From 1e6d7c100df5ed8c5507188158a741ee584cce5c Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Mon, 15 Jan 2024 17:47:58 +0800
Subject: [PATCH] 标签修改,走访任务修改,场所任务修改

---
 pages.json                                        |    9 
 subPackage/task/workLogDetail.vue                 |  155 +++++++++++
 subPackage/label/hotel.vue                        |  119 ++++++-
 subPackage/workbench/views/workLog.vue            |  133 ++++++++-
 subPackage/label/form.vue                         |  149 ++++++++--
 subPackage/workbench/views/audit.vue              |   31 ++
 common/common.js                                  |   23 +
 api/reporting/reporting.js                        |   19 
 pages/home/index.vue                              |    5 
 subPackage/workbench/views/schoolReportDetail.vue |    4 
 api/workLog/workLog.js                            |   19 +
 main.js                                           |    9 
 subPackage/task/workLogList.vue                   |   17 
 subPackage/house/member/householdLabel.vue        |    9 
 subPackage/label/school.vue                       |  127 +++++++-
 15 files changed, 696 insertions(+), 132 deletions(-)

diff --git a/api/reporting/reporting.js b/api/reporting/reporting.js
index 27b43b5..a4e99d3 100644
--- a/api/reporting/reporting.js
+++ b/api/reporting/reporting.js
@@ -141,6 +141,15 @@
 	})
 }
 
+//修改校园安全报事
+export const setSchoolReporting = (data) => {
+	return http.request({
+		url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/update',
+		method: 'POST',
+		data: data
+	})
+}
+
 
 //获取校园安全报事列表
 export const getSchoolReportingList = (params) => {
@@ -166,16 +175,6 @@
 export const saveSchoolReporting = (data) => {
 	return http.request({
 		url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/save',
-		method: 'POST',
-		data: data
-	})
-}
-
-
-//修改校园安全报事
-export const setSchoolReporting = (data) => {
-	return http.request({
-		url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/update',
 		method: 'POST',
 		data: data
 	})
diff --git a/api/workLog/workLog.js b/api/workLog/workLog.js
index cb2847e..5530c38 100644
--- a/api/workLog/workLog.js
+++ b/api/workLog/workLog.js
@@ -17,4 +17,23 @@
 			...params
 		}
 	})
+}
+
+
+export const getWorkLogDetail = (params) => {
+	return http.request({
+		url: '/blade-gridWorkLog/gridWorkLog/detail',
+		method: 'GET',
+		params: {
+			...params
+		}
+	})
+}
+
+export const updateWorkLog = (data) => {
+	return http.request({
+		url: '/blade-gridWorkLog/gridWorkLog/update',
+		method: 'POST',
+		data
+	})
 }
\ No newline at end of file
diff --git a/common/common.js b/common/common.js
index 500c1c3..8bcdec0 100644
--- a/common/common.js
+++ b/common/common.js
@@ -28,9 +28,32 @@
 		return []
 	}
 }
+
+
 export const showTips = (text, icon) => {
 	uni.showToast({
 		title: text,
 		icon: icon ? icon : 'none'
 	})
+}
+
+
+// 获取数据下标信息  (picker选择器数据回显)
+export const getIndex = (arr, value, key, nameKey) => {
+	if (key) {
+		for (let i = 0, ii = arr.length; i < ii; i++) {
+			if (arr[i] == value) {
+				return i;
+			}
+		}
+	} else {
+		for (let i = 0, ii = arr.length; i < ii; i++) {
+			if (arr[i][key] == value) {
+				return {
+					index: i,
+					name: arr[i][nameKey]
+				}
+			}
+		}
+	}
 }
\ No newline at end of file
diff --git a/main.js b/main.js
index e1c84d5..8e90928 100644
--- a/main.js
+++ b/main.js
@@ -5,7 +5,11 @@
 // import boxTitle from '@/components/boxTitle/index.vue';
 // Vue.component('box-title', boxTitle) // 
 import footerBtn from '@/components/btn/footerBtn.vue'
-import { setImageUrl,showTips } from '@/common/common.js'
+import {
+	setImageUrl,
+	showTips,
+	getIndex
+} from '@/common/common.js'
 Vue.config.productionTip = false;
 
 App.mpType = 'app';
@@ -13,7 +17,7 @@
 // 引入全局uView
 import uView from "uview-ui";
 Vue.use(uView);
-Vue.component('footer-btn', footerBtn) 
+Vue.component('footer-btn', footerBtn)
 // 引入vuex
 const vuexStore = require("@/store/$u.mixin.js");
 Vue.mixin(vuexStore);
@@ -33,6 +37,7 @@
 Vue.prototype.$http = http
 Vue.prototype.$showTips = showTips;
 Vue.prototype.$setImageUrl = setImageUrl;
