feat: 积分商城-对账-发票-优化4

This commit is contained in:
2026-09-08 20:11:56 +08:00
parent ecb5c8f40a
commit e78d75c516
11 changed files with 177 additions and 84 deletions
@@ -50,22 +50,23 @@ layout("/layouts/platform.html"){
<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 :index="orderIndexMethod" 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="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">
<template slot-scope="{row}">{{ (Number(row.pointsPrice || 0) - Number(row.refund || 0)).toFixed(2) }}</template>
<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="110" prop="refund"></el-table-column>
<el-table-column align="center" label="开票状态" min-width="100">
<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"
@@ -380,6 +381,14 @@ layout("/layouts/platform.html"){
invoiceResultType(value) {
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: "开票中" }
return map[value] || "-"
@@ -129,6 +129,8 @@ layout("/layouts/platform.html"){
</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>
@@ -274,6 +276,8 @@ layout("/layouts/platform.html"){
},
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: "测试工会(开发测试)",
@@ -478,13 +482,24 @@ layout("/layouts/platform.html"){
}
},
openApplyDialog() {
if (!this.pageForm.supplierId || !this.pageForm.startDate || !this.pageForm.endDate) {
if (this.tableLoading || !this.lastQuery) {
this.notifyWarning("请先查询订单列表")
return
}
if (!this.selections.length) {
this.notifyWarning("请先勾选需要开票的订单")
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: "测试工会(开发测试)",
@@ -497,17 +512,12 @@ layout("/layouts/platform.html"){
},
submitApply() {
this.$refs.applyFormRef.validate(async (valid) => {
if (!valid) {
if (!valid || this.applyLoading) {
return
}
this.applyLoading = true
try {
const params = Object.assign({}, this.applyForm, {
supplierId: this.pageForm.supplierId,
startDate: this.pageForm.startDate,
endDate: this.pageForm.endDate,
orderIds: this.selections.map((item) => item.orderId).join(",")
})
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 || "开票申请成功")
@@ -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