From c4d59de5b8132c70ae4dc64e4309fc6d761b111d Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 16 十二月 2025 09:24:56 +0800
Subject: [PATCH] 1.工艺模式   生产工单带工序改为默认历史最新2.生产执行新增 订单号字段

---
 src/views/workOrder/workOrderList.vue |   62 ++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index 5ef65e8..e71c162 100644
--- a/src/views/workOrder/workOrderList.vue
+++ b/src/views/workOrder/workOrderList.vue
@@ -476,7 +476,7 @@
                     v-if="mesSetting.workOrder"
                     class="el-icon-files"
                     style="cursor: pointer;color:#42b983;margin-right: 15px"
-                    @click.stop="pre(row,1)"
+                    @click="pre(row,1)"
                   />
                 </el-tooltip>
 
@@ -484,7 +484,7 @@
                   <i
                     class="el-icon-edit-outline"
                     :style="{color:$store.state.settings.theme}"
-                    @click.stop="edit('edit',row)"
+                    @click="edit('edit',row)"
                   />
                 </el-tooltip>
 
@@ -502,7 +502,7 @@
                     :style="{color:$store.state.settings.theme}"
                     class="el-icon-printer"
                     style="cursor: pointer;margin-right: 15px"
-                    @click.stop="handlePrint(row.wo_code,row.saleOrderCod,row)"
+                    @click="handlePrint(row.wo_code,row.saleOrderCod,row)"
                   />
                 </el-tooltip>
 
@@ -511,7 +511,7 @@
                     class="el-icon-view"
                     style="cursor: pointer;"
                     :style="{color:$store.state.settings.theme}"
-                    @click.stop="edit('view',row)"
+                    @click="edit('view',row)"
                   />
                 </el-tooltip>
 
@@ -533,6 +533,7 @@
 
       <div class="elTableDiv">
         <el-table
+          ref="tableDataRef2"
           :data="tableDataDetail"
           border
           height="210px"
@@ -856,7 +857,13 @@
             />
           </el-select>
         </el-form-item>
-
+        <el-form-item label="閿�鍞鍗�" prop="">
+          <el-input
+            v-model="dialogForm.saleordercode"
+            style="width: 200px"
+            :disabled="!(dialogForm.mesorderstus==='NEW'&&dialogForm.data_sources==='MES')"
+          />
+        </el-form-item>
         <el-form-item label="棰勮浜や粯鏃ユ湡" prop="deliverydate">
           <el-date-picker
             v-model="dialogForm.deliverydate"
@@ -1803,7 +1810,7 @@
           <el-button v-waves @click="dialogVisibleBackPreview">杩� 鍥�</el-button>
           <!--            <el-button v-waves v-if="operation==='add'" type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>-->
           <!--            <el-button v-waves type="primary" @click="dialogVisibleConfirm">纭� 瀹�/鎵� 鍗�</el-button>-->
-          <el-button v-waves v-print="printObj" type="primary">鎵� 鍗�</el-button>
+          <el-button v-waves v-print="printObj" type="primary" @click="sendMesOrderDistribution">鎵� 鍗�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -2572,7 +2579,13 @@
               />
             </el-select>
           </el-form-item>
-
+          <el-form-item label="閿�鍞鍗�" prop="">
+            <el-input
+              v-model="i.saleordercode"
+              style="width: 200px"
+              :disabled="!(i.mesorderstus==='NEW'&&i.data_sources==='MES')"
+            />
+          </el-form-item>
           <el-form-item label="棰勮浜や粯鏃ユ湡" prop="deliverydate">
             <el-date-picker
               v-model="i.deliverydate"
@@ -2783,7 +2796,7 @@
         // createdate: '', // 鍒涘缓鏃堕棿
         datatype: 'ED', // 鏃ユ湡绫诲瀷(璁″垝寮�宸�(PS)銆佽鍒掑畬宸�(PE)銆侀璁′氦浠�(ED)銆佸垱寤烘棩鏈�(CT))
         timeValue: [], // 鏌ヨ鏃ユ湡
-        prop: 'lm_date', // 鎺掑簭瀛楁
+        prop: 'partspec', // 鎺掑簭瀛楁  lm_date
         order: 'desc', // 鎺掑簭瀛楁
         page: 1, // 绗嚑椤�
         rows: 20 // 姣忛〉澶氬皯鏉�
@@ -2808,6 +2821,8 @@
         ordertype: 'PO', // 宸ュ崟绫诲瀷
         sourceorderid: '', // 婧愬崟id
         sourceorder: '', // 婧愬崟鍗曞彿
+
+        saleordercode: '', // 閿�鍞鍗曞彿
 
         partcode: '', // 浜у搧缂栫爜
         partname: '', // 浜у搧鍚嶇О
@@ -2906,7 +2921,7 @@
           console.log('鎵ц浜嗘墦鍗�')
         }
       },
