695593266@qq.com пре 7 месеци
родитељ
комит
9b818d8509

+ 6 - 68
src/views/entrust/components/create.vue

@@ -595,7 +595,7 @@
             this.form.factoriesId = data[0].factoryId;
             this.form.factoriesName = data[0].factoryName;
           }
-        } else if (type == 'edit' || type == 'detail' || type == 'wordEdit') {
+        } else if (type == 'edit' || type == 'detail') {
           this.getDetail(row.id);
         }
 
@@ -704,22 +704,16 @@
           return;
         }
 
-        // 只使用 id 作为唯一 key(你要求按 id 对比)
         const getKey = (item) => item.id;
-
-        // 新旧数据的 key 集合
         const newKeys = new Set(list.map(getKey));
         const oldKeys = new Set(this.orderList.map(getKey));
 
-        // 1️⃣ 保留原数据中在新数据里依然存在的项(不做任何修改)
         const keptOldList = this.orderList.filter((oldItem) =>
           newKeys.has(getKey(oldItem))
         );
 
-        // 2️⃣ 找出需要新增的项(id 不在旧数据中)
         const addedItems = list.filter((item) => !oldKeys.has(getKey(item)));
 
-        // 3️⃣ 处理新增项
         const newList = addedItems.map((item) => {
           const copy = this.deepCopy(item);
 
@@ -754,59 +748,7 @@
           return copy;
         });
 
-        // 4️⃣ 合并:保留原来的 + 新增
         this.orderList = [...keptOldList, ...newList];
-        // if (!list || list.length === 0) {
-        //   this.orderList = [];
-        //   return;
-        // }
-
-        // const getKey = (item) => item.id ?? item.apsWorkOrderCode ?? '';
-        // const existingKeys = new Set(this.orderList.map(getKey));
-
-        // const commonList = list.filter((item) =>
-        //   existingKeys.has(getKey(item))
-        // );
-
-        // const newList = list.filter((item) => !existingKeys.has(getKey(item)));
-
-        // const mergedList = [];
-
-        // commonList.forEach((it) => {
-        //   mergedList.push(this.deepCopy(it));
-        // });
-
-        // newList.forEach((item) => {
-        //   Object.assign(item, {
-        //     describes: '',
-        //     totalCount: item.formingNum,
-        //     taskList: [],
-        //     taskId: '',
-        //     taskName: '',
-        //     beEntrustedFactoriesId: '',
-        //     beEntrustedFactoriesName: '',
-        //     status: '',
-        //     beEntrustedDeptName: '',
-        //     beEntrustedDeptId: '',
-        //     measuringUnit: item.unit,
-        //     categoryName: item.productName,
-        //     categoryCode: item.productCode,
-        //     workOrderId: item.id,
-        //     workOrderCode: item.code,
-        //     brandNum: item.brandNo,
-        //     modelType: item.model,
-        //     name: this.form.name,
-        //     type: this.form.type,
-        //     planDeliveryTime: item.startTime,
-        //     applyDeptId: this.form.pleaseEntrustDeptId,
-        //     applyDeptName: this.form.pleaseEntrustDeptName,
-        //     applyFactoriesId: this.form.factoriesId,
-        //     applyFactoriesName: this.form.factoriesName
-        //   });
-        //   mergedList.push(this.deepCopy(item));
-        // });
-
-        // this.orderList = mergedList;
 
         this.getOrderTaskList();
       },
@@ -881,23 +823,19 @@
             item.status = type == 1 ? 0 : 1;
             item.approvalStatus = type == 1 ? 0 : 1;
           });
-
           let URL;
 
           const clearOrderIds = () => {
             this.orderList.forEach((it) => (it.id = ''));
           };
 
