Commit 246078e6 by 李伟康

fix(OrderScreen): 修复时间组件初始化问题

- 修改 OrderStatusList 组件的 initList 方法,以适应新的时间参数
- 更新 config.js 中的时间参数键名
- 调整 index.vue 中的时间参数处理逻辑
1 parent 811068d0
...@@ -109,8 +109,11 @@ export default { ...@@ -109,8 +109,11 @@ export default {
}, },
methods: { methods: {
initList () { initList () {
let { data, params: { idKey } } = this let { data, params: { idKey }, list } = this
this.currentId = data[idKey] if (data[idKey]) {
let item = list.find(val => val.value.join(',') == data[idKey].join(','))
this.currentId = item ? item.id : ''
}
this.$emit('onComplete') this.$emit('onComplete')
} }
} }
......
...@@ -26,7 +26,7 @@ const screenList = [ ...@@ -26,7 +26,7 @@ const screenList = [
title: '订单时间', title: '订单时间',
componentName: 'TimeList', componentName: 'TimeList',
params: { params: {
idKey: ['orderStartDate', 'orderEndDate'], idKey: ['placeOrderStartDateStr', 'placeOrderEndDateStr'],
currentIdKey: 'orderTimeId', currentIdKey: 'orderTimeId',
}, },
...@@ -35,7 +35,7 @@ const screenList = [ ...@@ -35,7 +35,7 @@ const screenList = [
title: '支付时间', title: '支付时间',
componentName: 'TimeList', componentName: 'TimeList',
params: { params: {
idKey: ['payStartDate', 'payEndDate'], idKey: ['installUpgradeBeginTimeStr', 'installUpgradeEndTimeStr'],
currentIdKey: 'payTimeId', currentIdKey: 'payTimeId',
}, },
......
...@@ -139,8 +139,8 @@ export default { ...@@ -139,8 +139,8 @@ export default {
delete chooseContent.payTimeId delete chooseContent.payTimeId
delete chooseContent.orderTimeId delete chooseContent.orderTimeId
Object.keys(chooseContent).map(e => { Object.keys(chooseContent).map(e => {
if (e == 'orderStartDate' || e == 'payStartDate') chooseContent[e] = `${chooseContent[e]} 00:00:00` if (e == 'placeOrderStartDateStr' || e == 'installUpgradeBeginTimeStr') chooseContent[e] = `${chooseContent[e]} 00:00:00`
if (e == 'orderEndDate' || e == 'payEndDate') chooseContent[e] = `${chooseContent[e]} 23:59:59` if (e == 'placeOrderEndDateStr' || e == 'installUpgradeEndTimeStr') chooseContent[e] = `${chooseContent[e]} 23:59:59`
}) })
this.$emit('onConfirm', chooseContent) this.$emit('onConfirm', chooseContent)
this.close() this.close()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!