From 3c738f4fe2762bba8087e5a22fc0dc06560eab0e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 08 Aug 2024 10:01:17 +0800
Subject: [PATCH] 三色任务与自查任务

---
 subPackage/workbench/views/selfCheckDetail.vue |   97 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 71 insertions(+), 26 deletions(-)

diff --git a/subPackage/workbench/views/selfCheckDetail.vue b/subPackage/workbench/views/selfCheckDetail.vue
index 7cc0b7f..e7b0e60 100644
--- a/subPackage/workbench/views/selfCheckDetail.vue
+++ b/subPackage/workbench/views/selfCheckDetail.vue
@@ -8,7 +8,7 @@
 			<text>标签</text>
 			<text>{{label || "未完善"}}</text>
 		</view>
-		<view class="item-row flex j-c-s-b a-i-c">
+		<!-- <view class="item-row flex j-c-s-b a-i-c">
 			<text>场所负责人</text>
 			<text>{{info.principal || "未完善"}}</text>
 		</view>
@@ -19,7 +19,7 @@
 		<view class="item-row flex j-c-s-b a-i-c">
 			<text>检查人</text>
 			<text>{{info.name}}</text>
-		</view>
+		</view> -->
 		<view class="item-row flex j-c-s-b a-i-c">
 			<text>检查时间</text>
 			<text>{{info.createTime}}</text>
@@ -85,11 +85,11 @@
 		<view class="mt-20 bgc-ff">
 			<block v-for="(item,index) in itemList">
 				<block v-for="(i,k) in item.children">
-					<block v-for="(n,m) in info.patrolRecordVOList">
-						<!-- <view class="item-row flex j-c-s-b a-i-c" v-if="i.id == n.itemId && n.state == 1">
-							<text class="item-left">{{i.title}}</text>
-							<text>不存在</text>
-						</view> -->
+					<block v-for="(n,m) in info.taskPlaceRecordVOList">
+						<view class="item-row flex j-c-s-b a-i-c" v-if="i.id == n.itemId && n.state == 0">
+							<text class="item-left fw">{{item.title}}</text>
+							<!-- <text>不存在</text> -->
+						</view>
 						<u-collapse :value="ids" v-if="i.id == n.itemId && n.state == 0" ref="collapse">
 							<u-collapse-item :name="n.itemId" :title="i.title" value="存在" :disabled="true"
 								:clickable="false" :isLink="false">
@@ -151,11 +151,12 @@
 		<view class="blank"></view>
 		<!-- <footer-btn @click="submitInfo" v-if="roleType == 2 && (info.status == 4 || info.status == 3)"     /> -->
 		<audit-action v-if="roleType == 1 && info.status == 1" @handle="submitAudit" />
+		<footer-btn v-if="roleType == 2 && info.status == 3 " text="重新提交" @click="navTo" />
 	</view>
 </template>
 
 <script>
-	import uploadMixin from "@/mixin/uploadMixin";
+	import uploadMixin from "@/mixin/uploadMixinPlace";
 	import {
 		getPlaceCheckItem,
 		getPlaceCheckReformDetail,
@@ -164,7 +165,8 @@
 	} from '@/api/place/place.js'
 
 	import {
-		getPlaceCheckDetail
+		getPlaceCheckDetail,
+		auditPlaceCheck
 	} from '@/api/reporting/reporting.js'
 
 	import auditAction from '../components/actionBtn.vue'
@@ -180,32 +182,53 @@
 				signatureUrl: [],
 				label: "",
 				itemList: [],
