From 3b956ef69d23f52e5a52812259c6ff967723695e Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 06 三月 2023 16:37:18 +0800
Subject: [PATCH] 1.节拍工价计件单价控制修改2.班组、人员报表红字添加

---
 src/views/scgl/gd.vue |  128 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 112 insertions(+), 16 deletions(-)

diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index 296a346..4c44ef9 100644
--- a/src/views/scgl/gd.vue
+++ b/src/views/scgl/gd.vue
@@ -319,11 +319,6 @@
             <template slot-scope="{row}">
               <div class="operationClass">
                 <el-tooltip class="item" effect="dark" content="鎵撳嵃宸ュ崟" placement="top">
-                  <!--                  <i-->
-                  <!--                    class="el-icon-tickets"-->
-                  <!--                    style="cursor: pointer;color: #42b983;margin-right: 15px"-->
-                  <!--                    @click="check(row)"-->
-                  <!--                  />-->
                   <i
                     class="el-icon-tickets"
                     style="cursor: pointer;color: #42b983;margin-right: 15px"
@@ -423,6 +418,9 @@
                     style="cursor: pointer;color: #42b983;margin-right: 15px"
                     @click="supplementSmallClick(row)"
                   />
+                </el-tooltip>
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="棰勮" placement="top">
+                  <i class="el-icon-files" style="cursor: pointer;color:#42b983;" @click="check(row)" />
                 </el-tooltip>
               </div>
             </template>
@@ -583,6 +581,7 @@
               style="width: 200px;"
               placeholder="璇烽�夋嫨"
               :disabled="dialogForm.routecode===''"
+              @change="wkshopcodeChange"
             >
               <el-option
                 v-for="item in wkshopArr"
@@ -598,6 +597,7 @@
             v-model="dialogForm.planstartdate"
             type="date"
             :clearable="false"
+            :picker-options="pickerOptions"
             value-format="yyyy-MM-dd"
             style="width: 200px"
             placeholder="閫夋嫨鏃ユ湡"
@@ -608,6 +608,7 @@
             v-model="dialogForm.planenddate"
             type="date"
             :clearable="false"
+            :picker-options="pickerOptions"
             value-format="yyyy-MM-dd"
             style="width: 200px"
             placeholder="閫夋嫨鏃ユ湡"
@@ -687,9 +688,19 @@
           <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
           <!--          <el-button v-if="operation==='add'" type="primary" @click="dialogVisibleConfirmPreview('add')">棰勮</el-button>-->
           <el-button
+            v-if="!sumbitBottonIsDisabled"
+            v-waves
             type="primary"
             :loading="$store.state.app.buttonIsDisabled"
             :disabled="$store.state.app.buttonIsDisabled"
+            @click="dialogVisibleConfirm"
+          >纭� 瀹�</el-button>
+
+          <el-button
+            v-if="sumbitBottonIsDisabled"
+            v-waves
+            type="primary"
+            disabled
             @click="dialogVisibleConfirm"
           >纭� 瀹�</el-button>
         </div>
@@ -1555,6 +1566,46 @@
       </span>
     </el-dialog>
 
+    <el-dialog
+      title="鏂囦欢棰勮"
+      :visible.sync="dialogVisibleCheck"
+      width="800px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="handleCloseCheck"
+      @close="handleCloseCheck"
+    >
+      <el-form label-width="80px">
+        <el-form-item label="鏂囦欢鐗堟湰">
+          <el-select
+            v-model="sopSelectValue"
+            style="width: 200px"
+            placeholder="璇烽�夋嫨"
+            filterable
+            :popper-append-to-body="false"
+          >
+            <el-option
+              v-for="item in sopSelectArr"
+              :key="item.id"
+              :label="item.define_name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+
+      </el-form>
+
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button @click="dialogVisibleCancelCheck">杩� 鍥�</el-button>
+          <el-button
+            type="primary"
+            @click="dialogVisibleConfirmCheck"
+          >棰� 瑙�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -1564,7 +1615,7 @@
   AddUpdateMesOrder,
   ClosedMesOrder,
   DeleteMesOrder, ErpOrderSearch,
-  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep,
+  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep, SearchWorkStepSopList, SelectRouteOrWkshop,
   SelectRouteStep
 } from '@/api/scgl'
 import { InventoryFileAssociationRoute, PartSelect, SaveInventoryFile } from '@/api/zzmx'
