zhaoxiaohai 2 years ago
parent
commit
5ba4045a29

+ 98 - 102
Eservice/agent/addServiceBill/index.js

@@ -3,117 +3,113 @@ 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",
-      "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
-      }
-    })
-    wx.navigateBack({
-      delta:0
-    })
-  },
-  // setDefaultData () {
-  //   let that = this
-  //   this.data.data.formLayout.formInfo.forEach(e=>{
-  //     Object.keys(that.data.form).map((key,index)=>{
-  //       if (e.id === key) {
-  //         e.inputValue = that.data.form[key]
-  //       }
-  //     })
-  //   })
-  //   this.setData({
-  //     data:this.data.data
-  //   })
-  // },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-  },
+    /**
+     * 页面的初始数据
+     */
+    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": "",
+        }
+    },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
+    async onClick(data) {
+        this.data.form = Object.assign({}, this.data.form, data.detail)
+        const res = await api._post({
+            "id": "20230206091403",
+            "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
+            }
+        })
+        wx.navigateBack({
+            delta: 0
+        })
+    },
+    // setDefaultData () {
+    //   let that = this
+    //   this.data.data.formLayout.formInfo.forEach(e=>{
+    //     Object.keys(that.data.form).map((key,index)=>{
+    //       if (e.id === key) {
+    //         e.inputValue = that.data.form[key]
+    //       }
+    //     })
+    //   })
+    //   this.setData({
+    //     data:this.data.data
+    //   })
+    // },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {},
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-  },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {},
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-    this.compData = this.selectComponent("#form")
-    // this.compData.setObjectData(this.compData.data.formLayoutData.formInfo)
-  },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+        this.compData = this.selectComponent("#form")
+        // this.compData.setObjectData(this.compData.data.formLayoutData.formInfo)
+    },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-    getApp().globalData.pageData = null
-  },
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+        getApp().globalData.pageData = null
+    },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
 
-  },
+    },
 
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
 
-  },
+    },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
 
-  }
+    }
 })

+ 0 - 2
Eservice/agent/editServiceBill/index.js

