From c8c2f28f9008989f8035da5e78c262b326707065 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 22 五月 2025 17:04:39 +0800 Subject: [PATCH] Merge branch 'dev-ui' of http://120.26.58.240:8888/r/LifePaymentFront into dev-ui --- packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue | 43 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 34 insertions(+), 9 deletions(-) diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue index f29dc02..d58c43d 100644 --- a/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue +++ b/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue @@ -4,8 +4,16 @@ ref="formRef" :rules="rules" label-position="top" - class="order-bill-recharge electric" + class="order-bill-recharge electric chunk-form" > + <slot name="top"></slot> + <NutFormItem label="鎵�鍦ㄥ煄甯�" class="bole-form-item" prop="areaList" required> + <ChooseInputWithAreaPicker + :columns="cityAreaTree" + v-model="form.areaList" + placeholder="璇烽�夋嫨鎵�鍦ㄥ煄甯�" + ></ChooseInputWithAreaPicker> + </NutFormItem> <NutFormItem label="缂磋垂鎴峰彿" class="bole-form-item" prop="gasAccount" required> <NutInput v-model.trim="form.gasAccount" @@ -13,6 +21,14 @@ placeholder="璇疯緭鍏ョ即璐规埛鍙�" type="text" max-length="13" + /> + </NutFormItem> + <NutFormItem label="鎴蜂富濮撳悕" class="bole-form-item" prop="name" required> + <NutInput + v-model.trim="form.name" + class="bole-input-text" + placeholder="璇峰~鍐欐埛涓诲鍚�" + type="text" /> </NutFormItem> <slot></slot> @@ -23,24 +39,33 @@ import { Form as NutForm, FormItem as NutFormItem, Input as NutInput } from '@nutui/nutui-taro'; import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; import { reactive, ref, computed, watch } from 'vue'; -import { useGetGasParValue } from '../../hooks'; +import ChooseInputWithAreaPicker from '../../components/Input/ChooseInputWithAreaPicker.vue'; +import { useAllAreaList } from '../../hooks/area'; +import { FormValidator } from '../../utils'; defineOptions({ name: 'GasBillRechargeBaseForm', }); -const form = defineModel<{ - province: string; - city: string; - gasAccount: string; -}>('form'); +const { findAreaNameFromCode, cityAreaTree } = useAllAreaList(); -const { gasParValueList } = useGetGasParValue(); +const form = defineModel<{ + // province: string; + // city: string; + gasAccount: string; + areaList: string[]; + name: string; +}>('form'); const rules = reactive<FormRules>({ province: [{ required: true, message: '璇烽�夋嫨鎵�鍦ㄥ尯鍩�' }], city: [{ required: true, message: '璇烽�夋嫨鎵�鍦ㄥ煄甯�' }], - gasAccount: [{ required: true, message: '璇疯緭鍏ョ即璐规埛鍙�', regex: /^\d{13}$/ }], + // gasAccount: [{ required: true, message: '璇疯緭鍏ョ即璐规埛鍙�', regex: /^\d{13}$/ }], + gasAccount: [{ required: true, message: '璇疯緭鍏ョ即璐规埛鍙�' }], + areaList: [ + { required: true, message: '璇烽�夋嫨鎵�鍦ㄥ煄甯�', validator: FormValidator.validatorArray }, + ], + name: [{ required: true, message: '璇峰~鍐欐埛涓诲鍚�' }], }); const formRef = ref<any>(null); -- Gitblit v1.9.1