|
@@ -19,9 +19,15 @@
|
|
<div v-if='order.type - 1 == 1'><span class="title">预产期:</span>{{order.yc_time}}</div>
|
|
<div v-if='order.type - 1 == 1'><span class="title">预产期:</span>{{order.yc_time}}</div>
|
|
<div v-if='order.type -1 == 2'><span class="title">孩子年龄:</span>{{order.age}}岁</div>
|
|
<div v-if='order.type -1 == 2'><span class="title">孩子年龄:</span>{{order.age}}岁</div>
|
|
<div><span class="title">预约状态:</span>{{order.contract_str}}</div>
|
|
<div><span class="title">预约状态:</span>{{order.contract_str}}</div>
|
|
- <div><span class="title">预约日期:</span><span class="appointment-date" @click='appointmentDate'>{{order.status_time}}</span>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <!--选择时间-->
|
|
|
|
+ <datetime v-model="bookingTime" format="YYYY-MM-DD HH:00"
|
|
|
|
+ @on-change="change" :title="('预约日期')" year-row="{value}年" month-row="{value}月" day-row="{value}日"
|
|
|
|
+ hour-row="{value}点" minute-row="{value}分" confirm-text="完成" cancel-text="取消"
|
|
|
|
+ :start-date='startDate'
|
|
|
|
+ placeholder="请选择日期"
|
|
|
|
+ :end-date='endDate' :min-hour=9 :max-hour=18></datetime>
|
|
</div>
|
|
</div>
|
|
- <div><span class="title">预约日期:</span>{{order.status_time}}</div>
|
|
|
|
<div><span class="title">家政员:</span><span v-if="order.tech == ''">暂未分配家政员</span>{{order.tech}}</div>
|
|
<div><span class="title">家政员:</span><span v-if="order.tech == ''">暂未分配家政员</span>{{order.tech}}</div>
|
|
<div><span class="title">备注:</span>{{order.desc}}</div>
|
|
<div><span class="title">备注:</span>{{order.desc}}</div>
|
|
|
|
|
|
@@ -31,17 +37,25 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import _ from '@/config'
|
|
import _ from '@/config'
|
|
|
|
+ import selectTime from '@/config/selectTime'
|
|
|
|
+ import {Group, DatetimeRange, TransferDom, Datetime} from 'vux'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'orderInfo',
|
|
name: 'orderInfo',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
type: {0: '钟点工', 1: '月嫂', 2: '育婴师', 3: '护理老人', 4: '全套家务'},
|
|
type: {0: '钟点工', 1: '月嫂', 2: '育婴师', 3: '护理老人', 4: '全套家务'},
|
|
- order: null,
|
|
|
|
- eAppointmentDate: false
|
|
|
|
|
|
+ order: {},
|
|
|
|
+ eAppointmentDate: false,
|
|
|
|
+ monthArr: {},
|
|
|
|
+ bookingTime: '', // 服务时间
|
|
|
|
+ value: ['2017-06-24', '03', '05'], // 设定日期格式
|
|
|
|
+ startDate: selectTime.startDate, // 限定最小日期
|
|
|
|
+ endDate: '', // 限定最大日期
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ console.log(selectTime.endDate)
|
|
if (_.oldOrderInfo === undefined) {
|
|
if (_.oldOrderInfo === undefined) {
|
|
this.$router.push({path: '/managementList'})
|
|
this.$router.push({path: '/managementList'})
|
|
}
|
|
}
|
|
@@ -58,62 +72,18 @@
|
|
this.eAppointmentDate = true
|
|
this.eAppointmentDate = true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ components: {
|
|
|
|
+ Group,
|
|
|
|
+ DatetimeRange,
|
|
|
|
+ TransferDom,
|
|
|
|
+ Datetime,
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
appointmentDate() {
|
|
appointmentDate() {
|
|
- if (this.eAppointmentDate) {
|
|
|
|
- let that = this;
|
|
|
|
- let currentDate = new Date() // Sat Jun 24 2017 10:09:18 GMT+0800 (中国标准时间)
|
|
|
|
- let currentYear = currentDate.getFullYear() // 当前年 2017
|
|
|
|
- let currentMonth = currentDate.getMonth() + 1 // 当前月 6
|
|
|
|
- let currentDay = currentDate.getDate() // 当前日 24
|
|
|
|
- let now = new Date().getHours() // 当前时 10
|
|
|
|
- let min = new Date().getMinutes() // 当前 分
|
|
|
|
- // 往后 6个月
|
|
|
|
- let monthArr = [];
|
|
|
|
- for (let i = 1; i < 7; i++) {
|
|
|
|
- monthArr.push({
|
|
|
|
- label: m(i),
|
|
|
|
- value: i - 1
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function m(i) {
|
|
|
|
- let d = new Date();
|
|
|
|
- // 因为getMonth()获取的月份的值只能在0~11之间所以我们在进行setMonth()之前先给其减一
|
|
|
|
- d.setMonth((d.getMonth() - 1) + i);
|
|
|
|
- let m = d.getMonth() + 1;
|
|
|
|
- return m
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- console.log(monthArr);
|
|
|
|
-
|
|
|
|
- weui.picker([currentYear], [monthArr], {
|
|
|
|
- onChange: function (result) {
|
|
|
|
- console.log(result);
|
|
|
|
- },
|
|
|
|
- onConfirm: function (result) {
|
|
|
|
- console.log(result);
|
|
|
|
- },
|
|
|
|
- id: 'multiPickerBtn'
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- weui.datePicker({
|
|
|
|
- start: new Date(), // 从今天开始
|
|
|
|
- end: currentYear + 20,
|
|
|
|
- defaultValue: [currentYear, currentMonth, currentDay, now, min],
|
|
|
|
- onChange: function (result) {
|
|
|
|
- // console.log(result);
|
|
|
|
- },
|
|
|
|
- onConfirm: function (result) {
|
|
|
|
- that.time = result[0].label + result[1].label + result[2].label
|
|
|
|
- that.resTime = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
|
|
|
|
- },
|
|
|
|
- id: 'datePicker'
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ change(val) {
|
|
|
|
+ console.log(val)
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
order: function (val, oldVal) {
|
|
order: function (val, oldVal) {
|
|
@@ -126,6 +96,10 @@
|
|
|
|
|
|
</script>
|
|
</script>
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
|
|
+ .weui-cell {
|
|
|
|
+ padding: 0 15px 0 0 !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
title {
|
|
title {
|
|
display: block;
|
|
display: block;
|
|
padding: 15px 0;
|
|
padding: 15px 0;
|
|
@@ -147,10 +121,15 @@
|
|
border-bottom: 0;
|
|
border-bottom: 0;
|
|
}
|
|
}
|
|
& > span:nth-child(1) {
|
|
& > span:nth-child(1) {
|
|
- width: 20%;
|
|
|
|
|
|
+ width: 25%;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+
|
|
|
|
+ p {
|
|
|
|
+ color: #2c3e50!important;
|
|
|
|
+ font-size: 15px!important;
|
|
|
|
+ }
|
|
|
|
+</style>
|