付延余
2022-12-19 d698c77ac8f21ef383a1557be3dfdabbc2d76d61
pages/home/home.vue
@@ -50,7 +50,7 @@
               <view class="bottom-container">
                  <!-- 按钮区域 -->
                  <view class="bottom-content__chulizhong bottom-content__item">
                     <view @click="withDrawClick(item.id)" v-if="item.status == 1">
                     <view @click="withDrawClick(item.procInstId)" v-if="item.status == 1">
                        <image src="@/static/home/cehui.png" mode=""></image>
                        <view>撤回</view>
                     </view>
@@ -58,21 +58,25 @@
                        <image src="@/static/home/jindu.png" mode=""></image>
                        <view>查看进度</view>
                     </view>
                     <view @click="theFormDataClick(item.tableId)" v-if="(item.status == 1 || item.status == 2) && item.procDefId == 'WAY_BILL:4:87504'">
                     <view @click="theFormDataClick(item.tableId)" v-if="(item.status == 1 || item.status == 2 || item.status == 3) && item.processName == '发运通知单'">
                        <image src="@/static/home/biaodan.png" mode=""></image>
                        <view>表单数据</view>
                        <view>申请详情</view>
                     </view>
                     <view @click="apply(item)" v-if="item.status == 3">
                     <!-- <view @click="apply(item)" v-if="item.status == 3">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>重新申请</view>
                     </view>
                     <view @click="editMyApplication(item)" v-if="item.status == 3 && item.procDefId == 'WAY_BILL:4:87504'">
                     </view> -->
                     <view @click="editMyApplication(item)" v-if="item.status == 1 && item.processName == '发运通知单'">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>编辑</view>
                     </view>
                     <view @click="approvalHistoryClick(item.procInstId)" v-if="item.status == 2 || item.status == 3">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>审批历史</view>
                     </view>
                     <view @click="deleteWithDrawApplication(item.tableId)" v-if="item.status == 3">
                        <image src="@/static/home/delete.png" mode=""></image>
                        <view>删除</view>
                     </view>
                  </view>
                  <!-- 已结束小组按钮 -->
@@ -120,10 +124,10 @@
               <view class="bottom-container">
                  <!-- 待办按钮 -->
                  <view class="bottom-content__item">
                     <!-- <view @click="theFormDataClick">
                     <view @click="theFormDataClick(item.tableId)">
                <image src="@/static/home/jindu.png" mode=""></image>
                <view>申请详情</view>
              </view> -->
              </view>
                     <view @click="adopClick(item)">
                        <image src="@/static/home/tongguo.png" mode=""></image>
                        <view>通过</view>
@@ -163,7 +167,7 @@
                  </view>
                  <view class="center-content__two center-margin">
                     <view>
                        <text>发起人:{{ item.actBusiness.createByName }}</text>
                        <text>发起人:{{ item.actBusiness.createByName || '' }}</text>
                     </view>
                     <view>
                        <text>审批操作:{{ item.deleteReason }}</text>
@@ -171,7 +175,7 @@
                  </view>
                  <view class="center-content__three center-margin">
                     <view class="">
                        <text>审批意见:{{ item.comment || '' }}</text>
                        <text>审批意见:{{ item.comment=='undefined'?'未填写':item.comment || '未填写' }}</text>
                     </view>
                     <view class="">
                        <text>
@@ -194,7 +198,7 @@
               <view class="bottom-container">
                  <!-- 已办按钮 -->
                  <view class="bottom-content__item">
                     <view @click="theFormDataClick(item.tableId)" v-if="item.procDefId == 'WAY_BILL:4:87504'">
                     <view @click="theFormDataClick(item.tableId)" v-if="item.processName == '发运通知单'">
                        <image src="@/static/home/biaodan.png" mode=""></image>
                        <view>表单数据</view>
                     </view>
@@ -245,8 +249,11 @@
      <!-- 撤回模态框 -->
      <view class="wodeshenqingMotai">
         <u-modal width="684rpx" :show="withDrawShow" title="撤回原因" :showCancelButton="true" @confirm="withDrawConfirm" @cancel="withDrawCancel">
            <view class="slot-content"><u--textarea v-model="withDrawData.reason" placeholder="请输入撤回原因"></u--textarea></view>
         <u-modal width="684rpx" :show="withDrawShow" title="提示" :showCancelButton="true" @confirm="withDrawConfirm" @cancel="withDrawCancel">
            <view class="slot-content">
               <!-- <u--textarea v-model="withDrawData.reason" placeholder="请输入撤回原因"></u--textarea> -->
               <text>确认撤回该申请吗?</text>
            </view>
         </u-modal>
      </view>
