695593266@qq.com 11 месяцев назад
Родитель
Сommit
ccbead4254

+ 15 - 7
src/api/material/BOM.js

@@ -124,7 +124,7 @@ export async function getBomTreeList(params) {
 export async function getBomGetById(id) {
   const res = await request.get(`/main/bomCategory/getById/${id}`);
   if (res.data.code == 0) {
-    console.log(res.data,'+++++++++++++++++++++++');
+    console.log(res.data, '+++++++++++++++++++++++');
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
@@ -160,16 +160,15 @@ export async function deleteBomTreeList(data) {
 // 保存BOM树节点
 export async function updateBatchBOM(data) {
   const res = await request.post(`/main/bomCategory/updateBatchBOM`, data);
-  console.log(res, "res111111111111111");
-  if (res&&res.data.code == 0) {
+  console.log(res, 'res111111111111111');
+  if (res && res.data.code == 0) {
     return res.data;
-  }else{
-     Message.error({
-      message:res.data.message
+  } else {
+    Message.error({
+      message: res.data.message
     });
     return false;
   }
- 
 }
 
 // 获取产品BOM列表
@@ -419,3 +418,12 @@ export async function sourceBomVersion(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//明细表
+export async function getDetailList(data) {
+  const res = await request.post(`/main/bomCategory/importByBOMDetail`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 16 - 9
src/api/material/file.js

@@ -12,18 +12,25 @@ export async function getDocTreeListAPI(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 /**
-* 查询文件数据
-* @data data
-*/
+ * 查询文件数据
+ * @data data
+ */
+// export async function filePageAPI(data) {
+//   if (!data.lcyStatus) {
+//     return true
+//   }
+//   const res = await request.post('/fm/file/page', data);
+//   if (res.data.code == 0) {
+//     return res.data.data;
+//   }
+//   return Promise.reject(new Error(res.data.message));
+// }
+
 export async function filePageAPI(data) {
-  if (!data.lcyStatus) {
-    return true
-  }
-  const res = await request.post('/fm/file/page', data);
+  const res = await request.post('/fm/file/queryIds', data);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 41 - 37
src/components/addDoc/browse.vue

@@ -18,44 +18,48 @@
 </template>
 
 <script>
-import { getFileType } from './util.js';
+  import { getFileType } from './util.js';
 
-export default {
-  data() {
-    return {
-      fileUrl: '',
-      showEditFlag: false
-    };
-  },
-
-  methods: {
-    open(row){
-      this.showEditFlag=true
-      this.setFileUrl(row)
+  export default {
+    data() {
+      return {
+        fileUrl: '',
+        showEditFlag: false
+      };
     },
-    setFileUrl(row) {
-      let file = row.storagePath[0];
-      let fileNames=file.storePath.split('/')
-      let url = window.location.origin+'/api/main/file/getFile?objectName='+file.storePath+'&fullfilename='+fileNames[fileNames.length-1]
-      this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
-      
-      // const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
-      // this.fileType = getFileType().includes(fileExt) ? 2 : 1;
-      // if (this.fileType == 2) {
-      //   this.fileUrl =
-      //     '/fm/' +
-      //     (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
-      //     '/view.html?url=' +
-      //     sessionStorage.filePath +
-      //     '/' +
-      //     row.outputNdsFiles;
-      // } else {
-      //   this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
-      //   // 'http://192.168.1.107:18082/kkfile/onlinePreview?url=' + btoa(url);
-      // }
+
+    methods: {
+      open(row) {
+        this.showEditFlag = true;
+        this.setFileUrl(row);
+      },
+      setFileUrl(row) {
+        let file = row.storagePath[0];
+        let fileNames = file.storePath.split('/');
+        let url =
+          window.location.origin +
+          '/api/main/file/getFile?objectName=' +
+          file.storePath +
+          '&fullfilename=' +
+          fileNames[fileNames.length - 1];
+        this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+
+        // const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
+        // this.fileType = getFileType().includes(fileExt) ? 2 : 1;
+        // if (this.fileType == 2) {
+        //   this.fileUrl =
+        //     '/fm/' +
+        //     (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
+        //     '/view.html?url=' +
+        //     sessionStorage.filePath +
+        //     '/' +
+        //     row.outputNdsFiles;
+        // } else {
+        //   this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+        //   // 'http://192.168.1.107:18082/kkfile/onlinePreview?url=' + btoa(url);
+        // }
+      }
     }
-  }
-};
+  };
 </script>
-<style scoped lang="scss">
-</style>
+<style scoped lang="scss"></style>

+ 156 - 160
src/components/addDoc/file-table-listTemplate.vue

@@ -27,172 +27,168 @@
 </template>
 
 <script>
-import { filePageAPI } from './api';
-import browse from './browse.vue';
+  import { filePageAPI } from './api';
+  import browse from './browse.vue';
 
-export default {
-  components: { browse },
-  props: {
-    // 上级
-    parentData: {
-      type: Object,
-      default: () => {}
+  export default {
+    components: { browse },
+    props: {
+      // 上级
+      parentData: {
+        type: Object,
+        default: () => {}
+      },
+
+      disabledTableList: {
+        //已选择列表
+        default: () => []
+      }
     },
 
-    disabledTableList: {
-      //已选择列表
-      default: () => []
-    }
-  },
+    data() {
+      return {
+        selection: [],
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            selectable: (row, index) => {
+              return !this.disabledTableList
+                .map((item) => item.id)
+                .includes(row.id);
+            }
+          },
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            fixed: 'left',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
 
-  data() {
-    return {
-      selection: [],
-      columns: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          selectable: (row, index) => {
-            return !this.disabledTableList
-              .map((item) => item.id)
-              .includes(row.id);
-          }
-        },
-        {
-          label: '编码',
-          prop: 'code',
-          width: 180,
-          align: 'center',
-          fixed: 'left',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'name',
-          label: '文档名称',
-          align: 'center',
-          slot: 'name',
-          showOverflowTooltip: true,
-          minWidth: 200
-        },
-        {
-          prop: 'storagePath',
-          label: '文件名称',
-          align: 'center',
-
-          showOverflowTooltip: true,
-          minWidth: 200,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue[0]?.name;
-          }
-        },
-        {
-          prop: 'version',
-          label: '版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'checkOutUserName',
-          label: '检出人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'checkOutStatus',
-          label: '检出状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue == 1 ? '已检出' : '';
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'checkOutUserName',
+            label: '检出人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'checkOutStatus',
+            label: '检出状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '已检出' : '';
+            }
+          },
+          {
+            prop: 'checkOutTime',
+            label: '检出时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            prop: 'updateUserName',
+            label: '修改人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'updateTime',
+            label: '修改时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
           }
-        },
-        {
-          prop: 'checkOutTime',
-          label: '检出时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160
-        },
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
-          }
-        },
-        {
-          prop: 'updateUserName',
-          label: '修改人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'updateTime',
-          label: '修改时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160
-        },
-        {
-          prop: 'sizeUnit',
-          label: '文档大小',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true,
-          fixed: 'right'
-        }
-      ]
-    };
-  },
-  created() {},
-
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return filePageAPI({
-        ...where,
-        ...order,
-        pageNum: page,
-        size: limit,
-        directoryId: this.parentData?.id
-      });
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ pageNum: 1, where: where });
+        ]
+      };
     },
+    created() {},
 
-    browseOpen(row) {
-      this.$refs.browseRef.open(row);
-    },
-    getTableList() {
-      return JSON.parse(JSON.stringify(this.selection));
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return filePageAPI({
+          ids: "'" + this.parentData?.id + "'"
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      browseOpen(row) {
+        this.$refs.browseRef.open(row);
+      },
+      getTableList() {
+        return JSON.parse(JSON.stringify(this.selection));
+      }
     }
-  }
-};
+  };
 </script>

+ 128 - 128
src/components/addDoc/main.vue

@@ -63,7 +63,7 @@
       custom-class="ele-dialog-form"
       append-to-body
       :maxable="true"
-    :resizable="true"
+      :resizable="true"
     >
       <doc_template
         :disabledTableList="tableList"
@@ -79,140 +79,140 @@
 </template>
 
 <script>
-import doc_template from './doc_template.vue';
-import fileEdit from './file-edit.vue';
-import browse from './browse.vue';
-import { queryIds } from './api';
+  import doc_template from './doc_template.vue';
+  import fileEdit from './file-edit.vue';
+  import browse from './browse.vue';
+  import { queryIds } from './api';
 
-export default {
-  components: { doc_template, fileEdit, browse },
+  export default {
+    components: { doc_template, fileEdit, browse },
 
-  data() {
-    return {
-      fileId: [],
-      fileShow: false,
-      showEditFlag: false,
-      tableList: [],
-      type: 'add',
-      columns: [
-        {
-          label: '编码',
-          prop: 'code',
-          width: 180,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'name',
-          label: '文档名称',
-          align: 'center',
-          slot: 'name',
-          showOverflowTooltip: true,
-          minWidth: 200
-        },
-        {
-          prop: 'storagePath',
-          label: '文件名称',
-          align: 'center',
+    data() {
+      return {
+        fileId: [],
+        fileShow: false,
+        showEditFlag: false,
+        tableList: [],
+        type: 'add',
+        columns: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
 
-          showOverflowTooltip: true,
-          minWidth: 200,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue && cellValue[0]?.name;
-          }
-        },
-        {
-          prop: 'version',
-          label: '版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue && cellValue[0]?.name;
+            }
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
 
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160
-        },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
 
-        {
-          prop: 'sizeUnit',
-          label: '文档大小',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  created() {},
-
-  methods: {
-    open(fileId, type) {
-      //查看详情:view 新增:add
-      this.showEditFlag = true;
-      this.fileId = fileId || [];
-      if (type) {
-        this.type = type;
-      }
-      this.init();
-    },
-    fileEditOpen() {
-      this.$refs.fileEditRef.open();
-    },
-    remove(row) {
-      this.tableList = this.tableList.filter((item) => item.code != row.code);
-      this.fileId = this.tableList.map((item) => item.id);
-    },
-    async init() {
-      if (this.fileId.length > 0) {
-        this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
-      } else {
-        this.tableList = [];
-      }
-    },
-    done(id) {
-      this.fileId.push(...id);
-      this.init();
-    },
-    browseOpen(row) {
-      this.$refs.browseRef.open(row);
-    },
-    addFile() {
-      this.$emit(
-        'success',
-        this.tableList.map((item) => item.id)
-      );
-      this.showEditFlag = false;
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
-    addTemplate() {
-      let list = this.$refs.doc_templateRef.getTableList();
-      this.fileShow = false;
-      if (list.length == 0) {
-        this.$message.error('请选择一条数据');
-        return;
+    created() {},
+
+    methods: {
+      open(fileId, type) {
+        //查看详情:view 新增:add
+        this.showEditFlag = true;
+        this.fileId = fileId || [];
+        if (type) {
+          this.type = type;
+        }
+        this.init();
+      },
+      fileEditOpen() {
+        this.$refs.fileEditRef.open();
+      },
+      remove(row) {
+        this.tableList = this.tableList.filter((item) => item.code != row.code);
+        this.fileId = this.tableList.map((item) => item.id);
+      },
+      async init() {
+        if (this.fileId.length > 0) {
+          this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
+        } else {
+          this.tableList = [];
+        }
+      },
+      done(id) {
+        this.fileId.push(...id);
+        this.init();
+      },
+      browseOpen(row) {
+        this.$refs.browseRef.open(row);
+      },
+      addFile() {
+        this.$emit(
+          'success',
+          this.tableList.map((item) => item.id)
+        );
+        this.showEditFlag = false;
+      },
+      addTemplate() {
+        let list = this.$refs.doc_templateRef.getTableList();
+        this.fileShow = false;
+        if (list.length == 0) {
+          this.$message.error('请选择一条数据');
+          return;
+        }
+        this.tableList.push(...list);
       }
-      this.tableList.push(...list);
     }
-  }
-};
+  };
 </script>

+ 2 - 2
src/store/modules/dict.js

@@ -23,7 +23,7 @@ const mutations = {
 
 const actions = {
   // 根据字典enumName请求字典 已获取的不做重复请求
-  async requestDict ({ commit, state }, enumName) {
+  async requestDict({ commit, state }, enumName) {
     const code = dictEnum[enumName];
 
     if (state[code]?.length) return state[code];
@@ -67,7 +67,7 @@ const actions = {
     return [];
   },
   // 更新字典
-  async reloadRequestDict ({ commit }, enumName) {
+  async reloadRequestDict({ commit }, enumName) {
     const code = dictEnum[enumName];
     const res = await getByCode(code);
     const isNumber = numberList.includes(code);

+ 814 - 744
src/views/material/BOMmanage/components/detailedList.vue

@@ -1,23 +1,49 @@
 <template>
   <div class="ele-body">
-
     <BOMSearch @search="reload" :statusOpt="statusOpt" />
-    <ele-pro-table ref="table" :key="tableKey" :columns="columns" :pagination="pagination"
-      :header-cell-style="headerCellStyle" :datasource="datasource" class="dict-table" tool-class="ele-toolbar-actions">
-
+    <ele-pro-table
+      ref="table"
+      :key="tableKey"
+      :columns="columns"
+      :pagination="pagination"
+      :header-cell-style="headerCellStyle"
+      :datasource="datasource"
+      class="dict-table"
+      tool-class="ele-toolbar-actions"
+    >
       <template v-slot:toolbar>
         <div class="toolbar_box">
-         
-          <div v-if="attributeData.status != 1&&attributeData.approvalStatus != 1">
-            <el-button type="primary" size="mini" @click="handleAdd" v-if="!isWt">新增</el-button>
-            <el-button type="primary" size="mini" @click="handleSave" v-if="!isWt">保存</el-button>
+          <div
+            v-if="
+              attributeData.status != 1 && attributeData.approvalStatus != 1
+            "
+          >
+            <el-button
+              type="primary"
+              size="mini"
+              @click="handleAdd"
+              v-if="!isWt"
+              >新增</el-button
+            >
+            <el-button
+              type="primary"
+              size="mini"
+              @click="handleSave"
+              v-if="!isWt"
+              >保存</el-button
+            >
           </div>
-          <div class="toolbar_box_right"><span>基本数量</span>
-            <el-input placeholder="请输入" v-model.number="attributeData.baseCount">
+          <div class="toolbar_box_right"
+            ><span>基本数量</span>
+            <el-input
+              placeholder="请输入"
+              v-model.number="attributeData.baseCount"
+            >
               <template #append>
                 {{
                   attributeData.category && attributeData.category.measuringUnit
-                }}</template>
+                }}</template
+              >
             </el-input>
           </div>
         </div>
@@ -27,94 +53,164 @@
         <div>
           <span class="is-required">{{ column.label }}</span>
         </div>
-
       </template>
 
       <template v-slot:dosage="{ row }">
-        <el-input v-model="row.dosage" placeholder="请输入" size="mini" style="width: 68px">
+        <el-input
+          v-model="row.dosage"
+          placeholder="请输入"
+          size="mini"
+          style="width: 68px"
+        >
         </el-input>
       </template>
 
       <template v-slot:versions="{ row }"> V{{ row.versions }}.0 </template>
 
-
-      <template v-slot:rootCategoryLevelId="{ row }">{{ rootCategoryLevelIdText(row.rootCategoryLevelId) }} </template>
-
+      <template v-slot:rootCategoryLevelId="{ row }"
+        >{{ rootCategoryLevelIdText(row.rootCategoryLevelId) }}
+      </template>
 
       <template v-slot:produceType="{ row }">
-
-        <el-select v-model="row.produceType" filterable multiple disabled class="ele-block" size="mini">
-          <el-option v-for="item in produceTypeList" :key="item.value" :value="item.value" :label="item.label"></el-option>
+        <el-select
+          v-model="row.produceType"
+          filterable
+          multiple
+          disabled
+          class="ele-block"
+          size="mini"
+        >
+          <el-option
+            v-for="item in produceTypeList"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          ></el-option>
         </el-select>
       </template>
 
       <template v-slot:attributeType="{ row }">
-        <el-select v-model="row.attributeType" filterable disabled class="ele-block" size="mini">
-          <el-option v-for="item in attributeList" :key="item.value" :value="item.value"
-            :label="item.label"></el-option>
+        <el-select
+          v-model="row.attributeType"
+          filterable
+          disabled
+          class="ele-block"
+          size="mini"
+        >
+          <el-option
+            v-for="item in attributeList"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          ></el-option>
         </el-select>
       </template>
 
       <template v-slot:componentAttribute="{ row }">
         <div>
-          <el-select v-model="row.componentAttribute" filterable multiple disabled class="ele-block" size="mini">
-            <el-option v-for="item in sxtList" :key="item.value" :value="item.value" :label="item.label"></el-option>
+          <el-select
+            v-model="row.componentAttribute"
+            filterable
+            multiple
+            disabled
+            class="ele-block"
+            size="mini"
+          >
+            <el-option
+              v-for="item in sxtList"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            ></el-option>
           </el-select>
         </div>
-
       </template>
 
       <template v-slot:resourceBomVersion="{ row }">
         <div v-if="!row.id">
-          <el-select v-model="row.resourceBomVersion" disabled class="ele-block" size="mini"
-            @change="resourceBomVersionFn($event, row)">
-
-            <el-option v-for="item in row.resourceBomVersionList" :key="item.versions" :value="item.versions"
-              :label="'V' + item.versions + '.0'"></el-option>
+          <el-select
+            v-model="row.resourceBomVersion"
+            disabled
+            class="ele-block"
+            size="mini"
+            @change="resourceBomVersionFn($event, row)"
+          >
+            <el-option
+              v-for="item in row.resourceBomVersionList"
+              :key="item.versions"
+              :value="item.versions"
+              :label="'V' + item.versions + '.0'"
+            ></el-option>
           </el-select>
         </div>
 
         <div v-else v-if="row.resourceBomVersion">
           {{ 'V' + row.resourceBomVersion + '.0' }}
         </div>
-
       </template>
 
-
       <template v-slot:materielDesignation="{ row }">
-        <el-input v-model="row.materielDesignation" placeholder="请输入物料代号" size="mini" style="width: 120px">
+        <el-input
+          v-model="row.materielDesignation"
+          placeholder="请输入物料代号"
+          size="mini"
+          style="width: 120px"
+        >
         </el-input>
       </template>
 
       <template v-slot:supplierId="{ row }">
-        <el-select v-model="row.supplierId" size="mini" clearable class="ele-block" filterable placeholder="请选择供应商">
-          <el-option v-for="(item, index) in gysList" :key="item.id + index" :value="item.id"
-            :label="item.name"></el-option>
+        <el-select
+          v-model="row.supplierId"
+          size="mini"
+          clearable
+          class="ele-block"
+          filterable
+          placeholder="请选择供应商"
+        >
+          <el-option
+            v-for="(item, index) in gysList"
+            :key="item.id + index"
+            :value="item.id"
+            :label="item.name"
+          ></el-option>
         </el-select>
       </template>
 
       <template v-slot:factories="{ row }">
-        <div style="display: flex;">
-          <el-input v-model="row.factories" disabled :value="row.factories" placeholder="请选择生产厂家" size="mini"
-            style="width: 120px">
+        <div style="display: flex">
+          <el-input
+            v-model="row.factories"
+            disabled
+            :value="row.factories"
+            placeholder="请选择生产厂家"
+            size="mini"
+            style="width: 120px"
+          >
           </el-input>
           <!--  -->
-          <el-button type="primary" @click="factoriesFn(row.code)">选择</el-button>
+          <el-button type="primary" @click="factoriesFn(row.code)"
+            >选择</el-button
+          >
           <!-- <el-select v-model="row.factories" size="mini" clearable class="ele-block" filterable placeholder="请选择生产厂家">
             <el-option v-for="(item, index) in sccjList" :key="item.id + index" :value="item.id"
               :label="item.name"></el-option>
           </el-select> -->
         </div>
 
-
         <!-- <el-input v-model="row.factories" placeholder="请输入生产厂家" size="mini" style="width: 120px">
         </el-input> -->
       </template>
 
       <!-- 表头工具栏 -->
       <template v-slot:action="{ row, $index }">
-        <el-link v-if="attributeData.status != 1&&!isWt" type="danger" :underline="false" icon="el-icon-delete"
-          @click="handleDel(row, $index)">
+        <el-link
+          v-if="attributeData.status != 1 && !isWt"
+          type="danger"
+          :underline="false"
+          icon="el-icon-delete"
+          @click="handleDel(row, $index)"
+        >
           删除
         </el-link>
       </template>
@@ -122,789 +218,763 @@
 
     <bomTreeDialog ref="bomTreeDialogRef" @reload="bomClose" />
 
-    <standardOutput ref="standardOutputRefs" @selection="chooseStandardList"></standardOutput>
+    <standardOutput
+      ref="standardOutputRefs"
+      @selection="chooseStandardList"
+    ></standardOutput>
 
-    <clientDialog ref="clientSelectionRef" @success="confirmSelection"></clientDialog>
+    <clientDialog
+      ref="clientSelectionRef"
+      @success="confirmSelection"
+    ></clientDialog>
   </div>
 </template>
 
 <script>
-import BOMSearch from './BOM-search.vue';
-import {
-  getBomPageCategoryId,
-  contactList,
-  deleteBomTreeList,
-  updateBatchBOM,
-  sourceBomVersion
-} from '@/api/material/BOM';
-
-import clientDialog from "./clientDialog.vue"
-
-import { getByCode } from '@/api/system/dictionary-data';
-
-import bomTreeDialog from './bomTreeDialog.vue';
-import { produceTypeList } from '@/enum/dict.js';
-
-import standardOutput from './standardOutput.vue';
-export default {
-  name: 'SystemDictionary',
-  components: { BOMSearch, bomTreeDialog, standardOutput, clientDialog },
-
-  data() {
-    return {
-      produceTypeList,
-      pagination: {
-        tableTotal: 0
-      },
-      // 表格列配置
-      columns: [
-        {
-          label: '序号',
-          columnKey: 'index',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'code',
-          label: 'BOM编码',
-          showOverflowTooltip: true,
-          width: 120
-        },
-        {
-          prop: 'categoryCode',
-          label: '物品编码',
-          showOverflowTooltip: true,
-          width: 120
-        },
-        {
-          prop: 'name',
-          label: '名称',
-          width: 150
-        },
-
-        {
-          prop: 'level',
-          label: '层级'
-        },
-
-        {
-          prop: 'brandNum',
-          label: '牌号'
-        },
-
-        {
-          prop: 'modelType',
-          label: '型号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'rootCategoryLevelId',
-          slot: 'rootCategoryLevelId',
-          label: '物品分类',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'dosage',
-          slot: 'dosage',
-          label: '用量',
-          width: 100,
-          headerSlot: "dosageHead"
-        },
-
-        {
-          prop: 'measuringUnit',
-          label: '计量单位',
-          showOverflowTooltip: true
-        },
-
-        {
-          prop: 'produceType',
-          slot: 'produceType',
-          label: '生产类型',
-          width: 260
-        },
-        {
-          prop: 'attributeType',
-          slot: 'attributeType',
-          label: '存货类型',
-          width: 260
-        },
-        {
-          prop: 'componentAttribute',
-          slot: 'componentAttribute',
-          label: '属性类型',
-          width: 260
-        },
-
-        {
-          prop: 'materielDesignation',
-          slot: 'materielDesignation',
-          label: '物料代号',
-          width: 150
-        },
-
-        {
-          prop: 'supplierId',
-          slot: 'supplierId',
-          label: '供应商',
-          width: 150
-        },
-
-        {
-          prop: 'factories',
-          slot: 'factories',
-          label: '生产厂家',
-          width: 180
-        },
-        {
-          prop: 'resourceBomVersion',
-          slot: 'resourceBomVersion',
-          label: '来源版本',
-          width: 180
-        },
-        {
-          prop: 'versions',
-          slot: 'versions',
-          label: '版本'
-        },
-
-        {
-          prop: 'status ',
-          label: '状态',
-          formatter: (row) => {
-            return this.statusOpt[+row.status];
+  import BOMSearch from './BOM-search.vue';
+  import {
+    getBomPageCategoryId,
+    contactList,
+    deleteBomTreeList,
+    updateBatchBOM,
+    sourceBomVersion
+  } from '@/api/material/BOM';
+
+  import clientDialog from './clientDialog.vue';
+
+  import { getByCode } from '@/api/system/dictionary-data';
+
+  import bomTreeDialog from './bomTreeDialog.vue';
+  import { produceTypeList } from '@/enum/dict.js';
+
+  import standardOutput from './standardOutput.vue';
+  export default {
+    name: 'SystemDictionary',
+    components: { BOMSearch, bomTreeDialog, standardOutput, clientDialog },
+
+    data() {
+      return {
+        produceTypeList,
+        pagination: {
+          tableTotal: 0
+        },
+        // 表格列配置
+        columns: [
+          {
+            label: '序号',
+            columnKey: 'index',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: 'BOM编码',
+            showOverflowTooltip: true,
+            width: 120
+          },
+          {
+            prop: 'categoryCode',
+            label: '物品编码',
+            showOverflowTooltip: true,
+            width: 120
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            width: 150
+          },
+
+          {
+            prop: 'level',
+            label: '层级'
+          },
+
+          {
+            prop: 'brandNum',
+            label: '牌号'
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'rootCategoryLevelId',
+            slot: 'rootCategoryLevelId',
+            label: '物品分类',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'dosage',
+            slot: 'dosage',
+            label: '用量',
+            width: 100,
+            headerSlot: 'dosageHead'
+          },
+
+          {
+            prop: 'measuringUnit',
+            label: '计量单位',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'produceType',
+            slot: 'produceType',
+            label: '生产类型',
+            width: 260
+          },
+          {
+            prop: 'attributeType',
+            slot: 'attributeType',
+            label: '存货类型',
+            width: 260
+          },
+          {
+            prop: 'componentAttribute',
+            slot: 'componentAttribute',
+            label: '属性类型',
+            width: 260
+          },
+
+          {
+            prop: 'materielDesignation',
+            slot: 'materielDesignation',
+            label: '物料代号',
+            width: 150
+          },
+
+          {
+            prop: 'supplierId',
+            slot: 'supplierId',
+            label: '供应商',
+            width: 150
+          },
+
+          {
+            prop: 'factories',
+            slot: 'factories',
+            label: '生产厂家',
+            width: 180
+          },
+          {
+            prop: 'resourceBomVersion',
+            slot: 'resourceBomVersion',
+            label: '来源版本',
+            width: 180
+          },
+          {
+            prop: 'versions',
+            slot: 'versions',
+            label: '版本'
+          },
+
+          {
+            prop: 'status ',
+            label: '状态',
+            formatter: (row) => {
+              return this.statusOpt[+row.status];
+            }
+          },
+
+          {
+            prop: 'createName',
+            label: '创建人',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '创建日期',
+            width: 160
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            fixed: 'right',
+            label: '操作',
+            width: 120
           }
-        },
-
-        {
-          prop: 'createName',
-          label: '创建人',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'createTime',
-          label: '创建日期',
-          width: 160
-        },
-        {
-          action: 'action',
-          slot: 'action',
-          fixed: 'right',
-          label: '操作',
-          width: 120
-        }
-      ],
-      statusOpt: {
-        '': '全部',
-        0: '草稿',
-        1: '已发布'
-      },
-      dictList: [
-        {
-          label: '加工',
-          value: 1
-        },
-
-        {
-          label: '装配',
-          value: 3
-        },
-      ],
-
-
-      attributeList: [
-        {
-          label: '总装',
-          value: 1
-        },
-        {
-          label: '部件',
-          value: 2
-        },
-        {
-          label: '零件',
-          value: 3
-        },
-        {
-          label: '原材料',
-          value: 4
-        }
-      ],
-
-      sxtList: [
-        {
-          label: '自制件',
-          value: 1
-        },
-        {
-          label: '采购件',
-          value: 2
-        },
-        {
-          label: '外协件',
-          value: 3
-        },
-        {
-          label: '受托件',
-          value: 4
-        }
-      ],
-
-
-      rootCategoryLevelIdList: [
-        {
-          label: '产品',
-          value: 9
-        },
-        {
-          label: '物料',
-          value: 1
-        },
-        {
-          label: '生产设备',
-          value: 4
-        },
-        {
-          label: '模具',
-          value: 5
-        },
-        {
-          label: '备品备件',
-          value: 6
-        },
-        {
-          label: '零部件',
-          value: 3
-        },
-        {
-          label: '舟皿',
-          value: 8
-        },
-        {
-          label: '消耗材料',
-          value: 10
-        },
-        {
-          label: '包装材料',
-          value: 13
-        },
-        {
-          label: '生产辅助设备',
-          value: 14
-        },
-        {
-          label: '仪表计量设备',
-          value: 15
-        },
-        {
-          label: '会计科目',
-          value: 23
-        },
-        {
-          label: '周转盘',
-          value: 26
-        },
-        {
-          label: '废品',
-          value: 28
-        },
-      
-      ],
-
-
-      isList: false,
-      isId: null,
-      tableKey: "",
-      list: [],//表格数据
-      listTow: [],
-      newList: [],
-      gysList: [],
-      sccjList: [],
-      newTreeId: null,
-      responsesList: [],
-      // dictList: []
-    };
-  },
-
-  created() {
-    // this.getDictList('productionType');
-    // this.getZeroPartPros('zeroPartPros');
-    this.getContactList();
-  },
-  mounted() { },
-
-  props: {
-    attributeData: {
-      type: Object,
-      default: {}
-    },
-    isWt:{
-      type: Boolean,
-      default: false
-    },
-    treeId: {
-      type: String,
-      default: ''
+        ],
+        statusOpt: {
+          '': '全部',
+          0: '草稿',
+          1: '已发布'
+        },
+        dictList: [
+          {
+            label: '加工',
+            value: 1
+          },
+
+          {
+            label: '装配',
+            value: 3
+          }
+        ],
+
+        attributeList: [
+          {
+            label: '总装',
+            value: 1
+          },
+          {
+            label: '部件',
+            value: 2
+          },
+          {
+            label: '零件',
+            value: 3
+          },
+          {
+            label: '原材料',
+            value: 4
+          }
+        ],
+
+        sxtList: [
+          {
+            label: '自制件',
+            value: 1
+          },
+          {
+            label: '采购件',
+            value: 2
+          },
+          {
+            label: '外协件',
+            value: 3
+          },
+          {
+            label: '受托件',
+            value: 4
+          }
+        ],
+
+        rootCategoryLevelIdList: [
+          {
+            label: '产品',
+            value: 9
+          },
+          {
+            label: '物料',
+            value: 1
+          },
+          {
+            label: '生产设备',
+            value: 4
+          },
+          {
+            label: '模具',
+            value: 5
+          },
+          {
+            label: '备品备件',
+            value: 6
+          },
+          {
+            label: '零部件',
+            value: 3
+          },
+          {
+            label: '舟皿',
+            value: 8
+          },
+          {
+            label: '消耗材料',
+            value: 10
+          },
+          {
+            label: '包装材料',
+            value: 13
+          },
+          {
+            label: '生产辅助设备',
+            value: 14
+          },
+          {
+            label: '仪表计量设备',
+            value: 15
+          },
+          {
+            label: '会计科目',
+            value: 23
+          },
+          {
+            label: '周转盘',
+            value: 26
+          },
+          {
+            label: '废品',
+            value: 28
+          }
+        ],
+
+        isList: false,
+        isId: null,
+        tableKey: '',
+        list: [], //表格数据
+        listTow: [],
+        newList: [],
+        gysList: [],
+        sccjList: [],
+        newTreeId: null,
+        responsesList: []
+        // dictList: []
+      };
     },
 
-    isTemp: {
-      type: Number,
-      default: 0
-    }
-  },
-
-  watch: {
-    treeId: {
-      handler(val) {
-        this.newTreeId = val;
-      },
-      deep: true,
-      immediate: true
+    created() {
+      // this.getDictList('productionType');
+      // this.getZeroPartPros('zeroPartPros');
+      this.getContactList();
     },
+    mounted() {},
 
-    "attributeData.id": {
-      handler(val) {
-        this.$nextTick(() => {
-          console.log(val,'66666666');
-          
-          this.reload();
-        });
+    props: {
+      attributeData: {
+        type: Object,
+        default: {}
       },
-      deep: true,
-      immediate: true
-    },
-    data: {
-      handler(val) {
-        console.log(val);
-        // this.$nextTick(() => {
-        //   this.reload();
-        // });
+      isWt: {
+        type: Boolean,
+        default: false
+      },
+      treeId: {
+        type: String,
+        default: ''
       },
-      deep: true,
-      immediate: true
-    },
-  },
-  // computed: {
-  //   processedItems() {
-  //     return this.list.map(item => {
-  //       // 处理逻辑
-  //       console.log(item);
-  //       // return processedItem;
-  //     });
-  //   }
-  // },
-
-
-  methods: {
-
-    rootCategoryLevelIdText(v) {
-      console.log(v,'111111');
-
-      if (v) {
-        let a = this.rootCategoryLevelIdList.find(item => item.value == v)
-        return a.label
-      }
-    },
-
-    factoriesFn(code) {
-      this.isId = code;
-      this.$refs.clientSelectionRef.open();
-    },
-    // 选择工厂
-    confirmSelection(obj) {
-      let list = this.$refs.table.getData();
-      list.map(v => {
-
-        if (v.code == this.isId) {
-          v.factories = obj.name;
-        }
-      });
-      console.log(list, 'list');
-      // arr.factories = obj.name;
-      this.$nextTick(() => {
-        this.list = [...list];
-        this.listTow = JSON.parse(JSON.stringify(this.list));
-
-
-        this.$refs.table.setData(this.list)
-        this.updateFn()
-        this.tableKey = Date.now();
-
-      });
-
-      this.$forceUpdate();
-    },
-
-    updateFn(list) {
-      this.isList = true;
-      this.reload();
-      setTimeout(() => {
-        this.isList = false;
-      }, 1000);
-    },
 
-    /* 表格数据源 */
-    datasource({ where, page, limit }) {
-      // let that = this;
-      // console.log(getBomPageCategoryId({
-      //   ...where,
-      //   pageNum: page,
-      //   size: limit,
-      //   id: this.attributeData.id,
-      //   bomType: this.attributeData.bomType
-      // }));
-
-      // return new Promise((resolve, reject) => {
-
-      //   getBomPageCategoryId({
-      //     ...where,
-      //     pageNum: page,
-      //     size: limit,
-      //     id: that.attributeData.id,
-      //     bomType: that.attributeData.bomType
-      //   }).then((res) => {
-      //     console.log(res, '111111111111');
-
-      //     if(res.list && res.list.length ){
-
-      //     const arrays = []
-      //     res.list.map((item) => {
-      //       arrays.push(item.categoryId);
-
-      //     });
-
-      //     that.getResourceBomVersionListFn(arrays).then(v => {
-      //       v.map(element => {
-      //         res.list.map((item2, i) => {
-      //           if (element.categoryId == item2.id) {
-      //             item2.resourceBomVersionList.push(element);
-      //           }
-      //           item2.resourceBomVersion = item2.resourceBomVersionList[0].versions;
-      //           item2.resourceBomId = item2.resourceBomVersionList[0].resourceBomId;
-      //           // item2.id ="";
-      //         })
-      //       })
-      //       this.$nextTick(() => {
-      //         resolve(res);
-      //       })
-      //     })
-      //   }
-      //   })
-      //     .catch((err) => {
-      //       reject(err);
-      //     });
-      // });
-
-      let data = getBomPageCategoryId({
-        ...where,
-        pageNum: page,
-        size: limit,
-        id: this.attributeData.id,
-        bomType: this.attributeData.bomType
-      });
-
-      if (this.isList) {
-        data = this.listTow;
+      isTemp: {
+        type: Number,
+        default: 0
       }
-
-      console.log(data, 'data');
-
-      return data;
     },
 
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ where });
-    },
+    watch: {
+      treeId: {
+        handler(val) {
+          this.newTreeId = val;
+        },
+        deep: true,
+        immediate: true
+      },
 
-    async getDictList(code) {
-      let { data: res } = await getByCode(code);
+      'attributeData.id': {
+        handler(val) {
+          this.$nextTick(() => {
+            console.log(val, '66666666');
 
-      this.dictList = res.map((item) => {
-        let values = Object.keys(item);
-        return {
-          value: Number(values[0]),
-          label: item[values[0]]
-        };
-      });
+            this.reload();
+          });
+        },
+        deep: true,
+        immediate: true
+      },
+      data: {
+        handler(val) {
+          console.log(val);
+          // this.$nextTick(() => {
+          //   this.reload();
+          // });
+        },
+        deep: true,
+        immediate: true
+      }
     },
-
-    // async getZeroPartPros(code) {
-    //   let { data: res } = await getByCode(code);
-    //   let sxtList = res.map((item) => {
-    //     let values = Object.keys(item);
-    //     return {
-    //       value: Number(values[0]),
-    //       label: item[values[0]]
-    //     };
-    //   });
-    //   this.$nextTick(() => {
-    //     this.$set(this, 'sxtList', sxtList);
-    //   });
-
-
+    // computed: {
+    //   processedItems() {
+    //     return this.list.map(item => {
+    //       // 处理逻辑
+    //       console.log(item);
+    //       // return processedItem;
+    //     });
+    //   }
     // },
 
-    getContactList() {
-      let param = {
-        pageNum: 1,
-        type: 2,
-        size: -1,
-        status: 1
-      };
-      contactList(param).then((res) => {
-        console.log(res, 'res11111111111');
-
-        this.gysList = res.list;
-      });
-    },
+    methods: {
+      rootCategoryLevelIdText(v) {
+        console.log(v, '111111');
 
+        if (v) {
+          let a = this.rootCategoryLevelIdList.find((item) => item.value == v);
+          return a.label;
+        }
+      },
 
-    handleAdd() {
-      // // 打开树形对话框
-      // this.$refs.bomTreeDialogRef.open(
-      //   this.attributeData.bomType,
-      //   this.attributeData.versions,
-      //   this.attributeData.categoryId,
-      //   this.newTreeId,
-      //   this.isTemp
-      // );
+      factoriesFn(code) {
+        this.isId = code;
+        this.$refs.clientSelectionRef.open();
+      },
+      // 选择工厂
+      confirmSelection(obj) {
+        let list = this.$refs.table.getData();
+        list.map((v) => {
+          if (v.code == this.isId) {
+            v.factories = obj.name;
+          }
+        });
+        console.log(list, 'list');
+        // arr.factories = obj.name;
+        this.$nextTick(() => {
+          this.list = [...list];
+          this.listTow = JSON.parse(JSON.stringify(this.list));
 
-      let _list = this.$refs.table.getData() ?? [];
+          this.$refs.table.setData(this.list);
+          this.updateFn();
+          this.tableKey = Date.now();
+        });
 
-      this.$refs.standardOutputRefs.open(_list);
+        this.$forceUpdate();
+      },
 
-    },
+      updateFn(list) {
+        this.isList = true;
+        this.reload();
+        setTimeout(() => {
+          this.isList = false;
+        }, 1000);
+      },
 
-    // 勾选
-    async chooseStandardList(data) {
-      const that = this;
-      const arrays = []
-      data.map((m) => {
-        m.parentId = this.newTreeId;
-        m.createTime = '';
-        m.bomType = this.attributeData.bomType;
-        m.level = Number(this.attributeData.level) + 1;
-        m.categoryCode = m.code;
-        m.code = '';
-        m.versions = this.attributeData.versions;
-        m.categoryId = m.id;
-        // m.dosage = 1;
-        m.componentAttribute = m.componentAttribute;
-        m.rootCategoryLevelId = m.categoryLevelPathIdParent;
-        m.resourceBomVersionList = [];
-        arrays.push(m.id)
-
-      });
-
-      this.getResourceBomVersionListFn(arrays).then(v => {
-        if (v.length) {
-          v.map(element => {
-            data.map((item2, i) => {
-              if (element.categoryId == item2.id) {
-                item2.resourceBomVersionList.push(element);
-              }
-              if (item2.resourceBomVersionList.length) {
-                item2.resourceBomVersion = item2.resourceBomVersionList[0].versions;
-                item2.resourceBomId = item2.resourceBomVersionList[0].resourceBomId;
-              }
-
-              setTimeout(() => {
-                item2.id = "";
-              }, 100);
-
-
-            })
-          })
-        }
+      /* 表格数据源 */
+      datasource({ where, page, limit }) {
+        // let that = this;
+        // console.log(getBomPageCategoryId({
+        //   ...where,
+        //   pageNum: page,
+        //   size: limit,
+        //   id: this.attributeData.id,
+        //   bomType: this.attributeData.bomType
+        // }));
+
+        // return new Promise((resolve, reject) => {
+
+        //   getBomPageCategoryId({
+        //     ...where,
+        //     pageNum: page,
+        //     size: limit,
+        //     id: that.attributeData.id,
+        //     bomType: that.attributeData.bomType
+        //   }).then((res) => {
+        //     console.log(res, '111111111111');
+
+        //     if(res.list && res.list.length ){
+
+        //     const arrays = []
+        //     res.list.map((item) => {
+        //       arrays.push(item.categoryId);
+
+        //     });
+
+        //     that.getResourceBomVersionListFn(arrays).then(v => {
+        //       v.map(element => {
+        //         res.list.map((item2, i) => {
+        //           if (element.categoryId == item2.id) {
+        //             item2.resourceBomVersionList.push(element);
+        //           }
+        //           item2.resourceBomVersion = item2.resourceBomVersionList[0].versions;
+        //           item2.resourceBomId = item2.resourceBomVersionList[0].resourceBomId;
+        //           // item2.id ="";
+        //         })
+        //       })
+        //       this.$nextTick(() => {
+        //         resolve(res);
+        //       })
+        //     })
+        //   }
+        //   })
+        //     .catch((err) => {
+        //       reject(err);
+        //     });
+        // });
 
+        let data = getBomPageCategoryId({
+          ...where,
+          pageNum: page,
+          size: limit,
+          id: this.attributeData.id,
+          bomType: this.attributeData.bomType
+        });
 
-        this.$nextTick(() => {
-          data.map(v => {
-            v.id = "";
-          })
+        if (this.isList) {
+          data = this.listTow;
+        }
 
-          this.list = [...data, ...this.$refs.table.getData()];
+        console.log(data, 'data');
 
-          this.$refs.table._data.tableTotal = this.list.length;
+        return data;
+      },
 
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ where });
+      },
 
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
 
-          this.$refs.table.setData(this.list)
-        })
+        this.dictList = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: Number(values[0]),
+            label: item[values[0]]
+          };
+        });
+      },
 
-      })
+      // async getZeroPartPros(code) {
+      //   let { data: res } = await getByCode(code);
+      //   let sxtList = res.map((item) => {
+      //     let values = Object.keys(item);
+      //     return {
+      //       value: Number(values[0]),
+      //       label: item[values[0]]
+      //     };
+      //   });
+      //   this.$nextTick(() => {
+      //     this.$set(this, 'sxtList', sxtList);
+      //   });
+
+      // },
+
+      getContactList() {
+        let param = {
+          pageNum: 1,
+          type: 2,
+          size: -1,
+          status: 1
+        };
+        contactList(param).then((res) => {
+          console.log(res, 'res11111111111');
 
+          this.gysList = res.list;
+        });
+      },
 
+      handleAdd() {
+        // // 打开树形对话框
+        // this.$refs.bomTreeDialogRef.open(
+        //   this.attributeData.bomType,
+        //   this.attributeData.versions,
+        //   this.attributeData.categoryId,
+        //   this.newTreeId,
+        //   this.isTemp
+        // );
 
+        let _list = this.$refs.table.getData() ?? [];
 
-      // this.$nextTick(() => {
-      //   this.list = [...data, ...this.$refs.table.getData()];
-      //   console.log(this.list,'9999999999');
-      //   // this.$refs.table.setData(this.list);
-      //   console.log(this.$refs.table._data,'this.$refs.table');
-      //   // this.$refs.table._data.tableData = [];
-      //   // 
-      //   // this.$set(this.$refs.table._data,"tableData",this.list);
+        this.$refs.standardOutputRefs.open(_list);
+      },
 
+      // 勾选
+      async chooseStandardList(data) {
+        const that = this;
+        const arrays = [];
+        data.map((m) => {
+          m.parentId = this.newTreeId;
+          m.createTime = '';
+          m.bomType = this.attributeData.bomType;
+          m.level = Number(this.attributeData.level) + 1;
+          m.categoryCode = m.code;
+          m.code = '';
+          m.versions = this.attributeData.versions;
+          m.categoryId = m.id;
+          // m.dosage = 1;
+          m.componentAttribute = m.componentAttribute;
+          m.rootCategoryLevelId = m.categoryLevelPathIdParent;
+          m.resourceBomVersionList = [];
+          arrays.push(m.id);
+        });
 
-      //   // this.bomClose();
-      // });
+        this.getResourceBomVersionListFn(arrays).then((v) => {
+          if (v.length) {
+            v.map((element) => {
+              data.map((item2, i) => {
+                if (element.categoryId == item2.id) {
+                  item2.resourceBomVersionList.push(element);
+                }
+                if (item2.resourceBomVersionList.length) {
+                  item2.resourceBomVersion =
+                    item2.resourceBomVersionList[0].versions;
+                  item2.resourceBomId =
+                    item2.resourceBomVersionList[0].resourceBomId;
+                }
+
+                setTimeout(() => {
+                  item2.id = '';
+                }, 100);
+              });
+            });
+          }
 
-    },
+          this.$nextTick(() => {
+            data.map((v) => {
+              v.id = '';
+            });
 
+            this.list = [...data, ...this.$refs.table.getData()];
 
+            this.$refs.table._data.tableTotal = this.list.length;
 
+            this.$refs.table.setData(this.list);
+          });
+        });
 
+        // this.$nextTick(() => {
+        //   this.list = [...data, ...this.$refs.table.getData()];
+        //   console.log(this.list,'9999999999');
+        //   // this.$refs.table.setData(this.list);
+        //   console.log(this.$refs.table._data,'this.$refs.table');
+        //   // this.$refs.table._data.tableData = [];
+        //   //
+        //   // this.$set(this.$refs.table._data,"tableData",this.list);
+
+        //   // this.bomClose();
+        // });
+      },
 
-    resourceBomVersionFn(e, row) {
-      let arr = row.resourceBomVersionList.find(item => item.versions == e);
-      console.log(arr, 'eeeeeeeeee');
-      this.$forceUpdate();
-      row.resourceBomVersion = arr.versions;
-      row.resourceBomId = arr.resourceBomId;
-      console.log(row);
-    },
+      resourceBomVersionFn(e, row) {
+        let arr = row.resourceBomVersionList.find((item) => item.versions == e);
+        console.log(arr, 'eeeeeeeeee');
+        this.$forceUpdate();
+        row.resourceBomVersion = arr.versions;
+        row.resourceBomId = arr.resourceBomId;
+        console.log(row);
+      },
 
-    async getResourceBomVersionListFn(id) {
-      return new Promise((resolve, reject) => {
-        sourceBomVersion({
-          bomType: this.attributeData.bomType,
-          categoryIds: id
-        }).then((res) => {
-          resolve(res.data);
+      async getResourceBomVersionListFn(id) {
+        return new Promise((resolve, reject) => {
+          sourceBomVersion({
+            bomType: this.attributeData.bomType,
+            categoryIds: id
+          }).then((res) => {
+            resolve(res.data);
+          });
         });
-      });
-    },
-
+      },
 
-    bomClose() {
-      this.$nextTick(() => {
-        this.$refs.table.reload({
-          pageNum: 1
+      bomClose() {
+        this.$nextTick(() => {
+          this.$refs.table.reload({
+            pageNum: 1
+          });
         });
-      });
-    },
-
-    handleDel(row, i) {
-      this.$confirm('是否确认删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          if (row.id) {
-            deleteBomTreeList([row.id]).then((msg) => {
-              this.$message.success('删除' + msg);
-              this.$refs.table.reload({
-                pageNum: 1
-              });
-            });
-          } else {
-
-            let _list = this.$refs.table.getData() ?? [];
-            _list.splice(i, 1);
-            // _list = _list.filter((item) => item.id !== row.id);
-            this.$refs.table.setData(_list);
-          }
+      },
 
+      handleDel(row, i) {
+        this.$confirm('是否确认删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
         })
-        .catch(() => { });
+          .then(() => {
+            if (row.id) {
+              deleteBomTreeList([row.id]).then((msg) => {
+                this.$message.success('删除' + msg);
+                this.$refs.table.reload({
+                  pageNum: 1
+                });
+              });
+            } else {
+              let _list = this.$refs.table.getData() ?? [];
+              _list.splice(i, 1);
+              // _list = _list.filter((item) => item.id !== row.id);
+              this.$refs.table.setData(_list);
+            }
+          })
+          .catch(() => {});
+      },
 
-    },
+      handleSave() {
+        let _list = this.$refs.table.getData() ?? [];
 
-    handleSave() {
-      let _list = this.$refs.table.getData() ?? [];
+        if (_list.length == 0) {
+          return this.$message.info('明细表最少有一条数据');
+        }
+        let list = JSON.parse(JSON.stringify(_list));
 
+        console.log(list, 'list');
 
-      if (_list.length == 0) {
-        return this.$message.info('明细表最少有一条数据');
-      }
-      let list = JSON.parse(JSON.stringify(_list));
+        const arr = list.every((v) => {
+          return v.dosage && v.quantity !== '';
+        });
 
-      console.log(list, 'list');
+        if (!arr) {
+          return this.$message.info('用量不能为空');
+        }
 
-      const arr = list.every(v => {
-        return v.dosage && v.quantity !== ''
-      })
+        // console.log(list);
+        // return
 
-      if (!arr) {
-        return this.$message.info('用量不能为空')
+        updateBatchBOM(list).then((res) => {
+          if (res) {
+            this.$message.success('保存成功');
+            this.reload();
+            // this.$refs.table.reload({
+            //   pageNum: 1
+            // });
+          }
+        });
       }
-
-      // console.log(list);
-      // return 
-
-      updateBatchBOM(list).then((res) => {
-        if (res) {
-          this.$message.success('保存成功');
-          this.reload();
-          // this.$refs.table.reload({
-          //   pageNum: 1
-          // });
-        }
-
-      });
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.ele-body {
-  height: 100%;
-
-  ::v-deep .el-card {
+  .ele-body {
     height: 100%;
 
-    .el-card__body {
+    ::v-deep .el-card {
       height: 100%;
-      display: flex;
-      flex-direction: column;
 
-      .dict-table {
-        flex: 1;
-        overflow: hidden;
+      .el-card__body {
+        height: 100%;
         display: flex;
         flex-direction: column;
 
-        .el-table {
+        .dict-table {
           flex: 1;
-          overflow-y: auto;
+          overflow: hidden;
+          display: flex;
+          flex-direction: column;
+
+          .el-table {
+            flex: 1;
+            overflow-y: auto;
+          }
         }
       }
     }
   }
-}
 
-.toolbar_box {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-
-  .toolbar_box_right {
+  .toolbar_box {
     display: flex;
+    justify-content: space-between;
     align-items: center;
-    justify-content: center;
-    margin-right: 10px;
 
-    >span {
-      width: 150px;
-    }
+    .toolbar_box_right {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-right: 10px;
 
-    >div {
-      margin-left: 10px;
+      > span {
+        width: 150px;
+      }
+
+      > div {
+        margin-left: 10px;
+      }
     }
   }
-}
 </style>

+ 15 - 0
src/views/material/BOMmanage/components/mbomDatailList.vue

@@ -0,0 +1,15 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+  export default {
+    methods: {
+      open(id, level) {
+        console.log(id, level, 'open');
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 1400 - 1104
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -1,47 +1,81 @@
 <template>
-    <ele-modal custom-class="ele-dialog-form long-dialog-form"
-             :centered="true" :visible.sync="visible" :title="title"
-             append-to-body
-             :close-on-click-modal="false" width="85%" :maxable="true">
-
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="visible"
+    :title="title"
+    append-to-body
+    :close-on-click-modal="false"
+    width="85%"
+    :maxable="true"
+  >
     <el-card shadow="never">
       <header-title title="物品信息"></header-title>
-      <el-form label-width="100px" ref="form" :model="rowData" class="item-height">
+      <el-form
+        label-width="100px"
+        ref="form"
+        :model="rowData"
+        class="item-height"
+      >
         <el-row>
           <el-col :span="6" label-width="100px">
             <el-form-item label="名称" prop="name">
-              <el-input disabled placeholder="物品名称" v-model="treeData.name"></el-input>
+              <el-input
+                disabled
+                placeholder="物品名称"
+                v-model="treeData.name"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6" label-width="100px">
             <el-form-item label="编码" prop="code">
-              <el-input disabled placeholder="物品编码" v-model="treeData.code"></el-input>
+              <el-input
+                disabled
+                placeholder="物品编码"
+                v-model="treeData.code"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6" label-width="100px">
             <el-form-item label="型号" prop="modelType">
-              <el-input disabled placeholder="物品型号" v-model="treeData.modelType"></el-input>
+              <el-input
+                disabled
+                placeholder="物品型号"
+                v-model="treeData.modelType"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6" label-width="100px">
             <el-form-item label="规格" prop="specification">
-              <el-input disabled placeholder="物品规格" v-model="treeData.specification"></el-input>
+              <el-input
+                disabled
+                placeholder="物品规格"
+                v-model="treeData.specification"
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
-      
+
       <header-title title="工序信息"></header-title>
       <el-form label-width="100px" ref="form" :model="rowData">
         <el-row>
           <el-col :span="6" label-width="100px">
             <el-form-item label="编码" prop="type">
-              <el-input disabled placeholder="工序编码" v-model="rowData.code"></el-input>
+              <el-input
+                disabled
+                placeholder="工序编码"
+                v-model="rowData.code"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6" label-width="100px">
             <el-form-item label="工序名称" prop="type">
-              <el-input disabled placeholder="工序名称" v-model="rowData.name"></el-input>
+              <el-input
+                disabled
+                placeholder="工序名称"
+                v-model="rowData.name"
+              ></el-input>
             </el-form-item>
           </el-col>
           <!-- <el-col :span="6" label-width="100px">
@@ -65,13 +99,30 @@
         </el-row>
       </el-form>
 
-      <el-tabs v-model="activeName" class="tab-box" type="border-card" @tab-click="tabsChange">
+      <el-tabs
+        v-model="activeName"
+        class="tab-box"
+        type="border-card"
+        @tab-click="tabsChange"
+      >
         <el-tab-pane label="工艺参数" name="工艺参数">
-          <ele-pro-table ref="table" :datasource="datasource" :immediate="true" :need-page="false" :columns="columns">
+          <ele-pro-table
+            ref="table"
+            :datasource="datasource"
+            :immediate="true"
+            :need-page="false"
+            :columns="columns"
+          >
             <!-- 表头工具栏 -->
             <template v-if="!isView" v-slot:toolbar>
-              <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
-                @click.native="openParam('工艺')">添加参数</el-button>
+              <el-button
+                size="small"
+                icon="el-icon-plus"
+                class="ele-btn-icon"
+                type="primary"
+                @click.native="openParam('工艺')"
+                >添加参数</el-button
+              >
             </template>
 
             <template v-slot:sort="{ row }">
@@ -85,13 +136,21 @@
                 {{ row.defaultValue }}
               </div>
               <div v-else>
-                <el-input v-if="
-                  row.textType == 1 ||
-                  row.textType == 4 ||
-                  row.textType == 3 ||
-                  row.textType == 5
-                " v-model="row.defaultValue" placeholder="请输入"></el-input>
-                <el-select v-if="row.textType == 2" v-model="row.defaultValue" placeholder="请选择">
+                <el-input
+                  v-if="
+                    row.textType == 1 ||
+                    row.textType == 4 ||
+                    row.textType == 3 ||
+                    row.textType == 5
+                  "
+                  v-model="row.defaultValue"
+                  placeholder="请输入"
+                ></el-input>
+                <el-select
+                  v-if="row.textType == 2"
+                  v-model="row.defaultValue"
+                  placeholder="请选择"
+                >
                   <el-option label="TRUE" :value="'TRUE'" />
                   <el-option label="FALSE" :value="'FALSE'" />
                 </el-select>
@@ -104,7 +163,11 @@
                 {{ row.maxValue }}
               </div>
               <div v-else>
-                <el-input v-if="row.textType == 3" v-model="row.maxValue" placeholder="请输入"></el-input>
+                <el-input
+                  v-if="row.textType == 3"
+                  v-model="row.maxValue"
+                  placeholder="请输入"
+                ></el-input>
               </div>
             </template>
             <!-- 下限 -->
@@ -113,7 +176,11 @@
                 {{ row.minValue }}
               </div>
               <div v-else>
-                <el-input v-if="row.textType == 3" v-model="row.minValue" placeholder="请输入"></el-input>
+                <el-input
+                  v-if="row.textType == 3"
+                  v-model="row.minValue"
+                  placeholder="请输入"
+                ></el-input>
               </div>
             </template>
 
@@ -123,8 +190,13 @@
                 {{ row.unitName }}
               </div>
               <div v-else>
-                <DictSelection v-if="row.textType != 2 && row.textType != 5" dictName="工艺参数单位" clearable filterable
-                  v-model="row.unitName">
+                <DictSelection
+                  v-if="row.textType != 2 && row.textType != 5"
+                  dictName="工艺参数单位"
+                  clearable
+                  filterable
+                  v-model="row.unitName"
+                >
                 </DictSelection>
                 <span v-if="row.textType == 5"> h(小时)</span>
               </div>
@@ -132,9 +204,17 @@
 
             <!-- 操作列 -->
             <template v-slot:action="{ row }">
-              <el-popconfirm class="ele-action" title="确定要删除当前参数吗?" @confirm="remove(row, '工艺')">
+              <el-popconfirm
+                class="ele-action"
+                title="确定要删除当前参数吗?"
+                @confirm="remove(row, '工艺')"
+              >
                 <template v-slot:reference>
-                  <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  <el-link
+                    type="danger"
+                    :underline="false"
+                    icon="el-icon-delete"
+                  >
                     删除
                   </el-link>
                 </template>
@@ -143,40 +223,64 @@
           </ele-pro-table>
         </el-tab-pane>
         <el-tab-pane label="质检项参数" name="质检项参数">
-          <term :qualityParam="qualityParam" :isView="isView" ref="qualityParamRef"></term>
+          <term
+            :qualityParam="qualityParam"
+            :isView="isView"
+            ref="qualityParamRef"
+          ></term>
         </el-tab-pane>
         <el-tab-pane label="生产节拍" name="生产节拍">
-          <el-form label-width="140px" ref="form" :model="beatParam" style="width: 800px; margin: auto;">
+          <el-form
+            label-width="140px"
+            ref="form"
+            :model="beatParam"
+            style="width: 800px; margin: auto"
+          >
             <el-row>
               <el-col :span="16" label-width="100px">
                 <el-form-item label="节拍生产数量" prop="beatNum">
-                  <el-input v-if="!isView" placeholder="" v-model="beatParam.beatNum" maxlength="9"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatNum"
+                    maxlength="9"
+                  ></el-input>
                   <div v-else>{{ beatParam.beatNum }}</div>
                 </el-form-item>
               </el-col>
 
               <el-col :span="8" label-width="100px">
-
                 <el-form-item label="单位:" prop="unit">
-                  <el-select v-if="!isView" v-model="beatParam.unit" filterable class="ele-block" @change="changeUnit">
-                    <el-option v-for="item in dictList" :key="item.value" :value="item.value"
-                      :label="item.label"></el-option>
+                  <el-select
+                    v-if="!isView"
+                    v-model="beatParam.unit"
+                    filterable
+                    class="ele-block"
+                    @change="changeUnit"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
                   </el-select>
                   <div v-else>{{ beatParam.unit }}</div>
                 </el-form-item>
               </el-col>
             </el-row>
 
-
-
             <el-row>
               <el-col :span="16" label-width="100px">
                 <el-form-item label="生产时长" prop="newBeatTime">
-
-
-                  <el-input v-if="!isView" placeholder="" v-model="beatParam.newBeatTime"
-                    @blur="convertVal(beatParam.newBeatTime, 'beatTime')" maxlength="9"
-                    oninput="value = value.replace(/[^\d.]/g, '')"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.newBeatTime"
+                    @blur="convertVal(beatParam.newBeatTime, 'beatTime')"
+                    maxlength="9"
+                    oninput="value = value.replace(/[^\d.]/g, '')"
+                  ></el-input>
 
                   <div v-else>{{ beatParam.newBeatTime }}</div>
                 </el-form-item>
@@ -191,9 +295,19 @@
             <el-row>
               <el-col :span="16" label-width="100px">
                 <el-form-item label="准备时长" prop="newBeatPrepareTime">
-                  <el-input v-if="!isView" placeholder="" v-model="beatParam.newBeatPrepareTime"
-                    @blur="convertVal(beatParam.newBeatPrepareTime, 'beatPrepareTime')" maxlength="9"
-                    oninput="value = value.replace(/[^\d.]/g, '')"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.newBeatPrepareTime"
+                    @blur="
+                      convertVal(
+                        beatParam.newBeatPrepareTime,
+                        'beatPrepareTime'
+                      )
+                    "
+                    maxlength="9"
+                    oninput="value = value.replace(/[^\d.]/g, '')"
+                  ></el-input>
                   <div v-else>{{ beatParam.newBeatPrepareTime }}</div>
                 </el-form-item>
               </el-col>
@@ -207,9 +321,16 @@
             <el-row>
               <el-col :span="16" label-width="140px">
                 <el-form-item label="下道工序间隔时长" prop="newBeatRestTime">
-                  <el-input v-if="!isView" placeholder="" v-model="beatParam.newBeatRestTime"
-                    @blur="convertVal(beatParam.newBeatRestTime, 'beatRestTime')" maxlength="9"
-                    oninput="value = value.replace(/[^\d.]/g, '')"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.newBeatRestTime"
+                    @blur="
+                      convertVal(beatParam.newBeatRestTime, 'beatRestTime')
+                    "
+                    maxlength="9"
+                    oninput="value = value.replace(/[^\d.]/g, '')"
+                  ></el-input>
                   <div v-else>{{ beatParam.newBeatRestTime }}</div>
                 </el-form-item>
               </el-col>
@@ -224,9 +345,14 @@
             <el-row>
               <el-col :span="16" label-width="100px">
                 <el-form-item label="标准时长" prop="newTime">
-                  <el-input v-if="!isView" placeholder="标准时长" v-model="beatParam.newTime"
-                    @blur="convertVal(beatParam.newTime, 'time')" maxlength="9"
-                    oninput="value = value.replace(/[^\d.]/g, '')"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder="标准时长"
+                    v-model="beatParam.newTime"
+                    @blur="convertVal(beatParam.newTime, 'time')"
+                    maxlength="9"
+                    oninput="value = value.replace(/[^\d.]/g, '')"
+                  ></el-input>
                   <div v-else>{{ beatParam.newTime }}</div>
                 </el-form-item>
               </el-col>
@@ -240,8 +366,13 @@
             <el-row>
               <el-col :span="16" label-width="100px">
                 <el-form-item label="工时单价" prop="taskPrice">
-                  <el-input v-if="!isView" placeholder="" v-model="beatParam.taskPrice"
-                    oninput="value = value.replace(/[^\d.]/g, '')" maxlength="7"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.taskPrice"
+                    oninput="value = value.replace(/[^\d.]/g, '')"
+                    maxlength="7"
+                  ></el-input>
                   <div v-else>{{ beatParam.taskPrice }}</div>
                 </el-form-item>
               </el-col>
@@ -255,8 +386,13 @@
             <el-row>
               <el-col :span="24" label-width="100px">
                 <el-form-item label="备注" prop="remark">
-                  <el-input v-if="!isView" placeholder="" v-model="beatParam.remark" type="textarea"
-                    :rows="4"></el-input>
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.remark"
+                    type="textarea"
+                    :rows="4"
+                  ></el-input>
                   <div v-else>{{ beatParam.remark }}</div>
                 </el-form-item>
               </el-col>
@@ -265,42 +401,77 @@
         </el-tab-pane>
 
         <el-tab-pane label="材料定额" name="材料定额">
-          <ele-pro-table ref="materialTable" :columns="columns1" :datasource="datasource" :need-page="false"
-            :immediate="true">
+          <ele-pro-table
+            ref="materialTable"
+            :columns="columns1"
+            :datasource="datasource"
+            :need-page="false"
+            :immediate="true"
+          >
             <!-- 表头工具栏 -->
             <template v-slot:toolbar>
-              <el-button type="primary" v-if="!isView" @click="add">添加</el-button>
+              <el-button type="primary" v-if="!isView" @click="add"
+                >添加</el-button
+              >
+              <el-button type="primary" v-if="!isView" @click="detailsList"
+                >从明细表导入</el-button
+              >
               <div class="toolbar_box">
                 <div>
-                  <el-form ref="form" :rules="rules" :model="form" label-width="80px" inline>
+                  <el-form
+                    ref="form"
+                    :rules="rules"
+                    :model="form"
+                    label-width="80px"
+                    inline
+                  >
                     <el-form-item prop="baseCount" label="基本数量">
-                      <el-input placeholder="请输入" :disabled="isView" v-model.number="form.baseCount">
+                      <el-input
+                        placeholder="请输入"
+                        :disabled="isView"
+                        v-model.number="form.baseCount"
+                      >
                       </el-input>
                     </el-form-item>
 
                     <el-form-item prop="baseCountUnit" label="单位">
-                      <DictSelection dictName="计量单位" :disabled="isView" v-model="form.baseCountUnit" />
+                      <DictSelection
+                        dictName="计量单位"
+                        :disabled="isView"
+                        v-model="form.baseCountUnit"
+                      />
                     </el-form-item>
                   </el-form>
                 </div>
-
               </div>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="danger" @click="handleDel(row, $index)">删除</el-link>
-              <el-link type="primary" @click="handSubstitution(row)">替代料</el-link>
-
+              <el-link type="danger" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
+              <el-link type="primary" @click="handSubstitution(row)"
+                >替代料</el-link
+              >
             </template>
             <template v-slot:subCode="{ row }">
               <div v-if="isView">{{ row.subCode }}</div>
-              <el-input v-else v-model="row.subCode" placeholder="请输入"></el-input>
+              <el-input
+                v-else
+                v-model="row.subCode"
+                placeholder="请输入"
+              ></el-input>
             </template>
 
             <template v-slot:isReworkBom="{ row }">
               <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
               <div v-else>
                 <el-select v-model="row.isReworkBom">
-                  <el-option v-for="item in isReworkBomList" :key="item.value" :label="item.label" :value="item.value">
+                  <el-option
+                    v-for="item in isReworkBomList"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
                   </el-option>
                 </el-select>
               </div>
@@ -309,26 +480,45 @@
             <template v-slot:unit="{ row }">
               <div v-if="isView">{{ row.unit }}</div>
               <div v-else>
-                <DictSelection dictName="计量单位" :isProhibit="true" v-model="row.unit"></DictSelection>
+                <DictSelection
+                  dictName="计量单位"
+                  :isProhibit="true"
+                  v-model="row.unit"
+                ></DictSelection>
               </div>
             </template>
 
             <template v-slot:count="{ row }">
               <div v-if="isView">{{ row.count }}</div>
-              <el-input v-else v-model="row.count" placeholder="请输入" @input="
-                (value) =>
-                (row.count = value.replace(
-                  /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
-                  '$1$2.$3'
-                ))
-              "></el-input>
+              <el-input
+                v-else
+                v-model="row.count"
+                placeholder="请输入"
+                @input="
+                  (value) =>
+                    (row.count = value.replace(
+                      /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
+                      '$1$2.$3'
+                    ))
+                "
+              ></el-input>
             </template>
 
             <template v-slot:categoryName="{ row, $index }">
-              <el-link type="primary" :underline="false" @click="handSubstitution(row)" v-if="isView">{{
-                row.categoryName }}</el-link>
-              <div v-else><el-input :value="row.categoryName" placeholder="请选择"
-                  @click.native="categorySelect(row, $index)"></el-input></div>
+              <el-link
+                type="primary"
+                :underline="false"
+                @click="handSubstitution(row)"
+                v-if="isView"
+                >{{ row.categoryName }}</el-link
+              >
+              <div v-else
+                ><el-input
+                  :value="row.categoryName"
+                  placeholder="请选择"
+                  @click.native="categorySelect(row, $index)"
+                ></el-input
+              ></div>
             </template>
 
             <template v-slot:bomArtFiles="{ row }">
@@ -337,44 +527,71 @@
 
             <template v-slot:remark="{ row }">
               <div v-if="isView">{{ row.remark }}</div>
-              <el-input v-else v-model="row.remark" placeholder="请输入"></el-input>
+              <el-input
+                v-else
+                v-model="row.remark"
+                placeholder="请输入"
+              ></el-input>
             </template>
           </ele-pro-table>
         </el-tab-pane>
 
         <el-tab-pane label="关键设备" name="关键设备">
-          <ele-pro-table ref="deviceTabRef" :columns="standardCol" :datasource="datasource" :need-page="false"
-            :immediate="true">
+          <ele-pro-table
+            ref="deviceTabRef"
+            :columns="standardCol"
+            :datasource="datasource"
+            :need-page="false"
+            :immediate="true"
+          >
             <!-- 表头工具栏 -->
             <template v-if="!isView" v-slot:toolbar>
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="danger" @click="handleDel(row, $index)">删除</el-link>
+              <el-link type="danger" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
             </template>
           </ele-pro-table>
         </el-tab-pane>
 
         <el-tab-pane label="制造资源" name="制造资源">
-          <ele-pro-table ref="resourceTable" :columns="columns1" :datasource="datasource" :need-page="false"
-            :immediate="true">
+          <ele-pro-table
+            ref="resourceTable"
+            :columns="columns1"
+            :datasource="datasource"
+            :need-page="false"
+            :immediate="true"
+          >
             <!-- 表头工具栏 -->
             <template v-if="!isView" v-slot:toolbar>
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)">删除</el-link>
+              <el-link type="primary" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
             </template>
             <template v-slot:subCode="{ row }">
               <div v-if="isView">{{ row.subCode }}</div>
-              <el-input v-else v-model="row.subCode" placeholder="请输入"></el-input>
+              <el-input
+                v-else
+                v-model="row.subCode"
+                placeholder="请输入"
+              ></el-input>
             </template>
 
             <template v-slot:isReworkBom="{ row }">
               <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
               <div v-else>
                 <el-select v-model="row.isReworkBom">
-                  <el-option v-for="item in isReworkBomList" :key="item.value" :label="item.label" :value="item.value">
+                  <el-option
+                    v-for="item in isReworkBomList"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
                   </el-option>
                 </el-select>
               </div>
@@ -383,25 +600,38 @@
             <template v-slot:unit="{ row }">
               <div v-if="isView">{{ row.unit }}</div>
               <div v-else>
-                <DictSelection dictName="计量单位" v-model="row.unit"></DictSelection>
+                <DictSelection
+                  dictName="计量单位"
+                  v-model="row.unit"
+                ></DictSelection>
               </div>
             </template>
 
             <template v-slot:count="{ row }">
               <div v-if="isView">{{ row.count }}</div>
-              <el-input v-else v-model="row.count" placeholder="请输入" @input="
-                (value) =>
-                (row.count = value.replace(
-                  /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
-                  '$1$2.$3'
-                ))
-              "></el-input>
+              <el-input
+                v-else
+                v-model="row.count"
+                placeholder="请输入"
+                @input="
+                  (value) =>
+                    (row.count = value.replace(
+                      /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
+                      '$1$2.$3'
+                    ))
+                "
+              ></el-input>
             </template>
 
             <template v-slot:categoryName="{ row, $index }">
               <div v-if="isView">{{ row.categoryName }}</div>
-              <div v-else><el-input :value="row.categoryName" placeholder="请选择"
-                  @click.native="categorySelect(row, $index)"></el-input></div>
+              <div v-else
+                ><el-input
+                  :value="row.categoryName"
+                  placeholder="请选择"
+                  @click.native="categorySelect(row, $index)"
+                ></el-input
+              ></div>
             </template>
 
             <template v-slot:bomArtFiles="{ row }">
@@ -410,46 +640,77 @@
 
             <template v-slot:remark="{ row }">
               <div v-if="isView">{{ row.remark }}</div>
-              <el-input v-else v-model="row.remark" placeholder="请输入"></el-input>
+              <el-input
+                v-else
+                v-model="row.remark"
+                placeholder="请输入"
+              ></el-input>
             </template>
           </ele-pro-table>
         </el-tab-pane>
 
         <el-tab-pane label="工种" name="工种">
-          <ele-pro-table ref="jobTable" :columns="jobColumns" :datasource="datasource" row-key="id">
+          <ele-pro-table
+            ref="jobTable"
+            :columns="jobColumns"
+            :datasource="datasource"
+            row-key="id"
+          >
             <!-- 表头工具栏 -->
             <template v-slot:toolbar>
-              <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon"
-                @click="addJob">新增</el-button>
+              <el-button
+                size="small"
+                type="primary"
+                icon="el-icon-plus"
+                class="ele-btn-icon"
+                @click="addJob"
+                >新增</el-button
+              >
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)">删除</el-link>
+              <el-link type="primary" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
             </template>
           </ele-pro-table>
         </el-tab-pane>
         <el-tab-pane label="工艺文件" name="工艺文件">
-          <ele-pro-table ref="fileTable" :columns="jobColumns1" :datasource="datasource" :need-page="false"
-            :immediate="true">
+          <ele-pro-table
+            ref="fileTable"
+            :columns="jobColumns1"
+            :datasource="datasource"
+            :need-page="false"
+            :immediate="true"
+          >
             <!-- 表头工具栏 -->
             <template v-if="!isView" v-slot:toolbar>
               <el-button type="primary" @click="addFile">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)">删除</el-link>
+              <el-link type="primary" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
               <el-link type="primary" @click="fileDetails(row)">详情</el-link>
             </template>
           </ele-pro-table>
         </el-tab-pane>
 
         <el-tab-pane label="标准产出" name="标准产出">
-          <ele-pro-table ref="standard" :columns="standardCol" :datasource="datasource" :need-page="false"
-            :immediate="true">
+          <ele-pro-table
+            ref="standard"
+            :columns="standardCol"
+            :datasource="datasource"
+            :need-page="false"
+            :immediate="true"
+          >
             <!-- 表头工具栏 -->
             <template v-if="!isView" v-slot:toolbar>
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="danger" @click="handleDel(row, $index)">删除</el-link>
+              <el-link type="danger" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
             </template>
           </ele-pro-table>
         </el-tab-pane>
@@ -459,1093 +720,1128 @@
     <jobDialog ref="jobRef" @chooseModal="chooseJob"></jobDialog>
     <ParamModal ref="paramRefs" @chooseModal="chooseModal"></ParamModal>
     <ProductModal ref="productRefs" @changeProduct="determineChoose" />
-    <ProductModalMultiple ref="productMultipleRefs" @selection="addProductList"></ProductModalMultiple>
+    <ProductModalMultiple
+      ref="productMultipleRefs"
+      @selection="addProductList"
+    ></ProductModalMultiple>
 
-    <standardOutput ref="standardOutputRefs" @selection="chooseStandardList"></standardOutput>
+    <standardOutput
+      ref="standardOutputRefs"
+      @selection="chooseStandardList"
+    ></standardOutput>
 
     <fileIndex v-if="fileShow" @close="fileClose"></fileIndex>
 
     <fileBrowse ref="browseRef"></fileBrowse>
 
-    <replaceMaterialPop ref="replaceMaterialRef" @selected="replaceSelected" :isView="isView"></replaceMaterialPop>
+    <replaceMaterialPop
+      ref="replaceMaterialRef"
+      @selected="replaceSelected"
+      :isView="isView"
+    ></replaceMaterialPop>
+
+    <mbomDatailList ref="bomDetailList"></mbomDatailList>
 
     <div class="btns">
-      <el-button type="primary" size="small" v-if="!isView" @click="save('save')">
-        保存</el-button>
+      <el-button
+        type="primary"
+        size="small"
+        v-if="!isView"
+        @click="save('save')"
+      >
+        保存</el-button
+      >
 
       <el-button type="primary" size="small" @click="save('close')">{{
         isView ? '确定' : '保存并关闭'
-        }}</el-button>
+      }}</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
-   </ele-modal>
+  </ele-modal>
 </template>
 
 <script>
-import dictMixins from '@/mixins/dictMixins';
-import * as dayjs from 'dayjs';
-import { getFile } from '@/api/system/file';
-// import fileUpload from '@/components/addDoc/index.vue';
-import { workingProcedureUpdate } from '@/api/material/BOM';
-import ParamModal from '@/views/technology/productParam/components/ParamModal.vue';
-import ProductModal from '@/components/select/bom/ProductModal.vue';
-import { getByCode } from '@/api/system/dictionary-data';
-import ProductModalMultiple from './ProductModalMultiple.vue';
-import userSearch from './user-search.vue';
-import jobDialog from './jobDialog.vue';
-import standardOutput from './standardOutput.vue';
-import term from '../qualityTesting/term';
-import fileIndex from '../file/index.vue';
-import fileBrowse from '../file/fileBrowse.vue';
-import replaceMaterialPop from './replaceMaterialPop.vue';
-import { filePageAPI } from '@/api/material/file';
-export default {
-  components: {
-    userSearch,
-    ParamModal,
-    // fileUpload,
-    ProductModal,
-    jobDialog,
-    ProductModalMultiple,
-    standardOutput,
-    term,
-    fileIndex,
-    fileBrowse,
-    replaceMaterialPop
-  },
-  mixins: [dictMixins],
-  data() {
-    return {
-      rules: {
-        baseCount: [
-          { required: true, message: '请输入基本数量', trigger: 'blur' },
-        ],
-        baseCountUnit: [{ required: true, message: '请选择单位', trigger: 'change' }]
-      },
-      form: {
-        baseCount: '',
-        baseCountUnit: '',
-      },
-      baseCountUnit: '',
-      baseCount2: '',
-      baseCountUnit2: '',
-      isView: false,
-      filedList: [],
-      jobFiledList: [],
-      activeName: '工艺参数',
-      attributeData: {},
-      visible: false,
-      title: '配置',
-      statusOption: [
-        {
-          label: '启用',
-          value: 1
-        },
-        {
-          label: '停用',
-          value: 0
-        }
-      ],
-      isReworkBom: ['否', '是'],
-      isReworkBomList: [
-        { label: '否', value: 0 },
-        { label: '是', value: 1 }
-      ],
-
-      dictList: [], //单位下拉
-
-      // 表格列配置
-      columns1: [],
-      defaultColumns1: [
-        {
-          type: 'index',
-          width: 55,
-          align: 'center'
-        },
-        {
-          label: '子项编号',
-          prop: 'subCode',
-          slot: 'subCode',
-          action: 'subCode'
-        },
-        {
-          label: '物料名称',
-          prop: 'categoryName',
-          slot: 'categoryName',
-          action: 'categoryName'
-        },
-        {
-          label: '是否回收料',
-          prop: 'isReworkBom',
-          slot: 'isReworkBom',
-          action: 'isReworkBom'
-        },
-        {
-          label: '编码',
-          prop: 'categoryCode'
-        },
-        {
-          label: '牌号',
-          prop: 'brandNum'
-        },
-        {
-          label: '型号',
-          prop: 'modelType'
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '数量',
-          slot: 'count',
-          action: 'count'
-        },
-        {
-          label: '单位',
-          slot: 'unit',
-          action: 'unit'
-        },
-
-        {
-          label: '附件',
-          slot: 'bomArtFiles',
-          action: 'bomArtFiles',
-          minWidth: 150
-        },
-
-        {
-          label: '备注',
-          slot: 'remark',
-          action: 'remark'
-        }
-      ],
-      columns: [],
-      // 表格列配置
-      defaultColumns: [
-        {
-          prop: 'sort',
-          slot: 'sort',
-          label: '排序',
-          minWidth: 60
-        },
-        {
-          prop: 'code',
-          label: '参数编码',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'name',
-          label: '参数名称',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
+  import dictMixins from '@/mixins/dictMixins';
+  import * as dayjs from 'dayjs';
+  import { getFile } from '@/api/system/file';
+  // import fileUpload from '@/components/addDoc/index.vue';
+  import { workingProcedureUpdate } from '@/api/material/BOM';
+  import ParamModal from '@/views/technology/productParam/components/ParamModal.vue';
+  import ProductModal from '@/components/select/bom/ProductModal.vue';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import ProductModalMultiple from './ProductModalMultiple.vue';
+  import userSearch from './user-search.vue';
+  import jobDialog from './jobDialog.vue';
+  import standardOutput from './standardOutput.vue';
+  import term from '../qualityTesting/term';
+  import fileIndex from '../file/index.vue';
+  import fileBrowse from '../file/fileBrowse.vue';
+  import replaceMaterialPop from './replaceMaterialPop.vue';
+  import { filePageAPI } from '@/api/material/file';
+  import { getBomGetById, getDetailList } from '@/api/material/BOM.js';
+  import mbomDatailList from './mbomDatailList.vue';
+  export default {
+    components: {
+      userSearch,
+      ParamModal,
+      // fileUpload,
+      ProductModal,
+      jobDialog,
+      ProductModalMultiple,
+      standardOutput,
+      term,
+      fileIndex,
+      fileBrowse,
+      replaceMaterialPop,
+      mbomDatailList
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        rules: {
+          baseCount: [
+            { required: true, message: '请输入基本数量', trigger: 'blur' }
+          ],
+          baseCountUnit: [
+            { required: true, message: '请选择单位', trigger: 'change' }
+          ]
         },
-        {
-          align: 'center',
-          prop: 'description',
-          label: '文本描述',
-          showOverflowTooltip: true,
-          minWidth: 110
+        form: {
+          baseCount: '',
+          baseCountUnit: ''
         },
+        baseCountUnit: '',
+        baseCount2: '',
+        baseCountUnit2: '',
+        isView: false,
+        filedList: [],
+        jobFiledList: [],
+        activeName: '工艺参数',
+        attributeData: {},
+        visible: false,
+        title: '配置',
+        statusOption: [
+          {
+            label: '启用',
+            value: 1
+          },
+          {
+            label: '停用',
+            value: 0
+          }
+        ],
+        isReworkBom: ['否', '是'],
+        isReworkBomList: [
+          { label: '否', value: 0 },
+          { label: '是', value: 1 }
+        ],
 
-        {
-          prop: 'maxValue',
-          slot: 'maxValue',
-          label: '参数上限',
-          align: 'center'
-        },
-        {
-          prop: 'minValue',
-          slot: 'minValue',
-          label: '参数下限',
-          align: 'center'
-        },
-        {
-          prop: 'defaultValue',
-          slot: 'defaultValue',
-          label: '默认值',
-          align: 'center'
-        }
-      ],
-      levelOptions: [
-        {
-          label: '初级',
-          value: '1'
-        },
-        {
-          label: '中级',
-          value: '2'
-        },
-        {
-          label: '高级',
-          value: '3'
-        }
-      ],
-      // 表格列配置
-      jobColumns: [
-        {
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center'
-        },
-        {
-          slot: 'type',
-          label: '类型',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110,
-          formatter: (_row) => {
-            return this.getDictValue('工种类型', _row.type);
+        dictList: [], //单位下拉
+
+        // 表格列配置
+        columns1: [],
+        defaultColumns1: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '子项编号',
+            prop: 'subCode',
+            slot: 'subCode',
+            action: 'subCode'
+          },
+          {
+            label: '物料名称',
+            prop: 'categoryName',
+            slot: 'categoryName',
+            action: 'categoryName'
+          },
+          {
+            label: '是否回收料',
+            prop: 'isReworkBom',
+            slot: 'isReworkBom',
+            action: 'isReworkBom'
+          },
+          {
+            label: '编码',
+            prop: 'categoryCode'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '数量',
+            slot: 'count',
+            action: 'count'
+          },
+          {
+            label: '单位',
+            slot: 'unit',
+            action: 'unit'
+          },
+
+          {
+            label: '附件',
+            slot: 'bomArtFiles',
+            action: 'bomArtFiles',
+            minWidth: 150
+          },
+
+          {
+            label: '备注',
+            slot: 'remark',
+            action: 'remark'
           }
-        },
-        {
-          align: 'center',
-          prop: 'code',
-          label: '编码',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          slot: 'name',
-          prop: 'name',
-          label: '名称',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          slot: 'level',
-          prop: 'level',
-          label: '等级',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110,
-          formatter: (_row) => {
-            return this.levelOptions.filter(
-              (item) => _row.level == item.value
-            )[0].label;
+        ],
+        columns: [],
+        // 表格列配置
+        defaultColumns: [
+          {
+            prop: 'sort',
+            slot: 'sort',
+            label: '排序',
+            minWidth: 60
+          },
+          {
+            prop: 'code',
+            label: '参数编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '参数名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            align: 'center',
+            prop: 'description',
+            label: '文本描述',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'maxValue',
+            slot: 'maxValue',
+            label: '参数上限',
+            align: 'center'
+          },
+          {
+            prop: 'minValue',
+            slot: 'minValue',
+            label: '参数下限',
+            align: 'center'
+          },
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '默认值',
+            align: 'center'
           }
-        },
-        {
-          slot: 'hourCost',
-          prop: 'hourCost',
-          label: '标准工时费',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 260,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 表格选中数据
-      jobColumns1: [
-        {
-          label: '编码',
-          prop: 'code',
-          width: 180,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-        {
-          prop: 'name',
-          label: '文档名称',
-          align: 'center',
-          slot: 'name',
-          showOverflowTooltip: true,
-          minWidth: 200
-        },
-
-        {
-          prop: 'storagePath',
-          label: '文件名称',
-          align: 'center',
+        ],
+        levelOptions: [
+          {
+            label: '初级',
+            value: '1'
+          },
+          {
+            label: '中级',
+            value: '2'
+          },
+          {
+            label: '高级',
+            value: '3'
+          }
+        ],
+        // 表格列配置
+        jobColumns: [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            slot: 'type',
+            label: '类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110,
+            formatter: (_row) => {
+              return this.getDictValue('工种类型', _row.type);
+            }
+          },
+          {
+            align: 'center',
+            prop: 'code',
+            label: '编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            slot: 'name',
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            slot: 'level',
+            prop: 'level',
+            label: '等级',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110,
+            formatter: (_row) => {
+              return this.levelOptions.filter(
+                (item) => _row.level == item.value
+              )[0].label;
+            }
+          },
+          {
+            slot: 'hourCost',
+            prop: 'hourCost',
+            label: '标准工时费',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 260,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 表格选中数据
+        jobColumns1: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
+
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
+          },
+
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 260,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
 
-          showOverflowTooltip: true,
-          minWidth: 200,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue[0]?.name;
+        standardCol: [
+          {
+            prop: 'code',
+            label: '编码'
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号'
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measuringUnit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
+        ],
 
-        {
-          prop: 'version',
-          label: '版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
+        rowData: {},
+        treeData: {},
+        currentIndex: 0,
+        tableData: {},
+        beatParam: {
+          newTime: '',
+          time: '',
+          newBeatPrepareTime: '',
+          beatPrepareTime: '',
+          newBeatTime: '',
+          beatTime: '',
+          newBeatRestTime: '',
+          beatRestTime: '',
+          taskPrice: ''
         },
 
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 260,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
+        qualityParam: [],
+        qualityPointParam: [],
+
+        fileShow: false,
+        resourceBomId: '',
+        level: '',
+        attributeData: {}
+      };
+    },
+    created() {
+      this.requestDict('工种类型');
+      this.getDictList('time_unit');
+    },
+    methods: {
+      addFile() {
+        this.fileShow = true;
+      },
+      fileClose(val) {
+        if (val == false) {
+          this.fileShow = false;
+        } else {
+          this.fileShow = false;
+
+          this.$refs.fileTable.setData([
+            ...val,
+            ...this.$refs.fileTable.getData()
+          ]);
+          this.$set(
+            this.tableData.taskParam[this.currentIndex],
+            'fileParam',
+            this.$refs.fileTable.getData()
+          );
         }
-      ],
+      },
 
-      standardCol: [
-        {
-          prop: 'code',
-          label: '编码'
-        },
-        {
-          prop: 'name',
-          label: '名称',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'brandNum',
-          label: '牌号'
-        },
+      async detailsList() {
+        console.log(this.rowData, 'this.rowData');
+        await getDetailList({
+          bomType: this.attributeData.bomType,
+          bomCategoryId: this.resourceBomId,
+          taskId: this.rowData.id
+        }).then((res) => {
+          console.log(res);
+          this.$refs.materialTable.setData(res.data);
 
-        {
-          prop: 'modelType',
-          label: '型号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'measuringUnit',
-          label: '计量单位',
-          showOverflowTooltip: true,
-          minWidth: 90
-        },
+          this.tableData.taskParam[this.currentIndex].materialQuota = res.data;
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-
-      rowData: {},
-      treeData: {},
-      currentIndex: 0,
-      tableData: {},
-      beatParam: {
-        newTime: '',
-        time: '',
-        newBeatPrepareTime: '',
-        beatPrepareTime: '',
-        newBeatTime: '',
-        beatTime: '',
-        newBeatRestTime: '',
-        beatRestTime: '',
-        taskPrice:''
+          console.log(this.tableData, 'this.tableData');
+        });
+        // this.$refs.bomDetailList.open(this.resourceBomId, this.level)
       },
 
-      qualityParam: [],
-      qualityPointParam: [],
-
-      fileShow: false
-    };
-  },
-  created() {
-    this.requestDict('工种类型');
-    this.getDictList('time_unit');
-  },
-  methods: {
-    addFile() {
-      this.fileShow = true;
-    },
-    fileClose(val) {
-      if (val == false) {
-        this.fileShow = false;
-      } else {
-        this.fileShow = false;
-
-        this.$refs.fileTable.setData([
-          ...val,
-          ...this.$refs.fileTable.getData()
+      fileDetails(row) {
+        this.$refs.browseRef.setFileUrl(row);
+      },
+      addJob() {
+        this.$refs.jobRef.open();
+      },
+      chooseJob(data) {
+        this.$refs.jobTable.setData([
+          ...data,
+          ...this.$refs.jobTable.getData()
         ]);
         this.$set(
           this.tableData.taskParam[this.currentIndex],
-          'fileParam',
-          this.$refs.fileTable.getData()
+          'aptitudeParam',
+          this.$refs.jobTable.getData()
         );
-      }
-    },
+      },
+      determineChoose(title, row, idx) {
+        let type = '';
+        if (this.activeName === '材料定额') {
+          type = 'materialQuota';
+        } else if (this.activeName === '制造资源') {
+          type = 'resource';
+        }
+        if (title == '选择物料') {
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'categoryName',
+            row.name
+          );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'categoryId',
+            row.id
+          );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'categoryCode',
+            row.code
+          );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'unit',
+            row.measuringUnit
+          );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'weightUnit',
+            row.weightUnit
+          );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'brandNum',
+            row.brandNum
+          );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'modelType',
+            row.modelType
+          );
+        }
+      },
+      uploadedSuccess(data, row) {
+        row.bomArtFiles = data[0].storePath;
+        this.filedList = [];
+      },
+      uploadedJobSuccess(data, row) {
+        row.path = data[0].storePath;
+        row.name = data[0].name;
+        this.jobFiledList = [];
+      },
+      downloadFile(url) {
+        getFile({ objectName: url }, '附件');
+      },
+      categorySelect(row, idx) {
+        this.$refs.productRefs.open(row, '选择物料', '1', idx);
+      },
+      handleDel(row, index) {
+        let type = '';
+        if (this.activeName === '材料定额') {
+          type = 'materialQuota';
+        } else if (this.activeName === '制造资源') {
+          type = 'resource';
+        } else if (this.activeName === '工种') {
+          type = 'aptitudeParam';
+        } else if (this.activeName === '工艺文件') {
+          type = 'fileParam';
+        } else if (this.activeName === '标准产出') {
+          type = 'standardOutput';
+        } else if (this.activeName === '关键设备') {
+          type = 'standardDevice';
+        }
 
-    fileDetails(row) {
-      this.$refs.browseRef.setFileUrl(row);
-    },
-    addJob() {
-      this.$refs.jobRef.open();
-    },
-    chooseJob(data) {
-      this.$refs.jobTable.setData([
-        ...data,
-        ...this.$refs.jobTable.getData()
-      ]);
-      this.$set(
-        this.tableData.taskParam[this.currentIndex],
-        'aptitudeParam',
-        this.$refs.jobTable.getData()
-      );
-    },
-    determineChoose(title, row, idx) {
-      let type = '';
-      if (this.activeName === '材料定额') {
-        type = 'materialQuota';
-      } else if (this.activeName === '制造资源') {
-        type = 'resource';
-      }
-      if (title == '选择物料') {
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'categoryName',
-          row.name
-        );
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'categoryId',
-          row.id
-        );
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'categoryCode',
-          row.code
-        );
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'unit',
-          row.measuringUnit
-        );
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'weightUnit',
-          row.weightUnit
-        );
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'brandNum',
-          row.brandNum
-        );
-        this.$set(
-          this.tableData.taskParam[this.currentIndex][type][idx],
-          'modelType',
-          row.modelType
+        this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
+      },
+      addProductList(list) {
+        let subCode = 0;
+        let array = [];
+        list.map((item, index) => {
+          let max = '';
+          if (
+            this.tableData.taskParam[this.currentIndex]['materialQuota']
+              .length > 0
+          ) {
+            max =
+              Math.max(
+                ...this.tableData.taskParam[this.currentIndex][
+                  'materialQuota'
+                ].map((i) => i.subCode)
+              ) +
+              10 * ++index +
+              '';
+
+            if (max.length < 4) {
+              max = new Array(4 - max.length).fill('0').join('') + max;
+            }
+          } else {
+            max = 10 * ++index + '';
+            if (max.length < 4) {
+              max = new Array(4 - max.length).fill('0').join('') + max;
+            }
+          }
+
+          console.log('item', this.isValueANumber(item.specification));
+
+          if (
+            item.categoryLevelPathIdParent == 8 &&
+            this.isValueANumber(this.baseCount) &&
+            this.isValueANumber(item.specification)
+          ) {
+            let num = this.baseCount / item.specification;
+            item.count = num == 'Infinity' ? '' : num.toFixed(3);
+          }
+
+          subCode = max.substring(0, max.length - 1) + '0';
+          array.push({
+            subCode,
+            id: item.id,
+            categoryName: item.name,
+            categoryCode: item.code,
+            isReworkBom: 0,
+            brandNum: item.brandNum,
+            count: item.count || '',
+            modelType: item.modelType,
+            unit: item.measuringUnit,
+            bomArtFiles: [],
+            remark: '',
+            specification: item.specification,
+            rootCategoryLevelId: item.categoryLevelPathIdParent,
+            extInfo: item.extInfo
+          });
+        });
+
+        let _arr =
+          this.tableData.taskParam[this.currentIndex].materialQuota.concat(
+            array
+          );
+        let uniqueArray = [];
+
+        uniqueArray = _arr.reduce((acc, current) => {
+          const existing = acc.find((item) => item.id === current.id);
+          if (!existing) {
+            acc.push(current);
+          }
+          return acc;
+        }, []);
+
+        this.tableData.taskParam[this.currentIndex].materialQuota = uniqueArray;
+
+        this.$refs.materialTable.setData(
+          this.tableData.taskParam[this.currentIndex].materialQuota
         );
-      }
-    },
-    uploadedSuccess(data, row) {
-      row.bomArtFiles = data[0].storePath;
-      this.filedList = [];
-    },
-    uploadedJobSuccess(data, row) {
-      row.path = data[0].storePath;
-      row.name = data[0].name;
-      this.jobFiledList = [];
-    },
-    downloadFile(url) {
-      getFile({ objectName: url }, '附件');
-    },
-    categorySelect(row, idx) {
-      this.$refs.productRefs.open(row, '选择物料', '1', idx);
-    },
-    handleDel(row, index) {
-      let type = '';
-      if (this.activeName === '材料定额') {
-        type = 'materialQuota';
-      } else if (this.activeName === '制造资源') {
-        type = 'resource';
-      } else if (this.activeName === '工种') {
-        type = 'aptitudeParam';
-      } else if (this.activeName === '工艺文件') {
-        type = 'fileParam';
-      } else if (this.activeName === '标准产出') {
-        type = 'standardOutput';
-      } else if (this.activeName === '关键设备') {
-        type = 'standardDevice';
-      }
+      },
 
-      this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
-    },
-    addProductList(list) {
-      let subCode = 0;
-      let array = [];
-      list.map((item, index) => {
-        let max = '';
+      isValueANumber(variable) {
+        if (variable === undefined || variable === null) {
+          return false; // 变量没有值
+        }
+        if (typeof variable === 'number') {
+          return true; // 基本类型的数字
+        }
         if (
-          this.tableData.taskParam[this.currentIndex]['materialQuota']
-            .length > 0
+          (typeof variable === 'string' &&
+            !isNaN(variable) &&
+            !variable.includes('.')) ||
+          (variable.includes('.') && !variable.endsWith('.'))
         ) {
-          max =
+          // 字符串类型的数字(注意:这个正则表达式判断较为简单,可能需要根据实际情况调整)
+          // 或者使用 Number.isFinite(parseFloat(variable)) 来代替这部分逻辑,但要注意性能开销和边缘情况
+          const num = Number(variable);
+          return !isNaN(num) && isFinite(num);
+        }
+        return false; // 其他类型
+      },
+
+      add() {
+        let subCode = '0010';
+        let type = '';
+        if (this.activeName === '材料定额') {
+          this.$refs.productMultipleRefs.open(1);
+          return;
+        } else if (this.activeName === '标准产出') {
+          this.$refs.standardOutputRefs.open(9);
+          return;
+        } else if (this.activeName === '关键设备') {
+          this.$refs.standardOutputRefs.open(4);
+          return;
+        } else if (this.activeName === '制造资源') {
+          type = 'resource';
+        }
+        console.log(this.tableData.taskParam[this.currentIndex]);
+        if (this.tableData.taskParam[this.currentIndex][type].length) {
+          let max =
             Math.max(
-              ...this.tableData.taskParam[this.currentIndex][
-                'materialQuota'
-              ].map((i) => i.subCode)
+              ...this.tableData.taskParam[this.currentIndex][type].map(
+                (i) => i.subCode
+              )
             ) +
-            10 * ++index +
+            10 +
             '';
 
           if (max.length < 4) {
             max = new Array(4 - max.length).fill('0').join('') + max;
           }
-        } else {
-          max = 10 * ++index + '';
-          if (max.length < 4) {
-            max = new Array(4 - max.length).fill('0').join('') + max;
-          }
+          subCode = max.substring(0, max.length - 1) + '0';
         }
 
-        console.log('item', this.isValueANumber(item.specification));
-
-        if (
-          item.categoryLevelPathIdParent == 8 &&
-          this.isValueANumber(this.baseCount) &&
-          this.isValueANumber(item.specification)
-        ) {
-          let num = this.baseCount / item.specification;
-          item.count = num == 'Infinity' ? '' : num.toFixed(3);
-        }
-
-        subCode = max.substring(0, max.length - 1) + '0';
-        array.push({
+        this.tableData.taskParam[this.currentIndex][type].push({
           subCode,
-          id: item.id,
-          categoryName: item.name,
-          categoryCode: item.code,
+          categoryId: '',
+          categoryName: '',
           isReworkBom: 0,
-          brandNum: item.brandNum,
-          count: item.count || '',
-          modelType: item.modelType,
-          unit: item.measuringUnit,
-          bomArtFiles: [],
-          remark: '',
-          specification: item.specification,
-          rootCategoryLevelId: item.categoryLevelPathIdParent,
-          extInfo: item.extInfo
+          brandNum: '',
+          count: '',
+          modelType: '',
+          unit: ''
         });
-      });
-
-      let _arr = this.tableData.taskParam[this.currentIndex].materialQuota.concat(
-        array
-      );
-      let uniqueArray = []
-
-      uniqueArray = _arr.reduce((acc, current) => {
-        const existing = acc.find(item => item.id === current.id);
-        if (!existing) {
-          acc.push(current);
+      },
+      /* 表格数据源 */
+      async datasource() {
+        return [];
+      },
+      tabsChange() {
+        console.log(this.activeName);
+        console.log(this.tableData.taskParam[this.currentIndex]);
+
+        if (this.activeName === '工艺参数') {
+          // 工艺参数
+          this.$refs.table.setData(
+            this.tableData.taskParam[this.currentIndex].produceList || []
+          );
+        } else if (this.activeName === '质检项参数') {
+          this.qualityParam =
+            this.tableData.taskParam[this.currentIndex].qualityParam || [];
+        } else if (this.activeName === '生产节拍') {
+          this.beatParam =
+            this.tableData.taskParam[this.currentIndex].beatParam ||
+            this.beatParam;
+        } else if (this.activeName === '材料定额') {
+          this.$refs.materialTable.setData(
+            this.tableData.taskParam[this.currentIndex].materialQuota || []
+          );
+        } else if (this.activeName === '制造资源') {
+          this.$refs.resourceTable.setData(
+            this.tableData.taskParam[this.currentIndex].resource || []
+          );
+        } else if (this.activeName === '工种') {
+          if (
+            JSON.stringify(
+              this.tableData.taskParam[this.currentIndex].aptitudeParam
+            ) == '{}'
+          ) {
+            this.tableData.taskParam[this.currentIndex].aptitudeParam = [];
+            this.$refs.jobTable.setData([]);
+          } else {
+            this.$refs.jobTable.setData(
+              this.tableData.taskParam[this.currentIndex].aptitudeParam
+            );
+          }
+        } else if (this.activeName === '工艺文件') {
+          if (
+            JSON.stringify(
+              this.tableData.taskParam[this.currentIndex].fileParam
+            ) == '{}'
+          ) {
+            this.tableData.taskParam[this.currentIndex].fileParam = [];
+            this.$refs.fileTable.setData([]);
+          } else {
+            let fileId = this.tableData.taskParam[this.currentIndex].fileParam;
+            if (fileId.length > 0) {
+              this.fileParamDatasource(fileId);
+            }
+            // this.$refs.fileTable.setData(
+            //   this.tableData.taskParam[this.currentIndex].fileParam
+            // );
+          }
+        } else if (this.activeName === '标准产出') {
+          this.$refs.standard.setData(
+            this.tableData.taskParam[this.currentIndex].standardOutput || []
+          );
+        } else if (this.activeName === '关键设备') {
+          this.$refs.deviceTabRef.setData(
+            this.tableData.taskParam[this.currentIndex].standardDevice || []
+          );
         }
-        return acc;
-      }, []);
-
-
-
-      this.tableData.taskParam[this.currentIndex].materialQuota = uniqueArray
-
-
-
-
-      this.$refs.materialTable.setData(
-        this.tableData.taskParam[this.currentIndex].materialQuota
-      );
-    },
-
-    isValueANumber(variable) {
-      if (variable === undefined || variable === null) {
-        return false; // 变量没有值
-      }
-      if (typeof variable === 'number') {
-        return true; // 基本类型的数字
-      }
-      if (
-        (typeof variable === 'string' &&
-          !isNaN(variable) &&
-          !variable.includes('.')) ||
-        (variable.includes('.') && !variable.endsWith('.'))
-      ) {
-        // 字符串类型的数字(注意:这个正则表达式判断较为简单,可能需要根据实际情况调整)
-        // 或者使用 Number.isFinite(parseFloat(variable)) 来代替这部分逻辑,但要注意性能开销和边缘情况
-        const num = Number(variable);
-        return !isNaN(num) && isFinite(num);
-      }
-      return false; // 其他类型
-    },
-
-    add() {
-      let subCode = '0010';
-      let type = '';
-      if (this.activeName === '材料定额') {
-        this.$refs.productMultipleRefs.open(1);
-        return;
-      } else if (this.activeName === '标准产出') {
-        this.$refs.standardOutputRefs.open(9);
-        return;
-      } else if (this.activeName === '关键设备') {
-        this.$refs.standardOutputRefs.open(4);
-        return;
-      } else if (this.activeName === '制造资源') {
-        type = 'resource';
-      }
-      console.log(this.tableData.taskParam[this.currentIndex]);
-      if (this.tableData.taskParam[this.currentIndex][type].length) {
-        let max =
-          Math.max(
-            ...this.tableData.taskParam[this.currentIndex][type].map(
-              (i) => i.subCode
-            )
-          ) +
-          10 +
-          '';
-
-        if (max.length < 4) {
-          max = new Array(4 - max.length).fill('0').join('') + max;
+      },
+      openParam(type) {
+        let tableData = [];
+        if (type === '工艺') {
+          tableData = this.$refs.table.getData();
+        } else {
+          tableData = this.$refs.qualityTable.getData();
         }
-        subCode = max.substring(0, max.length - 1) + '0';
-      }
-
-      this.tableData.taskParam[this.currentIndex][type].push({
-        subCode,
-        categoryId: '',
-        categoryName: '',
-        isReworkBom: 0,
-        brandNum: '',
-        count: '',
-        modelType: '',
-        unit: ''
-      });
-    },
-    /* 表格数据源 */
-    async datasource() {
-      return [];
-    },
-    tabsChange() {
-      console.log(this.activeName);
-      console.log(this.tableData.taskParam[this.currentIndex]);
-
-      if (this.activeName === '工艺参数') {
-        // 工艺参数
-        this.$refs.table.setData(
-          this.tableData.taskParam[this.currentIndex].produceList || []
+        this.$refs.paramRefs.open(tableData);
+      },
+      chooseModal(data) {
+        let dom = null;
+        if (this.activeName === '工艺参数') {
+          dom = this.$refs.table;
+        }
+        dom.setData([...data, ...dom.getData()]);
+        this.$set(
+          this.tableData.taskParam[this.currentIndex],
+          this.activeName === '工艺参数' ? 'produceList' : '',
+          dom.getData()
         );
-      } else if (this.activeName === '质检项参数') {
-        this.qualityParam =
-          this.tableData.taskParam[this.currentIndex].qualityParam || [];
-      } else if (this.activeName === '生产节拍') {
+      },
 
-        this.beatParam =
-          this.tableData.taskParam[this.currentIndex].beatParam || this.beatParam;
+      chooseStandardList(type, data) {
+        let dom = null;
 
+        if (type == 9) {
+          dom = this.$refs.standard;
+          dom.setData([data[0]]);
 
-      } else if (this.activeName === '材料定额') {
-        this.$refs.materialTable.setData(
-          this.tableData.taskParam[this.currentIndex].materialQuota || []
-        );
-      } else if (this.activeName === '制造资源') {
-        this.$refs.resourceTable.setData(
-          this.tableData.taskParam[this.currentIndex].resource || []
-        );
-      } else if (this.activeName === '工种') {
-        if (
-          JSON.stringify(
-            this.tableData.taskParam[this.currentIndex].aptitudeParam
-          ) == '{}'
-        ) {
-          this.tableData.taskParam[this.currentIndex].aptitudeParam = [];
-          this.$refs.jobTable.setData([]);
-        } else {
-          this.$refs.jobTable.setData(
-            this.tableData.taskParam[this.currentIndex].aptitudeParam
+          this.$set(
+            this.tableData.taskParam[this.currentIndex],
+            'standardOutput',
+            dom.getData()
+          );
+        } else if (type == 4) {
+          dom = this.$refs.deviceTabRef;
+          dom.setData([data[0]]);
+
+          this.$set(
+            this.tableData.taskParam[this.currentIndex],
+            'standardDevice',
+            dom.getData()
           );
         }
-      } else if (this.activeName === '工艺文件') {
-        if (
-          JSON.stringify(
-            this.tableData.taskParam[this.currentIndex].fileParam
-          ) == '{}'
-        ) {
-          this.tableData.taskParam[this.currentIndex].fileParam = [];
-          this.$refs.fileTable.setData([]);
+      },
+      remove(row, type) {
+        let dom = null;
+        if (type === '工艺') {
+          dom = this.$refs.table;
         } else {
-          let fileId=this.tableData.taskParam[this.currentIndex].fileParam
-          if(fileId.length > 0){
-             this.fileParamDatasource(fileId)
-          }
-          // this.$refs.fileTable.setData(
-          //   this.tableData.taskParam[this.currentIndex].fileParam
-          // );
+          dom = this.$refs.qualityTable;
+        }
+        const data = dom.getData();
+        if (row.id) {
+          dom.setData(data.filter((d) => d.id !== row.id));
+        } else {
+          dom.setData(data.filter((d) => d.paramId !== row.paramId));
         }
-      } else if (this.activeName === '标准产出') {
-        this.$refs.standard.setData(
-          this.tableData.taskParam[this.currentIndex].standardOutput || []
-        );
-      } else if (this.activeName === '关键设备') {
-        this.$refs.deviceTabRef.setData(
-          this.tableData.taskParam[this.currentIndex].standardDevice || []
-        );
-      }
-    },
-    openParam(type) {
-      let tableData = [];
-      if (type === '工艺') {
-        tableData = this.$refs.table.getData();
-      } else {
-        tableData = this.$refs.qualityTable.getData();
-      }
-      this.$refs.paramRefs.open(tableData);
-    },
-    chooseModal(data) {
-      let dom = null;
-      if (this.activeName === '工艺参数') {
-        dom = this.$refs.table;
-      }
-      dom.setData([...data, ...dom.getData()]);
-      this.$set(
-        this.tableData.taskParam[this.currentIndex],
-        this.activeName === '工艺参数' ? 'produceList' : '',
-        dom.getData()
-      );
-    },
-
-    chooseStandardList(type, data) {
-      let dom = null;
-
-      if (type == 9) {
-        dom = this.$refs.standard;
-        dom.setData([data[0]]);
-
         this.$set(
           this.tableData.taskParam[this.currentIndex],
-          'standardOutput',
+          type === '工艺' ? 'produceList' : 'qualityParam',
           dom.getData()
         );
-      } else if (type == 4) {
-        dom = this.$refs.deviceTabRef;
-        dom.setData([data[0]]);
-
-        this.$set(
-          this.tableData.taskParam[this.currentIndex],
-          'standardDevice',
-          dom.getData()
+      },
+      open(rowData, treeData, tableData, isView, attributeData, resourceBomId) {
+        this.columns = [];
+        this.columns1 = [];
+        this.isView = isView; //true详情 false编辑
+        this.resourceBomId = resourceBomId;
+        this.attributeData = attributeData;
+
+        if (!this.isView) {
+          this.columns = this.defaultColumns.concat({
+            columnKey: 'action',
+            label: '操作',
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          });
+
+          this.columns1 = this.defaultColumns1.concat({
+            action: 'action',
+            slot: 'action',
+            label: '操作'
+          });
+        } else {
+          this.columns = this.defaultColumns;
+          this.columns1 = this.defaultColumns1;
+        }
+        this.rowData = JSON.parse(JSON.stringify(rowData));
+        this.treeData = JSON.parse(JSON.stringify(treeData));
+        this.tableData = JSON.parse(JSON.stringify(tableData));
+        this.currentIndex = tableData.taskParam.findIndex(
+          (item) => item.id === rowData.id
         );
-      }
-    },
-    remove(row, type) {
-      let dom = null;
-      if (type === '工艺') {
-        dom = this.$refs.table;
-      } else {
-        dom = this.$refs.qualityTable;
-      }
-      const data = dom.getData();
-      if (row.id) {
-        dom.setData(data.filter((d) => d.id !== row.id));
-      } else {
-        dom.setData(data.filter((d) => d.paramId !== row.paramId));
-      }
-      this.$set(
-        this.tableData.taskParam[this.currentIndex],
-        type === '工艺' ? 'produceList' : 'qualityParam',
-        dom.getData()
-      );
-    },
-    open(rowData, treeData, tableData, isView) {
-      this.columns = [];
-      this.columns1 = [];
-      this.isView = isView; //true详情 false编辑
-
-
-      if (!this.isView) {
-        this.columns = this.defaultColumns.concat({
-          columnKey: 'action',
-          label: '操作',
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        });
+        this.activeName = '工艺参数';
 
-        this.columns1 = this.defaultColumns1.concat({
-          action: 'action',
-          slot: 'action',
-          label: '操作'
-        });
-      } else {
-        this.columns = this.defaultColumns;
-        this.columns1 = this.defaultColumns1;
-      }
-      this.rowData = JSON.parse(JSON.stringify(rowData));
-      this.treeData = JSON.parse(JSON.stringify(treeData));
-      this.tableData = JSON.parse(JSON.stringify(tableData));
-      this.currentIndex = tableData.taskParam.findIndex(
-        (item) => item.id === rowData.id
-      );
-      this.activeName = '工艺参数';
-
-      // this.baseCount = rowData.baseCount;
-      // this.baseCountUnit = rowData.baseCountUnit;
-
-      this.form.baseCount = rowData.baseCount;
-      this.form.baseCountUnit = rowData.baseCountUnit;
-
-      this.baseCount2 = rowData.baseCount2;
-      this.baseCountUnit2 = rowData.baseCountUnit2;
-
-      this.visible = true;
-      setTimeout(() => {
-        console.log(this.$refs);
-        // 工艺参数
-        this.$refs.table.setData(
-          this.tableData.taskParam[this.currentIndex].produceList
-        );
-      }, 500);
-    },
-    handleClose() {
-      this.visible = false;
-      this.$refs.table.setSelectedRows([]);
-      this.selection = [];
-    },
-    save(type) {
-      if (this.activeName == '材料定额') {
+        // this.baseCount = rowData.baseCount;
+        // this.baseCountUnit = rowData.baseCountUnit;
 
-      }
+        this.form.baseCount = rowData.baseCount;
+        this.form.baseCountUnit = rowData.baseCountUnit;
 
-      this.$refs.form.validate((valid) => {
-        let isYs = true;
-        if (this.activeName == '材料定额') {
-          isYs = valid
-        }
-        if (isYs) {
-          if (this.isView) {
-            this.handleClose();
-          } else {
-            // 保存生产节拍
-            let userInfo = JSON.parse(localStorage.getItem('info'));
-            this.beatParam.createName = userInfo.name;
-            this.beatParam.createTime = dayjs(new Date()).format(
-              'YYYY-MM-DD HH:mm:ss'
-            );
-            this.beatParam.updateName = userInfo.name;
-            this.beatParam.updateTime = dayjs(new Date()).format(
-              'YYYY-MM-DD HH:mm:ss'
-            );
-            this.tableData.taskParam[this.currentIndex].beatParam =
-              this.beatParam;
-            // 保存标准工时
-
-            // 保存材料定额
-            this.tableData.taskParam[this.currentIndex].baseCount =
-              this.form.baseCount;
-            this.tableData.taskParam[this.currentIndex].baseCountUnit =
-              this.form.baseCountUnit;
-
-            this.tableData.taskParam[this.currentIndex].baseCount2 =
-              this.baseCount2;
-            this.tableData.taskParam[this.currentIndex].baseCountUnit2 =
-              this.baseCountUnit2;
-
-            if (this.$refs.qualityParamRef) {
-              this.tableData.taskParam[this.currentIndex].qualityParam =
-                this.$refs.qualityParamRef.getDate() || [];
-            }
-            //工艺文件只传id
-            let fileParamArr=JSON.parse(JSON.stringify(this.tableData.taskParam))
-            fileParamArr.map((item,index)=>{
-              if(item.fileParam.length>0){
-                let val=[]
-                item.fileParam.map((fileItem)=>{
-                  let obj={
-                    id:fileItem.id
-                  }
-                  val.push(obj)
-                })
-                this.$set(
-                    this.tableData.taskParam[index],
-                    'fileParam',
-                    val
-                );
-              }
-            })
-            console.log('111112223344',this.tableData.taskParam)
-            workingProcedureUpdate({
-              id: this.tableData.id,
-              categoryId: this.treeData.categoryId,
-              bomCategoryId: this.treeData.id,
-              categoryCode: this.treeData.categoryCode,
-              taskParam: this.tableData.taskParam
-            }).then(() => {
-              this.$message.success('保存成功');
-              this.$emit('chooseProcess');
-              if (type === 'close') {
-                this.handleClose();
-              }
-            });
-          }
-        }
-      })
-    },
+        this.baseCount2 = rowData.baseCount2;
+        this.baseCountUnit2 = rowData.baseCountUnit2;
 
-    //工艺文件表格回显
-    fileParamDatasource(fileParam) {
-      let fileId=fileParam.map(item => item.id).join(',')
-      filePageAPI({
-          pageNum: 1,
-          size: 999,
-          directoryId: null,
-          lcyStatus: 1,
-          fileType: 0,
-          ids:fileId
-      }).then((res) => {
-        this.$refs.fileTable.setData(
-            res.list
+        this.visible = true;
+        setTimeout(() => {
+          console.log(this.$refs);
+          // 工艺参数
+          this.$refs.table.setData(
+            this.tableData.taskParam[this.currentIndex].produceList
           );
-      })
-      
-    },
-
-    async getDictList(code) {
-      let { data: res } = await getByCode(code);
-
-      this.dictList = res.reduce((acc, curr) => {
-        let key = Object.keys(curr)[0]; // 获取当前对象的键
-        let value = curr[key]; // 获取当前对象的值
-        acc.push({ value, label: value }); // 将 { value, label } 格式的对象添加到数组中
-        return acc;
-      }, []); // 初始值为空数组 []
-    },
-
-
+        }, 500);
 
-    convertToSeconds(time) {
-      switch (this.beatParam.unit) {
-        case '秒':
-          return time;
-        case '分钟':
-          return time * 60;
-        case '小时':
-          return time * 3600;
-        case '天':
-          return time * 86400; // 24小时 * 60分钟 * 60秒
-        case '月':
-          // 近似值,一个月按30天计算
-          return time * 86400 * 30;
-        case '年':
-          // 近似值,一年按365天计算
-          return time * 86400 * 365;
-        case '毫秒':
-          return time / 1000;
-        case '微秒':
-          return time / 1000000;
-        default:
-          this.$message.error('不支持的时间单位: ' + unit);
-      }
-    },
+        this.getBomLevel();
+      },
 
-    convertVal(val, name) {
-      if (!this.beatParam.unit) {
-        return this.$message.error('请选择时间单位');
-      }
+      async getBomLevel() {
+        await getBomGetById(this.resourceBomId).then((res) => {
+          if (res.data.level) {
+            this.level = res.data.level;
+          }
+        });
+      },
 
-      const isNumeric = /^\d*(\.\d+)?$/.test(val);
-      if (isNumeric) {
-        this.beatParam[name] = this.convertToSeconds(val);
-      } else {
-        this.$message.error('请输入数字');
-        this.beatParam[name] = ''
-      }
+      handleClose() {
+        this.visible = false;
+        this.$refs.table.setSelectedRows([]);
+        this.selection = [];
+      },
+      save(type) {
+        if (this.activeName == '材料定额') {
+        }
 
+        this.$refs.form.validate((valid) => {
+          let isYs = true;
+          if (this.activeName == '材料定额') {
+            isYs = valid;
+          }
+          if (isYs) {
+            if (this.isView) {
+              this.handleClose();
+            } else {
+              // 保存生产节拍
+              let userInfo = JSON.parse(localStorage.getItem('info'));
+              this.beatParam.createName = userInfo.name;
+              this.beatParam.createTime = dayjs(new Date()).format(
+                'YYYY-MM-DD HH:mm:ss'
+              );
+              this.beatParam.updateName = userInfo.name;
+              this.beatParam.updateTime = dayjs(new Date()).format(
+                'YYYY-MM-DD HH:mm:ss'
+              );
+              this.tableData.taskParam[this.currentIndex].beatParam =
+                this.beatParam;
+              // 保存标准工时
+
+              // 保存材料定额
+              this.tableData.taskParam[this.currentIndex].baseCount =
+                this.form.baseCount;
+              this.tableData.taskParam[this.currentIndex].baseCountUnit =
+                this.form.baseCountUnit;
+
+              this.tableData.taskParam[this.currentIndex].baseCount2 =
+                this.baseCount2;
+              this.tableData.taskParam[this.currentIndex].baseCountUnit2 =
+                this.baseCountUnit2;
+
+              if (this.$refs.qualityParamRef) {
+                this.tableData.taskParam[this.currentIndex].qualityParam =
+                  this.$refs.qualityParamRef.getDate() || [];
+              }
+              //工艺文件只传id
+              let fileParamArr = JSON.parse(
+                JSON.stringify(this.tableData.taskParam)
+              );
+              fileParamArr.map((item, index) => {
+                if (item.fileParam.length > 0) {
+                  let val = [];
+                  item.fileParam.map((fileItem) => {
+                    let obj = {
+                      id: fileItem.id
+                    };
+                    val.push(obj);
+                  });
+                  this.$set(this.tableData.taskParam[index], 'fileParam', val);
+                }
+              });
+              console.log('111112223344', this.tableData.taskParam);
+              workingProcedureUpdate({
+                id: this.tableData.id,
+                categoryId: this.treeData.categoryId,
+                bomCategoryId: this.treeData.id,
+                categoryCode: this.treeData.categoryCode,
+                taskParam: this.tableData.taskParam
+              }).then(() => {
+                this.$message.success('保存成功');
+                this.$emit('chooseProcess');
+                if (type === 'close') {
+                  this.handleClose();
+                }
+              });
+            }
+          }
+        });
+      },
 
+      //工艺文件表格回显
+      fileParamDatasource(fileParam) {
+        let fileId = fileParam.map((item) => item.id).join(',');
+        filePageAPI({
+          // pageNum: 1,
+          // size: 999,
+          // directoryId: null,
+          // lcyStatus: 1,
+          // fileType: 0,
+          // ids: fileId
+          ids: "'" + fileId + "'"
+        }).then((res) => {
+          this.$refs.fileTable.setData(res);
+        });
+      },
 
-    },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
 
-    changeUnit() {
-      this.beatParam.newTime = '';
-      this.beatParam.time = '';
-      this.beatParam.newBeatPrepareTime = '';
-      this.beatParam.beatPrepareTime = '';
-      this.beatParam.newBeatTime = '';
-      this.beatParam.beatTime = '';
-      this.beatParam.newBeatRestTime = '';
-      this.beatParam.beatRestTime = '';
-      this.beatParam.taskPrice = '';
+        this.dictList = res.reduce((acc, curr) => {
+          let key = Object.keys(curr)[0]; // 获取当前对象的键
+          let value = curr[key]; // 获取当前对象的值
+          acc.push({ value, label: value }); // 将 { value, label } 格式的对象添加到数组中
+          return acc;
+        }, []); // 初始值为空数组 []
+      },
 
-    },
+      convertToSeconds(time) {
+        switch (this.beatParam.unit) {
+          case '秒':
+            return time;
+          case '分钟':
+            return time * 60;
+          case '小时':
+            return time * 3600;
+          case '天':
+            return time * 86400; // 24小时 * 60分钟 * 60秒
+          case '月':
+            // 近似值,一个月按30天计算
+            return time * 86400 * 30;
+          case '年':
+            // 近似值,一年按365天计算
+            return time * 86400 * 365;
+          case '毫秒':
+            return time / 1000;
+          case '微秒':
+            return time / 1000000;
+          default:
+            this.$message.error('不支持的时间单位: ' + unit);
+        }
+      },
 
-    handSubstitution(row) {
-      this.$refs.replaceMaterialRef.open(row);
-    },
-    replaceSelected(id, list) {
+      convertVal(val, name) {
+        if (!this.beatParam.unit) {
+          return this.$message.error('请选择时间单位');
+        }
 
-      let _arr = []
-      _arr = this.tableData.taskParam[this.currentIndex].materialQuota
-      _arr.forEach(item => {
-        if (item.id === id) {
-          item.replaceMaterial = list;
+        const isNumeric = /^\d*(\.\d+)?$/.test(val);
+        if (isNumeric) {
+          this.beatParam[name] = this.convertToSeconds(val);
+        } else {
+          this.$message.error('请输入数字');
+          this.beatParam[name] = '';
         }
-      })
-      this.tableData.taskParam[this.currentIndex].materialQuota = _arr
+      },
 
-    }
+      changeUnit() {
+        this.beatParam.newTime = '';
+        this.beatParam.time = '';
+        this.beatParam.newBeatPrepareTime = '';
+        this.beatParam.beatPrepareTime = '';
+        this.beatParam.newBeatTime = '';
+        this.beatParam.beatTime = '';
+        this.beatParam.newBeatRestTime = '';
+        this.beatParam.beatRestTime = '';
+        this.beatParam.taskPrice = '';
+      },
 
-  }
-};
+      handSubstitution(row) {
+        this.$refs.replaceMaterialRef.open(row);
+      },
+      replaceSelected(id, list) {
+        let _arr = [];
+        _arr = this.tableData.taskParam[this.currentIndex].materialQuota;
+        _arr.forEach((item) => {
+          if (item.id === id) {
+            item.replaceMaterial = list;
+          }
+        });
+        this.tableData.taskParam[this.currentIndex].materialQuota = _arr;
+      }
+    }
+  };
 </script>
 
 <style lang="scss" scoped>
-.btns {
-  text-align: center;
-  padding: 10px 0;
-}
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
 
-.downLoad {
-  display: flex;
-}
+  .downLoad {
+    display: flex;
+  }
 
-.toolbar_box {
-  float: right;
-  margin-right: 10px;
+  .toolbar_box {
+    float: right;
+    margin-right: 10px;
 
-  >div {
-    display: flex;
-    align-items: center;
-    justify-content: center;
+    > div {
+      display: flex;
+      align-items: center;
+      justify-content: center;
 
-    >span {
-      width: 150px;
-    }
+      > span {
+        width: 150px;
+      }
 
-    >div {
-      margin-left: 10px;
+      > div {
+        margin-left: 10px;
+      }
     }
   }
-}
-.item-height{
-  margin-bottom: 20px;
-}
+  .item-height {
+    margin-bottom: 20px;
+  }
 </style>

+ 17 - 15
src/views/material/BOMmanage/components/workingStep.vue

@@ -559,13 +559,13 @@
                     filterable
                     class="ele-block"
                   >
-                  <el-option
-                    v-for="item in dictList"
-                    :key="item.value"
-                    :value="item.value"
-                    :label="item.label"
-                  ></el-option>
-               </el-select>
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ standardParam.unit }}</div>
                 </el-form-item>
               </el-col>
@@ -595,8 +595,10 @@
             :immediate="true"
           >
             <!-- 表头工具栏 -->
-            <template  v-slot:toolbar>
-              <el-button type="primary" v-if="!isView" @click="add">添加</el-button>
+            <template v-slot:toolbar>
+              <el-button type="primary" v-if="!isView" @click="add"
+                >添加</el-button
+              >
               <div class="toolbar_box">
                 <div
                   ><span>基本数量</span>
@@ -605,7 +607,6 @@
                   <DictSelection dictName="计量单位" v-model="baseCountUnit"
                 /></div>
               </div>
-          
             </template>
             <template v-slot:action="{ row, $index }">
               <el-link type="primary" @click="handleDel(row, $index)"
@@ -831,7 +832,9 @@
           >
             <!-- 表头工具栏 -->
             <template v-slot:toolbar>
-              <el-button type="primary"  v-if="!isView" @click="add">添加</el-button>
+              <el-button type="primary" v-if="!isView" @click="add"
+                >添加</el-button
+              >
 
               <div class="toolbar_box">
                 <div
@@ -841,7 +844,6 @@
                   <DictSelection dictName="计量单位" v-model="baseCountUnit2"
                 /></div>
               </div>
-              
             </template>
             <template v-slot:action="{ row, $index }">
               <el-link type="primary" @click="handleDel(row, $index)"
@@ -1337,8 +1339,8 @@
           this.baseCount = rowData.baseCount;
           this.baseCountUnit = rowData.baseCountUnit;
 
-         this.baseCount2 = rowData.baseCount2;
-         this.baseCountUnit2 = rowData.baseCountUnit2;
+          this.baseCount2 = rowData.baseCount2;
+          this.baseCountUnit2 = rowData.baseCountUnit2;
 
           this.visible = true;
           setTimeout(() => {
@@ -1386,7 +1388,7 @@
             label: item[values[0]]
           };
         });
-      },
+      }
     }
   };
 </script>

+ 5 - 3
src/views/material/BOMmanage/components/workmanship.vue

@@ -430,8 +430,8 @@
           .then((res) => {
             if (res.data) {
               this.$message.success('保存成功');
-            }else{
-               this.$message.error('保存失败');
+            } else {
+              this.$message.error('保存失败');
             }
           })
           .catch((err) => {
@@ -469,7 +469,9 @@
           row,
           this.taskParam,
           this.currentTableData,
-          !!isView
+          !!isView,
+          this.attributeData,
+          this.resourceBomId
         );
       },
       openStepConfigure(row, isView) {

+ 11 - 31
src/views/material/BOMmanage/file/index.vue

@@ -53,22 +53,16 @@
               :selection.sync="selection"
               highlight-current-row
             >
-
-            <template v-slot:action="{ row, $index }">
-           
-              <el-link type="primary"  @click="fileDetails(row)"
-                >详情</el-link
-              >
-            </template>
-
+              <template v-slot:action="{ row, $index }">
+                <el-link type="primary" @click="fileDetails(row)">详情</el-link>
+              </template>
             </ele-pro-table>
           </template>
         </ele-split-layout>
       </el-card>
     </div>
 
-
-    <fileBrowse  ref="browseRef"></fileBrowse>
+    <fileBrowse ref="browseRef"></fileBrowse>
 
     <div slot="footer">
       <el-button type="primary" @click="handleSave"> 选择 </el-button>
@@ -81,8 +75,7 @@
   import { getDocTreeListAPI, filePageAPI } from '@/api/material/file';
   import { mapGetters } from 'vuex';
 
-
-      import fileBrowse from '../file/fileBrowse.vue'
+  import fileBrowse from '../file/fileBrowse.vue';
 
   export default {
     components: { fileBrowse },
@@ -208,9 +201,6 @@
             resizable: false,
             slot: 'action',
             fixed: 'right'
-
-            
-
           }
         ]
       };
@@ -243,12 +233,7 @@
 
       datasource({ page, limit, where }) {
         return filePageAPI({
-          ...where,
-          pageNum: page,
-          size: limit,
-          directoryId: this.parentData?.id,
-          lcyStatus: '3',
-          fileType: 0
+          ids: "'" + this.parentData?.id + "'"
         });
       },
       /* 刷新表格 */
@@ -278,20 +263,15 @@
       },
       handleSave() {
         // 检查选中的条目数量
-        if(this.selection.length == 0) return this.$message.warning('请选择一条数据')
-        console.log('this.selection1111',this.selection)
+        if (this.selection.length == 0)
+          return this.$message.warning('请选择一条数据');
+        console.log('this.selection1111', this.selection);
         this.$emit('close', JSON.parse(JSON.stringify(this.selection)));
       },
 
-
       fileDetails(row) {
-         this.$refs.browseRef.setFileUrl(row)
-      },
-
-
-
-
-
+        this.$refs.browseRef.setFileUrl(row);
+      }
     }
   };
 </script>

+ 223 - 106
src/views/material/BOMmanage/qualityTesting/inspectionTemplate.vue

@@ -1,119 +1,236 @@
 <template>
-    <ele-modal title="选择" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
-        :close-on-press-escape="false" append-to-body width="60%" :maxable="true">
-        <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 605px)"
-            tool-class="ele-toolbar-form" cache-key="inspectionClassify" row-key="qualityLevelId"
-            :current.sync="current" :highlight-current-row="true" @current-change="handleCurrentChange">
-            <template v-slot:current="{ row, _index }">
-                <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
-            </template>
-            <template v-slot:status="{ row }">
-                {{ row.status ? '启用' : '停用' }}
-            </template>
+  <ele-modal
+    title="选择"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="60%"
+    :maxable="true"
+  >
+    <el-form
+      label-width="77px"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+    >
+      <el-row type="flex" :gutter="24">
+        <el-col :span="6">
+          <el-form-item label="质检类型" label-width="100px">
+            <el-select
+              v-model="where.type"
+              placeholder="请选择"
+              style="width: 100%"
+              clearable
+            >
+              <el-option
+                :label="item.label"
+                v-for="item in typeList"
+                :key="item.value"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="编码" label-width="100px">
+            <el-input
+              clearable
+              v-model.trim="where.qualitySchemeTemplateCode"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
 
-        </ele-pro-table>
-        <span slot="footer" class="dialog-footer">
-            <el-button @click="handleClose">取消</el-button>
-            <el-button type="primary" @click="changeSel">选择</el-button>
-        </span>
-    </ele-modal>
+        <el-col :span="6">
+          <el-form-item label="名称" label-width="100px">
+            <el-input
+              clearable
+              v-model.trim="where.qualitySchemeTemplateName"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="4">
+          <div class="ele-form-actions">
+            <el-button
+              type="primary"
+              class="ele-btn-icon"
+              size="small"
+              @click="reload"
+            >
+              查询
+            </el-button>
+            <el-button size="small" plain @click="reset">重置</el-button>
+          </div>
+        </el-col>
+      </el-row>
+    </el-form>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 400px)"
+      tool-class="ele-toolbar-form"
+      cache-key="inspectionClassify"
+      row-key="qualityLevelId"
+      :current.sync="current"
+      :highlight-current-row="true"
+      @current-change="handleCurrentChange"
+    >
+      <template v-slot:current="{ row, _index }">
+        <el-radio class="radio" v-model="radio" :label="row.id"
+          ><i></i
+        ></el-radio>
+      </template>
+      <template v-slot:status="{ row }">
+        {{ row.status ? '启用' : '停用' }}
+      </template>
+    </ele-pro-table>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" @click="changeSel">选择</el-button>
+    </span>
+  </ele-modal>
 </template>
 
 <script>
-import { getTemplateList } from '@/api/material/inspectionClassify';
+  import { getTemplateList } from '@/api/material/inspectionClassify';
+  import { getByCode } from '@/api/system/dictionary-data';
 
-export default {
+  export default {
     components: {},
     data() {
-        return {
-            visible: false,
-            selection: [],
-            current: null,
-            radio: '',
-            columns: [
-                // {
-                //     width: 45,
-                //     type: 'selection',
-                //     columnKey: 'selection',
-                //     align: 'center',
-                //     reserveSelection: true
-                // },
-                {
-                    width: 55,
-                    columnKey: 'current',
-                    slot: 'current',
-                    align: 'center'
-                },
-                {
-                    columnKey: 'index',
-                    label: '序号',
-                    type: 'index',
-                    width: 55,
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    fixed: 'left'
-                },
-                {
-                    prop: 'qualitySchemeTemplateCode',
-                    label: '质检方案编码',
-                    showOverflowTooltip: true,
-                    align: 'center',
-                    minWidth: 110
-                },
-                {
-                    prop: 'qualitySchemeTemplateName',
-                    label: '质检方案名称',
-                    align: 'center',
-                    minWidth: 150
-                },
-                {
-                    label: '状态',
-                    prop: 'status',
-                    slot: 'status',
-                    align: 'center'
-                },
-                {
-                    prop: 'templateRemark',
-                    label: '备注',
-                    showOverflowTooltip: true,
-                    align: 'center',
-                    minWidth: 110
-                },
-            ]
-        };
+      const defaultWhere = {
+        qualitySchemeTemplateCode: '',
+        qualitySchemeTemplateName: '',
+        type: ''
+      };
+      return {
+        visible: false,
+        selection: [],
+        current: null,
+        radio: '',
+        columns: [
+          // {
+          //     width: 45,
+          //     type: 'selection',
+          //     columnKey: 'selection',
+          //     align: 'center',
+          //     reserveSelection: true
+          // },
+          {
+            width: 55,
+            columnKey: 'current',
+            slot: 'current',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'qualitySchemeTemplateCode',
+            label: '质检方案编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'qualitySchemeTemplateName',
+            label: '质检方案名称',
+            align: 'center',
+            minWidth: 150
+          },
+          {
+            prop: 'type',
+            label: '质检类型',
+            slot: 'type',
+            align: 'center',
+            minWidth: 150,
+            planList: this.typeList
+          },
+          {
+            label: '状态',
+            prop: 'status',
+            slot: 'status',
+            align: 'center'
+          },
+          {
+            prop: 'templateRemark',
+            label: '备注',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          }
+        ],
+        where: { ...defaultWhere },
+        typeList: []
+      };
+    },
+
+    mounted() {
+      this.getInspectionType();
     },
-    methods: {
-        datasource({ page, where, limit }) {
-            return getTemplateList({
-                ...where,
-                pageNum: page,
-                size: limit
-            });
-        },
 
-        // 多选
-        selectionChangeHandle(val) {
-            this.selection = val;
-        },
-        open() {
-            this.visible = true;
-        },
-        handleClose() {
-            this.$nextTick(() => {
-                this.current = null;
-                this.radio = ''
-            })
-            this.visible = false
-        },
-        changeSel() {
-            this.$emit('changeSel', this.current);
-            this.handleClose()
+    methods: {
+      datasource({ page, where, limit }) {
+        console.log(1111);
+        return getTemplateList({
+          qualitySchemeTemplateCode: this.where.qualitySchemeTemplateCode,
+          qualitySchemeTemplateName: this.where.qualitySchemeTemplateName,
+          type: this.where.type,
+          pageNum: page,
+          size: limit
+        });
+      },
 
-        },
-        handleCurrentChange(row) {
-            this.radio = row.id
-        },
+      // 多选
+      selectionChangeHandle(val) {
+        this.selection = val;
+      },
+      open() {
+        this.visible = true;
+      },
+      search() {},
 
+      reload() {
+        this.$refs.table.reload();
+      },
+      handleClose() {
+        this.$nextTick(() => {
+          this.current = null;
+          this.radio = '';
+        });
+        this.visible = false;
+      },
+      changeSel() {
+        this.$emit('changeSel', this.current);
+        this.handleClose();
+      },
+      handleCurrentChange(row) {
+        this.radio = row.id;
+      },
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.reload();
+      },
+      async getInspectionType() {
+        let res = await getByCode('inspection_plan_type');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.typeList = list;
+        }
+      }
     }
-};
-</script>
+  };
+</script>

+ 208 - 159
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -1,10 +1,22 @@
 <template>
   <div>
-    <ele-pro-table ref="table" :columns="columns" :datasource="list" height="calc(100vh - 605px)"
-      tool-class="ele-toolbar-form" cache-key="inspectionClassify" row-key="qualityLevelId" :selection.sync="selection">
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="list"
+      height="calc(100vh - 500px)"
+      tool-class="ele-toolbar-form"
+      cache-key="inspectionClassify"
+      row-key="qualityLevelId"
+      :selection.sync="selection"
+    >
       <template v-slot:toolbar>
-        <el-button @click="handAdd" size="mini" type="primary" v-if="!isView">新增质检项</el-button>
-        <el-button @click="handSelect" size="mini" type="primary" v-if="!isView">选择质检方案</el-button>
+        <el-button @click="handAdd" size="mini" type="primary" v-if="!isView"
+          >新增质检项</el-button
+        >
+        <el-button @click="handSelect" size="mini" type="primary" v-if="!isView"
+          >选择质检方案</el-button
+        >
       </template>
 
       <template v-slot:textType="{ row }">
@@ -12,18 +24,18 @@
           row.textType == 1
             ? '数值'
             : row.textType == 2
-              ? '选择'
-              : row.textType == 3
-                ? '上下限'
-                : row.textType == 4
-                  ? '规格'
-                  : row.textType == 5
-                    ? '时间'
-                    : row.textType == 6
-                      ? '范围'
-                      : row.textType == 7
-                        ? '文本'
-                        : ''
+            ? '选择'
+            : row.textType == 3
+            ? '上下限'
+            : row.textType == 4
+            ? '规格'
+            : row.textType == 5
+            ? '时间'
+            : row.textType == 6
+            ? '范围'
+            : row.textType == 7
+            ? '文本'
+            : ''
         }}
       </template>
 
@@ -34,29 +46,54 @@
       <template v-slot:defaultValue="{ row }">
         <div style="width: 100%; display: flex; justify-content: space-between">
           <div style="width: 8%">
-            <DictSelection style="width: 100px" clearable dictName="数学字符" v-model="row.symbol"></DictSelection>
+            <DictSelection
+              style="width: 100px"
+              clearable
+              dictName="数学字符"
+              v-model="row.symbol"
+            ></DictSelection>
             <!-- <el-input v-model="row.symbol" :disabled="isView"> </el-input> -->
           </div>
           <!-- 上下限 -->
-          <div v-if="row.textType == 3" style="
+          <div
+            v-if="row.textType == 3"
+            style="
               display: flex;
               align-items: center;
               justify-content: space-between;
               width: 75%;
-            ">
-            <el-input style="width: 45%" v-model="row.minValue" :disabled="isView"></el-input>
+            "
+          >
+            <el-input
+              style="width: 45%"
+              v-model="row.minValue"
+              :disabled="isView"
+            ></el-input>
             <span>&nbsp;&nbsp;-</span>
-            
-            <el-input style="width: 45%; margin-left: 10px" v-model="row.maxValue" :disabled="isView"></el-input>
+
+            <el-input
+              style="width: 45%; margin-left: 10px"
+              v-model="row.maxValue"
+              :disabled="isView"
+            ></el-input>
           </div>
 
           <div v-else style="width: 75%">
-            <el-input v-model="row.defaultValue" placeholder="请输入" :disabled="isView">
+            <el-input
+              v-model="row.defaultValue"
+              placeholder="请输入"
+              :disabled="isView"
+            >
             </el-input>
           </div>
 
           <div style="width: 15%">
-            <DictSelection dictName="工艺参数单位" clearable filterable v-model="row.unit">
+            <DictSelection
+              dictName="工艺参数单位"
+              clearable
+              filterable
+              v-model="row.unit"
+            >
             </DictSelection>
             <!-- <el-input v-model="row.unit" :disabled="isView"> </el-input> -->
           </div>
@@ -64,7 +101,11 @@
       </template>
 
       <template v-slot:action="{ row, $index }">
-        <el-popconfirm class="ele-action" title="确定要删除当前质检项吗?" @confirm="handDel($index)">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除当前质检项吗?"
+          @confirm="handDel($index)"
+        >
           <template v-slot:reference>
             <el-link type="danger" :underline="false" icon="el-icon-delete">
               删除
@@ -76,159 +117,167 @@
 
     <termPop ref="termRef" @selectChange="selectChange"></termPop>
 
-    <inspectionTemplatePop ref="inspectionTemplateRef" @changeSel="changeSel"></inspectionTemplatePop>
+    <inspectionTemplatePop
+      ref="inspectionTemplateRef"
+      @changeSel="changeSel"
+    ></inspectionTemplatePop>
   </div>
 </template>
 
 <script>
-import termPop from './inspectionClassify/index.vue';
-import inspectionTemplatePop from './inspectionTemplate.vue';
+  import termPop from './inspectionClassify/index.vue';
+  import inspectionTemplatePop from './inspectionTemplate.vue';
 
-import dictMixins from '@/mixins/dictMixins';
-import { getByCode } from '@/api/system/dictionary-data';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getByCode } from '@/api/system/dictionary-data';
 
-import { getTemplateById } from '@/api/material/inspectionClassify';
+  import { getTemplateById } from '@/api/material/inspectionClassify';
 
-export default {
-  components: { termPop, inspectionTemplatePop },
-  mixins: [dictMixins],
-  props: {
-    qualityParam: {
-      type: Array
+  export default {
+    components: { termPop, inspectionTemplatePop },
+    mixins: [dictMixins],
+    props: {
+      qualityParam: {
+        type: Array
+      },
+      isView: {
+        type: Boolean,
+        default: false
+      }
     },
-    isView: {
-      type: Boolean,
-      default: false
-    }
-  },
 
-  watch: {
-    qualityParam: {
-      handler(val) {
-        this.list = val;
-        this.$forceUpdate();
-      },
-      deep: true,
-      immediate: true
-    }
-  },
-
-  data() {
-    return {
-      list: [],
-      dictList: [],
-
-      selection: [],
-
-      columns: [
-        // {
-        //   prop: 'sort',
-        //   label: '排序号',
-        //   align: 'center',
-
-        // },
-        {
-          prop: 'categoryLevelClassName',
-          label: '质检类型',
-          align: 'center',
-          minWidth: 110
-        },
-        // {
-        //   prop: 'categoryLevelName',
-        //   label: '质检类型',
-        //   align: 'center',
-        //   minWidth: 110
-        // },
-
-        {
-          prop: 'inspectionName',
-          label: '质检名称',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
+    watch: {
+      qualityParam: {
+        handler(val) {
+          this.list = val;
+          this.$forceUpdate();
         },
+        deep: true,
+        immediate: true
+      }
+    },
 
-        {
-          prop: 'defaultValue',
-          slot: 'defaultValue',
-          label: '工艺参数',
-          align: 'center',
-          width: 700
-        },
+    data() {
+      return {
+        list: [],
+        dictList: [],
 
-        // {
-        //   label: '工艺要求',
-        //   prop: 'inspectionStandard',
-        //   formatter: (row, column, cellValue) => {
-        //     return row.symbol + ' ' + cellValue + ' ' + row.unit;
-        //   },
-        //   minWidth: 350
-        // },
-
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 80,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right'
-        }
-      ]
-    };
-  },
-
-  created() {
-    this.requestDict('质检标准类型');
-    // this.getDictList('mathematical_symbol'); // 数学字符
-  },
-
-  methods: {
-    handDel(index) {
-      this.$confirm('是否删除该质检项', '删除', {
-        type: 'warning'
-      })
-        .then(() => {
-          this.list.splice(index, 1);
-        })
-        .catch(() => { });
-    },
+        selection: [],
 
-    handAdd() {
-      this.$refs.termRef.open(this.list);
-    },
+        columns: [
+          // {
+          //   prop: 'sort',
+          //   label: '排序号',
+          //   align: 'center',
 
-    async getDictList(code) {
-      let { data: res } = await getByCode(code);
-      this.dictList = res.map((item) => {
-        let values = Object.keys(item);
-        return {
-          value: Number(values[0]),
-          label: item[values[0]]
-        };
-      });
-    },
+          // },
+          {
+            prop: 'categoryLevelClassName',
+            label: '质检类型',
+            align: 'center',
+            minWidth: 110
+          },
+          // {
+          //   prop: 'categoryLevelName',
+          //   label: '质检类型',
+          //   align: 'center',
+          //   minWidth: 110
+          // },
 
-    getDate() {
-      return this.list;
-    },
+          {
+            prop: 'inspectionName',
+            label: '质检名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '工艺参数',
+            align: 'center',
+            width: 700
+          },
+
+          // {
+          //   label: '工艺要求',
+          //   prop: 'inspectionStandard',
+          //   formatter: (row, column, cellValue) => {
+          //     return row.symbol + ' ' + cellValue + ' ' + row.unit;
+          //   },
+          //   minWidth: 350
+          // },
 
-    selectChange(list) {
-      this.list = list;
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ]
+      };
     },
-    handSelect() {
-      this.$refs.inspectionTemplateRef.open();
+
+    created() {
+      this.requestDict('质检标准类型');
+
+      console.log(
+        document.documentElement.clientHeight,
+        'document.documentElement.clientHeight'
+      );
+      // this.getDictList('mathematical_symbol'); // 数学字符
     },
-    changeSel(list) {
-      console.log(list, 'list')
-      // let ids = list.map((item) => item.id).toString();
-      // console.log(ids, 'ids')
-      getTemplateById(list.id).then(({ data }) => {
-        this.list = [...this.list, ...(data.inspectionItemVOList || [])];
-      });
+
+    methods: {
+      handDel(index) {
+        this.$confirm('是否删除该质检项', '删除', {
+          type: 'warning'
+        })
+          .then(() => {
+            this.list.splice(index, 1);
+          })
+          .catch(() => {});
+      },
+
+      handAdd() {
+        this.$refs.termRef.open(this.list);
+      },
+
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: Number(values[0]),
+            label: item[values[0]]
+          };
+        });
+      },
+
+      getDate() {
+        return this.list;
+      },
+
+      selectChange(list) {
+        this.list = list;
+      },
+      handSelect() {
+        this.$refs.inspectionTemplateRef.open();
+      },
+      changeSel(list) {
+        console.log(list, 'list');
+        // let ids = list.map((item) => item.id).toString();
+        // console.log(ids, 'ids')
+        getTemplateById(list.id).then(({ data }) => {
+          this.list = [...this.list, ...(data.inspectionItemVOList || [])];
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 22 - 1
src/views/material/product/detail.vue

@@ -85,7 +85,11 @@
                 label="生产类型"
                 prop="produceType"
                 :rules="{
-                  required: form.categoryLevelPathId == 9 ? true : false,
+                  required:
+                    form.categoryLevelPathId == 9 ||
+                    form.componentAttribute.includes(1) == 1
+                      ? true
+                      : false,
                   message: '请选择生产类型',
                   trigger: 'change'
                 }"
@@ -829,6 +833,23 @@
         }
       },
 
+      // changeAttribute(val) {
+      //   if (val.includes(1)) {
+      //     // this.rules = {
+      //     //   produceType: [
+      //     //     { required: true, message: '请选择生产类型', trigger: 'change' }
+      //     //   ]
+      //     // };
+      //     this.rules.produceType = [
+      //       { required: true, message: '请选择生产类型', trigger: 'change' }
+      //     ];
+      //   } else {
+      //     if (this.rules.produceType) {
+      //       delete this.rules.produceType;
+      //     }
+      //   }
+      // },
+
       changePackagingSpecification(val) {
         this.packagingSpecificationList = val;
       },