Browse Source

申请单管理修改

xiaohaizhao 2 years ago
parent
commit
e218c0d565

+ 17 - 58
Eservice/workerLeader/editworkOrderDetail/index.js

@@ -14,6 +14,7 @@ Page({
     const res = await api._post({
       "id": "20230208140103",
       "content": {
+        nocache: true,
         "sa_workorderid": this.data.id
       }
     })
@@ -35,7 +36,6 @@ Page({
       confirmBtn: name,
       cancelBtn: '取消',
     }
-    // return console.log(id)
     Dialog.confirm(dialogConfig)
       .then(async () => {
         const res = await api._post({
@@ -44,13 +44,18 @@ Page({
             "sa_workorderid": this.data.id
           }
         })
-        console.log(res)
         wx.showToast({
           title: res.msg == '成功' ? `工单${name}成功` : res.msg,
           icon: "none",
           mask: true
-        })
-        this.mainData()
+        });
+        if (name == '作废') {
+          setTimeout(() => {
+            wx.navigateBack()
+          }, 500);
+        } else {
+          this.mainData()
+        }
       })
       .catch(() => console.log('点击了取消'))
       .finally(() => Dialog.close())
@@ -90,6 +95,7 @@ Page({
       "id": "20230211105903",
       "content": {
         "where": {
+          nocahce: true,
           "condition": "",
           "sa_workorderid": this.data.id
         }
@@ -125,7 +131,7 @@ Page({
   },
   showWorkerDialog() {
     this.setData({
-      workLeaderDialog: false
+      workLeaderDialog: !this.data.workLeaderDialog
     })
   },
   selectLeader(data) {
@@ -141,75 +147,28 @@ Page({
       })
     } else {
       this.data.billData.projectlearders = [this.data.actLeader.userid]
-      const res = api._post({
+      const res = await api._post({
         "id": "20230208140003",
         "content": this.data.billData
       })
       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
     })
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
   },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
   onShow() {
     this.mainData()
     this.confirmBillList()
   },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
 })

+ 7 - 0
Eservice/workerLeader/editworkOrderDetail/index.scss

@@ -26,6 +26,13 @@ page {
   line-height: 25px;
 }
 
+.tags {
+  width: 100%;
+  display: flex !important;
+  justify-content: space-between !important;
+  height: 48rpx !important;
+}
+
 .mr-5 {
   margin-right: 5px;
 }

+ 5 - 2
Eservice/workerLeader/editworkOrderDetail/index.wxml

@@ -33,15 +33,18 @@
       <view class="small"><text class="label">结束时间:</text>{{billData.enddate}}</view>
     </view>
   </card>
+
   <view style="margin-bottom: 5px;" class="small"><text class="label">项目成员</text></view>
+
   <card>
-    <view slot="content">
+    <view class="tags" slot="content">
       <t-tag class="mr-5 mt-5" wx:for="{{billData.team}}" wx:key="userid" variant="{{item.isleader === 1?'dark':'outline'}}" theme="{{item.isleader === 1?'primary':''}}">{{item.name}}</t-tag>
-      <t-tag class="mt-5" variant="dark" bind:click="showWorkerDialog">
+      <t-tag class="mt-5" variant="outline" theme="warning" variant="dark" bind:click="showWorkerDialog">
         修改负责人
       </t-tag>
     </view>
   </card>
+
   <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
     <t-tab-panel label="工单进度" value="0">
       <view style="padding:10px">

+ 48 - 66
Eservice/workerLeader/serviceBillDetail/index.js

@@ -21,6 +21,7 @@ Page({
       "id": "20230206091603",
       "version": 1,
       "content": {
+        nocache: true,
         "sa_serviceorderid": this.data.id
       }
     })
@@ -147,8 +148,13 @@ Page({
                 "sa_serviceorderid": that.data.id,
                 "issumbit": 1,
               }
+            });
+            wx.showToast({
+              title: res.msg == '成功' ? '工单提交成功' : res.msg,
+              icon: "none",
+              mask: true
             })
-            that.mainData()
+            if (res.msg == '成功') that.mainData();
           })
           .catch((err) => console.log(err))
           .finally(() => Dialog.close());
@@ -171,38 +177,48 @@ Page({
                 "sa_serviceorderids": [that.data.id],
               }
             })
