Explorar o código

1.新增个贷下单页面

GouGengquan hai 1 mes
pai
achega
1ad7e8265b

+ 5 - 0
src/api/personal.js

@@ -13,4 +13,9 @@ export function getPersonalTodoDetail(params) {
 // 获取个贷评估对象详情
 export function getPersonalTargetDetail(params) {
     return request.get(`personalTarget/${params}`)
+}
+
+// 个贷新增订单
+export function add(params) {
+    return request.post(`personal`, params)
 }

+ 9 - 0
src/router/index.js

@@ -18,6 +18,7 @@ import AssetsTodoDetailView from '@/views/assets/todoDetail.vue'
 // 个贷业务
 import PersonalIndex from '@/views/personal/index.vue'
 import PersonalTodoDetailView from '@/views/personal/todoDetail.vue'
+import PersonalPlaceOrderView from '@/views/personal/placeOrder.vue'
 
 // 大中型业务
 import MajorIndex from '@/views/major/index.vue'
@@ -112,6 +113,14 @@ const routes = [
               title: '待办处理-个贷'
             },
           },
+          {
+            path: 'placeOrder',
+            component: PersonalPlaceOrderView,
+            name: 'personalPlaceOrder',
+            meta: {
+              title: '个贷业务下单'
+            },
+          },
         ]
       },
       // 大中型业务

+ 1 - 1
src/views/home/start.vue

@@ -19,7 +19,7 @@
         </svg>
         <div class="icon-word">大中型下单</div>
       </div>
-      <div class="icon-area">
+      <div class="icon-area" @click="goBench('/index/personal/placeOrder')">
         <svg t="1716189375497" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709" width="48" height="48">
           <path
             d="M810.666667 1024H213.333333c-117.333333 0-213.333333-96-213.333333-213.333333V213.333333C0 96 96 0 213.333333 0h597.333334c117.333333 0 213.333333 96 213.333333 213.333333v597.333334c0 117.333333-96 213.333333-213.333333 213.333333z"

+ 5 - 5
src/views/major/placeOrder.vue

@@ -12,7 +12,7 @@
             name="financial"
             placeholder="请选择订单属性"
             clearable
-            :rules="[{ required: true, message: '请选择订单属性', trigger:'onBlur' }]"
+            :rules="[{ required: true, message: '请选择订单属性' }]"
             :required="true"
           />
           <VanSinglePicker
@@ -111,7 +111,7 @@
           />
           <van-field name="dispenseBenefitRadio" label="分配产值" :rules="[{ required: true, message: '请选择客户联系人' }]" required>
             <template #input>
-              <van-radio-group v-model="major.dispenseBenefit" direction="horizontal">
+              <van-radio-group v-model="major.dispenseBenefit" direction="horizontal" icon-size="14px">
                 <van-radio name="false">否</van-radio>
                 <van-radio name="true">是</van-radio>
               </van-radio-group>
@@ -119,7 +119,7 @@
           </van-field>
           <van-field name="nonnativeRadio" label="是否异地" :rules="[{ required: true, message: '请选择客户联系人' }]" required>
             <template #input>
-              <van-radio-group v-model="major.nonnative" direction="horizontal">
+              <van-radio-group v-model="major.nonnative" direction="horizontal" icon-size="14px">
                 <van-radio name="false">否</van-radio>
                 <van-radio name="true">是</van-radio>
               </van-radio-group>
@@ -127,7 +127,7 @@
           </van-field>
           <van-field name="refinanceRadio" label="是否续贷" :rules="[{ required: true, message: '请选择客户联系人' }]" required>
             <template #input>
-              <van-radio-group v-model="major.refinance" direction="horizontal">
+              <van-radio-group v-model="major.refinance" direction="horizontal" icon-size="14px">
                 <van-radio name="false">否</van-radio>
                 <van-radio name="true">是</van-radio>
               </van-radio-group>
@@ -135,7 +135,7 @@
           </van-field>
           <van-field name="loanExpireRadio" label="贷款到期" :rules="[{ required: true, message: '请选择客户联系人' }]">
             <template #input>
