商户类型改为单选

This commit is contained in:
weiwei committed 2025-03-06 19:57:31 +08:00
1 parent e7e59c9f56
commit 1d8b93a905
1 file changed
+6 -8
+6 -8
View File
@@ -22,11 +22,9 @@
<el-col :span="24" class="mb20">
<el-form-item label="商户类型" prop="merchantType">
<el-checkbox-group v-model="form.merchantType">
<el-checkbox :label="item.value" v-for="(item, index) in merchant_type" border :key="index">
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<el-radio-group v-model="form.merchantType">
<el-radio :label="item.value" v-for="(item, index) in merchant_type" border :key="index">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@@ -99,7 +97,7 @@ const form = reactive({
id: "",
deptId: "",
name: "",
merchantType: [],
merchantType: "",
logoPic: "",
collectMoneyCode: "",
swiperPic: "",
@@ -153,7 +151,7 @@ const parseDate = (timeString: string) => {
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false
const _pa = { ...form, types: form.merchantType.join(",") }
const _pa = { ...form, types: form.merchantType }
if (_pa.rangeDate && _pa.rangeDate.length) {
_pa.jobStartTime = parseDate(_pa.rangeDate[0])
_pa.jobEndTime = parseDate(_pa.rangeDate[1])
@@ -179,7 +177,7 @@ const getmerchantInfoData = (id: string) => {
.then((res: any) => {
const data = res.data
Object.assign(form, data, {
merchantType: data.types.split(","),
merchantType: data.types,
rangeDate: [data.jobStartTime, data.jobEndTime],
})
})