Просмотр исходного кода

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into test

yusheng 11 месяцев назад
Родитель
Сommit
a1806f62ec

+ 18 - 0
src/api/classifyManage/itemInformation.js

@@ -59,3 +59,21 @@ export async function pageSubstance(params) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+
+// /main/category/getListAndBom
+export async function getListAndBom(body) {
+  const res = await request.post('/main/category/getListAndBom', body);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// /main/category/getListAndInProduceTask
+export async function getListAndInProduceTask(body) {
+  const res = await request.post('/main/category/getListAndInProduceTask', body);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 5 - 5
src/components/CommomSelect/person-select.vue

@@ -33,14 +33,14 @@
         default: true
         default: true
       }
       }
     },
     },
-    data () {
+    data() {
       return {
       return {
         dictList: []
         dictList: []
       };
       };
     },
     },
     computed: {
     computed: {
       selectVal: {
       selectVal: {
-        set (val) {
+        set(val) {
           this.$emit(
           this.$emit(
             'selfChange',
             'selfChange',
             val,
             val,
@@ -48,18 +48,18 @@
           );
           );
           this.$emit('updateVal', val);
           this.$emit('updateVal', val);
         },
         },
-        get () {
+        get() {
           return this.value;
           return this.value;
         }
         }
       }
       }
     },
     },
-    created () {
+    created() {
       if (this.init) {
       if (this.init) {
         this.getList();
         this.getList();
       }
       }
     },
     },
     methods: {
     methods: {
-      async getList (params) {
+      async getList(params) {
         let data = { pageNum: 1, size: -1 };
         let data = { pageNum: 1, size: -1 };
         // 如果传了参数就是获取巡点检人员数据
         // 如果传了参数就是获取巡点检人员数据
         if (params) {
         if (params) {

+ 1 - 1
src/views/factoryModel/workshop/components/edit.vue

@@ -281,7 +281,7 @@
             }
             }
           }
           }
           if (row.extInfo.principalDep) {
           if (row.extInfo.principalDep) {
-            const params = { executeGroupId: row.extInfo.principalDep };
+            const params = { groupId: row.extInfo.principalDep };
             this.$nextTick(() => {
             this.$nextTick(() => {
               this.$refs.directorRef.getList(params);
               this.$refs.directorRef.getList(params);
             });
             });

+ 3 - 2
src/views/material/BOMmanage/components/attribute.vue

@@ -124,7 +124,7 @@
         <el-col :span="8" label-width="100px">
         <el-col :span="8" label-width="100px">
           <el-form-item label="生产类型:" prop="produceType">
           <el-form-item label="生产类型:" prop="produceType">
             <el-select
             <el-select
-              v-model="attributeData?.category.produceType"
+              v-model="attributeData.produceType"
               disabled
               disabled
               filterable
               filterable
               multiple
               multiple
@@ -143,8 +143,9 @@
         <el-col :span="8" label-width="100px">
         <el-col :span="8" label-width="100px">
           <el-form-item label="存货类型:" prop="attributeType">
           <el-form-item label="存货类型:" prop="attributeType">
             <el-select
             <el-select
-              v-model="attributeData.category.attributeType"
+              v-model="attributeData.attributeType"
               disabled
               disabled
+              filterable
               class="ele-block"
               class="ele-block"
             >
             >
               <el-option
               <el-option

+ 14 - 2
src/views/material/BOMmanage/components/routing.vue

@@ -107,6 +107,7 @@
   import routingDialog from './routingDialog.vue';
   import routingDialog from './routingDialog.vue';
   import route from '@/api/technology/route';
   import route from '@/api/technology/route';
   import UserEdit from '@/views/technology/route/components/user-edit.vue';
   import UserEdit from '@/views/technology/route/components/user-edit.vue';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
   import {
   import {
     workingProcedureUpdate,
     workingProcedureUpdate,
     workingProcedureSave
     workingProcedureSave
@@ -220,12 +221,14 @@
           { label: '生效', value: 1 }
           { label: '生效', value: 1 }
         ],
         ],
         loading: false,
         loading: false,
-        isBomRoute: false
+        isBomRoute: false,
+        isCategory: false
       };
       };
     },
     },
 
 
     created() {
     created() {
       console.log(this.attributeData, 'attributeDataattributeData111');
       console.log(this.attributeData, 'attributeDataattributeData111');
+      this.getCategoryType();
       // this.isDelete = false;
       // this.isDelete = false;
     },
     },
 
 
@@ -234,6 +237,14 @@
         this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
         this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
       },
       },
 
 
+      async getCategoryType() {
+        await parameterGetByCode({
+          code: 'add_routing_binding'
+        }).then((res) => {
+          this.isCategory = res.value == '1' ? true : false;
+        });
+      },
+
       createRoute(row) {
       createRoute(row) {
         this.current = row;
         this.current = row;
         this.showEdit = true;
         this.showEdit = true;
@@ -357,7 +368,8 @@
             (Object.keys(this.tableData.processRoute).length == 0 ||
             (Object.keys(this.tableData.processRoute).length == 0 ||
               this.tableData.processRoute.list.length == 0) &&
               this.tableData.processRoute.list.length == 0) &&
             isCreateBom == '2' &&
             isCreateBom == '2' &&
-            !this.isWt
+            !this.isWt &&
+            this.isCategory
           ) {
           ) {
             if (this.tableData.routingIdList.length != 0) {
             if (this.tableData.routingIdList.length != 0) {
               // this.selected(this.tableData.routingIdList);
               // this.selected(this.tableData.routingIdList);

+ 1 - 0
src/views/material/BOMmanage/components/user-detail.vue

@@ -3,6 +3,7 @@
   <ele-modal
   <ele-modal
     width="1060px"
     width="1060px"
     :visible="visible"
     :visible="visible"
+    v-if="visible"
     :append-to-body="true"
     :append-to-body="true"
     :close-on-click-modal="false"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
     custom-class="ele-dialog-form"

+ 38 - 9
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -410,7 +410,7 @@
           </el-form>
           </el-form>
         </el-tab-pane>
         </el-tab-pane>
 
 
-        <el-tab-pane label="材料定额" name="材料定额">
+        <el-tab-pane v-if="!process" label="材料定额" name="材料定额">
           <ele-pro-table
           <ele-pro-table
             ref="materialTable"
             ref="materialTable"
             :columns="columns1"
             :columns="columns1"
@@ -578,7 +578,7 @@
           </ele-pro-table>
           </ele-pro-table>
         </el-tab-pane>
         </el-tab-pane>
 
 
-        <el-tab-pane label="制造资源" name="制造资源">
+        <el-tab-pane v-if="!process" label="制造资源" name="制造资源">
           <ele-pro-table
           <ele-pro-table
             ref="resourceTable"
             ref="resourceTable"
             :columns="columns1"
             :columns="columns1"
@@ -696,7 +696,7 @@
             </template>
             </template>
           </ele-pro-table>
           </ele-pro-table>
         </el-tab-pane>
         </el-tab-pane>
-        <el-tab-pane label="工艺文件" name="工艺文件">
+        <el-tab-pane v-if="!process" label="工艺文件" name="工艺文件">
           <ele-pro-table
           <ele-pro-table
             ref="fileTable"
             ref="fileTable"
             :columns="jobColumns1"
             :columns="jobColumns1"
@@ -717,7 +717,7 @@
           </ele-pro-table>
           </ele-pro-table>
         </el-tab-pane>
         </el-tab-pane>
 
 
-        <el-tab-pane label="标准产出" name="标准产出">
+        <el-tab-pane v-if="!process" label="标准产出" name="标准产出">
           <ele-pro-table
           <ele-pro-table
             ref="standard"
             ref="standard"
             :columns="standardCol"
             :columns="standardCol"
@@ -736,6 +736,13 @@
             </template>
             </template>
           </ele-pro-table>
           </ele-pro-table>
         </el-tab-pane>
         </el-tab-pane>
+        <el-tab-pane label="过程监测" name="过程监测">
+          <userSettingMatterProcess
+            :produce-task-id="rowData.id"
+            :produce-task-name="rowData.name"
+            ref="userSettingMatterProcessRef"
+          ></userSettingMatterProcess>
+        </el-tab-pane>
       </el-tabs>
       </el-tabs>
     </el-card>
     </el-card>
     <!-- 选择工艺参数 -->
     <!-- 选择工艺参数 -->
@@ -803,6 +810,7 @@
   import { getBomGetById, getDetailList } from '@/api/material/BOM.js';
   import { getBomGetById, getDetailList } from '@/api/material/BOM.js';
   import mbomDatailList from './mbomDatailList.vue';
   import mbomDatailList from './mbomDatailList.vue';
   import { setFileUrl } from '@/components/addDoc/util.js';
   import { setFileUrl } from '@/components/addDoc/util.js';
+  import userSettingMatterProcess from '@/views/technology/production/components/user-setting-matter-process.vue';
 
 
   export default {
   export default {
     components: {
     components: {
@@ -817,7 +825,8 @@
       fileIndex,
       fileIndex,
       fileBrowse,
       fileBrowse,
       replaceMaterialPop,
       replaceMaterialPop,
-      mbomDatailList
+      mbomDatailList,
+      userSettingMatterProcess
     },
     },
     mixins: [dictMixins],
     mixins: [dictMixins],
     data() {
     data() {
@@ -1182,7 +1191,9 @@
         resourceBomId: '',
         resourceBomId: '',
         level: '',
         level: '',
         attributeData: {},
         attributeData: {},
-        unitList: []
+        unitList: [],
+        // 从工序管理过来为 true tab-pane隐藏 工艺文件、标准产出、材料定额、制造资源
+        process: false
       };
       };
     },
     },
     created() {
     created() {
@@ -1590,6 +1601,8 @@
           this.$refs.deviceTabRef.setData(
           this.$refs.deviceTabRef.setData(
             this.tableData.taskParam[this.currentIndex].standardDevice || []
             this.tableData.taskParam[this.currentIndex].standardDevice || []
           );
           );
+        } else if (this.activeName === '过程监测') {
+          // 过程监测数据查询
         }
         }
       },
       },
       openParam(type) {
       openParam(type) {
@@ -1656,12 +1669,20 @@
           dom.getData()
           dom.getData()
         );
         );
       },
       },
