zcy 3 роки тому
батько
коміт
5ad0b9cef6

+ 20 - 2
src/views/catenary/fault/CheckAndEditModel.vue

@@ -13,11 +13,14 @@
           v-model="model.lineId"
           placeholder="选择线别"
           dict-code="line"
+          @selectChange="lineChange"
         />
       </a-form-model-item>
       <a-form-model-item label="所别" prop="substationId">
         <j-list-select-tag
+          v-if="substationShow"
           v-model="model.substationId"
+          :line-id="model.lineId"
           placeholder="选择所别"
           dict-code="substation"
         />
@@ -77,6 +80,7 @@ export default {
   mixins: [detaileMixin],
   data() {
     return {
+      substationShow: false,
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
       dataSource: [],
@@ -101,15 +105,29 @@ export default {
       }
     }
   },
+  watch: {
+    'model.lineId': {
+      immediate: true,
+      handler: function(newV, oldV) {
+        this.substationShow = false
+        this.$nextTick(() => {
+          this.substationShow = true
+        })
+      }
+    }
+  },
   created() {
   },
   methods: {
+    lineChange() {
+      this.model.substationId = undefined
+    },
     add() {
-      this.model = {}
+      this.model = { substationId: null }
       this.visible = true
     },
     edit(record) {
-      this.model = Object.assign({}, record)
+      this.model = Object.assign({}, record, { substationId: record.substationId ? record.substationId : null })
       this.getDetaile(this.model.id)
       this.visible = true
     },

+ 24 - 8
src/views/catenary/fault/index.vue

@@ -13,7 +13,9 @@
         </a-form-item>
         <a-form-item>
           <j-list-select-tag
+            v-if="substationShow"
             v-model="queryParam.substationId"
+            :line-id="queryParam.lineId"
             style="width: 150px"
             placeholder="选择所别"
             dict-code="substation"
@@ -42,10 +44,10 @@
             placeholder="输入公里标"
           />
         </a-form-item>
-<!--        <a-form-item>-->
-<!--          <a-date-picker v-model="queryParam.date1" format="YYYY/MM/DD" placeholder="时间范围" /> - -->
-<!--          <a-date-picker v-model="queryParam.date2" format="YYYY/MM/DD" placeholder="时间范围" />-->
-<!--        </a-form-item>-->
+        <!--        <a-form-item>-->
+        <!--          <a-date-picker v-model="queryParam.date1" format="YYYY/MM/DD" placeholder="时间范围" /> - -->
+        <!--          <a-date-picker v-model="queryParam.date2" format="YYYY/MM/DD" placeholder="时间范围" />-->
+        <!--        </a-form-item>-->
         <a-form-item>
           <a-button type="primary" @click="searchQuery">查询</a-button>
           <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
@@ -55,10 +57,10 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator" style="margin: 15px 0">
       <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
-<!--      <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>-->
-<!--      <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">-->
-<!--        <a-button ghost type="danger" icon="import">导入</a-button>-->
-<!--      </a-upload>-->
+      <!--      <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>-->
+      <!--      <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">-->
+      <!--        <a-button ghost type="danger" icon="import">导入</a-button>-->
+      <!--      </a-upload>-->
 
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
@@ -121,6 +123,8 @@ export default {
   data() {
     return {
       // 查询条件
+      substationId: undefined,
+      substationShow: true,
       queryParam: {},
       // 表头
       columns: columns(this),
@@ -132,6 +136,18 @@ export default {
       }
     }
   },
+  watch: {
+    'queryParam.lineId': {
+      handler: function(newV, oldV) {
+        this.substationShow = false
+        this.$nextTick(() => {
+          this.queryParam.substationId = undefined
+          this.substationId = undefined
+          this.substationShow = true
+        })
+      }
+    }
+  },
   created() {
   },
   methods: {

+ 15 - 8
src/views/catenary/stand/view/fnh/CheckAndEditModel.vue

@@ -40,7 +40,9 @@
       </a-form-model-item>
       <a-form-model-item label="所别" prop="substationId">
         <j-list-select-tag
+          v-if="substationShow"
           v-model="model.substationId"
+          :line-id="model.lineId"
           dict-code="substation"
         />
       </a-form-model-item>
@@ -55,16 +57,16 @@
         <a-input v-model="model.pillarCode" />
       </a-form-model-item>
       <a-form-model-item label="开始公里标" prop="startMarker">
-        <a-input-number style="width: 100%" v-model="model.startMarker" />
+        <a-input-number v-model="model.startMarker" style="width: 100%" />
       </a-form-model-item>
       <a-form-model-item label="结束公里标" prop="endMarker">
-        <a-input-number style="width: 100%" v-model="model.endMarker" />
+        <a-input-number v-model="model.endMarker" style="width: 100%" />
       </a-form-model-item>
       <a-form-model-item label="易搭窝部位" prop="riskSource">
         <a-input v-model="model.riskSource" />
       </a-form-model-item>
       <a-form-model-item label="采取措施" prop="measures">
-        <a-textarea :maxLength="300" :rows="4" v-model="model.measures" />
+        <a-textarea v-model="model.measures" :max-length="300" :rows="4" />
       </a-form-model-item>
     </a-form-model>
   </j-modal>
@@ -81,6 +83,7 @@ export default {
     return {
       stationShow: false,
       lineShow: false,
+      substationShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -108,9 +111,6 @@ export default {
       }
     }
   },
-  created() {
-    this.loadTree()
-  },
   watch: {
     'model.deptId': {
       immediate: true,
@@ -125,19 +125,26 @@ export default {
       immediate: true,
       handler: function(newV, oldV) {
         this.stationShow = false
+        this.substationShow = false
         this.$nextTick(() => {
           this.stationShow = true
+          this.substationShow = true
         })
       }
     }
   },
+  created() {
+    this.loadTree()
+  },
   methods: {
     lineChange() {
       this.model.stationId = undefined
+      this.model.substationId = undefined
     },
     deptChange() {
       this.model.lineId = undefined
       this.model.stationId = undefined
+      this.model.substationId = undefined
     },
     loadTree() {
       this.treeData = []
@@ -148,11 +155,11 @@ export default {
       })
     },
     add() {
-      this.model = { lineId: null, stationId: null }
+      this.model = { lineId: null, stationId: null, substationId: null }
       this.visible = true
     },
     edit(record) {
-      this.model = Object.assign({}, record)
+      this.model = Object.assign({}, record, { substationId: record.substationId ? record.substationId : null })
       this.visible = true
     },
     close(isSubmit) {

+ 14 - 7
src/views/catenary/stand/view/fxs/CheckAndEditModel.vue

@@ -40,7 +40,9 @@
       </a-form-model-item>
       <a-form-model-item label="所别" prop="substationId">
         <j-list-select-tag
+          v-if="substationShow"
           v-model="model.substationId"
+          :line-id="model.lineId"
           placeholder="选择所别"
           dict-code="substation"
         />
@@ -56,10 +58,10 @@
         <a-input v-model="model.pillarCode" />
       </a-form-model-item>
       <a-form-model-item label="开始公里标" prop="startMarker">
-        <a-input-number style="width: 100%" v-model="model.startMarker" />
+        <a-input-number v-model="model.startMarker" style="width: 100%" />
       </a-form-model-item>
       <a-form-model-item label="结束公里标" prop="endMarker">
-        <a-input-number style="width: 100%" v-model="model.endMarker" />
+        <a-input-number v-model="model.endMarker" style="width: 100%" />
       </a-form-model-item>
       <a-form-model-item label="锈蚀部位" prop="rustPosition">
         <a-input v-model="model.rustPosition" />
@@ -88,6 +90,7 @@ export default {
     return {
       stationShow: false,
       lineShow: false,
+      substationShow: false,
       treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
@@ -117,9 +120,6 @@ export default {
       }
     }
   },
-  created() {
-    this.loadTree()
-  },
   watch: {
     'model.deptId': {
       immediate: true,
@@ -134,19 +134,26 @@ export default {
       immediate: true,
       handler: function(newV, oldV) {
         this.stationShow = false
+        this.substationShow = false
         this.$nextTick(() => {
           this.stationShow = true
+          this.substationShow = true
         })
       }
     }
   },
+  created() {
+    this.loadTree()
+  },
   methods: {
     lineChange() {
       this.model.stationId = undefined
+      this.model.substationId = undefined
     },
     deptChange() {
       this.model.lineId = undefined
       this.model.stationId = undefined
+      this.model.substationId = undefined
     },
     loadTree() {
       this.treeData = []
@@ -157,11 +164,11 @@ export default {
       })
     },
     add() {
-      this.model = { lineId: null, stationId: null }
+      this.model = { lineId: null, stationId: null, substationId: null }
       this.visible = true
     },
     edit(record) {
-      this.model = Object.assign({}, record)
+      this.model = Object.assign({}, record, { substationId: record.substationId ? record.substationId : null })
       this.visible = true
     },
     close(isSubmit) {