companyIdentity.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <template>
  2. <view class="center">
  3. <view v-if='!status' class="top">
  4. <text @click='consent' v-bind:class="switchs1">公司</text>
  5. <text @click='consent' v-bind:class="switchs2">个人</text>
  6. </view>
  7. <view class="content">
  8. <view v-if="consentStatus == true">
  9. <!-- 公司营业执照上传 -->
  10. <view v-if="license1 != ''">
  11. <upload :file-list='businesslicense' v-if="consentStatus == true" class="upload" ref="upload" :action="action"
  12. :max-size="maxSize" delIconSize='30' delBgColor='rgba(0,0,0,0.4)' delIcon="trash" :max-count="1" :size-type="['compressed']" @on-success="getImgUrl"
  13. @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  14. :options="uploadOptions" :custom="uploadCustom"></upload>
  15. </view>
  16. <view class="person-info">
  17. <view class="c-row b-b">
  18. <text class="tit_red">*</text>
  19. <text class="tit">公司名称</text>
  20. <view class="con-list">
  21. <input placeholder="请填写公司名称" name="input"
  22. v-model="identityAuthenticationInfo.compName"></input>
  23. </view>
  24. </view>
  25. <view class="c-row">
  26. <text class="tit">纳税人识别号</text>
  27. <view class="con-list">
  28. <input type='number' placeholder="请填写纳税人识别号" name="input"
  29. v-model="identityAuthenticationInfo.payTaxesCard"></input>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view v-else>
  35. <view>
  36. <!-- <image src="../../static/img/authentication/business.png" mode=""></image> -->
  37. <!-- 个人身份证正面 -->
  38. <upload class="upload" ref="upload1" :action="action" :max-size="maxSize" :max-count="1"
  39. :size-type="['compressed']" @on-success="getImgUrl1" @on-remove="onRemove"
  40. delIconSize='30' delBgColor='rgba(0,0,0,0.4)' delIcon="trash"
  41. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
  42. :custom="uploadCustom1"></upload>
  43. <!-- 个人身份证反面 -->
  44. <upload class="upload" ref="upload2" :action="action" :max-size="maxSize" :max-count="1"
  45. delIconSize='30' delBgColor='rgba(0,0,0,0.4)' delIcon="trash"
  46. :size-type="['compressed']" @on-success="getImgUrl2" @on-remove="onRemove"
  47. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions2"
  48. :custom="uploadCustom2"></upload>
  49. </view>
  50. <view class="person-info">
  51. <view class="c-row b-b">
  52. <text class="tit_red">*</text>
  53. <text class="tit">姓名</text>
  54. <view class="con-list">
  55. <input placeholder="请填写姓名" name="input"
  56. v-model="identityAuthenticationInfo.customerName"></input>
  57. </view>
  58. </view>
  59. <view class="c-row b-b">
  60. <text class="tit_red">*</text>
  61. <text class="tit">身份证号</text>
  62. <view class="con-list">
  63. <input placeholder="请填写身份证号" name="input" maxlength="18"
  64. v-model="identityAuthenticationInfo.customerNumberCard"></input>
  65. </view>
  66. </view>
  67. <view class="c-row">
  68. <text class="tit_red">*</text>
  69. <text class="tit">联系地址</text>
  70. <view class="con-list">
  71. <input placeholder="请填写联系地址" name="input"
  72. v-model="identityAuthenticationInfo.compAddress"></input>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <button class="btns btn" @click="jumpUrl">下一步</button>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import upload from '@/components/upload.vue';
  83. import {
  84. mapState
  85. } from 'vuex';
  86. export default {
  87. components: {
  88. upload
  89. },
  90. name: "buy",
  91. data() {
  92. return {
  93. isShowPerson:false,
  94. action: this.$uploadUrl,
  95. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  96. btnLoading: false, //防止重复点击
  97. isAdd: true,
  98. uploadCustom: true,
  99. uploadCustom1: true,
  100. uploadCustom2: true,
  101. businesslicense:[],
  102. uploadOptions: {
  103. "text": "上传营业执照",
  104. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/admin/0dd1401f54e34affaa11c711d808a0a0.png"
  105. },
  106. uploadOptions1: {
  107. "text": "上传身份证头像页",
  108. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identityup%282%29.png"
  109. },
  110. uploadOptions2: {
  111. "text": "上传身份证国徽页",
  112. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identitylow%282%29.png"
  113. },
  114. tupian: "",
  115. inputContent: null,
  116. customerPhone: '',
  117. consentStatus: true,
  118. consentStatus1: false,
  119. codestatus: false,
  120. verifyCode: null,
  121. inputStatus: 'none',
  122. sendText: '获取验证码',
  123. platform: '',
  124. sendDisabled: false,
  125. license1: "../../static/img/authentication/business@3x.png",
  126. switchs1: "switchs1",
  127. switchs2: "switchs2",
  128. id: [],
  129. id1: "../../static/img/authentication/identityup(3).png",
  130. id2: "../../static/img/authentication/identitylow(3).png",
  131. identityImgs1: {},
  132. status:false,
  133. identityAuthenticationInfo: {},
  134. tempFilePaths: [],
  135. businessLicenseAddressUrl: "",
  136. certificates: true,
  137. isEdit:false,
  138. invitation:"",
  139. inviteCompany:"",
  140. };
  141. },
  142. computed: {
  143. ...mapState(['hasLogin', 'userInfo'])
  144. },
  145. onLoad(options) {
  146. // this.isEdit = options.isEdit;
  147. this.invitation = options.ids //通过二维码进来的认证粮商,认证后无需审核通过,就直接通过邀请
  148. this.inviteCompany = options.compId
  149. if(options.status){
  150. this.status=true
  151. this.consentStatus = false
  152. this.consentStatus1 = true
  153. this.switchs1 = "switchs2"
  154. this.switchs2 = "switchs1"
  155. }
  156. if(options.id){
  157. this.$api.doRequest('get', '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo', {id:options.id},
  158. 'application/json;charset=UTF-8').then(res => {
  159. console.log("成功连接")
  160. this.identityAuthenticationInfo = res.data.data
  161. if (this.identityAuthenticationInfo.businessLicenseAddressUrl != "") {
  162. this.businesslicense=[{url:this.identityAuthenticationInfo.businessLicenseAddressUrl}]
  163. }
  164. console.log(this.businesslicense)
  165. // if (this.deptList.cardAddressUrl != "") {
  166. // this.id = this.deptList.cardAddressUrl.split(",")
  167. // this.idup = this.id[0]
  168. // this.idlow = this.id[1]
  169. // }
  170. // if (this.deptList.payeeAddressUrl != "") {
  171. // this.payeeAddress = this.deptList.payeeAddressUrl.split(","),
  172. // this.bank1 = this.payeeAddress[0]
  173. // this.bank2 = this.payeeAddress[1]
  174. // }
  175. // console.log(this.deptList.customerTypeFlag, "判断")
  176. if (this.identityAuthenticationInfo.customerTypeFlag == 2) {
  177. this.consentStatus = true
  178. this.consentStatus1 = true
  179. this.switchs1 = "switchs1"
  180. this.switchs2 = "switchs2"
  181. } else {
  182. this.consentStatus = false
  183. this.consentStatus1 = true
  184. this.switchs1 = "switchs2"
  185. this.switchs2 = "switchs1"
  186. }
  187. })
  188. .catch(res => {
  189. if (res.errmsg) {
  190. uni.showToast({
  191. title: res.errmsg,
  192. icon: 'none',
  193. duration: 2000
  194. })
  195. } else {
  196. uni.showToast({
  197. title: "系统异常,请联系管理员",
  198. icon: 'none',
  199. duration: 2000
  200. })
  201. }
  202. });
  203. }
  204. },
  205. onShow(){
  206. },
  207. methods: {
  208. filterFileType(index, lists) {
  209. if (lists[index].fileType != 'jpeg' &&lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  210. lists.splice(index, 1);
  211. // 当前文件不支持
  212. uni.showModal({
  213. title: '暂不支持当前图片类型',
  214. showCancel: false
  215. });
  216. } else {
  217. this.isAdd = false;
  218. }
  219. },
  220. // 营业执照上传
  221. getImgUrl(res) {
  222. console.log(res)
  223. console.log('------------res-----------')
  224. this.identityAuthenticationInfo.businessLicenseAddressUrl = res.data.appendixPath
  225. },
  226. // 身份证正面
  227. getImgUrl1(res) {
  228. console.log(res)
  229. let that = this
  230. that.id[0] = res.data.appendixPath
  231. that.id1 = res.data.appendixPath
  232. that.identityImgs1.personImg = res.data.appendixPath
  233. that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  234. .identityImgs1).then(res => {
  235. if (res.data.data.recPerson != null) {
  236. if (res.data.data.recPerson != "") {
  237. that.$set(that.identityAuthenticationInfo,
  238. 'customerName', res.data.data.recPerson)
  239. }
  240. }
  241. if (res.data.data.recPersonNo != null) {
  242. if (res.data.data.recPersonNo != "") {
  243. that.$set(that.identityAuthenticationInfo,
  244. 'customerNumberCard', res.data.data
  245. .recPersonNo)
  246. }
  247. }
  248. if (res.data.data.recPersonAddr != null) {
  249. if (res.data.data.recPersonAddr != "") {
  250. that.$set(that.identityAuthenticationInfo, 'compAddress', res.data.data
  251. .recPersonAddr)
  252. }
  253. }
  254. }).catch(res => {
  255. uni.showToast({
  256. title: res.data.message,
  257. icon: 'none',
  258. duration: 2000
  259. })
  260. })
  261. },
  262. // 身份证反面
  263. getImgUrl2(res) {
  264. console.log(res)
  265. let that = this
  266. that.id[1] = res.data.appendixPath
  267. that.id2 = res.data.appendixPath
  268. that.identityImgs1.personImg = res.data.appendixPath
  269. // that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  270. // .identityImgs1).then(res => {
  271. // if (res.data.data.recPerson != null) {
  272. // if (res.data.data.recPerson != "") {
  273. // that.$set(that.identityAuthenticationInfo,
  274. // 'customerName', res.data.data.recPerson)
  275. // }
  276. // }
  277. // if (res.data.data.recPersonNo != null) {
  278. // if (res.data.data.recPersonNo != "") {
  279. // that.$set(that.identityAuthenticationInfo,
  280. // 'customerNumberCard', res.data.data
  281. // .recPersonNo)
  282. // }
  283. // }
  284. // if (res.data.data.recPersonAddr != null) {
  285. // if (res.data.data.recPersonAddr != "") {
  286. // that.$set(that.identityAuthenticationInfo, 'compAddress', res.data.data
  287. // .recPersonAddr)
  288. // }
  289. // }
  290. // }).catch(res => {
  291. // uni.showToast({
  292. // title: res.data.message,
  293. // icon: 'none',
  294. // duration: 2000
  295. // })
  296. // })
  297. },
  298. onError(error) {
  299. alert(error)
  300. console.log('------------error-----------')
  301. console.log(error)
  302. },
  303. onProgress(e) {
  304. console.log(e)
  305. },
  306. onRemove(index) {},
  307. jumpUrl() {
  308. if (this.consentStatus) {
  309. if (!this.identityAuthenticationInfo.compName) {
  310. this.$api.msg('公司名称不能为空')
  311. return
  312. }
  313. if (this.identityAuthenticationInfo.compName.length < 2 || this.identityAuthenticationInfo.compName
  314. .length > 25) {
  315. this.$api.msg('公司名称输入错误')
  316. return
  317. }
  318. // if (!this.identityAuthenticationInfo.payTaxesCard) {
  319. // this.$api.msg('纳税人识别号不能为空')
  320. // return
  321. // }
  322. // if (this.identityAuthenticationInfo.payTaxesCard.length < 15 || this.identityAuthenticationInfo
  323. // .payTaxesCard.length > 20) {
  324. // this.$api.msg('纳税人识别号输入错误')
  325. // return
  326. // }
  327. // if (this.identityAuthenticationInfo.businessLicenseAddressUrl == "" || this.identityAuthenticationInfo
  328. // .businessLicenseAddressUrl == null) {
  329. // this.$api.msg('请上传营业执照')
  330. // return
  331. // }
  332. this.identityAuthenticationInfo.customerTypeFlag = "2"
  333. this.identityAuthenticationInfo.customerType = "企业"
  334. this.identityAuthenticationInfo.invitation = this.invitation
  335. this.identityAuthenticationInfo.inviteCompany = this.inviteCompany
  336. var model = JSON.stringify(this.identityAuthenticationInfo);
  337. uni.navigateTo({
  338. url: `/pageD/identity/companyIdentityTwo?identityAuthenticationInfo=` + model,
  339. })
  340. } else if (this.consentStatus1) {
  341. this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
  342. if (this.id[0] == '' || this.id[0] == null) {
  343. this.$api.msg('请上传身份证正面')
  344. return
  345. }
  346. // if (this.id[1] == '' || this.id[1] == null) {
  347. // this.$api.msg('请上传身份证反面')
  348. // return
  349. // }
  350. if (!this.identityAuthenticationInfo.customerName) {
  351. this.$api.msg('姓名不能为空')
  352. return
  353. }
  354. if (this.identityAuthenticationInfo.customerName.length < 2 || this.identityAuthenticationInfo
  355. .customerName.length > 10) {
  356. this.$api.msg('姓名输入错误')
  357. return
  358. }
  359. if (!this.identityAuthenticationInfo.customerNumberCard) {
  360. this.$api.msg('身份证号不能为空')
  361. return
  362. }
  363. if (this.identityAuthenticationInfo.customerNumberCard.length != 18) {
  364. this.$api.msg('身份证号输入错误')
  365. return
  366. }
  367. this.identityAuthenticationInfo.customerTypeFlag = "1"
  368. this.identityAuthenticationInfo.customerType = "个人"
  369. this.identityAuthenticationInfo.invitation = this.invitation
  370. this.identityAuthenticationInfo.inviteCompany = this.inviteCompany
  371. var model = JSON.stringify(this.identityAuthenticationInfo);
  372. uni.navigateTo({
  373. url: `/pageD/identity/companyIdentityThree?identityAuthenticationInfo=` + model,
  374. })
  375. }
  376. },
  377. consent() {
  378. if (this.consentStatus == false && this.consentStatus1 == true) {
  379. this.consentStatus = true
  380. this.consentStatus1 = false
  381. this.switchs1 = "switchs1"
  382. this.switchs2 = "switchs2"
  383. } else if (this.consentStatus == true && this.consentStatus1 == false) {
  384. this.consentStatus = false
  385. this.consentStatus1 = true
  386. this.switchs1 = "switchs2"
  387. this.switchs2 = "switchs1"
  388. }
  389. },
  390. phoneinput(e) {
  391. if (e.detail.value.length == 11) {
  392. this.codestatus = true
  393. }
  394. },
  395. verifyCodeInput(e) {
  396. this.verifyCode = e.detail.value
  397. },
  398. cancel() {
  399. this.inputShow = false
  400. this.inputStatus = 'none'
  401. this.isPhone = false
  402. },
  403. },
  404. }
  405. </script>
  406. <style>
  407. .center {
  408. /* padding: 10px 20px; */
  409. }
  410. .top {
  411. background: white;
  412. padding: 10px 20px;
  413. border-radius: 0 0 20rpx 20rpx;
  414. }
  415. .content {
  416. padding: 10px 20px;
  417. }
  418. .c-row {
  419. display: -webkit-box;
  420. display: -webkit-flex;
  421. display: flex;
  422. -webkit-box-align: center;
  423. -webkit-align-items: center;
  424. align-items: center;
  425. padding: 20rpx 30rpx;
  426. position: relative;
  427. }
  428. .con-list {
  429. -webkit-box-flex: 1;
  430. -webkit-flex: 1;
  431. flex: 1;
  432. display: -webkit-box;
  433. display: -webkit-flex;
  434. display: flex;
  435. -webkit-box-orient: vertical;
  436. -webkit-box-direction: normal;
  437. -webkit-flex-direction: column;
  438. flex-direction: column;
  439. color: #303133;
  440. line-height: 40rpx;
  441. text-align: right;
  442. padding-right: 20rpx;
  443. font-size: 14px;
  444. }
  445. .uni-navigator {
  446. display: inline-block;
  447. color: #22C572;
  448. }
  449. .getcode.active {
  450. background: #22C572;
  451. color: #fff;
  452. }
  453. .btn {
  454. margin-top: 10px;
  455. background-color: #FFFFFF;
  456. border-radius: 25px;
  457. border: none;
  458. }
  459. .btns {
  460. background-color: #22C572;
  461. color: white;
  462. }
  463. .switchs1 {
  464. font-size: 20px;
  465. font-weight: 700;
  466. margin-right: 16px;
  467. position: relative;
  468. }
  469. .switchs1::after,
  470. .switchs2::after {
  471. background: #22C572;
  472. width: 20px;
  473. height: 4px;
  474. content: ' ';
  475. position: absolute;
  476. bottom: -20rpx;
  477. left: 0;
  478. right: 0;
  479. margin: auto;
  480. }
  481. .switchs2 {
  482. font-size: 20px;
  483. margin-right: 16px;
  484. }
  485. .picture {
  486. width: 100%;
  487. height: 220px;
  488. text-align: center;
  489. margin-top: 10px;
  490. }
  491. .words {
  492. font-size: 18px;
  493. font-weight: 600;
  494. color: #617E8B;
  495. }
  496. .floats {
  497. position: relative;
  498. top: -150px;
  499. text-align: center;
  500. }
  501. .upload {
  502. margin: 20rpx 0;
  503. }
  504. .tit_red {
  505. color: #E54D42;
  506. }
  507. .person-info{
  508. background: white;
  509. padding: 20rpx;
  510. border-radius: 20rpx;
  511. margin-bottom: 50rpx;
  512. }
  513. </style>