Ver Fonte

no message

USER-20230908AJ\Administrator há 1 ano atrás
pai
commit
efd089e42b

+ 39 - 2
common/task/task_ima_tab.vue

@@ -24,6 +24,11 @@
 
 	export default {
 		name: 'task-ima-tab',
+    props:{
+      listType:{
+        default:0
+      }
+    },
 		data() {
 			return {
 				current: 0,
@@ -31,11 +36,43 @@
 					id: 0,
 					briefness_name: '全部',
 					product_icon: '/static/img/task/task-all.png'
-				}]
+				}],
+        typeList:[
+          {
+            id: 2,
+            briefness_name: '垫资还款',
+            product_icon: '/static/img/task/task-refund.png'
+          },
+          {
+            id: 1,
+            briefness_name: '房抵业务',
+            product_icon: '/static/img/task/task-loan.png'
+          },
+          {
+            id: 3,
+            briefness_name: '消费金融',
+            product_icon: '/static/img/task/task-financial.png'
+          },
+          {
+            id: 4,
+            briefness_name: '其他服务',
+            product_icon: '/static/img/task/task-else.png'
+          }
+        ]
 			}
 		},
+    watch:{
+
+    },
 		mounted() {
-			this.getTaskType()
+      console.log(this.listType+'----------------------------dsadsadas')
+      if(this.listType===1){
+        this.navList=this.typeList
+        console.log('--------------------------------')
+      }else {
+        this.getTaskType()
+      }
+
 		},
 		methods: {
 			getTaskType() {

+ 29 - 16
page_task/creation_task/creation_task.vue

@@ -1,45 +1,58 @@
 <template>
 	<view class="total-page page-box task-bg">
 		<Nav :title="'创建任务'" :genre="1" is_fixed></Nav>
-		<TaskImgTab></TaskImgTab>
+		<TaskImgTab @setProductId="setProductId" :list-type="1"></TaskImgTab>
 		<view class="sys-background-fff m-20 p-20 r-20">
 			<view class="creation_item row-justify-sb center line-60 sys-bg-BFD2CC r-20 p-30 m-b20"
-				v-for="(item,index) in creationLsit" :key="index" @click="onCeationTask(item)">
+				v-for="(item,index) in creationList" :key="index" @click="onCeationTask(item)">
 				<view class="row-c">
-					<image class="wh-60 m-r20" :src="item.icon" mode="aspectFill"></image>
-					<text class="size-28 text-color-12 sys-weight-400">{{item.name}}</text>
+					<image class="wh-60 m-r20" :src="item.product_icon" mode="aspectFill"></image>
+					<text class="size-28 text-color-12 sys-weight-400">{{item.product_name}}</text>
 				</view>
 				<image class="wh-45" src="/static/img/task/task-arrows.png" mode="aspectFill"></image>
 			</view>
 		</view>
+    <en-blank v-if="creationList.length<=0"></en-blank>
 	</view>
 </template>
 
 <script>
 	import TaskImgTab from "@/common/task/task_ima_tab.vue"
+  import {getTaskType} from "@/api/task";
+  import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
 
 	export default {
 		components: {
+      EnBlank,
 			TaskImgTab,
 		},
 		data() {
 			return {
-				creationLsit: [{
-					name: '垫资还款-开发区',
-					icon: '/static/img/task/task-repayment.png'
-				}, {
-					name: '提放业务',
-					icon: '/static/img/task/task-put.png'
-				}, {
-					name: '垫还',
-					icon: '/static/img/task/task-business.png'
-				}, ]
+        typeId:2,
+				creationList: [ ]
 			}
 		},
-		methods: {
+    mounted() {
+      this.getTaskType()
+    },
+    methods: {
+      setProductId(typeId){
+        if(this.typeId!==typeId){
+          this.typeId=typeId
+          this.getTaskType()
+        }
+
+      },
+      getTaskType(){
+        getTaskType({'productType':this.typeId}).then((res)=>{
+          if(res.code===1){
+            this.creationList=res.data;
+          }
+        })
+      },
 			onCeationTask(item) {
 				uni.navigateTo({
-					url: `/page_task/information/information?title=${item.name}`
+					url: `/page_task/information/information?title=${item.product_name}&productId=${item.id}`
 				})
 			}
 		}

+ 52 - 13
page_task/identity/identity.vue

@@ -4,21 +4,21 @@
 			<!-- 步鄹条start -->
 			<view class="task-tabs" :style="{top:`${$tools.topHeight()}px`}">
 				<view class="row-justify-sb m-lr50 m-tb20">
-					<view class="column-c" style="text-align: center;">
+					<view class="column-c" style="text-align: center;" @click="setNum(1)">
 						<image class="wh-45 m-b16" :src="`/static/img/information/${step === 1?'double':'correct'}.png`"
 							mode="aspectFill"></image>
 						<text class="size-24"
 							:class="step === 1?'color-0FB160 sys-weight-600':'sys-weight-400'">身份认证</text>
 					</view>
 					<view class="line"></view>
-					<view class="column-c justify-center">
+					<view class="column-c justify-center" @click="setNum(2)">
 						<image class="wh-45 m-b16" :src="`/static/img/information/${stepTwo[step-1]}.png`"
 							mode="aspectFill"></image>
 						<text class="size-24"
 							:class="step === 2?'color-0FB160 sys-weight-600':'sys-weight-400'">教育职业信息</text>
 					</view>
 					<view class="line"></view>
-					<view class="column-c justify-center">
+					<view class="column-c justify-center" @click="setNum(3)">
 						<image class="wh-45 m-b16" :src="`/static/img/information/${stepThree[step-1]}.png`"
 							mode="aspectFill"></image>
 						<text class="size-24"
@@ -37,7 +37,7 @@
 					<view class="size-26 m-t10 text-color-999">应监管要求,请先进行身份认证</view>
 					<view class="sys-bg-BFD2CC row-justify-sb sys-weight-500 center r-20 p-30 m-t40">
 						<view class="row-c flex">
-							<image class="wh-45 m-r20" src="../../static/img/logo.png" mode=""></image>
+							<image class="wh-45 m-r20" src="/static/img/task/sf_icon.png" mode=""></image>
 							<text class="size-26">身份证认证</text>
 						</view>
 						<button class="attestation-button button-background button-color size-26 r-30" type="default"
@@ -83,9 +83,9 @@
 			</view>
 			<!-- 社保信息end -->
 		</view>
-		<EnButton :text="'完成'" @onSubmit="onSubmit" v-if="step === 3 || step === 4">
-		</EnButton>
-		<EnButton is_both :leftText="'保存'" :rightText="'下一步'" @onLeftSubmit="onLeftSubmit" @onSubmit="onStep" v-else>
+		<EnButton :text="'完成'" @onSubmit="onSubmit" v-if="step === 3 || step === 4"></EnButton>
+		<EnButton is_both :leftText="'保存'" :rightText="'下一步'" @onLeftSubmit="onLeftSubmit" @onSubmit="onStep(1)" v-else>
+		<EnButton is_both :leftText="'上一步'" :rightText="'保存'" @onLeftSubmit="onStep(0)" @onSubmit="ponLeftSubmit" v-else>
 		</EnButton>
 
 	</view>
@@ -109,16 +109,49 @@
 				stepThree: ['three', 'three', 'double', 'correct'],
 				value: '',
 				formData: {
-					name: '',
-					sex: '',
-					id_number: ''
+          "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": []
 				}
 			}
 		},
 		onLoad(options) {
 			this.title = options.title
+      let clientInfoData=uni.getStorageSync('clientInfoData')
+      let clientInfoKey=uni.getStorageSync('clientInfoKey')
+      console.log(clientInfoData,clientInfoKey)
 		},
 		methods: {
+      setNum(step){
+        if(this.step!==step){
+          this.step=step
+        }
+      },
 			//  身份认证
 			onAuthentication(item) {
 				uni.navigateTo({
@@ -132,9 +165,15 @@
 				this.step--
 			},
 			// 下一步
-			onStep() {
-				if (this.step === 3) return
-				this.step++
+			onStep(type) {
+        if(type===1){
+          if (this.step === 3) return
+          this.step++
+        }else {
+          if (this.step === 1) return
+          this.step--
+        }
+
 			},
 			// 完成
 			onSubmit() {

+ 409 - 15
page_task/information/information.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="total-page page-box task-bg">
-		<Nav :title="title" :genre="1" :fixedHeight="105"></Nav>
+		<Nav :title="productInfo.product_name" :genre="1" :fixedHeight="105"></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" @click="onCeationTask(item)">
+					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>
@@ -13,9 +13,7 @@
 						</view>
 					</view>
 					<view class="">
-						<button class="button-background info_button sys-weight-500 text-color-fff size-26 r-100"
-							type="default" hover-class="is-hover" v-if="!item.is_finish"
-							@click="onAuthentication(item)">待上传</button>
+						<button class="button-background info_button sys-weight-500 text-color-fff size-26 r-100">待上传</button>
 						<button class="info_button sys-bg-CBCBCB sys-weight-500 text-color-fff size-26 r-100"
 							v-else>已认证</button>
 					</view>
@@ -29,6 +27,16 @@
 
 <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: {
@@ -43,45 +51,431 @@
 					icon: '/static/img/task/task-identity.png',
 					path: '/page_task/identity/identity',
 					type: 1,
-					is_finish: false
+					is_finish: false,
+					is_show: false,
+          type_keys:[]
 				}, {
 					name: '资产信息',
 					explain: '房产、车辆等资产',
 					icon: '/static/img/task/task-property.png',
 					path: '/page_task/property/property',
 					type: 2,
-					is_finish: false
+					is_finish: false,
+          is_show: false,
+          type_keys:[]
 				}, {
 					name: '申请信息',
 					explain: '贷款额度信息',
 					icon: '/static/img/task/task-apply.png',
 					path: '/page_task/apply/apply',
 					type: 3,
-					is_finish: false
+					is_finish: false,
+          is_show: false,
+          type_keys:[]
 				}, {
+          name: '第三方信息',
+          explain: '第三方企业/人员相关信息',
+          icon: '/static/img/task/task-apply.png',
+          path: '/page_task/apply/apply',
+          type: 4,
+          is_finish: false,
+          is_show: false,
+          type_keys:[]
+        },{
 					name: '联系人信息',
 					explain: '其他联系人',
 					icon: '/static/img/task/task-contacts.png',
-					type: 4,
-					is_finish: false
+					type: 5,
+					is_finish: false,
+          is_show: false,
+          type_keys:[]
 				}, {
 					name: '征信信息',
 					explain: '银行征信信息',
 					icon: '/static/img/task/task-credit.png',
-					type: 5,
-					is_finish: false
-				}, ]
+					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
 			}
 		},
-		onLoad(options) {
-			this.title = options.title
+    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)
+        }
+      }
 		},
 		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 typeRow=this.productInfo.type_data[verifyKey];
+        let data={}
+        if(typeRow.type==='1'){
+          data=this.taskData.clientInfo
+        }else if(typeRow.type==='2'){
+          data=this.taskData.property
+        }else if(typeRow.type==='3'){
+          data=this.taskData.applies
+        }else if(typeRow.type==='4'){
+          data=this.taskData.tripartite
+        }else if(typeRow.type==='5'){
+          data=this.taskData.linkman
+        }else if(typeRow.type==='6'){
+          data=this.taskData.credit
+        }else if(typeRow.type==='7'){
+          data=this.taskData.post_loan
+        }
+        console.log(data)
+        verifyBusinessModuleKey({'productId':this.productInfo.id,'data':data,'type':typeRow.type}).then((res)=>{
+          this.productInfo.type_data[verifyKey].is_end = 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
+            }
+            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
+            }
+            console.log('-----------this.taskData-------------',this.taskData)
+          }
+        })
+      },
+      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('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('预览');

+ 5 - 0
pages.json

@@ -188,6 +188,11 @@
 				"name": "任务详情",
 				"path": "/page_task/task_details/task_details",
 				"query": "taskId=4278"
+			},
+			{
+				"name": "添加任务",
+				"path": "/page_task/information/information",
+				"query": "productId=1"
 			}
 
 		]

BIN
static/img/task/sf_icon.png