ysy пре 1 година
родитељ
комит
6859eb9de7

+ 40 - 11
src/views/material/product/components/index-data.vue

@@ -3,7 +3,7 @@
     <!-- 数据表格 -->
     <ele-pro-table
       ref="table"
-      :columns="columns"
+      :columns="newColumns"
       :datasource="datasource"
       :need-page="true"
       :selection.sync="selection"
@@ -222,7 +222,7 @@
   import goodsAllocation from './goodsAllocation.vue';
   import aridRegion from './aridRegion';
   import importDialog from '@/components/upload/import-dialog.vue';
-
+  import {  fieldModel } from '@/api/codeManagement';
   export default {
     components: {
       importDialog,
@@ -337,17 +337,11 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 220,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right'
-          }
+     
         ],
 
+        newColumns: [],
+
         // 表格选中数据
         selection: [],
         // 是否显示编辑弹窗
@@ -364,6 +358,11 @@
       };
     },
 
+
+    created() {
+      this.getFieldModel();
+    },
+
     methods: {
       toBomManager(row) {
         this.$router.push({
@@ -422,6 +421,36 @@
           categoryLevelId: this.currentId
         });
       },
+
+      getFieldModel() {
+        fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          const privateColumn = [
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+          ];
+
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+
+          this.newColumns = [...this.columns, ...newRes, ...privateColumn];
+
+          this.$forceUpdate();
+        });
+      },
+
       /* 显示编辑 */
       openEdit(row, status) {
         this.$router.push({

+ 8 - 18
src/views/material/product/detail.vue

@@ -86,11 +86,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="批准文号" prop="approvalNumber">
-              <el-input v-model="form.approvalNumber" />
-            </el-form-item>
-          </el-col>
+
           <el-col :span="8">
             <el-form-item label="牌号" prop="brandNum">
               <el-input v-model="form.brandNum" />
@@ -108,12 +104,6 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="8">
-            <el-form-item label="包装规格" prop="packingSpecification">
-              <el-input v-model="form.packingSpecification" />
-            </el-form-item>
-          </el-col>
-
           <el-col :span="8">
             <el-form-item label="计量单位" prop="measuringUnit">
               <DictSelection
@@ -161,6 +151,9 @@
               </div>
             </el-form-item>
           </el-col>
+
+ 
+
           <el-col :span="8">
             <el-form-item label="毛重">
               <div class="form-line">
@@ -197,7 +190,6 @@
             </el-form-item>
           </el-col>
 
-
           <el-col :span="8" v-for="(f, idx) in fileList" :key="idx">
             <el-form-item :label="f.label">
               <template>
@@ -207,6 +199,8 @@
               </template>
             </el-form-item>
           </el-col>
+
+  
         </el-row>
       </el-form>
     </el-card>
@@ -317,12 +311,9 @@
           categoryLevelName: '',
           isConsumable: 1,
 
-          extField: {
-
-          }
+          extField: {}
         },
 
-       
         remarkform: {
           remarkAttach: []
         },
@@ -455,11 +446,10 @@
 
       getFieldModel() {
         fieldModel({ fieldModel: 't_main_category' }).then((res) => {
-
           this.fileList = res;
 
           this.fileList.forEach((f) => {
-            this.$set(this.form.extField,  f.prop,  ''); // 初始化动态模型属性
+            this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
           });
         });
       },