|
|
@@ -1,66 +1,212 @@
|
|
|
-// E-service/workOrder/detail.js
|
|
|
-Page({
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
|
|
|
- /**
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
+Page({
|
|
|
data: {
|
|
|
-
|
|
|
+ tabColorS: {
|
|
|
+ 售前: {
|
|
|
+ bgColor: "#E1EAFE",
|
|
|
+ color: "#3874F6"
|
|
|
+ },
|
|
|
+ 售中: {
|
|
|
+ bgColor: "#FEF0E1",
|
|
|
+ color: "#F69E38"
|
|
|
+ },
|
|
|
+ 售后: {
|
|
|
+ bgColor: "#FCE4E4",
|
|
|
+ color: "#ED4949"
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tabsList: [{
|
|
|
+ label: "服务商品",
|
|
|
+ }, {
|
|
|
+ label: "申请信息"
|
|
|
+ }, {
|
|
|
+ label: "工单信息"
|
|
|
+ }],
|
|
|
+ tabsActive: 2
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow() {
|
|
|
-
|
|
|
+ getApp().globalData.Language.getLanguagePackage(this, '工单详情');
|
|
|
+ console.log("options", options)
|
|
|
+ this.setData({
|
|
|
+ sa_workorderid: options.id
|
|
|
+ })
|
|
|
+ this.getDetail()
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {
|
|
|
-
|
|
|
+ getDetail() {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20230208140103,
|
|
|
+ "content": {
|
|
|
+ "sa_workorderid": this.data.sa_workorderid
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ console.log("工单详情", res)
|
|
|
+ if (res.code != '1') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ detail: res.data
|
|
|
+ })
|
|
|
+ this.setPreview(res);
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload() {
|
|
|
-
|
|
|
+ setPreview(res) {
|
|
|
+ /* 基本信息 */
|
|
|
+ let leader = null
|
|
|
+ try {
|
|
|
+ leader = res.data.team.find(v => v.isleader);
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ let list1 = [{
|
|
|
+ label: "工单号",
|
|
|
+ value: res.data.billno
|
|
|
+ }, {
|
|
|
+ label: "申请单号",
|
|
|
+ value: res.data.servicebillno
|
|
|
+ }, {
|
|
|
+ label: "服务类型",
|
|
|
+ value: res.data.servicetype,
|
|
|
+ style: this.data.tabColorS[res.data.servicetype] ? `color:${this.data.tabColorS[res.data.servicetype].color}` : ""
|
|
|
+ }, {
|
|
|
+ label: "工单类型",
|
|
|
+ value: res.data.type,
|
|
|
+ style: this.data.sColors[res.data.type] ? `color:${this.data.sColors[res.data.type].color}` : ''
|
|
|
+ }, {
|
|
|
+ label: "状态",
|
|
|
+ value: getApp().globalData.Language.getMapText(res.data.status),
|
|
|
+ style: `color:${this.data.sColors[res.data.status]}`
|
|
|
+ }, {
|
|
|
+ label: "企业名称",
|
|
|
+ value: res.data.enterprisename
|
|
|
+ }, {
|
|
|
+ label: "企业编号",
|
|
|
+ value: res.data.agentnum
|
|
|
+ }, {
|
|
|
+ label: "关联订单",
|
|
|
+ value: res.data.sonum
|
|
|
+ }, {
|
|
|
+ label: "省市县",
|
|
|
+ value: res.data.province + res.data.city + res.data.county
|
|
|
+ }, {
|
|
|
+ label: "详细地址",
|
|
|
+ value: res.data.address
|
|
|
+ }, {
|
|
|
+ label: "现场联系人",
|
|
|
+ value: res.data.scenecontact
|
|
|
+ }, {
|
|
|
+ label: "身份备注",
|
|
|
+ value: res.data.scenecontactrole
|
|
|
+ }, {
|
|
|
+ label: "现场联系人电话",
|
|
|
+ value: res.data.scenecontactphonenumber
|
|
|
+ }, {
|
|
|
+ label: "应用系统",
|
|
|
+ value: res.data.class1
|
|
|
+ }, {
|
|
|
+ label: "客诉大类",
|
|
|
+ value: res.data.class2
|
|
|
+ }, {
|
|
|
+ label: "问题描述",
|
|
|
+ value: res.data.reason
|
|
|
+ }, {
|
|
|
+ label: "服务负责人",
|
|
|
+ value: leader ? leader.name : ''
|
|
|
+ }, {
|
|
|
+ label: "服务负责人电话",
|
|
|
+ value: leader ? leader.phonenumber : ''
|
|
|
+ }, {
|
|
|
+ label: "业务员",
|
|
|
+ value: res.data.saler_name
|
|
|
+ }, {
|
|
|
+ label: "业务员电话",
|
|
|
+ value: res.data.salerphonenumber
|
|
|
+ }, {
|
|
|
+ label: "异常类型",
|
|
|
+ value: res.data.exception_type
|
|
|
+ }, {
|
|
|
+ label: "服务等级",
|
|
|
+ value: res.data.service_level,
|
|
|
+ style: `color:${this.data.sColors[res.data.service_level]}`
|
|
|
+ }, {
|
|
|
+ label: "项目名称",
|
|
|
+ value: res.data.projectname
|
|
|
+ }, {
|
|
|
+ label: "操作类型",
|
|
|
+ value: res.data.actiontype
|
|
|
+ }, {
|
|
|
+ label: "是否为我司出货产品",
|
|
|
+ value: res.data.isouritem === 1 ? "是" : "否"
|
|
|
+ }, {
|
|
|
+ label: "是否在保质期内",
|
|
|
+ value: res.data.inqualityguaranteeperiod === 1 ? "是" : "否"
|
|
|
+ }, {
|
|
|
+ label: "确认客诉异常描述",
|
|
|
+ value: res.data.reason
|
|
|
+ }, {
|
|
|
+ label: "是否属实",
|
|
|
+ value: res.data.isfact === 1 ? "是" : "否"
|
|
|
+ }, {
|
|
|
+ label: "备注",
|
|
|
+ value: res.data.remarks
|
|
|
+ }];
|
|
|
+ /* 系统信息 */
|
|
|
+ let list2 = [{
|
|
|
+ label: "创建时间",
|
|
|
+ value: res.data.createdate
|
|
|
+ }, {
|
|
|
+ label: "最近编辑人",
|
|
|
+ value: res.data.changeby
|
|
|
+ }, {
|
|
|
+ label: "最近编辑时间",
|
|
|
+ value: res.data.changedate
|
|
|
+ }, {
|
|
|
+ label: "接单时间",
|
|
|
+ value: res.data.takedate
|
|
|
+ }, {
|
|
|
+ label: "开始工单时间",
|
|
|
+ value: res.data.startdate
|
|
|
+ }, {
|
|
|
+ label: "完成时间",
|
|
|
+ value: res.data.finishdate
|
|
|
+ }, {
|
|
|
+ label: "中止时间",
|
|
|
+ value: res.data.abortdate
|
|
|
+ }, {
|
|
|
+ label: "中止原因",
|
|
|
+ value: res.data.abortreason
|
|
|
+ }];
|
|
|
+ this.setData({
|
|
|
+ list1,
|
|
|
+ list2
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {
|
|
|
-
|
|
|
+ //局部数据更新 tabs
|
|
|
+ partialRenewal(init = false) {
|
|
|
+ try {
|
|
|
+ let model = this.data.tabsList[this.data.tabsActive].model;
|
|
|
+ if (model) {
|
|
|
+ let Component = this.selectComponent(model),
|
|
|
+ {
|
|
|
+ total,
|
|
|
+ pageNumber,
|
|
|
+ pageTotal
|
|
|
+ } = Component.data.content,
|
|
|
+ id = this.data.detail.sa_workorderid;
|
|
|
+ if (total == null || init) {
|
|
|
+ Component.getList(id, init);
|
|
|
+ } else if (pageNumber <= pageTotal) {
|
|
|
+ Component.getList(id, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {
|
|
|
-
|
|
|
+ callPhone(e) {
|
|
|
+ wx.makePhoneCall({
|
|
|
+ phoneNumber: e.currentTarget.dataset.number
|
|
|
+ })
|
|
|
}
|
|
|
})
|