李书文 2 年之前
父节点
当前提交
53b40f52df
共有 4 个文件被更改,包括 174 次插入53 次删除
  1. 42 0
      common/common.scss
  2. 10 1
      pages.json
  3. 19 52
      pages/home/index.vue
  4. 103 0
      pages/home/list.vue

+ 42 - 0
common/common.scss

@@ -186,3 +186,45 @@
 		background-color: #f44336;
 	}
 }
+.spitem {
+	margin-top: 10px;
+	padding: 10px 5px 15px 5px;
+	border-bottom: 1px solid #f0f2f7;
+	background-color: white;
+	&:last-child {
+		border: 0px;
+	}
+	.title {
+		color: $font-c;
+		.icon {
+			padding-right: 5px;
+			font-weight: bold;
+			font-size: 18px;
+		}
+		.tit {
+			font-weight: bold;
+			padding-right: 3px;
+			font-size: 18px;
+		}
+		.dev {
+			font-size: 15px;
+			margin-top: 10px;
+		}
+	}
+	.desc {
+		font-size: 14px;
+		color: #848484;
+		padding-top: 10px;
+		.name {
+			float: left;
+			padding-right: 10px;
+		}
+		.bm {
+			float: left;
+			width: 40%;
+		}
+		.date {
+			float: right;
+		}
+	}
+}

+ 10 - 1
pages.json

@@ -98,7 +98,16 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/home/list",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "审批中心",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",
 		"navigationBarTitleText": "柳工机械",

+ 19 - 52
pages/home/index.vue

@@ -55,20 +55,20 @@
 			<view class="cn">
 				<view class="lable">
 					<text>审批中心</text>
-					<text class="more">更多></text>
+					<text class="more" @click="go('/pages/home/list')">更多></text>
 				</view>
 				<view class="list">
 					<view class="tab"><u-tabs :list="tab" :current="current" @click="click"></u-tabs></view>
-					<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.formId,item.docId)">
+					<view class="spitem" v-for="(item, index) in list" :key="index" @click="detail(item.formId, item.docId)">
 						<view class="title">
 							<text class="icon">&#xe602;</text>
-							<text>{{item.flowName}}</text>
-							<text>{{item.subject}}</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 class="name">{{ item.initiator }}</view>
+							<view class="bm omit">{{ item.initiatorDept }}</view>
+							<view class="date">{{ item.actionTime }}</view>
 						</view>
 						<view class="clear"></view>
 					</view>
@@ -91,20 +91,18 @@ export default {
 		this.getData();
 	},
 	methods: {
-	getData() {
-		this.http.request({
-			url: this.http.urls.myPending,
-			
-			success: res => {
-				console.log('gfgh===1111' + JSON.stringify(res.data.data.datas));
-				//let totalPage = res.data.data.row_count < 10 ? 1 : res.data.data.row_count / 10;
-				//this.loadMore = totalPage > this.param._currpage ? true : false;
-				//res.data.data.data.forEach(item => {
-					this.list=res.data.data.datas;
-				//});
-			}
-		});
-	},
+		getData() {
+			this.http.request({
+				url: this.http.urls.myPending,
+				success: res => {
+					this.list = res.data.data.datas;
+					this.list.forEach(item => {
+						item.subject=JSON.parse(item.subject);
+						item.subject.summaryText=item.subject.summaryText.replace(/\r|\n/ig,"");
+					});
+				}
+			});
+		},
 		//跳转
 		go(url) {
 			uni.navigateTo({ url: url });
@@ -205,37 +203,6 @@ page {
 				border-radius: 3px;
 				margin-top: 7px;
 			}
-			.item {
-				margin-top: 10px;
-				padding: 10px 5px 15px 5px;
-				border-bottom: 1px solid #f0f2f7;
-				&:last-child {
-					border: 0px;
-				}
-				.title {
-					font-size: 17px;
-					color: $font-c;
-					.icon {
-						padding-right: 5px;
-					}
-				}
-				.desc {
-					font-size: 14px;
-					color: #848484;
-					padding-top: 5px;
-					.name {
-						float: left;
-						padding-right: 10px;
-					}
-					.bm {
-						float: left;
-						width: 40%;
-					}
-					.date {
-						float: right;
-					}
-				}
-			}
 		}
 	}
 }

+ 103 - 0
pages/home/list.vue

@@ -0,0 +1,103 @@
+<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">&#xe602;</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: { appId: '__gAPYBW4YxB3UePM3lqO', containTitle: '申请单', opentarget: 'detail', viewId: '__km3aURKW95BHxp12XVt', _currpage: 1 },
+			list: [],
+			tab: [{ name: '全部' }, { name: '主流程' }, { name: '数字实验室' }, { name: '数字实验室' }, { name: '实验流程' }, { name: '设备借用' }],
+			show: false,
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		//this.getaccessToken();
+		//this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: this.http.urls.myPending,
+				data: this.param,
+				method: 'POST',
+				loading: 'false',
+				success: res => {
+					let totalPage = res.data.data.row_count < 10 ? 1 : res.data.data.row_count / 10;
+					this.loadMore = totalPage > this.param._currpage ? true : false;
+					res.data.data.data.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) {
+			
+		},
+		//刷新数据
+		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>