-				roleType: '', //1.民警/系统管理员   2.场所负责人
-				ids: []
+				roleType: '', //1.民警/系统管理员   2.场所负责人 / 学校主体
+				ids: [],
+				taskId: "",
+				type: 1 // 2学校主体
 			}
 		},
 		async onLoad(option) {
 			let {
-				roleName
+				roleName,
+				roleAlias
 			} = uni.getStorageSync("activeRole")
 			if (roleName == "居民") {
 				this.roleType = 2;
-			}
-			if (roleName == "民警" || roleName == "系统管理员") {
+			} else if (roleName == "民警" || roleName == "系统管理员") {
 				this.roleType = 1;
+			} else if (roleAlias == "xyzt") {
+				this.roleType = 2;
+			}
+
+
+			if (option.type) {
+				this.type = option.type;
 			}
 
 			await this.getItem();
-			this.getDetail(option.id);
+			this.taskId = option.id;
+		},
+
+
+		onShow() {
+			setTimeout(() => {
+				this.getDetail();
+			}, 100)
 		},
 
 		methods: {
 
 			getDetail(id) {
 				getPlaceCheckDetail({
-					task: id
+					taskId: this.taskId
 				}).then(res => {
 					let data = res.data;
+					if (data.type == 2) {
+						uni.setNavigationBarTitle({
+							title: "校园安全检查"
+						})
+					}
 					// this.info = res.data;
 					this.images = this.$setImageUrl(res.data.imageUrls);
 					this.signatureUrl = this.$setImageUrl(res.data.signaturePath);
@@ -214,7 +237,7 @@
 							.labelName;
 					}
 					let ids = [];
-					for (let i of data.patrolRecordVOList) {
+					for (let i of data.taskPlaceRecordVOList) {
 						if ((data.status == 4 || data.status == 3) && this.roleType == 2) {
 							if (i.rectificationImageUrls) {
 								i.urls = this.$setImageUrl(i.rectificationImageUrls, 2);
@@ -232,7 +255,15 @@
 			},
 
 			getItem() {
-				getPlaceCheckItem().then(res => {
+				let data = {
+					childType: 1,
+					type: 1
+				}
+				if (this.type == 2) {
+					data.childType = 9;
+					data.type = 3;
+				}
+				getPlaceCheckItem(data).then(res => {
 					if (res.code == 200) {
 						this.itemList = res.data;
 					}
@@ -243,7 +274,7 @@
 				uni.showLoading({
 					title: "上传中..."
 				})
-				let children = this.info.patrolRecordVOList;
+				let children = this.info.taskPlaceRecordVOList;
 				let lists = [].concat(event.file)
 				let fileListLen = item.urls.length;
 				lists.map((item) => {
@@ -252,7 +283,7 @@
 						status: 'uploading',
 						message: '上传中'
 					})
-					this.$set(this.info, "patrolRecordVOList", children)
+					this.$set(this.info, "taskPlaceRecordVOList", children)
 				})
 				for (let i = 0; i < lists.length; i++) {
 					const result = await this.uploadFilePromise(lists[i].url)
@@ -260,16 +291,16 @@
 						url: result.data.link,
 						name: result.data.name
 					}))
-					this.$set(this.info, "patrolRecordVOList", children)
+					this.$set(this.info, "taskPlaceRecordVOList", children)
 					fileListLen++
 				}
 				this.loadingClose()
 			},
 
 			deleteImages(event, index) {
-				let children = this.info.patrolRecordVOList;
+				let children = this.info.taskPlaceRecordVOList;
 				children[index].urls.splice(event.index, 1);
-				this.$set(this.info, "patrolRecordVOList", children)
+				this.$set(this.info, "taskPlaceRecordVOList", children)
 			},
 
 			setImages(key) {
@@ -297,7 +328,7 @@
 					title: "加载中..."
 				})
 				let data = this.info;
-				for (let i of data.patrolRecordVOList) {
+				for (let i of data.taskPlaceRecordVOList) {
 					if (i.urls) {
 						i.rectificationImageUrls = this.setImages(i.urls)
 					}
@@ -325,7 +356,7 @@
 				uni.showLoading({
 					title: "加载中..."
 				})
-				auditPlaceCheckReform({
+				auditPlaceCheck({
 					id: this.info.id,
 					taskId: this.info.taskId,
 					status: val.type,
@@ -340,7 +371,21 @@
 						}, 300)
 					}
 				})
-			}
+			},
+
+			navTo() {
+				if (this.type == 1) {
+					uni.navigateTo({
+						url: `/subPackage/label/check?taskId=${this.info.taskId}`
+					})
+				} else {
+					uni.navigateTo({
+						url: `/subPackage/school/security?taskId=${this.info.taskId}`
+					})
+				}
+
+			},
+
 		}
 	}
 </script>

--
Gitblit v1.9.3