| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 | 
							- // pages/agent/addServiceBill/index.js
 
- import api from '../../api/api'
 
- import data from './formData'
 
- Page({
 
-   /**
 
-    * 页面的初始数据
 
-    */
 
-   data: {
 
-     data,
 
-     form:{
 
-       "sa_serviceorderid":0,     //sa_brandid<=0时 为新增
 
-       "servicetype":"0",
 
-       "sa_orderid":0,
 
-       "remarks":"",
 
-       "class1":"",
 
-       "class2":"",
 
-       "reason":"",
 
-       "province":"",
 
-       "city":"",
 
-       "county":"",
 
-       "address":"",
 
-       "scenecontact":"",
 
-       "scenecontactrole":"",
 
-       "scenecontactphonenumber":"",
 
-       "billdate":"",
 
-       "begdate":"",
 
-       "enddate":""
 
-     }
 
-   },
 
-   async onClick (data) {
 
-     this.data.form = Object.assign({},this.data.form,data.detail)
 
-     const res = await api._post({
 
-       "id": "20230206091403",
 
-       "version":1,
 
-       "content": this.data.form
 
-     })
 
-     const rs = await api._post({
 
-       "classname": "system.attachment.Attachment",
 
-       "method": "createFileLink",
 
-       "content": {
 
-         "ownertable": "sa_serviceorder",
 
-         "ownerid": res.data.sa_serviceorderid,
 
-         "usetype": "附件",
 
-         "attachmentids": data.detail.attachmentids
 
-       }
 
-     })
 
-     if (res.code === 0) return wx.showToast({
 
-       title: res.msg,
 
-       duration: 3000,
 
-       icon: 'none',
 
-     })
 
-     wx.navigateBack({
 
-       delta:0
 
-     })
 
-   },
 
-   /**
 
-    * 生命周期函数--监听页面加载
 
-    */
 
-   onLoad(options) {
 
-     let that = this
 
-     let obj = getApp().globalData.handelSelect.data.orderMainData
 
-     that.data.form = Object.assign({},this.data.form,obj)
 
-     Object.keys(that.data.form).map((key,index)=>{
 
-       // console.log(key)
 
-       that.data.data.formLayout.formInfo.forEach(e=>{
 
-         if (e.id === 'servicetype') {
 
-           if (e.inputValue === '售前' || e.inputValue === '历史售后') {
 
-             console.log(e)
 
-             if (e.id === 'sa_orderid') {
 
-               console.log(e)
 
-               // e.force = false
 
-             }
 
-           }
 
-         }
 
-         if (e.id === key) {
 
-           e.inputValue = obj[key]
 
-         }
 
-         if (e.id === 'provinceArr') {
 
-           e.inputValue = `${obj.province},${obj.city},${obj.county}`
 
-         }
 
-       })
 
-     })
 
-     that.setData({
 
-       data:that.data.data
 
-     })
 
-   },
 
-   /**
 
-    * 生命周期函数--监听页面初次渲染完成
 
-    */
 
-   onReady() {
 
-   },
 
-   /**
 
-    * 生命周期函数--监听页面显示
 
-    */
 
-   onShow() {
 
-   },
 
-   /**
 
-    * 生命周期函数--监听页面隐藏
 
-    */
 
-   onHide() {
 
-     this.compData = this.selectComponent("#form")
 
-     // this.compData.setObjectData(this.compData.data.formLayoutData.formInfo)
 
-   },
 
-   /**
 
-    * 生命周期函数--监听页面卸载
 
-    */
 
-   onUnload() {
 
-     getApp().globalData.pageData = null
 
-   },
 
-   /**
 
-    * 页面相关事件处理函数--监听用户下拉动作
 
-    */
 
-   onPullDownRefresh() {
 
-   },
 
-   /**
 
-    * 页面上拉触底事件的处理函数
 
-    */
 
-   onReachBottom() {
 
-   },
 
-   /**
 
-    * 用户点击右上角分享
 
-    */
 
-   onShareAppMessage() {
 
-   }
 
- })
 
 
  |