|
@@ -382,11 +382,20 @@ export default {
|
|
|
* @returns {void}
|
|
|
*/
|
|
|
handleFormSaveSuccess(orderData) {
|
|
|
- this.orderFormVisible = false
|
|
|
- this.isEditMode = false
|
|
|
- this.editOrderId = null
|
|
|
- // 刷新列表数据
|
|
|
- this.onLoad(this.page)
|
|
|
+ if (this.isEditMode) {
|
|
|
+ // 编辑模式:保持在表单页,不返回列表
|
|
|
+ this.orderFormVisible = true
|
|
|
+ // 确保编辑ID保持最新(后端返回可能是字符串/数字)
|
|
|
+ this.editOrderId = orderData && (orderData.id || this.editOrderId)
|
|
|
+ // 后台刷新列表数据,不影响停留在表单
|
|
|
+ this.onLoad(this.page)
|
|
|
+ } else {
|
|
|
+ // 新增模式:保存后返回列表
|
|
|
+ this.orderFormVisible = false
|
|
|
+ this.isEditMode = false
|
|
|
+ this.editOrderId = null
|
|
|
+ this.onLoad(this.page)
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|