gerenZiliao.vue 21 KB

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