| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <template>
- <view class='purchase-list'>
- <my-tabs @change="tapChange" :initIndex="initIndex"></my-tabs>
- <scroll-view class="purchase-body" scroll-y="true" @scrolltolower="scrolltolower" @scroll="scroll">
- <view v-if="initIndex === 0">
- <form-Create></form-Create>
- </view>
- <view v-if="initIndex === 1">
- <data-List v-for="(item,index) in listData" :key="index" :info="item"></data-List>
- <uni-fab :pattern="pattern" :horizontal="horizontal" :vertical="vertical"
- :direction="direction" @fabClick="fabClick" />
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import { getTodoTaskPage, getDoneTaskPage,getMyProcessInstancePage } from "@/api/work/index"
- import myTabs from '../myTabs.vue'
- import dataList from '../dataList.vue'
- import formCreate from './formCreate.vue'
- import myPull from '@/static/js/myPull.js'
- export default {
- components:{myTabs,dataList,formCreate},
- data() {
- return {
- initIndex: 0,
- pageNo: 1,
- pageSize: 10,
- horizontal: 'right',
- vertical: 'bottom',
- direction: 'horizontal',
- pattern: {
- color: '#7A7E83',
- backgroundColor: '#fff',
- selectedColor: '#007AFF',
- buttonColor: '#007AFF',
- iconColor: '#fff'
- },
- }
- },
- onLoad(){
- this.refresh();
- },
- methods: {
- fabClick() {
- this.initIndex = 0;
- // uni.showToast({
- // title: '点击了悬浮按钮',
- // icon: 'none'
- // })
- },
- /**
- * @name 获取列表
- */
- getList(page,done){
- console.log(`获取第${page}页数据`);
- if(this.initIndex==1){
- getDoneTaskPage({pageNo:page,pageSize: this.pageSize}).then(response => {
- let dataList = response.data.list;
- let list = []
- dataList.forEach(v => {
- list.push({
- title:v.processInstance.name,
- status: v.name,
- time:v.createTime,
- nickname:v.processInstance.startUser.nickname
- })
- })
- done(list);
- });
- }
- },
-
- /**
- * @name 触底加载
- */
- scrolltolower(event){
- this.getList(this.page,this.__pulldone)
- },
-
- scroll(e){
- // 重新设置pulldown
- this.setPullDown(e.detail.scrollTop<10)
- },
- /**
- * @name 改变tab
- * @param val 索引
- */
- tapChange(val){
- this.initIndex=val;
- this.page = 1;
- this.getList(this.page,this.__pulldone)
- }
- },
- mixins:[myPull({})],
-
- }
- </script>
- <style lang='scss' scoped>
- .purchase-list {
- background-color: #f5f5f5;
- height: 100%;
- overflow: hidden;
-
- .purchase-body{
- height: calc(100% - 88upx);
- overflow: auto
- }
- }
- </style>
|