companyIdentityEdit.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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. uni.showToast({
  235. title: res.errmsg,
  236. icon: 'none',
  237. duration: 2000
  238. })
  239. });
  240. },
  241. license() {
  242. var that = this
  243. wx.chooseImage({
  244. success: function(res) {
  245. wx.uploadFile({
  246. url: 'https://www.zthymaoyi.com/upload/admin',
  247. filePath: res.tempFilePaths[0],
  248. name: 'file',
  249. success(res) {
  250. var data = res.data
  251. var strToObj = JSON.parse(data)
  252. that.deptList.businessLicenseAddressUrl = strToObj.url
  253. that.license1 = strToObj.url
  254. }
  255. })
  256. }
  257. })
  258. },
  259. idUp(){
  260. var that = this
  261. wx.chooseImage({
  262. success: function(res) {
  263. wx.uploadFile({
  264. url: 'https://www.zthymaoyi.com/upload/admin',
  265. filePath: res.tempFilePaths[0],
  266. name: 'file',
  267. success(res) {
  268. var data = res.data
  269. var strToObj = JSON.parse(data)
  270. that.id[0] = strToObj.url
  271. that.idup = strToObj.url
  272. }
  273. })
  274. }
  275. })
  276. },
  277. idLow(){
  278. var that = this
  279. wx.chooseImage({
  280. success: function(res) {
  281. wx.uploadFile({
  282. url: 'https://www.zthymaoyi.com/upload/admin',
  283. filePath: res.tempFilePaths[0],
  284. name: 'file',
  285. success(res) {
  286. var data = res.data
  287. var strToObj = JSON.parse(data)
  288. that.id[1] = strToObj.url
  289. that.idlow = strToObj.url
  290. }
  291. })
  292. }
  293. })
  294. },
  295. bankUp(){
  296. var that = this
  297. wx.chooseImage({
  298. success: function(res) {
  299. wx.uploadFile({
  300. url: 'https://www.zthymaoyi.com/upload/admin',
  301. filePath: res.tempFilePaths[0],
  302. name: 'file',
  303. success(res) {
  304. var data = res.data
  305. var strToObj = JSON.parse(data)
  306. that.bankid[0] = strToObj.url
  307. that.bank1 = strToObj.url
  308. }
  309. })
  310. }
  311. })
  312. },
  313. bankLow(){
  314. var that = this
  315. wx.chooseImage({
  316. success: function(res) {
  317. wx.uploadFile({
  318. url: 'https://www.zthymaoyi.com/upload/admin',
  319. filePath: res.tempFilePaths[0],
  320. name: 'file',
  321. success(res) {
  322. var data = res.data
  323. var strToObj = JSON.parse(data)
  324. that.bankid[1] = strToObj.url
  325. that.bank2 = strToObj.url
  326. }
  327. })
  328. }
  329. })
  330. },
  331. getList(ids) {
  332. this.$api.doRequest('get', '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo', this.parameter, 'application/json;charset=UTF-8').then(res => {
  333. console.log("成功连接")
  334. this.deptList = res.data.data
  335. if(this.deptList.businessLicenseAddressUrl != ""){
  336. this.license1 = this.deptList.businessLicenseAddressUrl
  337. }
  338. if(this.deptList.cardAddressUrl != ""){
  339. this.id = this.deptList.cardAddressUrl.split(",")
  340. this.idup = this.id[0]
  341. this.idlow = this.id[1]
  342. }
  343. if(this.deptList.payeeAddressUrl != ""){
  344. this.payeeAddress = this.deptList.payeeAddressUrl.split(","),
  345. this.bank1 = this.payeeAddress[0]
  346. this.bank2 = this.payeeAddress[1]
  347. }
  348. console.log(this.deptList.customerTypeFlag,"判断")
  349. if(this.deptList.customerTypeFlag == 2){
  350. this.consentStatus = true
  351. this.consentStatus1 = false
  352. this.switchs1 = "switchs1"
  353. this.switchs2 = "switchs2"
  354. }else{
  355. this.consentStatus = false
  356. this.consentStatus1 = true
  357. this.switchs1 = "switchs2"
  358. this.switchs2 = "switchs1"
  359. }
  360. })
  361. .catch(res => {
  362. uni.showToast({
  363. title: res.errmsg,
  364. icon: 'none',
  365. duration: 2000
  366. })
  367. });
  368. },
  369. consent(){
  370. if(this.consentStatus == false && this.consentStatus1 == true){
  371. this.consentStatus = true
  372. this.consentStatus1 = false
  373. this.switchs1 = "switchs1"
  374. this.switchs2 = "switchs2"
  375. }else if(this.consentStatus == true && this.consentStatus1 == false){
  376. this.consentStatus = false
  377. this.consentStatus1 = true
  378. this.switchs1 = "switchs2"
  379. this.switchs2 = "switchs1"
  380. }
  381. },
  382. }
  383. }
  384. </script>
  385. <style>
  386. .center {
  387. padding: 10px 20px;
  388. }
  389. .c-row {
  390. display: -webkit-box;
  391. display: -webkit-flex;
  392. display: flex;
  393. -webkit-box-align: center;
  394. -webkit-align-items: center;
  395. align-items: center;
  396. padding: 20rpx 30rpx;
  397. position: relative;
  398. }
  399. .con-list {
  400. -webkit-box-flex: 1;
  401. -webkit-flex: 1;
  402. flex: 1;
  403. display: -webkit-box;
  404. display: -webkit-flex;
  405. display: flex;
  406. -webkit-box-orient: vertical;
  407. -webkit-box-direction: normal;
  408. -webkit-flex-direction: column;
  409. flex-direction: column;
  410. color: #303133;
  411. line-height: 40rpx;
  412. text-align: right;
  413. padding-right: 20rpx;
  414. font-size: 14px;
  415. }
  416. .picture{
  417. width: 100%;
  418. height: 220px;
  419. text-align: center;
  420. margin-top: 10px;
  421. }
  422. .fujians{
  423. margin: 0 auto;
  424. background-color: #FFFFFF;
  425. margin-top: 30px;
  426. border-radius: 20px;
  427. padding: 10px 10px;
  428. }
  429. .picturebiaoti{
  430. font-size: 17px;
  431. font-weight: 700;
  432. }
  433. .personalcss{
  434. background-color: #FFFFFF;
  435. border-radius: 20px;
  436. margin-top: 10px;
  437. }
  438. .btn {
  439. margin-top: 10px;
  440. background-color: #FFFFFF;
  441. border-radius: 25px;
  442. border: none;
  443. }
  444. .btns {
  445. background-color: #22C572;
  446. }
  447. .switchs1{
  448. font-size: 20px;
  449. font-weight: 700;
  450. margin-right: 16px;
  451. }
  452. .switchs2{
  453. font-size: 20px;
  454. margin-right: 16px;
  455. }
  456. </style>