From 447af08b0fc2fe0050d361746b2449e3d376ee5b Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 08 三月 2023 16:08:47 +0800
Subject: [PATCH] 1.流转标签新增60*40尺寸

---
 src/views/scgl/sckbg.vue |  233 ++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 177 insertions(+), 56 deletions(-)

diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 69996f0..19f4dd9 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -297,7 +297,7 @@
                 sortable="custom"
               />
               <el-table-column
-                label="鏈姤宸ユ暟閲�"
+                label="鏈敹鏂欐暟閲�"
                 width="120"
               >
                 <!--                sortable="custom"-->
@@ -490,7 +490,7 @@
       :visible.sync="dialogVisible"
       width="850px"
       class="dialogVisible"
-      :top="dialogTitle==='鑷埗鎶ュ伐'?'5vh':'15vh'"
+      top="15vh"
       :close-on-click-modal="false"
       @close="handleClose"
       @closed="handleClose"
@@ -550,6 +550,7 @@
             v-model="dialogForm.eqpcode"
             style="width: 200px;"
             placeholder="璇烽�夋嫨"
+            filterable
           >
             <el-option
               v-for="item in ZZeqpArr"
@@ -563,25 +564,58 @@
         <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="涓嬮亾宸ュ簭锛�">
           <div style="width: 200px">{{ dialogForm.nextstepname }}</div>
         </el-form-item>
-        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" prop="usergroupcode" label="鐢熶骇鐝粍锛�">
+        <!--        <el-form-item  v-if="dialogTitle==='鑷埗鎶ュ伐'" prop="productionType" label="鐢熶骇绫诲瀷锛�">-->
+        <!--          <el-select-->
+        <!--            v-model="dialogForm.productionType"-->
+        <!--            style="width: 200px;"-->
+        <!--            placeholder="璇烽�夋嫨"-->
+        <!--            @change="usergroupChange111"-->
+        <!--          >-->
+        <!--            <el-option-->
+        <!--              v-for="item in productionTypeSelect"-->
+        <!--              :key="item.code"-->
+        <!--              :label="item.name"-->
+        <!--              :value="item.code"-->
+        <!--            />-->
+        <!--          </el-select>-->
+        <!--        </el-form-item>-->
+        <!--        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" :prop="dialogForm.productionType==='personal'?'':'usergroupcode'" label="鐢熶骇鐝粍锛�">-->
+        <!--          <el-select-->
+        <!--            v-model="dialogForm.usergroupcode"-->
+        <!--            style="width: 200px;"-->
+        <!--            placeholder="璇烽�夋嫨"-->
+        <!--            @change="usergroupChange"-->
+        <!--          >-->
+        <!--            <el-option-->
+        <!--              v-for="item in ZZtreams"-->
+        <!--              :key="item.group_code"-->
+        <!--              :label="item.group_name"-->
+        <!--              :value="item.group_code"-->
+        <!--            />-->
+        <!--          </el-select>-->
+        <!--        </el-form-item>-->
+
+        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" prop="productionType" label="鎶ュ伐浜哄憳锛�">
           <el-select
-            v-model="dialogForm.usergroupcode"
+            v-model="dialogForm.reportuser"
             style="width: 200px;"
             placeholder="璇烽�夋嫨"
-            @change="usergroupChange"
+            filterable
           >
             <el-option
-              v-for="item in ZZtreams"
-              :key="item.group_code"
-              :label="item.group_name"
-              :value="item.group_code"
+              v-for="item in ZZuserArr"
+              :key="item.usercode"
+              :label="item.username+' / '+item.usercode"
+              :value="item.usercode"
             />
           </el-select>
         </el-form-item>
+
         <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="璁惧鍚嶇О锛�" prop="eqpcode">
           <el-select
             v-model="dialogForm.eqpcode"
             style="width: 200px;"
+            filterable
             placeholder="璇烽�夋嫨"
           >
             <el-option
@@ -607,6 +641,7 @@
             :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
             multiple
             collapse-tags
+            filterable
           >
             <el-option
               v-for="item in badArr"
@@ -619,11 +654,12 @@
         <!--        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜哄憳锛�">-->
         <!--          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />-->
         <!--        </el-form-item>-->
-        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜猴細">
+        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎿嶄綔浜哄憳锛�">
           <el-select
             v-model="dialogForm.operation"
             style="width: 200px;"
             placeholder="璇烽�夋嫨"
+            filterable
           >
             <el-option
               v-for="item in OperationArr"
