|
@@ -15,13 +15,14 @@
|
|
|
<view class="item-main" >
|
|
<view class="item-main" >
|
|
|
<view class="item-info">
|
|
<view class="item-info">
|
|
|
<view class="info-row">
|
|
<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>
|
|
|
- <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>
|
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
|
<text class="info-label"> 单号:</text>
|
|
<text class="info-label"> 单号:</text>
|
|
@@ -46,8 +47,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item-price">¥{{ info.realPrice?parseFloat(info.realPrice):0 }} <text class="iconfont iconxiangyou"></text>
|
|
<view class="item-price">¥{{ info.realPrice?parseFloat(info.realPrice):0 }} <text class="iconfont iconxiangyou"></text>
|
|
|
</view>
|
|
</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>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -65,18 +65,37 @@ export default {
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
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
|
|
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) {
|
|
if (!entry || entry.indexOf('0000-00-00') >= 0) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!send || send.indexOf('0000-00-00') >= 0) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
- return send.substr(0, 19) !== entry.substr(0, 19)
|
|
|
|
|
|
|
+ return entry.substr(0, 19) !== send.substr(0, 19)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|