Browse Source

bug修复

xiaohaizhao 1 year ago
parent
commit
e2d2b7c2af

+ 91 - 91
Eservice/agent/billCanUseProduct/index.js

@@ -2,97 +2,97 @@
 import api from '../../api/api'
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    param: {
-      "id": "20230206161703",
-      "version": 1,
-      "content": {
-        "pageSize": 20,
-        "pageNumber": 1,
-        "sa_serviceorderid": 0,
-        "isAll": 0,
-        "sa_orderid": 0,
-        "where": {
-          "condition": ""
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        param: {
+            "id": "20230206161703",
+            "version": 1,
+            "content": {
+                "pageSize": 20,
+                "pageNumber": 1,
+                "sa_serviceorderid": 0,
+                "isAll": 0,
+                "sa_orderid": 0,
+                "where": {
+                    "condition": ""
+                }
+            }
+        },
+        value: '',
+        list: [],
+        selection: []
+    },
+    onLoad(options) {
+        console.log(options)
+        if (options.id) {
+            this.data.param.id = 20230421095904;
+            this.data.param.content.sa_workorderid = options.id;
+        }
+        let pages = getCurrentPages();
+        let prePage = pages[pages.length - 2];
+        this.data.param.content.sa_serviceorderid = prePage.data.sa_serviceorderid
+        this.data.param.content.sa_orderid = prePage.data.sa_orderid
+        this.listData();
+    },
+    tabChange(e) {
+        this.data.param.content.isAll = e.detail.title == '产品库' ? '1' : '0';
+        this.data.param.content.pageNumber = 1;
+        this.setData({
+            list: []
+        })
+        this.listData()
+    },
+    search(data) {
+        this.data.param.content.where.condition = data.detail.value
+        this.data.list = []
+        this.data.param.content.pageNumber = 1
+        this.listData()
+    },
+    clear() {
+        this.data.param.content.where.condition = ''
+        this.data.list = []
+        this.data.param.content.pageNumber = 1
+    },
+    async listData() {
+        const res = await api._post(this.data.param)
+        console.log(res)
+        if (res.data.length > 0) {
+            this.setData({
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+            })
+        } else {
+            wx.showToast({
+                title: '没有更多了!',
+                duration: 2000,
+                icon: 'none'
+            })
         }
-      }
     },
-    value: '',
-    list: [],
-    selection: []
-  },
-  onLoad(options) {
-    let pages = getCurrentPages();
-    let prePage = pages[pages.length - 2];
-    this.data.param.content.sa_serviceorderid = prePage.data.sa_serviceorderid || prePage.data.billData.sa_serviceorderid
-    this.data.param.content.sa_orderid = prePage.data.sa_orderid || prePage.data.billData.sa_orderid
-    console.log(options)
-    if (options.id) {
-      this.data.param.id = 20230421095904;
-      this.data.param.content.sa_workorderid = options.id;
-    }
-    this.listData()
-  },
-  tabChange(e) {
-    this.data.param.content.isAll = e.detail.title == '产品库' ? '1' : '0';
-    this.data.param.content.pageNumber = 1;
-    this.setData({
-      list: []
-    })
-    this.listData()
-  },
-  search(data) {
-    this.data.param.content.where.condition = data.detail.value
-    this.data.list = []
-    this.data.param.content.pageNumber = 1
-    this.listData()
-  },
-  clear() {
-    this.data.param.content.where.condition = ''
-    this.data.list = []
-    this.data.param.content.pageNumber = 1
-  },
-  async listData() {
-    const res = await api._post(this.data.param)
-    console.log(res)
-    if (res.data.length > 0) {
-      this.setData({
-        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
-      })
-    } else {
-      wx.showToast({
-        title: '没有更多了!',
-        duration: 2000,
-        icon: 'none'
-      })
-    }
-  },
-  handleGroupChange(event) {
-    this.setData({
-      selection: event.detail.value,
-    });
-  },
-  refresh() {
-    this.setData({
-      selection: []
-    })
-  },
-  onConfirm() {
-    let pages = getCurrentPages();
-    let prePage = pages[pages.length - 2];
-    prePage.getAdd(this.data.selection)
-    wx.navigateBack()
-  },
-  onPullDownRefresh() {
-    this.data.list = []
-    this.data.param.content.pageNumber = 1
-    this.listData()
-  },
-  onReachBottom() {
-    this.data.param.content.pageNumber++
-    this.listData()
-  },
+    handleGroupChange(event) {
+        this.setData({
+            selection: event.detail.value,
+        });
+    },
+    refresh() {
+        this.setData({
+            selection: []
+        })
+    },
+    onConfirm() {
+        let pages = getCurrentPages();
+        let prePage = pages[pages.length - 2];
+        prePage.getAdd(this.data.selection)
+        wx.navigateBack()
+    },
+    onPullDownRefresh() {
+        this.data.list = []
+        this.data.param.content.pageNumber = 1
+        this.listData()
+    },
+    onReachBottom() {
+        this.data.param.content.pageNumber++
+        this.listData()
+    },
 })

+ 8 - 10
Eservice/components/form/form.js

