wangguoyu před 2 měsíci
rodič
revize
bbe604df24

+ 1 - 1
pages/admin/Jiazheng/banzhengXinxi.vue

@@ -11,7 +11,7 @@
 		<!-- 报证机构(picker 实现下拉选择) -->
 		<view class="form-label-select form-top-margin">
 			<view class="phone-form-label"><text class="form-label-require">*</text>报证机构</view>
-			<picker mode="selector" :range="jigouNames" @change="jigouChange">
+			<picker :disabled="status =='edit'" mode="selector" :range="jigouNames" @change="jigouChange">
 				<view class="form-radio-select">
 					<view>{{ formData.baozhengJigouName || '请选择报证机构' }}</view>
 					<icon></icon>

+ 145 - 0
pages/admin/Jiazheng/common/jiazhengPdfUpload.vue

@@ -0,0 +1,145 @@
+<template>
+  <view>
+    <!-- 触发按钮 -->
+    <slot name="trigger" :uploading="uploading">
+      <button 
+        :disabled="uploading"
+        @click="choosePdf"
+        class="upload-btn"
+      >
+        {{ uploading ? '上传中...' : '上传PDF' }}
+      </button>
+    </slot>
+  </view>
+</template>
+
+<script>
+export default {
+  name: 'PdfUploader',
+  props: {
+    // 上传接口地址
+    uploadUrl: {
+      type: String,
+      required: true
+    },
+    // 最大文件大小(单位:MB)
+    maxSize: {
+      type: Number,
+      default: 50
+    }
+  },
+  data() {
+    return {
+      uploading: false
+    }
+  },
+  methods: {
+    // 选择PDF文件
+    async choosePdf() {
+      if (this.uploading) return
+      
+      try {
+        const [file] = await this.selectFile()
+        await this.verifyFile(file)
+        const result = await this.uploadFile(file)
+        this.$emit('success', result)
+      } catch (error) {
+        this.$emit('error', error)
+        this.showToast(error.message)
+      }
+    },
+
+    // 选择文件
+    selectFile() {
+      return new Promise((resolve, reject) => {
+        uni.chooseFile({
+          count: 1,
+          type: 'file',
+          extension: ['pdf'],
+          success: res => resolve(res.tempFiles),
+          fail: () => reject(new Error('取消选择'))
+        })
+      })
+    },
+
+    // 验证文件
+    verifyFile(file) {
+      const maxBytes = this.maxSize * 1024 * 1024
+      
+      if (!file.type.includes('pdf')) {
+        throw new Error('请选择PDF文件')
+      }
+      
+      if (file.size > maxBytes) {
+        throw new Error(`文件大小不能超过${this.maxSize}MB`)
+      }
+      
+      return true
+    },
+
+    // 执行上传
+    uploadFile(file) {
+      this.uploading = true
+      
+      return new Promise((resolve, reject) => {
+        uni.uploadFile({
+          url: this.uploadUrl,
+          filePath: file.path,
+          name: 'file',
+          formData: {
+            filename: file.name
+          },
+          success: (res) => {
+            if (res.statusCode === 200) {
+              resolve(JSON.parse(res.data))
+            } else {
+              reject(new Error('上传失败'))
+            }
+          },
+          fail: () => reject(new Error('网络错误')),
+          complete: () => (this.uploading = false)
+        })
+      })
+    },
+
+    // 显示提示
+    showToast(message) {
+      uni.showToast({
+        title: message,
+        icon: 'none',
+        duration: 3000
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.upload-btn {
+  background-color: #007AFF;
+  color: white;
+  padding: 10px 20px;
+  border-radius: 5px;
+  font-size: 14px;
+}
+
+.upload-btn[disabled] {
+  background-color: #cccccc;
+}
+</style>
+<!--  <SimplePdfUploader
+      upload-url="https://your-api.com/upload"
+      :max-size="30"
+      @success="handleSuccess"
+      @error="handleError"
+    >
+      <!-- 自定义触发按钮 -->
+      <template v-slot:trigger="{ uploading }">
+        <button 
+          :disabled="uploading"
+          class="custom-btn"
+        >
+          {{ uploading ? '正在上传...' : '选择PDF文件' }}
+        </button>
+      </template>
+    </SimplePdfUploader> -->

+ 63 - 21
pages/admin/Jiazheng/gerenZiliao.vue

@@ -20,7 +20,7 @@
 				<text v-if="formData.idtype ==2">护照号</text>
 				<icon @click="idCardChange" class="change-icon">切换</icon>
 			</view>
-			<uni-easyinput v-model="formData.idcard" placeholder="请输入身份证号或护照号" maxlength="18" />
+			<uni-easyinput @blur="idCardBlur" v-model="formData.idcard" placeholder="请输入身份证号或护照号" maxlength="18" />
 		</view>
 
 		<view class="form-label-select">
@@ -69,7 +69,7 @@
 		<view class="form-label-radio form-top-margin flex-start-row">
 			<view class="phone-form-label"><text class="form-label-require">*</text>学历</view>
 			<dataChecked :list="xueliList" :selectedIds='formData.xueli.id' mode="single" :showAdd="false"
-				@change="selectChangeXueliList"/>
+				@change="selectChangeXueliList" />
 		</view>
 		<view class="form-label-radio flex-start-row">
 			<view class="phone-form-label"><text class="form-label-require"></text>婚姻 </view>
@@ -78,13 +78,13 @@
 		</view>
 
 
-	<view class="form-label-input">
+		<view class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require"></text>通讯地址</view>
 			<view @click="openMap" class="input-text-row">
-				<view >{{formData.juzhuDizhi}}</view>
+				<view>{{formData.juzhuDizhi}}</view>
 				<icon></icon>
 			</view>
-		<!-- 	<picker :range="shuxiangList" mode='selector' :value="formData.shuxiangIndex" range-key="name"
+			<!-- 	<picker :range="shuxiangList" mode='selector' :value="formData.shuxiangIndex" range-key="name"
 				@change="shuxiangChange" @cancel="shuxiangCancel" class="select-picker-box">
 				<view class="form-radio-select">
 					<view>{{ formData.juzhuDizhi  }}</view>
@@ -132,8 +132,8 @@
 			<button type="default" v-if="status =='add'" @click="goNext" class="phone-green-btn">下一步</button>
 			<button type="default" v-if="status =='edit'" @click="editSave" class="phone-green-btn">保存</button>
 		</view>
-		<uni-popup  ref="popupMap" background-color="#fff" :is-mask-click="false" :mask-click="false" >
-				<customMap  style="100vh" @xuanzeAdress="xuanzeAdress" @close="mapClose"></customMap>
+		<uni-popup ref="popupMap" background-color="#fff" :is-mask-click="false" :mask-click="false">
+			<customMap style="100vh" @xuanzeAdress="xuanzeAdress" @close="mapClose"></customMap>
 		</uni-popup>
 	</view>
 </template>
@@ -149,7 +149,8 @@
 		getJiazhengShuxiang,
 		getJiazhengXingzuo,
 		getJiazhengJiguan,
-		jiazhengIdcard
+		jiazhengIdcard,
+		jiazhengCheck
 	} from "@/api/jiazheng.js";
 	export default {
 		components: {
@@ -225,17 +226,58 @@
 			this.initRequests()
 		},
 		methods: {
-			xuanzeAdress(data){
-				console.log('data',data);
+			xuanzeAdress(data) {
+				console.log('data', data);
 				this.formData.juzhuDizhi = data
 				this.mapClose()
 			},
-			openMap(){
+			openMap() {
 				this.$refs.popupMap.open('bottom')
 			},
-			mapClose(){
+			mapClose() {
 				this.$refs.popupMap.close()
 			},
+			idCardBlur() {
+				let req = {
+					idcard: this.formData.idcard,
+				};
+				jiazhengCheck(req).then(res => {
+					if (res.code == 0) {
+						console.log(res);
+						if (res.data.userId != 0) {
+							this.$nextTick(() => {
+								this.formData.userName = res.data.userName
+								this.formData.realName = res.data.realName
+								this.formData.idcard = res.data.idcard
+								this.formData.idtype = res.data.idtype
+								this.formData.jiguanObj.jiguanShengId = res.data.jiguanShengId
+								this.formData.jiguanShengName = res.data.jiguanShengName
+								this.formData.jiguanObj.jiguanShiId = res.data.jiguanShiId
+								this.formData.jiguanShiName = res.data.jiguanShiName
+								this.formData.juzhuDizhi = res.data.juzhuDizhi
+								this.formData.birthday = res.data.birthday
+								this.formData.minzu = this.dataForId(this.minzuList, res.data.minzu) || ''
+								this.formData.gender = res.data.gender
+								this.formData.xueli = this.dataForId(this.xueliList, res.data.xueli) || ''
+								this.formData.hunyin = this.dataForId(this.hunyinList, res.data.hunyin) || ''
+								this.formData.hujiDizhi = res.data.hujiDizhi
+								this.formData.juzhuDizhi = res.data.juzhuDizhi
+								this.formData.xingzuo = this.dataForId(this.xingzuoList, res.data.xingzuo) ||''
+								this.formData.shuxiang = this.dataForId(this.shuxiangList, res.data.xingzuo) ||''
+								this.formData.xingzuoFlag = res.data.xingzuoFlag
+								this.$emit('idCardBlur', res.data);
+							});
+						} else {
+
+						}
+					} else {
+						this.$message.error('');
+						return false;
+					}
+				});
+			},
+
+
 			async initRequests() {
 				try {
 					await Promise.all([
@@ -345,18 +387,18 @@
 			// 确认选择时获取完整数据
 			onPickerConfirm() {
 				const [provinceIndex, cityIndex] = this.multiIndex;
-	
+
 				const selectedProvince = this.multiArray[0][provinceIndex];
 				const selectedCity = this.multiArray[1][cityIndex];
 				console.log("选中的省份完整数据:", selectedProvince);
-						console.log("选中的城市完整数据:", selectedCity);
-				this.formData.jiguanShengId = selectedProvince?selectedProvince.value:''
-				this.formData.jiguanShiId = selectedCity?selectedCity.value:''
-				this.formData.jiguanShiName =selectedCity?selectedCity.label:''
-				this.formData.jiguanShengName = selectedProvince?selectedProvince.label:''
-				this.formData.jiguanObj.jiguanShengId = selectedProvince?selectedProvince.value:''
-				this.formData.jiguanObj.jiguanShiId = selectedCity?selectedCity.value:''
-		
+				console.log("选中的城市完整数据:", selectedCity);
+				this.formData.jiguanShengId = selectedProvince ? selectedProvince.value : ''
+				this.formData.jiguanShiId = selectedCity ? selectedCity.value : ''
+				this.formData.jiguanShiName = selectedCity ? selectedCity.label : ''
+				this.formData.jiguanShengName = selectedProvince ? selectedProvince.label : ''
+				this.formData.jiguanObj.jiguanShengId = selectedProvince ? selectedProvince.value : ''
+				this.formData.jiguanObj.jiguanShiId = selectedCity ? selectedCity.value : ''
+
 			},
 			setSelectedCity(cityId) {
 				for (let i = 0; i < this.allData.length; i++) {

+ 7 - 5
pages/admin/Jiazheng/jiazhengUserManager.vue

@@ -6,8 +6,8 @@
 		</view>
 		<v-tabs v-model="current" :tabs="tabs" :scroll="false" @change="changeTab" field="name"
 			class="admin-tab-box"></v-tabs>
-		<gerenZiliao ref="gerenZiliao" :status='status' @finishDom='finishDom' @editSave="editSaveGerenziliao"
-			@goNext="gerenziliaoNext" v-show="current ==0"></gerenZiliao>
+		<gerenZiliao ref="gerenZiliao" :status='status' @idCardBlur="idCardBlur" @finishDom='finishDom'
+			@editSave="editSaveGerenziliao" @goNext="gerenziliaoNext" v-show="current ==0"></gerenZiliao>
 		<qiuzhiXinxi ref="qiuzhiXinxi" :status='status' @editSave="editSaveQiuzhixinxi" @goNext="goNextQiuzhixinxi"
 			v-show="current ==1">
 		</qiuzhiXinxi>
@@ -17,8 +17,7 @@
 			v-show="current ==3">
 		</banzhengXinxi>
 		<banzhengXinxiList :list="editInfo.kaozhengList" v-show="banzhengXinxiFlag" @editBanzheng="editBanzheng"
-			@addBanzheng="addBanzheng" @deleteBanzheng="deleteBanzheng"
-			ref="banzhengXinxiList"></banzhengXinxiList>
+			@addBanzheng="addBanzheng" @deleteBanzheng="deleteBanzheng" ref="banzhengXinxiList"></banzhengXinxiList>
 	</view>
 </template>
 
@@ -131,7 +130,10 @@
 				})
 
 			},
-		
+			idCardBlur(data) {
+				this.$refs.qiuzhiXinxi.editinfo(data)
+				this.$refs.zhaopianZiliao.editinfo(data)
+			},
 			dataHandle(pageInfo) {
 				if (this.status == 'add') {
 					this.tabs = [{

+ 9 - 9
pages/admin/Jiazheng/qiuzhiXinxi.vue

@@ -6,7 +6,7 @@
 				@change="selectChangeType" @add="addType" />
 		</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>经验</view>
 			<picker :range="jingyanList" mode='selector' :value="jingyanIndex" range-key="name" @change="jingyanChange"
 				@cancel="jingyanCancel" class="select-picker-box">
 				<view class="form-radio-select">
@@ -228,14 +228,14 @@
 					})
 					return false
 				}
-				if (!this.formData.jingyan) {
-					uni.showToast({
-						title: "请选择经验年限!",
-						icon: 'none',
-						duration: 2000
-					})
-					return false
-				}
+				// if (!this.formData.jingyan) {
+				// 	uni.showToast({
+				// 		title: "请选择经验年限!",
+				// 		icon: 'none',
+				// 		duration: 2000
+				// 	})
+				// 	return false
+				// }
 				if (!this.formData.jineng) {
 					uni.showToast({
 						title: "请选择相应技能!",