Browse Source

Merge branch '2025北京诚祥App' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025北京诚祥App

tanxue 3 days ago
parent
commit
a8174c14bd

+ 2 - 0
api/hetong.js

@@ -46,3 +46,5 @@ export function getHetongInfo(data = {}) {
 }
 }
 
 
 
 
+
+

+ 11 - 0
api/sanfang.js

@@ -127,3 +127,14 @@ export function getSanfangShengxiao(data = {}) {
 }
 }
 
 
 
 
+export function getHetongSanfangMoban(data = {}) {
+  return request({
+    url: '/app/guanliyuan/sanfang/moban/preview',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 60 - 33
pages/admin/Hetong/addSanfangHetong.vue

@@ -8,7 +8,8 @@
 		<view class="sfht-form-box">
 		<view class="sfht-form-box">
 			<!-- 合同模板 -->
 			<!-- 合同模板 -->
 			<view class="form-label-select form-radius-box">
 			<view class="form-label-select form-radius-box">
-				<view class="phone-form-label"><text class="form-label-require"></text>合同模板</view>
+				<view class="phone-form-label"><text class="form-label-require"></text>合同模板 
+				<i @click="handlePreviewPdf">预览</i></view>
 				<picker :range="data.mobanList" mode='selector' :value="data.mobanIndex" range-key="name"
 				<picker :range="data.mobanList" mode='selector' :value="data.mobanIndex" range-key="name"
 					@change="onMobanSelect" class="select-picker-box">
 					@change="onMobanSelect" class="select-picker-box">
 					<view class="form-radio-select">
 					<view class="form-radio-select">
@@ -44,6 +45,9 @@
 			<button type="default" class="phone-green-btn" @click="handleUpdate"
 			<button type="default" class="phone-green-btn" @click="handleUpdate"
 				v-if="data.type == 'editorHetong'">更新合同</button>
 				v-if="data.type == 'editorHetong'">更新合同</button>
 		</view>
 		</view>
+
+
+		<pdfPreviewVue ref="pdfRef"></pdfPreviewVue>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -64,6 +68,8 @@
 	import qianMingVue from "./components/qianMing.vue";
 	import qianMingVue from "./components/qianMing.vue";
 	import qiTaYueDingVue from "./components/qiTaYueDing.vue";
 	import qiTaYueDingVue from "./components/qiTaYueDing.vue";
 	import commonDialog from '@/components/dialog/commonDialog.vue';
 	import commonDialog from '@/components/dialog/commonDialog.vue';
+	import pdfPreviewVue from "./components/pdfPreview.vue";
+	import {toast} from "@/utils/common.js"
 
 
 	import {
 	import {
 		useHetong
 		useHetong
@@ -117,14 +123,14 @@
 			xinyongdaima: '', // 统一社会信用代码
 			xinyongdaima: '', // 统一社会信用代码
 			xiuxi: '', // 休息天数
 			xiuxi: '', // 休息天数
 			khUserName: '', // 客户电话
 			khUserName: '', // 客户电话
-      shentiqingkuang: 0, // 身体状态,1 能自理 ,2半自理, 3不能自理
+			shentiqingkuang: 0, // 身体状态,1 能自理 ,2半自理, 3不能自理
 			beizhu: '', // 备注
 			beizhu: '', // 备注
 			qianmingBase64: '',
 			qianmingBase64: '',
 			id: null,
 			id: null,
-      jutidizhi: '',
+			jutidizhi: '',
 		},
 		},
 		type: null,
 		type: null,
-    timer: null
+		timer: null
 	})
 	})
 
 
 	const commonDialogRef = ref(null)
 	const commonDialogRef = ref(null)
@@ -133,6 +139,7 @@
 	provideHetong(data)
 	provideHetong(data)
 
 
 	const jzRef = ref(null)
 	const jzRef = ref(null)
+	const pdfRef = ref(null)
 
 
 	function handleSelct(code) {
 	function handleSelct(code) {
 		if (code == 'kh') {
 		if (code == 'kh') {
@@ -142,6 +149,18 @@
 		}
 		}
 	}
 	}
 
 
