From 7c3218e12105b87cab21e9ced57c99c339ffac10 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期二, 26 七月 2022 08:51:58 +0800
Subject: [PATCH] tatolpage

---
 pages/approval-history/approval-history.vue |  167 +++++++++++++++++++++++++++++++++----------------------
 1 files changed, 101 insertions(+), 66 deletions(-)

diff --git a/pages/approval-history/approval-history.vue b/pages/approval-history/approval-history.vue
index deef4e6..3edde09 100644
--- a/pages/approval-history/approval-history.vue
+++ b/pages/approval-history/approval-history.vue
@@ -1,117 +1,152 @@
 <template>
-	<!-- 瀹℃壒鍘嗗彶 -->
 	<view class="approval-history">
-		<combined-title title="鏌ョ湅杩涘害"></combined-title>
-		<view class="historyTable">
+		<combined-title title="瀹℃壒鍘嗗彶"></combined-title>
+		<u-empty v-if="scheduleData.length == 0"
+		        mode="data"
+		        icon="http://cdn.uviewui.com/uview/empty/data.png" 
+						width="100px"
+						height="150px"
+		>
+		</u-empty>
+		<view class="scheduleTable" v-for="(item,index) in scheduleData" :key="index">
 			<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁">
 				<!-- 琛ㄦ牸鏁版嵁琛� -->
 				<uni-tr>
 					<uni-th align="center">浠诲姟鍚嶇О</uni-th>
-					<uni-td>{{yibanData.renwu}}</uni-td>
+					<uni-td>{{ item.name }}</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">澶勭悊浜�</uni-th>
-					<uni-td>XXX XXX XXX XXX</uni-td>
+					<uni-td>
+						<view class="">
+							<u-tag :text="role.nickname" type="primary" size="mini" style="display:inline-block;margin-left: 5%;" plain v-for="(role,roleIndex) in item.assignees" :key="roleIndex"></u-tag>
+						</view>
+					</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">瀹℃壒鎿嶄綔</uni-th>
-					<uni-td>鈥斺��</uni-td>
+					<uni-td>{{item.deleteReason}}</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">瀹℃壒鎰忚</uni-th>
-					<uni-td>{{yibanData.shenpiyijian}}</uni-td>
+					<uni-td>{{ item.comment }}</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">鑰楁椂</uni-th>
-					<uni-td>{{yibanData.haoshi}}</uni-td>
+					<uni-td>{{
+						item.duration >= 86400000
+										? parseInt(item.duration / 86400000 + '澶�' + parseInt(item.duration % 86400000) / 3600000 + '鏃�' + parseInt(item.duration % 3600000) / 60000 + '鍒�')
+										: item.duration >= 3600000
+										? parseInt(item.duration / 3600000) + '鏃�' + parseInt((item.duration / 3600000) % 3600000) + '鍒�'
+										: parseInt(item.duration / 60000) + '鍒�'
+										}}
+										</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">鍒涘缓鏃堕棿</uni-th>
-					<uni-td>{{yibanData.createTime}}</uni-td>
+					<uni-td>{{ item.createTime }}</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">瀹屾垚鏃堕棿</uni-th>
-					<uni-td>鈥斺��</uni-td>
+					<uni-td>{{ item.endTime }}</uni-td>
 				</uni-tr>
 				<uni-tr>
 					<uni-th align="center">鐘舵��</uni-th>
-					<uni-td style="color:#007AFF" >寰呭鐞�</uni-td>
+					<uni-td :style="{color:(item.endTime==null?'#969696':'#007AFF')}">{{ item.endTime ==null? '寰呭鐞�' : '宸插姙鐞�' }}</uni-td>
 				</uni-tr>
 			</uni-table>
 		</view>
-		
+
 		<!-- 鑿滃崟鏍� -->
 		<popup-menu @menuShow="menushow" ref="menuRef"></popup-menu>
 	</view>
 </template>
 
 <script>
