Browse Source

解决设备下拉选项,筛选后再删除,option不回显问题

dong 2 months ago
parent
commit
d0ebb79f49

+ 5 - 0
src/views/module_cmms/inspectAbnormalItems/InspectAbnormalItemsList.vue

@@ -13,6 +13,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -289,6 +290,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       // 确认
       handleConfirm(record){
         postAction(this.url.confirm, record).then((res) => {

+ 5 - 0
src/views/module_cmms/inspectContent/modules/InspectContentForm.vue

@@ -35,6 +35,7 @@
                 placeholder="请输入设备名称或设备编号"
                 show-search
                 :filterOption="filterOptions"
+                @change="clearOptions"
                 @search="searchDevice"
                 allowClear>
                   <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -236,6 +237,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       inspectTypeChange(){
         this.model.cmmsInspectContentItemList = []
         this.$refs.addItemRef.type = this.model.classification

+ 5 - 0
src/views/module_cmms/repairManage/RepairManageList.vue

@@ -22,6 +22,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -393,6 +394,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       // 派单
       handleDisptch (record) {
         this.$refs.modalForm.title = "派单";

+ 5 - 0
src/views/module_cmms/repairManage/modules/RepairManageForm.vue

@@ -16,6 +16,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -176,6 +177,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       add () {
         this.edit(this.modelDefault);
       },

+ 5 - 0
src/views/module_cmms/repairMy/RepairMyList.vue

@@ -22,6 +22,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -361,6 +362,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       handleFeedback(record){
         this.$refs.modalForm.title = "维修反馈";
         this.$refs.modalForm.modalType = "feedback";

+ 4 - 0
src/views/module_cmms/spotcheck/modules/SpotcheckForm.vue

@@ -295,6 +295,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       add () {
         // this.edit(this.modelDefault);
         this.disabledEdit = false

+ 5 - 0
src/views/module_cmms/spotcheckAbnormalItems/spotcheckAbnormalItemsList.vue

@@ -13,6 +13,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -284,6 +285,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       // 确认
       handleConfirm(record){
         postAction(this.url.confirm, record).then((res) => {

+ 5 - 0
src/views/module_cmms/spotcheckContent/modules/SpotcheckContentForm.vue

@@ -25,6 +25,7 @@
                   show-search
                   :disabled="disabledEdit"
                   :filterOption="filterOptions"
+                  @change="clearOptions"
                   @search="searchDevice"
                   allowClear>
                     <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -224,6 +225,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       add () {
         // this.edit(this.modelDefault);
         this.model = Object.assign({}, this.modelDefault);

+ 5 - 0
src/views/module_cmms/submission/modules/SubmissionForm.vue

@@ -12,6 +12,7 @@
               show-search
               mode="multiple"
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -142,6 +143,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       add () {
         this.edit(this.modelDefault);
       },

+ 5 - 0
src/views/module_cmms/upkeep/UpkeepList.vue

@@ -23,6 +23,7 @@
                 placeholder="请输入设备名称或设备编号"
                 show-search
                 :filterOption="filterOptions"
+                @change="clearOptions"
                 @search="searchDevice"
                 allowClear>
                   <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -345,6 +346,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       handleEdit: function (record) {
         this.$refs.modalForm.edit(record);
         this.$refs.modalForm.title = "反馈";

+ 5 - 0
src/views/module_cmms/upkeepPlan/UpkeepPlanList.vue

@@ -42,6 +42,7 @@
                 placeholder="请输入设备名称或设备编号"
                 show-search
                 :filterOption="filterOptions"
+                @change="clearOptions"
                 @search="searchDevice"
                 allowClear>
                   <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -393,6 +394,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 5 - 0
src/views/module_cmms/upkeepPlan/modules/UpkeepPlanForm.vue

@@ -25,6 +25,7 @@
                   show-search
                   :disabled="disabledEdit"
                   :filterOption="filterOptions"
+                  @change="clearOptions"
                   @search="searchDevice"
                   allowClear>
                     <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -319,6 +320,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       add () {
         // this.edit(this.modelDefault);
         this.model = Object.assign({}, this.modelDefault);

+ 5 - 0
src/views/module_tpm/alarmQuery/alarmQueryList.vue

@@ -11,6 +11,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
               <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -375,6 +376,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 5 - 0
src/views/module_tpm/equipment/EquipmentList.vue

@@ -12,6 +12,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -370,6 +371,10 @@ import Template1 from '../../jeecg/JVxeDemo/layout-demo/Template1.vue'
       filterOptions(input, option) {
         return this.deviceOptions
       },
+      // 解决筛选后删除option不回显问题
+      clearOptions() {
+        this.deviceOptions = this.deviceOptionsAll
+      },
       getDataList(){
         console.log(111,this.selectData)
         this.queryParam.equipmenttreeid = this.selectData.equipmenttreeid

+ 5 - 1
src/views/module_tpm/equipmentEfficiency/index.vue

@@ -196,6 +196,10 @@ export default {
     filterOptions(input, option) {
     return this.deviceOptions
     },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
     // 筛选设备
     searchDevice(value) {
         // 若输入的值删除,则重新赋完整的设备列表
@@ -215,7 +219,7 @@ export default {
     handleChange() {
         this.deviceOptions = [...this.deviceOptionsAll];
         if (this.queryParams.equipmentids && this.queryParams.equipmentids.length > 5) {
-            this.$message.warning('最多选择5个车站');
+            this.$message.warning('最多选择5个');
             this.queryParams.equipmentids = this.queryParams.id.slice(0, 5);
         }
     },

+ 5 - 0
src/views/module_tpm/equipmentRunStatis/history.vue

@@ -10,6 +10,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -174,6 +175,10 @@ export default {
     filterOptions(input, option) {
       return this.deviceOptions
     },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
     /** 重置按钮操作 */
     resetQuery() {
       this.handleQuery()

+ 5 - 0
src/views/module_tpm/equipmentRunStatis/realtime.vue

@@ -10,6 +10,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -175,6 +176,10 @@ export default {
     filterOptions(input, option) {
       return this.deviceOptions
     },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
     dateformat(date) {
       var year = date.getFullYear()
       var month = date.getMonth() + 1

+ 5 - 0
src/views/module_tpm/healthDiagnosis/index.vue

@@ -15,6 +15,7 @@
                       placeholder="请输入设备名称或设备编号"
                       show-search
                       :filterOption="filterOptions"
+                      @change="clearOptions"
                       @search="searchDevice"
                       allowClear
                     >
@@ -324,6 +325,10 @@ export default {
     filterOptions(input, option) {                    
       return this.deviceOptions
     },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
     /** 查询报警数据列表 */
     getAlarmList() {
       this.alarmList = emsdata.homedata.alarmData

+ 5 - 0
src/views/module_tpm/messageAlarm/MessageAlarmList.vue

@@ -11,6 +11,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
               <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
@@ -379,6 +380,10 @@
       filterOptions(input, option) {                    
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 5 - 0
src/views/module_tpm/tpmParams/TpmParamsList.vue

@@ -12,6 +12,7 @@
               placeholder="请输入设备名称或设备编号"
               show-search
               :filterOption="filterOptions"
+              @change="clearOptions"
               @search="searchDevice"
               allowClear>
                 <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.equipmentcode" :label="item.equipmentname">
@@ -277,6 +278,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       getSuperFieldList(){
         let fieldList=[];
         fieldList.push({type:'string',value:'equipmentname',text:'设备名称',dictCode:''})

+ 4 - 0
src/views/module_tpm/tpmParams/modules/TpmParamsForm.vue

@@ -168,6 +168,10 @@
       filterOptions(input, option) {
         return this.deviceOptions
       },
+    // 解决筛选后删除option不回显问题
+    clearOptions() {
+      this.deviceOptions = this.deviceOptionsAll
+    },
       add () {
         this.edit(this.modelDefault);
       },