+Vue.prototype.$getIndex = getIndex
 // 公共函数
 import globalFunc from '@/utils/func.js'
 Vue.use(globalFunc, app);
diff --git a/pages.json b/pages.json
index 6300d84..52a1eea 100644
--- a/pages.json
+++ b/pages.json
@@ -348,6 +348,15 @@
 						"navigationBarBackgroundColor": "#fff",
 						"navigationBarTextStyle": "black"
 					}
+				},
+				{
+					"path": "workLogDetail",
+					"style": {
+						"navigationBarTitleText": "走访日志详情",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor": "#fff",
+						"navigationBarTextStyle": "black"
+					}
 				}
 			]
 		},
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 20c6954..df39874 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -734,8 +734,11 @@
 
 			//场所任务跳转 
 			navToSiteList() {
+				let {
+					houseCode
+				} = uni.getStorageSync("siteInfo")
 				uni.navigateTo({
-					url: `/subPackage/workbench/views/audit?code=${uni.getStorageSync("siteInfo").houseCode}`
+					url: `/subPackage/workbench/views/audit?code=${houseCode}&from=index`
 				})
 			}
 		}
diff --git a/subPackage/house/member/householdLabel.vue b/subPackage/house/member/householdLabel.vue
index 8fd2342..10aad7d 100644
--- a/subPackage/house/member/householdLabel.vue
+++ b/subPackage/house/member/householdLabel.vue
@@ -94,16 +94,19 @@
 					{
 						name: '绿',
 						disabled: false,
-						color: '#30D17C'
+						// color: '#30D17C'
+						color: 'green'
 					},
 					{
 						name: '黄',
 						disabled: false,
-						color: '#FFB42B'
+						color: '#FFB42B',
+						color: 'yellow'
 					}, {
 						name: '红',
 						disabled: false,
-						color: '#EA1F1F'
+						color: '#EA1F1F',
+						color: 'red'
 					}
 				],
 				currentLabelInfo: {},
diff --git a/subPackage/label/form.vue b/subPackage/label/form.vue
index 86c8129..6e0cd3f 100644
--- a/subPackage/label/form.vue
+++ b/subPackage/label/form.vue
@@ -4,6 +4,10 @@
 		<u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100"
 			:labelStyle="{fontSize:'28rpx'}">
 			<view class="content">
+				<u-form-item label="场所名称" prop="districtName" borderBottom required>
+					<u-input v-model="info.districtName" border="none" placeholder="请输入" placeholderClass="f-28 c-99"
+						inputAlign="right"></u-input>
+				</u-form-item>
 				<u-form-item label="对象电话" prop="transactionObjectTel" borderBottom required>
 					<u-input v-model="info.transactionObjectTel" type="number" border="none" placeholder="请输入"
 						placeholderClass="f-28 c-99" inputAlign="right"></u-input>
