shish 19 ساعت پیش
والد
کامیت
647cc52ce8
1فایلهای تغییر یافته به همراه23 افزوده شده و 3 حذف شده
  1. 23 3
      ghsApp/src/pagesPurchase/info.vue

+ 23 - 3
ghsApp/src/pagesPurchase/info.vue

@@ -24,12 +24,13 @@
 						<button @click="openSendTimePicker" class="admin-button-com default">修改</button>
 					</view>
 				</view>
-				<view class="order-info_box">
-					<view>开单日期:</view>
+				<!-- 入库时间为空,或与预录 addTime 相差超过 30 分钟才显示 -->
+				<view class="order-info_box" v-if="showDraftTime">
+					<view>预录时间:</view>
 					<view>{{ detailInfo.addTime?detailInfo.addTime.substr(2,14):'' }}</view>
 				</view>
 				<view class="order-info_box">
-					<view>入库日期:</view>
+					<view>入库时间:</view>
 					<view>
 						<text v-if="detailInfo.status==4">{{ detailInfo.entryTime?detailInfo.entryTime.substr(2,14):'' }}</text>
 						<text v-else>待入库</text>
@@ -401,6 +402,25 @@ export default {
 			const next = Number(this.detailInfo.nextDayTkPrice || 0)
 			return parseFloat((tk + next).toFixed(2))
 		},
+		/**
+		 * 预录时间 addTime:入库时间 entryTime 为空,或与 addTime 相差超过 30 分钟时才显示。
+		 */
+		showDraftTime() {
+			const add = this.detailInfo && this.detailInfo.addTime
+			if (!add || String(add).indexOf('0000-00-00') >= 0) {
+				return false
+			}
+			const entry = this.detailInfo.entryTime
+			if (!entry || String(entry).indexOf('0000-00-00') >= 0) {
+				return true
+			}
+			const addMs = new Date(String(add).replace(/-/g, '/')).getTime()
+			const entryMs = new Date(String(entry).replace(/-/g, '/')).getTime()
+			if (isNaN(addMs) || isNaN(entryMs)) {
+				return true
+			}
+			return Math.abs(addMs - entryMs) > 30 * 60 * 1000
+		},
 		/**
 		 * 是否展示「已结清」:非挂账,且已有结账单列表结清 / clearId 痕迹 / 剩余待结为 0
 		 */