ysy 2 лет назад
Родитель
Сommit
6e672544f5

+ 1 - 1
src/components/material/index.vue

@@ -133,7 +133,7 @@ export default {
                 this.$message.error('请至少选择一条数据');
                 return;
             }
-            this.$emit('chooseModal', this.selection, this.current)
+            this.$emit('chooseModal', this.selection, this.id)
             this.handleClose()
         },
     }

+ 36 - 49
src/views/material/product/components/MaterialModal.vue

@@ -164,67 +164,36 @@ export default {
 
 
             },
-            // 提交状态
-            loading: false,
 
 
-            removeList: [],
-
-            // 表格列配置
             columns: [
+
                 {
                     prop: 'code',
-                    label: '参数编码',
-                    showOverflowTooltip: true,
-                    align: 'center',
-                    minWidth: 110
+                    label: '编码'
                 },
                 {
                     prop: 'name',
-                    label: '参数名称',
-                    showOverflowTooltip: true,
-                    align: 'center',
-                    minWidth: 110
+                    label: '名称',
+                    showOverflowTooltip: true
                 },
                 {
-                    align: 'center',
-                    prop: 'description',
-                    label: '文本描述',
-                    showOverflowTooltip: true,
-                    minWidth: 110
+                    prop: 'brandNum',
+                    label: '牌号'
                 },
-
                 {
-                    prop: 'maxValue',
-                    slot: 'maxValue',
-                    label: '参数上限',
-                    align: 'center',
-
+                    prop: 'modelType',
+                    label: '型号'
                 },
                 {
-                    prop: 'minValue',
-                    slot: 'minValue',
-                    label: '参数下限',
-                    align: 'center',
-
+                    prop: 'measuringUnit',
+                    label: '计量单位'
                 },
                 {
-                    prop: 'defaultValue',
-                    slot: 'defaultValue',
-                    label: '默认值',
-                    align: 'center',
-
+                    prop: 'packingUnit',
+                    label: '包装单位'
                 },
 
-                {
-                    prop: 'unitName',
-                    slot: 'unitName',
-                    label: '参数单位',
-                    align: 'center',
-                    showOverflowTooltip: true
-                },
-
-
                 {
                     columnKey: 'action',
                     label: '操作',
@@ -234,8 +203,18 @@ export default {
                     slot: 'action',
                     showOverflowTooltip: true
                 }
+
             ],
 
+
+            // 提交状态
+            loading: false,
+
+
+            removeList: [],
+
+            tableData: []
+
         };
     },
     computed: {
@@ -250,14 +229,26 @@ export default {
 
 
         openParam() {
+            this.tableData = this.$refs.table.getData()
             this.$refs.materiaRef.open(this.tableData, '选择物料', '1')
         },
 
-        determineChoose(title, row) {
-
+        chooseModal(data) {
+            this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
 
         },
 
+        
+    /* 删除 */
+    remove(row) {
+      const data = this.$refs.table.getData() ?? [];
+      if (row.id) {
+        this.removeList.push(row.id);
+        this.$refs.table.setData(data.filter((d) => d.id !== row.id));
+      }
+
+     
+    },
 
 
         /* 表格数据源 */
@@ -278,8 +269,6 @@ export default {
 
 
 
-
-
             });
         },
         /* 更新visible */
@@ -294,9 +283,7 @@ export default {
         async visible(visible) {
             if (visible) {
 
-
                 if (this.data) {
-                    console.log(this.data)
 
                     this.$util.assignObject(this.form, {
                         ...this.data