@@ -76,7 +80,9 @@
 <script>
 	import uploadMixin from "@/mixin/uploadMixin";
 	import {
-		saveLabelReporting
+		saveLabelReporting,
+		getLabelReportingDetail,
+		setLabelReporting
 	} from "@/api/reporting/reporting";
 	export default {
 		mixins: [uploadMixin],
@@ -90,9 +96,15 @@
 					transactionProcess: "",
 					houseCode: "",
 					districtName: "",
-					userId: ""
+					userId: "",
+					reportType: ""
 				},
 				rules: {
+					'districtName': {
+						required: true,
+						message: '请输入场所名称',
+						trigger: ['blur', 'change']
+					},
 					'transactionObjectTel': [{
 							type: 'number',
 							required: true,
@@ -127,35 +139,76 @@
 				},
 				imageUrls: [],
 				goodsImageUrls: [],
-				eventType: 1
+				eventType: 1,
+				isEdit: false,
+				id: ""
 			}
 		},
 		onLoad(option) {
 			console.log(option);
-			if (option.type != 1) {
-				this.eventType = option.type;
-				uni.setNavigationBarTitle({
-					title: this.setTitle(option.type)
-				})
-			}
-			this.$set(this.info, "eventType", option.type);
-
-
-			if (option.type == 1) {
-				this.$set(this.info, "reportType", 3);
-			} else if (option.type == 2) {
-				this.$set(this.info, "reportType", 4);
+			if (option.id) {
+				this.isEdit = true;
+				this.id = opton.id;
+				this.getDetail(option.id);
 			} else {
-				this.$set(this.info, "reportType", 5);
+				if (option.type != 1) {
+					this.eventType = option.type;
+					uni.setNavigationBarTitle({
+						title: this.setTitle(option.type)
+					})
+				}
+				this.$set(this.info, "eventType", option.type);
+				if (option.type == 1) {
+					this.$set(this.info, "reportType", 3);
+				} else if (option.type == 2) {
+					this.$set(this.info, "reportType", 4);
+				} else {
+					this.$set(this.info, "reportType", 5);
+				}
+
+				let siteInfo = uni.getStorageSync("siteInfo");
+				let userInfo = uni.getStorageSync("userInfo");
+				this.$set(this.info, "houseCode", siteInfo.houseCode);
+				// this.$set(this.info, "districtName", siteInfo.name);
+				this.$set(this.info, "userId", userInfo.user_id);
 			}
 
-			let siteInfo = uni.getStorageSync("siteInfo");
-			let userInfo = uni.getStorageSync("userInfo");
-			this.$set(this.info, "houseCode", siteInfo.houseCode);
-			this.$set(this.info, "districtName", siteInfo.name);
-			this.$set(this.info, "userId", userInfo.user_id);
 		},
 		methods: {
+
+			getDetail(id) {
+				getLabelReportingDetail({
+					taskId: id
+				}).then(res => {
+					if (res.code == 200) {
+						let data = res.data;
+						uni.setNavigationBarTitle({
+							title: data.name
+						})
+						for (let i in this.info) {
+							this.info[i] = data[i]
+						}
+						this.imageUrls = this.$setImageUrl(data.imageUrls, 2);
+						this.goodsImageUrls = this.$setImageUrl(data.goodsImageUrls, 2);
+						this.eventType = data.eventType;
+						this.info.eventType = data.eventType;
+						if (data.checkTime) {
+							this.checkTime = Number(new Date(data.checkTime));
+						}
+						this.info.id = data.id;
+						this.info.taskId = data.taskId;
+
+						if (data.eventType == 1) {
+							this.$set(this.info, "reportType", 3);
+						} else if (option.type == 2) {
+							this.$set(this.info, "reportType", 4);
+						} else {
+							this.$set(this.info, "reportType", 5);
+						}
+					}
+				})
+			},
+
 			setTitle(type) {
 				if (type == 4) {
 					return "二手手机维修"
@@ -220,20 +273,50 @@
 			sumitInfo() {
 				this.$refs.form.validate().then(valid => {
 					this.checkImages()
-					saveLabelReporting(this.info).then(res => {
-						uni.showToast({
-							icon: 'success',
-							title: '提交成功',
-							success() {
-								setTimeout(() => {
-									uni.navigateBack()
-									// this.$u.func.globalNavigator("", "navBack")
-								}, 1000)
-							}
-						})
+					if (this.isEdit) {
+						this.info.status = 1;
+						this.setRequest()
+					} else {
+						this.addRequest()
+					}
+				})
+			},
+
+			addRequest() {
+				saveLabelReporting(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '提交成功',
+						success() {
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 300)
+						}
 					})
 				})
 			},
+			setRequest() {
+				setLabelReporting(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '保存成功'
+					})
+					setTimeout(() => {
+						this.reLoadPrePage()
+					}, 300)
+				})
+			},
+
+			//刷新上一页数据后返回
+			reLoadPrePage() {
+				let pages = getCurrentPages();
+				let prePage = pages[pages.length - 2];
+				prePage.$vm.currentPage = 1;
+				prePage.$vm.list = [];
+				prePage.$vm.getList();
+				uni.navigateBack();
+			},
+
 			navigatorPage() {
 				this.$u.func.globalNavigator(`formList?type=${this.eventType}`, "navTo")
 			}
diff --git a/subPackage/label/hotel.vue b/subPackage/label/hotel.vue
index c3a4e12..23b3d08 100644
--- a/subPackage/label/hotel.vue
+++ b/subPackage/label/hotel.vue
@@ -163,7 +163,7 @@
 				</u-form-item>
 			</view>
 		</u-form>
-		<button class="submit-btn" @click="sumitInfo">提交</button>
+		<button class="submit-btn" @click="sumitInfo">{{isEdit?"保存":"提交"}}</button>
 		<button class="list-btn" @click="navigatorPage">我上报的事件</button>
 		<u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="checkTime" mode="datetime"
 			:formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker>