-              <van-radio-group v-model="major.loanExpire" direction="horizontal">
+              <van-radio-group v-model="major.loanExpire" direction="horizontal" icon-size="14px">
                 <van-radio name="false">否</van-radio>
                 <van-radio name="true">是</van-radio>
               </van-radio-group>

+ 288 - 0
src/views/personal/placeOrder.vue

@@ -0,0 +1,288 @@
+<template>
+  <div>
+    <van-nav-bar title="个贷业务下单" left-text="返回" left-arrow @click-left="onClickLeft()" />
+    <div class="form-style">
+      <van-form @submit="addPersonalOrder()">
+        <van-cell-group inset>
+          <van-field label="客户经理" v-model="personal.clientManager" name="clientManager" readonly />
+          <VanSinglePicker
+            label="评估目的"
+            v-model="personal.evaluateAim"
+            v-bind:columns="evaluateAimColumns"
+            name="evaluateAim"
+            placeholder="请选择评估目的"
+            clearable
+            :rules="[{ required: true, message: '请选择评估目的' }]"
+            :required="true"
+          />
+          <van-field label="房屋用途" name="purpose" :rules="[{ required: true, message: '请选择房屋用途' }]" required>
+            <template #input>
+              <van-checkbox-group v-model="personal.purpose" direction="horizontal">
+                <van-checkbox name="HOUSE" shape="square" style="margin: 2px" icon-size="14px">住宅</van-checkbox>
+                <van-checkbox name="BUSINESS" shape="square" style="margin: 2px" icon-size="14px">商业</van-checkbox>
+                <van-checkbox name="OFFICE" shape="square" style="margin: 2px" icon-size="14px">办公</van-checkbox>
+                <van-checkbox name="INDUSTRIAL" shape="square" style="margin: 2px" icon-size="14px">工业</van-checkbox>
+                <van-checkbox name="OTHER" shape="square" style="margin: 2px" icon-size="14px">其他</van-checkbox>
+              </van-checkbox-group>
+            </template>
+          </van-field>
+          <van-field label="坐落" v-model="personal.location" name="location" type="textarea" placeholder="请输入坐落" :rules="[{ required: true, message: '请输入坐落' }]" required />
+          <VanSinglePicker
+            label="客户类型"
+            v-model="personal.clienteleType"
+            v-bind:columns="clienteleTypeColumns"
+            name="clienteleType"
+            placeholder="请选择客户类型"
+            @change="changeCustomerType(0)"
+            clearable
+            :rules="[{ required: true, message: '请选择客户类型' }]"
+            :required="true"
+          />
+          <VanSinglePicker
+            label="客户名称"
+            v-model="personal.clienteleId"
+            v-bind:columns="customerCompanyColumns"
+            name="clienteleId"
+            placeholder="请选择客户名称"
+            @change="findSubCustomerCompany(0)"
+            clearable
+            :rules="[{ required: true, message: '请选择客户名称' }]"
+            :required="true"
+            v-if="personal.clienteleType === '企业'"
+          />
+          <VanSinglePicker
+            label="业务来源"
+            v-model="personal.clienteleSubId"
+            v-bind:columns="subCustomerCompanyColumns"
+            name="clienteleSubId"
+            placeholder="请选择业务来源"
+            @change="findCustomerContract()"
+            clearable
+            :rules="[{ required: true, message: '请选择业务来源' }]"
+            :required="true"
+            v-if="personal.clienteleType === '企业'"
+          />
+          <VanSinglePicker
+            label="客户联系人"
+            v-model="personal.clienteleContactId"
+            v-bind:columns="customerContractColumns"
+            name="clienteleContactId"
+            placeholder="请选择客户联系人"
+            clearable
+            :rules="[{ required: true, message: '请选择客户联系人' }]"
+            :required="true"
+          />
+          <van-field label="中介" v-model="personal.agent" name="agent" placeholder="请输入中介" />
+          <van-field label="贷款性质" v-model="personal.loanNature" name="loanNature" placeholder="请输入贷款性质" />
+          <van-field label="贷款用途" v-model="personal.loanAim" name="loanAim" placeholder="请输入贷款用途" />
+          <van-field label="贷款额度" v-model="personal.loanLimit" name="loanLimit" type="number" placeholder="请输入贷款额度(万元)" :rules="[{ required: true, message: '请输入贷款额度' }]" required />
+          <van-field label="贷款期限" v-model="personal.loanPeriod" name="loanPeriod" type="number" placeholder="请输入贷款期限(年)" />
+          <van-field name="loanExpire" label="贷款是否到期">
+            <template #input>
+              <van-radio-group v-model="personal.loanExpire" direction="horizontal" icon-size="14px">
+                <van-radio name="false">否</van-radio>
+                <van-radio name="true">是</van-radio>
+              </van-radio-group>
+            </template>
+          </van-field>
+          <van-field label="资料说明" name="credentials">
+            <template #input>
+              <van-checkbox-group v-model="personal.credentials" direction="horizontal">
+                <van-checkbox name="HOUSE_CERTIFICATE" shape="square" style="margin: 2px" icon-size="14px">房产证</van-checkbox>
+                <van-checkbox name="LAND_CERTIFICATE" shape="square" style="margin: 2px" icon-size="14px">国土证</van-checkbox>
+                <van-checkbox name="IMMOVABLE_CERTIFICATE" shape="square" style="margin: 2px" icon-size="14px">不动产权证</van-checkbox>
+              </van-checkbox-group>
+            </template>
+          </van-field>
+          <van-field label="委托人1" v-model="personal.bailorA" name="bailorA" placeholder="请输入委托人1" />
+          <van-field label="委托人1电话" v-model="personal.bailoraTel" name="bailoraTel" placeholder="请输入委托人1电话" />
+          <van-field label="委托人2" v-model="personal.bailorB" name="bailorB" placeholder="请输入委托人2" />
+          <van-field label="委托人2电话" v-model="personal.bailorbTel" name="bailorbTel" placeholder="请输入委托人2电话" />
+          <van-field label="订单备注" v-model="personal.remark" name="remark" type="textarea" />
+        </van-cell-group>
+        <div style="margin: 16px;">
+          <van-button round block type="primary" native-type="submit">提交</van-button>
+        </div>
+      </van-form>
+    </div>
+  </div>
+</template>
+<script>
+import { mapStores } from 'pinia';
+import { useUserStore } from '@/stores/useUserStore';
+import { showNotify } from 'vant';
+import VanSinglePicker from '@/components/VanSinglePicker/index.vue';
+import { customerLinkmanDrop } from '@/api/customerLinkman';
+import { customerCompanyDrop } from '@/api/customerCompany';
+import { add } from '@/api/personal';
+import { commit } from '@/api/workflow';
+
+export default {
+  components: {
+    VanSinglePicker,
+  },
+  data() {
+    return {
+      // 评估目的
+      evaluateAimColumns: [
+        { text: '按揭', value: '按揭' },
+        { text: '抵押', value: '抵押' },
+        { text: '咨询', value: '咨询' },
+      ],
+      // 客户类型
+      clienteleTypeColumns: [
+        { text: '企业', value: '企业' },
+        { text: '个人', value: '个人' },
+      ],
+      // 客户名称
+      customerCompanyColumns: [],
+      // 业务来源
+      subCustomerCompanyColumns: [],
+      // 客户联系人
+      customerContractColumns: [],
+      personal: {
+        clientManagerId: null,
+        clientManager: null,
+        evaluateAim: null,
+        purpose: [],
+        location: null,
+        clienteleId: null,
+        clienteleSubId: null,
+        clienteleContactId: null,
+        agent: null,
+        loanNature: null,
+        loanAim: null,
+        loanLimit: null,
+        loanPeriod: null,
+        loanExpire: 'false',
+        credentials: [],
+        bailorA: null,
+        bailoraTel: null,
+        bailorB: null,
+        bailorbTel: null,
+        remark: null,
+      },
+    };
+  },
+  computed: {
+    ...mapStores(useUserStore),
+  },
+  created() {
+    this.personal.clientManagerId = this.userStore.userInfo.id;
+    this.personal.clientManager = this.userStore.userInfo.name;
+  },
+  methods: {
+    onClickLeft() {
+      history.back();
+    },
+    // 客户类型改变的触发
+    changeCustomerType(val) {
+      // 清空客户信息
+      this.customerCompanyColumns = [];
+      this.subCustomerCompanyColumns = [];
+      this.customerContractColumns = [];
+      this.personal.clienteleId = null;
+      this.personal.clienteleSubId = null;
+      this.personal.clienteleContactId = null;
+
+      // 判断客户类型
+      if (this.personal.clienteleType === '个人') {
+        // 个人类型直接获取客户联系人
+        let simpleAll = new Object();
+        simpleAll.ccId = 1;
+        simpleAll.terminal = 0;
+        customerLinkmanDrop(simpleAll).then((res) => {
+          if (res.code === 200) {
+            // 使用 map 方法提取 id 和 name 属性
+            this.customerContractColumns = res.data.map((item) => ({
+              value: String(item.id),
+              text: String(item.name),
+            }));
+          }
+        });
+      } else {
+        let simpleAll = new Object();
+        simpleAll.terminal = 0;
+        customerCompanyDrop(simpleAll).then((res) => {
+          if (res.code === 200) {
+            // 使用 map 方法提取 id 和 name 属性
+            this.customerCompanyColumns = res.data.map((item) => ({
+              value: String(item.id),
+              text: String(item.name),
+            }));
+          }
+        });
+      }
+    },
+    // 获取业务来源
+    findSubCustomerCompany(val) {
+      // 清空业务来源和客户联系人信息
+      this.subCustomerCompanyColumns = [];
+      this.customerContractColumns = [];
+      this.personal.clienteleSubId = null;
+      this.personal.clienteleContactId = null;
+      // 判断客户名称id不为空
+      if (this.personal.clienteleId) {
+        let simpleAll = new Object();
+        simpleAll.terminal = val;
+        simpleAll.parentId = this.personal.clienteleId;
+        customerCompanyDrop(simpleAll).then((res) => {
+          if (res.code === 200) {
+            // 使用 map 方法提取 id 和 name 属性
+            this.subCustomerCompanyColumns = res.data.map((item) => ({
+              value: String(item.id),
+              text: String(item.name),
+            }));
+          }
+        });
+      }
+    },
+    // 获取企业的客户联系人信息
+    findCustomerContract() {
+      // 清空客户联系人信息
+      this.customerContractColumns = [];
+      this.personal.clienteleContactId = null;
+      let simpleAll = new Object();
+      simpleAll.ccId = this.personal.clienteleSubId;
+      customerLinkmanDrop(simpleAll).then((res) => {
+        if (res.code === 200) {
+          // 使用 map 方法提取 id 和 name 属性
+          this.customerContractColumns = res.data.map((item) => ({
+            value: String(item.id),
+            text: String(item.name),
+          }));
+        }
+      });
+    },
+    // 个贷下单
+    addPersonalOrder() {
+      // 将数组转换成JSON字符串后会影响表单的双向绑定,所以新建一个对象
+      let personalObj = new Object();
+      personalObj = { ...this.personal };
+      personalObj.purpose = JSON.stringify(personalObj.purpose);
+      personalObj.credentials = JSON.stringify(personalObj.credentials);
+      // 下单
+      add(personalObj).then((res) => {
+        if (res.code === 200) {
+          if (res.data && res.data.instanceNodeId && res.data.state) {
+            commit(res.data).then((result) => {
+              if (result.code === 200 && result.data) {
+                showNotify({ type: 'success', message: '下单并提交流程成功' });
+              } else {
+                showNotify({ type: 'success', message: '下单成功, 需要手动提交流程' });
+              }
+            });
+          } else {
+            showNotify({ type: 'success', message: '下单成功, 需要手动提交流程' });
+          }
+          history.back();
+        } else {
+          showNotify({ type: 'success', message: '下单失败, 请稍后再试' });
+        }
+      });
+    },
+  },
+};
+</script>
+<style scoped>
+</style>