From a99b4aeb7e61be31a7dad81719a4e2102b284963 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期二, 26 三月 2024 09:50:17 +0800
Subject: [PATCH] 采购管理:到货确认添加全部合格入库

---
 src/api/purchaseManage/purchase.js                                   |    8 ++++
 src/views/purchaseManage/purchase/index.vue                          |   13 +++---
 src/views/purchaseManage/purchase/components/TestingAll.vue          |   13 ++++--
 src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue |   29 ++++++++++++--
 4 files changed, 49 insertions(+), 14 deletions(-)

diff --git a/src/api/purchaseManage/purchase.js b/src/api/purchaseManage/purchase.js
index 6e1941b..a7d1d89 100644
--- a/src/api/purchaseManage/purchase.js
+++ b/src/api/purchaseManage/purchase.js
@@ -179,3 +179,11 @@
     data
   })
 }
+// 鍏ㄩ儴鍚堟牸鍏ュ簱
+export function allProductInWarehouse(data) {
+  return request({
+    url: "/api/purchase/allProductInWarehouse",
+    method: "post",
+    data
+  })
+}
diff --git a/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue b/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue
index e2698a9..7b9476a 100644
--- a/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue
+++ b/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue
@@ -18,8 +18,8 @@
         <el-button size="small" v-if="this.editConfig.title != '鏌ョ湅'" @click="editConfig.visible = false">鍙栨秷</el-button>
         <el-button type="primary"  size="small"
           @click="saveClick('form')">纭鏀惰揣</el-button>
-        <!-- <el-button type="primary"  size="small"
-          @click="saveOkClickAll('form')">鍏ㄩ儴鍚堟牸鍏ュ簱</el-button> -->
+        <el-button type="primary"  size="small"
+          @click="saveOkClickAll('form')">鍏ㄩ儴鍚堟牸鍏ュ簱</el-button>
       </div>
     </el-dialog>
   </div>
@@ -28,7 +28,8 @@
 <script>
 import {
   getPurchaseProductConfirmInfo,
-  savePurchaseProductConfirm
+  savePurchaseProductConfirm,
+  allProductInWarehouse
 } from "@/api/purchaseManage/purchase"
 import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 export default {
@@ -124,7 +125,27 @@
       }
     },
     // 鍏ㄩ儴鍚堟牸鍏ュ簱
