Commit 02c7a921 authored by Morson's avatar Morson

保存服物现状接口对接

parent 3cf2ef5f
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
v-for="(item, index) in options[curTab]" v-for="(item, index) in options[curTab]"
:key="index" :key="index"
@click="changeOwn(index)" @click="changeOwn(index)"
:class="{'txt-item':true,'active': (curOwn == index)}"> :class="{'txt-item':true,'active': (trace.reasonRelegation == index)}">
<text class="txt">{{index}}</text> <text class="txt">{{index}}</text>
</view> </view>
</view> </view>
...@@ -50,19 +50,19 @@ ...@@ -50,19 +50,19 @@
<view class="title">{{feedback.type.title}}</view> <view class="title">{{feedback.type.title}}</view>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<view <view
v-for="(txt, index) in options[curTab][curOwn]" v-for="(txt, index) in options[curTab][trace.reasonRelegation]"
:key="index" :key="index"
@click="changeType(txt)" @click="changeType(txt)"
:class="{'txt-item':true,'active': (curType == txt)}"> :class="{'txt-item':true,'active': (trace.reason == txt)}">
<text class="txt">{{txt}}</text> <text class="txt">{{txt}}</text>
</view> </view>
</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> </view>
<appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<view class="u-m-60"> <view class="u-m-60">
<button class="btn">确定</button> <button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmitBtn">确定</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -75,15 +75,12 @@ ...@@ -75,15 +75,12 @@
orderId: null, orderId: null,
categoryId: null, categoryId: null,
showRemark: false, showRemark: false,
submiting: false,
background: { background: {
backgroundColor: 'none', backgroundColor: 'none',
}, },
tabList: [], tabList: [{name: '报单'}, {name: '改约'}],
curTab: 0, curTab: 0,
curOwn: "",
curType: "",
remark: "",
appointTime: "",
feedback: { feedback: {
own:{ own:{
title:'问题归属', title:'问题归属',
...@@ -96,7 +93,16 @@ ...@@ -96,7 +93,16 @@
} }
}, },
config: null, config: null,
options: [] options: [],
trace: {
reasonType: '', // 反馈类型
reasonRelegation: '', // 反馈归属
reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '', // 备注
},
}; };
}, },
components:{ components:{
...@@ -108,16 +114,33 @@ ...@@ -108,16 +114,33 @@
} }
}, },
computed: { 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.orderId = 1
this.categoryId = 88 this.categoryId = 88
if(e) { if(e) {
this.orderId = e.orderId || null this.orderId = e.orderId || null
this.categoryId = e.categoryId || null this.categoryId = e.categoryId || null
} }
this.initPageData() uni.showLoading({
title: "数据加载中",
mask: true
})
await this.initPageData()
}, },
methods: { methods: {
async initPageData() { async initPageData() {
...@@ -129,6 +152,7 @@ ...@@ -129,6 +152,7 @@
self.initParams() self.initParams()
self.buildConfig() self.buildConfig()
} }
uni.hideLoading()
}, },
buildConfig() { buildConfig() {
let self = this let self = this
...@@ -146,15 +170,17 @@ ...@@ -146,15 +170,17 @@
if(self.config) { if(self.config) {
let tabs = Object.keys(self.config) let tabs = Object.keys(self.config)
let list = Object.values(self.config) let list = Object.values(self.config)
let ownVal = Object.keys(list[self.curTab])[0] let relegation = Object.keys(list[self.curTab])[0]
let types = Object.values(list[self.curTab][ownVal]) let types = Object.values(list[self.curTab][relegation])
self.curOwn = ownVal self.trace.reasonType = tabs[self.curTab]
self.curType = types[0] self.trace.reasonRelegation = relegation
if(self.curTab) { self.trace.reason = types[0]
if(self.trace.reasonType == '改约') {
self.showRemark = true self.showRemark = true
} else { } else {
self.showRemark = false self.showRemark = false
self.remark = "" self.trace.remark = ''
} }
} }
}, },
...@@ -166,20 +192,19 @@ ...@@ -166,20 +192,19 @@
this.initParams() this.initParams()
}, },
changeOwn(key) { changeOwn(key) {
this.curOwn = key; let self = this
self.trace.reasonRelegation = key
self.trace.reason = self.options[self.curTab][key][0]
}, },
changeType(key) { changeType(key) {
this.curType = key; this.trace.reason = key
}, },
/** /**
* 拒单 * 拒单
*/ */
rejectOrder() { // rejectOrder() {
console.log("点击拒单") // console.log("点击拒单")
}, // },
sectionChange(index) {
this.curNow = index;
},
weekChange(data){ weekChange(data){
// 点击下一周 // 点击下一周
console.log(data,'week-data') console.log(data,'week-data')
...@@ -192,6 +217,21 @@ ...@@ -192,6 +217,21 @@
// 时间段选择变化 // 时间段选择变化
console.log(data,'week-data') 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> </script>
...@@ -285,6 +325,19 @@ ...@@ -285,6 +325,19 @@
height:0; 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-320{
width:320rpx; 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