fix: 商城仓库管理
This commit is contained in:
@@ -67,3 +67,11 @@ export async function openQrCodeApi(id: number) {
|
||||
id,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新门店包邮状态
|
||||
* @param data
|
||||
*/
|
||||
export async function updateStoreShippingFree(data: { id: number }) {
|
||||
return requestClient.post<any>(`${prefix}update-shipping-free`, data);
|
||||
}
|
||||
|
||||
@@ -79,6 +79,34 @@ export const modalFormProps: VbenFormProps = {
|
||||
label: 'ERP ID',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
formItemClass: 'col-span-6',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '诊所', value: 0 },
|
||||
{ label: '药店', value: 1 },
|
||||
],
|
||||
placeholder: '请选择门店类型',
|
||||
},
|
||||
fieldName: 'type',
|
||||
label: '门店类型',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
formItemClass: 'col-span-6',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '不包邮', value: 0 },
|
||||
{ label: '包邮', value: 1 },
|
||||
],
|
||||
placeholder: '是否包邮',
|
||||
},
|
||||
fieldName: 'is_shipping_free',
|
||||
label: '是否包邮',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'VbenInput',
|
||||
formItemClass: 'col-span-6',
|
||||
|
||||
@@ -33,6 +33,19 @@ export const formOptions: VbenFormProps = {
|
||||
fieldName: 'mobile',
|
||||
label: '联系人手机号',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
placeholder: '请选择类型',
|
||||
options: [
|
||||
{ label: '诊所', value: 0 },
|
||||
{ label: '药店', value: 1 },
|
||||
],
|
||||
},
|
||||
defaultValue: undefined,
|
||||
fieldName: 'type',
|
||||
label: '类型',
|
||||
},
|
||||
// {
|
||||
// component: 'RangePicker',
|
||||
// componentProps: {
|
||||
|
||||
@@ -25,6 +25,20 @@ export const gridOptions: VxeGridProps<RowType> = {
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{ field: 'id', align: 'left', title: 'ID', width: 100 },
|
||||
{ field: 'name', align: 'left', title: '诊所名称' },
|
||||
{
|
||||
field: 'type',
|
||||
align: 'left',
|
||||
title: '类型',
|
||||
slots: { default: 'type' },
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
field: 'is_shipping_free',
|
||||
align: 'left',
|
||||
title: '是否包邮',
|
||||
slots: { default: 'is_shipping_free' },
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
field: 'qr_code',
|
||||
align: 'left',
|
||||
|
||||
@@ -6,14 +6,19 @@ import { ref } from 'vue';
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { useClipboard } from '@vueuse/core';
|
||||
import { Button, Image, message, Tag } from 'ant-design-vue';
|
||||
import { Button, Image, message, Switch, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { Icon } from '#/components/icon';
|
||||
import QrCodePreview from '#/components/modal/QrCodePreview.vue';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
|
||||
import { deleteStore, openPcWindowsApiByStore, openQrCodeApi } from './api';
|
||||
import {
|
||||
deleteStore,
|
||||
openPcWindowsApiByStore,
|
||||
openQrCodeApi,
|
||||
updateStoreShippingFree,
|
||||
} from './api';
|
||||
import FormModalDemo from './components/modal.vue';
|
||||
import { formOptions } from './config/search';
|
||||
import { gridOptions } from './config/table';
|
||||
@@ -103,6 +108,16 @@ function copyText(source) {
|
||||
message.success('复制成功');
|
||||
}
|
||||
const { copy } = useClipboard({ legacy: true });
|
||||
|
||||
/**
|
||||
* 更新包邮状态
|
||||
*/
|
||||
const updateShippingFree = (id: number) => {
|
||||
updateStoreShippingFree({ id }).then(() => {
|
||||
message.success('修改成功!');
|
||||
gridApi.query();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -169,6 +184,21 @@ const { copy } = useClipboard({ legacy: true });
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
<Tag :color="row.type === 1 ? 'blue' : 'green'">
|
||||
{{ row.type === 1 ? '药店' : '诊所' }}
|
||||
</Tag>
|
||||
</template>
|
||||
<template #is_shipping_free="{ row }">
|
||||
<Switch
|
||||
:checked="row.is_shipping_free"
|
||||
:checked-value="1"
|
||||
:un-checked-value="0"
|
||||
checked-children="包邮"
|
||||
un-checked-children="不包邮"
|
||||
@click="updateShippingFree(row.id)"
|
||||
/>
|
||||
</template>
|
||||
<template #start-time="{ row }">
|
||||
早:<Tag color="success">{{ row.start_time }}</Tag>
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user