<template>
	<view style="width: 100vw;height:100vh;">
		<view style="height: calc(100% - 104rpx);">
			<swiper style="height: 100%;background-color:#F3F4F6 ;" :current="current" disable-touch
				@animationfinish="animationfinish">
				<swiper-item>
					<scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
						lower-threshold="10" :refresher-enabled="xlList1[0]" :refresher-triggered="xlList2[0]"
						@scrolltolower="lower(0)" @refresherrefresh="refresherrefresh(0)"
						@refresherrestore="refresherrestore(0)">
						<view v-if="title!='督办事项'" class="">


							<view style="padding: 20rpx;background-color: #fff;">
								<u-search v-model="db.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
									:animation="true" @custom="dbsearch" @clear="dbsearch">
								</u-search>
							</view>
							<view v-for="item in dbList" :key="item.WorkID"
								style="padding: 20rpx 40rpx;border-bottom: 1px solid #dadada;background-color: #fff;"
								@click="getinfo(item)">
								<view>
									<u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
								</view>
								<view
									style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
									<view>{{item.NodeName}}</view>
									<view>{{showtime(item.ADT)}}</view>
								</view>
							</view>
							<div style="padding: 10rpx 0;" v-if="dbList.length > 0">
								<u-loadmore :status="statusList[0]" />
							</div>
							<div v-if="dbList.length == 0">
								<u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
							</div>
						</view>
						<view v-else class="">
							<u-checkbox-group placement="column" @change="changeCheckBox">
								<view style="padding: 20rpx;background-color: #fff;">
									<u-search v-model="db.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
										:animation="true" @custom="dbsearch" @clear="dbsearch">
									</u-search>
								</view>
								<view v-for="item in dbList" :key="item.id"
									style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;">
									<uni-card>
										<view class="" style="display: flex;">
											<!-- <u-checkbox :disabled="item.submitState!=null" :name="item.id"></u-checkbox> -->
											<span
												style="font-weight: 700;font-size: 30rpx;margin-left: 40rpx;">{{item.title}}</span>
										</view>
										<view style='margin:20rpx 40rpx' class="">
											<text> 处室及负责人： {{item.departmentHead}}</text>
											<br />
											<text> 创建时间： {{item.createTime}}</text>
											<br />
											<text>
												责任处室：{{item.prersonLiable}}</text>
										</view>

										<view style="display: flex;" class="">
											<!-- <u-button v-if="item.submitState==1" @click="handleView(item)"
												style="width: 150rpx;" size="small" type="warning">查看</u-button> -->
											<u-button @click="handleChuli(item)" style="width: 150rpx;" size="small"
												type="primary">处理</u-button>
										</view>

									</uni-card>
								</view>
							</u-checkbox-group>
							<div style="padding: 10rpx 0;" v-if="dbList.length > 0">
								<u-loadmore :status="statusList[0]" />
							</div>
							<div v-if="dbList.length == 0">
								<u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
							</div>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item>

					<scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
						lower-threshold="0" :refresher-enabled="xlList1[1]" :refresher-triggered="xlList2[1]"
						@scrolltolower="lower(1)" @refresherrefresh="refresherrefresh(1)"
						@refresherrestore="refresherrestore(1)">
						<view v-if="this.title!='督办事项'" class="">
							<view style="padding: 20rpx;background-color: #fff;">
								<u-search v-model="sq.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
									:animation="true" @custom="sqsearch" @clear="sqsearch">
								</u-search>
							</view>
							<view v-for="item in sqList" :key="item.WorkID"
								style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;"
								@click="getinfo(item)">
								<view>
									<u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
								</view>
								<view
									style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
									<view>{{item.NodeName}}</view>
									<view>{{showtime(item.RDT)}}</view>
								</view>
							</view>
							<div style="padding: 10rpx 0;" v-if="sqList.length > 0">
								<u-loadmore :status="statusList[1]" />
							</div>
							<div v-if="sqList.length == 0">
								<u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
							</div>
						</view>
						<view v-else class="">
							<view style="padding: 20rpx;background-color: #fff;">
								<u-search v-model="sq.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
									:animation="true" @custom="sqsearch" @clear="sqsearch">
								</u-search>
							</view>
							<view style="background-color: #fff;" class="">


								<u-button v-if="sqList.length != 0" @click="submitDB"
									style="width: 150rpx;margin-left:50rpx;" size="small" type="primary">提
									交</u-button>
								<u-checkbox-group placement="column" @change="changeCheckBox">
									<view v-for="(item,index) in sqList" :key="index"
										style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;">
										<uni-card>
											<view class="" style="display: flex;">
												<u-checkbox :disabled="item.submitState!=0"
													:name="item.id"></u-checkbox>
												<span style="font-weight: 700;font-size: 30rpx;">{{item.title}}</span>
											</view>
											<view style='margin:20rpx 40rpx' class="">
												<text> 处室及负责人： {{item.departmentHead}}</text>
												<br />
												<text> 创建时间： {{item.createTime}}</text>
												<br />
												<text>
													责任处室：{{item.prersonLiable}}</text>
											</view>

											<view style="display: flex;" class="">
												<u-button v-if="item.submitState==1||item.submitState==3"
													@click="handleView(item)" style="width: 150rpx;" size="small"
													type="warning">查看</u-button>
												<u-button v-if="item.submitState == '2'" @click="handleAgain(item)"
													style="width: 150rpx;" size="small" type="primary">再次发起</u-button>
												<u-button v-if="item.submitState == '2'" @click="handleGuidang(item)"
													style="width: 150rpx;" size="small" type="success">归档</u-button>
											</view>
										</uni-card>
									</view>
								</u-checkbox-group>
							</view>
							<!-- <view v-for="item in sqList" :key="item.WorkID"
								style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;"
								@click="getinfo(item)">
								<view>
									<u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
								</view>
								<view
									style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
									<view>{{item.NodeName}}</view>
									<view>{{showtime(item.RDT)}}</view>
								</view>
							</view> -->
							<div style="padding: 10rpx 0;" v-if="sqList.length > 0">
								<u-loadmore :status="statusList[1]" />
							</div>
							<div v-if="sqList.length == 0">
								<u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
							</div>
							<u-modal :show="showGuidang" :showCancelButton='true' @cancel="showGuidang=false"
								@confirm="handleGD" title="提示" content='是否确认归档？'></u-modal>

						</view>
					</scroll-view>

				</swiper-item>
				<swiper-item>
					<scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
						lower-threshold="0" :refresher-enabled="xlList1[2]" :refresher-triggered="xlList2[2]"
						@scrolltolower="lower(2)" @refresherrefresh="refresherrefresh(2)"
						@refresherrestore="refresherrestore(2)">
						<view style="padding: 20rpx;background-color: #fff;">
							<u-search v-model="yb.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
								:animation="true" @custom="ybsearch" @clear="ybsearch">
							</u-search>
						</view>
						<view v-for="item in ybList" :key="item.WorkID"
							style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;"
							@click="getinfo(item)">
							<view>
								<u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
							</view>
							<view
								style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
								<view>{{item.NodeName}}</view>
								<view>{{showtime(item.RDT)}}</view>
							</view>
						</view>
						<div style="padding: 10rpx 0;" v-if="ybList.length > 0">
							<u-loadmore :status="statusList[2]" />
						</div>
						<div v-if="ybList.length == 0">
							<u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
						</div>
					</scroll-view>
				</swiper-item>
				<swiper-item>
					<scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
						lower-threshold="0" :refresher-enabled="xlList1[3]" :refresher-triggered="xlList2[3]"
						@scrolltolower="lower(3)" @refresherrefresh="refresherrefresh(3)"
						@refresherrestore="refresherrestore(3)">
						<view style="padding: 20rpx;background-color: #fff;">
							<u-search v-model="tj.title" placeholder="请输入督办事项" :showAction="true" actionText="搜索"
								:animation="true" @custom="tjsearch" @clear="tjsearch">

							</u-search>
						</view>
						<view style="background-color: #fff;" class="">

							<u-button v-if="tjList.length != 0" @click="cuibanDB"
								style="width: 150rpx;margin-left:50rpx;" size="small" type="success">催办</u-button>
							<u-checkbox-group placement="column" @change="changeCheckBox">

								<view v-for="(item,index) in tjList" :key="index"
									style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;">
									<uni-card>
										<view class="" style="display: flex;">
											<u-checkbox :name="item.id"></u-checkbox>
											<span style="font-weight: 700;font-size: 30rpx;">{{item.title}}</span>
										</view>
										<view style='margin:20rpx 40rpx' class="">
											<text> 处室及负责人： {{item.departmentHead}}</text>
											<br />
											<text> 创建时间： {{item.createTime}}</text>
											<br />
											<text>
												责任处室：{{item.prersonLiable}}</text>
										</view>

										<view style="display: flex;" class="">
											<u-button @click="handleView(item)" style="width: 150rpx;" size="small"
												type="warning">查看</u-button>
											<!-- <u-button @click="handleEdit(item)" v-if="
            item.submitState != null &&
             item.isCb != 'Y' &&
             item.progressEva != 1
            " style="width: 150rpx;" size="small" type="primary">催办</u-button> -->
										</view>
									</uni-card>
								</view>
							</u-checkbox-group>
						</view>
						<div style="padding: 10rpx 0;" v-if="tjList.length > 0">
							<u-loadmore :status="statusList[3]" />
						</div>
						<div v-if="tjList.length == 0">
							<u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
						</div>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<view v-if="title=='督办事项'" style="height: 100rpx;border-top: 2px solid #dadbde;box-sizing: border-box;">
			<u-grid :border="true" :col="showDB==true?3:2">
				<u-grid-item @click="click(0)">
					<text class="grid-text" :class="current==0?'choose':''">待办</text>
				</u-grid-item>
				<u-grid-item @click="click(1)">
					<text class="grid-text" :class="current==1?'choose':''">{{this.title=='督办事项'?'我发起的':'我申请的'}}</text>
				</u-grid-item>
				<u-grid-item v-if="title!='督办事项'" @click="click(2)">
					<text class="grid-text" :class="current==2?'choose':''">已办</text>
				</u-grid-item>
				<u-grid-item v-if="title=='督办事项'&&showDB==true" @click="click(3)">
					<text class="grid-text" :class="current==3?'choose':''">所有督办</text>
				</u-grid-item>
			</u-grid>
		</view>
		<view v-else style="height: 100rpx;border-top: 2px solid #dadbde;box-sizing: border-box;">
			<u-grid :border="true" :col="3">
				<u-grid-item @click="click(0)">
					<text class="grid-text" :class="current==0?'choose':''">待办</text>
				</u-grid-item>
				<u-grid-item @click="click(1)">
					<text class="grid-text" :class="current==1?'choose':''">{{this.title=='督办事项'?'我发起的':'我申请的'}}</text>
				</u-grid-item>
				<u-grid-item v-if="title!='督办事项'" @click="click(2)">
					<text class="grid-text" :class="current==2?'choose':''">已办</text>
				</u-grid-item>
				<u-grid-item v-if="title=='督办事项'&&showDB==true" @click="click(3)">
					<text class="grid-text" :class="current==3?'choose':''">所有督办</text>
				</u-grid-item>
			</u-grid>
		</view>
		<u-action-sheet :actions="morelist" :closeOnClickOverlay="true" :closeOnClickAction="true" cancelText="取消"
			title="发起" :show="show" @select="selectClick" @close="show = false"></u-action-sheet>
	</view>
