companyIdentityEdit.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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. <view>
  9. <view style="margin: 0 auto;" v-if="license1 != ''" @click="license">
  10. <image v-bind:src = "license1" class="picture"></image>
  11. </view>
  12. </view>
  13. <view class="personalcss">
  14. <view class="c-row b-b">
  15. <text class="tit">公司名称</text>
  16. <view class="con-list">
  17. <input placeholder="请填写公司名称" name="input" v-model="deptList.compName"></input>
  18. </view>
  19. </view>
  20. <view class="c-row ">
  21. <text class="tit">纳税人识别号</text>
  22. <view class="con-list">
  23. <input placeholder="请填写纳税人识别号" name="input" v-model="deptList.payTaxesCard"></input>
  24. </view>
  25. </view>
  26. </view>
  27. <view>
  28. <view style="margin: 0 auto;" v-if="idup != ''" @click="idUp">
  29. <image v-bind:src = "idup" class="picture"></image>
  30. </view>
  31. <view style="margin: 0 auto;" v-if="idlow != ''" @click="idLow">
  32. <image v-bind:src = "idlow" class="picture"></image>
  33. </view>
  34. </view>
  35. <view class="personalcss">
  36. <view class="c-row b-b">
  37. <text class="tit">姓名</text>
  38. <view class="con-list">
  39. <input placeholder="请填写姓名" name="input" v-model="deptList.customerName"></input>
  40. </view>
  41. </view>
  42. <view class="c-row ">
  43. <text class="tit">身份证号</text>
  44. <view class="con-list">
  45. <input placeholder="请填写身份证号" name="input"
  46. v-model="deptList.customerNumberCard"></input>
  47. </view>
  48. </view>
  49. </view>
  50. <view>
  51. <view style="margin: 0 auto;" v-if="bank1 != ''" @click="bankUp()">
  52. <image v-bind:src = "bank1" class="picture"></image>
  53. </view>
  54. <view style="margin: 0 auto;" v-if="bank2 != ''" @click="bankLow()">
  55. <image v-bind:src = "bank2" class="picture"></image>
  56. </view>
  57. </view>
  58. <view class="personalcss">
  59. <view class="c-row b-b">
  60. <text class="tit">银行卡号</text>
  61. <view class="con-list">
  62. <input placeholder="请填写银行卡号" name="input" v-model="deptList.bankCard"></input>
  63. </view>
  64. </view>
  65. <view class="c-row b-b">
  66. <text class="tit">开户行</text>
  67. <view class="con-list">
  68. <input placeholder="请填写开户行" name="input" v-model="deptList.bankDeposit"></input>
  69. </view>
  70. </view>
  71. <view class="c-row b-b">
  72. <text class="tit">开户支行</text>
  73. <view class="con-list">
  74. <input placeholder="请填写开户支行" name="input"
  75. v-model="deptList.bankDepositBranch"></input>
  76. </view>
  77. </view>
  78. <view class="c-row b-b">
  79. <text class="tit">手机号</text>
  80. <view class="con-list">
  81. <input placeholder="请填写手机号" @input='phoneinput' v-model="deptList.customerPhone"></input>
  82. </view>
  83. </view>
  84. <view class="c-row ">
  85. <text class="tit">公司地址</text>
  86. <view class="con-list">
  87. <input placeholder="请填写公司地址" name="input" v-model="deptList.compAddress"></input>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view v-else>
  93. <view>
  94. <view style="margin: 0 auto;" v-if="idup != ''" @click="idUp">
  95. <image v-bind:src = "idup" class="picture"></image>
  96. </view>
  97. <view style="margin: 0 auto;" v-if="idlow != ''" @click="idLow">
  98. <image v-bind:src = "idlow" class="picture"></image>
  99. </view>
  100. </view>
  101. <view class="personalcss">
  102. <view class="c-row b-b">
  103. <text class="tit">姓名</text>
  104. <view class="con-list">
  105. <input placeholder="请填写姓名" name="input" v-model="deptList.customerName"></input>
  106. </view>
  107. </view>
  108. <view class="c-row b-b">
  109. <text class="tit">身份证号</text>
  110. <view class="con-list">
  111. <input placeholder="请填写身份证号" name="input"
  112. v-model="deptList.customerNumberCard"></input>
  113. </view>
  114. </view>
  115. </view>
  116. <view>
  117. <view style="margin: 0 auto;" v-if="bank1 != ''" @click="bankUp()">
  118. <image v-bind:src = "bank1" class="picture"></image>
  119. </view>
  120. <view style="margin: 0 auto;" v-if="bank2 != ''" @click="bankLow()">
  121. <image v-bind:src = "bank2" class="picture"></image>
  122. </view>
  123. </view>
  124. <view class="personalcss">
  125. <view class="c-row b-b">
  126. <text class="tit">银行卡号</text>
  127. <view class="con-list">
  128. <input placeholder="请填写银行卡号" name="input" v-model="deptList.bankCard"></input>
  129. </view>
  130. </view>
  131. <view class="c-row b-b">
  132. <text class="tit">开户行</text>
  133. <view class="con-list">
  134. <input placeholder="请填写开户行" name="input" v-model="deptList.bankDeposit"></input>
  135. </view>
  136. </view>
  137. <view class="c-row b-b">
  138. <text class="tit">开户支行</text>
  139. <view class="con-list">
  140. <input placeholder="请填写开户支行" name="input"
  141. v-model="deptList.bankDepositBranch"></input>
  142. </view>
  143. </view>
  144. <view class="c-row b-b">
  145. <text class="tit">收款人姓名</text>
  146. <view class="con-list">
  147. <input placeholder="请填写收款人姓名" name="input" v-model="deptList.payeeName"></input>
  148. </view>
  149. </view>
  150. <view class="c-row">
  151. <text class="tit">收款人身份证号</text>
  152. <view class="con-list">
  153. <input placeholder="请填写收款身份证号" name="input"
  154. v-model="deptList.payeeNumberCard"></input>
  155. </view>
  156. </view>
  157. <view class="c-row b-b">
  158. <text class="tit">手机号</text>
  159. <view class="con-list">
  160. <input placeholder="请填写手机号" @input='phoneinput' v-model="deptList.customerPhone"></input>
  161. </view>
  162. </view>
  163. <view class="c-row ">
  164. <text class="tit">联系地址</text>
  165. <view class="con-list">
  166. <input placeholder="请填写联系地址" name="input" v-model="deptList.compAddress"></input>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <button class="btn btns" @click="commitEdit">修改</button>
  172. </view>
  173. </template>
  174. <script>
  175. import {
  176. mapState
  177. } from 'vuex';
  178. export default {
  179. name: "buy",
  180. data() {
  181. return {
  182. radios: 2,
  183. deptList:{
  184. compName:"",
  185. payTaxesCard:"",
  186. },
  187. consentStatus:true,
  188. consentStatus1:false,
  189. parameter:{},
  190. businessman:{},
  191. id:[],
  192. idup:"",
  193. idlow:"",
  194. license1:"",
  195. bank1:"",
  196. bank2:"",
  197. bankid:[],
  198. payeeAddress:[],
  199. commitEdits:{},
  200. switchs1:"switchs1",
  201. switchs2:"switchs2",
  202. };
  203. },
  204. onLoad(option) {
  205. this.parameter.id = option.id,
  206. this.getList()
  207. },
  208. computed: {
  209. ...mapState(['hasLogin','userInfo'])
  210. },
  211. methods: {
  212. commitEdit(item){
  213. console.log(this.deptList.compName,"公司名称")
  214. this.deptList.commonId = this.userInfo.id
  215. this.deptList.cardAddressUrl = this.id.toString()
  216. this.deptList.payeeAddressUrl = this.bankid.toString()
  217. if(this.consentStatus1 == true){
  218. this.deptList.customerTypeFlag = "个人"
  219. }else if(this.consentStatus == true){
  220. this.deptList.customerTypeFlag = "企业"
  221. }
  222. // console.log(this.deptList,"编辑对象")
  223. this.$api.doRequest('post', '/identityAuthenticationInfo/api/editIdentityAuthenticationInfo', this.deptList, 'application/json;charset=UTF-8').then(res => {
  224. console.log("成功连接")
  225. if (!this.deptList.goodsName) {
  226. this.$api.msg('修改成功!')
  227. return
  228. }
  229. uni.navigateTo({
  230. url: `/pages/attestation/index`
  231. })
  232. })
  233. .catch(res => {
  234. if(res.errmsg){
  235. uni.showToast({
  236. title: res.errmsg,
  237. icon: 'none',
  238. duration: 2000
  239. })
  240. }
  241. else{
  242. uni.showToast({
  243. title: "系统异常,请联系管理员",
  244. icon: 'none',
  245. duration: 2000
  246. })
  247. }
  248. });
  249. },
  250. license() {
  251. var that = this
  252. uni.chooseImage({
  253. success: function(res) {
  254. uni.uploadFile({
  255. url: 'https://www.zthymaoyi.com/upload/admin',
  256. filePath: res.tempFilePaths[0],
  257. name: 'file',
  258. success(res) {
  259. var data = res.data
  260. var strToObj = JSON.parse(data)
  261. that.deptList.businessLicenseAddressUrl = strToObj.url
  262. that.license1 = strToObj.url
  263. }
  264. })
  265. }
  266. })
  267. },
  268. idUp(){
  269. var that = this
  270. uni.chooseImage({
  271. success: function(res) {
  272. uni.uploadFile({
  273. url: 'https://www.zthymaoyi.com/upload/admin',
  274. filePath: res.tempFilePaths[0],
  275. name: 'file',
  276. success(res) {
  277. var data = res.data
  278. var strToObj = JSON.parse(data)
  279. that.id[0] = strToObj.url
  280. that.idup = strToObj.url
  281. }
  282. })
  283. }
  284. })
  285. },
  286. idLow(){
  287. var that = this
  288. uni.chooseImage({
  289. success: function(res) {
  290. uni.uploadFile({
  291. url: 'https://www.zthymaoyi.com/upload/admin',
  292. filePath: res.tempFilePaths[0],
  293. name: 'file',
  294. success(res) {
  295. var data = res.data
  296. var strToObj = JSON.parse(data)
  297. that.id[1] = strToObj.url
  298. that.idlow = strToObj.url
  299. }
  300. })
  301. }
  302. })
  303. },
  304. bankUp(){
  305. var that = this
  306. uni.chooseImage({
  307. success: function(res) {
  308. uni.uploadFile({
  309. url: 'https://www.zthymaoyi.com/upload/admin',
  310. filePath: res.tempFilePaths[0],
  311. name: 'file',
  312. success(res) {
  313. var data = res.data
  314. var strToObj = JSON.parse(data)
  315. that.bankid[0] = strToObj.url
  316. that.bank1 = strToObj.url
  317. }
  318. })
  319. }
  320. })
  321. },
  322. bankLow(){
  323. var that = this
  324. uni.chooseImage({
  325. success: function(res) {
  326. uni.uploadFile({
  327. url: 'https://www.zthymaoyi.com/upload/admin',
  328. filePath: res.tempFilePaths[0],
  329. name: 'file',
  330. success(res) {
  331. var data = res.data
  332. var strToObj = JSON.parse(data)
  333. that.bankid[1] = strToObj.url
  334. that.bank2 = strToObj.url
  335. }
  336. })
  337. }
  338. })
  339. },
  340. getList(ids) {
  341. this.$api.doRequest('get', '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo', this.parameter, 'application/json;charset=UTF-8').then(res => {
  342. console.log("成功连接")
  343. this.deptList = res.data.data
  344. if(this.deptList.businessLicenseAddressUrl != ""){
  345. this.license1 = this.deptList.businessLicenseAddressUrl
  346. }
  347. if(this.deptList.cardAddressUrl != ""){
  348. this.id = this.deptList.cardAddressUrl.split(",")
  349. this.idup = this.id[0]
  350. this.idlow = this.id[1]
  351. }
  352. if(this.deptList.payeeAddressUrl != ""){
  353. this.payeeAddress = this.deptList.payeeAddressUrl.split(","),
  354. this.bank1 = this.payeeAddress[0]
  355. this.bank2 = this.payeeAddress[1]
  356. }
  357. console.log(this.deptList.customerTypeFlag,"判断")
  358. if(this.deptList.customerTypeFlag == 2){
  359. this.consentStatus = true
  360. this.consentStatus1 = false
  361. this.switchs1 = "switchs1"
  362. this.switchs2 = "switchs2"
  363. }else{
  364. this.consentStatus = false
  365. this.consentStatus1 = true
  366. this.switchs1 = "switchs2"
  367. this.switchs2 = "switchs1"
  368. }
  369. })
  370. .catch(res => {
  371. if(res.errmsg){
  372. uni.showToast({
  373. title: res.errmsg,
  374. icon: 'none',
  375. duration: 2000
  376. })
  377. }
  378. else{
  379. uni.showToast({
  380. title: "系统异常,请联系管理员",
  381. icon: 'none',
  382. duration: 2000
  383. })
  384. }
  385. });
  386. },
  387. consent(){
  388. if(this.consentStatus == false && this.consentStatus1 == true){
  389. this.consentStatus = true
  390. this.consentStatus1 = false
  391. this.switchs1 = "switchs1"
  392. this.switchs2 = "switchs2"
  393. }else if(this.consentStatus == true && this.consentStatus1 == false){
  394. this.consentStatus = false
  395. this.consentStatus1 = true
  396. this.switchs1 = "switchs2"
  397. this.switchs2 = "switchs1"
  398. }
  399. },
  400. }
  401. }
  402. </script>
  403. <style>
  404. .center {
  405. padding: 10px 20px;
  406. }
  407. .c-row {
  408. display: -webkit-box;
  409. display: -webkit-flex;
  410. display: flex;
  411. -webkit-box-align: center;
  412. -webkit-align-items: center;
  413. align-items: center;
  414. padding: 20rpx 30rpx;
  415. position: relative;
  416. }
  417. .con-list {
  418. -webkit-box-flex: 1;
  419. -webkit-flex: 1;
  420. flex: 1;
  421. display: -webkit-box;
  422. display: -webkit-flex;
  423. display: flex;
  424. -webkit-box-orient: vertical;
  425. -webkit-box-direction: normal;
  426. -webkit-flex-direction: column;
  427. flex-direction: column;
  428. color: #303133;
  429. line-height: 40rpx;
  430. text-align: right;
  431. padding-right: 20rpx;
  432. font-size: 14px;
  433. }
  434. .picture{
  435. width: 100%;
  436. height: 220px;
  437. text-align: center;
  438. margin-top: 10px;
  439. }
  440. .fujians{
  441. margin: 0 auto;
  442. background-color: #FFFFFF;
  443. margin-top: 30px;
  444. border-radius: 20px;
  445. padding: 10px 10px;
  446. }
  447. .picturebiaoti{
  448. font-size: 17px;
  449. font-weight: 700;
  450. }
  451. .personalcss{
  452. background-color: #FFFFFF;
  453. border-radius: 20px;
  454. margin-top: 10px;
  455. }
  456. .btn {
  457. margin-top: 10px;
  458. background-color: #FFFFFF;
  459. border-radius: 25px;
  460. border: none;
  461. }
  462. .btns {
  463. background-color: #22C572;
  464. color: white;
  465. }
  466. .switchs1{
  467. font-size: 20px;
  468. font-weight: 700;
  469. margin-right: 16px;
  470. }
  471. .switchs2{
  472. font-size: 20px;
  473. margin-right: 16px;
  474. }
  475. </style>