From 5e6aea30840206d6bc86291b4649651b2ac01897 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 24 八月 2022 15:57:30 +0800
Subject: [PATCH] 1.提交   新增开报工的维修人员   备注等

---
 src/views/zlgl/gxjy.vue  |    2 
 src/views/scgl/sckbg.vue |  156 +++++++++++++++++++++++++--------------
 src/api/scgl.js          |    4 
 src/views/kb/zhkb.vue    |    7 +
 src/utils/global.js      |   21 +++++
 5 files changed, 129 insertions(+), 61 deletions(-)

diff --git a/src/api/scgl.js b/src/api/scgl.js
index c0a822c..69639cf 100644
--- a/src/api/scgl.js
+++ b/src/api/scgl.js
@@ -220,9 +220,9 @@
   })
 }
 // 涓嶈壇澶勭悊,鎻愪氦
-export function EditOrderNgStepSeave(data) {
+export function EditOrderNgStepSeave(data, username) {
   return request({
-    url: 'ProductionManagement/EditOrderNgStepSeave',
+    url: 'ProductionManagement/EditOrderNgStepSeave?username=' + username,
     method: 'post',
     data
   })
diff --git a/src/utils/global.js b/src/utils/global.js
index 9470685..81c59db 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -24,7 +24,7 @@
   return option
 }
 
-// 鏃堕棿澶勭悊鍑芥暟
+// 鏃堕棿澶勭悊鍑芥暟  骞存湀鏃�
 export function handleDatetime(value) {
   const data = new Date(value)
   const month = data.getMonth() < 9 ? '0' + (data.getMonth() + 1) : data.getMonth() + 1
@@ -32,6 +32,25 @@
   return data.getFullYear() + '-' + month + '-' + date
 }
 
+// 浜嬩欢澶勭悊鍑芥暟  鏃跺垎绉�
+// 鑾峰彇褰撳墠鏃堕棿
+export function handleDatetime2(value) {
+  const dt = new Date(value)
+  const wk = dt.getDay()
+  const y = dt.getFullYear()
+  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
+  const d = (dt.getDate() + '').padStart(2, '0')
+
+  const hh = (dt.getHours() + '').padStart(2, '0')
+  const mm = (dt.getMinutes() + '').padStart(2, '0')
+  const ss = (dt.getSeconds() + '').padStart(2, '0')
+  const weeks = ['鏄熸湡鏃�', '鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�']
+  const week = weeks[wk]
+
+  // return `${y}-${m}-${d}  ${hh}:${mm}:${ss}   ${week}`
+  return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
+}
+
 // 鑾峰彇瑙勫垯鐢熸垚鐨勭紪鐮�
 export async function getNewEncodingRules(encode) {
   const res = await NewEncodingRules({ rightcode: encode })
diff --git a/src/views/kb/zhkb.vue b/src/views/kb/zhkb.vue
index a12f33e..e5ef746 100644
--- a/src/views/kb/zhkb.vue
+++ b/src/views/kb/zhkb.vue
@@ -415,7 +415,12 @@
                     prop="saleOrderCode"
                     label="閿�鍞鍗曞彿"
                     width="158"
-                  />
+                  >
+                    <template slot-scope="{row}">
+                      <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
+                      <div v-else>/</div>
+                    </template>
+                  </el-table-column>
                   <el-table-column
                     prop="wo_code"
                     label="鍔犲伐鍗曞彿"
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index b5cc98d..a58b000 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -62,7 +62,7 @@
                 prop="status"
                 label="鐘舵��"
                 sortable="custom"
-                width="110"
+                width="80"
               >
                 <template slot-scope="{row}">
                   <div v-if="row.status==='NEW'">鏂拌鍗�</div>
@@ -74,7 +74,8 @@
               <el-table-column
                 prop="wo_code"
                 label="宸ュ崟鍙�"
-                min-width="160"
+                width="160"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
@@ -85,14 +86,16 @@
               />
               <el-table-column
                 prop="partname"
-                min-width="160"
+                width="160"
+                show-tooltip-when-overflow
                 label="浜у搧鍚嶇О"
                 sortable="custom"
               />
               <el-table-column
                 prop="stepname"
                 label="宸ュ簭"
-                min-width="80"
+                show-tooltip-when-overflow
+                width="120"
                 sortable="custom"
               />
               <!--              <el-table-column-->
@@ -254,7 +257,7 @@
                 prop="status"
                 label="鐘舵��"
                 sortable="custom"
-                width="110"
+                width="80"
               >
                 <template slot-scope="{row}">
                   <div v-if="row.status==='NEW'">鏂拌鍗�</div>
@@ -266,25 +269,27 @@
               <el-table-column
                 prop="wo_code"
                 label="宸ュ崟鍙�"
-                min-width="160"
+                width="160"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="partcode"
                 label="浜у搧缂栫爜"
-                min-width="110"
+                width="110"
                 sortable="custom"
               />
               <el-table-column
                 prop="partname"
                 label="浜у搧鍚嶇О"
-                min-width="160"
+                width="160"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="stepname"
                 label="宸ュ簭"
-                min-width="80"
+                width="120"
                 sortable="custom"
               />
               <!--              <el-table-column-->
@@ -407,35 +412,35 @@
                 label="搴忓彿"
                 fixed
               />
-
               <el-table-column
                 prop="wo_code"
                 label="宸ュ崟鍙�"
-                min-width="160"
+                width="160"
                 sortable="custom"
               />
               <el-table-column
                 prop="partcode"
                 label="浜у搧缂栫爜"
-                min-width="110"
+                width="110"
                 sortable="custom"
               />
               <el-table-column
                 prop="partname"
-                min-width="160"
+                width="160"
                 label="浜у搧鍚嶇О"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="stepname"
                 label="宸ュ簭"
-                min-width="80"
+                width="120"
                 sortable="custom"
               />
               <el-table-column
                 prop="plan_qty"
                 label="浠诲姟鏁伴噺"
-                min-width="110"
+                width="110"
                 sortable="custom"
               />
               <el-table-column
@@ -447,13 +452,13 @@
               <el-table-column
                 prop="ng_qty"
                 label="涓嶈壇鏁伴噺"
-                min-width="150"
+                width="150"
                 sortable="custom"
               />
               <el-table-column
                 prop="bad_qty"
                 label="宸叉姤搴熸暟閲�"
-                min-width="120"
+                width="120"
                 sortable="custom"
               />
               <el-table-column
@@ -614,6 +619,9 @@
               :value="item.code"
             />
           </el-select>
+        </el-form-item>
+        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="澶囨敞锛�">
+          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
         </el-form-item>
         <div v-if="dialogTitle==='鑷埗鎶ュ伐'">
           <i class="el-icon-s-operation" style="color:#42b983;" /> 浜哄憳鍒楄〃
@@ -812,7 +820,9 @@
             />
           </el-select>
         </el-form-item>
-
+        <el-form-item v-if="dialogTitle==='澶栧崗鏀舵枡'" label="澶囨敞锛�">
+          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
+        </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
@@ -837,22 +847,22 @@
       <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
       <div id="printMe2" style="padding: 30px;">
         <div
-          style="display: flex;width: 250px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+          style="display: flex;width: 300px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
         >
-
-          <div style="width: 60px;display: flex;flex-direction: column;border-right: 1px solid #000">
+          <div style="width: 80px;display: flex;flex-direction: column;border-right: 1px solid #000">
             <div
-              style="display: flex;height: 75%;border-bottom:1px solid #000;justify-content: center;align-items: center "
+              style="display: flex;height: 120px;border-bottom:1px solid #000;justify-content: center;align-items: center "
             >
               <div id="qrCode2" ref="qrCodeDiv2" />
             </div>
-            <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center">
-              <div style="margin-left: 5px;width: 40px">鏁伴噺:</div>
-              {{ qrForm.startqty }}
+            <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
+              <div style="margin-left: 5px;width: 30px">鏁伴噺:</div>
+              10000
+              <!--              {{ qrForm.startqty }}-->
             </div>
           </div>
 
-          <div style="width:190px;display: flex;flex-direction: column">
+          <div style="width:220px;display: flex;flex-direction: column">
             <div
               style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
             >
@@ -876,10 +886,13 @@
               <div>{{ qrForm.nextstepname }}</div>
             </div>
 
+            <!--            {{ qrForm.operator }}-->
+            <!--            {{ qrForm.operatorTime }}-->
           </div>
 
         </div>
       </div>
+
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="dialogVisible2 = false">鍙� 娑�</el-button>
@@ -930,6 +943,21 @@
         </el-form-item>
         <el-form-item label="涓嶈壇鏁伴噺锛�">
           <div style="width: 200px">{{ badDialogForm.ng_qty }}</div>
+        </el-form-item>
+
+        <el-form-item label="缁翠慨浜哄憳锛�">
+          <el-select
+            v-model="badDialogForm.operation"
+            style="width: 200px;"
+            placeholder="璇烽�夋嫨"
+          >
+            <el-option
+              v-for="item in badOperationArr"
+              :key="item.usercode"
+              :label="item.username"
+              :value="item.usercode"
+            />
+          </el-select>
         </el-form-item>
 
       </el-form>
@@ -1060,6 +1088,8 @@
 } from '@/api/scgl'
 import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
 import QRCode from 'qrcodejs2'
+import { getCookie } from '@/utils/auth'
+import { handleDatetime2 } from '@/utils/global'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
@@ -1152,7 +1182,9 @@
         usergroupcode: '', // 鐝粍缂栫爜
         reportuser: '', // 鎶ュ伐浜哄憳
 
-        startqtySum: '' // 涓嶈兘瓒呰繃鐨勬暟鍊�
+        startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
+
+        remarks: ''// 澶囨敞
 
       },
       ZZuserArr: [], // 鑷埗鐢ㄦ埛鎵�鏈�
