ysy 1 год назад
Родитель
Сommit
189b1de257
2 измененных файлов с 48 добавлено и 30 удалено
  1. 14 0
      src/api/codeManagement/index.js
  2. 34 30
      src/views/material/product/detail.vue

+ 14 - 0
src/api/codeManagement/index.js

@@ -67,3 +67,17 @@ export async function rootCategoryCode (rootCategoryLevelId) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+
+
+// 动态表头
+export async function fieldModel(params) {
+  const res = await request.get(
+    `/main/fieldmodel/list`, { params }
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 34 - 30
src/views/material/product/detail.vue

@@ -48,7 +48,7 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="图号/件号" prop="partNumber">
+            <el-form-item label="图号/件号" prop="imgCode">
               <el-input v-model="form.imgCode" />
             </el-form-item>
           </el-col>
@@ -176,24 +176,7 @@
               </div>
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="8">
-            <el-form-item label="所属部门">
-              <deptSelect
-                v-model="form.chargeGroupId"
-                @changeGroup="searchDeptNodeClick"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="负责人">
-              <personSelect
-                ref="directorRef"
-                v-model="form.chargeUserId"
-                @selfChange="handleDirectorChange"
-                :init="false"
-              />
-            </el-form-item>
-          </el-col> -->
+
           <el-col :span="8">
             <el-form-item label="级别">
               <template>
@@ -213,6 +196,17 @@
               </template>
             </el-form-item>
           </el-col>
+
+
+          <el-col :span="8" v-for="(f, idx) in fileList" :key="idx">
+            <el-form-item :label="f.label">
+              <template>
+                <div class="form-line">
+                  <el-input v-model="form.extField[f.prop]" />
+                </div>
+              </template>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
     </el-card>
@@ -271,7 +265,7 @@
   import linkMsg from './components/link-msg.vue';
   import { getDetails } from '@/api/classifyManage/itemInformation';
   import { getByCode } from '@/api/system/dictionary-data';
-  import { getCode, rootCategoryCode } from '@/api/codeManagement';
+  import { getCode, rootCategoryCode, fieldModel } from '@/api/codeManagement';
 
   import { addMaterial } from '@/api/material/list.js';
   import { deepClone } from '@/utils/index';
@@ -321,8 +315,14 @@
         form: {
           categoryLevelGroupName: '',
           categoryLevelName: '',
-          isConsumable: 1
+          isConsumable: 1,
+
+          extField: {
+
+          }
         },
+
+       
         remarkform: {
           remarkAttach: []
         },
@@ -339,6 +339,8 @@
         categoryLevelPathId: null,
 
         dictList: [],
+
+        fileList: [],
         // 表单验证规则
         rules: {
           categoryLevelGroupName: [
@@ -376,6 +378,7 @@
     },
 
     async created() {
+      this.getFieldModel();
       this.status = this.$route.query.status;
 
       if (this.$route.query.id) {
@@ -402,7 +405,6 @@
 
         this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
         this.judgeSet(info);
-        // this.searchDeptNodeClick(this.form.chargeDeptId);
 
         if (this.status == 1) {
           rootCategoryCode(this.categoryLevelPathId).then((res) => {
@@ -450,16 +452,18 @@
           this.categoryWms = info.categoryWms;
         }
       },
-      // 选择所属部门
-      searchDeptNodeClick(id, info) {
-        // 根据部门获取人员
-        const params = { executeGroupId: id ? id : '' };
-        this.$nextTick(() => {
-          this.$refs.directorRef.getList(params);
+
+      getFieldModel() {
+        fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+
+          this.fileList = res;
+
+          this.fileList.forEach((f) => {
+            this.$set(this.form.extField,  f.prop,  ''); // 初始化动态模型属性
+          });
         });
       },
-      //选择负责人
-      handleDirectorChange(id, info) {},
+
       // 确定分类
       async confirmCategory(node, title, PathInfo, ruleCode) {
         if (this.status != 0) {