From c57c6546d706019a5c5656ff02c411439bf95af5 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 24 十一月 2023 10:49:48 +0800
Subject: [PATCH] 概述的 入库获取供应商的接口联调 ,数据参数修改+出库获取客户的接口联调+数据参数修改

---
 src/views/overview/AddOverviewDialog.vue |  129 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 110 insertions(+), 19 deletions(-)

diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue
index 2097ac0..e09c059 100644
--- a/src/views/overview/AddOverviewDialog.vue
+++ b/src/views/overview/AddOverviewDialog.vue
@@ -10,7 +10,7 @@
       <div slot="title" class="dialog-header">
         <span>{{ editCommonConfig.title === "鏌ョ湅" ? editCommonConfig.title : editCommonConfig.title + addName }}</span>
         <div class="header_btns">
-          <span class="btn">
+          <span class="btn" @click="btnPrint">
             <i class="el-icon-printer"></i>
             <span>鎵撳嵃</span>
           </span>
@@ -18,7 +18,7 @@
             <i class="el-icon-s-tools"></i>
             <span>鍔ㄤ綔</span>
           </span>
-          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
+          <el-button v-if="showEdit" :disabled="this.editConfig.infomation.status===5" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
         </div>
       </div>
       <!-- 鍐呭 -->
@@ -36,6 +36,7 @@
             :showButton="showButton"
             :isValidateClick="isValidateClick"
             :isDelClick="isDelClick"
+            :isCancel="isCancel"
             :list="list"
             :showCancel="showCancel"
             @delClick="delClick"
@@ -49,7 +50,9 @@
               <el-col :span="12">
                 <el-form-item prop="companyName">
                   <span slot="label">{{ workType === 1 ? "渚涘簲鍟�" : workType === 2 ? "瀹㈡埛" : "鑱旂郴浜�" }}</span>
+                  
                   <el-select
+                    v-if="workType === 1"
                     v-model="editConfig.infomation.companyName"
                     placeholder="璇烽�夋嫨"
                     size="mini"
@@ -58,6 +61,40 @@
                     @change="companyChange"
                   >
                     <el-option
+                      v-for="item in supplierOptions"
+                      :key="item.SupplierId"
+                      :label="item.SupplierName"
+                      :value="{ value: item.SupplierId, label: item.SupplierName }"
+                    >
+                    </el-option>
+                  </el-select>
+                  <el-select
+                    v-else-if="workType === 2"
+                    v-model="editConfig.infomation.companyName"
+                    placeholder="璇烽�夋嫨"
+                    size="mini"
+                    style="width: 90%"
+                    :disabled="!showFooter"
+                    @change="companyChange"
+                  >
+                    <el-option
+                      v-for="item in clientOptions"
+                      :key="item.ClientId"
+                      :label="item.ClientName"
+                      :value="{ value: item.ClientId, label: item.ClientName }"
+                    >
+                    </el-option>
+                  </el-select>
+                  <el-select
+                    v-else
+                    v-model="editConfig.infomation.companyName"
+                    placeholder="璇烽�夋嫨"
+                    size="mini"
+                    style="width: 90%"
+                    :disabled="!showFooter"
+                    @change="companyChange"
+                  >
+                   <el-option
                       v-for="item in companyOptions"
                       :key="item.id"
                       :label="item.name"
@@ -65,6 +102,7 @@
                     >
                     </el-option>
                   </el-select>
+                  
                 </el-form-item>
               </el-col>
               <!-- <el-col :span="12">
@@ -314,9 +352,10 @@
   stateCancel,
   deleteOperation,
   getListTransfer,
-  getLogisticCompanyList
+  getLogisticCompanyList,
+  printReceipts
 } from "@/api/overview/overview"
