Explorar el Código

批发-订单详情新增打印时间按钮

ouyang hace 1 semana
padre
commit
282267f00f
Se han modificado 2 ficheros con 130 adiciones y 4 borrados
  1. 3 3
      ghsApp/src/admin/home/components/OrderItem.vue
  2. 127 1
      ghsApp/src/pagesOrder/detail.vue

+ 3 - 3
ghsApp/src/admin/home/components/OrderItem.vue

@@ -871,7 +871,7 @@ export default {
 
 .print-log-head {
   color: #3385ff;
-  font-size: 28upx;
+  font-size: 33upx;
   margin-bottom: 20upx;
 }
 
@@ -887,13 +887,13 @@ export default {
 
 .print-log-time {
   color: #b8860b;
-  font-size: 28upx;
+  font-size: 34upx;
   margin-bottom: 8upx;
 }
 
 .print-log-order-id {
   color: #2e7d32;
-  font-size: 26upx;
+  font-size: 28upx;
   word-break: break-all;
 }
 

+ 127 - 1
ghsApp/src/pagesOrder/detail.vue

@@ -133,6 +133,9 @@
 				<view class="order-info_box">
 					<view>配送时间:</view>
 					<view>{{ detailInfo.sendTimeWant }}</view>
+					<view class="price">
+						<button @click.stop="openPrintLog()" class="admin-button-com default">打印时间</button>
+					</view>
 				</view>
 </block>
 				<view class="order-info_box">
@@ -635,6 +638,27 @@
 			</view>
 		</uni-popup>
 
+		<!-- 打印时间记录 -->
+		<uni-popup ref="printLogPopup" background-color="#fff" type="center" :animation="true" class="class-popup-style">
+			<view class="print-log-popup-body">
+				<view class="print-log-sn-box">
+					<text class="print-log-sn-label">打印机编号</text>
+					<text class="print-log-sn-value">{{ printLogData.printSn || '-' }}</text>
+				</view>
+				<view class="print-log-head">打印时间 / 打印订单ID</view>
+				<view class="print-log-list" v-if="printLogData.list && printLogData.list.length">
+					<view class="print-log-item" v-for="(log, idx) in printLogData.list" :key="log.feieOrderId + '_' + idx">
+						<view class="print-log-time">{{ log.printTimeText || '等待回调' }}</view>
+						<view class="print-log-order-id">{{ log.feieOrderId }}</view>
+					</view>
+				</view>
+				<view class="print-log-empty" v-else>暂无打印记录</view>
+				<view class="text-center print-log-close">
+					<button class="admin-button-com default" @click="closePrintLog">关闭</button>
+				</view>
+			</view>
+		</uni-popup>
+
 	</view>
 </template>
 <script>
@@ -644,7 +668,7 @@ import { getDetail,debtPay,hasPay, freeShipping,confirmFinish,cancel,modifyRemar
 import { getOrderProduct,giveItem,printItemWlLabel } from "@/api/order-item";
 import productMins from "@/mixins/product";
 import { ORDER_STATUS } from "@/utils/declare";
-import { cloudPrintOrder, cancelOrder,cancelBookOrderInfo,confirmReachFn,changeSendStaffFn } from "@/api/order";
+import { cloudPrintOrder, cancelOrder,cancelBookOrderInfo,confirmReachFn,changeSendStaffFn,getOrderPrintLog } from "@/api/order";
 import { hasHitNavigate } from "@/api/map";
 import { getWeixinId } from "@/api/invite";
 import { refundMoney } from "@/api/refund";
@@ -715,6 +739,7 @@ export default {
 			treePrintNum: '',
 			treeBoxNum: '',
 			treePrintItem: null,
+			printLogData: { printSn: '', list: [] },
 			// 配送状态映射
 			sendStatusMap: {
 				'-4': { text: '未叫跑腿', color: '#999' },
@@ -1396,6 +1421,29 @@ export default {
 				doPrint()
 			}
 		},
+		/** 查看订单云打印记录 */
+		openPrintLog() {
+			const orderId = this.detailInfo.id || this.option.id
+			if (!orderId) {
+				return
+			}
+			uni.showLoading({ title: '加载中...' })
+			getOrderPrintLog({ id: orderId }).then((res) => {
+				uni.hideLoading()
+				if (res.code == 1) {
+					this.printLogData = {
+						printSn: res.data.printSn || '',
+						list: res.data.list || []
+					}
+					this.$refs.printLogPopup.open('center')
+				}
+			}).catch(() => {
+				uni.hideLoading()
+			})
+		},
+		closePrintLog() {
+			this.$refs.printLogPopup.close()
+		},
 		allotFn(){
 			this.$util.pageTo({url:'/pagesOrder/allot?id='+this.option.id})
 		},
@@ -2469,4 +2517,82 @@ export default {
 		opacity: 1;
 	}
 }
+
+.print-log-popup-body {
+	padding: 40upx 30upx 30upx;
+	width: 88vw;
+	max-height: 70vh;
+	box-sizing: border-box;
+}
+
+.print-log-sn-box {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: center;
+	border: 2upx solid #333;
+	border-radius: 12upx;
+	padding: 24upx 20upx;
+	margin-bottom: 30upx;
+}
+
+.print-log-sn-label {
+	font-size: 30upx;
+	color: #333;
+	flex-shrink: 0;
+}
+
+.print-log-sn-value {
+	font-size: 34upx;
+	color: #333;
+	font-weight: bold;
+	margin-left: 16upx;
+}
+
+.print-log-head {
+	color: #3385ff;
+	font-size: 33upx;
+	margin-bottom: 20upx;
+}
+
+.print-log-list {
+	max-height: 45vh;
+	overflow-y: auto;
+}
+
+.print-log-item {
+	padding: 18upx 0;
+	border-bottom: 1upx solid #eee;
+}
+
+.print-log-time {
+	color: #b8860b;
+	font-size: 34upx;
+	margin-bottom: 8upx;
+}
+
+.print-log-order-id {
+	color: #2e7d32;
+	font-size: 28upx;
+	word-break: break-all;
+}
+
+.print-log-empty {
+	text-align: center;
+	color: #999;
+	font-size: 28upx;
+	padding: 40upx 0;
+}
+
+.print-log-close {
+	margin-top: 24upx;
+	text-align: center;
+
+	.admin-button-com {
+		width: 210upx;
+		height: 80upx;
+		line-height: 80upx;
+		font-size: 29upx;
+	}
+}
 </style>