+	function handlePreviewPdf() {
+		const id = data.mobanList[data.mobanIndex] && data.mobanList[data.mobanIndex].id;
+		
+		if (id) {
+			httpApi.getHetongSanfangMoban({id: id}).then(res => {
+				 pdfRef.value.showPDF(res.data.base64List)
+			}).finally(() => {
+				
+			})
+		}
+	}
+
 	function goUpPage() {
 	function goUpPage() {
 		uni.navigateBack()
 		uni.navigateBack()
 	}
 	}
@@ -163,63 +182,71 @@
 	}
 	}
 
 
 	function handleAdd() {
 	function handleAdd() {
-    uni.showLoading({
-      title: '创建中...',
-      mask: true
-    });
+		if (!data.hetong.jiabingStartDate || data.hetong.jiabingEndDate || data.hetong.qianmingBase64) {
+			toast('请确认合同必填项是否完整')
+			return;
+		}
+
+		uni.showLoading({
+			title: '创建中...',
+			mask: true
+		});
 		const opt = Object.assign({}, {
 		const opt = Object.assign({}, {
 			...data.hetong,
 			...data.hetong,
 			htId: data.mobanList[data.mobanIndex].id
 			htId: data.mobanList[data.mobanIndex].id
 		})
 		})
 		httpApi.getSanfangAdd(opt).then(res => {
 		httpApi.getSanfangAdd(opt).then(res => {
 			if (res.data) {
 			if (res.data) {
-        uni.hideLoading()
+				uni.hideLoading()
 				uni.showToast({
 				uni.showToast({
 					title: "创建成功",
 					title: "创建成功",
-          duration:2000,
+					duration: 2000,
 					success() {
 					success() {
-            setTimeout(() => {
-              uni.navigateBack()
-            },2000)
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 2000)
 					}
 					}
 				})
 				})
 			}
 			}
 		}).catch(() => {
 		}).catch(() => {
-      uni.hideLoading()
-    }).
-    finally(() => {
-      clearTimeout(data.timer);
-      data.timer = null;
-    })
+			uni.hideLoading()
+		}).
+		finally(() => {
+			clearTimeout(data.timer);
+			data.timer = null;
+		})
 	}
 	}
 
 
 	function handleUpdate() {
 	function handleUpdate() {
-
-    uni.showLoading({
-      title: '更新中...',
-      mask: true
-    });
+		if (!data.hetong.jiabingStartDate || data.hetong.jiabingEndDate || data.hetong.qianmingBase64) {
+			toast('请确认合同必填项是否完整')
+			return;
+		}
+		uni.showLoading({
+			title: '更新中...',
+			mask: true
+		});
 		const opt = Object.assign({}, {
 		const opt = Object.assign({}, {
 			...data.hetong,
 			...data.hetong,
 			htId: data.mobanList[data.mobanIndex].id
 			htId: data.mobanList[data.mobanIndex].id
 		})
 		})
 		httpApi.getSanfangUpdate(opt).then(res => {
 		httpApi.getSanfangUpdate(opt).then(res => {
 			if (res.data) {
 			if (res.data) {
-        uni.hideLoading()
+				uni.hideLoading()
 				uni.showToast({
 				uni.showToast({
 					title: "更新成功",
 					title: "更新成功",
-          duration:2000,
-          mask: true,
+					duration: 2000,
+					mask: true,
 					success() {
 					success() {
-            setTimeout(() => {
-              uni.navigateBack()
-            },2000)
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 2000)
 					}
 					}
 				})
 				})
 			}
 			}
 		}).catch(() => {
 		}).catch(() => {
-      uni.hideLoading()
-    })
+			uni.hideLoading()
+		})
 	}
 	}
 
 
 	function handleConfirm() {
 	function handleConfirm() {
@@ -242,7 +269,7 @@
 					id
 					id
 				}).then(res => {
 				}).then(res => {
 					Object.assign(data.hetong, res.data)
 					Object.assign(data.hetong, res.data)
-					
+
 					console.log('ccccc', res.data)
 					console.log('ccccc', res.data)
 				})
 				})
 			})
 			})

