gerenZiliao.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  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 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 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 @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 {
  134. getJiazhengXueli,
  135. getJiazhengHunyin,
  136. getJiazhengMinzu,
  137. getJiazhengShuxiang,
  138. getJiazhengXingzuo,
  139. getJiazhengJiguan,
  140. jiazhengIdcard,
  141. jiazhengCheck
  142. } from "@/api/jiazheng.js";
  143. export default {
  144. components: {
  145. dataChecked,
  146. jiazhengUpload,
  147. customMap
  148. },
  149. props: {
  150. status: {
  151. type: String,
  152. }
  153. },
  154. data() {
  155. return {
  156. formData: {
  157. userName: '',
  158. realName: '',
  159. idcard: '',
  160. icon: '',
  161. birthday: '',
  162. hujiDizhi: '',
  163. idtype: '1',
  164. gender: '',
  165. juzhuDizhi: '',
  166. jingdu: '',
  167. weidu: '',
  168. shenfenzhengUrl: '',
  169. minzu: {},
  170. shuxiang: {
  171. },
  172. xingzuo: {
  173. },
  174. hunyin: {
  175. name: '',
  176. },
  177. xueli: {
  178. },
  179. jiguanObj: {},
  180. jiguanShengId: '',
  181. jiguanShiId: '',
  182. jiguanShiName: '',
  183. jiguanShengName: '',
  184. agree: false,
  185. xingzuoIndex: 0,
  186. minzuIndex: 0,
  187. shuxiangIndex: 0,
  188. xingzuoFlag: false
  189. },
  190. selectedIds: [],
  191. ceshidata: '',
  192. xueliList: [],
  193. hunyinList: [],
  194. shuxiangList: [],
  195. xingzuoList: [],
  196. minzuList: [],
  197. // areaTree: [],
  198. multiArray: [
  199. [],
  200. []
  201. ], // 初始化两列数据
  202. multiIndex: [0, 0], // 初始化选中索引
  203. allData: [], // 存储后端返回的完整数据
  204. }
  205. },
  206. created() {
  207. uni.showLoading({
  208. title: '加载中'
  209. });
  210. this.initRequests()
  211. },
  212. methods: {
  213. xuanzeAdress(data) {
  214. console.log('data', data);
  215. this.formData.juzhuDizhi = data
  216. this.mapClose()
  217. },
  218. currentWeizhi(data) {
  219. console.log('data', data);
  220. this.formData.jingdu = data.lng
  221. this.formData.weidu = data.lat
  222. this.mapClose()
  223. },
  224. openMap() {
  225. this.$refs.popupMap.open('top')
  226. },
  227. mapClose() {
  228. this.$refs.popupMap.close()
  229. },
  230. idCardBlur() {
  231. let req = {
  232. idcard: this.formData.idcard,
  233. };
  234. jiazhengCheck(req).then(res => {
  235. if (res.code == 0) {
  236. console.log(res);
  237. if (res.data.userId != 0) {
  238. this.$nextTick(() => {
  239. this.formData.userName = res.data.userName
  240. this.formData.realName = res.data.realName
  241. this.formData.idcard = res.data.idcard
  242. this.formData.idtype = res.data.idtype
  243. this.formData.jiguanObj.jiguanShengId = res.data.jiguanShengId
  244. this.formData.jiguanShengName = res.data.jiguanShengName
  245. this.formData.jiguanObj.jiguanShiId = res.data.jiguanShiId
  246. this.formData.jiguanShiName = res.data.jiguanShiName
  247. this.formData.juzhuDizhi = res.data.juzhuDizhi
  248. this.formData.birthday = res.data.birthday
  249. this.formData.minzu = this.dataForId(this.minzuList, res.data.minzu) || ''
  250. this.formData.gender = res.data.gender
  251. this.formData.xueli = this.dataForId(this.xueliList, res.data.xueli) || ''
  252. this.formData.hunyin = this.dataForId(this.hunyinList, res.data.hunyin) ||
  253. ''
  254. this.formData.hujiDizhi = res.data.hujiDizhi
  255. this.formData.juzhuDizhi = res.data.juzhuDizhi
  256. this.formData.xingzuo = this.dataForId(this.xingzuoList, res.data
  257. .xingzuo) || ''
  258. this.formData.shuxiang = this.dataForId(this.shuxiangList, res.data
  259. .xingzuo) || ''
  260. this.formData.xingzuoFlag = res.data.xingzuoFlag
  261. this.$emit('idCardBlur', res.data);
  262. });
  263. } else {
  264. }
  265. } else {
  266. this.$message.error('');
  267. return false;
  268. }
  269. });
  270. },
  271. async initRequests() {
  272. try {
  273. await Promise.all([
  274. this.getXueli(),
  275. this.getHunyin(),
  276. this.getMinzu(),
  277. this.getXingzuo(),
  278. this.getShuxiang(),
  279. this.getJiguan(),
  280. ]);
  281. uni.hideLoading();
  282. if (this.status == 'edit') {
  283. this.$emit('finishDom', 'gerenZiliao');
  284. }
  285. } catch (e) {
  286. uni.hideLoading();
  287. uni.showToast({
  288. title: `请求失败!`,
  289. icon: 'none',
  290. duration: 2000
  291. })
  292. }
  293. },
  294. editinfo(data) {
  295. this.$nextTick(() => {
  296. this.formData.userName = data.userName
  297. this.formData.realName = data.realName
  298. this.formData.idcard = data.idcard
  299. this.formData.jingdu = data.jingdu
  300. this.formData.weidu = data.weidu
  301. this.formData.idtype = data.idtype
  302. this.formData.jiguanObj.jiguanShengId = data.jiguanShengId
  303. this.formData.jiguanShengName = data.jiguanShengName
  304. this.formData.jiguanObj.jiguanShiId = data.jiguanShiId
  305. this.formData.jiguanShiName = data.jiguanShiName
  306. this.formData.juzhuDizhi = data.juzhuDizhi
  307. this.formData.birthday = data.birthday
  308. this.formData.minzu = this.dataForId(this.minzuList, data.minzu) || ''
  309. this.formData.gender = data.gender
  310. this.formData.xueli = this.dataForId(this.xueliList, data.xueli) || ''
  311. this.formData.hunyin = this.dataForId(this.hunyinList, data.hunyin) || ''
  312. this.formData.hujiDizhi = data.hujiDizhi
  313. this.formData.juzhuDizhi = data.juzhuDizhi
  314. this.formData.xingzuo = this.dataForId(this.xingzuoList, data.xingzuo) || ''
  315. this.formData.shuxiang = this.dataForId(this.shuxiangList, data.xingzuo) || ''
  316. this.formData.xingzuoFlag = data.xingzuoFlag
  317. })
  318. },
  319. dataForId(list, id) {
  320. return list.find(item => item.id == id);
  321. },
  322. idCardChange(data) {
  323. this.formData.idtype = this.formData.idtype == 1 ? 2 : 1;
  324. },
  325. getJiguan() {
  326. getJiazhengJiguan({}).then(res => {
  327. // this.areaTree = res.data
  328. // this.pickerData = this.formatData(res.data);
  329. this.allData = res.data;
  330. const provinces = this.allData.map(province => ({
  331. label: province.lable,
  332. value: province.id,
  333. children: province.children,
  334. }));
  335. const cities = this.allData[0].children.map(city => ({
  336. label: city.lable,
  337. value: city.id,
  338. }));
  339. // 回显已选中的城市(假设已选中的城市 id 是 1301)
  340. //this.setSelectedCity(1301);
  341. this.multiArray = [provinces, cities];
  342. //console.log('this.pickerData', this.pickerData);
  343. }).catch(error => {
  344. console.error('获取技能类型失败:', error);
  345. });
  346. },
  347. bindMultiPickerColumnChange(e) {
  348. const {
  349. column,
  350. value
  351. } = e.detail;
  352. // 更新 multiIndex
  353. this.multiIndex[column] = value;
  354. // 如果是第一列(省份)发生变化,更新第二列(城市)
  355. if (column === 0) {
  356. const selectedProvince = this.multiArray[0][value];
  357. const cities = selectedProvince.children.map(city => ({
  358. label: city.lable,
  359. value: city.id,
  360. }));
  361. // 更新 multiArray 和 multiIndex
  362. this.multiArray[1] = cities;
  363. this.multiIndex[1] = 0; // 重置城市列为第一个选项
  364. }
  365. // 强制更新视图
  366. //this.$forceUpdate();
  367. },
  368. // 确认选择时获取完整数据
  369. onPickerConfirm() {
  370. const [provinceIndex, cityIndex] = this.multiIndex;
  371. const selectedProvince = this.multiArray[0][provinceIndex];
  372. const selectedCity = this.multiArray[1][cityIndex];
  373. console.log("选中的省份完整数据:", selectedProvince);
  374. console.log("选中的城市完整数据:", selectedCity);
  375. this.formData.jiguanShengId = selectedProvince ? selectedProvince.value : ''
  376. this.formData.jiguanShiId = selectedCity ? selectedCity.value : ''
  377. this.formData.jiguanShiName = selectedCity ? selectedCity.label : ''
  378. this.formData.jiguanShengName = selectedProvince ? selectedProvince.label : ''
  379. this.formData.jiguanObj.jiguanShengId = selectedProvince ? selectedProvince.value : ''
  380. this.formData.jiguanObj.jiguanShiId = selectedCity ? selectedCity.value : ''
  381. },
  382. setSelectedCity(cityId) {
  383. for (let i = 0; i < this.allData.length; i++) {
  384. const province = this.allData[i];
  385. for (let j = 0; j < province.children.length; j++) {
  386. const city = province.children[j];
  387. if (city.id === cityId) {
  388. // 设置选中的省份和城市索引
  389. this.multiIndex = [i, j];
  390. // 更新 multiArray 的第二列(城市)
  391. const cities = province.children.map(city => ({
  392. label: city.lable,
  393. value: city.id,
  394. }));
  395. this.multiArray[1] = cities;
  396. // 强制更新视图
  397. this.$forceUpdate();
  398. return;
  399. }
  400. }
  401. }
  402. },
  403. checkAllFields() {
  404. const requiredFields = [{
  405. key: 'userName',
  406. name: '手机号'
  407. },
  408. {
  409. key: 'realName',
  410. name: '姓名'
  411. },
  412. {
  413. key: 'idcard',
  414. name: '身份证号'
  415. },
  416. {
  417. key: 'birthday',
  418. name: '生日'
  419. },
  420. // {
  421. // key: 'hometown',
  422. // name: '家乡',
  423. // type: 'array'
  424. // },
  425. // {
  426. // key: 'hujiDizhi',
  427. // name: '身份证地址'
  428. // },
  429. {
  430. key: 'gender',
  431. name: '性别'
  432. },
  433. // {
  434. // key: 'juzhuDizhi',
  435. // name: '通讯地址'
  436. // },
  437. {
  438. key: 'minzu',
  439. name: '民族',
  440. type: 'object'
  441. },
  442. {
  443. key: 'jiguanObj',
  444. name: '籍贯',
  445. type: 'object'
  446. },
  447. {
  448. key: 'xueli',
  449. name: '学历',
  450. type: 'object'
  451. },
  452. // {
  453. // key: 'shuxiang',
  454. // name: '属相',
  455. // type: 'object'
  456. // },
  457. // {
  458. // key: 'xingzuo',
  459. // name: '星座',
  460. // type: 'object'
  461. // },
  462. ]
  463. for (const field of requiredFields) {
  464. const value = this.formData[field.key]
  465. // 根据不同类型进行存在验证
  466. if (field.type === 'array' && !value?.length) {
  467. this.showAlert(field.name)
  468. return false
  469. }
  470. if (field.type === 'object' && !Object.keys(value).length) {
  471. this.showAlert(field.name)
  472. return false
  473. }
  474. if (field.type === 'boolean' && value !== true) {
  475. this.showAlert(field.name)
  476. return false
  477. }
  478. if (!field.type && !value?.toString().trim()) {
  479. this.showAlert(field.name)
  480. return false
  481. }
  482. }
  483. return true
  484. },
  485. showAlert(fieldName) {
  486. uni.showToast({
  487. title: `${fieldName}不能为空`,
  488. icon: 'none',
  489. duration: 2000
  490. })
  491. },
  492. getXueli() {
  493. getJiazhengXueli({}).then(res => {
  494. this.xueliList = res.data
  495. // console.log('xueliList', this.xueliList);
  496. }).catch(error => {
  497. console.error('获取技能类型失败:', error);
  498. });
  499. },
  500. getXingzuo() {
  501. getJiazhengXingzuo({}).then(res => {
  502. this.xingzuoList = res.data
  503. // console.log('xingzuoList', this.xingzuoList);
  504. }).catch(error => {
  505. console.error('获取技能类型失败:', error);
  506. });
  507. },
  508. getShuxiang() {
  509. getJiazhengShuxiang({}).then(res => {
  510. this.shuxiangList = res.data
  511. // console.log('shuxiangList', this.shuxiangList);
  512. }).catch(error => {
  513. console.error('获取技能类型失败:', error);
  514. });
  515. },
  516. getHunyin() {
  517. getJiazhengHunyin({}).then(res => {
  518. this.hunyinList = res.data
  519. // console.log('hunyinList', this.hunyinList);
  520. }).catch(error => {
  521. console.error('获取技能类型失败:', error);
  522. });
  523. },
  524. getMinzu() {
  525. getJiazhengMinzu({}).then(res => {
  526. this.minzuList = res.data
  527. // console.log('minzuList', this.minzuList);
  528. }).catch(error => {
  529. console.error('获取技能类型失败:', error);
  530. });
  531. },
  532. getFileUrl(data) {
  533. this.formData.shenfenzhengUrl = data
  534. console.log('data', data);
  535. jiazhengIdcard({
  536. url: this.formData.shenfenzhengUrl
  537. }).then(res => {
  538. console.log('res', res);
  539. if (res.code == 0) {
  540. this.formData.realName = res.data.name
  541. this.formData.idtype = '1'
  542. this.formData.gender = res.data.genderId
  543. this.formData.minzu.name = res.data.minzuName
  544. this.formData.minzu.id = res.data.minzuId
  545. this.formData.birthday = res.data.birthDate
  546. this.formData.hujiDizhi = res.data.address
  547. this.formData.idcard = res.data.idNumber
  548. this.formData.shuxiang.id = res.data.shuxiangId
  549. this.formData.shuxiang.name = res.data.shuxiangName
  550. this.formData.xingzuo.id = res.data.xingzuoId
  551. this.formData.xingzuo.name = res.data.xingzuoName
  552. this.formData.jiguanShengId = res.data.jiguanShengId
  553. this.formData.jiguanShiId = res.data.jiguanShiId
  554. this.formData.jiguanShengName = res.data.jiguanShengName
  555. this.formData.jiguanShiName = res.data.jiguanShiName
  556. this.formData.jiguanObj.jiguanShengId = res.data.jiguanShengId
  557. this.formData.jiguanObj.jiguanShiId = res.data.jiguanShiId
  558. }
  559. })
  560. },
  561. minzuChange(e) {
  562. const index = e.detail.value
  563. this.formData.minzu = this.minzuList[index]
  564. //console.log('this.formData.minzu', this.formData.minzu);
  565. },
  566. minzuCancel() {
  567. this.formData.minzuIndex = 0
  568. },
  569. xingzuoChange(e) {
  570. const index = e.detail.value
  571. this.formData.xingzuo = this.xingzuoList[index]
  572. // console.log('this.formData.xingzuo', this.formData.xingzuo);
  573. },
  574. xingzuoCancel() {
  575. this.formData.xingzuoIndex = 0
  576. },
  577. shuxiangChange(e) {
  578. const index = e.detail.value
  579. this.formData.shuxiang = this.shuxiangList[index]
  580. //console.log('this.formData.shuxiang', this.formData.shuxiang);
  581. },
  582. shuxiangCancel() {
  583. this.formData.shuxiangIndex = 0
  584. },
  585. selectChangeXueliList(data) {
  586. if (data.length > 0) {
  587. this.formData.xueli = data[0]
  588. } else {
  589. this.formData.xueli = {}
  590. }
  591. },
  592. genderSelect(data) {
  593. this.formData.gender = data
  594. },
  595. selectChangeHunyinList(data) {
  596. console.log('data', data[0]);
  597. if (data.length > 0) {
  598. this.formData.hunyin = data[0]
  599. } else {
  600. this.formData.hunyin = {}
  601. }
  602. },
  603. switchXingzuoChange(e) {
  604. this.formData.xingzuoFlag = e.detail.value
  605. },
  606. goNext() {
  607. console.log('formData', this.formData);
  608. if (!this.checkAllFields()) {
  609. return false
  610. }
  611. if (!this.formData.agree) {
  612. uni.showToast({
  613. title: "请勾选本人同意!",
  614. icon: 'none',
  615. duration: 2000
  616. })
  617. return false
  618. }
  619. this.$emit('goNext', this.formData, 0);
  620. },
  621. editSave() {
  622. console.log('formData', this.formData);
  623. if (!this.checkAllFields()) {
  624. return false
  625. }
  626. if (!this.formData.agree) {
  627. uni.showToast({
  628. title: "请勾选本人同意!",
  629. icon: 'none',
  630. duration: 2000
  631. })
  632. return false
  633. }
  634. this.$emit('editSave', this.formData);
  635. },
  636. handleAgree(e) {
  637. this.formData.agree = e.detail.value.length > 0
  638. },
  639. }
  640. }
  641. </script>