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

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

parent 129ea8b5
...@@ -575,8 +575,7 @@ export default { ...@@ -575,8 +575,7 @@ export default {
}, },
initData(res) { initData(res) {
this.form = res.data.value || {}; this.form = res.data.value || {};
this.loadOrderDetail(); this.initFormData();
const list = res.data.config.sort((a, b) => a.order - b.order); const list = res.data.config.sort((a, b) => a.order - b.order);
list.forEach((item, index) => { list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName) this.tabIndex = index; if (this.maintainStep === item.panelFieldsName) this.tabIndex = index;
...@@ -612,6 +611,12 @@ export default { ...@@ -612,6 +611,12 @@ export default {
if (this.auditResultsId) this.checkCompleteError(); if (this.auditResultsId) this.checkCompleteError();
uni.hideLoading(); 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() { loadOrderDetail() {
if (!this.$u.test.isEmpty(this.form) && this.form.hasOwnProperty("installComfirmTime") if (!this.$u.test.isEmpty(this.form) && this.form.hasOwnProperty("installComfirmTime")
&& this.$u.test.isEmpty(this.form.installComfirmTime)) { && this.$u.test.isEmpty(this.form.installComfirmTime)) {
...@@ -653,10 +658,16 @@ export default { ...@@ -653,10 +658,16 @@ export default {
handleSaveData() { handleSaveData() {
let param = {}; let param = {};
const name = this.list[this.tabIndex].panelFieldsName;
this.list.forEach((panel) => { this.list.forEach((panel) => {
param[panel.panelFieldsName] = []; param[panel.panelFieldsName] = [];
panel.items.forEach((group) => { panel.items.forEach((group) => {
group.items.forEach((ele) => { group.items.forEach((ele) => {
if(name === "partnerInspectItem") {
if(!this.form?.installationMethodType) {
this.$set(this.form, "installationMethodType", this.form.installType);
}
}
if (this.form[ele.fieldsName]) { if (this.form[ele.fieldsName]) {
param[panel.panelFieldsName].push({ param[panel.panelFieldsName].push({
fieldsName: ele.fieldsName, 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