-      open(rowData, treeData, tableData, isView, attributeData, resourceBomId) {
+      open(
+        rowData,
+        treeData,
+        tableData,
+        isView,
+        attributeData,
+        resourceBomId,
+        process = false
+      ) {
         // 工序信息
         // 工序信息
         console.log('rowData', rowData);
         console.log('rowData', rowData);
         // bom 信息
         // bom 信息
         console.log('treeData', treeData);
         console.log('treeData', treeData);
-        // 工序信息
+        // 工序信息列表 信息 包括工艺参数 材料定额等
         console.log('tableData', tableData);
         console.log('tableData', tableData);
         // 是否为详情 详情只能查看
         // 是否为详情 详情只能查看
         console.log('isView', isView);
         console.log('isView', isView);
@@ -1669,6 +1690,9 @@
         console.log('attributeData', attributeData);
         console.log('attributeData', attributeData);
         // bom id 对应 treeData和attributeData里的id
         // bom id 对应 treeData和attributeData里的id
         console.log('resourceBomId', resourceBomId);
         console.log('resourceBomId', resourceBomId);
+        // 从工序管理过来带有process=true
+        console.log('process', process);
+        this.process = process;
         this.columns = [];
         this.columns = [];
         this.columns1 = [];
         this.columns1 = [];
         this.isView = isView; //true详情 false编辑
         this.isView = isView; //true详情 false编辑
@@ -1716,6 +1740,7 @@
         this.currentIndex = tableData.taskParam.findIndex(
         this.currentIndex = tableData.taskParam.findIndex(
           (item) => item.id === rowData.id
           (item) => item.id === rowData.id
         );
         );
+        console.log('currentIndex', this.currentIndex);
         this.activeName = '工艺参数';
         this.activeName = '工艺参数';
 
 
         // this.baseCount = rowData.baseCount;
         // this.baseCount = rowData.baseCount;
@@ -1734,7 +1759,7 @@
           console.log(this.$refs);
           console.log(this.$refs);
           // 工艺参数
           // 工艺参数
           this.$refs.table.setData(
           this.$refs.table.setData(
-            this.tableData.taskParam[this.currentIndex].produceList
+            this.tableData.taskParam[this.currentIndex]?.produceList || []
           );
           );
         }, 500);
         }, 500);
 
 
@@ -1826,6 +1851,10 @@
                 }
                 }
               });
               });
               console.log('111112223344', this.tableData.taskParam);
               console.log('111112223344', this.tableData.taskParam);
