information.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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: '/static/img/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: '/static/img/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: '/static/img/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: '/static/img/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: '/static/img/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: '/static/img/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. },
  217. methods: {
  218. addTask() {
  219. console.log('addTask----start')
  220. // let isEnd=false;
  221. // this.productInfo.type_data.forEach((typeItem,typeKey)=>{
  222. // if(!typeItem.is_end && !isEnd && typeKey!==this.stepsNum){
  223. // isEnd=true
  224. // tools.error('完善'+typeItem.type_name)
  225. // }
  226. // })
  227. // if(isEnd){
  228. // return;
  229. // }
  230. if (this.isAjax) {
  231. return;
  232. }
  233. this.isAjax = true;
  234. addTask(this.taskData).then((res) => {
  235. if (res.code === 1) {
  236. tools.success(res.msg)
  237. // uni.$emit('goToTaskList', 0)
  238. setTimeout(() => {
  239. uni.redirectTo({
  240. url: 'pages-task/task-info/task-info?id=' + res.data.id
  241. });
  242. }, 1500)
  243. } else {
  244. this.isAjax = false;
  245. tools.error(res.msg)
  246. }
  247. })
  248. },
  249. addDraft() {
  250. addDraft(this.taskData).then((res) => {
  251. if (res.code === 1) {
  252. tools.success(res.msg)
  253. delBusinessCache({
  254. 'productId': this.productInfo.id
  255. }).then((res) => {
  256. uni.$emit('setNewDraft')
  257. setTimeout(() => {
  258. tools.leftClick()
  259. }, 1000)
  260. })
  261. } else {
  262. tools.error(res.msg)
  263. }
  264. })
  265. },
  266. verifyBusinessModuleKey(verifyKey) {
  267. let typeRow = this.productInfo.type_data[verifyKey];
  268. let data = {}
  269. if (typeRow.type === '1') {
  270. data = this.taskData.clientInfo
  271. } else if (typeRow.type === '2') {
  272. data = this.taskData.property
  273. } else if (typeRow.type === '3') {
  274. data = this.taskData.applies
  275. } else if (typeRow.type === '4') {
  276. data = this.taskData.tripartite
  277. } else if (typeRow.type === '5') {
  278. data = this.taskData.linkman
  279. } else if (typeRow.type === '6') {
  280. data = this.taskData.credit
  281. } else if (typeRow.type === '7') {
  282. data = this.taskData.post_loan
  283. }
  284. console.log(data)
  285. verifyBusinessModuleKey({
  286. 'productId': this.productInfo.id,
  287. 'data': data,
  288. 'type': typeRow.type
  289. }).then((res) => {
  290. this.productInfo.type_data[verifyKey].is_end = res.code === 1;
  291. })
  292. },
  293. getClientInfo() {
  294. //获取客户原始数据
  295. if (this.taskData.clientInfo.id_number === '') {
  296. return;
  297. }
  298. getClientInfo({
  299. 'id_number': this.taskData.clientInfo.id_number,
  300. 'productId': this.taskData.productId
  301. }).then((res) => {
  302. if (res.code === 1) {
  303. this.isNew = false
  304. if (res.data.business) {
  305. res.data.business.id = ''
  306. this.taskData.clientInfo = res.data.business
  307. uni.$emit('setClientData',this.taskData.clientInfo)
  308. }
  309. if (res.data.propertyList) {
  310. this.taskData.property = res.data.propertyList
  311. if (this.taskData.property) {
  312. this.taskData.property.forEach((item) => {
  313. item.id = ''
  314. })
  315. }
  316. }
  317. if (res.data.applyFor) {
  318. res.data.applyFor.id = ''
  319. this.taskData.applies = res.data.applyFor
  320. if (this.taskData.applies.apply_data) {
  321. this.taskData.applies.apply_data.forEach((item) => {
  322. item.id = ''
  323. })
  324. }
  325. }
  326. if (res.data.tripartite) {
  327. this.taskData.tripartite = res.data.tripartite
  328. this.taskData.tripartite.forEach((item) => {
  329. item.id = ''
  330. })
  331. }
  332. if (res.data.linkman) {
  333. res.data.linkman.forEach((item) => {
  334. item.id = ''
  335. })
  336. this.taskData.linkman = res.data.linkman
  337. }
  338. if (res.data.credit) {
  339. this.taskData.credit = res.data.credit
  340. this.taskData.credit.deal_data.forEach((item) => {
  341. item.id = ''
  342. })
  343. this.taskData.credit.overdue_data.forEach((item) => {
  344. item.id = ''
  345. })
  346. this.taskData.credit.query_data.forEach((item) => {
  347. item.id = ''
  348. })
  349. }
  350. if (res.data.postLoan) {
  351. this.taskData.post_loan = res.data.postLoan
  352. }
  353. }
  354. })
  355. },
  356. setBusinessCache() {
  357. //设置缓存
  358. if (this.isCache) {
  359. return false
  360. }
  361. this.isCache = true
  362. setBusinessCache(this.taskData).then((res) => {
  363. setTimeout(() => {
  364. this.isCache = false;
  365. }, 2000)
  366. })
  367. },
  368. getBusinessCache(productId) {
  369. //获取缓存
  370. getBusinessCache({
  371. 'productId': productId
  372. }).then((res) => {
  373. if (res.code === 1) {
  374. if (res.data.productId !== 0) {
  375. this.isNew = false
  376. this.taskData = res.data
  377. }
  378. }
  379. })
  380. },
  381. getTaskTypeInfo(id) {
  382. getTaskTypeInfo({
  383. 'id': id
  384. }).then((res) => {
  385. if (res.code === 1) {
  386. this.productInfo = res.data;
  387. if (this.isNew) this.getBusinessCache(id)
  388. } else {
  389. tools.error(res.msg)
  390. setTimeout(() => {
  391. this.closePage();
  392. }, 1000)
  393. }
  394. })
  395. },
  396. getDraftItem(draftId) {
  397. getDraftItem({
  398. 'draftId': draftId
  399. }).then((res) => {
  400. if (res.code === 1) {
  401. this.productInfo = res.data.productInfo
  402. this.taskData = res.data.taskData
  403. this.getTaskTypeInfo(this.taskData.productId)
  404. } else {
  405. this.closePage();
  406. }
  407. })
  408. },
  409. async getTaskDetail(businessId) {
  410. const res = await getTaskDetail({
  411. id: businessId
  412. })
  413. if (res.code === 1) {
  414. if (res.data.product) {
  415. this.productInfo = res.data.product
  416. this.taskData.productId = res.data.product.id
  417. }
  418. if (res.data.business) {
  419. this.taskData.clientInfo = res.data.business
  420. }
  421. if (res.data.propertyList) {
  422. this.taskData.property = res.data.propertyList
  423. }
  424. if (res.data.applyFor) {
  425. this.taskData.applies = res.data.applyFor
  426. }
  427. if (res.data.tripartite) {
  428. this.taskData.tripartite = res.data.tripartite
  429. }
  430. if (res.data.linkman) {
  431. this.taskData.linkman = res.data.linkman
  432. console.log('this.taskData.linkman:', this.taskData.linkman)
  433. }
  434. if (res.data.credit) {
  435. this.taskData.credit = res.data.credit
  436. }
  437. if (res.data.postLoan) {
  438. this.taskData.post_loan = res.data.postLoan
  439. }
  440. this.getTaskTypeInfo(this.taskData.productId)
  441. } else {
  442. this.closePage();
  443. }
  444. },
  445. delBusinessCache() {
  446. uni.showModal({
  447. title: '警告',
  448. content: '是否退出当前任务,并清除缓存!',
  449. success: (res) => {
  450. if (res.confirm) {
  451. delBusinessCache({
  452. 'productId': this.productInfo.id
  453. }).then((res) => {
  454. tools.leftClick()
  455. })
  456. uni.removeStorageSync('creditImg');
  457. } else {
  458. tools.leftClick()
  459. }
  460. }
  461. });
  462. },
  463. onAuthentication(item) {
  464. if (item.type === 1) {
  465. uni.setStorageSync('clientInfoKey', item.type_keys)
  466. uni.setStorageSync('clientInfoData', this.taskData.clientInfo)
  467. } else if (item.type === 2) {
  468. uni.setStorageSync('propertyKey', item.type_keys)
  469. uni.setStorageSync('propertyData', this.taskData.property)
  470. } else if (item.type === 3) {
  471. uni.setStorageSync('appliesKey', item.type_keys)
  472. uni.setStorageSync('appliesData', this.taskData.applies)
  473. } else if (item.type === 4) {
  474. uni.setStorageSync('tripartiteKey', item.type_keys)
  475. uni.setStorageSync('tripartiteData', this.taskData.tripartite)
  476. } else if (item.type === 5) {
  477. uni.setStorageSync('linkmanKey', item.type_keys)
  478. uni.setStorageSync('linkmanData', this.taskData.linkman)
  479. } else if (item.type === 6) {
  480. uni.setStorageSync('creditKey', item.type_keys)
  481. uni.setStorageSync('creditData', this.taskData.credit)
  482. } else if (item.type === 7) {
  483. uni.setStorageSync('postLoanKey', item.type_keys)
  484. uni.setStorageSync('postLoanData', this.taskData.post_loan)
  485. }
  486. uni.navigateTo({
  487. url: `${item.path}?title=${item.name}`
  488. })
  489. },
  490. closePage() {
  491. tools.leftClick()
  492. },
  493. onCeationTask() {},
  494. onLeftSubmit() {
  495. console.log('预览');
  496. },
  497. onSubmit() {
  498. console.log('提交资料');
  499. },
  500. }
  501. }
  502. </script>
  503. <style lang="scss" scoped>
  504. .info_button {
  505. width: 130rpx;
  506. height: 60rpx;
  507. border: none;
  508. line-height: 60rpx;
  509. }
  510. button::after {
  511. border: none;
  512. }
  513. </style>