From d24f61ea88ac2e2fbd74be059db78107847930c8 Mon Sep 17 00:00:00 2001
From: kilo <wan.ren@foxmail.com>
Date: Wed, 11 Oct 2023 14:19:33 +0800
Subject: [PATCH] =?UTF-8?q?=E9=9B=B6=E6=8B=85=E8=AE=A2=E5=8D=95=E6=93=8D?=
 =?UTF-8?q?=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../distribution/distributionReservation.js   | 13 +++
 .../reservation/reservationAddFrom.vue        | 80 +++++++++++++------
 2 files changed, 67 insertions(+), 26 deletions(-)

diff --git a/src/api/distribution/distributionReservation.js b/src/api/distribution/distributionReservation.js
index 8545d925..569b6cc0 100644
--- a/src/api/distribution/distributionReservation.js
+++ b/src/api/distribution/distributionReservation.js
@@ -209,6 +209,19 @@ export const patchPrintList = (ids) => {
   });
 }
 
+/**
+ * 查询预约计划零担详情
+ * @param ids
+ * @returns {AxiosPromise}
+ */
+export const getReservationZeroOrderDetail = (reservationId,id) => {
+  return request({
+    url: '/api/logpm-distribution/reservation/getReservationZeroOrderDetail',
+    method: 'get',
+    params: { id,reservationId }
+  });
+}
+
 
 
 
diff --git a/src/views/distribution/reservation/reservationAddFrom.vue b/src/views/distribution/reservation/reservationAddFrom.vue
index b85c0104..44baf8d2 100644
--- a/src/views/distribution/reservation/reservationAddFrom.vue
+++ b/src/views/distribution/reservation/reservationAddFrom.vue
@@ -317,26 +317,33 @@
                     title="零担订单信息"
                     width="50%"
                     :model="zeroOrderData">
-                <div v-for="(item,index) in zeroOrderData" :key="index">
-                    <el-row :gutter="24" class="rows">
-                        <el-col :xl="4" :lg="7" :md="8" :sm="24">
-                            <span>名称:{{item.firsts }} </span>
-                        </el-col>
-                        <el-col :xl="4" :lg="7" :md="8" :sm="24">
-                            <span>总数量:{{item.quantity }} </span>
-                        </el-col>
-                        <el-col :xl="4" :lg="7" :md="8" :sm="24">
-                            <span>在库数量:{{item.handQuantity }} </span>
-                        </el-col>
-                        <el-col :xl="4" :lg="7" :md="8" :sm="24">
-                            <span>出库数量:{{item.outboundQuantity }} </span>
-                        </el-col>
-                        <el-col :xl="4" :lg="7" :md="8" :sm="24">
-                            <span>可用数量:{{(item.handQuantity - item.outboundQuantity)}} </span>
-                        </el-col>
-                    </el-row>
-                    <el-input v-model="zeroPackageNum"  placeholder="请输入预约数量"></el-input>
-                </div>
+                <template v-if="zeroOrderData != null">
+                    <div v-for="(item,index) in zeroOrderData" :key="index" >
+                        <el-row :gutter="24" class="rows">
+                            <el-col :xl="4" :lg="7" :md="8" :sm="24">
+                                <span>名称:{{item.firsts }}</span>
+                            </el-col>
+                            <el-col :xl="4" :lg="7" :md="8" :sm="24">
+                                <span>总数量:{{item.quantity }} </span>
+                            </el-col>
+                            <el-col :xl="4" :lg="7" :md="8" :sm="24">
+                                <span>在库数量:{{item.handQuantity }} </span>
+                            </el-col>
+                            <el-col :xl="4" :lg="7" :md="8" :sm="24">
+                                <span>冻结数量:{{item.deliveryQuantity }} </span>
+                            </el-col>
+                            <el-col :xl="4" :lg="7" :md="8" :sm="24">
+                                <span>出库数量:{{item.outboundQuantity }} </span>
+                            </el-col>
+                            <el-col :xl="4" :lg="7" :md="8" :sm="24">
+                                <!--                            <span>可用数量:{{(item.handQuantity - item.outboundQuantity)}}</span>-->
+                                <span>可用数量:{{(item.quantity)}}</span>
+                            </el-col>
+                        </el-row>
+                        <el-input-number v-model="item.reservationNum" min="0" :max="item.quantity"  placeholder="请输入预约数量"></el-input-number>
+                        <!--                    <el-input-number v-model="item.reservationNum" min="0" :max="item.quantity - item.deliveryQuantity -item.outboundQuantity "  placeholder="请输入预约数量"></el-input-number>-->
+                    </div>
+                </template>
                 <el-form-item style="margin-left: 37%; margin-top: 5px">
                     <el-button type="primary" icon="el-icon-circle-close" @click="onSubmitZeroOrder"
                     >提交(零担订单)
@@ -560,7 +567,7 @@
     autonomouslySave,
     update,
     remove,
-    getReservationInfo
+    getReservationInfo, getReservationZeroOrderDetail
   } from '@/api/distribution/distributionReservation';
   import {
     getStockArticleList,
@@ -1702,6 +1709,7 @@
         deliveryTypeData: [],
         //增值服务列表
         addvalueServeType: [],
+        obj: {},
         //增值表单输入框对象
         addvalue: {},
         costList: [], //字典
@@ -1719,7 +1727,7 @@
         orderShow: false,
         zeroOrderData:[],
         zeroOrderShow: false,
-        zeroPackageNum:0,
+        // zeroPackageNum:0,
         //在库订单信息
         stockArticleInfo: [],
         //库存品信息
@@ -1973,9 +1981,23 @@
         this.onLoad(this.page);
       },
       viewStockArticlePackage(row) {
-        getZeroOrderDetail(row.id).then(res=>{
-          this.zeroOrderData =res.data.data;
-        })
+        this.obj = row;
+        if (this.reservationId){
+          //查询零担计划数量详情
+          console.log("order------------>",row.id);
+          getReservationZeroOrderDetail(this.reservationId,row.id).then(res=>{
+            this.zeroOrderData =res.data.data;
+            // console.log(res.data.data);
+          })
+
+        }else {
+          getZeroOrderDetail(row.id).then(res=>{
+            if (res.data.data != null){
+              this.zeroOrderData =res.data.data;
+            }
+          })
+        }
+
         this.zeroOrderShow = true;
       },
       checkPackage(row, index) {
@@ -2265,7 +2287,13 @@
         // }
       },
       onSubmitZeroOrder(){
-        console.log("this.aaa------------->",this.zeroPackageNum);
+        this.orderData.forEach(item=>{
+          if (this.obj.id === item.id){
+            item.parcelNumberVOS = this.zeroOrderData;
+          }
+        })
+        this.zeroOrderShow = false;
+        console.log("this.orderData------------->",this.orderData);
       },
       // 增加库存品
       onSubmitInventory() {