@@ -57,10 +57,11 @@ Component({
 
             let index = detail.currentTarget.dataset.index
             //添加排除特殊字符
-            this.data.formLayoutData.formInfo[index].inputValue = verify.queryStr(detail.detail.value);
-            this.setData({
-                formLayoutData: this.data.formLayoutData
-            })
+            this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value;
+
+            /*   this.setData({
+                  [`formLayoutData.formInfo[${index}].inputValue`]: verify.queryStr(detail.detail.value)
+              }) */
 
             if (data.role.formatter) {
                 let regStatus = data.role.formatter(detail.detail.value)
@@ -68,14 +69,11 @@ Component({
             }
         },
         onClear(detail) {
+            let data = detail.currentTarget.dataset.item
             let index = detail.currentTarget.dataset.index
-
-            this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
-
+            this.data.formLayoutData.formInfo[index].inputValue = '';
             this.setData({
-
                 formLayoutData: this.data.formLayoutData
-
             })
         },
         onPicker(detail) {
@@ -154,7 +152,7 @@ Component({
             let arr = this.data.formLayoutData.formInfo.map((e, index) => {
                 if (!e.force) return e
                 if (e.label === '关联订单') console.log(e.force && e.inputValue !== '')
-                if (e.force && e.inputValue !== '') {
+                if (e.force && e.inputValue !== '' && e.inputValue != 'undefined') {
                     if (e.role.formatter) {
                         let regStatus = e.role.formatter(e.inputValue)
                         this.setErrorMsg(regStatus, index)

+ 234 - 234
Eservice/installConfirmBill/index.js

@@ -2,242 +2,242 @@ const api = require("../api/api")
 
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    timerid: null,
-    bindSignNameData: {
-      "ownertable": "sa_workorder_confirmation",
-      "ownerid": 0,
-      "usetype": "signature",
-    },
-    paidServiceAmount: 0,
-    SignName: true
-  },
-
-  async billData() {
-    const res = await api._post({
-      "id": "20230211105803",
-      "content": {
-        "sa_workorder_confirmationid": this.data.id
-      }
-    })
-    this.setData({
-      mainData: res.data,
-      sa_serviceorderid: res.data.workorder.sa_serviceorderid,
-      sa_orderid: res.data.workorder.sa_orderid,
-      stopClick: res.data.status !== '新建' ? 'stopClick' : this.data.stopClick
-    })
-    this.setInputData()
-  },
-  setInputData() {
-    let that = this
-    that.data.mainData.confirmationcontent.forEach(e => {
-      Object.keys(e).map((key, index) => {
-        that.setData({
-          paidServiceAmount: that.data.paidServiceAmount + e[key].amount
-        })
-        if (key.includes('是否需要拆卸配件或整拆')) {
-          that.setData({
-            node1: e[key].confirm_value
-          })
-        }
-        if (key.includes('与现场协商确认维修方案')) {
-          that.setData({
-            node2: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
-          })
-        }
-        if (key.includes('实施内容')) {
-          that.setData({
-            node3: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
-          })
-        }
-        if (key.includes('与现场协商试运行')) {
-          that.setData({
-            node4: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
-          })
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        timerid: null,
+        bindSignNameData: {
+            "ownertable": "sa_workorder_confirmation",
+            "ownerid": 0,
+            "usetype": "signature",
+        },
+        paidServiceAmount: 0,
+        SignName: true
+    },
+
+    async billData() {
+        const res = await api._post({
+            "id": "20230211105803",
+            "content": {
+                "sa_workorder_confirmationid": this.data.id
+            }
+        })
+        this.setData({
+            mainData: res.data,
+            sa_serviceorderid: res.data.workorder.sa_serviceorderid || "0",
+            sa_orderid: res.data.workorder.sa_orderid || "0",
+            stopClick: res.data.status !== '新建' ? 'stopClick' : this.data.stopClick
+        })
+        this.setInputData()
+    },
+    setInputData() {
+        let that = this
+        that.data.mainData.confirmationcontent.forEach(e => {
+            Object.keys(e).map((key, index) => {
+                that.setData({
+                    paidServiceAmount: that.data.paidServiceAmount + e[key].amount
+                })
+                if (key.includes('是否需要拆卸配件或整拆')) {
+                    that.setData({
+                        node1: e[key].confirm_value
+                    })
+                }
+                if (key.includes('与现场协商确认维修方案')) {
+                    that.setData({
+                        node2: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
+                    })
+                }
+                if (key.includes('实施内容')) {
+                    that.setData({
+                        node3: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
+                    })
+                }
+                if (key.includes('与现场协商试运行')) {
+                    that.setData({
+                        node4: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
+                    })
+                }
+                if (key.includes('现场交代事项')) {
+                    that.setData({
+                        node5: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
+                    })
+                }
+            })
+        })
+    },
+    async updateBill() {
+        if (this.data.mainData.status !== '新建') return wx.showToast({
+            title: '非新建状态,修改的数据将不会保存',
+            icon: 'none'
+        })
+        const res = await api._post({
+            "id": "20230211105703",
+            "content": this.data.mainData
+        })
+    },
+    // 跳转到物料添加
+    addProduct() {
+        wx.navigateTo({
+            url: '/Eservice/agent/billCanUseProduct/index?id=' + this.data.mainData.sa_workorderid,
+        })
+    },
+    // 添加物料
+    async getAdd(selection) {
+        let arr = selection.map(e => {
+            return {
+                "sa_workorder_node_itemsid": 0,
+                "itemid": e,
+                "qty": 1
+            }
+        })
+        this.data.mainData.trainertitems = this.data.mainData.trainertitems.concat(arr)
+        this.updateMaterial(this.data.mainData.trainertitems)
+    },
+    async updateMaterial(trainertitems) {
+        const res = await api._post({
+            "id": "20230215201903",
+            "content": {
+                "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid,
+                "sa_workorderid": this.data.mainData.workorder.sa_workorderid,
+                "iteminfos": trainertitems
+            }
+        })
+        this.billData()
+    },
+    // 删除物料
+    async deleteMaterial(data) {
+        let itemid = data.detail.sa_workorder_node_itemsid
+        const res = await api._post({
+            "id": "20230215202003",
+            "version": 1,
+            "content": {
+                "sa_workorder_node_itemsids": [itemid]
+            }
+        })
+        this.billData()
+    },
+    // 改变评分
+    onChange(e) {
+        this.data.mainData[e.currentTarget.dataset.name] = e.detail.value
+        this.setData({
+            mainData: this.data.mainData
+        });
+        this.updateBill()
+    },
+
+    async submit() {
+        this.createImage();
+        const res = await api._post({
+            "id": "20230211110003",
+            "content": {
+                "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid
+            }
+        })
+        if (res.code == 1) {
+            wx.showToast({
+                title: '提交成功',
+                icon: "success"
+            })
+            this.billData()
         }
-        if (key.includes('现场交代事项')) {
-          that.setData({
-            node5: e[key].confirm_value ? e[key].confirm_value : e[key].textcontent
-          })
+
+    },
+    async delete() {
+        const res = await api._post({
+            "id": "20230211110103",
+            "content": {
+                "sa_workorder_confirmationids": [this.data.mainData.sa_workorder_confirmationid]
+            }
+        })
+        if (res.code == 1) {
+            wx.navigateBack()
         }
-      })
-    })
-  },
-  async updateBill() {
-    if (this.data.mainData.status !== '新建') return wx.showToast({
-      title: '非新建状态,修改的数据将不会保存',
-      icon: 'none'
-    })
-    const res = await api._post({
-      "id": "20230211105703",
-      "content": this.data.mainData
-    })
-  },
-  // 跳转到物料添加
-  addProduct() {
-    wx.navigateTo({
-      url: '/Eservice/agent/billCanUseProduct/index?id=' + this.data.mainData.sa_workorderid,
-    })
-  },
-  // 添加物料
-  async getAdd(selection) {
-    let arr = selection.map(e => {
-      return {
-        "sa_workorder_node_itemsid": 0,
-        "itemid": e,
-        "qty": 1
-      }
-    })
-    this.data.mainData.trainertitems = this.data.mainData.trainertitems.concat(arr)
-    this.updateMaterial(this.data.mainData.trainertitems)
-  },
-  async updateMaterial(trainertitems) {
-    const res = await api._post({
-      "id": "20230215201903",
-      "content": {
-        "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid,
-        "sa_workorderid": this.data.mainData.workorder.sa_workorderid,
-        "iteminfos": trainertitems
-      }
-    })
-    this.billData()
-  },
-  // 删除物料
-  async deleteMaterial(data) {
-    let itemid = data.detail.sa_workorder_node_itemsid
-    const res = await api._post({
-      "id": "20230215202003",
-      "version": 1,
-      "content": {
-        "sa_workorder_node_itemsids": [itemid]
-      }
-    })
-    this.billData()
-  },
-  // 改变评分
-  onChange(e) {
-    this.data.mainData[e.currentTarget.dataset.name] = e.detail.value
-    this.setData({
-      mainData: this.data.mainData
-    });
-    this.updateBill()
-  },
-
-  async submit() {
-    this.createImage();
-    const res = await api._post({
-      "id": "20230211110003",
-      "content": {
-        "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid
-      }
-    })
-    if (res.code == 1) {
-      wx.showToast({
-        title: '提交成功',
-        icon: "success"
-      })
-      this.billData()
-    }
+    },
+    inputChange(data) {
+        let keyValue = data.currentTarget.dataset.name
+        this.data.mainData.confirmationcontent.forEach(e => {
+            Object.keys(e).map((key, index) => {
+                if (key.includes(keyValue)) {
+                    e[key].confirm_value = data.detail.value
+                }
+            })
+        })
+        this.updateBill()
+    },
+    createImage() {
+        let token = wx.getStorageSync('userMsg').token
+        let parentid = wx.getStorageSync('siteP').appfolderid
+        let url = `${getApp().globalData.http.baseUrl}/yosweb/#/printTable?token=${token}&parentid=${parentid}&ownerid=${this.data.mainData.sa_workorder_confirmationid}`
+        this.setData({
+            url: url
+        })
+        wx.navigateTo({
+            url: '/Eservice/webView/index',
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        this.data.bindSignNameData.ownerid = options.id
+        this.setData({
+            id: options.id,
+            bindSignNameData: this.data.bindSignNameData
+        })
+        this.billData()
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+        this.setData({
+            SignName: true
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+        this.setData({
+            SignName: false
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
 
-  },
-  async delete() {
-    const res = await api._post({
-      "id": "20230211110103",
-      "content": {
-        "sa_workorder_confirmationids": [this.data.mainData.sa_workorder_confirmationid]
-      }
-    })
-    if (res.code == 1) {
-      wx.navigateBack()
     }
-  },
-  inputChange(data) {
-    let keyValue = data.currentTarget.dataset.name
-    this.data.mainData.confirmationcontent.forEach(e => {
-      Object.keys(e).map((key, index) => {
-        if (key.includes(keyValue)) {
-          e[key].confirm_value = data.detail.value
-        }
-      })
-    })
-    this.updateBill()
-  },
-  createImage() {
-    let token = wx.getStorageSync('userMsg').token
-    let parentid = wx.getStorageSync('siteP').appfolderid
-    let url = `${getApp().globalData.http.baseUrl}/yosweb/#/printTable?token=${token}&parentid=${parentid}&ownerid=${this.data.mainData.sa_workorder_confirmationid}`
-    this.setData({
-      url: url
-    })
-    wx.navigateTo({
-      url: '/Eservice/webView/index',
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-    this.data.bindSignNameData.ownerid = options.id
-    this.setData({
-      id: options.id,
-      bindSignNameData: this.data.bindSignNameData
-    })
-    this.billData()
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-    this.setData({
-      SignName: true
-    })
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-    this.setData({
-      SignName: false
-    })
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
 })

+ 79 - 80
Eservice/installConfirmBill/index.wxml

@@ -1,87 +1,86 @@
-<!--pages/trainConfirmBill/index.wxml-->
-<view>
-  <view class="title colorInfo">
-    单据信息
-  </view>
-  <t-cell title="服务单号" note="{{mainData.workorder.servicebillno}}" hover />
-  <t-cell title="确认日期" note="{{mainData.workorder.createdate}}" hover />
-  <view class="title colorInfo">
-    服务信息
-  </view>
-  <t-cell title="服务分类" note="{{mainData.workorder.servicetype}}" hover />
-  <t-cell title="应用系统" note="{{mainData.workorder.class1}}" hover />
-  <t-cell title="客诉大类" note="{{mainData.workorder.class2}}" hover />
-  <t-cell title="工单负责人" note="{{mainData.workorder.projectleader}}" hover />
-  <t-cell title="项目名称" note="{{mainData.workorder.projectname}}" hover />
-  <t-cell title="业务员" note="{{mainData.workorder.saler_name}}" hover />
-  <t-cell title="服务企业" note="{{mainData.workorder.enterprisename}}" hover />
-  <view class="title colorInfo">
-    现场联系人信息
-  </view>
-  <t-cell title="姓名" note="{{mainData.workorder.scenecontact}}" hover />
-  <t-cell title="电话" note="{{mainData.workorder.scenecontactphonenumber}}" hover />
-  <t-cell title="地址" note="{{mainData.workorder.address}}" hover />
-  <view class="title colorInfo">
-    产品
-  </view>
-  <t-tabs defaultValue="{{1}}" t-class="custom-tabs">
-    <t-tab-panel label="产品信息" value="1">
-      <view class="panel">
-        <card style="margin-top:10px" wx:for="{{mainData.trainertitems}}" wx:key="itemid">
-          <product-card style="flex:1" slot="content" data="{{item}}" changeQty="{{false}}" bind:delete="deleteMaterial" bind:input="qtyChange"></product-card>
-        </card>
-        <view class="flex-align-center flex-around panel">
-          <t-button size="extra-small" variant="primary" bind:tap="addProduct">添加产品</t-button>
-        </view>
-      </view>
-    </t-tab-panel>
-  </t-tabs>
-  <view class="title colorInfo">
-    客诉情况
-  </view>
-  <t-textarea style="margin-bottom:1px" label="客诉内容" value="{{mainData.workorder.reason}}" bind:blur="inputChange" t-class="external-class" placeholder="请输入客诉内容" disableDefaultPadding="{{true}}" autosize />
-  <view class="title colorInfo">
-    维修信息确认
-  </view>
-  <t-cell title="是否需要拆卸配件或整拆" note="{{node1}}" hover />
-  <t-textarea style="margin-bottom:1px" label="维修方案及周期" value="{{node2}}" data-name="与现场协商确认维修方案" bind:blur="inputChange" t-class="external-class" placeholder="维修方案" disableDefaultPadding="{{true}}" autosize />
-  <t-cell title="是否有偿服务" note="{{paidServiceAmount > 0?'是':'否'}}" hover />
-  <t-cell title="服务金额" note="{{paidServiceAmount}}" hover />
-  <t-textarea style="margin-bottom:1px" label="实施内容" value="{{node3}}" data-name="实施内容" bind:blur="inputChange" t-class="external-class" placeholder="实施内容" disableDefaultPadding="{{true}}" autosize />
-  <t-textarea style="margin-bottom:1px" label="服务测试内容描述" value="{{node4}}" data-name="与现场协商试运行" bind:blur="inputChange" t-class="external-class" placeholder="服务测试内容描述" disableDefaultPadding="{{true}}" autosize />
-  <t-textarea style="margin-bottom:1px" label="现场交代事项" value="{{node5}}" data-name="现场交代事项" bind:blur="inputChange" t-class="external-class" placeholder="现场交代事项" disableDefaultPadding="{{true}}" autosize />
+<view class="{{stopClick}}">
+    <view class="title colorInfo">
+        单据信息
+    </view>
+    <t-cell title="服务单号" note="{{mainData.workorder.servicebillno}}" hover />
+    <t-cell title="确认日期" note="{{mainData.workorder.createdate}}" hover />
+    <view class="title colorInfo">
+        服务信息
+    </view>
+    <t-cell title="服务分类" note="{{mainData.workorder.servicetype}}" hover />
+    <t-cell title="应用系统" note="{{mainData.workorder.class1}}" hover />
+    <t-cell title="客诉大类" note="{{mainData.workorder.class2}}" hover />
+    <t-cell title="工单负责人" note="{{mainData.workorder.projectleader}}" hover />
+    <t-cell title="项目名称" note="{{mainData.workorder.projectname}}" hover />
+    <t-cell title="业务员" note="{{mainData.workorder.saler_name}}" hover />
+    <t-cell title="服务企业" note="{{mainData.workorder.enterprisename}}" hover />
+    <view class="title colorInfo">
+        现场联系人信息
+    </view>
+    <t-cell title="姓名" note="{{mainData.workorder.scenecontact}}" hover />
+    <t-cell title="电话" note="{{mainData.workorder.scenecontactphonenumber}}" hover />
+    <t-cell title="地址" note="{{mainData.workorder.address}}" hover />
+    <view class="title colorInfo">
+        产品
+    </view>
+    <t-tabs defaultValue="{{1}}" t-class="custom-tabs">
+        <t-tab-panel label="产品信息" value="1">
+            <view class="panel">
+                <card style="margin-top:10px" wx:for="{{mainData.trainertitems}}" wx:key="itemid">
+                    <product-card style="flex:1" slot="content" data="{{item}}" changeQty="{{false}}" bind:delete="deleteMaterial" bind:input="qtyChange"></product-card>
+                </card>
+                <view class="flex-align-center flex-around panel">
+                    <t-button size="extra-small" variant="primary" bind:tap="addProduct">添加产品</t-button>
+                </view>
+            </view>
+        </t-tab-panel>
+    </t-tabs>
+    <view class="title colorInfo">
+        客诉情况
+    </view>
+    <t-textarea style="margin-bottom:1px" label="客诉内容" value="{{mainData.workorder.reason}}" bind:blur="inputChange" t-class="external-class" placeholder="请输入客诉内容" disableDefaultPadding="{{true}}" autosize />
+    <view class="title colorInfo">
+        维修信息确认
+    </view>
+    <t-cell title="是否需要拆卸配件或整拆" note="{{node1}}" hover />
+    <t-textarea style="margin-bottom:1px" label="维修方案及周期" value="{{node2}}" data-name="与现场协商确认维修方案" bind:blur="inputChange" t-class="external-class" placeholder="维修方案" disableDefaultPadding="{{true}}" autosize />
+    <t-cell title="是否有偿服务" note="{{paidServiceAmount > 0?'是':'否'}}" hover />
+    <t-cell title="服务金额" note="{{paidServiceAmount}}" hover />
+    <t-textarea style="margin-bottom:1px" label="实施内容" value="{{node3}}" data-name="实施内容" bind:blur="inputChange" t-class="external-class" placeholder="实施内容" disableDefaultPadding="{{true}}" autosize />
+    <t-textarea style="margin-bottom:1px" label="服务测试内容描述" value="{{node4}}" data-name="与现场协商试运行" bind:blur="inputChange" t-class="external-class" placeholder="服务测试内容描述" disableDefaultPadding="{{true}}" autosize />
+    <t-textarea style="margin-bottom:1px" label="现场交代事项" value="{{node5}}" data-name="现场交代事项" bind:blur="inputChange" t-class="external-class" placeholder="现场交代事项" disableDefaultPadding="{{true}}" autosize />
 
-  <view class="title colorInfo">
-    评价
-  </view>
-  <view class="demo-rate">
-    <view class="demo-rate__title">反应速度</view>
-    <!-- 实心评分,设置属性:variant-->
-    <t-rate value="{{mainData.responsescore}}" data-name="responsescore" variant="filled" bind:change="onChange" />
-  </view>
-  <view class="demo-rate">
-    <view class="demo-rate__title">配合态度</view>
-    <!-- 实心评分,设置属性:variant-->
-    <t-rate value="{{mainData.attitudescore}}" data-name="attitudescore" variant="filled" bind:change="onChange" />
-  </view>
-  <view class="title colorInfo">
-    客户签字
-  </view>
-  <card>
-    <view style="flex:1" slot="content">
-      <!-- <upload id="upload"></upload> -->
-      <sign-name wx:if="{{SignName}}" bindData="{{bindSignNameData}}"></sign-name>
+    <view class="title colorInfo">
+        评价
     </view>
-  </card>
+    <view class="demo-rate">
+        <view class="demo-rate__title">反应速度</view>
+        <!-- 实心评分,设置属性:variant-->
+        <t-rate value="{{mainData.responsescore}}" data-name="responsescore" variant="filled" bind:change="onChange" />
+    </view>
+    <view class="demo-rate">
+        <view class="demo-rate__title">配合态度</view>
+        <!-- 实心评分,设置属性:variant-->
+        <t-rate value="{{mainData.attitudescore}}" data-name="attitudescore" variant="filled" bind:change="onChange" />
+    </view>
+    <view class="title colorInfo">
+        客户签字
+    </view>
+    <card>
+        <view style="flex:1" slot="content">
+            <!-- <upload id="upload"></upload> -->
+            <sign-name wx:if="{{SignName}}" bindData="{{bindSignNameData}}"></sign-name>
+        </view>
+    </card>
 </view>
 
 <view style="height: 130rpx;" />
 <view class="footer">
-  <view class="count">
-  </view>
-  <view class="but-box">
-    <van-button custom-class='but' bind:click="createImage">单据预览</van-button>
-    <van-button custom-class='but delete' disabled="{{mainData.status !== '新建'?true:false}}" bind:click="delete">删 除</van-button>
-    <van-button custom-class='but' disabled="{{mainData.status !== '新建'?true:false}}" bind:click="submit">提 交</van-button>
-  </view>
+    <view class="count">
+    </view>
+    <view class="but-box">
+        <van-button custom-class='but' bind:click="createImage">单据预览</van-button>
+        <van-button custom-class='but delete' disabled="{{mainData.status !== '新建'?true:false}}" bind:click="delete">删 除</van-button>
+        <van-button custom-class='but' disabled="{{mainData.status !== '新建'?true:false}}" bind:click="submit">提 交</van-button>
+    </view>
 </view>

+ 5 - 0
Eservice/signName/index.scss

@@ -1,4 +1,9 @@
 
+page{
+  width: 100%;
+  height: 100vh;
+  overflow: hidden;
+}
 .container {
   width: 100%;
   height: 100vh;

+ 254 - 254
Eservice/trainConfirmBill/index.js

@@ -2,277 +2,277 @@ const api = require("../api/api")
 
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    timerid: null,
-    bindSignNameData: {
-      "ownertable": "sa_workorder_confirmation",
-      "ownerid": 0,
-      "usetype": "signature",
-    }
-  },
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        timerid: null,
+        bindSignNameData: {
+            "ownertable": "sa_workorder_confirmation",
+            "ownerid": 0,
+            "usetype": "signature",
+        }
+    },
 
-  async billData() {
-    const res = await api._post({
-      "id": "20230211105803",
-      "content": {
-        "sa_workorder_confirmationid": this.data.id
-      }
-    })
-    console.log('详情', res)
-    this.setData({
-      mainData: res.data,
-      sa_serviceorderid: res.data.workorder.sa_serviceorderid,
-      sa_orderid: res.data.workorder.sa_orderid||'0',
-      stopClick: res.data.status !== '新建' ? 'stopClick' : this.data.stopClick
-    })
-    this.setInputData()
-  },
-  setInputData() {
-    this.data.mainData.confirmationcontent.forEach(e => {
-      Object.keys(e).map((key, index) => {
-        if (key.includes('现场培训内容')) {
-          this.setData({
-            trainerContent: e[key].confirm_value
-          })
-        } else if (key.includes('现场互动及测试培训效果')) {
+    async billData() {
+        const res = await api._post({
+            "id": "20230211105803",
+            "content": {
+                "sa_workorder_confirmationid": this.data.id
+            }
+        })
+        console.log('详情', res)
+        this.setData({
+            mainData: res.data,
+            sa_serviceorderid: res.data.workorder.sa_serviceorderid || '0',
+            sa_orderid: res.data.workorder.sa_orderid || '0',
+            stopClick: res.data.status !== '新建' ? 'stopClick' : this.data.stopClick
+        })
+        this.setInputData()
+    },
+    setInputData() {
+        this.data.mainData.confirmationcontent.forEach(e => {
+            Object.keys(e).map((key, index) => {
+                if (key.includes('现场培训内容')) {
+                    this.setData({
+                        trainerContent: e[key].confirm_value
+                    })
+                } else if (key.includes('现场互动及测试培训效果')) {
 
-          this.setData({
-            trainerResult: e[key].confirm_value
-          })
-        } else {
+                    this.setData({
+                        trainerResult: e[key].confirm_value
+                    })
+                } else {
 
-        }
-      })
-    })
-  },
-  async updateBill() {
-    if (this.data.mainData.status !== '新建') return wx.showToast({
-      title: '非新建状态,修改的数据将不会保存',
-      icon: 'none'
-    })
-    const res = await api._post({
-      "id": "20230211105703",
-      "content": this.data.mainData
-    })
-  },
-  // 跳转到物料添加
-  addProduct() {
-    /*  wx.navigateTo({
-       url: '/Eservice/serviceMaterial/index',
-     }) */
-    wx.navigateTo({
-      url: '/Eservice/agent/billCanUseProduct/index?id=' + this.data.mainData.sa_workorderid
-    })
-  },
-  // 跳转到添加人员
-  addTrainers() {
-    wx.navigateTo({
-      url: '/Eservice/addTrainers/index',
-    })
-  },
-  // 添加人员
-  async getAddTrainers(data) {
-    data.sa_workorder_node_teamid = 0
-    this.data.mainData.trainers.push(data)
-    const res = await api._post({
-      "id": "20230215202103",
-      "content": {
-        "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid,
-        "sa_workorderid": this.data.mainData.workorder.sa_workorderid,
-        "trainers": this.data.mainData.trainers
-      }
-    })
-    this.billData()
-  },
-  // 删除人员
-  async deleteMenber(data) {
-    let id = data.detail.sa_workorder_node_teamid
-    const res = await api._post({
-      "id": "20230215202203",
-      "version": 1,
-      "content": {
-        "sa_workorder_node_teamids": [id]
-      }
-    })
-    this.billData()
-  },
-  // 添加物料
-  async getAdd(selection) {
-    console.log(selection)
-    let arr = selection.map(e => {
-      return {
-        "sa_workorder_node_itemsid": 0,
-        "itemid": e,
-        "qty": 1
-      }
-    })
-    this.data.mainData.trainertitems = this.data.mainData.trainertitems.concat(arr)
-    this.updateMaterial(this.data.mainData.trainertitems)
-  },
-  async updateMaterial(trainertitems) {
-    const res = await api._post({
-      "id": "20230215201903",
-      "content": {
-        "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid,
-        "sa_workorderid": this.data.mainData.workorder.sa_workorderid,
-        "iteminfos": trainertitems
-      }
-    })
-    this.billData()
-  },
-  // 修改物料数量
-  qtyChange(data) {
-    clearTimeout(this.data.timerid)
-    this.data.timerid = setTimeout(() => {
-      this.data.mainData.trainertitems.forEach(e => {
-        if (e.itemid == data.detail.itemid) {
-          e.qty = data.detail.qty
-        }
-      })
-      this.updateMaterial(this.data.mainData.trainertitems)
-    }, 1000)
-    this.setData({
-      timerid: this.data.timerid
-    })
+                }
+            })
+        })
+    },
+    async updateBill() {
+        if (this.data.mainData.status !== '新建') return wx.showToast({
+            title: '非新建状态,修改的数据将不会保存',
+            icon: 'none'
+        })
+        const res = await api._post({
+            "id": "20230211105703",
+            "content": this.data.mainData
+        })
+    },
+    // 跳转到物料添加
+    addProduct() {
+        /*  wx.navigateTo({
+           url: '/Eservice/serviceMaterial/index',
+         }) */
+        wx.navigateTo({
+            url: '/Eservice/agent/billCanUseProduct/index?id=' + this.data.mainData.sa_workorderid
+        })
+    },
+    // 跳转到添加人员
+    addTrainers() {
+        wx.navigateTo({
+            url: '/Eservice/addTrainers/index',
+        })
+    },
+    // 添加人员
+    async getAddTrainers(data) {
+        data.sa_workorder_node_teamid = 0
+        this.data.mainData.trainers.push(data)
+        const res = await api._post({
+            "id": "20230215202103",
+            "content": {
+                "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid,
+                "sa_workorderid": this.data.mainData.workorder.sa_workorderid,
+                "trainers": this.data.mainData.trainers
+            }
+        })
+        this.billData()
+    },
+    // 删除人员
+    async deleteMenber(data) {
+        let id = data.detail.sa_workorder_node_teamid
+        const res = await api._post({
+            "id": "20230215202203",
+            "version": 1,
+            "content": {
+                "sa_workorder_node_teamids": [id]
+            }
+        })
+        this.billData()
+    },
+    // 添加物料
+    async getAdd(selection) {
+        console.log(selection)
+        let arr = selection.map(e => {
+            return {
+                "sa_workorder_node_itemsid": 0,
+                "itemid": e,
+                "qty": 1
+            }
+        })
+        this.data.mainData.trainertitems = this.data.mainData.trainertitems.concat(arr)
+        this.updateMaterial(this.data.mainData.trainertitems)
+    },
+    async updateMaterial(trainertitems) {
+        const res = await api._post({
+            "id": "20230215201903",
+            "content": {
+                "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid,
+                "sa_workorderid": this.data.mainData.workorder.sa_workorderid,
+                "iteminfos": trainertitems
+            }
+        })
+        this.billData()
+    },
+    // 修改物料数量
+    qtyChange(data) {
+        clearTimeout(this.data.timerid)
+        this.data.timerid = setTimeout(() => {
+            this.data.mainData.trainertitems.forEach(e => {
+                if (e.itemid == data.detail.itemid) {
+                    e.qty = data.detail.qty
+                }
+            })
+            this.updateMaterial(this.data.mainData.trainertitems)
+        }, 1000)
+        this.setData({
+            timerid: this.data.timerid
+        })
 
-  },
-  // 删除物料
-  async deleteMaterial(data) {
-    let itemid = data.detail.sa_workorder_node_itemsid
-    const res = await api._post({
-      "id": "20230215202003",
-      "content": {
-        "sa_workorder_node_itemsids": [itemid]
-      }
-    })
-    this.billData()
-  },
-  // 改变评分
-  onChange(e) {
-    this.data.mainData[e.currentTarget.dataset.name] = e.detail.value
-    this.setData({
-      mainData: this.data.mainData
-    });
-    this.updateBill()
-  },
+    },
+    // 删除物料
+    async deleteMaterial(data) {
+        let itemid = data.detail.sa_workorder_node_itemsid
+        const res = await api._post({
+            "id": "20230215202003",
+            "content": {
+                "sa_workorder_node_itemsids": [itemid]
+            }
+        })
+        this.billData()
+    },
+    // 改变评分
+    onChange(e) {
+        this.data.mainData[e.currentTarget.dataset.name] = e.detail.value
+        this.setData({
+            mainData: this.data.mainData
+        });
+        this.updateBill()
+    },
 
-  async submit() {
-    this.createImage();
-    const res = await api._post({
-      "id": "20230211110003",
-      "content": {
-        "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid
-      }
-    })
-    if (res.code == 1) {
-      wx.showToast({
-        title: '提交成功',
-        icon: "success"
-      })
-      this.billData()
-    }
+    async submit() {
+        this.createImage();
+        const res = await api._post({
+            "id": "20230211110003",
+            "content": {
+                "sa_workorder_confirmationid": this.data.mainData.sa_workorder_confirmationid
+            }
+        })
+        if (res.code == 1) {
+            wx.showToast({
+                title: '提交成功',
+                icon: "success"
+            })
+            this.billData()
+        }
 
-  },
-  async delete() {
-    const res = await api._post({
-      "id": "20230211110103",
-      "content": {
-        "sa_workorder_confirmationids": [this.data.mainData.sa_workorder_confirmationid]
-      }
-    })
-    if (res.code == 1) {
-      wx.navigateBack()
-    }
-  },
-  inputChange(data) {
-    let keyValue = data.currentTarget.dataset.name
-    this.data.mainData.confirmationcontent.forEach(e => {
-      Object.keys(e).map((key, index) => {
-        if (key.includes(keyValue)) {
-          console.log(e)
-          e[key].confirm_value = data.detail.value
+    },
+    async delete() {
+        const res = await api._post({
+            "id": "20230211110103",
+            "content": {
+                "sa_workorder_confirmationids": [this.data.mainData.sa_workorder_confirmationid]
+            }
+        })
+        if (res.code == 1) {
+            wx.navigateBack()
         }
-      })
-    })
-    this.updateBill()
-  },
-  createImage() {
-    let token = wx.getStorageSync('userMsg').token
-    let parentid = wx.getStorageSync('siteP').appfolderid
-    let url = `${getApp().globalData.http.baseUrl}/yosweb/#/printTable?token=${token}&parentid=${parentid}&ownerid=${this.data.mainData.sa_workorder_confirmationid}`
-    this.setData({
-      url: url
-    })
-    wx.navigateTo({
-      url: '/Eservice/webView/index',
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-    this.data.bindSignNameData.ownerid = options.id
-    this.setData({
-      stopClick: options.class,
-      id: options.id,
-      bindSignNameData: this.data.bindSignNameData
-    })
-    this.billData()
-  },
+    },
+    inputChange(data) {
+        let keyValue = data.currentTarget.dataset.name
+        this.data.mainData.confirmationcontent.forEach(e => {
+            Object.keys(e).map((key, index) => {
+                if (key.includes(keyValue)) {
+                    console.log(e)
+                    e[key].confirm_value = data.detail.value
+                }
+            })
+        })
+        this.updateBill()
+    },
+    createImage() {
+        let token = wx.getStorageSync('userMsg').token
+        let parentid = wx.getStorageSync('siteP').appfolderid
+        let url = `${getApp().globalData.http.baseUrl}/yosweb/#/printTable?token=${token}&parentid=${parentid}&ownerid=${this.data.mainData.sa_workorder_confirmationid}`
+        this.setData({
+            url: url
+        })
+        wx.navigateTo({
+            url: '/Eservice/webView/index',
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        this.data.bindSignNameData.ownerid = options.id
+        this.setData({
+            stopClick: options.class,
+            id: options.id,
+            bindSignNameData: this.data.bindSignNameData
+        })
+        this.billData()
+    },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-    this.setData({
-      SignName: true
-    })
-  },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+        this.setData({
+            SignName: true
+        })
+    },
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-    this.setData({
-      SignName: false
-    })
-  },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+        this.setData({
+            SignName: false
+        })
+    },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
 
-  },
+    },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
 
-  },
+    },
 
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
 
-  },
+    },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
 
-  }
+    }
 })

+ 130 - 124
Eservice/workBillConfirmInfo/formData.js

@@ -1,138 +1,144 @@
 const formLayout = {
-  fieldId: '101', //对应一级表单层级
-  fieldName: '基本信息',
-  formInfo: [ //每个层级下面 具体表单元素
-    {
-      label: '申请人', //标题
-      type: 'cell', //表单类型 text,upload,picker,time
-      id: 'enterprisename', //表单id
-      placeholder: '选择服务类型', //设置文本框默认提示
-      inputValue: '',
-      data: [],
-      role: {
-        type: 'reg',
-        value: '', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '现场联系人', //标题
-      type: 'text', //表单类型 text,upload,picker,time
-      id: 'scenecontact', //表单id
-      placeholder: '输入现场联系人', //设置文本框默认提示
-      inputValue: '',
-      data: [],
-      role: {
-        type: 'reg',
-        value: '', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '联系电话', //标题
-      type: 'text', //表单类型 text,upload,picker,time
-      id: 'scenecontactphonenumber', //表单id
-      placeholder: '输入联系电话', //设置文本框默认提示
-      inputValue: '',
-      data: [],
-      role: {
-        type: 'reg',
-        value: '', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '地址', //标题
-      type: 'text', //表单类型 text,upload,picker,time
-      id: 'address', //表单id
-      placeholder: '输入地址', //设置文本框默认提示
-      inputValue: '',
-      data: [],
-      role: {
-        type: 'reg',
-        value: '', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '是否为我司出货产品', //标题
-      type: 'picker', //表单类型 text,upload,picker,time
-      id: 'isouritem', //表单id
-      placeholder: '选择', //设置文本框默认提示
-      inputValue: '1',
-      data: [{
-          value: '1',
-          label: '是'
+    fieldId: '101', //对应一级表单层级
+    fieldName: '基本信息',
+    formInfo: [ //每个层级下面 具体表单元素
+        {
+            label: '申请人', //标题
+            type: 'cell', //表单类型 text,upload,picker,time
+            id: 'enterprisename', //表单id
+            placeholder: '选择服务类型', //设置文本框默认提示
+            inputValue: '',
+            data: [],
+            role: {
+                type: 'reg',
+                value: '', //正则表达式
+            },
+            force: true, //是否必输入
         },
         {
-          value: '0',
-          label: '否'
+            label: '现场联系人', //标题
+            type: 'text', //表单类型 text,upload,picker,time
+            id: 'scenecontact', //表单id
+            placeholder: '输入现场联系人', //设置文本框默认提示
+            inputValue: '',
+            data: [],
+            role: {
+                type: 'reg',
+                value: '', //正则表达式
+            },
+            force: true, //是否必输入
         },
-      ],
-      role: {
-        type: 'reg',
-        value: '', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '是否在保质期内', //标题
-      type: 'picker', //表单类型 text,upload,picker,time
-      id: 'inqualityguaranteeperiod', //表单id
-      placeholder: '选择', //设置文本框默认提示
-      inputValue: "1",
-      data: [{
-          value: '1',
-          label: '是'
+        {
+            label: '联系电话', //标题
+            type: 'text', //表单类型 text,upload,picker,time
+            id: 'scenecontactphonenumber', //表单id
+            placeholder: '输入联系电话', //设置文本框默认提示
+            inputValue: '',
+            data: [],
+            role: {
+                type: 'reg',
+                formatter: (v) => {
+                    let reg = /^1[3-9]\d{9}$/
+
+                    if (!reg.test(v)) return '手机号输入有误'
+
+                    return ''
+                }
+            },
+            force: true, //是否必输入
         },
         {
-          value: '0',
-          label: '否'
+            label: '地址', //标题
+            type: 'text', //表单类型 text,upload,picker,time
+            id: 'address', //表单id
+            placeholder: '输入地址', //设置文本框默认提示
+            inputValue: '',
+            data: [],
+            role: {
+                type: 'reg',
+                value: '', //正则表达式
+            },
+            force: true, //是否必输入
         },
-      ],
-      role: {
-        type: 'reg',
-        value: '1', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '确认客诉异常描述是否属实', //标题
-      type: 'picker', //表单类型 text,upload,picker,time
-      id: 'isfact', //表单id
-      placeholder: '选择', //设置文本框默认提示
-      inputValue: '1',
-      data: [{
-          value: '1',
-          label: '是'
+        {
+            label: '是否为我司出货产品', //标题
+            type: 'picker', //表单类型 text,upload,picker,time
+            id: 'isouritem', //表单id
+            placeholder: '选择', //设置文本框默认提示
+            inputValue: '1',
+            data: [{
+                    value: '1',
+                    label: '是'
+                },
+                {
+                    value: '0',
+                    label: '否'
+                },
+            ],
+            role: {
+                type: 'reg',
+                value: '', //正则表达式
+            },
+            force: true, //是否必输入
+        },
+        {
+            label: '是否在保质期内', //标题
+            type: 'picker', //表单类型 text,upload,picker,time
+            id: 'inqualityguaranteeperiod', //表单id
+            placeholder: '选择', //设置文本框默认提示
+            inputValue: "1",
+            data: [{
+                    value: '1',
+                    label: '是'
+                },
+                {
+                    value: '0',
+                    label: '否'
+                },
+            ],
+            role: {
+                type: 'reg',
+                value: '1', //正则表达式
+            },
+            force: true, //是否必输入
+        },
+        {
+            label: '确认客诉异常描述是否属实', //标题
+            type: 'picker', //表单类型 text,upload,picker,time
+            id: 'isfact', //表单id
+            placeholder: '选择', //设置文本框默认提示
+            inputValue: '1',
+            data: [{
+                    value: '1',
+                    label: '是'
+                },
+                {
+                    value: '0',
+                    label: '否'
+                },
+            ],
+            role: {
+                type: 'reg',
+                value: '', //正则表达式
+            },
+            force: true, //是否必输入
         },
         {
-          value: '0',
-          label: '否'
+            label: '附件上传', //标题
+            type: 'upload', //表单类型 text,upload,picker,time
+            id: 'attinfos', //表单id
+            placeholder: '请上传附件', //设置文本框默认提示
+            data: {
+                ownertable: 'sa_serviceorder'
+            }, //填充表单的数据 例如下拉框
+            role: {
+                type: 'reg',
+            },
+            force: false, //是否必输入
         },
-      ],
-      role: {
-        type: 'reg',
-        value: '', //正则表达式
-      },
-      force: true, //是否必输入
-    },
-    {
-      label: '附件上传', //标题
-      type: 'upload', //表单类型 text,upload,picker,time
-      id: 'attinfos', //表单id
-      placeholder: '请上传附件', //设置文本框默认提示
-      data: {
-        ownertable: 'sa_serviceorder'
-      }, //填充表单的数据 例如下拉框
-      role: {
-        type: 'reg',
-      },
-      force: false, //是否必输入
-    },
 
-  ]
+    ]
 }
 module.exports = {
-  formLayout
+    formLayout
 }

+ 79 - 73
Eservice/workOrder/index.js

@@ -1,11 +1,11 @@
 // pages/home/index.js
 const imageCdn = 'https://tdesign.gtimg.com/miniprogram/images/';
 const swiperList = [
-  `${imageCdn}/swiper1.png`,
-  `${imageCdn}/swiper2.png`,
-  `${imageCdn}/swiper3.png`,
-  `${imageCdn}/swiper4.png`,
-  `${imageCdn}/swiper5.png`,
+    `${imageCdn}/swiper1.png`,
+    `${imageCdn}/swiper2.png`,
+    `${imageCdn}/swiper3.png`,
+    `${imageCdn}/swiper4.png`,
+    `${imageCdn}/swiper5.png`,
 ];
 
 const app = getApp()
@@ -13,72 +13,78 @@ import api from '../api/api'
 
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    current: 0,
-    autoplay: false,
-    duration: 500,
-    interval: 5000,
-    swiperList,
-    list: [],
-    pageNumber: 1,
-    pageSize: 20,
-    status: '待接单',
-    statistics: {}
-  },
-  /* 去详情 */
-  toDetail(e) {
-    console.log(e)
-    const {
-      item
-    } = e.currentTarget.dataset;
-    wx.navigateTo({
-      url: (item.team.some(v => v.userid == wx.getStorageSync('userMsg').userid) ? '/Eservice/workOrderDetail/index' : '/Eservice/workerLeader/editworkOrderDetail/index') + '?id=' + item.sa_workorderid,
-    })
-  },
-  async listData() {
-    const res = await api._post({
-      "id": "20230208140203",
-      "version": 1,
-      "content": {
-        "pageNumber": this.data.pageNumber,
-        "pageSize": this.data.pageSize,
-        "where": {
-          "status": this.data.status,
-          "condition": ""
-        }
-      }
-    })
-    this.setData({
-      statistics: res.data[0].rows_total[0]
-    })
-    if (!res.data[0].billno) return false;
-    this.setData({
-      list: this.data.list.concat(res.data)
-    })
-    console.log(this.data.statistics)
-  },
-  onTabsChange(e) {
-    this.data.status = e.detail.value;
-    this.onPullDownRefresh()
-  },
-  onLoad(options) {
-    this.listData()
-  },
-  onPullDownRefresh() {
-    this.setData({
-      pageNumber: 1,
-      list: []
-    })
-    this.listData()
-  },
-  onReachBottom() {
-    this.data.pageNumber++
-    this.setData({
-      pageNumber: this.data.pageNumber,
-    })
-    this.listData()
-  },
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        current: 0,
+        autoplay: false,
+        duration: 500,
+        interval: 5000,
+        swiperList,
+        list: [],
+        pageNumber: 1,
+        pageSize: 20,
+        status: '待接单',
+        statistics: {}
+    },
+    /* 去详情 */
+    toDetail(e) {
+        console.log(e)
+        const {
+            item
+        } = e.currentTarget.dataset;
+        wx.navigateTo({
+            url: (item.team.some(v => v.userid == wx.getStorageSync('userMsg').userid) ? '/Eservice/workOrderDetail/index' : '/Eservice/workerLeader/editworkOrderDetail/index') + '?id=' + item.sa_workorderid,
+        })
+    },
+    async listData() {
+        const res = await api._post({
+            "id": "20230208140203",
+            "version": 1,
+            "content": {
+                "pageNumber": this.data.pageNumber,
+                "pageSize": this.data.pageSize,
+                "where": {
+                    "status": this.data.status,
+                    "condition": ""
+                }
+            }
+        })
+        this.setData({
+            statistics: res.data[0].rows_total[0]
+        })
+        if (!res.data[0].billno) return false;
+        this.setData({
+            list: this.data.list.concat(res.data)
+        })
+        console.log(this.data.statistics)
+    },
+    onTabsChange(e) {
+        this.data.status = e.detail.value;
+        this.onPullDownRefresh()
+    },
+    onLoad(options) {
+        this.listData()
+    },
+    onShow() {
+        this.setData({
+            pageNumber: 1,
+        })
+        this.listData()
+    },
+    onPullDownRefresh() {
+        this.setData({
+            pageNumber: 1,
+            list: []
+        })
+        this.listData()
+    },
+    onReachBottom() {
+        this.data.pageNumber++
+        this.setData({
+            pageNumber: this.data.pageNumber,
+        })
+        this.listData()
+    },
 })

+ 225 - 217
Eservice/workerLeader/editworkOrderDetail/index.js

@@ -4,230 +4,238 @@ import Dialog from 'tdesign-miniprogram/dialog/index';
 // pages/workOrderDetail/index.js
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    workLeaderDialog: false,
-    showTeams: false,
-    teams: []
-  },
-  async mainData() {
-    const res = await api._post({
-      "id": "20230208140103",
-      "content": {
-        nocache: true,
-        "sa_workorderid": this.data.id
-      }
-    })
-    this.setData({
-      billData: res.data
-    })
-    this.workerData()
-  },
-  changeBillStatus(e) {
-    const {
-      id,
-      name
-    } = e.target.dataset;
-    if (!name) return;
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: `是否确定${name}当前工单?`,
-      confirmBtn: name,
-      cancelBtn: '取消',
-    }
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        workLeaderDialog: false,
+        showTeams: false,
+        teams: []
+    },
+    async mainData() {
         const res = await api._post({
-          "id": id,
-          "content": {
-            "sa_workorderid": this.data.id
-          }
+            "id": "20230208140103",
+            "content": {
+                nocache: true,
+                "sa_workorderid": this.data.id
+            }
         })
-        wx.showToast({
-          title: res.msg == '成功' ? `工单${name}成功` : res.msg,
-          icon: "none",
-          mask: true
-        });
-        if (name == '作废') {
-          setTimeout(() => {
-            wx.navigateBack()
-          }, 500);
-        } else {
-          this.mainData()
+        console.log("详情", res)
+        if (this.data.billData) {
+            let userid = wx.getStorageSync('userMsg').userid;
+            let item = this.data.billData;
+            if (!item.team.some(v => v.userid == userid) && res.data.team.some(v => v.userid == userid)) wx.redirectTo({
+                url: '/Eservice/workOrderDetail/index' + '?id=' + item.sa_workorderid,
+            })
+        }
+        this.setData({
+            billData: res.data
+        })
+        this.workerData()
+    },
+    changeBillStatus(e) {
+        const {
+            id,
+            name
+        } = e.target.dataset;
+        if (!name) return;
+        const dialogConfig = {
+            context: this,
+            title: '提示',
+            content: `是否确定${name}当前工单?`,
+            confirmBtn: name,
+            cancelBtn: '取消',
         }
-      })
-      .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 {}
+        Dialog.confirm(dialogConfig)
+            .then(async () => {
+                const res = await api._post({
+                    "id": id,
+                    "content": {
+                        "sa_workorderid": this.data.id
+                    }
+                })
+                wx.showToast({
+                    title: res.msg == '成功' ? `工单${name}成功` : res.msg,
+                    icon: "none",
+                    mask: true
+                });
+                if (name == '作废') {
+                    setTimeout(() => {
+                        wx.navigateBack()
+                    }, 500);
+                } else {
+                    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 {}
 
-  },
-  toConfirmBill(data) {
-    if (this.data.billData.type === '安装培训') {
-      wx.navigateTo({
-        url: '/Eservice/trainConfirmBill/index?class=stopClick&id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid,
-      })
-    }
-  },
-  async confirmBillList() {
-    const res = await api._post({
-      "id": "20230211105903",
-      "content": {
-        "where": {
-          nocahce: true,
-          "condition": "",
-          "sa_workorderid": this.data.id
+    },
+    toConfirmBill(data) {
+        if (this.data.billData.type === '安装培训') {
+            wx.navigateTo({
+                url: '/Eservice/trainConfirmBill/index?class=stopClick&id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid,
+            })
         }
-      }
-    })
-    this.setData({
-      confirmBills: res.data
-    })
-  },
-  toWorkConfirmInfo() {
-    getApp().globalData.handelSelect = this
-    wx.navigateTo({
-      url: '/Eservice/workBillConfirmInfo/index?class=stopClick'
-    })
-  },
-  async workerData() {
-    const res = await api._post({
-      "id": "20230213143003",
-      "version": 1,
-      "content": {
-        "where": {
-          "condition": ""
+    },
+    async confirmBillList() {
+        const res = await api._post({
+            "id": "20230211105903",
+            "content": {
+                "where": {
+                    nocahce: true,
+                    "condition": "",
+                    "sa_workorderid": this.data.id
+                }
+            }
+        })
+        this.setData({
+            confirmBills: res.data
+        })
+    },
+    toWorkConfirmInfo() {
+        getApp().globalData.handelSelect = this
+        wx.navigateTo({
+            url: '/Eservice/workBillConfirmInfo/index?class=stopClick'
+        })
+    },
+    async workerData() {
+        const res = await api._post({
+            "id": "20230213143003",
+            "version": 1,
+            "content": {
+                "where": {
+                    "condition": ""
+                }
+            }
+        })
+        this.setData({
+            workers: res.data
+        })
+    },
+    /**
+     * 开始添加成员或者取消添加
+     */
+    showTeamDialog() {
+        this.setData({
+            showTeams: !this.data.showTeams,
+            teams: this.data.billData.team.map(v => {
+                return v.isleader == 1 ? 0 : v.userid
+            })
+        })
+    },
+    /**
+     * 选择添加成员
+     */
+    selectTeams(e) {
+        const {
+            userid
+        } = e.currentTarget.dataset.item;
+        let teams = this.data.teams;
+        let i = teams.findIndex(v => v == userid);
+        if (i != -1) {
+            teams = teams.filter(v => v != userid)
+        } else {
+            teams.push(userid)
         }
-      }
-    })
-    this.setData({
-      workers: res.data
-    })
-  },
-  /**
-   * 开始添加成员或者取消添加
-   */
-  showTeamDialog() {
-    this.setData({
-      showTeams: !this.data.showTeams,
-      teams: this.data.billData.team.map(v => {
-        return v.isleader == 1 ? 0 : v.userid
-      })
-    })
-  },
-  /**
-   * 选择添加成员
-   */
-  selectTeams(e) {
-    const {
-      userid
-    } = e.currentTarget.dataset.item;
-    let teams = this.data.teams;
-    let i = teams.findIndex(v => v == userid);
-    if (i != -1) {
-      teams = teams.filter(v => v != userid)
-    } else {
-      teams.push(userid)
-    }
-    this.setData({
-      teams
-    })
-  },
-  addUser() {
-    api._post({
-      "id": 20220930103603,
-      "content": {
-        ownertable: 'sa_workorder',
-        ownerid: this.data.billData.sa_workorderid,
-        "userids": this.data.teams,
-        "justuserids": 1
-      }
-    }).then(res => {
-      console.log("添加成员", res)
-      wx.showToast({
-        title: res.msg == '成功' ? '修改成功' : res.msg,
-        icon: "none",
-        mask: true
-      });
-      if (res.msg == '成功') {
-        this.mainData()
-        this.showTeamDialog()
-      }
-    })
+        this.setData({
+            teams
+        })
+    },
+    addUser() {
+        api._post({
+            "id": 20220930103603,
+            "content": {
+                ownertable: 'sa_workorder',
+                ownerid: this.data.billData.sa_workorderid,
+                "userids": this.data.teams,
+                "justuserids": 1
+            }
+        }).then(res => {
+            console.log("添加成员", res)
+            wx.showToast({
+                title: res.msg == '成功' ? '修改成功' : res.msg,
+                icon: "none",
+                mask: true
+            });
+            if (res.msg == '成功') {
+                this.mainData()
+                this.showTeamDialog()
+            }
+        })
+
+    },
+    showWorkerDialog() {
+        this.setData({
+            workLeaderDialog: !this.data.workLeaderDialog
+        })
+    },
+    selectLeader(data) {
+        this.setData({
+            actLeader: data.currentTarget.dataset.item
+        })
+    },
+    async toWorker() {
+        if (!this.data.actLeader) {
+            wx.showToast({
+                title: '未选择负责人',
+                icon: 'none'
+            })
+        } else {
+            /* this.data.billData.projectlearders = [this.data.actLeader.userid]
+            const res = await api._post({
+              "id": "20230208140003",
+              "content": this.data.billData
+            }) */
 
-  },
-  showWorkerDialog() {
-    this.setData({
-      workLeaderDialog: !this.data.workLeaderDialog
-    })
-  },
-  selectLeader(data) {
-    this.setData({
-      actLeader: data.currentTarget.dataset.item
-    })
-  },
-  async toWorker() {
-    if (!this.data.actLeader) {
-      wx.showToast({
-        title: '未选择负责人',
-        icon: 'none'
-      })
-    } else {
-      /* this.data.billData.projectlearders = [this.data.actLeader.userid]
-      const res = await api._post({
-        "id": "20230208140003",
-        "content": this.data.billData
-      }) */
+            const res = await api._post({
+                "id": "20220930103703",
+                "content": {
+                    ownertable: 'sa_workorder',
+                    ownerid: this.data.billData.sa_workorderid,
+                    "userid": this.data.actLeader.userid
+                }
+            })
 
-      const res = await api._post({
-        "id": "20220930103703",
-        "content": {
-          ownertable: 'sa_workorder',
-          ownerid: this.data.billData.sa_workorderid,
-          "userid": this.data.actLeader.userid
+            this.setData({
+                workLeaderDialog: false
+            })
+            if (res.msg != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            });
+            this.mainData()
+            // this.confirmBillList()
         }
-      })
-
-      this.setData({
-        workLeaderDialog: false
-      })
-      if (res.msg != '成功') return wx.showToast({
-        title: res.msg,
-        icon: "none"
-      });
-      this.mainData()
-      // this.confirmBillList()
-    }
-  },
-  onLoad(options) {
-    this.setData({
-      id: options.id
-    })
-  },
-  onShow() {
-    this.mainData()
-    this.confirmBillList()
-  },
+    },
+    onLoad(options) {
+        this.setData({
+            id: options.id
+        })
+    },
+    onShow() {
+        this.mainData()
+        this.confirmBillList()
+    },
 })