|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<ele-modal
|
|
|
- custom-class="ele-dialog-form long-dialog-form"
|
|
|
+ custom-class="ele-dialog-form long-dialog-form"
|
|
|
:centered="true"
|
|
|
v-if="visible"
|
|
|
:visible.sync="visible"
|
|
|
@@ -55,13 +55,31 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="法定代表人" prop="legalPerson">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="form.legalPerson"
|
|
|
+ maxlength="50"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="注册资金" prop="registeredCapital">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="form.registeredCapital"
|
|
|
+ maxlength="50"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="授信额度" prop="authorizationLimit">
|
|
|
<el-input
|
|
|
placeholder="请输入"
|
|
|
v-model="form.authorizationLimit"
|
|
|
maxlength="17"
|
|
|
- oninput ="value=value.replace(/[^0-9.]/g,'')"
|
|
|
+ oninput="value=value.replace(/[^0-9.]/g,'')"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -117,13 +135,23 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="营业类型" prop="companyCategoryId">
|
|
|
<DictSelection
|
|
|
- dictName="企业类型"
|
|
|
+ dictName="营业类型"
|
|
|
clearable
|
|
|
v-model="form.companyCategoryId"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="企业类型" prop="enterpriseTypeId">
|
|
|
+ <DictSelection
|
|
|
+ dictName="企业类型"
|
|
|
+ clearable
|
|
|
+ v-model="form.enterpriseTypeId"
|
|
|
+ >
|
|
|
+ </DictSelection>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="登记日期" prop="registerDate">
|
|
|
<el-date-picker
|
|
|
@@ -150,14 +178,14 @@
|
|
|
<el-form-item
|
|
|
label="关联上级单位"
|
|
|
prop="parentId"
|
|
|
-
|
|
|
+
|
|
|
>
|
|
|
- <el-input
|
|
|
+ <el-input
|
|
|
placeholder="请选择关联上级单位"
|
|
|
v-model="form.parentName"
|
|
|
readonly
|
|
|
@click.native="handParent"
|
|
|
-
|
|
|
+
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -175,10 +203,9 @@
|
|
|
<el-form-item label="经营范围" prop="businessScope">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- :max="500"
|
|
|
+ maxlength="500"
|
|
|
placeholder="请输入"
|
|
|
v-model="form.businessScope"
|
|
|
- maxlength="100"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -213,7 +240,8 @@
|
|
|
</template>
|
|
|
<template v-slot:action="{ row, $index }">
|
|
|
<el-link type="primary" @click="handleBankDel(row, $index)"
|
|
|
- >删除</el-link
|
|
|
+ >删除
|
|
|
+ </el-link
|
|
|
>
|
|
|
</template>
|
|
|
<template v-slot:accountNameHeader="{ column }">
|
|
|
@@ -249,7 +277,8 @@
|
|
|
</template>
|
|
|
<template v-slot:action="{ row, $index }">
|
|
|
<el-link type="primary" @click="handleLinkDel(row, $index)"
|
|
|
- >删除</el-link
|
|
|
+ >删除
|
|
|
+ </el-link
|
|
|
>
|
|
|
</template>
|
|
|
<template v-slot:linkNameHeader="{ column }">
|
|
|
@@ -279,11 +308,15 @@
|
|
|
<template v-slot:email="{ row }">
|
|
|
<el-input v-model="row.email" placeholder="请输入" maxlength="50"></el-input>
|
|
|
</template>
|
|
|
+ <template v-slot:deptName="{ row }">
|
|
|
+ <el-input v-model="row.deptName" placeholder="请输入" maxlength="50"></el-input>
|
|
|
+ </template>
|
|
|
<template v-slot:post="{ row }">
|
|
|
<el-input v-model="row.post" placeholder="请输入" maxlength="20"></el-input>
|
|
|
</template>
|
|
|
<template v-slot:ifChief="{ row, $index }">
|
|
|
- <el-select v-model="row.ifChief" placeholder="请选择" class="w100" @change="((value)=>{ifChiefChange(value, $index)})">
|
|
|
+ <el-select v-model="row.ifChief" placeholder="请选择" class="w100"
|
|
|
+ @change="((value)=>{ifChiefChange(value, $index)})">
|
|
|
<el-option
|
|
|
v-for="item in ifChiefList"
|
|
|
:key="item.value"
|
|
|
@@ -325,14 +358,14 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="税率" prop="taxRate">
|
|
|
- <el-input v-model="otherForm.taxRate" maxlength="5" oninput ="value=value.replace(/[^0-9.]/g,'')">
|
|
|
+ <el-input v-model="otherForm.taxRate" maxlength="5" oninput="value=value.replace(/[^0-9.]/g,'')">
|
|
|
<template slot="append">%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="折扣率" prop="discount">
|
|
|
- <el-input v-model="otherForm.discount" maxlength="5" oninput ="value=value.replace(/[^0-9.]/g,'')">
|
|
|
+ <el-input v-model="otherForm.discount" maxlength="5" oninput="value=value.replace(/[^0-9.]/g,'')">
|
|
|
<template slot="append">%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -393,7 +426,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="收件人详细地址" prop="address"
|
|
|
- label-width="130px">
|
|
|
+ label-width="130px">
|
|
|
<el-input
|
|
|
placeholder="请输入"
|
|
|
v-model="otherForm.address"
|
|
|
@@ -414,7 +447,7 @@
|
|
|
<parentList ref="parentRef" classType="1" @changeParent="changeParent"></parentList>
|
|
|
|
|
|
</ele-modal>
|
|
|
-
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -431,358 +464,367 @@ import {copyObj} from '@/utils/util';
|
|
|
import parentList from './parentList.vue'
|
|
|
|
|
|
export default {
|
|
|
- props: {
|
|
|
- categoryTreeList: Array
|
|
|
- },
|
|
|
- mixins: [dictMixins],
|
|
|
- components: {
|
|
|
- fileUpload,
|
|
|
- deptSelect,
|
|
|
- personSelect,
|
|
|
- parentList
|
|
|
- },
|
|
|
- data() {
|
|
|
- let formDef = {
|
|
|
- address: '',
|
|
|
- addressId: '',
|
|
|
- addressName: '',
|
|
|
- authorizationLimit: 0,
|
|
|
- businessLicenseFiles: [],
|
|
|
- businessLicenseFile: {},
|
|
|
- businessScope: '',
|
|
|
- categoryId: '',
|
|
|
- companyCategoryId: '',
|
|
|
- companyCategoryName: '',
|
|
|
- parentId: '',
|
|
|
- industry: '',
|
|
|
- industryCode: '',
|
|
|
- industryFullName: '',
|
|
|
- mainProduct: '',
|
|
|
- name: '',
|
|
|
- officialIndustry: '',
|
|
|
- phone: '',
|
|
|
- registerDate: '',
|
|
|
- remark: '',
|
|
|
- serialNo: '',
|
|
|
- simpleName: '',
|
|
|
- type: 1,
|
|
|
- unifiedSocialCreditCode: ''
|
|
|
- };
|
|
|
- let otherFormDef = {
|
|
|
- settlementMode: '',
|
|
|
- settlementModeName: '',
|
|
|
- taxRate: 0,
|
|
|
- address: '',
|
|
|
- addressId: '',
|
|
|
- deptId: '',
|
|
|
- deptName: '',
|
|
|
- discount: 0,
|
|
|
- salesmanId: '',
|
|
|
- salesmanName: '',
|
|
|
- sender: '',
|
|
|
- senderPhone: ''
|
|
|
- };
|
|
|
- return {
|
|
|
- visible: false,
|
|
|
- title: '',
|
|
|
- row: {},
|
|
|
- activeName: 'base',
|
|
|
- formDef,
|
|
|
- otherFormDef,
|
|
|
- form: copyObj(formDef),
|
|
|
- otherForm: copyObj(otherFormDef),
|
|
|
- // removeBankList: [],
|
|
|
- // removeLinkList: [],
|
|
|
- tableBankData: [],
|
|
|
- tableLinkData: [],
|
|
|
- ifChiefList: [
|
|
|
- {
|
|
|
- value: 0,
|
|
|
- label: '否'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 1,
|
|
|
- label: '是'
|
|
|
- }
|
|
|
- ],
|
|
|
- bankColumns: [
|
|
|
- {
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '单位名称',
|
|
|
- prop: 'accountName',
|
|
|
- slot: 'accountName',
|
|
|
- action: 'accountName',
|
|
|
- headerSlot: 'accountNameHeader'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '银行账号',
|
|
|
- prop: 'accountNo',
|
|
|
- slot: 'accountNo',
|
|
|
- action: 'accountNo'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '开户行',
|
|
|
- prop: 'bankName',
|
|
|
- slot: 'bankName',
|
|
|
- action: 'bankName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '银行银联号',
|
|
|
- prop: 'interbankNo',
|
|
|
- slot: 'interbankNo',
|
|
|
- action: 'interbankNo'
|
|
|
- },
|
|
|
- {
|
|
|
- action: 'action',
|
|
|
- slot: 'action',
|
|
|
- label: '操作'
|
|
|
- }
|
|
|
- ],
|
|
|
- linkColumns: [
|
|
|
- {
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '姓名',
|
|
|
- prop: 'linkName',
|
|
|
- slot: 'linkName',
|
|
|
- action: 'linkName',
|
|
|
- headerSlot: 'linkNameHeader'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '手机',
|
|
|
- prop: 'mobilePhone',
|
|
|
- slot: 'mobilePhone',
|
|
|
- action: 'mobilePhone',
|
|
|
- headerSlot: 'mobilePhoneHeader'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '电话',
|
|
|
- prop: 'phone',
|
|
|
- slot: 'phone',
|
|
|
- action: 'phone'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '微信号',
|
|
|
- prop: 'wechat',
|
|
|
- slot: 'wechat',
|
|
|
- action: 'wechat',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '邮箱',
|
|
|
- prop: 'email',
|
|
|
- slot: 'email',
|
|
|
- action: 'email'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '职务',
|
|
|
- prop: 'post',
|
|
|
- slot: 'post',
|
|
|
- action: 'post'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '状态',
|
|
|
- prop: 'status',
|
|
|
- slot: 'status',
|
|
|
- action: 'status',
|
|
|
- headerSlot: 'statusHeader'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '是否首要',
|
|
|
- prop: 'ifChief',
|
|
|
- slot: 'ifChief',
|
|
|
- action: 'ifChief'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '备注',
|
|
|
- prop: 'remark',
|
|
|
- slot: 'remark',
|
|
|
- action: 'remark'
|
|
|
- },
|
|
|
- {
|
|
|
- action: 'action',
|
|
|
- slot: 'action',
|
|
|
- label: '操作'
|
|
|
- }
|
|
|
- ],
|
|
|
- rules: {
|
|
|
-
|
|
|
- categoryId: [
|
|
|
- { required: true, message: '请选择客户分类', trigger: 'change' }
|
|
|
- ],
|
|
|
- simpleName: [
|
|
|
- { required: true, message: '请输入客户简称', trigger: 'change' }
|
|
|
- ],
|
|
|
- name: [
|
|
|
- { required: true, message: '请输入客户名称', trigger: 'blur' }
|
|
|
- ],
|
|
|
- authorizationLimit: [
|
|
|
- { required: true, message: '请输入授信额度', trigger: 'blur' }
|
|
|
- ],
|
|
|
-
|
|
|
- addressId: [
|
|
|
- { required: true, message: '请选择地址', trigger: 'change' }
|
|
|
- ]
|
|
|
+ props: {
|
|
|
+ categoryTreeList: Array
|
|
|
+ },
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ fileUpload,
|
|
|
+ deptSelect,
|
|
|
+ personSelect,
|
|
|
+ parentList
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ let formDef = {
|
|
|
+ address: '',
|
|
|
+ addressId: '',
|
|
|
+ addressName: '',
|
|
|
+ authorizationLimit: 0,
|
|
|
+ businessLicenseFiles: [],
|
|
|
+ businessLicenseFile: {},
|
|
|
+ businessScope: '',
|
|
|
+ categoryId: '',
|
|
|
+ companyCategoryId: '',
|
|
|
+ companyCategoryName: '',
|
|
|
+ enterpriseTypeId: '',
|
|
|
+ enterpriseTypeName: '',
|
|
|
+ legalPerson: '',
|
|
|
+ registeredCapital: '',
|
|
|
+ parentId: '',
|
|
|
+ industry: '',
|
|
|
+ industryCode: '',
|
|
|
+ industryFullName: '',
|
|
|
+ mainProduct: '',
|
|
|
+ name: '',
|
|
|
+ officialIndustry: '',
|
|
|
+ phone: '',
|
|
|
+ registerDate: '',
|
|
|
+ remark: '',
|
|
|
+ serialNo: '',
|
|
|
+ simpleName: '',
|
|
|
+ type: 1,
|
|
|
+ unifiedSocialCreditCode: ''
|
|
|
+ };
|
|
|
+ let otherFormDef = {
|
|
|
+ settlementMode: '',
|
|
|
+ settlementModeName: '',
|
|
|
+ taxRate: 0,
|
|
|
+ address: '',
|
|
|
+ addressId: '',
|
|
|
+ deptId: '',
|
|
|
+ deptName: '',
|
|
|
+ discount: 0,
|
|
|
+ salesmanId: '',
|
|
|
+ salesmanName: '',
|
|
|
+ sender: '',
|
|
|
+ senderPhone: ''
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ title: '',
|
|
|
+ row: {},
|
|
|
+ activeName: 'base',
|
|
|
+ formDef,
|
|
|
+ otherFormDef,
|
|
|
+ form: copyObj(formDef),
|
|
|
+ otherForm: copyObj(otherFormDef),
|
|
|
+ // removeBankList: [],
|
|
|
+ // removeLinkList: [],
|
|
|
+ tableBankData: [],
|
|
|
+ tableLinkData: [],
|
|
|
+ ifChiefList: [
|
|
|
+ {
|
|
|
+ value: 0,
|
|
|
+ label: '否'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '是'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ bankColumns: [
|
|
|
+ {
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '单位名称',
|
|
|
+ prop: 'accountName',
|
|
|
+ slot: 'accountName',
|
|
|
+ action: 'accountName',
|
|
|
+ headerSlot: 'accountNameHeader'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '银行账号',
|
|
|
+ prop: 'accountNo',
|
|
|
+ slot: 'accountNo',
|
|
|
+ action: 'accountNo'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '开户行',
|
|
|
+ prop: 'bankName',
|
|
|
+ slot: 'bankName',
|
|
|
+ action: 'bankName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '银行银联号',
|
|
|
+ prop: 'interbankNo',
|
|
|
+ slot: 'interbankNo',
|
|
|
+ action: 'interbankNo'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ action: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ label: '操作'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ linkColumns: [
|
|
|
+ {
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '姓名',
|
|
|
+ prop: 'linkName',
|
|
|
+ slot: 'linkName',
|
|
|
+ action: 'linkName',
|
|
|
+ headerSlot: 'linkNameHeader'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '手机',
|
|
|
+ prop: 'mobilePhone',
|
|
|
+ slot: 'mobilePhone',
|
|
|
+ action: 'mobilePhone',
|
|
|
+ headerSlot: 'mobilePhoneHeader'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '电话',
|
|
|
+ prop: 'phone',
|
|
|
+ slot: 'phone',
|
|
|
+ action: 'phone'
|
|
|
},
|
|
|
- otherRules: {
|
|
|
- // settlementMode: [
|
|
|
- // { required: true, message: '请输入结算方式', trigger: 'blur' }
|
|
|
- // ],
|
|
|
- taxRate: [
|
|
|
- { required: true, message: '请输入税率', trigger: 'change' }
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
|
|
|
+ {
|
|
|
+ label: '微信号',
|
|
|
+ prop: 'wechat',
|
|
|
+ slot: 'wechat',
|
|
|
+ action: 'wechat',
|
|
|
},
|
|
|
- options: {
|
|
|
- cityData,
|
|
|
- categoryData,
|
|
|
+ {
|
|
|
+ label: '邮箱',
|
|
|
+ prop: 'email',
|
|
|
+ slot: 'email',
|
|
|
+ action: 'email'
|
|
|
},
|
|
|
- // 提交状态
|
|
|
- loading: false,
|
|
|
- // 是否是修改
|
|
|
- isUpdate: false,
|
|
|
-
|
|
|
- // 组织机构树形结构数据
|
|
|
- groupTreeData: [],
|
|
|
- // 组织机构平铺数据
|
|
|
- groupData: [],
|
|
|
-
|
|
|
- parentShow: false
|
|
|
- };
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.getGroupAll();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- async open(type, row, contactCategoryId) {
|
|
|
- this.title = type;
|
|
|
- this.row = row;
|
|
|
- this.visible = true;
|
|
|
- if (type == '新建客户') {
|
|
|
- this.isUpdate = false;
|
|
|
- // 默认带出列表页面选中的分类
|
|
|
- this.form.categoryId = contactCategoryId;
|
|
|
- } else {
|
|
|
- this.isUpdate = true;
|
|
|
- await this._getById(row.id);
|
|
|
+ {
|
|
|
+ label: '部门',
|
|
|
+ prop: 'deptName',
|
|
|
+ slot: 'deptName',
|
|
|
+ action: 'deptName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '职务',
|
|
|
+ prop: 'post',
|
|
|
+ slot: 'post',
|
|
|
+ action: 'post'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ slot: 'status',
|
|
|
+ action: 'status',
|
|
|
+ headerSlot: 'statusHeader'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是否首要',
|
|
|
+ prop: 'ifChief',
|
|
|
+ slot: 'ifChief',
|
|
|
+ action: 'ifChief'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remark',
|
|
|
+ slot: 'remark',
|
|
|
+ action: 'remark'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ action: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ label: '操作'
|
|
|
}
|
|
|
- },
|
|
|
+ ],
|
|
|
+ rules: {
|
|
|
|
|
|
- // 获取公司数据
|
|
|
- getGroupAll () {
|
|
|
- listOrganizations().then((list) => {
|
|
|
- this.groupData = list;
|
|
|
- this.groupTreeData = this.$util.toTreeData({
|
|
|
- data: list,
|
|
|
- idField: 'id',
|
|
|
- parentIdField: 'parentId'
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
+ categoryId: [
|
|
|
+ {required: true, message: '请选择客户分类', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ simpleName: [
|
|
|
+ {required: true, message: '请输入客户简称', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ name: [
|
|
|
+ {required: true, message: '请输入客户名称', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ authorizationLimit: [
|
|
|
+ {required: true, message: '请输入授信额度', trigger: 'blur'}
|
|
|
+ ],
|
|
|
|
|
|
- // 选择负责人部门
|
|
|
- change_principalDep(id) {
|
|
|
- const info = this.groupData.find(e => e.id == id);
|
|
|
- this.otherForm.deptName = info.name;
|
|
|
- this.otherForm.salesmanId = '';
|
|
|
- this.otherForm.salesmanName = '';
|
|
|
- // 根据部门获取人员
|
|
|
- const params = { groupId: id };
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.directorRef.getList(params);
|
|
|
- });
|
|
|
- },
|
|
|
- salesmanChange(val, info){
|
|
|
- this.otherForm.salesmanName = info.name;
|
|
|
+ addressId: [
|
|
|
+ {required: true, message: '请选择地址', trigger: 'change'}
|
|
|
+ ]
|
|
|
},
|
|
|
- settlementModeChange(info){
|
|
|
- this.otherForm.settlementModeName = info.dictValue;
|
|
|
- },
|
|
|
- ifChiefChange(value, idx){
|
|
|
- if(value === 1){
|
|
|
- this.tableLinkData.forEach(e => e.ifChief = 0);
|
|
|
- this.tableLinkData[idx].ifChief = 1;
|
|
|
- }
|
|
|
+ otherRules: {
|
|
|
+ // settlementMode: [
|
|
|
+ // { required: true, message: '请输入结算方式', trigger: 'blur' }
|
|
|
+ // ],
|
|
|
+ taxRate: [
|
|
|
+ {required: true, message: '请输入税率', trigger: 'change'}
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
- addBank() {
|
|
|
- this.tableBankData.push({
|
|
|
- accountName: '',
|
|
|
- accountNo: '',
|
|
|
- bankName: '',
|
|
|
- interbankNo: ''
|
|
|
- });
|
|
|
+ options: {
|
|
|
+ cityData,
|
|
|
+ categoryData,
|
|
|
},
|
|
|
- addLink() {
|
|
|
- this.tableLinkData.push({
|
|
|
- linkName: '',
|
|
|
- mobilePhone: '',
|
|
|
- phone: '',
|
|
|
- email: '',
|
|
|
- post: '',
|
|
|
- status: '',
|
|
|
- ifChief: 0,
|
|
|
- remark: ''
|
|
|
+ // 提交状态
|
|
|
+ loading: false,
|
|
|
+ // 是否是修改
|
|
|
+ isUpdate: false,
|
|
|
+
|
|
|
+ // 组织机构树形结构数据
|
|
|
+ groupTreeData: [],
|
|
|
+ // 组织机构平铺数据
|
|
|
+ groupData: [],
|
|
|
+
|
|
|
+ parentShow: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getGroupAll();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async open(type, row, contactCategoryId) {
|
|
|
+ this.title = type;
|
|
|
+ this.row = row;
|
|
|
+ this.visible = true;
|
|
|
+ if (type == '新建客户') {
|
|
|
+ this.isUpdate = false;
|
|
|
+ // 默认带出列表页面选中的分类
|
|
|
+ this.form.categoryId = contactCategoryId;
|
|
|
+ } else {
|
|
|
+ this.isUpdate = true;
|
|
|
+ await this._getById(row.id);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取公司数据
|
|
|
+ getGroupAll() {
|
|
|
+ listOrganizations().then((list) => {
|
|
|
+ this.groupData = list;
|
|
|
+ this.groupTreeData = this.$util.toTreeData({
|
|
|
+ data: list,
|
|
|
+ idField: 'id',
|
|
|
+ parentIdField: 'parentId'
|
|
|
});
|
|
|
- },
|
|
|
- handleBankDel(row, index) {
|
|
|
- this.tableBankData.splice(index, 1);
|
|
|
- if (row?.id) {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 选择负责人部门
|
|
|
+ change_principalDep(id) {
|
|
|
+ const info = this.groupData.find(e => e.id == id);
|
|
|
+ this.otherForm.deptName = info.name;
|
|
|
+ this.otherForm.salesmanId = '';
|
|
|
+ this.otherForm.salesmanName = '';
|
|
|
+ // 根据部门获取人员
|
|
|
+ const params = {groupId: id};
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.directorRef.getList(params);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ salesmanChange(val, info) {
|
|
|
+ this.otherForm.salesmanName = info.name;
|
|
|
+ },
|
|
|
+ settlementModeChange(info) {
|
|
|
+ this.otherForm.settlementModeName = info.dictValue;
|
|
|
+ },
|
|
|
+ ifChiefChange(value, idx) {
|
|
|
+ if (value === 1) {
|
|
|
+ this.tableLinkData.forEach(e => e.ifChief = 0);
|
|
|
+ this.tableLinkData[idx].ifChief = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addBank() {
|
|
|
+ this.tableBankData.push({
|
|
|
+ accountName: '',
|
|
|
+ accountNo: '',
|
|
|
+ bankName: '',
|
|
|
+ interbankNo: ''
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addLink() {
|
|
|
+ this.tableLinkData.push({
|
|
|
+ linkName: '',
|
|
|
+ mobilePhone: '',
|
|
|
+ phone: '',
|
|
|
+ email: '',
|
|
|
+ post: '',
|
|
|
+ status: '',
|
|
|
+ ifChief: 0,
|
|
|
+ remark: ''
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleBankDel(row, index) {
|
|
|
+ this.tableBankData.splice(index, 1);
|
|
|
+ if (row?.id) {
|
|
|
// this.removeBankList.push(row.id);
|
|
|
- }
|
|
|
- },
|
|
|
- handleLinkDel(row, index) {
|
|
|
- this.tableLinkData.splice(index, 1);
|
|
|
- if (row?.id) {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleLinkDel(row, index) {
|
|
|
+ this.tableLinkData.splice(index, 1);
|
|
|
+ if (row?.id) {
|
|
|
// this.removeLinkList.push(row.id);
|
|
|
- }
|
|
|
- },
|
|
|
- getValidate() {
|
|
|
- return Promise.all([
|
|
|
- new Promise((resolve, reject) => {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- this.activeName = 'base';
|
|
|
- reject(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
- }
|
|
|
- });
|
|
|
- }),
|
|
|
- new Promise((resolve, reject) => {
|
|
|
- this.$refs.otherForm.validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- this.activeName = 'other';
|
|
|
- reject(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
- }
|
|
|
- });
|
|
|
- }),
|
|
|
- new Promise((resolve, reject) => {
|
|
|
- if (this.tableLinkData.length === 0) {
|
|
|
- this.$message.error("联系人信息至少有1条");
|
|
|
- this.activeName = 'link';
|
|
|
- reject(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
- }
|
|
|
- })
|
|
|
- ]);
|
|
|
- },
|
|
|
- async save() {
|
|
|
- try {
|
|
|
- await this.getValidate();
|
|
|
- // 表单验证通过,执行保存操作
|
|
|
- this.loading = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getValidate() {
|
|
|
+ return Promise.all([
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ this.activeName = 'base';
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }),
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ this.$refs.otherForm.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ this.activeName = 'other';
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }),
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ if (this.tableLinkData.length === 0) {
|
|
|
+ this.$message.error("联系人信息至少有1条");
|
|
|
+ this.activeName = 'link';
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+ async save() {
|
|
|
+ try {
|
|
|
+ await this.getValidate();
|
|
|
+ // 表单验证通过,执行保存操作
|
|
|
+ this.loading = true;
|
|
|
// 基本信息处理
|
|
|
if (this.$refs.address.getCheckedNodes()) {
|
|
|
let node = this.$refs.address.getCheckedNodes()[0];
|
|
|
@@ -806,11 +848,17 @@ export default {
|
|
|
}
|
|
|
if (this.form.companyCategoryId) {
|
|
|
this.form.companyCategoryName = this.getDictValue(
|
|
|
- '企业类型',
|
|
|
+ '营业类型',
|
|
|
this.form.companyCategoryId
|
|
|
);
|
|
|
}
|
|
|
- if(this.form.businessLicenseFiles && this.form.businessLicenseFiles.length > 0){
|
|
|
+ if (this.form.enterpriseTypeId) {
|
|
|
+ this.form.enterpriseTypeName = this.getDictValue(
|
|
|
+ '企业类型',
|
|
|
+ this.form.enterpriseTypeId
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.form.businessLicenseFiles && this.form.businessLicenseFiles.length > 0) {
|
|
|
this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
|
|
|
} else {
|
|
|
this.form.businessLicenseFile = null;
|
|
|
@@ -837,8 +885,8 @@ export default {
|
|
|
if (!this.isUpdate) {
|
|
|
delete this.form.id;
|
|
|
} else {
|
|
|
- // this.form.removeBankList = this.removeBankList;
|
|
|
- // this.form.removeLinkList = this.removeLinkList;
|
|
|
+ // this.form.removeBankList = this.removeBankList;
|
|
|
+ // this.form.removeLinkList = this.removeLinkList;
|
|
|
}
|
|
|
const data = {
|
|
|
base: this.form,
|
|
|
@@ -868,76 +916,75 @@ export default {
|
|
|
.catch((e) => {
|
|
|
//this.loading = false;
|
|
|
});
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- // 表单验证未通过,不执行保存操作
|
|
|
}
|
|
|
+ } catch (error) {
|
|
|
+ // 表单验证未通过,不执行保存操作
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
- cancel() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.activeName = 'base';
|
|
|
- // 关闭后,销毁所有的表单数据
|
|
|
- this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
|
|
|
- this.$refs['formRef'] && this.$refs['formRef'].resetFields();
|
|
|
- this.form = copyObj(this.formDef),
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.activeName = 'base';
|
|
|
+ // 关闭后,销毁所有的表单数据
|
|
|
+ this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
|
|
|
+ this.$refs['formRef'] && this.$refs['formRef'].resetFields();
|
|
|
+ this.form = copyObj(this.formDef),
|
|
|
this.otherForm = copyObj(this.otherFormDef),
|
|
|
this.tableBankData = []
|
|
|
- this.tableLinkData = []
|
|
|
- this.visible = false;
|
|
|
- })
|
|
|
- },
|
|
|
- async _getById(id) {
|
|
|
- const data = await contactDetail(id);
|
|
|
- this.form = data.base;
|
|
|
- this.otherForm = data.other;
|
|
|
- this.tableBankData = data.bankList;
|
|
|
- this.tableLinkData = data.linkList;
|
|
|
- if(data.base.businessLicenseFile && data.base.businessLicenseFile !== ""){
|
|
|
- this.$set(this.form,'businessLicenseFiles',[data.base.businessLicenseFile])
|
|
|
- }
|
|
|
-
|
|
|
- if(this.tableLinkData && this.tableLinkData.length > 0){
|
|
|
- this.tableLinkData.forEach(e => e.status = e.status+"");
|
|
|
- }
|
|
|
- if(this.otherForm.settlementMode){
|
|
|
- this.otherForm.settlementMode = this.otherForm.settlementMode + "";
|
|
|
- }
|
|
|
-
|
|
|
- // 回显地址选择器
|
|
|
- if(this.form.addressId && this.form.addressId.length > 0){
|
|
|
- this.form.addressId = this.form.addressId.split(",");
|
|
|
- }
|
|
|
- if(this.otherForm.addressId && this.otherForm.addressId.length > 0){
|
|
|
- this.otherForm.addressId = this.otherForm.addressId.split(",");
|
|
|
- }
|
|
|
- // 回显行业
|
|
|
- if(this.form.industryCode && this.form.industryCode.length > 0){
|
|
|
- this.form.industry = this.form.industryCode.split(",");
|
|
|
- }
|
|
|
- if(this.otherForm.deptId) {
|
|
|
- // 编辑时,默认查询组织相关的用户列表,用于回显
|
|
|
- this.$nextTick(async () => {
|
|
|
- await this.$refs.directorRef.getList({groupId: this.otherForm.deptId});
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- handParent() {
|
|
|
- let item = {
|
|
|
- id: this.form.parentId
|
|
|
- }
|
|
|
- this.$refs.parentRef.open(item)
|
|
|
- },
|
|
|
+ this.tableLinkData = []
|
|
|
+ this.visible = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async _getById(id) {
|
|
|
+ const data = await contactDetail(id);
|
|
|
+ this.form = data.base;
|
|
|
+ this.otherForm = data.other;
|
|
|
+ this.tableBankData = data.bankList;
|
|
|
+ this.tableLinkData = data.linkList;
|
|
|
+ if (data.base.businessLicenseFile && data.base.businessLicenseFile !== "") {
|
|
|
+ this.$set(this.form, 'businessLicenseFiles', [data.base.businessLicenseFile])
|
|
|
+ }
|
|
|
|
|
|
- changeParent(obj) {
|
|
|
- this.$set( this.form, 'parentId', obj.id)
|
|
|
- this.$set( this.form, 'parentName', obj.name)
|
|
|
+ if (this.tableLinkData && this.tableLinkData.length > 0) {
|
|
|
+ this.tableLinkData.forEach(e => e.status = e.status + "");
|
|
|
+ }
|
|
|
+ if (this.otherForm.settlementMode) {
|
|
|
+ this.otherForm.settlementMode = this.otherForm.settlementMode + "";
|
|
|
+ }
|
|
|
|
|
|
+ // 回显地址选择器
|
|
|
+ if (this.form.addressId && this.form.addressId.length > 0) {
|
|
|
+ this.form.addressId = this.form.addressId.split(",");
|
|
|
+ }
|
|
|
+ if (this.otherForm.addressId && this.otherForm.addressId.length > 0) {
|
|
|
+ this.otherForm.addressId = this.otherForm.addressId.split(",");
|
|
|
}
|
|
|
+ // 回显行业
|
|
|
+ if (this.form.industryCode && this.form.industryCode.length > 0) {
|
|
|
+ this.form.industry = this.form.industryCode.split(",");
|
|
|
+ }
|
|
|
+ if (this.otherForm.deptId) {
|
|
|
+ // 编辑时,默认查询组织相关的用户列表,用于回显
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ await this.$refs.directorRef.getList({groupId: this.otherForm.deptId});
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
+ handParent() {
|
|
|
+ let item = {
|
|
|
+ id: this.form.parentId
|
|
|
+ }
|
|
|
+ this.$refs.parentRef.open(item)
|
|
|
+ },
|
|
|
|
|
|
+ changeParent(obj) {
|
|
|
+ this.$set(this.form, 'parentId', obj.id)
|
|
|
+ this.$set(this.form, 'parentName', obj.name)
|
|
|
|
|
|
}
|
|
|
- };
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|