695593266@qq.com преди 11 месеца
родител
ревизия
49c7fd1570

+ 15 - 7
src/api/system/dictionary-data/index.js

@@ -4,7 +4,7 @@ import request from '@/utils/request';
  * 分页查询字典数据
  * @param params 查询条件
  */
-export async function pageDictionaryData (id) {
+export async function pageDictionaryData(id) {
   const res = await request.get(`/system/dict/getById/${id}`, {});
   if (res.data.code == 0) {
     return res.data;
@@ -15,7 +15,7 @@ export async function pageDictionaryData (id) {
  * 根据code查字典
  * @param params 查询条件
  */
-export async function getByCode (code) {
+export async function getByCode(code) {
   const res = await request.get(`/system/dict/getByCode/${code}`, {});
   if (res.data.code == 0) {
     return res.data;
@@ -23,11 +23,19 @@ export async function getByCode (code) {
   return Promise.reject(new Error(res.data.message));
 }
 
+export async function parameterGetByCode(data) {
+  const res = await request.post('/sys/parameter/getByCode', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 查询字典数据列表
  * @param params 查询条件
  */
-export async function listDictionaryData (params) {
+export async function listDictionaryData(params) {
   const res = await request.get('/system/dictionary-data', {
     params
   });
@@ -41,7 +49,7 @@ export async function listDictionaryData (params) {
  * 添加字典数据
  * @param data 字典数据信息
  */
-export async function addDictionaryData (data) {
+export async function addDictionaryData(data) {
   const res = await request.post('/system/dictionary-data', data);
   if (res.data.code === 0) {
     return res.data.message;
@@ -53,7 +61,7 @@ export async function addDictionaryData (data) {
  * 修改字典数据
  * @param data 字典数据信息
  */
-export async function updateDictionaryData (data) {
+export async function updateDictionaryData(data) {
   const res = await request.put('/system/dictionary-data', data);
   if (res.data.code === 0) {
     return res.data.message;
@@ -65,7 +73,7 @@ export async function updateDictionaryData (data) {
  * 删除字典数据
  * @param id 字典数据id
  */
-export async function removeDictionaryData (id) {
+export async function removeDictionaryData(id) {
   const res = await request.post('/system/dict/removeDictInfoById', [id]);
   if (res.data.code == 0) {
     return res.data.message;
@@ -77,7 +85,7 @@ export async function removeDictionaryData (id) {
  * 批量删除字典数据
  * @param data 字典数据id集合
  */
-export async function removeDictionaryDataBatch (data) {
+export async function removeDictionaryDataBatch(data) {
   const res = await request.delete('/system/dictionary-data/batch', {
     data
   });

+ 45 - 1
src/api/technology/route/index.js

@@ -103,7 +103,8 @@ export default {
   //工艺路线列表-变更
   taskinstanceChange: async (data) => {
     const res = await request.post(
-      '/main/producerouting/taskinstance/change/' , data
+      '/main/producerouting/taskinstance/change/',
+      data
     );
     if (res.data.code == 0) {
       return res.data.message;
@@ -133,5 +134,48 @@ export default {
     if (res.data.code == 0) {
       return res.data.data;
     }
+  },
+
+  // 获取分类与工艺路线的关联列表
+  getCategoryAndRouteList: async (data) => {
+    const res = await request.post(
+      '/main/categoryLevel/categoryLevelRouting',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+
+  //获取产品和物品分类列表
+  getCategoryList: async (params) => {
+    const res = await request.get(`/main/categorylevelrouting/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+
+  //批量保存分类与工艺路线的关联
+  batchSaveCategory: async (data) => {
+    const res = await request.post(
+      '/main/categorylevelrouting/batchSave',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+
+  //删除工艺路线关联的产品分类
+  deteleRoutingCategory: async (data) => {
+    const res = await request.delete('/main/categorylevelrouting/delete', {
+      data
+    });
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
   }
 };

+ 311 - 300
src/views/factoryModel/station/components/ProductModal.vue

@@ -1,21 +1,47 @@
 <template>
-  <ele-modal :title="title" :visible.sync="visible" v-if="visible" :before-close="handleClose"
-    :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="75%" :maxable="true">
+  <ele-modal
+    :title="title"
+    :visible.sync="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="75%"
+    :maxable="true"
+  >
     <el-card shadow="never">
       <ProductSearch @search="reload" ref="searchRef" />
 
-      <ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
         <div class="ele-border-lighter split-layout-right-content">
-          <AssetTree ref="assetTreeRef" :id="categoryLevelId" @handleNodeClick="handleNodeClick" />
+          <AssetTree
+            ref="assetTreeRef"
+            :id="categoryLevelId"
+            @handleNodeClick="handleNodeClick"
+          />
         </div>
         <!-- 表格 -->
         <template v-slot:content>
-          <ele-pro-table ref="table" :columns="isLedger ? columns2 : columns" :datasource="datasource" row-key="id"
-            height="calc(100vh - 350px)" class="dict-table" @cell-click="cellClick">
+          <ele-pro-table
+            ref="table"
+            :columns="isLedger ? columns2 : columns"
+            :datasource="datasource"
+            row-key="id"
+            height="calc(100vh - 350px)"
+            class="dict-table"
+            @cell-click="cellClick"
+          >
             <!-- 表头工具栏 -->
             <template v-slot:action="{ row }">
               <span v-if="deviceList.includes(row.id)">已占用</span>
-              <el-radio v-else class="radio"  v-model="radio" :label="row.id"><i></i></el-radio>
+              <el-radio v-else class="radio" v-model="radio" :label="row.id"
+                ><i></i
+              ></el-radio>
             </template>
           </ele-pro-table>
         </template>
@@ -29,316 +55,301 @@
 </template>
 
 <script>
-import AssetTree from '@/components/AssetTree';
-import ProductSearch from '@/views/technology/productParam/components/product-search.vue'
-import { getMaterialList } from '@/api/material/list.js';
-import { getAssetList } from '@/api/ledgerAssets/index'
-import {
-  allDeviceList
-} from '@/api/factoryModel';
-
-export default {
-  components: { AssetTree, ProductSearch },
-  props: {
-    isLedger: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      visible: false,
-
-      deviceList: [],
-
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          type: 'index',
-          width: 45,
-          align: 'center',
-          reserveSelection: true
-        },
-        {
-          action: 'action',
-          slot: 'action',
-          align: 'center',
-          label: '选择',
-          fixed: 'left'
-        },
-        {
-          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
-        },
-
-        {
-          prop: 'weightUnit',
-          label: '重量单位',
-          showOverflowTooltip: true,
-          minWidth: 90
-        },
-
-        {
-          prop: 'roughWeight',
-          label: '毛重',
-          showOverflowTooltip: true,
-          minWidth: 90
-        },
-
-        {
-          prop: 'netWeight',
-          label: '净重',
-          showOverflowTooltip: true,
-          minWidth: 90
-        },
-
-
-        {
-          prop: 'packingUnit',
-          align: 'center',
-          label: '包装单位',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryLevelPath',
-          label: '分类',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-     
-      ],
-
-      columns2: [
-        {
-          columnKey: 'index',
-          type: 'index',
-          label: '序号',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          action: 'action',
-          slot: 'action',
-          align: 'center',
-          fixed: 'left',
-          label: '选择'
-        },
-        {
-          prop: 'fixCode',
-          label: '固资编码',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'code',
-          label: '编码'
-        },
-        {
-          prop: 'name',
-          label: '名称',
-          showOverflowTooltip: true
-        },
-
-        {
-          prop: 'codeNumber',
-          label: '编号',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-
-        {
-          prop: 'category.modelType',
-          label: '型号',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'category.specification',
-          label: '规格',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'pathName',
-          label: '位置',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row) => {
-            return _row.position[0]&&_row.position[0].pathName;
-          }
-        },
-        {
-          prop: 'source',
-          label: '生命周期',
-          showOverflowTooltip: true,
-          minWidth: 110
-        }
-      ],
-
-      title: null,
-      categoryLevelId: null,
-      radio: null,
-      idx: null,
-
-      isCategory: true
-    }
-  },
-
-  created() {
-  
-  },
-
-  watch: {
-
-  },
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, where, limit }) {
-      let URL = this.isLedger ? getAssetList : getMaterialList
-
-      if (this.isCategory) {
-        return URL({
-          ...where,
-          pageNum: page,
-          size: limit,
-          categoryLevelId: this.categoryLevelId
-        });
-      } else {
-        return URL({
-          ...where,
-          pageNum: page,
-          size: limit,
-        });
+  import AssetTree from '@/components/AssetTree';
+  import ProductSearch from '@/views/technology/productParam/components/product-search.vue';
+  import { getMaterialList } from '@/api/material/list.js';
+  import { getAssetList } from '@/api/ledgerAssets/index';
+  import { allDeviceList } from '@/api/factoryModel';
+
+  export default {
+    components: { AssetTree, ProductSearch },
+    props: {
+      isLedger: {
+        type: Boolean,
+        default: false
       }
-
     },
-    handleNodeClick(data) {
-      this.isCategory = true
-      this.categoryLevelId = data.id;
-      this.$refs.table.reload({ pageNum: 1, where: {} });
-      this.$refs.searchRef.reset2()
+    data() {
+      return {
+        visible: false,
+
+        deviceList: [],
+
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择',
+            fixed: 'left'
+          },
+          {
+            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
+          },
+
+          {
+            prop: 'weightUnit',
+            label: '重量单位',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'roughWeight',
+            label: '毛重',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'netWeight',
+            label: '净重',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'packingUnit',
+            align: 'center',
+            label: '包装单位',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ],
+
+        columns2: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            fixed: 'left',
+            label: '选择'
+          },
+          {
+            prop: 'fixCode',
+            label: '固资编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'code',
+            label: '编码'
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'codeNumber',
+            label: '编号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'category.modelType',
+            label: '型号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'category.specification',
+            label: '规格',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'pathName',
+            label: '位置',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.position[0] && _row.position[0].pathName;
+            }
+          },
+          {
+            prop: 'source',
+            label: '生命周期',
+            showOverflowTooltip: true,
+            minWidth: 110
+          }
+        ],
 
+        title: null,
+        categoryLevelId: null,
+        radio: null,
+        idx: null,
 
+        isCategory: true
+      };
     },
 
-    getAllDeviceList() {
-      allDeviceList().then(res => {
-      
-        this.deviceList =  res.map(item => {
-           return item.assetId
-        })
-       
-          
-      })
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.isCategory = false
-      this.$refs.table.reload({ pageNum: 1, where: where });
-    },
-    open(item, title, categoryLevelId, idx) {
-      if (item) {
-        this.title = title
-        this.categoryLevelId = categoryLevelId
-        this.idx = idx
-
-        this.current = {
-          id: item.categoryId,
-          name: item.categoryName,
-          code: item.categoryCode
+    created() {},
+
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        let URL = this.isLedger ? getAssetList : getMaterialList;
+
+        if (this.isCategory) {
+          return URL({
+            ...where,
+            pageNum: page,
+            size: limit,
+            categoryLevelId: this.categoryLevelId
+          });
+        } else {
+          return URL({
+            ...where,
+            pageNum: page,
+            size: limit
+          });
+        }
+      },
+      handleNodeClick(data) {
+        this.isCategory = true;
+        this.categoryLevelId = data.id;
+        this.$refs.table.reload({ pageNum: 1, where: {} });
+        this.$refs.searchRef.reset2();
+      },
+
+      getAllDeviceList() {
+        allDeviceList().then((res) => {
+          this.deviceList = res.map((item) => {
+            return item.assetId;
+          });
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.isCategory = false;
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+      open(item, title, categoryLevelId, idx) {
+        if (item) {
+          this.title = title;
+          this.categoryLevelId = categoryLevelId;
+          this.idx = idx;
+
+          this.current = {
+            id: item.categoryId,
+            name: item.categoryName,
+            code: item.categoryCode
+          };
+          this.radio = item.categoryId;
+        }
+        this.getAllDeviceList();
+        this.visible = true;
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请选择工作中心');
         }
-        this.radio = item.categoryId
-
-      }
-      this.getAllDeviceList()
-      this.visible = true
-    },
-
-
-
 
+        if (this.deviceList.includes(this.current.id)) {
+          return this.$message.warning('该设备已被占用,请重新选择');
+        }
 
-    // 单击获取id
-    cellClick(row) {
-      this.current = row
-      this.radio = row.id
-    },
-    handleClose() {
-      this.visible = false
-      this.current = null
-      this.radio = ''
-    },
-    selected() {
-      if (!this.current) {
-        return this.$message.warning('请选择工作中心')
+        this.$emit('changeProduct', this.title, this.current, this.idx);
+        this.handleClose();
       }
-      this.$emit('changeProduct', this.title, this.current, this.idx)
-      this.handleClose()
-    },
-  }
-}
+    }
+  };
 </script>
 
 <style lang="scss" scoped>
-.tree_col {
-  border: 1px solid #eee;
-  padding: 10px 0;
-  box-sizing: border-box;
-  height: 500px;
-  overflow: auto;
-}
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
 
-.table_col {
-  padding-left: 10px;
+  .table_col {
+    padding-left: 10px;
 
-  ::v-deep .el-table th.el-table__cell {
-    background: #f2f2f2;
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
   }
-}
 
-.pagination {
-  text-align: right;
-  padding: 10px 0;
-}
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
 
-.btns {
-  text-align: center;
-  padding: 10px 0;
-}
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
 
-.topsearch {
-  margin-bottom: 15px;
-}
+  .topsearch {
+    margin-bottom: 15px;
+  }
 </style>

+ 9 - 1
src/views/factoryModel/station/components/edit.vue

@@ -701,6 +701,11 @@
           if (this.type != 'edit') {
             delete this.form.id;
           }
+
+          if (this.form.extInfo.type == 3) {
+            this.form.extInfo.assetId = null;
+            this.form.extInfo.assetCode = null;
+          }
           // this.form.workstationSubstanceList =
           //   this.$refs.equipmentTable.datasource.map((n) => {
           //     return {
@@ -860,7 +865,10 @@
             // }
           }
           this.form = Object.assign({}, this.form, res);
-          if ( this.form?.extInfo?.teamId&&typeof(this.form?.extInfo?.teamId ) === 'string') {
+          if (
+            this.form?.extInfo?.teamId &&
+            typeof this.form?.extInfo?.teamId === 'string'
+          ) {
             this.userListFn(this.form.extInfo.teamId);
           }
           if (res.taskList?.length) {

+ 14 - 1
src/views/material/BOMmanage/components/detailedList.vue

@@ -8,8 +8,12 @@
       :columns="columns"
       :pagination="pagination"
       :datasource="datasource"
+      :page-size="20"
+      cache-key="routed_detailed_list"
       class="dict-table"
       tool-class="ele-toolbar-actions"
+      :height="tableHeight"
+      @fullscreen-change="fullscreenChange"
     >
       <template v-slot:toolbar>
         <div class="toolbar_box">
@@ -559,7 +563,8 @@
         gysList: [],
         sccjList: [],
         newTreeId: null,
-        responsesList: []
+        responsesList: [],
+        tableHeight: 'calc(100vh - 450px)'
         // dictList: []
       };
     },
@@ -973,6 +978,14 @@
           .catch(() => {});
       },
 
+      fullscreenChange(fullscreen) {
+        if (fullscreen) {
+          this.tableHeight = 'calc(100vh - 120px)';
+        } else {
+          this.tableHeight = 'calc(100vh - 450px)';
+        }
+      },
+
       handleSave() {
         let _list = this.$refs.table.getData() ?? [];
 

+ 57 - 10
src/views/material/BOMmanage/components/routing.vue

@@ -12,6 +12,7 @@
       >
         <!-- 表头工具栏 -->
         <!-- v-if="attributeData.status != 1 && !isWt" -->
+
         <template v-slot:toolbar>
           <el-button
             v-if="
@@ -19,7 +20,10 @@
                 attributeData.approvalStatus != 2 &&
                 !isWt &&
                 attributeData.parentId == '0') ||
-              !attributeData.resourceBomId
+              (!attributeData.resourceBomId &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2 &&
+                !isWt)
             "
             size="small"
             type="primary"
@@ -35,7 +39,10 @@
                 attributeData.approvalStatus != 2 &&
                 !isWt &&
                 attributeData.parentId == '0') ||
-              !attributeData.resourceBomId
+              (!attributeData.resourceBomId &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2 &&
+                !isWt)
             "
             size="small"
             type="primary"
@@ -71,7 +78,10 @@
                 attributeData.approvalStatus != 2 &&
                 !isWt &&
                 attributeData.parentId == '0') ||
-              !attributeData.resourceBomId
+              (!attributeData.resourceBomId &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2 &&
+                !isWt)
             "
             >删除</el-link
           >
@@ -215,13 +225,12 @@
     },
 
     created() {
-      console.log(this.attributeData, 'attributeDataattributeData');
+      console.log(this.attributeData, 'attributeDataattributeData111');
+      // this.isDelete = false;
     },
 
     methods: {
       add() {
-        console.log(this.taskParam, this.tableData);
-
         this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
       },
 
@@ -258,8 +267,7 @@
       },
 
       selected(dataList) {
-        console.log('1112233');
-        // let routingId = this.selection.map((it) => it.id);
+        console.log(dataList, 'dataList');
         let routingId = dataList.map((it) => it.id);
 
         route.getProcessById(routingId).then((data) => {
@@ -288,7 +296,9 @@
               bomCategoryId: this.taskParam.id,
               categoryCode: this.taskParam.categoryCode,
               processRoute: {
-                list: this.tableData.processRoute.list.concat(dataList)
+                list: this.tableData.processRoute.list
+                  ? this.tableData.processRoute.list.concat(dataList)
+                  : dataList
               },
               taskParam: this.tableData.taskParam.concat(newArr)
             }).then(() => {
@@ -302,7 +312,7 @@
               bomCategoryId: this.taskParam.id,
               categoryCode: this.taskParam.categoryCode,
               processRoute: {
-                list: this.selection
+                list: dataList
               },
               taskParam: data.map((item) => {
                 return {
@@ -340,6 +350,20 @@
         });
         if (data?.length > 0) {
           this.tableData = data[0];
+          const isCreateBom = sessionStorage.getItem('isCreateBom');
+          if (
+            (this.attributeData.approvalStatus == 0 ||
+              this.attributeData.approvalStatus == 3) &&
+            (Object.keys(this.tableData.processRoute).length == 0 ||
+              this.tableData.processRoute.list.length == 0) &&
+            isCreateBom == '2' &&
+            !this.isWt
+          ) {
+            if (this.tableData.routingIdList.length != 0) {
+              // this.selected(this.tableData.routingIdList);
+              this.getAllRouteList();
+            }
+          }
           return data[0].processRoute.list || [];
         } else {
           this.tableData = {};
@@ -347,6 +371,28 @@
         }
       },
 
+      async getAllRouteList() {
+        await route
+          .list({
+            pageNum: 1,
+            size: -1
+          })
+          .then((res) => {
+            let routeList = [];
+            let routeItem = [];
+            this.tableData.routingIdList.forEach((id) => {
+              routeItem = res.list.find((item) => item.id == id);
+              if (routeItem) {
+                routeList.push(routeItem);
+              }
+            });
+            if (routeItem.length != 0) {
+              this.selected(routeList);
+              // console.log(routeList, 'routeListrouteList');
+            }
+          });
+      },
+
       handleDel(row) {
         // route.getProcessById([row.id]).then((data) => {
 
@@ -373,6 +419,7 @@
               }
             }).then((data) => {
               this.$message.success('删除成功');
+              sessionStorage.setItem('isCreateBom', '1');
               this.reload();
             });
           })

+ 12 - 2
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -28,11 +28,11 @@
             </el-form-item>
           </el-col>
           <el-col :span="6" label-width="100px">
-            <el-form-item label="编码" prop="code">
+            <el-form-item label="编码" prop="categoryCode">
               <el-input
                 disabled
                 placeholder="物品编码"
-                v-model="treeData.code"
+                v-model="treeData.categoryCode"
               ></el-input>
             </el-form-item>
           </el-col>
@@ -54,6 +54,16 @@
               ></el-input>
             </el-form-item>
           </el-col>
+
+          <el-col :span="6" label-width="100px">
+            <el-form-item label="bom编码" prop="code">
+              <el-input
+                disabled
+                placeholder="物品规格"
+                v-model="treeData.code"
+              ></el-input>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
 

+ 2 - 1
src/views/material/BOMmanage/detailsPop.vue

@@ -495,7 +495,7 @@
 
         moudleName: 'mainUser',
         isSubmit: false,
-        radioSubmit: 1,
+        radioSubmit: '',
 
         treeId: null,
 
@@ -541,6 +541,7 @@
         this.searchObj = row;
 
         console.log(row, 'rowrowrowrowrow');
+        sessionStorage.setItem('isCreateBom', '2');
 
         if (Object.prototype.hasOwnProperty.call(row, 'isWt') && row.isWt) {
           this.isWt = row.isWt;

+ 11 - 3
src/views/material/BOMmanage/index.vue

@@ -168,12 +168,12 @@
 
   export default {
     name: 'SystemDictionary',
-    components: { BOMSearch, LCdetail, BomDetailsPop,processSubmitDialog },
+    components: { BOMSearch, LCdetail, BomDetailsPop, processSubmitDialog },
     mixins: [tabMixins],
     data() {
       return {
         produceTypeList,
-        processSubmitDialogFlag:false,
+        processSubmitDialogFlag: false,
         // 表格列配置
         columns: [
           {
@@ -278,11 +278,19 @@
           },
           {
             prop: 'createTime',
-            label: '创建日期',
+            label: '创建时间',
             showOverflowTooltip: true,
             slot: 'createTime',
             sortable: true
           },
+
+          {
+            prop: 'updateTime',
+            label: '修改时间',
+            showOverflowTooltip: true,
+            slot: 'updateTime',
+            sortable: true
+          },
           {
             columnKey: 'action',
             slot: 'action',

+ 11 - 4
src/views/material/product/detail.vue

@@ -619,7 +619,7 @@
         categoryQms: [...copyObj(defCategoryQms)],
         categoryVehicle: {},
         categoryWms: {
-          isUnpack: 1,
+          isUnpack: 0,
           isWarn: 1,
           inventoryMode: '',
           secureInventory: '1',
@@ -655,6 +655,7 @@
     watch: {
       '$route.query.id': {
         handler(id) {
+          console.log(id, 'id');
           if (id) {
             this._getDetails();
           } else {
@@ -714,7 +715,7 @@
 
             this.categoryVehicle = {};
             this.categoryWms = {
-              isUnpack: 1,
+              isUnpack: 0,
               isWarn: 1,
               inventoryMode: this.form.isConsumable,
               minPackageCell: '',
@@ -821,8 +822,11 @@
       }).then((res) => {
         if (res.value) {
           this.isNetWeight = res.value;
-          if (this.isNetWeight == 1) {
-            this.$set(this.categoryWms, 'isUnpack', 1);
+          if (this.clientEnvironmentId != 5) {
+            if (this.isNetWeight == 1) {
+              console.log('dadada');
+              this.$set(this.categoryWms, 'isUnpack', 1);
+            }
           }
         }
       });
@@ -869,6 +873,8 @@
       if (this.clientEnvironmentId == 4) {
         this.form.measureType = 3;
         this.$set(this.categoryWms, 'isUnpack', 0);
+      } else if (this.clientEnvironmentId == 5) {
+        this.$set(this.categoryWms, 'isUnpack', 0);
       }
     },
     methods: {
@@ -922,6 +928,7 @@
       },
       changeMeasureType() {
         if (this.form.measureType == 1) {
+          console.log('7897979');
           this.$set(this.categoryWms, 'isUnpack', 1);
         } else {
           this.$set(this.categoryWms, 'isUnpack', 0);

+ 239 - 0
src/views/technology/route/components/chooseCategory.vue

@@ -0,0 +1,239 @@
+<template>
+  <ele-modal
+    :title="title"
+    :visible.sync="categoryVisible"
+    v-if="categoryVisible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    append-to-body
+    :maxable="true"
+    width="60%"
+  >
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      :selection.sync="selection"
+      row-key="id"
+      :page-size="20"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="openEdit(null)"
+          >新增</el-button
+        >
+      </template>
+
+      <template v-slot:routingVersion="{ row }">
+        <span>V{{ row.routingVersion }}</span>
+      </template>
+      <template v-slot:action="{ row }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除此产品分类吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false"> 删除 </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <chooseCategoryList
+      ref="chooseCategoryListRef"
+      @chooseCategory="chooseCategory"
+    ></chooseCategoryList>
+
+    <choose-goods ref="chooseGoodsRef" @chooseGoods="chooseGoods"></choose-goods>
+  </ele-modal>
+</template>
+
+<script>
+  import route from '@/api/technology/route';
+  import chooseCategoryList from './chooseCategoryList.vue';
+  import chooseGoods from './chooseGoods.vue';
+  export default {
+    components: {
+      chooseCategoryList,
+      chooseGoods
+    },
+    data() {
+      return {
+        categoryVisible: false,
+        cacheKeyUrl: 'chooseCategory',
+        selection: [],
+
+        columns: [
+          {
+            prop: 'categoryLevelCode',
+            label: '物品分类编码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'categoryLevelName',
+            label: '物品分类名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+
+          {
+            prop: 'routingName',
+            label: '工艺路线名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'routingCode',
+            label: '工艺路线编码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'factoriesName',
+            label: '工厂名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'routingVersion',
+            slot: 'routingVersion',
+            label: '工艺路线版本',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            slot: 'action'
+          }
+        ],
+
+        listData: [],
+        routeData: {},
+        title: '',
+        type: ''
+      };
+    },
+
+    methods: {
+      open(row, type) {
+        if (type == 1) {
+          this.title = '工艺路线绑定产品分类';
+        } else if (type == 2) {
+          this.title = '工艺路线绑定物品';
+        }
+        this.type = type;
+        this.categoryVisible = true;
+        this.routeData = this.deepCopy(row);
+      },
+
+      async datasource({ page, limit }) {
+        const res = await route.getCategoryList({
+          pageNum: page,
+          size: limit,
+          routingId: this.routeData.id,
+          type: this.type
+        });
+        this.listData = res.data.list;
+        return res.data.list;
+      },
+
+      handleClose() {
+        this.categoryVisible = false;
+        // this.$emit('close');
+      },
+
+      handleColumnChange() {},
+
+      remove(item) {
+        let ids = [];
+        ids.push(item.id);
+        route
+          .deteleRoutingCategory(ids)
+          .then(() => {
+            this.$message.success('删除成功');
+            this.$refs.table.reload();
+          })
+          .catch(() => {
+            this.$message.error('删除失败');
+          });
+      },
+
+      openEdit() {
+        if (this.type == 1) {
+          let ids = [];
+          if (this.listData.length != 0) {
+            ids = this.listData.map((item) => item.categoryLevelId);
+          }
+          this.$refs.chooseCategoryListRef.open(ids, this.type);
+        } else if (this.type == 2) {
+          this.$refs.chooseGoodsRef.open();
+        }
+      },
+
+      chooseCategory(dataList) {
+        let categoryList = [];
+        dataList.forEach((item) => {
+          if (!item.children) {
+            categoryList.push(this.deepCopy(item));
+          }
+        });
+
+        categoryList.forEach((item) => {
+          item.routingId = this.routeData.id;
+          item.routingVersion = this.routeData.version;
+          item.routingName = this.routeData.name;
+          item.routingCode = this.routeData.code;
+          item.categoryLevelCode = item.code;
+          item.categoryLevelId = item.id;
+          item.categoryLevelName = item.name;
+          item.type = this.type;
+        });
+        route
+          .batchSaveCategory(categoryList)
+          .then(() => {
+            this.$message.success('保存成功');
+            this.$refs.table.reload();
+          })
+          .catch(() => {
+            this.$message.error('保存失败');
+          });
+      },
+
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
+
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
+
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 126 - 0
src/views/technology/route/components/chooseCategoryList.vue

@@ -0,0 +1,126 @@
+<!-- 角色权限分配弹窗 -->
+<template>
+  <ele-modal
+    width="460px"
+    title="选择产品分类"
+    :visible="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    append-to-body
+    :maxable="true"
+  >
+    <el-form ref="form" :model="data" label-width="100px">
+      <el-form-item label="产品分类">
+        <el-scrollbar
+          v-loading="categoryLoading"
+          style="height: 60vh"
+          wrap-style="overflow-x: hidden;"
+        >
+          <el-tree
+            ref="tree"
+            show-checkbox
+            :data="categoryData"
+            node-key="id"
+            default-expand-all
+            :props="defaultProps"
+            :default-checked-keys="checkedKeys"
+          >
+            <!--  <el-tree
+        ref="tree"
+        show-checkbox
+        check-strictly
+        :data="authData"
+        node-key="id"
+        :default-expand-all="true"
+        :props="{ label: 'name' }"
+        :default-checked-keys="checkedKeys"
+        @check="handleCheck"
+      >-->
+            <!-- <template v-slot="{ data }">
+          <span>
+            <i :class="data.icon"></i>
+            <span> {{ data.name }}</span>
+          </span>
+        </template> -->
+          </el-tree>
+        </el-scrollbar>
+      </el-form-item>
+    </el-form>
+
+    <template v-slot:footer>
+      <el-button @click="visible = false">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import { getTreeByPid } from '@/api/classifyManage';
+
+  export default {
+    data() {
+      return {
+        // 权限数据
+        categoryData: [],
+        // 权限数据请求状态
+        categoryLoading: false,
+        // 提交状态
+        loading: false,
+        // 角色权限选中的keys
+        checkedKeys: [],
+        ids: [],
+        visible: false,
+        data: {},
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        type: ''
+      };
+    },
+
+    created() {
+      // this.getTreeData();
+    },
+
+    methods: {
+      async getTreeData() {
+        if (this.type == 1) {
+          const res = await getTreeByPid(9);
+          this.categoryData = res.data;
+        } else if(this.type == 2) {
+          
+        }
+
+        // this.checkedKeys = this.ids;
+      },
+
+      open(ids, type) {
+        this.visible = true;
+        this.type = type;
+        this.checkedKeys = [];
+        this.getTreeData();
+        // this.ids = ids;
+        ids.forEach((item) => {
+          this.checkedKeys.push(item);
+        });
+      },
+
+      handleClose() {
+        this.visible = false;
+      },
+
+      save() {
+        // console.log(this.$refs.tree.getCheckedNodes(), 'this.$refs.tree');
+        const chooseDataList = this.$refs.tree.getCheckedNodes();
+        if (chooseDataList.length != 0) {
+          this.$emit('chooseCategory', chooseDataList);
+        }
+        this.handleClose();
+      }
+    }
+  };
+</script>

+ 343 - 0
src/views/technology/route/components/chooseGoods.vue

@@ -0,0 +1,343 @@
+<template>
+  <ele-modal
+    width="80%"
+    title="选择产品分类"
+    :visible="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    append-to-body
+    :maxable="true"
+  >
+    <div class="ele-body">
+      <el-card shadow="never">
+        <ele-split-layout
+          width="300px"
+          allow-collapse
+          :right-style="{ overflow: 'hidden' }"
+        >
+          <div class="ele-border-lighter sys-organization-list">
+            <el-tree
+              :data="treeList"
+              :props="defaultProps"
+              ref="treeRef"
+              :default-expanded-keys="current && current.id ? [current.id] : []"
+              :highlight-current="true"
+              node-key="id"
+              @node-click="handleNodeClick"
+            >
+              <span class="custom-tree-node" slot-scope="{ node, data }">
+                {{ (isCode == 1 ? data.code : '') + ' ' + data.name }}
+              </span>
+            </el-tree>
+          </div>
+
+          <template v-slot:content>
+            <div class="ele-border-lighter form-content" v-loading="loading">
+              <IndexSearch ref="searchRef" @search="reload" />
+
+              <!-- 物品 -->
+              <IndexData
+                ref="listData"
+                v-if="current"
+                :current-id="current.id"
+                :data="current"
+                :rootTreeId="rootTreeId"
+                :rootId="rootId"
+                :oneProduct="false"
+                :currentData="currentData"
+                cacheKeyUrl="9b62e840-material-product"
+                lyType="wp"
+              >
+              </IndexData>
+            </div>
+          </template>
+        </ele-split-layout>
+      </el-card>
+    </div>
+  </ele-modal>
+</template>
+<script>
+  import IndexData from './index-data.vue';
+  import IndexSearch from './index-search.vue';
+
+  import dictMixins from '@/mixins/dictMixins';
+  import { getTreeByGroup } from '@/api/classifyManage';
+  import { parameterGetByCode } from '@/api/system/dictionary/index.js';
+
+  import { getInfoById } from '@/api/classifyManage';
+
+  export default {
+    name: 'productIndex',
+
+    components: {
+      IndexData,
+      IndexSearch
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        loading: false,
+        isCode: 0,
+        current: {},
+        curNode: {},
+        treeList: [],
+        treeLoading: false,
+        formData: {},
+        rootTreeId: null,
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        currentData: {},
+        where: {},
+        visible: false
+      };
+    },
+    activated() {
+      // this.getTreeData();
+      this.$nextTick(() => {
+        this.$refs.listData.reloadNew(this.where);
+      });
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      },
+
+      rootId() {
+        return this.$route.query.id;
+      },
+
+      fullName() {
+        let str = '';
+        let codeStr = '';
+        let node = this.curNode;
+        while (node?.data?.name) {
+          str = node.data.name + '-' + str;
+          codeStr = node.data.code + '-' + codeStr;
+          node = node?.parent;
+        }
+
+        return str.substring(str, str.length - 1);
+        // return (
+        //   str.substring(str, str.length - 1) +
+        //   `(${codeStr.substring(str, str.length - 1)})`
+        // );
+      }
+    },
+    created() {
+      // this.getTreeData();
+      // //是否显示code
+      // parameterGetByCode({
+      //   code: 'mian_product_code'
+      // }).then((res) => {
+      //   if (res.value) {
+      //     this.isCode = res.value;
+      //   }
+      // });
+    },
+    methods: {
+      open() {
+        this.visible = true;
+        this.getTreeData();
+        //是否显示code
+        parameterGetByCode({
+          code: 'mian_product_code'
+        }).then((res) => {
+          if (res.value) {
+            this.isCode = res.value;
+          }
+        });
+      },
+
+      handleClose() {
+        this.visible = false;
+      },
+
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await getTreeByGroup({ type: 5 });
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+            if (!this.$route.query.categoryLevelId) {
+              this.$nextTick(() => {
+                //默认高亮第一级树节点;
+                if (this.treeList[0]) {
+                  this.rootTreeId = this.treeList[0].id;
+                  this.getDetail(this.treeList[0].id);
+                  this.publicfun(this.treeList[0]);
+                }
+              });
+            } else {
+              this.getDetail(this.$route.query.categoryLevelId);
+              this.$nextTick(() => {
+                this.$refs.treeRef.setCurrentKey(
+                  this.$route.query.categoryLevelId
+                );
+              });
+              const objByid = this.findNodeById(
+                this.treeList,
+                this.$route.query.categoryLevelId
+              );
+              console.log(objByid, '当前选择的物品');
+              this.publicfun(objByid);
+            }
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+
+      async getDetail(id) {
+        this.loading = true;
+        const res = await getInfoById(id);
+        this.loading = false;
+        if (res.code == '0') {
+          this.current = res.data;
+          this.$nextTick(() => {
+            this.$refs.treeRef.setCurrentKey(this.current.id);
+          });
+        }
+      },
+
+      findNodeById(tree, targetId) {
+        function traverse(nodes) {
+          for (let node of nodes) {
+            if (node.id === targetId) {
+              return node;
+            } else if (node.children && node.children.length > 0) {
+              const foundNode = traverse(node.children);
+              if (foundNode) {
+                return foundNode;
+              }
+            }
+          }
+          return null;
+        }
+
+        return traverse(tree);
+      },
+
+      async handleNodeClick(data, node) {
+        this.$route.query.categoryLevelId = '';
+        if (this.$refs.searchRef) {
+          this.$refs.searchRef.resetAllSearch();
+        }
+
+        this.curNode = node;
+        await this.publicfun(data);
+        console.log(data, '点击物品分类');
+        await this.getDetail(data.id);
+      },
+
+      publicfun(data) {
+        this.pathList = this.findParent([], data, this.treeList);
+        this.rootTreeId = null;
+        if (this.pathList.length == 0) {
+          this.rootTreeId = data.id;
+        } else {
+          this.rootTreeId =
+            this.pathList[this.pathList.length - 1] &&
+            this.pathList[this.pathList.length - 1].id;
+        }
+
+        let ruleCode = null;
+        if (this.pathList.length == 0) {
+          ruleCode = data.ruleCode;
+        } else {
+          ruleCode =
+            this.pathList[this.pathList.length - 1] &&
+            this.pathList[this.pathList.length - 1].ruleCode;
+        }
+
+        this.pathList.unshift(data);
+
+        const PathInfo = {
+          categoryLevelPath: '',
+          categoryLevelPathId: [],
+          categoryLevelPathCode: '',
+          categoryLevelId: '',
+          categoryLevelName: '',
+          ruleCode: ''
+        };
+        const pathName = [];
+        const pathCode = [];
+        console.log(this.pathList, 'this.pathList');
+        this.pathList.map((item) => {
+          pathName.unshift(item.name);
+          pathCode.unshift(item.code);
+
+          PathInfo.categoryLevelPathId.unshift(item.id);
+          // PathInfo.rootCategoryLevelId = item.rootCategoryLevelId;
+        });
+        PathInfo.categoryLevelPath = pathName.join('-');
+        PathInfo.categoryLevelPathId = PathInfo.categoryLevelPathId.join(',');
+        PathInfo.categoryLevelPathCode = pathCode.join('-');
+        PathInfo.categoryLevelId = data.id;
+        PathInfo.categoryLevelName = data.name;
+        PathInfo.ruleCode = ruleCode;
+
+        console.log(PathInfo, '点击物品分类');
+        this.currentData = PathInfo;
+      },
+      /* 刷新表格 */
+      reload(where) {
+        console.log(where, '刷新表格');
+        this.where = where;
+        this.$refs.listData.reload(where);
+      },
+
+      // parents:用于返回的数组,childNode:要查询的节点,treeList:json树形数据
+      findParent(parents, childNode, treeList) {
+        for (let i = 0; i < treeList.length; i++) {
+          // 父节点查询条件
+          if (treeList[i].id === childNode.parentId) {
+            // 如果找到结果,保存当前节点
+            parents.push(treeList[i]);
+            // 用当前节点再去原数据查找当前节点的父节点
+            this.findParent(parents, treeList[i], this.treeList);
+            break;
+          } else {
+            if (treeList[i].children instanceof Array) {
+              //	没找到,遍历该节点的子节点
+              this.findParent(parents, childNode, treeList[i].children);
+            }
+          }
+        }
+        return parents;
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 165px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 30px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+
+  .form-content {
+    height: 50px;
+    border: 1px solid;
+    box-sizing: border-box;
+  }
+
+  .form-wrapper {
+    padding: 12px 24px;
+  }
+</style>

+ 523 - 0
src/views/technology/route/components/index-data.vue

@@ -0,0 +1,523 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      :need-page="true"
+      :selection.sync="selection"
+      :current.sync="rowCurrent"
+      @sort-change="onSortChange"
+      highlight-current-row
+      height="calc(100vh - 412px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      :page-size="pageSize"
+      :initLoad="false"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
+      v-if="pageShow"
+    >
+      <template v-slot:componentAttribute="{ row }">
+        <div>
+          <!-- {{ }} -->
+          {{ getDictValueFn(row.componentAttribute) }}
+        </div>
+      </template>
+
+      <template v-slot:footer>
+        <el-button @click="pageShow = false">取消</el-button>
+        <el-button type="primary" :loading="loading" @click="save">
+          选择
+        </el-button>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import {
+    getMaterialList,
+    removeMaterial,
+    importCategorySparePart,
+    exportFile
+  } from '@/api/material/list.js';
+
+  import { getBomGetById } from '@/api/material/BOM.js';
+  import dictMixins from '@/mixins/dictMixins';
+  import { fieldModel } from '@/api/codeManagement';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { produceTypeList } from '@/enum/dict.js';
+  import request from '@/utils/request';
+  import { download } from '@/utils/file';
+  import { getByCode } from '@/api/system/dictionary-data';
+  const measureTypeList = [
+    {
+      label: '数量',
+      value: 1
+    },
+    {
+      label: '重量',
+      value: 2
+    },
+    {
+      label: '体积',
+      value: 3
+    },
+    {
+      label: '容积',
+      value: 4
+    },
+    {
+      label: '面积',
+      value: 5
+    }
+  ];
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+
+    components: {},
+    props: {
+      // 物料组id
+      currentId: [Number, String],
+      data: [Array, Object],
+      rootId: [Number, String],
+
+      rootTreeId: [Number, String],
+      lyType: [String],
+      oneProduct: Boolean,
+      currentData: Object,
+
+      //table-cacheKeyUrl
+      cacheKeyUrl: String
+    },
+    data() {
+      return {
+        attributeList: [],
+        exportLoading: false,
+        moudleName: 'mainCategory',
+        currentPage: 1,
+        errorData: [],
+        exportErrorDioalogVisible: false,
+        pagination: {
+          total: 0
+        },
+        bomShow: false,
+        whereData: {},
+        pageShow: false,
+
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 50,
+            align: 'center',
+            showOverflowTooltip: true,
+            label: '序号'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            sortable: true,
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'categoryLevelPath',
+          //   label: 'BOM状态',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   formatter: (row, column) => {
+          //     return row.isUnpack == 1 ? '是' : '否';
+          //   }
+          // },
+          {
+            prop: 'brandNum',
+            align: 'center',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'level',
+            label: '级别',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'measuringUnit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'weightUnit',
+            label: '重量单位',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'roughWeight',
+            label: '毛重',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'netWeight',
+            label: '净重',
+            showOverflowTooltip: true,
+            minWidth: 90
+          },
+
+          {
+            prop: 'packingUnit',
+            align: 'center',
+            label: '包装单位',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'componentAttribute',
+            slot: 'componentAttribute',
+            align: 'center',
+            label: '属性类型',
+            showOverflowTooltip: true
+            // formatter: (row, column) => {
+            //   return row?.produceType
+            //     ?.map((item) => {
+            //       {{row}}
+            //       return this.getDictValueFn(item);
+            //     })
+            //     ?.toString();
+            // }
+          },
+          {
+            prop: 'attributeType',
+            align: 'center',
+            label: '存货类型',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              const item = this.attributeList.find(
+                (item) => item[row.attributeType] !== undefined
+              );
+              return item ? item[row.attributeType] : null; // 如果找不到返回 null
+            }
+          },
+          {
+            prop: 'produceType',
+            align: 'center',
+            label: '生产类型',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return produceTypeList.find(
+                (item) => item.value == row.produceType
+              )?.label;
+            }
+          },
+          {
+            prop: 'measureType',
+            align: 'center',
+            label: '计量类型',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return measureTypeList.find(
+                (item) => item.value == row.measureType
+              )?.label;
+            }
+          },
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.modelKey
+                ? row.modelKey
+                    .split(',')
+                    ?.map((item) => this.getDictValue('物品机型', item))
+                    .toString()
+                : '';
+            }
+          },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.colorKey
+                ? row.colorKey
+                    .split(',')
+                    ?.map((item) => this.getDictValue('物品颜色', item))
+                    .toString()
+                : '';
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'isEnabled',
+            align: 'center',
+            label: '状态',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.isEnabled === 0
+                ? '停用'
+                : row.isEnabled === 1
+                ? '启用'
+                : '';
+            }
+          }
+        ],
+        sxtList: [
+          {
+            label: '自制件',
+            value: 1
+          },
+          {
+            label: '采购件',
+            value: 2
+          },
+          {
+            label: '外协件',
+            value: 3
+          },
+          {
+            label: '受托件',
+            value: 4
+          }
+        ],
+
+        // newColumns: [],
+        // 表格选中数据
+        selection: [],
+        // 是否显示编辑弹窗
+        showEdit: false,
+        id: null,
+
+        materialEdit: false,
+        paramEditShow: false,
+        mouldShow: false,
+        current: null,
+
+        rowCurrent: null,
+        isLoading: false,
+        pageSize: this.$store.state.tablePageSize
+      };
+    },
+
+    created: function () {
+      getByCode('inventory_type').then((res) => {
+        if (res.code === '0') {
+          this.attributeList = res.data;
+        }
+      });
+      // this.requestDict('生产类型');
+      this.requestDict('物品机型');
+      this.requestDict('物品颜色');
+
+      // this.getFieldModel();
+    },
+
+    methods: {
+      onSortChange(e) {
+        console.log(e, '99999999');
+
+        let sort = {
+          orderBy: e.order,
+          sortName: e.prop
+        };
+        this.sort = sort;
+        this.reload();
+      },
+      getDictValueFn(e) {
+        // console.log(e,'3333333333333');
+        if (e.length) {
+          let arr = [];
+          e.map((v) => {
+            arr.push(this.findFn(v)?.label);
+          });
+
+          return arr.join(',');
+        } else {
+          return '';
+        }
+        // let a =
+
+        // return a?.label||''
+      },
+
+      findFn(e) {
+        return this.sxtList.find((item) => item.value == Number(e));
+      },
+
+      toBomManager(row) {
+        let rowData = {
+          categoryId: row.id,
+          categoryName: row.name,
+          code: row.code,
+
+          rootPathIdParent: row.categoryLevelPathIdParent,
+          isProduct: row.isProduct == 1
+        };
+        this.$refs.bomDrawer.open(rowData);
+      },
+
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        this.currentPage = page;
+        let labs = getMaterialList({
+          pageNum: page,
+          size: limit,
+          ...this.sort,
+          ...where,
+          categoryLevelId: this.currentId
+        });
+        this.whereData = {
+          pageNum: page,
+          size: limit,
+          ...this.sort,
+          ...where,
+          categoryLevelId: this.currentId
+        };
+        let a = await labs;
+
+        return labs;
+      },
+      /* 刷新表格 */
+      reload(where) {
+        let labs = {
+          page: 1,
+          where: where,
+          categoryLevelId: this.currentId
+        };
+        this.whereData = labs;
+        this.$refs.table.reload({
+          page: 1,
+          where: where,
+          categoryLevelId: this.currentId
+        });
+      },
+      /* 刷新表格 */
+      reloadNew(where) {
+        let labs = {
+          page: 1,
+          where: where,
+          categoryLevelId: this.currentId
+        };
+        this.whereData = labs;
+        this.$refs.table.reload({
+          page: this.currentPage,
+          where: where,
+          categoryLevelId: this.currentId
+        });
+      },
+
+      save() {
+        if (this.selection.length == 0) {
+          this.$message.warning('请选择物品');
+          return;
+        }
+
+        this.$emit('chooseGoods', this.selection);
+        this.pageShow = false;
+      },
+
+      success() {
+        this.reload();
+      }
+    },
+    watch: {
+      // 监听物料组id变化
+      currentId() {
+        this.reload();
+      },
+
+      $route: {
+        handler(route) {
+          this.pageShow = false;
+
+          if (route.query && route.query.isWt) {
+            getBomGetById(route.query.businessId).then((res) => {
+              let rowData = {
+                categoryId: res.data.categoryId,
+                categoryName: res.data.name,
+                code: res.data.categoryCode,
+                rootPathIdParent: res.data.rootCategoryLevelId,
+                isProduct: res.data.rootCategoryLevelId == 9 ? true : false,
+                versions: res.data.versions,
+                bomType: res.data.bomType,
+                isWt: true,
+                isBtn: route.query.isBtn
+              };
+              this.$nextTick(() => {
+                this.$refs.bomDrawer.open(rowData);
+                this.pageShow = true;
+              });
+            });
+          } else {
+            this.pageShow = true;
+          }
+        },
+        immediate: true
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .upload {
+    display: inline-block;
+    width: 100px;
+    margin-left: 10px;
+  }
+</style>

+ 136 - 0
src/views/technology/route/components/index-search.vue

@@ -0,0 +1,136 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    size="small"
+    label-width="80px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="关键词">
+          <el-input
+            clearable
+            size="small"
+            v-model.trim="where.searchKey"
+            placeholder="型号、规格、牌号"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="编码">
+          <el-input
+            clearable
+            size="small"
+            v-model.trim="where.code"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="名称">
+          <el-input
+            clearable
+            size="small"
+            v-model.trim="where.name"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col
+        v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }"
+        style="display: flex; justify-content: flex-end"
+      >
+        <el-button
+          size="mini"
+          type="primary"
+          icon="el-icon-search"
+          class="ele-btn-icon"
+          @click="search"
+        >
+          查询
+        </el-button>
+
+        <el-button
+          @click="reset"
+          icon="el-icon-refresh"
+          class="ele-btn-icon"
+          size="mini"
+          >重置</el-button
+        >
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { syncMateriel } from '@/api/material/list';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        modelType: '',
+        bomStatus: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        loading: false,
+        bomTypeList: [
+          {
+            id: 1,
+            label: '有'
+          },
+          {
+            id: 0,
+            label: '无'
+          }
+        ],
+        loading: false
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+
+      resetAllSearch() {
+        this.$set(this.where, 'allSearch', false);
+      },
+
+      // 刷新数据
+      refreshData() {
+        this.loading = true;
+        syncMateriel()
+          .then((res) => {
+            if (res == '0') {
+              this.loading = false;
+              this.$message.success('数据刷新成功!');
+              this.search();
+            }
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      }
+    }
+  };
+</script>

+ 25 - 3
src/views/technology/route/components/user-edit.vue

@@ -90,9 +90,20 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="排序:" prop="sort">
-            <el-input  v-model="form.sort" type="number" />
+            <el-input v-model="form.sort" type="number" />
           </el-form-item>
         </el-col>
+        <!--
+        <el-col :span="8" v-if="isCategory">
+          <el-form-item label="产品/物品分类:" prop="workCenterName">
+            <el-input
+              @click.native="chooseWorkCenter"
+              v-model="form.workCenterName"
+              readonly
+            />
+          </el-form-item>
+        </el-col> -->
+
         <!-- <el-col :span="8">
           <el-form-item label="类型:" prop="routeType">
             <el-select v-model="form.routeType" placeholder="请选择">
@@ -123,6 +134,7 @@
   import route from '@/api/technology/route';
   import { pageList } from '@/api/technology/version/version.js';
   import UserTaskinstance from './user-taskinstance.vue';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
   export default {
     components: {
       UserTaskinstance
@@ -197,15 +209,17 @@
         isUpdate: false,
 
         taskInstanceList: [],
-        removeList: []
+        removeList: [],
+        isCategory: false
       };
     },
 
     mounted() {
-      console.log(this.isBomRoute, 'isBomRoute');
       if (this.isBomRoute) {
         this.form.status = 1;
       }
+
+      this.getCategoryType();
     },
 
     computed: {
@@ -277,6 +291,14 @@
         });
       },
 
+      async getCategoryType() {
+        await parameterGetByCode({
+          code: 'add_routing_binding'
+        }).then((res) => {
+          this.isCategory = res.value == '1' ? true : false;
+        });
+      },
+
       hasPropertyEqualToSeven(arr, property) {
         for (let i = 0; i < arr.length; i++) {
           if (

+ 331 - 293
src/views/technology/route/index.vue

@@ -55,6 +55,10 @@
           >
         </template>
 
+        <template v-slot:version="{ row }">
+          <span>V{{ row.version }}</span>
+        </template>
+
         <!-- 状态列 -->
         <template v-slot:status="{ row }">
           {{ checkStatus(row) }}
@@ -77,7 +81,6 @@
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-edit"
             @click="openEdit(row)"
             v-if="
               [0, 3].includes(row.approvalStatus) &&
@@ -89,7 +92,6 @@
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-edit"
             @click="approve(row)"
             v-if="
               [0, 3].includes(row.approvalStatus) &&
@@ -101,19 +103,31 @@
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-finished"
             @click="alteration(row)"
             v-if="row.approvalStatus == 2"
           >
             变更
           </el-link>
+          <el-link type="primary" :underline="false" @click="openHistory(row)">
+            历史版本
+          </el-link>
+
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-document"
-            @click="openHistory(row)"
+            @click="bingdingCategory(row, 1)"
+            v-if="isCategory"
           >
-            历史版本
+            绑定分类
+          </el-link>
+
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="bingdingCategory(row, 2)"
+            v-if="isCategory"
+          >
+            绑定物品
           </el-link>
 
           <el-popconfirm
@@ -171,311 +185,335 @@
       @reload="reload"
       :apiFunName="'produceroutingRelease'"
     ></process-submit-dialog>
+
+    <chooseCategory ref="chooseCategoryRef"></chooseCategory>
   </div>
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import UserSearch from './components/user-search.vue';
-import UserEdit from './components/user-edit.vue';
-import UserDetail from './components/user-detail.vue';
-import historyModal from './components/historyModal.vue';
-import route from '@/api/technology/route';
-import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
-import { reviewStatus } from '@/enum/dict';
-import importDialog from '@/components/upload/import-dialogNew.vue';
-export default {
-  name: 'technologyRoute',
-  mixins: [tabMixins],
-  components: {
-    UserSearch,
-    UserEdit,
-    UserDetail,
-    historyModal,
-    processSubmitDialog,
-    importDialog
-  },
-  data() {
-    return {
-      isUpdate: false,
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        // {
-        //   slot: 'routeType',
-        //   label: '类型',
-        //   align: 'center',
-        //   showOverflowTooltip: true
-        // },
-        {
-          prop: 'sort',
-          label: '排序',
-          showOverflowTooltip: true,
-          align: 'center',
-          width: 110
-        },
-        {
-          prop: 'code',
-          label: '工艺路线编码',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110,
-          slot: 'code'
-        },
-        {
-          prop: 'name',
-          label: '工艺路线名称',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-
-        {
-          prop: 'version',
-          label: '工艺路线版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-
-        // {
-        //   prop: 'produceVersionName',
-        //   label: '工艺类型',
-        //   align: 'center',
-        //   showOverflowTooltip: true
-        // },
-
-        {
-          //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          slot: 'status',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          filters: [
-            { text: '草稿', value: -1 },
-            { text: '失效', value: 0 },
-            { text: '生效', value: 1 }
-          ],
-          filterMultiple: false,
-          columnKey: 'status'
-        },
-        {
-          prop: 'approvalStatus',
-          label: '审核状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.approvalStatus];
-          }
-        },
-        {
-          prop: 'factoriesName',
-          label: '所属工厂',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-        {
-          align: 'center',
-          prop: 'createTime',
-          label: '创建时间',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 280,
-          align: 'left',
-          resizable: false,
-          slot: 'action'
-        }
-      ],
-
-      // 表格选中数据
-      selection: [],
-      // 当前编辑数据
-      current: null,
-      processSubmitDialogFlag: false,
-      // 是否显示编辑弹窗
-      showEdit: false,
-      detailEdit: false,
-
-      statusList: [
-        { label: '草稿', value: -1 },
-        { label: '失效', value: 0 },
-        { label: '生效', value: 1 }
-      ],
-      loading: false,
-      cacheKeyUrl: 'fb92f8df-technology-route'
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
-    }
-  },
-  methods: {
-    selectType(value) {
-      let where = {};
-      if (value.status.length > 0) {
-        where['status'] = value.status[0];
-      }
-      this.reload(where);
-    },
-    /* 表格数据源 */
-    async datasource({ page, limit, where, order }) {
-      const res = await route.list({
-        ...where,
-        ...order,
-        pageNum: page,
-        size: limit
-      });
-      return res;
-    },
-    importDialog() {
-      this.$refs.importDialogRef.open();
-    },
-    checkStatus(row) {
-      let obj = this.statusList.find((it) => it.value == row.status);
-      return obj.label;
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import UserSearch from './components/user-search.vue';
+  import UserEdit from './components/user-edit.vue';
+  import UserDetail from './components/user-detail.vue';
+  import historyModal from './components/historyModal.vue';
+  import route from '@/api/technology/route';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+  import { reviewStatus } from '@/enum/dict';
+  import importDialog from '@/components/upload/import-dialogNew.vue';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
+  import chooseCategory from './components/chooseCategory.vue';
+  export default {
+    name: 'technologyRoute',
+    mixins: [tabMixins],
+    components: {
+      UserSearch,
+      UserEdit,
+      UserDetail,
+      historyModal,
+      processSubmitDialog,
+      importDialog,
+      chooseCategory
     },
+    data() {
+      return {
+        isUpdate: false,
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          // {
+          //   slot: 'routeType',
+          //   label: '类型',
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
+          {
+            prop: 'sort',
+            label: '排序',
+            showOverflowTooltip: true,
+            align: 'center',
+            width: 110
+          },
+          {
+            prop: 'code',
+            label: '工艺路线编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '工艺路线名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'version',
+            label: '工艺路线版本',
+            align: 'center',
+            slot: 'version',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          // {
+          //   prop: 'produceVersionName',
+          //   label: '工艺类型',
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
 
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where: where });
+          {
+            //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            filters: [
+              { text: '草稿', value: -1 },
+              { text: '失效', value: 0 },
+              { text: '生效', value: 1 }
+            ],
+            filterMultiple: false,
+            columnKey: 'status'
+          },
+          {
+            prop: 'approvalStatus',
+            label: '审核状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.approvalStatus];
+            }
+          },
+          {
+            prop: 'factoriesName',
+            label: '所属工厂',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            align: 'center',
+            prop: 'createTime',
+            label: '创建时间',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 280,
+            align: 'left',
+            resizable: false,
+            slot: 'action'
+          }
+        ],
+
+        // 表格选中数据
+        selection: [],
+        // 当前编辑数据
+        current: null,
+        processSubmitDialogFlag: false,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        detailEdit: false,
+
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
+        loading: false,
+        cacheKeyUrl: 'fb92f8df-technology-route',
+        isCategory: false
+      };
     },
-    /* 打开编辑弹窗 */
-    openEdit(row) {
-      this.current = row;
-      this.showEdit = true;
-      if (row?.id) {
-        this.$refs.userEdit.isUpdate = true;
-      } else {
-        this.$refs.userEdit.isUpdate = false;
-      }
 
-      this.$refs.userEdit.$refs.form &&
-        this.$refs.userEdit.$refs.form.clearValidate();
+    mounted() {
+      this.getCategoryType();
     },
-    /* 打开历史版本 */
-    openHistory(row) {
-      this.$refs.historyRefs.open(row);
+
+    computed: {
+      // 是否开启响应式布局
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
     },
-    /* 删除 */
-    remove(row) {
-      const loading = this.$loading({ lock: true });
-
-      route
-        .delete(row.id)
-        .then((msg) => {
-          loading.close();
-          this.$message.success('删除' + msg);
-          this.reload();
-        })
-        .catch((e) => {
-          loading.close();
-          // this.$message.error(e.message);
+    methods: {
+      selectType(value) {
+        let where = {};
+        if (value.status.length > 0) {
+          where['status'] = value.status[0];
+        }
+        this.reload(where);
+      },
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        const res = await route.list({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
         });
-    },
+        return res;
+      },
+      importDialog() {
+        this.$refs.importDialogRef.open();
+      },
+      checkStatus(row) {
+        let obj = this.statusList.find((it) => it.value == row.status);
+        return obj.label;
+      },
 
-    //变更
-   alteration(row) {
-      console.log();
-      let param = {
-        id: row.id
-      };
-      route
-        .taskinstanceChange(param)
-        .then((msg) => {
-          // loading.close();
-          this.$message.success('变更' + msg);
-          this.reload();
-        })
-        .catch((e) => {
-          loading.close();
-          // this.$message.error(e.message);
+      async getCategoryType() {
+        await parameterGetByCode({
+          code: 'add_routing_binding'
+        }).then((res) => {
+          this.isCategory = res.value == '1' ? true : false;
         });
-    },
-    /* 批量删除 */
-    removeBatch() {
-      if (!this.selection.length) {
-        this.$message.error('请至少选择一条数据');
-        return;
-      }
-      this.$confirm('确定要删除选中的工序吗?', '提示', {
-        type: 'warning'
-      })
-        .then(() => {
-          const loading = this.$loading({ lock: true });
-          producetask
-            .delete(this.selection.map((d) => d.id))
-            .then((msg) => {
-              loading.close();
-              this.$message.success('删除' + msg);
-              this.reload();
-            })
-            .catch((e) => {
-              loading.close();
-              // this.$message.error(e.message);
-            });
-        })
-        .catch(() => {});
-    },
-    approve(res) {
-      this.processSubmitDialogFlag = true;
-      this.$nextTick(() => {
-        let params = {
-          businessId: res.id,
-          businessKey: 'routing_approve',
-          formCreateUserId: res.createUserId,
-          routingId: res.id,
-          variables: {
-            businessCode: res.code,
-            businessName: res.name,
-            businessType: ' 版本:' + res.version
-          }
-        };
+      },
 
-        this.$refs.processSubmitDialogRef.init(params);
-      });
-    },
-    // 刷新数据
-    refreshData() {
-      this.loading = true;
-      route
-        .syncRouting()
-        .then((res) => {
-          if (res == '0') {
-            this.loading = false;
-            this.$message.success('数据刷新成功!');
+      bingdingCategory(item, type) {
+        this.$refs.chooseCategoryRef.open(item, type);
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      /* 打开编辑弹窗 */
+      openEdit(row) {
+        this.current = row;
+        this.showEdit = true;
+        if (row?.id) {
+          this.$refs.userEdit.isUpdate = true;
+        } else {
+          this.$refs.userEdit.isUpdate = false;
+        }
+
+        this.$refs.userEdit.$refs.form &&
+          this.$refs.userEdit.$refs.form.clearValidate();
+      },
+      /* 打开历史版本 */
+      openHistory(row) {
+        this.$refs.historyRefs.open(row);
+      },
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+
+        route
+          .delete(row.id)
+          .then((msg) => {
+            loading.close();
+            this.$message.success('删除' + msg);
             this.reload();
-          }
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+
+      //变更
+      alteration(row) {
+        console.log();
+        let param = {
+          id: row.id
+        };
+        route
+          .taskinstanceChange(param)
+          .then((msg) => {
+            // loading.close();
+            this.$message.success('变更' + msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+      /* 批量删除 */
+      removeBatch() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        this.$confirm('确定要删除选中的工序吗?', '提示', {
+          type: 'warning'
         })
-        .catch((e) => {
-          this.loading = false;
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            producetask
+              .delete(this.selection.map((d) => d.id))
+              .then((msg) => {
+                loading.close();
+                this.$message.success('删除' + msg);
+                this.reload();
+              })
+              .catch((e) => {
+                loading.close();
+                // this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      },
+      approve(res) {
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'routing_approve',
+            formCreateUserId: res.createUserId,
+            routingId: res.id,
+            variables: {
+              businessCode: res.code,
+              businessName: res.name,
+              businessType: ' 版本:' + res.version
+            }
+          };
+
+          this.$refs.processSubmitDialogRef.init(params);
         });
-    },
+      },
+      // 刷新数据
+      refreshData() {
+        this.loading = true;
+        route
+          .syncRouting()
+          .then((res) => {
+            if (res == '0') {
+              this.loading = false;
+              this.$message.success('数据刷新成功!');
+              this.reload();
+            }
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      },
 
-    openDetail(row) {
-      this.current = row;
-      //
+      openDetail(row) {
+        this.current = row;
+        //
 
-      // this.$refs.userEdit.datasource(this.current.id);
-      this.detailEdit = true;
+        // this.$refs.userEdit.datasource(this.current.id);
+        this.detailEdit = true;
+      }
     }
-  }
-};
+  };
 </script>

+ 2 - 2
vue.config.js

@@ -35,11 +35,11 @@ module.exports = {
         // target: 'http://192.168.1.105:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
         // target: 'http://192.168.1.116:18086',
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {