|
@@ -15,8 +15,8 @@
|
|
|
ref="partQuery"
|
|
|
:newLoading="isInster"
|
|
|
@cancelProduct="cancelProduct"
|
|
|
- @cancelAll = "cancelAll"
|
|
|
- @convertPromoGifts = "convertPromoGifts"
|
|
|
+ @cancelAll="cancelAll"
|
|
|
+ @convertPromoGifts="convertPromoGifts"
|
|
|
@addProduct="insterProduct"></queryPart>
|
|
|
</a-card>
|
|
|
<a-card size="small" :bordered="false" class="waitDispatch-cont">
|
|
@@ -28,6 +28,7 @@
|
|
|
|
|
|
<!-- 已选配件列表 -->
|
|
|
<detailProductList ref="waitProduct" @refashTable="refashTable">
|
|
|
+ <!-- 统计数据 -->
|
|
|
<template slot="total">
|
|
|
本次下推款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
|
|
|
本次下推数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
|
|
@@ -44,7 +45,7 @@
|
|
|
class="button-primary"
|
|
|
@click="handleDispatch()"
|
|
|
:loading="loading"
|
|
|
- id="productInfoList-handleSubmit">下推</a-button>
|
|
|
+ id="waitDispatch-handleSubmit">下推</a-button>
|
|
|
</div>
|
|
|
<!-- 下推 -->
|
|
|
<dsModal ref="dsModal" :openModal="showDsModal" @close="showDsModal=false" @ok="handleSubmit" />
|
|
@@ -57,6 +58,7 @@ import { VSelect } from '@/components'
|
|
|
import queryPart from './queryPart.vue'
|
|
|
import detailProductList from './detailProductList.vue'
|
|
|
import dsModal from './dsModal.vue'
|
|
|
+// 接口
|
|
|
import { salesDetailBySn } from '@/api/salesNew'
|
|
|
import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty, salesDetailCancleOfAll, batchTransferOfPurchaseAmount } from '@/api/salesDetailNew'
|
|
|
import { pushDown } from '@/api/waitDispatchDetail'
|
|
@@ -68,7 +70,7 @@ export default {
|
|
|
components: { detailProductList, VSelect, queryPart, dsModal },
|
|
|
data () {
|
|
|
return {
|
|
|
- showDsModal: false,
|
|
|
+ showDsModal: false, // 下推弹框
|
|
|
spinning: false,
|
|
|
salesBillSn: null, // 销售单sn
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
@@ -77,12 +79,16 @@ export default {
|
|
|
loading: false, // 是否下推中
|
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
|
productForm: {
|
|
|
- dispatchBillSn: ''
|
|
|
+ dispatchBillSn: '' // 下推单sn
|
|
|
},
|
|
|
- totalData: null
|
|
|
+ totalData: null // 统计数据
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 返回
|
|
|
+ handleBack () {
|
|
|
+ this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
|
|
|
+ },
|
|
|
// 统计查询
|
|
|
getTotalData (flag) {
|
|
|
findBySalesBillSn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
|
|
@@ -91,9 +97,9 @@ export default {
|
|
|
if (res.data && Object.keys(res.data).length > 0) {
|
|
|
this.productForm.dispatchBillSn = res.data.dispatchBillSn
|
|
|
const _this = this
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
_this.$refs.waitProduct.pageInit(this.productForm, this.detailData, this.$refs.partQuery.activeList)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
_this.$refs.waitProduct.resetSearchForm()
|
|
|
}
|
|
|
}
|
|
@@ -102,10 +108,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 返回
|
|
|
- handleBack () {
|
|
|
- this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
|
|
|
- },
|
|
|
// 添加产品
|
|
|
insterProduct (list) {
|
|
|
// 防止多次添加产品
|
|
@@ -133,16 +135,16 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 整单取消
|
|
|
- cancelAll(){
|
|
|
- salesDetailCancleOfAll({salesBillSn: this.salesBillSn}).then(res=>{
|
|
|
- if(res.status == 200){
|
|
|
+ cancelAll () {
|
|
|
+ salesDetailCancleOfAll({ salesBillSn: this.salesBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
this.handleBack()
|
|
|
this.$message.success(res.message)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 批量转采购额
|
|
|
- convertPromoGifts(list){
|
|
|
+ convertPromoGifts (list) {
|
|
|
this.$message.loading('正在批量转采购额...', 1)
|
|
|
this.isInster = true
|
|
|
this.spinning = true
|
|
@@ -180,9 +182,10 @@ export default {
|
|
|
this.isInster = false
|
|
|
})
|
|
|
},
|
|
|
- refashTable(flag){
|
|
|
+ // 刷新表格
|
|
|
+ refashTable (flag) {
|
|
|
this.getTotalData()
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
this.getOrderDetail(false)
|
|
|
}
|
|
|
},
|
|
@@ -191,9 +194,11 @@ export default {
|
|
|
salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.detailData = res.data
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
+ // 初始化表格
|
|
|
this.$refs.partQuery.pageInit(this.salesBillSn, this.detailData)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
+ // 刷新表格
|
|
|
this.$refs.partQuery.resetSearchForm(this.detailData)
|
|
|
}
|
|
|
}
|
|
@@ -203,6 +208,7 @@ export default {
|
|
|
handleDispatch () {
|
|
|
const dataSource = this.$refs.waitProduct.dataSource
|
|
|
if (dataSource.length) {
|
|
|
+ // 打开下推弹框
|
|
|
this.showDsModal = true
|
|
|
this.detailData.dispatchBillCount = this.totalData.dispatchBillCount
|
|
|
this.detailData.receiverName = this.totalData.receiverName ? this.totalData.receiverName : ''
|
|
@@ -230,21 +236,7 @@ export default {
|
|
|
this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
- // 一键下推
|
|
|
- oneDispatch () {
|
|
|
- this.isInster = true
|
|
|
- this.spinning = true
|
|
|
- salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.resetSearchForm()
|
|
|
- this.$refs.partQuery.resetCurForm()
|
|
|
- this.spinning = false
|
|
|
- } else {
|
|
|
- this.spinning = false
|
|
|
- }
|
|
|
- this.isInster = false
|
|
|
- })
|
|
|
- },
|
|
|
+ // 页面初始化
|
|
|
pageInit () {
|
|
|
this.$refs.partQuery.clearSelectTable()
|
|
|
this.salesBillSn = this.$route.params.salesBillSn
|