优化维修单

This commit is contained in:
java110 2020-04-26 20:56:19 +08:00
parent fa1876c3a2
commit b269ddc4b9
2 changed files with 25 additions and 24 deletions

View File

@ -14,9 +14,9 @@ const GetNoticeListUrl = baseUrl + 'app/api.queryNotices'; //报修接口
const listMyEnteredCommunitys = baseUrl + 'app/community.listMyEnteredCommunitys'; //查看员工小区 const listMyEnteredCommunitys = baseUrl + 'app/community.listMyEnteredCommunitys'; //查看员工小区
const listOwnerRepairs = baseUrl + 'app/ownerRepair.listOwnerRepairs'; // const listOwnerRepairs = baseUrl + 'app/ownerRepair.listOwnerRepairs'; //查看报
const saveOwnerRepair = baseUrl + 'app/ownerRepair.saveOwnerRepair'; //查看报 const saveOwnerRepair = baseUrl + 'app/ownerRepair.saveOwnerRepair'; //
const queryStaffInfos = baseUrl + 'app/query.staff.infos'; //查询员工信息 const queryStaffInfos = baseUrl + 'app/query.staff.infos'; //查询员工信息
@ -57,6 +57,8 @@ const listCommunitys = baseUrl + "app/community.listCommunitys"; //查询小区
const listActivitiess = baseUrl + "app/activities.listActivitiess"; //查询小区广告 const listActivitiess = baseUrl + "app/activities.listActivitiess"; //查询小区广告
const listAdvertPhoto = baseUrl + "app/advert.listAdvertPhoto"; const listAdvertPhoto = baseUrl + "app/advert.listAdvertPhoto";
module.exports = { module.exports = {
baseUrl: baseUrl, baseUrl: baseUrl,
hcBaseUrl: hcBaseUrl, hcBaseUrl: hcBaseUrl,

View File

@ -18,14 +18,14 @@
<view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'"> <view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'">
</view> </view>
<view class="content"> <view class="content">
<view class="text-grey">{{item.complaintId}}</view> <view class="text-grey">{{item.repairId}}</view>
<view class="text-gray text-sm flex"> <view class="text-gray text-sm flex">
<view class="text-cut"> <view class="text-cut">
{{item.complaintName}} {{item.repairName}}
</view> </view> </view> </view>
</view> </view>
<view class="action"> <view class="action">
<view class="text-grey text-xs">{{item.createTime}}</view> <view class="text-grey text-xs">{{item.appointmentTime}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -68,9 +68,9 @@
<form> <form>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">报修类型</view> <view class="title">报修类型</view>
<picker @change="_changeResult" :value="typeCdIndex" :range="typeCds"> <picker @change="repairChange" :value="typeCdIndex" :range="typeCds">
<view class="picker"> <view class="picker">
{{typeCdIndex>-1?typeCds[typeCdIndex]:'请选择'}} {{typeName?typeName:'请选择'}}
</view> </view>
</picker> </picker>
</view> </view>
@ -157,7 +157,9 @@
roomId: '', roomId: '',
roomNum: '', roomNum: '',
typeCd: '', typeCd: '',
typeCds: ['卧室报修', '管道报修','客厅报修'], typeCds: ['卧室报修', '管道报修', '客厅报修'],
repairIdAttr:['10001','10002','10003'],
typeName:'请选择',
typeCdIndex: -1, typeCdIndex: -1,
context:'', context:'',
repairName:'', repairName:'',
@ -209,7 +211,7 @@
communityId:_that.java110Context.getCurrentCommunity().communityId communityId:_that.java110Context.getCurrentCommunity().communityId
}; };
this.java110Context.request({ this.java110Context.request({
url: _that.java110Constant.url.listComplaints, url: _that.java110Constant.url.listOwnerRepairs,
header: _that.java110Context.getHeaders(), header: _that.java110Context.getHeaders(),
method: "GET", method: "GET",
data: _objData, // data: _objData, //
@ -223,13 +225,13 @@
return; return;
} }
let _data = res.data; let _data = res.data;
_that.myOrders = _data.complaints; _that.myRepairOrders = _data.ownerRepairs;
_data.complaints.forEach(function(item){ _data.ownerRepairs.forEach(function(item){
let dateStr = item.createTime; let dateStr = item.appointmentTime;
console.log(dateStr); console.log(dateStr);
let _date=new Date(dateStr); let _date=new Date(dateStr);
item.createTime = (_date.getMonth()+1) +'-'+_date.getDate(); item.appointmentTime = (_date.getMonth()+1) +'-'+_date.getDate();
}); });
}, },
fail: function(e) { fail: function(e) {
@ -303,13 +305,10 @@
"&floorId=" + this.floorId + "&floorNum=" + this.floorNum + "&unitId=" + this.unitId + "&unitNum=" + this.unitNum "&floorId=" + this.floorId + "&floorNum=" + this.floorNum + "&unitId=" + this.unitId + "&unitNum=" + this.unitNum
}); });
}, },
_changeResult: function(e) {
this.typeCdIndex = e.detail.value;
console.log(e, this.typeCdIndex);
},
repairChange: function(e) { repairChange: function(e) {
this.typeName = this.columns[e.detail.value]; this.typeName = this.typeCds[e.detail.value];
this.typeId = this.repairIdAttr[e.detail.value]; this.typeCd = this.repairIdAttr[e.detail.value];
}, },
dateChange:function(e){ dateChange:function(e){
this.bindDate = e.detail.value; this.bindDate = e.detail.value;
@ -331,7 +330,7 @@
"photos": [], "photos": [],
"context": this.context, "context": this.context,
"userId": _userInfo.userId, "userId": _userInfo.userId,
"communityId": this.communityId, "communityId": _that.java110Context.getCurrentCommunity().communityId,
"bindDate": this.bindDate, "bindDate": this.bindDate,
"bindTime": this.bindTime "bindTime": this.bindTime
} }
@ -357,7 +356,7 @@
} else if (obj.bindTime == "") { } else if (obj.bindTime == "") {
msg = "请选择预约时间"; msg = "请选择预约时间";
} else if (obj.context == "") { } else if (obj.context == "") {
msg = "请填写投诉内容"; msg = "请填写报修内容";
} }
console.log(obj.roomId); console.log(obj.roomId);
@ -368,9 +367,9 @@
duration: 2000 duration: 2000
}); });
} else { } else {
context.request({ this.java110Context.request({
url: constant.url.saveOwnerRepair, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair url: this.java110Constant.url.saveOwnerRepair, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
header: context.getHeaders(), header: this.java110Context.getHeaders(),
method: "POST", method: "POST",
data: obj, // data: obj, //
success: function(res) { success: function(res) {