Przeglądaj źródła

完善质控作业,质控详情页面

zyj 1 rok temu
rodzic
commit
900f896558

+ 12 - 4
pages/my/index.vue

@@ -1,13 +1,21 @@
 <template>
-	<view>
+	<view class="my">
 		我的
+		<!-- 个人信息 -->
+		<view>
+			<view>
+			</view>
+			<view>王军</view>
+		</view>
+		<!-- 列表 -->
+		<view></view>
 	</view>
 </template>
 
-<script>
+<script setup>
 	
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+@import './index.scss'
 </style>

+ 5 - 5
pages/ypczk/zkTask/djTask.vue

@@ -24,15 +24,15 @@
 		<uni-card padding="0" spacing="0" v-for="(item,index) in pageData.djList" class="djList">
 			<view class="djList_title">
 				<view class="djList_text">检查项目</view>
-				<view class="djList_righttext">{{item.bhgx}}</view>
+				<view class="djList_righttext">{{item.item}}</view>
 			</view>
 			<view class="djList_title">
 				<view class="djList_text">检查内容</view>
-				<view class="djList_righttext">{{item.content}}</view>
+				<view class="djList_righttext">{{item.assessmentCriteria}}</view>
 			</view>
 			<view class="djList_title">
 				<view class="djList_text">检查结果</view>
-				<view class="djList_righttext">{{item.result}}</view>
+				<view class="djList_righttext">{{item.score}}</view>
 			</view>
 			<view class="djList_title" v-if="item.result=='不合格'">
 				<view class="djList_text">原因</view>
