瀏覽代碼

工单服务管理添加作废按钮

xiaohaizhao 2 年之前
父節點
當前提交
2fd27e9274

+ 15 - 5
Eservice/workerLeader/editworkOrderDetail/index.js

@@ -22,16 +22,20 @@ Page({
     })
     this.workerData()
   },
-  changeBillStatus(data) {
-    let id = data.currentTarget.dataset.id
+  changeBillStatus(e) {
+    const {
+      id,
+      name
+    } = e.target.dataset;
+    if (!name) return;
     const dialogConfig = {
       context: this,
       title: '提示',
-      content: '确认执行当前操作吗?',
-      confirmBtn: '确定',
+      content: `是否确定${name}当前工单?`,
+      confirmBtn: name,
       cancelBtn: '取消',
     }
-
+    // return console.log(id)
     Dialog.confirm(dialogConfig)
       .then(async () => {
         const res = await api._post({
@@ -40,6 +44,12 @@ Page({
             "sa_workorderid": this.data.id
           }
         })
+        console.log(res)
+        wx.showToast({
+          title: res.msg == '成功' ? `工单${name}成功` : res.msg,
+          icon: "none",
+          mask: true
+        })
         this.mainData()
       })
       .catch(() => console.log('点击了取消'))

+ 55 - 13
Eservice/workerLeader/editworkOrderDetail/index.scss

@@ -1,38 +1,80 @@
-
-page{
+page {
   background-color: #f1f2f3;
 }
-.type{
+
+.type {
   padding: 5px;
   font-size: 22rpx;
-  color:#fff;
+  color: #fff;
   letter-spacing: 3px;
   writing-mode: vertical-lr;
   background: #4F7BFD;
   border-radius: 3px;
-  margin-right:5px ;
+  margin-right: 5px;
 }
-.flex-column-between{
+
+.flex-column-between {
   height: 100%;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
 }
-.small{
+
+.small {
   font-size: 26rpx;
-  color:#333;
+  color: #333;
   line-height: 25px;
 }
-.mr-5{
+
+.mr-5 {
   margin-right: 5px;
 }
-.mt-5{
+
+.mt-5 {
   margin-bottom: 5px;
 }
-.textIndentNodeChild{
+
+.textIndentNodeChild {
   padding-left: 10px;
 }
-.smallChild{
+
+.smallChild {
   font-size: 24rpx;
-  color:#666
+  color: #666
+}
+
+.footer {
+  display: flex;
+  justify-content: space-between;
+  padding: 0 30rpx;
+  position: fixed;
+  width: 100vw;
+  height: 130rpx;
+  background: #FFFFFF;
+  box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+  bottom: 0;
+  box-sizing: border-box;
+  z-index: 9999;
+  padding-top: 10rpx;
+
+  .but-box {
+    .but {
+      min-width: 180rpx;
+      height: 90rpx;
+      background: #3874F6;
+      border-radius: 8rpx;
+      font-size: 28rpx;
+      font-family: PingFang SC-Bold, PingFang SC;
+      font-weight: bold;
+      color: #FFFFFF;
+    }
+
+    .delete {
+      background: var(--warning);
+    }
+
+    .abandon {
+      background: var(--error);
+    }
+  }
 }

+ 20 - 17
Eservice/workerLeader/editworkOrderDetail/index.wxml

@@ -21,7 +21,9 @@
   <card>
     <view slot="content">
       <view style="margin-bottom: 5px;" class="small"><text class="label">工单编号:</text>{{billData.billno}}</view>
-      <view  style="margin-bottom: 5px;" class="small"><t-button size="extra-small" theme="light" bind:tap="toWorkConfirmInfo">查看工单确认信息</t-button></view>
+      <view style="margin-bottom: 5px;" class="small">
+        <t-button size="extra-small" theme="light" bind:tap="toWorkConfirmInfo">查看工单确认信息</t-button>
+      </view>
       <view style="margin-bottom: 5px;" class="small"><text class="label">现场联系人:</text>{{billData.scenecontact}}</view>
       <view class="small flex-align-center"><text class="label">联系电话:</text>
         <t-call phone="{{billData.scenecontactphonenumber}}">{{billData.scenecontactphonenumber}}</t-call>
@@ -50,7 +52,9 @@
             {{index + 1}}-{{childIndex + 1}}.{{child.workpresetjson.workname}}
             <image-view isdelete="{{false}}" wx:if="{{child.attinfos.length > 0}}" list="{{child.attinfos}}"></image-view>
             <view class="small">
-              <text class="colorInfo">{{child.finishdate}}</text><t-tag class="mr-5 mt-5" variant="dark" theme="{{child.status == 0?'danger':child.status == 1?'success':'primary'}}" size="small">{{child.status == 0?'未完成':child.status == 1?'完成':'进行中'}}</t-tag> <t-tag wx:if="{{child.finishby}}" class="mr-5 mt-5" variant="dark" theme="primary" size="small">{{child.finishby}}</t-tag>
+              <text class="colorInfo">{{child.finishdate}}</text>
+              <t-tag class="mr-5 mt-5" variant="dark" theme="{{child.status == 0?'danger':child.status == 1?'success':'primary'}}" size="small">{{child.status == 0?'未完成':child.status == 1?'完成':'进行中'}}</t-tag>
+              <t-tag wx:if="{{child.finishby}}" class="mr-5 mt-5" variant="dark" theme="primary" size="small">{{child.finishby}}</t-tag>
             </view>
           </navigator>
           <t-divider dashed />
@@ -60,31 +64,30 @@
     <t-tab-panel label="确认单" value="1">
       <t-cell wx:for="{{confirmBills}}" wx:key="sa_workorder_confirmationid" title="{{item.confirmationno}}" data-item="{{item}}" hover arrow bind:click="toConfirmBill"></t-cell>
     </t-tab-panel>
-  </t-tabs>  
-</view>
-
-<view style="padding:0 10px 10px 10px">
-  <t-button wx:if="{{billData.status === '进行中'}}" theme="dark" variant="primary" data-id="20230209144603" bind:tap="changeBillStatus" block>暂停</t-button>
-  <t-button wx:if="{{billData.status === '暂停'}}" theme="dark" variant="primary" data-id="20230209144703" bind:tap="changeBillStatus" block>启用</t-button>
+  </t-tabs>
 </view>
+<block wx:if="{{billData.status !== '作废'}}">
+  <view style="height: 160rpx;" />
+  <view class="footer">
+    <view />
+    <view class="but-box" bindtap="changeBillStatus">
+      <van-button wx:if="{{billData.status !== '完成'}}" data-name="作废" data-id="20230209144803" custom-class='but abandon' bind:click="submit">作废</van-button>
+      <van-button wx:if="{{billData.status === '进行中'}}" data-name="暂停" data-id="20230209144603" custom-class='but delete' bind:click="deleteItem">暂停</van-button>
+      <van-button wx:if="{{billData.status === '暂停'}}" data-name="启用" data-id="20230209144703" custom-class='but' bind:click="notarize">启用</van-button>
+    </view>
+  </view>
+</block>
 
 <t-dialog id="t-dialog" />
 
-<t-dialog
-  visible="{{workLeaderDialog}}"
-  title="转工单"
-  confirm-btn="确定"
-  cancel-btn="取消"
-  bind:confirm="toWorker"
-  bind:cancel="showWorkerDialog"
->
+<t-dialog visible="{{workLeaderDialog}}" title="转工单" confirm-btn="确定" cancel-btn="取消" bind:confirm="toWorker" bind:cancel="showWorkerDialog">
   <view slot="content">
     <view class="d-title">
       选择负责人:
     </view>
     <view>
       <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>
   </view>