From 1cf81a64af5bac57f2af8c419db0b22b3d5ba7c8 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 17 十一月 2023 16:37:50 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/zs-mes-before

---
 src/views/plan/outsourcingorder/index.vue |  127 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 112 insertions(+), 15 deletions(-)

diff --git a/src/views/plan/outsourcingorder/index.vue b/src/views/plan/outsourcingorder/index.vue
index 2a82f99..858ffa0 100644
--- a/src/views/plan/outsourcingorder/index.vue
+++ b/src/views/plan/outsourcingorder/index.vue
@@ -18,13 +18,9 @@
                   鐘舵�佸彉鏇�<i class="el-icon-arrow-down el-icon--right"></i>
                 </el-button>
                 <el-dropdown-menu slot="dropdown">
-                  <template v-for="item in stateTagArr">
-                    <el-dropdown-item
-                      :command="item.command"
-                      :disabled="item.disabled">
-                      {{ item.eventName }}
-                    </el-dropdown-item>
-                  </template>
+                  <el-dropdown-item v-for="(item, index) in stateTagArr" :key="index" :command="item.command" :disabled="item.disabled">
+                    {{ item.eventName }}
+                  </el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
               <el-dropdown @command="handleCommandOa" style="margin-left: 10px">
@@ -32,8 +28,8 @@
                   瀹℃牳鍙樻洿<i class="el-icon-arrow-down el-icon--right"></i>
                 </el-button>
                 <el-dropdown-menu slot="dropdown">
-                  <template v-for="item in oaStateTagArr">
-                    <el-dropdown-item :key="item" :command="item.command" v-if="item.isShow"
+                  <template v-for="(item, index) in oaStateTagArr">
+                    <el-dropdown-item :key="index" :command="item.command" v-if="item.isShow"
                       >{{ item.eventName }}
                     </el-dropdown-item>
                   </template>
@@ -70,6 +66,16 @@
         @refreshOutsourcingOrder="refreshOutsourcingOrder"
       ></outsourcing-order-stock-form>
     </basic-container>
+    <el-dialog
+      title="鎻愮ず"
+      :visible.sync="showForeignDialog"
+      width="30%">
+      <span>杩欐槸涓�娈典俊鎭�</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showForeignDialog = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="showForeignDialog = false">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -90,10 +96,12 @@
 import TableForm from './outsourcingorder-form'
 import OutsourcingOrderStockForm from './outsourcingorderstock-form'
 import { value2label, dateTime2date } from '@/util/formatUtil'
+import { log } from '@chenfengyuan/vue-qrcode'
 
 export default {
   data() {
     return {
+      showForeignDialog: false,
       ajaxFun: fetchListOutsourcingOrder,
       addOrUpdateVisible: false,
       addOrUpdateJoinVisible: false,
@@ -250,6 +258,19 @@
           },
           {
             minWidth: '140',
+            prop: 'foreignState',
+            label: '瀵瑰鐩村彂鐘舵��',
+            sort: true,
+            isTrue: true,
+            formatter: this.formatForeignState,
+            isSearch: true,
+            searchInfoType: 'select',
+            optList: () => {
+              return this.foreignStateList
+            }
+          },
+          {
+            minWidth: '140',
             prop: 'state',
             label: '鐘舵��',
             sort: true,
@@ -335,16 +356,54 @@
             type: 'primary',
             loading: false,
             fun: this.launchOaProcess
+          },
+          {
+            text: '鏂板澶栧崗鐩村彂鐢宠鍗�',
+            type: 'primary',
+            loading: false,
+            fun: this.showForeign
+          },
+        ],
+        operator:[
+          {
+            text: '鎵撳嵃鍙戞枡鍗�',
+            type: 'text',
+            size: 'small',
+            show: {
+              val: [
+                '03pass'
+              ],
+              key: 'oaState'
+            }
+          },
+          {
+            text: '鎵撳嵃妯″叿澶栧崗鐢熶骇鍗�',
+            type: 'text',
+            size: 'small',
+            show: {
+              val: [
+                '03pass'
+              ],
+              key: 'oaState'
+            }
           }
         ],
         operatorConfig: {
           fixed: 'right',
           label: '鎿嶄綔',
-          width: 100,
-          minWidth: 100
+          width: 230,
+          minWidth: 230
         }
       },