+
+              // 保存过程监测事项
+              this.$refs.userSettingMatterProcessRef?.saveMatterList();
+
               workingProcedureUpdate({
               workingProcedureUpdate({
                 id: this.tableData.id,
                 id: this.tableData.id,
                 categoryId: this.treeData.categoryId,
                 categoryId: this.treeData.categoryId,

+ 0 - 1
src/views/material/BOMmanage/components/workmanship.vue

@@ -210,7 +210,6 @@
             :underline="false"
             :underline="false"
             icon="el-icon-setting"
             icon="el-icon-setting"
             @click="openConfigure(row)"
             @click="openConfigure(row)"
-            v-if="attributeData.status != 1"
           >
           >
             配置
             配置
           </el-link>
           </el-link>

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

@@ -92,7 +92,7 @@
                 prop="produceType"
                 prop="produceType"
                 :rules="{
                 :rules="{
                   required:
                   required:
-                    form.categoryLevelPathId == 9 ||
+                    form.categoryLevelPathId.substring(0, 1) == 9 ||
                     form.componentAttribute.includes(1) == 1
                     form.componentAttribute.includes(1) == 1
                       ? true
                       ? true
                       : false,
                       : false,

+ 225 - 0
src/views/rulesManagement/releaseRules/components/ProductModal.vue

@@ -0,0 +1,225 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <seekPage :seekList="seekList" @search="reload" />
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            ref="assetTreeRef"
+            id="9"
+            @handleNodeClick="handleNodeClick"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            height="calc(100vh - 450px)"
+            class="dict-table"
+            :selection.sync="selection"
+            @cell-click="cellClick"
+          >
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+
+  import { getListAndInProduceTask } from '@/api/classifyManage/itemInformation';
+  export default {
+    components: { AssetTree },
+    props: {
+      // 是否 多选
+      multiple: {
+        type: Boolean,
+        default: false
+      }
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '产品编码',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '产品名称',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '型号',
+            value: 'modelType',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            prop: 'code',
+            label: '产品编码'
+          },
+          {
+            prop: 'name',
+            label: '产品名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号'
+          },
+          {
+            prop: 'modelType',
+            label: '型号'
+          },
+          {
+            prop: 'measuringUnit',
+            label: '计量单位'
+          },
+          {
+            prop: 'packingUnit',
+            label: '包装单位'
+          }
+        ],
+        categoryLevelId: '9',
+        // 表格选中数据
+        selection: []
+      };
+    },
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        return getListAndInProduceTask({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId,
+          isProduct: true,
+          produceTaskCode: this.produceTaskCode
+        });
+      },
+      handleNodeClick(data) {
+        this.categoryLevelId = data.id;
+        this.reload();
+      },
+      /* 刷新表格 */
+      reload(where = {}) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      open(rows, produceTaskCode) {
+        this.produceTaskCode = produceTaskCode;
+        console.log('rows', rows, this.produceTaskCode);
+        this.visible = true;
+        if (rows) {
+          this.selection = rows;
+          this.$nextTick(() => {
+            this.$refs.table.setSelectedRows(rows);
+          });
+        } else {
+          this.selection = [];
+          this.$nextTick(() => {
+            this.$refs.table.setSelectedRows([]);
+          });
+        }
+        console.log('this.selection', this.selection);
+      },
+      handleClose() {
+        this.visible = false;
+        this.selection = [];
+      },
+      selected() {
+        console.log('this.selection', this.selection);
+        if (!this.selection.length) {
+          return this.$message.warning('请选择产品');
+        }
+
+        if (!this.multiple && this.selection.length > 1) {
+          return this.$message.warning('只能选择一个产品');
+        }
+
+        this.$emit(
+          'changeProduct',
+          this.multiple ? this.selection : this.selection[0]
+        );
+        this.handleClose();
+      },
+      cellClick(row) {
+        console.log('cellClick', row);
+        this.selection.push(row);
+        this.$refs.table.setSelectedRows(this.selection);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+  .table_col {
+    padding-left: 10px;
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 15 - 6
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -494,11 +494,11 @@
       @changeProduct="changeProduct"
       @changeProduct="changeProduct"
     ></ProductModal>
     ></ProductModal>
 
 
-    <ProductModal
+    <ProductModalCorrelation
       ref="ProductModalCorrelationRef"
       ref="ProductModalCorrelationRef"
       @changeProduct="changeRelateProduct"
       @changeProduct="changeRelateProduct"
       multiple
       multiple
-    ></ProductModal>
+    ></ProductModalCorrelation>
 
 
     <processModal
     <processModal
       ref="processModalRef"
       ref="processModalRef"
@@ -529,6 +529,8 @@
   import ProductModal from '@/components/selectProduct/ProductModal.vue';
   import ProductModal from '@/components/selectProduct/ProductModal.vue';
   import { getTreeByPid } from '@/api/classifyManage';
   import { getTreeByPid } from '@/api/classifyManage';
   import processModal from './processModal.vue';
   import processModal from './processModal.vue';
+  import ProductModalCorrelation from './ProductModal.vue';
+  import productionAPI from '@/api/technology/production/index.js';
 
 
   export default {
   export default {
     components: {
     components: {
@@ -538,7 +540,8 @@
       ProductModal,
       ProductModal,
       MaterialAdd,
       MaterialAdd,
       toolModal,
       toolModal,
-      processModal
+      processModal,
+      ProductModalCorrelation
     },
     },
     mixins: [dictMixins],
     mixins: [dictMixins],
     computed: {
     computed: {
@@ -804,7 +807,8 @@
         ],
         ],
         // 产品分类
         // 产品分类
         productCategory: [],
         productCategory: [],
-        loading: false
+        loading: false,
+        produceTaskCode: ''
       };
       };
     },
     },
     mounted() {
     mounted() {
@@ -1435,8 +1439,13 @@
         row.productCode = '';
         row.productCode = '';
       },
       },
       // 关联产品
       // 关联产品
-      relateProductSelect() {
-        this.$refs.ProductModalCorrelationRef.open();
+      async relateProductSelect() {
+        // 查询工序详情
+        const productTaskInfo = await productionAPI.getById(
+          this.formData.produceTaskConfigBatchSavePo.produceTaskId
+        );
+        console.log('productTaskInfo', productTaskInfo);
+        this.$refs.ProductModalCorrelationRef.open([], productTaskInfo.code);
       },
       },
       changeRelateProduct(array) {
       changeRelateProduct(array) {
         console.log('this.formData.categories ', array);
         console.log('this.formData.categories ', array);

+ 118 - 7
src/views/technology/production/components/user-setting-matter-process-drawer.vue

@@ -87,6 +87,37 @@
             row-key="id"
             row-key="id"
             cache-key="setting-matter-process-product-table-2510181638"
             cache-key="setting-matter-process-product-table-2510181638"
           >
           >
+            <template v-slot:bomType="{ row }">
+              <el-select
+                v-model="row.bomType"
+                placeholder="请选择"
+                size="small"
+                @change="bomTypeChange(row)"
+              >
+                <el-option
+                  v-for="item in row.bomTypeList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </template>
+            <template v-slot:bomVersion="{ row }">
+              <el-select
+                v-model="row.bomVersion"
+                placeholder="请选择"
+                size="small"
+              >
+                <el-option
+                  v-for="item in row.bomCategoryMap[row.bomType] || []"
+                  :key="item.id"
+                  :label="`V${Number(item.versions).toFixed(1)}`"
+                  :value="item.versions"
+                >
+                </el-option>
+              </el-select>
+            </template>
             <template v-slot:action="{ row }">
             <template v-slot:action="{ row }">
               <el-link
               <el-link
                 type="primary"
                 type="primary"
@@ -108,8 +139,9 @@
 
 
 <script>
 <script>
   import { getTreeByPid } from '@/api/classifyManage';
   import { getTreeByPid } from '@/api/classifyManage';
-  import { getList } from '@/api/classifyManage/itemInformation.js';
+  import { getListAndBom } from '@/api/classifyManage/itemInformation.js';
   import workingProcedure from '@/views/material/BOMmanage/components/workingProcedure.vue';
   import workingProcedure from '@/views/material/BOMmanage/components/workingProcedure.vue';
+  import { getMbomPage } from '@/api/material/BOM.js';
 
 
   export default {
   export default {
     components: {
     components: {
@@ -160,12 +192,14 @@
           // 下拉
           // 下拉
           {
           {
             label: 'BOM类型',
             label: 'BOM类型',
-            prop: 'weightUnit'
+            prop: 'bomType',
+            slot: 'bomType'
           },
           },
           // 下拉
           // 下拉
           {
           {
             label: 'BOM版本',
             label: 'BOM版本',
-            prop: 'weightUnit'
+            prop: 'bomVersion',
+            slot: 'bomVersion'
           },
           },
           {
           {
             label: '操作',
             label: '操作',
@@ -259,27 +293,104 @@
         )?.label;
         )?.label;
 
 
         this.drawer = true;
         this.drawer = true;
+
+        this.$nextTick(() => {
+          this.$refs.productTableRef?.reload();
+        });
       },
       },
       handleClose(done) {
       handleClose(done) {
+        this.$refs.productTableRef.reload();
         done();
         done();
       },
       },
       productDatasource({ page, limit, where, order }) {
       productDatasource({ page, limit, where, order }) {
-        return getList({
+        return this.getList({ page, limit, where, order });
+      },
+      async getList({ page, limit, where, order }) {
+        const data = await getListAndBom({
           ...where,
           ...where,
           ...order,
           ...order,
           pageNum: page,
           pageNum: page,
           size: limit,
           size: limit,
-          categoryLevelId: 9
+          categoryLevelId: 9,
+          bomTypes: [1, 2, 3],
+          produceTaskCode: this.currentProcessData.code
+        });
+        data.list.forEach((item) => {
+          item.bomType = '';
+          item.bomVersion = '';
+          item.bomTypeList = Object.keys(item.bomCategoryMap).map((key) => {
+            let label = '';
+            // PBOM = 1,MBOM=2,ABOM=3
+            if (key == '1') {
+              label = 'PBOM';
+            } else if (key == '2') {
+              label = 'MBOM';
+            } else {
+              label = 'ABOM';
+            }
+
+            return {
+              value: key,
+              label: label
+            };
+          });
         });
         });
+        console.log('getList', data);
+        return data;
       },
       },
       /* 刷新表格 */
       /* 刷新表格 */
       reload(where) {
       reload(where) {
         this.$refs.productTableRef.reload({ page: 1, where: where });
         this.$refs.productTableRef.reload({ page: 1, where: where });
       },
       },
+
+      // bom类型修改
+      bomTypeChange(row) {
+        row.bomVersion = '';
+      },
       // 工序配置
       // 工序配置
-      openConfig(row) {
+      async openConfig(row) {
         console.log('row', row);
         console.log('row', row);
-        this.$refs.workingProcedureRef.open();
+        if (row.bomType && row.bomVersion) {
+          // bom信息查询
+          const bomInfo = row.bomCategoryMap[row.bomType].find(
+            (item) => item.versions == row.bomVersion
+          );
+
+          // 查询工序信息
+          const data = await getMbomPage({
+            pageNum: 1,
+            size: 10,
+            bomCategoryId: bomInfo.id,
+            categoryCode: bomInfo.categoryCode
+          });
+
+          console.log('data', data[0]);
+
+          // 匹配当前工序
+
+          const currentTask = data[0]?.taskParam.find(
+            (item) => item.code == this.currentProcessData.code
+          );
+
+          console.log('currentTask', currentTask, this.currentProcessData.code);
+
+          if (currentTask) {
+            // 打开配置
+            this.$refs.workingProcedureRef.open(
+              currentTask,
+              bomInfo,
+              data[0],
+              false,
+              bomInfo,
+              bomInfo.id,
+              true
+            );
+          } else {
+            this.$message.warning('该BOM下未配置此工序');
+          }
+        } else {
+          this.$message.warning('请先选择BOM类型和版本');
+        }
       }
       }
     }
     }
   };
   };

+ 26 - 128
src/views/technology/production/components/user-setting-matter-process.vue

@@ -1,98 +1,5 @@
 <template>
 <template>
-  <ele-modal
-    :visible="visible"
-    :append-to-body="true"
-    :close-on-click-modal="false"
-    custom-class="ele-dialog-form"
-    title="配置事项"
-    @update:visible="updateVisible"
-    :maxable="true"
-    :before-close="handleClose"
-    width="60%"
-  >
-    <el-tabs v-model="reportWorkType" type="card">
-      <el-tab-pane
-        v-for="i in tabPaneList"
-        :label="i.dictValue"
-        :name="i.dictCode"
-        :key="i.dictCode"
-      ></el-tab-pane>
-    </el-tabs>
-    <div style="margin: 10px 0"></div>
-
-    <el-form :model="params" label-width="115px" style="margin-top: 20px">
-      <el-row :gutter="20" style="margin-bottom: 10px">
-        <el-col :span="10">
-          <el-form-item label="关联产品方式">
-            <el-select
-              v-model="relateProductMethod"
-              placeholder="请选择关联产品方式"
-              style="width: 100%"
-            >
-              <el-option
-                v-for="item in relateProductMethodOpeions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col v-if="relateProductMethod == 1" :span="10">
-          <el-form-item label="关联产品分类">
-            <ele-tree-select
-              multiple
-              clearable
-              :data="productCategory"
-              v-model="params.categoryLevels"
-              placeholder="请选择关联产品分类"
-              default-expand-all
-              labelKey="name"
-              valueKey="id"
-              @change="getMatterList"
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <template v-if="relateProductMethod == 2">
-        <div style="margin-bottom: 20px">
-          <header-title title="关联产品">
-            <el-button
-              size="mini"
-              type="primary"
-              icon="el-icon-plus"
-              class="ele-btn-icon"
-              @click="relateProductSelect"
-            >
-              选择产品
-            </el-button>
-          </header-title>
-
-          <ele-pro-table
-            ref="productTableRef"
-            :columns="productColumns"
-            :datasource="params.products"
-            :needPage="false"
-            row-key="id"
-            cache-key="user-setting-matter-process-product-2510181402"
-          >
-            <template v-slot:action="{ row }">
-              <el-link
-                type="danger"
-                :underline="false"
-                icon="el-icon-delete"
-                @click="productColumnsDeleteRow(row)"
-              >
-                删除
-              </el-link>
-            </template>
-          </ele-pro-table>
-        </div>
-      </template>
-    </el-form>
-
+  <div>
     <ele-pro-table
     <ele-pro-table
       ref="table"
       ref="table"
       :columns="bankColumns"
       :columns="bankColumns"
@@ -127,7 +34,6 @@
             </el-link>
             </el-link>
           </template>
           </template>
         </el-popconfirm>
         </el-popconfirm>
-
         <el-link
         <el-link
           type="primary"
           type="primary"
           :underline="false"
           :underline="false"
@@ -139,14 +45,6 @@
       </template>
       </template>
     </ele-pro-table>
     </ele-pro-table>
 
 
-    <template v-slot:footer>
-      <el-button type="primary" @click="saveMatterList" :loading="butLoading">
-        确定
-      </el-button>
-
-      <el-button @click="handleClose">取消</el-button>
-    </template>
-
     <userSettingMatterAdd
     <userSettingMatterAdd
       ref="userSettingMatterAddRef"
       ref="userSettingMatterAddRef"
       @addMatter="addMatter"
       @addMatter="addMatter"
@@ -159,7 +57,7 @@
       @changeProduct="changeRelateProduct"
       @changeProduct="changeRelateProduct"
       multiple
       multiple
     ></ProductModal>
     ></ProductModal>
-  </ele-modal>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
@@ -179,9 +77,20 @@
     name: 'UserSettingMatter',
     name: 'UserSettingMatter',
     mixins: [dictMixins, tableColumnsMixin],
     mixins: [dictMixins, tableColumnsMixin],
     components: { userSettingMatterAdd, ProductModal },
     components: { userSettingMatterAdd, ProductModal },
+    props: {
+      // 工序id
+      produceTaskId: {
+        type: String,
+        required: true
+      },
+      // 工序名称
+      produceTaskName: {
+        type: String,
+        required: true
+      }
+    },
     data() {
     data() {
       return {
       return {
-        visible: false,
         // 	记录规则报工类型 产前、过程、产后
         // 	记录规则报工类型 产前、过程、产后
         reportWorkType: '2',
         reportWorkType: '2',
         // 事项列表
         // 事项列表
@@ -225,8 +134,6 @@
             slot: 'action'
             slot: 'action'
           }
           }
         ],
         ],
-        // 当前行数据
-        currentRow: null,
         // 添加事项列表
         // 添加事项列表
         addPOs: [],
         addPOs: [],
         deletedIds: [],
         deletedIds: [],
@@ -307,6 +214,7 @@
     },
     },
     created() {
     created() {
       this.getProductCategory();
       this.getProductCategory();
+      this.getMatterList();
     },
     },
     methods: {
     methods: {
       // 获取产品分类
       // 获取产品分类
@@ -315,20 +223,11 @@
         console.log('产品分类', data);
         console.log('产品分类', data);
         this.productCategory = data;
         this.productCategory = data;
       },
       },