@@ -636,7 +672,8 @@
         <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==='鑷埗鎶ュ伐'">
+        <!--        <div v-if="dialogTitle==='鑷埗鎶ュ伐'">-->
+        <div v-if="false">
           <i class="el-icon-s-operation" style="color:#42b983;" /> 浜哄憳鍒楄〃
           <el-button type="primary" style="margin: 10px 0" @click="userAdd">澧炶</el-button>
           <el-table
@@ -899,63 +936,127 @@
       @close="dialogVisible2Close"
     >
       <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
-      <div id="printMe2" style="padding: 30px;">
+      <div id="printMe2">
+
         <div
-          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+          style="display: flex;width: 220px;height: 130px;border: 1px solid #000;text-align: center;font-size: 12px"
         >
 
-          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
+          <div style="width: 70px;display: flex;flex-direction: column;border-right: 1px solid #000">
             <div
-              style="display: flex;height: 90px;border-bottom:1px solid #000;
+              style="display: flex;height: 60%;border-bottom:1px solid #000;
               justify-content: center;align-items: center;position: relative"
             >
-              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+              <div
+                id="qrCode2"
+                ref="qrCodeDiv2"
+                style="overflow-y: hidden;height:71%;position: absolute;left: 7px;"
+              />
             </div>
             <div
-              style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
+              style="display: flex;height:  20%;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
             >
-              <div style="margin-left: 5px;width: 28px">鏁伴噺:</div>
-              {{ qrForm.startqty }}
+              <div style="margin-left: 3px; ">鏁伴噺:{{ qrForm.startqty }}</div>
             </div>
-            <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
-              <div style="margin-left: 5px;width: 42px">澶勭悊浜�:</div>
-              {{ qrForm.operator }}
+            <div style="display: flex;height:  20%;justify-content: flex-start;align-items: center;">
+              <div style="margin-left: 3px; ">鎿嶄綔:{{ qrForm.operator }}</div>
+
             </div>
           </div>
 
-          <div style="width:190px;display: flex;flex-direction: column">
+          <div style="width:150px;display: flex;flex-direction: column">
             <div
               style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
             >
-              <div style="width: 60px;margin-left: 5px;">宸ュ崟缂栧彿:</div>
-              <div>{{ qrForm.wo_code }}</div>
+              <div style="margin-left: 3px;">缂栧彿:{{ qrForm.wo_code }}</div>
+
             </div>
             <div
               style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
             >
-              <div style="width: 60px;margin-left: 5px;">浜у搧缂栫爜:</div>
-              <div>{{ qrForm.partcode }}</div>
+              <div style="margin-left: 3px;">浜у搧缂栫爜:{{ qrForm.partcode }}</div>
+
             </div>
             <div
               style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
             >
-              <div style="width:60px;margin-left: 5px;">浜у搧鍚嶇О:</div>
-              <div>{{ qrForm.partname }}</div>
+              <div style="margin-left: 3px;">浜у搧鍚嶇О:{{ qrForm.partname }}</div>
+
             </div>
             <div
               style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
             >
-              <div style="width:60px;margin-left: 5px;">涓嬮亾宸ュ簭:</div>
-              <div>{{ qrForm.nextstepname }}</div>
+              <div style="margin-left: 3px;">涓嬮亾宸ュ簭:{{ qrForm.nextstepname }}</div>
+
             </div>
             <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
-              <div style="width: 60px;margin-left: 5px;">澶勭悊鏃堕棿:</div>
-              <div>{{ qrForm.operatorTime }}</div>
+              <div style=" margin-left: 3px;">鏃堕棿: {{ qrForm.operatorTime }}</div>
+              <!--                <div>{{ qrForm.operatorTime?qrForm.operatorTime.substring(5):'' }}</div>-->
+              <!--                <div>{{ qrForm.operatorTime }}</div>-->
             </div>
 
           </div>
 
         </div>
