certification.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view>
  3. <view class="form">
  4. <view class="card">
  5. <u-form :model="model" labelWidth="200" ref="uForm" >
  6. <u-form-item label="所在地址" >
  7. <u-input type="text" v-model="model.address" placeholder="请填写所在地址" ></u-input>
  8. </u-form-item>
  9. <u-form-item :required="true" label="身份证号" >
  10. <u-input type="idcard" v-model="model.idCard" placeholder="请填写身份证号" ></u-input>
  11. </u-form-item>
  12. <u-form-item :required="true" label="所属党支部" >
  13. <u-input type="select" :select-open="branchShow" v-model="branchLabel" placeholder="请选择所属党支部" @click="branchShow=true"></u-input>
  14. </u-form-item>
  15. <u-form-item :required="true" label="入党时间" >
  16. <u-input type="select" :select-open="enterTimeShow" v-model="model.enterTime" placeholder="请选择入党时间" @click="enterTimeShow=true"></u-input>
  17. </u-form-item>
  18. <u-form-item class="" :required="true" label="请上传党员证件图像" label-position="top">
  19. </u-form-item>
  20. <view class="upload-img">
  21. <view class="" @click="chooseImage">
  22. <upload-img
  23. :width="width"
  24. :height="height"
  25. :currentImage="model.memberPic"
  26. bgsrc="http://139.9.103.171:1888/miniofile/xlyq/upload.png"
  27. >
  28. </upload-img>
  29. <view class="text-center padding-top-20 base-color" >
  30. <text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
  31. <text v-if="$isEmpty(model.memberPic)">点击上传党员证件图像</text>
  32. <text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
  33. </view>
  34. </view>
  35. </view>
  36. </u-form>
  37. </view>
  38. </view>
  39. <view >
  40. <view class="bg-white" style="height: 80rpx;"></view>
  41. <view class="" @click="submit" style="width: 90%;margin: 0 auto ;margin-bottom: 10%;">
  42. <view class="cu-btn round base-bg-color" style="padding: 40rpx;width: 100%;" >
  43. <text class="cuIcon-add"></text>
  44. <text >确认提交</text>
  45. </view>
  46. </view>
  47. </view>
  48. <u-select @confirm="branchConfirm" v-model="branchShow" :list="branchList"></u-select>
  49. <u-picker v-model="enterTimeShow" mode="time" :params="params" @confirm="enterTimeConfirm"></u-picker>
  50. </view>
  51. </template>
  52. <script>
  53. import uploadImg from '@/components/uploadimg/uploadImg.vue'
  54. export default {
  55. components:{
  56. uploadImg
  57. },
  58. data() {
  59. return {
  60. width:480,
  61. height:320,
  62. model:{
  63. personId:'',
  64. personType:'2',
  65. address:'',
  66. memberPic:'',
  67. idCard:'',
  68. enterTime:''
  69. },
  70. //党支部
  71. branchShow:false,
  72. branchLabel:'',
  73. branchList:[],
  74. //入党时间
  75. enterTimeShow:false,
  76. params: {
  77. year: true,
  78. month: true,
  79. day: true,
  80. hour: false,
  81. minute: false,
  82. second: false
  83. },
  84. }
  85. },
  86. onLoad() {
  87. this.model.personId=this.$cache.get('userId')
  88. if (this.$isEmpty(this.model.personId)) {
  89. this.$dialog.showModal('系统异常',false).then(res=>{
  90. this.$navigateBack()
  91. })
  92. }
  93. this.fetchBranchList()
  94. },
  95. methods: {
  96. //加载党支部列表
  97. fetchBranchList(){
  98. this.branchList=[]
  99. this.$api.party.page().then(res=>{
  100. res.data.forEach(item=>{
  101. let obj={
  102. label:item.branchName,
  103. value:item.id
  104. }
  105. this.branchList.push(obj)
  106. })
  107. })
  108. },
  109. //党支部
  110. branchConfirm(e){
  111. this.model.branchId=e[0].value
  112. this.branchLabel=e[0].label
  113. },
  114. //入党时间
  115. enterTimeConfirm(e){
  116. this.model.enterTime=e.year+'-'+e.month+'-'+e.day
  117. },
  118. //党员证件照
  119. chooseImage() {
  120. let that=this
  121. that.$mpi.chooseImage().then(res=>{
  122. that.$api.uploadFile.submit(res[0]).then(res=>{
  123. that.model.memberPic=res.data.link
  124. })
  125. })
  126. },
  127. //提交
  128. submit(){
  129. if (this.$isEmpty(this.model.idCard)) {
  130. this.$u.toast('请填写身份证号')
  131. return
  132. }
  133. if (!this.$verify.isIdCard(this.model.idCard)) {
  134. this.$u.toast('请填写正确的身份证号')
  135. return
  136. }
  137. if (this.$isEmpty(this.model.branchId)) {
  138. this.$u.toast('请选择所属党支部')
  139. return
  140. }
  141. if (this.$isEmpty(this.model.enterTime)) {
  142. this.$u.toast('请选择入党时间')
  143. return
  144. }
  145. if (this.$isEmpty(this.model.memberPic)) {
  146. this.$u.toast('请上传党员证件')
  147. return
  148. }
  149. this.$api.party.apply(this.model).then(res=>{
  150. if (res.success==true) {
  151. this.$dialog.showModal('操作成功,请耐心等待管理员审核',false).then(res=>{
  152. this.$navigateBack()
  153. })
  154. }else{
  155. this.$dialog.showModal(res.msg,false)
  156. }
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss">
  163. page{
  164. background-color: #FFFFFF;
  165. }
  166. .form{
  167. padding: 40rpx 30rpx;
  168. .tag{
  169. width: 35rpx;
  170. height: 35rpx;
  171. display: block;
  172. padding-top: 6rpx;
  173. padding-right: 10rpx;
  174. }
  175. .card{
  176. margin-top: 20rpx;
  177. padding: 0 30rpx;
  178. box-sizing: border-box;
  179. border-radius: 12rpx;
  180. box-shadow: 0 -10rpx rgba(248, 248, 248,.9) ,0 10rpx rgba(248, 248, 248,.9) , -10rpx 0rpx rgba(248, 248, 248,.9) ,10rpx 0rpx rgba(248, 248, 248,.9);
  181. .item{
  182. padding:30rpx 0;
  183. display: flex;
  184. justify-content: space-between;
  185. }
  186. .upload-img{
  187. padding:50rpx 0 30rpx;
  188. display: flex;
  189. justify-content: center;
  190. align-items: center;
  191. }
  192. }
  193. }
  194. </style>