-      updateVisible(val) {
-        this.visible = val;
-      },
-      openSetting(row) {
-        console.log('row', row);
-        this.currentRow = row;
-        this.visible = true;
-        this.getMatterList();
-      },
       // 查询事项数据
       // 查询事项数据
       async getMatterList() {
       async getMatterList() {
         const { list } = await produceTaskRecordRules({
         const { list } = await produceTaskRecordRules({
           // 工序id
           // 工序id
-          produceTaskId: this.currentRow.id,
+          produceTaskId: this.produceTaskId,
           pageNum: 1,
           pageNum: 1,
           size: 9999,
           size: 9999,
           reportWorkType: this.reportWorkType
           reportWorkType: this.reportWorkType
@@ -368,15 +267,15 @@
         this.matterList.push({
         this.matterList.push({
           ...matter,
           ...matter,
           id: id,
           id: id,
-          produceTaskId: this.currentRow.id,
-          produceTaskName: this.currentRow.name,
+          produceTaskId: this.produceTaskId,
+          produceTaskName: this.produceTaskName,
           reportWorkType: this.reportWorkType
           reportWorkType: this.reportWorkType
         });
         });
         this.addPOs.push({
         this.addPOs.push({
           ...matter,
           ...matter,
           id: id,
           id: id,
-          produceTaskId: this.currentRow.id,
-          produceTaskName: this.currentRow.name,
+          produceTaskId: this.produceTaskId,
+          produceTaskName: this.produceTaskName,
           reportWorkType: this.reportWorkType
           reportWorkType: this.reportWorkType
         });
         });
         this.handleSort();
         this.handleSort();
@@ -401,8 +300,8 @@
           );
           );
           this.updatePOs.push({
           this.updatePOs.push({
             ...matter,
             ...matter,
-            produceTaskId: this.currentRow.id,
-            produceTaskName: this.currentRow.name,
+            produceTaskId: this.produceTaskId,
+            produceTaskName: this.produceTaskName,
             reportWorkType: this.reportWorkType
             reportWorkType: this.reportWorkType
           });
           });
         } else {
         } else {
@@ -455,12 +354,12 @@
           await produceTaskRecordRulesBatchSave({
           await produceTaskRecordRulesBatchSave({
             addPOs: this.addPOs,
             addPOs: this.addPOs,
             deletedIds: this.deletedIds,
             deletedIds: this.deletedIds,
-            produceTaskId: this.currentRow.id,
-            produceTaskName: this.currentRow.name,
+            produceTaskId: this.produceTaskId,
+            produceTaskName: this.produceTaskName,
             updatePOs: this.updatePOs
             updatePOs: this.updatePOs
           });
           });
-          this.$message.success('保存成功');
           this.handleClose();
           this.handleClose();
+
           this.butLoading = false;
           this.butLoading = false;
         } catch (error) {
         } catch (error) {
           this.butLoading = false;
           this.butLoading = false;
@@ -468,8 +367,7 @@
       },
       },
       // 关闭弹窗、清空数据
       // 关闭弹窗、清空数据
       handleClose() {
       handleClose() {
-        this.visible = false;
-        this.matterList = [];
+        this.getMatterList();
         this.addPOs = [];
         this.addPOs = [];
         this.deletedIds = [];
         this.deletedIds = [];
         this.updatePOs = [];
         this.updatePOs = [];

+ 1 - 7
src/views/technology/production/index.vue

@@ -160,14 +160,10 @@
 
 
     <!-- 配置事项 产前准备 产后检查-->
     <!-- 配置事项 产前准备 产后检查-->
     <userSettingMatter ref="userSettingMatterRef" />
     <userSettingMatter ref="userSettingMatterRef" />
-    <!-- 配置事项  过程监测 -->
-    <userSettingMatterProcess
-      key="userSettingMatterProcessRef"
-      ref="userSettingMatterProcessRef"
-    ></userSettingMatterProcess>
 
 
     <WorkCenter ref="centerRefs" @changeCenter="determineChoose" />
     <WorkCenter ref="centerRefs" @changeCenter="determineChoose" />
 
 
+    <!-- 配置事项 过程监测 -->
     <userSettingMatterProcessDrawer
     <userSettingMatterProcessDrawer
       ref="userSettingMatterProcessDrawerRef"
       ref="userSettingMatterProcessDrawerRef"
     ></userSettingMatterProcessDrawer>
     ></userSettingMatterProcessDrawer>
@@ -186,7 +182,6 @@
   import work from '@/api/technology/work';
   import work from '@/api/technology/work';
   import WorkCenter from './components/WorkCenter.vue';
   import WorkCenter from './components/WorkCenter.vue';
   import userSettingMatter from './components/user-setting-matter.vue';
   import userSettingMatter from './components/user-setting-matter.vue';
-  import userSettingMatterProcess from './components/user-setting-matter-process.vue';
   import userSettingMatterProcessDrawer from './components/user-setting-matter-process-drawer.vue';
   import userSettingMatterProcessDrawer from './components/user-setting-matter-process-drawer.vue';
   import dictMixins from '@/mixins/dictMixins';
   import dictMixins from '@/mixins/dictMixins';
 
 
@@ -201,7 +196,6 @@
       importDialog,
       importDialog,
       WorkCenter,
       WorkCenter,
       userSettingMatter,
       userSettingMatter,
-      userSettingMatterProcess,
       userSettingMatterProcessDrawer
       userSettingMatterProcessDrawer
     },
     },
     data() {
     data() {

+ 79 - 1
src/views/technology/route/components/chooseCategory.vue

@@ -29,6 +29,15 @@
           @click="openEdit(null)"
           @click="openEdit(null)"
           >新增</el-button
           >新增</el-button
         >
         >
+
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-delete"
+          class="ele-btn-icon"
+          @click="batchDelete"
+          >批量删除</el-button
+        >
       </template>
       </template>
 
 
       <template v-slot:routingVersion="{ row }">
       <template v-slot:routingVersion="{ row }">
@@ -51,7 +60,7 @@
       @chooseCategory="chooseCategory"
       @chooseCategory="chooseCategory"
     ></chooseCategoryList>
     ></chooseCategoryList>
 
 
-    <choose-goods ref="chooseGoodsRef" @chooseGoods="chooseGoods"></choose-goods>
+    <choose-goods ref="chooseGoodsRef" @allGoods="allGoods"></choose-goods>
   </ele-modal>
   </ele-modal>
 </template>
 </template>
 
 
@@ -71,6 +80,12 @@
         selection: [],
         selection: [],
 
 
         columns: [
         columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           {
           {
             prop: 'categoryLevelCode',
             prop: 'categoryLevelCode',
             label: '物品分类编码',
             label: '物品分类编码',
@@ -231,6 +246,69 @@
           acc[key] = this.deepCopy(obj[key], hash);
           acc[key] = this.deepCopy(obj[key], hash);
           return acc;
           return acc;
         }, result);
         }, result);
+      },
+
+      allGoods(goodsList) {
+        let categoryList = [];
+        goodsList.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('保存失败');
+          });
+      },
+
+      batchDelete() {
+        if (this.selection.length == 0) {
+          this.$message.warning('请选择需要删除的数据');
+          return;
+        }
+
+        const messageTitle =
+          this.type == 1
+            ? '此操将删除该分类所绑定的工艺路线, 是否继续?'
+            : '此操将删除该物品所绑定的工艺路线, 是否继续?';
+
+        this.$confirm(messageTitle, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            let ids = [];
+            this.selection.forEach((item) => {
+              ids.push(item.id);
+            });
+            route
+              .deteleRoutingCategory(ids)
+              .then(() => {
+                this.$message.success('删除成功');
+                this.$refs.table.reload();
+              })
+              .catch(() => {
+                this.$message.error('删除失败');
+              });
+          })
+          .catch(() => {});
       }
       }
     }
     }
   };
   };

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