-import { getCompanyList } from "@/api/common/other"
+import { getSupplierList,getCompanyList,getClientList } from "@/api/common/other"
 export default {
   name: "AddOverviewDialog",
   props: {
@@ -358,15 +397,10 @@
         operationTypeId: [{ required: true, message: "璇烽�夋嫨鍏ュ簱绫诲瀷", trigger: "change" }]
       },
       companyOptions: [], // 鍏徃
+      supplierOptions:[],//渚涘簲鍟�
+      clientOptions:[],//瀹㈡埛
       memberOptions: [{ id: 1, name: "绠$悊鍛�" }],
       toLocationOptions: [], //  婧愪綅缃� 浠撳簱浣嶇疆
-      list: [
-        { label: "鑽夌", status: "todo", value: 1 },
-        { label: "姝e湪绛夊緟", status: "todo", value: 2 },
-        { label: "灏辩华", status: "todo", value: 3 },
-        { label: "瀹屾垚", status: "todo", value: 4 },
-        { label: "宸插彇娑�", status: "todo", value: 5 }
-      ],
       showButton: true,
       activeName: "first",
       productTableList: {},
@@ -375,6 +409,7 @@
       isNoProduct: true, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑�
+      isCancel:false, //楠岃瘉鎸夐挳鏄惁鍙偣鍑�
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨
       currentState: "todo", // 褰撳墠鐘舵��
       detailTableList: {},
@@ -394,13 +429,15 @@
         logisticWeight:0,
       },
       showCancel:false, // 鍙栨秷鏄惁鍙互鏄剧ず
+      list:[],
     }
   },
   created() {
+    this.getCompanyList()
+    this.setStatusList()
     this.setTableForm()
     this.setBottonView()
     this.setDetailTableForm()
-    this.getCompanyList()
     this.getLocationList()
     this.receiptType = this.editConfig.title === "鏌ョ湅" ? this.editConfig.infomation.operationTypeName : this.addName
     if (this.showOperationType) {
@@ -409,14 +446,49 @@
     this.getLogisticCompanyList()
   },
   methods: {
+    setStatusList(){
+      console.log(this.editConfig.infomation,"edit")
+      if(this.editConfig.infomation.status===5){
+        this.list=[
+          { label: "鑽夌", status: "todo", value: 1 },
+          { label: "姝e湪绛夊緟", status: "todo", value: 2 },
+          { label: "灏辩华", status: "todo", value: 3 },
+          { label: "瀹屾垚", status: "todo", value: 4 },
+          { label: "宸插彇娑�", status: "todo", value: 5 }
+        ]
+      }else{
+        this.list=[
+          { label: "鑽夌", status: "todo", value: 1 },
+          { label: "姝e湪绛夊緟", status: "todo", value: 2 },
+          { label: "灏辩华", status: "todo", value: 3 },
+          { label: "瀹屾垚", status: "todo", value: 4 }
+        ]
+      }
+    },
     // 鑾峰彇鍏徃鍒楄〃
     async getCompanyList() {
-      await getCompanyList().then((res) => {
-        console.log(res)
-        if (res.code === 200) {
-          this.companyOptions = res.data
-        }
-      })
+      if(this.workType === 1){
+        await getSupplierList().then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.supplierOptions = res.data
+          }
+        })
+      }else if(this.workType === 2){
+        await getClientList().then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.clientOptions = res.data
+          }
+        })
+      }else{
+        await getCompanyList().then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.companyOptions = res.data
+          }
+        })
+      } 
     },
     // 鑾峰彇浠撳簱浣嶇疆鍒楄〃
     async getLocationList() {
@@ -474,9 +546,11 @@
         }else if(this.editConfig.infomation.status === 3){
           this.isValidateClick = true
           this.showCancel=true
+        }else if(this.editConfig.infomation.status===5){
+          this.isCancel=true
+          this.isValidateClick=true
         }else{
           this.isValidateClick = true
-
         }
       } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "瀹屾垚") {
         this.showButton = true
@@ -485,6 +559,7 @@
         this.showFooter = false
         this.isValidateClick = false
       } else if (this.editConfig.infomation.status === 5) {
+        this.isCancel=true
         this.showButton = true
         this.showEdit = false
         this.showFooter = false
@@ -788,6 +863,19 @@
         })
       }).catch(() => {         
       });
+    },
+    //鎵撳嵃
+    async btnPrint(){
+      await printReceipts(this.editCommonConfig.infomation.id).then((res) => {
+        console.log(res)
+        if (res.code === 200) {
+          this.$message.success("鎵撳嵃鎴愬姛")
+          const link = document.createElement('a');
+          link.href = res.data;
+          link.download = '鍑哄簱鍗�.xlsx';
+          link.click();
+        }
+      })
     }
   }
 }
@@ -804,6 +892,9 @@
     margin-left: auto;
     margin-right: 60px;
     .btn {
+      cursor: pointer;
+    }
+    .btn:nth-of-type(2){
       cursor: no-drop;
     }
   }

--
Gitblit v1.8.0