@@ -177,7 +177,9 @@
 <script>
 	import uploadMixin from "@/mixin/uploadMixin";
 	import {
-		saveHotelReporting
+		saveHotelReporting,
+		setHotelReporting,
+		getHotelReportingDetail
 	} from "@/api/reporting/reporting";
 
 	export default {
@@ -185,7 +187,6 @@
 		data() {
 			return {
 				info: {
-					districtName: "",
 					hotelName: "",
 					checkUserName: "",
 					checkTelephone: "",
@@ -330,18 +331,25 @@
 						name: "以上皆未做到",
 						value: 6
 					}
-
-				]
+				],
+				isEdit: false,
+				id: ""
 			}
 		},
 		onLoad(option) {
-			let siteInfo = uni.getStorageSync("siteInfo");
-			let userInfo = uni.getStorageSync("userInfo");
-			this.$set(this.info, "houseCode", siteInfo.houseCode);
-			this.$set(this.info, "districtName", siteInfo.neiName || "");
-			this.$set(this.info, "checkUserName", userInfo.real_name);
-			this.$set(this.info, "checkTelephone", userInfo.phone);
-			this.$set(this.info, "checkUserId", userInfo.user_id);
+			if (option.id) {
+				this.isEdit = true;
+				this.getDetail(option.id)
+			} else {
+				let siteInfo = uni.getStorageSync("siteInfo");
+				let userInfo = uni.getStorageSync("userInfo");
+				this.$set(this.info, "houseCode", siteInfo.houseCode);
+				// this.$set(this.info, "districtName", siteInfo.neiName || "");
+				this.$set(this.info, "checkUserName", userInfo.real_name);
+				this.$set(this.info, "checkTelephone", userInfo.phone);
+				this.$set(this.info, "checkUserId", userInfo.user_id);
+			}
+
 		},
 
 		onReady() {
@@ -350,6 +358,36 @@
 		},
 
 		methods: {
+
+			getDetail(id) {
+				getHotelReportingDetail({
+					taskId: id
+				}).then(res => {
+					if (res.code == 200) {
+						let data = res.data;
+						for (let i in this.info) {
+							this.info[i] = data[i]
+						}
+						if (data.fireStatus) {
+							this.fireStatusIndex = [this.$getIndex(this.fireStatus[0], data.fireStatus)];
+						}
+
+						this.fireImageUrls = this.$setImageUrl(data.fireImageUrls, 2);
+						this.scImageUrls = this.$setImageUrl(data.scImageUrls, 2);
+						this.uanImageUrls = this.$setImageUrl(data.uanImageUrls, 2);
+						this.pfImageUrls = this.$setImageUrl(data.pfImageUrls, 2)
+						if (data.scStatus) {
+							this.scStatusIndex = [this.$getIndex(this.scStatus[0], data.scStatus)]
+						}
+						if (data.checkTime) {
+							this.checkTime = Number(new Date(data.checkTime));
+						}
+						this.info.id = data.id;
+						this.info.taskId = data.taskId;
+					}
+				})
+			},
+
 
 			getLocation() {
 				uni.chooseLocation({
@@ -436,21 +474,54 @@
 			sumitInfo() {
 				this.$refs.form.validate().then(valid => {
 					this.checkImages()
-					console.log("info=>", this.info);
-					saveHotelReporting(this.info).then(res => {
-						uni.showToast({
-							icon: 'success',
-							title: '提交成功',
-							success() {
-								setTimeout(() => {
-									uni.navigateBack()
-									// that.$u.func.globalNavigator("", "navBack")
-								}, 1000)
-							}
-						})
+					if (this.isEdit) {
+						this.info.id = this.id;
+						this.info.status = 1;
+						this.info.reportType = 2;
+						this.setHotelReportingRequest()
+					} else {
+						this.addHotelReportingRequest()
+					}
+				})
+			},
+
+			addHotelReportingRequest() {
+				saveHotelReporting(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '提交成功',
+						success() {
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 300)
+						}
 					})
 				})
 			},
+
+
+			setHotelReportingRequest() {
+				setHotelReporting(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '保存成功'
+					})
+					setTimeout(() => {
+						this.reLoadPrePage()
+					}, 300)
+				})
+			},
+
+			//刷新上一页数据后返回
+			reLoadPrePage() {
+				let pages = getCurrentPages();
+				let prePage = pages[pages.length - 2];
+				prePage.$vm.currentPage = 1;
+				prePage.$vm.list = [];
+				prePage.$vm.getList();
+				uni.navigateBack();
+			},
+
 			navigatorPage() {
 				this.$u.func.globalNavigator('hotelList', "navTo")
 			}
diff --git a/subPackage/label/school.vue b/subPackage/label/school.vue
index 080b351..c2d1db7 100644
--- a/subPackage/label/school.vue
+++ b/subPackage/label/school.vue
@@ -3,11 +3,11 @@
 		<u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100"
 			:labelStyle="{fontSize:'28rpx'}">
 			<view class="content">
-				<u-form-item label="社区名称" prop="districtName" borderBottom required>
+				<!-- <u-form-item label="社区名称" prop="districtName" borderBottom required>
 					<view class="content-name f-28">
 						{{info.districtName}}
 					</view>
-				</u-form-item>
+				</u-form-item> -->
 				<u-form-item label="校园名称" prop="campusName" borderBottom required>
 					<u-input v-model="info.campusName" border="none" placeholder="请输入" placeholderClass="f-28 c-99"
 						inputAlign="right"></u-input>
