From a2bce22a3a4df5f4662c373e57c07fa4268aeee1 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 13 六月 2025 09:02:52 +0800
Subject: [PATCH] 1.修改工单打印模板

---
 src/views/workOrder/workOrderList.vue |  144 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 91 insertions(+), 53 deletions(-)

diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index 1427b1b..ec1c5a3 100644
--- a/src/views/workOrder/workOrderList.vue
+++ b/src/views/workOrder/workOrderList.vue
@@ -286,6 +286,13 @@
             width="100"
           />
           <el-table-column
+            prop="printcount"
+            label="鎵撳嵃娆℃暟"
+            sortable="custom"
+            show-tooltip-when-overflow
+            width="110"
+          />
+          <el-table-column
             prop="priuserdefnvc1"
             label="瀹㈡埛鍚嶇О"
             width="110"
@@ -463,7 +470,7 @@
                     :style="{color:$store.state.settings.theme}"
                     class="el-icon-printer"
                     style="cursor: pointer;margin-right: 15px"
-                    @click="handlePrint(row.wo_code,row.saleOrderCod,row)"
+                    @click="handlePrint(row.wo_code,row.saleOrderCode,row)"
                   />
                 </el-tooltip>
 
@@ -1418,14 +1425,14 @@
       <div id="printMe" style="padding: 30px">
         <!--        <div v-for="(item,index) in tableDataPrint" :key="index">-->
         <div>
-          <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div>
+          <div style="font-size: 32px; text-align: center;font-weight:bolder;">娴佺▼鍗�</div>
 
           <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;">
-            <div style="width: 78%">
+            <div style="width: 200%">
               <el-form
                 ref="formApprove"
                 :model="formApprove"
-                label-width="80px"
+                label-width="100px"
                 inline
                 style="display: flex;justify-content: space-between"
               >
@@ -1484,20 +1491,20 @@
                 </div>
               </el-form>
             </div>
-            <div
-              id="qrCode0"
-              style="width: 22%;height:90px;
-                        margin-top: 20px;
-                        overflow-y: scroll;display: flex;
-                        justify-content: center;
-                        position: relative;"
-            >
-              <div id="qrCode00" ref="qrCodeDiv00" />
-            </div>
-            <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />
-            <div
-              style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"
-            />
+            <!--            <div-->
+            <!--              id="qrCode0"-->
+            <!--              style="width: 22%;height:90px;-->
+            <!--                        margin-top: 20px;-->
+            <!--                        overflow-y: scroll;display: flex;-->
+            <!--                        justify-content: center;-->
+            <!--                        position: relative;"-->
+            <!--            >-->
+            <!--              <div id="qrCode00" ref="qrCodeDiv00" />-->
+            <!--            </div>-->
+            <!--            <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />-->
+            <!--            <div-->
+            <!--              style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"-->
+            <!--            />-->
           </div>
 
           <el-table
@@ -1505,26 +1512,25 @@
             :data="tableDataPrint[0]"
             border
             class="tableDataPrint"
-            :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}"
-            :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}"
+            :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'2px 0'}"
+            :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'5px 0'}"
             style="width: 100%;margin-top: 20px;text-align: center;border-color: #000"
           >
             <el-table-column
               id="column0"
               prop="seq"
-              label="宸ュ簭鍙�"
+              label="搴忓彿"
               width="70"
               align="center"
             />
             <el-table-column
               id="column1"
               prop="stepqrcode"
-              label="宸ュ簭浜岀淮鐮�"
+              label="浜岀淮鐮�"
               width="100"
               align="center"
             >
               <template slot-scope="{row}">
-
                 <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" />
               </template>
             </el-table-column>
@@ -1570,11 +1576,11 @@
           <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div>
 
           <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;">
-            <div style="width: 78%">
+            <div style="width: 200%">
               <el-form
                 ref="formApprove"
                 :model="formApprove"
-                label-width="80px"
+                label-width="100px"
                 inline
                 style="display: flex;justify-content: space-between"
               >
@@ -1613,20 +1619,20 @@
                 </div>
               </el-form>
             </div>
-            <div
-              id="qrCode1"
-              style="width: 22%;height:90px;
-                        margin-top: 20px;
-                        overflow-y: scroll;display: flex;
-                        justify-content: center;
-                        position: relative;"
-            >
-              <div id="qrCode01" ref="qrCodeDiv01" />
-            </div>
-            <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />
-            <div
-              style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"
-            />
+            <!--            <div-->
+            <!--              id="qrCode1"-->
+            <!--              style="width: 22%;height:90px;-->
+            <!--                        margin-top: 20px;-->
+            <!--                        overflow-y: scroll;display: flex;-->
+            <!--                        justify-content: center;-->
+            <!--                        position: relative;"-->
+            <!--            >-->
+            <!--              <div id="qrCode01" ref="qrCodeDiv01" />-->
+            <!--            </div>-->
+            <!--            <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />-->
+            <!--            <div-->
+            <!--              style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"-->
+            <!--            />-->
           </div>
 
           <el-table
@@ -1634,21 +1640,21 @@
             :data="tableDataPrint[1]"
             border
             class="tableDataPrint"
-            :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}"
-            :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}"
+            :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'2px 0'}"
+            :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'5px 0'}"
             style="width: 100%;margin-top: 20px;text-align: center;border-color: #000"
           >
             <el-table-column
               id="column0"
               prop="seq"
