Browse Source

客户需求管理工作台修改 ,保存增加loading提示

szdq
wangxy 3 years ago
parent
commit
82f7f4460c
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      src/views/plan/workbench/homePage/beta/predict/predictEdit.vue

+ 13
- 1
src/views/plan/workbench/homePage/beta/predict/predictEdit.vue View File

@ -1,6 +1,6 @@
<template>
<div class="predict-edit-container">
<ContentContainer>
<ContentContainer v-loading="tableLoading">
<el-form ref="formData" :model="formData" :rules="rules" label-width="130px" class="clearfix search-content">
<el-row :gutter="24">
<el-col :span="6">
@ -201,6 +201,7 @@ export default {
startWeekArray: [],
orgListArray: [],
CustDemandVerDetail: {},
tableLoading: false,
}
},
mounted() {
@ -281,8 +282,10 @@ export default {
})
},
handleUpdate(CustomerId, VersionId) { //
this.tableLoading = true
get(`/admin/ap/custdemandverhead/selectone/${CustomerId}/${VersionId}`)
.then(res => {
this.tableLoading = false
if (res.code === 200) {
let formNewData = res.data
this.formData = formNewData
@ -294,11 +297,14 @@ export default {
})
}
}
}).catch(() => {
this.tableLoading = false
})
},
submitForm() { //
this.$refs['formData'].validate(valid => {
if (valid) {
this.tableLoading = true
if (this.formData['AP_CustDemandVerHead-CustomerItem'] && this.formData['AP_CustDemandVerHead-CustomerItem'].length > 0) {
this.formData['AP_CustDemandVerHead-CustomerItem'].forEach(el => {
if (el.Item) {
@ -310,21 +316,27 @@ export default {
}
if (this.item.title === '修改') {
put(this.url.updateUrl, this.formData).then(res => {
this.tableLoading = false
if (res.code === 200) {
this.msgSuccess('修改成功')
this.$router.push({path:'/plan/workbench/homePage',query: {CustomerId: this.item.CustomerId}})
} else {
this.msgError(res.msg)
}
}).catch(() => {
this.tableLoading = false
})
} else {
post(this.url.addUrl, this.formData).then(res => {
this.tableLoading = false
if (res.code === 200) {
this.msgSuccess('新增成功')
this.$router.push({path:'/plan/workbench/homePage',query: {CustomerId: this.item.CustomerId}})
} else {
this.msgError(res.msg)
}
}).catch(() => {
this.tableLoading = false
})
}
}


Loading…
Cancel
Save