Explorar o código

禅道bug 2635 2633 修复:临时生产计划编辑功能优化及行号字段调整

yusheng hai 9 meses
pai
achega
b6994937ae

+ 20 - 0
src/api/productionPlan/index.js

@@ -75,6 +75,16 @@ export async function del(id) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+/**
+ * 删除
+ */
+export async function factoryDelete(id) {
+  const res = await request.delete(`/aps/productionplan/delete/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 
 // 拆分
 // 拆分
 export async function splitWork(params) {
 export async function splitWork(params) {
@@ -134,6 +144,16 @@ export async function batchSave(data) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+
+// 计划分解 (保存并发布)
+export async function issueProductionPlan(data) {
+  const res = await request.post(`/aps/productionplan/issueProductionPlan`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 齐套性检查
 // 齐套性检查
 export async function homogeneityInspect(data) {
 export async function homogeneityInspect(data) {
   const res = await request.post(
   const res = await request.post(

+ 10 - 0
src/api/saleOrder/index.js

@@ -328,3 +328,13 @@ export async function findBomCategoryByCategoryIds(data) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+
+// 临时计划
+export async function getUpdateInfoByCode(code) {
+  const res = await request.get(`/aps/productionplan/getUpdateInfoByCode/${code}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 212 - 162
src/views/productionPlan/components/factoryAdd/index.vue

@@ -215,15 +215,13 @@
             </template>
             </template>
 
 
             <template v-slot:bomCategoryId="{ row, $index }">
             <template v-slot:bomCategoryId="{ row, $index }">
-              <el-select
-                v-model="row.bomCategoryId"
-                @change="changeBomId(row, $index)"
-              >
+              <el-select v-model="row.bomCategoryId">
                 <el-option
                 <el-option
                   v-for="item of row.bomVersionList"
                   v-for="item of row.bomVersionList"
                   :key="item.id"
                   :key="item.id"
                   :label="item.name + '(V' + item.versions + '.0)'"
                   :label="item.name + '(V' + item.versions + '.0)'"
                   :value="item.id"
                   :value="item.id"
+                  @click.native="changeBomId(row, $index, item)"
                 ></el-option>
                 ></el-option>
               </el-select>
               </el-select>
             </template>
             </template>
@@ -395,10 +393,7 @@
             </template>
             </template>
 
 
             <template v-slot:set="{ row, $index }">
             <template v-slot:set="{ row, $index }">
-              <el-button
-                type="text"
-                @click="handleDeleteItem($index)"
-                v-if="!row.id"
+              <el-button type="text" @click="handleDeleteItem($index)"
                 >删除</el-button
                 >删除</el-button
               >
               >
             </template>
             </template>
@@ -429,7 +424,6 @@
         @choose="confirmChoose"
         @choose="confirmChoose"
         :selectList="[]"
         :selectList="[]"
         ref="equipmentRefs"
         ref="equipmentRefs"
-        isMultiple="0"
       >
       >
       </EquipmentDialog>
       </EquipmentDialog>
     </div>
     </div>
@@ -457,9 +451,11 @@
     saveSaleToPlan,
     saveSaleToPlan,
     getFactoryList,
     getFactoryList,
     temporarilyUpdate,
     temporarilyUpdate,
-    temporaryPlanSave
+    temporaryPlanSave,
+    getUpdateInfoByCode
   } from '@/api/saleOrder';
   } from '@/api/saleOrder';
   import contactDialog from '@/components/contactDialog/openContactDialog.vue';
   import contactDialog from '@/components/contactDialog/openContactDialog.vue';
