addqy.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="rzbox">
  3. <uni-forms ref="form" :model="user">
  4. <view class="f15 co23 fw5">请添加申请人相关企业 <text>(可添加多个)</text></view>
  5. <view v-for="(ite,idx) in qylist" :key="idx" class="mt24">
  6. <view class="flexcc mb20">
  7. <view class="carbox">
  8. <image :src="cardq" class="img"></image>
  9. <view class="tit">营业执照</view>
  10. </view>
  11. </view>
  12. <view class="mb28">
  13. <view class="cardtip">企业信息会跟进上传的营业执照图片自动识别,支持手动输入。</view>
  14. <view class="cardtip">如果识别错误,可尝试再次拍照</view>
  15. </view>
  16. <view @click="getDel(idx)" v-if="idx!=0" style="color: red;">删除</view>
  17. <!-- 身份信息 -->
  18. <uni-forms-item label="统一社会信用代码" name="nickName">
  19. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  20. </uni-forms-item>
  21. <uni-forms-item label="企业名称" name="phonenumber">
  22. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  23. </uni-forms-item>
  24. <block v-if="zheList[idx].zheflag">
  25. <uni-forms-item label="企业类型" name="email">
  26. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  27. </uni-forms-item>
  28. <uni-forms-item label="企业地址" name="email">
  29. <uni-easyinput type="textarea" :autoHeight="true" v-model="user.email" :inputBorder='false'
  30. placeholder="自动识别" />
  31. </uni-forms-item>
  32. <uni-forms-item label="法人姓名" name="nickName">
  33. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  34. </uni-forms-item>
  35. <uni-forms-item label="注册资金" name="phonenumber">
  36. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  37. </uni-forms-item>
  38. <uni-forms-item label="成立日期" name="email">
  39. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  40. </uni-forms-item>
  41. <uni-forms-item label="营业期限" name="email">
  42. <uni-easyinput v-model="user.email" :inputBorder='false' placeholder="自动识别" />
  43. </uni-forms-item>
  44. <uni-forms-item label="经营范围" name="email">
  45. <uni-easyinput type="textarea" :autoHeight="true" v-model="user.email" :inputBorder='false'
  46. placeholder="自动识别" />
  47. </uni-forms-item>
  48. </block>
  49. <view class="upbox" :class="zheList[idx].zheflag?'':'act'" @click="getZheFn(idx)">
  50. <image :src="upimg"></image>
  51. <view>{{zheList[idx].zheflag?'折叠企业信息':'展开企业信息'}}</view>
  52. </view>
  53. </view>
  54. </uni-forms>
  55. <view class="rzbfot">
  56. <view class="rzbtns bgb" @click="getAddQyFn">
  57. <image :src="addqy"></image>添加企业
  58. </view>
  59. <view class="rzbtns bga" @click="getNext">提交</view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import config from '@/config'
  65. const baseUrl = config.baseUrl
  66. import {uploadmore} from '@/utils/common.js'
  67. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  68. export default {
  69. components: {},
  70. data() {
  71. return {
  72. cardq: require('@/work/static/images/prove/cardq.png'),
  73. addqy: require('@/work/static/images/prove/addqy.png'),
  74. upimg: require('@/work/static/images/up.png'),
  75. user: {
  76. },
  77. zheList:[{zheflag:true}],
  78. qylist: [{
  79. "schoolId": "",
  80. "schoolName": "",
  81. "classId": "",
  82. "className": "",
  83. "studentName": "",
  84. "studentNumber": ""
  85. }],
  86. }
  87. },
  88. methods: {
  89. checkPermi,
  90. checkRole,
  91. getNext() {
  92. this.$tab.navigateTo("/work/pages/prove/zctype")
  93. },
  94. getZheFn(idx){
  95. this.zheList[idx].zheflag=!this.zheList[idx].zheflag
  96. },
  97. getAddQyFn(){
  98. var obj = {
  99. "schoolId": "",
  100. "schoolName": "",
  101. "classId": "",
  102. "className": "",
  103. "studentName": "",
  104. "studentNumber": ""
  105. }
  106. this.qylist.push(obj);
  107. var zheobj={zheflag:true}
  108. this.zheList.push(zheobj);
  109. },
  110. getDel(idx) {
  111. var that = this;
  112. uni.showModal({
  113. title: '确认删除',
  114. content: "是否确认删除",
  115. cancelText: '取消删除',
  116. confirmText: '确认删除',
  117. success: function(res) {
  118. if (res.confirm) {
  119. that.qylist.splice(idx, 1)
  120. that.zheList.splice(idx, 1)
  121. } else if (res.cancel) {
  122. }
  123. }
  124. });
  125. },
  126. getaddImage(e){
  127. let that = this;
  128. let file =[],count=9
  129. // if(e=='zj'){
  130. // file = that.zjfile;
  131. // count=9
  132. // }else{
  133. // file = that.mjfile;
  134. // count=9
  135. // }
  136. uni.chooseImage({
  137. count: 1,
  138. success:function(res){
  139. let img= res.tempFilePaths;
  140. if(img.length + file.length > count){
  141. uni.showToast({
  142. title: '最多上传'+count+'张图片',
  143. icon: 'none',
  144. duration: 2000
  145. })
  146. }else{
  147. let imglen = res.tempFilePaths.length;
  148. var fuwufile = [];
  149. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  150. if(e=='zj'){
  151. that.zjfile = that.zjfile.concat(rs);
  152. that.datainfo.identificationPhoto=that.zjfile.join(',')
  153. }
  154. })
  155. }
  156. }
  157. });
  158. },
  159. getSubmit() {
  160. var that = this;
  161. this.$refs.form.validate().then(res => {
  162. var params = JSON.parse(JSON.stringify(this.datainfob))
  163. var list=this.classlist;
  164. var newArr = []
  165. var a=0;
  166. Object.keys(list).some((key) => {
  167. if(!list[key].studentName){
  168. a=1;
  169. this.$toast("请输入学生姓名" )
  170. return
  171. }else if(!list[key].studentNumber){
  172. a=1;
  173. this.$toast("请输入学生身份证号" )
  174. return
  175. }else if (list[key].schoolName && list[key].className) {
  176. let _IDRe18 =
  177. /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
  178. let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/
  179. // 校验身份证:
  180. if (_IDRe18.test(list[key].studentNumber) || _IDre15.test(list[key].studentNumber)) {
  181. newArr.push(list[key])
  182. }else{
  183. a=1;
  184. this.$toast('请输入学生'+ list[key].studentName + "正确身份证号")
  185. return
  186. }
  187. } else if (list[key].schoolName && !list[key].className) {
  188. a=1;
  189. this.$toast("请选择" + list[key].schoolName + "的班级")
  190. return
  191. } else if(!list[key].schoolName){
  192. a=1;
  193. this.$toast("请选择学校")
  194. return
  195. }
  196. })
  197. if(a==1){
  198. return
  199. }
  200. params.registerParentsStudentList = JSON.parse(JSON.stringify(newArr))
  201. this.$emit('getparentsregFn',params)
  202. // this.$tab.navigateTo(`/mine/pages/mine/success`)
  203. })
  204. },
  205. }
  206. }
  207. </script>
  208. <style lang="scss" scoped>
  209. page{
  210. background:#ffffff;
  211. }
  212. .rzbox /deep/ .uni-forms-item{min-height: 116rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:22rpx 0;}
  213. .rzbox /deep/ .uni-forms-item__label{font-weight: bold;font-size: 30rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  214. .rzbox /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 30rpx;color: #222327;}
  215. .rzbox /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 30rpx;}
  216. .rzbox /deep/ .uni-easyinput__placeholder-class{font-size: 30rpx;color: #AAAAAA;}
  217. .rzbox /deep/ .uni-input-input{font-size: 30rpx;}
  218. .rzbox /deep/ .uni-textarea-textarea{font-size: 30rpx;}
  219. .rzbox{padding: 44rpx 34rpx 324rpx;
  220. .carbox{width: 320rpx;border-radius: 14rpx;overflow: hidden;
  221. .img{width: 320rpx;height: 216rpx;}
  222. .tit{width: 100%;height: 60rpx;background: #A0C6D5;text-align: center;font-weight: 500;
  223. font-size: 26rpx;line-height: 60rpx;
  224. color: #FFFFFF;}
  225. }
  226. .cardtip{font-weight: 500;font-size: 24rpx;color: #999999;line-height: 40rpx;}
  227. .inttxet{font-weight: 500;font-size: 30rpx;flex: 1;text-align: right;color: #222327;}
  228. .formtip{font-weight: 500;font-size: 24rpx;color: #FF6969;margin-top: 40rpx;text-align: right;}
  229. .upbox{display: flex;flex-direction: column;align-items: center;padding: 32rpx 0 28rpx;
  230. image{width: 30rpx;height: 26rpx;margin-bottom: 18rpx;transition: all 0.3s;}
  231. view{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  232. &.act{
  233. image{transform: rotate(180deg);}
  234. }
  235. }
  236. }
  237. .rzbfot{
  238. .rzbtns{width: 100%;border-radius:10rpx;height: 100rpx;display: flex;align-items: center;justify-content: center;font-weight: bold;font-size: 30rpx;
  239. &.bga{background: #00A9F0;color: #FFFFFF;}
  240. &.bgb{background:#EBF3FF;color: $com-cd3;margin-bottom: 28rpx;
  241. image{width: 30rpx;height: 30rpx;margin-right: 10rpx;}
  242. }
  243. }
  244. }
  245. </style>