gerenZiliao.vue 20 KB

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