index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <view class="cantent">
  3. <!-- <view class="tip">孝心缝帮扶:仅限服装行业从业者申请哦~</view> -->
  4. <!-- <view class="flex til-list" v-if="!id">
  5. <view class="red">基本信息</view>
  6. <view class="">信息选择</view>
  7. <view class="">家庭成员情况</view>
  8. <view class="">详细情况</view>
  9. </view> -->
  10. <view class="tit-tip">
  11. 基本信息
  12. </view>
  13. <view class="flex til-list" v-if="id && status == ''">
  14. <view class="red">基本信息</view>
  15. <view class="" @click="navTo('/pages/applyHelp/second?id='+id)">信息选择</view>
  16. <view class="" @click="navTo('/pages/applyHelp/third?id='+id)">家庭成员情况</view>
  17. <view class="" @click="navTo('/pages/applyHelp/fourth?id='+id)">详细情况</view>
  18. </view>
  19. <view class="flex til-list" v-if="id && status == 2">
  20. <view class="red">基本信息</view>
  21. <view class="" @click="navTo('/pages/applyHelp/second?id='+id +'&status=2')">信息选择</view>
  22. <view class="" @click="navTo('/pages/applyHelp/third?id='+id+'&status=2')">家庭成员情况</view>
  23. <view class="" @click="navTo('/pages/applyHelp/fourth?id='+id+'&status=2')">详细情况</view>
  24. </view>
  25. <view class="content_box">
  26. <view class="row b-b">
  27. <text class="tit">姓名</text>
  28. <input class="input" type="text" :disabled="disabled" v-model="name" placeholder="请填写您的姓名" placeholder-class="placeholder" />
  29. </view>
  30. <view class="row b-b">
  31. <text class="tit">年龄</text>
  32. <input class="input" type="text" :disabled="disabled" v-model="age" placeholder="请填写您的年龄" placeholder-class="placeholder" />
  33. </view>
  34. <view class="row b-b">
  35. <text class="tit">性别</text>
  36. <input class="input" type="text" :disabled="disabled" v-model="sex" placeholder="请填写您的性别" placeholder-class="placeholder" />
  37. </view>
  38. </view>
  39. <!-- <view class="content_box">
  40. <view class="list-name">政治面貌</view>
  41. <view class="uni-list">
  42. <radio-group @change="radioChange">
  43. <view class="radio-list flex_item">
  44. <label class="uni-list-cell uni-list-cell-pd flex_item" v-for="(item, index) in outlook" :key="item.name">
  45. <view><radio :disabled="disabled" style="transform:scale(0.7)" color='#FF727E' :value="item.name" :checked="index === current" /></view>
  46. <view>{{item.name}}</view>
  47. </label>
  48. </view>
  49. </radio-group>
  50. </view>
  51. </view> -->
  52. <view class="content_box">
  53. <view class="row b-b" v-if="status =='' ">
  54. <text class="tit">政治面貌</text>
  55. <picker mode="" :range="checkedList" @change="changeChecked">
  56. <input class="input" disabled v-model="checked" placeholder="请选择政治面貌" placeholder-class="placeholder" />
  57. </picker>
  58. <!-- <pickerAddress class="input" @change="onCityClick">{{checked||'请选择省市区'}}</pickerAddress> -->
  59. </view>
  60. <view class="row b-b" v-if="status ==2 ">
  61. <text class="tit">政治面貌</text>
  62. <input class="input" :disabled="disabled" v-model="address" placeholder="省市区" placeholder-class="placeholder" />
  63. </view>
  64. <view class="row" v-if="status == ''" @click="selectDatePicker(type)">
  65. <text class="tit">出生日期:</text>
  66. <input class="input" type="text" v-model="birthday" disabled="true" placeholder-class="placeholder" />
  67. <datetime ref='date-time' :type='type' :datestring='dateString' @change='dateTimeChange'></datetime>
  68. </view>
  69. <view class="row" v-if="status == 2">
  70. <text class="tit">出生日期:</text>
  71. <input class="input" type="text" v-model="birthday" disabled="true" placeholder-class="placeholder" />
  72. <datetime ref='date-time' :type='type' :datestring='dateString' @change='dateTimeChange'></datetime>
  73. </view>
  74. <view class="row b-b">
  75. <text class="tit">身份证号</text>
  76. <input class="input" type="number" :disabled="disabled" v-model="card" placeholder="请填写身份证号" placeholder-class="placeholder" />
  77. </view>
  78. <view class="row b-b" v-if="status =='' ">
  79. <text class="tit">省市区</text>
  80. <pickerAddress class="input" @change="onCityClick">{{address||'请选择省市区'}}</pickerAddress>
  81. </view>
  82. <view class="row b-b" v-if="status ==2 ">
  83. <text class="tit">省市区</text>
  84. <input class="input" :disabled="disabled" v-model="address" placeholder="省市区" placeholder-class="placeholder" />
  85. </view>
  86. <view class="row b-b">
  87. <text class="tit">详细地址</text>
  88. <input class="input" v-model="addr" :disabled="disabled" placeholder="请填写详细地址" placeholder-class="placeholder" />
  89. </view>
  90. <view class="row b-b">
  91. <text class="tit">联系电话</text>
  92. <input class="input" type="text" :disabled="disabled" v-model="phone" placeholder="请填写联系电话" placeholder-class="placeholder" />
  93. </view>
  94. <view class="row b-b">
  95. <text class="tit">工作单位</text>
  96. <input class="input" type="text" :disabled="disabled" v-model="work" placeholder="请填写工作单位" placeholder-class="placeholder" />
  97. </view>
  98. </view>
  99. <view class="content_box" v-if="status == ''">
  100. <view class="list-name">单位性质</view>
  101. <view class="uni-list">
  102. <radio-group @change="radioChange1">
  103. <view class="radio-list flex_item">
  104. <label class="uni-list-cell uni-list-cell-pd flex_item" v-for="(item, index) in nature" :key="item.name">
  105. <view><radio :disabled="disabled" style="transform:scale(0.7)" color='#FF727E' :value="item.name" :checked="index === current1" /></view>
  106. <view>{{item.name}}</view>
  107. </label>
  108. </view>
  109. </radio-group>
  110. </view>
  111. </view>
  112. <view class="add-btn" v-if="status == ''" @click="confirm">下一步</view>
  113. <view class="add-btn" v-if="status == 2" @click="Tosecond">下一步</view>
  114. </view>
  115. </template>
  116. <script>
  117. import uniList from '@/components/uni-list/uni-list.vue';
  118. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  119. import { upload,add_help } from '@/api/index.js';
  120. import { getList,helpdetail } from '@/api/applyHelp.js';
  121. import datetime from '@/components/DateTimePicker/DateTimePicker.vue'
  122. import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
  123. export default {
  124. components: {
  125. uniList,
  126. uniListItem,
  127. pickerAddress,
  128. datetime
  129. },
  130. data() {
  131. return {
  132. id:'',
  133. name:'',//姓名
  134. age:'',//年龄
  135. sex:'',//性别
  136. card:'',//身份证号
  137. phone:'',//电话
  138. address:'',//
  139. addr:'',
  140. work:'',//工作单位
  141. checkedList: ['团员','预备党员','党员','群众'],//政治面貌
  142. outlook:[{
  143. id:1,
  144. name:'团员'
  145. },{
  146. id:2,
  147. name:'预备党员'
  148. },{
  149. id:3,
  150. name:'党员'
  151. },{
  152. id:4,
  153. name:'群众'
  154. }],//政治面貌
  155. current:'',
  156. checked:'',
  157. nature:[{
  158. id:1,
  159. name:'国有企业'
  160. },{
  161. id:2,
  162. name:'私营企业'
  163. },{
  164. id:3,
  165. name:'外资企业'
  166. },{
  167. id:4,
  168. name:'事业单位'
  169. },{
  170. id:5,
  171. name:'个位经营'
  172. },{
  173. id:6,
  174. name:'无'
  175. }],//单位性质
  176. current1:'',
  177. checked1:'',
  178. dateString: '',
  179. birthday:'请选择出生日期',//出生日期
  180. type: 'date',
  181. status:'',//审核通过
  182. disabled:false,
  183. };
  184. },
  185. onLoad(option) {
  186. if(option.id){
  187. this.id = option.id;
  188. this.helpDetail();
  189. }
  190. if(option.status){
  191. this.status = option.status;
  192. this.disabled = true;
  193. }
  194. },
  195. onUnload() {
  196. uni.navigateTo({
  197. url: '/pages/applyHelp/cation'
  198. });
  199. },
  200. methods: {
  201. // 选择政治面貌
  202. changeChecked(e) {
  203. console.log(e)
  204. },
  205. radioChange(evt){
  206. this.checked = evt.detail.value;
  207. },
  208. radioChange1(evt){
  209. this.checked1 = evt.detail.value;
  210. },
  211. // 显示日期选择器
  212. selectDatePicker(type, index) {
  213. this.type = type;
  214. this.index = index;
  215. this.$refs['date-time'].show();
  216. },
  217. dateTimeChange(value) {
  218. this.birthday = value;
  219. console.log(value)
  220. },
  221. // 选中城市切换
  222. onCityClick(res) {
  223. let obj = this;
  224. let province = res.data[0];
  225. let city = res.data[1];
  226. let district = res.data[2];
  227. obj.address = province + city+ district;
  228. console.log(obj.address, '城市');
  229. },
  230. //申请详情
  231. helpDetail(){
  232. let obj = this;
  233. helpdetail({
  234. id:obj.id
  235. }).then(({ data }) => {
  236. obj.name = data.name;
  237. obj.sex = data.sex;
  238. obj.card = data.card;
  239. obj.phone = data.phone;
  240. obj.work = data.work;
  241. obj.birthday = data.birthday;
  242. obj.age = data.age;
  243. console.log(data.address)
  244. let addressDateil = data.address.split(',');
  245. console.log(addressDateil)
  246. obj.address = addressDateil[0];
  247. obj.addr = addressDateil[1];
  248. obj.checked = data.politic;
  249. if(obj.checked == '团员'){
  250. obj.current = 0;
  251. }
  252. if(obj.checked == '预备党员'){
  253. obj.current = 1;
  254. }
  255. if(obj.checked == '党员'){
  256. obj.current = 2;
  257. }
  258. if(obj.checked == '群众'){
  259. obj.current = 3;
  260. }
  261. obj.checked1 = data.properties;
  262. if(obj.checked1 == '国有企业'){
  263. obj.current1 = 0;
  264. }
  265. if(obj.checked1 == '私营企业'){
  266. obj.current1 = 1;
  267. }
  268. if(obj.checked1 == '外资企业'){
  269. obj.current1 = 2;
  270. }
  271. if(obj.checked1 == '事业单位'){
  272. obj.current1 = 3;
  273. }
  274. if(obj.checked1 == '个位经营'){
  275. obj.current1 = 4;
  276. }
  277. if(obj.checked1 == '无'){
  278. obj.current1 = 5;
  279. }
  280. })
  281. .catch(err => {
  282. console.log(err);
  283. });
  284. },
  285. Tosecond(){
  286. uni.navigateTo({
  287. url:'/pages/applyHelp/second?id='+this.id+'&status=2'
  288. })
  289. },
  290. //提交
  291. confirm() {
  292. let obj = this;
  293. if(obj.name == ''){
  294. this.$api.msg('请填写您的姓名!');
  295. return;
  296. }
  297. if(obj.age == ''){
  298. this.$api.msg('请填写您的年龄!');
  299. return;
  300. }
  301. if(obj.sex == ''){
  302. this.$api.msg('请填写您的性别!');
  303. return;
  304. }
  305. if(obj.checked == ''){
  306. this.$api.msg('请填写您的政治面貌!');
  307. return;
  308. }
  309. if(obj.birthday == '' || obj.birthday == '请选择出生日期'){
  310. this.$api.msg('请选择出生日期!');
  311. return;
  312. }
  313. if(obj.card == ''){
  314. this.$api.msg('请填写您的身份证号!');
  315. return;
  316. }
  317. if(obj.address == ''){
  318. this.$api.msg('请选择省市区!');
  319. return;
  320. }
  321. if(obj.addr == ''){
  322. this.$api.msg('请填写您的详细地址!');
  323. return;
  324. }
  325. if(obj.phone == ''){
  326. this.$api.msg('请填写您的联系电话!');
  327. return;
  328. }
  329. if(obj.work == ''){
  330. this.$api.msg('请填写您的工作单位!');
  331. return;
  332. }
  333. if(obj.checked1 == ''){
  334. this.$api.msg('请填写您的单位性质!');
  335. return;
  336. }
  337. let data = {};
  338. if(obj.id){
  339. data = {
  340. id:obj.id,
  341. name:obj.name,
  342. age:obj.age,
  343. sex:obj.sex,
  344. card:obj.card,
  345. phone:obj.phone,
  346. address:obj.address +','+ obj.addr,
  347. work:obj.work,
  348. politic:obj.checked,//政治面貌
  349. birthday:obj.birthday,
  350. properties:obj.checked1//单位性质
  351. }
  352. }else{
  353. data = {
  354. name:obj.name,
  355. age:obj.age,
  356. sex:obj.sex,
  357. card:obj.card,
  358. phone:obj.phone,
  359. address:obj.address +','+ obj.addr,
  360. work:obj.work,
  361. politic:obj.checked,//政治面貌
  362. birthday:obj.birthday,
  363. properties:obj.checked1//单位性质
  364. }
  365. }
  366. add_help(data).then(function(e) {
  367. obj.$api.msg(e.msg);
  368. let id = e.data.id;
  369. console.log(id)
  370. setTimeout(function(){
  371. uni.navigateTo({
  372. url:'/pages/applyHelp/second?id='+id
  373. })
  374. }, 1000);
  375. })
  376. .catch(e => {
  377. obj.$api.msg(e.message);
  378. });
  379. },
  380. navTo(url) {
  381. uni.navigateTo({
  382. url
  383. });
  384. }
  385. }
  386. };
  387. </script>
  388. <style lang="scss">
  389. page {
  390. background: $page-color-base;
  391. min-height: 100%;
  392. }
  393. .cantent{
  394. padding-bottom: 110rpx;
  395. }
  396. .tip{
  397. color: #DE2412;
  398. background-color: #FEE2E3;
  399. font-size: 24rpx;
  400. padding: 25rpx 35rpx;
  401. }
  402. .til-list{
  403. padding: 35rpx 50rpx;
  404. font-size: 28rpx;
  405. color: #666666;
  406. .red{
  407. color: #E62129 !important;
  408. }
  409. }
  410. .name{
  411. padding: 0rpx 35rpx;
  412. padding-bottom: 15rpx !important;
  413. font-size: 36rpx;
  414. font-weight:500;
  415. }
  416. .content_box {
  417. background-color: #ffffff;
  418. padding: 0rpx 25rpx;
  419. .list-name{
  420. padding-top: 25rpx;
  421. font-size: 35rpx;
  422. padding-left: 15rpx;
  423. padding-bottom: 10rpx;
  424. }
  425. .examine_list{
  426. width: 100%;
  427. .textarea-box{
  428. width: 100%;
  429. padding-bottom: 25rpx;
  430. padding-left: 25rpx;
  431. .textarea{
  432. width: 100%;
  433. font-size: 28rpx;
  434. min-height: 150rpx;
  435. }
  436. input{
  437. font-size: 28rpx;
  438. }
  439. }
  440. }
  441. }
  442. .radio-list{
  443. display: flex;
  444. flex-wrap: wrap;
  445. font-size: 28rpx;
  446. padding-top: 30rpx;
  447. .uni-label-pointer{
  448. padding-right: 25rpx;
  449. padding-bottom: 30rpx;
  450. }
  451. }
  452. .mar-b{
  453. margin-bottom: 120rpx;
  454. }
  455. .row {
  456. display: flex;
  457. align-items: center;
  458. // position: relative;
  459. padding: 0 30rpx;
  460. height: 110rpx;
  461. background: #fff;
  462. border-bottom: 1rpx solid #f8f6f6;
  463. .tit {
  464. flex-shrink: 0;
  465. width: 180rpx;
  466. font-size: 30rpx;
  467. color: $font-color-dark;
  468. }
  469. .value{
  470. width: 100%;
  471. text-align: right;
  472. }
  473. .input {
  474. flex: 1;
  475. font-size: 30rpx;
  476. color: $font-color-dark;
  477. text-align: right;
  478. }
  479. .iconlocation {
  480. font-size: 36rpx;
  481. color: $font-color-light;
  482. }
  483. }
  484. .examine_name {
  485. color: #171717;
  486. font-size: 28rpx;
  487. padding: 25rpx 25rpx;
  488. }
  489. .examine_img {
  490. width: 100%;
  491. text-align: center;
  492. .image{
  493. width: 150rpx;
  494. height: 150rpx;
  495. }
  496. .image1{
  497. min-width: 150rpx;
  498. max-width: 100%;
  499. min-height: 150rpx;
  500. }
  501. }
  502. .add-img-box {
  503. width: 100%;
  504. flex-direction: row;
  505. flex-wrap: wrap;
  506. margin-top: 50rpx;
  507. }
  508. .add-img-item {
  509. margin-bottom: 25rpx;
  510. width: 100%;
  511. .add-img {
  512. min-width: 150rpx;
  513. max-width: 100%;
  514. height: 400rpx;
  515. }
  516. }
  517. .add-img-del {
  518. position: absolute;
  519. width: 40rpx;
  520. height: 40rpx;
  521. right: 60rpx;
  522. // bottom: 155rpx;
  523. //background-color: rgba(238, 0, 0, 1);
  524. border-radius: 20rpx;
  525. }
  526. .default-row {
  527. margin-top: 16rpx;
  528. .tit {
  529. flex: 1;
  530. }
  531. switch {
  532. transform: translateX(16rpx) scale(0.9);
  533. }
  534. }
  535. .add-btn{
  536. position: fixed;
  537. bottom: 0rpx;
  538. left: 0rpx;
  539. width: 100%;
  540. height: 100rpx;
  541. font-size: 28rpx;
  542. color: #FFFFFF;
  543. background-color: #FF727E;
  544. line-height: 100rpx;
  545. text-align: center;
  546. }
  547. .img_box {
  548. padding: 35rpx 35rpx;
  549. width: 250rpx;
  550. height: 250rpx;
  551. }
  552. .img_box image {
  553. width: 100%;
  554. height: 100%;
  555. }
  556. .alert-box {
  557. background-color: #ffffff;
  558. }
  559. .b-b:after {
  560. position: relative !important;
  561. }
  562. .check_box {
  563. padding: 25rpx 25rpx;
  564. font-size: 20rpx;
  565. padding-bottom: 150rpx;
  566. text{
  567. color: #6786FB;
  568. }
  569. }
  570. .tit-tip {
  571. color: #ff727e;
  572. font-size: 36rpx;
  573. padding: 10rpx 0 10rpx 20rpx;
  574. }
  575. </style>