|
@@ -1,33 +1,36 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
+ <GrowCard :loading="loading" class="enter-y" :list="growCardList" />
|
|
|
<BasicTable @register="registerTable">
|
|
|
<template #toolbar>
|
|
|
- <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('invoice-export')"> 导出</a-button>
|
|
|
+ <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('invoice-export')">
|
|
|
+ 导出</a-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
- <TableAction
|
|
|
- stopButtonPropagation
|
|
|
- :actions="[
|
|
|
- {
|
|
|
- label: '开票登记',
|
|
|
- //icon: 'la:file-invoice-dollar',
|
|
|
- ifShow:getCheckPerm('invoice-checkin') && record.invoiced==0,
|
|
|
- onClick: handleInvoice.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '电子发票',
|
|
|
- ifShow:record.type == 2 && record.invoiced==1,
|
|
|
- //icon: 'simple-icons:invoiceninja',
|
|
|
- onClick: headleDetails.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '快递单号',
|
|
|
- ifShow:record.type != 2&& record.invoiced==1,
|
|
|
- //icon: 'icon-park-outline:express-delivery',
|
|
|
- onClick: headleDetails.bind(null, record),
|
|
|
- },
|
|
|
- ]"
|
|
|
- />
|
|
|
+ <TableAction
|
|
|
+ stopButtonPropagation
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ label: '开票登记',
|
|
|
+ //icon: 'la:file-invoice-dollar',
|
|
|
+ ifShow: getCheckPerm('invoice-checkin') && record.invoiced == 0,
|
|
|
+ onClick: handleInvoice.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '电子发票',
|
|
|
+ ifShow: record.type == 2 && record.invoiced == 1,
|
|
|
+ //icon: 'simple-icons:invoiceninja',
|
|
|
+ onClick: headleDetails.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '快递单号',
|
|
|
+ ifShow: record.type != 2 && record.invoiced == 1,
|
|
|
+ //icon: 'icon-park-outline:express-delivery',
|
|
|
+ onClick: headleDetails.bind(null, record),
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
<AddModal @update="reload" @register="registerAddModal" />
|
|
@@ -35,106 +38,167 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, h, reactive } from 'vue';
|
|
|
- import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
|
|
|
- import { PageWrapper } from '/@/components/Page';
|
|
|
- import { useModal } from '/@/components/Modal';
|
|
|
- import { Descriptions } from 'ant-design-vue';
|
|
|
- import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
- import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { InvoiceList,InvoiceExport } from '/@/api/order'
|
|
|
- import { downloadByData } from '/@/utils/file/download'
|
|
|
- import { searchForm, columns } from './data'
|
|
|
- import AddModal from './InvoiceModal.vue';
|
|
|
- import EditModal from './EditModal.vue';
|
|
|
- import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
- interface apiDataParam {
|
|
|
- orderSn?: string;
|
|
|
- payTimeStart?: string;
|
|
|
- payTimeEnd?: string;
|
|
|
- invoiceTimeStart?: string;
|
|
|
- invoiceTimeEnd?: string;
|
|
|
- orderBy?: string;
|
|
|
- sortBy?: string;
|
|
|
- }
|
|
|
- export default defineComponent({
|
|
|
- components: {
|
|
|
- AddModal,
|
|
|
- EditModal,
|
|
|
- BasicTable,
|
|
|
- TableAction,
|
|
|
- PageWrapper,
|
|
|
- TableImg,
|
|
|
- [Descriptions.name]: Descriptions,
|
|
|
- [Descriptions.Item.name]: Descriptions.Item,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- const { t } = useI18n();
|
|
|
- const permissionStore = usePermissionStore();
|
|
|
- const { getCheckPerm } = permissionStore;
|
|
|
- const apiData = reactive<apiDataParam>({
|
|
|
- orderSn: '',
|
|
|
- payTimeStart: '',
|
|
|
- payTimeEnd: '',
|
|
|
- invoiceTimeStart: '',
|
|
|
- invoiceTimeEnd: '',
|
|
|
- orderBy: '',
|
|
|
- sortBy: '',
|
|
|
- });
|
|
|
- const { createMessage,createConfirm } = useMessage();
|
|
|
- const [registerAddModal, { openModal: openAddModal }] = useModal();
|
|
|
- const [registerEditModal, { openModal: openEditModal }] = useModal();
|
|
|
- const [registerTable, { reload }] = useTable({
|
|
|
- api: InvoiceList,
|
|
|
- title: '发票列表',
|
|
|
- // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
- columns: columns,
|
|
|
- useSearchForm: true,
|
|
|
- formConfig: searchForm,
|
|
|
- showTableSetting: true,
|
|
|
- showIndexColumn:false,
|
|
|
- rowKey: 'id',
|
|
|
- beforeFetch:(params) =>{
|
|
|
- let searchData = {
|
|
|
- orderSn: params.orderSn,
|
|
|
- payTimeStart: params.payTime && params.payTime[0],
|
|
|
- payTimeEnd: params.payTime && params.payTime[1],
|
|
|
- invoiceTimeStart: params.invoiceTime && params.invoiceTime[0],
|
|
|
- invoiceTimeEnd: params.invoiceTime && params.invoiceTime[1],
|
|
|
- }
|
|
|
- apiData.orderSn = searchData.orderSn
|
|
|
- apiData.payTimeStart = searchData.payTimeStart
|
|
|
- apiData.payTimeEnd = searchData.payTimeEnd
|
|
|
- apiData.invoiceTimeStart = searchData.invoiceTimeStart
|
|
|
- apiData.invoiceTimeEnd = searchData.invoiceTimeEnd
|
|
|
- return {
|
|
|
- ...params,
|
|
|
- ...searchData,
|
|
|
- }
|
|
|
- },
|
|
|
- fetchSetting: {
|
|
|
- pageField: 'pageNum',
|
|
|
- sizeField: 'pageSize',
|
|
|
- listField: 'list',
|
|
|
- totalField: 'total',
|
|
|
- },
|
|
|
- actionColumn: {
|
|
|
- width: 100,
|
|
|
- title: '操作',
|
|
|
- fixed: 'right',
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- },
|
|
|
- canResize: false,
|
|
|
+import { defineComponent, h, reactive, ref } from 'vue';
|
|
|
+import GrowCard from '../dashboard/analysis/components/GrowCard.vue';
|
|
|
+import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
|
|
|
+import { PageWrapper } from '/@/components/Page';
|
|
|
+import { useModal } from '/@/components/Modal';
|
|
|
+import { Descriptions } from 'ant-design-vue';
|
|
|
+import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+import { InvoiceList, InvoiceExport } from '/@/api/order';
|
|
|
+import { downloadByData } from '/@/utils/file/download';
|
|
|
+import { searchForm, columns } from './data';
|
|
|
+import AddModal from './InvoiceModal.vue';
|
|
|
+import EditModal from './EditModal.vue';
|
|
|
+import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
+interface apiDataParam {
|
|
|
+ orderSn?: string;
|
|
|
+ payTimeStart?: string;
|
|
|
+ payTimeEnd?: string;
|
|
|
+ invoiceTimeStart?: string;
|
|
|
+ invoiceTimeEnd?: string;
|
|
|
+ orderBy?: string;
|
|
|
+ sortBy?: string;
|
|
|
+}
|
|
|
+interface GrowCardItem {
|
|
|
+ icon: string;
|
|
|
+ title: string;
|
|
|
+ value: number;
|
|
|
+ unit: string;
|
|
|
+ color: string;
|
|
|
+ action: string;
|
|
|
+}
|
|
|
+export default defineComponent({
|
|
|
+ components: {
|
|
|
+ AddModal,
|
|
|
+ GrowCard,
|
|
|
+ EditModal,
|
|
|
+ BasicTable,
|
|
|
+ TableAction,
|
|
|
+ PageWrapper,
|
|
|
+ TableImg,
|
|
|
+ [Descriptions.name]: Descriptions,
|
|
|
+ [Descriptions.Item.name]: Descriptions.Item,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ const { t } = useI18n();
|
|
|
+ const loading = ref(true);
|
|
|
+ const growCardList = ref<GrowCardItem[]>([{
|
|
|
+ title: '累计用户',
|
|
|
+ // icon: 'fa6-solid:users-gear',
|
|
|
+ icon: 'visit-count|svg',
|
|
|
+ value: 0,
|
|
|
+ unit: '人',
|
|
|
+ color: 'green',
|
|
|
+ action: '年',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上月新增用户',
|
|
|
+ icon: 'akar-icons:person-add',
|
|
|
+ value: 0,
|
|
|
+ unit: '人',
|
|
|
+ color: 'blue',
|
|
|
+ action: '月',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '今日新增用户',
|
|
|
+ icon: 'carbon:user-role',
|
|
|
+ value: 0,
|
|
|
+ unit: '人',
|
|
|
+ color: 'orange',
|
|
|
+ action: '日',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上月权益订单数',
|
|
|
+ icon: 'fxemoji:notchedrightsemi3dot',
|
|
|
+ value: 0,
|
|
|
+ unit: '笔',
|
|
|
+ color: 'blue',
|
|
|
+ action: '月',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上月下载订单数',
|
|
|
+ icon: 'download-count|svg',
|
|
|
+ value: 0,
|
|
|
+ unit: '笔',
|
|
|
+ color: 'orange',
|
|
|
+ action: '月',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上月配件订单数',
|
|
|
+ icon: 'transaction|svg',
|
|
|
+ value: 0,
|
|
|
+ unit: '人',
|
|
|
+ color: 'blue',
|
|
|
+ action: '月',
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ const permissionStore = usePermissionStore();
|
|
|
+ const { getCheckPerm } = permissionStore;
|
|
|
+ const apiData = reactive<apiDataParam>({
|
|
|
+ orderSn: '',
|
|
|
+ payTimeStart: '',
|
|
|
+ payTimeEnd: '',
|
|
|
+ invoiceTimeStart: '',
|
|
|
+ invoiceTimeEnd: '',
|
|
|
+ orderBy: '',
|
|
|
+ sortBy: '',
|
|
|
+ });
|
|
|
+ const { createMessage, createConfirm } = useMessage();
|
|
|
+ const [registerAddModal, { openModal: openAddModal }] = useModal();
|
|
|
+ const [registerEditModal, { openModal: openEditModal }] = useModal();
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
+ api: InvoiceList,
|
|
|
+ title: '发票列表',
|
|
|
+ // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
+ columns: columns,
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: searchForm,
|
|
|
+ showTableSetting: true,
|
|
|
+ showIndexColumn: false,
|
|
|
+ rowKey: 'id',
|
|
|
+ beforeFetch: (params) => {
|
|
|
+ let searchData = {
|
|
|
+ orderSn: params.orderSn,
|
|
|
+ payTimeStart: params.payTime && params.payTime[0],
|
|
|
+ payTimeEnd: params.payTime && params.payTime[1],
|
|
|
+ invoiceTimeStart: params.invoiceTime && params.invoiceTime[0],
|
|
|
+ invoiceTimeEnd: params.invoiceTime && params.invoiceTime[1],
|
|
|
+ };
|
|
|
+ apiData.orderSn = searchData.orderSn;
|
|
|
+ apiData.payTimeStart = searchData.payTimeStart;
|
|
|
+ apiData.payTimeEnd = searchData.payTimeEnd;
|
|
|
+ apiData.invoiceTimeStart = searchData.invoiceTimeStart;
|
|
|
+ apiData.invoiceTimeEnd = searchData.invoiceTimeEnd;
|
|
|
+ return {
|
|
|
+ ...params,
|
|
|
+ ...searchData,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
+ },
|
|
|
+ actionColumn: {
|
|
|
+ width: 100,
|
|
|
+ title: '操作',
|
|
|
+ fixed: 'right',
|
|
|
+ dataIndex: 'action',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ },
|
|
|
+ canResize: false,
|
|
|
+ });
|
|
|
+ function handleDelete(record: Recordable) {
|
|
|
+ console.log('点击了删除', record);
|
|
|
+ }
|
|
|
+ function handleInvoice(record: Recordable) {
|
|
|
+ openAddModal(true, {
|
|
|
+ ...record,
|
|
|
});
|
|
|
- function handleDelete(record: Recordable) {
|
|
|
- console.log('点击了删除', record);
|
|
|
- }
|
|
|
- function handleInvoice(record: Recordable) {
|
|
|
- openAddModal(true, {
|
|
|
- ...record,
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
function handleEdit(record: Recordable) {
|
|
|
console.log('record', record);
|
|
|
}
|
|
@@ -145,27 +209,29 @@
|
|
|
});
|
|
|
}
|
|
|
function exportExcel() {
|
|
|
- createConfirm({
|
|
|
- iconType: 'warning',
|
|
|
- title: () => h('span', '温馨提示'),
|
|
|
- content: () => h('span', '确定导出当前发票所有记录?'),
|
|
|
- onOk: async () => {
|
|
|
- await InvoiceExport(apiData);
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- return {
|
|
|
- registerTable,
|
|
|
- handleDelete,
|
|
|
- registerAddModal,
|
|
|
- registerEditModal,
|
|
|
- handleInvoice,
|
|
|
- exportExcel,
|
|
|
- handleEdit,
|
|
|
- headleDetails,
|
|
|
- reload,
|
|
|
- getCheckPerm,
|
|
|
- };
|
|
|
- },
|
|
|
- });
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: () => h('span', '温馨提示'),
|
|
|
+ content: () => h('span', '确定导出当前发票所有记录?'),
|
|
|
+ onOk: async () => {
|
|
|
+ await InvoiceExport(apiData);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ registerTable,
|
|
|
+ handleDelete,
|
|
|
+ registerAddModal,
|
|
|
+ registerEditModal,
|
|
|
+ handleInvoice,
|
|
|
+ exportExcel,
|
|
|
+ handleEdit,
|
|
|
+ headleDetails,
|
|
|
+ reload,
|
|
|
+ getCheckPerm,
|
|
|
+ loading,
|
|
|
+ growCardList,
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
</script>
|