+
+        <!--        -->
+        <!--        -->
+        <!--        <div-->
+        <!--          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"-->
+        <!--        >-->
+
+        <!--          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">-->
+        <!--            <div-->
+        <!--              style="display: flex;height: 90px;border-bottom:1px solid #000;-->
+        <!--              justify-content: center;align-items: center;position: relative"-->
+        <!--            >-->
+        <!--              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />-->
+        <!--            </div>-->
+        <!--            <div-->
+        <!--              style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"-->
+        <!--            >-->
+        <!--              <div style="margin-left: 5px;width: 28px">鏁伴噺:</div>-->
+        <!--              {{ qrForm.startqty }}-->
+        <!--            </div>-->
+        <!--            <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">-->
+        <!--              <div style="margin-left: 5px;width: 42px">澶勭悊浜�:</div>-->
+        <!--              {{ qrForm.operator }}-->
+        <!--            </div>-->
+        <!--          </div>-->
+
+        <!--          <div style="width:190px;display: flex;flex-direction: column">-->
+        <!--            <div-->
+        <!--              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"-->
+        <!--            >-->
+        <!--              <div style="width: 60px;margin-left: 5px;">宸ュ崟缂栧彿:</div>-->
+        <!--              <div>{{ qrForm.wo_code }}</div>-->
+        <!--            </div>-->
+        <!--            <div-->
+        <!--              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"-->
+        <!--            >-->
+        <!--              <div style="width: 60px;margin-left: 5px;">浜у搧缂栫爜:</div>-->
+        <!--              <div>{{ qrForm.partcode }}</div>-->
+        <!--            </div>-->
+        <!--            <div-->
+        <!--              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"-->
+        <!--            >-->
+        <!--              <div style="width:60px;margin-left: 5px;">浜у搧鍚嶇О:</div>-->
+        <!--              <div>{{ qrForm.partname }}</div>-->
+        <!--            </div>-->
+        <!--            <div-->
+        <!--              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"-->
+        <!--            >-->
+        <!--              <div style="width:60px;margin-left: 5px;">涓嬮亾宸ュ簭:</div>-->
+        <!--              <div>{{ qrForm.nextstepname }}</div>-->
+        <!--            </div>-->
+        <!--            <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">-->
+        <!--              <div style="width: 60px;margin-left: 5px;">澶勭悊鏃堕棿:</div>-->
+        <!--              <div>{{ qrForm.operatorTime }}</div>-->
+        <!--            </div>-->
+
+        <!--          </div>-->
+
+        <!--        </div>-->
       </div>
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
@@ -1254,9 +1355,14 @@
         startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
 
         operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
-        remarks: ''// 澶囨敞
+        remarks: '', // 澶囨敞
 
+        productionType: 'personal'// 鐢熶骇绫诲瀷
       },
+      productionTypeSelect: [
+        { code: 'personal', name: '涓汉绫诲瀷' },
+        { code: 'team', name: '鐝粍绫诲瀷' }
+      ], // 鐢熶骇绫诲瀷鏁扮粍
       ZZuserArr: [], // 鑷埗鐢ㄦ埛鎵�鏈�
       ZZtreams: [], // 鑷埗鐢熶骇鐝粍鏁扮粍
       ZZeqpArr: [], // 鑷埗璁惧鍚嶇О
@@ -1297,6 +1403,9 @@
         ],
         startqty: [
           { required: true, message: '璇疯緭鍏ユ姤宸ユ暟閲�', trigger: ['blur', 'change'] }
+        ],
+        productionType: [
+          { required: true, message: '璇烽�夋嫨鐢熶骇绫诲瀷', trigger: ['blur', 'change'] }
         ]
       },
       activeName: '',
@@ -1397,6 +1506,13 @@
     this.getMesOrderSelectUserAll() // 鑾峰彇鎵�鏈変汉鍛�
   },
   methods: {
+    // 閫夋嫨鐢熶骇绫诲瀷
+    usergroupChange111(val) {
+      console.log(val)
+      if (val === 'personal') {
+        this.dialogForm.usergroupcode = ''
+      }
+    },
 
     tableRowClassName({ row, rowIndex }) {
       return 'custom-row'
@@ -1685,7 +1801,7 @@
         this.dialogForm.startqty = obj.noreportqty
 
         this.dialogForm.nextstepname = obj.nextstepname
-        this.dialogForm.nextstepcode = obj.nextstepcode
+        this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
 
         this.dialogForm.startqtySum = obj.noreportqty
       })
@@ -1746,7 +1862,7 @@
         this.dialogForm.stepcode = obj.stepcode
 
         this.dialogForm.nextstepname = obj.nextstepname
-        this.dialogForm.nextstepcode = obj.nextstepcode
+        this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
 
         this.dialogForm.noputqty = obj.noputqty
         this.dialogForm.stepseq = obj.seq
