From 52e18000ace434b2acdebce5e118c45c337a3fe7 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 28 五月 2024 13:31:54 +0800
Subject: [PATCH] 合并冲突

---
 src/views/plan/customerorder/index.vue |  156 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 119 insertions(+), 37 deletions(-)

diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index 3ae8486..87bf7f7 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -18,7 +18,7 @@
             @command="documentHandle"
             style="margin-left: 10px"
           >
-            <el-button>
+            <el-button style="padding: 9px 14px;">
               宸ヨ壓鏂囦欢<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
             <el-dropdown-menu slot="dropdown">
@@ -38,7 +38,7 @@
             @command="handleCommitCommand"
             style="margin-left: 10px"
           >
-            <el-button>
+            <el-button style="padding: 9px 14px;">
               瀹℃牳鐘舵�佹敼鍙�<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
             <el-dropdown-menu slot="dropdown">
@@ -52,11 +52,24 @@
             </el-dropdown-menu>
           </el-dropdown>
           <el-button
-            style="margin-left: 10px"
+            style="margin-left: 10px;padding: 9px 14px;"
             type="primary"
             @click="() => (exportDialogVisible = true)"
             >瀵煎嚭鍙拌处</el-button
           >
+          <el-button
+            style="margin-left: 10px;padding: 9px 14px;"
+            type="primary"
+            v-if="permissions.plan_customerorder_check"
+            @click="handleCheck"
+            >瀹℃牳</el-button
+          >
+          <!-- <el-button
+            style="margin-left: 10px"
+            type="primary"
+            @click="() => ($refs.technology.init())"
+            >缂栧啓鎶�鏈氦搴曞崟</el-button
+          > -->
         </template>
       </ttable>
       <!-- 寮圭獥, 鏃ユ湡閫夋嫨 -->
@@ -347,6 +360,7 @@
         ></el-table-column>
       </el-table>
     </el-dialog>
+    <technology-form ref="technology"></technology-form>
   </div>
 </template>
 
@@ -358,6 +372,7 @@
 } from '@/api/plan/customerOrderInterrelated'
 import ConfirmPullCustomerorder from './confirm-pull-customerorder'
 import TableForm from './customerorder-form'
+import TechnologyForm from './technology-form.vue'
 import TableFormDEesc from './customerorder-form-desc'
 import SampleTableForm from './sample-customerorder-form'
 import { mapGetters } from 'vuex'
@@ -384,7 +399,8 @@
   exportCustomerOrderSplit,
   syncOrder,
   dropByContractNo,
-  downloadWordFile,
+  downloadProduct,
+  downloadWordFile
 } from '../../../api/plan/customerorder'
 import DocumentTable from '@/views/common/document.vue'
 import { remote } from '@/api/admin/dict'
@@ -399,6 +415,7 @@
       interrelatedOrderId: null,
       interrelatedOrderData: [],
       showInterrelatedOrderDialog: false,
