gerenZiliao.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <template>
  2. <view class="jz-content-box">
  3. <view class="upload-img-box">
  4. <jiazhengUpload @getFileUrl="getFileUrl" changjingType="shenfenzheng"></jiazhengUpload>
  5. </view>
  6. <view class="form-label-input">
  7. <view class="phone-form-label"><text class="form-label-require">*</text>手机号</view>
  8. <uni-easyinput :disabled="!statusFlag && status=='edit'" type="number" v-model="formData.userName" placeholder="请输入手机号" maxlength="11" />
  9. </view>
  10. <view class="form-label-input">
  11. <view class="phone-form-label"><text class="form-label-require">*</text>姓名</view>
  12. <uni-easyinput :disabled="!statusFlag && status=='edit'" v-model="formData.realName" placeholder="请输入姓名" />
  13. </view>
  14. <view class="form-label-input">
  15. <view class="phone-form-label">
  16. <text class="form-label-require">*</text>
  17. <text v-if="formData.idtype ==1">身份证号</text>
  18. <text v-if="formData.idtype ==2">护照号</text>
  19. <icon @click="idCardChange" class="change-icon">切换</icon>
  20. </view>
  21. <uni-easyinput :disabled="!statusFlag && status=='edit'" @blur="idCardBlur" v-model="formData.idcard" placeholder="请输入身份证号或护照号" maxlength="18" />
  22. </view>
  23. <view class="form-label-select">
  24. <view class="phone-form-label"><text class="form-label-require">*</text>生日</view>
  25. <uni-datetime-picker type="line" v-model="formData.birthday">
  26. <view class="form-radio-select">
  27. <view>{{formData.birthday}}</view>
  28. <icon></icon>
  29. </view>
  30. </uni-datetime-picker>
  31. </view>
  32. <view class="form-label-select">
  33. <view class="phone-form-label"><text class="form-label-require">*</text>籍贯</view>
  34. <picker mode="multiSelector" :range="multiArray" :range-key="'label'" :value="multiIndex"
  35. @columnchange="bindMultiPickerColumnChange" @change="onPickerConfirm" class="select-picker-box">
  36. <view class="form-radio-select">
  37. <view>
  38. {{formData.jiguanShengName === formData.jiguanShiName ? formData.jiguanShengName : `${formData.jiguanShengName} ${formData.jiguanShiName}`}}
  39. </view>
  40. <icon></icon>
  41. </view>
  42. </picker>
  43. </view>
  44. <view class="form-label-input">
  45. <view class="phone-form-label"><text class="form-label-require">*</text>身份证地址</view>
  46. <uni-easyinput v-model="formData.hujiDizhi" placeholder="请输入身份证地址" />
  47. </view>
  48. <view class="form-label-select">
  49. <view class="phone-form-label"><text class="form-label-require">*</text>民族</view>
  50. <picker :range="minzuList" mode='selector' :value="formData.minzuIndex" range-key="name"
  51. @change="minzuChange" @cancel="minzuCancel" class="select-picker-box">
  52. <view class="form-radio-select">
  53. <view>{{ formData.minzu.name }}</view>
  54. <icon></icon>
  55. </view>
  56. </picker>
  57. </view>
  58. <view class="form-label-radio">
  59. <view class="phone-form-label"><text class="form-label-require">*</text>性别</view>
  60. <view class="form-radio-group">
  61. <view class="form-radio-item" :class="{genderActive: formData.gender==1}" @click="genderSelect(1)">
  62. 男</view>
  63. <view class="form-radio-item" :class="{genderActive: formData.gender==2}" @click="genderSelect(2)">
  64. 女</view>
  65. </view>
  66. </view>
  67. <view class="form-label-radio form-top-margin flex-start-row">
  68. <view class="phone-form-label"><text class="form-label-require">*</text>学历</view>
  69. <dataChecked :list="xueliList" :selectedIds='formData.xueli.id' mode="single" :showAdd="false"
  70. @change="selectChangeXueliList" />
  71. </view>
  72. <view class="form-label-radio flex-start-row">
  73. <view class="phone-form-label"><text class="form-label-require"></text>婚姻 </view>
  74. <dataChecked :list="hunyinList" mode="single" :selectedIds='formData.hunyin.id' :showAdd="false"
  75. @change="selectChangeHunyinList" />
  76. </view>
  77. <view class="form-label-input">
  78. <view class="phone-form-label"><text class="form-label-require"></text>通讯地址</view>
  79. <view @click="openMap" class="input-text-row">
  80. <view v-if="formData.jingdu&&formData.weidu">{{formData.juzhuDizhi}}</view>
  81. <view v-if="formData.jingdu ==''&&formData.weidu ==''">{{formData.juzhuDizhi}} <text
  82. v-if="formData.juzhuDizhi" style="color: #3fd2a1;">(无经纬度)</text></view>
  83. <icon></icon>
  84. </view>
  85. </view>
  86. <view class="form-label-select">
  87. <view class="phone-form-label"><text class="form-label-require"></text>星座</view>
  88. <picker :range="xingzuoList" mode='selector' :value="formData.xingzuoIndex" range-key="name"
  89. @change="xingzuoChange" @cancel="xingzuoCancel" class="select-picker-box">
  90. <view class="form-radio-select">
  91. <view>{{ formData.xingzuo.name }}</view>
  92. <icon></icon>
  93. </view>
  94. </picker>
  95. </view>
  96. <view class="form-label-select">
  97. <view class="phone-form-label"><text class="form-label-require"></text>属相</view>
  98. <picker :range="shuxiangList" mode='selector' :value="formData.shuxiangIndex" range-key="name"
  99. @change="shuxiangChange" @cancel="shuxiangCancel" class="select-picker-box">
  100. <view class="form-radio-select">
  101. <view>{{ formData.shuxiang.name }}</view>
  102. <icon></icon>
  103. </view>
  104. </picker>
  105. </view>
  106. <view class="form-label-switch">
  107. <view class="phone-form-label"> <text class="form-label-require"></text>星座属相展示到简历 </view>
  108. <view>展示
  109. <switch @change="switchXingzuoChange" :checked="formData.xingzuoFlag" color="#3fd2a1"
  110. style="transform:scale(0.7)" />
  111. </view>
  112. </view>
  113. <view class="agree-section-box form-top-margin">
  114. <checkbox-group @change="handleAgree">
  115. <label class="checkbox">
  116. <checkbox :checked="formData.agree" color="#3fd2a1" style="transform:scale(0.65)" />
  117. <text>已征得本人同意,将其个人资料信息录入平台</text>
  118. </label>
  119. </checkbox-group>
  120. <button type="default" v-if="status =='add'" @click="goNext" class="phone-green-btn">下一步</button>
  121. <button type="default" v-if="status =='edit'" @click="editSave" class="phone-green-btn">保存</button>
  122. </view>
  123. <uni-popup ref="popupMap" background-color="#fff" :is-mask-click="false" :mask-click="false">
  124. <customMap style="100vh" @xuanzeAdress="xuanzeAdress" @currentWeizhi="currentWeizhi" @close="mapClose">
  125. </customMap>
  126. </uni-popup>
  127. </view>
  128. </template>
  129. <script>
  130. import dataChecked from './common/dataChecked.vue';
  131. import jiazhengUpload from "./common/jiazhengUpload.vue"
  132. import customMap from "@/components/customMap/customMap.vue"
  133. import {toast} from "@/utils/common";
  134. import {
  135. getJiazhengXueli,
  136. getJiazhengHunyin,
  137. getJiazhengMinzu,
  138. getJiazhengShuxiang,
  139. getJiazhengXingzuo,
  140. getJiazhengJiguan,
  141. jiazhengIdcard,
  142. jiazhengCheck
  143. } from "@/api/jiazheng.js";
  144. export default {
  145. components: {
  146. dataChecked,
  147. jiazhengUpload,
  148. customMap
  149. },
  150. props: {
  151. status: {
  152. type: String,
  153. },
  154. statusFlag: {
  155. type: Boolean,
  156. }
  157. },
  158. data() {
  159. return {
  160. formData: {
  161. userName: '',
  162. realName: '',
  163. idcard: '',
  164. icon: '',
  165. birthday: '',
  166. hujiDizhi: '',
  167. idtype: '1',
  168. gender: '',
  169. juzhuDizhi: '',
  170. jingdu: '',
  171. weidu: '',
  172. shenfenzhengUrl: '',
  173. minzu: {},
  174. shuxiang: {
  175. },
  176. xingzuo: {
  177. },
  178. hunyin: {
  179. name: '',
  180. },
  181. xueli: {
  182. },
  183. jiguanObj: {},
  184. jiguanShengId: '',
  185. jiguanShiId: '',
  186. jiguanShiName: '',
  187. jiguanShengName: '',
  188. agree: false,
  189. xingzuoIndex: 0,
  190. minzuIndex: 0,
  191. shuxiangIndex: 0,
  192. xingzuoFlag: false
  193. },
  194. selectedIds: [],
  195. ceshidata: '',
  196. xueliList: [],
  197. hunyinList: [],
  198. shuxiangList: [],
  199. xingzuoList: [],
  200. minzuList: [],
  201. // areaTree: [],
  202. multiArray: [
  203. [],
  204. []
  205. ], // 初始化两列数据
  206. multiIndex: [0, 0], // 初始化选中索引
  207. allData: [], // 存储后端返回的完整数据
  208. }
  209. },
  210. created() {
  211. console.log('statusFlag',this.statusFlag);
  212. uni.showLoading({
  213. title: '加载中'
  214. });
  215. this.initRequests()
  216. },
  217. methods: {
  218. xuanzeAdress(data) {
  219. console.log('data', data);
  220. this.formData.juzhuDizhi = data
  221. this.mapClose()
  222. },
  223. currentWeizhi(data) {
  224. console.log('data', data);
  225. this.formData.jingdu = data.lng
  226. this.formData.weidu = data.lat
  227. this.mapClose()
  228. },
  229. openMap() {
  230. this.$refs.popupMap.open('top')
  231. },
  232. mapClose() {
  233. this.$refs.popupMap.close()
  234. },
  235. idCardBlur() {
  236. let req = {
  237. idcard: this.formData.idcard,
  238. };
  239. jiazhengCheck(req).then(res => {
  240. if (res.code == 0) {
  241. console.log(res);
  242. if (res.data.userId != 0) {
  243. this.$nextTick(() => {
  244. this.formData.userName = res.data.userName
  245. this.formData.realName = res.data.realName
  246. this.formData.idcard = res.data.idcard
  247. this.formData.idtype = res.data.idtype
  248. this.formData.jiguanObj.jiguanShengId = res.data.jiguanShengId
  249. this.formData.jiguanShengName = res.data.jiguanShengName
  250. this.formData.jiguanObj.jiguanShiId = res.data.jiguanShiId
  251. this.formData.jiguanShiName = res.data.jiguanShiName
  252. this.formData.juzhuDizhi = res.data.juzhuDizhi
  253. this.formData.birthday = res.data.birthday
  254. this.formData.minzu = this.dataForId(this.minzuList, res.data.minzu) || ''
  255. this.formData.gender = res.data.gender
  256. this.formData.xueli = this.dataForId(this.xueliList, res.data.xueli) || ''
  257. this.formData.hunyin = this.dataForId(this.hunyinList, res.data.hunyin) ||
  258. ''
  259. this.formData.hujiDizhi = res.data.hujiDizhi
  260. this.formData.juzhuDizhi = res.data.juzhuDizhi
  261. this.formData.xingzuo = this.dataForId(this.xingzuoList, res.data
  262. .xingzuo) || ''
  263. this.formData.shuxiang = this.dataForId(this.shuxiangList, res.data
  264. .xingzuo) || ''
  265. this.formData.xingzuoFlag = res.data.xingzuoFlag
  266. this.$emit('idCardBlur', res.data);
  267. });
  268. } else {
  269. }
  270. } else {
  271. this.$message.error('');
  272. return false;
  273. }
  274. });
  275. },
  276. async initRequests() {
  277. try {
  278. await Promise.all([
  279. this.getXueli(),
  280. this.getHunyin(),
  281. this.getMinzu(),
  282. this.getXingzuo(),
  283. this.getShuxiang(),
  284. this.getJiguan(),
  285. ]);
  286. uni.hideLoading();
  287. if (this.status == 'edit') {
  288. this.$emit('finishDom', 'gerenZiliao');
  289. }
  290. } catch (e) {
  291. uni.hideLoading();
  292. uni.showToast({
  293. title: `请求失败!`,
  294. icon: 'none',
  295. duration: 2000
  296. })
  297. }
  298. },
  299. editinfo(data) {
  300. this.$nextTick(() => {
  301. this.formData.userName = data.userName
  302. this.formData.realName = data.realName
  303. this.formData.idcard = data.idcard
  304. this.formData.jingdu = data.jingdu
  305. this.formData.weidu = data.weidu
  306. this.formData.idtype = data.idtype
  307. this.formData.jiguanObj.jiguanShengId = data.jiguanShengId
  308. this.formData.jiguanShengName = data.jiguanShengName
  309. this.formData.jiguanObj.jiguanShiId = data.jiguanShiId
  310. this.formData.jiguanShiName = data.jiguanShiName
  311. this.formData.juzhuDizhi = data.juzhuDizhi
  312. this.formData.birthday = data.birthday
  313. this.formData.minzu = this.dataForId(this.minzuList, data.minzu) || ''
  314. this.formData.gender = data.gender
  315. this.formData.xueli = this.dataForId(this.xueliList, data.xueli) || ''
  316. this.formData.hunyin = this.dataForId(this.hunyinList, data.hunyin) || ''
  317. this.formData.hujiDizhi = data.hujiDizhi
  318. this.formData.juzhuDizhi = data.juzhuDizhi
  319. this.formData.xingzuo = this.dataForId(this.xingzuoList, data.xingzuo) || ''
  320. this.formData.shuxiang = this.dataForId(this.shuxiangList, data.xingzuo) || ''
  321. this.formData.xingzuoFlag = data.xingzuoFlag
  322. })
  323. },
  324. dataForId(list, id) {
  325. return list.find(item => item.id == id);
  326. },
  327. idCardChange(data) {
  328. this.formData.idtype = this.formData.idtype == 1 ? 2 : 1;
  329. },
  330. getJiguan() {
  331. getJiazhengJiguan({}).then(res => {
  332. // this.areaTree = res.data
  333. // this.pickerData = this.formatData(res.data);
  334. this.allData = res.data;
  335. const provinces = this.allData.map(province => ({
  336. label: province.lable,
  337. value: province.id,
  338. children: province.children,
  339. }));
  340. const cities = this.allData[0].children.map(city => ({
  341. label: city.lable,
  342. value: city.id,
  343. }));
  344. // 回显已选中的城市(假设已选中的城市 id 是 1301)
  345. //this.setSelectedCity(1301);
  346. this.multiArray = [provinces, cities];
  347. //console.log('this.pickerData', this.pickerData);
  348. }).catch(error => {
  349. console.error('获取技能类型失败:', error);
  350. });
  351. },
  352. bindMultiPickerColumnChange(e) {
  353. const {
  354. column,
  355. value
  356. } = e.detail;
  357. // 更新 multiIndex
  358. this.multiIndex[column] = value;
  359. // 如果是第一列(省份)发生变化,更新第二列(城市)
  360. if (column === 0) {
  361. const selectedProvince = this.multiArray[0][value];
  362. const cities = selectedProvince.children.map(city => ({
  363. label: city.lable,
  364. value: city.id,
  365. }));
  366. // 更新 multiArray 和 multiIndex
  367. this.multiArray[1] = cities;
  368. this.multiIndex[1] = 0; // 重置城市列为第一个选项
  369. }
  370. // 强制更新视图
  371. //this.$forceUpdate();
  372. },
  373. // 确认选择时获取完整数据
  374. onPickerConfirm() {
  375. const [provinceIndex, cityIndex] = this.multiIndex;
  376. const selectedProvince = this.multiArray[0][provinceIndex];
  377. const selectedCity = this.multiArray[1][cityIndex];
  378. console.log("选中的省份完整数据:", selectedProvince);
  379. console.log("选中的城市完整数据:", selectedCity);
  380. this.formData.jiguanShengId = selectedProvince ? selectedProvince.value : ''
  381. this.formData.jiguanShiId = selectedCity ? selectedCity.value : ''
  382. this.formData.jiguanShiName = selectedCity ? selectedCity.label : ''
  383. this.formData.jiguanShengName = selectedProvince ? selectedProvince.label : ''
  384. this.formData.jiguanObj.jiguanShengId = selectedProvince ? selectedProvince.value : ''
  385. this.formData.jiguanObj.jiguanShiId = selectedCity ? selectedCity.value : ''
  386. },
  387. setSelectedCity(cityId) {
  388. for (let i = 0; i < this.allData.length; i++) {
  389. const province = this.allData[i];
  390. for (let j = 0; j < province.children.length; j++) {
  391. const city = province.children[j];
  392. if (city.id === cityId) {
  393. // 设置选中的省份和城市索引
  394. this.multiIndex = [i, j];
  395. // 更新 multiArray 的第二列(城市)
  396. const cities = province.children.map(city => ({
  397. label: city.lable,
  398. value: city.id,
  399. }));
  400. this.multiArray[1] = cities;
  401. // 强制更新视图
  402. this.$forceUpdate();
  403. return;
  404. }
  405. }
  406. }
  407. },
  408. checkAllFields() {
  409. const requiredFields = [{
  410. key: 'userName',
  411. name: '手机号'
  412. },
  413. {
  414. key: 'realName',
  415. name: '姓名'
  416. },
  417. {
  418. key: 'idcard',
  419. name: '身份证号'
  420. },
  421. {
  422. key: 'birthday',
  423. name: '生日'
  424. },
  425. // {
  426. // key: 'hometown',
  427. // name: '家乡',
  428. // type: 'array'
  429. // },
  430. // {
  431. // key: 'hujiDizhi',
  432. // name: '身份证地址'
  433. // },
  434. {
  435. key: 'gender',
  436. name: '性别'
  437. },
  438. // {
  439. // key: 'juzhuDizhi',
  440. // name: '通讯地址'
  441. // },
  442. {
  443. key: 'minzu',
  444. name: '民族',
  445. type: 'object'
  446. },
  447. {
  448. key: 'jiguanObj',
  449. name: '籍贯',
  450. type: 'object'
  451. },
  452. {
  453. key: 'xueli',
  454. name: '学历',
  455. type: 'object'
  456. },
  457. // {
  458. // key: 'shuxiang',
  459. // name: '属相',
  460. // type: 'object'
  461. // },
  462. // {
  463. // key: 'xingzuo',
  464. // name: '星座',
  465. // type: 'object'
  466. // },
  467. ]
  468. for (const field of requiredFields) {
  469. const value = this.formData[field.key]
  470. // 根据不同类型进行存在验证
  471. if (field.type === 'array' && !value?.length) {
  472. this.showAlert(field.name)
  473. return false
  474. }
  475. if (field.type === 'object' && !Object.keys(value).length) {
  476. this.showAlert(field.name)
  477. return false
  478. }
  479. if (field.type === 'boolean' && value !== true) {
  480. this.showAlert(field.name)
  481. return false
  482. }
  483. if (!field.type && !value?.toString().trim()) {
  484. this.showAlert(field.name)
  485. return false
  486. }
  487. }
  488. return true
  489. },
  490. showAlert(fieldName) {
  491. uni.showToast({
  492. title: `${fieldName}不能为空`,
  493. icon: 'none',
  494. duration: 2000
  495. })
  496. },
  497. getXueli() {
  498. getJiazhengXueli({}).then(res => {
  499. this.xueliList = res.data
  500. // console.log('xueliList', this.xueliList);
  501. }).catch(error => {
  502. console.error('获取技能类型失败:', error);
  503. });
  504. },
  505. getXingzuo() {
  506. getJiazhengXingzuo({}).then(res => {
  507. this.xingzuoList = res.data
  508. // console.log('xingzuoList', this.xingzuoList);
  509. }).catch(error => {
  510. console.error('获取技能类型失败:', error);
  511. });
  512. },
  513. getShuxiang() {
  514. getJiazhengShuxiang({}).then(res => {
  515. this.shuxiangList = res.data
  516. // console.log('shuxiangList', this.shuxiangList);
  517. }).catch(error => {
  518. console.error('获取技能类型失败:', error);
  519. });
  520. },
  521. getHunyin() {
  522. getJiazhengHunyin({}).then(res => {
  523. this.hunyinList = res.data
  524. // console.log('hunyinList', this.hunyinList);
  525. }).catch(error => {
  526. console.error('获取技能类型失败:', error);
  527. });
  528. },
  529. getMinzu() {
  530. getJiazhengMinzu({}).then(res => {
  531. this.minzuList = res.data
  532. // console.log('minzuList', this.minzuList);
  533. }).catch(error => {
  534. console.error('获取技能类型失败:', error);
  535. });
  536. },
  537. getFileUrl(data) {
  538. this.formData.shenfenzhengUrl = data
  539. console.log('data', data);
  540. jiazhengIdcard({
  541. url: this.formData.shenfenzhengUrl
  542. }).then(res => {
  543. console.log('res', res);
  544. if (res.code == 0) {
  545. this.formData.realName = res.data.name
  546. this.formData.idtype = '1'
  547. this.formData.gender = res.data.genderId
  548. this.formData.minzu.name = res.data.minzuName
  549. this.formData.minzu.id = res.data.minzuId
  550. this.formData.birthday = res.data.birthDate
  551. this.formData.hujiDizhi = res.data.address
  552. this.formData.idcard = res.data.idNumber
  553. this.formData.shuxiang.id = res.data.shuxiangId
  554. this.formData.shuxiang.name = res.data.shuxiangName
  555. this.formData.xingzuo.id = res.data.xingzuoId
  556. this.formData.xingzuo.name = res.data.xingzuoName
  557. this.formData.jiguanShengId = res.data.jiguanShengId
  558. this.formData.jiguanShiId = res.data.jiguanShiId
  559. this.formData.jiguanShengName = res.data.jiguanShengName
  560. this.formData.jiguanShiName = res.data.jiguanShiName
  561. this.formData.jiguanObj.jiguanShengId = res.data.jiguanShengId
  562. this.formData.jiguanObj.jiguanShiId = res.data.jiguanShiId
  563. }
  564. })
  565. },
  566. minzuChange(e) {
  567. const index = e.detail.value
  568. this.formData.minzu = this.minzuList[index]
  569. //console.log('this.formData.minzu', this.formData.minzu);
  570. },
  571. minzuCancel() {
  572. this.formData.minzuIndex = 0
  573. },
  574. xingzuoChange(e) {
  575. const index = e.detail.value
  576. this.formData.xingzuo = this.xingzuoList[index]
  577. // console.log('this.formData.xingzuo', this.formData.xingzuo);
  578. },
  579. xingzuoCancel() {
  580. this.formData.xingzuoIndex = 0
  581. },
  582. shuxiangChange(e) {
  583. const index = e.detail.value
  584. this.formData.shuxiang = this.shuxiangList[index]
  585. //console.log('this.formData.shuxiang', this.formData.shuxiang);
  586. },
  587. shuxiangCancel() {
  588. this.formData.shuxiangIndex = 0
  589. },
  590. selectChangeXueliList(data) {
  591. if (data.length > 0) {
  592. this.formData.xueli = data[0]
  593. } else {
  594. this.formData.xueli = {}
  595. }
  596. },
  597. genderSelect(data) {
  598. if(!this.statusFlag && this.status =='edit '){
  599. toast("非未办证状态,禁止修改")
  600. return false
  601. }
  602. this.formData.gender = data
  603. },
  604. selectChangeHunyinList(data) {
  605. console.log('data', data[0]);
  606. if (data.length > 0) {
  607. this.formData.hunyin = data[0]
  608. } else {
  609. this.formData.hunyin = {}
  610. }
  611. },
  612. switchXingzuoChange(e) {
  613. this.formData.xingzuoFlag = e.detail.value
  614. },
  615. goNext() {
  616. console.log('formData', this.formData);
  617. if (!this.checkAllFields()) {
  618. return false
  619. }
  620. if (!this.formData.agree) {
  621. uni.showToast({
  622. title: "请勾选本人同意!",
  623. icon: 'none',
  624. duration: 2000
  625. })
  626. return false
  627. }
  628. this.$emit('goNext', this.formData, 0);
  629. },
  630. editSave() {
  631. console.log('formData', this.formData);
  632. if (!this.checkAllFields()) {
  633. return false
  634. }
  635. if (!this.formData.agree) {
  636. uni.showToast({
  637. title: "请勾选本人同意!",
  638. icon: 'none',
  639. duration: 2000
  640. })
  641. return false
  642. }
  643. this.$emit('editSave', this.formData);
  644. },
  645. handleAgree(e) {
  646. this.formData.agree = e.detail.value.length > 0
  647. },
  648. }
  649. }
  650. </script>