@@ -48,6 +48,8 @@
                 :currentData="currentData"
                 :currentData="currentData"
                 cacheKeyUrl="9b62e840-material-product"
                 cacheKeyUrl="9b62e840-material-product"
                 lyType="wp"
                 lyType="wp"
+                @allGoods="allGoods"
+                @cancel="cancel"
               >
               >
               </IndexData>
               </IndexData>
             </div>
             </div>
@@ -310,6 +312,14 @@
           }
           }
         }
         }
         return parents;
         return parents;
+      },
+
+      allGoods(goodsList) {
+        this.$emit('allGoods', goodsList);
+        this.visible = false;
+      },
+      cancel() {
+        this.visible = false;
       }
       }
     }
     }
   };
   };

+ 20 - 9
src/views/technology/route/components/index-data.vue

@@ -25,14 +25,12 @@
           {{ getDictValueFn(row.componentAttribute) }}
           {{ getDictValueFn(row.componentAttribute) }}
         </div>
         </div>
       </template>
       </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>
     </ele-pro-table>
+
+    <div class="btns">
+      <el-button type="primary" @click="save" class="btn"> 选择 </el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -469,8 +467,11 @@
           return;
           return;
         }
         }
 
 
-        this.$emit('chooseGoods', this.selection);
-        this.pageShow = false;
+        this.$emit('allGoods', this.selection);
+      },
+
+      cancel() {
+        this.$emit('cancel');
       },
       },
 
 
       success() {
       success() {
@@ -520,4 +521,14 @@
     width: 100px;
     width: 100px;
     margin-left: 10px;
     margin-left: 10px;
   }
   }
