information.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. <template>
  2. <view class="total-page page-box task-bg">
  3. <Nav :title="productInfo.product_name" :genre="1" is_fixed></Nav>
  4. <view class="task-tabs" :style="{top:`${$tools.topHeight()}px`}">
  5. <view class="m-t20">
  6. <view class="creation_item row-justify-sb center sys-background-fff m-lr30 m-b20 p-30 r-20"
  7. v-for="(item,index) in informationList" :key="index" v-show="item.is_show"
  8. @click="onAuthentication(item)">
  9. <view class="row-c">
  10. <image class="wh-80 m-r20 r-100" :src="item.icon" mode="aspectFill"></image>
  11. <view>
  12. <text class="size-28 text-color-12 sys-weight-600">{{item.name}}</text>
  13. <view class="size-24 text-color-999 m-t10">{{item.explain}}</view>
  14. </view>
  15. </view>
  16. <view class="">
  17. <button
  18. class="button-background info_button sys-weight-500 text-color-fff size-26 r-100">待上传</button>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <EnButton is_both :leftText="'预览'" :rightText="'提交资料'" @onLeftSubmit="onLeftSubmit" @onSubmit="onSubmit">
  24. </EnButton>
  25. </view>
  26. </template>
  27. <script>
  28. import TaskImgTab from "@/common/task/task_ima_tab.vue"
  29. import tools from "@/service/tools";
  30. import {
  31. addDraft,
  32. addTask,
  33. delBusinessCache,
  34. getBusinessCache,
  35. getClientInfo,
  36. getDraftItem,
  37. getTaskDetail,
  38. getTaskTypeInfo,
  39. setBusinessCache,
  40. verifyBusinessModuleKey
  41. } from "@/api/task";
  42. export default {
  43. components: {
  44. TaskImgTab,
  45. },
  46. data() {
  47. return {
  48. title: '',
  49. informationList: [{
  50. name: '身份信息',
  51. explain: '身份证、婚姻、职业、社保信息',
  52. icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-identity.png',
  53. path: '/page_task/identity/identity',
  54. type: 1,
  55. is_finish: false,
  56. is_show: false,
  57. type_keys: []
  58. }, {
  59. name: '资产信息',
  60. explain: '房产、车辆等资产',
  61. icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-property.png',
  62. path: '/page_task/property/property',
  63. type: 2,
  64. is_finish: false,
  65. is_show: false,
  66. type_keys: []
  67. }, {
  68. name: '申请信息',
  69. explain: '贷款额度信息',
  70. icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-apply.png',
  71. path: '/page_task/apply/apply',
  72. type: 3,
  73. is_finish: false,
  74. is_show: false,
  75. type_keys: []
  76. }, {
  77. name: '联系人信息',
  78. explain: '其他联系人',
  79. icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-contacts.png',
  80. type: 5,
  81. is_finish: false,
  82. is_show: false,
  83. type_keys: []
  84. }, {
  85. name: '第三方信息',
  86. explain: '第三方企业/人员相关信息',
  87. icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-three.png',
  88. path: '/page_task/tripartite_info/tripartite_info',
  89. type: 4,
  90. is_finish: false,
  91. is_show: false,
  92. type_keys: []
  93. }, {
  94. name: '征信信息',
  95. explain: '银行征信信息',
  96. icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-credit.png',
  97. type: 6,
  98. is_finish: false,
  99. is_show: false,
  100. type_keys: []
  101. }, ],
  102. stepsNum: 0,
  103. stepsKey: 0,
  104. productInfo: {
  105. id: 1,
  106. product_name: "",
  107. product_types: '',
  108. field_ids: [],
  109. type_data: [],
  110. },
  111. taskData: {
  112. 'productId': '',
  113. "clientInfo": {
  114. "name": "",
  115. "birthday": "",
  116. "sex": 1,
  117. "id_number": "",
  118. "identity_one": "",
  119. "identity_two": "",
  120. "phone": "",
  121. "marriage_type": 1,
  122. "education_type": '',
  123. "education_name": '',
  124. "employ_type": 1,
  125. "firm_name": "",
  126. "firm_address": "",
  127. "resident_city": "",
  128. "resident_address": "",
  129. "mate_name": "",
  130. "mate_phone": "",
  131. "mate_id_number": "",
  132. "mate_firm": "",
  133. "m_code": "",
  134. "code": "",
  135. "m_identity_one": "",
  136. "m_identity_two": "",
  137. "firm_city": "",
  138. "social_num": "",
  139. "reserved_money": "",
  140. "marriage_img": [],
  141. "credit_img": []
  142. },
  143. "property": [],
  144. "applies": {
  145. "is_farming": '1',
  146. "loan_form": '',
  147. "loan_type": '',
  148. "loan_industry": [],
  149. "enterprise_type": "",
  150. "use_date": "",
  151. "pay_status": '1',
  152. "quota": "",
  153. "apply_data": []
  154. },
  155. "tripartite": [],
  156. "linkman": [],
  157. "credit": {
  158. 'credit_img': [],
  159. 'deal_data': [],
  160. 'overdue_data': [],
  161. 'query_data': [],
  162. },
  163. "post_loan": {
  164. 'bank_id': '',
  165. 'loans_money': '',
  166. 'interest_rate': '',
  167. 'repayment_money': '',
  168. 'refund_num': '',
  169. 'repayment_type': '',
  170. 'repayment_date': '',
  171. },
  172. },
  173. isCache: true,
  174. isNew: true
  175. }
  176. },
  177. watch: {
  178. 'productInfo.product_types': function() {
  179. let productTypes = this.productInfo.product_types
  180. if (typeof productTypes === 'string') {
  181. productTypes = productTypes.split(',')
  182. }
  183. this.informationList.forEach(item => {
  184. item.is_show = productTypes.indexOf(item.type + '') >= 0;
  185. this.productInfo.type_data.forEach(val => {
  186. if (val.type === item.type + '') {
  187. item.type_keys = val.type_keys
  188. }
  189. })
  190. })
  191. }
  192. },
  193. onLoad(data) {
  194. if (data.draftId) {
  195. this.getDraftItem(data.draftId)
  196. this.isNew = false
  197. } else if (data.businessId) {
  198. this.getTaskDetail(data.businessId)
  199. this.isNew = false
  200. } else {
  201. if (data.productId === undefined) {
  202. tools.leftClick()
  203. } else {
  204. this.taskData.productId = data.productId
  205. this.getTaskTypeInfo(data.productId)
  206. }
  207. }
  208. uni.$on('putClientInfo',clientInfo=>{
  209. if(this.taskData.clientInfo.id_number!==clientInfo.id_number){
  210. this.taskData.clientInfo=clientInfo
  211. this.getClientInfo()
  212. }else {
  213. this.taskData.clientInfo=clientInfo
  214. }
  215. })
  216. uni.$on('putTripartiteInfo',tripartiteInfo=>{
  217. this.taskData.tripartite=tripartiteInfo
  218. })
  219. },
  220. methods: {
  221. addTask() {
  222. console.log('addTask----start')
  223. // let isEnd=false;
  224. // this.productInfo.type_data.forEach((typeItem,typeKey)=>{
  225. // if(!typeItem.is_end && !isEnd && typeKey!==this.stepsNum){
  226. // isEnd=true
  227. // tools.error('完善'+typeItem.type_name)
  228. // }
  229. // })
  230. // if(isEnd){
  231. // return;
  232. // }
  233. if (this.isAjax) {
  234. return;
  235. }
  236. this.isAjax = true;
  237. addTask(this.taskData).then((res) => {
  238. if (res.code === 1) {
  239. tools.success(res.msg)
  240. // uni.$emit('goToTaskList', 0)
  241. setTimeout(() => {
  242. uni.redirectTo({
  243. url: 'pages-task/task-info/task-info?id=' + res.data.id
  244. });
  245. }, 1500)
  246. } else {
  247. this.isAjax = false;
  248. tools.error(res.msg)
  249. }
  250. })
  251. },
  252. addDraft() {
  253. addDraft(this.taskData).then((res) => {
  254. if (res.code === 1) {
  255. tools.success(res.msg)
  256. delBusinessCache({
  257. 'productId': this.productInfo.id
  258. }).then((res) => {
  259. uni.$emit('setNewDraft')
  260. setTimeout(() => {
  261. tools.leftClick()
  262. }, 1000)
  263. })
  264. } else {
  265. tools.error(res.msg)
  266. }
  267. })
  268. },
  269. verifyBusinessModuleKey(verifyKey) {
  270. let typeRow = this.productInfo.type_data[verifyKey];
  271. let data = {}
  272. if (typeRow.type === '1') {
  273. data = this.taskData.clientInfo
  274. } else if (typeRow.type === '2') {
  275. data = this.taskData.property
  276. } else if (typeRow.type === '3') {
  277. data = this.taskData.applies
  278. } else if (typeRow.type === '4') {
  279. data = this.taskData.tripartite
  280. } else if (typeRow.type === '5') {
  281. data = this.taskData.linkman
  282. } else if (typeRow.type === '6') {
  283. data = this.taskData.credit
  284. } else if (typeRow.type === '7') {
  285. data = this.taskData.post_loan
  286. }
  287. console.log(data)
  288. verifyBusinessModuleKey({
  289. 'productId': this.productInfo.id,
  290. 'data': data,
  291. 'type': typeRow.type
  292. }).then((res) => {
  293. this.productInfo.type_data[verifyKey].is_end = res.code === 1;
  294. })
  295. },
  296. getClientInfo() {
  297. //获取客户原始数据
  298. if (this.taskData.clientInfo.id_number === '') {
  299. return;
  300. }
  301. getClientInfo({
  302. 'id_number': this.taskData.clientInfo.id_number,
  303. 'productId': this.taskData.productId
  304. }).then((res) => {
  305. if (res.code === 1) {
  306. this.isNew = false
  307. if (res.data.business) {
  308. res.data.business.id = ''
  309. this.taskData.clientInfo = res.data.business
  310. uni.$emit('setClientData',this.taskData.clientInfo)
  311. }
  312. if (res.data.propertyList) {
  313. this.taskData.property = res.data.propertyList
  314. if (this.taskData.property) {
  315. this.taskData.property.forEach((item) => {
  316. item.id = ''
  317. })
  318. }
  319. }
  320. if (res.data.applyFor) {
  321. res.data.applyFor.id = ''
  322. this.taskData.applies = res.data.applyFor
  323. if (this.taskData.applies.apply_data) {
  324. this.taskData.applies.apply_data.forEach((item) => {
  325. item.id = ''
  326. })
  327. }
  328. }
  329. if (res.data.tripartite) {
  330. this.taskData.tripartite = res.data.tripartite
  331. this.taskData.tripartite.forEach((item) => {
  332. item.id = ''
  333. })
  334. }
  335. if (res.data.linkman) {
  336. res.data.linkman.forEach((item) => {
  337. item.id = ''
  338. })
  339. this.taskData.linkman = res.data.linkman
  340. }
  341. if (res.data.credit) {
  342. this.taskData.credit = res.data.credit
  343. this.taskData.credit.deal_data.forEach((item) => {
  344. item.id = ''
  345. })
  346. this.taskData.credit.overdue_data.forEach((item) => {
  347. item.id = ''
  348. })
  349. this.taskData.credit.query_data.forEach((item) => {
  350. item.id = ''
  351. })
  352. }
  353. if (res.data.postLoan) {
  354. this.taskData.post_loan = res.data.postLoan
  355. }
  356. }
  357. })
  358. },
  359. setBusinessCache() {
  360. //设置缓存
  361. if (this.isCache) {
  362. return false
  363. }
  364. this.isCache = true
  365. setBusinessCache(this.taskData).then((res) => {
  366. setTimeout(() => {
  367. this.isCache = false;
  368. }, 2000)
  369. })
  370. },
  371. getBusinessCache(productId) {
  372. //获取缓存
  373. getBusinessCache({
  374. 'productId': productId
  375. }).then((res) => {
  376. if (res.code === 1) {
  377. if (res.data.productId !== 0) {
  378. this.isNew = false
  379. this.taskData = res.data
  380. }
  381. }
  382. })
  383. },
  384. getTaskTypeInfo(id) {
  385. getTaskTypeInfo({
  386. 'id': id
  387. }).then((res) => {
  388. if (res.code === 1) {
  389. this.productInfo = res.data;
  390. if (this.isNew) this.getBusinessCache(id)
  391. } else {
  392. tools.error(res.msg)
  393. setTimeout(() => {
  394. this.closePage();
  395. }, 1000)
  396. }
  397. })
  398. },
  399. getDraftItem(draftId) {
  400. getDraftItem({
  401. 'draftId': draftId
  402. }).then((res) => {
  403. if (res.code === 1) {
  404. this.productInfo = res.data.productInfo
  405. this.taskData = res.data.taskData
  406. this.getTaskTypeInfo(this.taskData.productId)
  407. } else {
  408. this.closePage();
  409. }
  410. })
  411. },
  412. async getTaskDetail(businessId) {
  413. const res = await getTaskDetail({
  414. id: businessId
  415. })
  416. if (res.code === 1) {
  417. if (res.data.product) {
  418. this.productInfo = res.data.product
  419. this.taskData.productId = res.data.product.id
  420. }
  421. if (res.data.business) {
  422. this.taskData.clientInfo = res.data.business
  423. }
  424. if (res.data.propertyList) {
  425. this.taskData.property = res.data.propertyList
  426. }
  427. if (res.data.applyFor) {
  428. this.taskData.applies = res.data.applyFor
  429. }
  430. if (res.data.tripartite) {
  431. this.taskData.tripartite = res.data.tripartite
  432. }
  433. if (res.data.linkman) {
  434. this.taskData.linkman = res.data.linkman
  435. console.log('this.taskData.linkman:', this.taskData.linkman)
  436. }
  437. if (res.data.credit) {
  438. this.taskData.credit = res.data.credit
  439. }
  440. if (res.data.postLoan) {
  441. this.taskData.post_loan = res.data.postLoan
  442. }
  443. this.getTaskTypeInfo(this.taskData.productId)
  444. } else {
  445. this.closePage();
  446. }
  447. },
  448. delBusinessCache() {
  449. uni.showModal({
  450. title: '警告',
  451. content: '是否退出当前任务,并清除缓存!',
  452. success: (res) => {
  453. if (res.confirm) {
  454. delBusinessCache({
  455. 'productId': this.productInfo.id
  456. }).then((res) => {
  457. tools.leftClick()
  458. })
  459. uni.removeStorageSync('creditImg');
  460. } else {
  461. tools.leftClick()
  462. }
  463. }
  464. });
  465. },
  466. onAuthentication(item) {
  467. if (item.type === 1) {
  468. uni.setStorageSync('clientInfoKey', item.type_keys)
  469. uni.setStorageSync('clientInfoData', this.taskData.clientInfo)
  470. } else if (item.type === 2) {
  471. uni.setStorageSync('propertyKey', item.type_keys)
  472. uni.setStorageSync('propertyData', this.taskData.property)
  473. } else if (item.type === 3) {
  474. uni.setStorageSync('propertyData', this.taskData.property)
  475. uni.setStorageSync('appliesKey', item.type_keys)
  476. uni.setStorageSync('appliesData', this.taskData.applies)
  477. } else if (item.type === 4) {
  478. uni.setStorageSync('tripartiteKey', item.type_keys)
  479. uni.setStorageSync('tripartiteData', this.taskData.tripartite)
  480. } else if (item.type === 5) {
  481. uni.setStorageSync('linkmanKey', item.type_keys)
  482. uni.setStorageSync('linkmanData', this.taskData.linkman)
  483. } else if (item.type === 6) {
  484. uni.setStorageSync('creditKey', item.type_keys)
  485. uni.setStorageSync('creditData', this.taskData.credit)
  486. } else if (item.type === 7) {
  487. uni.setStorageSync('postLoanKey', item.type_keys)
  488. uni.setStorageSync('postLoanData', this.taskData.post_loan)
  489. }
  490. uni.navigateTo({
  491. url: `${item.path}?title=${item.name}`
  492. })
  493. },
  494. closePage() {
  495. tools.leftClick()
  496. },
  497. onCeationTask() {},
  498. onLeftSubmit() {
  499. console.log('预览');
  500. },
  501. onSubmit() {
  502. console.log('提交资料');
  503. },
  504. }
  505. }
  506. </script>
  507. <style lang="scss" scoped>
  508. .info_button {
  509. width: 130rpx;
  510. height: 60rpx;
  511. border: none;
  512. line-height: 60rpx;
  513. }
  514. button::after {
  515. border: none;
  516. }
  517. </style>