|
@@ -99,6 +99,7 @@
|
|
|
type="primary"
|
|
|
class="button-primary"
|
|
|
@click="handleSubmit()"
|
|
|
+ :loading="loading"
|
|
|
id="productInfoList-handleSubmit">下推</a-button>
|
|
|
</div>
|
|
|
</a-affix>
|
|
@@ -120,7 +121,8 @@ export default {
|
|
|
salesBillSn: null, // 销售单sn
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
isInster: false, // 是否正在添加产品
|
|
|
- delLoading: false,
|
|
|
+ delLoading: false, // 是否正在移除产品
|
|
|
+ loading: false, // 是否下推中
|
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
|
dataSource: [],
|
|
|
productForm: {
|
|
@@ -215,7 +217,7 @@ export default {
|
|
|
}
|
|
|
const obj = []
|
|
|
_this.selectedRows.map(item => {
|
|
|
- obj.push(item.productSn)
|
|
|
+ obj.push(item.salesBillDetailSn)
|
|
|
})
|
|
|
|
|
|
this.$confirm({
|
|
@@ -245,7 +247,7 @@ export default {
|
|
|
deleteFun (row, type) {
|
|
|
const _this = this
|
|
|
_this.delLoading = true
|
|
|
- deleteBatch({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
|
|
|
+ deleteBatch(type == 0 ? [row.salesBillDetailSn] : row).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.resetSearchForm(true)
|
|
|
_this.$message.success(res.message)
|
|
@@ -265,9 +267,7 @@ export default {
|
|
|
saveNewProduct (list) {
|
|
|
this.$message.loading('正在添加产品...', 1)
|
|
|
this.isInster = true
|
|
|
- insertBatchOfWaitDispatch({
|
|
|
- list: list
|
|
|
- }).then(res => {
|
|
|
+ insertBatchOfWaitDispatch(list).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.resetSearchForm()
|
|
|
this.$refs.partQuery.resetCurForm()
|
|
@@ -303,11 +303,17 @@ export default {
|
|
|
},
|
|
|
// 提交下推
|
|
|
handleSubmit () {
|
|
|
- pushDown({ salesBillSn: this.salesBillSn }).then(res => {
|
|
|
+ this.delLoading = true
|
|
|
+ this.isInster = true
|
|
|
+ this.loading = true
|
|
|
+ pushDown({ salesBillSn: this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.handleBack()
|
|
|
this.$message.success(res.message)
|
|
|
}
|
|
|
+ this.delLoading = false
|
|
|
+ this.isInster = false
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
}
|
|
|
},
|