diff --git a/src/filters/order.js b/src/filters/order.js index 5217a51..d9fb3f9 100644 --- a/src/filters/order.js +++ b/src/filters/order.js @@ -15,8 +15,8 @@ */ export function paidFilter(status) { const statusMap = { - true: '已支付', - false: '未支付', + true: "已支付", + false: "未支付" }; return statusMap[status]; } @@ -27,46 +27,38 @@ export function paidFilter(status) { */ export function orderStatusFilter(status) { const statusMap = { - 0: '待付款', - 1: '待发货', - 2: '部分发货', - 3: '待核销', - 4: '待收货', - 5: '已收货', - 6: '已完成', - 9: '已取消', + 0: "待付款", + 1: "待发货", + 2: "部分发货", + 3: "待核销", + 4: "待收货", + 5: "已收货", + 6: "已完成", + 9: "已取消" }; return statusMap[status]; } /** - * @description 订单中的退款状态 + * @description 订单业务状态 */ -export function orderRefundStatusFilter(status) { +export function orderBusinessStatusFilter(status) { const statusMap = { - 0: '未退款', - 1: '申请退款中', - 2: '部分退款', - 3: '已退款', + 0: "待支付", + 1: "待接单", + 2: "待备货", + 3: "待取货", + 4: "已取货(待配送)", + 5: "配送中(待送达)", + 6: "已配送(待收货或已送达自提点)", + 8: "完成(待评价或自动完成)", + "-1": "未支付订单取消", + "-2": "申请退款", + "-3": "同意退款", + "-4": "整单退款完成", + "-5": "部分退款完成" }; - return statusMap[status]; -} - -/** - * @description 退款单退款状态 - * - */ -export function refundStatusFilter(status) { - const statusMap = { - 0: '待审核', - 1: '商家拒绝', - 2: '退款中', - 3: '退款成功', - 4: '用户退货', - 5: '商家待收货', - 6: '已撤销', - }; - return statusMap[status]; + return statusMap[status] || statusMap[String(status)] || "未知状态"; } /** @@ -74,9 +66,9 @@ export function refundStatusFilter(status) { */ export function payTypeFilter(status) { const statusMap = { - weixin: '微信', - alipay: '支付宝', - yue: '余额', + weixin: "微信", + alipay: "支付宝", + yue: "余额" }; return statusMap[status]; } @@ -86,11 +78,11 @@ export function payTypeFilter(status) { */ export function orderTypeFilter(status) { const statusMap = { - 0: '普通订单', - 1: '视频号订单', - 2: '秒杀订单', - 5: '云盘订单', - 6: '卡密订单', + 0: "普通订单", + 1: "视频号订单", + 2: "秒杀订单", + 5: "云盘订单", + 6: "卡密订单" }; return statusMap[status]; } diff --git a/src/views/modules/marketing/points-order/popup/view-details.vue b/src/views/modules/marketing/points-order/popup/view-details.vue index 48277c4..6857857 100644 --- a/src/views/modules/marketing/points-order/popup/view-details.vue +++ b/src/views/modules/marketing/points-order/popup/view-details.vue @@ -20,10 +20,10 @@ {{ ruleForm.preSaleStage === 1 - ? '已付定金' + ? "已付定金" : ruleForm.preSaleStage === 2 - ? '已付尾款' - : '待付定金' + ? "已付尾款" + : "待付定金" }} diff --git a/src/views/modules/operation-management/brand-market/popup/view-details.vue b/src/views/modules/operation-management/brand-market/popup/view-details.vue index c357cf7..22a1f21 100644 --- a/src/views/modules/operation-management/brand-market/popup/view-details.vue +++ b/src/views/modules/operation-management/brand-market/popup/view-details.vue @@ -109,11 +109,11 @@ export default { title: "订单详情", show: false, width: "1200px", - fullscreen: true, + fullscreen: true }, modalData: {}, ruleForm: {}, - tableData: [], + tableData: [] }; }, watch: { @@ -145,7 +145,7 @@ export default { update: () => { this.modalConfig.title = "店铺详情"; this.isAdd = false; - }, + } }; }, init(row) { @@ -154,24 +154,7 @@ export default { }, handleSelectionChange(e) { console.log(e); - }, - getRefundStatus(val) { - if (val == 0) { - return "正常"; - } else if (val == 1) { - return "退款中"; - } else if (val == 2) { - return "完全退款"; - } else if (val == 3) { - return "部分退款"; - } else if (val == 4) { - return "拒绝用户退款"; - } else if (val == -1) { - return "退款失败"; - } else if (val == -2) { - return "用户申请退款中"; - } - }, + } }, computed: { modalHandles() { @@ -180,8 +163,8 @@ export default { label: "关闭", handle: () => { this.toggle(); - }, - }, + } + } // { // label: "确认", // type: "primary", @@ -190,10 +173,9 @@ export default { // }, // }, ]; - }, + } }, - asyncComputed: {}, + asyncComputed: {} }; - \ No newline at end of file + diff --git a/src/views/modules/operation-management/brand-order/index.vue b/src/views/modules/operation-management/brand-order/index.vue index 06e6764..4e291ae 100644 --- a/src/views/modules/operation-management/brand-order/index.vue +++ b/src/views/modules/operation-management/brand-order/index.vue @@ -100,10 +100,10 @@ - - - - + + + + @@ -179,9 +179,9 @@ {{ filterUnitStatus(scope.row.status) }} - + @@ -218,20 +218,20 @@ export default { pageNumber: 1, pageSize: 10, brandId: "", - agentId: "", + agentId: "" }, form: { name: "", orderNo: "", startTime: "", - endTime: "", + endTime: "" }, total: 0, state: "", tableData: [], time: "", overviewList: {}, - isBrand: false, + isBrand: false }; }, created() { @@ -257,9 +257,9 @@ export default { .distributorOrBrandOrderPage({ ...this.formInline, state: this.state, - ...this.form, + ...this.form }) - .then((res) => { + .then(res => { console.log(res); this.tableData = res.data.data.data; this.total = Number(res.data.data.total); @@ -267,7 +267,7 @@ export default { this.$api.mer_admin .orderOverview({ ...this.formInline, ...this.form }) .then() - .then((res) => { + .then(res => { this.overviewList = res.data.data; console.log(res); }); @@ -277,7 +277,7 @@ export default { name: "", orderNo: "", startTime: "", - endTime: "", + endTime: "" }; this.getList(); }, @@ -313,16 +313,16 @@ export default { case "未支付订单取消": this.state = -1; break; - case "用户申请退款中": + case "申请退款": this.state = -2; break; - case "用户申请已退款": + case "同意退款": this.state = -3; break; - case "商家取消订单": + case "整单退款完成": this.state = -4; break; - case "平台取消订单": + case "部分退款完成": this.state = -5; break; } @@ -370,30 +370,13 @@ export default { } else if (val == -1) { return "未支付订单取消"; } else if (val == -2) { - return "用户申请退款中"; + return "申请退款"; } else if (val == -3) { - return "用户申请已退款"; + return "同意退款"; } else if (val == -4) { - return "商家取消订单"; + return "整单退款完成"; } else if (val == -5) { - return "平台取消订单"; - } - }, - filterUnitRefundStatus(val) { - if (val === 0) { - return "正常"; - } else if (val == 1) { - return "退款中"; - } else if (val == 2) { - return "完全退款"; - } else if (val == 3) { - return "部分退款"; - } else if (val == 4) { - return "拒绝用户退款"; - } else if (val == -1) { - return "退款失败"; - } else if (val == -2) { - return "用户申请退款中"; + return "部分退款完成"; } }, changeTime(e) { @@ -404,8 +387,8 @@ export default { this.form.startTime = ""; this.form.endTime = ""; } - }, - }, + } + } }; @@ -431,4 +414,4 @@ export default { .stat-title { margin-bottom: 5px; } - \ No newline at end of file + diff --git a/src/views/modules/operation-management/brand-store/popup/view-details.vue b/src/views/modules/operation-management/brand-store/popup/view-details.vue index fe8a681..d7dca97 100644 --- a/src/views/modules/operation-management/brand-store/popup/view-details.vue +++ b/src/views/modules/operation-management/brand-store/popup/view-details.vue @@ -153,11 +153,11 @@ export default { title: "订单详情", show: false, width: "1200px", - fullscreen: true, + fullscreen: true }, modalData: {}, ruleForm: {}, - tableData: [], + tableData: [] }; }, watch: { @@ -189,7 +189,7 @@ export default { update: () => { this.modalConfig.title = "店铺详情"; this.isAdd = false; - }, + } }; }, init(row) { @@ -198,24 +198,7 @@ export default { }, handleSelectionChange(e) { console.log(e); - }, - getRefundStatus(val) { - if (val == 0) { - return "正常"; - } else if (val == 1) { - return "退款中"; - } else if (val == 2) { - return "完全退款"; - } else if (val == 3) { - return "部分退款"; - } else if (val == 4) { - return "拒绝用户退款"; - } else if (val == -1) { - return "退款失败"; - } else if (val == -2) { - return "用户申请退款中"; - } - }, + } }, computed: { modalHandles() { @@ -224,8 +207,8 @@ export default { label: "关闭", handle: () => { this.toggle(); - }, - }, + } + } // { // label: "确认", // type: "primary", @@ -234,10 +217,9 @@ export default { // }, // }, ]; - }, + } }, - asyncComputed: {}, + asyncComputed: {} }; - \ No newline at end of file + diff --git a/src/views/modules/operation-management/order/index.vue b/src/views/modules/operation-management/order/index.vue index 4e57a85..ccb6577 100644 --- a/src/views/modules/operation-management/order/index.vue +++ b/src/views/modules/operation-management/order/index.vue @@ -64,8 +64,19 @@ - 搜索 - 重置 + 搜索 + 重置 @@ -102,170 +113,212 @@ - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -280,13 +333,13 @@ export default { receiverName: "", unitOrderNo: "", statusList: [], - dateRange: [], + dateRange: [] }, stats: { totalCount: 0, totalMoney: 0, completeRate: 0, - agentCommission: 0, + agentCommission: 0 }, orderStatusOptions: [ { label: "待支付", value: 0 }, @@ -298,20 +351,20 @@ export default { { label: "已配送(待收货)", value: 6 }, { label: "完成", value: 8 }, { label: "未支付订单取消", value: -1 }, - { label: "用户申请退款中", value: -2 }, - { label: "用户申请已退款", value: -3 }, - { label: "商家取消订单", value: -4 }, - { label: "平台取消订单", value: -5 }, + { label: "申请退款", value: -2 }, + { label: "同意退款", value: -3 }, + { label: "整单退款完成", value: -4 }, + { label: "部分退款完成", value: -5 } ], tableData: [], pagination: { pageNumber: 1, pageSize: 10, - total: 0, + total: 0 }, loading: false, expandedRows: [], - expandedShopRows: {}, + expandedShopRows: {} }; }, watch: { @@ -319,8 +372,8 @@ export default { handler(query) { this.applyQueryParamsAndSearch(query); }, - immediate: true, - }, + immediate: true + } }, methods: { applyQueryParamsAndSearch(query) { @@ -342,9 +395,11 @@ export default { const params = { receiverName: this.searchForm.receiverName || null, unitOrderNo: this.searchForm.unitOrderNo || null, - statusList: this.searchForm.statusList.length ? this.searchForm.statusList.join(',') : null, + statusList: this.searchForm.statusList.length + ? this.searchForm.statusList.join(",") + : null, startTime: null, - endTime: null, + endTime: null }; if (this.searchForm.dateRange && this.searchForm.dateRange.length === 2) { params.startTime = this.searchForm.dateRange[0]; @@ -357,41 +412,48 @@ export default { const params = { ...this.getCommonParams(), pageNumber: this.pagination.pageNumber, - pageSize: this.pagination.pageSize, + pageSize: this.pagination.pageSize }; - mer_admin.orderV2Page(params).then(res => { - if (res.data && res.data.data) { - this.tableData = res.data.data.data; - this.pagination.total = parseInt(res.data.data.total) || 0; - } else { + mer_admin + .orderV2Page(params) + .then(res => { + if (res.data && res.data.data) { + this.tableData = res.data.data.data; + this.pagination.total = parseInt(res.data.data.total) || 0; + } else { + this.tableData = []; + this.pagination.total = 0; + } + }) + .catch(err => { + console.error("Error fetching order data:", err); this.tableData = []; this.pagination.total = 0; - } - }).catch(err => { - console.error("Error fetching order data:", err); - this.tableData = []; - this.pagination.total = 0; - }).finally(() => { - this.loading = false; - }); + }) + .finally(() => { + this.loading = false; + }); }, fetchOverview() { const params = this.getCommonParams(); - mer_admin.orderV2Overview(params).then(res => { - if (res.data && res.data.data) { - this.stats = res.data.data; - } else { - this.stats = { - totalCount: 0, - totalMoney: 0, - completeRate: 0, - agentCommission: 0, - }; - } - }).catch(err => { - console.error("Error fetching overview data:", err); - }); + mer_admin + .orderV2Overview(params) + .then(res => { + if (res.data && res.data.data) { + this.stats = res.data.data; + } else { + this.stats = { + totalCount: 0, + totalMoney: 0, + completeRate: 0, + agentCommission: 0 + }; + } + }) + .catch(err => { + console.error("Error fetching overview data:", err); + }); }, handleSearch() { this.pagination.pageNumber = 1; @@ -415,27 +477,32 @@ export default { if (status === undefined || status === null) { return "未知状态"; } - const statusOption = this.orderStatusOptions.find(opt => opt.value === status); + const statusOption = this.orderStatusOptions.find( + opt => opt.value === status + ); return statusOption ? statusOption.label : "未知状态"; }, getStatusTagType(status) { switch (status) { - case 0: return 'warning'; // 待支付 + case 0: + return "warning"; // 待支付 case 1: case 2: case 3: case 4: case 5: case 6: - return 'info'; // 进行中 - case 8: return 'success'; // 完成 + return "info"; // 进行中 + case 8: + return "success"; // 完成 case -1: case -2: case -3: case -4: case -5: - return 'danger'; // 取消或退款 - default: return 'primary'; + return "danger"; // 取消或退款 + default: + return "primary"; } }, viewDetails(row) { @@ -448,34 +515,34 @@ export default { }, getShopStatusText(status) { const shopStatusMap = { - 0: '待备货', - 1: '备货完成 待取货', - 2: '已取货(待配送)', - 3: '配送中', - 4: '配送完成(待收货)', - 5: '待评价', - 6: '已完成' + 0: "待备货", + 1: "备货完成 待取货", + 2: "已取货(待配送)", + 3: "配送中", + 4: "配送完成(待收货)", + 5: "待评价", + 6: "已完成" }; - return shopStatusMap[status] || '未知状态'; + return shopStatusMap[status] || "未知状态"; }, getShopStatusType(status) { switch (status) { case 0: // 待备货 case 1: // 备货完成 待取货 - return 'warning'; + return "warning"; case 2: // 已取货(待配送) case 3: // 配送中 case 4: // 配送完成(待收货) - return 'info'; + return "info"; case 5: // 待评价 - return 'primary'; + return "primary"; case 6: // 已完成 - return 'success'; + return "success"; default: - return 'danger'; + return "danger"; } } - }, + } }; @@ -502,7 +569,7 @@ export default { .stat-value { font-size: 20px; font-weight: bold; - color: #409EFF; + color: #409eff; } .search-form .el-form-item { margin-bottom: 10px; diff --git a/src/views/modules/operation-management/order/popup/view-details.vue b/src/views/modules/operation-management/order/popup/view-details.vue index a2e3ba3..6eebe22 100644 --- a/src/views/modules/operation-management/order/popup/view-details.vue +++ b/src/views/modules/operation-management/order/popup/view-details.vue @@ -112,7 +112,7 @@ > - {{ruleForm.createTime}} + {{ ruleForm.createTime }} @@ -219,11 +219,11 @@ export default { title: "订单详情", show: false, width: "1200px", - fullscreen: true, + fullscreen: true }, modalData: {}, ruleForm: {}, - tableData: [], + tableData: [] }; }, watch: { @@ -255,7 +255,7 @@ export default { update: () => { this.modalConfig.title = "订单详情"; this.isAdd = false; - }, + } }; }, init(row) { @@ -264,24 +264,7 @@ export default { }, handleSelectionChange(e) { console.log(e); - }, - getRefundStatus(val) { - if (val == 0) { - return "正常"; - } else if (val == 1) { - return "退款中"; - } else if (val == 2) { - return "完全退款"; - } else if (val == 3) { - return "部分退款"; - } else if (val == 4) { - return "拒绝用户退款"; - } else if (val == -1) { - return "退款失败"; - } else if (val == -2) { - return "用户申请退款中"; - } - }, + } }, computed: { modalHandles() { @@ -290,8 +273,8 @@ export default { label: "关闭", handle: () => { this.toggle(); - }, - }, + } + } // { // label: "确认", // type: "primary", @@ -300,10 +283,9 @@ export default { // }, // }, ]; - }, + } }, - asyncComputed: {}, + asyncComputed: {} }; - \ No newline at end of file + diff --git a/src/views/modules/operation-management/total-order/popup/view-details.vue b/src/views/modules/operation-management/total-order/popup/view-details.vue index 2ecad38..8ed7611 100644 --- a/src/views/modules/operation-management/total-order/popup/view-details.vue +++ b/src/views/modules/operation-management/total-order/popup/view-details.vue @@ -111,8 +111,10 @@ - - {{ getRefundStatus(ruleForm.refundStatus) }} + + {{ + getBusinessStatus(ruleForm.unitOrderOriginStatus) + }} @@ -219,11 +221,11 @@ export default { title: "订单详情", show: false, width: "1200px", - fullscreen: true, + fullscreen: true }, modalData: {}, ruleForm: {}, - tableData: [], + tableData: [] }; }, watch: { @@ -255,7 +257,7 @@ export default { update: () => { this.modalConfig.title = "订单详情"; this.isAdd = false; - }, + } }; }, init(row) { @@ -265,23 +267,24 @@ export default { handleSelectionChange(e) { console.log(e); }, - getRefundStatus(val) { - if (val == 0) { - return "正常"; - } else if (val == 1) { - return "退款中"; - } else if (val == 2) { - return "完全退款"; - } else if (val == 3) { - return "部分退款"; - } else if (val == 4) { - return "拒绝用户退款"; - } else if (val == -1) { - return "退款失败"; - } else if (val == -2) { - return "用户申请退款中"; - } - }, + getBusinessStatus(val) { + const statusMap = { + 0: "待支付", + 1: "待接单", + 2: "待备货", + 3: "待取货", + 4: "已取货(待配送)", + 5: "配送中(待送达)", + 6: "已配送(待收货或已送达自提点)", + 8: "完成(待评价或自动完成)", + "-1": "未支付订单取消", + "-2": "申请退款", + "-3": "同意退款", + "-4": "整单退款完成", + "-5": "部分退款完成" + }; + return statusMap[val] || statusMap[String(val)] || "未知状态"; + } }, computed: { modalHandles() { @@ -290,8 +293,8 @@ export default { label: "关闭", handle: () => { this.toggle(); - }, - }, + } + } // { // label: "确认", // type: "primary", @@ -300,10 +303,9 @@ export default { // }, // }, ]; - }, + } }, - asyncComputed: {}, + asyncComputed: {} }; - \ No newline at end of file + diff --git a/src/views/modules/presale/order/popup/view-details.vue b/src/views/modules/presale/order/popup/view-details.vue index 48277c4..6857857 100644 --- a/src/views/modules/presale/order/popup/view-details.vue +++ b/src/views/modules/presale/order/popup/view-details.vue @@ -20,10 +20,10 @@ {{ ruleForm.preSaleStage === 1 - ? '已付定金' + ? "已付定金" : ruleForm.preSaleStage === 2 - ? '已付尾款' - : '待付定金' + ? "已付尾款" + : "待付定金" }}