information.vue 15 KB

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