123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <template>
- <view>
- <van-sticky>
- <view class="top-wrap">
- <view @click="handleGoSearch">
- <van-search disabled use-left-icon-slot shape="round" placeholder="客户名称/社会信用码">
- <view slot="left-icon">
- <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
- </view>
- </van-search>
- </view>
- <van-tabs id="tabs" :active="status" title-active-color="#3385FF" color="#3385FF" @change="typeChange">
- <van-tab :title="item" :name="item" v-for="item in tabList" :key="item"></van-tab>
- </van-tabs>
- </view>
- </van-sticky>
- <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="finished&&list.length===0" />
- <view class="list" v-else>
- <approve-list-item v-for="item in list" :key="item" :data="item"></approve-list-item>
- </view>
-
- <image src="../static/seal-icon.png" mode="aspectFill" class="add-btn" @click="handleGoApplySeal" v-if="showAddSeal"></image>
- </view>
- </template>
- <script>
- import {apiSealList,apiSealApproveList} from '@/api/approve/seal.js'
- import approveListItem from '../components/approveListItem.vue'
- export default {
- components:{
- approveListItem
- },
- computed:{
- showAddSeal(){
-
- let RoleTypeCode=this.$store.state.userInfo.RoleTypeCode
- if(['ficc_seller','rai_seller','compliance','ficc_group','rai_group','ficc_team'].includes(RoleTypeCode)){
- return true
- }else{
- return false
- }
- }
- },
- data() {
- return {
- tabList:['待审批','处理中','已审批','已签回','其它'],
- status: '待审批',
- list:[],
- page:1,
- finished:false,
- }
- },
- onLoad(options) {
- this.status=options.status||'待审批'
-
- this.getList()
-
- uni.$on('sealApproveListUpdate',(e)=>{
- console.log('更新列表');
- if(this.status==='待审批'){
- this.page=1
- this.finished=false
- this.list=[]
- this.getList()
- return
- }
- this.list=this.list.filter(item=>{
- return !(item.ContractApprovalId==e.ContractApprovalId&&item.ContractApprovalRecordId==e.ContractApprovalRecordId&&item.SealId==e.SealId)
- })
- })
- },
- onUnload(){
- uni.$off('sealApproveListUpdate')
- },
- onShow() {
-
-
-
- this.$nextTick(()=>{
- this.selectComponent('#tabs').resize();
- })
- },
- onPullDownRefresh() {
- this.page=1
- this.finished=false
- this.list=[]
- this.getList()
- setTimeout(()=>{
- uni.stopPullDownRefresh()
- },1500)
- },
- onReachBottom() {
- if(this.finished) return
- this.page++
- this.getList()
- },
- methods: {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- handleGoApplySeal(){
- uni.navigateTo({
- url:'/pages-approve/seal/addSeal'
- })
- },
-
-
- handleGoSearch() {
- uni.navigateTo({
- url: '../search/index?type=seal'
- })
- },
-
- typeChange(e){
- this.status=e.detail.name
- this.page=1
- this.finished=false
- this.list=[]
- this.getList()
- },
-
-
- async getList(){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- let res=await apiSealApproveList({
- CurrentIndex:this.page,
- Status:this.status,
- Keyword:''
- })
- if(res.code===200){
- if(!res.data.List||res.data.List.length===0){
- this.finished=true
- }else{
- if(this.page===1&&res.data.List.length<20){
- this.finished=true
- }
- let arr=res.data.List.map(item=>{
- return {
- title:item.CompanyName,
- saller:item.UserName,
- submitTime:this.status==='处理中'?item.ModifyTime:item.CreateTime,
- approveTime:item.ApproveTime,
- backTime:item.ModifyTime,
- cancelTime:item.InvalidTime,
- checkBackTime:item.CheckBackFileTime,
- status:item.Status,
- applyType:item.SealType,
- ContractApprovalId:item.ContractApprovalId||0,
- ContractApprovalRecordId:item.ContractApprovalRecordId||0,
- SealId:item.SealId||0,
- AffiliatedCompany:item.AffiliatedCompany,
- type:'seal'
- }
- })
- this.list=[...this.list,...arr]
- }
- }
- },
-
- },
- }
- </script>
- <style lang="scss">
- .search-icon {
- width: 40rpx;
- height: 40rpx;
- display: block;
- position: relative;
- top: 4rpx;
- margin-right: 10rpx;
- }
- .list{
- padding: 20rpx;
- }
- .add-btn{
- width: 120rpx;
- height: 120rpx;
- position: fixed;
- bottom: 102rpx;
- right: 34rpx;
- z-index: 100;
- }
- </style>
|