From 6211659e247248edf924cae5673914dcd17e2115 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Fri, 23 Feb 2024 17:31:27 +0800
Subject: [PATCH] 取保候审页面样式优化,场所采集、编辑场所调整

---
 subPackage/workbench/views/editCscj.vue         |  374 ++++++++++++++++++++++++++++++++++++++++------
 subPackage/workbench/views/bailReportDetail.vue |   49 +++++-
 subPackage/workbench/views/cscj.vue             |   45 +++--
 3 files changed, 391 insertions(+), 77 deletions(-)

diff --git a/subPackage/workbench/views/bailReportDetail.vue b/subPackage/workbench/views/bailReportDetail.vue
index 3d647cc..78243d4 100644
--- a/subPackage/workbench/views/bailReportDetail.vue
+++ b/subPackage/workbench/views/bailReportDetail.vue
@@ -1,12 +1,24 @@
 <template>
 	<view class="container">
 		<view class="basic">
-			<box-title title="基本信息" class="box-title"></box-title>
-			<view class="info">
+			<!-- <box-title title="基本信息" class="box-title"></box-title> -->
+			<view class="info mt-20 bgc-ff">
 				<lineItem :dataInfo="basicData"></lineItem>
+
+				<view class="licence" v-if="locationImageUrls.length">
+					<!-- <box-title title="位置图片" class="box-title"></box-title> -->
+					<view class="f-30 mb-20">位置图片</view>
+					<view class="flex-wrap">
+						<view v-for="(i,k) in locationImageUrls" :key="k" class="mr-20 mt-20"
+							@click="previewImg(i,locationImageUrls)">
+							<u-image :src="i" width="80" height="80"></u-image>
+						</view>
+					</view>
+				</view>
+
 			</view>
 		</view>
-		<view class="licence" v-if="locationImageUrls.length">
+		<!-- <view class="licence" v-if="locationImageUrls.length">
 			<box-title title="位置图片" class="box-title"></box-title>
 			<view class="flex-wrap">
 				<view v-for="(i,k) in locationImageUrls" :key="k" class="ml-20 mt-20"
@@ -14,10 +26,10 @@
 					<u-image :src="i" width="80" height="80"></u-image>
 				</view>
 			</view>
-		</view>
+		</view> -->
 
 
-		<view class="item mt-30">
+		<view class="item mt-20 bgc-ff">
 			<u-form labelPosition="left" :model="info" ref="form" labelWidth="100" :labelStyle="{fontSize:'28rpx'}">
 				<u-form-item label="审核结果" prop="confirmFlag" borderBottom>
 					<u-input v-model="confirmFlag" disabled disabledColor="#ffffff" border="none" placeholder="请输入"
@@ -41,7 +53,7 @@
 			</u-form>
 		</view>
 
-		<view v-if="status == 2">
+		<view v-if="status == 2" class="section bgc-ff mt-20 mb-20">
 			<u-subsection :list="tabList" :current="tabIndex" button-color="#017BFC" @change="changeTab"></u-subsection>
 			<u-form labelPosition="left" :model="goOutInfo" ref="form" labelWidth="100"
 				:labelStyle="{fontSize:'28rpx'}">
@@ -83,7 +95,7 @@
 				</view>
 			</u-form>
 			<view class="upload bgc-ff">
-				<view class="f-28 mb-20">位置图片</view>
+				<view class="f-30 mb-20">位置图片</view>
 				<view class="mt-20" v-if="tabIndex == 0">
 					<u-upload :fileList="startImageUrls" :previewFullImage="uploadConfig.previewFullImage"
 						:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
@@ -459,6 +471,10 @@
 </script>
 
 <style lang="scss">
