|
|
@ -116,6 +116,7 @@ export default { |
|
|
|
label: "车辆状态:", |
|
|
|
key: "vehicleStatus", |
|
|
|
type: "select", |
|
|
|
required: true, |
|
|
|
options: { |
|
|
|
options: [ |
|
|
|
{ |
|
|
@ -160,19 +161,19 @@ export default { |
|
|
|
handler(bool) { |
|
|
|
if (!bool) return; |
|
|
|
|
|
|
|
console.log("vehicleTypeList:",this.vehicleTypeList); |
|
|
|
|
|
|
|
let abc = this.vehicleTypeList.map((item) => ({ |
|
|
|
this.formList.filter((item) => item.key == "vehicleType")[0].options.options = this.vehicleTypeList.map((item) => ({ |
|
|
|
key: item.dictValue, |
|
|
|
label: item.dictLabel, |
|
|
|
})) |
|
|
|
console.log("-----1:",abc); |
|
|
|
})); |
|
|
|
|
|
|
|
if(this.data){ |
|
|
|
this.formData = this.data; |
|
|
|
this.formData.vehicleType = this.data.vehicleType.toString(); |
|
|
|
}else{ |
|
|
|
this.formData = null; |
|
|
|
} |
|
|
|
|
|
|
|
this.formData = !this.data ? null : { |
|
|
|
organizationId: this.data.organizationId, |
|
|
|
vehiclePlate: this.data.vehiclePlate, |
|
|
|
vehicleType: this.data.vehicleType, |
|
|
|
}; |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -180,40 +181,20 @@ export default { |
|
|
|
async getOptions() { |
|
|
|
|
|
|
|
|
|
|
|
// this.vehicleTypeList.map((item) => ({ |
|
|
|
// key: item.dictValue, |
|
|
|
// label: item.dictLabel, |
|
|
|
// })) |
|
|
|
// console.log("-----1:",this.vehicleTypeList); |
|
|
|
|
|
|
|
console.log("this.vehicleTypeList:",this.vehicleTypeList); |
|
|
|
|
|
|
|
const result = await getSelectOptionsStation(1); |
|
|
|
const result = await getSelectOptionsStation(); |
|
|
|
|
|
|
|
this.formList[0].options.options = result; |
|
|
|
this.formList[0].default = result[0].key; |
|
|
|
// this.formList[0].options.options.push({ |
|
|
|
// disabled: false, |
|
|
|
// key: 0, |
|
|
|
// label: "无", |
|
|
|
// }); |
|
|
|
// console.log(this.formList[0].options.options); |
|
|
|
}, |
|
|
|
handleSubmit() { |
|
|
|
this.$refs.FormConfigRef.validate().then((data) => { |
|
|
|
this.submitting = true; |
|
|
|
|
|
|
|
if (this.data) data.id = this.data.dcOrganizations.id; |
|
|
|
if (this.data) data.id = this.data.id; |
|
|
|
|
|
|
|
if (typeof data.parentId != "number") data.parentId = 0; |
|
|
|
if (data.stakeMark[0]) { |
|
|
|
data.stakeMark = `K${data.stakeMark[0]}+${data.stakeMark[1]}`; |
|
|
|
} else { |
|
|
|
data.stakeMark = ""; |
|
|
|
} |
|
|
|
|
|
|
|
request({ |
|
|
|
url: `/business/organization`, |
|
|
|
url: `/business/vehicles`, |
|
|
|
method: this.data ? "PUT" : "POST", |
|
|
|
data, |
|
|
|
}) |
|
|
|