information.vue 14 KB

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