gerenZiliao.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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"><text class="form-label-require">*</text>身份证号</view>
  16. <uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号" maxlength="18" />
  17. </view>
  18. <view class="form-label-input">
  19. <view class="phone-form-label"><text class="form-label-require">*</text>生日</view>
  20. <uni-datetime-picker type="line" v-model="formData.birthday">
  21. <view class="form-radio-select">
  22. <view v-if="!formData.birthday">请选择出生日期</view>
  23. <view v-else>{{formData.birthday}}</view>
  24. <icon></icon>
  25. </view>
  26. </uni-datetime-picker>
  27. </view>
  28. <view class="form-label-input">
  29. <view class="phone-form-label"><text class="form-label-require">*</text>籍贯</view>
  30. <uni-data-picker v-model="formData.hometown" placeholder="请选择籍贯" :localdata="hometownData">
  31. {{formData.hometown}}
  32. </uni-data-picker>
  33. </view>
  34. <view class="form-label-input">
  35. <view class="phone-form-label"><text class="form-label-require">*</text>身份证地址</view>
  36. <uni-easyinput v-model="formData.hujiDizhi" placeholder="请输入身份证地址" />
  37. </view>
  38. <view class="form-label-input">
  39. <view class="phone-form-label"><text class="form-label-require">*</text>民族</view>
  40. <picker :range="minzuList" mode='selector' :value="formData.minzuIndex" range-key="name"
  41. @change="minzuChange" @cancel="minzuCancel">
  42. <view class="form-radio-select">
  43. <view>{{ formData.minzu.name || '请选择民族' }}</view>
  44. <icon></icon>
  45. </view>
  46. </picker>
  47. </view>
  48. <view class="form-label-radio">
  49. <view class="phone-form-label"><text class="form-label-require">*</text>性别</view>
  50. <view class="form-radio-group">
  51. <view class="form-radio-item" :class="{genderActive: formData.gender===1}" @click="genderSelect(1)">
  52. 男</view>
  53. <view class="form-radio-item" :class="{genderActive: formData.gender===2}" @click="genderSelect(2)">
  54. 女</view>
  55. </view>
  56. </view>
  57. <view class="form-label-radio form-top-margin flex-start-row">
  58. <view class="phone-form-label"><text class="form-label-require"></text>学历</view>
  59. <dataChecked :list="xueliList" mode="single" :showAdd="false" @change="selectChangeXueliList" />
  60. </view>
  61. <view class="form-label-radio flex-start-row">
  62. <view class="phone-form-label"><text class="form-label-require"></text>婚姻 </view>
  63. <dataChecked :list="hunyinList" mode="single" :showAdd="false" @change="selectChangeHunyinList" />
  64. </view>
  65. <view class="form-label-input form-top-margin flex-start-row">
  66. <view class="phone-form-label"><text class="form-label-require">*</text>通讯地址</view>
  67. <textarea v-model="formData.juzhuDizhi" placeholder="请输入通讯地址" class="form-textarea-box" />
  68. </view>
  69. <view class="form-label-select">
  70. <view class="phone-form-label"><text class="form-label-require"></text>星座</view>
  71. <picker :range="xingzuoList" mode='selector' :value="formData.xingzuoIndex" range-key="name"
  72. @change="xingzuoChange" @cancel="xingzuoCancel">
  73. <view class="form-radio-select">
  74. <view>{{ formData.xingzuo.name || '请选择星座' }}</view>
  75. <icon></icon>
  76. </view>
  77. </picker>
  78. </view>
  79. <view class="form-label-select">
  80. <view class="phone-form-label"><text class="form-label-require"></text>属相</view>
  81. <picker :range="shuxiangList" mode='selector' :value="formData.shuxiangIndex" range-key="name"
  82. @change="shuxiangChange" @cancel="shuxiangCancel">
  83. <view class="form-radio-select">
  84. <view>{{ formData.shuxiang.name || '请选择属相' }}</view>
  85. <icon></icon>
  86. </view>
  87. </picker>
  88. </view>
  89. <view class="form-label-switch">
  90. <view class="phone-form-label"> <text class="form-label-require"></text>星座属相展示到简历 </view>
  91. <view>展示
  92. <switch @change="switchXingzuoChange" :checked="formData.xingzuoFlag" color="#3fd2a1" style="transform:scale(0.7)" />
  93. </view>
  94. </view>
  95. <view class="agree-section-box form-top-margin">
  96. <checkbox-group @change="handleAgree">
  97. <label class="checkbox">
  98. <checkbox :checked="formData.agree" color="#3fd2a1" style="transform:scale(0.65)" />
  99. <text>已征得本人同意,将其个人资料信息录入平台</text>
  100. </label>
  101. </checkbox-group>
  102. <button type="default" @click="goNext" class="phone-green-btn">下一步</button>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import dataChecked from './common/dataChecked.vue';
  108. import jiazhengUpload from "./common/jiazhengUpload.vue"
  109. import {
  110. getJiazhengXueli,
  111. getJiazhengHunyin,
  112. getJiazhengMinzu,
  113. getJiazhengShuxiang,
  114. getJiazhengXingzuo
  115. } from "@/api/jiazheng.js";
  116. export default {
  117. components: {
  118. dataChecked,
  119. jiazhengUpload
  120. },
  121. data() {
  122. return {
  123. formData: {
  124. userName: '',
  125. realName: '',
  126. idCard: '',
  127. birthday: '',
  128. hometown: [],
  129. hujiDizhi: '',
  130. gender: '',
  131. juzhuDizhi: '',
  132. minzu: {},
  133. shuxiang: {},
  134. xingzuo: {},
  135. hunyin: {},
  136. xueli: {},
  137. agree: false,
  138. xingzuoIndex: 0,
  139. minzuIndex: 0,
  140. shuxiangIndex: 0,
  141. xingzuoFlag:false
  142. },
  143. xueliList: [],
  144. hunyinList: [],
  145. shuxiangList: [],
  146. xingzuoList: [],
  147. minzuList: [],
  148. hometownData: [{
  149. text: '辽宁省',
  150. value: '210000',
  151. children: [{
  152. text: '大连市',
  153. value: '210200',
  154. children: [{
  155. text: '西岗区',
  156. value: '210203'
  157. },
  158. // 其他区县...
  159. ]
  160. }]
  161. }
  162. // 其他省份...
  163. ],
  164. }
  165. },
  166. created() {
  167. this.getXueli()
  168. this.getHunyin()
  169. this.getMinzu()
  170. this.getXingzuo()
  171. this.getShuxiang()
  172. },
  173. methods: {
  174. validate() {
  175. return new Promise((resolve) => {
  176. // 实际验证逻辑
  177. const isValid = this.formData.realName
  178. if (!isValid) {
  179. this.showError = true
  180. resolve(false)
  181. } else {
  182. resolve(true)
  183. }
  184. })
  185. },
  186. getXueli() {
  187. getJiazhengXueli({}).then(res => {
  188. this.xueliList = res.data
  189. // console.log('xueliList', this.xueliList);
  190. }).catch(error => {
  191. console.error('获取技能类型失败:', error);
  192. });
  193. },
  194. getXingzuo() {
  195. getJiazhengXingzuo({}).then(res => {
  196. this.xingzuoList = res.data
  197. // console.log('xingzuoList', this.xingzuoList);
  198. }).catch(error => {
  199. console.error('获取技能类型失败:', error);
  200. });
  201. },
  202. getShuxiang() {
  203. getJiazhengShuxiang({}).then(res => {
  204. this.shuxiangList = res.data
  205. // console.log('shuxiangList', this.shuxiangList);
  206. }).catch(error => {
  207. console.error('获取技能类型失败:', error);
  208. });
  209. },
  210. getHunyin() {
  211. getJiazhengHunyin({}).then(res => {
  212. this.hunyinList = res.data
  213. // console.log('hunyinList', this.hunyinList);
  214. }).catch(error => {
  215. console.error('获取技能类型失败:', error);
  216. });
  217. },
  218. getMinzu() {
  219. getJiazhengMinzu({}).then(res => {
  220. this.minzuList = res.data
  221. // console.log('minzuList', this.minzuList);
  222. }).catch(error => {
  223. console.error('获取技能类型失败:', error);
  224. });
  225. },
  226. getFileUrl(data) {
  227. this.formData.icon = data
  228. console.log('data', data);
  229. },
  230. minzuChange(e) {
  231. const index = e.detail.value
  232. this.formData.minzu = this.minzuList[index]
  233. //console.log('this.formData.minzu', this.formData.minzu);
  234. },
  235. minzuCancel() {
  236. this.formData.minzuIndex = 0
  237. },
  238. xingzuoChange(e) {
  239. const index = e.detail.value
  240. this.formData.xingzuo = this.xingzuoList[index]
  241. // console.log('this.formData.xingzuo', this.formData.xingzuo);
  242. },
  243. xingzuoCancel() {
  244. this.formData.xingzuoIndex = 0
  245. },
  246. shuxiangChange(e) {
  247. const index = e.detail.value
  248. this.formData.shuxiang = this.shuxiangList[index]
  249. //console.log('this.formData.shuxiang', this.formData.shuxiang);
  250. },
  251. shuxiangCancel() {
  252. this.formData.shuxiangIndex = 0
  253. },
  254. selectChangeXueliList(data) {
  255. console.log('data', data);
  256. },
  257. genderSelect(data) {
  258. this.formData.gender = data
  259. },
  260. selectChangeHunyinList(data) {
  261. this.formData.hunyin = data
  262. },
  263. switchXingzuoChange(e) {
  264. this.formData.xingzuoFlag = e.detail.value
  265. },
  266. goNext() {
  267. console.log('formData', this.formData);
  268. //this.$emit('goNext',0);
  269. },
  270. handleAgree(e) {
  271. this.formData.agree = e.detail.value.length > 0
  272. },
  273. }
  274. }
  275. </script>