|
|
@@ -21,6 +21,7 @@ Page({
|
|
|
"id": "20230206091603",
|
|
|
"version": 1,
|
|
|
"content": {
|
|
|
+ nocache: true,
|
|
|
"sa_serviceorderid": this.data.id
|
|
|
}
|
|
|
})
|
|
|
@@ -147,8 +148,13 @@ Page({
|
|
|
"sa_serviceorderid": that.data.id,
|
|
|
"issumbit": 1,
|
|
|
}
|
|
|
+ });
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg == '成功' ? '工单提交成功' : res.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
})
|
|
|
- that.mainData()
|
|
|
+ if (res.msg == '成功') that.mainData();
|
|
|
})
|
|
|
.catch((err) => console.log(err))
|
|
|
.finally(() => Dialog.close());
|
|
|
@@ -171,38 +177,48 @@ Page({
|
|
|
"sa_serviceorderids": [that.data.id],
|
|
|
}
|
|
|
})
|
|
|
- wx.navigateBack()
|
|
|
-
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg == '成功' ? '工单删除成功' : res.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ if (res.msg == '成功') setTimeout(() => {
|
|
|
+ wx.navigateBack()
|
|
|
+ }, 500);
|
|
|
})
|
|
|
.catch((err) => console.log(err))
|
|
|
.finally(() => Dialog.close());
|
|
|
break;
|
|
|
case "转工单":
|
|
|
this.setData({
|
|
|
- showToWoker: !this.data.showToWoker
|
|
|
+ showToWoker: true
|
|
|
})
|
|
|
break;
|
|
|
case "退回":
|
|
|
this.setData({
|
|
|
- showWithInput: !this.data.showWithInput
|
|
|
+ showWithInput: true
|
|
|
})
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- /* 取消按钮 */
|
|
|
+ /* 专工单/退回 取消 */
|
|
|
showBackReason() {
|
|
|
this.setData({
|
|
|
showWithInput: false,
|
|
|
- showToWoker: false
|
|
|
+ showToWoker: false,
|
|
|
+ backreason: ""
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
inputReason(data) {
|
|
|
- console.log(data)
|
|
|
- this.data.backreason = data.detail.value
|
|
|
+ this.data.backreason = data.detail.value;
|
|
|
},
|
|
|
async onBack() {
|
|
|
let that = this
|
|
|
- if (!that.data.backreason) return;
|
|
|
+ if (!that.data.backreason) return wx.showToast({
|
|
|
+ title: '请说明退回原因!',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
const res = await api._post({
|
|
|
"id": "20230206101403",
|
|
|
"version": 1,
|
|
|
@@ -212,8 +228,15 @@ Page({
|
|
|
"backreason": that.data.backreason
|
|
|
}
|
|
|
})
|
|
|
- that.mainData()
|
|
|
- that.showBackReason()
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg == '成功' ? '已退回工单' : res.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ if (res.msg == '成功') {
|
|
|
+ that.mainData()
|
|
|
+ that.showBackReason()
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
async workOrderTemp() {
|
|
|
@@ -252,7 +275,6 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
async toWorker() {
|
|
|
- console.log(this.data.actTemp)
|
|
|
if (!this.data.actTemp && !this.data.actLeader) {
|
|
|
wx.showToast({
|
|
|
title: '未选择工单模板或负责人',
|
|
|
@@ -268,8 +290,16 @@ Page({
|
|
|
"projectlearders": [this.data.actLeader.userid]
|
|
|
}
|
|
|
})
|
|
|
- this.mainData()
|
|
|
- this.showBackReason()
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg == '成功' ? '操作成功' : res.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.msg == '成功') {
|
|
|
+ this.mainData();
|
|
|
+ this.linkWorkOrder();
|
|
|
+ this.showBackReason()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|
|
|
@@ -278,6 +308,7 @@ Page({
|
|
|
"id": "20230207154203",
|
|
|
"version": 1,
|
|
|
"content": {
|
|
|
+ nocache: true,
|
|
|
"sa_serviceorderid": this.data.id
|
|
|
}
|
|
|
})
|
|
|
@@ -306,62 +337,13 @@ Page({
|
|
|
progress: res.data
|
|
|
})
|
|
|
},
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
onLoad(options) {
|
|
|
this.setData({
|
|
|
id: options.id
|
|
|
})
|
|
|
- this.linkWorkOrder()
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
onShow() {
|
|
|
- this.mainData()
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {
|
|
|
-
|
|
|
+ this.mainData();
|
|
|
+ this.linkWorkOrder();
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {
|
|
|
-
|
|
|
- }
|
|
|
})
|