فهرست منبع

Merge branch 'redesign‌-260706' of http://git.huaml.com/zhh/front-end into redesign‌-260706

ouyang 1 هفته پیش
والد
کامیت
55d5e5a8a6

+ 213 - 2
ghsApp/src/admin/home/components/OrderItem.vue

@@ -160,6 +160,8 @@
 
     <uni-popup ref="morePopup" background-color="#fff" type="center" :animation="true" class="class-popup-style">
       <view class="more-popup-body">
+        <view class="text-center"><button class="admin-button-com" @click="openPrintLog(item)">打印时间</button></view>
+        <view class="text-center"><button class="admin-button-com" @click="openRemarkEdit(item)">备注</button></view>
         <block v-if="item.sendStatus == -4 && item.status == 2">
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">呼叫跑腿</button></view>
         </block>
@@ -178,6 +180,44 @@
       </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>
+
+    <!-- 修改订单备注 -->
+    <uni-popup ref="remarkPopup" background-color="#fff" type="center" :animation="true" class="class-popup-style">
+      <view class="remark-popup-body">
+        <view class="remark-popup-title">备注</view>
+        <textarea
+          class="remark-popup-input"
+          v-model="modifyRemarkText"
+          maxlength="200"
+          placeholder="请填写备注"
+          :show-confirm-bar="false"
+        />
+        <view class="remark-popup-actions">
+          <button class="admin-button-com default remark-popup-btn" @click="closeRemarkPopup">取消</button>
+          <button class="admin-button-com bule remark-popup-btn" @click="confirmRemarkModify">确定</button>
+        </view>
+      </view>
+    </uni-popup>
+
     <!-- 新增物流下单弹窗 -->
     <uni-popup ref="expressAddressRef" background-color="#fff" type="center" :animation="true" class="class-popup-style" :mask-click="false">
       <view class="express-popup-body">
@@ -278,7 +318,7 @@ import { getUserDet } from '@/api/member';
 import { createExpressOrder, cancelExpressOrder as cancelSFExpressOrder } from '@/api/express';
 import { cancelDeliveryOrder } from '@/api/express/delivery';
 import { createCallExpressOrder, cancelCallExpressOrder,getOrderFee } from '@/api/shop/shop-express';