-
+      sendMesOrderWoCode: '',
       formApprove: {
         m_po: '', // 婧愬崟鍗曞彿
         mesordercode: '',
@@ -3031,7 +3046,7 @@
 
       routecodeArr: [], //
 
-      sourceType: false, // 宸ュ簭鐨勬暟鎹潵婧�
+      sourceType: true, // 宸ュ簭鐨勬暟鎹潵婧�
 
       mesSetting: JSON.parse(localStorage.getItem('mesSetting')),
 
@@ -3091,6 +3106,16 @@
     // })
   },
   methods: {
+    // 鎵撳嵃鐨勬椂鍊欐墽琛屾淳鍙戜簨浠�
+    sendMesOrderDistribution() {
+      MesOrderDistribution([this.sendMesOrderWoCode]).then(res => {
+        if (res.code === '200') {
+          this.$notify.success('娲惧彂鎴愬姛!')
+          this.getMesOrderSearch()
+        }
+      })
+    },
+
     mesqtyInputChange(val) {
       if (this.stepTableData && this.stepTableData.length > 0) {
         this.stepTableData.forEach(i => {
@@ -3150,6 +3175,7 @@
           ordertype: i.wotype, // 宸ュ崟绫诲瀷
           sourceorderid: i.sourceid, // 婧愬崟id
           sourceorder: i.m_po, // 婧愬崟鍗曞彿
+          saleordercode: i.saleOrderCode,
           partcode: i.partcode, // 浜у搧缂栫爜
           partname: i.partname, // 浜у搧鍚嶇О
           partspec: i.partspec, // 浜у搧瑙勬牸
@@ -3264,6 +3290,7 @@
           sourceid: i.sourceorderid, // 婧愬崟id
           sourcewo: i.sourceorder, // 婧愬崟鍗曞彿
           partcode: i.partcode, // 浜у搧缂栧彿
+          saleordercode: i.saleordercode, // 閿�鍞崟鍙�
           wkshopcode: i.wkshopcode,
           woqty: i.mesqty, // 宸ュ崟鏁伴噺
           deliverydate: i.deliverydate, // 浜や粯鏃堕棿
@@ -3615,6 +3642,8 @@
       this.form.ordertype = ''
       // this.form.createdate = ''
 
+      this.form.saleordercode = ''
+
       this.form.timeValue = []
       this.cycleTime = null
       this.$refs.DateTypeRef.clearValue()
@@ -3728,6 +3757,7 @@
       this.dialogForm.ordertype = row.wotype
       this.dialogForm.sourceorderid = row.sourceid
       this.dialogForm.sourceorder = row.m_po
+      this.dialogForm.saleordercode = row.saleOrderCode
       this.dialogForm.partcode = row.partcode
       this.dialogForm.partname = row.partname
       this.dialogForm.partspec = row.partspec
@@ -3812,7 +3842,9 @@
 
           this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
         } else {
-          await this.getBasicProcessData()
+          // await this.getBasicProcessData()
+          console.log('鎵ц')
+          this.sourceTypeChange(this.sourceType)
         }
       }
 
@@ -3942,7 +3974,7 @@
         ordertype: 'PO', // 宸ュ崟绫诲瀷
         sourceorderid: '', // 婧愬崟id
         sourceorder: '', // 婧愬崟鍗曞彿
-
+        saleordercode: '', // 閿�鍞鍗曞彿
         partcode: '', // 浜у搧缂栫爜
         partname: '', // 浜у搧鍚嶇О
         partspec: '', // 浜у搧瑙勬牸
@@ -3959,11 +3991,13 @@
 
       this.dialogForm.routecode = ''
 
-      this.sourceType = false
+      this.sourceType = true
 
       this.stepSelectedValue = []
       this.stepTableData = []
       this.$refs.dialogForm.clearValidate()
+      this.$refs.tableDataRef.doLayout()
+      this.$refs.tableDataRef2.doLayout()
     },
     // 瀵硅瘽妗嗗彇娑�
     dialogVisibleCancel() {
@@ -4021,6 +4055,7 @@
             wotype: this.dialogForm.ordertype, // 宸ュ崟绫诲瀷
             sourceid: this.dialogForm.sourceorderid, // 婧愬崟id
             sourcewo: this.dialogForm.sourceorder, // 婧愬崟鍗曞彿
+            saleordercode: this.dialogForm.saleordercode, // 閿�鍞鍗曞彿
             partcode: this.dialogForm.partcode, // 浜у搧缂栧彿
             wkshopcode: this.dialogForm.wkshopcode,
             woqty: this.dialogForm.mesqty, // 宸ュ崟鏁伴噺
@@ -4115,6 +4150,7 @@
       const data2 = {
         mesordercode: wo_code || this.dialogForm.mesordercode
       }
+      this.sendMesOrderWoCode = wo_code || this.dialogForm.mesordercode
       MesOrderPrintSearch(data2).then(res2 => {
         if (res2.code === '200') {
           this.dialogVisibleApprove = true

--
Gitblit v1.9.3