-            wx.navigateBack()
-
+            wx.showToast({
+              title: res.msg == '成功' ? '工单删除成功' : res.msg,
+              icon: "none",
+              mask: true
+            })
+            if (res.msg == '成功') setTimeout(() => {
+              wx.navigateBack()
+            }, 500);
           })
           .catch((err) => console.log(err))
           .finally(() => Dialog.close());
         break;
       case "转工单":
         this.setData({
-          showToWoker: !this.data.showToWoker
+          showToWoker: true
         })
         break;
       case "退回":
         this.setData({
-          showWithInput: !this.data.showWithInput
+          showWithInput: true
         })
         break;
     }
   },
-  /* 取消按钮 */
+  /* 专工单/退回 取消 */
   showBackReason() {
     this.setData({
       showWithInput: false,
-      showToWoker: false
+      showToWoker: false,
+      backreason: ""
     })
   },
+
   inputReason(data) {
-    console.log(data)
-    this.data.backreason = data.detail.value
+    this.data.backreason = data.detail.value;
   },
   async onBack() {
     let that = this
-    if (!that.data.backreason) return;
+    if (!that.data.backreason) return wx.showToast({
+      title: '请说明退回原因!',
+      icon: "none"
+    })
     const res = await api._post({
       "id": "20230206101403",
       "version": 1,
@@ -212,8 +228,15 @@ Page({
         "backreason": that.data.backreason
       }
     })
-    that.mainData()
-    that.showBackReason()
+    wx.showToast({
+      title: res.msg == '成功' ? '已退回工单' : res.msg,
+      icon: "none",
+      mask: true
+    })
+    if (res.msg == '成功') {
+      that.mainData()
+      that.showBackReason()
+    }
   },
 
   async workOrderTemp() {
@@ -252,7 +275,6 @@ Page({
     })
   },
   async toWorker() {
-    console.log(this.data.actTemp)
     if (!this.data.actTemp && !this.data.actLeader) {
       wx.showToast({
         title: '未选择工单模板或负责人',
@@ -268,8 +290,16 @@ Page({
           "projectlearders": [this.data.actLeader.userid]
         }
       })
-      this.mainData()
-      this.showBackReason()
+      wx.showToast({
+        title: res.msg == '成功' ? '操作成功' : res.msg,
+        icon: "none",
+        mask: true
+      });
+      if (res.msg == '成功') {
+        this.mainData();
+        this.linkWorkOrder();
+        this.showBackReason()
+      }
     }
 
   },
@@ -278,6 +308,7 @@ Page({
       "id": "20230207154203",
       "version": 1,
       "content": {
+        nocache: true,
         "sa_serviceorderid": this.data.id
       }
     })
@@ -306,62 +337,13 @@ Page({
       progress: res.data
     })
   },
-  /**
-   * 生命周期函数--监听页面加载
-   */
   onLoad(options) {
     this.setData({
       id: options.id
     })
-    this.linkWorkOrder()
   },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
   onShow() {
-    this.mainData()
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
+    this.mainData();
+    this.linkWorkOrder();
   },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
 })

+ 3 - 8
Eservice/workerLeader/serviceBillDetail/index.wxml

@@ -52,7 +52,6 @@
     <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-empty wx:if="{{linkWorkOrders.length === 0}}" icon="root-list" t-class="empty-cls" t-class-image="t-empty__image" description="暂无工单" />
-
     </t-tab-panel>
     <t-tab-panel wx:if="{{orderMainData.servicetype !== '售前' && orderMainData.servicetype !== '历史售后'}}" label="售后商品" value="1">
       <view style="padding:10px" wx:if="{{list.length === 0}}">
@@ -77,8 +76,9 @@
 
 <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-textarea style="margin-top:20px" slot="content" placeholder="请输入退回原因" value="" disableDefaultPadding="{{true}}" bind:change="inputReason" autosize bordered />
 </t-dialog>
+
 <t-dialog visible="{{showToWoker}}" title="转工单" confirm-btn="确定" cancel-btn="取消" bind:confirm="toWorker" bind:cancel="showBackReason">
   <view slot="content">
     <view class="d-title">
@@ -97,10 +97,10 @@
         <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}}">
   <view slot="content">
     <scroll-view style="display: inline-block;width: 100%;height: 300px;" scroll-y>
@@ -111,15 +111,10 @@
         <t-divider align="left" />
       </view>
       <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>
-
 <!-- 底部 -->
-
 <block wx:if="{{tabbarsList.length!=0}}">
   <view style="height: 160rpx;" />
   <Yl_Tabbar list='{{tabbarsList}}' bind:callback="tabbarOnClick" />