@@ -1240,8 +1272,11 @@
       badTableData: [], // 涓嶈壇澶勭悊鍒楄〃table鏁版嵁
       badTotal: 0,
       badDialogVisible: false,
-      badDialogForm: {},
-      badTableDataDialog: []// 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
+      badDialogForm: {
+        operation: getCookie('navTabId')
+      },
+      badTableDataDialog: [], // 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
+      badOperationArr: [] // 缁翠慨浜哄憳鏁扮粍
     }
   },
   // computed: {
@@ -1461,13 +1496,8 @@
         // this.dialogForm.startqty = obj.startqty
         this.dialogForm.startqty = obj.noreportqty
 
-        if (obj.nextstepname === null || obj.nextstepcode === '') {
-          this.dialogForm.nextstepname = obj.stepname
-          this.dialogForm.nextstepcode = obj.stepcode
-        } else {
-          this.dialogForm.nextstepname = obj.nextstepname
-          this.dialogForm.nextstepcode = obj.nextstepcode
-        }
+        this.dialogForm.nextstepname = obj.nextstepname
+        this.dialogForm.nextstepcode = obj.nextstepcode
 
         this.dialogForm.startqtySum = obj.noreportqty
       })
@@ -1526,13 +1556,10 @@
         this.dialogForm.reportqty = obj.reportqty
         this.dialogForm.noreportqty = obj.noreportqty
         this.dialogForm.stepcode = obj.stepcode