+  import awk from 'highlight.js/lib/languages/awk';
 
 
   export default {
   export default {
     components: {
     components: {
@@ -891,6 +887,7 @@
       },
       },
       async open(val) {
       async open(val) {
         await this.getFactoryList();
         await this.getFactoryList();
+
         this.clientEnvironmentId =
         this.clientEnvironmentId =
           this.$store.state.user.info.clientEnvironmentId;
           this.$store.state.user.info.clientEnvironmentId;
         this.factoriesId = this.$store.state.user.info.factoryId;
         this.factoriesId = this.$store.state.user.info.factoryId;
@@ -901,7 +898,7 @@
           }
           }
           this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
           this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
           val.planType = String(val.planType);
           val.planType = String(val.planType);
-          this.form = val;
+          this.form = await getUpdateInfoByCode(val.code);
           // 修改
           // 修改
           if (val.id) {
           if (val.id) {
             if (
             if (
@@ -926,43 +923,67 @@
                   this.$set(
                   this.$set(
                     this.form.productInfoList[index],
                     this.form.productInfoList[index],
                     'routingList',
                     'routingList',
-                    await this.changeBomIdFn(v.bomCategoryId)
+                    await this.changeBomIdFn(
+                      v.bomCategoryId,
+                      this.form.productInfoList[index]
+                    )
                   );
                   );
                 }
                 }
               });
               });
             }
             }
-            let categoryId = this.form.productInfoList[0].categoryId;
-            const res = await findBomCategoryByCategoryId(categoryId);
-            if (res && res.length > 0) {
-              let list = [];
-              let listMap = {};
-              res.map((el) => {
-                if (el.bomType == '2' || el.bomType == '3') {
-                  console.log(listMap, 'listMap');
-                  if (listMap[el.bomType]) {
-                    listMap[el.bomType].push(el);
-                  } else {
-                    listMap[el.bomType] = [el];
+            // let categoryId = this.form.productInfoList[0].categoryId;
+            // const res = await findBomCategoryByCategoryId(categoryId);
+            let promiseAll = [];
+            this.form.productInfoList.forEach(async (item) => {
+              let categoryId = item.categoryId;
+              promiseAll.push(findBomCategoryByCategoryId(categoryId));
+            });
+            const resAll = await Promise.all(promiseAll);
+            console.log(this.form.productInfoList);
+
+            this.form.productInfoList.forEach((item, index) => {
+              if (resAll[index]) {
+                let list = [];
+                let listMap = {};
+
+                resAll[index].map((el) => {
+                  if (el.bomType == '2' || el.bomType == '3') {
+                    console.log(listMap, 'listMap');
+                    if (listMap[el.bomType]) {
+                      listMap[el.bomType].push(el);
+                    } else {
+                      listMap[el.bomType] = [el];
+                    }
                   }
                   }
+                });
+                if (listMap[2]) {
+                  list.push({ code: 2, name: 'MBOM' });
+                }
+                if (listMap[3]) {
+                  list.push({ code: 3, name: 'ABOM' });
                 }
                 }
-              });
-              if (listMap[2]) {
-                list.push({ code: 2, name: 'MBOM' });
-              }
-              if (listMap[3]) {
-                list.push({ code: 3, name: 'ABOM' });
-              }
 
 
-              if (!this.form.productInfoList[0].factoriesId) {
-                this.form.productInfoList[0].factoriesId = this.factoriesId;
-                this.form.productInfoList[0].factoriesName =
-                  this.factoryList?.find(
-                    (factoryData) => factoryData.id === this.factoriesId
-                  )?.name;
+                if (!item.factoriesId) {
+                  this.$set(
+                    this.form.productInfoList[index],
+                    'factoriesId',
+                    this.factoriesId
+                  );
+                  this.$set(
+                    this.form.productInfoList[index],
+                    'factoriesName',
+                    this.factoryList?.find(
+                      (factoryData) => factoryData.id === this.factoriesId
+                    )?.name
+                  );
+                }
+                this.$set(
+                  this.form.productInfoList[index],
+                  'producedList',
+                  list
+                );
               }
               }
-
-              this.form.productInfoList[0].producedList = list;
-            }
+            });
           }
           }
           this.$forceUpdate();
           this.$forceUpdate();
         } else {
         } else {
@@ -1004,120 +1025,139 @@
             }
             }
           });
           });
         }
         }