+ 73 - 2
pages/admin/Hetong/components/addKh.vue

@@ -35,15 +35,21 @@
     	<button type="default" class="phone-green-btn info-btn" @click="saveBtn">保存</button>
     	<button type="default" class="phone-green-btn info-btn" @click="saveBtn">保存</button>
     </view>
     </view>
   </uni-popup>
   </uni-popup>
+  
+  <commonDialogVue ref="comRef" :content="content" @confirm-btn="htAdd2"></commonDialogVue>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
 import {ref,reactive,nextTick} from "vue";
 import {ref,reactive,nextTick} from "vue";
 import {onLoad} from "@dcloudio/uni-app";
 import {onLoad} from "@dcloudio/uni-app";
-import * as khApi from "@/api/kehu.js"
+import * as khApi from "@/api/kehu.js";
+import commonDialogVue from "@/components/dialog/commonDialog.vue";
 
 
 const emits = defineEmits('success')
 const emits = defineEmits('success')
 
 
+const comRef = ref(null);
+const content = ref('');
+
 const formData = reactive({
 const formData = reactive({
 	realName: '',
 	realName: '',
 	userName: '',
 	userName: '',
@@ -53,6 +59,13 @@ const formData = reactive({
 
 
 function goback2() {
 function goback2() {
   popupRef.value.close();
   popupRef.value.close();
+  
+  formData.realName = '';
+  formData.userName = '';
+  formData.idcard = '';
+  formData.idtype = '1';
+  content.value = null;
+  
 }
 }
 
 
 const popupRef = ref(null)
 const popupRef = ref(null)
@@ -97,14 +110,72 @@ function htAdd(){
 		userName: formData.userName,
 		userName: formData.userName,
 		idtype: formData.idtype,
 		idtype: formData.idtype,
 		idcard: formData.idcard,
 		idcard: formData.idcard,
+		checked: 0
 	}
 	}
 	khApi.getKehuAdd(opt).then(res => {
 	khApi.getKehuAdd(opt).then(res => {
-		if (res.data) {
+		if (res.data.result) {
 			uni.showToast({
 			uni.showToast({
 				title: '新增成功'
 				title: '新增成功'
 			})
 			})
 			goback2();
 			goback2();
 			emits('success')
 			emits('success')
+			nextTick(() => {
+				formData.realName = '';
+				formData.userName = '';
+				formData.idcard = '';
+				formData.idtype = '1';
+				content.value = null;
+			})
+		} else {
+			// 有重复数据
+			content.value = res.data.message;
+			comRef.value.handleShow();
+		}
+	}).finally(()=>{
+		uni.hideLoading()
+	})
+}
+
+function htAdd2(){
+	let arr = [];
+	if (!formData.realName) {
+		arr.push('姓名');
+	}
+	if (!formData.userName) {
+		arr.push('电话');
+	}
+	if (!formData.realName || !formData.userName) {
+		uni.showToast({
+			icon: 'none',
+			title: `请完善${arr.join('、')}信息!`
+		})
+		return;
+	}
+	uni.showLoading({
+	      title: '新增中...',
+	      mask: true
+	    });
+	const opt = {
+		realName: formData.realName,
+		userName: formData.userName,
+		idtype: formData.idtype,
+		idcard: formData.idcard,
+		checked: 1
+	}
+	khApi.getKehuAdd(opt).then(res => {
+		if (res.data.result) {
+			uni.showToast({
+				title: '新增成功'
+			})
+			goback2();
+			emits('success')
+			nextTick(() => {
+				formData.realName = '';
+				formData.userName = '';
+				formData.idcard = '';
+				formData.idtype = '1';
+				content.value = null;
+			})
 		}
 		}
 	}).finally(()=>{
 	}).finally(()=>{
 		uni.hideLoading()
 		uni.hideLoading()

+ 2 - 2
pages/admin/Hetong/components/fuWuShiJian.vue

@@ -2,7 +2,7 @@
 	<uni-collapse class="fwnr-collapse-box collapse-border-box" @change="handleChange">
 	<uni-collapse class="fwnr-collapse-box collapse-border-box" @change="handleChange">
 		<uni-collapse-item title="服务时间" :open="true">
 		<uni-collapse-item title="服务时间" :open="true">
 			<view class="form-label-select">
 			<view class="form-label-select">
-				<view class="phone-form-label"><text class="form-label-require"></text>三方合同服务期限(开始)</view>
+				<view class="phone-form-label"><text class="form-label-require"><text class="form-label-require">*</text></text>三方合同服务期限(开始)</view>
 				<picker mode='date' :value="data.hetong.jiabingStartDate" @change="onDateStartSelect"
 				<picker mode='date' :value="data.hetong.jiabingStartDate" @change="onDateStartSelect"
 					class="form-radio-select">
 					class="form-radio-select">
 					<view class="data-select-box">
 					<view class="data-select-box">
@@ -12,7 +12,7 @@
 				</picker>
 				</picker>
 			</view>
 			</view>
 			<view class="form-label-select">
 			<view class="form-label-select">
-				<view class="phone-form-label"><text class="form-label-require"></text>三方合同服务期限(结束)</view>
+				<view class="phone-form-label"><text class="form-label-require"><text class="form-label-require">*</text></text>三方合同服务期限(结束)</view>
 				<picker mode='date' :value="data.hetong.jiabingEndDate" @change="onDateEndSelect"
 				<picker mode='date' :value="data.hetong.jiabingEndDate" @change="onDateEndSelect"
 					class="form-radio-select">
 					class="form-radio-select">
 					<view class="data-select-box">
 					<view class="data-select-box">

+ 61 - 0
pages/admin/Hetong/components/pdfPreview.vue

@@ -0,0 +1,61 @@
+<template>
+	<view>
+		<uni-popup ref="popupRef" background-color="#fff" :animation="true" :is-mask-click="false" :mask-click="false">
+			<view class="icon-title-navBar-box">
+				<view @click="goUpPage" class="nav-bar-icon"></view>
+				<text class="nav-bar-title">合同预览</text>
+			</view>
+			<view class="pdf-box" style="height: calc(100vh - 60px);overflow-y: auto;">
+				<img v-for="item in imgList" mode="aspectFit" style="height: auto;width: 100%" :src="`data:image/png;base64,${item}`"
+					@click="previewBase64Image(`data:image/png;base64,${item}`)" class="pdf-img" />
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script setup>
+	import {
+		base64ToPath
+	} from "image-tools";
+	import {
+		ref
+	} from "vue";
+	const imgList = ref([])
+	const popupRef = ref(null);
+
+	function showPDF(list) {
+		popupRef.value.open('bottom');
+		imgList.value = list;
+	}
+
+	function goUpPage() {
+		popupRef.value.close()
+	}
+
+	async function previewBase64Image(base64Data) {
+		try {
+			// 关键步骤:将 Base64 字符串转换为本地临时路径
+			// 此处以使用 image-tools 的 base64ToPath 为例
+			const localPath = await base64ToPath(base64Data);
+			// 调用 UniApp 的图片预览 API
+			uni.previewImage({
+				urls: [localPath], // 注意:urls 参数需要是数组,即使只预览一张图
+				current: 0, // 当前显示图片在 urls 数组中的索引
+			});
+		} catch (error) {
+			// 如果出现错误(如转换失败),隐藏加载提示并告知用户
+			console.error('预览失败:', error);
+			uni.showToast({
+				title: '预览失败',
+				icon: 'none'
+			});
+		}
+	}
+
+	defineExpose({
+		showPDF
+	})
+</script>
+
+<style>
+</style>

+ 3 - 1
pages/admin/Hetong/components/qianMing.vue

@@ -3,7 +3,9 @@
 		<!-- 合同模板 -->
 		<!-- 合同模板 -->
 		<view class="sfht-mt24">
 		<view class="sfht-mt24">
 			<view class="form-label-select form-radius-box">
 			<view class="form-label-select form-radius-box">
-				<view class="phone-form-label"><text class="form-label-require"></text>签名</view>
+				<view class="phone-form-label"><text class="form-label-require">
+				<text class="form-label-require">*</text>
+				</text>签名</view>
 				<view class="form-radio-select" @click="handleQianming">
 				<view class="form-radio-select" @click="handleQianming">
 					<view>{{!!data.hetong.qianmingBase64? '已签名': ''}}</view>
 					<view>{{!!data.hetong.qianmingBase64? '已签名': ''}}</view>
 					<icon></icon>
 					<icon></icon>

+ 229 - 126
pages/admin/kehu/kehuInfo.vue

@@ -7,14 +7,12 @@
 		<view>
 		<view>
 			<view class="form-label-input">
 			<view class="form-label-input">
 				<view class="phone-form-label"><text class="form-label-require">*</text>姓名</view>
 				<view class="phone-form-label"><text class="form-label-require">*</text>姓名</view>
-				<uni-easyinput v-model="formData.realName"
-					placeholder="请输入姓名" />
+				<uni-easyinput v-model="formData.realName" placeholder="请输入姓名" />
 			</view>
 			</view>
-			
+
 			<view class="form-label-input">
 			<view class="form-label-input">
 				<view class="phone-form-label"><text class="form-label-require">*</text>手机号</view>
 				<view class="phone-form-label"><text class="form-label-require">*</text>手机号</view>
-				<uni-easyinput type="number" v-model="formData.userName"
-					placeholder="请输入手机号" maxlength="11" />
+				<uni-easyinput type="number" v-model="formData.userName" placeholder="请输入手机号" maxlength="11" />
 			</view>
 			</view>
 			<view class="form-label-input">
 			<view class="form-label-input">
 				<view class="phone-form-label">
 				<view class="phone-form-label">
@@ -32,149 +30,254 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<button type="default" class="phone-green-btn info-btn" @click="saveBtn">保存</button>
 		<button type="default" class="phone-green-btn info-btn" @click="saveBtn">保存</button>
+
+		<commonDialogVue ref="comRefAdd" :content="contentAdd" @confirm-btn="htAdd2"></commonDialogVue>
+		<commonDialogVue ref="comRefEditor" :content="contentEditor" @confirm-btn="htAdd2"></commonDialogVue>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import {ref,reactive} from "vue";
-import {onLoad} from "@dcloudio/uni-app";
-import * as khApi from "@/api/kehu.js"
-const formData = reactive({
-	realName: '',
-	userName: '',
-	idcard: '',
-	idtype: '1',
-	
-jutidizhi: '',
-	pageFlag:'add',
-	id:null,
-	userId:null,
-})
-
-// 返回
-function goUpPage() {
-	uni.redirectTo({
-		url: '/pages/admin/kehu/kehuList'
+	import {
+		ref,
+		reactive
+	} from "vue";
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
+	import * as khApi from "@/api/kehu.js"
+	const formData = reactive({
+		realName: '',
+		userName: '',
+		idcard: '',
+		idtype: '1',
+
+		jutidizhi: '',
+		pageFlag: 'add',
+		id: null,
+		userId: null,
 	})
 	})
-}
-function idCardChange(data) {
-	formData.idtype = formData.idtype == 1 ? 2 : 1;
-}
-
-// 保存
-function saveBtn(){
-	if(formData.pageFlag==='editor'){
-		htEditor();
-	}else{
-		htAdd();
+
+	const contentAdd = ref('');
+	const contentEditor = ref('');
+
+	const comRefAdd = ref(null);
+	const comRefEditor = ref(null)
+
+	// 返回
+	function goUpPage() {
+		uni.redirectTo({
+			url: '/pages/admin/kehu/kehuList'
+		})
 	}
 	}
-}
-
-// 新增
-function htAdd(){
-	
-	let arr = [];
-	if (!formData.realName) {
-		arr.push('姓名');
+
+	function idCardChange(data) {
+		formData.idtype = formData.idtype == 1 ? 2 : 1;
 	}
 	}
-	if (!formData.userName) {
-		arr.push('电话');
+
+	// 保存
+	function saveBtn() {
+		if (formData.pageFlag === 'editor') {
+			htEditor();
+		} else {
+			htAdd();
+		}
 	}
 	}
-	if (!formData.realName || !formData.userName) {
-		uni.showToast({
-			icon: 'none',
-			title: `请完善${arr.join('、')}信息!`
+
+	// 新增
+	function htAdd() {
+
+		let arr = [];
+		if (!formData.realName) {
+			arr.push('姓名');
+		}
+		if (!formData.userName) {
+			arr.push('电话');
+		}
+		if (!formData.realName || !formData.userName) {
+			uni.showToast({
+				icon: 'none',
+				title: `请完善${arr.join('、')}信息!`
+			})
+			return;
+		}
+
+		uni.showLoading({
+			title: '新增中...',
+			mask: true
+		});
+		const opt = {
+			realName: formData.realName,
+			userName: formData.userName,
+			idtype: formData.idtype,
+			idcard: formData.idcard,
+			jutidizhi: formData.jutidizhi,
+			checked: 0
+		}
+		khApi.getKehuAdd(opt).then(res => {
+			if (res.data.result) {
+				uni.showToast({
+					title: '新增成功'
+				})
+				goUpPage();
+			} else {
+				contentAdd.value = res.data.message;
+				comRefAdd.value.handleShow();
+			}
+		}).finally(() => {
+			uni.hideLoading()
 		})
 		})
-		return;
 	}
 	}
-	
-	uni.showLoading({
-	      title: '新增中...',
-	      mask: true
-	    });
-	const opt = {
-		realName: formData.realName,
-		userName: formData.userName,
-		idtype: formData.idtype,
-		idcard: formData.idcard,
-		jutidizhi: formData.jutidizhi,
-	}
-	khApi.getKehuAdd(opt).then(res => {
-		if (res.data) {
+
+	function htAdd2() {
+
+		let arr = [];
+		if (!formData.realName) {
+			arr.push('姓名');
+		}
+		if (!formData.userName) {
+			arr.push('电话');
+		}
+		if (!formData.realName || !formData.userName) {
 			uni.showToast({
 			uni.showToast({
-				title: '新增成功'
+				icon: 'none',
+				title: `请完善${arr.join('、')}信息!`
 			})
 			})
-			goUpPage();
+			return;
 		}
 		}
-	}).finally(()=>{
-		uni.hideLoading()
-	})
-}
-
-// 编辑
-function handleEditor() {
-	khApi.getKehuInfo({
-		userId: formData.userId,
-		id:formData.id,
-	}).then(res => {
-		formData.realName = res.data.realName,
-		formData.userName = res.data.userName,
-		formData.idcard = res.data.idcard;
-		formData.idtype = res.data.idtype;
-		formData.addres = res.data.addres;
-		formData.jutidizhi = res.data.jutidizhi;
-		formData.idtype = res.data.idtype;
-				
-	})
-}
 
 
-function htEditor(){
-	let arr = [];
-	if (!formData.realName) {
-		arr.push('姓名');
-	}
-	if (!formData.userName) {
-		arr.push('电话');
+		uni.showLoading({
+			title: '新增中...',
+			mask: true
+		});
+		const opt = {
+			realName: formData.realName,
+			userName: formData.userName,
+			idtype: formData.idtype,
+			idcard: formData.idcard,
+			jutidizhi: formData.jutidizhi,
+			checked:1
+		}
+		khApi.getKehuAdd(opt).then(res => {
+			if (res.data) {
+				uni.showToast({
+					title: '新增成功'
+				})
+				goUpPage();
+			}
+		}).finally(() => {
+			uni.hideLoading()
+		})
 	}
 	}
-	if (!formData.realName || !formData.userName) {
-		uni.showToast({
-			icon: 'none',
-			title: `请完善${arr.join('、')}信息!`
+
+
+	// 编辑
+	function handleEditor() {
+		khApi.getKehuInfo({
+			userId: formData.userId,
+			id: formData.id,
+		}).then(res => {
+			formData.realName = res.data.realName,
+				formData.userName = res.data.userName,
+				formData.idcard = res.data.idcard;
+			formData.idtype = res.data.idtype;
+			formData.addres = res.data.addres;
+			formData.jutidizhi = res.data.jutidizhi;
+			formData.idtype = res.data.idtype;
+
 		})
 		})
-		return;
 	}
 	}
-	uni.showLoading({
-	      title: '更新中...',
-	      mask: true
-	    });
-	const opt = {
-		userId: formData.userId,
-		realName: formData.realName,
-		userName: formData.userName,
-		idtype: formData.idtype,
-		idcard: formData.idcard,
-		jutidizhi: formData.jutidizhi,
+
+	function htEditor() {
+		let arr = [];
+		if (!formData.realName) {
+			arr.push('姓名');
+		}
+		if (!formData.userName) {
+			arr.push('电话');
+		}
+		if (!formData.realName || !formData.userName) {
+			uni.showToast({
+				icon: 'none',
+				title: `请完善${arr.join('、')}信息!`
+			})
+			return;
+		}
+		uni.showLoading({
+			title: '更新中...',
+			mask: true
+		});
+		const opt = {
+			userId: formData.userId,
+			realName: formData.realName,
+			userName: formData.userName,
+			idtype: formData.idtype,
+			idcard: formData.idcard,
+			jutidizhi: formData.jutidizhi,
+			checked: 0
+		}
+		khApi.getKehuUpdate(opt).then(res => {
+			if (res.data.result) {
+				uni.showToast({
+					title: '编辑成功'
+				})
+				goUpPage();
+			} else {
+				contentEditor.value = res.data.message;
+				comRefEditor.value.handleShow();
+			}
+		}).finally(() => {
+			uni.hideLoading()
+		})
 	}
 	}
-	khApi.getKehuUpdate(opt).then(res => {
-		if (res.data) {
+
+	function htEditor2() {
+		let arr = [];
+		if (!formData.realName) {
+			arr.push('姓名');
+		}
+		if (!formData.userName) {
+			arr.push('电话');
+		}
+		if (!formData.realName || !formData.userName) {
 			uni.showToast({
 			uni.showToast({
-				title: '编辑成功'
+				icon: 'none',
+				title: `请完善${arr.join('、')}信息!`
 			})
 			})
-			goUpPage();
+			return;
 		}
 		}
-	}).finally(()=>{
-		uni.hideLoading()
-	})
-}
-	
-onLoad((options) => {
-	if(options.id && options.userId){
-		formData.pageFlag = 'editor';
-		formData.id = options.id;
-		formData.userId = options.userId;
-		handleEditor();
+		uni.showLoading({
+			title: '更新中...',
+			mask: true
+		});
+		const opt = {
+			userId: formData.userId,
+			realName: formData.realName,
+			userName: formData.userName,
+			idtype: formData.idtype,
+			idcard: formData.idcard,
+			jutidizhi: formData.jutidizhi,
+			checked: 1
+		}
+		khApi.getKehuUpdate(opt).then(res => {
+			if (res.data) {
+				uni.showToast({
+					title: '编辑成功'
+				})
+				goUpPage();
+			}
+		}).finally(() => {
+			uni.hideLoading()
+		})
 	}
 	}
-})
+
+	onLoad((options) => {
+		if (options.id && options.userId) {
+			formData.pageFlag = 'editor';
+			formData.id = options.id;
+			formData.userId = options.userId;
+			handleEditor();
+		}
+	})
 </script>
 </script>
 
 
 <style>
 <style>