123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <template>
- <view class="content pending">
- <u-sticky bgColor="#fff">
- <view class="search-wrap">
- <view class="input-wrap">
- <u-search
- bgColor='#fff'
- :showAction='false'
- :placeholder="$t('base.list.inputPlaceholder')"
- @search="searchList"
- @clear='searchList'
- v-model="keyword">
- </u-search>
- <view class="search-btn" @click="searchList">{{$t("customer_meter.search")}}</view>
- </view>
- <!-- <uni-icons type="settings-filled" size='24' @click="onClickRight"></uni-icons> -->
- </view>
- </u-sticky>
- <view class="swiper-box">
- <template v-if="allPendingList.length">
- <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5">
- <u-list-item v-for="(item, index) in allPendingList" :key="index">
- <view class="order-card">
- <view class="order-card-title">
- {{$t('approval.approvalTitle')}}:{{item.fullName}}
- <u-tag v-if="item.status == 1" size="mini" plain borderColor="#4680F9" color="#4680F9" :text="$t('approval.examLoading')"></u-tag>
- <u-tag v-if="item.status == 2" size="mini" plain borderColor="#4680F9" color="#4680F9" :text="$t('approval.examPass')"></u-tag>
- <u-tag v-if="item.status == 3" size="mini" plain borderColor="#4680F9" color="#4680F9" :text="$t('approval.examReject')"></u-tag>
- <u-tag v-if="item.status == 4" size="mini" plain borderColor="#4680F9" color="#4680F9" :text="$t('approval.processReject')"></u-tag>
- <u-tag v-if="item.status == 5" size="mini" plain borderColor="#4680F9" color="#4680F9" :text="$t('approval.examStop')"></u-tag>
- </view>
- <view class="order-info">
- <p class="info-line">
- <text class="label">{{$t('approval.process')}}:</text>
- <text class="info">{{item.flowName || ''}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('approval.originatingTime')}}:</text>
- <text class="info">{{formatTime(item.startTime) || ''}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('approval.originator')}}:</text>
- <text class="info">{{item.userName || ''}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('approval.currentNode')}}:</text>
- <text class="info">{{item.thisStep || item.currentNodeName || ''}}</text>
- </p>
- <!-- <p class="info-line">
- <text class="label">{{$t('approval.urgency')}}</text>
- <text class="info" v-if="item.flowUrgent == 1">{{$t('approval.ordinary')}}</text>
- <text class="info" v-if="item.flowUrgent == 2">{{$t('approval.important')}}</text>
- <text class="info" v-if="item.flowUrgent == 3">{{$t('approval.urgent')}}</text>
- </p> -->
- <p class="info-line">
- <text class="label">{{$t('approval.timeReceipt')}}:</text>
- <text class="info">{{item.claimTime || ''}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('approval.expirationTime')}}:</text>
- <text class="info">{{item.dueDate || ''}}</text>
- </p>
- </view>
- <view>
- <view class="card-oper">
- <view class="btn">
- <button class="oper-btn bule" @click="audit(item)">{{$t('approval.adopt')}}</button>
- </view>
- <view class="btn">
- <button class="oper-btn red" @click="reject(item)">{{$t('approval.refuse')}}</button>
- </view>
- <view class="btn">
- <button class="oper-btn info" @click="checkView(item)">{{$t('approval.details')}}</button>
- </view>
- </view>
- </view>
-
- </view>
- </u-list-item>
- </u-list>
- </template>
- <template v-else>
- <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
- </u-empty>
- </template>
- </view>
- <u-loading-page
- color="#666"
- loading-mode="semicircle"
- :loading="loading">
- </u-loading-page>
- <u-modal :show="showReject" @confirm="confirm('reject')" ref="addModal" showCancelButton closeOnClickOverlay @cancel="showReject=false" @close="showReject=false">
- <view class="invite-box">
- <view class="invite-box-title">{{$t('approval.approvalComments')}}</view>
- <u--input :placeholder="$t('base.common.placeholderII')+$t('approval.approvalComments')" border="surround" v-model="handleOpinion"></u--input>
- </view>
- </u-modal>
- <u-modal :show="showAudit" @confirm="confirm('audit')" ref="addModal" showCancelButton closeOnClickOverlay @cancel="showAudit=false" @close="showAudit=false">
- <view class="invite-box">
- <view class="invite-box-title">{{$t('approval.approvalComments')}}</view>
- <u--input :placeholder="$t('base.common.placeholderII')+$t('approval.approvalComments')" border="surround" v-model="handleOpinion"></u--input>
- </view>
- </u-modal>
- <u-toast ref="loadingToast" />
- </view>
- </template>
- <script>
- import dayjs from 'dayjs'
- import {
- getPendingList,
- audit, //通过
- reject, //拒绝
- getApprovalInfo,
- } from "../../api/approval"
- import uniAgreementsVue from '../../components/uni-agreements/uni-agreements.vue'
- export default {
- data(){
- return{
- handleOpinion:'',
- showAudit:false,
- showReject:false,
- dayjs,
- page: {
- pages: 1,
- size: 10,
- },
- hasMore:false,
- allPendingList:[],
- keyword:'',
- loading:true,
- currentItem:undefined,
- currentId:undefined,
- enCode:undefined,
- }
- },
- onLoad(options) {
- this.getPendingList()
- },
- methods:{
- getPendingList(){
- this.loading=true
- let data={
- currentPage:this.page.pages,
- pageSize:this.page.size,
- keyword:this.keyword || '',
- }
- getPendingList(1,data).then(res=>{
- if (res.data.code == 200) {
- if (this.hasMore) {
- this.allPendingList = [
- ...this.allPendingList,
- ...res.data.data.list,
- ];
- } else {
- this.allPendingList = res.data.data.list;
- }
- console.log(this.allPendingList);
- this.total = res.data.data.pagination.total
- if (this.allPendingList.length >= this.total) {
- this.hasMore = false;
- } else {
- this.hasMore = true;
- }
- this.loading = false
- }
- })
- },
- audit(item){
- let encode = item.flowCode[0].toUpperCase()+item.flowCode.slice(1)
- getApprovalInfo(encode,item.processId).then(res=>{
- if(res.data.code == 200){
- this.currentItem = res.data.data
- this.showAudit = true
- this.currentId = item.id
- this.enCode=item.flowCode
- }
- })
- },
- reject(item){
- let encode = item.flowCode[0].toUpperCase()+item.flowCode.slice(1)
- getApprovalInfo(encode,item.processId).then(res=>{
- if(res.data.code == 200){
- this.currentItem = res.data.data
- this.showReject = true
- this.currentId = item.id
- this.enCode=item.flowCode
- }
- })
- },
- //确定
- confirm(value){
- let _this = this
- let data = {
- enCode:this.enCode,
- formData:this.currentItem,
- handleOpinion:this.handleOpinion,
- copyIds: "",
- signImg: ""
- }
- this.showReject=false
- this.showAudit=false
- this.$refs.loadingToast.show({
- type:"loading",
- message: _this.$t('base.common.loading'),
- duration:'100000',
- })
- if(value == 'audit'){
- audit(this.currentId,data).then(res=>{
- this.$refs.loadingToast.hide()
- if(res.data.code == 200){
- uni.showToast({
- title: _this.$t('approval.approved'),
- icon: 'success',
- })
- this.searchList()
- }else{
- uni.showToast({
- title: res.data.msg || _this.$t('base.common.equestFailed'),
- icon: 'none',
- })
- }
- })
- }else{
- reject(this.currentId,data).then(res=>{
- this.$refs.loadingToast.hide()
- if(res.data.code == 200){
- uni.showToast({
- title: _this.$t('approval.approvalRejection'),
- icon: 'success',
- })
- this.searchList()
- }else{
- uni.showToast({
- title: res.data.msg || _this.$t('base.common.equestFailed'),
- icon: 'none',
- })
- }
- })
- }
- },
- //加载更多
- scrolltolower() {
- console.log("1111111111111111");
- if (this.hasMore) {
- this.page.pages += 1;
- this.getPendingList();
- }
- },
- checkView(item){
- console.log(item);
- uni.navigateTo({ url: '/subpages/approvalform/'+item.flowCode+'?id='+item.processId })
- },
- //搜索列表
- searchList(){
- this.page.pages = 1
- this.hasMore = false
- this.getPendingList()
- },
- //转化时间
- formatTime(time){
- let str =''
- if(time){
- time = Number(time)
- str=dayjs(time).format('YYYY-MM-DD HH:mm:ss')
- }else{
- str =''
- }
- return str
- }
- }
- }
- </script>
- <style>
- /* #ifndef APP-NVUE */
- view {
- /* display: flex; */
- box-sizing: border-box;
- /* flex-direction: column; */
- }
- page {
- box-sizing: border-box;
- /* padding: 40rpx 40rpx 80rpx; */
- height: 100%;
- }
- /* #endif*/
- </style>
- <style lang="scss" scoped>
- @import '../../common/css/approval.scss';
- /deep/ .u-modal__content{
- flex-direction: column;
- }
- </style>
|