付延余
2022-07-26 7c3218e12105b87cab21e9ced57c99c339ffac10
pages/my-application/my-application.vue
@@ -20,17 +20,17 @@
         </view>
         <!-- 时间选择器 -->
         <view class="example-body"><uni-datetime-picker v-model="range" type="daterange" @maskClick="maskClick" /></view>
         <view class="searchBtn"><u-button type="primary" text="搜索" @click="searchClick"></u-button></view>
         <view class="searchBtn"><u-button type="primary" text="搜索" @click="searchClick"></u-button> <u-button type="primary" :plain="true" text="清空" @click="emptyButtonClick"></u-button></view>
      </view>
      <!-- 选择器 -->
      <u-picker @cancel="dataSelectCancel" @confirm="selectConfirm" :show="selectPickerShow" :columns="selectList"></u-picker>
      <!-- 我的申请卡片区域 -->
      <u-checkbox-group v-model="checkBoxValue" placement="column" @change="checkboxChange" style="margin-bottom:50px">
      <!-- <u-checkbox-group v-model="checkBoxValue" placement="column" @change="checkboxChange" style="margin-bottom:150px"> -->
         <combination-card v-for="(item, index) in shenqingData" index="index">
            <template v-slot:top>
               <u-checkbox size="35" :key="item.id" :name="item.id"></u-checkbox>
               <!-- <u-checkbox size="35" :key="item.id" :name="item.id"></u-checkbox> -->
               <view>
                  <text>{{ item.title }}</text>
               </view>
@@ -71,11 +71,11 @@
                        <image src="@/static/home/cehui.png" mode=""></image>
                        <view>撤回</view>
                     </view>
                     <view @click="checkTheScheduleClick" v-if="item.status == 1">
                     <view @click="checkTheScheduleClick(item.procInstId)" v-if="item.status == 1">
                        <image src="@/static/home/jindu.png" mode=""></image>
                        <view>查看进度</view>
                     </view>
                     <view @click="theFormDataClick" v-if="item.status == 1 || item.status == 2">
                     <view @click="theFormDataClick(item.tableId)" v-if="item.status == 1 || item.status == 2">
                        <image src="@/static/home/biaodan.png" mode=""></image>
                        <view>表单数据</view>
                     </view>
@@ -83,11 +83,11 @@
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>重新申请</view>
                     </view>
                     <view v-if="item.status == 3">
                     <view v-if="item.status == 3" @click="editMyApplication(item)">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>编辑</view>
                     </view>
                     <view @click="approvalHistoryClick" v-if="item.status == 2 || item.status == 3">
                     <view @click="approvalHistoryClick(item.procInstId)" v-if="item.status == 2 || item.status == 3">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>审批历史</view>
                     </view>
@@ -95,7 +95,7 @@
               </view>
            </template>
         </combination-card>
      </u-checkbox-group>
      <!-- </u-checkbox-group> -->
      <!-- 撤回模态框 -->
      <view class="wodeshenqingMotai">
@@ -116,15 +116,19 @@
         ></u-modal>
      </view>
      <view class="" style="height:50px;">
      </view>
      <!-- 底部全选 -->
      <view class="bottomTabbar">
         <view class="bottomTabbar_checkBox">
            <u-checkbox-group size="35" v-model="totalSelectValue" placement="column" @change="totalSelectChange">
            <!-- <u-checkbox-group size="35" v-model="totalSelectValue" placement="column" @change="totalSelectChange">
               <u-checkbox labelSize="13px" label="全选" name="tatalSelect"></u-checkbox>
            </u-checkbox-group>
            </u-checkbox-group> -->
         </view>
         <view class="bottomTabbar_button">
            <u-button :plain="true" type="primary" text="批量删除" @click="batchDeleteClick"></u-button>
            <!-- <u-button :plain="true" type="primary" text="批量删除" @click="batchDeleteClick"></u-button> -->
            <u-button type="primary" text="新增申请" @click="newApplicationClick"></u-button>
         </view>
      </view>
