companyIdentityEdit.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <template>
  2. <view class="center">
  3. <view>
  4. <text @click='consent' v-bind:class="switchs1">公司</text>
  5. <text @click='consent' v-bind:class="switchs2">个人</text>
  6. </view>
  7. <view v-if="consentStatus == true">
  8. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  9. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  10. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions"
  11. :custom="uploadCustom" @on-progress="onProgress"></upload>
  12. <view class="personalcss">
  13. <view class="c-row b-b">
  14. <text class="tit">公司名称</text>
  15. <view class="con-list">
  16. <input placeholder="请填写公司名称" name="input" v-model="deptList.compName"></input>
  17. </view>
  18. </view>
  19. <view class="c-row ">
  20. <text class="tit">纳税人识别号</text>
  21. <view class="con-list">
  22. <input type='number' placeholder="请填写纳税人识别号" name="input" v-model="deptList.payTaxesCard"></input>
  23. </view>
  24. </view>
  25. </view>
  26. <view>
  27. <view style="margin: 0 auto;" v-if="idup != ''" @click="idUp">
  28. <image v-bind:src="idup" class="picture"></image>
  29. </view>
  30. <view style="margin: 0 auto;" v-if="idlow != ''" @click="idLow">
  31. <image v-bind:src="idlow" class="picture"></image>
  32. </view>
  33. </view>
  34. <view class="personalcss">
  35. <view class="c-row b-b">
  36. <text class="tit">姓名</text>
  37. <view class="con-list">
  38. <input placeholder="请填写姓名" name="input" v-model="deptList.customerName"></input>
  39. </view>
  40. </view>
  41. <view class="c-row ">
  42. <text class="tit">身份证号</text>
  43. <view class="con-list">
  44. <input placeholder="请填写身份证号" maxlength="18" name="input" v-model="deptList.customerNumberCard"></input>
  45. </view>
  46. </view>
  47. </view>
  48. <view>
  49. <view style="margin: 0 auto;" v-if="bank1 != ''" @click="bankUp()">
  50. <image v-bind:src="bank1" class="picture"></image>
  51. </view>
  52. <view style="margin: 0 auto;" v-if="bank2 != ''" @click="bankLow()">
  53. <image v-bind:src="bank2" class="picture"></image>
  54. </view>
  55. </view>
  56. <view class="personalcss">
  57. <view class="c-row b-b">
  58. <text class="tit">银行卡号</text>
  59. <view class="con-list">
  60. <input type='number' placeholder="请填写银行卡号" name="input" v-model="deptList.bankCard"></input>
  61. </view>
  62. </view>
  63. <view class="c-row b-b">
  64. <text class="tit">开户行</text>
  65. <view class="con-list">
  66. <input placeholder="请填写开户行" name="input" v-model="deptList.bankDeposit"></input>
  67. </view>
  68. </view>
  69. <view class="c-row b-b">
  70. <text class="tit">开户支行</text>
  71. <view class="con-list">
  72. <input placeholder="请填写开户支行" name="input" v-model="deptList.bankDepositBranch"></input>
  73. </view>
  74. </view>
  75. <view class="c-row b-b">
  76. <text class="tit">手机号</text>
  77. <view class="con-list">
  78. <input type='number' placeholder="请填写手机号" @input='phoneinput' v-model="deptList.customerPhone"></input>
  79. </view>
  80. </view>
  81. <view class="c-row ">
  82. <text class="tit">公司地址</text>
  83. <view class="con-list">
  84. <input placeholder="请填写公司地址" name="input" v-model="deptList.compAddress"></input>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <view v-else>
  90. <view>
  91. <!-- 个人身份证正面 -->
  92. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  93. :size-type="['compressed']" @on-success="getImgUrl1" @on-error="onError" @on-remove="onRemove"
  94. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
  95. :custom="uploadCustom1" @on-progress="onProgress"></upload>
  96. <!-- 个人身份证反面 -->
  97. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  98. :size-type="['compressed']" @on-success="getImgUrl2" @on-error="onError" @on-remove="onRemove"
  99. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions2"
  100. :custom="uploadCustom2" @on-progress="onProgress"></upload>
  101. </view>
  102. <view class="personalcss">
  103. <view class="c-row b-b">
  104. <text class="tit">姓名</text>
  105. <view class="con-list">
  106. <input placeholder="请填写姓名" name="input" v-model="deptList.customerName"></input>
  107. </view>
  108. </view>
  109. <view class="c-row b-b">
  110. <text class="tit">身份证号</text>
  111. <view class="con-list">
  112. <input placeholder="请填写身份证号" name="input" maxlength="18" v-model="deptList.customerNumberCard"></input>
  113. </view>
  114. </view>
  115. </view>
  116. <view>
  117. <!-- 上传银行卡正面 -->
  118. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  119. :size-type="['compressed']" @on-success="getImgUrl3" @on-error="onError" @on-remove="onRemove"
  120. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions3"
  121. :custom="uploadCustom3" @on-progress="onProgress"></upload>
  122. <!-- 上传银行卡反面 -->
  123. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  124. :size-type="['compressed']" @on-success="getImgUrl4" @on-error="onError" @on-remove="onRemove"
  125. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions4"
  126. :custom="uploadCustom4" @on-progress="onProgress"></upload>
  127. </view>
  128. <view class="personalcss">
  129. <view class="c-row b-b">
  130. <text class="tit">银行卡号</text>
  131. <view class="con-list">
  132. <input type='number' placeholder="请填写银行卡号" name="input" v-model="deptList.bankCard"></input>
  133. </view>
  134. </view>
  135. <view class="c-row b-b">
  136. <text class="tit">开户行</text>
  137. <view class="con-list">
  138. <input placeholder="请填写开户行" name="input" v-model="deptList.bankDeposit"></input>
  139. </view>
  140. </view>
  141. <view class="c-row">
  142. <text class="tit">供应商电话</text>
  143. <view class="con-list">
  144. <input type='number' placeholder="请填写供应商电话" name="input" v-model="deptList.supplierPhone"></input>
  145. </view>
  146. </view>
  147. <view class="c-row b-b">
  148. <text class="tit">手机号</text>
  149. <view class="con-list">
  150. <input type='number' placeholder="请填写手机号" @input='phoneinput' v-model="deptList.customerPhone"></input>
  151. </view>
  152. </view>
  153. <view class="c-row b-b">
  154. <text class="tit">联系地址</text>
  155. <view class="con-list">
  156. <input placeholder="请填写联系地址" name="input" v-model="deptList.compAddress"></input>
  157. </view>
  158. </view>
  159. <view class="c-row b-b">
  160. <text class="tit">开户支行</text>
  161. <view class="con-list">
  162. <input placeholder="请填写开户支行" name="input" v-model="deptList.bankDepositBranch"></input>
  163. </view>
  164. </view>
  165. <view class="c-row b-b">
  166. <text class="tit">供应商姓名</text>
  167. <view class="con-list">
  168. <input placeholder="请填写供应商姓名" name="input" v-model="deptList.supplier"></input>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. <button class="btn btns" @click="commitEdit">修改</button>
  174. </view>
  175. </template>
  176. <script>
  177. import upload from '@/components/upload.vue';
  178. import {
  179. mapState
  180. } from 'vuex';
  181. export default {
  182. name: "buy",
  183. data() {
  184. return {
  185. radios: 2,
  186. action: this.$uploadUrl,
  187. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  188. btnLoading: false, //防止重复点击
  189. isAdd: true,
  190. imgUrls: [],
  191. uploadCustom: true,
  192. uploadCustom1: true,
  193. uploadCustom2: true,
  194. uploadCustom3: true,
  195. uploadCustom4: true,
  196. uploadOptions: {
  197. "text": "上传营业执照",
  198. "bgc": ""
  199. },
  200. uploadOptions1: {
  201. "text": "上传身份证头像页",
  202. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identityup%282%29.png"
  203. },
  204. uploadOptions2: {
  205. "text": "上传身份证国徽页",
  206. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identitylow%282%29.png"
  207. },
  208. uploadOptions3: {
  209. "text": "上传银行卡正面",
  210. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/bankup%282%29.png"
  211. },
  212. uploadOptions4: {
  213. "text": "上传银行卡反面",
  214. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/banklow%282%29.png"
  215. },
  216. deptList: {
  217. compName: "",
  218. payTaxesCard: "",
  219. },
  220. consentStatus: true,
  221. consentStatus1: false,
  222. parameter: {},
  223. businessman: {},
  224. id: [],
  225. idup: "",
  226. idlow: "",
  227. license1: "",
  228. bank1: "",
  229. bank2: "",
  230. bankid: [],
  231. payeeAddress: [],
  232. commitEdits: {},
  233. switchs1: "switchs1",
  234. switchs2: "switchs2",
  235. };
  236. },
  237. onLoad(option) {
  238. this.parameter.id = option.id,
  239. this.getList()
  240. },
  241. computed: {
  242. ...mapState(['hasLogin', 'userInfo'])
  243. },
  244. methods: {
  245. filterFileType(index, lists) {
  246. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  247. lists.splice(index, 1);
  248. // 当前文件不支持
  249. uni.showModal({
  250. title: '暂不支持当前图片类型',
  251. showCancel: false
  252. });
  253. } else {
  254. this.isAdd = false;
  255. }
  256. },
  257. onError(error) {
  258. alert(error)
  259. console.log('------------error-----------')
  260. console.log(error)
  261. },
  262. onProgress(e) {
  263. console.log(e)
  264. },
  265. onRemove(index) {
  266. this.imgUrls.splice(index, 1);
  267. },
  268. getImgUrl(res) {
  269. console.log(res)
  270. console.log('------------res-----------')
  271. this.deptList.businessLicenseAddressUrl = res.data.appendixPath
  272. this.license1 = res.data.appendixPath
  273. },
  274. getImgUrl1(res) {
  275. console.log(res)
  276. console.log('------------res-----------')
  277. that.id[0] = rres.data.appendixPath
  278. that.idup = res.data.appendixPath
  279. },
  280. getImgUrl2(res) {
  281. console.log(res)
  282. console.log('------------res-----------')
  283. that.id[1] = res.data.appendixPath
  284. that.idlow = res.data.appendixPath
  285. },
  286. getImgUrl3(res) {
  287. console.log(res)
  288. console.log('------------res-----------')
  289. that.bankid[0] = res.data.appendixPath
  290. that.bank1 = res.data.appendixPath
  291. },
  292. getImgUrl4(res) {
  293. console.log(res)
  294. console.log('------------res-----------')
  295. that.bankid[1] = res.data.appendixPath
  296. that.bank2 = res.data.appendixPath
  297. },
  298. commitEdit(item) {
  299. console.log(this.deptList.compName, "公司名称")
  300. this.deptList.commonId = this.userInfo.id
  301. this.deptList.cardAddressUrl = this.id.toString()
  302. this.deptList.payeeAddressUrl = this.bankid.toString()
  303. if (this.consentStatus1 == true) {
  304. this.deptList.customerTypeFlag = "个人"
  305. } else if (this.consentStatus == true) {
  306. this.deptList.customerTypeFlag = "企业"
  307. }
  308. // console.log(this.deptList,"编辑对象")
  309. this.$api.doRequest('post', '/identityAuthenticationInfo/api/editIdentityAuthenticationInfo', this
  310. .deptList, 'application/json;charset=UTF-8').then(res => {
  311. console.log("成功连接")
  312. if (!this.deptList.goodsName) {
  313. this.$api.msg('修改成功!')
  314. return
  315. }
  316. uni.navigateTo({
  317. url: `/pages/attestation/index`
  318. })
  319. })
  320. .catch(res => {
  321. if (res.errmsg) {
  322. uni.showToast({
  323. title: res.errmsg,
  324. icon: 'none',
  325. duration: 2000
  326. })
  327. } else {
  328. uni.showToast({
  329. title: "系统异常,请联系管理员",
  330. icon: 'none',
  331. duration: 2000
  332. })
  333. }
  334. });
  335. },
  336. // license() {
  337. // var that = this
  338. // uni.chooseImage({
  339. // success: function(res) {
  340. // uni.uploadFile({
  341. // url: 'https://www.zthymaoyi.com/upload/admin',
  342. // filePath: res.tempFilePaths[0],
  343. // name: 'file',
  344. // success(res) {
  345. // var data = res.data
  346. // var strToObj = JSON.parse(data)
  347. // that.deptList.businessLicenseAddressUrl = strToObj.url
  348. // that.license1 = strToObj.url
  349. // }
  350. // })
  351. // }
  352. // })
  353. // },
  354. // idUp() {
  355. // var that = this
  356. // uni.chooseImage({
  357. // success: function(res) {
  358. // uni.uploadFile({
  359. // url: 'https://www.zthymaoyi.com/upload/admin',
  360. // filePath: res.tempFilePaths[0],
  361. // name: 'file',
  362. // success(res) {
  363. // var data = res.data
  364. // var strToObj = JSON.parse(data)
  365. // that.id[0] = strToObj.url
  366. // that.idup = strToObj.url
  367. // }
  368. // })
  369. // }
  370. // })
  371. // },
  372. // idLow() {
  373. // var that = this
  374. // uni.chooseImage({
  375. // success: function(res) {
  376. // uni.uploadFile({
  377. // url: 'https://www.zthymaoyi.com/upload/admin',
  378. // filePath: res.tempFilePaths[0],
  379. // name: 'file',
  380. // success(res) {
  381. // var data = res.data
  382. // var strToObj = JSON.parse(data)
  383. // that.id[1] = strToObj.url
  384. // that.idlow = strToObj.url
  385. // }
  386. // })
  387. // }
  388. // })
  389. // },
  390. // bankUp() {
  391. // var that = this
  392. // uni.chooseImage({
  393. // success: function(res) {
  394. // uni.uploadFile({
  395. // url: 'https://www.zthymaoyi.com/upload/admin',
  396. // filePath: res.tempFilePaths[0],
  397. // name: 'file',
  398. // success(res) {
  399. // var data = res.data
  400. // var strToObj = JSON.parse(data)
  401. // that.bankid[0] = strToObj.url
  402. // that.bank1 = strToObj.url
  403. // }
  404. // })
  405. // }
  406. // })
  407. // },
  408. // bankLow() {
  409. // var that = this
  410. // uni.chooseImage({
  411. // success: function(res) {
  412. // uni.uploadFile({
  413. // url: 'https://www.zthymaoyi.com/upload/admin',
  414. // filePath: res.tempFilePaths[0],
  415. // name: 'file',
  416. // success(res) {
  417. // var data = res.data
  418. // var strToObj = JSON.parse(data)
  419. // that.bankid[1] = strToObj.url
  420. // that.bank2 = strToObj.url
  421. // }
  422. // })
  423. // }
  424. // })
  425. // },
  426. getList(ids) {
  427. this.$api.doRequest('get', '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo', this.parameter,
  428. 'application/json;charset=UTF-8').then(res => {
  429. console.log("成功连接")
  430. this.deptList = res.data.data
  431. if (this.deptList.businessLicenseAddressUrl != "") {
  432. this.license1 = this.deptList.businessLicenseAddressUrl
  433. }
  434. if (this.deptList.cardAddressUrl != "") {
  435. this.id = this.deptList.cardAddressUrl.split(",")
  436. this.idup = this.id[0]
  437. this.idlow = this.id[1]
  438. }
  439. if (this.deptList.payeeAddressUrl != "") {
  440. this.payeeAddress = this.deptList.payeeAddressUrl.split(","),
  441. this.bank1 = this.payeeAddress[0]
  442. this.bank2 = this.payeeAddress[1]
  443. }
  444. console.log(this.deptList.customerTypeFlag, "判断")
  445. if (this.deptList.customerTypeFlag == 2) {
  446. this.consentStatus = true
  447. this.consentStatus1 = false
  448. this.switchs1 = "switchs1"
  449. this.switchs2 = "switchs2"
  450. } else {
  451. this.consentStatus = false
  452. this.consentStatus1 = true
  453. this.switchs1 = "switchs2"
  454. this.switchs2 = "switchs1"
  455. }
  456. })
  457. .catch(res => {
  458. if (res.errmsg) {
  459. uni.showToast({
  460. title: res.errmsg,
  461. icon: 'none',
  462. duration: 2000
  463. })
  464. } else {
  465. uni.showToast({
  466. title: "系统异常,请联系管理员",
  467. icon: 'none',
  468. duration: 2000
  469. })
  470. }
  471. });
  472. },
  473. consent() {
  474. if (this.consentStatus == false && this.consentStatus1 == true) {
  475. this.consentStatus = true
  476. this.consentStatus1 = false
  477. this.switchs1 = "switchs1"
  478. this.switchs2 = "switchs2"
  479. } else if (this.consentStatus == true && this.consentStatus1 == false) {
  480. this.consentStatus = false
  481. this.consentStatus1 = true
  482. this.switchs1 = "switchs2"
  483. this.switchs2 = "switchs1"
  484. }
  485. },
  486. }
  487. }
  488. </script>
  489. <style>
  490. .center {
  491. padding: 10px 20px;
  492. }
  493. .c-row {
  494. display: -webkit-box;
  495. display: -webkit-flex;
  496. display: flex;
  497. -webkit-box-align: center;
  498. -webkit-align-items: center;
  499. align-items: center;
  500. padding: 20rpx 30rpx;
  501. position: relative;
  502. }
  503. .con-list {
  504. -webkit-box-flex: 1;
  505. -webkit-flex: 1;
  506. flex: 1;
  507. display: -webkit-box;
  508. display: -webkit-flex;
  509. display: flex;
  510. -webkit-box-orient: vertical;
  511. -webkit-box-direction: normal;
  512. -webkit-flex-direction: column;
  513. flex-direction: column;
  514. color: #303133;
  515. line-height: 40rpx;
  516. text-align: right;
  517. padding-right: 20rpx;
  518. font-size: 14px;
  519. }
  520. .picture {
  521. width: 100%;
  522. height: 220px;
  523. text-align: center;
  524. margin-top: 10px;
  525. }
  526. .fujians {
  527. margin: 0 auto;
  528. background-color: #FFFFFF;
  529. margin-top: 30px;
  530. border-radius: 20px;
  531. padding: 10px 10px;
  532. }
  533. .picturebiaoti {
  534. font-size: 17px;
  535. font-weight: 700;
  536. }
  537. .personalcss {
  538. background-color: #FFFFFF;
  539. border-radius: 20px;
  540. margin-top: 10px;
  541. }
  542. .btn {
  543. margin-top: 10px;
  544. background-color: #FFFFFF;
  545. border-radius: 25px;
  546. border: none;
  547. }
  548. .btns {
  549. background-color: #22C572;
  550. color: white;
  551. }
  552. .switchs1 {
  553. font-size: 20px;
  554. font-weight: 700;
  555. margin-right: 16px;
  556. }
  557. .switchs2 {
  558. font-size: 20px;
  559. margin-right: 16px;
  560. }
  561. </style>