|
@@ -42,13 +42,17 @@ userId: 17
|
|
|
userName: "微信用户q0zj95zuo4pv" -->
|
|
|
<template>
|
|
|
<div class="p-4">
|
|
|
- <BasicTable
|
|
|
- @register="registerTable"
|
|
|
- :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
|
|
|
- >
|
|
|
+ <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
|
|
|
<template #toolbar>
|
|
|
- <a-button type="primary" @click="sendPackage"> 发货</a-button>
|
|
|
- <!-- dashed link text-->
|
|
|
+ <!-- <a-button type="primary" @click="sendPackage"> 发货</a-button> -->
|
|
|
+ <PopConfirmButton
|
|
|
+ title="是否确定收货?"
|
|
|
+ primary
|
|
|
+ color="error"
|
|
|
+ @confirm="handleConfirmReceive"
|
|
|
+ >
|
|
|
+ 确定收货</PopConfirmButton
|
|
|
+ >
|
|
|
</template>
|
|
|
<template #cover="{ record }">
|
|
|
<TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
|
|
@@ -70,6 +74,12 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
+ icon: 'mdi:truck-delivery',
|
|
|
+ label: '发货',
|
|
|
+ color: 'warning',
|
|
|
+ onClick: sendPackage.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
icon: 'mdi:information-outline',
|
|
|
label: '详情',
|
|
|
onClick: () => {
|
|
@@ -88,6 +98,7 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
/>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
+ <ConfirmModal @register="registerConfirmModal" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
@@ -101,7 +112,6 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
TableImg,
|
|
|
} from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { uploadApi } from '/@/api/sys/upload';
|
|
|
// import { Switch } from 'ant-design-vue';
|
|
|
// import { h } from 'vue';
|
|
|
import { ListApi } from '/@/api/order/list';
|
|
@@ -109,9 +119,12 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
// 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';
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, TableAction, TableImg, Time },
|
|
|
+ components: { BasicTable, TableAction, TableImg, Time, PopConfirmButton, ConfirmModal },
|
|
|
setup() {
|
|
|
const { createMessage } = useMessage();
|
|
|
const go = useGo();
|
|
@@ -126,8 +139,8 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
{
|
|
|
title: '订单号',
|
|
|
dataIndex: 'orderSn',
|
|
|
-
|
|
|
- width: 160,
|
|
|
+ ellipsis: false,
|
|
|
+ width: 180,
|
|
|
},
|
|
|
{
|
|
|
title: '会员昵称',
|
|
@@ -192,7 +205,8 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
dataIndex: '',
|
|
|
slots: { customRender: 'action' },
|
|
|
fixed: 'right',
|
|
|
- width: 140,
|
|
|
+ align: 'center',
|
|
|
+ width: 230,
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -211,7 +225,9 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
],
|
|
|
};
|
|
|
|
|
|
- const [registerTable] = useTable({
|
|
|
+ const [registerConfirmModal, { openModal: openConfirmModal }] = useModal();
|
|
|
+
|
|
|
+ const [registerTable, { getSelectRowKeys }] = useTable({
|
|
|
title: '订单列表',
|
|
|
api: ListApi,
|
|
|
columns: columns,
|
|
@@ -279,13 +295,20 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
return '';
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- function sendPackage() {
|
|
|
- console.log('sendPackage');
|
|
|
+ // function onSelectChange(selectedRowKeys: (string | number)[]) {
|
|
|
+ // console.log(selectedRowKeys);
|
|
|
+ // // checkedKeys.value = selectedRowKeys;
|
|
|
+ // }
|
|
|
+ function sendPackage(record: Recordable) {
|
|
|
+ openConfirmModal(true, record);
|
|
|
}
|
|
|
- function onSelectChange(selectedRowKeys: (string | number)[]) {
|
|
|
- console.log(selectedRowKeys);
|
|
|
- // checkedKeys.value = selectedRowKeys;
|
|
|
+
|
|
|
+ function handleConfirmReceive() {
|
|
|
+ const keys = getSelectRowKeys();
|
|
|
+ if (keys.length === 0) {
|
|
|
+ createMessage.info(t('modal.atLeastOne'));
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return {
|
|
@@ -298,8 +321,9 @@ userName: "微信用户q0zj95zuo4pv" -->
|
|
|
rendershippingStatusLabel,
|
|
|
renderpayStatusLabel,
|
|
|
sendPackage,
|
|
|
- onSelectChange,
|
|
|
- uploadApi: uploadApi as any,
|
|
|
+ // onSelectChange,
|
|
|
+ handleConfirmReceive,
|
|
|
+ registerConfirmModal,
|
|
|
};
|
|
|
},
|
|
|
});
|