Merge branch 'feature_积分商城_对账' into release_20260914
This commit is contained in:
@@ -510,3 +510,10 @@ CREATE TABLE IF NOT EXISTS `points_mall_schedule_user_points_record` (
|
||||
KEY `idx_points_mall_schedule_user_points_user` (`userId`),
|
||||
KEY `idx_points_mall_schedule_user_points_status` (`status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分商城定时发放积分记录';
|
||||
|
||||
ALTER TABLE sys_user
|
||||
ADD COLUMN virtual_id VARCHAR(64) NULL COMMENT '虚拟用户ID,积分商城向供应商传递的用户标识',
|
||||
ADD COLUMN virtual_org_id VARCHAR(255) NULL COMMENT '虚拟组织ID';
|
||||
|
||||
UPDATE sys_user SET virtual_id = MD5(CONCAT(id, '_', loginName, '_', salt))
|
||||
where id is not null and loginName is not null and salt is not null;
|
||||
@@ -14,19 +14,11 @@ layout("/layouts/platform.html"){
|
||||
<el-option label="失败" :value="1"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="成功订单">
|
||||
<el-input clearable placeholder="请输入订单ID" v-model="pageForm.sucOrderIds"></el-input>
|
||||
</search-item>
|
||||
<search-item label="失败订单">
|
||||
<el-input clearable placeholder="请输入订单ID" v-model="pageForm.failOrderIds"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="发票管理">
|
||||
<el-button @click="openApplyDialog" size="mini" type="success">开票申请</el-button>
|
||||
<el-button @click="openOrderDialog" size="mini" type="primary">可开票订单</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" border class="vi-table" size="small" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
@@ -36,13 +28,11 @@ layout("/layouts/platform.html"){
|
||||
<el-tag :type="invoiceResultType(row.bSuccess)" size="mini">{{ invoiceResultName(row.bSuccess) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="成功订单" min-width="220" prop="sucOrderIds" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="失败订单" min-width="220" prop="failOrderIds" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="失败原因" min-width="220" prop="failMsg" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="220">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="340">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openInfoDialog(row)" size="mini" type="primary">发票明细</el-button>
|
||||
<el-button @click="openOrderDialog(row.sucOrderIds)" size="mini">成功订单</el-button>
|
||||
<el-button @click="openOrderDialog(row.sucOrderIds)" size="mini" type="primary">开票成功列表</el-button>
|
||||
<el-button @click="openInfoDialog(row)" size="mini">查看</el-button>
|
||||
<el-button v-if="Number(row.bSuccess) === 1" @click="retryInvoice(row.id)" :loading="retryLoading" size="mini" type="warning">重新获取发票</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -58,120 +48,25 @@ layout("/layouts/platform.html"){
|
||||
></el-pagination>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="开票申请" :visible.sync="applyDialogVisible" top="5vh" width="720px">
|
||||
<el-form :model="applyForm" label-width="120px" size="small">
|
||||
<el-form-item label="供应商" required>
|
||||
<el-select clearable filterable placeholder="请选择供应商" style="width: 100%" v-model="applyForm.supplierId">
|
||||
<el-option :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" v-for="item in supplierList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单完成日期" required>
|
||||
<el-date-picker
|
||||
end-placeholder="结束日期"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="applyDateRange"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单ID" required>
|
||||
<el-input placeholder="多个订单ID用英文逗号分隔" type="textarea" v-model="applyForm.orderIds"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票日期" required>
|
||||
<el-date-picker placeholder="请选择开票日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="applyForm.invoiceDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票抬头">
|
||||
<el-input clearable placeholder="请输入发票抬头" v-model="applyForm.invoiceTitle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" required>
|
||||
<el-input clearable placeholder="请输入纳税人识别号" v-model="applyForm.invoiceCode"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票地址" required>
|
||||
<el-input clearable placeholder="请输入发票地址" v-model="applyForm.invoiceAddress"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" required>
|
||||
<el-input clearable placeholder="请输入联系电话" v-model="applyForm.invoiceContact"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票类型">
|
||||
<el-select clearable placeholder="请选择发票类型" style="width: 100%" v-model="applyForm.invoiceType">
|
||||
<el-option label="全电专票" :value="9"></el-option>
|
||||
<el-option label="全电普票" :value="10"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票内容">
|
||||
<el-input clearable placeholder="请输入开票内容" v-model="applyForm.invoiceContent"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开户银行">
|
||||
<el-input clearable placeholder="请输入开户银行" v-model="applyForm.bankName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="银行账号">
|
||||
<el-input clearable placeholder="请输入银行账号" v-model="applyForm.bankAccount"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input placeholder="请输入备注" type="textarea" v-model="applyForm.remark"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单积分合计">
|
||||
<span>{{ orderTotalPoints }}</span>
|
||||
<el-button @click="loadOrderTotalPoints" size="mini" style="margin-left: 12px">计算</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="applyDialogVisible = false">取消</el-button>
|
||||
<el-button @click="submitApply" :loading="applyLoading" type="primary">提交申请</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="可开票订单" :visible.sync="orderDialogVisible" top="5vh" width="90%">
|
||||
<el-form :inline="true" size="small" @submit.native.prevent>
|
||||
<el-form-item label="供应商">
|
||||
<el-select clearable filterable placeholder="供应商" style="width: 180px" v-model="orderForm.supplierId">
|
||||
<el-option :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" v-for="item in supplierList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单ID">
|
||||
<el-input clearable placeholder="多个订单ID用英文逗号分隔" v-model="orderForm.orderId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成日期">
|
||||
<el-date-picker
|
||||
end-placeholder="结束日期"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 260px"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="orderDateRange"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票状态">
|
||||
<el-select clearable placeholder="开票状态" style="width: 130px" v-model="orderForm.invoiceStatus">
|
||||
<el-option label="未开票" :value="0"></el-option>
|
||||
<el-option label="已开票" :value="1"></el-option>
|
||||
<el-option label="开票中" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="orderSearch" type="primary">查询</el-button>
|
||||
<el-button @click="orderReset">重置</el-button>
|
||||
<el-button @click="useOrdersForApply" type="success">用于开票</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="orderList" @selection-change="orderSelectionChange" border size="small" style="width: 100%" v-loading="orderLoading">
|
||||
<el-table-column align="center" type="selection" width="50"></el-table-column>
|
||||
<el-table-column :index="orderIndexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-dialog :close-on-click-modal="false" title="订单明细" :visible.sync="orderDialogVisible" top="5vh" width="90%">
|
||||
<el-table :data="orderList" border size="small" style="width: 100%" v-loading="orderLoading">
|
||||
<el-table-column align="center" label="订单ID" min-width="170" prop="orderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="主订单号" min-width="170" prop="mainOrderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="150" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="用户ID" min-width="120" prop="userId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="完成时间" min-width="160" prop="orderCompleteTime"></el-table-column>
|
||||
<el-table-column align="center" label="订单总金额" min-width="110" prop="totalPrice"></el-table-column>
|
||||
<el-table-column align="center" label="积分金额" min-width="110" prop="pointsPrice"></el-table-column>
|
||||
<el-table-column align="center" label="退款积分" min-width="110" prop="refund"></el-table-column>
|
||||
<el-table-column align="center" label="开票状态" min-width="100">
|
||||
<el-table-column align="center" label="订单状态" min-width="110">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag :type="orderStatusType(row.orderState)" size="mini">{{ orderStateName(row.orderState) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发票状态" min-width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag :type="invoiceStatusType(row.invoiceStatus)" size="mini">{{ invoiceStatusName(row.invoiceStatus) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="完成时间" min-width="160" prop="orderCompleteTime"></el-table-column>
|
||||
<el-table-column align="center" label="实际消耗积分" min-width="110">
|
||||
<template slot-scope="{row}">{{ (Number(row.pointsPrice || 0) - Number(row.refund || 0)).toFixed(2) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="orderForm.pageNumber"
|
||||
@@ -184,37 +79,30 @@ layout("/layouts/platform.html"){
|
||||
style="margin-top: 16px; text-align: right"
|
||||
></el-pagination>
|
||||
<span slot="footer">
|
||||
<span style="margin-right: 20px">总消耗积分:{{ orderTotalPoints }}</span>
|
||||
<el-button @click="orderDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="发票明细" :visible.sync="infoDialogVisible" top="5vh" width="90%">
|
||||
<el-form :inline="true" size="small" @submit.native.prevent>
|
||||
<el-form-item label="发票号码">
|
||||
<el-input clearable placeholder="发票号码" v-model="infoForm.invoiceId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票代码">
|
||||
<el-input clearable placeholder="发票代码" v-model="infoForm.invoiceCode"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票日期">
|
||||
<el-date-picker clearable placeholder="发票日期" type="date" value-format="yyyy-MM-dd" v-model="infoForm.invoiceDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="infoSearch" type="primary">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="infoList" border size="small" style="width: 100%" v-loading="infoLoading">
|
||||
<el-table-column :index="infoIndexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column align="center" label="发票号码" min-width="150" prop="invoiceId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="发票代码" min-width="130" prop="invoiceCode" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="发票日期" min-width="120" prop="invoiceDate"></el-table-column>
|
||||
<el-table-column align="center" label="发票类型" min-width="110">
|
||||
<template slot-scope="{row}">{{ invoiceTypeName(row.invoiceType) }}</template>
|
||||
<el-dialog :close-on-click-modal="false" title="发票明细列表" :visible.sync="infoDialogVisible" top="5vh" width="90%">
|
||||
<el-table :data="infoList" stripe size="small" style="width: 100%" v-loading="infoLoading">
|
||||
<el-table-column label="发票主ID" min-width="160" prop="mainId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="发票号码" min-width="170" prop="invoiceId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="发票代码" min-width="160" prop="invoiceCode" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="发票日期" min-width="140" prop="invoiceDate"></el-table-column>
|
||||
<el-table-column label="发票裸价" min-width="130" prop="invoiceNakeAmount"></el-table-column>
|
||||
<el-table-column label="发票税率" min-width="110" prop="invoiceTaxRate"></el-table-column>
|
||||
<el-table-column label="发票税额" min-width="130" prop="invoiceTaxAmount"></el-table-column>
|
||||
<el-table-column label="价税合计" min-width="130" prop="invoiceAmount"></el-table-column>
|
||||
<el-table-column label="发票类型" min-width="180">
|
||||
<template slot-scope="{row}"><el-tag size="mini">{{ Number(row.invoiceType) === 9 ? '全电发票(增值税专用发票)' : Number(row.invoiceType) === 10 ? '全电发票(增值税普通发票)' : invoiceTypeName(row.invoiceType) }}</el-tag></template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="电子发票" width="110">
|
||||
<template slot-scope="{row}"><el-button @click="previewInvoice(row)" size="mini" type="text">预览</el-button></template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="100">
|
||||
<template slot-scope="{row}"><el-button @click="openInvoiceDetail(row)" size="mini" type="text">详情</el-button></template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="价税合计" min-width="110" prop="invoiceAmount"></el-table-column>
|
||||
<el-table-column align="center" label="税额" min-width="100" prop="invoiceTaxAmount"></el-table-column>
|
||||
<el-table-column align="center" label="纳税人识别号" min-width="160" prop="taxIdNumber" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="电子发票地址" min-width="220" prop="url" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="infoForm.pageNumber"
|
||||
@@ -225,9 +113,46 @@ layout("/layouts/platform.html"){
|
||||
style="margin-top: 16px; text-align: right"
|
||||
></el-pagination>
|
||||
<span slot="footer">
|
||||
<el-button @click="retryInvoice(infoForm.mainId)" :loading="retryLoading" type="primary">重新获取发票</el-button>
|
||||
<el-button @click="infoDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :close-on-click-modal="false" title="发票详情" :visible.sync="detailDialogVisible" append-to-body top="5vh" width="70%">
|
||||
<el-card v-loading="detailLoading" shadow="never">
|
||||
<el-descriptions :column="2" border size="small">
|
||||
<el-descriptions-item label="发票主ID">{{ detailData.mainId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票号码">{{ detailData.invoiceId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票代码">{{ detailData.invoiceCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票日期">{{ detailData.invoiceDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票类型">
|
||||
<el-tag size="mini" :type="Number(detailData.invoiceType) === 9 ? 'warning' : 'primary'">{{ Number(detailData.invoiceType) === 9 ? '全电发票(增值税专用发票)' : Number(detailData.invoiceType) === 10 ? '全电发票(增值税普通发票)' : invoiceTypeName(detailData.invoiceType) }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票状态"><el-tag size="mini" :type="Number(detailData.status) === 1 ? 'success' : Number(detailData.status) === 2 ? 'danger' : 'info'">{{ Number(detailData.status) === 1 ? '成功' : Number(detailData.status) === 2 ? '失败' : '未知' }}</el-tag></el-descriptions-item>
|
||||
<el-descriptions-item label="发票裸价"><span style="color: #409eff">¥{{ Number(detailData.invoiceNakeAmount || 0).toFixed(2) }}</span></el-descriptions-item>
|
||||
<el-descriptions-item label="发票税率">{{ detailData.invoiceTaxRate == null ? '-' : (Number(detailData.invoiceTaxRate) * 100).toFixed(2) + '%' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票税额"><span style="color: #409eff">¥{{ Number(detailData.invoiceTaxAmount || 0).toFixed(2) }}</span></el-descriptions-item>
|
||||
<el-descriptions-item label="价税合计" :span="3"><strong style="color: #f56c6c; font-size: 18px">¥{{ Number(detailData.invoiceAmount || 0).toFixed(2) }}</strong></el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2" v-if="detailData.remark">{{ detailData.remark }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电子发票">
|
||||
<template v-if="detailData.url || detailData.imageEncode">
|
||||
<el-button @click="previewInvoice(detailData)" size="mini" type="text" icon="el-icon-view">预览PDF</el-button>
|
||||
<el-link :href="detailData.url || detailData.imageEncode" :download="(detailData.invoiceId || '发票') + '.' + (detailData.fileType || 'pdf').toLowerCase()" type="success" :underline="false" icon="el-icon-download" style="margin-left: 16px">下载PDF</el-link>
|
||||
</template>
|
||||
<span v-else>暂无地址</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<span slot="footer">
|
||||
<el-button v-if="detailData.id && (Number(detailData.status) === 2 || !detailData.url)" @click="retryInvoice(detailData.mainId)" :loading="retryLoading" type="primary">重新获取发票</el-button>
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :close-on-click-modal="false" title="PDF预览" :visible.sync="pdfDialogVisible" append-to-body width="80%" @closed="closePdfPreview">
|
||||
<div v-loading="pdfLoading" style="height: 70vh">
|
||||
<iframe v-if="pdfUrl" :src="pdfUrl" title="发票PDF预览" style="width: 100%; height: 100%; border: 0"></iframe>
|
||||
</div>
|
||||
<span slot="footer"><el-button @click="pdfDialogVisible = false">关闭</el-button></span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
@@ -236,7 +161,6 @@ layout("/layouts/platform.html"){
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
supplierList: [],
|
||||
tableData: [],
|
||||
tableLoading: false,
|
||||
pageForm: {
|
||||
@@ -244,48 +168,28 @@ layout("/layouts/platform.html"){
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
settlementId: null,
|
||||
bSuccess: null,
|
||||
sucOrderIds: null,
|
||||
failOrderIds: null,
|
||||
failMsg: null
|
||||
bSuccess: null
|
||||
},
|
||||
applyDialogVisible: false,
|
||||
applyLoading: false,
|
||||
applyDateRange: [],
|
||||
orderTotalPoints: 0,
|
||||
applyForm: this.emptyApplyForm(),
|
||||
orderDialogVisible: false,
|
||||
orderLoading: false,
|
||||
orderDateRange: [],
|
||||
orderList: [],
|
||||
orderSelections: [],
|
||||
orderForm: this.emptyOrderForm(),
|
||||
infoDialogVisible: false,
|
||||
infoLoading: false,
|
||||
infoList: [],
|
||||
infoForm: this.emptyInfoForm()
|
||||
infoForm: this.emptyInfoForm(),
|
||||
detailDialogVisible: false,
|
||||
detailLoading: false,
|
||||
retryLoading: false,
|
||||
pdfDialogVisible: false,
|
||||
pdfLoading: false,
|
||||
pdfUrl: null,
|
||||
detailData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emptyApplyForm() {
|
||||
return {
|
||||
supplierId: null,
|
||||
orderIds: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
invoiceDate: null,
|
||||
invoiceTitle: null,
|
||||
invoiceCode: null,
|
||||
invoiceAddress: null,
|
||||
invoiceContact: null,
|
||||
invoiceType: 10,
|
||||
invoiceContent: null,
|
||||
remark: null,
|
||||
bankAccount: null,
|
||||
registeredAddress: null,
|
||||
bankName: null
|
||||
}
|
||||
},
|
||||
emptyOrderForm() {
|
||||
return {
|
||||
pageNumber: 1,
|
||||
@@ -295,7 +199,7 @@ layout("/layouts/platform.html"){
|
||||
orderId: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
invoiceStatus: 0
|
||||
invoiceStatus: null
|
||||
}
|
||||
},
|
||||
emptyInfoForm() {
|
||||
@@ -343,79 +247,21 @@ layout("/layouts/platform.html"){
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
async loadSuppliers() {
|
||||
const resp = await this.$axios.post(loc() + "/supplierList")
|
||||
if (resp.code === 0) {
|
||||
this.supplierList = resp.data || []
|
||||
}
|
||||
},
|
||||
openApplyDialog() {
|
||||
this.applyForm = this.emptyApplyForm()
|
||||
this.applyDateRange = []
|
||||
this.orderTotalPoints = 0
|
||||
this.applyDialogVisible = true
|
||||
},
|
||||
syncApplyDateRange() {
|
||||
this.applyForm.startDate = this.applyDateRange && this.applyDateRange.length ? this.applyDateRange[0] : null
|
||||
this.applyForm.endDate = this.applyDateRange && this.applyDateRange.length ? this.applyDateRange[1] : null
|
||||
},
|
||||
async loadOrderTotalPoints() {
|
||||
this.syncApplyDateRange()
|
||||
if (!this.applyForm.supplierId || !this.applyForm.orderIds) {
|
||||
this.notifyWarning("请先选择供应商并填写订单ID")
|
||||
return
|
||||
}
|
||||
const resp = await this.$axios.post(loc() + "/orderTotalPoints", {
|
||||
supplierId: this.applyForm.supplierId,
|
||||
orderId: this.applyForm.orderIds,
|
||||
startDate: this.applyForm.startDate,
|
||||
endDate: this.applyForm.endDate,
|
||||
invoiceStatus: 0
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.orderTotalPoints = resp.data || 0
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
async submitApply() {
|
||||
this.syncApplyDateRange()
|
||||
this.applyLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/applyInvoice", this.applyForm)
|
||||
this.applyLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.data || "开票申请成功")
|
||||
this.applyDialogVisible = false
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
openOrderDialog(orderIds) {
|
||||
this.orderDialogVisible = true
|
||||
this.orderForm = this.emptyOrderForm()
|
||||
this.orderDateRange = []
|
||||
if (typeof orderIds === "string" && orderIds) {
|
||||
this.orderForm.orderId = orderIds
|
||||
this.orderForm.invoiceStatus = null
|
||||
this.orderList = []
|
||||
this.orderTotalPoints = 0
|
||||
if (typeof orderIds !== "string" || !orderIds.trim()) {
|
||||
return
|
||||
}
|
||||
this.orderForm.orderId = orderIds
|
||||
this.orderPageData()
|
||||
},
|
||||
syncOrderDateRange() {
|
||||
this.orderForm.startDate = this.orderDateRange && this.orderDateRange.length ? this.orderDateRange[0] : null
|
||||
this.orderForm.endDate = this.orderDateRange && this.orderDateRange.length ? this.orderDateRange[1] : null
|
||||
},
|
||||
orderSearch() {
|
||||
this.orderForm.pageNumber = 1
|
||||
this.orderPageData()
|
||||
},
|
||||
orderReset() {
|
||||
this.orderForm = this.emptyOrderForm()
|
||||
this.orderDateRange = []
|
||||
this.orderPageData()
|
||||
this.loadOrderTotalPoints()
|
||||
},
|
||||
async orderPageData() {
|
||||
this.syncOrderDateRange()
|
||||
if (!this.orderForm.orderId) return
|
||||
this.orderLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/orderPage", this.orderForm)
|
||||
this.orderLoading = false
|
||||
@@ -435,27 +281,77 @@ layout("/layouts/platform.html"){
|
||||
this.orderForm.pageNumber = 1
|
||||
this.orderPageData()
|
||||
},
|
||||
orderSelectionChange(rows) {
|
||||
this.orderSelections = rows || []
|
||||
async loadOrderTotalPoints() {
|
||||
const resp = await this.$axios.post(loc() + "/orderTotalPoints", this.orderForm)
|
||||
if (resp.code === 0) this.orderTotalPoints = resp.data || 0
|
||||
else this.notifyWarning(resp.msg)
|
||||
},
|
||||
useOrdersForApply() {
|
||||
if (!this.orderSelections.length) {
|
||||
this.notifyWarning("请先选择订单")
|
||||
async openInvoiceDetail(row) {
|
||||
this.detailData = {}
|
||||
this.detailDialogVisible = true
|
||||
this.detailLoading = true
|
||||
try {
|
||||
const resp = await this.$axios.post(loc() + "/infoDetail", { id: row.id })
|
||||
if (resp.code === 0 && resp.data) this.detailData = resp.data
|
||||
else this.notifyWarning(resp.msg || "发票详情不存在")
|
||||
} finally {
|
||||
this.detailLoading = false
|
||||
}
|
||||
},
|
||||
async retryInvoice(mainId) {
|
||||
if (!mainId || this.retryLoading) return
|
||||
this.retryLoading = true
|
||||
try {
|
||||
const resp = await this.$axios.post(loc() + "/retryInvoice", { mainId })
|
||||
if (resp.code !== 0) this.notifyWarning(resp.msg || "重新获取发票失败")
|
||||
else this.$message.success("发票已重新获取")
|
||||
await this.pageData()
|
||||
if (this.infoDialogVisible && this.infoForm.mainId === mainId) await this.infoPageData()
|
||||
if (this.detailDialogVisible && this.detailData.mainId === mainId) {
|
||||
await this.openInvoiceDetail({ id: this.detailData.id })
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyWarning(e.message || "重新获取发票失败")
|
||||
} finally {
|
||||
this.retryLoading = false
|
||||
}
|
||||
},
|
||||
async previewInvoice(row) {
|
||||
const path = row.url || row.imageEncode
|
||||
if (!path) {
|
||||
this.notifyWarning("暂无可预览的发票文件")
|
||||
return
|
||||
}
|
||||
const first = this.orderSelections[0]
|
||||
this.applyForm = this.emptyApplyForm()
|
||||
this.applyForm.supplierId = first.supplierId
|
||||
this.applyForm.orderIds = this.orderSelections.map((item) => item.orderId).join(",")
|
||||
this.applyForm.invoiceDate = new Date().toISOString().slice(0, 10)
|
||||
this.applyDateRange = [this.orderForm.startDate, this.orderForm.endDate].filter(Boolean)
|
||||
this.orderDialogVisible = false
|
||||
this.applyDialogVisible = true
|
||||
this.loadOrderTotalPoints()
|
||||
if ((row.fileType || "pdf").toLowerCase() !== "pdf") {
|
||||
this.$commonUtil.previewFile({ suffix: row.fileType.toLowerCase(), downloadPath: path, name: row.invoiceId || "发票" })
|
||||
return
|
||||
}
|
||||
if (this.pdfLoading) return
|
||||
this.closePdfPreview()
|
||||
this.pdfDialogVisible = true
|
||||
this.pdfLoading = true
|
||||
try {
|
||||
const response = await fetch(path, { credentials: "same-origin" })
|
||||
if (!response.ok) throw new Error("获取发票文件失败")
|
||||
const bytes = await response.arrayBuffer()
|
||||
const signature = String.fromCharCode.apply(null, new Uint8Array(bytes, 0, Math.min(5, bytes.byteLength)))
|
||||
if (signature !== "%PDF-") throw new Error("返回内容不是有效的PDF文件")
|
||||
if (this.pdfDialogVisible) this.pdfUrl = URL.createObjectURL(new Blob([bytes], { type: "application/pdf" }))
|
||||
} catch (e) {
|
||||
this.notifyWarning(e.message || "发票预览失败")
|
||||
this.pdfDialogVisible = false
|
||||
} finally {
|
||||
this.pdfLoading = false
|
||||
}
|
||||
},
|
||||
closePdfPreview() {
|
||||
if (this.pdfUrl) URL.revokeObjectURL(this.pdfUrl)
|
||||
this.pdfUrl = null
|
||||
},
|
||||
openInfoDialog(row) {
|
||||
this.infoForm = this.emptyInfoForm()
|
||||
this.infoForm.mainId = row.id
|
||||
this.infoList = []
|
||||
this.infoDialogVisible = true
|
||||
this.infoPageData()
|
||||
},
|
||||
@@ -470,6 +366,7 @@ layout("/layouts/platform.html"){
|
||||
if (resp.code === 0) {
|
||||
this.infoList = resp.data.list || []
|
||||
this.infoForm.totalCount = resp.data.totalCount || 0
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
@@ -479,10 +376,18 @@ layout("/layouts/platform.html"){
|
||||
this.infoPageData()
|
||||
},
|
||||
invoiceResultName(value) {
|
||||
return Number(value) === 0 ? "成功" : "失败"
|
||||
return value == null ? "开票中" : Number(value) === 0 ? "成功" : "失败"
|
||||
},
|
||||
invoiceResultType(value) {
|
||||
return Number(value) === 0 ? "success" : "danger"
|
||||
return value == null ? "warning" : Number(value) === 0 ? "success" : "danger"
|
||||
},
|
||||
orderStateName(value) {
|
||||
const map = { 0: "待付款", 1: "已支付", 2: "进行中", 3: "已取消", 4: "已签收", 5: "已完成", 6: "换货", 7: "退货", 8: "已废除" }
|
||||
return map[value] || "-"
|
||||
},
|
||||
orderStatusType(value) {
|
||||
const map = { 0: "info", 1: "primary", 2: "warning", 3: "danger", 4: "primary", 5: "success", 6: "warning", 7: "danger", 8: "info" }
|
||||
return map[value] || "info"
|
||||
},
|
||||
invoiceStatusName(value) {
|
||||
const map = { 0: "未开票", 1: "已开票", 2: "开票中" }
|
||||
@@ -498,8 +403,11 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSuppliers()
|
||||
this.pageData()
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.pdfDialogVisible = false
|
||||
this.closePdfPreview()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -3,44 +3,74 @@ layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="供应商">
|
||||
<el-select clearable filterable placeholder="请选择供应商" style="width: 100%" v-model="pageForm.supplierId">
|
||||
<el-option :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" v-for="item in supplierList"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="订单ID">
|
||||
<el-input clearable placeholder="多个订单ID用英文逗号分隔" v-model="pageForm.orderId"></el-input>
|
||||
</search-item>
|
||||
<search-item label="用户ID">
|
||||
<el-input clearable placeholder="请输入用户ID" v-model="pageForm.userId"></el-input>
|
||||
</search-item>
|
||||
<search-item label="起始日期">
|
||||
<el-date-picker clearable placeholder="开始日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="pageForm.startDate"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="结束日期">
|
||||
<el-date-picker clearable placeholder="结束日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="pageForm.endDate"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="对账状态">
|
||||
<el-select clearable placeholder="请选择对账状态" style="width: 100%" v-model="pageForm.reconciliationStatus">
|
||||
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in reconciliationStatusOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="发票状态">
|
||||
<el-select clearable placeholder="请选择发票状态" style="width: 100%" v-model="pageForm.invoiceStatus">
|
||||
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in invoiceStatusOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
<el-card :body-style="{ paddingBottom: '2px' }" shadow="never">
|
||||
<el-form label-width="96px" @submit.native.prevent>
|
||||
<el-row :gutter="8">
|
||||
<el-col :lg="4" :md="12" :xs="24">
|
||||
<el-form-item label="供应商">
|
||||
<el-select clearable filterable placeholder="请选择供应商" style="width: 100%" v-model="pageForm.supplierId">
|
||||
<el-option :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" v-for="item in supplierList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="4" :md="12" :xs="24">
|
||||
<el-form-item label="起始日期">
|
||||
<el-date-picker clearable placeholder="开始日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="pageForm.startDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="4" :md="12" :xs="24">
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker clearable placeholder="结束日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="pageForm.endDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="4" :md="12" :xs="24">
|
||||
<el-form-item label="对账类型">
|
||||
<el-select clearable placeholder="请选择对账类型" style="width: 100%" v-model="pageForm.reconciliationType">
|
||||
<el-option label="正常订单对账" :value="1"></el-option>
|
||||
<el-option label="历史异常订单对账" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="4" :md="12" :xs="24">
|
||||
<el-form-item label="发票状态">
|
||||
<el-select clearable placeholder="请选择发票状态" style="width: 100%" v-model="pageForm.invoiceStatus">
|
||||
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in invoiceStatusOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="4" :md="12" :xs="24">
|
||||
<el-form-item label="对账状态">
|
||||
<el-select clearable placeholder="请选择对账状态" style="width: 100%" v-model="pageForm.reconciliationStatus">
|
||||
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in reconciliationStatusOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="6" :md="24" :xs="24">
|
||||
<el-form-item label="订单ID">
|
||||
<el-input clearable placeholder="多个订单ID用英文逗号分隔" v-model="pageForm.orderId"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :md="24" :xs="24">
|
||||
<el-form-item label-width="16px">
|
||||
<el-button @click="doSearch" native-type="button" type="primary">查询</el-button>
|
||||
<el-button @click="resetSearch" native-type="button">重置</el-button>
|
||||
<el-button @click="openReconcileDialog" native-type="button" type="success">对账</el-button>
|
||||
<el-button
|
||||
v-if="pageForm.reconciliationStatus === 1 && hasSearched && pageForm.invoiceStatus === 0"
|
||||
@click="openApplyDialog"
|
||||
native-type="button"
|
||||
type="warning"
|
||||
>开票申请</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="对账订单列表">
|
||||
<el-button @click="openReconcileDialog" size="mini" type="success">对账</el-button>
|
||||
<el-button @click="openRecordDialog" size="mini" type="primary">对账记录</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" border class="vi-table" size="small" style="width: 100%" v-loading="tableLoading">
|
||||
<table-tool label="对账订单列表"></table-tool>
|
||||
<el-table ref="tableRef" :data="tableData" @selection-change="selectionChange" border class="vi-table" size="small" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column align="center" type="selection" width="50"></el-table-column>
|
||||
<el-table-column :index="indexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column align="center" label="订单ID" min-width="170" prop="orderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="150" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
@@ -87,39 +117,46 @@ layout("/layouts/platform.html"){
|
||||
</el-card>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="确认对账" :visible.sync="reconcileDialogVisible" width="480px">
|
||||
<el-form label-width="100px" size="small">
|
||||
<el-form-item label="供应商">
|
||||
<el-select clearable filterable placeholder="请选择供应商" style="width: 100%" v-model="reconcileForm.supplierId">
|
||||
<el-option :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" v-for="item in supplierList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="对账类型">
|
||||
<el-select placeholder="请选择对账类型" style="width: 100%" v-model="reconcileForm.reconciliationType">
|
||||
<el-option label="正常订单对账" :value="1"></el-option>
|
||||
<el-option label="历史异常订单对账" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始日期">
|
||||
<el-date-picker placeholder="开始日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="reconcileForm.startDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker placeholder="结束日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="reconcileForm.endDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单ID">
|
||||
<el-input clearable placeholder="多个订单ID用英文逗号分隔" v-model="reconcileForm.orderId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分合计">
|
||||
<span>{{ reconcilePointsTotal }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-alert :closable="false" show-icon title="确认后订单将更新为已对账或对账异常,并生成对账记录。" type="warning"></el-alert>
|
||||
<el-alert :closable="false" show-icon style="margin-bottom: 16px" :title="reconcileSelectionCount ? '本次仅对已勾选的 ' + reconcileSelectionCount + ' 笔订单执行对账。' : '您尚未勾选订单,本次将对当前查询条件下所有符合对账条件的订单执行对账(包含其他分页)。请确认对账范围。'" :type="reconcileSelectionCount ? 'info' : 'warning'"></el-alert>
|
||||
<el-descriptions :column="1" border size="small">
|
||||
<el-descriptions-item label="本次对账金额">{{ reconcilePointsTotal }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-alert :closable="false" show-icon style="margin-top: 16px" title="请记录当前对账积分金额,确认对账后该数值将不再展示。" type="warning"></el-alert>
|
||||
<span slot="footer">
|
||||
<el-button @click="reconcileDialogVisible = false">取消</el-button>
|
||||
<el-button @click="loadPointsTotal" :loading="pointsTotalLoading">计算金额</el-button>
|
||||
<el-button @click="executeReconciliation" :loading="executeLoading" type="primary">确认对账</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="开票申请" :visible.sync="applyDialogVisible" top="5vh" width="720px">
|
||||
<el-alert :closable="false" show-icon type="info" style="margin-bottom: 16px"
|
||||
:title="applySelectionCount ? '本次仅为已勾选的 ' + applySelectionCount + ' 笔订单申请开票。' : '未勾选订单,本次将为当前查询条件下的全部可开票订单申请开票(包含其他分页)。'"></el-alert>
|
||||
<el-form ref="applyFormRef" :model="applyForm" :rules="applyRules" label-width="120px" size="small">
|
||||
<el-form-item label="开票日期" prop="invoiceDate">
|
||||
<el-date-picker placeholder="请选择开票日期" style="width: 100%" type="date" value-format="yyyy-MM-dd" v-model="applyForm.invoiceDate"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票抬头" prop="invoiceTitle" required>
|
||||
<el-input clearable placeholder="请输入发票抬头" v-model="applyForm.invoiceTitle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" prop="taxIdNumber" required>
|
||||
<el-input clearable placeholder="请输入纳税人识别号" v-model="applyForm.taxIdNumber"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开户地址" prop="invoiceAddress" required>
|
||||
<el-input clearable placeholder="请输入发票地址" v-model="applyForm.invoiceAddress"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="invoiceContact" required>
|
||||
<el-input clearable maxlength="11" placeholder="请输入联系电话" v-model="applyForm.invoiceContact"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票类型" prop="invoiceType" required>
|
||||
<dict-select clearable code="invoice_type" placeholder="请选择发票类型" style="width: 100%" v-model="applyForm.invoiceType"></dict-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="applyDialogVisible = false">取消</el-button>
|
||||
<el-button @click="submitApply" :loading="applyLoading" type="primary">确认开票</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="对账记录" :visible.sync="recordDialogVisible" top="5vh" width="90%">
|
||||
<el-form :inline="true" size="small" @submit.native.prevent>
|
||||
<el-form-item label="供应商">
|
||||
@@ -209,6 +246,10 @@ layout("/layouts/platform.html"){
|
||||
supplierList: [],
|
||||
tableData: [],
|
||||
tableLoading: false,
|
||||
selections: [],
|
||||
lastQuery: null,
|
||||
reconcileSelectionCount: 0,
|
||||
hasSearched: false,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
@@ -218,6 +259,7 @@ layout("/layouts/platform.html"){
|
||||
userId: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
reconciliationType: null,
|
||||
reconciliationStatus: null,
|
||||
invoiceStatus: null
|
||||
},
|
||||
@@ -232,6 +274,38 @@ layout("/layouts/platform.html"){
|
||||
startDate: null,
|
||||
endDate: null
|
||||
},
|
||||
applyDialogVisible: false,
|
||||
applyLoading: false,
|
||||
applyScope: {},
|
||||
applySelectionCount: 0,
|
||||
applyForm: {
|
||||
invoiceDate: [new Date().getFullYear(), String(new Date().getMonth() + 1).padStart(2, "0"), String(new Date().getDate()).padStart(2, "0")].join("-"),
|
||||
invoiceTitle: "测试工会(开发测试)",
|
||||
taxIdNumber: "91320100MA00000000",
|
||||
invoiceAddress: "江苏省南京市测试路1号(开发测试)",
|
||||
invoiceContact: "13800000000",
|
||||
invoiceType: 10
|
||||
},
|
||||
applyRules: {
|
||||
invoiceDate: [{ required: true, message: "请选择开票日期", trigger: "change" }],
|
||||
invoiceTitle: [{ required: true, message: "请输入发票抬头", trigger: "blur" }],
|
||||
taxIdNumber: [{ required: true, message: "请输入纳税人识别号", trigger: "blur" }],
|
||||
invoiceAddress: [{ required: true, message: "请输入开户地址", trigger: "blur" }],
|
||||
invoiceContact: [
|
||||
{ required: true, message: "请输入联系电话", trigger: "blur" },
|
||||
{
|
||||
validator(rule, value, callback) {
|
||||
if (value && !/^1[3-9]\d{9}$/.test(value)) {
|
||||
callback(new Error("请输入正确的手机号码"))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
invoiceType: [{ required: true, message: "请选择发票类型", trigger: "change" }]
|
||||
},
|
||||
recordDialogVisible: false,
|
||||
recordLoading: false,
|
||||
recordList: [],
|
||||
@@ -279,14 +353,41 @@ layout("/layouts/platform.html"){
|
||||
return index + 1 + (this.recordForm.pageNumber - 1) * this.recordForm.pageSize
|
||||
},
|
||||
doSearch() {
|
||||
this.hasSearched = true
|
||||
this.selections = []
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
resetSearch() {
|
||||
this.pageForm = {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
supplierId: null,
|
||||
orderId: null,
|
||||
userId: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
reconciliationType: null,
|
||||
reconciliationStatus: null,
|
||||
invoiceStatus: null
|
||||
}
|
||||
this.hasSearched = false
|
||||
this.selections = []
|
||||
this.pageData()
|
||||
},
|
||||
selectionChange(rows) {
|
||||
this.selections = rows || []
|
||||
},
|
||||
async pageData() {
|
||||
this.tableLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/pageData", this.pageForm)
|
||||
const query = Object.assign({}, this.pageForm)
|
||||
const resp = await this.$axios.post(loc() + "/pageData", query)
|
||||
this.tableLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.lastQuery = query
|
||||
this.selections = []
|
||||
if (this.$refs.tableRef) this.$refs.tableRef.clearSelection()
|
||||
this.tableData = resp.data.list || []
|
||||
this.pageForm.totalCount = resp.data.totalCount || 0
|
||||
} else {
|
||||
@@ -308,52 +409,134 @@ layout("/layouts/platform.html"){
|
||||
this.supplierList = resp.data || []
|
||||
}
|
||||
},
|
||||
openReconcileDialog() {
|
||||
this.reconcileForm = {
|
||||
supplierId: this.pageForm.supplierId,
|
||||
reconciliationType: this.pageForm.reconciliationStatus === 2 ? 2 : 1,
|
||||
orderId: this.pageForm.orderId,
|
||||
startDate: this.pageForm.startDate,
|
||||
endDate: this.pageForm.endDate
|
||||
}
|
||||
this.reconcilePointsTotal = 0
|
||||
this.reconcileDialogVisible = true
|
||||
this.loadPointsTotal()
|
||||
},
|
||||
async loadPointsTotal() {
|
||||
if (!this.reconcileForm.supplierId || !this.reconcileForm.startDate || !this.reconcileForm.endDate || !this.reconcileForm.reconciliationType) {
|
||||
this.notifyWarning("请先选择供应商、对账类型和对账日期")
|
||||
async openReconcileDialog() {
|
||||
if (this.tableLoading || !this.lastQuery) {
|
||||
this.notifyWarning("请先查询订单列表")
|
||||
return
|
||||
}
|
||||
const query = this.lastQuery
|
||||
this.reconcileSelectionCount = this.selections.length
|
||||
this.reconcileForm = {
|
||||
supplierId: query.supplierId,
|
||||
reconciliationType: query.reconciliationType,
|
||||
orderId: this.selections.map(item => item.orderId).join(",") || null,
|
||||
queryOrderId: query.orderId,
|
||||
userId: query.userId,
|
||||
reconciliationStatus: query.reconciliationStatus,
|
||||
invoiceStatus: query.invoiceStatus,
|
||||
startDate: query.startDate,
|
||||
endDate: query.endDate
|
||||
}
|
||||
this.reconcilePointsTotal = 0
|
||||
if (!this.reconciliationParamsComplete()) {
|
||||
this.notifyWarning("请选择供应商、对账类型和对账日期,并查询订单列表")
|
||||
return
|
||||
}
|
||||
if (await this.loadPointsTotal()) {
|
||||
this.reconcileDialogVisible = true
|
||||
}
|
||||
},
|
||||
reconciliationParamsComplete() {
|
||||
if (!this.reconcileForm.supplierId || !this.reconcileForm.reconciliationType) {
|
||||
return false
|
||||
}
|
||||
if (!this.reconcileForm.startDate || !this.reconcileForm.endDate) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
async loadPointsTotal() {
|
||||
if (!this.reconciliationParamsComplete()) {
|
||||
return false
|
||||
}
|
||||
this.pointsTotalLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/pointsTotal", this.reconcileForm)
|
||||
this.pointsTotalLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.reconcilePointsTotal = resp.data || 0
|
||||
} else {
|
||||
try {
|
||||
const resp = await this.$axios.post(loc() + "/pointsTotal", this.reconcileForm)
|
||||
if (resp.code === 0) {
|
||||
this.reconcilePointsTotal = resp.data || 0
|
||||
return true
|
||||
}
|
||||
this.notifyWarning(resp.msg)
|
||||
return false
|
||||
} finally {
|
||||
this.pointsTotalLoading = false
|
||||
}
|
||||
},
|
||||
async executeReconciliation() {
|
||||
if (!this.reconcileForm.supplierId || !this.reconcileForm.startDate || !this.reconcileForm.endDate || !this.reconcileForm.reconciliationType) {
|
||||
this.notifyWarning("请先选择供应商、对账类型和对账日期")
|
||||
if (!this.reconciliationParamsComplete()) {
|
||||
this.notifyWarning("请先选择供应商、对账类型和对账日期,并查询订单列表")
|
||||
return
|
||||
}
|
||||
this.executeLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/execute", this.reconcileForm)
|
||||
this.executeLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.data || "对账完成")
|
||||
this.reconcileDialogVisible = false
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
try {
|
||||
const resp = await this.$axios.post(loc() + "/execute", this.reconcileForm)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.data || "对账完成")
|
||||
this.reconcileDialogVisible = false
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
} finally {
|
||||
this.executeLoading = false
|
||||
}
|
||||
},
|
||||
openApplyDialog() {
|
||||
if (this.tableLoading || !this.lastQuery) {
|
||||
this.notifyWarning("请先查询订单列表")
|
||||
return
|
||||
}
|
||||
const query = this.lastQuery
|
||||
if (!query.supplierId || !query.startDate || !query.endDate || query.reconciliationStatus !== 1 || query.invoiceStatus !== 0) {
|
||||
this.notifyWarning("请查询对账成功且未开票的订单")
|
||||
return
|
||||
}
|
||||
this.applySelectionCount = this.selections.length
|
||||
this.applyScope = {
|
||||
supplierId: query.supplierId,
|
||||
startDate: query.startDate,
|
||||
endDate: query.endDate,
|
||||
queryOrderId: query.orderId,
|
||||
userId: query.userId,
|
||||
orderIds: this.selections.map(item => item.orderId).join(",") || null
|
||||
}
|
||||
this.applyForm = {
|
||||
invoiceDate: [new Date().getFullYear(), String(new Date().getMonth() + 1).padStart(2, "0"), String(new Date().getDate()).padStart(2, "0")].join("-"),
|
||||
invoiceTitle: "测试工会(开发测试)",
|
||||
taxIdNumber: "91320100MA00000000",
|
||||
invoiceAddress: "江苏省南京市测试路1号(开发测试)",
|
||||
invoiceContact: "13800000000",
|
||||
invoiceType: 10
|
||||
}
|
||||
this.applyDialogVisible = true
|
||||
},
|
||||
submitApply() {
|
||||
this.$refs.applyFormRef.validate(async (valid) => {
|
||||
if (!valid || this.applyLoading) {
|
||||
return
|
||||
}
|
||||
this.applyLoading = true
|
||||
try {
|
||||
const params = Object.assign({}, this.applyForm, this.applyScope)
|
||||
const resp = await this.$axios.post("/platform/zhgh/points-mall/invoice/applyInvoice", params)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.data || "开票申请成功")
|
||||
this.applyDialogVisible = false
|
||||
this.selections = []
|
||||
this.$refs.tableRef.clearSelection()
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
} finally {
|
||||
this.applyLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
openRecordDialog() {
|
||||
this.recordDialogVisible = true
|
||||
this.recordForm.supplierId = this.pageForm.supplierId
|
||||
this.recordForm.orderId = this.pageForm.orderId
|
||||
this.recordForm.orderId = null
|
||||
this.recordPageData()
|
||||
},
|
||||
recordSearch() {
|
||||
|
||||
@@ -13,25 +13,6 @@ layout("/layouts/platform.html"){
|
||||
<search-item label="订单ID">
|
||||
<el-input clearable placeholder="请输入订单ID" v-model="pageForm.orderId"></el-input>
|
||||
</search-item>
|
||||
<search-item label="用户ID">
|
||||
<el-input clearable placeholder="请输入用户ID" v-model="pageForm.userId"></el-input>
|
||||
</search-item>
|
||||
<search-item label="批次号">
|
||||
<el-input clearable placeholder="请输入对账批次号" v-model="pageForm.batchNo"></el-input>
|
||||
</search-item>
|
||||
<search-item label="差异类型">
|
||||
<el-select clearable placeholder="请选择差异类型" style="width: 100%" v-model="pageForm.diffType">
|
||||
<el-option label="一致" :value="0"></el-option>
|
||||
<el-option label="异常" :value="1"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="通知状态">
|
||||
<el-select clearable placeholder="请选择通知状态" style="width: 100%" v-model="pageForm.noticeStatus">
|
||||
<el-option label="未推送" :value="0"></el-option>
|
||||
<el-option label="推送成功" :value="1"></el-option>
|
||||
<el-option label="推送失败" :value="2"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
@@ -39,11 +20,10 @@ layout("/layouts/platform.html"){
|
||||
<table-tool label="对账记录"></table-tool>
|
||||
<el-table :data="tableData" border class="vi-table" size="small" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column align="center" label="批次号" min-width="170" prop="batchNo" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="订单ID" min-width="170" prop="orderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="150" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商编码" min-width="130" prop="supplierId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="用户ID" min-width="120" prop="userId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="用户工号" min-width="120" prop="loginname" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="订单总金额(平台)" min-width="140" prop="pTotalPrice"></el-table-column>
|
||||
<el-table-column align="center" label="现金金额(平台)" min-width="130" prop="pCashAmount"></el-table-column>
|
||||
<el-table-column align="center" label="积分金额(平台)" min-width="130" prop="pPointsPrice"></el-table-column>
|
||||
@@ -57,18 +37,7 @@ layout("/layouts/platform.html"){
|
||||
<el-tag :type="diffTypeTag(row.diffType)" size="mini">{{ diffTypeName(row.diffType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="通知状态" min-width="110">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag :type="noticeStatusTag(row.noticeStatus)" size="mini">{{ noticeStatusName(row.noticeStatus) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="推送次数" min-width="90" prop="pushTime"></el-table-column>
|
||||
<el-table-column align="center" label="差异原因" min-width="240" prop="diffReason" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="90">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openDetail(row)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="pageForm.pageNumber"
|
||||
@@ -87,7 +56,7 @@ layout("/layouts/platform.html"){
|
||||
<el-descriptions-item label="批次号">{{ currentRecord.batchNo || "-" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单ID">{{ currentRecord.orderId || "-" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="供应商">{{ currentRecord.supplierName || currentRecord.supplierId || "-" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="用户ID">{{ currentRecord.userId || "-" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="用户工号">{{ currentRecord.loginname || "-" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="平台总金额">{{ currentRecord.pTotalPrice || "0" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="对账总金额">{{ currentRecord.sTotalPrice || "0" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="平台现金金额">{{ currentRecord.pCashAmount || "0" }}</el-descriptions-item>
|
||||
@@ -121,11 +90,7 @@ layout("/layouts/platform.html"){
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
supplierId: null,
|
||||
orderId: null,
|
||||
userId: null,
|
||||
diffType: null,
|
||||
batchNo: null,
|
||||
noticeStatus: null
|
||||
orderId: null
|
||||
},
|
||||
detailDialogVisible: false,
|
||||
currentRecord: null
|
||||
|
||||
@@ -146,36 +146,12 @@ layout("/layouts/platform_h5.html"){
|
||||
this.userPoints = resp.data || 0
|
||||
}
|
||||
},
|
||||
async openSupplier(item) {
|
||||
openSupplier(item) {
|
||||
if (!item.supplierUrl) {
|
||||
this.$toast("暂无跳转地址")
|
||||
return
|
||||
}
|
||||
const userId = this.$store && this.$store.state.user ? this.$store.state.user.id : ""
|
||||
if (!userId) {
|
||||
this.$toast("获取用户信息失败,请重新登录后再试")
|
||||
return
|
||||
}
|
||||
window.location.href = this.withSupplierQuery(item.supplierUrl, {
|
||||
userId: userId
|
||||
})
|
||||
},
|
||||
withSupplierQuery(url, params) {
|
||||
const query = Object.keys(params)
|
||||
.filter((key) => params[key] !== undefined && params[key] !== null && params[key] !== "")
|
||||
.map((key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key]))
|
||||
.join("&")
|
||||
if (!query) {
|
||||
return url
|
||||
}
|
||||
const hashIndex = url.indexOf("#")
|
||||
if (hashIndex > -1) {
|
||||
const base = url.slice(0, hashIndex)
|
||||
const hash = url.slice(hashIndex)
|
||||
const joiner = hash.indexOf("?") > -1 ? "&" : "?"
|
||||
return base + hash + joiner + query
|
||||
}
|
||||
return url + (url.indexOf("?") > -1 ? "&" : "?") + query
|
||||
window.location.href = item.supplierUrl
|
||||
},
|
||||
onImgError(e) {
|
||||
e.target.src = this.defaultLogo
|
||||
|
||||
@@ -257,6 +257,7 @@ layout("/layouts/platform_h5.html"){
|
||||
return item ? item.class : "gray"
|
||||
},
|
||||
getOrderStatusItem(value) {
|
||||
if (Number(value) === 1) return { code: 1, name: "已支付", class: "blue" }
|
||||
const list = this.normalTabList.concat(this.specialTabList)
|
||||
return list.find((tab) => Number(tab.code) === Number(value))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user