|
@@ -6,123 +6,151 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- dateVisible:false,
|
|
|
- timerid:null,
|
|
|
- bindSignNameData:{
|
|
|
+ dateVisible: false,
|
|
|
+ timerid: null,
|
|
|
+ bindSignNameData: {
|
|
|
"ownertable": "sa_workorder_confirmation",
|
|
|
"ownerid": 0,
|
|
|
"usetype": "signature",
|
|
|
},
|
|
|
- paidServiceAmount:0
|
|
|
+ paidServiceAmount: 0
|
|
|
},
|
|
|
|
|
|
- async billData () {
|
|
|
+ async billData() {
|
|
|
const res = await api._post({
|
|
|
"id": "20230211105803",
|
|
|
"content": {
|
|
|
- "sa_workorder_confirmationid":this.data.id
|
|
|
+ "sa_workorder_confirmationid": this.data.id
|
|
|
}
|
|
|
})
|
|
|
|
|
|
let ishave = false
|
|
|
|
|
|
- res.data.confirmationcontent.forEach(item=>{
|
|
|
- if(item.nextTreatmentTime){
|
|
|
+ res.data.confirmationcontent.forEach(item => {
|
|
|
+ if (item.nextTreatmentTime) {
|
|
|
ishave = true
|
|
|
}
|
|
|
})
|
|
|
if (!ishave) {
|
|
|
- let arr = [{nextTreatmentTime:{confirm_value:''}},{treatment:{confirm_value:''}},{explain:{confirm_value:''}},{repairResult:{confirm_value:''}},{rebackTime:{confirm_value:''}},{nextRebackTime:{confirm_value:''}},{text:{confirm_value:''}}]
|
|
|
- arr.forEach(e=>{
|
|
|
+ let arr = [{
|
|
|
+ nextTreatmentTime: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ treatment: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ explain: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ repairResult: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ rebackTime: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ nextRebackTime: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: {
|
|
|
+ confirm_value: ''
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ arr.forEach(e => {
|
|
|
res.data.confirmationcontent.push(e)
|
|
|
- },this)
|
|
|
+ }, this)
|
|
|
}
|
|
|
console.log(res.data)
|
|
|
this.setData({
|
|
|
- mainData:res.data,
|
|
|
- stopClick:res.data.status !== '新建'?'stopClick':this.data.stopClick
|
|
|
+ mainData: res.data,
|
|
|
+ stopClick: res.data.status !== '新建' ? 'stopClick' : this.data.stopClick
|
|
|
})
|
|
|
this.setInputData()
|
|
|
},
|
|
|
- setInputData () {
|
|
|
+ setInputData() {
|
|
|
let that = this
|
|
|
- that.data.mainData.confirmationcontent.forEach(e=>{
|
|
|
-
|
|
|
- Object.keys(e).map((key,index)=>{
|
|
|
+ that.data.mainData.confirmationcontent.forEach(e => {
|
|
|
+
|
|
|
+ Object.keys(e).map((key, index) => {
|
|
|
that.setData({
|
|
|
- paidServiceAmount:that.data.paidServiceAmount + e[key].amount
|
|
|
+ paidServiceAmount: that.data.paidServiceAmount + e[key].amount
|
|
|
})
|
|
|
if (key === 'nextTreatmentTime') {
|
|
|
this.setData({
|
|
|
- nextTreatmentTime:e[key].confirm_value
|
|
|
+ nextTreatmentTime: e[key].confirm_value
|
|
|
})
|
|
|
}
|
|
|
if (key === 'treatment') {
|
|
|
this.setData({
|
|
|
- treatment:e[key].confirm_value
|
|
|
+ treatment: e[key].confirm_value
|
|
|
})
|
|
|
}
|
|
|
if (key === 'explain') {
|
|
|
this.setData({
|
|
|
- explain:e[key].confirm_value
|
|
|
+ explain: e[key].confirm_value
|
|
|
})
|
|
|
}
|
|
|
if (key === 'nextRebackTime') {
|
|
|
this.setData({
|
|
|
- nextRebackTime:e[key].confirm_value
|
|
|
+ nextRebackTime: e[key].confirm_value
|
|
|
})
|
|
|
}
|
|
|
if (key === 'text') {
|
|
|
this.setData({
|
|
|
- text:e[key].confirm_value
|
|
|
+ text: e[key].confirm_value
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- async updateBill () {
|
|
|
+ async updateBill() {
|
|
|
if (this.data.mainData.status !== '新建') return wx.showToast({
|
|
|
title: '非新建状态,修改的数据将不会保存',
|
|
|
- icon:'none'
|
|
|
+ icon: 'none'
|
|
|
})
|
|
|
const res = await api._post({
|
|
|
"id": "20230211105703",
|
|
|
"content": this.data.mainData
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 改变评分
|
|
|
onChange(e) {
|
|
|
this.data.mainData[e.currentTarget.dataset.name] = e.detail.value
|
|
|
this.setData({
|
|
|
- mainData:this.data.mainData
|
|
|
+ mainData: this.data.mainData
|
|
|
});
|
|
|
this.updateBill()
|
|
|
},
|
|
|
|
|
|
- async submit () {
|
|
|
+ async submit() {
|
|
|
const res = await api._post({
|
|
|
"id": "20230211110003",
|
|
|
"content": {
|
|
|
- "sa_workorder_confirmationid":this.data.mainData.sa_workorder_confirmationid
|
|
|
+ "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid
|
|
|
}
|
|
|
})
|
|
|
if (res.code == 1) {
|
|
|
wx.showToast({
|
|
|
title: '提交成功',
|
|
|
- icon:"success"
|
|
|
+ icon: "success"
|
|
|
})
|
|
|
this.billData()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
- async delete () {
|
|
|
+ async delete() {
|
|
|
const res = await api._post({
|
|
|
"id": "20230211110103",
|
|
|
"content": {
|
|
|
- "sa_workorder_confirmationids":[this.data.mainData.sa_workorder_confirmationid]
|
|
|
+ "sa_workorder_confirmationids": [this.data.mainData.sa_workorder_confirmationid]
|
|
|
}
|
|
|
})
|
|
|
if (res.code == 1) {
|
|
@@ -132,44 +160,44 @@ Page({
|
|
|
inputChange(data) {
|
|
|
console.log(data)
|
|
|
let name = data.currentTarget.dataset.name
|
|
|
- this.data.mainData.confirmationcontent.forEach(e=>{
|
|
|
- Object.keys(e).map((key,index)=>{
|
|
|
+ this.data.mainData.confirmationcontent.forEach(e => {
|
|
|
+ Object.keys(e).map((key, index) => {
|
|
|
if (name === key) {
|
|
|
e[key].confirm_value = data.detail.value
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
this.updateBill()
|
|
|
},
|
|
|
- showNextTimePicker (data) {
|
|
|
+ showNextTimePicker(data) {
|
|
|
let name = data.currentTarget.dataset.name
|
|
|
this.setData({
|
|
|
- pickkerName:name,
|
|
|
- dateVisible:!this.data.dateVisible
|
|
|
+ pickkerName: name,
|
|
|
+ dateVisible: !this.data.dateVisible
|
|
|
})
|
|
|
},
|
|
|
- onConfirm (data) {
|
|
|
+ onConfirm(data) {
|
|
|
let name = this.data.pickkerName
|
|
|
- this.data.mainData.confirmationcontent.forEach(e=>{
|
|
|
- Object.keys(e).map((key,index)=>{
|
|
|
+ this.data.mainData.confirmationcontent.forEach(e => {
|
|
|
+ Object.keys(e).map((key, index) => {
|
|
|
if (name === key) {
|
|
|
e[key].confirm_value = data.detail.value
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
this.setData({
|
|
|
- mainData:this.data.mainData
|
|
|
+ mainData: this.data.mainData
|
|
|
})
|
|
|
this.updateBill()
|
|
|
this.setInputData()
|
|
|
- },
|
|
|
- createImage () {
|
|
|
+ },
|
|
|
+ createImage() {
|
|
|
let token = wx.getStorageSync('userMsg').token
|
|
|
let parentid = wx.getStorageSync('siteP').appfolderid
|
|
|
- let url = `${getApp().globalData.http.baseUrl}/comfirmBill/#/htmlToImageServe?token=${token}&parentid=${parentid}&ownerid=${this.data.mainData.sa_workorder_confirmationid}`
|
|
|
+ let url = `${getApp().globalData.http.baseUrl}/yosweb/#/printTable?token=${token}&parentid=${parentid}&ownerid=${this.data.mainData.sa_workorder_confirmationid}`
|
|
|
this.setData({
|
|
|
- url:url
|
|
|
+ url: url
|
|
|
})
|
|
|
wx.navigateTo({
|
|
|
url: '/Eservice/webView/index',
|
|
@@ -181,9 +209,9 @@ Page({
|
|
|
onLoad(options) {
|
|
|
this.data.bindSignNameData.ownerid = options.id
|
|
|
this.setData({
|
|
|
- stopClick:options.class,
|
|
|
- id:options.id,
|
|
|
- bindSignNameData:this.data.bindSignNameData
|
|
|
+ stopClick: options.class,
|
|
|
+ id: options.id,
|
|
|
+ bindSignNameData: this.data.bindSignNameData
|
|
|
})
|
|
|
this.billData()
|
|
|
},
|
|
@@ -200,7 +228,7 @@ Page({
|
|
|
*/
|
|
|
onShow() {
|
|
|
this.setData({
|
|
|
- SignName:true
|
|
|
+ SignName: true
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -209,7 +237,7 @@ Page({
|
|
|
*/
|
|
|
onHide() {
|
|
|
this.setData({
|
|
|
- SignName:false
|
|
|
+ SignName: false
|
|
|
})
|
|
|
},
|
|
|
|