|
@@ -37,7 +37,7 @@
|
|
|
<a-card size="small" :bordered="false" class="salesReturnEdit-cont">
|
|
|
<!-- <div>已入库产品信息</div>
|
|
|
<a-divider /> -->
|
|
|
- <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct" @bachAdd="saveMoreProduct"></queryPart>
|
|
|
+ <queryPart ref="partQuery" :newLoading="isInster" :addMoreLoading="addMoreLoading" @add="saveProduct" @bachAdd="saveMoreProduct"></queryPart>
|
|
|
</a-card>
|
|
|
<a-card size="small" :bordered="false" class="salesReturnEdit-cont">
|
|
|
<a-alert style="margin-bottom: 10px;" type="info">
|
|
@@ -247,7 +247,8 @@ export default {
|
|
|
},
|
|
|
openModal: false, // 修改信息弹窗
|
|
|
statisticsObj: null, // 统计明细
|
|
|
- detailsData: null// 基础信息数据
|
|
|
+ detailsData: null, // 基础信息数据
|
|
|
+ addMoreLoading: false// 批量添加动画
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -283,12 +284,14 @@ export default {
|
|
|
},
|
|
|
resetTable (flag) {
|
|
|
this.$refs.table.refresh(flag)
|
|
|
+ this.$refs.partQuery.refreshTable()
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm (flag) {
|
|
|
this.productForm.productName = ''
|
|
|
this.productForm.productCode = ''
|
|
|
this.$refs.table.refresh(!!flag)
|
|
|
+ this.$refs.partQuery.refreshTable()
|
|
|
},
|
|
|
// 已选产品 blur
|
|
|
onCellBlur (val, record) {
|
|
@@ -336,10 +339,14 @@ export default {
|
|
|
sparePartsNo: row.sparePartsNo,
|
|
|
sparePartsSn: row.sparePartsSn
|
|
|
}
|
|
|
- this.spinning = true
|
|
|
this.saveEdit(paramsData)
|
|
|
},
|
|
|
saveMoreProduct (data) {
|
|
|
+ if (this.addMoreLoading) {
|
|
|
+ // 防止多次添加产品
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.addMoreLoading = true
|
|
|
var ajax_data = []
|
|
|
data.forEach(item => {
|
|
|
const obj = {
|
|
@@ -364,12 +371,14 @@ export default {
|
|
|
this.saveEdit(ajax_data)
|
|
|
},
|
|
|
saveEdit (params) {
|
|
|
+ this.spinning = true
|
|
|
sparePartsReturnDetailSave(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.resetSearchForm(true)
|
|
|
}
|
|
|
this.isInster = false
|
|
|
this.spinning = false
|
|
|
+ this.addMoreLoading = false
|
|
|
})
|
|
|
},
|
|
|
beforeSubmit () {
|