zcy 4 years ago
parent
commit
f30ea93fc0

+ 36 - 1
src/views/catenary/stand/view/fb/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -64,6 +70,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -92,7 +100,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fb/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fcr/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -83,6 +89,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -117,7 +125,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fcr/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/ff/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -64,6 +70,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -92,7 +100,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/ff/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fh/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -63,6 +69,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -92,7 +100,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fh/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fl/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -64,6 +70,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -92,7 +100,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fl/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fnh/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -70,6 +76,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -99,7 +107,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fnh/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fs/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -82,6 +88,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 7 },
       wrapperCol: { span: 16 },
@@ -118,7 +126,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fs/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fxs/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -77,6 +83,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -108,7 +116,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fxs/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',

+ 36 - 1
src/views/catenary/stand/view/fyw/CheckAndEditModel.vue

@@ -18,17 +18,23 @@
           :tree-data="treeData"
           tree-node-filter-prop="label"
           :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
+          @change="deptChange"
         />
       </a-form-model-item>
-      <a-form-model-item label="线" prop="lineId">
+      <a-form-model-item label="线" prop="lineId">
         <j-list-select-tag
+          v-if="lineShow"
           v-model="model.lineId"
+          :dept-id="model.deptId"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="站场区间" prop="stationId">
         <j-list-select-tag
+          v-if="stationShow"
           v-model="model.stationId"
+          :line-id="model.lineId"
           dict-code="station"
         />
       </a-form-model-item>
@@ -64,6 +70,8 @@ export default {
   },
   data() {
     return {
+      stationShow: false,
+      lineShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -92,7 +100,34 @@ export default {
   created() {
     this.loadTree()
   },
+  watch: {
+    'model.deptId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.lineShow = false
+        this.$nextTick(() => {
+          this.lineShow = true
+        })
+      }
+    },
+    'model.lineId': {
+      deep: true,
+      handler: function(newV, oldV) {
+        this.stationShow = false
+        this.$nextTick(() => {
+          this.stationShow = true
+        })
+      }
+    }
+  },
   methods: {
+    lineChange() {
+      this.model.stationId = undefined
+    },
+    deptChange() {
+      this.model.lineId = undefined
+      this.model.stationId = undefined
+    },
     loadTree() {
       this.treeData = []
       getAction(this.url.tree).then((res) => {

+ 0 - 6
src/views/catenary/stand/view/fyw/indexColumns.js

@@ -9,12 +9,6 @@ function columns(vm) {
         return parseInt(index) + 1
       }
     },
-    {
-      title: '段别',
-      align: 'center',
-      dataIndex: 'piecewise',
-      key: 'piecewise'
-    },
     {
       title: '车间',
       align: 'center',