123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- const api = require("../api/api")
- import Dialog from 'tdesign-miniprogram/dialog/index';
- // pages/workOrderDetail/index.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- },
- async mainData () {
- const res = await api._post({
- "id": "20230208140103",
- "content": {
- "sa_workorderid":this.data.id
- }
- })
- this.setData({
- billData:res.data
- })
- setTimeout(() => {
- if (this.data.billData.status === '待开始') {
- getApp().globalData.handelSelect = this
- wx.navigateTo({
- url: '/Eservice/workBillConfirmInfo/index',
- })
- }
- }, 1000);
-
- },
- changeBillStatus(data) {
- let id = data.currentTarget.dataset.id
- const dialogConfig = {
- context: this,
- title: '提示',
- content: '确认执行当前操作吗?',
- confirmBtn: '确定',
- cancelBtn: '取消',
- };
- Dialog.confirm(dialogConfig)
- .then(async () => {
- const res = await api._post({
- "id": id,
- "content": {
- "sa_workorderid":this.data.id
- }
- })
- this.mainData()
- })
- .catch(() => console.log('点击了取消'))
- .finally(() => Dialog.close());
- },
- async addConfirmBill () {
- const res = await api._post({
- "id": "20230211105703",
- "version":1,
- "content": {
- "sa_workorder_confirmationid":0,
- "sa_workorderid":this.data.id,
- "attitudescore":0,
- "responsescore":0,
- }
- })
- if (this.data.billData.type === '安装培训') {
- wx.navigateTo({
- url: '/Eservice/trainConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
- })
- } else if (this.data.billData.type === '安装调试') {
- wx.navigateTo({
- url: '/Eservice/installConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
- })
- } else {
- wx.navigateTo({
- url: '/Eservice/serviceConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
- })
- }
-
- },
- toConfirmBill (data) {
- if (this.data.billData.type === '安装培训') {
- wx.navigateTo({
- url: '/Eservice/trainConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + this.data.stopClick,
- })
- } else if (this.data.billData.type === '安装调试') {
- wx.navigateTo({
- url: '/Eservice/installConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + this.data.stopClick,
- })
- } else {
- wx.navigateTo({
- url: '/Eservice/serviceConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + this.data.stopClick,
- })
- }
-
- },
- async confirmBillList () {
- const res = await api._post({
- "id": "20230211105903",
- "content": {
- "where":{
- "condition":"",
- "sa_workorderid":this.data.id
- }
- }
- })
- this.setData({
- confirmBills:res.data
- })
- },
- toWorkConfirmInfo () {
- getApp().globalData.handelSelect = this
- wx.navigateTo({
- url: '/Eservice/workBillConfirmInfo/index?class=' + this.data.stopClick,
- })
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.setData({
- id:options.id,
- stopClick:options.class
- })
-
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- this.mainData()
- this.confirmBillList()
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|