From 197f13dbcf007eac8dd9a307aae992df677ea8f6 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Fri, 10 Nov 2023 17:21:15 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app

---
 subPackage/workbench/views/examine.vue |  156 ++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 108 insertions(+), 48 deletions(-)

diff --git a/subPackage/workbench/views/examine.vue b/subPackage/workbench/views/examine.vue
index 046416f..9a89743 100644
--- a/subPackage/workbench/views/examine.vue
+++ b/subPackage/workbench/views/examine.vue
@@ -9,21 +9,40 @@
 		<view class="licence">
 			<box-title title="营业执照" class="box-title"></box-title>
 			<view class="info">
-				<view class="images-box"></view>
+				<view class="images-box">
+					<u-image v-if="imageObj.imageUrls" width="80" height="80" :src="imageObj.imageUrls"
+						@click="preViewImg(imageObj.imageUrls)"></u-image>
+				</view>
 			</view>
 		</view>
 		<view class="planegraph">
 			<box-title title="场所平面图" class="box-title"></box-title>
 			<view class="info">
-				<view class="images-box"></view>
+				<view class="images-box">
+					<u-image v-if="imageObj.planImageUrl" width="80" height="80" :src="imageObj.planImageUrls"
+						@click="preViewImg(imageObj.planImageUrl)"></u-image>
+				</view>
 			</view>
 		</view>
 		<view class="personnel">
 			<box-title title="从业人员" class="box-title"></box-title>
 			<view class="info">
-				<view class="person-box" v-for="(item, index) in personnelData" :key="index">
+				<view class="person-box" v-for="(item, index) in placePersonList" :key="item.id">
 					<view class="title">人员信息-#{{ index + 1 }}</view>
-					<line-item :data-info="item"></line-item>
+					<view class="info-box">
+						<view class="content">
+							<text>姓名</text>
+							<text>{{ item.name || '未完善' }}</text>
+						</view>
+						<view class="content">
+							<text>电话号码</text>
+							<text>{{ item.telephone || '未完善' }}</text>
+						</view>
+						<view class="content">
+							<text>暂住地</text>
+							<text>{{ item.tempAddress || '未完善' }}</text>
+						</view>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -33,7 +52,7 @@
 				<u-form labelWidth="70" :model="form" ref="form" class="form">
 					<u-form-item label="审核状态" @click="isPickerShow = true" class="form-item">
 						<u--input v-model="form.confirmFlag" disabled disabledColor="#ffffff" placeholder="请选择审核状态"
-							border="none"></u--input>
+							border="none" :placeholder="this.defaultPlaceholder"></u--input>
 						<u-icon slot="right" name="arrow-right"></u-icon>
 					</u-form-item>
 					<u-form-item label="备注" class="form-item">
@@ -45,7 +64,7 @@
 		<view class="bottom-btn">
 			<u-button type="primary" @click="submit">提交审核</u-button>
 		</view>
-		<u-picker :closeOnClickOverlay="true" @close="isPickerShow = false" :show="isPickerShow" ref="uPicker"
+		<u-picker :defaultIndex="[this.defaultColumns]" :closeOnClickOverlay="true" @close="isPickerShow = false" :show="isPickerShow" ref="uPicker"
 			:columns="columns" keyName="name" @cancel="isPickerShow = false" @confirm="handleConfirm"></u-picker>
 	</view>
 </template>
