Browse Source

修改bug

wangxy 2 days ago
parent
commit
a0605b82b2

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

@@ -8,7 +8,8 @@
 		<view class="sfht-form-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"
 					@change="onMobanSelect" class="select-picker-box">
 					<view class="form-radio-select">
@@ -44,6 +45,9 @@
 			<button type="default" class="phone-green-btn" @click="handleUpdate"
 				v-if="data.type == 'editorHetong'">更新合同</button>
 		</view>
+
+
+		<pdfPreviewVue ref="pdfRef"></pdfPreviewVue>
 	</view>
 </template>
 
@@ -64,6 +68,7 @@
 	import qianMingVue from "./components/qianMing.vue";
 	import qiTaYueDingVue from "./components/qiTaYueDing.vue";
 	import commonDialog from '@/components/dialog/commonDialog.vue';
+	import pdfPreviewVue from "./components/pdfPreview.vue";
 
 	import {
 		useHetong
@@ -117,14 +122,14 @@
 			xinyongdaima: '', // 统一社会信用代码
 			xiuxi: '', // 休息天数
 			khUserName: '', // 客户电话
-      shentiqingkuang: 0, // 身体状态,1 能自理 ,2半自理, 3不能自理
+			shentiqingkuang: 0, // 身体状态,1 能自理 ,2半自理, 3不能自理
 			beizhu: '', // 备注
 			qianmingBase64: '',
 			id: null,
-      jutidizhi: '',
+			jutidizhi: '',
 		},
 		type: null,
-    timer: null
+		timer: null
 	})
 
 	const commonDialogRef = ref(null)
@@ -133,6 +138,7 @@
 	provideHetong(data)
 
 	const jzRef = ref(null)
+	const pdfRef = ref(null)
 
 	function handleSelct(code) {
 		if (code == 'kh') {
@@ -142,6 +148,11 @@
 		}
 	}
 
+	function handlePreviewPdf() {
+		const imgList = data.mobanList[data.mobanIndex] && data.mobanList[data.mobanIndex].base64List;
+		imgList && pdfRef.value.showPDF(imgList)
+	}
+
 	function goUpPage() {
 		uni.navigateBack()
 	}
@@ -163,63 +174,71 @@
 	}
 
 	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({}, {
 			...data.hetong,
 			htId: data.mobanList[data.mobanIndex].id
 		})
 		httpApi.getSanfangAdd(opt).then(res => {
 			if (res.data) {
-        uni.hideLoading()
+				uni.hideLoading()
 				uni.showToast({
 					title: "创建成功",
-          duration:2000,
+					duration: 2000,
 					success() {
-            setTimeout(() => {
-              uni.navigateBack()
-            },2000)
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 2000)
 					}
 				})
 			}
 		}).catch(() => {
-      uni.hideLoading()
-    }).
-    finally(() => {
-      clearTimeout(data.timer);
-      data.timer = null;
-    })
+			uni.hideLoading()
+		}).
+		finally(() => {
+			clearTimeout(data.timer);
+			data.timer = null;
+		})
 	}
 
 	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({}, {
 			...data.hetong,
 			htId: data.mobanList[data.mobanIndex].id
 		})
 		httpApi.getSanfangUpdate(opt).then(res => {
 			if (res.data) {
-        uni.hideLoading()
+				uni.hideLoading()
 				uni.showToast({
 					title: "更新成功",
-          duration:2000,
-          mask: true,
+					duration: 2000,
+					mask: true,
 					success() {
-            setTimeout(() => {
-              uni.navigateBack()
-            },2000)
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 2000)
 					}
 				})
 			}
 		}).catch(() => {
-      uni.hideLoading()
-    })
+			uni.hideLoading()
+		})
 	}
 
 	function handleConfirm() {
@@ -242,7 +261,7 @@
 					id
 				}).then(res => {
 					Object.assign(data.hetong, res.data)
-					
+
 					console.log('ccccc', res.data)
 				})
 			})

+ 12 - 0
pages/admin/Hetong/components/addKh.vue

@@ -53,6 +53,12 @@ const formData = reactive({
 
 function goback2() {
   popupRef.value.close();
+  
+  formData.realName = '';
+  formData.userName = '';
+  formData.idcard = '';
+  formData.idtype = '1';
+  
 }
 
 const popupRef = ref(null)
@@ -105,6 +111,12 @@ function htAdd(){
 			})
 			goback2();
 			emits('success')
+			nextTick(() => {
+				formData.realName = '';
+				formData.userName = '';
+				formData.idcard = '';
+				formData.idtype = '1';
+			})
 		}
 	}).finally(()=>{
 		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-item title="服务时间" :open="true">
 			<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"
 					class="form-radio-select">
 					<view class="data-select-box">
@@ -12,7 +12,7 @@
 				</picker>
 			</view>
 			<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"
 					class="form-radio-select">
 					<view class="data-select-box">

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

@@ -3,7 +3,9 @@
 		<!-- 合同模板 -->
 		<view class="sfht-mt24">
 			<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>{{!!data.hetong.qianmingBase64? '已签名': ''}}</view>
 					<icon></icon>