Commit d0975713 authored by 高铭波's avatar 高铭波

fix(order): 修复安装方式默认值问题

parent 129ea8b5
......@@ -575,8 +575,7 @@ export default {
},
initData(res) {
this.form = res.data.value || {};
this.loadOrderDetail();
this.initFormData();
const list = res.data.config.sort((a, b) => a.order - b.order);
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName) this.tabIndex = index;
......@@ -612,6 +611,12 @@ export default {
if (this.auditResultsId) this.checkCompleteError();
uni.hideLoading();
},
initFormData() {
this.loadOrderDetail();
if(!this.form.hasOwnProperty("installationMethodType") || this.$u.test.isEmpty(this.form['installationMethodType'])) {
this.$set(this.form, "installationMethodType", this.form.installType);
}
},
loadOrderDetail() {
if (!this.$u.test.isEmpty(this.form) && this.form.hasOwnProperty("installComfirmTime")
&& this.$u.test.isEmpty(this.form.installComfirmTime)) {
......@@ -653,10 +658,16 @@ export default {
handleSaveData() {
let param = {};
const name = this.list[this.tabIndex].panelFieldsName;
this.list.forEach((panel) => {
param[panel.panelFieldsName] = [];
panel.items.forEach((group) => {
group.items.forEach((ele) => {
if(name === "partnerInspectItem") {
if(!this.form?.installationMethodType) {
this.$set(this.form, "installationMethodType", this.form.installType);
}
}
if (this.form[ele.fieldsName]) {
param[panel.panelFieldsName].push({
fieldsName: ele.fieldsName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment