|
@@ -18,19 +18,30 @@
|
|
|
<div><span class="title">服务技能:</span>{{order.skill_str}}</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><span class="title">预约状态:</span>{{order.contract_str}}</div>
|
|
|
- <div>
|
|
|
+ <!--showContract btnContract-->
|
|
|
+ <div v-if="!showContract"><span class="title">签约状态:</span>{{order.contract_str}}</div>
|
|
|
+ <div v-if="showContract"><span class="title">签约状态:</span><span @click='btnContract'>{{contractStr}}</span></div>
|
|
|
+ <!--预约日期-->
|
|
|
+ <div v-if="!showStatus">
|
|
|
<!--选择时间-->
|
|
|
- <datetime v-model="bookingTime" format="YYYY-MM-DD HH:00"
|
|
|
- @on-change="change" :title="('预约日期')" year-row="{value}年" month-row="{value}月" day-row="{value}日"
|
|
|
+ <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><span class="title">家政员:</span><span v-if="order.tech == ''">暂未分配家政员</span>{{order.tech}}</div>
|
|
|
+ <div v-if="showStatus"><span class="title">预约日期:</span>{{order.status_time}}</div>
|
|
|
+ <!--家政员-->
|
|
|
+ <div v-if="!showTech">
|
|
|
+ <span class="title">家政员:</span><span><input v-model="tech" class="tech" type="text"
|
|
|
+ placeholder='请输入家政员'></span>
|
|
|
+ </div>
|
|
|
+ <div v-if='showTech'><span class="title">家政员:</span>{{order.tech}}</div>
|
|
|
<div><span class="title">备注:</span>{{order.desc}}</div>
|
|
|
-
|
|
|
+ </div>
|
|
|
+ <div class="m-btn">
|
|
|
+ <x-button type="primary" @click.native='btnSubmint'>提交</x-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</scroller>
|
|
@@ -38,7 +49,8 @@
|
|
|
<script>
|
|
|
import _ from '@/config'
|
|
|
import selectTime from '@/config/selectTime'
|
|
|
- import {Group, DatetimeRange, TransferDom, Datetime} from 'vux'
|
|
|
+ import axios from 'axios'
|
|
|
+ import {Group, Datetime, XButton} from 'vux'
|
|
|
|
|
|
export default {
|
|
|
name: 'orderInfo',
|
|
@@ -52,37 +64,122 @@
|
|
|
value: ['2017-06-24', '03', '05'], // 设定日期格式
|
|
|
startDate: selectTime.startDate, // 限定最小日期
|
|
|
endDate: '', // 限定最大日期
|
|
|
+ tech: '',
|
|
|
+ showTech: false, // 家政员
|
|
|
+ showContract: false, // 签约状态
|
|
|
+ contractStr: '未签约',
|
|
|
+ contractStrArr: [],
|
|
|
+ showStatus: false // 预约状态
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- console.log(selectTime.endDate)
|
|
|
+
|
|
|
+// console.log(_.oldOrderInfo)
|
|
|
if (_.oldOrderInfo === undefined) {
|
|
|
this.$router.push({path: '/managementList'})
|
|
|
}
|
|
|
this.order = _.oldOrderInfo;
|
|
|
+ console.log(this.order);
|
|
|
// 转化时间格式
|
|
|
- this.order.yc_time = _.timetrans(this.order.yc_time); // 预产期
|
|
|
- this.order.yc_time = this.order.yc_time.substring(0, 10); // 预产期
|
|
|
- this.order.server_start_time = _.timetrans(this.order.server_start_time);
|
|
|
- this.order.server_start_time = this.order.server_start_time.substring(11, 16);
|
|
|
- this.order.server_end_time = _.timetrans(this.order.server_end_time);
|
|
|
- this.order.server_end_time = this.order.server_end_time.substring(11, 16);
|
|
|
- this.order.status_time = _.timetrans(this.order.status_time);
|
|
|
+ /* this.order.yc_time = _.timetrans(this.order.yc_time); // 预产期
|
|
|
+ this.order.yc_time = this.order.yc_time.substring(0, 10); // 预产期
|
|
|
+ this.order.server_start_time = _.timetrans(this.order.server_start_time);
|
|
|
+ this.order.server_start_time = this.order.server_start_time.substring(11, 16);
|
|
|
+ this.order.server_end_time = _.timetrans(this.order.server_end_time);
|
|
|
+ this.order.server_end_time = this.order.server_end_time.substring(11, 16);
|
|
|
+ this.order.status_time = _.timetrans(this.order.status_time);*/
|
|
|
if (this.order.status - 1 == 0) {
|
|
|
this.eAppointmentDate = true
|
|
|
}
|
|
|
+ if (this.order.tech.length > 0) {
|
|
|
+ this.showTech = true;
|
|
|
+ }
|
|
|
+ if (this.order.status !== 1) {
|
|
|
+ this.showStatus = true;
|
|
|
+ }
|
|
|
+ if (this.order.contract == 1 && this.order.status == 2) {
|
|
|
+ this.showContract = true;
|
|
|
+ }
|
|
|
+ // showContract
|
|
|
+ console.log()
|
|
|
},
|
|
|
components: {
|
|
|
Group,
|
|
|
- DatetimeRange,
|
|
|
- TransferDom,
|
|
|
Datetime,
|
|
|
+ XButton
|
|
|
},
|
|
|
methods: {
|
|
|
- appointmentDate() {
|
|
|
+ btnContract() {
|
|
|
+ let that = this;
|
|
|
+ weui.picker([
|
|
|
+ {
|
|
|
+ label: '未签约',
|
|
|
+ value: 0,
|
|
|
+ disabled: true // 不可用
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '已签约',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ ], {
|
|
|
+ className: 'custom-classname',
|
|
|
+ container: 'body',
|
|
|
+ defaultValue: [0],
|
|
|
+ onChange: function (result) {
|
|
|
+// console.log(result)
|
|
|
+ },
|
|
|
+ onConfirm: function (result) {
|
|
|
+// console.log(result)
|
|
|
+ that.contractStr = result[0].label;
|
|
|
+ that.contractStrArr = result[0];
|
|
|
+ },
|
|
|
+ id: 'singleLinePicker'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ btnSubmint() {
|
|
|
+ let that = this;
|
|
|
+ if (that.bookingTime.length == 0 && !that.showStatus) {
|
|
|
+ weui.alert('请选择预约日期');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (that.tech.length == 0 && !that.showTech) {
|
|
|
+ weui.alert('请输入家政人员');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.order.contract == 1 && this.order.status == 2) {
|
|
|
+ if (this.contractStr !== '已签约') {
|
|
|
+ weui.alert('请签约状态');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let stitching = `&id=${_.oldOrderInfo.id}&contract=2&status=3`;
|
|
|
+ axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ weui.alert('提交成功', function () {
|
|
|
+ that.$router.push({path: '/managementList'})
|
|
|
+ });
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ weui.alert('提交失败');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let stitching = `&id=${_.oldOrderInfo.id}&status=2&status_time=${ycTime(this.bookingTime)}&tech=${this.tech}`;
|
|
|
+ axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ weui.alert('提交成功', function () {
|
|
|
+ that.$router.push({path: '/managementList'})
|
|
|
+ });
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ weui.alert('提交失败');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
change(val) {
|
|
|
- console.log(val)
|
|
|
+ this.bookingTime = val;
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
@@ -94,6 +191,13 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 日期转时间戳 2014-07-10
|
|
|
+ function ycTime(t) {
|
|
|
+ let stringTime = t + ':00';
|
|
|
+ let timestamp = Date.parse(new Date(stringTime));
|
|
|
+ timestamp = timestamp / 1000;
|
|
|
+ return timestamp;
|
|
|
+ }
|
|
|
</script>
|
|
|
<style scoped lang="less">
|
|
|
.weui-cell {
|
|
@@ -125,11 +229,25 @@
|
|
|
display: inline-block;
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
+ & > span:nth-child(2) {
|
|
|
+ width: 70%;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .tech, .tech:focus {
|
|
|
+ border: 0;
|
|
|
+ outline: none
|
|
|
+ }
|
|
|
+
|
|
|
+ .m-btn {
|
|
|
+ width: 80%;
|
|
|
+ margin: 10% auto 0;
|
|
|
+ }
|
|
|
+
|
|
|
p {
|
|
|
- color: #2c3e50!important;
|
|
|
- font-size: 15px!important;
|
|
|
+ color: #2c3e50 !important;
|
|
|
+ font-size: 15px !important;
|
|
|
}
|
|
|
</style>
|