| | |
| | | <template> |
| | | <!-- 我的申请 --> |
| | | <view class="my-application"> |
| | | <view class="my-application" > |
| | | <!-- 搜索区域 --> |
| | | |
| | | <view class="searchBox"> |
| | | <view class="topRow"> |
| | | <view class="search"> |
| | |
| | | </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> |
| | |
| | | <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> |
| | | <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> |
| | | <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> |
| | |
| | | </view> |
| | | </template> |
| | | </combination-card> |
| | | </u-checkbox-group> |
| | | <!-- </u-checkbox-group> --> |
| | | |
| | | <!-- 撤回模态框 --> |
| | | <view class="wodeshenqingMotai"> |
| | |
| | | @cancel="batchDeleteModalCancel" |
| | | ></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"> |
| | | <view class="bottomTabbar_checkBox"> |
| | | <!-- <u-checkbox-group size="35" v-model="totalSelectValue" placement="column" @change="totalSelectChange"> |
| | | <u-checkbox labelSize="13px" label="全选" name="tatalSelect"></u-checkbox> |
| | | </u-checkbox-group> |
| | | </view> |
| | | </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> |
| | |
| | | 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: '', |
| | | // 选择器 |
| | |
| | | id: '', // 撤回申请ID |
| | | procInstId: '' |
| | | }, |
| | | // 重新申请 |
| | | form: { |
| | | sendMessage: true, |
| | | sendSms: true, |
| | | sendEmail: true, |
| | | procDefId: '', |
| | | assignees: [], |
| | | priority: '0' |
| | | }, |
| | | assigneeList: [], |
| | | showAssign: false, |
| | | isGateway: false, |
| | | isCustom: false, |
| | | // 批量删除申请 |
| | | batchDeleteModalShow: false, |
| | | // 复选框 |
| | |
| | | if (this.menuShow == true) { |
| | | this.$refs.menuRef.menuClick(); |
| | | } |
| | | this.myApplication.pageNumber = 1; |
| | | this.init(); |
| | | }, |
| | | // 点击导航栏菜单后 |
| | |
| | | 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(); |
| | |
| | | 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(); // 关闭加载动画 |
| | | }); |
| | |
| | | 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) { |
| | |
| | | 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({ |
| | | title: res.data, |
| | | duration: 2000 |
| | | }); |
| | | this.withDrawShow = false; |
| | | // 初始化申请列表 |
| | | this.shenqingData = []; |
| | | this.myApplication.pageNumber = 1; |
| | | this.getMoreNews(); |
| | | } |
| | | this.withDrawShow = false; |
| | | // 初始化申请列表 |
| | | this.myApplication.pageNumber = 1; |
| | | this.shenqingData = []; |
| | | this.getMoreNews(); |
| | | }); |
| | | |
| | | console.log(this.withDrawId); |
| | |
| | | }, |
| | | 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,'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(); |
| | | }) |
| | | } else { |
| | | this.form.assignees = []; |
| | | this.showAssign = true; |
| | | this.error = '请进入"流程管理"为审批节点分配候选审批人员'; |
| | | } |
| | | } |
| | | } |
| | | console.log(this.form); |
| | | }); |
| | | |
| | | this.modalVisible = true; |
| | | // } |
| | | }, |
| | | // 修改申请 |
| | | editMyApplication(v){ |
| | | console.log('修改申请'); |
| | | uni.navigateTo({ |
| | | url: `/pages/edit-my-application/edit-my-application?index=${v.tableId}` |
| | | }); |
| | | }, |
| | | // 批量删除模态框 |
| | | batchDeleteClick() { |
| | |
| | | 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}` |
| | | }); |
| | | }, |
| | | // 新增申请 |