Commit 8ab77fde by chenwq

fix(退货管理): 修复退货操作状态提示和请求处理问题

修复退货保存接口未返回全部响应数据的问题
优化操作成功/失败的提示信息显示
添加操作中的防重复提交处理
统一使用$notify替代$message显示提示
1 parent be4e1246
......@@ -379,7 +379,8 @@ const refundSave = params => {
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
sign: true,
returnAll: true
})
}
......
......@@ -573,6 +573,14 @@ export default {
* 作废按钮(invalid) - 5:作废
**/
handleConfirm(params, btnType = 'save') {
if (this.loading) {
return true
}
const tipTxtObj = {
save: '单据保存成功',
review: '提交审核成功',
invalid: '作废成功'
}
const btnObj = this.btnTypeMap[btnType]
// eslint-disable-next-line prettier/prettier
params.refundStatus = (this.oprType == 'edit' && btnType == 'save') ? this.editRefundForm.refundStatus : btnObj.refundStatus
......@@ -585,10 +593,12 @@ export default {
this.loading = true
this.$apis.stockManage.refundSave(params).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
type: res.code == 0 ? 'success' : 'error',
title: res.code == 0 ? (tipTxtObj[btnType] || '操作成功') : res.message
})
this.handleAddClose()
if (res.code == 0) {
this.handleAddClose()
}
})
})
.catch(err => {
......
......@@ -156,7 +156,7 @@ export default {
width: 150,
addHtml: 'refundStatus',
formatter: cellValue => {
return this.baseData.refundStatusList.find(item => item.confId === cellValue.refundStatus)?.confLabel || '--'
return this.baseData.refundStatusList.find(item => item.confId === cellValue.refundStatus)?.confLabel || '-'
},
className: cellValue => {
return {
......@@ -214,7 +214,7 @@ export default {
})
.then(() => {
console.log(row)
this.updateStatus(row, 2)
this.updateStatus(row, 2, '提交审核成功')
})
.catch(() => { })
}
......@@ -283,7 +283,6 @@ export default {
created() {
this.refundStatusIdx = this.tableParams.tableColumns.findIndex(item => item.prop === 'refundStatus')
console.log(this.refundStatusIdx)
},
mounted() {
......@@ -343,8 +342,7 @@ export default {
refundStatus
})
.then(res => {
console.log(res)
this.$message({
this.$notify({
message: res.code == '0' ? okMessage : res.message,
type: res.code == '0' ? 'success' : 'error'
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!