+
+  .btns {
+    margin-top: 10px;
+    display: flex;
+    flex-direction: row-reverse;
+
+    .btn {
+      margin-left: 10px;
+    }
+  }
 </style>
 </style>

+ 417 - 405
src/views/workforceManagement/schedule/detail.vue

@@ -4,6 +4,13 @@
       <el-card shadow="never">
       <el-card shadow="never">
         <template v-slot:header>
         <template v-slot:header>
           <div class="top-search-group">
           <div class="top-search-group">
+            <el-button
+              type="primary"
+              icon="el-icon-back"
+              style="margin-right: 30px"
+              @click="goBack"
+              >返回</el-button
+            >
             <el-input
             <el-input
               placeholder="搜索班次"
               placeholder="搜索班次"
               v-model="form.bc"
               v-model="form.bc"
@@ -21,8 +28,8 @@
               :style="`background-color:${classesColor[item.id]}`"
               :style="`background-color:${classesColor[item.id]}`"
               v-for="item in showClassesList"
               v-for="item in showClassesList"
               :key="item.id"
               :key="item.id"
-              >{{ item.name }} </div
-            >
+              >{{ item.name }}
+            </div>
             <div
             <div
               class="item"
               class="item"
               @click="handlselected(item)"
               @click="handlselected(item)"
