123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <template>
- <view>
- <view class="tab"><u-tabs :list="tab" :current="current" @click="click"></u-tabs></view>
- <view class="list">
- <view class="spitem" v-for="(item, index) in list" :key="index" @click="detail(item.formId, item.docId)">
- <view class="title">
- <text class="icon"></text>
- <text class="tit">[{{ item.flowName }}]</text>
- <view class="dev">{{ item.subject.summaryText }}</view>
- </view>
- <view class="desc">
- <view class="name">{{ item.initiator }}</view>
- <view class="bm omit">{{ item.initiatorDept }}</view>
- <view class="date">{{ item.actionTime }}</view>
- </view>
- <view class="clear"></view>
- </view>
- <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
- <u-empty v-if="!loadMore && list.length == 0"></u-empty>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- param: { _currpage: 1 },
- list: [],
- tab: [{ name: '全部' }, { name: '主流程' }, { name: '数字实验室' }, { name: '数字实验室' }, { name: '实验流程' }, { name: '设备借用' }],
- show: false,
- loadMore: true,
- current:0,
- flowId:'__cdN7J1XsfNyfF40QotH'
- };
- },
- onLoad(e) {
- //this.getaccessToken();
- this.getnavData();
- this.getData();
-
-
- },
- methods: {
- getnavData() {
- this.http.request({
- url: this.http.urls.navspendings,
- data: this.param,
- method: 'GET',
- loading: 'false',
- success: res => {
-
- this.tab=[];
- res.data.data[0].pendingFlowList.forEach(item => {
- var badge={value:0}
- item.badge=badge;
- item.badge.value=item.num;
- this.tab.push(item);
- });
-
-
- }
- });
- },
- getData() {
- this.http.request({
- url: this.http.urls.flowcenters_pendings+'&flowId='+this.flowId+'&applicationId=__gAPYBW4YxB3UePM3lqO',
- data: this.param,
- method: 'GET',
- loading: 'false',
- success: res => {
- console.log('res' + JSON.stringify(res));
-
- let totalPage = res.data.data.rowCount < 10 ? 1 : res.data.data.rowCount / 10;
- this.loadMore = totalPage > this.param._currpage ? true : false;
- res.data.data.datas.forEach(item => {
- item.subject = JSON.parse(item.subject);
- item.subject.summaryText = item.subject.summaryText.replace(/\r|\n/gi, '');
- this.list.push(item);
- });
- }
- });
- },
- //选择tab
- click(e) {
- console.log('e:' + JSON.stringify(e));
- this.flowId=e.id;
- this.getData();
- },
- //刷新数据
- refresh() {
- this.loadMore = true;
- this.param._currpage = 1;
- this.list = [];
- this.getData();
- },
- //跳转到详情
- detail(id, ste) {
- uni.navigateTo({
- url: '/pages/index/detail?id=' + id + '&ste=' + ste
- });
- },
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.refresh();
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param._currpage++;
- this.getData();
- }
- },
- //展开搜索
- onNavigationBarButtonTap() {
- this.show = !this.show;
- }
- };
- </script>
- <style lang="scss">
- .tab {
- background-color: white;
- }
- .list {
- padding: 5px 0px 0px 0px;
- }
- </style>
|