Commit a12d388b authored by jiangqihao's avatar jiangqihao

修改密码页面校验

parent 6afa9e5c
...@@ -85,115 +85,7 @@ const customersRouter = { ...@@ -85,115 +85,7 @@ const customersRouter = {
name: 'CustomersMessage', name: 'CustomersMessage',
meta: { title: '代理商信息' } meta: { title: '代理商信息' }
}, },
// {
// path: 'resource',
// meta: { title: '资源池管理' },
// component: () => import('@/views/customers/resource'),
// redirect: '/customers/resource/pool',
// name: 'ResourceManagement',
// children: [
// {
// path: 'pool',
// component: () => import('@/views/customers/resource-pool'),
// name: 'ResourcePool',
// meta: { title: '资源池' }
// },
// {
// path: 'release',
// component: () => import('@/views/customers/release-record'),
// name: 'ReleaseRecord',
// meta: { title: '发布记录' }
// },
// {
// path: 'release-detail',
// component: () => import('@/views/customers/release-record/detail'),
// name: 'ReleaseDetail',
// hidden: true,
// meta: { title: '发布记录详情' }
// },
// {
// path: 'detail',
// component: () => import('@/views/customers/resource-detail/detail.vue'),
// name: 'ResourceDetail',
// meta: { title: '资源池客户详情' },
// hidden: true
// },
// {
// path: 'application',
// component: () => import('@/views/customers/application-record'),
// name: 'ApplicationRecord',
// meta: { title: '申请记录' }
// },
// {
// path: 'application-detail',
// component: () => import('@/views/customers/application-record/detail.vue'),
// name: 'ApplicationDetail',
// hidden: true,
// meta: { title: '申请记录详情' }
// },
// {
// path: 'approval',
// component: () => import('@/views/customers/approval-record'),
// name: 'ApprovalRecord',
// meta: { title: '审批记录' }
// },
// {
// path: 'approval-detail',
// component: () => import('@/views/customers/approval-record/detail'),
// name: 'ApprovalDetail',
// hidden: true,
// meta: { title: '审批记录详情' }
// },
// {
// path: 'contact',
// component: () => import('@/views/customers/contact'),
// name: 'Contact',
// meta: { title: '联系人' }
// },
// ]
// },
{
path: 'enterprise',
component: () => import('@/views/customers/enterprise-customers'),
name: 'EnterpriseCustomers',
meta: { title: 'enterpriseCustomers' },
hidden: true
},
{
path: 'enterprise-detail',
component: () => import('@/views/customers/enterprise-customers/detail'),
name: 'EnterpriseCustomersDetail',
meta: { title: '企业用户详情' },
hidden: true
},
{
path: 'individual',
component: () => import('@/views/customers/individual-customers'),
name: 'IndividualCustomersDetail',
meta: { title: '个人客户' },
hidden: true
},
{
path: 'individual-detail',
component: () => import('@/views/customers/individual-customers/detail'),
name: 'IndividualCustomers',
meta: { title: '个人客户详情' },
hidden: true
},
{
path: 'important',
component: () => import('@/views/customers/important-customers'),
name: 'ImportantCustomers',
meta: { title: '创建正式客户' },
hidden: true
},
{
path: 'important-detail',
component: () => import('@/views/customers/important-customers/detail'),
name: 'ImportantCustomersDetail',
meta: { title: '正式客户详情' },
hidden: true
}
] ]
} }
export default customersRouter export default customersRouter
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
rules: { rules: {
Name: {required: true, message: '公司名称必填'}, Name: {required: true, message: '公司名称必填'},
ExtSocialUnifiedCreditCode_SDK: { required: true, message: '社会统一信用代码必填' }, ExtSocialUnifiedCreditCode_SDK: { required: true, message: '社会统一信用代码必填' },
ExtRegisteredCapital_SDK: {required: true, message: '注册资本必填' }, // ExtRegisteredCapital_SDK: {required: true, message: '注册资本必填' },
ExtCorporateName_SDK: { required: true, message: '法人必填' }, ExtCorporateName_SDK: { required: true, message: '法人必填' },
ExtProvince_SDK: { required: true, message: '省份必填' }, ExtProvince_SDK: { required: true, message: '省份必填' },
ExtDistrict_SDK: {required: true, message: '城市必填' }, ExtDistrict_SDK: {required: true, message: '城市必填' },
......
import { address } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '地址信息',
url: address.searchUrl,
isSearch: true,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Ext_CustomerAddressType_KUT: {
label: '地址类型'
},
CountryCode: {
label: '国别',
value: 'CountryCodeText'
},
StateCode: {
label: '省份',
value: 'StateCodeText'
},
City: {
label: '城市'
},
Street: {
label: '区/县'
},
Ext_CustomerAddressDetailedAddress_KUT: {
label: '详细地址'
},
StreetPostalCode: {
label: '邮编'
},
MainIndicator: {
label: '是否默认'
},
Ext_CustomerAddressNote_KUT: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Ext_CustomerAddressType_KUT: {
type: 'select',
label: '地址类型',
isOptions: true,
options: dictionary.customerAddressType,
layout: 12
},
CountryCode: {
type: 'select',
label: '国别',
isOptions: true,
options: dictionary.countryCode,
layout: 12
},
StateCode: {
label: '省份',
type: 'select',
value: 'Ext_CustomerStatus_KUTText',
layout: 12
},
City: {
label: '城市',
type: 'input',
layout: 12
},
Street: {
label: '区/县',
type: 'input',
layout: 12
},
Ext_CustomerAddressDetailedAddress_KUT: {
label: '详细地址',
type: 'input',
layout: 12
},
StreetPostalCode: {
label: '邮编',
type: 'input',
layout: 12
},
MainIndicator: {
label: '是否默认',
type: 'radio',
layout: 12,
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
default: false
},
Ext_CustomerAddressNote_KUT: {
label: '备注',
type: 'textarea',
attrs: {
// autosizeType: 'switch',
autosize: false,
rows: 2,
maxlength: 300
},
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...address
}
<template>
<div>
<Title :title="title" />
<AddressTable :form-data="$attrs['form-data']" />
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善项目信息
</el-button>
<el-button
type="primary"
icon="el-icon-right"
@click="handleNext"
>下一步,完善联系人信息</el-button>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import AddressTable from './table.vue'
import constant from './constant'
const tableTitle = constant.tableConfig.tableTitle
export default {
components: {
Title,
AddressTable
},
data() {
return {
title: '创建企业客户-' + tableTitle
}
},
methods: {
handlePrev() {
this.$emit('changeComponent', 'projectInfo')
},
handleNext() {
this.$emit('changeComponent', 'contactsInfo')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
// 如果没有AccountID即代表是新增阶段,可以不设置url,让其为一个空数组
if (this.$attrs['form-data'] && this.$attrs['form-data'].AccountID) {
constant.tableConfig.initialParams = {
AccountID: this.$attrs['form-data'].AccountID
}
} else {
constant.tableConfig.url = ''
}
this.constant = constant
}
}
</script>
<style>
</style>
import dictionary from '@/api/dictionary'
import { customer } from '@/api/customers'
const formConfig = {
tableTitle: '基本信息',
updateUrl: customer.updateUrl,
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: false,
rules: {
Name: {
trigger: 'blur',
validator: function(rule, value, callback) {
if (this.formData.Ext_CustomerIsRepeatability_KUT === true && this.formData.isRepeat) {
return callback(new Error('客户名称重复'))
} else {
return callback()
}
}
}
},
formDesc: {
Name: {
type: 'input',
label: '客户名称',
layout: 12,
required: true
},
Ext_CustomerSocialUnifiedCreditCode_KUT: {
type: 'input',
label: '社会统一信用代码',
layout: 12
},
Ext_CustomerIsRepeatability_KUT: {
type: 'radio',
label: '进行重复性校验',
isOptions: true,
options: dictionary.TF,
layout: 12
},
key_btn: {
type: 'button',
default: '重复性校验',
layout: 12,
attrs: {
type: 'primary'
}
},
Ext_CustomerEnglishName_KUT: {
type: 'input',
label: '英文名称',
layout: 12
},
CountryCode: {
type: 'select',
label: '客户国别',
isOptions: true,
options: dictionary.countryCode,
attrs: {
filterable: true
},
layout: 12
},
Ext_CustomerForm_KUT: {
type: 'select',
label: '客户来源',
isOptions: true,
options: dictionary.customerForm,
layout: 12
},
Ext_CustomerContinent_KUT: {
type: 'select',
label: '所在大洲',
isOptions: true,
options: dictionary.customerContinent,
layout: 12
},
Ext_CustomerType_KUT: {
type: 'select',
label: '客户类型',
disabled: true,
isOptions: true,
default: '131',
options: dictionary.customerType,
layout: 12
},
ParentAccountID: {
type: 'lov',
code: 'customer',
returnFn: function(row) {
return {
ParentAccountID: row.ObjectID,
ParentAccountText: row.Name
}
},
initialParams: {
roleCode: 'BUP002'
},
label: '上级客户',
layout: 12
},
Ext_CustomerResearchSubjects_KUT: {
type: 'radio',
label: '研发主体',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12
},
Ext_CustomerFilingInstructions_KUT: {
type: 'textarea',
label: '报备说明',
attrs: {
autosizeType: 'switch',
autosize: false,
rows: 3
}
},
Ext_CustomerNote_KUT: {
type: 'textarea',
label: '备注信息',
attrs: {
autosizeType: 'switch',
autosize: false,
rows: 3
}
}
}
}
export default {
formConfig
}
<template>
<div>
<Title :title="title">
<span>*</span>为必填项
</Title>
<div class="form-container">
<form-title :title="formTitle" />
<ele-form
ref="form"
v-model="formData"
v-bind="formConfig"
>
<template v-slot:key_btn>
<el-button
type="primary"
@click="handleCheckRepeat"
>进行重复性校验</el-button>
</template>
</ele-form>
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-right"
:loading="loading"
@click="handleSubmit"
>保存,下一步,完善行业信息</el-button>
</div>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import constant from './constant.js'
import { addPotentialCustomer } from '@/api/customers'
import { updatePotentialCustomer } from '@/api/customers'
export default {
name: 'EnterpriseCustomersBaseInfo',
components: {
Title
},
props: {
formData: {
type: Object,
default: () => { }
}
},
data() {
return {
title: '创建企业客户-基础信息',
formTitle: '基础信息',
loading: false,
formConfig: constant.formConfig
}
},
watch: {
formData(val) {
this.originData = JSON.stringify(val)
}
},
methods: {
async handleSubmit() {
await this.$refs.form.validate()
this.loading = true
if (this.$route.query.objectID) {
if (JSON.stringify(this.formData) !== this.originData) {
this.handleEdit()
} else {
this.loading = false
this.handleNext()
}
} else {
this.handleAdd()
}
},
handleAdd() {
const formData = this.$translateToC4CData(this.formData)
// 潜在客户roleCode默认是'BUP002'
formData.roleCode = 'BUP002'
// 新建潜在客户的状态为草稿状态101
formData.ext_CustomerStatus_KUT = '101'
delete formData.key_btn
// 新建接口是基于批量新增设计的,所以要用数组包裹formData传值
addPotentialCustomer([formData]).then(res => {
console.log(res)
this.loading = false
const objectID = res.results[0]
this.$router.push({
path: '/customers/enterprise',
query: { objectID }
})
this.handleNext()
})
},
handleEdit() {
const formData = this.$translateToC4CData(this.formData)
updatePotentialCustomer(formData).then(res => {
this.loading = false
this.handleNext()
})
},
handleCheckRepeat() {
this.formData.isRepeat = true
this.$refs.form.$refs.form.validateField('Name')
},
handleNext() {
this.originData = JSON.stringify(this.formData)
this.$emit('changeComponent', 'industryInfo')
}
}
}
</script>
<style>
</style>
<template>
<DescriptionTable
:table-config="formConfig"
:table-data="formData"
/>
</template>
<script>
import constant from './constant'
export default {
name: 'BaseInfo',
props: {
formData: {
type: Object,
default: () => { }
}
},
data() {
return {
formConfig: constant.formConfig
}
}
}
</script>
<style>
</style>
\ No newline at end of file
import { contact } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '联系人信息',
url: contact.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Ext_CustomerRole_KUT: {
label: '角色'
},
LastName: {
label: '联系人名称'
},
JobTitle: {
label: '职位'
},
Ext_CustomerPhone_KUT: {
label: '手机1'
},
Ext_CustomerMobile_KUT: {
label: '手机2'
},
Ext_CustomerLandline_KUT: {
label: '座机'
},
Email: {
label: '电子邮箱'
},
Ext_CustomerMainContact_KUT: {
label: '是否主要联系人'
},
Ext_CustomerWeChat_KUT: {
label: '微信'
},
Ext_CustomerQQ_KUT: {
label: 'QQ'
},
Ext_CustomerAddress_KUT: {
label: '地址'
},
Ext_CustomerNote_KUT: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Ext_CustomerRole_KUT: {
type: 'select',
label: '角色',
isOptions: true,
options: dictionary.contactRole,
layout: 12
},
LastName: {
type: 'input',
label: '联系人名称',
layout: 12
},
JobTitle: {
label: '职位',
type: 'input',
layout: 12
},
Ext_CustomerPhone_KUT: {
label: '手机1',
type: 'input',
layout: 12
},
Ext_CustomerMobile_KUT: {
label: '手机2',
type: 'input',
layout: 12
},
Ext_CustomerLandline_KUT: {
label: '座机',
type: 'input',
layout: 12
},
Email: {
label: '电子邮箱',
type: 'input',
rules: [
{
type: 'email',
trigger: 'blur'
}
],
layout: 12
},
Ext_CustomerMainContact_KUT: {
label: '是否主要联系人',
type: 'radio',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12,
default: false
},
Ext_CustomerWeChat_KUT: {
label: '微信',
type: 'input',
layout: 12
},
Ext_CustomerQQ_KUT: {
label: 'QQ',
type: 'input',
layout: 12
},
Ext_CustomerAddress_KUT: {
label: '地址',
type: 'input',
layout: 12
},
Ext_CustomerNote_KUT: {
label: '备注',
type: 'input',
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...contact
}
<template>
<div>
<Title :title="title" />
<ContactTable :form-data="$attrs['form-data']" />
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善地址信息
</el-button>
<el-button
type="primary"
icon="el-icon-right"
@click="handleNext"
>下一步,完善附件信息</el-button>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import ContactTable from './table.vue'
import constant from './constant'
const tableTitle = constant.tableConfig.tableTitle
export default {
components: {
Title,
ContactTable
},
data() {
return {
title: '创建企业客户-' + tableTitle
}
},
methods: {
handlePrev() {
this.$emit('changeComponent', 'addressInfo')
},
handleNext() {
this.$emit('changeComponent', 'fileInfo')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
// 如果没有AccountID即代表是新增阶段,可以不设置url,让其为一个空数组
if (this.$attrs['form-data'] && this.$attrs['form-data'].AccountID) {
constant.tableConfig.initialParams = {
AccountID: this.$attrs['form-data'].AccountID
}
} else {
constant.tableConfig.url = ''
}
this.constant = constant
}
}
</script>
<style>
</style>
import dictionary from '@/api/dictionary'
const formConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: false,
rules: {
// Name: {
// trigger: 'blur',
// validator: function(rule, value, callback) {
// if (this.formData.Ext_CustomerIsRepeatability_KUT === true) {
// return callback(new Error('客户名称重复'))
// } else {
// return callback()
// }
// }
// }
},
formDesc: {
Ext_CustomerSocialUnifiedCreditCode_KUT: {
type: 'input',
label: '社会统一信用代码',
layout: 12,
required: true
},
Ext_CustomerListedCompanyCode_KUT: {
type: 'input',
label: '上市公司代码',
layout: 12
},
Ext_CustomerCompanyName_KUT: {
type: 'radio',
label: '公司名称',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12,
default: true
},
Ext_CustomerRegisteredCapital_KUT: {
type: 'input',
label: '注册资本',
layout: 12
},
Ext_CustomerRegistrationNumber_KUT: {
type: 'input',
label: '注册号',
layout: 12
},
Ext_CustomerEnterprisesTypes_KUT: {
type: 'select',
label: '企业类型',
isOptions: true,
options: dictionary.countryCode,
attrs: {
filterable: true
},
layout: 12
},
Ext_CustomerRegistrationAuthority_KUT: {
type: 'select',
label: '登记机关',
isOptions: true,
options: dictionary.customerForm,
layout: 12
},
Ext_CustomerExperienceRange_KUT: {
type: 'select',
label: '经验范围',
isOptions: true,
options: dictionary.customerContinent,
layout: 12
},
Ext_CustomerCorporateName_KUT: {
type: 'select',
label: '法人名',
isOptions: true,
options: dictionary.customerType,
layout: 12
},
Ext_CustomerOpeningTime_KUT: {
type: 'select',
label: '营业开始日期',
isOptions: true,
options: [
{
text: '选项1',
value: 1
},
{
text: '选项2',
value: 2
},
{
text: '选项3',
value: 3
}
],
layout: 12
},
Ext_CustomerOldName_KUT: {
type: 'radio',
label: '曾用名',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12
},
Ext_CustomerClosingTime_KUT: {
type: 'input',
label: '营业结束日期',
attrs: {
autosizeType: 'switch',
autosize: false,
rows: 3
}
},
Ext_CustomerIncorporationDate_KUT: {
type: 'input',
label: '成立日期',
layout: 12
},
Ext_CustomerLssuingLicenseDate_KUT: {
type: 'input',
label: '发照日期',
layout: 12
},
Ext_CustomerRevocationDate_KUT: {
type: 'input',
label: '吊销日期',
layout: 12
},
Ext_CustomerOrganizationStructureCode_KUT: {
type: 'input',
label: '组织机构代码',
layout: 12
},
Ext_CustomerEnterpriseStatus_KUT: {
type: 'input',
label: '企业状态',
layout: 12
},
Ext_CustomerIsListed_KUT: {
type: 'input',
label: '是否上市',
layout: 12
},
Ext_CustomerProvince_KUT: {
type: 'input',
label: '省份',
layout: 12
},
Ext_CustomerBeListedType_KUT: {
type: 'input',
label: '上市类型',
layout: 12
},
Ext_CustomerUpdateDate_KUT: {
type: 'input',
label: '更新日期',
layout: 12
},
Ext_CustomerEnterpriseScale_KUT: {
type: 'input',
label: '企业规模',
layout: 12
},
Ext_CustomerLandline_KUT: {
type: 'input',
label: '座机',
layout: 12
},
Ext_CustomerWebURL_KUT: {
type: 'input',
label: '官方地址',
layout: 12
},
Ext_CustomerEnterpriseIntroduction_KUT: {
type: 'textarea',
label: '企业介绍',
attrs: {
autosizeType: 'switch',
autosize: false,
rows: 3
}
}
}
}
export default {
formConfig
}
<template>
<div>
<base-info :form-data="$attrs.formData" />
</div>
</template>
<script>
import BaseInfo from '../base-info/table'
export default {
components: {
BaseInfo
}
}
</script>
<style>
</style>
<template>
<div v-loading.fullscreen.lock="loading">
<Title :title="title">
<el-button
type="primary"
icon="el-icon-download"
:loading="loading"
@click="handleNext"
>从企查查获取企业工商信息</el-button>
</Title>
<div class="form-container">
<form-title :title="formTitle" />
<ele-form
ref="form"
v-model="industryData"
v-bind="formConfig"
:request-fn="handleRequest"
@request-success="handleRequestSuccess"
/>
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善附件信息
</el-button>
<el-button
type="primary"
@click="handleNext"
>关闭</el-button>
<el-button
v-if="formData.Ext_CustomerStatus_KUT==='101'"
type="primary"
icon="el-icon-check"
@click="handleSubmit"
>确认提交</el-button>
</div>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import constant from './constant.js'
import { customer } from '@/api/customers'
// import { addPotentialCustomer } from '@/api/customers'
export default {
name: 'EnterpriseCustomersBaseInfo',
components: {
Title
},
props: {
formData: {
type: Object,
default: () => { }
}
},
data() {
return {
title: '创建企业客户-基础信息',
formTitle: '基础信息',
loading: false,
industryData: {},
formConfig: constant.formConfig
}
},
methods: {
handleRequest(data) {
console.log(data)
return Promise.resolve()
},
handleRequestSuccess() {
this.$message.success('发送成功')
},
handlePrev() {
this.$emit('changeComponent', 'fileInfo')
},
handleNext() {
var path = this.$route.path
console.log(path)
this.$store.commit('tagsView/DEL_VISITED_VIEW', { path })
this.$router.push({
path: '/customers/potential'
})
},
handleSubmit() {
const data = {
objectID: this.$route.query.objectID,
ext_CustomerStatus_KUT: '111'
}
this.loading = true
this.$request(customer.updateUrl, data).then(res => {
this.loading = false
this.handleNext()
}).then(() => {
this.loading = false
})
}
}
}
</script>
<style>
</style>
<template>
<div>
<Title :title="title" />
<FileTable />
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善联系人信息
</el-button>
<el-button
type="primary"
icon="el-icon-right"
@click="handleNext"
>保存,下一步,完善企业工商信息</el-button>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import FileTable from '../../../important-customers/components/file-info/table.vue'
export default {
components: {
Title,
FileTable
},
data() {
return {
title: '创建企业客户-附件信息'
}
},
created() {
this.tableListeners = {
handleEdit: this.handleEdit
}
},
methods: {
handlePrev() {
this.$emit('changeComponent', 'contactsInfo')
},
handleNext() {
this.$emit('changeComponent', 'enterpriseInfo')
}
}
}
</script>
<style lang="scss" scoped>
</style>
import dictionary from '@/api/dictionary'
import { industry, fetchFirstLevelClassification, fetchSecondLevelClassification, fetchThirdLevelClassification } from '@/api/customers'
const tableConfig = {
tableTitle: '行业信息',
url: industry.searchUrl,
isSearch: true,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
levelOneClassification: {
label: '一级分类',
value: ['LevelOneClassificationName']
},
levelTwoClassification: {
label: '二级分类',
value: ['LevelTwoClassificationName']
},
levelThreeClassification: {
label: '三级分类',
value: ['LevelThreeClassificationName']
},
MainProduct: {
label: '主要产品'
},
MainBusinessSituation: {
label: '主要业务情况'
},
PCS: {
label: '年销售量(PCS)'
},
AnnualSales: {
label: '年销售额(万元)'
},
SalesArea: {
label: '销售区域'
},
MarketShare: {
label: '市场份额占比'
},
Year: {
label: '年份'
},
Note: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
levelOneClassification: {
type: 'select',
label: '一级分类',
isOptions: true,
options: async data => {
const res = await fetchFirstLevelClassification()
var result = res.results.map(item => {
return {
text: item.LevelOneClassificationName,
value: item.LevelOneClassificationID
}
})
return result
},
layout: 12
},
levelTwoClassification: {
type: 'select',
label: '二级分类',
isOptions: true,
optionsLinkageFields: ['levelOneClassification'],
options: async data => {
if (!data.levelOneClassification) {
return []
}
const res = await fetchSecondLevelClassification({
levelOneClassificationID: data.levelOneClassification
})
var result = res.results.map(item => {
return {
text: item.LevelTwoClassificationName,
value: item.LevelTwoClassificationID
}
})
return result
},
layout: 12
},
levelThreeClassification: {
type: 'select',
label: '三级分类',
isOptions: true,
optionsLinkageFields: ['levelOneClassification', 'levelTwoClassification'],
options: async data => {
if (!data.levelTwoClassification) {
return []
}
const res = await fetchThirdLevelClassification({
levelTwoClassificationID: data.levelTwoClassification
})
var result = res.results.map(item => {
return {
text: item.LevelThreeClassificationName,
value: item.LevelThreeClassificationID
}
})
return result
},
layout: 12
},
MainProduct: {
label: '主要产品',
type: 'input',
value: 'Ext_CustomerStatus_KUTText',
layout: 12
},
MainBusinessSituation: {
label: '主要业务情况',
type: 'input',
layout: 12
},
PCS: {
label: '年销售量(PCS)',
type: 'input',
layout: 12
},
AnnualSales: {
label: '年销售额(万元)',
type: 'input',
layout: 12
},
SalesArea: {
label: '销售区域',
type: 'select',
isOptions: true,
options: dictionary.customerSalesArea,
layout: 12
},
MarketShare: {
label: '市场份额占比',
type: 'input',
layout: 12
},
Year: {
label: '年份',
type: 'date',
attrs: {
type: 'year'
},
layout: 12
},
Note: {
label: '备注',
type: 'input',
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...industry
}
<template>
<div>
<Title :title="title" />
<IndustryTable />
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善基础信息
</el-button>
<el-button
type="primary"
icon="el-icon-right"
@click="handleNext"
>下一步,完善项目信息</el-button>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import IndustryTable from './table.vue'
import constant from './constant'
const tableTitle = constant.tableConfig.tableTitle
export default {
components: {
Title,
IndustryTable
},
data() {
return {
title: '创建企业客户-' + tableTitle
}
},
methods: {
handlePrev() {
this.$emit('changeComponent', 'baseInfo')
},
handleNext() {
this.$emit('changeComponent', 'projectInfo')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import { project, fetchFirstLevelClassification, fetchSecondLevelClassification, fetchThirdLevelClassification } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '项目信息',
url: project.searchUrl,
showPagination: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
ProjectType: {
label: '项目类型'
},
levelOneClassification: {
label: '一级分类'
},
levelTwoClassification: {
label: '二级分类'
},
levelThreeClassification: {
label: '三级分类'
},
TerminalProducts: {
label: '终端产品'
},
ProductsType: {
label: '产品型号'
},
PCS: {
label: '年用量预估(PCS)'
},
ProductIntroduction: {
label: '项目介绍'
},
ExpectStartTime: {
label: '预计启动时间'
},
ExpectCompletionTime: {
label: '预计完成时间'
},
OriginalProductsCompanyOne: {
label: '原用产品公司1'
},
OriginalProductsTypeOne: {
label: '原用产品型号1'
},
OriginalProductsCompanyTwo: {
label: '原用产品公司2'
},
OriginalProductsTypeTwo: {
label: '原用产品型号2'
},
OriginalProductsCompanyThree: {
label: '原用产品公司3'
},
OriginalProductsTypeThree: {
label: '原用产品型号3'
},
MainlyRepresentCustomers: {
label: '主要代表客户'
},
Note: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
ProjectType: {
type: 'select',
label: '项目类型',
isOptions: true,
options: dictionary.customerProjectType,
layout: 12
},
levelOneClassification: {
type: 'select',
label: '一级分类',
isOptions: true,
options: async data => {
const res = await fetchFirstLevelClassification()
var result = res.results.map(item => {
return {
text: item.LevelOneClassificationName,
value: item.LevelOneClassificationID
}
})
return result
},
layout: 12
},
levelTwoClassification: {
type: 'select',
label: '二级分类',
isOptions: true,
optionsLinkageFields: ['levelOneClassification'],
options: async data => {
if (!data.levelOneClassification) {
return []
}
const res = await fetchSecondLevelClassification({
levelOneClassificationID: data.levelOneClassification
})
var result = res.results.map(item => {
return {
text: item.LevelTwoClassificationName,
value: item.LevelTwoClassificationID
}
})
return result
},
layout: 12
},
levelThreeClassification: {
type: 'select',
label: '三级分类',
isOptions: true,
optionsLinkageFields: ['levelOneClassification', 'levelTwoClassification'],
options: async data => {
if (!data.levelTwoClassification) {
return []
}
const res = await fetchThirdLevelClassification({
levelTwoClassificationID: data.levelTwoClassification
})
var result = res.results.map(item => {
return {
text: item.LevelThreeClassificationName,
value: item.LevelThreeClassificationID
}
})
return result
},
layout: 12
},
TerminalProducts: {
label: '终端产品',
type: 'select',
layout: 12
},
ProductsType: {
label: '产品型号',
type: 'input',
layout: 12
},
PCS: {
label: '年用量预估(PCS)',
type: 'input',
layout: 12
},
ProductIntroduction: {
label: '项目介绍',
type: 'input',
layout: 12
},
ExpectStartTime: {
label: '预计启动时间',
type: 'date',
layout: 12
},
ExpectCompletionTime: {
label: '预计完成时间',
type: 'date',
layout: 12
},
OriginalProductsCompanyOne: {
label: '原用产品公司1',
type: 'input',
layout: 12
},
OriginalProductsTypeOne: {
label: '原用产品型号1',
type: 'input',
layout: 12
},
OriginalProductsCompanyTwo: {
label: '原用产品公司2',
type: 'input',
layout: 12
},
OriginalProductsTypeTwo: {
label: '原用产品型号2',
type: 'input',
layout: 12
},
OriginalProductsCompanyThree: {
label: '原用产品公司3',
type: 'input',
layout: 12
},
OriginalProductsTypeThree: {
label: '原用产品型号3',
type: 'input',
layout: 12
},
MainlyRepresentCustomers: {
label: '主要代表客户',
type: 'input',
layout: 12
},
Note: {
label: '备注',
type: 'input',
layout: 12
}
}
}
export default {
tableConfig,
formConfig,
...project
}
<template>
<div>
<Title :title="title" />
<ProjectTable />
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善行业信息
</el-button>
<el-button
type="primary"
icon="el-icon-right"
@click="handleNext"
>下一步,完善地址信息</el-button>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import ProjectTable from './table.vue'
import constant from './constant'
const tableTitle = constant.tableConfig.tableTitle
export default {
components: {
Title,
ProjectTable
},
data() {
return {
title: '创建企业客户-' + tableTitle
}
},
methods: {
handlePrev() {
this.$emit('changeComponent', 'industryInfo')
},
handleNext() {
this.$emit('changeComponent', 'addressInfo')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import { followRecord } from '@/api/customers'
const tableConfig = {
tableTitle: '跟进记录',
url: followRecord.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
FollowUPRecordPerson: {
label: '跟进人'
},
FollowUPRecord: {
label: '跟进记录'
},
CreateOn: {
label: '创建时间'
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
FollowUPRecord: {
type: 'textarea',
label: '跟进记录',
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...followRecord
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import dictionary from '@/api/dictionary'
import { followTask } from '@/api/customers'
const tableConfig = {
tableTitle: '跟进任务信息',
url: followTask.searchUrl,
isSearch: true,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Subject: {
label: '标题'
},
Ext_CustomerTaskCreateBy_KUT: {
label: '创建人'
},
SupervisionFeedBack: {
label: '创建时间'
},
Processor: {
label: '跟进人'
},
StartDateTime: {
label: '开始时间'
},
Ext_CustomerTaskContent_KUT: {
label: '跟进内容'
},
Ext_CustomerEstimatedCompletionTime_KUT: {
label: '预计完成时间'
},
CompletionDateTime: {
label: '实际完成时间'
},
Status: {
label: '任务状态'
},
Ext_CustomerTaskNote_KUT: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
Subject: {
type: 'input',
label: '任务标题',
layout: 24
},
Category: {
label: '任务类型',
type: 'select',
isOptions: true,
options: dictionary.customerTaskCategory,
layout: 24
},
Status: {
label: '任务状态',
type: 'select',
isOptions: true,
disabled: true,
default: '1',
options: dictionary.customerTaskStatus,
layout: 24
},
Ext_CustomerTaskContent_KUT: {
type: 'textarea',
label: '任务内容',
layout: 24,
attrs: {
rows: 2,
autosizeType: 'switch',
autosize: false
}
},
Processor: {
type: 'input',
label: '跟进人员',
layout: 24
},
StartDateTime: {
type: 'date',
label: '开始时间',
layout: 24
},
Ext_CustomerEstimatedCompletionTime_KUT: {
type: 'date',
label: '预计完成时间',
layout: 24
},
// CompletionDateTime: {
// type: 'date',
// label: '实际完成时间',
// layout: 24
// },
Ext_CustomerTaskNote_KUT: {
type: 'textarea',
label: '备注',
layout: 24,
attrs: {
rows: 2,
autosizeType: 'switch',
autosize: false
}
}
}
}
export default {
tableConfig,
formConfig,
...followTask
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import { supervise } from '@/api/customers'
const tableConfig = {
tableTitle: '督办任务信息',
url: supervise.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
SupervisionName: {
label: '督办人'
},
SupervisionContent: {
label: '督办内容'
},
SupervisionFeedBack: {
label: '督办反馈'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
SupervisionContent: {
type: 'textarea',
label: '督办内容',
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...supervise
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
<template>
<div>
<Supervise />
<FollowTask />
<FollowRecord />
</div>
</template>
<script>
import FollowRecord from './components/follow-record'
import FollowTask from './components/follow-task'
import Supervise from './components/supervise'
export default {
components: {
FollowRecord,
FollowTask,
Supervise
}
}
</script>
<style>
</style>
<template>
<div
v-loading.fullscreen.lock="loading"
class="app-container"
>
<div class="detail-header-container">
<div class="detail-header-title">
<h3>{{ customerDetail.Name }}</h3>
<div class="detail-header-info">
<div>
<i class="el-icon-plus" />
<span>客户编码:{{ customerDetail.AccountID }}</span>
</div>
<div>
<i class="el-icon-plus" />
<span>客户状态:{{ customerDetail.Ext_CustomerStatus_KUTText }}</span>
</div>
<div>
<i class="el-icon-plus" />
<span>客户归属:{{ customerDetail.Ext_CustomerType_KUTText }}</span>
</div>
</div>
</div>
<div class="detail-header-info">
<div><span>创建人:{{ customerDetail.CreatedBy }}</span></div>
<div><span>创建时间:{{ customerDetail.CreationOn }}</span></div>
<div><span>修改人:{{ customerDetail.ChangedBy }}</span></div>
<div><span>修改时间:{{ customerDetail.ChangedOn }}</span></div>
<div v-if="customerDetail.Ext_CustomerFollowUpName_KUT"><span>跟进人:{{ customerDetail.Ext_CustomerFollowUpName_KUT }}</span></div>
<div v-if="customerDetail.Ext_CustomerFollowUpDate_KUT"><span>跟进时间:{{ customerDetail.Ext_CustomerFollowUpDate_KUT }}</span></div>
</div>
<div class="detail-header-btn">
<el-button
v-if="!customerDetail.Ext_CustomerFollowUpID_KUT"
type="primary"
icon="el-icon-plus"
@click="hanldeFollow"
>客户跟进</el-button>
<el-button
v-if="customerDetail.Ext_CustomerFollowUpID_KUT===userInfo.ObjectID"
type="danger"
icon="el-icon-plus"
@click="hanldeEndFollow"
>取消跟进</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleLinkTo"
>转正式客户报备</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleShowDialog(constant.ResourcePoolFormConfig, true)"
>转资源池</el-button>
<el-button
v-if="!customerDetail.Ext_CustomerIsImportant_KUT"
plain
icon="el-icon-star-off"
@click="handleFocus(true)"
>重点关注</el-button>
<el-button
v-else
type="danger"
icon="el-icon-star-on"
@click="handleFocus(false)"
>取消重点关注</el-button>
<el-button
v-if="customerDetail.Ext_CustomerStatus_KUT === '111'"
type="danger"
icon="el-icon-plus"
@click="handleShowDialog(constant.CancellationFormConfig)"
>注销客户</el-button>
<el-button
v-if="customerDetail.Ext_CustomerStatus_KUT === '131'"
type="primary"
icon="el-icon-plus"
@click="handleShowDialog(constant.ActivationFormConfig)"
>激活客户</el-button>
</div>
</div>
<div class="detail-content-container">
<el-tabs v-model="activeName">
<el-tab-pane
v-for="tab in tabs"
:key="tab.name"
:label="tab.label"
:name="tab.name"
:lazy="true"
>
<component
:is="tab.name"
:form-data="customerDetail"
/>
</el-tab-pane>
</el-tabs>
</div>
<!-- 弹框 -->
<ele-form-dialog
v-model="dialogData"
:request-fn="handleSave"
:visible.sync="dialogFormVisible"
v-bind="dialogConfig"
:loading="dialogLoading"
/>
</div>
</template>
<script>
import RecordInfo from '../important-customers/components/record-info'
import ApprovalInfo from '../important-customers/components/approval-info'
import IndustryInfo from './components/industry-info/table'
import ProjectInfo from './components/project-info/table'
import AddresInfo from './components/address-info/table'
import ContactInfo from './components/contacts-info/table'
import FileInfo from '../important-customers/components/file-info/table.vue'
import EnterpriseInfo from './components/enterprise-info/detail'
import HandleInfo from '../important-customers/components/handle-info'
import constant from '../potential-customers/constant'
import { customer } from '@/api/customers'
import { parseTime } from '@/utils'
export default {
components: {
RecordInfo,
ApprovalInfo,
IndustryInfo,
ProjectInfo,
AddresInfo,
ContactInfo,
FileInfo,
EnterpriseInfo,
HandleInfo
},
data() {
return {
customerDetail: {},
userInfo: {},
tabs: [{
label: '跟进记录',
name: 'RecordInfo'
}, {
label: '审批信息',
name: 'ApprovalInfo'
}, {
label: '行业信息',
name: 'IndustryInfo'
}, {
label: '项目信息',
name: 'ProjectInfo'
}, {
label: '联系人信息',
name: 'ContactInfo'
}, {
label: '地址信息',
name: 'AddresInfo'
}, {
label: '附件信息',
name: 'FileInfo'
}, {
label: '企业信息',
name: 'EnterpriseInfo'
}, {
label: '操作日志',
name: 'HandleInfo'
}],
activeName: 'RecordInfo',
loading: false,
constant: constant,
dialogData: {},
dialogConfig: {
formDesc: {}
},
dialogFormVisible: false,
dialogLoading: false
}
},
created() {
this.objectID = this.$route.query.objectID
this.userInfo = JSON.parse(localStorage.getItem('USERINFO'))
this.fetchData()
},
methods: {
fetchData() {
this.loading = true
this.$request(customer.detailUrl, { objectID: this.objectID }).then(res => {
this.customerDetail = res.results[0]
this.loading = false
})
},
hanldeFollow() {
this.$confirm('是否确定跟进客户', '确认提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
objectID: this.objectID,
ext_CustomerFollowUpName_KUT: this.userInfo.Ext_EmployeeUserName_KUT,
ext_CustomerFollowUpDate_KUT: parseTime(new Date()),
ext_CustomerFollowUpID_KUT: this.userInfo.ObjectID
}
this.loading = true
this.hanldeUpdate(data).then(res => {
this.loading = false
this.customerDetail.Ext_CustomerFollowUpName_KUT = data.ext_CustomerFollowUpName_KUT
this.customerDetail.Ext_CustomerFollowUpDate_KUT = data.ext_CustomerFollowUpDate_KUT
this.customerDetail.Ext_CustomerFollowUpID_KUT = data.ext_CustomerFollowUpID_KUT
})
})
},
hanldeEndFollow() {
this.$confirm('是否取消跟进客户', '确认提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
objectID: this.objectID
}
this.loading = true
this.$request(customer.endFollowUrl, data).then(res => {
this.loading = false
this.customerDetail.Ext_CustomerFollowUpName_KUT = ''
this.customerDetail.Ext_CustomerFollowUpDate_KUT = ''
this.customerDetail.Ext_CustomerFollowUpID_KUT = ''
}).catch(() => {
this.loading = false
})
})
},
handleFocus(status) {
const data = {
objectID: this.objectID,
ext_CustomerIsImportant_KUT: status
}
this.loading = true
this.hanldeUpdate(data).then(res => {
this.loading = false
this.customerDetail.Ext_CustomerIsImportant_KUT = status
})
},
handleShowDialog(config, isArray) {
this.isArray = isArray
this.dialogConfig = config
this.dialogFormVisible = true
},
handleSave() {
this.dialogLoading = true
let data = this.$translateToC4CData(this.dialogData)
data.objectID = this.objectID
data.roleCode = this.customerDetail.RoleCode
if (this.isArray) {
data = [data]
}
this.$request(this.dialogConfig.createUrl, data).then(res => {
this.customerDetail.Ext_CustomerStatus_KUT = this.dialogData.Ext_CustomerStatus_KUT
this.dialogLoading = false
this.dialogFormVisible = false
}).catch(() => {
this.dialogLoading = false
})
},
handleLinkTo() {
this.$router.push({
path: '/customers/important',
query: {
objectID: this.objectID
}
})
},
async hanldeUpdate(data) {
try {
return await this.$request(customer.updateUrl, data)
} catch (err) {
this.loading = false
return Promise.reject(err)
}
}
}
}
</script>
<style>
</style>
<template>
<div
v-loading.fullscreen.lock="loading"
class="app-container"
>
<transition
mode="out-in"
name="fade-transform"
>
<keep-alive>
<component
:is="componentName"
:form-data="customerDetail"
@changeComponent="changeComponent"
/>
</keep-alive>
</transition>
</div>
</template>
<script>
import baseInfo from './components/base-info'
import industryInfo from './components/industry-info'
import projectInfo from './components/project-info'
import addressInfo from './components/address-info'
import contactsInfo from './components/contacts-info'
import fileInfo from './components/file-info'
import enterpriseInfo from './components/enterprise-info'
import { fetchPotentialCustomerDetail } from '@/api/customers'
export default {
components: {
baseInfo,
industryInfo,
projectInfo,
addressInfo,
contactsInfo,
fileInfo,
enterpriseInfo
},
data() {
return {
loading: false,
componentName: 'baseInfo',
customerDetail: {
Ext_CustomerStatus_KUT: '101'
}
}
},
created() {
this.objectID = this.$route.query.objectID
if (this.objectID) {
this.fetchData()
}
},
methods: {
fetchData() {
this.loading = true
fetchPotentialCustomerDetail({ objectID: this.objectID }).then(res => {
this.customerDetail = res.results[0]
this.loading = false
})
},
changeComponent(name) {
this.componentName = name
}
}
}
</script>
<style lang="scss" scoped>
/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all 0.15s;
}
.fade-transform-enter {
opacity: 0;
transform: translateX(-90vw);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(90vw);
}
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from '../constant'
export default {
data() {
return {
constant: {}
}
},
created() {
var config = JSON.parse(JSON.stringify(constant))
config.tableConfig.tableTitle = '报关行地址信息'
// 设置表单的初始搜索条件,该条件一般不会发生改变
config.tableConfig.initialParams = {
AccountID: this.$attrs['form-data'].AccountID,
Ext_CustomerAddressCategory_KUT: '111'
}
this.constant = config
}
}
</script>
<style>
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from '../constant'
export default {
data() {
return {
constant: {}
}
},
created() {
var config = JSON.parse(JSON.stringify(constant))
config.tableConfig.tableTitle = '地址信息'
// 设置表单的初始搜索条件,该条件一般不会发生改变
// 如果没有AccountID即代表是新增阶段,可以不设置url,让其为一个空数组
if (this.$attrs['form-data'] && this.$attrs['form-data'].AccountID) {
constant.tableConfig.initialParams = {
AccountID: this.$attrs['form-data'].AccountID,
Ext_CustomerAddressCategory_KUT: '101'
}
} else {
constant.tableConfig.url = ''
}
this.constant = config
}
}
</script>
<style>
</style>
import { address } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '地址信息',
url: address.searchUrl,
isSearch: true,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Ext_CustomerAddressType_KUT: {
label: '地址类型',
value: 'Ext_CustomerAddressType_KUTText'
},
CountryCode: {
label: '国别',
value: 'CountryCodeText'
},
StateCode: {
label: '省份',
value: 'StateCodeText'
},
City: {
label: '城市'
},
Street: {
label: '区/县'
},
HouseNumber: {
label: '详细地址'
},
PostalCode: {
label: '邮编'
},
MainIndicator: {
label: '是否默认'
},
Ext_CustomerAddressNote_KUT: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Ext_CustomerAddressType_KUT: {
type: 'select',
label: '地址类型',
isOptions: true,
options: dictionary.customerAddressType,
layout: 12
},
CountryCode: {
type: 'select',
label: '国别',
isOptions: true,
options: dictionary.countryCode,
layout: 12
},
StateCode: {
label: '省份',
type: 'select',
value: 'Ext_CustomerStatus_KUTText',
layout: 12
},
City: {
label: '城市',
type: 'input',
layout: 12
},
Street: {
label: '区/县',
type: 'input',
layout: 12
},
Ext_CustomerAddressDetailedAddress_KUT: {
label: '详细地址',
type: 'input',
layout: 12
},
StreetPostalCode: {
label: '邮编',
type: 'input',
layout: 12
},
MainIndicator: {
label: '是否默认',
type: 'radio',
layout: 12,
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
default: false
},
Ext_CustomerAddressNote_KUT: {
label: '备注',
type: 'textarea',
attrs: {
// autosizeType: 'switch',
autosize: false,
rows: 2,
maxlength: 300
},
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...address
}
<template>
<div>
<Title :title="title" />
<AddressTable :form-data="$attrs['form-data']" />
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-back"
@click="handlePrev"
>
上一步,完善市场信息
</el-button>
<el-button
type="primary"
icon="el-icon-right"
@click="handleNext"
>下一步,完善联系人信息</el-button>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import AddressTable from './components/normalTable'
import constant from './constant'
const tableTitle = constant.tableConfig.tableTitle
export default {
components: {
Title,
AddressTable
},
data() {
return {
title: '创建企业客户-' + tableTitle
}
},
methods: {
handlePrev() {
this.$emit('changeComponent', 'marketInfo')
},
handleNext() {
this.$emit('changeComponent', 'contactsInfo')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<NormalTable :form-data="$attrs['form-data']" />
<DeclarationTable :form-data="$attrs['form-data']" />
</div>
</template>
<script>
import NormalTable from './components/normalTable'
import DeclarationTable from './components/declarationTable'
export default {
components: {
NormalTable,
DeclarationTable
}
}
</script>
<style>
</style>
const tableConfig = {
tableTitle: '审批信息',
url: 'flow/runtime/search',
multiple: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
title: {
label: '审批标题'
},
assignee: {
label: '审批人'
},
Ext_CustomerStatus_KUT: {
label: '审批职位'
},
statusText: {
label: '审批状态'
},
comment: {
label: '审批意见'
},
updatedTime: {
label: '审批时间'
}
// handle: {
// label: '操作',
// hideInFilter: true,
// fixed: 'right',
// renderItem: (h, scope, listeners) => {
// return h('div', {}, [
// h(
// 'el-button',
// {
// on: {
// click: (e) => listeners.handlePass(scope.row)
// },
// class: 'el-icon-edit',
// props: {
// type: 'text'
// }
// },
// '审批通过'),
// scope.row.Ext_CustomerStatus_KUT === '101' && h(
// 'el-button',
// {
// on: {
// click: (e) => listeners.handleReject(scope.row)
// },
// class: 'el-icon-delete',
// props: {
// type: 'text'
// }
// },
// '审批否决')
// ])
// }
// }
}
}
// 审批意见弹框
const ApprovalFormConfig = {
title: '审批意见',
createUrl: '/flow/runtime/nodeComplete',
labelPosition: 'left',
submitBtnText: '确定',
span: 22,
formDesc: {
comment: {
type: 'textarea',
label: '审批意见',
layout: 24
}
}
}
export default {
tableConfig,
ApprovalFormConfig
}
<template>
<div>
<BusinessTable
ref="table"
v-bind="constant"
>
<template v-slot:btn="{ selection }">
<el-button
type="primary"
icon="el-icon-check"
@click="hanldePass(selection)"
>审批通过</el-button>
<el-button
type="danger"
icon="el-icon-close"
@click="hanldeReject(selection)"
>审批否决</el-button>
</template>
</BusinessTable>
<!-- 弹框部分 -->
<ele-form-dialog
:form-data="formData"
:request-fn="handleSave"
:visible.sync="dialogFormVisible"
v-bind="formConfig"
:loading="loading"
/>
</div>
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {},
formData: {},
dialogFormVisible: false,
loading: false,
formConfig: {
formDesc: {}
}
}
},
created() {
var userInfo = JSON.parse(localStorage.getItem('USERINFO'))
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
assignee: userInfo.Ext_EmployeeUserName_KUT,
definitionCode: 'CUSTOMER_TO_RESOURCE_POOL',
businessKey: this.$route.query.objectID,
status: 'ACTIVE'
}
this.constant = constant
this.formConfig = constant.ApprovalFormConfig
},
methods: {
hanldePass(selection) {
if (selection && selection.length < 1) {
this.$message.warning('请先选择一条数据再进行操作')
return
}
this.dialogFormVisible = true
var data = selection[0]
console.log(data)
this.formData = {
runtimeId: data.id,
assignee: data.assignee,
variables: { approvalResult: 'approved' }
}
},
hanldeReject(selection) {
if (selection && selection.length < 1) {
this.$message.warning('请先选择一条数据再进行操作')
return
}
this.dialogFormVisible = true
var data = selection[0]
this.formData = {
runtimeId: data.id,
assignee: data.assignee,
variables: { approvalResult: 'reject' }
}
},
handleSave() {
this.loading = true
this.$request(this.formConfig.createUrl, this.formData).then(res => {
this.$message.success('审批成功')
this.dialogFormVisible = false
this.$refs.table.search()
this.loading = false
}).catch(() => {
this.loading = false
})
}
}
}
</script>
<style>
</style>
import dictionary from '@/api/dictionary'
import { customer } from '@/api/customers'
const formConfig = {
tableTitle: '基本信息',
updateUrl: customer.updateUrl,
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: true,
rules: {
// Name: {
// trigger: 'blur',
// validator: function(rule, value, callback) {
// if (this.formData.Ext_CustomerIsRepeatability_KUT === true) {
// return callback(new Error('客户名称重复'))
// } else {
// return callback()
// }
// }
// }
},
formDesc: {
Name: {
type: 'input',
label: '客户名称',
layout: 12,
required: true
},
Ext_CustomerSocialUnifiedCreditCode_KUT: {
type: 'input',
label: '社会统一信用代码',
layout: 12
},
Ext_CustomerIsRepeatability_KUT: {
type: 'radio',
label: '进行重复性校验',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12,
default: true
},
key_btn: {
type: 'button',
default: '重复性校验',
layout: 12,
attrs: {
type: 'primary'
}
},
Ext_CustomerEnglishName_KUT: {
type: 'input',
label: '英文名称',
layout: 12
},
Ext_CustomerType_KUT: {
type: 'select',
label: '客户类型',
required: true,
isOptions: true,
options: [
{
text: '直销客户',
value: '101'
},
{
text: '代理商客户',
value: '111'
}
],
layout: 12
},
CountryCode: {
type: 'select',
label: '客户国别',
isOptions: true,
options: dictionary.countryCode,
attrs: {
filterable: true
},
layout: 12
},
Ext_CustomerContinent_KUT: {
type: 'select',
label: '所在大洲',
isOptions: true,
options: dictionary.customerContinent,
layout: 12
},
Ext_CustomerStatus_KUT: {
type: 'select',
label: '客户状态',
isOptions: true,
disabled: true,
default: '101',
options: dictionary.customerStatus,
layout: 12
},
Ext_CustomerAccountManagerID_KUT: {
type: 'select',
label: '客户经理',
isOptions: true,
options: [
{
text: '选项1',
value: 1
},
{
text: '选项2',
value: 2
},
{
text: '选项3',
value: 3
}
],
layout: 12
},
ParentAccountID: {
type: 'lov',
code: 'customer',
returnFn: function(row) {
return {
ParentAccountID: row.ObjectID,
ParentAccountText: row.Name
}
},
initialParams: {
// roleCode: 'BUP002'
},
label: '上级客户',
layout: 12
},
Ext_CustomerAgentPMID_KUT: {
type: 'select',
label: '代理商',
isOptions: true,
options: [
{
text: '选项1',
value: 1
},
{
text: '选项2',
value: 2
},
{
text: '选项3',
value: 3
}
],
layout: 12
},
Ext_CustomerLevel_KUT: {
type: 'select',
label: '客户等级',
isOptions: true,
options: dictionary.customerLevel,
layout: 12
},
Ext_CustomerIsRepeatability_KU111: {
type: 'radio',
label: '重要客户',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12,
default: true
},
Ext_CustomerFilingInstructions_KUT: {
type: 'textarea',
label: '报备说明',
attrs: {
autosizeType: 'switch',
autosize: false,
rows: 3
}
},
Ext_CustomerNote_KUT: {
type: 'textarea',
label: '备注信息',
attrs: {
autosizeType: 'switch',
autosize: false,
rows: 3
}
}
}
}
export default {
formConfig
}
<template>
<div>
<Title :title="title">
<span>*</span>为必填项
</Title>
<div class="form-container">
<form-title :title="formTitle" />
<ele-form
ref="form"
v-model="formData"
v-bind="formConfig"
>
<template v-slot:key_btn>
<el-button
type="primary"
@click="handleCheckRepeat"
>进行重复性校验</el-button>
</template>
</ele-form>
<div class="submit-btn">
<el-button
type="primary"
icon="el-icon-right"
:loading="loading"
@click="handleSubmit"
>保存,下一步,完善行业信息</el-button>
</div>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import constant from './constant.js'
import { addPotentialCustomer, updatePotentialCustomer } from '@/api/customers'
export default {
name: 'EnterpriseCustomersBaseInfo',
components: {
Title
},
props: {
formData: {
type: Object,
default: () => { }
}
},
data() {
return {
title: '创建正式客户-基础信息',
formTitle: '基础信息',
loading: false,
formConfig: constant.formConfig,
newFormData: {}
}
},
watch: {
formData(val) {
this.newFormData = JSON.parse(JSON.stringify(val))
this.originData = JSON.parse(JSON.stringify(val))
}
},
created() {
this.$emit('changeTitle', this.title)
},
methods: {
async handleSubmit() {
await this.$refs.form.validate()
this.loading = true
if (this.$route.query.objectID) {
if (JSON.stringify(this.originData) !== JSON.stringify(this.newFormData)) {
this.handleEdit()
} else {
this.loading = false
this.handleNext()
}
} else {
this.handleAdd()
}
},
handleAdd() {
const formData = this.$translateToC4CData(this.formData)
// 正式客户roleCode默认是'BUP002'
formData.roleCode = 'CRM000'
// 新建潜在客户的状态为草稿状态101
formData.ext_CustomerStatus_KUT = '101'
delete formData.key_btn
// 新建接口是基于批量新增设计的,所以要用数组包裹formData传值
addPotentialCustomer([formData]).then(res => {
console.log(res)
this.loading = false
const objectID = res.results[0]
this.$router.push({
path: '/customers/important',
query: { objectID }
})
this.handleNext()
})
},
handleEdit() {
const formData = this.$getUpdateChange(this.originData, this.newFormData)
updatePotentialCustomer(formData).then(res => {
this.loading = false
this.handleNext()
})
},
handleCheckRepeat(data) {
},
handleNext() {
this.originData = JSON.stringify(this.newFormData)
this.$emit('changeComponent', 'industryInfo')
}
}
}
</script>
<style>
</style>
<template>
<DescriptionTable
:table-config="formConfig"
:table-data="formData"
/>
</template>
<script>
import constant from './constant'
export default {
name: 'BaseInfo',
props: {
formData: {
type: Object,
default: () => { }
}
},
data() {
return {
formConfig: constant.formConfig
}
}
}
</script>
<style>
</style>
\ No newline at end of file
import dictionary from '@/api/dictionary'
import { billing } from '@/api/customers'
// import { fetchFirstLevelClassification, fetchSecondLevelClassification, fetchThirdLevelClassification } from '@/api/customers'
const tableConfig = {
tableTitle: '开票信息',
url: billing.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
BillingType: {
label: '开票类型'
},
CompanyName: {
label: '单位'
},
DetailedAddress: {
label: '地址'
},
TaxpayerIdentificationNumber: {
label: '纳税人识别号'
},
DepositBank: {
label: '开户行'
},
BankNumber: {
label: '账号'
},
Phone: {
label: '电话'
},
TradeName: {
label: '商品名称'
},
Unit: {
label: '单位'
},
Currency: {
label: '货币'
},
TaxRate: {
label: '税率'
},
IsDefault: {
label: '是否默认'
},
Note: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
BillingType: {
type: 'select',
label: '开票类型',
isOptions: true,
options: dictionary.billingType,
required: true,
layout: 12
},
CompanyName: {
type: 'input',
label: '公司名称',
layout: 12
},
DetailedAddress: {
label: '地址',
type: 'input',
layout: 12
},
TaxpayerIdentificationNumber: {
label: '纳税人识别号',
type: 'input',
layout: 12
},
DepositBank: {
label: '开户行',
type: 'input',
layout: 12
},
BankNumber: {
label: '账号',
type: 'input',
layout: 12
},
Phone: {
label: '电话',
type: 'input',
layout: 12
},
TradeName: {
label: '商品名称',
type: 'input',
layout: 12
},
Unit: {
label: '单位',
type: 'select',
isOptions: true,
options: dictionary.unit,
layout: 12
},
Currency: {
label: '货币',
type: 'select',
isOptions: true,
options: dictionary.currency,
layout: 12
},
TaxRate: {
label: '税率',
type: 'input',
layout: 12
},
IsDefault: {
label: '是否默认',
type: 'radio',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12,
default: true
},
Note: {
label: '备注',
type: 'input',
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...billing
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
<template>
<div class="credit-box">
<form-title title="信用管理" />
<el-descriptions
:column="1"
size="small"
border
>
<el-descriptions-item label="信用等级:">
<div class="edit-item">
<div>
{{ detail.Ext_CustomerCreditRating_KUTText }}
</div>
<div>
<el-button
type="text"
icon="el-icon-edit"
@click="handleEdit(levelConfig)"
>等级编辑</el-button>
</div>
</div>
</el-descriptions-item>
<el-descriptions-item label="信用分值:">
{{ detail.Ext_CustomerCreditScore_KUT }}
</el-descriptions-item>
<el-descriptions-item label="信用授权:">
<div class="edit-item">
<div>
<el-checkbox
v-model="detail.Ext_CustomerLunarKnot_KUT"
disabled
>
<span>月结</span>
<input
v-model="detail.Ext_CustomerLunarKnotDays_KUT"
type="number"
disabled
>
<span></span>
</el-checkbox>
<el-checkbox
v-model="detail.Ext_CustomerSilverExchange_KUT"
disabled
>
<span>银兑</span>
<input
v-model="detail.Ext_CustomerSilverExchangeDays_KUT"
type="number"
disabled
>
<span></span>
</el-checkbox>
<el-checkbox
v-model="detail.Ext_CustomerExchange_KUT"
disabled
>
<span>商兑</span>
<input
v-model="detail.Ext_CustomerExchangeDays_KUT"
type="number"
disabled
>
<span></span>
</el-checkbox>
<el-checkbox
v-model="detail.Ext_CustomerWireTransfer_KUT"
label="电汇"
disabled
/>
<el-checkbox
v-model="detail.Ext_CustomerCash_KUT"
label="现金"
disabled
/>
<el-checkbox
v-model="detail.Ext_CustomerTicketArrival_KUT"
disabled
>
<span>票到</span>
<input
v-model="detail.Ext_CustomerTicketArrivalDays_KUT"
type="number"
disabled
>
<span></span>
</el-checkbox>
</div>
<div>
<el-button
type="text"
icon="el-icon-edit"
@click="handleEdit(authorizionConfig)"
>授权编辑</el-button>
</div>
</div>
</el-descriptions-item>
<el-descriptions-item label="信用额度:">
{{ detail.Ext_CustomerCreditLine_KUT }}
</el-descriptions-item>
<el-descriptions-item label="剩余额度:">
{{ detail.Ext_CustomerRemainingLimit_KUT }}
</el-descriptions-item>
<el-descriptions-item label="样品额度:">
{{ detail.Ext_CustomerSampleQuota_KUT }}
</el-descriptions-item>
<el-descriptions-item label="样品剩余额度:">
{{ detail.Ext_CustomerSampleRemainingQuota_KUT }}
</el-descriptions-item>
</el-descriptions>
<ele-form-dialog
v-model="dialogFormData"
:request-fn="handleSave"
:visible.sync="dialogVisible"
v-bind="config"
:loading="loading"
>
<template v-slot:Ext_CustomerCreditLine_KUT>
<div class="dialog-item">
<el-checkbox v-model="detail.Ext_CustomerLunarKnot_KUT">
<span>月结</span>
<input
v-model="detail.Ext_CustomerLunarKnotDays_KUT"
type="number"
>
<span></span>
</el-checkbox>
<el-checkbox v-model="detail.Ext_CustomerSilverExchange_KUT">
<span>银兑</span>
<input
v-model="detail.Ext_CustomerSilverExchangeDays_KUT"
type="number"
>
<span></span>
</el-checkbox>
<el-checkbox v-model="detail.Ext_CustomerExchange_KUT">
<span>商兑</span>
<input
v-model="detail.Ext_CustomerExchangeDays_KUT"
type="number"
>
<span></span>
</el-checkbox>
<el-checkbox
v-model="detail.Ext_CustomerWireTransfer_KUT"
label="电汇"
/>
<el-checkbox
v-model="detail.Ext_CustomerCash_KUT"
label="现金"
/>
<el-checkbox v-model="detail.Ext_CustomerTicketArrival_KUT">
<span>票到</span>
<input
v-model="detail.Ext_CustomerTicketArrivalDays_KUT"
type="number"
>
<span></span>
</el-checkbox>
</div>
</template>
</ele-form-dialog>
</div>
</template>
<script>
import dictionary from '@/api/dictionary'
import { customer } from '@/api/customers'
export default {
props: {
formData: {
type: Object,
default: () => { }
}
},
data() {
return {
detail: {},
dialogVisible: false,
loading: false,
dialogFormData: {},
config: {
formDesc: {}
},
levelConfig: {
title: '添加信用等级',
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Ext_CustomerCreditRating_KUT: {
type: 'select',
label: '信用等级',
isOptions: true,
options: dictionary.customerCreditRating
},
Ext_CustomerCreditScore_KUT: {
type: 'input',
label: '信用分值'
}
}
},
authorizionConfig: {
title: '添加信用授权',
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Ext_CustomerCreditLine_KUT: {
type: 'select',
label: '信用额度'
},
Ext_CustomerRemainingLimit_KUT: {
type: 'input',
label: '剩余额度'
},
Ext_CustomerSampleQuota_KUT: {
type: 'input',
label: '样品额度'
},
Ext_CustomerSampleRemainingQuota_KUT: {
type: 'input',
label: '剩余样品额度'
}
}
}
}
},
watch: {
formData: {
handler(newVal) {
this.detail = newVal
},
immediate: true
}
},
methods: {
handleEdit(config) {
this.dialogFormData = JSON.parse(JSON.stringify(this.detail))
this.config = config
this.dialogVisible = true
},
handleSave() {
this.loading = true
const data = this.$getUpdateChange(this.detail, this.dialogFormData)
this.$request(customer.updateUrl, data).then(res => {
this.$message.success('更新成功')
this.detail = this.dialogFormData
this.loading = false
}).catch(() => {
this.loading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.credit-box {
margin: 20px;
::v-deep .el-descriptions-item__label {
width: 150px;
text-align: right;
padding-right: 4px;
}
::v-deep .el-button--text {
padding-top: 0;
padding-bottom: 0;
}
.edit-item,
.dialog-item {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
input {
width: 30px;
border: none;
outline: none;
padding: 0 5px;
border-bottom: 1px solid #999;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type="number"] {
-moz-appearance: textfield;
}
}
.dialog-item {
justify-content: start;
}
}
</style>
import { deliveryinstruction } from '@/api/customers'
import { upload, uploadCode } from '@/api/upload'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '交货说明',
url: deliveryinstruction.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
InstructionsType: {
label: '说明类型'
},
Content: {
label: '内容'
},
Note: {
label: '备注'
},
Document: {
label: '附件'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
InstructionsType: {
type: 'select',
label: '说明类型',
isOptions: true,
options: dictionary.instructionsType
},
Content: {
type: 'input',
label: '内容'
},
Note: {
label: '备注',
type: 'textarea',
attrs: {
rows: 2,
autosize: false
}
},
Document: {
label: '附件',
type: 'upload-file',
attrs: {
// 上传地址
action: upload.createUrl,
isCanDelete: true,
data: {
typeCode: uploadCode.customer
}
}
}
}
}
export default {
tableConfig,
formConfig,
...deliveryinstruction
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID,
projectType: '101'
}
this.constant = constant
}
}
</script>
<style>
</style>
<template>
<div class="tab-container">
<el-tabs type="border-card">
<el-tab-pane
label="银行及付款信息"
:lazy="true"
>
<PaymentTable />
</el-tab-pane>
<el-tab-pane
label="交货说明"
:lazy="true"
>
<DeliveryTable />
</el-tab-pane>
<el-tab-pane
label="信用管理"
:lazy="true"
>
<CreditManagement :form-data="$attrs['form-data']" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import DeliveryTable from './delivery-table'
import PaymentTable from './payment-table'
import CreditManagement from './credit-management'
export default {
components: {
DeliveryTable,
PaymentTable,
CreditManagement
}
}
</script>
<style lang="scss" scoped>
.tab-container {
padding: 20px;
background: #fff;
}
</style>>
import { collectionAndPaymentbank, customerBank } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '收付款银行信息',
url: collectionAndPaymentbank.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Name: {
label: '名称'
},
PayingBank: {
label: '付款银行'
},
ReceivingBank: {
label: '收款银行(国民)'
},
Currency: {
label: '货币'
},
Explain: {
label: '说明'
},
IsDefault: {
label: '是否默认'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
Name: {
type: 'input',
label: '名称',
layout: 24
},
PayingBank: {
type: 'lov',
code: 'customerBank',
searchUrl: customerBank.searchUrl,
returnFn: function(row) {
return {
PayingBankID: row.ObjectID,
PayingBank: row.DepositBank
}
},
label: '付款银行',
layout: 24
},
ReceivingBank: {
type: 'input',
label: '收款银行(国民)',
disabled: true,
layout: 24
},
Currency: {
type: 'select',
label: '货币',
isOptions: true,
options: dictionary.billingCurrency,
layout: 24
},
Explain: {
type: 'input',
label: '说明',
layout: 24
},
IsDefault: {
type: 'radio',
label: '重要客户',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
default: false
}
}
}
export default {
tableConfig,
formConfig,
...collectionAndPaymentbank
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
constant.formConfig.formDesc.PayingBank.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import { customerBank } from '@/api/customers'
const tableConfig = {
tableTitle: '客户银行信息',
url: customerBank.searchUrl,
showPagination: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
DepositBank: {
label: '开户行'
},
AccountName: {
label: '账户名称'
},
BankAccount: {
label: '银行账户'
},
Note: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
DepositBank: {
type: 'input',
label: '开户行'
},
AccountName: {
type: 'input',
label: '账户名称'
},
BankAccount: {
type: 'input',
label: '银行账户'
},
Note: {
type: 'textarea',
label: '备注'
}
}
}
export default {
tableConfig,
formConfig,
...customerBank
}
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import { paymentTermDetail } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '付款条件明细',
url: paymentTermDetail.searchUrl,
showPagination: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
PaymentStage: {
label: '付款阶段'
},
PaymentProportion: {
label: '付款比例'
},
PaymentMethod: {
label: '付款方式'
},
SupervisionFeedBack: {
label: '承兑天数'
},
PaymentTime: {
label: '付款时间'
},
Currency: {
label: '币别'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
PaymentStage: {
type: 'select',
label: '付款阶段',
isOptions: true,
options: dictionary.paymentStage
},
PaymentProportion: {
type: 'select',
label: '付款比例',
isOptions: true,
options: dictionary.paymentProportion
},
PaymentMethod: {
type: 'select',
label: '付款方式',
isOptions: true,
options: dictionary.paymentMethod
},
SupervisionFeedBack: {
type: 'input',
label: '承兑天数',
disabled: true
},
PaymentTime: {
type: 'select',
label: '付款时间',
isOptions: true,
options: dictionary.paymentTime
},
// Currency: {
// type: 'select',
// label: '币别',
// isOptions: true,
// options: dictionary.paymentTermsCurrency
// },
// PaymentType: {
// type: 'select',
// label: '款项类别',
// isOptions: true,
// options: dictionary.paymentType
// }
}
}
export default {
tableConfig,
formConfig,
...paymentTermDetail
}
<template>
<div style="margin: 20px -20px 0;">
<BusinessTable
ref="detailTable"
v-bind="constant"
/>
</div>
</template>
<script>
import constant from './constant'
export default {
props: {
id: {
type: String,
default: ''
}
},
data() {
return {
constant: {}
}
},
watch: {
id: {
handler(newVal) {
this.$refs.detailTable.search()
},
immediate: true
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
parentObjectID: this.id
}
this.constant = constant
}
}
</script>
<style>
</style>
import { paymentTerm } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '付款条件信息',
url: paymentTerm.searchUrl,
showPagination: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Name: {
label: '名称',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleCheck(scope.row)
},
props: {
type: 'text'
}
},
scope.row.Name)
}
},
PaymentTerms: {
label: '付款条件'
},
ValidState: {
label: '有效状态'
},
ValidStartTime: {
label: '有效开始时间'
},
ValidEndTime: {
label: '有效结束时间'
},
IsDefault: {
label: '是否默认'
},
Explain: {
label: '说明'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
width: '760px',
labelPosition: 'left',
submitBtnText: '保存',
span: 22,
formDesc: {
Name: {
type: 'select',
label: '付款阶段',
isOptions: true,
options: dictionary.paymentStage
},
PaymentTerms: {
type: 'select',
label: '付款条件',
isOptions: true,
options: dictionary.paymentProportion
},
Btn: {
},
Currency: {
type: 'select',
label: '货币',
isOptions: true,
options: dictionary.paymentTermsCurrency
},
ValidStartTime: {
type: 'date',
label: '有效开始时间'
},
ValidEndTime: {
type: 'date',
label: '有效结束时间'
},
IsDefault: {
type: 'radio',
label: '重要客户',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
default: false
},
Explain: {
type: 'input',
label: '说明',
layout: 24
}
}
}
export default {
tableConfig,
formConfig,
...paymentTerm
}
<template>
<div class="table-container">
<form-title :title="tableConfig.tableTitle">
<div>
<el-button
v-if="createUrl"
type="primary"
icon="el-icon-plus"
@click="handleAdd()"
>添加</el-button>
<el-button
v-if="deleteUrl"
type="danger"
icon="el-icon-delete"
@click="handleBatchDelete()"
>删除</el-button>
</div>
</form-title>
<ele-table
ref="eleTable"
:listeners="tableListeners"
v-bind="tableConfig"
:expand-params="expandParams"
@handleSelectionChange="handleSelectionChange"
/>
<PaymentTermDetail
v-if="detailId"
:id="detailId"
ref="detailTable"
/>
<ele-form-dialog
v-model="dialogFormData"
:title="dialogTitle"
:request-fn="handleSave"
:visible.sync="dialogFormVisible"
v-bind="formConfig"
:loading="loading"
>
<template v-slot:Btn>
<el-button
v-if="deleteUrl"
type="primary"
icon="el-icon-plus"
@click="handleAddDetail"
>添加付款条件</el-button>
<el-table
v-if="dialogFormData.paymentTermsPaymentTermsDetails.length > 0"
border
:data="dialogFormData.paymentTermsPaymentTermsDetails"
>
<el-table-column
:show-overflow-tooltip="true"
property="PaymentStage"
label="付款阶段"
/>
<el-table-column
:show-overflow-tooltip="true"
property="PaymentProportion"
label="付款比例"
/>
<el-table-column
:show-overflow-tooltip="true"
property="PaymentMethod"
label="付款方式"
/>
<el-table-column
:show-overflow-tooltip="true"
property="SupervisionFeedBack"
label="承兑天数"
/>
<el-table-column
:show-overflow-tooltip="true"
property="PaymentTime"
label="付款时间"
/>
<el-table-column
:show-overflow-tooltip="true"
property="Currency"
label="币别"
/>
</el-table>
</template>
</ele-form-dialog>
<ele-form-dialog
v-model="innerFormData"
title="添加付款条件"
:request-fn="handleInnerSave"
:visible.sync="innerVisible"
v-bind="innerFormConfig"
:loading="innerLoading"
/>
</div>
</template>
<script>
import PaymentTermDetail from '../payment-term-detail'
import constant from './constant'
import detailConstant from '../payment-term-detail/constant'
export default {
components: {
PaymentTermDetail
},
data() {
return {
desc: {},
tableListeners: {}, // 事件监听对象,供ele-table内部调用
dialogFormData: {
paymentTermsPaymentTermsDetails: []
},
$index: -1,
selection: [],
dialogFormVisible: false,
dialogTitle: '',
loading: false,
deleteUrl: constant.deleteUrl,
updateUrl: constant.updateUrl,
createUrl: constant.createUrl,
expandParams: constant.expandParams,
formConfig: constant.formConfig,
tableConfig: {},
innerVisible: false,
innerFormConfig: detailConstant.formConfig,
innerFormData: {},
innerLoading: false,
detailId: false
}
},
created() {
this.init()
},
methods: {
init() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.tableConfig = constant.tableConfig
const tableTitle = this.tableConfig.tableTitle
this.desc = {
add: '创建' + tableTitle,
edit: '编辑' + tableTitle
}
this.tableListeners = {
handleEdit: this.handleEdit,
handleCheck: this.handleCheck,
handleDelete: this.handleDelete
}
},
handleAdd() {
this.dialogTitle = this.desc.add
this.dialogFormData = {
paymentTermsPaymentTermsDetails: []
}
this.dialogFormVisible = true
},
handleEdit(row, index) {
this.dialogTitle = this.desc.edit
this.$index = index
this.dialogFormData = JSON.parse(JSON.stringify(row))
this.dialogFormVisible = true
},
handleSave() {
console.log(this.dialogFormData)
this.loading = true
const dialogFormData = this.$translateToC4CData(this.dialogFormData)
if (this.dialogTitle === this.desc.add) {
const accountID = this.$route.query.objectID || this.tableConfig.initialParams.objectID
dialogFormData.accountID = accountID
this.$request(this.createUrl, [dialogFormData]).then(res => {
this.dialogFormData.objectID = res.results[0]
console.log(this.dialogFormData)
this.$refs.eleTable.add(this.dialogFormData)
this.dialogFormVisible = false
this.loading = false
})
} else {
this.updateUrl && this.$request(this.updateUrl, dialogFormData).then(res => {
this.$refs.eleTable.edit(this.$index, this.dialogFormData)
this.dialogFormVisible = false
this.loading = false
})
}
},
handleInnerSave() {
this.dialogFormData.paymentTermsPaymentTermsDetails.push(this.innerFormData)
this.innerVisible = false
},
handleSelectionChange(selection) {
this.selection = selection
},
handleBatchDelete() {
var selection = this.selection
if (selection.length === 0) {
this.$message.warning('请先选择一行数据')
return
} else if (selection.length === 1) {
selection = this.$translateToC4CData(selection[0])
} else {
selection = selection.map(item => {
return this.$translateToC4CData(item)
})
}
this.$request(this.deleteUrl, selection).then(res => {
this.$refs.eleTable.handleSearch()
})
},
handleAddDetail() {
this.innerVisible = true
},
handleCheck(row) {
this.detailId = row.ObjectID
}
}
}
</script>
<style>
</style>
<template>
<div>
<CustomerBank />
<CollectionAndPayment />
<PaymentTerm />
</div>
</template>
<script>
import CustomerBank from './components/customer-bank'
import CollectionAndPayment from './components/collection-and-payment'
import PaymentTerm from './components/payment-term'
export default {
components: {
CustomerBank,
CollectionAndPayment,
PaymentTerm
}
}
</script>
<style>
</style>
<template>
<BusinessTable v-bind="constant" />
</template>
<script>
import constant from './constant'
export default {
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
}
}
</script>
<style>
</style>
import { contact } from '@/api/customers'
import dictionary from '@/api/dictionary'
const tableConfig = {
tableTitle: '联系人信息',
url: contact.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Ext_CustomerRole_KUT: {
label: '角色',
value: 'Ext_CustomerRole_KUTText'
},
LastName: {
label: '联系人名称'
},
JobTitle: {
label: '职位'
},
Ext_CustomerPhone_KUT: {
label: '手机1'
},
Ext_CustomerMobile_KUT: {
label: '手机2'
},
Ext_CustomerLandline_KUT: {
label: '座机'
},
Email: {
label: '电子邮箱'
},
Ext_CustomerMainContact_KUT: {
label: '是否主要联系人'
},
Ext_CustomerWeChat_KUT: {
label: '微信'
},
Ext_CustomerQQ_KUT: {
label: 'QQ'
},
Ext_CustomerAddress_KUT: {
label: '地址'
},
Ext_CustomerNote_KUT: {
label: '备注'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Ext_CustomerRole_KUT: {
type: 'select',
label: '角色',
isOptions: true,
options: dictionary.contactRole,
layout: 12
},
LastName: {
type: 'input',
label: '联系人名称',
layout: 12
},
JobTitle: {
label: '职位',
type: 'input',
layout: 12
},
Ext_CustomerPhone_KUT: {
label: '手机1',
type: 'input',
layout: 12
},
Ext_CustomerMobile_KUT: {
label: '手机2',
type: 'input',
layout: 12
},
Ext_CustomerLandline_KUT: {
label: '座机',
type: 'input',
layout: 12
},
Email: {
label: '电子邮箱',
type: 'input',
layout: 12
},
Ext_CustomerMainContact_KUT: {
label: '是否主要联系人',
type: 'radio',
isOptions: true,
options: [
{
text: '是',
value: true
},
{
text: '否',
value: false
}
],
layout: 12,
default: false
},
Ext_CustomerWeChat_KUT: {
label: '微信',
type: 'input',
layout: 12
},
Ext_CustomerQQ_KUT: {
label: 'QQ',
type: 'input',
layout: 12
},
Ext_CustomerAddress_KUT: {
label: '地址',
type: 'input',
layout: 12
},
Ext_CustomerNote_KUT: {
label: '备注',
type: 'textarea',
layout: 24,
attrs: {
autosize: false,
rows: 3
}
}
}
}
export default {
tableConfig,
formConfig,
...contact
}
<template>
<div>
<base-info :form-data="$attrs.formData" />
</div>
</template>
<script>
import BaseInfo from '../base-info/table'
export default {
components: {
BaseInfo
}
}
</script>
<style>
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment