优化工单回访、优化工单评价

master
chen 2022-08-17 17:41:52 +08:00
parent 2e8aaea60f
commit 0c28fdc693
8 changed files with 113 additions and 78 deletions

16
App.vue
View File

@ -31,21 +31,7 @@
}, },
methods:{ methods:{
// uniapp
openSettings() {
uni.getSystemInfo({
success(res) {
if(res.platform == 'ios'){
plus.runtime.openURL("app-settings://");
} else if (res.platform == 'android'){
var main = plus.android.runtimeMainActivity();
var Intent = plus.android.importClass("android.content.Intent");
var mIntent = new Intent('android.settings.SOUND_SETTINGS');
main.startActivity(mIntent);
}
}
});
},
} }
}; };
</script> </script>

View File

@ -62,13 +62,13 @@
return { return {
windowHeight: uni.getSystemInfoSync().windowHeight, windowHeight: uni.getSystemInfoSync().windowHeight,
ifPhone:false, ifPhone:false,
login_phone:'',// login_phone:'17366921088',//
ifCode:false, ifCode:false,
login_code:'',// login_code:'',//
ifunitName:false, ifunitName:false,
login_unitName:'',// login_unitName:'1',//
ifPassword:false, ifPassword:false,
login_password:'',// login_password:'123456',//
codeText:'获取验证码' ,// codeText:'获取验证码' ,//
flagCode:true ,// flagCode:true ,//
countDown:null, countDown:null,

View File

@ -248,7 +248,7 @@
'/pagesB/personal-information/personal-information', '/pagesB/personal-information/personal-information',
'/pagesB/electronic-certificate/electronic-certificate', '/pagesB/electronic-certificate/electronic-certificate',
'/pagesB/service-range/service-range', '/pagesB/service-range/service-range',
'/pagesA/workOrder/workOrderLlsit?is_evaluate=1', '/pagesA/workOrder/workOrderLlsit?status=待评价&statusId=9',
'/pagesB/my-account/my-account?index=0', '/pagesB/my-account/my-account?index=0',
'/pagesB/set-up/set-up', '/pagesB/set-up/set-up',
]; ];

View File

@ -426,11 +426,30 @@
// uni.showToast({ // uni.showToast({
// title:'' // title:''
// }) // })
this.bofang(msg); // this.bofang(msg);
this.openSettings();
} }
}); });
} }
}, },
// uniapp
openSettings() {
// #ifdef APP-PLUS
uni.getSystemInfo({
success(res) {
if(res.platform == 'ios'){
plus.runtime.openURL("app-settings://");
} else if (res.platform == 'android'){
var main = plus.android.runtimeMainActivity();
var Intent = plus.android.importClass("android.content.Intent");
var mIntent = new Intent('android.settings.SOUND_SETTINGS');
main.startActivity(mIntent);
}
}
});
// #endif
},
//
bofang(msg){ bofang(msg){
this.bgmMusic.autoplay = true;// this.bgmMusic.autoplay = true;//
// this.bgmMusic.loop = true;// // this.bgmMusic.loop = true;//

View File

@ -294,12 +294,12 @@
if (op.orderId != undefined) { if (op.orderId != undefined) {
this.orderId = op.orderId; this.orderId = op.orderId;
// //
this.getDetail(1); this.getDetail(1,op.statusText,op.statusColor);
} }
}, },
methods: { methods: {
// //
getDetail(type) { getDetail(type,text,color) {
let params = { let params = {
order_id: this.orderId, order_id: this.orderId,
type:type type:type
@ -307,8 +307,8 @@
this.$requst.get('/universal/api.order/order_info', params).then(res => { this.$requst.get('/universal/api.order/order_info', params).then(res => {
console.log(res.data,'工单详情') console.log(res.data,'工单详情')
if (res.code) { if (res.code) {
this.statusText = res.data.btn.attributes.text; this.statusText = res.data.btn?res.data.btn.attributes.text:text;
this.statusColor = res.data.btn.attributes.color; this.statusColor = res.data.btn?res.data.btn.attributes.color:color;
switch (type) { switch (type) {
case 1: case 1:
this.detailObj = res.data; this.detailObj = res.data;
@ -371,7 +371,7 @@
// //
detailSwitch(index) { detailSwitch(index) {
let type = [1, 2, 3, 4][index]; let type = [1, 2, 3, 4][index];
this.getDetail(type); this.getDetail(type,this.statusText,this.statusColor);
}, },
// //
goEvaluate() { goEvaluate() {

View File

@ -13,13 +13,13 @@
<text></text> <text></text>
<text></text> <text></text>
</view> </view>
<input class="input" v-model="name" placeholder="请填写联系人称呼" type="text" placeholder-class="placeClass" /> <input class="input" disabled v-model="name" placeholder="请填写联系人称呼" type="text" placeholder-class="placeClass" />
</view> </view>
<view class="payReturnVisit-input"> <view class="payReturnVisit-input">
<view class="title"> <view class="title">
联系电话 联系电话
</view> </view>
<input class="input" maxlength="11" v-model="phone" placeholder="请输入手机号码" type="number" placeholder-class="placeClass" /> <input class="input" disabled maxlength="11" v-model="phone" placeholder="请输入手机号码" type="number" placeholder-class="placeClass" />
</view> </view>
<view class="payReturnVisit-input"> <view class="payReturnVisit-input">
<view class="title"> <view class="title">
@ -27,7 +27,7 @@
<text></text> <text></text>
<text></text> <text></text>
</view> </view>
<input class="input" v-model="wxcode" placeholder="请输入微信号码" type="text" placeholder-class="placeClass" /> <input class="input" disabled v-model="wxcode" placeholder="请输入微信号码" type="text" placeholder-class="placeClass" />
</view> </view>
<view class="payReturnVisit-textarea"> <view class="payReturnVisit-textarea">
@ -77,14 +77,36 @@
custmerphone:'400-765-9876',// custmerphone:'400-765-9876',//
custmertime:'',//访 custmertime:'',//访
workId:'',//id workId:'',//id
flag:true flag:true,
visitTypeList:[]
} }
}, },
onLoad(op) { onLoad(op) {
if(op.id) {this.workId = op.id} this.getVisitType();
if(op.order_id) {this.workId = op.order_id}
this.getVisitInfo(this.workId);
this.custmertime = this.$toolAll.tools.returnCurrentTime('/',1); this.custmertime = this.$toolAll.tools.returnCurrentTime('/',1);
}, },
methods: { methods: {
// 访
getVisitType(){
this.$requst.get('/universal/api.order/visit_type').then(res=>{
if(res.code) {
this.visitTypeList = res.data;
}
})
},
// 访
getVisitInfo(id){
this.$requst.get('/universal/api.order/visit',{order_id:id}).then(res=>{
if(res.code) {
this.name = res.data.order_contact;
this.phone = res.data.order_contact_phone;
this.wxcode = res.data.order_contact_wechat;
this.custmerphone = res.data.consumer_hotline;
}
})
},
// 访 // 访
setVisit() { setVisit() {
if(this.checkEmpty() && this.flag) { if(this.checkEmpty() && this.flag) {
@ -94,32 +116,30 @@
mask:true mask:true
}) })
let parmas = { let parmas = {
id:this.workId, order_id:this.workId,
a:this.name, return_visit:this.content,
b:this.phone, type_id:this.visitTypeList[0].type_id
c:this.wxcode,
d:this.custmerphone,
e:this.custmertime,
f:this.content
} }
this.$request.post('',parmas).then(res=>{ this.$requst.post('/universal/api.order/visit',parmas).then(res=>{
if(res.code) { if(res.code) {
// , this.$toolAll.tools.showToast('回访成功');
this.$toolAll.tools.automaticBack(); setTimeout(()=>{
// ,
this.$toolAll.tools.automaticBack();
},1000)
} else {
this.$toolAll.tools.showToast(res.msg);
} }
uni.hideLoading();
this.flag = true;
}) })
setTimeout(()=>{
this.flag = true;
},2000)
} }
}, },
// //
checkEmpty() { checkEmpty() {
let result = false; let result = false;
if(!this.name) { if(!this.content) {
this.$toolAll.tools.showToast('请填写联系人称呼');
} else if(this.$toolAll.tools.isPhone(this.phone)) {
this.$toolAll.tools.showToast('请正确填写手机号码');
} else if(!this.content) {
this.$toolAll.tools.showToast('请输入回访内容'); this.$toolAll.tools.showToast('请输入回访内容');
} else { } else {
result = true; result = true;

View File

@ -32,14 +32,15 @@
</view> </view>
<view class="project-list"> <view class="project-list">
<!-- 列表循环体 --> <!-- 列表循环体 -->
<view class="li animated fadeIn" @click="projectDetailsFun(item.order_status,item.order_id,item.btn.attributes.text,item.btn.attributes.color)" v-for="(item,index) in dataList" :key="index"> <view class="li animated fadeIn" @click="projectDetailsFun(item.order_status,item.order_id,item.btn?item.btn.attributes.text:item.order_status_view,item.btn?item.btn.attributes.color:'#DDDDDD')" v-for="(item,index) in dataList" :key="index">
<view class="work-order-code">工单编号{{item.order_number}}</view> <view class="work-order-code">工单编号{{item.order_number}}</view>
<view class="message"> <view class="message">
<image class="img" :src="item.cover_picture" mode="aspectFill" lazy-load></image> <image class="img" :src="item.cover_picture" mode="aspectFill" lazy-load></image>
<view class="text disjb fc" style="height: 180rpx;"> <view class="text disjb fc" style="height: 180rpx;">
<view class="title flexs"> <view class="title flexs">
<view class="text clips1">{{item.project_name}}</view> <view class="text clips1">{{item.project_name}}</view>
<view class="icon" :style="{backgroundColor: item.btn.attributes.color || '#DDDDDD'}">{{item.btn.attributes.text}}</view> <view v-if="item.btn" class="icon" :style="{backgroundColor: item.btn.attributes.color || '#DDDDDD'}">{{item.btn.attributes.text}}</view>
<view v-else class="icon" style="background-color: #DDDDDD;color: #333333;">{{item.order_status_view}}</view>
</view> </view>
<view class="disjb fc line-h36" style="margin-left: -20rpx;"> <view class="disjb fc line-h36" style="margin-left: -20rpx;">
<view class="serial-number scal09"> <view class="serial-number scal09">
@ -61,7 +62,7 @@
</view> </view>
<!-- 订单不等于已完成和待回访并且访问人不是工程师 --> <!-- 订单不等于已完成和待回访并且访问人不是工程师 -->
<view class="" v-if="role==1 || role==2"> <view class="" v-if="role==1 || role==2">
<view @tap.stop="hurryUpEv(item.order_id)" class="date" v-if="item.order_status!=5 && item.order_status!=6 && item.order_status!=7 && item.order_status!=8"> <view @tap.stop="hurryUpEv(item.order_id)" class="date" v-if="item.order_status!=5 && item.order_status!=6 && item.order_status!=7 && item.order_status!=8 && item.order_status!=9">
催一催 <image class="img" src="../../static/iocn/ld.png" mode="" lazy-load></image> 催一催 <image class="img" src="../../static/iocn/ld.png" mode="" lazy-load></image>
</view> </view>
</view> </view>
@ -211,30 +212,32 @@
}, },
// //
projectDetailsFun(status,id,statusText,statusColor) { projectDetailsFun(status,id,statusText,statusColor) {
if (uni.getStorageSync('type_id')==4 && status == 2) { if (uni.getStorageSync('type_id')==4) {
// //
uni.showModal({ if(status == 2) {
cancelText:'取消', //
cancelColor:'#999999', uni.showModal({
confirmColor:'#03affb', cancelText:'取消',
confirmText:'确认', cancelColor:'#999999',
content:'确认接单', confirmColor:'#03affb',
success: (res) => { confirmText:'确认',
if(res.confirm){ content:'确认接单',
this.$requst.post('/universal/api.order/accept_order',{order_id:id,is_order:1}).then(res=>{ success: (res) => {
if(res.code){ if(res.confirm){
this.$toolAll.tools.showToast('接单成功'); this.$requst.post('/universal/api.order/accept_order',{order_id:id,is_order:1}).then(res=>{
setTimeout(()=>{ if(res.code){
uni.navigateTo({ this.$toolAll.tools.showToast('接单成功');
url: `/pagesA/workOrder/workOrder?id=${id}` setTimeout(()=>{
}) uni.navigateTo({
},1000) url: `/pagesA/workOrder/workOrder?id=${id}`
} })
}) },1000)
}
})
}
} }
} })
}) }
}else if(uni.getStorageSync('type_id')==4) {
if(status==3){ if(status==3){
// //
uni.navigateTo({ uni.navigateTo({
@ -248,8 +251,9 @@
}) })
} }
} else if(uni.getStorageSync('type_id')==5){ } else if(uni.getStorageSync('type_id')==5){
//
if(status==6){ if(status==6){
// //
uni.navigateTo({ uni.navigateTo({
url: `/pagesA/workOrder/workOrderAudit?orderId=${id}&status=${status}&statusText=${statusText}&statusColor=${statusColor}` url: `/pagesA/workOrder/workOrderAudit?orderId=${id}&status=${status}&statusText=${statusText}&statusColor=${statusColor}`
}) })
@ -260,18 +264,26 @@
}) })
} }
} else if(uni.getStorageSync('type_id')==3){ } else if(uni.getStorageSync('type_id')==3){
//
if(status==1){ if(status==1){
// //
uni.navigateTo({ uni.navigateTo({
url: `/pagesA/peopleManagement/peopleManagement?orderId=${id}` url: `/pagesA/peopleManagement/peopleManagement?orderId=${id}`
}) })
} }
if(status==8){ if(status==8){
// // 访
uni.navigateTo({ uni.navigateTo({
url: `/pagesA/workOrder/payReturnVisit?order_id=${id}` url: `/pagesA/workOrder/payReturnVisit?order_id=${id}`
}) })
} }
} else if(uni.getStorageSync('type_id')==1 || uni.getStorageSync('type_id')==2){
//
if(status == 9){
uni.navigateTo({
url: `/pagesB/i-want-evaluate/i-want-evaluate?orderId=${id}`
})
}
} else { } else {
// //
uni.navigateTo({ uni.navigateTo({

View File

@ -140,8 +140,6 @@
this.agreementArr.push(obj) this.agreementArr.push(obj)
} }
} }
console.log(this.agreementArr,77777);
// uni.navigateBack({delta:1})
} }
}) })
}, },