@@ -1574,6 +1625,7 @@
 import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
 import QRCode from 'qrcodejs2'
 import $ from 'jquery'
+import { SystemSopView } from '@/api/xtsz'
 
 export default {
   name: 'GD',
@@ -1791,7 +1843,18 @@
         // { code: 3, name: '50*40' },
         // { code: 4, name: '50*80' },
         // { code: 5, name: '40*30' }
-      ]
+      ],
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 8.64e7
+        }
+      },
+      /* 鏂囦欢棰勮閮ㄥ垎*/
+      dialogVisibleCheck: false,
+      sopSelectArr: [], // sop涓嬫媺閫夐」鏁扮粍
+      sopSelectValue: '', // sop涓嬫媺閫変腑鍊�
+
+      sumbitBottonIsDisabled: false
     }
   },
   created() {
@@ -1900,6 +1963,20 @@
     getCurrentRow(wo_code) {
       this.radioSelected = wo_code
     },
+    // 鐢熶骇杞﹂棿鍊兼敼鍙樻椂
+    wkshopcodeChange(val) {
+      const data = {
+        partcode: this.dialogForm.partcode,
+        routecode: this.dialogForm.routecode,
+        wkshopcode: val
+      }
+      SelectRouteOrWkshop(data).then((res) => {
+        // console.log(res, 1)
+      }).catch(err => {
+        // console.log(err, 2)
+        this.sumbitBottonIsDisabled = true
+      })
+    },
     // 鏂板鎸夐挳
     async add(operation) {
       this.operation = operation
@@ -1928,6 +2005,8 @@
       }
 
       this.dialogForm.wkshopcode = ''
+
+      this.sumbitBottonIsDisabled = false
     },
     // 宸ヨ壓璺嚎鍊兼敼鍙�
     async routecodeChange(val) {
@@ -1939,18 +2018,34 @@
       const { data: res2 } = await RouteSelectWkshop(data)
       this.wkshopArr = res2
       this.dialogForm.wkshopcode = ''
+      this.sumbitBottonIsDisabled = false
     },
-    // 宸ュ簭浠诲姟
+    // 棰勮
     async check(row) {
-      const { data: res } = await SearchWorkStep({ wo_code: row.wo_code })
-      this.taskTableData = res
-
-      if (this.taskTableData.length === 0) {
-        return this.$message.info('鏃犵敓浜т换鍔℃暟鎹紒')
+      this.dialogVisibleCheck = true
+      const data = {
+        partcode: row.partcode,
+        routecode: this.tableData.find(i => i.wo_code === this.radioSelected).route_code,
+        stepcode: row.stepcode
       }
-      this.dialogForm.mesordercode = res[0].wo_code
-      this.dialogVisibleTask = true
+      const { data: res } = await SearchWorkStepSopList(data)
+      this.sopSelectArr = res
+      this.sopSelectValue = res[0].id
     },
+    // 棰勮鍏抽棴
+    handleCloseCheck() {
+      this.sopSelectValue = ''
+    },
+    // 棰勮杩斿洖
+    dialogVisibleCancelCheck() {
+      this.dialogVisibleCheck = false
+    },
+    // 棰勮鏂板紑娴忚鍣ㄩ〉绛�
+    async dialogVisibleConfirmCheck() {
+      const { data: res } = await SystemSopView({ id: this.sopSelectValue, filepath: this.sopSelectArr.find(i => i.id === this.sopSelectValue).file_path })
+      window.open(res)
+    },
+
     dialogVisibleBack() {
       this.dialogVisibleTask = false
     },
@@ -2084,6 +2179,7 @@
       this.dialogForm.orderlev = '' // 宸ュ崟绛夌骇
 
       this.$refs.dialogForm.clearValidate()
+      this.sumbitBottonIsDisabled = false
     },
     // 瀵硅瘽妗嗗彇娑�
     dialogVisibleCancel() {
@@ -2215,9 +2311,9 @@
             // div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
             div.scrollTop = 0 // 婊氬姩鏉′綅浜庢渶椤堕儴
           })
+          this.dialogVisibleApprove = true
         }
       })
-      this.dialogVisibleApprove = true
     },
     dialogVisibleTaskClose() {
       this.dialogForm.mesordercode = ''

--
Gitblit v1.9.3