Commit 8ab77fde by chenwq

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

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