@@ -309,10 +316,10 @@
               <view class="top"><u-icon name="backspace" color="#FF4233" size="70"></u-icon></view>
               <view class="bottom-text"><text>退出</text></view>
            </view>
            <view class="utils-container-body" @click="huanBang">
            <!-- <view class="utils-container-body" @click="huanBang">
               <view class="top"><u-icon name="lock-open" color="#1987FF" size="70"></u-icon></view>
               <view class="bottom-text"><text>换绑</text></view>
            </view>
            </view> -->
         </view>
      </view>
      <u-gap height="60" bgColor="#eeeeee"></u-gap>
@@ -368,8 +375,8 @@
         withDrawShow: false,
         fyData: [],
         withDrawData: {
            reason: '',
            id: '', // 撤回申请ID
            // reason: '',
            // id: '', // 撤回申请ID
            procInstId: ''
         },
         withDrawContent: '',
@@ -594,18 +601,12 @@
         this.menuShow = e;
      },
      // 撤回模态框
      withDrawClick(id) {
      withDrawClick(procInstId) {
         this.withDrawShow = true;
         this.withDrawData.id = id;
         this.withDrawData.procInstId = procInstId;
      },
      withDrawConfirm() {
         this.shenqingData.forEach(i => {
            if (i.id == this.withDrawData.id) {
               this.withDrawData.procInstId = i.procInstId;
            }
         });
         if (this.withDrawData.reason.length >= 2) {
            this.$reqPost('withDraw', this.withDrawData, 'form').then(res => {
            this.$reqPost('cancel', this.withDrawData).then(res => {
               this.withDrawShow = false;
               if (res.code == 0) {
                  uni.showToast({
@@ -613,14 +614,14 @@
                     duration: 2000
                  });
               }
               // 刷新列表
               this.getProcessDataList();
               this.todoList();
               this.doneList();
            });
         } else {
            uni.showToast({
               title: '请规范输入',
               duration: 2000
            });
         }
      },
      withDrawCancel() {
         this.withDrawShow = false;
      },
      // 通过
      adopClick(v) {
@@ -637,13 +638,14 @@
      adoptModalConfirm() {
         this.adoptModalShow = false;
         this.adoptForm.comment = this.adoptModalContent;
         this.$reqPost('passAll', this.adoptForm, 'form').then(res => {
         this.$reqPost('passAll', this.adoptForm).then(res => {
            if (res.code == 0) {
               this.$u.toast('操作成功!');
            } else {
               this.$u.toast('添加失败!!');
               this.$u.toast('通过失败!!');
            }
            this.todoList(); // 我的待办
            this.doneList();
         });
      },
      adoptModalCancel() {
@@ -659,20 +661,24 @@
      rejectModalConfirm() {
         this.rejectModalShow = false;
         this.$reqPost('backAll', this.rejectForm, 'form').then(res => {
         this.$reqPost('backAll', this.rejectForm).then(res => {
            if (res.code == 0) {
               this.$u.toast('操作成功!');
            } else {
               this.$u.toast('操作失败!!!');
            }
            this.todoList(); // 我的待办
            this.doneList();
         });
      },
      rejectModalCancel() {
         this.rejectModalShow = false;
      },
      withDrawCancel() {
         this.withDrawShow = false;
      // 删除申请
      deleteApplicationClick(id) {
         this.deleteApplicationModalShow = true;
         this.procInstId = id;
         console.log(id);
      },
      // 删除申请模态框
      deleteApplicationModalConfirm() {
@@ -702,83 +708,112 @@
            url: `/pages/the-form-data/the-form-data?index=${v}`
         });
      },
      // 重新申请
      apply(v) {
         if (!v.procDefId || v.procDefId == 'null') {
            this.$u.toast('流程定义为空');
            return;
         }
         this.form.id = v.id;
         this.form.procDefId = v.procDefId;
         this.form.title = v.title;
         // 加载审批人
         // this.userLoading = true;
         uni.showLoading({
            title: '审批人加载中'
         });
         // getFirstNode(v.procDefId).then((res) => {
         this.$reqGet('getFirstNode', {}, v.procDefId).then(res => {
            // this.userLoading = false;
            console.log('审批人', res);
            uni.hideLoading();
            if (res.data) {
               this.error = '';
               if (res.data.type == 3 || res.data.type == 4) {
                  this.isGateway = true;
                  this.form.firstGateway = true;
                  this.showAssign = false;
                  this.isCustom = false;
                  return;
      // 删除撤回申请
      deleteWithDrawApplication(id){
         uni
            .request({
               url: `${BaseUrl}/yunxiao/xswaybill/${id}`,
               method: 'DELETE',
               header: {
                  'TENANT-ID': 5,
                  Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
                  VERSION: 'zzl'
               }
               if (res.data.type == 5) {
                  this.isCustom = true;
                  this.isGateway = false;
                  this.form.firstGateway = false;
                  this.showAssign = false;
                  return;
               }
               if (res.data.type == 1) {
                  this.showAssign = true;
                  this.isGateway = false;
                  this.form.firstGateway = false;
                  this.isCustom = false;
                  if (res.data.users && res.data.users.length > 0) {
                     this.assigneeList = res.data.users;
                     // 默认勾选
                     let ids = [];
                     res.data.users.forEach(e => {
                        ids.push(e.userId);
                     });
                     this.form.assignees = ids;
                     this.showAssign = true;
                     // 获取表单内容,重新创建申请
                     this.$reqPost('apply', this.form, 'form').then(res => {
                        console.log('重新提交申请', res);
                        if (res.code == 0) {
                           uni.showToast({
                              title: res.data,
                              icon: 'success',
                              duration: 2000
                           });
                        }
                        // 初始化申请列表
                        // this.myApplication.pageNumber = 1;
                        // this.shenqingData = [];
                        // this.getMoreNews();
                        this.getProcessDataList();
                     });
                  } else {
                     this.form.assignees = [];
                     this.showAssign = true;
                     this.error = '请进入"流程管理"为审批节点分配候选审批人员';
                  }
               }
            }
            console.log(this.form);
         });
         this.modalVisible = true;
            })
            .then(res => {
               uni.showToast({
                  title:'删除成功',
                  icon:'none'
               })
               // 刷新列表
               this.getProcessDataList();
            })
            .catch(err => {
               uni.showToast({
                  title:'删除出错',
                  icon:'none'
               })
            });
      },
      // 重新申请
      // apply(v) {
      //    if (!v.procDefId || v.procDefId == 'null') {
      //       this.$u.toast('流程定义为空');
      //       return;
      //    }
      //    this.form.id = v.id;
      //    this.form.procDefId = v.procDefId;
      //    this.form.title = v.title;
      //    // 加载审批人
      //    // this.userLoading = true;
      //    uni.showLoading({
      //       title: '审批人加载中'
      //    });
      //    // getFirstNode(v.procDefId).then((res) => {
      //    this.$reqGet('getFirstNode', {}, v.procDefId).then(res => {
      //       // this.userLoading = false;
      //       console.log('审批人', res);
      //       uni.hideLoading();
      //       if (res.data) {
      //          this.error = '';
      //          if (res.data.type == 3 || res.data.type == 4) {
      //             this.isGateway = true;
      //             this.form.firstGateway = true;
      //             this.showAssign = false;
      //             this.isCustom = false;
      //             return;
      //          }
      //          if (res.data.type == 5) {
      //             this.isCustom = true;
      //             this.isGateway = false;
      //             this.form.firstGateway = false;
      //             this.showAssign = false;
      //             return;
      //          }
      //          if (res.data.type == 1) {
      //             this.showAssign = true;
      //             this.isGateway = false;
      //             this.form.firstGateway = false;
      //             this.isCustom = false;
      //             if (res.data.users && res.data.users.length > 0) {
      //                this.assigneeList = res.data.users;
      //                // 默认勾选
      //                let ids = [];
      //                res.data.users.forEach(e => {
      //                   ids.push(e.userId);
      //                });
      //                this.form.assignees = ids;
      //                this.showAssign = true;
      //                // 获取表单内容,重新创建申请
      //                this.$reqPost('apply', this.form, 'form').then(res => {
      //                   console.log('重新提交申请', res);
      //                   if (res.code == 0) {
      //                      uni.showToast({
      //                         title: res.data,
      //                         icon: 'success',
      //                         duration: 2000
      //                      });
      //                   }
      //                   // 初始化申请列表
      //                   // this.myApplication.pageNumber = 1;
      //                   // this.shenqingData = [];
      //                   // this.getMoreNews();
      //                   this.getProcessDataList();
      //                });
      //             } else {
      //                this.form.assignees = [];
      //                this.showAssign = true;
      //                this.error = '请进入"流程管理"为审批节点分配候选审批人员';
      //             }
      //          }
      //       }
      //       console.log(this.form);
      //    });
      //    this.modalVisible = true;
      // },
      // 修改
      editMyApplication(v) {
         console.log('修改申请');
@@ -792,12 +827,7 @@
            url: `/pages/approval-history/approval-history?index=${v}`
         });
      },
      // 删除申请
      deleteApplicationClick(id) {
         this.deleteApplicationModalShow = true;
         this.procInstId = id;
         console.log(id);
      },
      redirectLogin() {
         redirectLogin();
      },
@@ -820,7 +850,8 @@
   .utils {
      .utils-container {
         display: flex;
         justify-content: space-between;
         // justify-content: space-between;
         justify-content: center;
         width: 66%;
         margin: 0 auto;
         .utils-container-body {