| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539 |
- <template>
- <view class="total-page page-box task-bg">
- <Nav :title="productInfo.product_name" :genre="1" is_fixed></Nav>
- <view class="task-tabs" :style="{top:`${$tools.topHeight()}px`}">
- <view class="m-t20">
- <view class="creation_item row-justify-sb center sys-background-fff m-lr30 m-b20 p-30 r-20"
- v-for="(item,index) in informationList" :key="index" v-show="item.is_show"
- @click="onAuthentication(item)">
- <view class="row-c">
- <image class="wh-80 m-r20 r-100" :src="item.icon" mode="aspectFill"></image>
- <view>
- <text class="size-28 text-color-12 sys-weight-600">{{item.name}}</text>
- <view class="size-24 text-color-999 m-t10">{{item.explain}}</view>
- </view>
- </view>
- <view class="">
- <button class="button-background info_button sys-weight-500 text-color-fff size-26 r-100" v-if="item.is_finish">已完成</button>
- <button class="sys-bg-CBCBCB info_button sys-weight-500 text-color-fff size-26 r-100" v-else>待上传</button>
- </view>
- </view>
- </view>
- </view>
- <EnButton is_both :leftText="'预览'" :rightText="'提交资料'" @onLeftSubmit="onLeftSubmit" @onSubmit="onSubmit">
- </EnButton>
- </view>
- </template>
- <script>
- import TaskImgTab from "@/common/task/task_ima_tab.vue"
- import tools from "@/service/tools";
- import {
- addDraft,
- addTask,
- delBusinessCache,
- getBusinessCache,
- getClientInfo,
- getDraftItem,
- getTaskDetail,
- getTaskTypeInfo,
- setBusinessCache,
- verifyBusinessModuleKey
- } from "@/api/task";
- export default {
- components: {
- TaskImgTab,
- },
- data() {
- return {
- title: '',
- informationList: [{
- name: '身份信息',
- explain: '身份证、婚姻、职业、社保信息',
- icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-identity.png',
- path: '/page_task/identity/identity',
- type: 1,
- is_finish: false,
- is_show: false,
- type_keys: []
- }, {
- name: '资产信息',
- explain: '房产、车辆等资产',
- icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-property.png',
- path: '/page_task/property/property',
- type: 2,
- is_finish: false,
- is_show: false,
- type_keys: []
- }, {
- name: '申请信息',
- explain: '贷款额度信息',
- icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-apply.png',
- path: '/page_task/apply/apply',
- type: 3,
- is_finish: false,
- is_show: false,
- type_keys: []
- }, {
- name: '第三方信息',
- explain: '第三方企业/人员相关信息',
- icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-three.png',
- path: '/page_task/tripartite_info/tripartite_info',
- type: 4,
- is_finish: false,
- is_show: false,
- type_keys: []
- }, {
- name: '联系人信息',
- explain: '其他联系人',
- icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-contacts.png',
- type: 5,
- path: '/page_task/linkman/linkman',
- is_finish: false,
- is_show: false,
- type_keys: []
- },{
- name: '征信信息',
- explain: '银行征信信息',
- icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-credit.png',
- type: 6,
- is_finish: false,
- is_show: false,
- type_keys: []
- }, ],
- stepsNum: 0,
- stepsKey: 0,
- productInfo: {
- id: 1,
- product_name: "",
- product_types: '',
- field_ids: [],
- type_data: [],
- },
- taskData: {
- 'productId': '',
- "clientInfo": {
- "name": "",
- "birthday": "",
- "sex": 1,
- "id_number": "",
- "identity_one": "",
- "identity_two": "",
- "phone": "",
- "marriage_type": 1,
- "education_type": '',
- "education_name": '',
- "employ_type": 1,
- "firm_name": "",
- "firm_address": "",
- "resident_city": "",
- "resident_address": "",
- "mate_name": "",
- "mate_phone": "",
- "mate_id_number": "",
- "mate_firm": "",
- "m_code": "",
- "code": "",
- "m_identity_one": "",
- "m_identity_two": "",
- "firm_city": "",
- "social_num": "",
- "reserved_money": "",
- "marriage_img": [],
- "credit_img": []
- },
- "property": [],
- "applies": {
- "is_farming": '1',
- "loan_form": '',
- "loan_type": '',
- "loan_industry": [],
- "enterprise_type": "",
- "use_date": "",
- "pay_status": '1',
- "quota": "",
- "apply_data": []
- },
- "tripartite": [],
- "linkman": [],
- "credit": {
- 'credit_img': [],
- 'deal_data': [],
- 'overdue_data': [],
- 'query_data': [],
- },
- "post_loan": {
- 'bank_id': '',
- 'loans_money': '',
- 'interest_rate': '',
- 'repayment_money': '',
- 'refund_num': '',
- 'repayment_type': '',
- 'repayment_date': '',
- },
- },
- isCache: true,
- isNew: true
- }
- },
- watch: {
- 'productInfo.product_types': function() {
- let productTypes = this.productInfo.product_types
- if (typeof productTypes === 'string') {
- productTypes = productTypes.split(',')
- }
- this.informationList.forEach(item => {
- item.is_show = productTypes.indexOf(item.type + '') >= 0;
- this.productInfo.type_data.forEach(val => {
- if (val.type === item.type + '') {
- item.type_keys = val.type_keys
- }
- })
- })
- }
- },
- onLoad(data) {
- if (data.draftId) {
- this.getDraftItem(data.draftId)
- this.isNew = false
- } else if (data.businessId) {
- this.getTaskDetail(data.businessId)
- this.isNew = false
- } else {
- if (data.productId === undefined) {
- tools.leftClick()
- } else {
- this.taskData.productId = data.productId
- this.getTaskTypeInfo(data.productId)
- }
- }
- uni.$on('putClientInfo',clientInfo=>{
- if(this.taskData.clientInfo.id_number!==clientInfo.id_number){
- this.taskData.clientInfo=clientInfo
- this.getClientInfo()
- }else {
- this.taskData.clientInfo=clientInfo
- this.verifyBusinessModuleKey(1)
- }
- })
- //更新第三方信息
- uni.$on('putTripartiteInfo',tripartiteInfo=>{
- this.taskData.tripartite=tripartiteInfo
- this.verifyBusinessModuleKey(4)
- })
- //更新联系人信息
- uni.$on('putLinkmenInfo',linkmenInfo=>{
- this.taskData.linkman=linkmenInfo
- this.verifyBusinessModuleKey(5)
- })
- },
- methods: {
- addTask() {
- console.log('addTask----start')
- // let isEnd=false;
- // this.productInfo.type_data.forEach((typeItem,typeKey)=>{
- // if(!typeItem.is_end && !isEnd && typeKey!==this.stepsNum){
- // isEnd=true
- // tools.error('完善'+typeItem.type_name)
- // }
- // })
- // if(isEnd){
- // return;
- // }
- if (this.isAjax) {
- return;
- }
- this.isAjax = true;
- addTask(this.taskData).then((res) => {
- if (res.code === 1) {
- tools.success(res.msg)
- // uni.$emit('goToTaskList', 0)
- setTimeout(() => {
- uni.redirectTo({
- url: 'pages-task/task-info/task-info?id=' + res.data.id
- });
- }, 1500)
- } else {
- this.isAjax = false;
- tools.error(res.msg)
- }
- })
- },
- addDraft() {
- addDraft(this.taskData).then((res) => {
- if (res.code === 1) {
- tools.success(res.msg)
- delBusinessCache({
- 'productId': this.productInfo.id
- }).then((res) => {
- uni.$emit('setNewDraft')
- setTimeout(() => {
- tools.leftClick()
- }, 1000)
- })
- } else {
- tools.error(res.msg)
- }
- })
- },
- verifyBusinessModuleKey(verifyKey) {
- let data = {}
- if (verifyKey === 1) {
- data = this.taskData.clientInfo
- } else if (verifyKey === 2) {
- data = this.taskData.property
- } else if (verifyKey === 3) {
- data = this.taskData.applies
- } else if (verifyKey === 4) {
- data = this.taskData.tripartite
- } else if (verifyKey === 5) {
- data = this.taskData.linkman
- } else if (verifyKey === 6) {
- data = this.taskData.credit
- } else if (verifyKey === 7) {
- data = this.taskData.post_loan
- }
- console.log(data)
- verifyBusinessModuleKey({
- 'productId': this.productInfo.id,
- 'data': data,
- 'type': verifyKey
- }).then((res) => {
- this.informationList.forEach(item=>{
- if(item.type===verifyKey){
- item.is_finish= res.code === 1;
- }
- })
- })
- },
- getClientInfo() {
- //获取客户原始数据
- if (this.taskData.clientInfo.id_number === '') {
- return;
- }
- getClientInfo({
- 'id_number': this.taskData.clientInfo.id_number,
- 'productId': this.taskData.productId
- }).then((res) => {
- if (res.code === 1) {
- this.isNew = false
- if (res.data.business) {
- res.data.business.id = ''
- this.taskData.clientInfo = res.data.business
- uni.$emit('setClientData',this.taskData.clientInfo)
- }
- if (res.data.propertyList) {
- this.taskData.property = res.data.propertyList
- if (this.taskData.property) {
- this.taskData.property.forEach((item) => {
- item.id = ''
- })
- }
- }
- if (res.data.applyFor) {
- res.data.applyFor.id = ''
- this.taskData.applies = res.data.applyFor
- if (this.taskData.applies.apply_data) {
- this.taskData.applies.apply_data.forEach((item) => {
- item.id = ''
- })
- }
- }
- if (res.data.tripartite) {
- this.taskData.tripartite = res.data.tripartite
- this.taskData.tripartite.forEach((item) => {
- item.id = ''
- })
- }
- if (res.data.linkman) {
- res.data.linkman.forEach((item) => {
- item.id = ''
- })
- this.taskData.linkman = res.data.linkman
- }
- if (res.data.credit) {
- this.taskData.credit = res.data.credit
- this.taskData.credit.deal_data.forEach((item) => {
- item.id = ''
- })
- this.taskData.credit.overdue_data.forEach((item) => {
- item.id = ''
- })
- this.taskData.credit.query_data.forEach((item) => {
- item.id = ''
- })
- }
- if (res.data.postLoan) {
- this.taskData.post_loan = res.data.postLoan
- }
- }
- })
- },
- setBusinessCache() {
- //设置缓存
- if (this.isCache) {
- return false
- }
- this.isCache = true
- setBusinessCache(this.taskData).then((res) => {
- setTimeout(() => {
- this.isCache = false;
- }, 2000)
- })
- },
- getBusinessCache(productId) {
- //获取缓存
- getBusinessCache({
- 'productId': productId
- }).then((res) => {
- if (res.code === 1) {
- if (res.data.productId !== 0) {
- this.isNew = false
- this.taskData = res.data
- }
- }
- })
- },
- getTaskTypeInfo(id) {
- getTaskTypeInfo({
- 'id': id
- }).then((res) => {
- if (res.code === 1) {
- this.productInfo = res.data;
- if (this.isNew) this.getBusinessCache(id)
- } else {
- tools.error(res.msg)
- setTimeout(() => {
- this.closePage();
- }, 1000)
- }
- })
- },
- getDraftItem(draftId) {
- getDraftItem({
- 'draftId': draftId
- }).then((res) => {
- if (res.code === 1) {
- this.productInfo = res.data.productInfo
- this.taskData = res.data.taskData
- this.getTaskTypeInfo(this.taskData.productId)
- } else {
- this.closePage();
- }
- })
- },
- async getTaskDetail(businessId) {
- const res = await getTaskDetail({
- id: businessId
- })
- if (res.code === 1) {
- if (res.data.product) {
- this.productInfo = res.data.product
- this.taskData.productId = res.data.product.id
- }
- if (res.data.business) {
- this.taskData.clientInfo = res.data.business
- }
- if (res.data.propertyList) {
- this.taskData.property = res.data.propertyList
- }
- if (res.data.applyFor) {
- this.taskData.applies = res.data.applyFor
- }
- if (res.data.tripartite) {
- this.taskData.tripartite = res.data.tripartite
- }
- if (res.data.linkman) {
- this.taskData.linkman = res.data.linkman
- console.log('this.taskData.linkman:', this.taskData.linkman)
- }
- if (res.data.credit) {
- this.taskData.credit = res.data.credit
- }
- if (res.data.postLoan) {
- this.taskData.post_loan = res.data.postLoan
- }
- this.getTaskTypeInfo(this.taskData.productId)
- } else {
- this.closePage();
- }
- },
- delBusinessCache() {
- uni.showModal({
- title: '警告',
- content: '是否退出当前任务,并清除缓存!',
- success: (res) => {
- if (res.confirm) {
- delBusinessCache({
- 'productId': this.productInfo.id
- }).then((res) => {
- tools.leftClick()
- })
- uni.removeStorageSync('creditImg');
- } else {
- tools.leftClick()
- }
- }
- });
- },
- onAuthentication(item) {
- if (item.type === 1) {
- uni.setStorageSync('clientInfoKey', item.type_keys)
- uni.setStorageSync('clientInfoData', this.taskData.clientInfo)
- } else if (item.type === 2) {
- uni.setStorageSync('propertyKey', item.type_keys)
- uni.setStorageSync('propertyData', this.taskData.property)
- } else if (item.type === 3) {
- uni.setStorageSync('propertyData', this.taskData.property)
- uni.setStorageSync('appliesKey', item.type_keys)
- uni.setStorageSync('appliesData', this.taskData.applies)
- } else if (item.type === 4) {
- uni.setStorageSync('tripartiteKey', item.type_keys)
- uni.setStorageSync('tripartiteData', this.taskData.tripartite)
- } else if (item.type === 5) {
- uni.setStorageSync('linkmanKey', item.type_keys)
- uni.setStorageSync('linkmanData', this.taskData.linkman)
- } else if (item.type === 6) {
- uni.setStorageSync('creditKey', item.type_keys)
- uni.setStorageSync('creditData', this.taskData.credit)
- } else if (item.type === 7) {
- uni.setStorageSync('postLoanKey', item.type_keys)
- uni.setStorageSync('postLoanData', this.taskData.post_loan)
- }
- uni.navigateTo({
- url: `${item.path}?title=${item.name}`
- })
- },
- closePage() {
- tools.leftClick()
- },
- onCeationTask() {},
- onLeftSubmit() {
- console.log('预览');
- },
- onSubmit() {
- console.log('提交资料');
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .info_button {
- width: 130rpx;
- height: 60rpx;
- border: none;
- line-height: 60rpx;
- }
- button::after {
- border: none;
- }
- </style>
|