</template>

<script>
	import {
		showtime
	} from "@/utils/wjw.js"
	export default {
		data() {
			return {
				fkFlow: '',
				CheckBoxList: [],
				//当前待办还是已办
				current: 0,
				//待办相关
				db: {
					pageNum: 1,
					pageSize: 20,
					fkFlow: null,
					title: null,
					token: uni.getStorageSync('jtoken')
				},
				dbList: [],
				showGuidang: false,
				dbSearch: null,
				dbTotal: 0,
				//已办相关
				yb: {
					pageNum: 1,
					pageSize: 20,
					fkFlow: null,
					title: null,
					token: uni.getStorageSync('jtoken')
				},
				ybList: [],
				ybSearch: null,
				ybTotal: 0,
				//下拉刷新相关
				xlList1: [true, false, false, false],
				xlList2: [true, true, true, true],
				statusList: ['loadmore', 'loadmore', 'loadmore', 'loadmore'],
				//查看事件
				showtime: showtime,
				//收发文状态
				type: null,
				//我申请的相关
				sq: {
					pageNum: 1,
					pageSize: 20,
					fkFlow: null,
					title: null,
					token: uni.getStorageSync('jtoken')
				},
				tj: {
					pageNum: 1,
					pageSize: 20,
					fkFlow: null,
					title: null,
					orderByColumn: 'createTime',
					isAsc: 'Desc',
					token: uni.getStorageSync('jtoken')
				},
				sqList: [],
				sqSearch: null,
				sqTotal: 0,
				//更多展示
				show: false,
				morelist: [

				],
				tjList: [],
				checkBoxAll: '',
				checkBoxAllList: [],
				selectedItems: '',
				title: '',
				rowItem: null,
				showDB: false
			}
		},
		onLoad(options) {
			uni.$u.http.get('/getInfo').then(res => {
				console.log('res66', res)
				res.roles.filter((item) => {
					if (item == 'zhoubaoGly') {
						this.showDB = true
					}
				})
			})
			getApp().globalData.zerenList = null
			getApp().globalData.ywListZR = null
			this.fkFlow = options.fkFlow
			this.db.fkFlow = options.fkFlow
			this.yb.fkFlow = options.fkFlow
			this.sq.fkFlow = options.fkFlow
			this.tj.fkFlow = options.fkFlow
			this.type = options.type
			this.title = options.title
			uni.setNavigationBarTitle({
				title: options.title
			})
			this.getDbList()
			if (options.fkFlow == '006') {
				this.morelist.push({
					name: '中层出差申请'
				})
			} else if (options.fkFlow == '007') {
				this.morelist.push({
					name: '外出授课申请'
				})
			} else if (options.fkFlow == '009') {
				this.morelist.push({
					name: '请(休)假申请'
				})
			} else if (options.fkFlow == '015') {
				this.morelist.push({
					name: '用车申请'
				})
			} else if (options.fkFlow == '020') {
				this.morelist.push({
					name: '调班申请'
				})
			} else if (options.fkFlow == '017') {
				this.morelist.push({
					name: '用章申请'
				})
			} else if (options.fkFlow == '018') {
				this.morelist.push({
					name: '合同用章申请'
				})
			} else if (options.fkFlow == '016') {
				this.morelist.push({
					name: '督办事项发起'
				})
			}
		},
		onNavigationBarButtonTap(e) {
			this.show = true
		},
		onShow() {
			getApp().globalData.peoIdList = []
			getApp().globalData.peoList = []
			getApp().globalData.peoDeptList = []

			uni.$off()
			uni.$on('query', (query) => {
				if (query.a == 'back') {
					setTimeout(() => {
						this.db.pageNum = 1
						this.dbList = []
						this.getDbList()
						this.xlList2[this.current] = true
						this.yb.pageNum = 1
						this.ybList = []
						this.getYbList()
						this.tj.pageNum = 1
						this.tjList = []
						this.getTjList()
						this.sq.pageNum = 1
						this.sqList = []
						this.getSqList()
						this.selectedItems = null
					}, 2000)
				}
			})
		},
		methods: {
			handleGD() {
				let data = {
					id: this.rowItem.id,
					submitState: '3'
				}
				let dataGuidang = {
					workId: this.rowItem.id,
					archiveFormNo: '016'
				}
				uni.$u.http.put('/offcial/supervision', data).then(res => {
					uni.$u.http.post('/offcial/archive/save', dataGuidang).then(res => {
						uni.showToast({
							title: '归档成功',
							icon: 'none'
						})
						this.showGuidang = false
						this.sq.pageNum = 1
						this.sqList = []
						this.getSqList()
					})
				})
			},
			handleGuidang(row) {
				console.log('frer', row)
				this.showGuidang = true
				this.rowItem = row
			},
			handleAgain(row) {
				uni.navigateTo({
					url: '/pages/dbZaici/dbZaiCi?id=' + row.id
				})
			},
			handleChuli(row) {
				uni.navigateTo({
					url: '/pages/dbChuli/dbChuli?fkFlow=' + this.fkFlow + '&id=' + row.id +
						'&title=' + '督办事项处理'
				})
			},
			handleEdit(row) {
				uni.navigateTo({
					url: '/pages/dbDetail/dbDetail?fkFlow=' + this.fkFlow + '&id=' + row.id +
						'&title=' + '督办编辑'
				})
			},
			handleView(row) {
				console.log('row', row)
				uni.navigateTo({
					url: '/pages/dbDetail/dbDetail?fkFlow=' + this.fkFlow + '&id=' + row.id +
						'&title=' + '督办查看'
				})
			},
			submitDB() {
				uni.showLoading({
					title: "提交中..."
				})
				console.log('selectedItems', this.selectedItems)
				if (this.selectedItems != '' && this.selectedItems != null) {
					uni.$u.http.post('/offcial/supervision/patchStartSupervision/' + this.selectedItems).then(
						res => {
							console.log('res', res)
							uni.showToast({
								title: '提交成功',
								icon: "none",
								mask: true,
								duration: 3000
							})
							uni.hideLoading()
							this.selectedItems = null
							this.tj.pageNum = 1
							this.tjList = []
							this.getTjList()
							this.sq.pageNum = 1
							this.sqList = []
							this.getSqList()
						}).catch(() => {
						uni.hideLoading()
					})
				} else {
					uni.showToast({
						title: '请先勾选要提交的督办事项',
						icon: "none",
						mask: true,
						duration: 3000
					})
				}

			},
			cuibanDB() {
				uni.showLoading({
					title: "催办中..."
				})
				console.log('selectedItems', this.selectedItems)
				if (this.selectedItems != '' && this.selectedItems != null) {
					uni.$u.http.get('/offcial/supervision/sel/myselfDetail/' + this.selectedItems).then(
						res => {
							console.log('res', res)
							uni.showToast({
								title: '催办成功',
								icon: "none",
								mask: true,
								duration: 3000
							})
							uni.hideLoading()
							this.selectedItems = null
							this.tj.pageNum = 1
							this.tjList = []
							this.getTjList()
							this.sq.pageNum = 1
							this.sqList = []
							this.getSqList()
						}).catch(() => {
						uni.hideLoading()
					})
				} else {
					uni.showToast({
						title: '请先勾选要催办的督办事项',
						icon: "none",
						mask: true,
						duration: 3000
					})
				}
			},
			changeCheckBox(val) {
				console.log('val', val)
				// console.log(this.CheckBoxList)
				this.selectedItems = val.join(',');
				console.log('selectedItems', this.selectedItems)
			},
			//点击已办待办
			click(i) {
				if (i == 0) {
					this.xlList1[i] = true
					this.xlList1[this.current] = false
					this.current = i
					if (this.dbList.length == 0) {
						this.getDbList()
					}
				} else if (i == 1) {
					this.xlList1[i] = true
					this.xlList1[this.current] = false
					this.current = i
					if (this.sqList.length == 0) {
						this.getSqList()
					}
					this.selectedItems = null
				} else if (i == 2) {
					this.xlList1[i] = true
					this.xlList1[this.current] = false
					this.current = i
					if (this.ybList.length == 0) {
						this.getYbList()
					}
				} else if (i == 3) {
					this.xlList1[i] = true
					this.xlList1[this.current] = false
					this.current = i
					if (this.tjList.length == 0) {
						this.getTjList()
					}
					this.selectedItems = null
				}
			},
			getTjList() {
				uni.$u.http.get('/offcial/supervision/list', {
					params: this.tj
				}).then(res => {
					uni.hideLoading()
					this.tjList = [...this.tjList, ...res.rows]
					console.log('tjList', this.tjList)
					if (res.total <= this.tj.pageSize) {
						this.statusList[0] = "nomore"
					} else {
						this.statusList[0] = "loadmore"
					}
					console.log('863',
						this.tjList)
					this.$forceUpdate()
					this.tjTotal = Math.ceil(res.total / this.tj.pageSize)
				})
			},
			//swiper切换
			animationfinish(e) {
				this.current = e.detail.current;
			},
			//查询待办列表
			getDbList() {
				if (this.title == '督办事项') {
					uni.$u.http.get('/offcial/supervision/dblist', {
						params: this.db
					}).then(res => {
						uni.hideLoading()
						this.dbList = [...this.dbList, ...res.rows]
						if (res.total <= this.db.pageSize) {
							this.statusList[0] = "nomore"
						} else {
							this.statusList[0] = "loadmore"
						}
						this.$forceUpdate()
						this.dbTotal = Math.ceil(res.total / this.db.pageSize)
					})
				} else {
					uni.$u.http.get('/jflow/restful/DB_Todolist_FlowNo', {
						params: this.db
					}).then(res => {
						uni.hideLoading()
						this.dbList = [...this.dbList, ...res.list]
						if (res.total <= this.db.pageSize) {
							this.statusList[0] = "nomore"
						} else {
							this.statusList[0] = "loadmore"
						}
						this.$forceUpdate()
						this.dbTotal = Math.ceil(res.total / this.db.pageSize)
					})
				}

			},
			//查询已办列表
			getYbList() {
				uni.$u.http.get('/jflow/restful/MyJoinOneFlows', {
					params: this.yb
				}).then(res => {

					uni.hideLoading()
					this.ybList = [...this.ybList, ...res.list]
					if (res.total <= this.yb.pageSize) {
						this.statusList[2] = "nomore"
					} else {
						this.statusList[2] = "loadmore"
					}
					this.$forceUpdate()
					this.ybTotal = Math.ceil(res.total / this.yb.pageSize)
				})
			},
			//查询我申请的列表
			getSqList() {
				if (this.title == '督办事项') {
					uni.$u.http.get('/offcial/supervision/dbfqlist', {
						params: {
							...this.sq
						},
						header: {
							'content-Type': 'application/x-www-form-urlencoded'
						},
					}).then(res => {
						// console.log(res)
						uni.hideLoading()
						this.sqList = [...this.sqList, ...res.rows]
						if (res.total <= this.sq.pageSize) {
							this.statusList[1] = "nomore"
						} else {
							this.statusList[1] = "loadmore"
						}

						this.$forceUpdate()
						this.sqTotal = Math.ceil(res.total / this.sq.pageSize)
					})
				} else {
					uni.$u.http.get('/jflow/restful/DB_MyStartFlowInstanceByFlow', {
						params: {
							...this.sq
						},
						header: {
							'content-Type': 'application/x-www-form-urlencoded'
						},
					}).then(res => {
						// console.log(res)
						uni.hideLoading()
						this.sqList = [...this.sqList, ...res.list]
						if (res.total <= this.sq.pageSize) {
							this.statusList[1] = "nomore"
						} else {
							this.statusList[1] = "loadmore"
						}
						this.$forceUpdate()
						this.sqTotal = Math.ceil(res.total / this.sq.pageSize)
					})
				}

			},
			//触底加载
			lower(e) {
				uni.showLoading({
					title: "加载中..."
				})
				if (e == 0) {
					if (this.db.pageNum != this.dbTotal) {
						this.db.pageNum++
						this.getDbList()
					} else {
						uni.hideLoading()
						this.statusList[e] = "nomore"
						this.$forceUpdate()
					}
				} else if (e == 1) {
					if (this.sq.pageNum != this.sqTotal) {
						this.sq.pageNum++
						this.getSqList()
					} else {
						uni.hideLoading()
						this.statusList[e] = "nomore"
						this.$forceUpdate()
					}
				} else if (e == 2) {
					if (this.yb.pageNum != this.ybTotal) {
						this.yb.pageNum++
						this.getYbList()
					} else {
						uni.hideLoading()
						this.statusList[e] = "nomore"
						this.$forceUpdate()
					}
				} else if (e == 3) {
					if (this.tj.pageNum != this.tjTotal) {
						this.tj.pageNum++
						this.getTjList()
					} else {
						uni.hideLoading()
						this.statusList[e] = "nomore"
						this.$forceUpdate()
					}
				}

			},
			//下拉刷新
			refresherrefresh(e) {
				if (e == 0) {
					this.xlList2[e] = true
					this.db.pageNum = 1
					this.dbList = []
					this.getDbList()
					setTimeout(() => {
						this.xlList2[e] = false
						this.$forceUpdate()
					}, 2000)
				} else if (e == 1) {
					this.xlList2[e] = true
					this.sq.pageNum = 1
					this.sqList = []
					this.getSqList()
					setTimeout(() => {
						this.xlList2[e] = false
						this.$forceUpdate()
					}, 2000)
				} else if (e == 2) {
					this.xlList2[e] = true
					this.yb.pageNum = 1
					this.ybList = []
					this.getYbList()
					setTimeout(() => {
						this.xlList2[e] = false
						this.$forceUpdate()
					}, 2000)
				} else if (e == 3) {
					this.xlList2[e] = true
					this.tj.pageNum = 1
					this.tjList = []
					this.getTjList()
					setTimeout(() => {
						this.xlList2[e] = false
						this.$forceUpdate()
					}, 2000)
				}
			},
			refresherrestore(e) {

			},
			//待办搜索
			dbsearch() {
				this.db.pageNum = 1
				this.dbList = []
				this.getDbList()
			},
			//已办搜索
			ybsearch() {
				this.yb.pageNum = 1
				this.ybList = []
				this.getYbList()
			},
			//申请搜索
			sqsearch() {
				this.sq.pageNum = 1
				this.sqList = []
				this.getSqList()
			},
			//提交搜索
			tjsearch() {
				this.tj.pageNum = 1
				this.tjList = []
				this.getTjList()
			},
			//查看收文发文详情
			getinfo(item) {
				console.log('title', item)
				uni.navigateTo({
					url: "/pages/workInfo/workInfo?workid=" + item.WorkID + '&type=' + this.current +
						'&flowNo=' +
						this.db.fkFlow + "&title=" + item.Title + "&nodeName=" + item.NodeName +
						"&nodeId=" + item
						.FK_Node + "&fkFlow=" + this.db.fkFlow
				})
			},
			//点击申请
			selectClick() {
				if (this.db.fkFlow == '006') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=中层出差申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '007') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=外出授课申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '009') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=请(休)假申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '015') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=用车申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '020') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=调班申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '017') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=用章申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '018') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=合同用章申请&fkFlow=" + this.db.fkFlow
					})
				} else if (this.db.fkFlow == '016') {
					uni.navigateTo({
						url: "/pages/shenqing/shenqing?title=督办事项发起&fkFlow=" + this.db.fkFlow
					})
				}

			}

		}
	}
</script>

<style lang="scss" scoped>
	.grid-text {
		height: 100rpx;
		line-height: 100rpx;
		font-size: 36rpx;
		color: #606266;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}

	.choose {
		color: #409EFF
	}

	.uni-card {
		margin: 0 !important;
	}
</style>