@@ -62,445 +69,450 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import {
-  getpullDown,
-  teamqueuedetailSave,
-  getByIdteamqueue,
-  teamqueuedetailupdate
-} from '@/api/workforceManagement/schedule';
-import ManagementTable from './components/ManagementTable.vue';
-import { finishPageTab } from '@/utils/page-tab-util';
-import { debounce } from 'throttle-debounce';
-export default {
-  components: {
-    ManagementTable
-  },
-  data() {
-    const defaultForm = {
-      bc: '',
-      checked_bc: ''
-    };
-    return {
-      defaultForm,
-      // 表单数据
-      form: { ...defaultForm },
-      // 表单验证规则
-      rules: {},
-      type: '', // add/edit
-      loading: false,
-      colorList: [],
-      showClassesList: [],
-      classesList: [],
-      defaultbtn: [
-        {
-          name: '休息',
-          id: '1'
-        },
-        {
-          name: '清除单元格',
-          id: 'clear'
-        }
-      ],
-      selectedClasses: [],
-      classesColor: {
-        1: '#979d9d',
-        clear: '#979d9d'
-      },
-      addInfo: ''
-    };
-  },
-  computed: {
-    title() {
-      switch (this.type) {
-        case 'add':
-          return '排班';
-          break;
-        case 'edit':
-          return '排班';
-          break;
-        default:
-          break;
-      }
-    }
-  },
-  async created() {
-    this.search = debounce(500, this.search);
-    this.init();
-    await this.getBc();
-    
-  },
-  methods: {
-    // 初始化数据
-    init() {
-      if (this.$route.query.type) {
-        this.type = this.$route.query.type;
-        if (this.type == 'add') {
-          this.addInfo = this.$store.state.team.addInfo;
-          this.setAddinfo();
-        } else if (this.type == 'edit') {
-          // 按班排班
-          let isSchedule = this.$route.query.isSchedule;
-          if (isSchedule == '1') {
-            this.$nextTick(() => {
-              this.$refs.ManagementTable.changanbp();
-            });
+  import {
+    getpullDown,
+    teamqueuedetailSave,
+    getByIdteamqueue,
+    teamqueuedetailupdate
+  } from '@/api/workforceManagement/schedule';
+  import ManagementTable from './components/ManagementTable.vue';
+  import { finishPageTab } from '@/utils/page-tab-util';
+  import { debounce } from 'throttle-debounce';
+  export default {
+    components: {
+      ManagementTable
+    },
+    data() {
+      const defaultForm = {
+        bc: '',
+        checked_bc: ''
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {},
+        type: '', // add/edit
+        loading: false,
+        colorList: [],
+        showClassesList: [],
+        classesList: [],
+        defaultbtn: [
+          {
+            name: '休息',
+            id: '1'
+          },
+          {
+            name: '清除单元格',
+            id: 'clear'
           }
           }
-          this.getByIdteamqueue(this.$route.query.id);
+        ],
+        selectedClasses: [],
+        classesColor: {
+          1: '#979d9d',
+          clear: '#979d9d'
+        },
+        addInfo: ''
+      };
+    },
+    computed: {
+      title() {
+        switch (this.type) {
+          case 'add':
+            return '排班';
+            break;
+          case 'edit':
+            return '排班';
+            break;
+          default:
+            break;
         }
         }
       }
       }
     },
     },
-    /* 保存 */
-    save() {
-      switch (this.type) {
-        case 'add':
-          this.add();
-          break;
-        case 'edit':
-          this.update();
-          break;
-        default:
-          break;
-      }
+    async created() {
+      this.search = debounce(500, this.search);
+      this.init();
+      await this.getBc();
     },
     },
-    // 修改
-    update() {
-      // 源数据
-      let personData = this.$refs.ManagementTable.personData;
-      let teamData = this.$refs.ManagementTable.teamData;
-
-      let personDetails = [];
-      let teamDetails = [];
-      // 处理人员数据
-      personData.forEach((n) => {
-        // 时间数据
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-            teamQueueTime.push({
-              date: key != 'null' ? key : null ,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
+    methods: {
+      // 初始化数据
+      init() {
+        if (this.$route.query.type) {
+          this.type = this.$route.query.type;
+          if (this.type == 'add') {
+            this.addInfo = this.$store.state.team.addInfo;
+            this.setAddinfo();
+          } else if (this.type == 'edit') {
+            // 按班排班
+            let isSchedule = this.$route.query.isSchedule;
+            if (isSchedule == '1') {
+              this.$nextTick(() => {
+                this.$refs.ManagementTable.changanbp();
+              });
+            }
+            this.getByIdteamqueue(this.$route.query.id);
           }
           }
         }
         }
-
-        personDetails.push({
-          id: n.item.id,
-          userId: n.item.userId,
-          type: n.item.type,
-          teamId: n.item.teamId,
-          teamQueueTime
-        });
-      });
-      // 处理班组数据
-      teamData.forEach((n) => {
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-            teamQueueTime.push({
-              date: key,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
-          }
+      },
+      /* 保存 */
+      save() {
+        switch (this.type) {
+          case 'add':
+            this.add();
+            break;
+          case 'edit':
+            this.update();
+            break;
+          default:
+            break;
         }
         }
-        teamDetails.push({
-          id: n.item.id,
-          type: n.item.type,
-          teamId: n.item.teamId,
-          teamQueueTime
-        });
-      });
-      let par = {
-        id: this.$route.query.id,
-        personDetails,
-        teamDetails
-      };
-      const loading = this.$messageLoading('正在请求中..');
-      teamqueuedetailupdate(par).then((msg) => {
-        this.$message.success(msg);
-        this.rest();
-      }).finally(() => {
-        loading.close();
-      })
-    },
-    // 处理新增信息
-    setAddinfo() {
-      if (this.addInfo) {
-        let addInfo = this.addInfo;
-        // 人员数据
-        let personDetails = addInfo.personDetails.map((n) => {
-          return {
-            item: {
-              name: n.userName,
-              ...n
+      },
+      // 修改
+      update() {
+        // 源数据
+        let personData = this.$refs.ManagementTable.personData;
+        let teamData = this.$refs.ManagementTable.teamData;
+
+        let personDetails = [];
+        let teamDetails = [];
+        // 处理人员数据
+        personData.forEach((n) => {
+          // 时间数据
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key != 'null' ? key : null,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
             }
             }
-          };
+          }
+
+          personDetails.push({
+            id: n.item.id,
+            userId: n.item.userId,
+            type: n.item.type,
+            teamId: n.item.teamId,
+            teamQueueTime
+          });
         });
         });
-        // 班组数据
-        let teamDetails = addInfo.teamDetails.map((n) => {
-          return {
-            item: {
-              name: n.teamName,
-              ...n
+        // 处理班组数据
+        teamData.forEach((n) => {
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
             }
             }
-          };
-        });
-        this.$nextTick(() => {
-          this.$refs.ManagementTable.setData(personDetails, teamDetails);
-        });
-      }
-    },
-    // 新增
-    add() {
-      let addInfo = this.$store.state.team.addInfo;
-      // 源数据
-      let personData = this.$refs.ManagementTable.personData;
-      let teamData = this.$refs.ManagementTable.teamData;
-
-      let personDetails = [];
-      let teamDetails = [];
-      // 处理人员数据
-      personData.forEach((n) => {
-        // 时间数据
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-            teamQueueTime.push({
-              date: key,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
           }
           }
+          teamDetails.push({
+            id: n.item.id,
+            type: n.item.type,
+            teamId: n.item.teamId,
+            teamQueueTime
+          });
+        });
+        let par = {
+          id: this.$route.query.id,
+          personDetails,
+          teamDetails
+        };
+        const loading = this.$messageLoading('正在请求中..');
+        teamqueuedetailupdate(par)
+          .then((msg) => {
+            this.$message.success(msg);
+            this.rest();
+          })
+          .finally(() => {
+            loading.close();
+          });
+      },
+      // 处理新增信息
+      setAddinfo() {
+        if (this.addInfo) {
+          let addInfo = this.addInfo;
+          // 人员数据
+          let personDetails = addInfo.personDetails.map((n) => {
+            return {
+              item: {
+                name: n.userName,
+                ...n
+              }
+            };
+          });
+          // 班组数据
+          let teamDetails = addInfo.teamDetails.map((n) => {
+            return {
+              item: {
+                name: n.teamName,
+                ...n
+              }
+            };
+          });
+          this.$nextTick(() => {
+            this.$refs.ManagementTable.setData(personDetails, teamDetails);
+          });
         }
         }
+      },
+      // 新增
+      add() {
+        let addInfo = this.$store.state.team.addInfo;
+        // 源数据
+        let personData = this.$refs.ManagementTable.personData;
+        let teamData = this.$refs.ManagementTable.teamData;
 
 
-        personDetails.push({
-          userId: n.item.userId,
-          type: n.item.type,
-          teamId: n.item.teamId,
-          teamQueueTime
-        });
-      });
-      // 处理班组数据
-      teamData.forEach((n) => {
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-          
-            teamQueueTime.push({
-              date: key,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
+        let personDetails = [];
+        let teamDetails = [];
+        // 处理人员数据
+        personData.forEach((n) => {
+          // 时间数据
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
+            }
           }
           }
-        }
-        teamDetails.push({
-          type: n.item.type,
-          teamId: n.item.teamId,
-          
 
 
+          personDetails.push({
+            userId: n.item.userId,
+            type: n.item.type,
+            teamId: n.item.teamId,
+            teamQueueTime
+          });
         });
         });
-      });
-      let par = {
-        name: addInfo.name,
-        totalPersonNumber: addInfo.totalPersonNumber,
-        personDetails,
-        teamDetails
-      };
-      const loading = this.$messageLoading('正在请求中..');
-      teamqueuedetailSave(par).then((msg) => {
-        this.$message.success(msg);
-        finishPageTab();
-      }).finally(() => {
-        loading.close();
-      })
-    },
-    // 重置
-    rest() {
-      if (this.type == 'add') {
-        this.setAddinfo();
-      } else if (this.type == 'edit') {
-        this.getByIdteamqueue(this.$route.query.id);
-      }
-    },
-    // 配置颜色
-    configColor() {
-      this.classesList.forEach((element, index) => {
-        console.log(element.id)
-        this.$set(this.classesColor, element.id, this.colorList[index]);
-      });
-    },
-    handleClose() {
-      this.visible = false;
-    },
-    handlselected(val) {
-      if (val.id == '1' || val.id == 'clear') {
-        this.selectedClasses = [val];
-      } else {
-        let result = this.selectedClasses.find((n) => {
-          return ['1', 'clear'].includes(n.id);
+        // 处理班组数据
+        teamData.forEach((n) => {
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
+            }
+          }
+          teamDetails.push({
+            type: n.item.type,
+            teamId: n.item.teamId
+          });
         });
         });
-        if (result) {
-          this.selectedClasses = [];
+        let par = {
+          name: addInfo.name,
+          totalPersonNumber: addInfo.totalPersonNumber,
+          personDetails,
+          teamDetails
+        };
+        const loading = this.$messageLoading('正在请求中..');
+        teamqueuedetailSave(par)
+          .then((msg) => {
+            this.$message.success(msg);
+            finishPageTab();
+          })
+          .finally(() => {
+            loading.close();
+          });
+      },
+      // 重置
+      rest() {
+        if (this.type == 'add') {
+          this.setAddinfo();
+        } else if (this.type == 'edit') {
+          this.getByIdteamqueue(this.$route.query.id);
         }
         }