-
+      foreignStateList: [
+          {
+            label: '鏄�',
+            value: 0
+          },{
+            label: '鍚�',
+            value: 1
+          }
+      ],
       paramObj: { outsourcingOrderId: 0 },
       joinAjaxFun: fetchList,
       joinMultipleSelection: [],
@@ -449,8 +508,8 @@
         operatorConfig: {
           fixed: 'right',
           label: '鎿嶄綔',
-          width: 60,
-          minWidth: 60
+          width: 100,
+          minWidth: 100
         }
       }
     }
@@ -464,6 +523,24 @@
     ...mapGetters(['permissions'])
   },
   methods: {
+    //灞曠ず鏂板澶栧崗鐩村彂妯℃�佹
+    showForeign(){
+      let data = this.currentOutsourcingOrder
+      if(data){
+        if(data.foreignState == "1"){
+          this.$message.warning("璇ヨ鍗曟棤闇�澶栧崗鐩村彂鐢宠鍗�")
+          return
+        }
+        if(data.foreignState == "0" && data.foreignId!= null){
+          this.$message.warning("璇ヨ鍗曞凡鏈夊鍗忕洿鍙戠敵璇峰崟")
+          return
+        }
+        //
+        this.$message.success("鏂板")
+      }else{
+        this.$message.warning("璇烽�夋嫨涓�鏉″澶栬鍗�")
+      }
+    },
     // 鑾峰彇鏁版嵁鍒楄〃
     getData() {
       this.$refs.outsourcingOrderTable.refreshData()
@@ -472,12 +549,19 @@
     addOrUpdateHandle(row) {
       this.addOrUpdateVisible = true
       this.$nextTick(() => {
-        this.$refs.addOrUpdate.init(row == null ? null : row.id)
+        this.$refs.addOrUpdate.init(row == null ? null : row.id,null,row == null ? null : row.mpsId)
       })
     },
     // 鍙戣捣OA瀹℃牳娴佺▼
     launchOaProcess() {
       if (this.currentOutsourcingOrder) {
+        let foreignState = this.currentOutsourcingOrder.foreignState
+        let foreignId = this.currentOutsourcingOrder.foreignId
+        console.log(this.currentOutsourcingOrder);
+        if(foreignState == 0 && foreignId==null){
+          this.$message.warning("璇峰厛鏂板澶栧崗鐩村彂鐢宠鍗�")
+          return
+        }
         this.table.toolbar[1].loading = true
         approvalOaByOutsourcingOrderId(this.currentOutsourcingOrder.id)
           .then((data) => {
@@ -500,6 +584,15 @@
     // 鐘舵�佹牸寮忓寲
     formatState(row, column, cellValue) {
       return value2label(cellValue, this.stateTagArr)
+    },
+    //澶栧崗鐩村彂鐘舵�佹牸寮忓寲
+    formatForeignState(row,column,cellValue){
+      this.foreignStateList.forEach(obj=>{
+        if(obj.value==cellValue){
+          cellValue =  obj.label
+        }
+      })
+      return cellValue
     },
     // OA鐘舵�佹牸寮忓寲
     formatOaState(row, column, cellValue) {
@@ -586,6 +679,10 @@
     // 搴撳瓨鎺ユ敹
     addOrUpdateStockHandle(row) {
       if (this.currentOutsourcingOrder) {
+        if(this.currentOutsourcingOrder.foreignState == "0"){
+          this.$message.error('澶栧崗鐩村彂涓嶆帴鏀跺簱瀛�')
+          return
+        }
         this.addOrUpdateJoinVisible = true
         this.$nextTick(() => {
           this.$refs.addOrUpdateJoin.init(

--
Gitblit v1.9.3