v1
付延余
2022-07-19 2909406f4e67616aa8f618013534d43aae566f0c
pages/my-application/my-application.vue
@@ -2,7 +2,6 @@
   <!-- 我的申请 -->
   <view class="my-application">
      <!-- 搜索区域 -->
      <view class="searchBox">
         <view class="topRow">
            <view class="search">
@@ -80,12 +79,12 @@
                        <image src="@/static/home/biaodan.png" mode=""></image>
                        <view>表单数据</view>
                     </view>
                     <view v-if="item.status == 3">
                        <image src="@/static/home/history.png" mode="" ></image>
                     <view v-if="item.status == 3" @click="apply(item)">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>重新申请</view>
                     </view>
                     <view v-if="item.status == 3">
                        <image src="@/static/home/history.png" mode="" ></image>
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>编辑</view>
                     </view>
                     <view @click="approvalHistoryClick" v-if="item.status == 2 || item.status == 3">
@@ -144,9 +143,9 @@
   data() {
      return {
         status: ['草稿', '处理中', '已结束', '已撤回'],
         statusColor: ['#bbbbbb', '#FF9900', '#007AFF', '#06BE00'],
         statusColor: ['#dd8b8c', '#FF9900', '#007AFF', '#06BE00'],
         result: ['未提交', '处理中', '通过', '驳回'],
         resultColor: ['#bbbbbb', '#FF9900', '#06BE00', '#be2b2d'],
         resultColor: ['#dd8b8c', '#FF9900', '#06BE00', '#be2b2d'],
         // 搜索区域
         selectText: '',
         // 选择器
@@ -163,6 +162,19 @@
            id: '', // 撤回申请ID
            procInstId: ''
         },
         // 重新申请
         form: {
            sendMessage: true,
            sendSms: true,
            sendEmail: true,
            procDefId: '',
            assignees: [],
            priority: '0'
         },
         assigneeList: [],
         showAssign: false,
         isGateway: false,
         isCustom: false,
         // 批量删除申请
         batchDeleteModalShow: false,
         // 复选框
@@ -311,7 +323,7 @@
               this.withDrawData.procInstId = i.procInstId;
            }
         });
         this.$reqPost('withDraw', this.withDrawData).then(res => {
         this.$reqPost('withDraw', this.withDrawData, 'form').then(res => {
            console.log('res', res);
            if (res.code == 0) {
               uni.showToast({
@@ -339,6 +351,77 @@
      withDrawCancel() {
         this.withDrawShow = false;
      },
      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).then(res=>{
                        console.log('重新提交申请',res);
                        if(res.code == 0){
                           uni.showToast({
                              title:res.data,
                              icon:'success',
                              duration:2000
                           });
                        }
                     })
                  } else {
                     this.form.assignees = [];
                     this.showAssign = true;
                     this.error = '请进入"流程管理"为审批节点分配候选审批人员';
                  }
               }
            }
            console.log(this.form);
         });
         this.modalVisible = true;
      },
      // 批量删除模态框
      batchDeleteClick() {
         this.batchDeleteModalShow = true;