Commit 2a37fe9d by jack

修复bug

1 parent 0ff3d3ac
......@@ -50,11 +50,11 @@
<basic-dialog :title="filterDialogTitle" :isVisible="filterVisible" @confirmDialog="filterConfirm" @closeDialog="closeFilter">
<slot>
<div v-loading="loading">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
</el-input>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
</el-input>
<el-tree class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
</el-tree>
<el-tree class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
</el-tree>
</div>
</slot>
</basic-dialog>
......@@ -327,6 +327,7 @@ export default {
label: "车牌:",
prop: "licensePlate",
type: "input",
maxlength:9,
clearable: true,
},
{ label: "外色:", prop: "color", type: "input", clearable: true },
......@@ -386,7 +387,7 @@ export default {
// 新增车辆-车型数据
vehicleList: [],
loading:false
loading: false,
};
},
watch: {
......@@ -426,10 +427,18 @@ export default {
this.vehicleVisible = !this.vehicleVisible;
this.isReadonly = false;
if (this.vehicleVisible) {
let _list = _.cloneDeep(this.vehicleData);
let _arr = [];
_list.map((k) => {
this.$set(k, "disabled", false);
if (k.prop != "seriesId" && k.prop != "typeId") {
_arr.push(k);
}
});
this.vehicleTitle = "新增车辆";
this.vehicleHasOk = true;
this.vehicleForm = {};
this.vehicleData = _.cloneDeep(this.vehicleDefalutData);
this.vehicleData = _arr;
}
if (this.$refs.vehicleRuleForm)
this.$refs.vehicleRuleForm.$children[0].clearValidate();
......@@ -438,19 +447,18 @@ export default {
this.vehicleVisible = !this.vehicleVisible;
this.isReadonly = false;
if (this.vehicleVisible) {
let _list = this.vehicleDefalutData;
//let _list = this.vehicleDefalutData;
this.vehicleTitle = "编辑车辆";
this.vehicleHasOk = true;
infoVehicle({ tempId: scope.tempId }).then((res) => {
const { code, data } = res;
if (code == 200) {
//动态创建车系、车型选择框
let _list = this.creatSelect(data);
_list.map(k => {
this.$set(k,"disabled",false)
})
_list.map((k) => {
this.$set(k, "disabled", false);
});
this.vehicleData = _.cloneDeep(_list);
this.vehicleArr.forEach((item) => {
......@@ -471,12 +479,11 @@ export default {
infoVehicle({ tempId: scope.tempId }).then((res) => {
const { code, data } = res;
if (code == 200) {
//动态创建车系、车型选择框
let _list = this.creatSelect(data);
_list.map(k => {
this.$set(k,"disabled",true)
})
_list.map((k) => {
this.$set(k, "disabled", true);
});
this.vehicleData = _.cloneDeep(_list);
this.vehicleArr.forEach((item) => {
......@@ -750,20 +757,20 @@ export default {
},
// 监听切换车系
changeCarModel(e,row) {
console.log(row)
changeCarModel(e, row) {
console.log(row);
let list = this.vehicleDefalutData;
let m = row.options;
let o = {};
// 找第三级
let nn = m.find(k => {
let _n = k.childs.find(j => j.id == e);
if(_n){
let nn = m.find((k) => {
let _n = k.childs.find((j) => j.id == e);
if (_n) {
o = _n;
}
return _n;
})
});
let idx = this.vehicleDefalutData.findIndex((k) => k.prop == "seriesId");
let i = list.findIndex((k) => k.prop == "typeId");
......@@ -804,13 +811,13 @@ export default {
// 车系
if (n) {
m = (n.childs||[]).find((j) => j.id == data.subBrandId);
m = (n.childs || []).find((j) => j.id == data.subBrandId);
}
console.log(m);
if (m) {
km = (m.childs||[]).find((j) => j.id == data.seriesId);
km = (m.childs || []).find((j) => j.id == data.seriesId);
}
let _series = {
......@@ -854,7 +861,6 @@ export default {
return _list;
},
},
};
</script>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!