| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 | 
							- <template>
 
- 	<view>
 
- 		<view class="list_search card_banner flex">
 
- 			<uni-datetime-picker class="list_search_date" v-model="searchForm.createTime" type="daterange" />
 
- 			<u-icon class="list_search_icon" name="search" color="#fff" size="28" @click="doSearch"></u-icon>
 
- 		</view>
 
- 		<view class="list_content">
 
- 			<u-cell-group>
 
- 				<u-cell v-for="item in dataList" @click="toInfo(item)">
 
- 					<view slot="title">
 
- 						<view class="text-bold text-black">
 
- 							<view class="ellipsis-description">
 
- 								{{item.name}}
 
- 							</view>
 
- 						</view>
 
- 					</view>
 
- 					<view slot="value">
 
- 						<view>
 
- 							<u-tag v-if="type==1 || type==4" text="点击中止" type="warning" @click="suspend(item)">
 
- 							</u-tag>
 
- 						</view>
 
- 						<view class="text-grey text-sm list_label margin-top">
 
- 							{{item.createTime}}
 
- 						</view>
 
- 					</view>
 
- 					<view slot="label">
 
- 						<view class="text-grey margin-top">
 
- 							{{item.authorPerson}}
 
- 						</view>
 
- 					</view>
 
- 				</u-cell>
 
- 			</u-cell-group>
 
- 		</view>
 
- 		<u-loadmore :status="status" />
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import yzCirculationCardService from '@/api/commonseal/yzCirculationCardService.js'
 
- 	import yzFlowService from '@/api/commonseal/yzFlowService.js'
 
- 	import * as $auth from "@/common/auth.js"
 
