|
|
@ -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 |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|