Browse Source

改单

java8
han\hanst 1 year ago
parent
commit
0491170bce
  1. 54
      src/views/modules/ecss/codelnotify.vue

54
src/views/modules/ecss/codelnotify.vue

@ -390,8 +390,10 @@
</el-row> </el-row>
</el-form> </el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="doUpdateDetail()">保存</el-button>
<el-button type="primary" @click="updateDetailModelFlag=false">关闭</el-button>
<el-button type="primary" @click="doUpdateDetail()" :loading="updateDetailLoading" :disabled="updateDetailLoading">
{{ updateDetailLoading ? '保存中...' : '保存' }}
</el-button>
<el-button type="primary" @click="updateDetailModelFlag=false" :disabled="updateDetailLoading">关闭</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="沃尔玛订单" :close-on-click-modal="false" v-drag :visible.sync="walMartOrderDialog" width="200px"> <el-dialog title="沃尔玛订单" :close-on-click-modal="false" v-drag :visible.sync="walMartOrderDialog" width="200px">
@ -786,6 +788,7 @@
dataList2:[], dataList2:[],
dataListLoading: false, dataListLoading: false,
xiadaLoading: false, // 下达按钮加载状态 xiadaLoading: false, // 下达按钮加载状态
updateDetailLoading: false, // 明细保存/取消按钮加载状态
searchData: { searchData: {
page: 1, page: 1,
limit: 100, limit: 100,
@ -2277,9 +2280,24 @@
}) })
return false return false
} }
// 开始加载
this.updateDetailLoading = true
updateEcssDelDetail(this.updateDetailModel).then(({data}) => { updateEcssDelDetail(this.updateDetailModel).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
// 保存当前选中行的标识,以便刷新后恢复
const currentSelectedKey = this.currentRow ? this.currentRow.delNo : null
if (currentSelectedKey) {
this.selectedRowKey = currentSelectedKey
this.saveSelectedRowToStorage()
}
// 刷新明细表格
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
// 刷新表头列表
this.searchTable()
this.updateDetailModelFlag=false this.updateDetailModelFlag=false
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
@ -2292,6 +2310,14 @@
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} }
}).catch((error) => {
// 处理错误情况
this.$alert('操作失败,请重试', '错误', {
confirmButtonText: '确定'
})
}).finally(() => {
// 无论成功还是失败都要恢复加载状态
this.updateDetailLoading = false
}) })
}, },
@ -2352,9 +2378,23 @@
}, },
deleteDelDetail(row){ deleteDelDetail(row){
this.$confirm('确认取消此明细?', '提示').then(() => { this.$confirm('确认取消此明细?', '提示').then(() => {
// 开始加载
this.updateDetailLoading = true
deleteEcssDelDetail(row).then(({data}) => { deleteEcssDelDetail(row).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
// 保存当前选中行的标识,以便刷新后恢复
const currentSelectedKey = this.currentRow ? this.currentRow.delNo : null
if (currentSelectedKey) {
this.selectedRowKey = currentSelectedKey
this.saveSelectedRowToStorage()
}
// 刷新明细表格
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
// 刷新表头列表
this.searchTable()
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -2366,7 +2406,17 @@
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} }
}).catch((error) => {
// 处理错误情况
this.$alert('操作失败,请重试', '错误', {
confirmButtonText: '确定'
})
}).finally(() => {
// 无论成功还是失败都要恢复加载状态
this.updateDetailLoading = false
}) })
}).catch(() => {
// 用户取消确认时不需要loading状态
}) })
}, },
getBu () { getBu () {

Loading…
Cancel
Save