@@ -212,9 +212,9 @@ const createTask=()=>{
 // 获取代煎质控作业
 const getDjTask=(data)=>{
 	formData.id=data
-	http.get("app-api/taskDetail/getTaskDjDetailById",formData).then(res=>{
+	http.get("app-api/taskDetail/get",formData).then(res=>{
 		console.log(res)
-		pageData.djList = res.djCfDetail
+		pageData.djList = res.results
 	})
 }
 

+ 2 - 2
pages/ypczk/zkTask/djhjTask.vue

@@ -175,9 +175,9 @@ const createTask=()=>{
 // 获取代煎质控作业
 const getDjTask=(data)=>{
 	formData.id=data
-	http.get("app-api/taskDetail/getTaskDjDetailById",formData).then(res=>{
+	http.get("app-api/taskDetail/get",formData).then(res=>{
 		console.log(res)
-		pageData.djhjList = res.djCfDetail
+		pageData.djhjList = res.results
 	})
 }
 

+ 3 - 2
pages/ypczk/zkTask/dpTask.vue

@@ -92,6 +92,7 @@ const pageData = reactive({
 			wc:'0.2'
 		}
 	],
+	dpList:[],
 	// 图片列表
 	imageList: []
 })
@@ -142,9 +143,9 @@ const createTask=()=>{
 // 获取代煎质控作业
 const getDjTask=(data)=>{
 	formData.id=data
-	http.get("app-api/taskDetail/getTaskDpDetailById",formData).then(res=>{
+	http.get("app-api/taskDetail/get",formData).then(res=>{
 		console.log(res)
-		pageData.djList = res.djCfDetail
+		pageData.dpList = res.results
 	})
 }
 

+ 8 - 87
pages/ypczk/zkTask/indexList.scss

@@ -1,74 +1,4 @@
-::v-deep.yui-tabs{
-	height: 100%;
-	position: fixed;
-	justify-content: center;
-	align-items: center;
-}
-
 .leaderIndex{
-	.leaderIndex_header{
-		background: linear-gradient(180deg, rgba(189, 162, 115, 1) 0%, rgba(255, 255, 255, 1) 100%);
-		height: 450rpx;
-		.info{
-			display: flex;
-			padding: 10rpx 10rpx 20rpx 10rpx;
-			.info_img{
-				width:100rpx;
-				height:100rpx;
-				border-radius:50%;
-				background-color:white;
-				.headImg{
-					margin-left: auto;
-					margin-right: auto;
-					width: 80rpx;
-					height: 80rpx;
-				}
-			}
-			.userName{
-				font-size: 20px;
-				font-weight: 500;
-				color: rgba(255, 255, 255, 1);
-				text-align: center;
-				padding-left: 20rpx;
-				padding-right: 40rpx;
-			}
-			.eyeIcon{
-				width: 60rpx;
-				height: 60rpx;
-			}
-		}
-		.slogan{
-			display:flex;
-			align-items: center;
-			justify-content: center;
-			.slogan_img{
-				width: 670rpx;
-				height: 290rpx;
-			}
-		}
-	}
-	.leaderIndex_title{
-		display: flex;
-		padding-left: 30rpx;
-		.title_left{
-			display:flex;
-			align-items: center;
-			justify-content: center;
-			.uni-badge--x{
-				padding-left: 5rpx;
-			}
-		}
-		.title_right{
-			padding-left: 400rpx;
-			right: 20rpx;
-			.right_text{
-				font-size: 17px;
-				font-weight: 400;
-				color: rgba(153, 153, 153, 1);
-				padding-right: 5rpx;
-			}
-		}
-	}
 	.leaderIndex_list{
 		.list_title{
 			padding: 15rpx 0 5rpx 5rpx;
@@ -109,23 +39,6 @@
 			}
 		}
 		.button_group{
-			border-top: 0.5px solid rgba(221, 221, 221, 1);
-			height: 80rpx;
-			display: flex;
-			justify-content: flex-start;
-			.button_item{
-				flex: 1;
-				text-align: center;
-				justify-content: center;
-				color: rgba(190, 163, 117, 1);
-				font-size: 17px;
-				font-weight: 400;
-			}
-			.button_item:first-child{
-				border-right: 0.5px solid rgba(221, 221, 221, 1);
-			}
-		}
-		.button_group{
 			display: flex;
 			justify-content: flex-start;
 			height: 80rpx;
@@ -154,3 +67,11 @@
 		}
 	}
 }
+
+.zkTaskList{
+	::v-deep .uni-scroll-view-content{
+		display: flex;
+		align-content: flex-end;
+		justify-content: space-around;
+	}
+}

+ 1 - 1
pages/ypczk/zkTask/zkTask.vue

@@ -105,7 +105,7 @@
 					<uni-tr>
 						<uni-th align="center" width="150rpx">处方编号</uni-th>
 						<uni-th align="center" width="150rpx">贴数(贴)</uni-th>
-						<uni-th align="center" width="150rpx">平均误差(%)</uni-th>
+						<uni-th align="center" width="150rpx">不合格项</uni-th>
 						<uni-th align="center" width="150rpx">创建人</uni-th>
 					</uni-tr>
 					<!-- 表格数据行 -->

+ 3 - 3
pages/ypczk/zkTask/zkTaskDetail/detailsList.vue

@@ -14,7 +14,7 @@
 					<view class="detail_list">
 						<view class="List_title">
 							<view class="detail_text">任务编号</view>
-							<view class="detail_righttext">{{pageInfo.detailList.id}}</view>
+							<view class="detail_righttext">{{pageInfo.detailList.taskNumber}}</view>
 						</view>
 						<view class="List_title">
 							<view class="detail_text">任务状态</view>
@@ -170,7 +170,7 @@
 	const getDpTaskData=()=>{
 		http.get("app-api/taskDetail/getTaskDpDetailById",formData).then(res=>{
 			console.log(res)
-			pageInfo.dpTaskList=res
+			pageInfo.dpTaskList=res.dpCfDetail
 		})
 	}
 	
@@ -178,7 +178,7 @@
 	const getDjTaskData=()=>{
 		http.get("app-api/taskDetail/getTaskDjDetailById",formData).then(res=>{
 			console.log(res)
-			pageInfo.djTaskList=res
+			pageInfo.djTaskList=res.djCfDetail
 		})
 	}
 	

+ 3 - 20
pages/ypczk/zkTask/zkTaskDetail/djTaskDetail.vue

@@ -23,10 +23,10 @@
 						<uni-th align="center" width="155rpx">不合格项</uni-th>
 					</uni-tr>
 					<!-- 表格数据行 -->
-					<uni-tr v-for="(item, index) in pageData.djTaskList" :key="index">
+					<uni-tr v-for="(item, index) in djTaskList" :key="index">
 						<uni-td align="center">{{item.cfbh}}</uni-td>
 						<uni-td align="center">{{item.ts}}</uni-td>
-						<uni-td align="center">{{item.jcx}}</uni-td>
+						<uni-td align="center">{{item.wc}}</uni-td>
 						<uni-td align="center">{{item.bhgx}}
 							<uni-icons type="right" @click="toDetail(item)"></uni-icons>
 						</uni-td>
@@ -47,28 +47,11 @@ const props = defineProps({
 	djTaskList:  Array,	
 });
 
-const pageData=reactive({
-	djTaskList:[
-		{
-			cfbh:'111111',
-			ts:'1',
-			jcx:'1',
-			bhgx:'1'
-		},
-		{
-			cfbh:'222222',
-			ts:'2',
-			jcx:'2',
-			bhgx:'2'
-		}
-	]
-})
-
 // 跳转详情界面
 const toDetail=(e)=>{
 	console.log(e)
 	uni.navigateTo({
-		url:"/pages/ypczk/zkTask/djTask?status=get"
+		url:"/pages/ypczk/zkTask/djTask?status=get"+'&ptwybh='+e.cfbh+'&fyfslx=2'
 	})
 }
 

+ 1 - 1
pages/ypczk/zkTask/zkTaskDetail/dpTaskDetail.vue

@@ -27,7 +27,7 @@
 					<uni-tr v-for="(item, index) in dpTaskList" :key="index">
 						<uni-td align="center">{{item.cfbh}}</uni-td>
 						<uni-td align="center">{{item.ts}}</uni-td>
-						<uni-td align="center">{{item.jcx}}</uni-td>
+						<uni-td align="center">{{item.wc}}</uni-td>
 						<uni-td align="center">{{item.jcx}}</uni-td>
 						<uni-td align="center">{{item.bhgx}}
 							<uni-icons type="right" @click="toDetail(item)"></uni-icons>

+ 54 - 30
pages/ypczk/zkTask/zkTaskList.vue

@@ -1,43 +1,41 @@
 <template>
-	<view>
-		<yui-tabs :tabs="pageInfo.tabs" :offsetTop="22" v-model="pageInfo.activeIndex" @change="tabChange" color="rgba(190, 163, 117, 1)"
-			titleActiveColor="rgba(190, 163, 117, 1)" sticky swipeable line-width="60rpx" line-height="2px" animated>
+	<view class="zkTaskList" ref="zktaskList">
+		<custom-tabs type="zkTaskListViewRef" :value="pageInfo.current" fixed="true" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="changeIndex">
 			<!-- 所有 -->
-			<template #pane0>
-				<ZkTaskListView></ZkTaskListView>
-			</template>
+			<custom-tab-pane label="所有" name="zkTaskListViewRef_1">
+				<ZkTaskListView ref="zkTaskListViewRef_1" state=""></ZkTaskListView>
+			</custom-tab-pane>
 			<!-- 待质控 -->
-			<template #pane1>
-				<ZkTaskListView state="wait"></ZkTaskListView>
-			</template>
+			<custom-tab-pane label="待质控" name="zkTaskListViewRef_2">
+				<ZkTaskListView ref="zkTaskListViewRef_2" state="7003"></ZkTaskListView>
+			</custom-tab-pane>
 			<!-- 质控中 -->
-			<template #pane2>
-				<ZkTaskListView state="intask"></ZkTaskListView>
-			</template>
+			<custom-tab-pane label="质控中" name="zkTaskListViewRef_3">
+				<ZkTaskListView ref="zkTaskListViewRef_3" state="7007"></ZkTaskListView>
+			</custom-tab-pane>
 			<!-- 完成 -->
-			<template #pane3>
-				<ZkTaskListView state="complete"></ZkTaskListView>
-			</template>
-		</yui-tabs>
+			<custom-tab-pane label="完成" name="zkTaskListViewRef_4">
+				<ZkTaskListView ref="zkTaskListViewRef_4" state="7004"></ZkTaskListView>
+			</custom-tab-pane>
+		</custom-tabs>
 	</view>
 </template>
 
 <script setup>
 	import http from '@/utils/request';
-	import {ref,reactive} from "vue";
+	import {ref,reactive,getCurrentInstance, computed, nextTick,watch} from "vue";
 	import {onLoad,onShow,onUnload,onReachBottom,onPullDownRefresh} from "@dcloudio/uni-app";
 	import ZkTaskListView from "./zkTaskListView.vue"
-
+	
+	const zkTaskListViewRef_1 = ref(null)
+	
 	const pageInfo = reactive({
-		// 判断列表是否为空
-		isEmpty: true,
-		total: 0,
-		value: 0,
+		current:-1,
 		tabs: ["所有", "待质控", "质控中", "完成"],
-		activeIndex: 0,
 		detailStatus: ''
 	});
-
+	
+	const {proxy} = getCurrentInstance()
 	const showIcon = reactive({
 		nowIcon: '',
 		showIcon: '/static/blackDisplay.png',
@@ -49,6 +47,8 @@
 		wanIcon: '/static/wan_icon.png',
 		zhiIcon: '/static/zhi_icon.png'
 	})
+	
+
 
 	// 切换显示与隐藏
 	const changeState = (type) => {
@@ -68,6 +68,21 @@
 			}
 		}
 	}
+	
+	const IndexName = ref("zkTaskListViewRef_1")
+
+	const changeIndex=(e)=>{
+		console.log('change-----------')
+		IndexName.value = e.name
+		pageInfo.current = e.value
+		if(taskListRef())
+			taskListRef().fetch()
+	}
+	
+	const taskListRef = ()=>{
+		const taskList = proxy.$refs[IndexName.value]
+		return taskList
+	}
 
 	// 跳转到任务详情
 	const toDetail = () => {
@@ -75,16 +90,25 @@
 	
 	// 上拉加载
 	onReachBottom(() => {
+		console.log("父上拉加载");
+		taskListRef().reachBottom()
+	})
+	
+	//下拉刷新
+	onPullDownRefresh(() => {
+		console.log("父下拉刷新");
+		taskListRef().pullDownRefresh()
+	})
+	
+	onShow(()=>{
+		console.log("父onShow");
+		nextTick(()=>{
+			pageInfo.current = 0
+		})
 	})
 	
-	// //下拉刷新
-	// onPullDownRefresh(() => {
-	// 	console.log('onPullDownRefresh')
-	// })
-
 </script>
 
-
 <style lang="scss" scoped>
 	@import 'indexList.scss';
 </style>

+ 57 - 58
pages/ypczk/zkTask/zkTaskListView.vue

@@ -47,11 +47,11 @@
 <script setup>
 	import http from '@/utils/request';
 	import {ref,onMounted,reactive} from "vue";
-	import {onLoad,onShow,onUnload,onPageScroll,onReachBottom,onPullDownRefresh} from "@dcloudio/uni-app";
+	import {onLoad,onShow,onUnload,onPageScroll} from "@dcloudio/uni-app";
 
 	const props = defineProps({
 		//接受父组件参数,当前要接质控任务状态
-		state:  Object,	
+		state:  String,
 	});
 
 	const loadingData = reactive({
@@ -67,8 +67,8 @@
 
 	const formData = reactive({
 		pageSize: 10,
-		pageIndex: 1,
-		status:''
+		pageNum: 1,
+		status:props.state
 	})
 
 	const pageInfo = reactive({
@@ -228,75 +228,73 @@
 	
 
 	const getTaskData = () => {
-		if(props.state=='wait'){
-			formData.status="7003"
-		}else if(props.state=='intask'){
-			formData.status="7007"
-		}else if(props.state=='complete'){
-			formData.status="7004"
-		}
-		
-		http.get("app-api/zkzy/findZkzyList",formData).then(
-			res => {
-				console.log(res)
-				// pageData.taskList = res.data
-				for (let i = 0; i < res.data.length; i++) {
-					pageData.taskList.push(res.data[i])
+		console.log("getTaskData");
+		http.get("app-api/zkzy/findZkzyList",formData).then(res => {
+			console.log(res)
+			pageData.taskList = pageData.taskList.concat(res.data)
+			pageData.taskList.forEach(item => {
+				if (item.wcrq1 != null && item.wcrq2 != null) {
+					item.finishTime = item.wcrq1 + ' ~ ' + item.wcrq2
 				}
-				pageData.taskList.forEach(item => {
-					if (item.wcrq1 != null && item.wcrq2 != null) {
-						item.finishTime = item.wcrq1 + ' ~ ' + item.wcrq2
-					}
-					if (item.status == '7003') {
-						item.taskStatusIcon = statusIcon.daiIcon
-					} else if (item.status == '7004') {
-						item.taskStatusIcon = statusIcon.wanIcon
-					} else {
-						item.taskStatusIcon = statusIcon.zhiIcon
-					}
-				})
-
-				if (formData.pageSize > res.data.length) {
-					loadingData.reload = false
-					loadingData.status = 'noMore'
-					uni.stopPullDownRefresh();
+				if (item.status == '7003') {
+					item.taskStatusIcon = statusIcon.daiIcon
+				} else if (item.status == '7004') {
+					item.taskStatusIcon = statusIcon.wanIcon
 				} else {
-					loadingData.status = 'more'
-					loadingData.reload = true
+					item.taskStatusIcon = statusIcon.zhiIcon
 				}
-				
-				setTimeout(function() {
-					uni.stopPullDownRefresh();
-				}, 1000);
 			})
+			if (formData.pageSize > res.data.length) {
+				loadingData.reload = false
+				loadingData.status = 'noMore'
+				uni.stopPullDownRefresh();
+			} else {
+				loadingData.status = 'more'
+				loadingData.reload = true
+			}
+				
+		setTimeout(function() {
+			uni.stopPullDownRefresh();
+			}, 1000);
+		})
 	}
-
-	onShow(() => {
-		eyeIcon.nowIcon = eyeIcon.hideIcon
-		showIcon.nowIcon = showIcon.hideIcon
-		
-		formData.pageIndex = 1;
-		loadingData.reload = true
-		getTaskData();
-		pageData.taskList = []
-	})
+	
 	
 	// 上拉加载
-	onReachBottom(() => {
+	const reachBottom = ()=>{
+		console.log("上拉加载");
 		if (loadingData.reload) {
-			formData.pageIndex++;
+			formData.pageNum++;
 			loadingData.status = 'loading'
 			getTaskData();
 		}
-	})
+	}
 	
+	const propsState = ref("")
+	onShow(() => {
+		eyeIcon.nowIcon = eyeIcon.hideIcon
+		showIcon.nowIcon = showIcon.hideIcon
+		formData.pageNum = 1;
+		loadingData.reload = true
+		propsState.value = props.state
+		// getTaskData();
+	})
+
 	//下拉刷新
-	onPullDownRefresh(() => {
-		formData.pageIndex = 1;
+	const pullDownRefresh = () => {
+		console.log("下拉刷新");
+		formData.pageNum = 1;
 		loadingData.reload = true
-		getTaskData();
 		pageData.taskList = []
-	})
+		getTaskData();
+	}
+	
+	const fetch = ()=>{
+		console.log(pageData.taskList);
+		if(pageData.taskList == null || pageData.taskList.length == 0){
+			pullDownRefresh()
+		}
+	}
 	
 	// 页面滚动触发事件
 	onPageScroll((detail) => {
@@ -306,6 +304,7 @@
 			duration: 0
 		})
 	})
+	defineExpose({reachBottom,pullDownRefresh,fetch})
 </script>
 
 <style lang="scss" scoped>