|
@@ -18,8 +18,11 @@
|
|
<div><span class="title">服务技能:</span>{{order.skill_str}}</div>
|
|
<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 == 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>
|
|
|
|
|
|
+ <!--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"
|
|
<datetime v-model="bookingTime" format="YYYY-MM-DD HH:00"
|
|
@on-change="change" :title="('预约日期:')" year-row="{value}年" month-row="{value}月" day-row="{value}日"
|
|
@on-change="change" :title="('预约日期:')" year-row="{value}年" month-row="{value}月" day-row="{value}日"
|
|
@@ -28,10 +31,13 @@
|
|
placeholder="请选择日期"
|
|
placeholder="请选择日期"
|
|
:end-date='endDate' :min-hour=9 :max-hour=18></datetime>
|
|
:end-date='endDate' :min-hour=9 :max-hour=18></datetime>
|
|
</div>
|
|
</div>
|
|
- <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"
|
|
<span class="title">家政员:</span><span><input v-model="tech" class="tech" type="text"
|
|
placeholder='请输入家政员'></span>
|
|
placeholder='请输入家政员'></span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if='showTech'><span class="title">家政员:</span>{{order.tech}}</div>
|
|
<div><span class="title">备注:</span>{{order.desc}}</div>
|
|
<div><span class="title">备注:</span>{{order.desc}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="m-btn">
|
|
<div class="m-btn">
|
|
@@ -58,26 +64,44 @@
|
|
value: ['2017-06-24', '03', '05'], // 设定日期格式
|
|
value: ['2017-06-24', '03', '05'], // 设定日期格式
|
|
startDate: selectTime.startDate, // 限定最小日期
|
|
startDate: selectTime.startDate, // 限定最小日期
|
|
endDate: '', // 限定最大日期
|
|
endDate: '', // 限定最大日期
|
|
- tech: ''
|
|
|
|
|
|
+ tech: '',
|
|
|
|
+ showTech: false, // 家政员
|
|
|
|
+ showContract: false, // 签约状态
|
|
|
|
+ contractStr: '未签约',
|
|
|
|
+ contractStrArr: [],
|
|
|
|
+ showStatus: false // 预约状态
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- console.log(selectTime.endDate)
|
|
|
|
|
|
+
|
|
|
|
+// console.log(_.oldOrderInfo)
|
|
if (_.oldOrderInfo === undefined) {
|
|
if (_.oldOrderInfo === undefined) {
|
|
this.$router.push({path: '/managementList'})
|
|
this.$router.push({path: '/managementList'})
|
|
}
|
|
}
|
|
this.order = _.oldOrderInfo;
|
|
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) {
|
|
if (this.order.status - 1 == 0) {
|
|
this.eAppointmentDate = true
|
|
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: {
|
|
components: {
|
|
Group,
|
|
Group,
|
|
@@ -85,29 +109,74 @@
|
|
XButton
|
|
XButton
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ 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() {
|
|
btnSubmint() {
|
|
let that = this;
|
|
let that = this;
|
|
- if (that.bookingTime.length == 0) {
|
|
|
|
|
|
+ if (that.bookingTime.length == 0 && !that.showStatus) {
|
|
weui.alert('请选择预约日期');
|
|
weui.alert('请选择预约日期');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if (that.tech.length == 0) {
|
|
|
|
|
|
+ if (that.tech.length == 0 && !that.showTech) {
|
|
weui.alert('请输入家政人员');
|
|
weui.alert('请输入家政人员');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- // 字符串拼接
|
|
|
|
- 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('提交失败');
|
|
|
|
|
|
+ if (this.order.contract == 1 && this.order.status == 2) {
|
|
|
|
+ if (this.contractStr !== '已签约') {
|
|
|
|
+ weui.alert('请签约状态');
|
|
return
|
|
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) {
|
|
change(val) {
|
|
this.bookingTime = val;
|
|
this.bookingTime = val;
|
|
@@ -160,6 +229,10 @@
|
|
display: inline-block;
|
|
display: inline-block;
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
}
|
|
}
|
|
|
|
+ & > span:nth-child(2) {
|
|
|
|
+ width: 70%;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|