【开发】企业管理员
This commit is contained in:
+8
-1
@@ -116,6 +116,11 @@ const getContactsByCompany = (params) => getAction('/company/payContactsManageme
|
|||||||
const getContactsByCompanyNoLimit = (params) => getAction('/company/payContactsManagement/queryByCompanyMeeting', params)
|
const getContactsByCompanyNoLimit = (params) => getAction('/company/payContactsManagement/queryByCompanyMeeting', params)
|
||||||
// 通过联系人id获取联系人信息
|
// 通过联系人id获取联系人信息
|
||||||
const getContactsById = (param) => getAction('/company/payContactsManagement/queryByIdMeeting', param)
|
const getContactsById = (param) => getAction('/company/payContactsManagement/queryByIdMeeting', param)
|
||||||
|
// 企业管理员重置密码
|
||||||
|
const companyAdminResetPassword = (param) => postAction('/company/payContactsManagement/queryByIdMeeting', param)
|
||||||
|
|
||||||
|
// 企业管理员启用禁用
|
||||||
|
const companyAdminEnable= (param) => postAction('/company/payContactsManagement/queryByIdMeeting', param)
|
||||||
|
|
||||||
// 加密获取key 与 iv
|
// 加密获取key 与 iv
|
||||||
const getKeyIv = (param) => getAction('/sys/getEncryptedString',param)
|
const getKeyIv = (param) => getAction('/sys/getEncryptedString',param)
|
||||||
@@ -183,7 +188,9 @@ export {
|
|||||||
getFileInfo,
|
getFileInfo,
|
||||||
getKeyIv,
|
getKeyIv,
|
||||||
getContactsByCompanyNoLimit,
|
getContactsByCompanyNoLimit,
|
||||||
loginIdmPlatform
|
loginIdmPlatform,
|
||||||
|
companyAdminResetPassword,
|
||||||
|
companyAdminEnable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<page-header-title :img-for-icon="IconImg"></page-header-title>
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 查询区域-start -->
|
||||||
|
<div class="table-page-search-wrapper">
|
||||||
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
|
<a-row>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入用户账号" v-model="queryParam.name" :maxLength='50'></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入用户姓名" v-model="queryParam.companyName" :maxLength='50'></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<a-form-item label="企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入企业名称" v-model="queryParam.phone" :maxLength='11'></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<span class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" icon="search" @click="searchQuery" v-has="'companyadmin:page'">查询</a-button>
|
||||||
|
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!-- 查询区域-end-->
|
||||||
|
|
||||||
|
<!-- 操作按钮区域-->
|
||||||
|
<div class="table-operator">
|
||||||
|
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'companyadmin:add'">新增</a-button>
|
||||||
|
<a-button type="primary" icon="export" @click="handleExportXls('企业管理员')" v-has="'companyadmin:export'">导出
|
||||||
|
</a-button>
|
||||||
|
<a-button type="danger" icon="delete" @click="batchDel" v-has="'companyadmin:deleteBatch'">批量删除</a-button>
|
||||||
|
</div>
|
||||||
|
<!-- 操作按钮区域-end-->
|
||||||
|
|
||||||
|
<!-- table表格区域-->
|
||||||
|
<div>
|
||||||
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
bordered
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:scroll="{x: 1500}"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:loading="loading"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
|
@change="handleTableChange"
|
||||||
|
class="j-table-force-nowrap">
|
||||||
|
|
||||||
|
<template slot="text" slot-scope="text">
|
||||||
|
<j-ellipsis :value="text" :length="18"></j-ellipsis>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||||
|
<a @click="handleUse(record)" v-has="'companyadmin:use'">启用</a>
|
||||||
|
<a @click="handleEdit(record)" v-has="'companyadmin:edit'">编辑</a>
|
||||||
|
<a @click="resetPassword(record)" v-has="'companyadmin:resetPassword'">重置密码</a>
|
||||||
|
<a @click="handleDelete(record.id)" v-has="'companyadmin:delete'">删除</a>
|
||||||
|
</span>
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
|
<company-admin-module ref="modalForm" @ok="modalFormOk"></company-admin-module>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {JeroListMixin} from '@/mixins/JeroListMixin'
|
||||||
|
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
|
||||||
|
import CompanyAdminModule from '@views/businessManagement/modules/CompanyAdminModule'
|
||||||
|
import IconImg from '@/assets/imgs/icon/icon_company_management.png'
|
||||||
|
import {companyAdminEnable, companyAdminResetPassword} from '@api/api'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CompanyAdmin',
|
||||||
|
components: {CompanyAdminModule, PageHeaderTitle},
|
||||||
|
mixins: [JeroListMixin],
|
||||||
|
computed: {
|
||||||
|
importExcelUrl: function () {
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
IconImg,
|
||||||
|
labelCol: {
|
||||||
|
xs: {span: 24},
|
||||||
|
sm: {span: 5}
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: {span: 24},
|
||||||
|
sm: {span: 10}
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
list: '/com.jero.payment/payManagerManagement/page',
|
||||||
|
delete: '/com.jero.payment/payManagerManagement/delete',
|
||||||
|
deleteBatch: '/com.jero.payment/payManagerManagement/deleteBatch',
|
||||||
|
exportXlsUrl: '/com.jero.payment/payManagerManagement/exportXls',
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: '',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 60,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function (t, r, index) {
|
||||||
|
return parseInt(index) + 1
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
title: '用户账号',
|
||||||
|
align: 'center',
|
||||||
|
width: 280,
|
||||||
|
dataIndex: 'username',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
}, {
|
||||||
|
title: '用户姓名',
|
||||||
|
align: 'center',
|
||||||
|
width: 120,
|
||||||
|
dataIndex: 'name'
|
||||||
|
}, {
|
||||||
|
title: '企业名称',
|
||||||
|
align: 'center',
|
||||||
|
width: 280,
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'status'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
align: 'center',
|
||||||
|
fixed: 'right',
|
||||||
|
width: 160,
|
||||||
|
scopedSlots: {customRender: 'action'}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 重置密码
|
||||||
|
* */
|
||||||
|
resetPassword(record) {
|
||||||
|
const param = {
|
||||||
|
id: record.id
|
||||||
|
}
|
||||||
|
companyAdminResetPassword(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.loadData()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 启用禁用
|
||||||
|
* */
|
||||||
|
handleUse(record) {
|
||||||
|
const param = {
|
||||||
|
id: record.id
|
||||||
|
}
|
||||||
|
companyAdminEnable(param).then(res => {
|
||||||
|
if(res.success){
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.loadData()
|
||||||
|
}else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :xl="24" :sm="24">
|
||||||
|
<a-form-item label="公司名称" :labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol">
|
||||||
|
<company-select placeholder="请选择公司" @change="changeCompany"
|
||||||
|
v-decorator="['companyId',validatorRules.companyId]"></company-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :xl="24" :sm="24">
|
||||||
|
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<select-contacts :selected-company="selectedCompany"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-decorator="['companyContactId',validatorRules.companyContactId]"
|
||||||
|
:maxLength='50'
|
||||||
|
:init-contacts="selectPerson"
|
||||||
|
@change="changeContact"
|
||||||
|
ref="selectPerson"
|
||||||
|
@ok="addContactsOk"></select-contacts>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :xl="24" :sm="24">
|
||||||
|
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入用户账号"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()" :maxLength="50"
|
||||||
|
v-decorator="['username']"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :xl="24" :sm="24">
|
||||||
|
<a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入手机号"
|
||||||
|
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9]/g,'')}"
|
||||||
|
:maxLength="11"
|
||||||
|
v-decorator="['phone']"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { httpAction } from '@api/manage'
|
||||||
|
import CompanySelect from '@comp/company/CompanySelect'
|
||||||
|
import SelectContacts from '@comp/company/SelectContacts'
|
||||||
|
import {getRSAPublicKey} from '@api/login'
|
||||||
|
import {JSEncrypt} from 'jsencrypt'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CompanyAdminModule',
|
||||||
|
components:{
|
||||||
|
CompanySelect,
|
||||||
|
SelectContacts
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '操作',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
c:'',// 加密公钥
|
||||||
|
model: {},
|
||||||
|
selectedCompany:null,// 选择的公司
|
||||||
|
selectPerson:null, // 回显的公司人员
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 18 }
|
||||||
|
},
|
||||||
|
remarksLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 3 }
|
||||||
|
},
|
||||||
|
remarksWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 21 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
companyName: {
|
||||||
|
rules: [{ required: true, validator: this.checkCompanyName }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
companyAddress: {
|
||||||
|
rules: [{ required: true, message: '请输入公司地址' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
add: '/com.jero.payment/payManagerManagement/add',
|
||||||
|
edit: '/com.jero.payment/payManagerManagement/edit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add() {
|
||||||
|
this.edit({})
|
||||||
|
},
|
||||||
|
edit(record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.getRSAPublicKeyFunc()
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择公司
|
||||||
|
* */
|
||||||
|
changeCompany(value){
|
||||||
|
this.selectedCompany = value
|
||||||
|
console.log(value,'选择公司')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择公司人员
|
||||||
|
* */
|
||||||
|
changeContact(val){
|
||||||
|
console.log(val,'选择人员')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择人员后的回调
|
||||||
|
* */
|
||||||
|
addContactsOk(){
|
||||||
|
this.$refs.selectPerson.getContactsList()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取公钥
|
||||||
|
* */
|
||||||
|
getRSAPublicKeyFunc() {
|
||||||
|
getRSAPublicKey().then(res => {
|
||||||
|
this.rsaPublicKey = res.result
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk: function () {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
let httpurl = ''
|
||||||
|
let method = 'post'
|
||||||
|
if (!this.model.id) {
|
||||||
|
httpurl += this.url.add
|
||||||
|
} else {
|
||||||
|
httpurl += this.url.edit
|
||||||
|
}
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
formData.companyName = this.selectedCompany.companyName
|
||||||
|
formData.companyId = this.selectedCompany.companyId
|
||||||
|
let encrypt = new JSEncrypt()
|
||||||
|
encrypt.setPublicKey(this.rsaPublicKey)
|
||||||
|
formData.phone = encrypt.encrypt(values.phone)
|
||||||
|
formData.rsaPublicKey = this.rsaPublicKey
|
||||||
|
httpAction(httpurl, formData, method).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message)
|
||||||
|
that.$emit('ok', res.result)
|
||||||
|
that.close()
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user