@@ -54,7 +73,8 @@
 	import boxTitle from '@/components/boxTitle/index.vue'
 	import lineItem from '../components/lineItem.vue'
 	import {
-		checkPlaceExtData
+		checkPlaceExtData,
+		getPlaceDetail
 	} from '@/api/placeExp/placeExp.js'
 	export default {
 		components: {
@@ -64,44 +84,34 @@
 		data() {
 			return {
 				basicData: [{
-						label: '场所名称',
+						label: '场所名称',
 						name: "placeName",
 						value: '未完善'
 					},
 					{
-						label: '法人信息',
+						label: '法人信息',
 						name: 'legalPerson',
 						value: '未完善'
 					},
 					{
-						label: '法人电话',
+						label: '法人电话',
 						name: 'legalTel',
 						value: '未完善'
 					},
 					{
-						label: '场所位置',
+						label: '场所位置',
 						name: 'localtion',
 						value: '未完善'
 					},
 				],
-				personnelData: [
-					[{
-							label: '姓名',
-							value: '未完善',
-						},
-						{
-							label: '电话号码',
-							value: '未完善',
-						},
-						{
-							label: '暂住地',
-							value: '未完善',
-						}
-					]
-				],
+				placePersonList: [],
 				form: {
-					confirmFlag: '待审核',
+					confirmFlag: '',
 					confirmNotion: ''
+				},
+				imageObj: {
+					imageUrls: '',
+					planImageUrls: ''
 				},
 				isPickerShow: false,
 				columns: [
@@ -119,26 +129,53 @@
 						},
 					]
 				],
-				currentId: '',
-				currentData: {}
+				currentData: {
+					placeId: '',
+					id: ''
+				},
+				defaultColumns: 0,
+				defaultPlaceholder: ''
 			}
 		},
 		onLoad(option) {
-			// const {
-			// 	id
-			// } = option
-			// this.currentId = id
-			const { siteData } = option
-			this.currentData = JSON.parse(siteData)
+			const {
+				placeId,
+				id
+			} = option
+			this.currentData = {
+				placeId,
+				id
+			}
 		},
 		onShow() {
 			this.setDefaultValue()
 		},
-		methods: {
-			setDefaultValue() {
-				this.basicData.forEach(item => {
-					item.value = this.currentData[item.name]
+		methods: {
+			async setDefaultValue() {
+				const {
+					code,
+					data
+				} = await getPlaceDetail({
+					placeId: this.currentData.placeId
+				})
+				if (code !== 200) {
+					uni.showToast({
+						title: '数据请求失败',
+						icon: "error"
+					})
+					return
+				}
+				Object.keys(this.imageObj).forEach(key => {
+					this.imageObj[key] = data[key]
+				})
+				this.basicData.forEach(item => {
+					item.value = data[item.name] || '未完善'
 				})
+				console.log(data);
+				let columns = this.columns[0]
+				this.defaultColumns = columns.findIndex(item => item.status == data.confirmFlag)
+				this.defaultPlaceholder = columns[this.defaultColumns].name
+				this.placePersonList = data.placePractitioner
 			},
 			async checkPlaceExt(data) {
 				const res = await checkPlaceExtData(data)
@@ -149,11 +186,25 @@
 					})
 					return
 				}
-				uni.navigateBack()
+				uni.showToast({
+					title: '审核成功',
+					icon: 'success',
+					duration: 1500,
+					complete() {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 1500)
+					}
+				})
 			},
 			handleConfirm(e) {
 				this.form.confirmFlag = e.value[0].name
 				this.isPickerShow = false
+			},
+			preViewImg(url) {
+				uni.previewImage({
+					urls: [url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
+				})
 			},
 			submit() {
 				const {
@@ -168,12 +219,12 @@
 					confirmNotion
 				})
 				this.checkPlaceExt(data)
-			},
-			findObjValue(value, obj) {
-				const res = obj.find(item => {
-					return item.name == value
-				})
-				return res
+			},
+			findObjValue(value, obj) {
+				const res = obj.find(item => {
+					return item.name == value
+				})
+				return res
 			},
 		}
 	}
@@ -192,8 +243,6 @@
 		}
 
 		.info {
-
-
 			.title {
 				font-size: 30rpx;
 				padding-left: 10rpx;
@@ -204,6 +253,17 @@
 				min-height: 100rpx;
 				background-color: #fff;
 			}
+
+			.info-box {
+				.content {
+					font-size: 30rpx;
+					border-bottom: 1rpx solid #f6f6f6;
+					display: flex;
+					justify-content: space-between;
+					background-color: #fff;
+					padding: 20rpx;
+				}
+			}
 		}
 
 		.form {

--
Gitblit v1.9.3