优化功能
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
This commit is contained in:
@@ -15,6 +15,7 @@ import { TableAction } from '#/components/table-action';
|
||||
|
||||
// 导入药店管理相关的API(直接使用store的API)
|
||||
import {
|
||||
batchSyncDrugPriceApi,
|
||||
deleteStore,
|
||||
openPcWindowsApiByStore,
|
||||
openQrCodeApi,
|
||||
@@ -175,6 +176,26 @@ const updateSubscribe = (id: number) => {
|
||||
gridApi.query();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量同步总仓库药品
|
||||
*/
|
||||
const batchSyncDrugPrice = () => {
|
||||
const records = gridApi.grid.getCheckboxRecords();
|
||||
if (records.length === 0) {
|
||||
message.warning('请至少选择一条记录!');
|
||||
return;
|
||||
}
|
||||
const ids = records.map((item) => item.id);
|
||||
batchSyncDrugPriceApi(ids)
|
||||
.then((res) => {
|
||||
message.success(`批量同步任务已创建,共 ${res.data.success} 个门店的任务已提交!`);
|
||||
gridApi.query();
|
||||
})
|
||||
.catch(() => {
|
||||
message.error('批量同步失败!');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -203,6 +224,15 @@ const updateSubscribe = (id: number) => {
|
||||
confirm: deleteApi.bind(null, false),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '同步总仓库药品',
|
||||
icon: 'ant-design:sync-outlined',
|
||||
ifShow: hasTopTableDropDownActions,
|
||||
popConfirm: {
|
||||
title: '确定要同步选中门店的总仓库药品吗?同步将更新价格、上架下架状态,并自动添加新药品。',
|
||||
confirm: batchSyncDrugPrice,
|
||||
},
|
||||
},
|
||||
]"
|
||||
>
|
||||
<template #more>
|
||||
|
||||
@@ -139,3 +139,13 @@ export async function updateStoreDrugPricesApi(data: {
|
||||
}) {
|
||||
return requestClient.post<any>(`${prefix}update-store-drug-prices`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量同步总仓库药品
|
||||
* @param ids 门店ID数组
|
||||
*/
|
||||
export async function batchSyncDrugPriceApi(ids: number[]) {
|
||||
return requestClient.post<any>(`${prefix}batch-sync-drug-price`, {
|
||||
ids,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import QrCodePreview from '#/components/modal/QrCodePreview.vue';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
|
||||
import {
|
||||
batchSyncDrugPriceApi,
|
||||
deleteStore,
|
||||
openPcWindowsApiByStore,
|
||||
openQrCodeApi,
|
||||
@@ -168,6 +169,26 @@ const updateSubscribe = (id: number) => {
|
||||
gridApi.query();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量同步总仓库药品
|
||||
*/
|
||||
const batchSyncDrugPrice = () => {
|
||||
const records = gridApi.grid.getCheckboxRecords();
|
||||
if (records.length === 0) {
|
||||
message.warning('请至少选择一条记录!');
|
||||
return;
|
||||
}
|
||||
const ids = records.map((item) => item.id);
|
||||
batchSyncDrugPriceApi(ids)
|
||||
.then((res) => {
|
||||
message.success(`批量同步任务已创建,共 ${res.data.success} 个门店的任务已提交!`);
|
||||
gridApi.query();
|
||||
})
|
||||
.catch(() => {
|
||||
message.error('批量同步失败!');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -199,6 +220,15 @@ const updateSubscribe = (id: number) => {
|
||||
confirm: deleteApi.bind(null, false),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '同步总仓库药品',
|
||||
icon: 'ant-design:sync-outlined',
|
||||
ifShow: hasTopTableDropDownActions,
|
||||
popConfirm: {
|
||||
title: '确定要同步选中门店的总仓库药品吗?同步将更新价格、上架下架状态,并自动添加新药品。',
|
||||
confirm: batchSyncDrugPrice,
|
||||
},
|
||||
},
|
||||
]"
|
||||
>
|
||||
<template #more>
|
||||
|
||||
Reference in New Issue
Block a user