@@ -30,9 +30,7 @@ Page({
   },
 
   async onClick (data) {
-    console.log(this.data.form,'---')
     this.data.form = Object.assign({},this.data.form,data.detail)
-    console.log(this.data.form)
     const res = await api._post({
       "id": "20230206091403",
       "version":1,

+ 2 - 2
Eservice/agent/serviceBillDetail/index.js

@@ -1,6 +1,6 @@
 // pages/agent/serviceBillDetail/index.js
 import api from '../../api/api'
-// import Dialog from 'tdesign-miniprogram/dialog/index';
+import Dialog from 'tdesign-miniprogram/dialog/index';
 Page({
 
   /**
@@ -126,7 +126,7 @@ Page({
     const dialogConfig = {
       context: this,
       title: '提示',
-      content: '确认提交当前申请单吗',
+      content: '确认删除当前申请单吗',
       confirmBtn: '确定',
       cancelBtn: '取消',
     };

+ 74 - 68
Eservice/agent/serviceBillDetail/index.wxml

@@ -1,91 +1,97 @@
 <!--pages/agent/serviceBillDetail/index.wxml-->
 <view class="panel mt-5">
-  <view class="flex-align-start">
-    <view style="flex:1">
-      <view class="mt-5">
-        <text class="colorInfo small">服务单号:</text>
-        <text class="billno">{{orderMainData.billno}}</text>
-      </view>
-      <view class="mt-5">
-        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.servicetype}}</t-tag>
-        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class1}}</t-tag>
-        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class2}}</t-tag>
-      </view>
-    </view>
-    <view class="flex-align-center" wx:if="{{orderMainData.status === '新建'}}" >
-      <!-- <view class="mr-10">
+    <view class="flex-align-start">
+        <view style="flex:1">
+            <view class="mt-5">
+                <text class="colorInfo small">服务单号:</text>
+                <text class="billno">{{orderMainData.billno}}</text>
+            </view>
+            <view class="mt-5">
+                <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.servicetype}}</t-tag>
+                <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class1}}</t-tag>
+                <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class2}}</t-tag>
+            </view>
+        </view>
+        <view class="flex-align-center" wx:if="{{orderMainData.status === '新建'}}">
+            <!-- <view class="mr-10">
         <t-icon name="root-list" size="36rpx" bind:click="onIconTap" />
         <text style="font-size: 20rpx;">转工单</text>
       </view> -->
-      <view class="mr-10" bindtap="onSubmit">
-        <t-icon name="root-list" size="36rpx" bind:click="onIconTap" />
-        <text style="font-size: 20rpx;">提交</text>
-      </view>
-      <view class="mr-10" bindtap="onEdit">
-        <t-icon name="edit" size="36rpx" bind:click="onIconTap" />
-        <text style="font-size: 20rpx;">编辑</text>
-      </view>
-      <view bindtap="onDelete">
-        <t-icon name="delete" size="36rpx" bind:click="onIconTap" />
-        <text style="font-size: 20rpx;">删除</text>
-      </view>
+            <view class="mr-10" bindtap="onSubmit">
+                <t-icon name="root-list" size="36rpx" bind:click="onIconTap" />
+                <text style="font-size: 20rpx;">提交</text>
+            </view>
+            <view class="mr-10" bindtap="onEdit">
+                <t-icon name="edit" size="36rpx" bind:click="onIconTap" />
+                <text style="font-size: 20rpx;">编辑</text>
+            </view>
+            <view bindtap="onDelete">
+                <t-icon name="delete" size="36rpx" bind:click="onIconTap" />
+                <text style="font-size: 20rpx;">删除</text>
+            </view>
+        </view>
     </view>
-  </view>
-  <view class="small"><text class="label">服务单类型:</text>{{orderMainData.servicetype}}</view>
-  <view class="small"><text class="label">服务单状态:</text>{{orderMainData.status}}</view>
-  <view class="small"><text class="label">开始日期:</text>{{orderMainData.begdate}}</view>
-  <view class="small"><text class="label">结束日期:</text>{{orderMainData.enddate}}</view>
+    <view class="small"><text class="label">服务单类型:</text>{{orderMainData.servicetype}}</view>
+    <view class="small"><text class="label">服务单状态:</text>{{orderMainData.status}}</view>
+    <view class="small"><text class="label">开始日期:</text>{{orderMainData.begdate}}</view>
+    <view class="small"><text class="label">结束日期:</text>{{orderMainData.enddate}}</view>
 </view>
 <!-- <view style="padding:5px" class="small"><text class="label">现场联系人</text></view> -->
 
 <view class="panel mt-5">
-  <view>
-    <view class="small"><text class="label">姓名:</text>{{orderMainData.scenecontact}}</view>
-    <view class="small flex-align-center">
-      <text class="label">电话:</text>
-      <t-call phone="{{orderMainData.scenecontactphonenumber}}"></t-call>
+    <view>
+        <view class="small"><text class="label">姓名:</text>{{orderMainData.scenecontact}}</view>
+        <view class="small flex-align-center">
+            <text class="label">电话:</text>
+            <t-call phone="{{orderMainData.scenecontactphonenumber}}"></t-call>
+        </view>
+        <view class="small"><text class="label">岗位:</text>{{orderMainData.scenecontactrole}}</view>
+        <view class="small"><text class="label">省市县:</text>{{orderMainData.province + orderMainData.city+orderMainData.county}}</view>
+        <view class="small"><text class="label">地址:</text>{{orderMainData.address}}</view>
     </view>
-    <view class="small"><text class="label">岗位:</text>{{orderMainData.scenecontactrole}}</view>
-  </view>
 </view>
 <!-- <view style="padding:5px" class="small"><text class="label">关联订单</text></view> -->
 <view class="panel mt-5" wx:if="{{orderMainData.sonum}}">
-  <text class="label">关联订单:</text>{{orderMainData.sonum}}
+    <text class="label">关联订单:</text>{{orderMainData.sonum}}
 </view>
 
 <view class="panel mt-5">
-  <view class="small">
-    <text class="label">问题描述:</text>{{orderMainData.reason}}
-  </view>
+    <view class="small">
+        <text class="label">问题描述:</text>{{orderMainData.reason}}
+    </view>
 
 </view>
 <view class="panel mt-5">
-  <view class="small"><text class="label">附件信息:</text></view>
-  <imageview wx:if="{{filelist.length > 0}}" list="{{filelist}}"></imageview>
+    <view class="small"><text class="label">附件信息:</text></view>
+    <imageview wx:if="{{filelist.length > 0}}" list="{{filelist}}"></imageview>
 </view>
 <view>
-  <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
-    <t-tab-panel label="关联工单" value="0">
-      <t-cell wx:for="{{linkWorkOrders}}" wx:key="sa_serviceorderid" title="工单编号" note="{{item.billno}}" data-item="{{item}}" bind:click="tolinkWorkOrder" hover arrow />
-    </t-tab-panel>
-    <t-tab-panel wx:if="{{orderMainData.servicetype !== '售前' && orderMainData.servicetype !== '历史售后'}}" label="售后商品" value="1">
-      <view style="padding:10px" wx:if="{{list.length === 0}}">
-        <t-empty icon="cart" description="暂未添加商品">
-          <t-button slot="action" theme="primary" size="extra-small" bindtap="addProduct">前往添加</t-button>
-        </t-empty>
-      </view>
-      <view wx:else>
-        <view style="text-align: right;border:1px solid #f1f2f3">
-          <t-button theme="primary" size="small" icon="add" variant="text"  bindtap="addProduct">
-          继续添加
-          </t-button>
-        </view>
-        <view wx:for="{{list}}" wx:key="{{itemid}}">
-          <product-card data="{{item}}" isdelete="{{true}}" bind:delete="onDelete"></product-card>
-        </view>
-        
-      </view>
-    </t-tab-panel>
-  </t-tabs>
+    <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
+        <t-tab-panel label="关联工单" value="0">
+            <t-cell wx:for="{{linkWorkOrders}}" wx:key="sa_serviceorderid" title="工单编号" note="{{item.billno}}" data-item="{{item}}" bind:click="tolinkWorkOrder" hover arrow />
+            <block wx:if="{{linkWorkOrders.length==0}}">
+                <Yl_Empty />
+                <view style="height: 50px;" />
+            </block>
+        </t-tab-panel>
+        <t-tab-panel wx:if="{{orderMainData.servicetype !== '售前' && orderMainData.servicetype !== '历史售后'}}" label="售后商品" value="1">
+            <view style="padding:10px" wx:if="{{list.length === 0}}">
+                <t-empty icon="cart" description="暂未添加商品">
+                    <t-button slot="action" theme="primary" size="extra-small" bindtap="addProduct">前往添加</t-button>
+                </t-empty>
+            </view>
+            <view wx:else>
+                <view style="text-align: right;border:1px solid #f1f2f3">
+                    <t-button theme="primary" size="small" icon="add" variant="text" bindtap="addProduct">
+                        继续添加
+                    </t-button>
+                </view>
+                <view wx:for="{{list}}" wx:key="{{itemid}}">
+                    <product-card data="{{item}}" isdelete="{{true}}" bind:delete="onDelete"></product-card>
+                </view>
+
+            </view>
+        </t-tab-panel>
+    </t-tabs>
 </view>
-<t-dialog id="t-dialog" />
+<t-dialog id="t-dialog" />

+ 4 - 5
Eservice/agent/serviceBillList/index.js

@@ -16,7 +16,7 @@ Page({
                 "isadmin": false,
                 "where": {
                     "condition": "",
-                    "status": "待指派"
+                    "status": "新建"
                 }
             }
         }
@@ -28,9 +28,6 @@ Page({
                 list: this.data.list.concat(res.data)
             })
         } else {
-            this.setData({
-                list: []
-            })
             wx.showToast({
                 title: '没有更多了!',
                 duration: 2000,
@@ -44,7 +41,9 @@ Page({
         })
     },
     onTabsChange(data) {
-        console.log(data)
+        this.setData({
+            list:[]
+        })
         this.data.param.content.where.status = data.detail.value
         this.onPullDownRefresh()
     },

+ 32 - 37
Eservice/agent/serviceBillList/index.wxml

@@ -1,41 +1,36 @@
 <!--pages/agent/serviceBillList/index.wxml-->
-<t-tabs defaultValue="待指派" bind:change="onTabsChange" t-class="custom-tabs">
-  <t-tab-panel label="待指派" value="待指派" />
-  <t-tab-panel label="待处理" value="待处理" />
-  <t-tab-panel label="进行中" value="进行中" />
-  <t-tab-panel label="已完成" value="已完成" />
+<t-tabs defaultValue="新建" bind:change="onTabsChange" t-class="custom-tabs">
+    <t-tab-panel label="新建" value="新建" />
+    <t-tab-panel label="待指派" value="待指派" />
+    <t-tab-panel label="待处理" value="待处理" />
+    <t-tab-panel label="进行中" value="进行中" />
+    <t-tab-panel label="已完成" value="已完成" />
 </t-tabs>
-<t-pull-down-refresh
-  value="{{baseRefresh.value}}"
-  loadingProps="{{loadingProps}}"
-  loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}"
-  bind:refresh="onPullDownRefresh"
-  bind:scrolltolower="onReachBottom"
->
-<view style="padding:10px">
-  <t-card url="{{'/Eservice/agent/serviceBillDetail/index?id=' + item.sa_serviceorderid}}" wx:for="{{list}}" wx:key="sa_serviceorderid">
-    <view style="flex:1"  slot="content">
-      <view class="flex-align-center flex-between card__header">
-        <view>
-          <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.servicetype}}</t-tag>
-          <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.class1}}</t-tag>
-          <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.class2}}</t-tag>
-        </view>
-        <text>{{item.status}}</text>
-      </view>
-      <view class="card__body">
-        <view>服务地址:{{item.province}}{{item.city}}{{item.county}}{{item.address}}</view>
-        <view style="margin-top:3px">
-          <!-- <view class="colorInfo small">关联订单:{{item.sonum}}</view> -->
-          <view class="colorInfo small">申请单号:{{item.billno}}</view>
-          <view class="colorInfo small">
-            <text class="mr-5">现场联系人:{{item.scenecontact}}</text><text class="mr-5">{{item.scenecontactrole}}</text><text class="mr-5">{{item.scenecontactphonenumber}}</text>
-          </view>
-        </view>
-      </view>
+<t-pull-down-refresh value="{{baseRefresh.value}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scrolltolower="onReachBottom">
+    <view style="padding:10px">
+        <t-card url="{{'/Eservice/agent/serviceBillDetail/index?id=' + item.sa_serviceorderid}}" wx:for="{{list}}" wx:key="sa_serviceorderid">
+            <view style="flex:1" slot="content">
+                <view class="flex-align-center flex-between card__header">
+                    <view>
+                        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.servicetype}}</t-tag>
+                        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.class1}}</t-tag>
+                        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.class2}}</t-tag>
+                    </view>
+                    <text>{{item.status}}</text>
+                </view>
+                <view class="card__body">
+                    <view>服务地址:{{item.province}}{{item.city}}{{item.county}}{{item.address}}</view>
+                    <view style="margin-top:3px">
+                        <!-- <view class="colorInfo small">关联订单:{{item.sonum}}</view> -->
+                        <view class="colorInfo small">申请单号:{{item.billno}}</view>
+                        <view class="colorInfo small">
+                            <text class="mr-5">现场联系人:{{item.scenecontact}}</text><text class="mr-5">{{item.scenecontactrole}}</text><text class="mr-5">{{item.scenecontactphonenumber}}</text>
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </t-card>
+        <Yl_Empty wx:if="{{!list.length}}" />
+        <t-fab icon="add" style="position:fixed;right:16px;bottom:72px" bind:click="handleClick" aria-label="增加"></t-fab>
     </view>
-  </t-card>
-  <Yl_Empty wx:if="{{!list.length}}" />
-  <t-fab icon="add" style="position:fixed;right:16px;bottom:72px" bind:click="handleClick" aria-label="增加"></t-fab>
-</view>
 </t-pull-down-refresh>

+ 218 - 220
Eservice/components/form/form.js

@@ -4,238 +4,236 @@ import util from '../../../utils/util'
 
 const app = getApp()
 Component({
-  /**
-   * 组件的属性列表
-   */
-  options: {
-    multipleSlots: true // 复数插槽: 是
-  },
-  properties: {
-    formLayoutData:{
-      value:{},
-      type:Object
-    }
-  },
-
-  /**
-   * 组件的初始数据
-   */
-  data: {
-    pickerVisible:false,
-    dateVisible:false,
-    cascaderVisible:false,
-    disabledStatus:false,
-    pickerIndex:0,
-    timePickerValue:'',
-    actPicker:{},
-    options:[]
-  },
-  
-  /**
-   * 组件的方法列表
-   */
-  lifetimes:{
-    created(){
+    /**
+     * 组件的属性列表
+     */
+    options: {
+        multipleSlots: true // 复数插槽: 是
     },
-    attached () {
-      this.getarealist()
-      getApp().globalData.formData = this
-    }
-  },
-  methods: {
-    
-    onBlur (detail) {
-
-      let data = detail.currentTarget.dataset.item
-
-      let index = detail.currentTarget.dataset.index
-
-      this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
-
-      if (data.role.formatter) {
-
-        let regStatus = data.role.formatter(detail.detail.value)
-
-        this.setErrorMsg(regStatus,index)
-      }
+    properties: {
+        formLayoutData: {
+            value: {},
+            type: Object
+        }
     },
-    onClear (detail) {
-      let index = detail.currentTarget.dataset.index
-
-      this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
-
-      this.setData({
-
-        formLayoutData:this.data.formLayoutData
 
-      })
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        pickerVisible: false,
+        dateVisible: false,
+        cascaderVisible: false,
+        disabledStatus: false,
+        pickerIndex: 0,
+        timePickerValue: '',
+        actPicker: {},
+        options: []
     },
-    onPicker (detail) {
-      let data = detail.currentTarget.dataset.item
-      this.setData({
-        pickerIndex:detail.currentTarget.dataset.index,
-        pickerVisible:true,
-        actPicker:{
-          label:data.label,
-          data:data.data
-        }
-      })
-      console.log(this.data.formLayoutData.formInfo)
-    },
-    onPickerConfirm (detail) {
-      this.data.formLayoutData.formInfo[this.data.pickerIndex].inputValue = detail.detail.value[0]
-      this.data.actPicker.data.forEach(e=>{
-        if (e.value === detail.detail.value[0]) {
-          this.data.formLayoutData.formInfo.filter(v=>{
-            if (v.id === e.hide) {
-              v.force = false
-              v.errorMsg = null,
-              v.inputValue = 0
-            }
-          })
+
+    /**
+     * 组件的方法列表
+     */
+    lifetimes: {
+        created() {},
+        attached() {
+            this.getarealist()
+            getApp().globalData.formData = this
         }
-      })
-      this.setData({
-        formLayoutData:this.data.formLayoutData
-      })
-    },
-    showDatePicker (detail) {
-      let data = detail.currentTarget.dataset.item
-      this.setData({
-        pickerIndex:detail.currentTarget.dataset.index,
-        dateVisible:true,
-        timePickerValue:data.inputValue
-      })
-    },
-    onTimePickerConfirm (detail) {
-      this.data.formLayoutData.formInfo[this.data.pickerIndex].inputValue = detail.detail.value
-      this.setData({
-        formLayoutData:this.data.formLayoutData
-      })
-    },
-    showCascader (detail) {
-      let data = detail.currentTarget.dataset.item
-      this.setData({
-        pickerIndex:detail.currentTarget.dataset.index,
-        cascaderVisible:true,
-      })
     },
+    methods: {
 
-    // onChange (detail) {
-    //   let data = detail.currentTarget.dataset.item
+        onBlur(detail) {
 
-    //   let index = detail.currentTarget.dataset.index
+            let data = detail.currentTarget.dataset.item
 
-    //   this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
+            let index = detail.currentTarget.dataset.index
 
-    //   if (data.role.formatter) {
+            this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
 
-    //     let regStatus = data.role.formatter(detail.detail.value)
-    //     this.setErrorMsg(regStatus,index)
-    //   }
-    // },
-    onChange (detail) {
-      this.data.formLayoutData.formInfo[this.data.pickerIndex].inputValue = detail.detail.selectedOptions.map(e=>{
-        return e.value
-      }).join(',')
-      this.setData({
-        formLayoutData:this.data.formLayoutData
-      })
-    },
-    validate (fn) {
-      let arr = this.data.formLayoutData.formInfo.map((e,index)=>{
-        // console.log(e)
-        if (!e.force) return e
-        console.log(e)
-      if (e.label === '关联订单') {
-        console.log(e.force && e.inputValue !== '')
-      }
-        if (e.force && e.inputValue !== '') {
-         
-          if (e.role.formatter) {
-
-            let regStatus = e.role.formatter(e.inputValue)
-    
-            this.setErrorMsg(regStatus,index)
-            
-          } else {
-
-            this.setErrorMsg('',index)
-
-          }
-
-        } else {
-          console.log(e.label)
-          this.setErrorMsg(e.label + '不能为空',index)
-        }
-        return e
-      })
+            if (data.role.formatter) {
 
-      let isValidate = !arr.some(item=>item.errorMsg && item.errorMsg !== '')
-
-      fn(isValidate)
-      
-    },
-    setErrorMsg (msg,index) {
+                let regStatus = data.role.formatter(detail.detail.value)
 
-      this.data.formLayoutData.formInfo[index].errorMsg = msg
-
-      this.setData({
-        formLayoutData:this.data.formLayoutData
-      })
-    },
-    async getarealist () {
-      const res = await api.arealist()
-      
-      this.setData({
-        options:util.createMenu(res.data)
-      })
-    },
-    
-    setObjectData (data) {
-      let that = this, obj = {}
-      that.setData({
-        disabledStatus:false
-      })
-      
-
-      that.compData = that.selectComponent("#upload")
-
-      that.compData.toSetFileData().then(e=>{
-        that.setData({
-          disabledStatus:false
-        })
-        data.forEach(e=>{
-          if (e.type === 'upload') {
-            e.inputValue = that.compData.data.attachmentids
-          }
-  
-          obj[e.id] = e.inputValue
-          
-        })
-  
-        if (obj.provinceArr) {
-          let arr = obj.provinceArr.split(",")
-          obj.province = arr[0]
-          obj.city = arr[1]
-          obj.county = arr[2]
-        }
-        that.triggerEvent("click", obj);
-      })
-
-    },
-    formSubmit () {
-      var that = this
-      console.log(this.data.formLayoutData.formInfo)
-
-      that.validate((valid) => {
-        console.log(valid)
-        if (valid) {
-          that.setObjectData(that.data.formLayoutData.formInfo)
-        } else {
-          return false;
+                this.setErrorMsg(regStatus, index)
+            }
+        },
+        onClear(detail) {
+            let index = detail.currentTarget.dataset.index
+
+            this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
+
+            this.setData({
+
+                formLayoutData: this.data.formLayoutData
+
+            })
+        },
+        onPicker(detail) {
+            let data = detail.currentTarget.dataset.item
+            this.setData({
+                pickerIndex: detail.currentTarget.dataset.index,
+                pickerVisible: true,
+                actPicker: {
+                    label: data.label,
+                    data: data.data
+                }
+            })
+            console.log(this.data.formLayoutData.formInfo)
+        },
+        onPickerConfirm(detail) {
+            this.data.formLayoutData.formInfo[this.data.pickerIndex].inputValue = detail.detail.value[0]
+            this.data.actPicker.data.forEach(e => {
+                if (e.value === detail.detail.value[0]) {
+                    this.data.formLayoutData.formInfo.filter(v => {
+                        if (v.id === e.hide) {
+                            v.force = false
+                            v.errorMsg = null,
+                                v.inputValue = 0
+                        }
+                    })
+                }
+            })
+            this.setData({
+                formLayoutData: this.data.formLayoutData
+            })
+        },
+        showDatePicker(detail) {
+            let data = detail.currentTarget.dataset.item
+            this.setData({
+                pickerIndex: detail.currentTarget.dataset.index,
+                dateVisible: true,
+                timePickerValue: data.inputValue
+            })
+        },
+        onTimePickerConfirm(detail) {
+            this.data.formLayoutData.formInfo[this.data.pickerIndex].inputValue = detail.detail.value
+            this.setData({
+                formLayoutData: this.data.formLayoutData
+            })
+        },
+        showCascader(detail) {
+            let data = detail.currentTarget.dataset.item
+            this.setData({
+                pickerIndex: detail.currentTarget.dataset.index,
+                cascaderVisible: true,
+            })
+        },
+
+        // onChange (detail) {
+        //   let data = detail.currentTarget.dataset.item
+
+        //   let index = detail.currentTarget.dataset.index
+
+        //   this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
+
+        //   if (data.role.formatter) {
+
+        //     let regStatus = data.role.formatter(detail.detail.value)
+        //     this.setErrorMsg(regStatus,index)
+        //   }
+        // },
+        onChange(detail) {
+            this.data.formLayoutData.formInfo[this.data.pickerIndex].inputValue = detail.detail.selectedOptions.map(e => {
+                return e.value
+            }).join(',')
+            this.setData({
+                formLayoutData: this.data.formLayoutData
+            })
+        },
+        validate(fn) {
+            let arr = this.data.formLayoutData.formInfo.map((e, index) => {
+                // console.log(e)
+                if (!e.force) return e
+                console.log(e)
+                if (e.label === '关联订单') {
+                    console.log(e.force && e.inputValue !== '')
+                }
+                if (e.force && e.inputValue !== '') {
+
+                    if (e.role.formatter) {
+
+                        let regStatus = e.role.formatter(e.inputValue)
+
+                        this.setErrorMsg(regStatus, index)
+
+                    } else {
+
+                        this.setErrorMsg('', index)
+
+                    }
+
+                } else {
+                    console.log(e.label)
+                    this.setErrorMsg(e.label + '不能为空', index)
+                }
+                return e
+            })
+
+            let isValidate = !arr.some(item => item.errorMsg && item.errorMsg !== '')
+
+            fn(isValidate)
+
+        },
+        setErrorMsg(msg, index) {
+
+            this.data.formLayoutData.formInfo[index].errorMsg = msg
+
+            this.setData({
+                formLayoutData: this.data.formLayoutData
+            })
+        },
+        async getarealist() {
+            const res = await api.arealist()
+
+            this.setData({
+                options: util.createMenu(res.data)
+            })
+        },
+
+        setObjectData(data) {
+            let that = this,
+                obj = {}
+            that.setData({
+                disabledStatus: false
+            })
+
+
+            that.compData = that.selectComponent("#upload")
+
+            that.compData.toSetFileData().then(e => {
+                that.setData({
+                    disabledStatus: false
+                })
+                data.forEach(e => {
+                    if (e.type === 'upload') {
+                        e.inputValue = that.compData.data.attachmentids
+                    }
+
+                    obj[e.id] = e.inputValue
+
+                })
+
+                if (obj.provinceArr) {
+                    let arr = obj.provinceArr.split(",")
+                    obj.province = arr[0]
+                    obj.city = arr[1]
+                    obj.county = arr[2]
+                }
+                that.triggerEvent("click", obj);
+            })
+
+        },
+        formSubmit() {
+            var that = this
+            that.validate((valid) => {
+                console.log(valid)
+                if (valid) {
+                    that.setObjectData(that.data.formLayoutData.formInfo)
+                } else {
+                    return false;
+                }
+            });
         }
-      });
     }
-  }
-})
+})

+ 1 - 1
Eservice/components/form/form.wxml

@@ -49,7 +49,7 @@
       </view>
     </t-input>
     <!-- 选择 -->
-    <t-cell wx:if="{{item.type == 'picker'}}" required="{{item.force}}" note="{{item.inputValue == 1?'是':item.inputValue == 0?'':item.inputValue}}" class="block" title="{{item.label}}" data-index="{{index}}" data-item="{{item}}" arrow hover bind:click="onPicker" >
+    <t-cell wx:if="{{item.type == 'picker'}}" required="{{item.force}}" note="{{item.inputValue == 1?'是':item.inputValue == 0?'请选择':item.inputValue}}" class="block" title="{{item.label}}" data-index="{{index}}" data-item="{{item}}" arrow hover bind:click="onPicker" >
       <text slot="description" class="t-class-description">{{item.errorMsg?item.errorMsg:''}}</text>
     </t-cell>
     <!-- 上传 -->

+ 1 - 1
Eservice/saler/serviceBillDetail/index.js

@@ -1,6 +1,6 @@
 // pages/agent/serviceBillDetail/index.js
 import api from '../../api/api'
-// import Dialog from 'tdesign-miniprogram/dialog/index';
+import Dialog from 'tdesign-miniprogram/dialog/index';
 Page({
 
   /**

+ 1 - 1
Eservice/workOrderDetail/index.js

@@ -1,5 +1,5 @@
 const api = require("../api/api")
-// import Dialog from 'tdesign-miniprogram/dialog/index';
+import Dialog from 'tdesign-miniprogram/dialog/index';
 
 // pages/workOrderDetail/index.js
 Page({

+ 1 - 1
Eservice/workerLeader/editworkOrderDetail/index.js

@@ -1,5 +1,5 @@
 const api = require("../../api/api");
-// import Dialog from 'tdesign-miniprogram/dialog/index';
+import Dialog from 'tdesign-miniprogram/dialog/index';
 
 // pages/workOrderDetail/index.js
 Page({

+ 1 - 1
Eservice/workerLeader/serviceBillDetail/index.js

@@ -1,6 +1,6 @@
 // pages/agent/serviceBillDetail/index.js
 import api from '../../api/api'
-// import Dialog from 'tdesign-miniprogram/dialog/index';
+import Dialog from 'tdesign-miniprogram/dialog/index';
 Page({
 
   /**

+ 74 - 71
packageA/toolBill/detail.js

@@ -16,7 +16,7 @@ Page({
 			}
 			return value;
 		},
-		show:false,
+		show: false,
 		tabsList: [{
 			label: "详细信息",
 			icon: "icon-tabchanpin"
@@ -51,19 +51,18 @@ Page({
 			let tabbarsList = []
 			if (res.data.status == '新建') tabbarsList = [{
 				label: "编辑",
-            	icon: "icon-dibu-bianji"
-			},{
+				icon: "icon-dibu-bianji"
+			}, {
 				label: "提交",
-            	icon: "icon-tijiao",
-			},{
+				icon: "icon-tijiao",
+			}, {
 				label: "删除",
 				icon: "icon-guanlian-shanchu"
 			}]
 			if (res.data.status == '提交') tabbarsList = [{
 				label: "取消提交",
 				icon: "icon-tabgenjinjilu"
-			}
-			]
+			}]
 			if (res.data.status == '审核') tabbarsList = []
 
 			this.setPreview(res.data);
@@ -78,28 +77,29 @@ Page({
 	/* 设置详情信息 */
 	setPreview(data) {
 		let list1 = [{
-				label: "单号",
-				value: data.billno
-			}, {
-				label: "单据日期",
-				value: data.billdate
-			}, {
-				label: "状态",
-				value: data.status
-			},
-			{
-				label:'是否实物返回',
-				value:data.isitemreturn ? '是' : '否'
-			}, {
-				label: "提交日期",
-				value: data.submitdate
-			},{
-				label: "审核日期",
-				value: data.checkdate
-			}, {
-				label: "备注",
-				value: data.remarks
-			}],
+					label: "单号",
+					value: data.billno
+				}, {
+					label: "单据日期",
+					value: data.billdate
+				}, {
+					label: "状态",
+					value: data.status
+				},
+				{
+					label: '是否实物返回',
+					value: data.isitemreturn ? '是' : '否'
+				}, {
+					label: "提交日期",
+					value: data.submitdate
+				}, {
+					label: "审核日期",
+					value: data.checkdate
+				}, {
+					label: "备注",
+					value: data.remarks
+				}
+			],
 			list2 = [{
 				label: "创建人",
 				value: data.createby
@@ -119,33 +119,33 @@ Page({
 		})
 	},
 	/* 审核选择弹出框关闭 */
-	onClose () {
+	onClose() {
 		this.setData({
 			show: false
 		})
 	},
 	/* 审核提交 */
-	async checkSubmit ({
+	async checkSubmit({
 		detail
 	}) {
 		let res = await _Http.basic({
-			 "id": "20221226153304",
+			"id": "20221226153304",
 			"content": {
-				"sa_aftersalesmagid":this.data.sa_aftersalesmagid,
-				"period":getTime.formatTime(new Date(detail), '-').split(' ')[0]
+				"sa_aftersalesmagid": this.data.sa_aftersalesmagid,
+				"period": getTime.formatTime(new Date(detail), '-').split(' ')[0]
 			}
 		})
 		console.log(res);
 		if (res.msg == '成功') {
 			this.setData({
-				show:false
+				show: false
 			})
 			this.getDetail(true)
 		}
 	},
 	tabbarOnClick({
-        detail
-    }) {
+		detail
+	}) {
 		switch (detail.label) {
 			case "编辑":
 				wx.navigateTo({
@@ -162,7 +162,7 @@ Page({
 						if (confirm) _Http.basic({
 							"id": "20230105161603",
 							"content": {
-								"sa_aftersalesmagid":this.data.sa_aftersalesmagid
+								"sa_aftersalesmagid": this.data.sa_aftersalesmagid
 							}
 						}).then(res => {
 							wx.showToast({
@@ -189,7 +189,7 @@ Page({
 						if (confirm) _Http.basic({
 							"id": "20230105161703",
 							"content": {
-								"sa_aftersalesmagid":this.data.sa_aftersalesmagid
+								"sa_aftersalesmagid": this.data.sa_aftersalesmagid
 							}
 						}).then(res => {
 							wx.showToast({
@@ -207,35 +207,35 @@ Page({
 				})
 				break;
 			case "删除":
-			wx.showModal({
-				title: '提示',
-				content: `是否删除该工具归还单?`,
-				complete: ({
-					confirm
-				}) => {
-					if (confirm) _Http.basic({
-						"id":20230104160803,
-						"content": {
-							sa_aftersalesmagids:[this.data.sa_aftersalesmagid]
-						}
-					}).then(res => {
-						wx.showToast({
-							title: res.msg == '成功' ? `已删除该工具归还单` : res.msg,
-							icon: "none"
-						});
-						if (res.msg == '成功') {
-							setTimeout(() => {
-								wx.navigateBack()
-								getCurrentPages()[getCurrentPages().length - 2].getList(true)
-							},300)
-						}
-					})
-				}
-			})
-			break;
-        }
+				wx.showModal({
+					title: '提示',
+					content: `是否删除该工具归还单?`,
+					complete: ({
+						confirm
+					}) => {
+						if (confirm) _Http.basic({
+							"id": 20230104160803,
+							"content": {
+								sa_aftersalesmagids: [this.data.sa_aftersalesmagid]
+							}
+						}).then(res => {
+							wx.showToast({
+								title: res.msg == '成功' ? `已删除该工具归还单` : res.msg,
+								icon: "none"
+							});
+							if (res.msg == '成功') {
+								setTimeout(() => {
+									wx.navigateBack()
+									getCurrentPages()[getCurrentPages().length - 2].getList(true)
+								}, 300)
+							}
+						})
+					}
+				})
+				break;
+		}
 	},
-	onInput (detail) {
+	onInput(detail) {
 
 	},
 	//tabs 切换
@@ -244,8 +244,8 @@ Page({
 	}) {
 		this.setData({
 			tabsActive: detail
-        });
-        console.log(this.data.tabsActive);
+		});
+		console.log(this.data.tabsActive);
 		this.partialRenewal();
 	},
 	//局部数据更新 tabs
@@ -258,7 +258,7 @@ Page({
 					pageNumber,
 					pageTotal
 				} = Component.data.content,
-                id = this.data.detail.sa_aftersalesmagid;
+				id = this.data.detail.sa_aftersalesmagid;
 			if (total == null || init) {
 				Component.getList(id, init);
 			} else if (pageNumber < pageTotal) {
@@ -270,11 +270,14 @@ Page({
 		this.partialRenewal();
 	},
 	onUnload() {
+		return; 
 		console.log("更新列表数据")
 		let page = getCurrentPages().find(v => v.__route__ == 'packageA/toolBill/index');
 		let content = JSON.parse(JSON.stringify(page.data.content));
+
 		content.pageNumber = 1;
-		content.pageSize = page.data.list.length;
+		content.pageSize = page.data.list.length + 3;
+
 		_Http.basic({
 			"id": 20230111141104,
 			content

+ 1 - 1
packageA/toolBill/detail.wxml

@@ -16,7 +16,7 @@
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 	<Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <toolDetail disabled="{{detail.status != '新建'}}" detail="{{detail}}" slot="商品明细" id="toolBill" bind:onSuccess="getDetail"></toolDetail>
-	<view style="height: 140rpx;" />
+	<view style="height: 160rpx;" />
 </Yl_FunTabs>
 
 <!-- 底部 -->

+ 14 - 9
packageA/toolBill/index.js

@@ -3,20 +3,21 @@ const _Http = getApp().globalData.http;
 Page({
     data: {
         loading: true,
-        active: 1,
+        active: 0,
         amount: 0,
         "content": {
+            nocache: true,
             "isExport": 0,
             "pageNumber": 1,
             "pageTotal": 1,
             "pageSize": 20,
-            "type":'借用归还单',
+            "type": '借用归还单',
             total: 0,
             "where": {
                 "condition": "",
                 "status": "",
-                "startdate":"",
-                "enddate":""
+                "startdate": "",
+                "enddate": ""
             },
             sort: []
         },
@@ -31,8 +32,8 @@ Page({
     }) {
         console.log(detail)
         this.setData({
-            'content.where.startdate':detail.startdate,
-            'content.where.enddate':detail.enddate,
+            'content.where.startdate': detail.startdate,
+            'content.where.enddate': detail.enddate,
         })
         this.getList(true)
     },
@@ -84,17 +85,21 @@ Page({
         });
         this.getList(true);
     },
+    onShow(){
+        // thisgetList
+        this.getList(true);
+    },
     onReady() {
         this.setListHeight()
     },
     /* 去新增 */
-    toAdd(){
+    toAdd() {
         wx.navigateTo({
-        url: '/packageA/toolBill/update'
+            url: '/packageA/toolBill/update'
         })
     },
     /* 设置页面高度 */
     setListHeight() {
-        this.selectComponent("#ListBox").setHeight(".tabs", this);
+        this.selectComponent("#ListBox").setHeight(".zhanwei", this);
     },
 })

+ 1 - 0
packageA/toolBill/index.wxml

@@ -8,6 +8,7 @@
     <van-tab title="审核" />
     <van-tab title="复核" />
 </van-tabs>
+<view class="zhanwei" style="height: 20rpx;" />
 <!-- <view class="tips">
     共计{{content.total}}单,合计¥{{amount}}
 </view> -->

+ 3 - 2
packageA/toolBill/modules/list/index.wxml

@@ -19,7 +19,8 @@
             归还原因:{{item.reason || '--'}}
         </view>
     </view>
-
+    <view style="height: 20rpx;" />
+<!-- 
     <view wx:if="{{item.contacts.length}}" class="bottom line-1">
         <text style="margin-right: 10rpx;">{{item.contacts[0].name}}</text>
         <text style="margin-right: 10rpx;">{{item.contacts[0].phonenumber}}</text>
@@ -27,7 +28,7 @@
     </view>
     <view wx:else class="bottom">
         暂无更多信息
-    </view>
+    </view> -->
 </navigator>
 
 <Yl_Empty wx:if="{{list.length==0}}" />