+        let ids = this.form.productInfoList.map((item) => item.categoryId);
 
 
-        list = list
-          .filter(
-            (i) =>
-              !this.disabledList.find(
-                (p) => p.productCode == i.code || p.productCode == i.productCode
-              )
-          )
+        let result = list
+          .filter((i) => !ids.includes(i.id))
           .map((item, index) => {
           .map((item, index) => {
-            if (item.productCode) {
-              return item;
-            } else {
-              return {
-                categoryId: item.id,
-                productCode: item.code,
-                productName: item.name,
-                productUnitWeight: item.netWeight,
-                weightUnit: item.weightUnit,
-                model: item.modelType,
-                specification: item.specification,
-                brandNo: item.brandNum,
-                measuringUnit: item.measuringUnit,
-                produceRoutingId: item.produceRoutingId,
-                produceRoutingName: item.produceRoutingName,
-                produceVersionName: item.produceVersionName,
-                factoriesId: this.factoriesId,
-                factoriesName: this.factoryList?.find(
-                  (factoryData) => factoryData.id === this.factoriesId
-                )?.name
-              };
-            }
-          })
-          .concat(this.disabledList);
-
-        this.form.productInfoList = [];
+            return {
+              categoryId: item.id,
+              productCode: item.code,
+              productName: item.name,
+              productUnitWeight: item.netWeight,
+              weightUnit: item.weightUnit,
+              model: item.modelType,
+              specification: item.specification,
+              brandNo: item.brandNum,
+              measuringUnit: item.measuringUnit,
+              produceRoutingId: item.produceRoutingId,
+              produceRoutingName: item.produceRoutingName,
+              produceVersionName: item.produceVersionName,
+              factoriesId: this.factoriesId,
+              factoriesName: this.factoryList?.find(
+                (factoryData) => factoryData.id === this.factoriesId
+              )?.name
+            };
+          });
+        // this.form.productInfoList = [];
 
 
         //  取出在弹窗中选中并且不在表格中的数据
         //  取出在弹窗中选中并且不在表格中的数据