@@ -210,6 +214,7 @@
      if (this.menuShow == true) {
         this.$refs.menuRef.menuClick();
      }
      this.myApplication.pageNumber = 1;
      this.init();
   },
   // 点击导航栏菜单后
@@ -246,6 +251,17 @@
         this.getMoreNews();
      }, 1000);
   },
   // 下拉加载
   onPullDownRefresh() {
      console.log('refresh');
      this.myApplication.pageNumber = 1;
      this.loadingType = 0;
      this.shenqingData = [];
      setTimeout(()=> {
         uni.stopPullDownRefresh();
      }, 1000);
      this.init();
   },
   methods: {
      init() {
         this.getMoreNews();
@@ -279,7 +295,12 @@
               return;
            }
            // this.myApplication.pageNumber++; // 每触底一次 page +1
            this.shenqingData = this.shenqingData.concat(response.data.records); //将数据拼接在一起
            if(this.myApplication.title||this.myApplication.status||this.myApplication.result||this.myApplication.startTime||this.myApplication.endTime){
               this.shenqingData = response.data.records
            } else{
               this.shenqingData = this.shenqingData.concat(response.data.records);
            }
             //将数据拼接在一起
            this.loadingType = 0; // 将loadingType归0重置
            uni.hideNavigationBarLoading(); // 关闭加载动画
         });
@@ -307,10 +328,16 @@
         console.log('maskClick事件:', e);
      },
      searchClick() {
         // if(this.myApplication.title || this.myApplication.status || this.myApplication.result ||  this.myApplication.startTime || this.myApplication.endTime){
         console.log('this.myApplication', this.myApplication);
         this.getProcessDataList();
         // }
         this.myApplication.pageNumber = 1;
         this.loadingType = 0;
         this.getMoreNews();
      },
      emptyButtonClick(){
         this.myApplication.title = '';
         this.selectText = '';
         this.range = [];
         this.init();
      },
      // 撤回模态框
      withDrawClick(id) {
@@ -330,12 +357,12 @@
                  title: res.data,
                  duration: 2000
               });
            }
               this.withDrawShow = false;
               // 初始化申请列表
               this.shenqingData = [];
               this.myApplication.pageNumber = 1;
            this.shenqingData = [];
               this.getMoreNews();
            }
         });
         console.log(this.withDrawId);
@@ -400,7 +427,7 @@
                     this.form.assignees = ids;
                     this.showAssign = true;
                     // 获取表单内容,重新创建申请
                     this.$reqPost('apply',this.form).then(res=>{
                     this.$reqPost('apply',this.form,'form').then(res=>{
                        console.log('重新提交申请',res);
                        if(res.code == 0){
                           uni.showToast({
@@ -409,6 +436,10 @@
                              duration:2000   
                           });
                        }
                        // 初始化申请列表
                        this.myApplication.pageNumber = 1;
                        this.shenqingData = [];
                        this.getMoreNews();
                     })
                  } else {
                     this.form.assignees = [];
@@ -421,6 +452,14 @@
         });
         
         this.modalVisible = true;
      // }
      },
      // 修改申请
      editMyApplication(v){
         console.log('修改申请');
         uni.navigateTo({
            url: `/pages/edit-my-application/edit-my-application?index=${v.tableId}`
         });
      },
      // 批量删除模态框
      batchDeleteClick() {
@@ -452,21 +491,21 @@
         console.log('totalChange', n);
      },
      // 查看进度
      checkTheScheduleClick() {
      checkTheScheduleClick(v) {
         uni.navigateTo({
            url: '/pages/check-the-schedule/check-the-schedule'
            url: `/pages/check-the-schedule/check-the-schedule?index=${v}`
         });
      },
      // 表单数据
      theFormDataClick() {
      theFormDataClick(v) {
         uni.navigateTo({
            url: '/pages/the-form-data/the-form-data'
            url: `/pages/the-form-data/the-form-data?index=${v}`
         });
      },
      // 审批历史
      approvalHistoryClick() {
      approvalHistoryClick(v) {
         uni.navigateTo({
            url: '/pages/approval-history/approval-history'
            url: `/pages/approval-history/approval-history?index=${v}`
         });
      },
      // 新增申请