-        if (obj.nextstepname === null || obj.nextstepcode === '') {
-          this.dialogForm.nextstepname = obj.stepname
-          this.dialogForm.nextstepcode = obj.stepcode
-        } else {
-          this.dialogForm.nextstepname = obj.nextstepname
-          this.dialogForm.nextstepcode = obj.nextstepcode
-        }
+
+        this.dialogForm.nextstepname = obj.nextstepname
+        this.dialogForm.nextstepcode = obj.nextstepcode
+
         this.dialogForm.noputqty = obj.noputqty
         this.dialogForm.stepseq = obj.seq
         this.dialogForm.sqty = obj.startqty
@@ -1682,6 +1709,8 @@
 
       this.dialogForm.nextstepcode = '' // 涓嬮亾宸ュ簭缂栫爜
 
+      this.dialogForm.remarks = '' // 澶囨敞
+
       this.userTableData = [] // 浜哄憳鍒楄〃
 
       this.$refs.dialogForm.clearValidate()
@@ -1740,6 +1769,7 @@
               inuser: this.dialogForm.inuser, // 鍙戞枡浜哄憳
               taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
               sqty: this.dialogForm.sqty, // 鏀舵枡鏁伴噺
+              remarks: this.dialogForm.remarks, // 澶囨敞
               ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
               badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
             }
@@ -1750,8 +1780,8 @@
 
                 if (this.dialogForm.nextstepcode !== '') {
                   this.WXprint2()
+                  this.dialogVisible2 = true
                 }
