|
@@ -192,7 +192,8 @@ import {
|
|
|
salesReturnDetailInsert,
|
|
|
salesReturnDetailUpdateQty,
|
|
|
salesReturnDetailUpdateReason,
|
|
|
- salesReturnDetailSetReason
|
|
|
+ salesReturnDetailSetReason,
|
|
|
+ salesReturnUpdateAllReason
|
|
|
} from '@/api/salesReturnDetail'
|
|
|
export default {
|
|
|
name: 'SalesReturnEdit',
|
|
@@ -388,32 +389,33 @@ export default {
|
|
|
if (!this.plReturnReason) {
|
|
|
this.$message.warning('请选择退货原因!')
|
|
|
} else {
|
|
|
- // 批量设置
|
|
|
- if(this.selNums){
|
|
|
- this.spinning = true
|
|
|
- const snList = []
|
|
|
- const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
- const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
|
|
|
- arr.map(item => {
|
|
|
- snList.push(item.salesReturnDetailSn)
|
|
|
- })
|
|
|
- salesReturnDetailSetReason({
|
|
|
- salesReturnBillDetailSnList: snList,
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
|
|
|
+ const params = {
|
|
|
salesReturnBillSn: this.orderSn,
|
|
|
returnReason: rows ? rows.dispName : '',
|
|
|
returnReasonCode: this.plReturnReason,
|
|
|
returnReasonRemarks: this.showEditRemarks ? this.plReturnRemark || '' : undefined
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.showPlModal = false
|
|
|
- this.$refs.table.clearSelected()
|
|
|
- this.resetTable(false)
|
|
|
- }
|
|
|
- this.spinning = false
|
|
|
- })
|
|
|
- }else{
|
|
|
- // 整单设置
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 批量或整单设置
|
|
|
+ const funs = this.selNums ? salesReturnDetailSetReason : salesReturnUpdateAllReason
|
|
|
+
|
|
|
+ // 批量设置
|
|
|
+ if(this.selNums){
|
|
|
+ const snList = []
|
|
|
+ const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
+ arr.map(item => snList.push(item.salesReturnDetailSn))
|
|
|
+ params.salesReturnBillDetailSnList = snList
|
|
|
+ }
|
|
|
+
|
|
|
+ this.spinning = true
|
|
|
+ funs(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.showPlModal = false
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
+ this.resetTable(false)
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 获取单据详细
|