cyl/dev
wangxia 2 years ago
parent 1db0ad7baf
commit 56cd6692a2

@ -209,6 +209,15 @@ export function addMemberApi (data) {
data: setqs(data), data: setqs(data),
}); });
} }
// 成员管理:更新成员
export function updateMemberApi (data) {
return request({
url: "/yishoudan/user/updateAgencyCorpUser",
method: "post",
data: setqs(data),
});
}
// 数据统计列表获取 // 数据统计列表获取
export function dataStatisticsListApiold (data) { export function dataStatisticsListApiold (data) {
return request({ return request({

@ -49,7 +49,8 @@
</span> </span>
<div slot="setting" v-if="!record.children" class="setting" slot-scope="text, record" style="color: #f40"> <div slot="setting" v-if="!record.children" class="setting" slot-scope="text, record" style="color: #f40">
<a @click="showDetail('detail', record)">详情</a> <a @click="showDetail('detail', record)">详情</a>
<a v-if="loginUserInfo.agencyRole != 3" class="delete" @click="deleteMemeber(record)"></a> <a v-if="loginUserInfo.agencyRole != 3" class="delete" @click="showDetail('edit', record)"></a>
<a v-if="loginUserInfo.agencyRole != 3" @click="deleteMemeber(record)"></a>
</div> </div>
</a-table> </a-table>
<div class="pagecontainer mt16"> <div class="pagecontainer mt16">
@ -61,7 +62,7 @@
</div> </div>
</div> </div>
<a-modal :title="modalTitle" v-model="visible" centered id="demo" @cancel="modalCancel" width="640px" destroyOnClose class="detailWindow"> <a-modal :title="modalTitle" v-model="visible" centered id="demo" @cancel="modalCancel" width="640px" destroyOnClose class="detailWindow">
<template slot="footer" v-if="modalTitle == '新建成员'"> <template slot="footer" v-if="this.modalTitle != '成员详情'">
<button style="background-color: #fff; border-color: #d9d9d9" @click="modalCancel"></button> <button style="background-color: #fff; border-color: #d9d9d9" @click="modalCancel"></button>
<button style="background-color: #f40;color: #fff;border: none;margin-left: 16px;margin-right: 16px;" @click="handleSubmit"></button> <button style="background-color: #f40;color: #fff;border: none;margin-left: 16px;margin-right: 16px;" @click="handleSubmit"></button>
</template> </template>
@ -79,12 +80,8 @@
</a-row> </a-row>
<a-row style="margin-bottom:24px"> <a-row style="margin-bottom:24px">
<a-col :span="4">分组</a-col> <a-col :span="4">分组</a-col>
<a-col :span="18">{{ '分组1' }}</a-col> <a-col :span="18">{{ currentMember.agencyTeamName }}</a-col>
</a-row> </a-row>
<!-- <a-row>
<a-col :span="4">登录密码</a-col>
<a-col :span="20">{{ currentMember.userName }}</a-col>
</a-row>-->
<a-row style="margin-bottom:24px"> <a-row style="margin-bottom:24px">
<a-col :span="4">角色</a-col> <a-col :span="4">角色</a-col>
<a-col :span="18">{{ currentMember.role }}</a-col> <a-col :span="18">{{ currentMember.role }}</a-col>
@ -148,7 +145,7 @@
</template> </template>
<script> <script>
import { getMemberListApi, deleteMemberApi, addMemberApi, getMemberGroupApi, addMemberGroupApi, updateMemberGroupApi, delMemberGroupApi } from '../../api/userinfo' import { getMemberListApi, deleteMemberApi, addMemberApi, getMemberGroupApi, addMemberGroupApi, updateMemberGroupApi, delMemberGroupApi, updateMemberApi } from '../../api/userinfo'
import { formatDateYMD, getUserApplyOrderStatusById, getAgencyRoleTypeById, getAgencyPermissionNameById, getAgencyPermissionsByRole } from '../../utils/commonUtil' import { formatDateYMD, getUserApplyOrderStatusById, getAgencyRoleTypeById, getAgencyPermissionNameById, getAgencyPermissionsByRole } from '../../utils/commonUtil'
const rowSelection = { const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
@ -212,38 +209,7 @@ export default {
permissionName: '查看职位,报名,查看报名,查看老乡,修改密码,修改手机号', permissionName: '查看职位,报名,查看报名,查看老乡,修改密码,修改手机号',
permission: 'job:list,apply:add,apply:list,apply:user,user:pwd,user:tel', permission: 'job:list,apply:add,apply:list,apply:user,user:pwd,user:tel',
expandedRowKeys: [], expandedRowKeys: [],
groupList: [ groupList: [],
{
text: '全部',
value: '全部',
checked: true,
},
{
text: '分组1',
value: '分组1',
checked: false,
},
{
text: '分组2',
value: '分组2',
checked: false,
},
{
text: '分组3',
value: '分组3',
checked: false,
},
{
text: '分组4',
value: '分组4',
checked: false,
},
{
text: '分组5',
value: '分组5',
checked: false,
},
],
rowSelection, rowSelection,
showGroup: false, showGroup: false,
addGroupShow: false, addGroupShow: false,
@ -324,7 +290,7 @@ export default {
// sortOrder: sortedInfo.columnKey == "userApplyOrder" && sortedInfo.order, // sortOrder: sortedInfo.columnKey == "userApplyOrder" && sortedInfo.order,
// ellipsis: true, // ellipsis: true,
width: 100, width: 140,
}, },
] ]
return columns return columns
@ -388,7 +354,7 @@ export default {
if (data.status === 200) { if (data.status === 200) {
this.memberList = data.data.recordList this.memberList = data.data.recordList
this.memberList.forEach((item, index) => { this.memberList.forEach((item, index) => {
item.group = '分组' + ((index % 5) + 1) // item.group = '' + ((index % 5) + 1)
// item1.children.forEach((item) => { // item1.children.forEach((item) => {
console.log(item) console.log(item)
item.role = getAgencyRoleTypeById(item.agencyRole) item.role = getAgencyRoleTypeById(item.agencyRole)
@ -514,7 +480,21 @@ export default {
console.log(type) console.log(type)
console.log(e) console.log(e)
let that = this let that = this
if (type == 'detail') { if (type == 'edit') {
this.currentMember = e
this.modalTitle = '编辑'
this.visible = true
setTimeout(() => {
console.log(this.currentMember)
that.form.setFieldsValue({
agencyRole: this.currentMember.agencyRole + '',
aliasName: this.currentMember.aliasName,
tel: this.currentMember.tel,
permission: this.currentMember.permission,
group: this.currentMember.group,
})
}, 200)
} else if (type == 'detail') {
this.currentMember = e this.currentMember = e
this.modalTitle = '成员详情' this.modalTitle = '成员详情'
this.visible = true this.visible = true
@ -557,10 +537,33 @@ export default {
}, },
handleSubmit() { handleSubmit() {
console.log('issubmit') console.log('issubmit')
console.log(this.currentMember)
this.form.validateFields(async (err) => { this.form.validateFields(async (err) => {
console.log(err) console.log(err)
if (err == null) { if (err == null) {
console.log(this.form.getFieldsValue()) if (this.modalTitle == '编辑') {
try {
let { data } = await updateMemberApi({
...this.form.getFieldsValue(),
agencyPermissions: this.permission,
agencyTeamId: this.agencyTeamId,
id: this.currentMember.id,
})
console.log(data)
if (data.status == 200) {
this.$message.success('修改成功')
this.visible = false
this.permission = getAgencyPermissionsByRole(1)
this.permissionName = getAgencyPermissionNameById(this.permission)
this.getMemberList()
} else {
this.$message.warning(data.msg)
this.visible = false
}
} catch (error) {
console.log(error)
}
} else {
try { try {
let { data } = await addMemberApi({ let { data } = await addMemberApi({
...this.form.getFieldsValue(), ...this.form.getFieldsValue(),
@ -582,6 +585,7 @@ export default {
console.log(error) console.log(error)
} }
} }
}
}) })
}, },
changeGroup(e) { changeGroup(e) {
@ -619,7 +623,7 @@ export default {
console.log(rule) console.log(rule)
console.log(value) console.log(value)
console.log(callback) console.log(callback)
let reg = /^1[3|4|5|7|8][0-9]{9}$/ let reg = /^1[3|4|5|7|8|9][0-9]{9}$/
// if(value.length == 11){ // if(value.length == 11){
if (!reg.test(value)) { if (!reg.test(value)) {
callback(new Error()) callback(new Error())
@ -915,14 +919,15 @@ export default {
height: 16px !important; height: 16px !important;
} }
.setting { .setting {
a:first-child { a:nth-child(2) {
padding-right: 9px; padding: 0 9px;
} margin: 0 9px;
a:last-child {
padding-left: 9px;
} }
// a:last-child {
// }
.delete { .delete {
border-left: 1px solid #979797; border-left: 1px solid #979797;
border-right: 1px solid #979797;
} }
} }
// /deep/ .ant-table-row-cell-break-word { // /deep/ .ant-table-row-cell-break-word {
@ -955,12 +960,14 @@ export default {
.detailWindow { .detailWindow {
/deep/ .ant-modal { /deep/ .ant-modal {
.ant-modal-close-x { .ant-modal-close-x {
height: 42px; height: 50px;
width: 42px; width: 50px;
line-height: 42px; line-height: 50px;
} }
.ant-modal-header { .ant-modal-header {
padding: 8px 16px; padding: 14px;
text-align: left;
background-color: #f5f5f5;
} }
.ant-modal-body { .ant-modal-body {
padding-left: 100px; padding-left: 100px;

Loading…
Cancel
Save