-                this.dialogVisible2 = true
                 this.tabClick()
               } else {
                 this.$message.error('鏀舵枡澶辫触!')
@@ -1814,6 +1844,7 @@
               startqty: this.dialogForm.reportqty, // 寮�宸ユ暟閲�
               // reportqty: this.dialogForm.reportqty, // 鎶ュ伐鏁伴噺
               reportqty: this.dialogForm.startqty, // 鎶ュ伐鏁伴噺
+              remarks: this.dialogForm.remarks, // 澶囨敞
               ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
               badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
             }
@@ -1826,8 +1857,8 @@
                 console.log(this.dialogForm.nextstepcode, 1)
                 if (this.dialogForm.nextstepcode !== '') {
                   this.ZZprint2()
+                  this.dialogVisible2 = true
                 }
-                this.dialogVisible2 = true
                 this.tabClick()
               } else {
                 this.$message.error('鎶ュ伐澶辫触!')
@@ -1910,24 +1941,31 @@
         Data: this.badTableDataDialog
       }
       // console.log(JSON.stringify(data), 1)
-      // this.badPrint()
-      // this.dialogVisible2 = true
+      // console.log(this.badDialogForm.operation, 1)
+      // this.badPrintOperator =
+      this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
+      this.dialogVisible2 = true
 
-      EditOrderNgStepSeave(data).then(res => {
-        if (res.code === '200' || res.code === '301') {
-          this.getBadList()
-          this.badDialogVisible = false
-          return this.$message.success('淇濆瓨鎴愬姛锛�')
-        }
-      })
+      // EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
+      //   if (res.code === '200' || res.code === '301') {
+      //     this.getBadList()
+      //     this.badDialogVisible = false
+      //     this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
+      //     this.dialogVisible2 = true
+      //     return this.$message.success('淇濆瓨鎴愬姛锛�')
+      //   }
+      // })
     },
-    badPrint() {
+    badPrint(username) {
       this.qrForm.qrvalue = this.badDialogForm.wo_code + ';' + this.badDialogForm.nextstepcode
       this.qrForm.startqty = this.badDialogForm.plan_qty
       this.qrForm.wo_code = this.badDialogForm.wo_code
       this.qrForm.partcode = this.badDialogForm.partcode
       this.qrForm.partname = this.badDialogForm.partname
       this.qrForm.nextstepname = this.badDialogForm.nextstepname
+      this.qrForm.operator = username
+      this.qrForm.operatorTime = handleDatetime2(new Date())
+      console.log(this.qrForm, 22)
       this.$nextTick(() => {
         this.bindQRCode(this.qrForm.qrvalue)
       })
@@ -1935,10 +1973,14 @@
 
     handleCloseBad() {
       this.badDialogForm = {}
+      this.badDialogForm.operation = getCookie('navTabId')
       this.badTableDataDialog = []
     },
-    // 鐐瑰嚮缁翠慨澶勭悊鎸夐挳
+    // 鐐瑰嚮缁翠慨澶勭悊鎸夐挳  鎴�  鎵弿鏉$爜鐨勬壂鎻忓洖杞︿簨浠�
     async repairHandle(row) {
+      const { data: res1 } = await MesOrderSelectUser({ usercode: '' })
+      this.badOperationArr = res1
+
       console.log(row)
       let data
       if (row.wo_code) {
@@ -1971,6 +2013,8 @@
           item.repair_qty = 0
           item.bad_qty = 0
           item.isVisible = 0
+          // item.defect_code = [...new Set(item.defect_code.split(','))].join(',')
+          // item.defect_name = [...new Set(item.defect_name.split(','))].join(',')
         })
         console.log(this.badTableDataDialog, 321)
         this.badDialogVisible = true
diff --git a/src/views/zlgl/gxjy.vue b/src/views/zlgl/gxjy.vue
index fccc514..153339e 100644
--- a/src/views/zlgl/gxjy.vue
+++ b/src/views/zlgl/gxjy.vue
@@ -32,7 +32,7 @@
           <div style="display: flex;margin-left: 30px;">
             <div style="display: flex;margin-right: 50px">
               <div style="width: 90px">浜у搧鍚嶇О锛�</div>
-              <div style="width: 100px">{{ form.partname }}</div>
+              <div style="width: 200px">{{ form.partname }}</div>
             </div>
             <div style="display: flex;">
               <div style="width: 90px">浜у搧瑙勬牸锛�</div>

--
Gitblit v1.9.3