فهرست منبع

fix(goodsDetail): 更新收货逻辑,增加状态3的判断并传递detailType

xieyong 1 روز پیش
والد
کامیت
213b9021dd
2فایلهای تغییر یافته به همراه12 افزوده شده و 7 حذف شده
  1. 9 4
      src/views/entrust/components/goodsDetail.vue
  2. 3 3
      src/views/entrust/index.vue

+ 9 - 4
src/views/entrust/components/goodsDetail.vue

@@ -41,7 +41,7 @@
         <el-input
           placeholder=""
           v-model="row.receiveQuantity"
-          :disabled="type == 'receipt' && itemData.sendStatus == 4"
+          :disabled="type == 'receipt' && (itemData.sendStatus == 4 || itemData.sendStatus == 3)"
         >
           <template slot="append">{{ row.measuringUnit }}</template>
         </el-input>
@@ -230,16 +230,16 @@
         return this.statusMap[Number(status)] || { label: '驳回', type: 'success' };
       },
 
-      open(item, type) {
+      open(item, type, detailType) {
         this.visible = true;
         this.type = type;
         this.title = this.type != 'receipt' ? '发货单' : '收货单';
         this.itemData = item;
         this.id = item.id;
-        this.getDetail(item.id);
+        this.getDetail(item.id, detailType);
       },
 
-      async getDetail(id) {
+      async getDetail(id, type) {
         let detailType = this.type == 'receipt' ? 2 : 1;
         const params = {
           id,
@@ -249,10 +249,15 @@
           params.detailType = 1;
         }
 
+        //用type来区分收货详情与收货 存在type则是收货
         if(this.type === "receipt") {
           params.detailType = 4;
         }
 
+        if(this.type === 'receipt' && type) {
+          params.detailType = type;
+        }
+
         await pleaseEntrustGoodsDetail(params).then(async (res) => {
           this.goodsList = [];
           res.data.forEach((item) => {

+ 3 - 3
src/views/entrust/index.vue

@@ -158,7 +158,7 @@
           <el-link
             type="primary"
             :underline="false"
-            @click="sendGoods(row, 'receipt')"
+            @click="sendGoods(row, 'receipt', 3)"
             v-if="row.approvalStatus == 2 && row.sendStatus == 3"
           >
             收货
@@ -695,8 +695,8 @@
         });
       },
 
-      sendGoods(item, type) {
-        this.$refs.goodsDetailRef.open(item, type);
+      sendGoods(item, type, detailType) {
+        this.$refs.goodsDetailRef.open(item, type, detailType);
       },
 
       fullscreenChange(fullscreen) {