企业管理、联系人管理bug修改

This commit is contained in:
zhaoxiao
2021-08-30 17:05:38 +08:00
parent ffd41c4761
commit f24acddbf5
6 changed files with 55 additions and 28 deletions
+4 -1
View File
@@ -106,6 +106,8 @@ export const transitRESTful = {
// 通过企业名称获取该企业下的联系人 // 通过企业名称获取该企业下的联系人
const getContactsByCompany = (params) => getAction('/company/payContactsManagement/queryByCompany', params) const getContactsByCompany = (params) => getAction('/company/payContactsManagement/queryByCompany', params)
// 通过联系人id获取联系人信息
const getContactsById = (param) => getAction('/company/payContactsManagement/queryById', param)
export { export {
addRole, addRole,
@@ -165,7 +167,8 @@ export {
getDictItemsFromCache, getDictItemsFromCache,
resetUserPassword, resetUserPassword,
getContactsByCompany, getContactsByCompany,
queryallRoles queryallRoles,
getContactsById
} }
+1 -1
View File
@@ -39,7 +39,7 @@ export default {
return return
} }
this.$refs.businessSelect.visible = true this.$refs.businessSelect.visible = true
this.$refs.businessSelect.selectedRowKeys.push(this.value.id) this.$refs.businessSelect.selectedRowKeys[0] = this.value.id
}, },
/** /**
* 选中后抛出企业信息(id, companyName) * 选中后抛出企业信息(id, companyName)
@@ -40,7 +40,7 @@
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:scroll="{x: 1300}" :scroll="{x: 1500}"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
@@ -49,7 +49,7 @@
class="j-table-force-nowrap"> class="j-table-force-nowrap">
<template slot="text" slot-scope="text,record"> <template slot="text" slot-scope="text,record">
<j-ellipsis :value="text" :length="20"></j-ellipsis> <j-ellipsis :value="text" :length="18"></j-ellipsis>
</template> </template>
<span slot="action" class="action-span-cell" slot-scope="text, record"> <span slot="action" class="action-span-cell" slot-scope="text, record">
@@ -115,12 +115,11 @@ export default {
}, { }, {
title: '创建时间', title: '创建时间',
align: 'center', align: 'center',
width: 180,
dataIndex: 'createTime' dataIndex: 'createTime'
}, { }, {
title: '银行户名', title: '银行户名',
align: 'center', align: 'center',
width: 140, width: 300,
dataIndex: 'bankAccountName', dataIndex: 'bankAccountName',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, { }, {
@@ -50,7 +50,7 @@
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:scroll="{x: 1000}" :scroll="{x: 1500}"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
@@ -63,7 +63,7 @@
</template> </template>
<template slot="text" slot-scope="text,record"> <template slot="text" slot-scope="text,record">
<j-ellipsis :value="text" :length="20"></j-ellipsis> <j-ellipsis :value="text" :length="18"></j-ellipsis>
</template> </template>
<span slot="action" class="action-span-cell" slot-scope="text, record"> <span slot="action" class="action-span-cell" slot-scope="text, record">
@@ -138,6 +138,7 @@ export default {
}, { }, {
title: '手机号', title: '手机号',
align: 'center', align: 'center',
width: 140,
dataIndex: 'phone' dataIndex: 'phone'
}, { }, {
title: '创建时间', title: '创建时间',
@@ -146,7 +147,6 @@ export default {
}, { }, {
title: '企业名称', title: '企业名称',
align: 'center', align: 'center',
width: 140,
dataIndex: 'companyName', dataIndex: 'companyName',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, { }, {
@@ -51,7 +51,7 @@
<a-col :xl="12" :sm="24"> <a-col :xl="12" :sm="24">
<a-form-item label="银行户名" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="银行户名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入银行户名" <a-input placeholder="请输入银行户名"
v-decorator="['bankAccountName']" v-decorator="['bankAccountName', validatorRules.bankAccountName]"
:maxLength='50' :maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input> @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item> </a-form-item>
@@ -59,7 +59,7 @@
<a-col :xl="12" :sm="24"> <a-col :xl="12" :sm="24">
<a-form-item label="开户行" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="开户行" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入开户行" <a-input placeholder="请输入开户行"
v-decorator="['openingBank']" v-decorator="['openingBank', validatorRules.openingBank]"
:maxLength='50' :maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input> @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item> </a-form-item>
@@ -90,7 +90,7 @@
placeholder="请输入备注" placeholder="请输入备注"
v-decorator="['remarks']" v-decorator="['remarks']"
:auto-size="{ minRows: 3, maxRows: 6 }" :auto-size="{ minRows: 3, maxRows: 6 }"
:maxLength='300' :maxLength='200'
@change="e => {e.target.value = (e.target.value + '').trim()}"/> @change="e => {e.target.value = (e.target.value + '').trim()}"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -152,16 +152,28 @@ export default {
validateTrigger: 'blur' validateTrigger: 'blur'
}, },
companyPhone: { companyPhone: {
rules: [{ required: false, validator: this.checkCompanyPhone }] rules: [{ required: true, validator: this.checkCompanyPhone }],
validateTrigger: 'blur'
}, },
postalCode: { postalCode: {
rules: [{ required: false, validator: this.checkPostcode }] rules: [{ required: true, validator: this.checkPostcode }],
validateTrigger: 'blur'
},
bankAccountName: {
rules: [{ required: true, message: '请输入银行户名'}],
validateTrigger: 'blur'
},
openingBank: {
rules: [{ required: true, message: '请输入开户行'}],
validateTrigger: 'blur'
}, },
bankAccount: { bankAccount: {
rules: [{ validator: this.checkBankAccount }] rules: [{ required: true, validator: this.checkBankAccount }],
validateTrigger: 'blur'
}, },
dutyCode: { dutyCode: {
rules: [{ validator: this.checkDutyCode }] rules: [{ required: true, validator: this.checkDutyCode }],
validateTrigger: 'blur'
} }
}, },
url: { url: {
@@ -234,7 +246,7 @@ export default {
} }
return return
} }
callback() callback('请填写电话号码')
}, },
/** /**
* 邮编校验 * 邮编校验
@@ -247,11 +259,11 @@ export default {
if (postcode(value)) { if (postcode(value)) {
callback() callback()
} else { } else {
callback('请输入正确格式的邮') callback('请输入正确格式的邮政编码')
} }
return return
} }
callback() callback('请输入邮政编码')
}, },
/** /**
* 限制银行账号只能输入数字 * 限制银行账号只能输入数字
@@ -268,7 +280,7 @@ export default {
} }
return return
} }
callback() callback('请输入银行账号')
}, },
/** /**
* 校验税号 * 校验税号
@@ -285,7 +297,7 @@ export default {
} }
return return
} }
callback() callback('请输入税号')
}, },
/** /**
* 企业名称唯一性校验 * 企业名称唯一性校验
@@ -304,7 +316,7 @@ export default {
if (res.success) { if (res.success) {
callback() callback()
} else { } else {
callback(res.message) callback('企业名称已存在')
} }
}) })
return return
@@ -88,7 +88,7 @@
placeholder="请输入备注" placeholder="请输入备注"
:auto-size="{ minRows: 3, maxRows: 6 }" :auto-size="{ minRows: 3, maxRows: 6 }"
v-decorator="['remarks']" v-decorator="['remarks']"
:maxLength='300' :maxLength='200'
@change="e => {e.target.value = (e.target.value + '').trim()}"/> @change="e => {e.target.value = (e.target.value + '').trim()}"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -165,8 +165,8 @@ export default {
}, },
validatorRules: { validatorRules: {
company: { company: {
rules: [{ required: true, message: '请选择企业' }], rules: [{ required: true, validator: this.checkCompany }],
validateTrigger: 'blur' validateTrigger: 'change'
}, },
name: { name: {
rules: [{ required: true, message: '请输入姓名' }], rules: [{ required: true, message: '请输入姓名' }],
@@ -205,7 +205,6 @@ export default {
} }
}, },
edit(record) { edit(record) {
console.log(record, '-------edit')
let company = { let company = {
id: record.companyId, id: record.companyId,
companyName: record.companyName companyName: record.companyName
@@ -259,6 +258,20 @@ export default {
handleCancel() { handleCancel() {
this.close() this.close()
}, },
/**
* 企业必填校验
* @param rules
* @param value
* @param callback
*/
checkCompany(rules, value, callback) {
console.log('---check---', value)
if (value.id && value.companyName) {
callback()
return
}
callback('请选择企业')
},
/** /**
* 手机号校验 * 手机号校验
* @param rules * @param rules
@@ -285,7 +298,7 @@ export default {
callback() callback()
return return
} }
callback('请填写正确手机号') callback('请输入正确手机号')
}, },
/** /**
* 邮箱校验 * 邮箱校验
@@ -297,7 +310,7 @@ export default {
if (isEmail(value)) { if (isEmail(value)) {
callback() callback()
} else { } else {
callback('请填写正确邮箱') callback('请输入正确邮箱')
} }
}, },
/** /**