+	page {
+		background-color: #f5f5f5;
+	}
+
 	.container {
 		padding: 0 20rpx 130rpx;
 
@@ -505,11 +521,12 @@
 	/deep/ .u-form-item__body__left__content__label,
 	/deep/ .uni-input-placeholder {
 		font-size: 30rpx;
+		color: #000;
 	}
 
 	.upload {
-		margin: 0 30rpx;
-		padding: 30rpx;
+		// margin: 0 30rpx;
+		padding: 20rpx 0 0;
 
 
 	}
@@ -519,4 +536,18 @@
 		height: 140rpx;
 		border: 1px solid #EEEEEE;
 	}
+
+	.section {
+		padding: 20rpx;
+
+	}
+
+	.item,
+	.licence {
+		padding: 0 20rpx;
+	}
+
+	/deep/ .line-item-container .text .r {
+		color: #000 !important;
+	}
 </style>
\ No newline at end of file
diff --git a/subPackage/workbench/views/cscj.vue b/subPackage/workbench/views/cscj.vue
index 02a6912..fe3da89 100644
--- a/subPackage/workbench/views/cscj.vue
+++ b/subPackage/workbench/views/cscj.vue
@@ -789,25 +789,38 @@
 							// } = this.$getIndex(this.nineTypeList, data.nineType, "value", "name");
 							// this.nineTypeIndex = index;
 							// this.nineTypeValue = name;
-							this.$refs.selector.showDefault(data.nineType)
-							setTimeout(() => {
-								if (this.$refs.selector.selectedItem.childrenId) {
-									this.nineTypeValue = this.$refs.selector.selectedItem
-										.childrenName
-								} else {
-									this.nineTypeValue = this.$refs.selector.selectedItem
-										.parentName;
+							if (!data.isNine) {
+								this.form.isNine = 2;
+							} else {
+								if (data.isNine == 1) {
+									this.$refs.selector.showDefault(data.nineType)
+									setTimeout(() => {
+										if (this.$refs.selector.selectedItem.childrenId) {
+											this.nineTypeValue = this.$refs.selector.selectedItem
+												.childrenName
+										} else {
+											this.nineTypeValue = this.$refs.selector.selectedItem
+												.parentName;
+										}
+									}, 200)
 								}
-							}, 200)
+							}
 						}
 
-						if (key == "isFront" && data.isFront != null) {
-							let {
-								index,
-								name
-							} = this.$getIndex(this.frontTypeList, data.frontType, "value", "name");
-							this.frontTypeIndex = index;
-							this.frontTypeValue = name;
+						if (key == "isFront") {
+							if (!data.isFront) {
+								this.form.isFront = 2;
+							} else {
+								if (data.isFront == 1) {
+									let {
+										index,
+										name
+									} = this.$getIndex(this.frontTypeList, data.frontType, "value",
+										"name");
+									this.frontTypeIndex = index;
+									this.frontTypeValue = name;
+								}
+							}
 						}
 					})
 					this.$set(this.form, "jwd", `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`)
diff --git a/subPackage/workbench/views/editCscj.vue b/subPackage/workbench/views/editCscj.vue
index afb89ae..cfe73a0 100644
--- a/subPackage/workbench/views/editCscj.vue
+++ b/subPackage/workbench/views/editCscj.vue
@@ -25,7 +25,52 @@
 						</u-input>
 						<u-icon slot="right" name="arrow-right"></u-icon>
 					</u-form-item>
