ysy 1 سال پیش
والد
کامیت
e3111455d3

+ 4 - 1
src/views/material/BOMmanage/components/attribute.vue

@@ -274,11 +274,12 @@
     beforeDestroy() {},
     methods: {
       async getDictList(code) {
+      
         let { data: res } = await getByCode(code);
         this.dictList = res.map((item) => {
           let values = Object.keys(item);
           return {
-            value: values[0],
+            value: Number(values[0]),
             label: item[values[0]]
           };
         });
@@ -298,6 +299,8 @@
         console.log(Object.prototype.hasOwnProperty.call(val, 'category'));
         if (Object.prototype.hasOwnProperty.call(val, 'category')) {
           this.category = val.category;
+          this.category.produceType  = val.produceType
+          
 
           this.$forceUpdate();
         }

+ 3 - 0
src/views/material/BOMmanage/components/detailedList.vue

@@ -147,6 +147,9 @@
         },
         /* 表格数据源 */
         datasource({ where, page, limit }) {
+            if(!this.attrObj.id) {
+                return false
+            }
           return getBomPageCategoryId({
             ...where,
             pageNum: page,

+ 13 - 1
src/views/material/BOMmanage/components/processModal.vue

@@ -147,7 +147,19 @@
       },
       open(item, selectWorkingProcess, type, currentRow) {
         this.type = type;
-        this.selectWorkingProcess = selectWorkingProcess;
+        if (
+          Object.prototype.hasOwnProperty.call(
+            selectWorkingProcess,
+            'taskParam'
+          )
+        ) {
+          this.selectWorkingProcess = selectWorkingProcess;
+        } else {
+          this.selectWorkingProcess = {
+            taskParam: []
+          };
+        }
+
         this.currentRow = currentRow;
         this.processData = item;
         this.initColumns();

+ 27 - 4
src/views/material/BOMmanage/components/routing.vue

@@ -30,7 +30,7 @@
         </template>
 
         <template v-slot:action="{ row, $index }">
-          <el-link type="primary" @click="handleDel(row, $index)">删除</el-link>
+          <el-link type="danger" @click="handleDel(row)">删除</el-link>
         </template>
       </ele-pro-table>
     </el-card>
@@ -41,6 +41,10 @@
 <script>
   import { getMbomPage } from '@/api/material/BOM';
   import routingDialog from './routingDialog.vue';
+
+  import {
+    workingProcedureUpdate,
+  } from '@/api/material/BOM';
   export default {
     name: 'technologyRoute',
     components: {
@@ -102,6 +106,12 @@
             label: '类型',
             align: 'center',
             showOverflowTooltip: true
+          },
+          {
+            prop: 'action',
+            label: '操作',
+            align: 'center',
+            slot: 'action'
           }
         ],
 
@@ -145,9 +155,22 @@
         }
       },
 
-
-      handleDel(row, index) {
-        
+      handleDel(row) {
+        console.log(row,  this.tableData);
+        workingProcedureUpdate({
+          id: this.tableData.id,
+          categoryId: this.taskParam.categoryId,
+          bomCategoryId: this.taskParam.id,
+          categoryCode: this.taskParam.categoryCode,
+          processRoute: {
+            list: this.tableData.processRoute.list.filter(
+            (item) => item.id !== row.id
+          )
+          }
+        }).then((data) => {
+          this.$message.success('删除成功');
+          this.reload();
+        });
       },
       checkStatus(row) {
         let obj = this.statusList.find((it) => it.value == row.status);

+ 21 - 14
src/views/material/BOMmanage/components/routingDialog.vue

@@ -21,12 +21,20 @@
           <el-row>
             <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
               <el-form-item label="工艺路线组编码:">
-                <el-input clearable v-model.trim="where.code" placeholder="请输入" />
+                <el-input
+                  clearable
+                  v-model.trim="where.code"
+                  placeholder="请输入"
+                />
               </el-form-item>
             </el-col>
             <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
               <el-form-item label="工艺路线名称:">
-                <el-input clearable v-model.trim="where.name" placeholder="请输入" />
+                <el-input
+                  clearable
+                  v-model.trim="where.name"
+                  placeholder="请输入"
+                />
               </el-form-item>
             </el-col>
             <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
@@ -88,17 +96,7 @@
           :selection.sync="selection"
           row-key="id"
         >
-          <!-- 表头工具栏 -->
-          <template v-slot:toolbar>
-            <el-button
-              size="small"
-              type="primary"
-              icon="el-icon-plus"
-              class="ele-btn-icon"
-              @click="synchronous()"
-              >同步</el-button
-            >
-          </template>
+
 
           <template v-slot:code="{ row }">
             <el-link type="primary" :underline="false" @click="openDetail(row)">
@@ -251,7 +249,16 @@
       open(treeData, tableData) {
         this.treeData = treeData;
         console.log(tableData);
-        this.tableData = tableData;
+
+        if (
+          Object.prototype.hasOwnProperty.call(tableData.processRoute, 'list')
+        ) {
+          this.tableData = tableData;
+        } else {
+          this.tableData = tableData;
+          this.tableData.processRoute.list = [];
+        }
+
         this.visible = true;
       },
       selected() {

+ 1 - 1
src/views/material/BOMmanage/details.vue

@@ -123,7 +123,7 @@
               <el-tab-pane label="属性" name="属性">
                 <attribute :attributeData="currentNodeData"></attribute>
               </el-tab-pane>
-              <el-tab-pane label="清单" name="清单">
+              <el-tab-pane  :label="currentNodeData.bomType == 1 ? 'PBOM明细表' : currentNodeData.bomType == 2 ? 'MBOM明细表' : 'ABOM明细表' " name="明细表">
                 <!-- <document></document> -->
                  <detailedList  :attributeData="currentNodeData"></detailedList>
               </el-tab-pane>