tripartite_info.vue 11 KB

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