-
+					<u-form-item label="九小场所:" labelWidth="100" prop="isNine" :required="isRequired">
+						<u-radio-group v-model="form.isNine" v-if="!currentId">
+							<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
+								:key="index" :label="item.name" :name="item.id">
+							</u-radio>
+						</u-radio-group>
+						<view class="f-30" v-if="currentId">
+							{{form.isNine == 1?"是":"否"}}
+						</view>
+					</u-form-item>
+					<u-form-item v-if="form.isNine == 1" @click="showNineTypeSelector" class="form-item"
+						labelWidth="100" label="九小场所类型:" :required="isRequired" :disabled="isDisabled" prop="nineType">
+						<u-input border="none" v-model="nineTypeValue" disabled disabledColor="#ffffff"
+							placeholder="请选择">
+						</u-input>
+						<u-icon slot="right" name="arrow-right"></u-icon>
+					</u-form-item>
+					<u-form-item label="阵地:" labelWidth="100" prop="isFront" :required="isRequired">
+						<u-radio-group v-model="form.isFront" v-if="!currentId">
+							<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
+								:key="index" :label="item.name" :name="item.id">
+							</u-radio>
+						</u-radio-group>
+						<view class="f-30" v-if="currentId">
+							{{form.isFront == 1?"是":"否"}}
+						</view>
+					</u-form-item>
+					<u-form-item v-if="form.isFront == 1" @click="showFrontTypePicker = true" class="form-item"
+						labelWidth="100" label="阵地类型:" :required="isRequired" :disabled="isDisabled" prop="frontType">
+						<u-input border="none" v-model="frontTypeValue" disabled disabledColor="#ffffff"
+							placeholder="请选择">
+						</u-input>
+						<u-icon slot="right" name="arrow-right"></u-icon>
+					</u-form-item>
+					<!-- <view v-if="showLabelList.length" class="label" style="border-bottom:1px solid eff1f3;">
+						<view v-for="(item,index) in showLabelList" :key="index" class="activeLabel">
+							<u-tag :closable="currentId?false:true" :show="!item.isClose" size="mini"
+								@close="delTag(item)" :text="item.text"></u-tag>
+						</view>
+					</view> -->
+					<!-- <view v-if="categoryValue.length" class="label" style="border-bottom:1px solid eff1f3;">
+						<view v-for="(item,index) in categoryValue" :key="index" class="activeLabel">
+							<u-tag :closable="currentId?false:true"  size="mini"
+								@close="delTag()" :text="item.categoryName"></u-tag>
+						</view>
+					</view> -->
 					<u-form-item class="form-item" labelWidth="100" label="备注:" prop="remark">
 						<u--input border="none" v-model="form.remark" placeholder="请输入">
 						</u--input>
@@ -82,16 +127,23 @@
 			</u-form>
 		</view>
 		<footer-btn @click="submit" text="保存" />
-		<u-picker :show="showPicker" :defaultIndex="defaultIndex" ref="uPicker" keyName="name" :loading="pickerLoading"
-			:columns="pickColumns" @change="changeHandler" @confirm="confirmPicker"
-			@cancel="showPicker = false"></u-picker>
 
+		<u-picker :show="showNineTypePicker" :defaultIndex="nineTypeIndex" ref="uPicker" keyName="name"
+			:loading="pickerLoading" :columns="[nineTypeList]" @confirm="confirmNineTypePicker"
+			@cancel="showNineTypePicker = false"></u-picker>
+
+		<!-- <u-picker :show="showPicker" :defaultIndex="defaultIndex" ref="uPicker" keyName="name" :loading="pickerLoading"
+			:columns="pickColumns" @change="changeHandler" @confirm="confirmPicker"
+			@cancel="showPicker = false"></u-picker> -->
+
+		<u-picker :show="showFrontTypePicker" :defaultIndex="frontTypeIndex" ref="uPicker" keyName="name"
+			:loading="pickerLoading" :columns="[frontTypeList]" @confirm="confirmFrontTypePicker"
+			@cancel="showFrontTypePicker = false"></u-picker>
 
 		<u-picker :show="isShowCatePicker" :defaultIndex="categoryIndex" ref="catePicker" keyName="categoryName"
 			:columns="categoryList" @confirm="confirmCategory" @change="changeCategory"
 			@cancel="isShowCatePicker = false"></u-picker>
-
-
+		<cate-selector ref="selector" @comfirm="comfirmNineType" />
 	</view>
 </template>
 
@@ -118,11 +170,19 @@
 	import {
 		minioBaseUrl
 	} from "../../../common/setting";
