Преглед на файлове

feat: 协同办公优化

liujt преди 3 дни
родител
ревизия
573056dca2

+ 62 - 17
src/BIZComponents/processSubmitDialog/components/businessTripComponent.vue

@@ -84,7 +84,7 @@
             top="5vh"
             :close-on-press-escape="false"
             append-to-body
-            width="70%"
+            width="50%"
             :maxable="true"
             destroy-on-close
         >
@@ -100,10 +100,18 @@
                             trigger: 'change'
                         }"
                     >
-                        <el-input
+                        <el-select
+                            style="width: 100%;"
                             v-model="form.transportation"
-                            placeholder="请输入"
-                        ></el-input>
+                            placeholder="请选择"
+                        >
+                            <el-option
+                                v-for="item in transportationOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                            ></el-option>
+                        </el-select>
                     </el-form-item>
         
                     <el-form-item
@@ -116,10 +124,18 @@
                             trigger: 'change'
                         }"
                     >
-                        <el-input
+                        <el-select
+                            style="width: 100%;"
                             v-model="form.isRoundTrip"
-                            placeholder="请输入"
-                        ></el-input>
+                            placeholder="请选择"
+                        >
+                            <el-option
+                                v-for="item in isRoundTripOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                            ></el-option>
+                        </el-select>
                     </el-form-item>
                     <el-form-item 
                         label="出发城市" 
@@ -131,10 +147,11 @@
                                 trigger: 'change'
                             }"
                     >
-                        <el-input
+                        <!-- <el-input
                             v-model="form.departureCity"
                             placeholder="请输入"
-                        ></el-input>
+                        ></el-input> -->
+                        <regions-select style="width: 100%;" valueField="label" v-model="form.departureCity" placeholder="请选择省市区"/>
                     </el-form-item>
                     <el-form-item 
                         label="目的城市" 
@@ -146,10 +163,11 @@
                                 trigger: 'change'
                             }"
                     >
-                        <el-input
+                        <!-- <el-input
                             v-model="form.destinationCity"
                             placeholder="请输入"
-                        ></el-input>
+                        ></el-input> -->
+                        <regions-select style="width: 100%;" valueField="label" v-model="form.destinationCity" placeholder="请选择省市区"/>
                     </el-form-item>
                     <el-form-item 
                         label="开始时间" 
@@ -193,11 +211,6 @@
                         label="时长" 
                         label-width="110px" 
                         prop="duration"
-                        :rules="{
-                                required: true,
-                                message: '请选择开始/结束时间',
-                                trigger: 'change'
-                            }"
                     >
                         <el-input
                             v-model="form.duration"
@@ -216,7 +229,11 @@
     </div>
 </template>
 <script>
+import RegionsSelect from '@/components/RegionsSelect/index.vue';
 export default {
+    components: {
+        RegionsSelect
+    },
     props: {
         info: {
             type: Object,
@@ -269,7 +286,35 @@ export default {
             visible: false,
             currentItem: {},
             currentIndex: null,
-            type: 'add'
+            type: 'add',
+            transportationOptions: [
+                {
+                    label: '飞机',
+                    value: '飞机'
+                },
+                {
+                    label: '火车',
+                    value: '火车'
+                },
+                {
+                    label: '汽车',
+                    value: '汽车'
+                },
+                {
+                    label: '其他',
+                    value: '其他'
+                }
+            ],
+            isRoundTripOptions: [
+                {
+                    label: '单程',
+                    value: '单程'
+                },
+                {
+                    label: '往返',
+                    value: '往返'
+                }
+            ]
         }
     },
     mounted() {

+ 9 - 3
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -993,11 +993,17 @@ this.postOptions.push(...response.data);
             }
           });
 
-          // 检查每个组件的数据是否为空数组
+          // 检查每个组件的数据是否为空
           let emptyComponents = [];
           validArr.forEach((item) => {
-            // 检查data[item]是否存在且为数组,并且长度为0
-            if (Array.isArray(data[item]) && data[item].length === 0) {
+            const val = data[item];
+            // 为空(null/undefined/空字符串)或为数组且长度为0,均视为未填写
+            if (
+              val === null ||
+              val === undefined ||
+              val === '' ||
+              (Array.isArray(val) && val.length === 0)
+            ) {
               emptyComponents.push(item);
             }
           });