From b4668a820cb11703613c59d6529898e230be0b28 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 04 八月 2025 14:57:18 +0800
Subject: [PATCH] bug修改
---
src/views/order/index.vue | 350 +++++++++++++++++++++++++++++++++------------------------
1 files changed, 203 insertions(+), 147 deletions(-)
diff --git a/src/views/order/index.vue b/src/views/order/index.vue
index 05f2131..9fdb65a 100644
--- a/src/views/order/index.vue
+++ b/src/views/order/index.vue
@@ -1,166 +1,183 @@
<template>
- <div class="app-container">
- <div style="display: flex; justify-content: space-between">
- <div style="width: 300px">
- <el-input
- placeholder="鎸夊鍚嶃�佽绋嬨�佺數璇濇悳绱�"
- v-model="data.keyword"
- class="input-with-select"
- size="small"
- >
- <el-button
- slot="append"
- icon="el-icon-search"
- @click="handleClick"
- ></el-button>
- </el-input>
- </div>
- </div>
- <div style="height: calc(100vh - 208px)">
- <el-table
- v-loading="listLoading"
- :data="list"
- element-loading-text="Loading"
- fit
- height="100%"
- >
- <el-table-column label="璁㈠崟鍙�" width="200" prop="number">
- </el-table-column>
- <el-table-column label="瀛﹀憳" prop="playerBaseInfo.name">
- </el-table-column>
- <el-table-column label="鐢佃瘽" prop="mobile"> </el-table-column>
- <el-table-column label="璐拱鏂瑰紡" width="200" prop="payType">
- <template slot-scope="scope">
- {{ scope.row.payType == "DIRECT" ? "鏀惰垂褰曞叆" : "鍟嗗煄璐叆" }}
- </template>
- </el-table-column>
- <el-table-column label="鎬讳环" width="80" prop="originAmt">
- </el-table-column>
- <el-table-column label="鎶樻墸" width="80" prop="discount">
- </el-table-column>
- <el-table-column label="瀹為檯缂磋垂" width="80" prop="amt">
- </el-table-column>
- <el-table-column label="璁㈠崟鏃堕棿" width="200" prop="createTime">
- </el-table-column>
- <el-table-column label="鎿嶄綔" width="200">
- <template slot-scope="scope">
- <el-link
- @click="handlePrint(scope.row)"
- type="primary"
- :underline="false"
- >鎵撳嵃鏀舵嵁</el-link
+ <div class="app-container">
+ <div style="display: flex; justify-content: space-between">
+ <div style="width: 300px">
+ <el-input
+ placeholder="鎸夊鍚嶃�佽绋嬨�佺數璇濇悳绱�"
+ v-model="data.keyword"
+ class="input-with-select"
+ size="small"
+ >
+ <el-button
+ slot="append"
+ icon="el-icon-search"
+ @click="handleClick"
+ ></el-button>
+ </el-input>
+ </div>
+ </div>
+ <div style="height: calc(100vh - 158px)">
+ <el-table
+ v-loading="listLoading"
+ :data="list"
+ element-loading-text="Loading"
+ fit
+ height="100%"
>
- </template>
- </el-table-column>
- </el-table>
+ <el-table-column label="璁㈠崟鍙�" width="200" prop="number">
+ </el-table-column>
+ <el-table-column label="瀛﹀憳" prop="playerBaseInfo.name">
+ </el-table-column>
+ <el-table-column label="鐢佃瘽" prop="mobile"> </el-table-column>
+ <el-table-column label="璐拱鏂瑰紡" prop="payType">
+ <template slot-scope="scope">
+ {{
+ scope.row.payType == 'DIRECT'
+ ? '鏀惰垂褰曞叆'
+ : '鍟嗗煄璐叆'
+ }}
+ </template>
+ </el-table-column>
+ <el-table-column label="鎬讳环" width="80" prop="originAmt">
+ </el-table-column>
+ <el-table-column label="鎶樻墸" width="80" prop="discount">
+ </el-table-column>
+ <el-table-column label="瀹為檯缂磋垂" width="80" prop="amt">
+ </el-table-column>
+ <el-table-column label="璁㈠崟鏃堕棿" width="180" prop="createTime">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="120">
+ <template slot-scope="scope">
+ <el-link
+ @click="handlePrint(scope.row)"
+ type="primary"
+ :underline="false"
+ >鎵撳嵃鏀舵嵁</el-link
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <div>
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="data.pageIn.index + 1"
+ :page-sizes="[10, 20, 30, 40]"
+ :page-size="data.pageIn.size"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="total"
+ >
+ </el-pagination>
+ </div>
</div>
- <div>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="data.pageIn.index + 1"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="data.pageIn.size"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
- </div>
</template>
<script>
-import { getData } from "@/api/order";
+import { getData, findPlayerAccByOrderId } from "@/api/order";
import { printHtml } from "@/utils/print";
import { convertCurrency } from "@/utils/ruoyi";
export default {
- filters: {
- statusFilter(status) {
- const statusMap = {
- published: "success",
- draft: "gray",
- deleted: "danger",
- };
- return statusMap[status];
- },
- },
- data() {
- return {
- dateRange: [],
- list: null,
- listLoading: true,
- total: 0,
- data: {
- staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
- keyword: "",
- pageIn: {
- //鍙�夛紝濡傛灉鏄垎椤垫煡璇紝闇�瑕佸姞涓娿��
- index: 0, //蹇呴��
- size: 10, //姣忛〉鐨勫ぇ灏忋�傞粯璁�20
- sorts: {
- name: "createTime", //鎺掑簭瀛楁鍚嶇О
- direction: "DESC", //鎺掑簭鏂瑰悜
- },
+ filters: {
+ statusFilter(status) {
+ const statusMap = {
+ published: "success",
+ draft: "gray",
+ deleted: "danger",
+ };
+ return statusMap[status];
},
- },
- dialogVisible: false,
- };
- },
- created() {
- this.fetchData();
- },
- methods: {
- reloadData() {
- this.dialogVisible = false;
- this.fetchData();
},
- fetchData() {
- this.listLoading = true;
- getData(this.data).then((response) => {
- this.list = response.data.findOrderByOrgId.ls;
- this.total = response.data.findOrderByOrgId.pageOut.total;
- this.listLoading = false;
- });
+ data() {
+ return {
+ dateRange: [],
+ list: null,
+ listLoading: true,
+ total: 0,
+ data: {
+ staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
+ keyword: "",
+ pageIn: {
+ //鍙�夛紝濡傛灉鏄垎椤垫煡璇紝闇�瑕佸姞涓娿��
+ index: 0, //蹇呴��
+ size: 10, //姣忛〉鐨勫ぇ灏忋�傞粯璁�20
+ sorts: {
+ name: "createTime", //鎺掑簭瀛楁鍚嶇О
+ direction: "DESC", //鎺掑簭鏂瑰悜
+ },
+ },
+ },
+ dialogVisible: false,
+ };
},
- handleClick() {
- this.fetchData();
+ created() {
+ this.fetchData();
},
- handleSizeChange(val) {
- this.data.pageIn.size = val;
- this.fetchData();
- },
- handleCurrentChange(val) {
- this.data.pageIn.index = val - 1;
- this.fetchData();
- },
- handlePrint(row) {
- const orgName = JSON.parse(localStorage.getItem("selectStaff")).org.name;
+ methods: {
+ reloadData() {
+ this.dialogVisible = false;
+ this.fetchData();
+ },
+ fetchData() {
+ this.listLoading = true;
+ getData(this.data).then((response) => {
+ this.list = response.data.findOrderVoByOrgId.ls;
+ this.total = response.data.findOrderVoByOrgId.pageOut.total;
+ this.listLoading = false;
+ });
+ },
+ handleClick() {
+ this.fetchData();
+ },
+ handleSizeChange(val) {
+ this.data.pageIn.size = val;
+ this.fetchData();
+ },
+ handleCurrentChange(val) {
+ this.data.pageIn.index = val - 1;
+ this.fetchData();
+ },
+ handlePrint(row) {
- let detail = "";
- row.details.forEach((o) => {
- detail += `<tr>
+ if (row.payType == "DIRECT") {
+ findPlayerAccByOrderId({ 'orderId': row.id }).then(res => {
+ if (res.data.findPlayerAccByOrderId.length > 0) {
+ row.staffName = res.data.findPlayerAccByOrderId[0].staffName
+ row.message = res.data.findPlayerAccByOrderId[0].description
+ }
+ this.doPrint(row)
+ })
+ }
+ else {
+ this.doPrint(row)
+ }
+
+ },
+ doPrint(row) {
+ const orgName = JSON.parse(localStorage.getItem("selectStaff")).org.name;
+ let detail = "";
+ row.details.forEach((o) => {
+ detail += `<tr>
<td> ${o.voucherName || o.goodsName}</td>
<td>${o.qty} </td>
- <td> ${o.giftQty}</td>
+ <td> ${o.giftQty || 0}</td>
<td>${o.amt}</td>
- <td>${row.saleStaff.name} </td>
+ <td>${row.saleStaff ? row.saleStaff.name : ''} </td>
</tr>`;
- });
+ });
- let printData = `<div style="display: flex; justify-content: center;">
+ let printData = `<div style="display: flex; justify-content: center;">
<div style="margin-top: 50px; width: 600px;line-height: 2;">
<h2 style="text-align: center;">${orgName}缂磋垂鏀舵嵁 </h2>
<div> 璁㈠崟鍙凤細${row.number}</div>
<div class="div-2-column">
- <div> 瀛﹀憳濮撳悕锛�<u>${
- row.playerBaseInfo ? row.playerBaseInfo.name : ""
- }</u> </div>
+ <div> 瀛﹀憳濮撳悕锛�<u>${row.playerBaseInfo ? (row.playerBaseInfo.name||'') : ""
+ }</u> </div>
<div>鑱旂郴鐢佃瘽锛�<u>${row.mobile || "鏈綍鍏�"} </u></div>
</div>
- <div> 璁㈠崟绫诲瀷锛�${
- row.payType == "DIRECT" ? "鏀惰垂褰曞叆" : "鍟嗗煄璐叆"
- } </div>
+ <div> 璁㈠崟绫诲瀷锛�${row.payType == "DIRECT" ? "鏀惰垂褰曞叆" : "鍟嗗煄璐叆"
+ } </div>
<div class="m-h2"> 璇剧▼淇℃伅</div>
<table class="txt-center" width="100%" border="1" cellpadding="2" cellspacing="0">
@@ -168,7 +185,7 @@
<th width="140px" nowradiv>绉戠洰</th>
<th width="80px" nowradiv>鏁伴噺</th>
<th width="80px" nowradiv>璧犻��</th>
- <th width="100px" nowradiv>浣欓</th>
+ <th width="100px" nowradiv>閲戦</th>
<th>璇剧▼椤鹃棶</th>
</tr>
${detail}
@@ -183,25 +200,64 @@
<td> 鎶樻墸/璧犻�侀噾棰濓細${row.discount}</td>
</tr>
<tr>
- <td> 瀹炵即閲戦锛�${convertCurrency(row.amt)}锛埪�${
- row.amt
- }锛�</td>
+ <td> 瀹炵即閲戦锛�${convertCurrency(row.amt)}锛埪�${row.amt
+ }锛�</td>
</tr>
</table>
+ <div> 鏍″尯鍦板潃锛�${row.org.address||row.org.addressDetail}</div>
<div> 澶囨敞锛�${row.message || ""} </div>
<br>
<br>
<div class="div-2-column">
- <div> 缁忓姙浜猴細${row.buyer.name} </div>
+ <div> 缁忓姙浜猴細${row.staffName || ''} </div>
<div>缁忓姙鏃ユ湡锛�${row.createTime} </div>
</div>
</div>
</div>`;
- printHtml(printData);
+ printHtml(printData);
+ },
+ showCreate() {
+ this.$refs.studentCreate.showDialog();
+ },
},
- showCreate() {
- this.$refs.studentCreate.showDialog();
- },
- },
};
</script>
+
+<style>
+#print-container {
+ display: none;
+}
+@media print {
+ body > :not(.print-container) {
+ display: none;
+ }
+ html,
+ body {
+ display: block !important;
+ }
+ #print-container {
+ display: block;
+ }
+}
+@page {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+.div-2-column {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+}
+.m-h2 {
+ text-align: center;
+ font-size: 1.17em;
+ margin-top: 50px;
+ font-weight: bold;
+}
+#tr {
+ height: 30px;
+}
+.txt-center {
+ text-align: center;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0