|
@@ -0,0 +1,369 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <van-nav-bar title="资产业务下单" left-text="返回" left-arrow @click-left="onClickLeft()" />
|
|
|
|
+ <div class="form-style">
|
|
|
|
+ <van-form @submit="addAssetsOrder()" label-width="8.7em">
|
|
|
|
+ <van-cell-group inset>
|
|
|
|
+ <van-field label="客户经理" v-model="assets.clientManager" name="clientManager" readonly />
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="分单类型"
|
|
|
|
+ v-model="assets.allotType"
|
|
|
|
+ v-bind:columns="allotTypeColumns"
|
|
|
|
+ name="allotType"
|
|
|
|
+ placeholder="请选择分单类型"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择分单类型' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ />
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="接单部门"
|
|
|
|
+ v-model="assets.departmentId"
|
|
|
|
+ v-bind:columns="allotDepartmentColumns"
|
|
|
|
+ name="departmentId"
|
|
|
|
+ placeholder="请选择接单部门"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择接单部门' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ v-if="assets.allotType === '指派'"
|
|
|
|
+ />
|
|
|
|
+ <van-field label="项目名称" v-model="assets.name" name="name" type="textarea" placeholder="请输入项目名称" :rules="[{ required: true, message: '请输入项目名称' }]" required />
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="业务类型"
|
|
|
|
+ v-model="assets.assetsBusinessGener"
|
|
|
|
+ v-bind:columns="businessGenerColumns"
|
|
|
|
+ name="assetsBusinessGener"
|
|
|
|
+ placeholder="请选择业务类型"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择业务类型' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ :search="true"
|
|
|
|
+ />
|
|
|
|
+ <van-field name="entrustAgain" label="客户再次委托" :rules="[{ required: true, message: '请选择是否客户再次委托' }]" required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group v-model="assets.entrustAgain" direction="horizontal" icon-size="14px">
|
|
|
|
+ <van-radio name="false">否</van-radio>
|
|
|
|
+ <van-radio name="true">是</van-radio>
|
|
|
|
+ </van-radio-group>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="客户类型"
|
|
|
|
+ v-model="assets.clienteleType"
|
|
|
|
+ v-bind:columns="clienteleTypeColumns"
|
|
|
|
+ name="clienteleType"
|
|
|
|
+ placeholder="请选择客户类型"
|
|
|
|
+ @change="changeCustomerType(0)"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择客户类型' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ />
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="客户名称"
|
|
|
|
+ v-model="assets.clienteleId"
|
|
|
|
+ v-bind:columns="customerCompanyColumns"
|
|
|
|
+ name="clienteleId"
|
|
|
|
+ placeholder="请选择客户名称"
|
|
|
|
+ @change="findSubCustomerCompany(0)"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择客户名称' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ :search="true"
|
|
|
|
+ v-if="assets.clienteleType === '企业'"
|
|
|
|
+ />
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="业务来源"
|
|
|
|
+ v-model="assets.clienteleSubId"
|
|
|
|
+ v-bind:columns="subCustomerCompanyColumns"
|
|
|
|
+ name="clienteleSubId"
|
|
|
|
+ placeholder="请选择业务来源"
|
|
|
|
+ @change="findCustomerContract()"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择业务来源' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ :search="true"
|
|
|
|
+ v-if="assets.clienteleType === '企业'"
|
|
|
|
+ />
|
|
|
|
+ <VanSinglePicker
|
|
|
|
+ label="客户联系人"
|
|
|
|
+ v-model="assets.clienteleContactId"
|
|
|
|
+ v-bind:columns="customerContractColumns"
|
|
|
|
+ name="clienteleContactId"
|
|
|
|
+ placeholder="请选择客户联系人"
|
|
|
|
+ clearable
|
|
|
|
+ :rules="[{ required: true, message: '请选择客户联系人' }]"
|
|
|
|
+ :required="true"
|
|
|
|
+ :search="true"
|
|
|
|
+ />
|
|
|
|
+ <van-field name="security" label="是否证券项目" :rules="[{ required: true, message: '请选择是否证券项目' }]" required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group v-model="assets.security" 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 name="significantAssetsReorganization" label="是否资产重组项目" :rules="[{ required: true, message: '请选择是否资产重组项目' }]" required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group v-model="assets.significantAssetsReorganization" 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 name="stateAssets" label="是否国资项目" :rules="[{ required: true, message: '请选择是否国资项目' }]" required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group v-model="assets.stateAssets" 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 name="foreignAssetsInvolved" label="是否涉及境外资产" :rules="[{ required: true, message: '请选择是否涉及境外资产' }]" required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group v-model="assets.foreignAssetsInvolved" 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 name="dispenseBenefit" label="是否分配产值" :rules="[{ required: true, message: '请选择是否分配产值' }]" required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group v-model="assets.dispenseBenefit" 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="委托人" v-model="assets.bailor" name="bailor" placeholder="请输入委托人" />
|
|
|
|
+ <van-field label="委托联系人" v-model="assets.bailorContactName" name="bailorContactName" placeholder="请输入委托联系人" />
|
|
|
|
+ <van-field label="委托电话" v-model="assets.bailorContactTel" name="bailorContactTel" placeholder="请输入委托电话" />
|
|
|
|
+ <van-field label="委托人地址" v-model="assets.bailorAddress" name="bailorAddress" placeholder="请输入委托人地址" />
|
|
|
|
+ <van-field label="订单备注" v-model="assets.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 { allot } from '@/api/department';
|
|
|
|
+import { add } from '@/api/assets';
|
|
|
|
+import { commit } from '@/api/workflow';
|
|
|
|
+export default {
|
|
|
|
+ components: {
|
|
|
|
+ VanSinglePicker,
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ // 分单类型
|
|
|
|
+ allotTypeColumns: [
|
|
|
|
+ { text: '指派', value: '指派' },
|
|
|
|
+ { text: '轮单', value: '轮单' },
|
|
|
|
+ ],
|
|
|
|
+ // 接单部门
|
|
|
|
+ allotDepartmentColumns: [],
|
|
|
|
+ // 业务类型
|
|
|
|
+ businessGenerColumns: [
|
|
|
|
+ {
|
|
|
|
+ text: '企业价值',
|
|
|
|
+ value: '企业价值',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '单项资产',
|
|
|
|
+ value: '单项资产',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '资产组合',
|
|
|
|
+ value: '资产组合',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '无形资产',
|
|
|
|
+ value: '无形资产',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '森林资源资产',
|
|
|
|
+ value: '森林资源资产',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '珠宝首饰艺术品',
|
|
|
|
+ value: '珠宝首饰艺术品',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '债权',
|
|
|
|
+ value: '债权',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '其他资产评估',
|
|
|
|
+ value: '其他资产评估',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ // 客户类型
|
|
|
|
+ clienteleTypeColumns: [
|
|
|
|
+ { text: '企业', value: '企业' },
|
|
|
|
+ { text: '个人', value: '个人' },
|
|
|
|
+ ],
|
|
|
|
+ // 客户名称
|
|
|
|
+ customerCompanyColumns: [],
|
|
|
|
+ // 业务来源
|
|
|
|
+ subCustomerCompanyColumns: [],
|
|
|
|
+ // 客户联系人
|
|
|
|
+ customerContractColumns: [],
|
|
|
|
+ assets: {
|
|
|
|
+ clientManagerId: null,
|
|
|
|
+ clientManager: null,
|
|
|
|
+ allotType: '指派',
|
|
|
|
+ departmentId: null,
|
|
|
|
+ name: null,
|
|
|
|
+ entrustAgain: 'false',
|
|
|
|
+ clienteleType: '企业',
|
|
|
|
+ clienteleId: null,
|
|
|
|
+ clienteleSubId: null,
|
|
|
|
+ clienteleContactId: null,
|
|
|
|
+ security: 'false',
|
|
|
|
+ significantAssetsReorganization: 'false',
|
|
|
|
+ stateAssets: 'false',
|
|
|
|
+ foreignAssetsInvolved: 'false',
|
|
|
|
+ dispenseBenefit: 'false',
|
|
|
|
+ bailor: null,
|
|
|
|
+ bailorContactName: null,
|
|
|
|
+ bailorContactTel: null,
|
|
|
|
+ bailorAddress: null,
|
|
|
|
+ remark: null,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapStores(useUserStore),
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.assets.clientManagerId = this.userStore.userInfo.id;
|
|
|
|
+ this.assets.clientManager = this.userStore.userInfo.name;
|
|
|
|
+ this.getAllotDepartment();
|
|
|
|
+ this.changeCustomerType();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ onClickLeft() {
|
|
|
|
+ history.back();
|
|
|
|
+ },
|
|
|
|
+ // 获取部门下拉列表
|
|
|
|
+ getAllotDepartment() {
|
|
|
|
+ allot('ASSET_BUSINESS').then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ // 使用 map 方法提取 id 和 name 属性
|
|
|
|
+ this.allotDepartmentColumns = res.data.map((item) => ({
|
|
|
|
+ value: String(item.id),
|
|
|
|
+ text: String(item.name),
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 客户类型改变的触发
|
|
|
|
+ changeCustomerType(val) {
|
|
|
|
+ // 清空客户信息
|
|
|
|
+ this.customerCompanyColumns = [];
|
|
|
|
+ this.subCustomerCompanyColumns = [];
|
|
|
|
+ this.customerContractColumns = [];
|
|
|
|
+ this.assets.clienteleId = null;
|
|
|
|
+ this.assets.clienteleSubId = null;
|
|
|
|
+ this.assets.clienteleContactId = null;
|
|
|
|
+
|
|
|
|
+ // 判断客户类型
|
|
|
|
+ if (this.assets.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.assets.clienteleSubId = null;
|
|
|
|
+ this.assets.clienteleContactId = null;
|
|
|
|
+ // 判断客户名称id不为空
|
|
|
|
+ if (this.assets.clienteleId) {
|
|
|
|
+ let simpleAll = new Object();
|
|
|
|
+ simpleAll.terminal = val;
|
|
|
|
+ simpleAll.parentId = this.assets.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.assets.clienteleContactId = null;
|
|
|
|
+ let simpleAll = new Object();
|
|
|
|
+ simpleAll.ccId = this.assets.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),
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 资产下单
|
|
|
|
+ addAssetsOrder() {
|
|
|
|
+ add(this.assets).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: '下单成功, 需要手动提交流程' });
|
|
|
|
+ }
|
|
|
|
+ history.back();
|
|
|
|
+ } else {
|
|
|
|
+ showNotify({ type: 'danger', message: '下单失败, 请稍后再试' });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|