|
@@ -3,14 +3,6 @@
|
|
|
<BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
|
|
|
<template #toolbar>
|
|
|
<a-button type="primary" @click="exportExcel"> 导出</a-button>
|
|
|
- <PopConfirmButton
|
|
|
- title="是否确定收货?"
|
|
|
- primary
|
|
|
- color="error"
|
|
|
- @confirm="handleConfirmReceive"
|
|
|
- >
|
|
|
- 确定收货</PopConfirmButton
|
|
|
- >
|
|
|
</template>
|
|
|
<template #cover="{ record }">
|
|
|
<TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
|
|
@@ -35,6 +27,7 @@
|
|
|
icon: 'mdi:truck-delivery',
|
|
|
label: '发货',
|
|
|
color: 'warning',
|
|
|
+ disabled: record.shippingStatus == 1,
|
|
|
onClick: sendPackage.bind(null, record),
|
|
|
},
|
|
|
{
|
|
@@ -47,6 +40,16 @@
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ icon: 'ic:outline-living',
|
|
|
+ label: '收货',
|
|
|
+ color: 'warning',
|
|
|
+ disabled: record.orderStatus !== 1,
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否确认收货',
|
|
|
+ confirm: handleConfirmReceive.bind(null, record),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
icon: 'mdi:printer-outline',
|
|
|
label: '打印',
|
|
|
color: 'error',
|
|
@@ -72,12 +75,17 @@
|
|
|
} from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
- import { ListApi, BrandListApi, GetOrderInfoApi, exportExcelApi } from '/@/api/order/list';
|
|
|
+ import {
|
|
|
+ ListApi,
|
|
|
+ BrandListApi,
|
|
|
+ GetOrderInfoApi,
|
|
|
+ exportExcelApi,
|
|
|
+ confirmOrder,
|
|
|
+ } from '/@/api/order/list';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
// import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
|
import { useGo } from '/@/hooks/web/usePage';
|
|
|
import { Time } from '/@/components/Time';
|
|
|
- import { PopConfirmButton } from '/@/components/Button';
|
|
|
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import ConfirmModal from './confirmModal.vue';
|
|
@@ -95,7 +103,6 @@
|
|
|
TableAction,
|
|
|
TableImg,
|
|
|
Time,
|
|
|
- PopConfirmButton,
|
|
|
ConfirmModal,
|
|
|
PrintModal,
|
|
|
},
|
|
@@ -180,7 +187,7 @@
|
|
|
slots: { customRender: 'action' },
|
|
|
fixed: 'right',
|
|
|
align: 'center',
|
|
|
- width: 230,
|
|
|
+ width: 280,
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -268,11 +275,15 @@
|
|
|
],
|
|
|
};
|
|
|
|
|
|
+ const getCheckboxProps = (record: Recordable) => {
|
|
|
+ console.log('record', record);
|
|
|
+ return { disabled: record.type == 2 };
|
|
|
+ };
|
|
|
const [registerConfirmModal, { openModal: openConfirmModal }] = useModal();
|
|
|
|
|
|
const [registerPrintModal, { openModal: openPrintModal }] = useModal();
|
|
|
|
|
|
- const [registerTable, { getSelectRowKeys, getSelectRows, reload }] = useTable({
|
|
|
+ const [registerTable, { getSelectRows, reload }] = useTable({
|
|
|
title: '订单列表',
|
|
|
api: ListApi,
|
|
|
columns: columns,
|
|
@@ -349,20 +360,18 @@
|
|
|
function sendPackage(record: Recordable) {
|
|
|
openConfirmModal(true, record);
|
|
|
}
|
|
|
- async function handleConfirmReceive() {
|
|
|
- const keys = getSelectRowKeys();
|
|
|
- if (keys.length === 1) {
|
|
|
- // const { id,brandId} = keys[0]
|
|
|
- // await confirmOrder({
|
|
|
- // id,brandId
|
|
|
- // })
|
|
|
- } else {
|
|
|
- createMessage.info(t('modal.onatLeastOne'));
|
|
|
- return;
|
|
|
+ async function handleConfirmReceive(record: Recordable) {
|
|
|
+ const { id, brandId } = record;
|
|
|
+ let res = await confirmOrder({
|
|
|
+ id,
|
|
|
+ brandId,
|
|
|
+ });
|
|
|
+ if (res) {
|
|
|
+ reload();
|
|
|
+ createMessage.success('操作成功');
|
|
|
}
|
|
|
}
|
|
|
async function printDetail(record: Recordable) {
|
|
|
- console.log('record', record);
|
|
|
const orderInfo = await GetOrderInfoApi({
|
|
|
id: record.id,
|
|
|
brandId: record.brandId,
|
|
@@ -407,6 +416,7 @@
|
|
|
printDetail,
|
|
|
registerPrintModal,
|
|
|
exportExcel,
|
|
|
+ getCheckboxProps,
|
|
|
};
|
|
|
},
|
|
|
});
|