lilei 1 سال پیش
والد
کامیت
b4977adc50

+ 8 - 0
src/api/salesDetailNew.js

@@ -32,6 +32,14 @@ export const salesDetailBatchDel = (params) => {
     method: 'post'
   })
 }
+// 批量转采购额
+export const batchTransferOfPurchaseAmount = (params) => {
+  return axios({
+    url: `/sales/detail/batchTransferOfPurchaseAmount`,
+    data: params,
+    method: 'post'
+  })
+}
 // 仓库设置
 export const updateWarehouse = (params) => {
     return axios({

+ 21 - 1
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -15,6 +15,7 @@
           :newLoading="isInster"
           @cancelProduct="cancelProduct"
           @cancelAll = "cancelAll"
+          @convertPromoGifts = "convertPromoGifts"
           @addProduct="insterProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="waitDispatch-cont">
@@ -56,7 +57,7 @@ import queryPart from './queryPart.vue'
 import detailProductList from './detailProductList.vue'
 import dsModal from './dsModal.vue'
 import { salesDetailBySn } from '@/api/salesNew'
-import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty, salesDetailCancleOfAll } from '@/api/salesDetailNew'
+import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty, salesDetailCancleOfAll, batchTransferOfPurchaseAmount } from '@/api/salesDetailNew'
 import { pushDown } from '@/api/waitDispatchDetail'
 import { findBySalesBillSn } from '@/api/dispatch'
 
@@ -139,6 +140,25 @@ export default {
         }
       })
     },
+    // 批量转采购额
+    convertPromoGifts(list){
+      this.$message.loading('正在批量转采购额...', 1)
+      this.isInster = true
+      this.spinning = true
+      batchTransferOfPurchaseAmount({
+        salesBillDetailList: list,
+        salesBillSn: this.salesBillSn
+      }).then(res => {
+        if (res.status == 200) {
+          this.getOrderDetail()
+          this.$message.success(res.message, 2.5)
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+        this.isInster = false
+      })
+    },
     // 批量取消产品
     cancelProduct (list) {
       // 防止多次添加产品

+ 4 - 1
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -29,6 +29,9 @@
                 <a-select-option value="GIFT">
                   促销产品
                 </a-select-option>
+                <a-select-option value="GIFT" v-if="hasConvertPromoGifts">
+                  促销产品(转采购额)
+                </a-select-option>
                 <a-select-option value="GATE">
                   门槛产品
                 </a-select-option>
@@ -70,7 +73,7 @@
     <div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
       <div style="display: flex;align-items: center;">
         <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
-        <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlPurchase">批量转采购额</a-button>
+        <a-button type="primary" :disabled="newLoading" class="button-info" v-if="hasConvertPromoGifts" @click="handlePlPurchase">批量转采购额</a-button>
         <a-button type="primary" v-if="hasNormalProduct" ghost style="margin-left:6px;" :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
         <a-button type="primary" v-if="hasPrompActive&&hasNoPushedActive" ghost style="margin-left:6px;" :disabled="newLoading" @click="handleAllCancel">整单取消</a-button>
         <a-tooltip placement="top" v-if="hasPrompActive&&hasNoPushedActive" style="margin-left:6px;">

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.2.111:8602/ocs-admin',
+        target: 'http://192.168.2.113:8660/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,