lilei 6 mesi fa
parent
commit
ddabd13e4d

+ 5 - 3
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -303,12 +303,14 @@ export default {
       this.searchTable()
     },
     // 显示第三方库存
-    showThreeStock () {
-      this.showStockCol = true
+    showThreeStock (flag) {
+      this.showStockCol = flag
+      if (flag) {
+        this.searchTable()
+      }
     },
     // 当满足发货经销商显示条件时  查询
     transferTableData (list) {
-      console.log(list, this.warehouseSn)
       this.dataSource = list.filter(item => this.warehouseSn != '' ? item.warehouseSn == this.warehouseSn : true).filter(item => {
         if (this.transferQty == '0') { // 不满足
           return (!item.transferDealerStockQty || (item.transferDealerStockQty && item.transferDealerStockQty * 1 < item.qty * 1))

+ 25 - 18
src/views/salesManagement/salesQueryNew/detail.vue

@@ -123,16 +123,15 @@
               </a-form>
             </div>
             <div>
-              <span v-if="selectedDealer">发货经销商:{{ selectedDealer }}</span>
+              <span v-if="selectedDealer">发货经销商:{{ selectedDealer }}</span>
               <a-button
                 id="salesDetail-updateStock"
                 type="link"
                 v-if="showTransferDealer"
-                style="margin:0 10px;"
                 @click="openDealerModal"
                 class="button-dealerStock">选择发货经销商</a-button>
-              <a-button id="salesDetail-updateStock" type="primary" v-if="showStock" @click="getThreeStock" class="button-info">第三方库存</a-button>
               <a-button id="salesDetail-stockOut" v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
+              <a-checkbox id="salesDetail-updateStock" @change="e=>getThreeStock(e)" v-if="showStock"><span style="display: inline-block;margin-top: 1px;">第三方库存</span></a-checkbox>
               <a-checkbox id="salesDetail-cityPrice" v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
             </div>
           </div>
@@ -224,9 +223,8 @@
         转单
       </a-button>
       <a-button
-        type="primary"
+        type="default"
         class="button-info"
-        ghost
         :disabled="spinning"
         style="width: 100px;margin: 0 10px;"
         id="salesDetail-edit-btn"
@@ -238,8 +236,7 @@
       <a-button
         style="width: 100px;margin: 0 10px;"
         :disabled="spinning"
-        type="primary"
-        ghost
+        type="default"
         id="salesDetail-edit1-btn"
         v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE'||detailData.billStatus == 'SUPERIOR_AUDIT_REJECT' || detailData.billStatus == 'TRANSFER_AUDIT_REJECT')&&$hasPermissions('B_salesEdit')"
         @click="handleChangeOrder()"
@@ -251,7 +248,6 @@
         :disabled="spinning"
         type="primary"
         class="button-info"
-        ghost
         id="salesDetail-UPaudit-btn"
         v-if="detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'SUPERIOR_AUDIT_REJECT' || detailData.billStatus == 'TRANSFER_AUDIT_REJECT')&&$hasPermissions('B_salesAudit')&&$route.params.pageType!='salesNewDetailTransfer'"
         @click="handleAudit()"
@@ -429,7 +425,7 @@ export default {
     showConvertPromoGifts () {
       return this.activeList && this.activeList.filter(item => item.enabledFlag == 1).find(item => item.promotionRule && item.promotionRule.convertExpenseFlag == 1 && item.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD')
     },
-    // 是否显示库存列
+    // 是否显示三方库存列
     showStock () {
       return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
     },
@@ -525,8 +521,10 @@ export default {
       this.$router.push({ name: 'salesNewEdit', params: { sn: this.$route.params.sn || this.bizSn } })
     },
     // 查询第三方库存
-    getThreeStock () {
-      this.$refs.productList.showThreeStock()
+    getThreeStock (e) {
+      this.hideActiveTable = this.activeList.length == 0
+      this.$refs.productList.showThreeStock(e.target.checked)
+      if (!this.hideActiveTable) this.$refs.productActiveList.showThreeStock(e.target.checked)
     },
     //  重置
     resetSearchForm () {
@@ -570,11 +568,11 @@ export default {
       this.spinning = false
       setTimeout(() => {
         this.resetSearchForm()
-      }, 500)
+      }, 300)
     },
     // 打开缺货明细弹框
     openStockOut () {
-      if (this.$refs.productList.outStockStr != '') {
+      if (this.$refs.productList.outStockStr != '' || this.activeList.length && this.$refs.productActiveList.outStockStr != '') {
         this.showStockOut = true
       } else {
         this.$info({
@@ -589,13 +587,16 @@ export default {
       this.$emit('close')
       this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
     },
-    // 验证转单
+    // 转单
     handleOrder () {
       const _this = this
       if (!_this.selectedDealerSn) {
         _this.$message.warning('请选择发货经销商!')
+        _this.openDealerModal()
         return
       }
+      _this.spinning = true
+      // 验证
       transferVerify({ salesBillSn: _this.$route.params.sn, transferDealerSn: _this.selectedDealerSn }).then(res => {
         if (res.status == 200) {
           if (res.data && Object.keys(res.data).length) {
@@ -606,9 +607,12 @@ export default {
               closable: true,
               okText: '提交',
               onOk () {
-                _this.spinning = true
+                _this.spinning = false
                 // 验证成功
                 _this.handleTransfer()
+              },
+              onCancel () {
+                _this.spinning = false
               }
             })
           } else {
@@ -617,22 +621,23 @@ export default {
         }
       })
     },
-    // 转单
+    // 提交转单
     handleTransfer () {
+      this.spinning = true
       transfer({ salesBillSn: this.$route.params.sn, transferDealerSn: this.selectedDealerSn }).then(res => {
         if (res.status == 200) {
-          this.spinning = false
           this.$message.success(res.message)
           //  转单成功 关闭详情跳列表
           this.handleBack()
         }
+        this.spinning = false
       })
     },
     // 打开 转单审核弹窗
     handleTransferAudit () {
       this.openTransferOrder = true
     },
-    // 转单审核
+    // 确认转单审核
     transferOrderAuditOk (val) {
       transferAudit({ salesBillSn: this.$route.params.sn, auditPassFlag: val }).then(res => {
         if (res.status == 200) {
@@ -770,9 +775,11 @@ export default {
         // 一键审核成功
         this.showDsModal = true
         this.$refs.dsModal.setDetail(this.detailData)
+        this.spinning = false
       } else {
         this.auditText = null
         this.visibleAudit = true
+        this.spinning = false
       }
     },
     // 一键审核确定