- 	export default {
 
- 		onShow() {
 
- 			// 先获取页面栈
 
- 			let pages = getCurrentPages();
 
- 			// 当前页面的前一个页面
 
- 			let prevPage = pages[pages.length - 1];
 
- 			if (prevPage.options.type) {
 
- 				this.dataList = []
 
- 				this.type = prevPage.options.type
 
- 				switch (prevPage.options.type) {
 
- 					case "1":
 
- 						uni.setNavigationBarTitle({
 
- 							title: '待办列表' // 设置为你想要显示的标题文本
 
- 						});
 
- 						break;
 
- 					case "3":
 
- 						uni.setNavigationBarTitle({
 
- 							title: '归档列表' // 设置为你想要显示的标题文本
 
- 						});
 
- 						break;
 
- 					case "4":
 
- 						uni.setNavigationBarTitle({
 
- 							title: '已办列表' // 设置为你想要显示的标题文本
 
- 						});
 
- 						break;
 
- 					case "5":
 
- 						uni.setNavigationBarTitle({
 
- 							title: '公文列表' // 设置为你想要显示的标题文本
 
- 						});
 
- 						break;
 
- 				}
 
- 				this.searchForm.state = prevPage.options.type
 
- 				this.tablePage.currentPage = 0
 
- 				this.status = 'loading';
 
- 				this.loadmore()
 
- 			}
 
- 		},
 
- 		data() {
 
- 			return {
 
- 				status: 'loadmore',
 
- 				type: "",
 
- 				time: "",
 
- 				value: "",
 
- 				range: [],
 
- 				dataList: [],
 
- 				searchForm: {
 
- 					yearNum: '',
 
- 					cardNum: '',
 
- 					state: '',
 
- 					createTime: ""
 
- 				},
 
- 				tablePage: {
 
- 					pages: 0,
 
- 					currentPage: 0,
 
- 					pageSize: 10,
 
- 					orders: [{
 
- 						column: "a.create_time",
 
- 						asc: false
 
- 					}],
 
- 				},
 
- 				loading: false,
 
- 			}
 
- 		},
 
- 		methods: {
 
- 			
 
- 			// 中止
 
- 			suspend(row) {
 
- 				let that = this
 
- 				uni.showModal({
 
- 					title: '中止原因',
 
- 					placeholderText: '输入中止原因',
 
- 					editable: true,
 
- 					success: function(res) {
 
- 						if (res.confirm) {
 
- 							that.status = 'loading';
 
- 							row.suspend = res.content;
 
- 							row.state = 2;
 
- 							row.authorPerson = row.authorId;
 
- 							row.proofreader = row.proofreaderId;
 
- 							yzCirculationCardService.save(row).then((data) => {
 
- 								uni.showToast({
 
- 									title: "已中止",
 
- 								})	
 
- 								that.status = 'loadmore'
 
- 								that.dataList = [];
 
- 								that.tablePage.currentPage = 0;
 
- 								that.tablePage.pageSize = 10;
 
- 								that.tablePage.pages = 0;
 
- 								that.loadmore()
 
- 							});
 
- 						} else if (res.cancel) {
 
- 							console.log('用户点击取消');
 
- 						}
 
- 					}
 
- 				});
 
- 			},
 
- 			// 查看详情
 
- 			toInfo(item) {
 
- 				if (this.type == 3 || this.type == 5 || this.type == 4) {
 
- 					uni.navigateTo({
 
- 						url: '/pages/commonseal/commonInfo?id=' + item.id
 
- 					})
 
- 				} else {
 
- 					uni.navigateTo({
 
- 						url: '/pages/commonseal/examineCommon?id=' + item.id
 
- 					})
 
- 				}
 
- 			},
 
- 			// 搜索
 
- 			doSearch() {
 
- 				this.dataList = [];
 
- 				this.tablePage.currentPage = 0;
 
- 				this.tablePage.pageSize = 10;
 
- 				this.tablePage.pages = 0;
 
- 				this.loadmore()
 
- 			},
 
- 			onReachBottom() {
 
- 				this.loadmore()
 
- 			},
 
- 			loadmore() {
 
- 				if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
 
- 					this.status = 'nomore';
 
- 					return;
 
- 				}
 
- 				this.tablePage.currentPage = ++this.tablePage.currentPage;
 
- 				//联网加载数据
 
- 				this.status = 'loading';
 
- 				let {
 
- 					createTime,
 
- 					...newForm
 
- 				} = this.searchForm
 
- 				yzCirculationCardService.list({
 
- 					current: this.tablePage.currentPage,
 
- 					size: this.tablePage.pageSize,
 
- 					orders: this.tablePage.orders,
 
- 					beginCreateDate: this.searchForm.createTime ? this.searchForm.createTime[0] : '',
 
- 					endCreateDate: this.searchForm.createTime ? this.searchForm.createTime[1] : '',
 
- 					...newForm
 
- 				}).then((data) => {
 
- 					//追加新数据
 
- 					this.dataList = this.dataList.concat(data.records);
 
- 					this.tablePage.pages = data.pages;
 
- 					if (this.tablePage.pages <= this.tablePage.currentPage) {
 
- 						this.status = 'nomore'
 
- 					} else {
 
- 						this.status = 'loadmore'
 
- 					}
 
- 				})
 
- 			}
 
- 		}
 
- 	}
 
- </script>
 
- <style>
 
- 	.card_banner {
 
- 		width: 100%;
 
- 		height: 60px;
 
- 		background-color: #36a7f3;
 
- 	}
 
- 	.ellipsis-description {
 
- 		font-size: 18px;
 
- 	}
 
- 	.u-transition {
 
- 		align-items: flex-end;
 
- 	}
 
- 	.list_search_icon {
 
- 		line-height: 60px;
 
- 	}
 
- 	.list_search_select {
 
- 		width: 200px;
 
- 		background-color: #fff;
 
- 		height: 30px;
 
- 		border-radius: 10px;
 
- 		margin: 15px 5px 0;
 
- 	}
 
- 	.list_search_date {
 
- 		margin: 8px 5px 0;
 
- 	}
 
- 	.t-c {
 
- 		height: 34px;
 
- 		line-height: 34px;
 
- 	}
 
- 	.list_content {
 
- 		background-color: #fff;
 
- 	}
 
- 	.list_label {
 
- 		margin-top: 33px;
 
- 	}
 
- </style>
 
 
  |