-	import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
-	import combinedTitle from '@/components/common/combined-title/combined-title.vue';
-	export default {
-		data() {
-			return {
-				yibanData:
-					{
-						meizhongshenqing:'钁涙硥鐭跨敵璇凤細鐓ょ煾鐭�',
-						renwu:'鍙戣繍瀹℃壒',
-						liucheng:'鍙戣繍閫氱煡鍗�',
-						faqiren:'钁涙硥鐭�',
-						shenpiCaozuo:'瀹℃壒閫氳繃',
-						shenpiyijian:'鍚屾剰',
-						haoshi:'19绉�',
-						createTime:'2022-5-25 12:06:15'
-					},
-				menuShow:false
-			};
-		},
-		// 鐐瑰嚮瀵艰埅鏍忚彍鍗曞悗
-		onNavigationBarButtonTap(e) {
-			// console.log(e);
+import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
+import combinedTitle from '@/components/common/combined-title/combined-title.vue';
+export default {
+	data() {
+		return {
+			scheduleData: [],
+				// meizhongshenqing: '钁涙硥鐭跨敵璇凤細鐓ょ煾鐭�',
+				// renwu: '鍙戣繍瀹℃壒',
+				// liucheng: '鍙戣繍閫氱煡鍗�',
+				// faqiren: '钁涙硥鐭�',
+				// shenpiCaozuo: '瀹℃壒閫氳繃',
+				// shenpiyijian: '鍚屾剰',
+				// haoshi: '19绉�',
+				// createTime: '2022-5-25 12:06:15'
+			applicationId:null,
+			menuShow:false,
+			ifEmpty:false
+		};
+	},
+	onLoad(options){
+		this.applicationId = JSON.parse(options.index);
+	},
+	// 鐐瑰嚮瀵艰埅鏍忚彍鍗曞悗
+	onNavigationBarButtonTap(e) {
+		// console.log(e);
+		this.$refs.menuRef.menuClick();
+	},
+	onShow(){
+		if(this.menuShow == true){
 			this.$refs.menuRef.menuClick()
+		}
+		this.init();
+	},
+	components: {
+		combinedTitle,
+		popupMenu
+	},
+	methods: {
+		init(){
+			this.historicFlow()
 		},
-		onShow(){
-			if(this.menuShow == true){
-				this.$refs.menuRef.menuClick()
-			}
+		historicFlow(){
+			this.$reqGet('historicFlow',{},this.applicationId).then(res=>{
+				console.log('瀹℃壒鍘嗗彶',res);
+				
+				if(res.code == 0){
+					if(res.data == null){
+						this.ifEmpty = true
+					} else{
+						this.scheduleData = res.data
+					}
+				}
+			})
 		},
-		components: {
-			combinedTitle,
-			popupMenu
-		},
-		methods:{
-			menushow(e){
-				this.menuShow = e
-			}
+		menushow(e){
+			this.menuShow = e
 		}
 	}
+};
 </script>
 
 <style lang="scss" scoped>
-.approval-history{
+::v-deep.approval-history {
 	width: 100%;
 	height: 100%;
-	// 琛ㄦ牸
-	.historyTable{
-		margin:0 auto;
-		width:91%;
-		.uni-table{
-			
-			.uni-table-tr{
-				.uni-table-th{
-					width:vww(88);
-					height:vww(40);
-					background-color: #F5F5F5;
-					color:#111111;
-					font-size:vww(13);
+	.scheduleTable {
+		margin: vww(10) auto 0;
+		width: 91%;
+		.uni-table {
+			.uni-table-tr {
+				.uni-table-th {
+					width: vww(88);
+					height: vww(40);
+					background-color: #f5f5f5;
+					color: #111111;
+					font-size: vww(13);
 					font-weight: 500;
 				}
-				.uni-table-td{
-					width:vww(240);
-					height:vww(40);
-					background-color: #FFFFFF;
-					color:#111111;
-					font-size:vww(13);
+				.uni-table-td {
+					width: vww(240);
+					height: vww(40);
+					background-color: #ffffff;
+					color: #111111;
+					font-size: vww(13);
 				}
 			}
 		}

--
Gitblit v1.9.1