pages-workFlow-flowTodo-index.D3FWRUkZ.js 7.0 KB

1
  1. import{g as t,Z as s,Y as e,k as a,X as o,m as i,w as r,o as n,p as l,q as u,z as c,a1 as h}from"./index-C9TJPork.js";import{_ as m}from"./u-search.DOsDiA_z.js";import{r as p}from"./uni-app.es.CUt9gedF.js";import{_ as d}from"./u-tabs.CYgabJiD.js";import{_ as g}from"./u-subsection.D8Of0b4C.js";import{_ as f}from"./mescroll-body.DWp9Rb53.js";import{r as y}from"./resources.DEPsJg7u.js";import{M as b}from"./mescroll-mixins.C2YUWJKd.js";import{g as w,a as k,f as L}from"./flowList.7z63vEXk.js";import{_ as T}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.BNGPST4x.js";import"./u-badge.BHkDpFBd.js";import"./renderjs.Cg3LvhxW.js";import"./u-swipe-action.BhRxbaFQ.js";const x={1:[{name:"全部",status:""},{name:"协办",status:"7"},{name:"退回",status:"5"},{name:"超时",status:"-2"}],2:[{name:"全部",status:""},{name:"协办",status:"7"},{name:"退回",status:"5"},{name:"超时",status:"-2"}],3:[{name:"全部",status:""},{name:"待提交",status:"0"},{name:"进行中",status:"1"},{name:"已完成",status:"2"}],4:[{name:"全部",status:""},{name:"同意",status:"1"},{name:"拒绝",status:"2"},{name:"转审",status:"3"},{name:"加签",status:"4"},{name:"退回",status:"5"}],5:[{name:"全部",status:""},{name:"已读",status:"1"},{name:"未读",status:"0"}]},S=t("sysConfigInfo");const j=T({components:{flowlist:L},mixins:[b,{data:()=>({mescrollTop:206,statusList:[],tabsList:[{fullName:"在办",category:"2",key:2},{fullName:"发起",category:null,key:3},{fullName:"已办",category:"3",key:4},{fullName:"抄送",category:"4",key:5}],current:0,subsectionIndex:0,status:""}),watch:{current:{handler(t){if(1==S.flowSign&&0==t)return this.statusList=[];this.statusList=x[this.tabsList[t].key],this.category=this.tabsList[this.current].category},immediate:!0,deep:!0}},onLoad(t){this.config=(null==t?void 0:t.data)&&JSON.parse(decodeURIComponent(null==t?void 0:t.data)),this.addTabList(),this.getContentHeight(),(null==t?void 0:t.data)&&this.change(this.config.tabIndex)},methods:{addTabList(){[{key:"flowTodo",tab:{fullName:"待办",category:"1",key:1}},{key:"flowSign",tab:{fullName:"待签",category:"0",key:0}}].forEach((t=>{if(1===S[t.key])return this.tabsList.unshift(t.tab)}))},change(t){var s,e;let a=this.tabsList.findIndex((s=>s.key===t)),o=this.tabsList[(null==(s=this.config)?void 0:s.portal)?a:t];this.current=Number((null==(e=this.config)?void 0:e.portal)?a:t),this.status="",this.keyword="",this.subsectionIndex=0,this.category=o.category,this.$nextTick((()=>{this.list=[],this.mescroll.resetUpScroll()}))},subsection(t){let s=this.statusList[t];this.status=s.status,this.subsectionIndex=t,this.$nextTick((()=>{this.list=[],this.mescroll.resetUpScroll()}))},upCallback(t){(this.category?w:k)({currentPage:t.num,pageSize:t.size,keyword:this.keyword,category:this.tabsList[this.current].category,status:this.status},{load:1==t.num}).then((s=>{this.mescroll.endSuccess(s.data.list.length),1==t.num&&(this.list=[]);const e=s.data.list.map((t=>({flowStatus:this.getFlowStatus(t.status),opType:this.setOpType(t.status),swipeAction:this.swipeAction(t.status),...t})));this.list=this.list.concat(e)})).catch((()=>{this.mescroll.endErr()}))},swipeAction(t){let s=!0;return 3!==this.tabsList[this.current].key||this.category||"0"!=t&&"9"!=t||(s=!1),s},setOpType(t){return 3==this.tabsList[this.current].key?"0"==t||"9"==t||"8"==t?"-1":0:0==this.tabsList[this.current].key?1:1==this.tabsList[this.current].key?2:2==this.tabsList[this.current].key?3:4==this.tabsList[this.current].key?4:5==this.tabsList[this.current].key?5:void 0}}}],data(){return{noticeWarpH:0,searchBox:0,flowTabs:0,flowStatusTabs:0,activeItemStyle:{backgroundColor:"#fff"},keyword:"",category:"0",list:[],downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:20,time:null},empty:{use:!0,icon:y.message.nodata,tip:this.$t("common.noData"),fixed:!0,top:"300rpx"},textNoMore:this.$t("app.apply.noMoreData")}}},onShow(){s("operate"),e("refresh",(()=>{this.list=[],this.mescroll.resetUpScroll()}))},onUnload(){s("refresh")},mounted(){this.getContentHeight()},methods:{async getContentHeight(){this.$u.sys().windowHeight;const[t,s,e]=await Promise.all([this.$uGetRect(".search-box"),this.$uGetRect(".flow-tabs"),this.$uGetRect(".flow-status-tabs")]);this.flowStatusTabs=t.height,this.flowTabs=s.height,this.searchBox=e.height,this.mescrollTop=this.flowStatusTabs+this.flowTabs+this.searchBox,this.noticeWarpH=this.mescrollTop},getFlowStatus(t){let s;return"0"==this.category&&(s=y.status.signfor),"1"!=this.category&&"2"!=this.category||("1"==t&&(s=y.status.circulation),"5"==t&&(s=y.status.back),"7"==t&&(s=y.status.assist),"3"==t&&(s=y.status.transfer),"6"==t&&(s=y.status.recall),"8"==t&&(s=y.status.revoking),"2"==t&&(s=y.status.addSign),"4"==t&&(s=y.status.assign),"9"==t&&(s=y.status.transfer2)),this.category||("0"==t&&(s=y.status.draft),"1"==t&&(s=y.status.doing),"2"==t&&(s=y.status.adopt),"3"==t&&(s=y.status.reject),"4"==t&&(s=y.status.cancel),"5"==t&&(s=y.status.pause),"6"==t&&(s=y.status.revoking),"7"==t&&(s=y.status.revoke),"8"==t&&(s=y.status.back),"9"==t&&(s=y.status.recall)),"3"==this.category&&("7"==t&&(s=y.status.transfer),"1"==t&&(s=y.status.agree),"0"==t&&(s=y.status.refuse),"5"==t&&(s=y.status.addSign),"3"==t&&(s=y.status.return),"18"==t&&(s=y.status.transfer2)),"4"==this.category&&("1"==t&&(s=y.status.doing),"2"==t&&(s=y.status.adopt),"3"==t&&(s=y.status.reject),"8"==t&&(s=y.status.back)),s},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.mescroll.resetUpScroll()}),300)}}},[["render",function(t,s,e,y,b,w){const k=p(a("u-search"),m),L=n,T=p(a("u-tabs"),d),x=p(a("u-subsection"),g),S=o("flowlist"),j=p(a("mescroll-body"),f);return l(),i(L,{class:"flow-v"},{default:r((()=>[u(L,{class:"notice-warp",style:h({height:b.noticeWarpH+"px"})},{default:r((()=>[u(L,{class:"search-box"},{default:r((()=>[u(k,{placeholder:t.$t("app.apply.pleaseKeyword"),modelValue:b.keyword,"onUpdate:modelValue":s[0]||(s[0]=t=>b.keyword=t),height:"72","show-action":!1,onChange:w.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1}),u(L,{class:"flow-tabs"},{default:r((()=>[u(T,{ref:"tabs",list:t.tabsList,"active-color":"#0177FF","inactive-color":"#303133","font-size":"30",modelValue:t.current,"onUpdate:modelValue":s[1]||(s[1]=s=>t.current=s),name:"fullName",onChange:t.change,height:"80","is-scroll":!1},null,8,["list","modelValue","onChange"])])),_:1}),t.statusList.length?(l(),i(L,{key:0,class:"flow-status-tabs"},{default:r((()=>[u(x,{list:t.statusList,current:t.subsectionIndex,name:"name","active-color":"#2979FF","inactive-color":"#999999","bg-color":"#F2F3F7","font-size":"24",bold:!1,onChange:t.subsection},null,8,["list","current","onChange"])])),_:1})):c("",!0)])),_:1},8,["style"]),u(j,{ref:"mescrollRef",onInit:t.mescrollInit,onDown:t.downCallback,onUp:t.upCallback,down:b.downOption,up:b.upOption,top:t.mescrollTop},{default:r((()=>[u(S,{list:b.list,swipeAction:3!=t.current,category:b.category},null,8,["list","swipeAction","category"])])),_:1},8,["onInit","onDown","onUp","down","up","top"])])),_:1})}],["__scopeId","data-v-55ba0e8a"]]);export{j as default};