浏览代码

E服务优化

xiaohaizhao 2 年之前
父节点
当前提交
81dff8e3fa

+ 106 - 139
Eservice/agent/serviceBillDetail/index.js

@@ -7,42 +7,52 @@ Page({
    * 页面的初始数据
    */
   data: {
-    refresh:true,
-    orderMainData:{},
-    list:[]
-  },
-  async mainData () {
+    refresh: true,
+    orderMainData: {},
+    list: [],
+    tabbarsList: [{
+      label: "编辑",
+      icon: "icon-dibu-bianji"
+    }, {
+      label: "提交",
+      icon: "icon-tijiao",
+    }, {
+      label: "删除",
+      icon: "icon-guanlian-shanchu"
+    }]
+  },
+  async mainData() {
     const res = await api._post({
       "id": "20230206091603",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":this.data.id
+        "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      orderMainData:res.data,
-      sa_serviceorderid:res.data.sa_serviceorderid,
-      sa_orderid:res.data.sa_orderid,
+      orderMainData: res.data,
+      sa_serviceorderid: res.data.sa_serviceorderid,
+      sa_orderid: res.data.sa_orderid,
     })
     this.fileData()
     this.linkWorkOrder()
   },
-  async fileData () {
+  async fileData() {
     const res = await api._post({
       "method": "queryFileLink",
       "classname": "system.attachment.Attachment",
       "content": {
         "ownertable": "sa_serviceorder",
         "ownerid": this.data.id,
-        "usetype":"附件"//传空返回有所
+        "usetype": "附件" //传空返回有所
       }
     })
     this.setData({
-      filelist:res.data,
-      refresh:true
+      filelist: res.data,
+      refresh: true
     })
   },
-  addProduct () {
+  addProduct() {
     wx.navigateTo({
       url: '/Eservice/agent/billCanUseProduct/index',
     })
@@ -50,14 +60,14 @@ Page({
 
   async getAdd(selection) {
     const res = await api._post({
-      "id": "20230206161803", 
-      "version": 1, 
+      "id": "20230206161803",
+      "version": 1,
       "content": {
         "sa_serviceorderid": this.data.id,
-        "iteminfos":selection.map(e=>{
+        "iteminfos": selection.map(e => {
           return {
-            "sa_serviceorderitemsid": 0, 
-            "itemid": e, 
+            "sa_serviceorderitemsid": 0,
+            "itemid": e,
             "reason": ""
           }
         })
@@ -66,98 +76,90 @@ Page({
     this.productmx()
   },
 
-  async productmx () {
+  async productmx() {
     const res = await api._post({
-      "id": "20230206161903", 
-      "version": 1, 
+      "id": "20230206161903",
+      "version": 1,
       "content": {
         "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      list:res.data
-    })
-  },
-  async onDelete (data) {
-    let itemid = data.detail.sa_serviceorderitemsid
-    const res = await api._post({
-      "id": "20230206162003",
-      "content": {
-        "sa_serviceorderitemsids": [itemid]
-      }
-    })
-    this.productmx()
-  },
-  onEdit () {
-
-    getApp().globalData.handelSelect = this
-
-    wx.navigateTo({
-      url: '/Eservice/agent/editServiceBill/index',
+      list: res.data
     })
   },
-   onSubmit() {
-    let that = this
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: '确认提交当前申请单吗',
-      confirmBtn: '确定',
-      cancelBtn: '取消',
-    };
-
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
-        const res = await api._post({
-          "id": "20230206101403",
-          "version":1,
-          "content": {
-            "sa_serviceorderid":that.data.id,
-            "issumbit":1,
-          }
+  /* 底部按钮回调 */
+  tabbarOnClick(e) {
+    let that = this,
+      dialogConfig = null,
+      res = null;
+    switch (e.detail.label) {
+      case "编辑":
+        getApp().globalData.handelSelect = this
+        wx.navigateTo({
+          url: '/Eservice/agent/editServiceBill/index',
         })
-        that.mainData()
-      })
-      .catch((err) => console.log(err))
-      .finally(() => Dialog.close());
-  },
-  onDelete() {
-    let that = this
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: '确认删除当前申请单吗',
-      confirmBtn: '确定',
-      cancelBtn: '取消',
-    };
-
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
-        const res = await api._post({
-          "id": "20230206091803",
-          "version":1,
-          "content": {
-            "sa_serviceorderids":[that.data.id],
-          }
-        })
-        wx.navigateBack()
-      })
-      .catch((err) => console.log(err))
-      .finally(() => Dialog.close());
+        break;
+      case "提交":
+        dialogConfig = {
+          context: this,
+          title: '提示',
+          content: '确认提交当前申请单吗',
+          confirmBtn: '确定',
+          cancelBtn: '取消',
+        };
+        Dialog.confirm(dialogConfig)
+          .then(async () => {
+            res = await api._post({
+              "id": "20230206101403",
+              "version": 1,
+              "content": {
+                "sa_serviceorderid": that.data.id,
+                "issumbit": 1,
+              }
+            });
+            that.mainData()
+          })
+          .catch((err) => console.log(err))
+          .finally(() => Dialog.close());
+        break;
+      case "删除":
+        dialogConfig = {
+          context: this,
+          title: '提示',
+          content: '确认删除当前申请单吗',
+          confirmBtn: '确定',
+          cancelBtn: '取消',
+        };
+        Dialog.confirm(dialogConfig)
+          .then(async () => {
+            res = await api._post({
+              "id": "20230206091803",
+              "version": 1,
+              "content": {
+                "sa_serviceorderids": [that.data.id],
+              }
+            })
+            wx.navigateBack()
+          })
+          .catch((err) => console.log(err))
+          .finally(() => Dialog.close());
+        break;
+    }
   },
   async linkWorkOrder() {
     const res = await api._post({
       "id": "20230207154203",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":this.data.id
+        "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      linkWorkOrders:res.data
+      linkWorkOrders: res.data
     })
   },
-  tolinkWorkOrder (e) {
+  tolinkWorkOrder(e) {
     let id = e.currentTarget.dataset.item.sa_workorderid
     let app = getApp()
     app.globalData.action = ['editLeader']
@@ -170,58 +172,23 @@ Page({
    */
   onLoad(options) {
     this.setData({
-      id:options.id
+      id: options.id
     })
-    
     this.productmx()
   },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
   onShow() {
     this.mainData()
   },
+  async onUnload() {
+    let page = getCurrentPages().find(v => v.__route__ == 'Eservice/agent/serviceBillList/index');
+    if (!page) return;
+    let param = JSON.parse(JSON.stringify(page.data.param));
+    param.content.pageSize = param.content.pageNumber * param.content.pageSize;
+    param.content.pageNumber = 1;
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
+    const res = await api._post(param);
+    page.setData({
+      list: res.data
+    })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
 })

+ 7 - 19
Eservice/agent/serviceBillDetail/index.wxml

@@ -12,24 +12,6 @@
                 <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>
     </view>
     <view class="small"><text class="label">服务单类型:</text>{{orderMainData.servicetype}}</view>
     <view class="small"><text class="label">服务单状态:</text>{{orderMainData.status}}</view>
@@ -94,4 +76,10 @@
         </t-tab-panel>
     </t-tabs>
 </view>
-<t-dialog id="t-dialog" />
+<t-dialog id="t-dialog" />
+<!-- 底部 -->
+
+<block wx:if="{{orderMainData.status === '新建'}}">
+    <view style="height: 160rpx;" />
+    <Yl_Tabbar list='{{tabbarsList}}' bind:callback="tabbarOnClick" />
+</block>

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

@@ -11,6 +11,7 @@ Page({
             "id": "20230206091703",
             "version": 1,
             "content": {
+                nocache: true,
                 "pageSize": 20,
                 "pageNumber": 1,
                 "isadmin": false,
@@ -42,7 +43,7 @@ Page({
     },
     onTabsChange(data) {
         this.setData({
-            list:[]
+            list: []
         })
         this.data.param.content.where.status = data.detail.value
         this.onPullDownRefresh()
@@ -51,7 +52,7 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        // this.listData()
+        this.listData()
     },
 
     /**
@@ -65,9 +66,7 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow() {
-        this.data.param.content.pageNumber = 1
-        this.data.list = []
-        this.listData()
+
     },
 
     /**

+ 96 - 92
Eservice/saler/serviceBillDetail/index.js

@@ -7,40 +7,50 @@ Page({
    * 页面的初始数据
    */
   data: {
-    refresh:true,
-    orderMainData:{},
-    list:[]
-  },
-  async mainData () {
+    refresh: true,
+    orderMainData: {},
+    list: [],
+    tabbarsList: [{
+      label: "编辑",
+      icon: "icon-dibu-bianji"
+    }, {
+      label: "提交",
+      icon: "icon-tijiao",
+    }, {
+      label: "删除",
+      icon: "icon-guanlian-shanchu"
+    }]
+  },
+  async mainData() {
     const res = await api._post({
       "id": "20230206091603",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":this.data.id
+        "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      orderMainData:res.data
+      orderMainData: res.data
     })
     this.fileData()
     this.linkWorkOrder()
   },
-  async fileData () {
+  async fileData() {
     const res = await api._post({
       "method": "queryFileLink",
       "classname": "system.attachment.Attachment",
       "content": {
         "ownertable": "sa_serviceorder",
         "ownerid": this.data.id,
-        "usetype":"附件"//传空返回有所
+        "usetype": "附件" //传空返回有所
       }
     })
     this.setData({
-      filelist:res.data,
-      refresh:true
+      filelist: res.data,
+      refresh: true
     })
   },
-  addProduct () {
+  addProduct() {
     wx.navigateTo({
       url: '/Eservice/saler/billCanUseProduct/index',
     })
@@ -48,14 +58,14 @@ Page({
 
   async getAdd(selection) {
     const res = await api._post({
-      "id": "20230206161803", 
-      "version": 1, 
+      "id": "20230206161803",
+      "version": 1,
       "content": {
         "sa_serviceorderid": this.data.id,
-        "iteminfos":selection.map(e=>{
+        "iteminfos": selection.map(e => {
           return {
-            "sa_serviceorderitemsid": 0, 
-            "itemid": e, 
+            "sa_serviceorderitemsid": 0,
+            "itemid": e,
             "reason": ""
           }
         })
@@ -64,99 +74,93 @@ Page({
     this.productmx()
   },
 
-  async productmx () {
+  async productmx() {
     const res = await api._post({
-      "id": "20230206161903", 
-      "version": 1, 
+      "id": "20230206161903",
+      "version": 1,
       "content": {
         "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      list:res.data
-    })
-  },
-  async onDelete (data) {
-    let itemid = data.detail.sa_serviceorderitemsid
-    const res = await api._post({
-      "id": "20230206162003",
-      "content": {
-        "sa_serviceorderitemsids": [itemid]
-      }
+      list: res.data
     })
-    this.productmx()
   },
-  onEdit () {
 
-    getApp().globalData.handelSelect = this
 
-    wx.navigateTo({
-      url: '/Eservice/saler/editServiceBill/index',
-    })
-  },
-   onSubmit() {
-    let that = this
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: '确认提交当前申请单吗',
-      confirmBtn: '确定',
-      cancelBtn: '取消',
-    };
-
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
-        const res = await api._post({
-          "id": "20230206101403",
-          "version":1,
-          "content": {
-            "sa_serviceorderid":that.data.id,
-            "issumbit":1,
-          }
+  /* 底部按钮回调 */
+  tabbarOnClick(e) {
+    let that = this,
+      dialogConfig = null,
+      res = null;
+    switch (e.detail.label) {
+      case "编辑":
+        getApp().globalData.handelSelect = this
+        wx.navigateTo({
+          url: '/Eservice/saler/editServiceBill/index',
         })
-        that.mainData()
-      })
-      .catch((err) => console.log(err))
-      .finally(() => Dialog.close());
-  },
-  onDelete() {
-    let that = this
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: '确认删除当前申请单吗',
-      confirmBtn: '确定',
-      cancelBtn: '取消',
-    };
-
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
-        const res = await api._post({
-          "id": "20230206091803",
-          "version":1,
-          "content": {
-            "sa_serviceorderids":[that.data.id],
-          }
-        })
-        wx.navigateBack()
-        
-      })
-      .catch((err) => console.log(err))
-      .finally(() => Dialog.close());
+        break;
+      case "提交":
+        dialogConfig = {
+          context: this,
+          title: '提示',
+          content: '确认提交当前申请单吗',
+          confirmBtn: '确定',
+          cancelBtn: '取消',
+        };
+        Dialog.confirm(dialogConfig)
+          .then(async () => {
+            res = await api._post({
+              "id": "20230206101403",
+              "version": 1,
+              "content": {
+                "sa_serviceorderid": that.data.id,
+                "issumbit": 1,
+              }
+            })
+            that.mainData()
+          })
+          .catch((err) => console.log(err))
+          .finally(() => Dialog.close());
+        break;
+      case "删除":
+        dialogConfig = {
+          context: this,
+          title: '提示',
+          content: '确认删除当前申请单吗',
+          confirmBtn: '确定',
+          cancelBtn: '取消',
+        };
+        Dialog.confirm(dialogConfig)
+          .then(async () => {
+            res = await api._post({
+              "id": "20230206091803",
+              "version": 1,
+              "content": {
+                "sa_serviceorderids": [that.data.id],
+              }
+            })
+            wx.navigateBack()
+
+          })
+          .catch((err) => console.log(err))
+          .finally(() => Dialog.close());
+        break;
+    }
   },
   async linkWorkOrder() {
     const res = await api._post({
       "id": "20230207154203",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":this.data.id
+        "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      linkWorkOrders:res.data
+      linkWorkOrders: res.data
     })
   },
-  tolinkWorkOrder (e) {
+  tolinkWorkOrder(e) {
     let id = e.currentTarget.dataset.item.sa_workorderid
 
     let app = getApp()
@@ -172,9 +176,9 @@ Page({
    */
   onLoad(options) {
     this.setData({
-      id:options.id
+      id: options.id
     })
-    
+
     this.productmx()
   },
 

+ 8 - 21
Eservice/saler/serviceBillDetail/index.wxml

@@ -12,24 +12,6 @@
         <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>
   </view>
   <view class="small"><text class="label">服务单类型:</text>{{orderMainData.servicetype}}</view>
   <view class="small"><text class="label">服务单状态:</text>{{orderMainData.status}}</view>
@@ -78,16 +60,21 @@
       </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 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" />
+
+<block wx:if="{{orderMainData.status === '新建'}}">
+  <view style="height: 160rpx;" />
+  <Yl_Tabbar list='{{tabbarsList}}' bind:callback="tabbarOnClick" />
+</block>

+ 20 - 16
Eservice/saler/serviceBillList/index.js

@@ -6,26 +6,26 @@ Page({
    * 页面的初始数据
    */
   data: {
-    list:[],
-    param:{
+    list: [],
+    param: {
       "id": "20230206091703",
-      "version":1,
+      "version": 1,
       "content": {
-        "pageSize":20,
-        "pageNumber":1,
-        "isadmin":false,
-        "where":{
-          "condition":"",
-          "status":'待指派'
+        "pageSize": 20,
+        "pageNumber": 1,
+        "isadmin": false,
+        "where": {
+          "condition": "",
+          "status": '新建'
         }
       }
     }
   },
-  async listData () {
+  async listData() {
     const res = await api._post(this.data.param)
     if (res.data.length > 0) {
       this.setData({
-        list:this.data.list.concat(res.data)
+        list: this.data.list.concat(res.data)
       })
     } else {
       wx.showToast({
@@ -35,14 +35,16 @@ Page({
       })
     }
   },
-  handleClick () {
+  handleClick() {
     wx.navigateTo({
       url: '/Eservice/saler/addServiceBill/index',
     })
   },
-  onTabsChange (data) {
-    console.log(data)
+  onTabsChange(data) {
     this.data.param.content.where.status = data.detail.value
+    this.setData({
+      list: []
+    })
     this.onPullDownRefresh()
   },
   /**
@@ -64,7 +66,9 @@ Page({
    */
   onShow() {
     this.data.param.content.pageNumber = 1
-    this.data.list = []
+    this.setData({
+      list: []
+    })
     this.listData()
   },
 
@@ -95,7 +99,7 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-    this.data.param.content.pageNumber ++
+    this.data.param.content.pageNumber++
     this.listData()
   },
 

+ 3 - 1
Eservice/saler/serviceBillList/index.wxml

@@ -1,5 +1,6 @@
 <!--pages/agent/serviceBillList/index.wxml-->
-<t-tabs defaultValue="待指派" bind:change="onTabsChange" t-class="custom-tabs">
+<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="进行中" />
@@ -12,6 +13,7 @@
   bind:refresh="onPullDownRefresh"
   bind:scrolltolower="onReachBottom"
 >
+
 <view style="padding:10px">
   <t-card url="{{'/Eservice/saler/serviceBillDetail/index?id=' + item.sa_serviceorderid}}" wx:for="{{list}}" wx:key="sa_serviceorderid">
     <view style="flex:1"  slot="content">

+ 34 - 38
Eservice/workOrder/index.wxml

@@ -1,45 +1,41 @@
 <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
-  <t-tab-panel label="待接单" value="0" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}"/>
-  <t-tab-panel label="待开始" value="4" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}"/>
-  <t-tab-panel label="暂停" value="1" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}"/>
-  <t-tab-panel label="进行中" value="2" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}"/>
-  <t-tab-panel label="已完成" value="3" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}"/>
+  <t-tab-panel label="待接单" value="0" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}" />
+  <t-tab-panel label="待开始" value="4" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}" />
+  <t-tab-panel label="暂停" value="1" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}" />
+  <t-tab-panel label="进行中" value="2" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}" />
+  <t-tab-panel label="已完成" value="3" badge-props="{{ { count: 0, offset: ['-16rpx', '8rpx'] } }}" />
 </t-tabs>
-<t-pull-down-refresh
-  style="padding-bottom:60px"
-  value="{{baseRefresh.value}}"
-  loadingProps="{{loadingProps}}"
-  loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}"
-  bind:refresh="onPullDownRefresh"
-  bind:scrolltolower="onReachBottom"
->
-<view style="padding:10px">
-  <view>
-    <card wx:for="{{list}}" url="{{'/Eservice/workOrderDetail/index?id=' + item.sa_workorderid}}" wx:key="index">
-      <view style="width: 40px;" slot="left">
-        <view class="type">{{item.type}}</view>
-      </view>
-      <view style="flex:1" slot="content">
-        <view>
-          {{item.province}}{{item.city}}{{item.county}}{{item.address}}
+<t-pull-down-refresh style="padding-bottom:60px" value="{{baseRefresh.value}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scrolltolower="onReachBottom">
+  <view style="padding:10px">
+    <view>
+      <card wx:for="{{list}}" url="{{'/Eservice/workOrderDetail/index?id=' + item.sa_workorderid}}" wx:key="index">
+        <view style="width: 40px;" slot="left">
+          <view class="type">{{item.type}}</view>
         </view>
-        <view class="colorInfo small">
-          指派日期:{{item.createdate}}
+        <view style="flex:1" slot="content">
+          <view>
+            {{item.province}}{{item.city}}{{item.county}}{{item.address}}
+          </view>
+          <view class="colorInfo small">
+            指派日期:{{item.createdate}}
+          </view>
+          <view wx:if="{{item.status === '待接单'}}" class="colorInfo small">
+            {{item.status}}
+          </view>
+          <view wx:if="{{item.status !== '待接单' && item.status !== '已完成'}}" class="colorInfo small">
+            {{item.status=='待开始'?'待开始':'当前工序:'+item.curcontent}}
+          </view>
+          <view wx:if="{{item.status == '已完成'}}" class="colorInfo small">
+            已完成
+          </view>
         </view>
-        <view wx:if="{{item.status === '待接单'}}" class="colorInfo small">
-          {{item.status}}
+        <view class="flex-align-center" slot="right">
+          <view class="colorInfo small">
+            {{item.status}}
+          </view>
         </view>
-        <view wx:if="{{item.status !== '待接单'}}" class="colorInfo small">
-          当前工序:{{item.curcontent}}
-        </view>
-      </view>
-      <view class="flex-align-center" slot="right">
-        <view class="colorInfo small">
-          {{item.status}}
-        </view>
-      </view>
-    </card>
-    <t-empty wx:if="{{list.length === 0}}" icon="root-list" t-class="empty-cls" t-class-image="t-empty__image" description="暂无工单" />
+      </card>
+      <t-empty wx:if="{{list.length === 0}}" icon="root-list" t-class="empty-cls" t-class-image="t-empty__image" description="暂无工单" />
+    </view>
   </view>
-</view>
 </t-pull-down-refresh>

+ 160 - 125
Eservice/workerLeader/serviceBillDetail/index.js

@@ -7,47 +7,69 @@ Page({
    * 页面的初始数据
    */
   data: {
-    showWithInput:false,  
-    showProgress:false,
-    showToWoker:false, 
-    orderMainData:{},
-    list:[],
-    templist:[],
-    actTemp:null,
-    actLeader:null
+    showWithInput: false,
+    showProgress: false,
+    showToWoker: false,
+    orderMainData: {},
+    list: [],
+    templist: [],
+    actTemp: null,
+    actLeader: null
   },
-  async mainData () {
+  async mainData() {
     const res = await api._post({
       "id": "20230206091603",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":this.data.id
+        "sa_serviceorderid": this.data.id
       }
     })
+    let tabbarsList = [];
+    if (res.data.status == '新建') {
+      tabbarsList = [{
+        label: "编辑",
+        icon: "icon-dibu-bianji"
+      }, {
+        label: "提交",
+        icon: "icon-tijiao",
+      }, {
+        label: "删除",
+        icon: "icon-guanlian-shanchu"
+      }];
+    } else if (res.data.status == '待指派') {
+      tabbarsList = [{
+        label: "转工单",
+        icon: "icon-shenhe"
+      }, {
+        label: "退回",
+        icon: "icon-a-fanshenhetuihui",
+      }];
+    }
     this.setData({
-      orderMainData:res.data
+      orderMainData: res.data,
+      tabbarsList
     })
     this.productmx()
     this.fileData()
     this.workOrderTemp()
     this.workerData()
   },
-  async fileData () {
+  async fileData() {
     const res = await api._post({
       "method": "queryFileLink",
       "classname": "system.attachment.Attachment",
       "content": {
         "ownertable": "sa_serviceorder",
         "ownerid": this.data.id,
-        "usetype":"附件"//传空返回有所
+        "usetype": "附件" //传空返回有所
       }
     })
     this.setData({
-      filelist:res.data,
-      refresh:true
+      filelist: res.data,
+      refresh: true
     })
   },
-  addProduct () {
+  addProduct() {
     wx.navigateTo({
       url: '/Eservice/workerLeader/billCanUseProduct/index',
     })
@@ -55,14 +77,14 @@ Page({
 
   async getAdd(selection) {
     const res = await api._post({
-      "id": "20230206161803", 
-      "version": 1, 
+      "id": "20230206161803",
+      "version": 1,
       "content": {
         "sa_serviceorderid": this.data.id,
-        "iteminfos":selection.map(e=>{
+        "iteminfos": selection.map(e => {
           return {
-            "sa_serviceorderitemsid": 0, 
-            "itemid": e, 
+            "sa_serviceorderitemsid": 0,
+            "itemid": e,
             "reason": ""
           }
         })
@@ -71,19 +93,19 @@ Page({
     this.productmx()
   },
 
-  async productmx () {
+  async productmx() {
     const res = await api._post({
-      "id": "20230206161903", 
-      "version": 1, 
+      "id": "20230206161903",
+      "version": 1,
       "content": {
         "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      list:res.data
+      list: res.data
     })
   },
-  async onMXDelete (data) {
+  async onMXDelete(data) {
     let itemid = data.detail.sa_serviceorderitemsid
     const res = await api._post({
       "id": "20230206162003",
@@ -93,164 +115,177 @@ Page({
     })
     this.productmx()
   },
-  onEdit () {
 
-    getApp().globalData.handelSelect = this
 
-    wx.navigateTo({
-      url: '/Eservice/workerLeader/editServiceBill/index',
-    })
-  },
-   onSubmit() {
-    let that = this
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: '确认提交当前申请单吗',
-      confirmBtn: '确定',
-      cancelBtn: '取消',
-    };
+  /* 底部按钮回调 */
+  tabbarOnClick(e) {
+    let that = this,
+      dialogConfig = null,
+      res = null;
+    switch (e.detail.label) {
+      case "编辑":
+        getApp().globalData.handelSelect = this
+        wx.navigateTo({
+          url: '/Eservice/workerLeader/editServiceBill/index',
+        })
+        break;
+      case "提交":
+        dialogConfig = {
+          context: this,
+          title: '提示',
+          content: '确认提交当前申请单吗',
+          confirmBtn: '确定',
+          cancelBtn: '取消',
+        };
 
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
-        const res = await api._post({
-          "id": "20230206101403",
-          "version":1,
-          "content": {
-            "sa_serviceorderid":that.data.id,
-            "issumbit":1,
-          }
+        Dialog.confirm(dialogConfig)
+          .then(async () => {
+            res = await api._post({
+              "id": "20230206101403",
+              "version": 1,
+              "content": {
+                "sa_serviceorderid": that.data.id,
+                "issumbit": 1,
+              }
+            })
+            that.mainData()
+          })
+          .catch((err) => console.log(err))
+          .finally(() => Dialog.close());
+
+        break;
+      case "删除":
+        dialogConfig = {
+          context: this,
+          title: '提示',
+          content: '确认删除当前申请单吗',
+          confirmBtn: '确定',
+          cancelBtn: '取消',
+        };
+        Dialog.confirm(dialogConfig)
+          .then(async () => {
+            res = await api._post({
+              "id": "20230206091803",
+              "version": 1,
+              "content": {
+                "sa_serviceorderids": [that.data.id],
+              }
+            })
+            wx.navigateBack()
+
+          })
+          .catch((err) => console.log(err))
+          .finally(() => Dialog.close());
+        break;
+      case "转工单":
+        this.setData({
+          showToWoker: !this.data.showToWoker
         })
-        that.mainData()
-      })
-      .catch((err) => console.log(err))
-      .finally(() => Dialog.close());
+        break;
+      case "退回":
+        this.setData({
+          showWithInput: !this.data.showWithInput
+        })
+        break;
+    }
   },
-  showBackReason () {
+  /* 取消按钮 */
+  showBackReason() {
     this.setData({
-      showWithInput:!this.data.showWithInput
+      showWithInput: false,
+      showToWoker: false
     })
   },
-  inputReason (data) {
+  inputReason(data) {
     console.log(data)
     this.data.backreason = data.detail.value
   },
   async onBack() {
     let that = this
+    if (!that.data.backreason) return;
     const res = await api._post({
       "id": "20230206101403",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":that.data.id,
-        "issumbit":0,
-        "backreason":that.data.backreason
+        "sa_serviceorderid": that.data.id,
+        "issumbit": 0,
+        "backreason": that.data.backreason
       }
     })
     that.mainData()
+    that.showBackReason()
   },
-  onDelete() {
-    let that = this
-    const dialogConfig = {
-      context: this,
-      title: '提示',
-      content: '确认删除当前申请单吗',
-      confirmBtn: '确定',
-      cancelBtn: '取消',
-    };
 
-    Dialog.confirm(dialogConfig)
-      .then(async () => {
-        const res = await api._post({
-          "id": "20230206091803",
-          "version":1,
-          "content": {
-            "sa_serviceorderids":[that.data.id],
-          }
-        })
-        wx.navigateBack()
-        
-      })
-      .catch((err) => console.log(err))
-      .finally(() => Dialog.close());
-  },
-
-  async workOrderTemp () {
+  async workOrderTemp() {
     const res = await api._post({
       "id": "20230206155803",
-      "version":1,
-      "content": {
-      }
+      "version": 1,
+      "content": {}
     })
     this.setData({
-      templist:res.data
+      templist: res.data
     })
   },
-  showWorkerDialog () {
+  selectTemp(data) {
     this.setData({
-      showToWoker:!this.data.showToWoker
-    })
-  },
-  selectTemp (data) {
-    this.setData({
-      actTemp:data.currentTarget.dataset.item
+      actTemp: data.currentTarget.dataset.item
     })
   },
 
-  async workerData () {
+  async workerData() {
     const res = await api._post({
       "id": "20230213143003",
-      "version":1,
+      "version": 1,
       "content": {
-        "where":{
-          "condition":""
+        "where": {
+          "condition": ""
         }
       }
     })
     this.setData({
-      workers:res.data
+      workers: res.data
     })
   },
-  selectLeader (data) {
+  selectLeader(data) {
     this.setData({
-      actLeader:data.currentTarget.dataset.item
+      actLeader: data.currentTarget.dataset.item
     })
   },
-  async toWorker () {
+  async toWorker() {
     console.log(this.data.actTemp)
     if (!this.data.actTemp && !this.data.actLeader) {
       wx.showToast({
         title: '未选择工单模板或负责人',
-        icon:'none'
+        icon: 'none'
       })
     } else {
       const res = api._post({
         "id": "20230207091003",
         "content": {
-          "type":this.data.actTemp.type,
-          "sa_serviceorderid":this.data.id,
-          "projectlearders":[this.data.actLeader.userid]
+          "type": this.data.actTemp.type,
+          "sa_serviceorderid": this.data.id,
+          "sa_workorder_templateid": this.data.actTemp.sa_workorder_templateid,
+          "projectlearders": [this.data.actLeader.userid]
         }
       })
-      this.setData({
-        showToWoker:false
-      })
       this.mainData()
+      this.showBackReason()
     }
-    
+
   },
   async linkWorkOrder() {
     const res = await api._post({
       "id": "20230207154203",
-      "version":1,
+      "version": 1,
       "content": {
-        "sa_serviceorderid":this.data.id
+        "sa_serviceorderid": this.data.id
       }
     })
     this.setData({
-      linkWorkOrders:res.data
+      linkWorkOrders: res.data
     })
   },
-  tolinkWorkOrder (e) {
+  tolinkWorkOrder(e) {
     let id = e.currentTarget.dataset.item.sa_workorderid
 
     let app = getApp()
@@ -261,14 +296,14 @@ Page({
       url: '/Eservice/workerLeader/editworkOrderDetail/index?id=' + id
     })
   },
-  async showProgressDialog () {
+  async showProgressDialog() {
     const res = await api._post({
-      id:"20230208140203",
-      content:{}
+      id: "20230208140203",
+      content: {}
     })
     this.setData({
-      showProgress:!this.data.showProgress,
-      progress:res.data
+      showProgress: !this.data.showProgress,
+      progress: res.data
     })
   },
   /**
@@ -276,7 +311,7 @@ Page({
    */
   onLoad(options) {
     this.setData({
-      id:options.id
+      id: options.id
     })
     this.linkWorkOrder()
   },

+ 20 - 60
Eservice/workerLeader/serviceBillDetail/index.wxml

@@ -12,31 +12,6 @@
         <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class2}}</t-tag>
       </view>
     </view>
-    <view class="flex-align-center">
-      <view  wx:if="{{orderMainData.status === '待指派'}}" class="mr-10" bindtap="showWorkerDialog">
-        <t-icon name="root-list" size="36rpx" bind:click="onIconTap" />
-        <text style="font-size: 20rpx;">转工单</text>
-      </view>
-      <view  wx:if="{{orderMainData.status === '待指派'}}" class="mr-10" bindtap="showBackReason">
-        <t-icon name="enter" size="36rpx" bind:click="onIconTap" />
-        <text style="font-size: 20rpx;">退回</text>
-      </view>
-      <view class="flex-align-center"  wx:if="{{orderMainData.status === '新建'}}" >
-        <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>
@@ -87,38 +62,24 @@
       </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 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="onMXDelete"></product-card>
         </view>
-        
+
       </view>
     </t-tab-panel>
   </t-tabs>
 </view>
+
 <t-dialog id="t-dialog" />
-<t-dialog
-  visible="{{showWithInput}}"
-  title="退回原因"
-  confirm-btn="确定"
-  cancel-btn="取消"
-  bind:confirm="onBack"
-  bind:cancel="showBackReason"
->
-  <t-textarea style="margin-top:20px" slot="content" placeholder="请输入退回原因" value="" disableDefaultPadding="{{true}}" bind:blur="inputReason" autosize bordered/>
+<t-dialog visible="{{showWithInput}}" title="退回原因" confirm-btn="确定" cancel-btn="取消" bind:confirm="onBack" bind:cancel="showBackReason">
+  <t-textarea style="margin-top:20px" slot="content" placeholder="请输入退回原因" value="" disableDefaultPadding="{{true}}" bind:blur="inputReason" autosize bordered />
 </t-dialog>
-
-<t-dialog
-  visible="{{showToWoker}}"
-  title="转工单"
-  confirm-btn="确定"
-  cancel-btn="取消"
-  bind:confirm="toWorker"
-  bind:cancel="showWorkerDialog"
->
+<t-dialog visible="{{showToWoker}}" title="转工单" confirm-btn="确定" cancel-btn="取消" bind:confirm="toWorker" bind:cancel="showBackReason">
   <view slot="content">
     <view class="d-title">
       选择工单模板:
@@ -133,25 +94,17 @@
     </view>
     <view class="mt-5">
       <block wx:for="{{workers}}" wx:key="rowindex">
-        <t-tag class="mr-5 mt-5" variant="{{actLeader.userid === item.userid?'dark':'outline'}}" theme="primary" data-item="{{item}}" bindtap="selectLeader">{{  item.position?item.position + '-':'' }}{{ item.name }}</t-tag>
+        <t-tag class="mr-5 mt-5" variant="{{actLeader.userid === item.userid?'dark':'outline'}}" theme="primary" data-item="{{item}}" bindtap="selectLeader">{{ item.position?item.position + '-':'' }}{{ item.name }}</t-tag>
       </block>
     </view>
 
     <t-button bind:tap="showProgressDialog" variant="primary" size="extra-small">查看人员进度</t-button>
   </view>
 </t-dialog>
-
-<t-dialog
-  visible="{{showProgress}}"
-  title="进度"
-  confirm-btn="确定"
-  bind:confirm="showProgressDialog"
-  external-classes="['t-class']"
-  show-overlay="{{false}}"
->
+<t-dialog visible="{{showProgress}}" title="进度" confirm-btn="确定" bind:confirm="showProgressDialog" external-classes="['t-class']" show-overlay="{{false}}">
   <view slot="content">
     <scroll-view style="display: inline-block;width: 100%;height: 300px;" scroll-y>
-      <view  wx:for="{{progress}}" wx:key="rowindex">
+      <view wx:for="{{progress}}" wx:key="rowindex">
         <view class="small"><text class="label">姓名:</text>{{item.projectleader}}</view>
         <view class="small"><text class="label">地址:</text>{{item.province}}{{item.city}}{{item.county}}{{item.address}}</view>
         <view class="small"><text class="label">创建时间:</text>{{item.createdate}}</view>
@@ -160,7 +113,14 @@
       <t-empty wx:if="{{progress.length === 0}}" icon="root-list" t-class="empty-cls" t-class-image="t-empty__image" description="暂无进行中的人员" />
 
     </scroll-view>
-    
-    
+
+
   </view>
-</t-dialog>
+</t-dialog>
+
+<!-- 底部 -->
+
+<block wx:if="{{tabbarsList.length!=0}}">
+  <view style="height: 160rpx;" />
+  <Yl_Tabbar list='{{tabbarsList}}' bind:callback="tabbarOnClick" />
+</block>

+ 17 - 16
Eservice/workerLeader/serviceBillList/index.js

@@ -8,26 +8,27 @@ Page({
    * 页面的初始数据
    */
   data: {
-    list:[],
-    param:{
+    list: [],
+    param: {
       "id": "20230206091703",
-      "version":1,
+      "version": 1,
       "content": {
-        "pageSize":20,
-        "pageNumber":1,
-        "isadmin":true,
-        "where":{
-          "condition":"",
-          "status":'待指派'
+        nocache: true,
+        "pageSize": 20,
+        "pageNumber": 1,
+        "isadmin": true,
+        "where": {
+          "condition": "",
+          "status": '新建'
         }
       }
     }
   },
-  async listData () {
+  async listData() {
     const res = await api._post(this.data.param)
     if (res.data.length > 0) {
       this.setData({
-        list:this.data.list.concat(res.data)
+        list: this.data.list.concat(res.data)
       })
     } else {
       wx.showToast({
@@ -37,18 +38,18 @@ Page({
       })
     }
   },
-  handleClick () {
+  handleClick() {
     wx.navigateTo({
       url: '/Eservice/workerLeader/addServiceBill/index',
     })
   },
-  onTabsChange (data) {
+  onTabsChange(data) {
     this.data.param.content.where.status = data.detail.value
     this.data.param.content.pageNumber = 1
     this.data.list = []
     this.setData({
-      param:this.data.param,
-      list:[]
+      param: this.data.param,
+      list: []
     })
     this.listData()
   },
@@ -102,7 +103,7 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-    this.data.param.content.pageNumber ++
+    this.data.param.content.pageNumber++
     this.listData()
   },
 

+ 2 - 1
Eservice/workerLeader/serviceBillList/index.wxml

@@ -1,5 +1,6 @@
 <!--pages/agent/serviceBillList/index.wxml-->
-<t-tabs defaultValue="待指派" bind:change="onTabsChange" t-class="custom-tabs">
+<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="进行中" />