+      technologyDialog:true,
       uniqueStateArr: [],
       dataForm: {
         selectTime: null,
@@ -518,6 +535,7 @@
         isSearch: true, // 楂樼骇鏌ヨ鎸夐挳
         defaultOrderBy: { column: 'placeOrderDate', direction: 'desc' },
         cancelRunCreated: true,
+        reserveSelection: true,//鏄惁淇濈暀涔嬪墠閫夋嫨鐨勬暟鎹�
       },
       table: {
         total: 0,
@@ -585,7 +603,7 @@
             sort: true,
             isTrue: true,
             isSearch: true,
-            searchInfoType: 'text',
+            searchInfoType: 'datetimerange',
             formatter: this.formatDutyDate,
           },
           {
@@ -787,19 +805,19 @@
           //   size: 'small',
           //   fun: this.packageExportHandle
           // },
-          {
-            text: '瀹℃牳',
-            type: 'text',
-            size: 'small',
-            fun: this.checkHandOrder,
-            showFun: (row) => {
-              return row.sourceId === '1'
-            },
-            show: {
-              val: [false],
-              key: 'isPass',
-            },
-          },
+        //   {
+        //     text: '瀹℃牳',
+        //     type: 'text',
+        //     size: 'small',
+        //     fun: this.checkHandOrder,
+        //     showFun: (row) => {
+        //       return row.sourceId === '1'
+        //     },
+        //     show: {
+        //       val: [false],
+        //       key: 'isPass',
+        //     },
+        //   },
           {
             text: '宸插叧鑱旇鍗�',
             type: 'text',
@@ -962,6 +980,7 @@
     SalesPartBatchDialog,
     TableFormDEesc,
     CustomerorderReturnDialog,
+    TechnologyForm,
   },
   computed: {
     ...mapGetters(['permissions']),
@@ -1000,6 +1019,7 @@
   created() {
     // this.getManufactureAttrs()
     this.getTitles()
+    if (this.permissions.plan_customerorder_add) {
     this.table.toolbar.push({
       text: '鏂板閿�鍞鍗�',
       type: 'primary',
@@ -1007,6 +1027,7 @@
       disabled: false,
       permitArr: [],
     })
+    }
     if (this.permissions.customerorder_from_otc) {
       this.table.toolbar.push({
         text: '鑾峰彇閿�鍞鍗�',
@@ -1035,13 +1056,25 @@
         permitArr: [],
       })
     }
-    this.table.toolbar.push({
-      text: '涓嬭浇Word',
-      disabled: false,
-      type: 'primary',
-      fun: this.downloadWord,
-      permitArr: ['03plan', '04planed'],
-    })
+    if(this.permissions.plan_download_process_file){
+        this.table.toolbar.push({
+            text: '涓嬭浇宸ヨ壓鏂囦欢',
+            disabled: false,
+            type: 'primary',
+            fun: this.downloadWord,
+            permitArr: ['03plan','04planed'],
+        })
+    }
+    if(this.permissions.plan_download_product_file){
+        this.table.toolbar.push({
+            text: '涓嬭浇鎺掍骇鍗�',
+            disabled: false,
+            type: 'primary',
+            permitArr: [],
+            fun: this.downloadProductionScheduling,
+        })
+    }
+    if(this.permissions.plan_relevance_order){
     this.table.toolbar.push({
       text: '鍏宠仈璁㈠崟',
       disabled: false,
@@ -1049,6 +1082,7 @@
       fun: this.interrelatedOrderFun,
       permitArr: [],
     })
+    }
     if (this.permissions.customerorder_create_masterplan) {
       this.table.toolbar.push({
         text: '涓荤敓浜ц鍒�',
@@ -1115,16 +1149,29 @@
       this.interrelatedOrderId = currentOrder.id
       this.showInterrelatedOrderDialog = true
     },
-
-    //涓嬭浇word
-    downloadWord() {
-      let ids = this.multipleSelection.map((ele) => ele.id)
-      if (ids.length < 1) {
-        this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�')
-        return
-      }
-      downloadWordFile(ids)
-        .then((response) => {
+    //涓嬭浇鎺掍骇閫氱煡鍗�
+    downloadProductionScheduling(){
+        let ids = this.multipleSelection.map(obj => obj.id)
+        if(ids.length<1){
+            this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�")
+            return
+        }
+        downloadProduct(ids).then(res=>{
+            if(res.status===200){
+                transform(res)
+            }
+        }).catch(error=>{
+            console.error(error)
+        })
+    },
+    //涓嬭浇宸ヨ壓鏂囦欢
+    downloadWord(){
+        let ids = this.multipleSelection.map(ele=>ele.id)
+        if(ids.length<1){
+            this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�")
+            return
+        }
+        downloadWordFile(ids).then(response=>{
           // 澶勭悊杩斿洖鐨勬枃浠舵祦
           const blob = response.data
           const link = document.createElement('a')
@@ -1160,8 +1207,9 @@
       this.getData()
     },
 
-    getData() {
-      this.$refs.customerOrderTable.getDataList()
+    async getData() {
+      await this.$refs.customerOrderTable.getDataList()
+      this.$refs.customerOrderTable.toggleRowExpansion()
     },
     // 鑾峰彇鏁版嵁鍒楄〃鍘婚櫎宸插畬鎴愮姸鎬佺殑
     handleDataList(command) {
@@ -1905,6 +1953,40 @@
         this.$message.error('璇峰厛閫夋嫨鏃ユ湡')
       }
     },
+    handleCheck(){
+        if (this.multipleSelection.length > 0) {
+            for(let i=0 ;i<this.multipleSelection.length;i++){
+                if(this.multipleSelection[i].sourceId==0){
+                    this.$message.error('璇烽�夋嫨鎵嬪姩杈撳叆鐨勯攢鍞鍗�')
+                    return;
+                }
+                if(this.multipleSelection[i].isPass){
+                    this.$message.error('璇烽�夋嫨鏈鏍搁�氳繃鐨勯攢鍞鍗�')
+                    return;
+                }
+            }
+            this.$confirm('纭瀹℃牳閫氳繃閫変腑鐨勯攢鍞鍗曞悧?', '鎻愮ず', {
+                confirmButtonText: '閫氳繃',
+                cancelButtonText: '鍙栨秷',
+                type: 'warning',
+            })
+                .then(() => {
+                checkHanderOrder(this.multipleSelection)
+                    .then((res) => {
+                    if (res.status === 200) {
+                        this.$message.success('瀹℃牳閫氳繃')
+                        this.getData()
+                    }
+                    })
+                    .catch((error) => {
+                    console.error(error)
+                    })
+                })
+                .catch(() => {})
+        } else {
+            this.$message.error('璇烽�夋嫨鑷冲皯涓�鏉¢攢鍞鍗�')
+        }
+    }
   },
 }
 </script>

--
Gitblit v1.9.3