-    saveOkClickAll(){
+    async saveOkClickAll(){
+      let pipeline=false // 鏄惁鏈夊ぇ浜�0鐨勬敹璐ф暟閲�
+      // let rule1=false    // 鏈鏀惰揣鏄惁澶т簬鏈敹璐ф暟閲�
+      // let arr=[]
+      this.productTableList.tableData.map((item)=>{
+        if(item.nowReceiveAmount>0&&item.nowReceiveAmount<=item.notReceiveAmount){
+          pipeline=true
+          // arr.push(item)
+        }
+      })
+      if(pipeline){
+        await allProductInWarehouse(this.productTableList.tableData).then((res)=>{
+          if(res.code===200){
+            this.editConfig.visible=false
+            this.$parent.getData()
+            this.$message.success("纭鍏ュ簱璐ㄦ鎴愬姛锛�")
+          }
+        })
+      }else{
+        this.$message.warning("鏈鏀惰揣鏁伴噺涓嶈兘涓�0涓斾笉鑳借秴鍑烘湭鏀惰揣鏁伴噺 ")
+      }
 
     },
     saveParams() {
diff --git a/src/views/purchaseManage/purchase/components/TestingAll.vue b/src/views/purchaseManage/purchase/components/TestingAll.vue
index 524eba6..a10a971 100644
--- a/src/views/purchaseManage/purchase/components/TestingAll.vue
+++ b/src/views/purchaseManage/purchase/components/TestingAll.vue
@@ -2,9 +2,9 @@
   <div class="add-quotation">
     <el-dialog :visible.sync="editConfig.visible" width="70%" append-to-body custom-class="iframe-dialog">
       <el-header>
-        <el-button type="primary" v-if="this.editConfig.title != '鏌ョ湅'" size="small"
+        <el-button type="primary" :disabled="isDisabled"  size="small"
           @click="saveClick()">鎵归噺鍚堟牸鍏ュ簱</el-button>
-        <el-button type="primary" v-if="this.editConfig.title != '鏌ョ湅'" size="small"
+        <el-button type="primary" :disabled="isDisabled"  size="small"
           @click="saveNoClick()">鎵归噺涓嶅悎鏍�</el-button>
       </el-header>
       <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini"
@@ -18,8 +18,8 @@
 
               <template slot="tableButton">
                 <el-table-column label="鎿嶄綔" width="120" align="center">
-                  <template slot-scope="scope">
-                    <el-button type="text" size="small" @click="saveClick(scope.row)"
+                  <template slot-scope="scope"  v-if="scope.row.status==1" >
+                    <el-button type="text"  size="small" @click="saveClick(scope.row)"
                       style="margin-right: 5px">鍚堟牸</el-button>
                     <el-button type="text" size="small" @click="saveNoClick(scope.row)"
                       style="margin-right: 5px">涓嶅悎鏍�</el-button>
@@ -100,6 +100,7 @@
       thatTimes: [],
       selectList: [],
       qualityStatusList: getDataByType("qualityStatus"),
+      isDisabled:false,
     }
   },
   created() {
@@ -221,8 +222,12 @@
     async getPurchaseQualityInspectionInfo(params) {
       await getPurchaseQualityInspectionInfo(params).then((res) => {
         this.timeList = []
+        this.isDisabled=true // 鍒ゆ柇鏈夋病鏈夊緟璐ㄦ鐨�
         res.data.map((item) => {
           this.timeList.push({ id: item.createTime, name: item.createTime })
+          if(item.status===1){
+            this.isDisabled=false
+          }
         })
         this.setTableForm()
         this.productTableList.tableData = res.data
diff --git a/src/views/purchaseManage/purchase/index.vue b/src/views/purchaseManage/purchase/index.vue
index 53d8dad..08caf16 100644
--- a/src/views/purchaseManage/purchase/index.vue
+++ b/src/views/purchaseManage/purchase/index.vue
@@ -166,9 +166,9 @@
   data() {
     // 浜у搧淇℃伅
     const productColumn = [
-      { label: "浜у搧缂栧彿", prop: "number", default: true },
-      { label: "浜у搧鍚嶇О", prop: "name" },
-      { label: "瑙勬牸", prop: "specifications" },
+      { label: "浜у搧缂栧彿", prop: "productId", default: true },
+      { label: "浜у搧鍚嶇О", prop: "productName" },
+      { label: "瑙勬牸", prop: "specs" },
       { label: "鍨嬪彿", prop: "modelNumber" },
       { label: "閲囪喘鏁伴噺", prop: "amount" },
       { label: "宸插彂璐ф暟閲�", prop: "sendAmount" },
@@ -250,7 +250,7 @@
       showCol: ["閲囪喘鍗曞彿", "閲囪喘鍗曞悕绉�", "鍗曟嵁绫诲瀷", "渚涘簲鍟嗗悕绉�", "閲囪喘鏁伴噺", "鏀惰揣浠撳簱", "缁忓姙浜�", "鍒跺崟浜�"],
       tableBottomColumn: [],
       showBottomCol: [],
-      TabsIndex: "0",
+      TabsIndex: 0,
       productTableList: {},
       // 浜у搧淇℃伅
       productColumn: productColumn,
@@ -369,7 +369,8 @@
             this.pagerOptions.totalCount = res.data.total
             if (res.data.total > 0) {
               this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
-              this.tableRowClick(this.selectRow)
+              // this.tableRowClick(this.selectRow)
+              this.getProductInventoryInfo(this.selectRow)
             }
           }
         })
@@ -687,7 +688,7 @@
         })
       } else if (this.TabsIndex == 1 && row.status == 1) {
         this.productTableList.tableInfomation = []
-      } else if(this.TabsIndex==1 && row.status==7||row.status==8){
+      } else if(this.TabsIndex==1 && row.status==7||this.TabsIndex==1&&row.status==8){
         getPurchaseQualityInspectionInfo({
             purchaseNumber: row.number,
           }).then((res)=>{

--
Gitblit v1.8.0