企业管理模块接口对接
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:scroll="{x: 1100}"
|
||||
:scroll="{x: 1300}"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
@@ -125,12 +125,12 @@ export default {
|
||||
}, {
|
||||
title: '公司地址',
|
||||
align: 'center',
|
||||
width: 350,
|
||||
dataIndex: 'companyAddress',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
}, {
|
||||
title: '公司电话',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'companyPhone'
|
||||
}, {
|
||||
title: '创建时间',
|
||||
|
||||
@@ -33,10 +33,12 @@
|
||||
<!-- 操作按钮区域-->
|
||||
<div class="table-operator">
|
||||
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
<a-button type="primary" icon="export">导出</a-button>
|
||||
<a-button type="primary" icon="download">下载模板</a-button>
|
||||
<a-button type="danger" icon="delete">批量删除</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="export" @click="handleExportXls('联系人管理')">导出</a-button>
|
||||
<a-button type="primary" icon="download" @click="downTemplate('联系人管理导入模板')">下载模板</a-button>
|
||||
<a-button type="danger" icon="delete" @click="batchDel">批量删除</a-button>
|
||||
</div>
|
||||
<!-- 操作按钮区域-end-->
|
||||
|
||||
@@ -65,8 +67,15 @@
|
||||
</template>
|
||||
<template slot="fileSlot" slot-scope="text,record">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<j-ellipsis @click.native="uploadFile(record.chargeNoticeFileId)" style="color:#219AFF;cursor: pointer"
|
||||
:value="text" :length="20"/>
|
||||
<j-ellipsis
|
||||
@click.native="uploadFile(record.chargeNoticeFileId)"
|
||||
style="color:#219AFF;cursor: pointer"
|
||||
:value="text"
|
||||
:length="20"/>
|
||||
</template>
|
||||
|
||||
<template slot="sex" slot-scope="text, record">
|
||||
<div>{{ text === 1 ? '男' : text === 2 ? '女' : '' }}</div>
|
||||
</template>
|
||||
|
||||
<template slot="text" slot-scope="text,record">
|
||||
@@ -79,7 +88,7 @@
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<contact-management-module ref="modalForm"></contact-management-module>
|
||||
<contact-management-module ref="modalForm" @ok="modalFormOk"></contact-management-module>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@@ -91,6 +100,11 @@ export default {
|
||||
name: 'ContactManagement',
|
||||
components: { ContactManagementModule },
|
||||
mixins: [JeroListMixin],
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelCol: {
|
||||
@@ -102,12 +116,12 @@ export default {
|
||||
sm: { span: 10 }
|
||||
},
|
||||
url: {
|
||||
list: '',
|
||||
delete: '',
|
||||
deleteBatch: '',
|
||||
exportXlsUrl: '',
|
||||
importExcelUrl: '',
|
||||
exportTemplateUrl: ''
|
||||
list: '/company/payContactsManagement/list',
|
||||
delete: '/company/payContactsManagement/delete',
|
||||
deleteBatch: '/company/payContactsManagement/deleteBatch',
|
||||
exportXlsUrl: '/company/payContactsManagement/exportXls',
|
||||
importExcelUrl: '/company/payContactsManagement/importExcel',
|
||||
downTemplateUrl: ''
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
@@ -129,7 +143,8 @@ export default {
|
||||
title: '性别',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'gender'
|
||||
dataIndex: 'gender',
|
||||
scopedSlots: { customRender: 'sex' }
|
||||
}, {
|
||||
title: '职务',
|
||||
align: 'center',
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
import { postcode, phoneReg, isPhone } from '@/utils/validate'
|
||||
import pick from 'lodash.pick'
|
||||
import { httpAction } from '@api/manage'
|
||||
import { duplicateCheck } from '@api/api'
|
||||
|
||||
export default {
|
||||
name: 'BusinessMangementModule',
|
||||
@@ -133,7 +134,7 @@ export default {
|
||||
},
|
||||
validatorRules: {
|
||||
companyName: {
|
||||
rules: [{ required: true, message: '请输入企业名称' }],
|
||||
rules: [{ required: true, validator: this.checkCompanyName }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
companyPhone: {
|
||||
@@ -229,6 +230,29 @@ export default {
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
/**
|
||||
* 企业名称唯一性校验
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkCompanyName(rules, value, callback) {
|
||||
if (value) {
|
||||
const params = {
|
||||
confusionCode: 'pay_company_management_company_name',
|
||||
fieldVal: value
|
||||
}
|
||||
duplicateCheck(params).then(res => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback(res.message)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
callback('请输入企业名称')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<company-select placeholder="请选择企业"
|
||||
v-decorator="['companyName',validatorRules.companyName]"
|
||||
v-decorator="['company',validatorRules.company]"
|
||||
:maxLength='50'
|
||||
:is-company-disabled="isCompanyDisabled"
|
||||
:disabled="isCompanyDisabled"></company-select>
|
||||
@@ -31,10 +31,8 @@
|
||||
<a-row>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select placeholder="请选择性别"
|
||||
v-decorator="['gender']"
|
||||
:maxLength='50'
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-select>
|
||||
<j-dict-select-tag v-decorator="['gender', {}]" :triggerChange="true" placeholder="请选择性别"
|
||||
dictCode="pay_gender"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
@@ -104,6 +102,7 @@ import pick from 'lodash.pick'
|
||||
import { httpAction } from '@api/manage'
|
||||
import CompanySelect from '@comp/company/CompanySelect'
|
||||
import { postcode, phoneReg, isEmail } from '@/utils/validate'
|
||||
import { duplicateCheck } from '@api/api'
|
||||
|
||||
export default {
|
||||
name: 'ContactManagementModule',
|
||||
@@ -149,11 +148,11 @@ export default {
|
||||
sm: { span: 21 }
|
||||
},
|
||||
url: {
|
||||
add: '',
|
||||
edit: ''
|
||||
add: '/company/payContactsManagement/add',
|
||||
edit: '/company/payContactsManagement/edit'
|
||||
},
|
||||
validatorRules: {
|
||||
companyName: {
|
||||
company: {
|
||||
rules: [{ required: true, message: '请选择企业' }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
@@ -189,16 +188,22 @@ export default {
|
||||
}
|
||||
this.model = Object.assign({}, company)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'companyName'))
|
||||
this.form.setFieldsValue(pick(this.model, 'company'))
|
||||
})
|
||||
}
|
||||
},
|
||||
edit(record) {
|
||||
console.log(record, '-------edit')
|
||||
let company = {
|
||||
id: record.companyId,
|
||||
companyName: record.companyName
|
||||
}
|
||||
record.company = company
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'companyName', 'name', 'gender', 'post', 'phone', 'email', 'contactAddress', 'postalCode', 'remarks'))
|
||||
this.form.setFieldsValue(pick(this.model, 'company', 'name', 'gender', 'post', 'phone', 'email', 'contactAddress', 'postalCode', 'remarks'))
|
||||
})
|
||||
},
|
||||
close() {
|
||||
@@ -210,6 +215,10 @@ export default {
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
// 处理企业名称和id等信息
|
||||
values.companyName = values.company.companyName
|
||||
values.companyId = values.company.id
|
||||
values.gender = Number(values.gender)
|
||||
let httpurl = ''
|
||||
let method = ''
|
||||
if (!this.model.id) {
|
||||
@@ -246,10 +255,25 @@ export default {
|
||||
*/
|
||||
checkPhone(rules, value, callback) {
|
||||
if (phoneReg(value)) {
|
||||
if (!this.model.id) {
|
||||
const param = {
|
||||
confusionCode: 'pay_contacts_management_phone',
|
||||
fieldVal: value
|
||||
}
|
||||
// 唯一性校验
|
||||
duplicateCheck(param).then(res => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback(res.message)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
callback()
|
||||
} else {
|
||||
callback('请填写正确手机号')
|
||||
return
|
||||
}
|
||||
callback('请填写正确手机号')
|
||||
},
|
||||
/**
|
||||
* 邮箱校验
|
||||
|
||||
Reference in New Issue
Block a user