@@ -195,7 +195,7 @@
 			</view>
 
 		</u-form>
-		<button class="submit-btn" @click="sumitInfo">提交</button>
+		<button class="submit-btn" @click="sumitInfo">{{isEdit?"保存":"提交"}}</button>
 		<button class="list-btn" @click="navigatorPage">我上报的事件</button>
 		<u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="checkTime" mode="datetime"
 			:formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker>
@@ -207,7 +207,9 @@
 <script>
 	import uploadMixin from "@/mixin/uploadMixin";
 	import {
-		saveSchoolReporting
+		saveSchoolReporting,
+		getSchoolReportingDetail,
+		setSchoolReporting
 	} from "@/api/reporting/reporting";
 
 	export default {
@@ -215,7 +217,6 @@
 		data() {
 			return {
 				info: {
-					districtName: "",
 					campusName: "",
 					checkUserName: "",
 					checkTelephone: "",
@@ -377,17 +378,28 @@
 						name: "以上皆未配备",
 						value: 5
 					}
-				]
+				],
+				isEdit: false,
+				id: ""
 			}
 		},
 		onLoad(option) {
-			let siteInfo = uni.getStorageSync("siteInfo");
-			let userInfo = uni.getStorageSync("userInfo");
-			this.$set(this.info, "houseCode", siteInfo.houseCode);
-			this.$set(this.info, "districtName", siteInfo.neiName || "");
-			this.$set(this.info, "checkUserName", userInfo.real_name);
-			this.$set(this.info, "checkTelephone", userInfo.phone);
-			this.$set(this.info, "checkUserId", userInfo.user_id);
+
+			if (option.id) {
+				this.isEdit = true;
+				this.id = option.id;
+				this.getDetail(option.id)
+			} else {
+				let siteInfo = uni.getStorageSync("siteInfo");
+				let userInfo = uni.getStorageSync("userInfo");
+				this.$set(this.info, "houseCode", siteInfo.houseCode);
+				// this.$set(this.info, "districtName", siteInfo.neiName || "");
+				this.$set(this.info, "checkUserName", userInfo.real_name);
+				this.$set(this.info, "checkTelephone", userInfo.phone);
+				this.$set(this.info, "checkUserId", userInfo.user_id);
+			}
+
+
 		},
 
 		onReady() {
@@ -396,6 +408,37 @@
 		},
 
 		methods: {
+
+			getDetail(id) {
+				getSchoolReportingDetail({
+					taskId: id
+				}).then(res => {
+					if (res.code == 200) {
+						let data = res.data;
+						for (let i in this.info) {
+							this.info[i] = data[i]
+						}
+						this.foImageUrls = this.$setImageUrl(data.foImageUrls, 2);
+						this.fireFacsImageUrls = this.$setImageUrl(data.fireFacsImageUrls, 2);
+						this.scImageUrls = this.$setImageUrl(data.scImageUrls, 2);
+						this.antiCollisionImageUrls = this.$setImageUrl(data.antiCollisionImageUrls, 2)
+						this.patrolImageUrls = this.$setImageUrl(data.patrolImageUrls, 2)
+						this.haImageUrls = this.$setImageUrl(data.haImageUrls, 2)
+						if (data.scStatus) {
+							this.scStatusIndex = [this.$getIndex(this.scStatus[0], data.scStatus)]
+						}
+
+						if (data.checkTime) {
+							this.checkTime = Number(new Date(data.checkTime));
+						}
+						this.info.id = data.id;
+						this.info.taskId = data.taskId;
+
+					}
+				})
+			},
+
+
 
 			getLocation() {
 				uni.chooseLocation({
@@ -480,22 +523,58 @@
 			sumitInfo() {
 				this.$refs.form.validate().then(valid => {
 					this.checkImages()
-					saveSchoolReporting(this.info).then(res => {
-						uni.showToast({
-							icon: 'success',
-							title: '提交成功',
-							success() {
-								setTimeout(() => {
-									uni.navigateBack()
-								}, 1000)
-							}
-						})
+					if (this.isEdit) {
+						this.setRequest()
+					} else {
+						this.addRequst()
+					}
+
+				})
+			},
+
+			addRequst() {
+				saveSchoolReporting(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '提交成功',
+						success() {
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 300)
+						}
 					})
 				})
 			},
+
+			setRequest() {
+				this.info.status = 1;
+				this.info.reportType = 6;
+				setSchoolReporting(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '修改成功',
+					})
+					setTimeout(() => {
+						this.reLoadPrePage()
+					}, 300)
+				})
+			},
+
+
 			navigatorPage() {
 				this.$u.func.globalNavigator('schoolList', "navTo")
-			}
+			},
+
+			//刷新上一页数据后返回
+			reLoadPrePage() {
+				let pages = getCurrentPages();
+				let prePage = pages[pages.length - 2];
+				prePage.$vm.currentPage = 1;
+				prePage.$vm.list = [];
+				prePage.$vm.getList();
+				uni.navigateBack();
+			},
+
 		}
 	}
 </script>
diff --git a/subPackage/task/workLogDetail.vue b/subPackage/task/workLogDetail.vue
new file mode 100644
index 0000000..6250532
--- /dev/null
+++ b/subPackage/task/workLogDetail.vue
@@ -0,0 +1,155 @@
+<template>
+	<view class="">
+		<view class="item-row flex j-c-s-b a-i-c">
+			<text>走访类型</text>
+			<text>{{typeName}}</text>
+		</view>
+		<view class="item-row flex j-c-s-b a-i-c" v-if="info.type == 2">
+			<text>重点人群类型</text>
+			<text>{{labelName}}</text>
+		</view>
+		<view class="item-row flex j-c-s-b a-i-c">
+			<text>被访人姓名</text>
+			<text>{{houseHold.name}}</text>
+		</view>
+		<view class="item-row flex j-c-s-b a-i-c">
+			<text>手机号</text>
+			<text>{{houseHold.phoneNumber}}</text>
+		</view>
+		<view class="item-row flex j-c-s-b a-i-c">
+			<text>走访地址</text>
+			<text>{{houseHold.currentAddress}}</text>
+		</view>
+		<view class="item-row flex j-c-s-b a-i-c">
+			<text>内容</text>
+			<text>{{info.context}}</text>
+		</view>
+		<view class="item-row flex j-c-s-b a-i-c">
+			<text>内容</text>
+			<text>{{info.wordTime}}</text>
+		</view>
+
+		<view class="image-wrap bgc-ff">
+			<view class="image-item" v-for="(i,k) in images" @click="previewImage(i)">
+				<u-image :src="i" width="80rpx" height="80rpx"></u-image>
+			</view>
+
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		getWorkLogDetail
+	} from "@/api/workLog/workLog.js"
+	import {
+		getHouseholdDetail
+	} from '@/api/house/household.js'
+	export default {
+		data() {
+			return {
+				info: {},
+				images: [],
+				typeName: "",
+				labelName: "",
+				houseHold: {},
+				typeList: [],
+				labelList: []
+			}
+		},
+		async onLoad(option) {
+			await this.getTypeList();
+			await this.getLabelLit();
+			this.getDetail(option.id);
+		},
+		methods: {
+			getDetail(id) {
+				getWorkLogDetail({
+					id
+				}).then(res => {
+					this.info = res.data;
+					this.images = this.$setImageUrl(res.data.url);
+					this.getHousehold(res.data.houseHold);
+					this.typeName = this.getTypeValue(res.data.type);
+					this.labelName = this.getLabelValue(res.data.personType);
+				})
+			},
+
+
+			getTypeList() {
+				bizDictionary({
+					code: "haveType"
+				}).then(res => {
+					console.log(res)
+					this.typeList = res.data;
+				})
+			},
+
+			getLabelLit() {
+				getLabelListByParentId({
+					parentId: 100
+				}).then(res => {
+					this.labelList = res.data;
+				})
+			},
+
+			getTypeValue(value) {
+				for (let i = 0, ii = this.typeList.length; i < ii; i++) {
+					if (value == this.typeList[i].dictKey) {
+						return this.typeList[i].dictValue
+					}
+				}
+			},
+
+			getLabelValue(value) {
+				for (let i = 0, ii = this.labelList.length; i < ii; i++) {
+					if (value == this.labelList[i].id) {
+						return this.labelList[i].name
+					}
+				}
+			},
+
+			getHousehold(id) {
+				getHouseholdDetail({
+					id
+				}).then(res => {
+					console.log(res);
+					this.houseHold = res.data;
+				})
+			},
+
+			previewImage(cur) {
+				uni.previewImage({
+					urls: this.images,
+					current: cur
+				})
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #f5f5f5;
+	}
+
+	.item-row {
+		width: 100%;
+		padding: 30rpx;
+		box-sizing: border-box;
+		border-bottom: 1px solid #f5f5f5;
+		font-size: 28rpx;
+		background-color: #fff;
+	}
+
+	.image-wrap {
+		margin-top: 20rpx;
+		padding: 20rpx;
+
+		.image-item {
+			margin-right: 20rpx;
+		}
+	}
+</style>
\ No newline at end of file
diff --git a/subPackage/task/workLogList.vue b/subPackage/task/workLogList.vue
index 410de94..36bb6e6 100644
--- a/subPackage/task/workLogList.vue
+++ b/subPackage/task/workLogList.vue
@@ -20,7 +20,7 @@
 		</u-sticky>
 
 		<view class="list">
-			<view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k">
+			<view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k" @click="navTo(i.id,i.status)">
 				<view class="item-title flex a-i-c j-c-s-b mb-20">
 					<text class="f-32 fw">{{i.name}}</text>
 					<u-tag v-if="i.status == 1" text="待处理" type="warning" plain plainFill></u-tag>
@@ -162,16 +162,11 @@
 					this.loadingStatus = 'nomore'
 				})
 			},
-			navTo(name, id, type) {
-
-				if (type == 1) {
-					this.$u.func.globalNavigator(`bailReportDetail?id=${id}`)
-				} else if (type == 2) {
-					this.$u.func.globalNavigator(`hotelReportDetail?id=${id}`)
-				} else if (type == 3 || type == 4 || type == 5) {
-					this.$u.func.globalNavigator(`labelReportDetail?id=${id}`)
-				} else if (type == 6) {
-					this.$u.func.globalNavigator(`schoolReportDetail?id=${id}`)
+			navTo(id, status) {
+				if (status == 1) {
+					this.$u.func.globalNavigator(`/subPackage/workbench/views/workLog?id=${id}`)
+				} else {
+					this.$u.func.globalNavigator(`workLogDetail?id=${id}`)
 				}
 			},
 
diff --git a/subPackage/workbench/views/audit.vue b/subPackage/workbench/views/audit.vue
index 4453c99..63c59a9 100644
--- a/subPackage/workbench/views/audit.vue
+++ b/subPackage/workbench/views/audit.vue
@@ -21,7 +21,7 @@
 
 		<view class="list">
 			<view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k"
-				@click="navTo(i.name,i.id,i.reportType)">
+				@click="navTo(i.id,i.reportType,i.status)">
 				<view class="item-title flex a-i-c j-c-s-b mb-20">
 					<text class="f-32 fw">{{i.name}}</text>
 					<u-tag v-if="i.status == 4" text="待接收" type="warning" plain plainFill></u-tag>
@@ -101,7 +101,12 @@
 					title: "取保候审"
 				})
 			}
-			if (option.from) {
+			if (option.from == "index") {
+				uni.setNavigationBarTitle({
+					title: "场所任务"
+				})
+			}
+			if (option.from == "task") {
 				this.tabIndex = 1;
 				this.currentStatus = 1;
 			}
@@ -182,7 +187,27 @@
 					this.loadingStatus = 'nomore'
 				})
 			},
