From fdc0b3f08b09c9cc77c0db680cf27dd1e4cfb33a Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 29 十一月 2022 09:39:58 +0800
Subject: [PATCH] 1.存货档案控制默认工艺路线为必填

---
 src/views/scgl/sckbg.vue |  110 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 81 insertions(+), 29 deletions(-)

diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 69996f0..6da64ea 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -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"
@@ -563,21 +563,52 @@
         <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"
           >
             <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"
+              :value="item.usercode"
             />
           </el-select>
         </el-form-item>
+
         <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="璁惧鍚嶇О锛�" prop="eqpcode">
           <el-select
             v-model="dialogForm.eqpcode"
@@ -619,7 +650,7 @@
         <!--        <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;"
@@ -636,7 +667,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
@@ -1254,9 +1286,14 @@
         startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
 
         operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
-        remarks: ''// 澶囨敞
+        remarks: '', // 澶囨敞
 
+        productionType: 'personal'// 鐢熶骇绫诲瀷
       },
+      productionTypeSelect: [
+        { code: 'personal', name: '涓汉绫诲瀷' },
+        { code: 'team', name: '鐝粍绫诲瀷' }
+      ], // 鐢熶骇绫诲瀷鏁扮粍
       ZZuserArr: [], // 鑷埗鐢ㄦ埛鎵�鏈�
       ZZtreams: [], // 鑷埗鐢熶骇鐝粍鏁扮粍
       ZZeqpArr: [], // 鑷埗璁惧鍚嶇О
@@ -1297,6 +1334,9 @@
         ],
         startqty: [
           { required: true, message: '璇疯緭鍏ユ姤宸ユ暟閲�', trigger: ['blur', 'change'] }
+        ],
+        productionType: [
+          { required: true, message: '璇烽�夋嫨鐢熶骇绫诲瀷', trigger: ['blur', 'change'] }
         ]
       },
       activeName: '',
@@ -1397,6 +1437,13 @@
     this.getMesOrderSelectUserAll() // 鑾峰彇鎵�鏈変汉鍛�
   },
   methods: {
+    // 閫夋嫨鐢熶骇绫诲瀷
+    usergroupChange111(val) {
+      console.log(val)
+      if (val === 'personal') {
+        this.dialogForm.usergroupcode = ''
+      }
+    },
 
     tableRowClassName({ row, rowIndex }) {
       return 'custom-row'
@@ -1822,6 +1869,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 +1952,7 @@
       this.dialogForm.reportqty = '', // 宸叉姤鏁伴噺
       this.dialogForm.noreportqty = '', // 鏈姤鏁伴噺
       this.dialogForm.startqty = '', // 寮�(鎶�)宸ユ暟閲�
-
+      this.dialogForm.reportuser = '', // 鎶ュ伐浜哄憳
       this.dialogForm.wxcode = '', // 澶栧崗渚涘簲鍟嗙紪鐮�
       this.dialogForm.outuser = '', // 鍙戞枡浜哄憳
       this.dialogForm.taskqty = '', // 浠诲姟鏁伴噺
@@ -1995,10 +2046,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 +2085,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 +2095,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 +2109,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 +2125,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 {

--
Gitblit v1.9.3