|
@@ -44,9 +44,9 @@
|
|
|
<!-- 添加或修改产品树信息对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
- <el-form-item label="归属" prop="parentId" v-if="isAdd">
|
|
|
+ <el-form-item label="归属" prop="aircraftId" v-if="isAdd">
|
|
|
<el-select v-model="form.aircraftId" placeholder="请选择机号信息" style="width:100%">
|
|
|
- <el-option v-for="item in aircraftOptions" :key="item.id" :label="item.number" :value="item.id">
|
|
|
+ <el-option v-for="item in aircraftOptions" :key="item.id" :label="item.name" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -120,6 +120,9 @@ export default {
|
|
|
parentId: [
|
|
|
{ required: true, message: '归属不能为空', trigger: 'blur' },
|
|
|
],
|
|
|
+ aircraftId: [
|
|
|
+ { required: true, message: '归属不能为空', trigger: 'blur' },
|
|
|
+ ],
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -157,10 +160,8 @@ export default {
|
|
|
getTreeselect() {
|
|
|
listProduct().then(response => {
|
|
|
this.productOptions = []
|
|
|
- let data = { id: 0, name: '顶级节点', children: [], isDisabled: true }
|
|
|
+ const data = { id: 0, name: '顶级节点', children: [], isDisabled: true }
|
|
|
data.children = this.handleTree(response.data, 'id', 'parentId')
|
|
|
- console.log('sdfg', data)
|
|
|
- data.children[0].isDisabled = false
|
|
|
this.productOptions.push(data)
|
|
|
})
|
|
|
},
|
|
@@ -197,8 +198,6 @@ export default {
|
|
|
this.getTreeselect()
|
|
|
this.isAdd = false
|
|
|
this.form.parentId = row.id
|
|
|
- this.form.name = row.name
|
|
|
- this.form.snsId = row.snsId
|
|
|
} else {
|
|
|
this.isAdd = true
|
|
|
this.form.parentId = 0
|
|
@@ -220,6 +219,10 @@ export default {
|
|
|
console.log(row)
|
|
|
if (row.parentId == 0) {
|
|
|
this.form.aircraftId = row.aircraftId
|
|
|
+ this.form.name = row.name
|
|
|
+ this.form.snsId = row.snsId
|
|
|
+ this.form.parentId = row.parentId
|
|
|
+ this.form.id = row.id
|
|
|
this.isAdd = true
|
|
|
this.open = true
|
|
|
return
|