-        const result = list.filter(
-          (i) =>
-            this.form.productInfoList.findIndex(
-              (p) => p.productCode === i.productCode
-            ) === -1
-        );
-
-        // 取出在表格中并且不在弹窗中选中的数据 即取消选中的数据
-        const del = this.form.productInfoList.filter(
-          (i) => list.findIndex((p) => p.productCode === i.productCode) === -1
-        );
-
-        for (let i = this.form.productInfoList.length - 1; i >= 0; i--) {
-          for (let j in del) {
-            if (
-              this.form.productInfoList[i].productCode === del[j].productCode
-            ) {
-              this.form.productInfoList.splice(i, 1);
-              break;
-            }
-          }
-        }
+        // const result = list.filter(
+        //   (i) =>
+        //     this.form.productInfoList.findIndex(
+        //       (p) => p.productCode === i.productCode
+        //     ) === -1
+        // );
+
+        // // 取出在表格中并且不在弹窗中选中的数据 即取消选中的数据
+        // const del = this.form.productInfoList.filter(
+        //   (i) => list.findIndex((p) => p.productCode === i.productCode) === -1
+        // );
+
+        // for (let i = this.form.productInfoList.length - 1; i >= 0; i--) {
+        //   for (let j in del) {
+        //     if (
+        //       this.form.productInfoList[i].productCode === del[j].productCode
+        //     ) {
+        //       this.form.productInfoList.splice(i, 1);
+        //       break;
+        //     }
+        //   }
+        // }
+        let promiseAll = [];
+        result.forEach(async (item) => {
+          let categoryId = item.categoryId;
+          promiseAll.push(findBomCategoryByCategoryId(categoryId));
+        });
+
+        const resAll = await Promise.all(promiseAll);
 
 
         try {
         try {
-          let categoryId = result[0].categoryId;
-          const res = await findBomCategoryByCategoryId(categoryId);
-          if (res) {
-            let listMap = {};
-            let list = [];
-            let arr = [];
-            res.map((el) => {
-              if (el.bomType == '2' || el.bomType == '3') {
-                console.log(listMap, 'listMap');
-                if (listMap[el.bomType]) {
-                  listMap[el.bomType].push(el);
-                } else {
-                  listMap[el.bomType] = [el];
+          await result.forEach(async (item, index) => {
+            if (resAll[index]) {
+              let listMap = {};
+              let list = [];
+              let arr = [];
+              resAll[index].map((el) => {
+                if (el.bomType == '2' || el.bomType == '3') {
+                  console.log(listMap, 'listMap');
+                  if (listMap[el.bomType]) {
+                    listMap[el.bomType].push(el);
+                  } else {
+                    listMap[el.bomType] = [el];
+                  }
+                }
+              });
+              if (listMap[2]) {
+                list.push({ code: 2, name: 'MBOM' });
+                arr = listMap[2];
+                item.productType = 2;
+              }
+              if (listMap[3]) {
+                list.push({ code: 3, name: 'ABOM' });
+                if (!listMap[2]) {
+                  arr = listMap[3];
+                  item.productType = 3;
                 }
                 }
               }
               }
-            });
-            if (listMap[2]) {
-              list.push({ code: 2, name: 'MBOM' });
-              arr = listMap[2];
-              result[0].productType = 2;
-            }
-            if (listMap[3]) {
-              list.push({ code: 3, name: 'ABOM' });
-              if (!listMap[2]) {
-                arr = listMap[3];
-                result[0].productType = 3;
+              if (arr.length > 0) {
+                arr.map((el) => (el.bomCategoryId = el.id));
+
+                item.bomCategoryId = arr[0].id;
+                await this.changeBomId(arr[0], 0);
+
+                this.$set(item, 'produceRoutingId', arr[0].produceRoutingId);
+                this.$set(
+                  item,
+                  'produceVersionName',
+                  arr[0].produceVersionName
+                );
+                this.$set(
+                  item,
+                  'produceRoutingName',
+                  arr[0].produceRoutingName
+                );
+                console.log(arr[0],'arr[0]')
+                this.$set(item, 'routingList', arr[0].routingList);
+                this.$set(item, 'bomCategoryName', arr[0].name);
+                this.$set(item, 'bomCategoryVersions', arr[0].versions);
               }
               }
+              item.producedList = list;
+              item.bomVersionList = arr;
+
+              return item;
             }
             }
-            if (arr.length > 0) {
-              arr.map((el) => (el.bomCategoryId = el.id));
-              result[0].bomCategoryId = arr[0].id;
-              this.changeBomId(arr[0], 0);
-            }
-            result[0].producedList = list;
-            result[0].bomVersionList = arr;
-            // bomVersionList
-            this.form.productInfoList =
-              this.form.productInfoList.concat(result);
-            this.$refs.tableRef.setData(this.form.productInfoList);
-            this.changeLineNumber();
-            //重置
-            this.$set(this.form, 'produceType', '');
-            this.$set(this.form, 'bomCategoryId', '');
-            this.$set(this.form, 'produceRoutingId', '');
-          }
+          });
         } catch (err) {}
         } catch (err) {}
-
-        // this.bomListVersion();
+        this.form.productInfoList.push(...result);
+        this.changeLineNumber();
+
+        this.$refs.tableRef.setData(this.form.productInfoList);
+        //重置
+        this.$set(this.form, 'produceType', '');
+        this.$set(this.form, 'bomCategoryId', '');
+        this.$set(this.form, 'produceRoutingId', '');
       },
       },
 
 
       changeLineNumber() {
       changeLineNumber() {
-        this.form.productInfoList.map((item, index) => {
-          item.lineNumber = 10 * (index + 1);
+        this.form.productInfoList.forEach((item, index) => {
+          let data = this.form.productInfoList[index - 1];
+
+          this.$set(
+            this.form.productInfoList[index],
+            'lineNumber',
+            data ? data.lineNumber + 10 : 10
+          );
         });
         });
       },
       },
       handleDeleteItem(index) {
       handleDeleteItem(index) {
@@ -1163,7 +1203,7 @@
         // console.log(this.$refs);
         // console.log(this.$refs);
         // this.$refs.tableRef.setData([]);
         // this.$refs.tableRef.setData([]);
       },
       },
