uu
This commit is contained in:
parent
af1c5cc3c2
commit
5ceb922ffb
@ -59,8 +59,25 @@
|
|||||||
import { setClipboardData } from "@/common/untool"
|
import { setClipboardData } from "@/common/untool"
|
||||||
import { numberToChinese } from "@/common/util"
|
import { numberToChinese } from "@/common/util"
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
|
let dayFormat = 'YYYY-MM-DD'
|
||||||
|
let dateTimeFormat = 'YYYY-MM-DD HH:mm:ss'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
watch:{
|
||||||
|
show: {
|
||||||
|
handler: function(cval, oval) {
|
||||||
|
cval && this.initData()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
modelInfo: {
|
||||||
|
get(){
|
||||||
|
return this.value
|
||||||
|
}
|
||||||
|
},
|
||||||
timeFilterList() {
|
timeFilterList() {
|
||||||
const _this = this
|
const _this = this
|
||||||
let list = []
|
let list = []
|
||||||
@ -77,9 +94,9 @@
|
|||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
default () {
|
default () {
|
||||||
return ''
|
return { }
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -106,15 +123,20 @@
|
|||||||
methods: {
|
methods: {
|
||||||
initData() {
|
initData() {
|
||||||
this.makeList()
|
this.makeList()
|
||||||
|
let { pickStartDate, pickFinishDate } = this.modelInfo || {}
|
||||||
// 默认值
|
// 默认值
|
||||||
this.model.date = this.dayList[0].val
|
this.model.date = this.dayList[0].val
|
||||||
|
if(pickStartDate && pickFinishDate) {
|
||||||
|
this.model.date = dayjs(pickStartDate).format(dayFormat)
|
||||||
|
this.model.time = `${pickStartDate}~${pickFinishDate}`
|
||||||
|
}
|
||||||
},
|
},
|
||||||
makeList() {
|
makeList() {
|
||||||
const _this = this
|
const _this = this
|
||||||
const now = dayjs(new Date())
|
const now = dayjs(new Date())
|
||||||
const nowDate = dayjs(now).format('YYYY-MM-DD')
|
const nowDate = dayjs(now).format(dayFormat)
|
||||||
const plus1Date = dayjs(nowDate).add(1, 'day').format('YYYY-MM-DD')
|
const plus1Date = dayjs(nowDate).add(1, 'day').format(dayFormat)
|
||||||
const plus2Date = dayjs(nowDate).add(2, 'day').format('YYYY-MM-DD')
|
const plus2Date = dayjs(nowDate).add(2, 'day').format(dayFormat)
|
||||||
const nowHour = now.get("hours")
|
const nowHour = now.get("hours")
|
||||||
let dayList = [
|
let dayList = [
|
||||||
{ title: '今天', val: nowDate },
|
{ title: '今天', val: nowDate },
|
||||||
@ -129,17 +151,16 @@
|
|||||||
start = nowHour + 1
|
start = nowHour + 1
|
||||||
}
|
}
|
||||||
for(var tIndex = start; tIndex <= end; tIndex ++) {
|
for(var tIndex = start; tIndex <= end; tIndex ++) {
|
||||||
let cTlt = '', cVal
|
let tItem = {}
|
||||||
let timeStr = `${tIndex < 10?'0':''}${tIndex}:00`
|
tItem.startTime = dayjs(`${dItem.val} ${tIndex}`).format(dateTimeFormat)
|
||||||
let timeNextStr = `${(tIndex + 1) < 10?'0':''}${(tIndex + 1)}:00`
|
tItem.endTime = dayjs(`${dItem.val} ${tIndex + 1}`).format(dateTimeFormat)
|
||||||
cVal = timeStr
|
|
||||||
cTlt = `${timeStr}-${timeNextStr}`
|
tItem.val = `${tItem.startTime}~${tItem.endTime}`
|
||||||
|
tItem.title = `${dayjs(tItem.startTime).format("HH:mm")}-${dayjs(tItem.endTime).format("HH:mm")}`
|
||||||
if(dIndex == 0 && tIndex == start) {
|
if(dIndex == 0 && tIndex == start) {
|
||||||
cTlt = `${numberToChinese(start - nowHour)}小时内`
|
tItem.title = `${numberToChinese(start - nowHour)}小时内`
|
||||||
}
|
}
|
||||||
timeList.push({
|
timeList.push(tItem)
|
||||||
title: cTlt , val: cVal
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
dItem.timeList = timeList
|
dItem.timeList = timeList
|
||||||
})
|
})
|
||||||
@ -152,8 +173,21 @@
|
|||||||
handleEditItem() {
|
handleEditItem() {
|
||||||
const { date, time } = this.model
|
const { date, time } = this.model
|
||||||
const value = `${date} ${time}`
|
const value = `${date} ${time}`
|
||||||
this.$emit('onChange', this.model)
|
let curItem
|
||||||
this.$emit('update:value', value)
|
this.dayList.map(d=> {
|
||||||
|
if(d.val == date) {
|
||||||
|
d.timeList.map(t=> {
|
||||||
|
if(t.val == time) {
|
||||||
|
curItem = t
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$emit('onChange', curItem)
|
||||||
|
if(curItem){
|
||||||
|
this.modelInfo.pickStartDate = curItem.startTime
|
||||||
|
this.modelInfo.pickFinishDate = curItem.endTime
|
||||||
|
}
|
||||||
this.handleCloseModal()
|
this.handleCloseModal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,8 +45,8 @@ export const getOrderModels = () => {
|
|||||||
packType: 2, // 包装类型
|
packType: 2, // 包装类型
|
||||||
dispatchMethod: undefined, // 派送方式
|
dispatchMethod: undefined, // 派送方式
|
||||||
pickupMethod: undefined, // 取件方式
|
pickupMethod: undefined, // 取件方式
|
||||||
pickStartDate: undefined,
|
pickStartDate: undefined, // 上门取货-开始时间
|
||||||
pickFinishDate: undefined,
|
pickFinishDate: undefined,// 上门取货-结束时间
|
||||||
intoWarehouseCode: undefined, // 入仓仓库code
|
intoWarehouseCode: undefined, // 入仓仓库code
|
||||||
intoWarehouseName: undefined, // 仓库名称
|
intoWarehouseName: undefined, // 仓库名称
|
||||||
intoWarehouseAddress: undefined, // 仓库地址
|
intoWarehouseAddress: undefined, // 仓库地址
|
||||||
|
|||||||
@ -59,7 +59,10 @@
|
|||||||
<view v-else>预计入仓时间</view>
|
<view v-else>预计入仓时间</view>
|
||||||
</view>
|
</view>
|
||||||
<u-row custom-style="flex: 1;" justify="end" align="center">
|
<u-row custom-style="flex: 1;" justify="end" align="center">
|
||||||
{{ '' || '请选择'}}
|
<view v-if="submitParam.pickStartDate && submitParam.pickFinishDate">
|
||||||
|
{{submitParam.pickStartDate}}
|
||||||
|
</view>
|
||||||
|
<view v-else>请选择</view>
|
||||||
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
|
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
|
||||||
</u-row>
|
</u-row>
|
||||||
</u-row>
|
</u-row>
|
||||||
@ -153,7 +156,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</tpx-layout>
|
</tpx-layout>
|
||||||
|
|
||||||
<buns-revtime-sheet v-model:show="revtimeModal.show" v-model:value="submitParam.revtime"></buns-revtime-sheet>
|
<buns-revtime-sheet v-model:show="revtimeModal.show" v-model:value="submitParam"></buns-revtime-sheet>
|
||||||
|
|
||||||
<buns-edit-sheet percentHeight="70" title="货物信息" v-model:show="goodChooseModal.show" v-model:value="submitParam" v-slot="tempObject" @onSure="handleGoodInfoSure">
|
<buns-edit-sheet percentHeight="70" title="货物信息" v-model:show="goodChooseModal.show" v-model:value="submitParam" v-slot="tempObject" @onSure="handleGoodInfoSure">
|
||||||
<view class="">
|
<view class="">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user