|
@@ -22,7 +22,10 @@
|
22
|
22
|
:data="ptAreaOptions"
|
23
|
23
|
:props="{ value: 'areaId', label: 'areaName', children: 'children' }"
|
24
|
24
|
value-key="areaId"
|
|
25
|
+ node-key="areaId"
|
|
26
|
+ :highlight-current="true"
|
25
|
27
|
placeholder="请选择餐厅"
|
|
28
|
+ @current-change="handleClickNode"
|
26
|
29
|
/>
|
27
|
30
|
</el-form-item>
|
28
|
31
|
</el-col>
|
|
@@ -104,6 +107,7 @@ import { queryRoom2AreaList } from '@/api/basics/room/ptRoom';
|
104
|
107
|
import * as XfTermApi from '@/api/consumption/xfTerm';
|
105
|
108
|
import { XfTermForm } from '@/api/consumption/xfTerm/types';
|
106
|
109
|
import { useI18n } from 'vue-i18n';
|
|
110
|
+import { number } from 'vue-types';
|
107
|
111
|
|
108
|
112
|
defineOptions({ name: 'XfTermForm' });
|
109
|
113
|
|
|
@@ -246,6 +250,11 @@ const open = async (type: string, id?: number) => {
|
246
|
250
|
}
|
247
|
251
|
}
|
248
|
252
|
};
|
|
253
|
+
|
|
254
|
+const handleClickNode = (data: PtAreaOption, node: any) => {
|
|
255
|
+ // console.log(data, node, 'handleClickNode');
|
|
256
|
+};
|
|
257
|
+
|
249
|
258
|
/** 表单重置 */
|
250
|
259
|
const resetForm = () => {
|
251
|
260
|
formData.value = {
|
|
@@ -324,9 +333,16 @@ const emit = defineEmits(['success']);
|
324
|
333
|
/** 提交按钮 */
|
325
|
334
|
const submitForm = async () => {
|
326
|
335
|
// 校验表单
|
|
336
|
+ // console.log(typeof formData.value.roomId);
|
327
|
337
|
if (!formRef.value) return;
|
328
|
338
|
const valid = await formRef.value?.validate();
|
329
|
339
|
if (!valid) return;
|
|
340
|
+ // 校验选择的餐厅 是不是 房间
|
|
341
|
+ // console.log(typeof formData.value.roomId);
|
|
342
|
+ if (formData.value.roomId && typeof formData.value.roomId !== 'number') {
|
|
343
|
+ proxy?.$modal.msgError('所属餐厅只能选择房间,校区、楼栋、楼层不能选择!');
|
|
344
|
+ return;
|
|
345
|
+ }
|
330
|
346
|
// 提交请求
|
331
|
347
|
formLoading.value = true;
|
332
|
348
|
try {
|