-        this.selectedClasses.push(val);
-      }
-      // 去重
-      this.selectedClasses = Array.from(new Set(this.selectedClasses));
-    },
-    // 删除标签
-    handleClose(tag) {
-      this.selectedClasses.splice(this.selectedClasses.indexOf(tag), 1);
-    },
-    // 获取班次
-    getBc() {
-      return getpullDown().then((res) => {
-        this.classesList = res.map((n) => {
-          return {
-            id: n.id,
-            name: `${n.name}(${n.startTime.slice(0, 5)}-${n.endTime.slice(
-              0,
-              5
-            )})`
-          };
+      },
+      // 配置颜色
+      configColor() {
+        this.classesList.forEach((element, index) => {
+          console.log(element.id);
+          this.$set(this.classesColor, element.id, this.colorList[index]);
         });
         });
-     
-        let len = Math.round(this.classesList.length/5)
-        len == 0 ? len = 1 : len
-    
-        const color = [
+      },
+      handleClose() {
+        this.visible = false;
+      },
+      handlselected(val) {
+        if (val.id == '1' || val.id == 'clear') {
+          this.selectedClasses = [val];
+        } else {
+          let result = this.selectedClasses.find((n) => {
+            return ['1', 'clear'].includes(n.id);
+          });
+          if (result) {
+            this.selectedClasses = [];
+          }
+          this.selectedClasses.push(val);
+        }
+        // 去重
+        this.selectedClasses = Array.from(new Set(this.selectedClasses));
+      },
+      // 删除标签
+      handleClose(tag) {
+        this.selectedClasses.splice(this.selectedClasses.indexOf(tag), 1);
+      },
+      // 获取班次
+      getBc() {
+        return getpullDown().then((res) => {
+          this.classesList = res.map((n) => {
+            return {
+              id: n.id,
+              name: `${n.name}(${n.startTime.slice(0, 5)}-${n.endTime.slice(
+                0,
+                5
+              )})`
+            };
+          });
+
+          let len = Math.round(this.classesList.length / 5);
+          len == 0 ? (len = 1) : len;
+
+          const color = [
             '#fb6f7b',
             '#fb6f7b',
             '#f59a23',
             '#f59a23',
             '#4672ca',
             '#4672ca',
             '#2196f3',
             '#2196f3',
             '#00bcd4',
             '#00bcd4',
-            '#009688',
-        ]
-        for(var i = 0;i<len;i++){
-            this.colorList = this.colorList.concat(color)
-        }
-        this.showClassesList = this.classesList;
-
-        this.configColor();
-      });
-    },
-    // 搜索
-    search(val) {
-      if (val !== '') {
-        this.showClassesList = this.classesList.filter((n) => {
-          return n.name.toLowerCase().indexOf(val.toLowerCase()) > -1;
-        });
-      } else {
-        this.showClassesList = this.classesList;
-      }
-    },
-    // 获取排班详情
-    getByIdteamqueue(id) {
-      getByIdteamqueue(id).then((res) => {
-        // 回显数据
-        //人员数据
-        let personDetails = res.personDetails.map((n) => {
-          let item = {
-            name: n.userName,
-            ...n
-          };
-          delete item.teamQueueTime;
-          let teamQueueTime = {};
-          if (n.teamQueueTime) {
-            n.teamQueueTime.forEach((el) => {
-              teamQueueTime[el.date] = el.teamTimeSimple;
-            });
+            '#009688'
+          ];
+          for (var i = 0; i < len; i++) {
+            this.colorList = this.colorList.concat(color);
           }
           }
+          this.showClassesList = this.classesList;
 
 
-          return {
-            item,
-            ...teamQueueTime
-          };
+          this.configColor();
         });
         });
-        // 班组数据
-        let teamDetails = res.teamDetails.map((n) => {
-          let item = {
-            name: n.teamName,
-            ...n
-          };
-          delete item.teamQueueTime;
-          let teamQueueTime = {};
-          if (n.teamQueueTime) {
-            n.teamQueueTime.forEach((el) => {
-              teamQueueTime[el.date] = el.teamTimeSimple;
-            });
-          }
+      },
 
 
-          return {
-            item,
-            ...teamQueueTime
-          };
-        });
-        this.$nextTick(() => {
-          this.$refs.ManagementTable.setData(personDetails, teamDetails);
+      goBack() {
+        this.$router.go(-1);
+      },
+
+      // 搜索
+      search(val) {
+        if (val !== '') {
+          this.showClassesList = this.classesList.filter((n) => {
+            return n.name.toLowerCase().indexOf(val.toLowerCase()) > -1;
+          });
+        } else {
+          this.showClassesList = this.classesList;
+        }
+      },
+      // 获取排班详情
+      getByIdteamqueue(id) {
+        getByIdteamqueue(id).then((res) => {
+          // 回显数据
+          //人员数据
+          let personDetails = res.personDetails.map((n) => {
+            let item = {
+              name: n.userName,
+              ...n
+            };
+            delete item.teamQueueTime;
+            let teamQueueTime = {};
+            if (n.teamQueueTime) {
+              n.teamQueueTime.forEach((el) => {
+                teamQueueTime[el.date] = el.teamTimeSimple;
+              });
+            }
+
+            return {
+              item,
+              ...teamQueueTime
+            };
+          });
+          // 班组数据
+          let teamDetails = res.teamDetails.map((n) => {
+            let item = {
+              name: n.teamName,
+              ...n
+            };
+            delete item.teamQueueTime;
+            let teamQueueTime = {};
+            if (n.teamQueueTime) {
+              n.teamQueueTime.forEach((el) => {
+                teamQueueTime[el.date] = el.teamTimeSimple;
+              });
+            }
+
+            return {
+              item,
+              ...teamQueueTime
+            };
+          });
+          this.$nextTick(() => {
+            this.$refs.ManagementTable.setData(personDetails, teamDetails);
+          });
         });
         });
-      });
+      }
     }
     }
-  }
-};
+  };
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.location-warp {
-  display: flex;
-  .detail {
-    margin-left: 10px;
-  }
-}
-.top-search-group {
-  max-width: 400px;
-  display: flex;
-  :deep(.el-input input) {
-    border-top-right-radius: 0;
-    border-bottom-right-radius: 0;
-    border-right-width: 0;
-  }
-  .el-button {
-    border-top-left-radius: 0;
-    border-bottom-left-radius: 0;
-  }
-}
-.bc-warp {
-  display: flex;
-  flex-wrap:wrap;
-  .item {
-    height: 34px;
-    padding: 0 10px;
-    color: #fff;
-    border-radius: 4px;
-    cursor: pointer;
-    margin-right: 10px;
-    margin-bottom:10px;
+  .location-warp {
+    display: flex;
+    .detail {
+      margin-left: 10px;
+    }
   }
   }
-  .item + .item {
-    margin-right: 10px;
-    margin-bottom:10px;
+  .top-search-group {
+    max-width: 400px;
+    display: flex;
+    :deep(.el-input input) {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+      border-right-width: 0;
+    }
+    .el-button {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
   }
   }
-  .tag {
-    color: #fff;
-    height: 34px;
-    border: none;
-    line-height: 34px;
-    margin:0 10px 10px 0;
-    :deep(.el-tag__close) {
+  .bc-warp {
+    display: flex;
+    flex-wrap: wrap;
+    .item {
+      height: 34px;
+      padding: 0 10px;
+      color: #fff;
+      border-radius: 4px;
+      cursor: pointer;
+      margin-right: 10px;
+      margin-bottom: 10px;
+    }
+    .item + .item {
+      margin-right: 10px;
+      margin-bottom: 10px;
+    }
+    .tag {
       color: #fff;
       color: #fff;
+      height: 34px;
+      border: none;
+      line-height: 34px;
+      margin: 0 10px 10px 0;
+      :deep(.el-tag__close) {
+        color: #fff;
+      }
     }
     }
   }
   }
-}
 </style>
 </style>

Разница между файлами не показана из-за своего большого размера
+ 295 - 295
yarn.lock


Некоторые файлы не были показаны из-за большого количества измененных файлов