Browse Source

修改待选已选不为空

Shannon_mu 3 years ago
parent
commit
89363161a2

+ 3 - 3
operationSupport/src/views/facilityInspections/inspectionsRecords.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="main">
         <div class="search">
-            <el-input placeholder="请输入巡检任务/人员" class="search-input" clearable v-model="mixins_query.inspectionName"></el-input>
+            <el-input placeholder="请输入巡检任务/人员" class="search-input" clearable v-model="mixins_query.currentUsers"></el-input>
             <el-select class="width90" placeholder="请选择巡检状态" v-model="mixins_query.inspectionStatus" clearable>
                 <el-option label="待执行" :value="1"></el-option>
                 <el-option label="执行中" :value="2"></el-option>
@@ -120,8 +120,8 @@ export default {
             if (!arr) {
                 arr = ['', ''];
             }
-            this.mixins_query.startDate = arr[0];
-            this.mixins_query.endDate = arr[1];
+            this.mixins_query.startTime = arr[0];
+            this.mixins_query.endTime = arr[1];
         },
         lookDetails(row) {
             new Promise((resolve) => {

+ 36 - 3
operationSupport/src/views/facilityInspections/popups/add.vue

@@ -26,7 +26,23 @@
                 :options="deviceArr"
                 @change="deviceArrToggle"
             ></el-cascader>
-            <div style="text-align: center; margin-top: 20px">
+            <!-- <div style="text-align: center; margin-top: 20px">
+                <el-transfer
+                    style="text-align: left; display: inline-block"
+                    v-model="formData.deviceIds"
+                    filterable
+                    :props="{
+                        key: 'id',
+                        label: 'deviceName'
+                    }"
+                    :titles="['待选列表', '已选列表']"
+                    :data="devicesArr"
+                ></el-transfer>
+            </div> -->
+        </template>
+
+        <template slot="deviceIds">
+            <div style="text-align: center">
                 <el-transfer
                     style="text-align: left; display: inline-block"
                     v-model="formData.deviceIds"
@@ -117,7 +133,18 @@ export default {
                         }
                     }
                 }),
-                typeValue: [this.$valid.selectRequired('设备/设施类型')]
+                typeValue: [this.$valid.selectRequired('设备/设施类型')],
+                deviceIds: this.$valid.custome({
+                    validator(rule, value, cb) {
+                        const rl = rule;
+                        if (!value.length) {
+                            rl.message = '已选列表不能为空';
+                            cb(new Error());
+                        } else {
+                            cb();
+                        }
+                    }
+                })
             },
             formCols: [
                 [
@@ -136,6 +163,12 @@ export default {
                         prop: 'typeValue',
                         slot: 'typeValue'
                     },
+                    {
+                        label: '',
+                        prop: 'deviceIds',
+                        slot: 'deviceIds'
+                    },
+
                     {
                         label: '巡检时间',
                         prop: 'startDate',
@@ -166,7 +199,7 @@ export default {
             defaultProps: {
                 value: 'id', // 唯一标识
                 label: 'label', // 标签显示
-                children: 'children',
+                children: 'children'
             },
             defaultProps1: {
                 value: 'id', // 唯一标识