Commit 02c7a921 authored by Morson's avatar Morson

保存服物现状接口对接

parent 3cf2ef5f
......@@ -42,7 +42,7 @@
v-for="(item, index) in options[curTab]"
:key="index"
@click="changeOwn(index)"
:class="{'txt-item':true,'active': (curOwn == index)}">
:class="{'txt-item':true,'active': (trace.reasonRelegation == index)}">
<text class="txt">{{index}}</text>
</view>
</view>
......@@ -50,19 +50,19 @@
<view class="title">{{feedback.type.title}}</view>
<view class="u-flex u-flex-wrap">
<view
v-for="(txt, index) in options[curTab][curOwn]"
v-for="(txt, index) in options[curTab][trace.reasonRelegation]"
:key="index"
@click="changeType(txt)"
:class="{'txt-item':true,'active': (curType == txt)}">
:class="{'txt-item':true,'active': (trace.reason == txt)}">
<text class="txt">{{txt}}</text>
</view>
</view>
<u-input v-show="showRemark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input>
<u-input v-show="showRemark" v-model="trace.remark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input>
</view>
<appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view>
<view class="u-m-60">
<button class="btn">确定</button>
<button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmitBtn">确定</button>
</view>
</view>
</template>
......@@ -75,15 +75,12 @@
orderId: null,
categoryId: null,
showRemark: false,
submiting: false,
background: {
backgroundColor: 'none',
},
tabList: [],
tabList: [{name: '报单'}, {name: '改约'}],
curTab: 0,
curOwn: "",
curType: "",
remark: "",
appointTime: "",
feedback: {
own:{
title:'问题归属',
......@@ -96,7 +93,16 @@
}
},
config: null,
options: []
options: [],
trace: {
reasonType: '', // 反馈类型
reasonRelegation: '', // 反馈归属
reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '', // 备注
},
};
},
components:{
......@@ -108,16 +114,33 @@
}
},
computed: {
disabledSubmitBtn() {
debugger
let self = this
if(self.trace.reasonType == '预约'
&& (self.trace.appointmentDatetime == null || self.trace.appointmentDatetimeRange == ''
|| self.trace.nextTraceDatetime == '')) {
return true
} else if(self.trace.reasonType != '预约'
&& (!self.trace.reasonType || !self.trace.reasonRelegation || !self.trace.reason)) {
return true
}
return false
},
},
onLoad(e) {
async onLoad(e) {
this.orderId = 1
this.categoryId = 88
if(e) {
this.orderId = e.orderId || null
this.categoryId = e.categoryId || null
}
this.initPageData()
uni.showLoading({
title: "数据加载中",
mask: true
})
await this.initPageData()
},
methods: {
async initPageData() {
......@@ -129,6 +152,7 @@
self.initParams()
self.buildConfig()
}
uni.hideLoading()
},
buildConfig() {
let self = this
......@@ -146,15 +170,17 @@
if(self.config) {
let tabs = Object.keys(self.config)
let list = Object.values(self.config)
let ownVal = Object.keys(list[self.curTab])[0]
let types = Object.values(list[self.curTab][ownVal])
self.curOwn = ownVal
self.curType = types[0]
if(self.curTab) {
let relegation = Object.keys(list[self.curTab])[0]
let types = Object.values(list[self.curTab][relegation])
self.trace.reasonType = tabs[self.curTab]
self.trace.reasonRelegation = relegation
self.trace.reason = types[0]
if(self.trace.reasonType == '改约') {
self.showRemark = true
} else {
self.showRemark = false
self.remark = ""
self.trace.remark = ''
}
}
},
......@@ -166,20 +192,19 @@
this.initParams()
},
changeOwn(key) {
this.curOwn = key;
let self = this
self.trace.reasonRelegation = key
self.trace.reason = self.options[self.curTab][key][0]
},
changeType(key) {
this.curType = key;
this.trace.reason = key
},
/**
* 拒单
*/
rejectOrder() {
console.log("点击拒单")
},
sectionChange(index) {
this.curNow = index;
},
// rejectOrder() {
// console.log("点击拒单")
// },
weekChange(data){
// 点击下一周
console.log(data,'week-data')
......@@ -192,6 +217,21 @@
// 时间段选择变化
console.log(data,'week-data')
},
async submitFrom() {
let self = this
self.orderId = 666
if(!self.orderId) {
uni.showToast({
icon:error,
title:"工单ID不能为空"
})
return false
}
self.submiting = true
let res = await self.$u.api.traceAndAppointment(self.trace, self.orderId)
self.submiting = false
},
}
}
</script>
......@@ -285,6 +325,19 @@
height:0;
}
}
.btn{
padding:30rpx;
border-radius: 52rpx;
line-height: 44rpx;
font-size:32rpx;
text-align: center;
background-color: #2272FF;
color:#fff;
&::after{
content:'';
height:0;
}
}
.width-320{
width:320rpx;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment