优化代码

This commit is contained in:
wuxw 2024-02-28 14:05:39 +08:00
parent f5099d5ecf
commit ba15a2ea7a
6 changed files with 115 additions and 27 deletions

View File

@ -357,3 +357,27 @@ export function repairStart(_that,_data){
})
});
}
/**
* 回复评价
* @param {Object} _that 上下文对象
* @param {Object} _data 请求报文
*/
export function replyRepairAppraise(_data,_that){
return new Promise(function(reslove,reject){
_that.context.post({
url: url.replyRepairAppraise,
data:_data,
success: function(res) {
reslove(res.data);
},
fail: function(e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
})
});
}

View File

@ -10,6 +10,8 @@ export default {
listMyEnteredCommunitys: baseUrl + 'app/community.listMyEnteredCommunitys', //查看员工小区
listOwnerRepairs: baseUrl + 'app/ownerRepair.listOwnerRepairs', //查看报修
saveOwnerRepair: baseUrl + 'app/ownerRepair.saveOwnerRepair', //维修
replyRepairAppraise: baseUrl + 'app/repair.replyRepairAppraise', //维修
queryStaffInfos: baseUrl + 'app/query.staff.infos', //查询员工信息
changeStaffPwd: baseUrl + 'app/user.changeStaffPwd', //修改密码
listAuditHistoryComplaints: baseUrl + 'app/auditUser.listAuditHistoryComplaints', //查询历史单

View File

@ -875,6 +875,14 @@
"navigationBarTitleText" : "回复评价",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/repairOrder/replyRepairAppraise",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {

View File

@ -73,13 +73,13 @@
<text class="text-grey text-sm">{{repairDetailInfo.context}}</text>
</view>
</view>
<view class="cu-item" v-if="repairDetailInfo.repairPhotos.length > 0">
<view class="cu-item" v-if="repairDetailInfo.repairPhotos&& repairDetailInfo.repairPhotos.length > 0">
<view class="content">
<text class="cuIcon-pic text-green"></text>
<text class="text-grey">业主报修图片</text>
</view>
</view>
<view class="cu-item" v-if="repairDetailInfo.repairPhotos.length > 0">
<view class="cu-item" v-if="repairDetailInfo.repairPhotos&&repairDetailInfo.repairPhotos.length > 0">
<!-- <view class="repair-img-title">业主报修图片</view> -->
<view class="margin-top grid text-center col-4 grid-square" >
<view class="" v-for="(_item,index) in repairDetailInfo.repairPhotos" :key="index">
@ -87,13 +87,13 @@
</view>
</view>
</view>
<view class="cu-item" v-if="repairDetailInfo.beforePhotos.length > 0">
<view class="cu-item" v-if="repairDetailInfo.beforePhotos&&repairDetailInfo.beforePhotos.length > 0">
<view class="content">
<text class="cuIcon-pic text-green"></text>
<text class="text-grey">维修前图片</text>
</view>
</view>
<view class="cu-item" v-if="repairDetailInfo.beforePhotos.length > 0">
<view class="cu-item" v-if="repairDetailInfo.beforePhotos&&repairDetailInfo.beforePhotos.length > 0">
<!-- <view class="repair-img-title">维修前图片</view> -->
<view class="margin-top grid text-center col-4 grid-square" >
<view class="" v-for="(_item,index) in repairDetailInfo.beforePhotos" :key="index">
@ -101,13 +101,13 @@
</view>
</view>
</view>
<view class="cu-item" v-if="repairDetailInfo.afterPhotos.length > 0">
<view class="cu-item" v-if="repairDetailInfo.afterPhotos&&repairDetailInfo.afterPhotos.length > 0">
<view class="content">
<text class="cuIcon-pic text-green"></text>
<text class="text-grey">维修后图片</text>
</view>
</view>
<view class="cu-item" v-if="repairDetailInfo.afterPhotos.length > 0">
<view class="cu-item" v-if="repairDetailInfo.afterPhotos&&repairDetailInfo.afterPhotos.length > 0">
<!-- <view class="repair-img-title">维修后图片</view> -->
<view class="margin-top grid text-center col-4 grid-square" >
<view class="" v-for="(_item,index) in repairDetailInfo.afterPhotos" :key="index">
@ -116,9 +116,6 @@
</view>
</view>
</view>
<view class="cu-timeline margin-top">
<view class="cu-time">工单</view>
@ -126,9 +123,6 @@
<view class="bg-cyan content">
<text>{{item.startTime}} </text> 到达 {{item.staffName}} 工位 - {{item.stateName}}
</view>
<!-- <view class="bg-cyan content" v-if="item.endTime != undefined">
<text>{{item.endTime}} </text> 处理完成
</view> -->
<view class="bg-cyan content" v-if="item.endTime != undefined">
<text>处理意见</text> {{item.context}}
<block v-if="item.state == '12000' && item.payTypeName != undefined">
@ -140,6 +134,12 @@
<text>处理意见</text> {{item.context}}
<block v-if="item.payTypeName != undefined">({{item.payTypeName}})</block>
</view>
<view v-if="item.state == '10007'" class="flex justify-between margin-top-sm">
<view></view>
<view class="rob-order text-df text-white bg-green text-center" @click="_replyRepairAppraise(item)">
回复
</view>
</view>
</view>
</view>
@ -245,10 +245,6 @@
}
let _data = _json.data;
_that.repairDetailInfo = _data[0];
// let dateStr = _that.repairDetailInfo.appointmentTime;
// let _date = new Date(dateStr.replace(/-/g, "/"));
// _that.repairDetailInfo.appointmentTime = (_date.getMonth() + 1) + '-' + _date.getDate();
},
fail: function(e) {
wx.showToast({
@ -268,10 +264,20 @@
closeViewImage: function() {
this.viewImage = false;
},
_replyRepairAppraise:function(_repairUser){
uni.navigateTo({
url: "/pages/repairOrder/replyRepairAppraise?ruId=" + _repairUser.ruId + '&repairId=' + _repairUser.repairId
});
}
}
}
</script>
<style>
.rob-order{
width: 80upx;
height: 60upx;
line-height: 60upx;
border-radius: 10upx;
}
</style>

View File

@ -254,16 +254,6 @@
}
});
},
/**
* 跳转新增页
*/
// _addRecord: function(){
// uni.navigateTo({
// url: '/pages/repairAdd/repairAdd'
// });
// },
/**
* 派单
* @param {Object} _item

View File

@ -0,0 +1,58 @@
<template>
<view>
<view class="cu-form-group margin-top">
<textarea v-model="replyContext" placeholder="请输入回复说明"></textarea>
</view>
<view class="flex flex-direction margin-top">
<button class="cu-btn bg-green margin-tb-sm lg" @click="_reply()">提交</button>
</view>
</view>
</template>
<script>
import {replyRepairAppraise} from '../../api/repair/repair.js'
import {getCommunity,getCurrentCommunity} from '../../api/community/community.js'
export default {
data() {
return {
replyContext: '',
repairId:'',
ruId:''
}
},
onLoad(options) {
this.java110Context.onLoad();
this.ruId = options.ruId;
this.repairId = options.repairId;
},
methods: {
_reply: function() {
replyRepairAppraise({
replyContext:this.replyContext,
communityId:getCurrentCommunity().communityId,
ruId:this.ruId,
repairId:this.repairId
},this)
.then(function(res){
if (res.code != 0) {
uni.showToast({
icon:'none',
title:res.data
});
return;
}
uni.navigateBack({
delta:1
})
})
},
}
}
</script>
<style>
</style>