-import { printWlLabel, cloudPrintOrder } from '@/api/order';
+import { printWlLabel, cloudPrintOrder, getOrderPrintLog, modifyRemarkFn } from '@/api/order';
 import { iconSrc } from '@/utils/iconSrc';
 export default {
   name: 'OrderItem',
@@ -313,7 +353,11 @@ export default {
       receiverFloor: '',
       receiverName: '',
       receiverMobile: '',
-      callExpressData: {sendCost:0,packageNum:1,weight:0}
+      callExpressData: {sendCost:0,packageNum:1,weight:0},
+      printLogData: { printSn: '', list: [] },
+      /** 当前正在编辑备注的订单 */
+      remarkEditItem: null,
+      modifyRemarkText: ''
     };
   },
   mounted() {
@@ -396,6 +440,57 @@ export default {
     closeMore() {
       this.$refs.morePopup.close();
     },
+    openPrintLog(item) {
+      this.closeMore();
+      uni.showLoading({ title: '加载中...' });
+      getOrderPrintLog({ id: item.id }).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();
+    },
+    /** 打开备注编辑弹窗 */
+    openRemarkEdit(item) {
+      this.closeMore();
+      this.remarkEditItem = item;
+      this.modifyRemarkText = item.remark || '';
+      this.$refs.remarkPopup.open('center');
+    },
+    closeRemarkPopup() {
+      this.$refs.remarkPopup.close();
+      this.remarkEditItem = null;
+      this.modifyRemarkText = '';
+    },
+    /** 保存订单备注并同步列表展示 */
+    confirmRemarkModify() {
+      const item = this.remarkEditItem;
+      if (!item || !item.id) {
+        return;
+      }
+      const remark = (this.modifyRemarkText || '').trim();
+      uni.showLoading({ title: '保存中...', mask: true });
+      modifyRemarkFn({ id: item.id, remark }).then((res) => {
+        uni.hideLoading();
+        if (res.code == 1) {
+          this.$set(item, 'remark', remark);
+          this.updateFiled({ id: item.id, key: 'remark', value: remark });
+          this.closeRemarkPopup();
+          this.$msg('操作成功');
+        }
+      }).catch(() => {
+        uni.hideLoading();
+      });
+    },
     callIntraCity(item) {
       this.closeMore();
       // this.callExpressData = {
@@ -743,6 +838,122 @@ export default {
   }
 }
 
+.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;
+  .admin-button-com {
+    width: 210upx;
+    height: 80upx;
+    line-height: 80upx;
+    font-size: 29upx;
+  }
+}
+
+.remark-popup-body {
+  width: 88vw;
+  padding: 40upx 30upx 30upx;
+  box-sizing: border-box;
+}
+
+.remark-popup-title {
+  text-align: center;
+  font-size: 34upx;
+  color: #333333;
+  font-weight: bold;
+  margin-bottom: 30upx;
+}
+
+.remark-popup-input {
+  width: 100%;
+  height: 280upx;
+  padding: 20upx;
+  font-size: 28upx;
+  color: #333333;
+  border: 2upx solid #e0e0e0;
+  border-radius: 8upx;
+  box-sizing: border-box;
+}
+
+.remark-popup-actions {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: 30upx;
+}
+
+.remark-popup-btn {
+  width: 45%;
+  height: 80upx;
+  line-height: 80upx;
+  margin: 0;
+}
+
 .express-popup-body,
 .call-express-popup-body {
   padding: 40upx 50upx;

+ 3 - 0
ghsApp/src/api/order/index.js

@@ -256,6 +256,9 @@ export const addPrintNum = data => https.get("/order/add-print-num", data);
 //云打印 shish 20210714
 export const cloudPrintOrder = data => https.get("/order/cloud-print-order", data);
 
+//飞鹅云打印日志
+export const getOrderPrintLog = data => https.get("/order/print-log", data);
+
 //确认完成订单 shish 20210810
 export const confirmFinish = data => https.get("/order/confirm-finish", data);
 

+ 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>

+ 32 - 4
ghsApp/src/pagesPurchase/details.vue

@@ -180,6 +180,10 @@
 							<view v-if="myShopInfo.cgModel == 0">{{perKgFreight}}</view>
 							<input v-else style="border: 1upx solid #eee;color: #3385FF;width: calc(100%);height:70upx;"  type="digit" :disabled="!canIEdit"  @focus="form.avgKgWeight=''" v-model="form.avgKgWeight" placeholder-class="phcolor" class="tui-input" name="avgKgWeight" placeholder="请输入每公斤的运费成本"/>
 						</tui-list-cell>
+						<tui-list-cell class="line-cell" :hover="false">
+							<view class="tui-title ">总成本</view>
+							<view>{{ totalCost }}</view>
+						</tui-list-cell>
 					</block>
 
 					<tui-list-cell class="line-cell" :hover="false">
@@ -194,10 +198,7 @@
 		</view>
 		<view class="under-bar">
 			<view class="price-view">
-				<text class="price-title">金额</text>
-				<text class="price-number">
-					¥ <text class="large">{{ modifyPrice }}</text>
-				</text>
+				<text class="price-title">应付 <text style="font-size: 30upx;color:red;font-weight:bold;margin-left:10upx;margin-right:20upx;">¥{{ modifyPrice?parseFloat(modifyPrice) : 0 }}</text> 总成本 <text style="font-size: 30upx;font-weight:bold;margin-left:10upx;color:green;">¥{{ totalCost?parseFloat(totalCost) : 0 }}</text></text>
 			</view>
 			<button v-if="location == 0" class="admin-button-com blue big" @click="formSubmit(0)">下一步</button>
 			<button v-else class="admin-button-com blue big" @click="formSubmit(1)">确认提交</button>
@@ -417,6 +418,32 @@ export default {
 			let calcWeight = realityWeight.toFixed(2);
 			return calcWeight
 		},
+		/**
+		 * 总成本:寄付 = 应付金额 + 提货费 + 本地运费;到付 = 应付金额 + 短途 + 长途 + 提货 + 本地
+		 */
+		totalCost() {
+			let cost = Number(this.modifyPrice) || 0;
+			const pickCharge = Number(this.form.pickCharge);
+			const localCharge = Number(this.form.localCharge);
+			if (pickCharge > 0) {
+				cost += pickCharge;
+			}
+			if (localCharge > 0) {
+				cost += localCharge;
+			}
+			// 到付时短途、长途未计入应付金额,需补入总成本
+			if (Number(this.form.yfPayWay) === 2) {
+				const shortCharge = Number(this.form.shortCharge);
+				const longCharge = Number(this.form.longCharge);
+				if (shortCharge > 0) {
+					cost += shortCharge;
+				}
+				if (longCharge > 0) {
+					cost += longCharge;
+				}
+			}
+			return parseFloat(cost.toFixed(2));
+		},
 		canIEdit() {
 			const { orderSn } = this.option || {};
 			if (!orderSn || this.detailsInfo.status == PURCHASE_ORDER_STATUS.CONFIRM) {
@@ -873,6 +900,7 @@ export default {
 			font-size: 24upx;
 			.price-title {
 				color: #333;
+				font-size: 30upx;
 			}
 			.price-number {
 				margin: 0 10upx;