-          if (type === 1 && this.form.id) {
-            // 编辑
-            URL = update;
-          } else if (type === 1) {
-            // 新增
-            URL = save;
-            clearOrderIds();
+          if (type === 1) {
+            URL = this.type === 'edit' ? update : save;
           } else {
-            // 其他类型提交
             URL = addSubmit;
+          }
+
+          if (this.type === 'add' && (type !== 1 || type === 1)) {
             clearOrderIds();
           }
 

+ 14 - 0
src/views/produce/components/new_produceOrder.vue

@@ -67,6 +67,12 @@
         </div>
       </template>
 
+      <template v-slot:workOrderType="{ row }">
+        <span v-if="row.workOrderType == 1">普通订单</span>
+        <span v-if="row.workOrderType == 2">临时订单</span>
+        <span v-if="row.workOrderType == 3">受托订单</span>
+      </template>
+
       <template v-slot:status="{ row }">
         <span> {{ sumStatus(row) }}</span>
       </template>
@@ -191,6 +197,14 @@
             minWidth: 110,
             showOverflowTooltip: true
           },
+          {
+            prop: 'workOrderType',
+            label: '订单类型',
+            slot: 'workOrderType',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
           {
             prop: 'singleReport',
             slot: 'singleReport',

+ 3 - 6
src/views/produce/components/outsourcing/index.vue

@@ -557,11 +557,11 @@
       this.getContactList();
       this.getFactoryList();
       if (this.chooseType == '1') {
-        this.attributeData.name = this.taskObj.taskName + '委外';
-        // this.$set(this.outsourceFormVal, 'name', this.taskName + '委托');
+        this.attributeData.name = this.taskObj.name
+          ? this.taskObj.name + '委外'
+          : this.taskObj.taskTypeName + '委外';
       } else if (this.chooseType == '2') {
         this.attributeData.name = this.taskObj.taskName + '请托';
-        // this.$set(this.outsourceFormVal, 'name', this.taskName + '请托');
       }
 
       if (this.chooseType == '2') {
@@ -839,7 +839,6 @@
           let URL;
 
           const clearOrderIds = () => {
-            // this.orderList.forEach((it) => (it.id = ''));
             this.form.id = '';
           };
 
@@ -862,8 +861,6 @@
           this.form.status = type == 1 ? 0 : 1;
           this.form.approvalStatus = type == 1 ? 0 : 1;
 
-          console.log(this.form, 'this.form');
-
           const list = [];
           list.push(this.form);
 

+ 14 - 0
src/views/produceOrder/index.vue

@@ -123,6 +123,12 @@
           <span v-if="row.sourceType == 3">受托转订单</span>
         </template>
 
+        <template v-slot:workOrderType="{ row }">
+          <span v-if="row.workOrderType == 1">普通订单</span>
+          <span v-if="row.workOrderType == 2">临时订单</span>
+          <span v-if="row.workOrderType == 3">受托订单</span>
+        </template>
+
         <template v-slot:outsourceStatus="{ row }">
           <div v-if="row.outsourceStatus">
             <span v-if="row.outsourceStatus == 1">未委外</span>
@@ -532,6 +538,14 @@
             minWidth: 110,
             showOverflowTooltip: true
           },
+          {
+            prop: 'workOrderType',
+            label: '订单类型',
+            slot: 'workOrderType',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
           {
             prop: 'productionPlanCode',
             label: '计划编号',

+ 14 - 0
src/views/produceWord/index.vue

@@ -27,6 +27,12 @@ r++<template>
           <span v-if="row.sourceType == 3">受托转订单</span>
         </template>
 
+        <template v-slot:workOrderType="{ row }">
+          <span v-if="row.workOrderType == 1">普通订单</span>
+          <span v-if="row.workOrderType == 2">临时订单</span>
+          <span v-if="row.workOrderType == 3">受托订单</span>
+        </template>
+
         <template v-slot:priority="{ row }">
           <div style="display: flex">
             <el-input
@@ -203,6 +209,14 @@ r++<template>
             minWidth: 110,
             showOverflowTooltip: true
           },
+          {
+            prop: 'workOrderType',
+            label: '订单类型',
+            slot: 'workOrderType',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
           {
             prop: 'model',
             label: '型号',