123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- const api = require("../api/api")
- import Dialog from 'tdesign-miniprogram/dialog/index';
- Page({
- data: {
- },
- /* 修改团队 */
- checkTeam(e) {
- const {
- status,
- sa_workorderid
- } = this.data.billData;
- console.log("工单状态", status)
- wx.navigateTo({
- url: `/Universal/dataTeam/index?ownertable=sa_workorder&ownerid=${sa_workorderid}`,
- })
- },
- /* 是否阻止跳转 */
- isStopToPage() {
- if (this.data.billData.status != '进行中') {
- wx.showToast({
- title: '当前工单状态不支持操作!',
- icon: "none"
- })
- }
- },
- async mainData() {
- const res = await api._post({
- "id": "20230208140103",
- "content": {
- nocache: true,
- "sa_workorderid": this.data.id
- }
- })
- console.log("详情", res)
- this.setData({
- billData: res.data
- })
- },
- changeBillStatus(data) {
- let id = data.currentTarget.dataset.id
- const dialogConfig = {
- context: this,
- title: '提示',
- content: '确认执行当前操作吗?',
- confirmBtn: '确定',
- cancelBtn: '取消',
- };
- Dialog.confirm(dialogConfig)
- .then(async () => {
- if (id == '20230209144503') {
- getApp().globalData.handelSelect = this
- wx.navigateTo({
- url: '/Eservice/workBillConfirmInfo/index',
- })
- } else {
- 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
- })
- },
- onShow() {
- this.mainData()
- this.confirmBillList()
- },
- })
|