shish 13 hours ago
parent
commit
0db893f22a

+ 9 - 9
ghsApp/src/pagesGys/detailsItem.vue

@@ -15,7 +15,7 @@
 				</text>
 			</view>
 			<view class="item-row">
-				<view class="mark">{{ info.entryTime?info.entryTime.substr(2,14):'' }}
+				<view class="mark">{{ info.sendTime && info.sendTime.indexOf('0000-00-00') < 0 ? info.sendTime.substr(2,14) : '' }}
 				<text v-if="info.yfPayWay ==2" style="margin-left:16upx;color:#333333;">到付</text></view>
 			</view>
 			<view v-if="!$util.isEmpty(info.remark)" class="item-row">
@@ -25,8 +25,8 @@
 				<view class="price" style="color:#3385FF;">
 					<text :class="[hasPartialClear ? 'price-del' : '']">¥{{ parseFloat(displayDebtPrice) }}</text>
 				</view>
-				<!-- 发货时间与记账时间(entryTime)不完全相同时才贴右侧 -->
-				<view v-if="showSendTime" class="send-date">发货时间 {{ info.sendTime.substr(2, 14) }}</view>
+				<!-- 记账时间与发货时间不完全相同时才贴右侧 -->
+				<view v-if="showEntryTime" class="send-date">记账时间 {{ info.entryTime.substr(2, 14) }}</view>
 			</view>
 			<!-- 售后退款单独成行,不与挂账价格挤在同一行 -->
 			<view class="item-row" v-if="Number(info.tkPrice)>0">
@@ -85,18 +85,18 @@ export default {
 			return this.displayDebtPrice > this.remainDebtPrice
 		},
 		/**
-		 * 金额行右侧发货时间:sendTime 有效,且与记账时间 entryTime(含时分秒)不完全相同才展示。
+		 * 金额行右侧记账时间:entryTime 有效,且与主展示的发货时间 sendTime(含时分秒)不完全相同才展示。
 		 */
-		showSendTime() {
-			const send = this.info.sendTime
+		showEntryTime() {
 			const bill = this.info.entryTime
-			if (!send || send.indexOf('0000-00-00') >= 0) {
+			const send = this.info.sendTime
+			if (!bill || bill.indexOf('0000-00-00') >= 0) {
 				return false
 			}
-			if (!bill || bill.indexOf('0000-00-00') >= 0) {
+			if (!send || send.indexOf('0000-00-00') >= 0) {
 				return true
 			}
-			return send.substr(0, 19) !== bill.substr(0, 19)
+			return bill.substr(0, 19) !== send.substr(0, 19)
 		}
 	},
 	methods: {

+ 1 - 1
ghsApp/src/pagesPurchase/order.vue

@@ -32,7 +32,7 @@
 							ref="billDateSelect"
 							class="date-select"
 							top="0"
-							defaultShowName="入库时间"
+							defaultShowName="记账时间"
 							@selectDateFn="selectBillDateFn"
 							@overlay-change="onBillDateOverlayChange"
 						/>

+ 33 - 14
ghsApp/src/pagesPurchase/orderItem.vue

@@ -15,13 +15,14 @@
 		<view class="item-main" >
 			<view class="item-info">
 				<view class="info-row">
-					<text class="info-label"> 开单:</text>
-					<text class="info-value">{{ info.addTime.substr(2,14) }} </text>
+					<text class="info-label"> 发货:</text>
+					<text class="info-value" v-if="!info.sendTime || info.sendTime.indexOf('0000-00-00') >= 0"></text>
+					<text class="info-value" v-else>{{ info.sendTime.substr(2,14) }} </text>
 				</view>
-				<view class="info-row">
-					<text class="info-label"> 入库:</text>
-					<text class="info-value" v-if="info.entryTime == '0000-00-00 00:00:00'"></text>
-					<text class="info-value" v-else>{{ info.entryTime.substr(2,14) }} </text>
+				<!-- 记账时间为空,或与草稿 addTime 相差超过 30 分钟才显示 -->
+				<view class="info-row" v-if="showDraftTime">
+					<text class="info-label"> 预录:</text>
+					<text class="info-value">{{ info.addTime.substr(2,14) }} </text>
 				</view>
 				<view class="info-row">
 					<text class="info-label"> 单号:</text>
@@ -46,8 +47,7 @@
 			</view>
 			<view class="item-price">¥{{ info.realPrice?parseFloat(info.realPrice):0 }} <text class="iconfont iconxiangyou"></text>
 			</view>
-			<!-- 发货时间贴卡片右缘;与入库时间(含时分秒)完全相同时不展示 -->
-			<text v-if="showSendTime" class="extra-date">发货时间 {{ info.sendTime.substr(2, 14) }}</text>
+			<text v-if="showEntryTime" class="extra-date">记账时间 {{ info.entryTime.substr(2, 14) }}</text>
 		</view>
 	</view>
 </template>
@@ -65,18 +65,37 @@ export default {
 	},
 	computed: {
 		/**
-		 * 右侧发货时间:sendTime 有效,且与入库时间(含时分秒)不完全相同才展示。
+		 * 草稿 addTime:记账时间 entryTime 为空,或与 addTime 相差超过 30 分钟时才显示。
 		 */
-		showSendTime() {
-			const send = this.info.sendTime
-			const entry = this.info.entryTime
-			if (!send || send.indexOf('0000-00-00') >= 0) {
+		showDraftTime() {
+			const add = this.info.addTime
+			if (!add || String(add).indexOf('0000-00-00') >= 0) {
 				return false
 			}
+			const entry = this.info.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
+		},
+		/**
+		 * 右侧记账时间:entryTime 有效,且与主展示的发货时间(含时分秒)不完全相同才展示。
+		 */
+		showEntryTime() {
+			const entry = this.info.entryTime
+			const send = this.info.sendTime
 			if (!entry || entry.indexOf('0000-00-00') >= 0) {
+				return false
+			}
+			if (!send || send.indexOf('0000-00-00') >= 0) {
 				return true
 			}
-			return send.substr(0, 19) !== entry.substr(0, 19)
+			return entry.substr(0, 19) !== send.substr(0, 19)
 		}
 	},
 	methods: {