|
|
@@ -11,6 +11,12 @@
|
|
|
<a-form-model-item label="区间站场名称" prop="stationName">
|
|
|
<a-input v-model="model.stationName" />
|
|
|
</a-form-model-item>
|
|
|
+ <a-form-model-item label="线路" prop="lineId">
|
|
|
+ <j-list-select-tag
|
|
|
+ v-model="model.lineId"
|
|
|
+ dict-code="line"
|
|
|
+ />
|
|
|
+ </a-form-model-item>
|
|
|
<a-form-model-item label="所属车间" prop="deptStations">
|
|
|
<a-tree-select
|
|
|
v-model="model.deptStations"
|
|
|
@@ -25,14 +31,6 @@
|
|
|
:replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
|
|
|
/>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="线路" prop="lineId">
|
|
|
- <j-list-select-tag
|
|
|
- v-if="lineShow"
|
|
|
- v-model="model.lineId"
|
|
|
- :dept-id="model.deptStations"
|
|
|
- dict-code="line"
|
|
|
- />
|
|
|
- </a-form-model-item>
|
|
|
<a-form-model-item label="行别" prop="xingbie">
|
|
|
<j-dict-select-tag
|
|
|
v-model="model.xingbie"
|
|
|
@@ -67,7 +65,6 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- lineShow: false,
|
|
|
treeData: [],
|
|
|
labelCol: { span: 4 },
|
|
|
wrapperCol: { span: 19 },
|
|
|
@@ -89,32 +86,27 @@ export default {
|
|
|
url: {
|
|
|
add: '/business/catenary/bus/station/add',
|
|
|
edit: '/business/catenary/bus/station/update',
|
|
|
- tree: '/system/dept/treeSelect'
|
|
|
+ tree: '/business/catenary/bus/line/getDeptByLineId/'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- 'model.deptStations': {
|
|
|
+ 'model.lineId': {
|
|
|
deep: true,
|
|
|
handler: function(newV, oldV) {
|
|
|
- if (newV.length > 0) {
|
|
|
- this.lineShow = false
|
|
|
- this.$nextTick(() => {
|
|
|
- this.lineShow = true
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.lineShow = false
|
|
|
+ debugger
|
|
|
+ if (this.model.lineId) {
|
|
|
+ this.loadTree(this.model.lineId)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.loadTree()
|
|
|
},
|
|
|
methods: {
|
|
|
- loadTree() {
|
|
|
+ loadTree(lineId) {
|
|
|
this.treeData = []
|
|
|
- getAction(this.url.tree).then((res) => {
|
|
|
+ getAction(this.url.tree + lineId).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.treeData = res.data
|
|
|
}
|