-      changeBomIdFn(bomCategoryId) {
+      changeBomIdFn(bomCategoryId, row) {
         return new Promise((resolve, reject) => {
         return new Promise((resolve, reject) => {
           bomRoutingList(bomCategoryId).then((res) => {
           bomRoutingList(bomCategoryId).then((res) => {
             let arr = res || [];
             let arr = res || [];
@@ -1176,24 +1216,30 @@
       },
       },
 
 
       // 选择BOM
       // 选择BOM
-      changeBomId(row, index) {
+      async changeBomId(row, index, bomData) {
+        if (bomData) {
+          item.bomCategoryName = bomData.name;
+          item.bomCategoryVersions = bomData.versions;
+        }
         // row.routingList = []
         // row.routingList = []
-        bomRoutingList(row.bomCategoryId).then((res) => {
+        return await bomRoutingList(row.bomCategoryId).then((res) => {
           let arr = res || [];
           let arr = res || [];
           if (arr.length > 0) {
           if (arr.length > 0) {
-            this.$nextTick(() => {
-              row.produceRoutingName = arr[0].name;
-              row.produceVersionName = arr[0].version;
-              row.routingList = arr;
-              this.$set(
-                this.form.productInfoList[index],
-                'produceRoutingId',
-                arr[0].id
-              );
-              // this.selectionRowShow = false;
-              row.selectionRowShow = false;
-              this.$set(this.form.productInfoList[index], 'routingList', arr);
-            });
+            // this.$nextTick(() => {
+            row.produceRoutingName = arr[0].name;
+            row.produceVersionName = arr[0].version;
+            row.produceRoutingId = arr[0].id;
+            row.routingList = arr;
+            this.$set(row, 'produceRoutingId', arr[0].id);
+            this.$set(
+              this.form.productInfoList[index],
+              'produceRoutingId',
+              arr[0].id
+            );
+
+            row.selectionRowShow = false;
+            this.$set(this.form.productInfoList[index], 'routingList', arr);
+            // });
           }
           }
           this.$forceUpdate();
           this.$forceUpdate();
         });
         });
@@ -1234,7 +1280,7 @@
               row.bomVersionList = arr;
               row.bomVersionList = arr;
               this.form.productInfoList[index].bomVersionList = arr;
               this.form.productInfoList[index].bomVersionList = arr;
               row.bomCategoryId = arr[0].id;
               row.bomCategoryId = arr[0].id;
-              this.changeBomId(row, index);
+              this.changeBomId(row, index,arr[0]);
               let arrAll = JSON.parse(JSON.stringify(this.form));
               let arrAll = JSON.parse(JSON.stringify(this.form));
               this.$set(this, 'form', arrAll);
               this.$set(this, 'form', arrAll);
             }
             }
@@ -1296,6 +1342,8 @@
           let flag = this.parameterVerification();
           let flag = this.parameterVerification();
           // 必填参数校验
           // 必填参数校验
           if (!flag) return;
           if (!flag) return;
+
+          // this.
           if (!this.form.id) {
           if (!this.form.id) {
             if (this.form.productInfoList.length) {
             if (this.form.productInfoList.length) {
               this.form.productInfoList.map((item, index) => {
               this.form.productInfoList.map((item, index) => {
@@ -1314,11 +1362,11 @@
                   item.newSumOrderWeight = item.requiredFormingNum;
                   item.newSumOrderWeight = item.requiredFormingNum;
                 }
                 }
                 delete item.selectionRowShow;
                 delete item.selectionRowShow;
-                if (item.bomVersionList && item.bomVersionList.length) {
-                  item.bomCategoryName = item.bomVersionList[0].name;
-                  item.bomCategoryVersions = item.bomVersionList[0].versions;
-                  item.produceRoutingName = item.routingList[0].name;
-                }
+                // if (item.bomVersionList && item.bomVersionList.length) {
+                //   item.bomCategoryName = item.bomVersionList[0].name;
+                //   item.bomCategoryVersions = item.bomVersionList[0].versions;
+                //   item.produceRoutingName = item.routingList[0].name;
+                // }
               });
               });
             }
             }
 
 
@@ -1340,6 +1388,8 @@
               });
               });
           } else {
           } else {
             this.loading = true;
             this.loading = true;
+            console.log(this.form.productInfoList, 'this.form.productInfoList');
+            // return
             temporaryPlanSave(this.form)
             temporaryPlanSave(this.form)
               .then((res) => {
               .then((res) => {
                 this.$message.success('修改成功!');
                 this.$message.success('修改成功!');

+ 8 - 8
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -417,7 +417,7 @@
   import currentDetailDialog from './currentDetailDialog.vue';
   import currentDetailDialog from './currentDetailDialog.vue';
   import producePlan from '@/views/materialPlan/components/producePlan.vue';
   import producePlan from '@/views/materialPlan/components/producePlan.vue';
   import purchaseDialog from './purchaseDialog.vue';
   import purchaseDialog from './purchaseDialog.vue';
-  import { batchSave } from '@/api/productionPlan/index.js';
+  import { issueProductionPlan } from '@/api/productionPlan/index.js';
   export default {
   export default {
     components: {
     components: {
       stockDetailDialog,
       stockDetailDialog,
@@ -456,8 +456,8 @@
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
           {
           {
-            prop: 'salesCode',
-            label: '销售订单号',
+            prop: 'bomCode',
+            label: 'BOM编码',
             align: 'center',
             align: 'center',
             minWidth: 100,
             minWidth: 100,
             showOverflowTooltip: true
             showOverflowTooltip: true
@@ -1107,9 +1107,9 @@
           if (el.finalState == 1) {
           if (el.finalState == 1) {
             return this.$message.warning('必须选择最终状态为缺料的数据');
             return this.$message.warning('必须选择最终状态为缺料的数据');
           }
           }
-          if (el.hasIssued) {
-            return this.$message.warning('必须选择下发状态为未下发的数据');
-          }
+          // if (el.hasIssued) {
+          //   return this.$message.warning('必须选择下发状态为未下发的数据');
+          // }
         }
         }
         let obj = this.bomListType.find(
         let obj = this.bomListType.find(
           (el) => el.bomType === this.formInline.bomType
           (el) => el.bomType === this.formInline.bomType
@@ -1140,7 +1140,7 @@
               produceType: obj.bomType,
               produceType: obj.bomType,
               id: this.planInfo.id
               id: this.planInfo.id
             };
             };
-            batchSave(param).then((res) => {
+            issueProductionPlan(param).then((res) => {
               this.$message.success('操作成功');
               this.$message.success('操作成功');
               this.bomVChange(this.formInline.bomId);
               this.bomVChange(this.formInline.bomId);
             });
             });
@@ -1156,7 +1156,7 @@
         // return;
         // return;
         let list = arr.map((item) => {
         let list = arr.map((item) => {
           return {
           return {
-            id: item.id,
+            id: item.resourceBomId,
             categoryId: item.categoryId,
             categoryId: item.categoryId,
             productCode: item.code,
             productCode: item.code,
             productName: item.name,
             productName: item.name,

+ 1 - 1
src/views/productionPlan/factoryPlan.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <homeIndex :timeDimensionPlanType="3" :cacheKeyUrl="cacheKeyUrl"></homeIndex>
+    <homeIndex :timeDimensionPlanType="3" :cacheKeyUrl="cacheKeyUrl" :isLineNumbre="true"></homeIndex>
   </div>
   </div>
 </template>
 </template>
 
 

+ 49 - 13
src/views/productionPlan/index.vue

@@ -266,7 +266,20 @@
           >
           >
             删除
             删除
           </el-link>
           </el-link>
-
+          <el-link
+            v-if="
+              !row.joinPlanCode &&
+              !row.childList.length &&
+              activeName == 'first' &&
+              isLineNumbre &&
+              row.status != 4
+            "
+            type="danger"
+            :underline="false"
+            @click="handleDel(row)"
+          >
+            删除
+          </el-link>
           <el-link
           <el-link
             v-if="
             v-if="
               clientEnvironmentId != 4 &&
               clientEnvironmentId != 4 &&
@@ -317,7 +330,8 @@
     getList,
     getList,
     del,
     del,
     updatePriority,
     updatePriority,
-    getPlanStatistics
+    getPlanStatistics,
+    factoryDelete
   } from '@/api/productionPlan/index.js';
   } from '@/api/productionPlan/index.js';
   import productionPlanSearch from './components/productionPlan-search.vue';
   import productionPlanSearch from './components/productionPlan-search.vue';
   import unpackDialog from './components/unpackDialog.vue';
   import unpackDialog from './components/unpackDialog.vue';
@@ -350,6 +364,9 @@
     },
     },
     props: {
     props: {
       timeDimensionPlanType: { type: Number, default: 1 },
       timeDimensionPlanType: { type: Number, default: 1 },
+      isLineNumbre: {
+        default: false
+      },
       cacheKeyUrl: { type: String, default: '513b2388-aps-productionPlan' }
       cacheKeyUrl: { type: String, default: '513b2388-aps-productionPlan' }
     },
     },
     data() {
     data() {
@@ -396,7 +413,7 @@
         newColumns: [],
         newColumns: [],
 
 
         selection: [],
         selection: [],
-
+        clientEnvironmentId: '',
         // factoryShow: false,
         // factoryShow: false,
         factoryType: 3,
         factoryType: 3,
         factoryObj: {},
         factoryObj: {},
@@ -406,9 +423,9 @@
       };
       };
     },
     },
     computed: {
     computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      },
+      // clientEnvironmentId() {
+      //   return this.$store.state.user.info.clientEnvironmentId;
+      // },
       // 表格列配置
       // 表格列配置
       columns() {
       columns() {
         const num = this.columnsVersion;
         const num = this.columnsVersion;
@@ -472,7 +489,16 @@
             minWidth: 140,
             minWidth: 140,
             sortable: true
             sortable: true
           },
           },
-
+          this.isLineNumbre
+            ? {
+                prop: 'lineNumber',
+                label: '行号',
+                align: 'center',
+                showOverflowTooltip: true
+              }
+            : {
+                width: 1
+              },
           {
           {
             slot: 'code',
             slot: 'code',
             prop: 'code',
             prop: 'code',
@@ -831,8 +857,10 @@
       this.getFieldModel();
       this.getFieldModel();
     },
     },
     mounted() {
     mounted() {
-      this.getPlanStatistics();
+      this.clientEnvironmentId =
+        this.$store.state.user.info.clientEnvironmentId;
 
 
+      this.getPlanStatistics();
     },
     },
     methods: {
     methods: {
       handleSele(e) {
       handleSele(e) {
@@ -1027,7 +1055,7 @@
             privateColumn.push({
             privateColumn.push({
               columnKey: 'action',
               columnKey: 'action',
               label: '操作',
               label: '操作',
-              width: 148,
+              width: 200,
               align: 'center',
               align: 'center',
               resizable: false,
               resizable: false,
               fixed: 'right',
               fixed: 'right',
@@ -1084,10 +1112,18 @@
       handleDel(row) {
       handleDel(row) {
         this.$confirm('确定删除当前数据?', '提示')
         this.$confirm('确定删除当前数据?', '提示')
           .then(() => {
           .then(() => {
-            del(row.id).then((res) => {
-              this.reload();
-              this.$message.success('删除成功');
-            });
+            if (this.isLineNumbre) {
+
+              factoryDelete(row.id).then((res) => {
+                this.reload();
+                this.$message.success('删除成功');
+              });
+            } else {
+              del(row.id).then((res) => {
+                this.reload();
+                this.$message.success('删除成功');
+              });
+            }
           })
           })
           .catch(() => {});
           .catch(() => {});
       },
       },

+ 7 - 0
src/views/workOrder/index.vue

@@ -319,6 +319,13 @@
             sortable: true,
             sortable: true,
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
+          {
+            prop: 'lineNumber',
+            label: '行号',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
           {
           {
             prop: 'taskName',
             prop: 'taskName',
             action: 'taskName',
             action: 'taskName',