Parcourir la source

update: shop editor

dev
powersir il y a 1 an
Parent
révision
6e4114b50f
2 fichiers modifiés avec 40 ajouts et 18 suppressions
  1. +21
    -12
      src/pages/system/shop/manage/index.tsx
  2. +19
    -6
      src/pages/system/shop/manage/shop-editor.tsx

+ 21
- 12
src/pages/system/shop/manage/index.tsx Voir le fichier

@@ -28,10 +28,9 @@ export default () => {
}
};


const showDeleteConfirm = (data: PlatformShop) => {
antdUtils.modal?.confirm({
title: '确认要将该菜单删除吗?',
title: '确认要将该店铺删除吗?',
icon: <ExclamationCircleFilled />,
content: '请注意删除以后不可恢复!',
okText: '删除',
@@ -174,26 +173,36 @@ export default () => {
return (
<>
<div>
{/* <Card className='mt-[4px] dark:bg-[rgb(33,41,70)] bg-white roundle-lg px[12px]' bodyStyle={{ paddingTop: 4, paddingBottom: 4 }}>
<Card className='mt-[4px] dark:bg-[rgb(33,41,70)] bg-white roundle-lg px[12px]' bodyStyle={{ paddingTop: 4, paddingBottom: 4 }}>
<div className='flex justify-between content-center'>
<div className='flex justify-normal items-center'>
<Form layout='inline' form={searchFrom}>
<Form.Item name="name" label="租户名称">
<Input className='w-[150px]' placeholder='请输入名称' allowClear />
<Form.Item name="shopName" label="店铺名称">
<Input className='w-[140px]' placeholder='请输入名称' allowClear />
</Form.Item>
<Form.Item name="platformId" label="平台">
<Input className='w-[140px]' placeholder='请选择' allowClear />
</Form.Item>
<Form.Item name="contactName" label="租户名称">
<Input className='w-[150px]' placeholder='请输入联系人' allowClear />
<Form.Item name="shopManagerId" label="所属店长">
<Input className='w-[140px]' placeholder='请输入' allowClear />
</Form.Item>
<Form.Item name="contactMobile" label="联系人手机">
<Input className='w-[160px]' placeholder='请输入联系人手机' allowClear />
<Form.Item name="shopStaffId" label="所属商户">
<Input className='w-[140px]' placeholder='请输入' allowClear />
</Form.Item>
<Form.Item className='ml-2 w-[130px]' name="status" label="状态">
<Form.Item className='ml-2 w-[130px]' name="shopStatus" label="状态">
<Select placeholder="请选择" allowClear >
<Select.Option value="">全部</Select.Option>
<Select.Option value="0">开启</Select.Option>
<Select.Option value="1">关闭</Select.Option>
</Select>
</Form.Item>
<Form.Item className='ml-2 w-[150px]' name="tokenFlag" label="授权状态">
<Select placeholder="请选择" allowClear >
<Select.Option value="">全部</Select.Option>
<Select.Option value="0">成功</Select.Option>
<Select.Option value="1">失败</Select.Option>
</Select>
</Form.Item>
</Form>
<Space.Compact className="ml-5">
<Button type='primary' size='large' icon={<SearchOutlined />} onClick={load}> 搜索 </Button>
@@ -204,10 +213,10 @@ export default () => {
<Button className="ml-5" type='primary' size='large' icon={<PlusOutlined />} onClick={() => {
seEditData(undefined);
seEditorVisable(true);
}}> 新增租户 </Button>
}}> 新增店铺 </Button>
</div>
</div>
</Card> */}
</Card>
<Card className='mt-[4px] dark:bg-[rgb(33,41,70)] bg-white roundle-lg px[12px]'>
<Table rowKey="id"
scroll={{ x: true }}


+ 19
- 6
src/pages/system/shop/manage/shop-editor.tsx Voir le fichier

@@ -59,15 +59,16 @@ const TenantEditor: React.FC<EditorProps> = (props) => {
form.resetFields();
shopForm.resetFields();
}
setCurrent(0);
}, [visible]);

const save = async () => {
await shopForm.validateFields();
setSaveLoading(true);
const fieldValues = form.getFieldsValue();
const expireTime = dayjs(form.getFieldValue('expiresTime')).toDate().getTime();
const expiresTime = dayjs(form.getFieldValue('expiresTime')).toDate().getTime();
const shopFieldValues = shopForm.getFieldsValue();
const newValue = isEdit ? { ...data, ...fieldValues, expireTime, shopConfig: { ...shopFieldValues } } : { ...fieldValues, expireTime, shopConfig: { ...shopFieldValues } };
const newValue = isEdit ? { ...data, ...fieldValues, expiresTime, shopConfig: { ...shopFieldValues } } : { ...fieldValues, expiresTime, shopConfig: { ...shopFieldValues } };
const [error, { msg, code }] = isEdit ? await updateApi(newValue) : await createApi(newValue);
if (!error && code === 0) {
onSave(newValue);
@@ -97,7 +98,7 @@ const TenantEditor: React.FC<EditorProps> = (props) => {
title: '商户设置'
},
{
title: '平台店铺配置',
title: '店铺配置',
}
]} />

@@ -155,8 +156,20 @@ const TenantEditor: React.FC<EditorProps> = (props) => {
message: '请设置状态',
},]}>
<Radio.Group options={[
{ value: 0, label: "开启" },
{ value: 1, label: "关闭" }
{ value: 1, label: "开启" },
{ value: 2, label: "停用" }
]} optionType="default">
</Radio.Group>
</Form.Item>

<Form.Item name="tokenFlag" label="授权状态" rules={[{
required: true,
message: '请设置授权状态',
},]}>
<Radio.Group options={[
{ value: 0, label: "未授权不能为空" },
{ value: 1, label: "成功" },
{ value: 2, label: "失败" }
]} optionType="default">
</Radio.Group>
</Form.Item>
@@ -177,7 +190,7 @@ const TenantEditor: React.FC<EditorProps> = (props) => {
message: '请设置店铺',
},
]}>
<Input />
<InputNumber />
</Form.Item>
<Form.Item name="iossNo" label="欧盟税号">
<Input />


Chargement…
Annuler
Enregistrer