companyIdentityEdit.vue 12 KB

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