|
@@ -57,6 +57,7 @@
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
<ConfirmModal @register="registerConfirmModal" @reload="reload" />
|
|
|
+ <PrintModal @register="registerPrintModal" @reload="reload" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
@@ -72,17 +73,27 @@
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
// import { Switch } from 'ant-design-vue';
|
|
|
// import { h } from 'vue';
|
|
|
- import { ListApi, BrandListApi } from '/@/api/order/list';
|
|
|
+ import { ListApi, BrandListApi, GetOrderInfoApi } 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 printJS from 'print-js';
|
|
|
+ // import printJS from 'print-js';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import ConfirmModal from './confirmModal.vue';
|
|
|
+ import PrintModal from './printModal.vue';
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, TableAction, TableImg, Time, PopConfirmButton, ConfirmModal },
|
|
|
+ components: {
|
|
|
+ BasicTable,
|
|
|
+ TableAction,
|
|
|
+ TableImg,
|
|
|
+ Time,
|
|
|
+ PopConfirmButton,
|
|
|
+ ConfirmModal,
|
|
|
+ PrintModal,
|
|
|
+ },
|
|
|
setup() {
|
|
|
const { createMessage } = useMessage();
|
|
|
const go = useGo();
|
|
@@ -254,6 +265,8 @@
|
|
|
|
|
|
const [registerConfirmModal, { openModal: openConfirmModal }] = useModal();
|
|
|
|
|
|
+ const [registerPrintModal, { openModal: openPrintModal }] = useModal();
|
|
|
+
|
|
|
const [registerTable, { getSelectRowKeys, reload }] = useTable({
|
|
|
title: '订单列表',
|
|
|
api: ListApi,
|
|
@@ -337,21 +350,27 @@
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- function printDetail(record: Recordable) {
|
|
|
+ async function printDetail(record: Recordable) {
|
|
|
console.log('record', record);
|
|
|
- printJS({
|
|
|
- printable: [
|
|
|
- { name: '订单号', email: '20210908174503807397842', phone: '123' },
|
|
|
- { name: 'qq', email: '456@gmail.com', phone: '456' },
|
|
|
- ],
|
|
|
- properties: ['name', 'email', 'phone'],
|
|
|
- type: 'json',
|
|
|
- gridHeaderStyle: 'color: red; border: 2px solid #3971A5;',
|
|
|
- gridStyle: 'border: 2px solid #3971A5;',
|
|
|
- header: '<h3 class="custom-h3">订单详情</h3>',
|
|
|
- documentTitle: '订单详情',
|
|
|
- style: '.custom-h3 { color: red; }',
|
|
|
+ const orderInfo = await GetOrderInfoApi({
|
|
|
+ id: record.id,
|
|
|
+ brandId: record.brandId,
|
|
|
});
|
|
|
+ console.log('orderInfo', orderInfo);
|
|
|
+ openPrintModal(true, orderInfo);
|
|
|
+ // printJS({
|
|
|
+ // printable: [
|
|
|
+ // { name: '订单号', email: '20210908174503807397842', phone: '123' },
|
|
|
+ // { name: 'qq', email: '456@gmail.com', phone: '456' },
|
|
|
+ // ],
|
|
|
+ // properties: ['name', 'email', 'phone'],
|
|
|
+ // type: 'json',
|
|
|
+ // gridHeaderStyle: 'color: red; border: 2px solid #3971A5;',
|
|
|
+ // gridStyle: 'border: 2px solid #3971A5;',
|
|
|
+ // header: '<h3 class="custom-h3">订单详情</h3>',
|
|
|
+ // documentTitle: '订单详情',
|
|
|
+ // style: '.custom-h3 { color: red; }',
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
return {
|
|
@@ -369,6 +388,7 @@
|
|
|
registerConfirmModal,
|
|
|
reload,
|
|
|
printDetail,
|
|
|
+ registerPrintModal,
|
|
|
};
|
|
|
},
|
|
|
});
|