+	import {
+		bizDictionary,
+		bizDictionaryTree
+	} from '@/api/system/dict.js'
+
+	import cateSelector from "../components/cateSelector.vue"
+
 	export default {
 		mixins: [uploadMixin],
 		components: {
 			lineItem,
-			boxTitle
+			boxTitle,
+			cateSelector
 		},
 		data() {
 			return {
@@ -145,9 +205,14 @@
 					placeName: "",
 					principal: '',
 					principalPhone: '',
+					principalIdCard: '',
 					lat: '',
 					lng: '',
-					location: ''
+					location: '',
+					isNine: "",
+					isFront: "",
+					frontType: "",
+					nineType: ""
 				},
 				rules: {
 					// 'buildingCode': {
@@ -156,6 +221,12 @@
 					// 	message: '请选择楼栋',
 					// 	trigger: ['blur', 'change']
 					// },
+					'form.isNine': {
+						type: 'string',
+						required: true,
+						message: '是否九小场所',
+						trigger: ['blur', 'change']
+					},
 					'form.placeName': {
 						type: 'string',
 						required: true,
@@ -187,7 +258,22 @@
 							trigger: ['change', 'blur']
 
 						}
-
+					],
+					'form.principalIdCard': [{
+							type: 'string',
+							required: false,
+							message: '请输入身份证号码',
+							trigger: ['change', 'blur']
+						},
+						{
+							validator: (rule, value, callback) => {
+								const idCardRegex =
+									/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
+								return idCardRegex.test(value)
+							},
+							message: '身份证号码有误',
+							trigger: ['change', 'blur']
+						}
 					],
 				},
 
@@ -231,16 +317,16 @@
 						// 	name: 'username',
 						// 	value: "未完善",
 						// },
-						{
-							label: "采集人",
-							name: 'createUserName',
-							value: "未完善"
-						},
-						{
-							label: "采集时间",
-							name: 'createTime',
-							value: "未完善"
-						},
+						// {
+						// 	label: "采集人",
+						// 	name: 'createUserName',
+						// 	value: "未完善"
+						// },
+						// {
+						// 	label: "采集时间",
+						// 	name: 'createTime',
+						// 	value: "未完善"
+						// },
 						// {
 						// 	label: "历史事件",
 						// 	value: "未完善",
@@ -317,7 +403,26 @@
 				secondId: "",
 				categoryValue: "",
 				houseCode: "",
-				from: ""
+				statusList: [{
+						name: "是",
+						id: 1
+					},
+					{
+						name: "否",
+						id: 2
+					}
+				],
+				nineTypeList: [], //九小类型
+				frontTypeList: [], //阵地
+				nineTypeIndex: [0],
+				frontTypeIndex: [0],
+				showNineTypePicker: false,
+				showFrontTypePicker: false,
+				nineTypeValue: "",
+				frontTypeValue: "",
+				isView: false
+
+
 			}
 		},
 		created() {
@@ -326,7 +431,12 @@
 		options: {
 			styleIsolation: 'shared', // 解除样式隔离
 		},
-		onLoad(option) {
+		async onLoad(option) {
+			console.log("option===>", option);
+			await this.getCategory();
+			await this.getAllBizDict();
+			// this.getNineTypeList();
+
 			const {
 				type
 			} = option
@@ -343,7 +453,8 @@
 			if (option.id || option.houseCode) {
 				this.getBuildingDetail()
 			}
-			this.getCategory();
+			this.getCurrentLocation();
+			// this.getCategory();
 		},
 
 		watch: {
@@ -365,7 +476,9 @@
 			// }  
 
 		},
-
+		onReady() {
+			this.$refs.form.setRules(this.rules)
+		},
 
 		methods: {
 			// getBuildingDetail(params = {}) {
@@ -412,6 +525,40 @@
 			// 		})
 			// 	})
 			// },
+
+
+			async getAllBizDict() {
+				// 获取九小场所类型
+				// await this.getBizDict('nineType', this.nineTypeList)
+				// 获取阵地
+				await this.getBizDict('frontType', this.frontTypeList)
+			},
+
+			// 获取业务字典
+			async getBizDict(code, list) {
+				const param = {
+					code: code
+				}
+				const res = await bizDictionary(param)
+				res.data.forEach(e => {
+					list.push({
+						name: e.dictValue,
+						value: Number(e.dictKey)
+					})
+				})
+			},
+
+			getNineTypeList() {
+				bizDictionaryTree({
+					code: "nineType"
+				}).then(res => {
+					console.log(res.data);
+				})
+			},
+
+			showNineTypeSelector() {
+				this.$refs.selector.open();
+			},
 
 			navTo(type) {
 				if (type == 1) {
@@ -502,6 +649,9 @@
 						id: this.currentId
 					}
 				}
+				uni.showLoading({
+					title: "加载中..."
+				})
 				getPlaceDetail({
 					...params,
 					...idorCodeParams
@@ -509,6 +659,7 @@
 					code,
 					data
 				}) => {
+					uni.hideLoading();
 					if (code !== 200) {
 						uni.showToast({
 							title: "数据加载失败",
@@ -548,8 +699,49 @@
 								this.form.images = []
 							}
 						}
+
+						if (key == "isNine") {
+							// let {
+							// 	index,
+							// 	name
+							// } = this.$getIndex(this.nineTypeList, data.nineType, "value", "name");
+							// this.nineTypeIndex = index;
+							// this.nineTypeValue = name;
+							if (!data.isNine) {
+								this.form.isNine = 2;
+							} else {
+								if (data.isNine == 1) {
+									this.$refs.selector.showDefault(data.nineType)
+									setTimeout(() => {
+										if (this.$refs.selector.selectedItem.childrenId) {
+											this.nineTypeValue = this.$refs.selector.selectedItem
+												.childrenName
+										} else {
+											this.nineTypeValue = this.$refs.selector.selectedItem
+												.parentName;
+										}
+									}, 200)
+								}
+							}
+						}
+
+						if (key == "isFront") {
+							if (!data.isFront) {
+								this.form.isFront = 2;
+							} else {
+								if (data.isFront == 1) {
+									let {
+										index,
+										name
+									} = this.$getIndex(this.frontTypeList, data.frontType, "value",
+										"name");
+									this.frontTypeIndex = index;
+									this.frontTypeValue = name;
+								}
+							}
+						}
 					})
-					this.form.jwd = `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`
+					this.$set(this.form, "jwd", `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`)
 					this.form.building = arr.join("")
 					let labelList = data.placePoiLabelVOList;
 					let tempLabelList = [];
@@ -561,13 +753,14 @@
 					this.firstId = tempLabelList[0].poiCode;
 					this.categoryValue = tempLabelList[1].labelName;
 					this.form.label = tempLabelList[1].poiCode
-					setTimeout(() => {
-						let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo ==
-							tempLabelList[0].poiCode)
-						let childIndex = this.categoryList[1].findIndex(i => i.categoryNo ==
-							tempLabelList[1].poiCode)
-						this.categoryIndex = [firstIndex, childIndex]
-					}, 500)
+					// setTimeout(() => {
+					let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo ==
+						tempLabelList[0].poiCode)
+					let childIndex = this.categoryList[1].findIndex(i => i.categoryNo ==
+						tempLabelList[1].poiCode)
+					this.categoryIndex = [firstIndex, childIndex]
+					// }, 500)
+
 
 					Object.keys(this.comprehensiveData).forEach(key => {
 						this.comprehensiveData[key].forEach(item => {
@@ -594,32 +787,67 @@
 				})
 			},
 
+			//选择九小场所类型
+			comfirmNineType(val) {
+				if (val.childrenId) {
+					this.form.nineType = val.childrenId;
+					this.nineTypeValue = val.childrenName;
+				} else {
+					this.form.nineType = val.parentId;
+					this.nineTypeValue = val.parentName;
+				}
+			},
+
 			//表单提交
 			submit() {
-				const that = this
-				this.$refs.form.validate().then(valid => {
-					if (valid) {
-						if (this.form?.images?.length > 0) {
-							let urls = []
-							this.form.images.forEach(e => {
-								urls.push(e.name)
-							})
-							this.form.imageUrls = urls.join(",")
-						}
+				if (!this.form.placeName) {
+					this.$showTips("请输入场所名称")
+					return
+				}
 
-						this.form.roleName = uni.getStorageSync("activeRole").roleName;
-						add(this.form).then(res => {
-							uni.showToast({
-								icon: 'success',
-								title: '保存成功'
-							})
-							setTimeout(() => {
-								uni.navigateBack()
-							}, 300)
-						})
-					}
+				if (!this.form.label) {
+					this.$showTips("请选择标签")
+					return
+				}
+				// this.$refs.form.validate().then(valid => {
+				// 	if (valid) {
+				if (this.form?.images?.length > 0) {
+					let urls = []
+					this.form.images.forEach(e => {
+						urls.push(e.name)
+					})
+					this.form.imageUrls = urls.join(",")
+				}
+
+				this.form.roleName = uni.getStorageSync("activeRole").roleName;
+				if (this.form.isNine == 2 && this.form.nineType) {
+					this.form.nineType = "";
+				}
+				if (this.form.isFront == 2 && this.form.frontType) {
+					this.form.frontType = "";
+				}
+
+				if (this.form.isNine == 1 && !this.form.nineType) {
+					this.$showTips("请选择九小场所类型")
+					return
+				}
+
+				if (this.form.isFront == 1 && !this.form.frontType) {
+					this.$showTips("请选择阵地类型")
+					return
+				}
+
+				delete this.form.images;
+
+				add(this.form).then(res => {
+					this.$showTips("提交成功", "success");
+					setTimeout(() => {
+						uni.navigateBack()
+					}, 300)
+
 				})
 			},
+
 
 			async buildColumn() {
 				//设置街道
@@ -641,6 +869,34 @@
 
 			setColumn(data, index) {
 				this.$set(this.pickColumns, index, data)
+			},
+
+			//获取当前位置信息
+			getCurrentLocation() {
+				uni.getLocation({
+					type: 'gcj02', // 坐标系类型
+					success: (res) => {
+						// var latitude = res.latitude; // 维度
+						// var longitude = res.longitude; // 经度
+
+						// this.form.lng = longitude
+						// this.form.lat = latitude
+						// this.form.jwd =
+						// 	`${Number(res.longitude).toFixed(6)},${Number(res.latitude).toFixed(6)}`
+					},
+					complete: (res) => {
+						if (res.latitude) {
+							this.$set(this.form, "x", res.longitude)
+							this.$set(this.form, "y", res.latitude)
+						} else {
+							uni.showModal({
+								title: "提示!",
+								content: `获取定位信息失败 ${res.errMsg}`,
+								showCancel: false
+							})
+						}
+					}
+				});
 			},
 
 			getLocation() {
@@ -674,6 +930,20 @@
 				this.showPicker = false
 			},
 
+			confirmNineTypePicker(e) {
+				this.nineTypeIndex = e.indexs;
+				this.nineTypeValue = e.value[0].name;
+				this.form.nineType = e.value[0].value;
+				this.showNineTypePicker = false;
+			},
+
+			confirmFrontTypePicker(e) {
+				this.frontTypeIndex = e.indexs;
+				this.frontTypeValue = e.value[0].name;
+				this.form.frontType = e.value[0].value;
+				this.showFrontTypePicker = false;
+			},
+
 			async changeHandler(e) {
 				const {
 					columnIndex,

--
Gitblit v1.9.3