소스 검색

修改质控作业上传图片,质控作业标题

zyj 1 년 전
부모
커밋
68c7061c97

+ 44 - 31
pages/ypczk/zkTask/djTask.vue

@@ -44,13 +44,13 @@
 			<uni-card>
 				<uni-section title="图片上传" type="line"></uni-section>
 				<view class="img_upload">
-					<uni-file-picker limit="4" :modelValue="pageData.imageList" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
+					<uni-file-picker limit="4" :modelValue="showImage(pageData.imageList)" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
 				</view>
 			</uni-card>
 		</view>
 		<!-- 按钮 -->
 		<view class="operator_button" v-if="pageData.operatorStatus=='add'">
-			<button class="pass_button" @click="pass">一键通过</button>
+			<button :class="pageData.buttonDisabled==false?'pass_button':'pass_button_grey'" @click="pass" :disabled="pageData.buttonDisabled">一键通过</button>
 			<!-- 如果还有数据按钮显示为“下一个”,数据全部加载完毕显示为“完成” -->
 			<view class="finish_button_grop">
 				<button class="next_or_finish_button" @click="next">下一个</button>
@@ -124,7 +124,8 @@ const pageData=reactive({
 	totalProgress:0,
 	// 任务状态(编辑为2,保存为1)
 	taskStatus:'',
-	taskStatusData:''
+	taskStatusData:'',
+	buttonDisabled:true
 })
 
 const formData=reactive({
@@ -216,7 +217,9 @@ const countDownEnd=()=>{
 
 // 选中图片,将选中的图片添加列表
 const selectImg=(e)=>{
-	console.log(e)
+	if(pageData.imageList==null || pageData.imageList == undefined){
+		pageData.imageList=[]
+	}
 	e.tempFiles.forEach(item=>{
 		uni.showLoading({
 			title: '图片上传....',
@@ -224,13 +227,7 @@ const selectImg=(e)=>{
 		});
 		http.upload("oss/upload",{file:item.file}).then(e => {
 			uni.hideLoading()
-			item.id = e.id
-			console.log(e.id)
-			// pageData.resData.detail.imageIds=[]
-			// pageData.imageIdList.push(e.id)
-			pageData.imageIdList=pageData.imageIdList+','+e.id
-			pageData.resData.detail.imageIds=pageData.imageIdList.toString()
-			pageData.imageList.push(item)
+			pageData.imageList.push(e.id)
 		})
 	})
 }
@@ -238,17 +235,13 @@ const selectImg=(e)=>{
 // 删除图片,并将其从列表中删除
 const deleteImg=(e)=>{
 	let index=0
-	let deleteImgId = e.tempFilePath.split("=")[1].split("&")[0]
-	index = pageData.imageList.indexOf(deleteImgId)
-	pageData.imageList.splice(index,1)
-	if(typeof(pageData.imageIdList)==Array){
-		pageData.imageIdList.splice(index,1)
-		pageData.resData.detail.imageIds=pageData.imageIdList.toString()
-	}else{
-		let list = pageData.imageIdList.split(",")
-		list.splice(index,1)
-		pageData.resData.detail.imageIds=list.toString()
-	}
+	pageData.imageList.forEach((item,idx)=>{
+		index=e.tempFilePath.indexOf(item)
+		if(index>0){
+			// 删除列表中的元素
+			pageData.imageList.splice(idx,1)
+		}
+	})
 }
 
 const item = ref({})
@@ -288,6 +281,9 @@ const countTotal=()=>{
 	pageData.resData.results.forEach(item=>{
 		pageData.resData.resultContent+=Number(item.score)
 	})
+	if(pageData.imageList!=null || pageData.imageList!=undefined){
+		pageData.resData.detail.imageIds=pageData.imageList.toString()
+	}
 }
 
 const saveDjTask=()=>{
@@ -419,20 +415,29 @@ const getDjTaskDetail=()=>{
 			}
 		})
 		if(res.detail.imageIds!=null && res.detail.imageIds!=''){
-			pageData.imageIdList=res.detail.imageIds
-			pageData.imageList = uploadImageModelValue(res.detail.imageIds)
+			if(typeof(res.detail.imageIds)=='string'){
+				var urls=res.detail.imageIds.split(',')
+				pageData.imageList=[]
+				urls.forEach(e=>{
+					pageData.imageList.push(e)
+				})
+			}
 		}
 	})
 }
 
+
 onShow(()=>{
-	if(pageData.operatorStatus=='add'){
-		pageData.imageStatus=false
-		createTask()
-	}else{
-		pageData.imageStatus=true
-		getDjTaskDetail()
-	}
+	// if(pageData.operatorStatus=='add'){
+	// 	pageData.imageStatus=false
+	// 	createTask()
+	// }else{
+	// 	pageData.imageStatus=true
+	// 	getDjTaskDetail()
+	// }
+	setTimeout(()=>{
+		pageData.buttonDisabled=false
+	},5000)
 })
 
 onLoad((type)=>{
@@ -455,6 +460,14 @@ onLoad((type)=>{
 	if(type.taskStatus!=null){
 		pageData.taskStatusData=type.taskStatus
 	}
+	// 获取代煎数据
+	if(pageData.operatorStatus=='add'){
+		pageData.imageStatus=false
+		createTask()
+	}else{
+		pageData.imageStatus=true
+		getDjTaskDetail()
+	}
 })
 </script>
 

+ 30 - 23
pages/ypczk/zkTask/djhjTask.vue

@@ -37,13 +37,13 @@
 			<uni-card>
 				<uni-section title="图片上传" type="line"></uni-section>
 				<view class="img_upload">
-					<uni-file-picker limit="4" :modelValue="pageData.imageList" @select="selectImg" @delete="deleteImg"></uni-file-picker>
+					<uni-file-picker limit="4" :modelValue="showImage(pageData.imageList)" @select="selectImg" @delete="deleteImg"></uni-file-picker>
 				</view>
 			</uni-card>
 		</view>
 		<!-- 按钮组 -->
 		<view class="operator_button">
-			<button class="pass_button" @click="pass">一键通过</button>
+			<button :class="pageData.buttonDisabled==false?'pass_button':'pass_button_grey'" @click="pass" :disabled="pageData.buttonDisabled">一键通过</button>
 			<!-- 如果还有数据按钮显示为“下一个”,数据全部加载完毕显示为“完成” -->
 			<view class="finish_button_grop">
 				<button class="next_or_finish_button" v-if="pageData.resList.results!=0" @click="next">下一个</button>
@@ -89,8 +89,8 @@ const pageData=reactive({
 	djhjList:[],
 	imageList:[],
 	resList:[],
-	imageIdList:[],
 	taskStatus:'',
+	buttonDisabled:true
 })
 
 const formData=reactive({
@@ -175,6 +175,9 @@ const countDownEnd=()=>{
 
 // 选中图片,将选中的图片添加列表
 const selectImg=(e)=>{
+	if(pageData.imageList==null || pageData.imageList == undefined){
+		pageData.imageList=[]
+	}
 	e.tempFiles.forEach(item=>{
 		uni.showLoading({
 			title: '图片上传....',
@@ -182,11 +185,7 @@ const selectImg=(e)=>{
 		});
 		http.upload("oss/upload",{file:item.file}).then(e => {
 			uni.hideLoading()
-			item.id = e.id
-			// pageData.resList.detail.imageIds=[]
-			pageData.imageIdList=pageData.imageIdList+','+e.id
-			pageData.resList.detail.imageIds=pageData.imageIdList.toString()
-			pageData.imageList.push(item)
+			pageData.imageList.push(e.id)
 		})
 	})
 }
@@ -194,17 +193,13 @@ const selectImg=(e)=>{
 // 删除图片,并将其从列表中删除
 const deleteImg=(e)=>{
 	let index=0
-	let deleteImgId = e.tempFilePath.split("=")[1].split("&")[0]
-	index = pageData.imageList.indexOf(deleteImgId)
-	pageData.imageList.splice(index,1)
-	if(typeof(pageData.imageIdList)==Array){
-		pageData.imageIdList.splice(index,1)
-		pageData.resList.detail.imageIds=pageData.imageIdList.toString()
-	}else{
-		let list = pageData.imageIdList.split(",")
-		list.splice(index,1)
-		pageData.resList.detail.imageIds=list.toString()
-	}
+	pageData.imageList.forEach((item,idx)=>{
+		index=e.tempFilePath.indexOf(item)
+		if(index>0){
+			// 删除列表中的元素
+			pageData.imageList.splice(idx,1)
+		}
+	})
 }
 
 const item = ref({})
@@ -248,13 +243,15 @@ const countTotal=()=>{
 
 // 保存环境质控
 const saveHjTask=()=>{
+	if(pageData.imageList!=null || pageData.imageList!=undefined){
+		pageData.resList.detail.imageIds=pageData.imageList.toString()
+	}
 	uni.showLoading({
 		title: '提交中.......',
 		mask: true
 	});
 	http.post("app-api/zkzy/save",pageData.resList).then(res=>{
 		uni.hideLoading()
-		console.log(res)
 		if(res==true){
 			uni.showToast({
 				title: '提交成功',
@@ -337,8 +334,13 @@ const getHJTask=(data)=>{
 			})
 		}
 		if(res.detail.imageIds!=null && res.detail.imageIds!=''){
-			pageData.imageIdList=res.detail.imageIds
-			pageData.imageList = showImage(res.detail.imageIds)
+			if(typeof(res.detail.imageIds)=='string'){
+				var urls=res.detail.imageIds.split(',')
+				pageData.imageList=[]
+				urls.forEach(e=>{
+					pageData.imageList.push(e)
+				})
+			}
 		}
 	})
 }
@@ -348,8 +350,13 @@ const showImage=(id)=>{
 	return uploadImageModelValue(id)
 }
 
-
 onShow(()=>{
+	setTimeout(()=>{
+		pageData.buttonDisabled=false
+	},5000)
+})
+
+onLoad(()=>{
 	createTask()
 })
 

+ 59 - 38
pages/ypczk/zkTask/dpTask.vue

@@ -33,12 +33,12 @@
 					</uni-td>
 					<uni-td align="center" style="width: 200rpx;">
 						<view style="display: flex;align-items: center;">
-							<uni-easyinput v-model.number="item.totalScore" :clearable="false" :disabled="pageData.disabledStatus" type="digit"></uni-easyinput>
+							<uni-easyinput v-model.number="item.totalScore" :clearable="false" :disabled="pageData.disabledStatus" type="digit" @change="changeYz(item)"></uni-easyinput>
 							<text>{{"(>"+(item.score!=null?item.score:0)+"g)"}}</text>
 						</view>
 					</uni-td>
 					<uni-td align="center">
-						<uni-easyinput v-model.number="item.score" :clearable="false" :disabled="pageData.disabledStatus" type="digit"></uni-easyinput>
+						<uni-easyinput v-model.number="item.score" :clearable="false" :disabled="pageData.disabledStatus" type="digit" @change="changeSz(item)"></uni-easyinput>
 					</uni-td>
 					<uni-td align="center">
 						<uni-easyinput v-model.number="item.resultContent" :clearable="false" :disabled="pageData.disabledStatus" type="digit"></uni-easyinput>
@@ -59,7 +59,7 @@
 				<uni-section title="图片上传" type="line">
 				</uni-section>
 				<view class="image_upload" style="border-top: 0.5px solid #ebedf0;margin-bottom: 3px;">
-					<uni-file-picker limit="4" :modelValue="pageData.imageList" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
+					<uni-file-picker limit="4" :modelValue="showImage(pageData.imageList)" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
 				</view>
 			</uni-card>
 		</view>
@@ -95,7 +95,6 @@ const pageData = reactive({
 	dpList:[],
 	// 图片列表
 	imageList: [],
-	imageIdList:[],
 	// 图片状态
 	imageStatus:true,
 	resData:{},
@@ -121,6 +120,20 @@ const createData=reactive({
 	providerType:''
 })
 
+// const changeSz=(item)=>{
+// 	if(item.score!=null && item.totalScore!=null){
+// 		// 误差率 = (实重 - 应重) / 实重
+// 		item.resultContent=Math.abs((item.score-item.totalScore)/item.score)
+// 	}
+// }
+
+// const changeYz=(item)=>{
+// 	if(item.score!=null && item.totalScore!=null){
+// 		// 误差率 = (实重 - 应重) / 实重
+// 		item.resultContent=Math.abs((item.score-item.totalScore)/item.score)
+// 	}
+// }
+
 // 均值 应重
 const avgYz=()=>{
 	let num=0
@@ -150,7 +163,9 @@ const avgWc=()=>{
 
 // 选中图片,将选中的图片添加列表
 const selectImg=(e)=>{
-	console.log(e)
+	if(pageData.imageList==null || pageData.imageList == undefined){
+		pageData.imageList=[]
+	}
 	e.tempFiles.forEach(item=>{
 		uni.showLoading({
 			title: '图片上传....',
@@ -158,13 +173,7 @@ const selectImg=(e)=>{
 		});
 		http.upload("oss/upload",{file:item.file}).then(e => {
 			uni.hideLoading()
-			item.id = e.id
-			console.log(e.id);
-			// pageData.resData.detail.imageIds=[]
-			// pageData.imageIdList.push(e.id)
-			pageData.imageIdList=pageData.imageIdList+','+e.id
-			pageData.resData.detail.imageIds=pageData.imageIdList.toString()
-			pageData.imageList.push(item)
+			pageData.imageList.push(e.id)
 		})
 	})
 }
@@ -172,24 +181,22 @@ const selectImg=(e)=>{
 // 删除图片,并将其从列表中删除
 const deleteImg=(e)=>{
 	let index=0
-	let deleteImgId = e.tempFilePath.split("=")[1].split("&")[0]
-	index = pageData.imageList.indexOf(deleteImgId)
-	pageData.imageList.splice(index,1)
-	if(typeof(pageData.imageIdList)==Array){
-		pageData.imageIdList.splice(index,1)
-		pageData.resData.detail.imageIds=pageData.imageIdList.toString()
-	}else{
-		let list = pageData.imageIdList.split(",")
-		list.splice(index,1)
-		pageData.resData.detail.imageIds=list.toString()
-	}
+	pageData.imageList.forEach((item,idx)=>{
+		index=e.tempFilePath.indexOf(item)
+		if(index>0){
+			// 删除列表中的元素
+			pageData.imageList.splice(idx,1)
+		}
+	})
 }
 
 const countResultContent=()=>{
-	console.log(pageData.resData);
 	pageData.resData.resultContent=0
 	pageData.resData.resultContent=avgWc()
 	pageData.resData.detail.reciper=data.reciper
+	if(pageData.imageList!=null || pageData.imageList!=undefined){
+		pageData.resData.detail.imageIds=pageData.imageList.toString()
+	}
 }
 
 // 下一个
@@ -324,24 +331,28 @@ const getDpTaskDetail=()=>{
 		pageData.taskStatus=res.detail.status
 		data.reciper=res.detail.reciper
 		if(res.detail.imageIds!=null && res.detail.imageIds!=''){
-			pageData.imageIdList=res.detail.imageIds
-			pageData.imageList = uploadImageModelValue(res.detail.imageIds)
+			if(typeof(res.detail.imageIds)=='string'){
+				var urls=res.detail.imageIds.split(',')
+				pageData.imageList=[]
+				urls.forEach(e=>{
+					pageData.imageList.push(e)
+				})
+			}
 		}
 	})
 }
 
-onShow(()=>{
-	if(pageData.operatorStatus=='add'){
-		pageData.imageStatus=false
-		pageData.disabledStatus=false
-		createTask()
-	}else{
-		pageData.imageStatus=true
-		pageData.disabledStatus=true
-		getDpTaskDetail()
-	}
-	
-})
+// onShow(()=>{
+// 	if(pageData.operatorStatus=='add'){
+// 		pageData.imageStatus=false
+// 		pageData.disabledStatus=false
+// 		createTask()
+// 	}else{
+// 		pageData.imageStatus=true
+// 		pageData.disabledStatus=true
+// 		getDpTaskDetail()
+// 	}
+// })
 
 onLoad((type)=>{
 	console.log(type)
@@ -364,6 +375,16 @@ onLoad((type)=>{
 	if(type.taskStatus!=null){
 		pageData.taskStatusData=type.taskStatus
 	}
+	// 获取代配数据
+	if(pageData.operatorStatus=='add'){
+		pageData.imageStatus=false
+		pageData.disabledStatus=false
+		createTask()
+	}else{
+		pageData.imageStatus=true
+		pageData.disabledStatus=true
+		getDpTaskDetail()
+	}
 })
 </script>
 

+ 12 - 0
pages/ypczk/zkTask/index.scss

@@ -371,6 +371,12 @@
 			background: rgba(79, 136, 129, 0.86);
 			color: rgba(255, 255, 255, 1);
 		}
+		.pass_button_grey{
+			flex: 1;
+			width: 100rpx;
+			background: #C1C1C1;
+			color: rgba(255, 255, 255, 1);
+		}
 		.finish_button_grop{
 			margin-top:auto;
 			padding-left: 28rpx;
@@ -671,6 +677,12 @@
 			background: rgba(79, 136, 129, 0.86);
 			color: rgba(255, 255, 255, 1);
 		}
+		.pass_button_grey{
+			flex: 1;
+			width: 100rpx;
+			background: #C1C1C1;
+			color: rgba(255, 255, 255, 1);
+		}
 		.finish_button_grop{
 			margin-top:auto;
 			padding-left: 28rpx;

+ 8 - 3
pages/ypczk/zkTask/zkTask.vue

@@ -3,7 +3,7 @@
 		<!-- 飞行质控任务 -->
 		<view class="flightTask">
 			<uni-card>
-				<uni-section title="飞行质控任务" type="line">
+				<uni-section :title="pageData.taskList.name" type="line">
 					<template v-slot:right>
 						<image style="width: 50rpx; height: 50rpx;" :src="showIcon.nowIcon" @click="changeState()"></image>
 					</template>
@@ -57,7 +57,7 @@
 						<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>
 					<!-- 表格数据行 -->
 					<uni-tr v-for="(item, index) in pageData.dpList" :key="index">
@@ -90,7 +90,7 @@
 						<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>
 					<!-- 表格数据行 -->
 					<uni-tr v-for="(item, index) in pageData.djList" :key="index">
@@ -230,7 +230,12 @@ const finishTask=()=>{
 
 // 查询质控作业--根据Id
 const getZkData=()=>{
+	uni.showLoading({
+		title: '',
+		mask: true
+	});
 	http.get("app-api/zkzy/findZkzyById",zkzyData).then(res=>{
+		uni.hideLoading()
 		console.log(res)
 		pageData.detailList=res
 		pageData.taskList=res.task

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

@@ -3,7 +3,7 @@
 		<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">
 			<!-- 所有 -->
 			<custom-tab-pane label="所有" name="zkTaskListViewRef_1">
-				<ZkTaskListView ref="zkTaskListViewRef_1" state=""  style="height: 100%;"></ZkTaskListView>
+				<ZkTaskListView ref="zkTaskListViewRef_1"  style="height: 100%;"></ZkTaskListView>
 			</custom-tab-pane>
 			<!-- 待质控 -->
 			<custom-tab-pane label="待质控" name="zkTaskListViewRef_2">	

BIN
static/dai_icon.png


BIN
static/wan_icon.png


BIN
static/whiteDisplay.png


BIN
static/zhi_icon.png