gerenZiliao.vue 20 KB

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