-              label="宸ュ簭鍙�"
+              label="搴忓彿"
               width="70"
               align="center"
             />
             <el-table-column
               id="column1"
               prop="stepqrcode"
-              label="宸ュ簭浜岀淮鐮�"
+              label="浜岀淮鐮�"
               width="100"
               align="center"
             >
@@ -1701,7 +1707,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="printObjGetApi">鎵� 鍗�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -2618,7 +2624,7 @@
   AddMesOrderCodeSearch,
   AddUpdateMesOrder, AddUpdateMesOrderList, DeleteMesOrder,
   MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, MesOrderProcessSopSearch,
-  MesOrderSearch, MesOrderSopSearch, UpdateMesOrderStepListSearch,
+  MesOrderSearch, MesOrderSopSearch, UpdateMesOrderPrintCount, UpdateMesOrderStepListSearch,
   UpdateMesOrderStepSearch
 } from '@/api/WorkOrder'
 import { PartSelect } from '@/api/ProductModel'
@@ -3525,6 +3531,9 @@
 
       this.dialogForm.mesqtyinit = row.plan_qty
 
+      this.dialogForm.paystartdate = row.plan_startdate
+      this.dialogForm.payenddate = row.plan_enddate
+
       const data = {
         sourceid: this.dialogForm.sourceorderid,
         sourcewo: this.dialogForm.sourceorder,
@@ -3747,6 +3756,10 @@
             return this.$message.info('姝ゅ伐鍗曠殑鏈�澶т慨鏀规暟鍊间负锛�' + this.dialogForm.mesmaxqty)
           }
 
+          if (this.mesSetting.route && !this.dialogForm.routecode) {
+            return this.$message.error('璇烽�夋嫨宸ヨ壓璺嚎锛�')
+          }
+
           const workListSub = []
           this.stepTableData.forEach((i, j) => {
             workListSub.push(
@@ -3774,6 +3787,8 @@
             wkshopcode: this.dialogForm.wkshopcode,
             woqty: this.dialogForm.mesqty, // 宸ュ崟鏁伴噺
             deliverydate: this.dialogForm.deliverydate, // 浜や粯鏃堕棿
+            paystartdate: this.dialogForm.paystartdate,
+            payenddate: this.dialogForm.payenddate,
             data_sources: this.dialogForm.data_sources, // 鏁版嵁鏉ユ簮
             isstep: workListSub.length > 0 ? 'Y' : 'N', //
             difference: this.dialogForm.mesqty - this.dialogForm.mesqtyinit, // 鏁版嵁宸��
@@ -3881,9 +3896,9 @@
               item.forEach(i => {
                 this.bindQRCode(i.seq, i.stepqrcode, 'small')
               })
-              this.bindQRCode(index, this.formApprove.mesordercode, 'big')
-              const div = document.getElementById('qrCode' + index)
-              div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
+              // this.bindQRCode(index, this.formApprove.mesordercode, 'big')
+              // const div = document.getElementById('qrCode' + index)
+              // div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
             })
 
             // const div = document.getElementById('qrCode')
@@ -3934,8 +3949,8 @@
       if (size === 'big') {
         new QRCode(this.$refs['qrCodeDiv0' + seq], {
           text: text,
-          width: size === 'big' ? 90 : 60,
-          height: size === 'big' ? 90 : 60,
+          width: size === 'big' ? 90 : 45,
+          height: size === 'big' ? 90 : 45,
           // colorDark: '#333333', // 浜岀淮鐮侀鑹�
           colorDark: '#000', // 浜岀淮鐮侀鑹�
           colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
@@ -3944,8 +3959,8 @@
       } else {
         new QRCode(this.$refs['qrCodeDiv' + seq], {
           text: text,
-          width: size === 'big' ? 90 : 60,
-          height: size === 'big' ? 90 : 60,
+          width: size === 'big' ? 90 : 45,
+          height: size === 'big' ? 90 : 45,
           // colorDark: '#333333', // 浜岀淮鐮侀鑹�
           colorDark: '#000', // 浜岀淮鐮侀鑹�
           colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
@@ -4370,6 +4385,12 @@
         this.$refs.tableDataRef.doLayout()
       })
       return sums
+    },
+    async printObjGetApi() {
+      const res = await UpdateMesOrderPrintCount({ wo_code: this.formApprove.mesordercode })
+      if (res.code === '200') {
+        await this.getMesOrderSearch()
+      }
     }
   }
 }
@@ -4531,7 +4552,18 @@
 }
 
 .formContent {
-  width: 240px;
+  //width: 330px;
+  width: calc(50% - 10px);
+  display:flex;
+
+  ::v-deep .el-form-item__label {
+    float: left;
+  }
+
+  ::v-deep .el-form-item__content {
+    //float: left;
+    width: 240px;
+  }
 }
 
 </style>
@@ -4547,6 +4579,12 @@
 <style>
 .formContent .el-form-item__label {
   color: #000 !important;
+  font-size: 20px;
+}
+
+.formContent .el-form-item__content {
+  color: #000 !important;
+  font-size: 20px;
 }
 </style>
 <!--鍏叡椤甸潰鏍峰紡-->

--
Gitblit v1.9.3