@@ -1822,6 +1938,10 @@
     },
     // 鐢ㄦ埛娣诲姞
     userAdd() {
+      if (this.userTableData.find(i => i.isVisible === 1)) {
+        return this.$message.info('璇峰厛淇濆瓨褰撳墠琛屼俊鎭紒')
+      }
+
       let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
       number = number === 0 ? (10 + Math.random()) : number
       console.log(this.userTableData, 6)
@@ -1901,7 +2021,7 @@
       this.dialogForm.reportqty = '', // 宸叉姤鏁伴噺
       this.dialogForm.noreportqty = '', // 鏈姤鏁伴噺
       this.dialogForm.startqty = '', // 寮�(鎶�)宸ユ暟閲�
-
+      this.dialogForm.reportuser = '', // 鎶ュ伐浜哄憳
       this.dialogForm.wxcode = '', // 澶栧崗渚涘簲鍟嗙紪鐮�
       this.dialogForm.outuser = '', // 鍙戞枡浜哄憳
       this.dialogForm.taskqty = '', // 浠诲姟鏁伴噺
@@ -1995,10 +2115,10 @@
               if (res.code === '200') {
                 this.dialogVisible = false
                 this.$message.success('鏀舵枡鎴愬姛锛�')
-                if (this.dialogForm.nextstepcode === '') {
-                  this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
-                  this.dialogVisible2 = true
-                }
+                // if (this.dialogForm.nextstepcode === '') {
+                this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
+                this.dialogVisible2 = true
+                // }
                 this.tabClick()
                 this.$store.state.app.buttonIsDisabled = false
               } else {
@@ -2034,9 +2154,9 @@
             if (parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) {
               return this.$message.info('鎶ュ伐鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庝簡鏈姤鏁伴噺!')
             }
-            if (this.userTableData.length < 1) {
-              return this.$message.info('浜哄憳鍒楄〃涓嶈兘涓虹┖!')
-            }
+            // if (this.userTableData.length < 1) {
+            //   return this.$message.info('浜哄憳鍒楄〃涓嶈兘涓虹┖!')
+            // }
 
             if (parseFloat(this.dialogForm.noputqty) > 0) {
               if (this.dialogForm.badcode.length < 1) {
@@ -2044,13 +2164,13 @@
               }
             }
             // this.userTableData = [...new Set(this.userTableData)]// 鏁扮粍鍘婚噸
-            this.userTableData = this.userTableData.filter(item => item.usercode !== '')
+            // this.userTableData = this.userTableData.filter(item => item.usercode !== '')
             // 鏁扮粍涓璞$浉鍚岀殑鍘婚噸
-            this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
-              return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
-            })
+            // this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
+            //   return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
+            // })
             // console.log(this.userTableData, 1)
-            const reportuser = this.userTableData.map(item => item.usercode).join(';')
+            // const reportuser = this.userTableData.map(item => item.usercode).join(';')
             const data = {
               mesordercode: this.dialogForm.wo_code, // 宸ュ崟缂栧彿
               partcode: this.dialogForm.partcode, // 浜у搧缂栫爜
@@ -2058,7 +2178,8 @@
               stepcode: this.dialogForm.stepcode, // 宸ュ簭缂栫爜
               eqpcode: this.dialogForm.eqpcode, // 璁惧缂栫爜
               usergroupcode: this.dialogForm.usergroupcode, // 鐝粍缂栫爜
-              reportuser: reportuser, // 鎶ュ伐浜哄憳
+              // reportuser: reportuser, // 鎶ュ伐浜哄憳
+              reportuser: this.dialogForm.reportuser, // 鎶ュ伐浜哄憳
               taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
               // startqty: this.dialogForm.startqty, // 寮�宸ユ暟閲�
               startqty: this.dialogForm.reportqty, // 寮�宸ユ暟閲�
@@ -2073,10 +2194,10 @@
               if (res.code === '200') {
                 this.dialogVisible = false
                 this.$message.success('鎶ュ伐鎴愬姛锛�')
-                if (this.dialogForm.nextstepcode === '') {
-                  this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
-                  this.dialogVisible2 = true
-                }
+                // if (this.dialogForm.nextstepcode === '') {
+                this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
+                this.dialogVisible2 = true
+                // }
                 this.tabClick()
                 this.$store.state.app.buttonIsDisabled = false
               } else {
@@ -2092,9 +2213,9 @@
       new QRCode(this.$refs.qrCodeDiv2, {
         text: text,
         // width: 50,
-        width: 60,
+        width: 55,
         // height: 50,
-        height: 60,
+        height: 55,
         colorDark: '#000', // 浜岀淮鐮侀鑹�
         colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
         correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H

--
Gitblit v1.9.3