添加正元同步表单项

This commit is contained in:
weiwei committed 2025-03-21 17:29:51 +08:00
1 parent 9969dc2b41
commit 7bfc398c59
2 files changed
+21 -4

No files matched your search

+11 -1
View File
@@ -1,6 +1,6 @@
<template>
<el-dialog :title="form.id ? '编辑' : '新增'" width="40%" v-model="visible" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px" v-loading="loading">
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="110px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="商户名" prop="name">
@@ -31,6 +31,12 @@
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item v-if="useUserInfo().userInfos.roleCodes.includes('ROLE_ADMIN')" label="是否同步到正元" prop="isSyncZy">
<el-switch v-model="form.isSyncZy" />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="商户logo" prop="logoPic">
<upload-img v-model:imageUrl="form.logoPic" />
@@ -108,6 +114,7 @@ import { useDict } from "/@/hooks/dict"
import { useMessage } from "/@/hooks/message"
import { getObj, addObj, putObj } from "/@/api/wallet/mch-manage"
const emit = defineEmits(["refresh"])
import { useUserInfo } from "/@/stores/userInfo"
// 定义变量内容
const dataFormRef = ref()
@@ -126,6 +133,7 @@ const form = reactive({
logoPic: "",
collectMoneyCode: "",
swiperPic: "",
isSyncZy: false,
phone: "",
businessTime: "",
address: "",
@@ -175,6 +183,7 @@ const onSubmit = async () => {
if (!valid) return false
const _pa = {
...form,
isSyncZy: form.isSyncZy ? "1" : "0",
types: form.merchantType,
jobTime: (jobTime.morning?.join("-") || "") + "," + (jobTime.noon?.join("-") || "") + "," + (jobTime.evening?.join("-") || ""),
}
@@ -201,6 +210,7 @@ const getmerchantInfoData = async (id: string) => {
const resJobTime = res.data.jobTime && regex.test(res.data.jobTime) ? res.data.jobTime.split(",") : []
Object.assign(form, res.data, {
merchantType: res.data.types,
isSyncZy: res.data.isSyncZy == "1" ? true : false,
})
jobTime.morning = resJobTime[0]?.split("-") ?? []
jobTime.noon = resJobTime[1]?.split("-") ?? []