-			navTo(name, id, type) {
+			navTo(id, type, status) {
+				if (status == 4) {
+					this.navToEdit(type, id);
+				} else {
+					this.navToDetail(type, id)
+				}
+			},
+
+			navToEdit(type, id) {
+				if (type == 1) {
+					this.$u.func.globalNavigator(`/subPackage/label/bail?id=${id}`)
+				} else if (type == 2) {
+					this.$u.func.globalNavigator(`/subPackage/label/hotel?id=${id}`)
+				} else if (type == 3 || type == 4 || type == 5) {
+					this.$u.func.globalNavigator(`/subPackage/label/form?id=${id}`)
+				} else if (type == 6) {
+					this.$u.func.globalNavigator(`/subPackage/label/school?id=${id}`)
+				}
+			},
+
+			navToDetail(type, id) {
 				if (type == 1) {
 					this.$u.func.globalNavigator(`bailReportDetail?id=${id}`)
 				} else if (type == 2) {
diff --git a/subPackage/workbench/views/schoolReportDetail.vue b/subPackage/workbench/views/schoolReportDetail.vue
index 24b3fa7..254c15f 100644
--- a/subPackage/workbench/views/schoolReportDetail.vue
+++ b/subPackage/workbench/views/schoolReportDetail.vue
@@ -285,8 +285,8 @@
 			reLoadPrePage() {
 				let pages = getCurrentPages();
 				let prePage = pages[pages.length - 2];
-				prePage.$vm.currentPage = 1,
-					prePage.$vm.list = [];
+				prePage.$vm.currentPage = 1;
+				prePage.$vm.list = [];
 				prePage.$vm.getList();
 				uni.navigateBack();
 			},
diff --git a/subPackage/workbench/views/workLog.vue b/subPackage/workbench/views/workLog.vue
index 269c9b3..2dc904f 100644
--- a/subPackage/workbench/views/workLog.vue
+++ b/subPackage/workbench/views/workLog.vue
@@ -76,7 +76,7 @@
 			@cancel="isShowTypePicker = false" @confirm="confirmType()" keyName="dictValue"></u-picker>
 		<u-picker :show="isShowLabelPicker" :columns="labelList" :defaultIndex="labelIndex"
 			@cancel="isShowLabelPicker = false" @confirm="confirmLabelType()" keyName="name"></u-picker>
-		<footer-btn @click="submitInfo" />
+		<footer-btn @click="submitInfo" :text="isEdit?'保存':'提交'" />
 
 		<u-popup :show="isShowPopup" mode="bottom" :round="10" closeable="true" @close="isShowPopup = false">
 			<view class="popup-content">
@@ -113,11 +113,14 @@
 
 <script>
 	import {
-		addWorkLog
+		addWorkLog,
+		getWorkLogDetail,
+		updateWorkLog
 	} from "@/api/workLog/workLog.js"
 	import uploadMixin from "@/mixin/uploadMixin";
 	import {
-		bizDictionary
+		bizDictionary,
+		update
 	} from '@/api/system/dict.js'
 	import {
 		getLabelListByParentId
@@ -125,6 +128,9 @@
 	import {
 		fetchHousehold
 	} from "@/api/house/household.js"
+	import {
+		getHouseholdDetail
+	} from '@/api/house/household.js'
 	export default {
 		mixins: [uploadMixin],
 		data() {
@@ -133,8 +139,8 @@
 					images: []
 				},
 				info: {
-					name: "",
-					phone: "",
+					// name: "",
+					// phone: "",
 					context: ""
 				},
 				rules: {
@@ -186,7 +192,9 @@
 				houseHoldList: [],
 				selectedHousehold: {},
 				isShowPopup: false,
-				address: ""
+				address: "",
+				isEdit: false,
+				id: ""
 			}
 		},
 		// onLoad() {
@@ -196,13 +204,65 @@
 		// },
 
 
-		onLoad() {
-			this.getTypeList();
-			this.getLabelLit();
+		async onLoad(option) {
+			await this.getTypeList();
+			await this.getLabelLit();
+			if (option.id) {
+				this.isEdit = true;
+				this.id = option.id;
+				this.getDetail(option.id)
+			}
 		},
 
 
 		methods: {
+
+
+			getDetail(id) {
+				getWorkLogDetail({
+					id
+				}).then(res => {
+					console.log(res);
+					if (res.code == 200) {
+						let data = res.data
+						this.typeIndex = this.getTypeValue(data.type).index;
+						this.typeName = this.getTypeValue(data.type).name;
+						this.workTime = Number(new Date(data.workTime))
+						this.info.type = data.type;
+						this.info.workTime = data.workTime;
+						this.info.context = data.context;
+						this.info.householdId = data.householdId;
+						this.info.personType = data.personType;
+						this.labelIndex = this.getLabelValue(data.personType).index;
+						this.labelName = this.getLabelValue(data.personType).name;
+						this.getHouseholdList();
+						this.getHousehold(data.householdId);
+						this.form.images = this.$setImageUrl(data.url, 2);
+					}
+				})
+			},
+
+			getTypeValue(value) {
+				for (let i = 0, ii = this.typeList[0].length; i < ii; i++) {
+					if (value == this.typeList[0][i].dictKey) {
+						return {
+							index: [i],
+							name: this.typeList[0][i].dictValue
+						}
+					}
+				}
+			},
+
+			getLabelValue(value) {
+				for (let i = 0, ii = this.labelList[0].length; i < ii; i++) {
+					if (value == this.labelList[0][i].id) {
+						return {
+							index: [i],
+							name: this.labelList[0][i].name
+						}
+					}
+				}
+			},
 
 			getTypeList() {
 				bizDictionary({
@@ -218,6 +278,16 @@
 					parentId: 100
 				}).then(res => {
 					this.labelList = [res.data];
+				})
+			},
+
+			getHousehold(id) {
+				getHouseholdDetail({
+					id
+				}).then(res => {
+					console.log(res);
+					this.address = res.data.currentAddress;
+					this.selectedHousehold = res.data;
 				})
 			},
 
@@ -302,19 +372,44 @@
 			submitInfo() {
 				this.$refs.form.validate().then(valid => {
 					this.checkImages();
-					addWorkLog(this.info).then(res => {
-						uni.showToast({
-							icon: 'success',
-							title: '提交成功',
-							success() {
-								setTimeout(() => {
-									uni.navigateBack()
-								}, 1000)
-							}
-						})
+					this.info.status = 2;
+					if (this.isEdit) {
+						this.updateWorkLogRequest()
+					} else {
+						this.addWorkLogRequest()
+					}
+
+				})
+			},
+
+			addWorkLogRequest() {
+				addWorkLog(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '提交成功',
+						success() {
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 1000)
+						}
+					})
+				})
+			},
+
+			updateWorkLogRequest() {
+				updateWorkLog(this.info).then(res => {
+					uni.showToast({
+						icon: 'success',
+						title: '提交成功',
+						success() {
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 1000)
+						}
 					})
 				})
 			}
+
 		}
 	}
 </script>

--
Gitblit v1.9.3