tripartite_info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <view class="total-page page-env-160 page-box task-bg">
  3. <Nav :title="title" is_fixed :genre="4" :opacity="scrollTop"></Nav>
  4. <view id="apply-info" class="m-t20 m-lr30 text-color-12">
  5. <view class="sys-background-fff r-20 p-20 m-b20" v-for="(tripartite,index) in tripartiteList" :key="index">
  6. <!-- 个人担保start -->
  7. <view class="" v-if="editIndex!==index">
  8. <!-- 个人担保信息start -->
  9. <view class="sys-from-background-color p-20 r-20 size-26" >
  10. <view class="">
  11. <view class="row-justify-sb center">
  12. <text class="size-28 sys-weight-600">担保{{tripartite.type*1===1?'人':'企业'}}信息({{index+1}})</text>
  13. <view class="row-c sys-background-fff r-100 p-lr30 p-tb10">
  14. <image class="wh-30" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/edit.png" mode="aspectFill"
  15. @click="onEditInfo(index)"></image>
  16. <view class="title-line m-lr20"></view>
  17. <image class="wh-30" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/delete.png" mode="aspectFill"
  18. @click="delTripartite(index)">
  19. </image>
  20. </view>
  21. </view>
  22. <view v-if="tripartite.type*1===1">
  23. <view class="row-c p-tb30">
  24. <view class="text-color-666"><text></text>担保类型:</view>
  25. <text>个人</text>
  26. </view>
  27. <view class="row-c">
  28. <view class="text-color-666"><text></text>担保人姓名:</view>
  29. <text>{{tripartite.name}}</text>
  30. </view>
  31. <view class="row-c">
  32. <view class="text-color-666"><text></text>身份证号码:</view>
  33. <text>{{tripartite.id_number}}</text>
  34. </view>
  35. <view class="p-t30">
  36. <view class="wh-text size-28 text-color-666 m-b20">证件照片</view>
  37. <EnImage :img="[tripartite.identity_one,tripartite.identity_two]"></EnImage>
  38. </view>
  39. </view>
  40. <view v-else>
  41. <view class="row-c p-tb30">
  42. <view class="text-color-666"><text></text>担保类型:</view>
  43. <text>企业</text>
  44. </view>
  45. <view class="row-c">
  46. <view class="text-color-666"><text></text>企业名称:</view>
  47. <text>{{tripartite.name}}</text>
  48. </view>
  49. <view class="row-c">
  50. <view class="text-color-666"><text></text>营业执照编号:</view>
  51. <text>{{tripartite.id_number}}</text>
  52. </view>
  53. <view class="p-t30">
  54. <view class="wh-text size-28 text-color-666 m-b20">证件照片</view>
  55. <EnImage :img="[tripartite.identity_one]"></EnImage>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="m-t30" v-for="(bankItem,bIndex) in tripartite.bank_data" :key="bIndex">
  61. <text class="size-28 sys-weight-600">银行信息({{key+1}})</text>
  62. <view class="row-c p-tb30">
  63. <view class="text-color-666"><text></text>账户姓名:</view>
  64. <text>{{bankItem.name}}</text>
  65. </view>
  66. <view class="row-c">
  67. <view class="text-color-666"><text></text>所属银行:</view>
  68. <text>{{bankItem.bank_name}}</text>
  69. </view>
  70. <view class="row-c p-t30">
  71. <view class="text-color-666"><text></text>银行卡号:</view>
  72. <text>{{bankItem.bank_num}}</text>
  73. </view>
  74. </view>
  75. </view>
  76. <view v-else>
  77. <en-radio label="担保类型" v-model="tripartite.type" @updateData="farming(index)" :list="appliesData"></en-radio>
  78. <view v-if="tripartite.type*1===1">
  79. <add-identity v-if="verifyKey('id_number')" :user-name.sync="tripartite.name" :id-number.sync="tripartite.id_number" :identity-one.sync="tripartite.identity_one" :identity-two.sync="tripartite.identity_two"></add-identity>
  80. <en-input label="姓名" v-if="verifyKey('name')" v-model="tripartite.name" type="text" placeholder="等待自动录入"></en-input>
  81. <en-input label="身份证号" v-if="verifyKey('id_number')" v-model="tripartite.id_number" type="idcard" placeholder="等待自动录入"></en-input>
  82. </view>
  83. <view v-else>
  84. <en-input label="企业名称" v-if="verifyKey('name')" v-model="tripartite.name" type="text" placeholder="请输入企业名称"></en-input>
  85. <en-input label="营业执照编号" v-if="verifyKey('id_number')" v-model="tripartite.id_number" type="text" placeholder="请输入营业执照编号"></en-input>
  86. <add-license v-if="verifyKey('identity_one')" v-model="tripartite.identity_one" :user-name.sync="tripartite.name" :id-number.sync="tripartite.id_number"></add-license>
  87. </view>
  88. <view class="m-t30" v-for="(bankItem,bIndex) in tripartite.bank_data">
  89. <view class="row-justify-sb center">
  90. <text class="size-30 sys-weight-600'">银行卡信息({{bIndex+1}})</text>
  91. <image class="wh-30" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/delete.png" mode="aspectFill"
  92. @click="delBank(index,bIndex)">
  93. </image>
  94. </view>
  95. <en-input label="账户姓名" v-model="bankItem.name" type="text" placeholder="请输开户人姓名" ></en-input>
  96. <add-bank :bank-name.sync="bankItem.bank_name" :bank-num.sync="bankItem.bank_num"></add-bank>
  97. </view>
  98. <view class="row-justify-sb">
  99. <button class="size-26 r-10 button-color still-button m-t30" hover-class="is-hover"
  100. @click="addBank(index)">+ 添加还款信息</button>
  101. <view class="flex"></view>
  102. </view>
  103. </view>
  104. </view>
  105. <en-blank message="暂无第三方信息~~" v-if="tripartiteList.length<=0"></en-blank>
  106. <button class="size-26 r-10 button-color apply-button m-t30" hover-class="is-hover"
  107. @click="addItem">+添加第三方信息</button>
  108. </view>
  109. <EnButton leftText="保存" @onSubmit="onSubmit">
  110. </EnButton>
  111. </view>
  112. </template>
  113. <script>
  114. import WhInput from "@/components/en-from/en-input/en-input.vue"
  115. import EnUpload from "@/components/en-from/en-upload/en-upload.vue"
  116. import EnImage from "@/components/en-utils/en-image/en-image.vue"
  117. import AddIdentity from "@/page_task/identity_upload/add-identity.vue";
  118. import EnInput from "@/components/en-from/en-input/en-input.vue";
  119. import AddLicense from "@/page_task/apply/components/add-license.vue";
  120. import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
  121. import AddBank from "@/page_task/apply/components/add-bank.vue";
  122. import tools from "@/service/tools";
  123. export default {
  124. components: {
  125. AddBank,
  126. EnBlank,
  127. AddLicense,
  128. EnInput,
  129. AddIdentity,
  130. WhInput,
  131. EnUpload,
  132. EnImage
  133. },
  134. data() {
  135. return {
  136. title: '',
  137. scrollTop: 0,
  138. editIndex:0,
  139. appliesData:[{'value':1,'text':'个人'},{'value':2,'text':'企业'}],
  140. tripartiteList:[],
  141. tripartiteItem:{
  142. "type": "1",
  143. "name": "",
  144. "id_number": "",
  145. "identity_one": "",
  146. "identity_two": "",
  147. "bank_data": [],
  148. }
  149. }
  150. },
  151. onPageScroll(res) {
  152. this.scrollTop = res.scrollTop / 120
  153. },
  154. onLoad(options) {
  155. this.title = options.title
  156. let tripartiteList = uni.getStorageSync('tripartiteData')
  157. let tripartiteKey = uni.getStorageSync('tripartiteKey')
  158. this.tripartiteList=tripartiteList
  159. this.showKeys=tripartiteKey
  160. },
  161. methods: {
  162. addItem(){
  163. this.tripartiteList.push(this.tripartiteItem)
  164. },
  165. delTripartite(itemKey){
  166. uni.showModal({
  167. title: '是否删除当前第三方信息',
  168. content: '确定删除?',
  169. success: (res) => {
  170. if (res.confirm) {
  171. this.tripartiteList.splice(itemKey,1)
  172. }
  173. }
  174. })
  175. },
  176. farming(key) {
  177. if(this.tripartiteList[key].type*1===1){
  178. this.tripartiteList[key].q_identity_one=this.tripartiteList[key].identity_one
  179. this.tripartiteList[key].q_name=this.tripartiteList[key].name
  180. this.tripartiteList[key].q_id_number=this.tripartiteList[key].id_number
  181. this.tripartiteList[key].name=''
  182. this.tripartiteList[key].identity_one=''
  183. this.tripartiteList[key].id_number=''
  184. if( this.tripartiteList[key].u_identity_one){
  185. this.tripartiteList[key].identity_one=this.tripartiteList[key].u_identity_one
  186. }
  187. if( this.tripartiteList[key].u_name){
  188. this.tripartiteList[key].name=this.tripartiteList[key].u_name
  189. }
  190. if( this.tripartiteList[key].u_id_number){
  191. this.tripartiteList[key].id_number=this.tripartiteList[key].u_id_number
  192. }
  193. }else {
  194. this.tripartiteList[key].u_identity_one=this.tripartiteList[key].identity_one
  195. this.tripartiteList[key].u_name=this.tripartiteList[key].name
  196. this.tripartiteList[key].u_id_number=this.tripartiteList[key].id_number
  197. this.tripartiteList[key].name=''
  198. this.tripartiteList[key].identity_one=''
  199. this.tripartiteList[key].id_number=''
  200. if( this.tripartiteList[key].q_identity_one){
  201. this.tripartiteList[key].identity_one=this.tripartiteList[key].q_identity_one
  202. }
  203. if( this.tripartiteList[key].q_name){
  204. this.tripartiteList[key].name=this.tripartiteList[key].q_name
  205. }
  206. if( this.tripartiteList[key].q_id_number){
  207. this.tripartiteList[key].id_number=this.tripartiteList[key].q_id_number
  208. }
  209. }
  210. },
  211. delBank(applyKey,itemKey){
  212. uni.showModal({
  213. title: '是否删除当前还款信息',
  214. content: '确定删除?',
  215. success: (res) => {
  216. if (res.confirm) {
  217. this.tripartiteList[applyKey].bank_data.splice(itemKey,1)
  218. }
  219. }
  220. })
  221. },
  222. addBank(applyKey){
  223. if(!this.tripartiteList[applyKey].bank_data){
  224. this.tripartiteList[applyKey].bank_data=[];
  225. }
  226. this.tripartiteList[applyKey].bank_data.push({'name':'','bank_name':'','bank_num':''})
  227. },
  228. verifyKey(field) {
  229. return this.showKeys.indexOf(field) >= 0
  230. },
  231. // 保存
  232. onLeftSubmit() {
  233. this.tripartiteList.map(item => {
  234. item.is_edit = true
  235. })
  236. },
  237. // 提交
  238. onSubmit() {
  239. uni.$emit('putTripartiteInfo',this.tripartiteList)
  240. setTimeout(()=>{
  241. tools.leftClick()
  242. },50)
  243. },
  244. // 编辑单个信息
  245. onEditInfo(index) {
  246. this.editIndex=index
  247. },
  248. }
  249. }
  250. </script>
  251. <style lang="scss" scoped>
  252. .attestation-button {
  253. width: 156rpx;
  254. height: 54rpx;
  255. line-height: 54rpx;
  256. background: #FFFFFF;
  257. border: 1rpx solid #0FB160;
  258. }
  259. .still-button {
  260. width: 260rpx;
  261. background: #FFFFFF;
  262. border-radius: 10rpx;
  263. border: 1rpx solid #0FB160;
  264. }
  265. .apply-button {
  266. height: 80rpx;
  267. line-height: 80rpx;
  268. background: #FFFFFF;
  269. border: 2rpx solid #0FB160;
  270. margin-bottom: 100rpx;
  271. }
  272. .apply-button-save {
  273. width: 140rpx;
  274. background: #FFFFFF;
  275. border: 2rpx solid #0FB160;
  276. }
  277. .apply-button-delete {
  278. color: #E83F37;
  279. width: 140rpx;
  280. background: #FFFFFF;
  281. border: 2rpx solid #E83F37;
  282. }
  283. </style>