|
@@ -1,37 +1,16 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <el-dialog
|
|
|
|
|
- :title="title"
|
|
|
|
|
- :visible.sync="visible"
|
|
|
|
|
- :before-close="handleClose"
|
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
|
- :close-on-press-escape="false"
|
|
|
|
|
- append-to-body
|
|
|
|
|
- width="80%"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
|
|
|
|
|
+ :close-on-press-escape="false" append-to-body width="70%">
|
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
|
<ProductSearch @search="reload" />
|
|
<ProductSearch @search="reload" />
|
|
|
- <ele-split-layout
|
|
|
|
|
- width="244px"
|
|
|
|
|
- allow-collapse
|
|
|
|
|
- :right-style="{ overflow: 'hidden' }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
|
|
|
<div class="ele-border-lighter split-layout-right-content">
|
|
<div class="ele-border-lighter split-layout-right-content">
|
|
|
- <AssetTree
|
|
|
|
|
- ref="assetTreeRef"
|
|
|
|
|
- :id="categoryLevelId"
|
|
|
|
|
- @handleNodeClick="handleNodeClick"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <AssetTree ref="assetTreeRef" :id="categoryLevelId" @handleNodeClick="handleNodeClick" />
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
|
<template v-slot:content>
|
|
<template v-slot:content>
|
|
|
- <ele-pro-table
|
|
|
|
|
- ref="table"
|
|
|
|
|
- :columns="columns"
|
|
|
|
|
- :datasource="datasource"
|
|
|
|
|
- height="calc(100vh - 350px)"
|
|
|
|
|
- class="dict-table"
|
|
|
|
|
- @cell-click="cellClick"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
|
|
|
|
|
+ class="dict-table" @cell-click="cellClick">
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
|
<el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
|
|
<el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
|
|
@@ -48,15 +27,15 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import AssetTree from '@/components/AssetTree';
|
|
|
|
|
- import ProductSearch from './product-search.vue'
|
|
|
|
|
- import { getMaterialList } from '@/api/material/manage.js';
|
|
|
|
|
|
|
+import AssetTree from '@/components/AssetTree';
|
|
|
|
|
+import ProductSearch from './product-search.vue'
|
|
|
|
|
+import { getMaterialList } from '@/api/material/manage.js';
|
|
|
export default {
|
|
export default {
|
|
|
- components: { AssetTree, ProductSearch },
|
|
|
|
|
- data () {
|
|
|
|
|
|
|
+ components: { AssetTree, ProductSearch },
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 表格列配置
|
|
// 表格列配置
|
|
|
columns: [
|
|
columns: [
|
|
|
{
|
|
{
|
|
@@ -81,59 +60,59 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
{
|
|
{
|
|
|
- prop: 'modelType',
|
|
|
|
|
- label: '型号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'specification',
|
|
|
|
|
- label: '规格',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'measuringUnit',
|
|
|
|
|
- label: '计量单位',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 90
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'weightUnit',
|
|
|
|
|
- label: '重量单位',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 90
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'roughWeight',
|
|
|
|
|
- label: '毛重',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 90
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'netWeight',
|
|
|
|
|
- label: '净重',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 90
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'packingUnit',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- label: '包装单位',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'categoryLevelPath',
|
|
|
|
|
- label: '分类',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
|
|
+ prop: 'modelType',
|
|
|
|
|
+ label: '型号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'specification',
|
|
|
|
|
+ label: '规格',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'measuringUnit',
|
|
|
|
|
+ label: '计量单位',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 90
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'weightUnit',
|
|
|
|
|
+ label: '重量单位',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 90
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'roughWeight',
|
|
|
|
|
+ label: '毛重',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 90
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'netWeight',
|
|
|
|
|
+ label: '净重',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 90
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'packingUnit',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ label: '包装单位',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'categoryLevelPath',
|
|
|
|
|
+ label: '分类',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
action: 'action',
|
|
action: 'action',
|
|
|
slot: 'action',
|
|
slot: 'action',
|
|
@@ -143,7 +122,7 @@ export default {
|
|
|
],
|
|
],
|
|
|
title: null,
|
|
title: null,
|
|
|
categoryLevelId: null,
|
|
categoryLevelId: null,
|
|
|
- radio:null
|
|
|
|
|
|
|
+ radio: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -152,7 +131,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/* 表格数据源 */
|
|
/* 表格数据源 */
|
|
|
- datasource ({ page, where, limit }) {
|
|
|
|
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
return getMaterialList({
|
|
return getMaterialList({
|
|
|
...where,
|
|
...where,
|
|
|
pageNum: page,
|
|
pageNum: page,
|
|
@@ -161,60 +140,60 @@ export default {
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- handleNodeClick (data) {
|
|
|
|
|
|
|
+ handleNodeClick(data) {
|
|
|
this.categoryLevelId = data.id;
|
|
this.categoryLevelId = data.id;
|
|
|
this.reload();
|
|
this.reload();
|
|
|
},
|
|
},
|
|
|
/* 刷新表格 */
|
|
/* 刷新表格 */
|
|
|
- reload () {
|
|
|
|
|
|
|
+ reload() {
|
|
|
this.$refs.table.reload();
|
|
this.$refs.table.reload();
|
|
|
},
|
|
},
|
|
|
- open(item, title, categoryLevelId){
|
|
|
|
|
- if(item){
|
|
|
|
|
|
|
+ open(item, title, categoryLevelId) {
|
|
|
|
|
+ if (item) {
|
|
|
this.title = title
|
|
this.title = title
|
|
|
this.categoryLevelId = categoryLevelId
|
|
this.categoryLevelId = categoryLevelId
|
|
|
|
|
|
|
|
- if(title == '选择产品') {
|
|
|
|
|
|
|
+ if (title == '选择产品') {
|
|
|
this.current = {
|
|
this.current = {
|
|
|
- id:item.categoryId,
|
|
|
|
|
- name: item.categoryName,
|
|
|
|
|
- code:item.categoryCode
|
|
|
|
|
- }
|
|
|
|
|
- this.radio = item.categoryId
|
|
|
|
|
-
|
|
|
|
|
- } else if(title == '选择舟皿') {
|
|
|
|
|
|
|
+ id: item.categoryId,
|
|
|
|
|
+ name: item.categoryName,
|
|
|
|
|
+ code: item.categoryCode
|
|
|
|
|
+ }
|
|
|
|
|
+ this.radio = item.categoryId
|
|
|
|
|
+
|
|
|
|
|
+ } else if (title == '选择舟皿') {
|
|
|
this.current = {
|
|
this.current = {
|
|
|
- id:item.categoryId,
|
|
|
|
|
- name: item.categoryName,
|
|
|
|
|
- code:item.categoryCode
|
|
|
|
|
- }
|
|
|
|
|
- this.radio = item.categoryId
|
|
|
|
|
|
|
+ id: item.categoryId,
|
|
|
|
|
+ name: item.categoryName,
|
|
|
|
|
+ code: item.categoryCode
|
|
|
|
|
+ }
|
|
|
|
|
+ this.radio = item.categoryId
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
this.visible = true
|
|
this.visible = true
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 单击获取id
|
|
// 单击获取id
|
|
|
- cellClick (row) {
|
|
|
|
|
- this.current = row
|
|
|
|
|
- this.radio = row.id
|
|
|
|
|
|
|
+ cellClick(row) {
|
|
|
|
|
+ this.current = row
|
|
|
|
|
+ this.radio = row.id
|
|
|
},
|
|
},
|
|
|
- handleClose () {
|
|
|
|
|
|
|
+ handleClose() {
|
|
|
this.visible = false
|
|
this.visible = false
|
|
|
this.current = null
|
|
this.current = null
|
|
|
this.radio = ''
|
|
this.radio = ''
|
|
|
},
|
|
},
|
|
|
- selected(){
|
|
|
|
|
- if(!this.current){
|
|
|
|
|
- return this.$message.warning('请选择工作中心')
|
|
|
|
|
- }
|
|
|
|
|
- this.$emit('changeProduct', this.title, this.current)
|
|
|
|
|
- this.handleClose()
|
|
|
|
|
|
|
+ selected() {
|
|
|
|
|
+ if (!this.current) {
|
|
|
|
|
+ return this.$message.warning('请选择工作中心')
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$emit('changeProduct', this.title, this.current)
|
|
|
|
|
+ this.handleClose()
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -228,21 +207,26 @@ export default {
|
|
|
height: 500px;
|
|
height: 500px;
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.table_col {
|
|
.table_col {
|
|
|
padding-left: 10px;
|
|
padding-left: 10px;
|
|
|
|
|
+
|
|
|
::v-deep .el-table th.el-table__cell {
|
|
::v-deep .el-table th.el-table__cell {
|
|
|
background: #f2f2f2;
|
|
background: #f2f2f2;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.pagination {
|
|
.pagination {
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
padding: 10px 0;
|
|
padding: 10px 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.btns {
|
|
.btns {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
padding: 10px 0;
|
|
padding: 10px 0;
|
|
|
}
|
|
}
|
|
|
-.topsearch{
|
|
|
|
|
- margin-bottom:15px;
|
|
|
|
|
|
|
+
|
|
|
|
|
+.topsearch {
|
|
|
|
|
+ margin-bottom: 15px;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|