修改了小程序页面,修改了企业绑定用户模块,修改了管理用户绑定小程序用户和企业

This commit is contained in:
chendaze 2024-03-24 16:50:05 +08:00
parent 432b5046d0
commit 828b9a1ad1
5 changed files with 195 additions and 67 deletions

View File

@ -3,7 +3,8 @@ import { axios } from '@/utils/request'
const api = { const api = {
customer: '/admin/customer', // 客户管理 customer: '/admin/customer', // 客户管理
customerContacts: 'admin/contacts', // 客户管理-联系人 customerContacts: 'admin/contacts', // 客户管理-联系人
customerAttachments: '/admin/attachments' // 客户管理-相关文件 customerAttachments: '/admin/attachments', // 客户管理-相关文件
icsCustomerStaff: '/admin/staff'
} }
export function getCustomerList (parameter) { export function getCustomerList (parameter) {
@ -14,6 +15,34 @@ export function getCustomerList (parameter) {
}) })
} }
export function getStaffList (parameter) {
return axios({
url: api.icsCustomerStaff + '/list',
method: 'get',
params: parameter
})
}
export function getStaffListNotId (parameter) {
return axios({
url: api.icsCustomerStaff + '/getStaffListNotId',
method: 'get',
params: parameter
})
}
export function updateStaff (parameter) {
return axios({
url: api.icsCustomerStaff + '/update',
method: 'post',
data: parameter,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function saveCustomer (parameter) { export function saveCustomer (parameter) {
return axios({ return axios({
url: api.customer + (parameter.id > 0 ? '/update' : '/save'), url: api.customer + (parameter.id > 0 ? '/update' : '/save'),

View File

@ -243,8 +243,8 @@
</div> </div>
<a-table :pagination="false" :columns="contactsItemColumns" :dataSource="contactsItemData" rowKey="id"> <a-table :pagination="false" :columns="contactsItemColumns" :dataSource="contactsItemData" rowKey="id">
<template slot="operation" slot-scope="text, record"> <template slot="operation" slot-scope="text, record">
<a-button type="link" @click="$refs.contactModal.add(record)">编辑</a-button> <!-- <a-button type="link" @click="$refs.contactModal.add(record)">编辑</a-button>-->
<a-divider type="vertical" /> <!-- <a-divider type="vertical" />-->
<a-popconfirm @confirm="handleDeleteContact(record)"> <a-popconfirm @confirm="handleDeleteContact(record)">
<template slot="title"> <template slot="title">
<span>确定删除 {{ record.name }} </span> <span>确定删除 {{ record.name }} </span>
@ -257,6 +257,7 @@
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="相关文件" key="4" v-if="$route.query.customerId"> <a-tab-pane tab="相关文件" key="4" v-if="$route.query.customerId">
<customer-attachment-list :customer-id="$route.query.customerId"></customer-attachment-list> <customer-attachment-list :customer-id="$route.query.customerId"></customer-attachment-list>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-form> </a-form>
@ -268,7 +269,7 @@
import moment from 'moment' import moment from 'moment'
import storage from 'store' import storage from 'store'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { saveCustomer, getCustomer, getQiXinBasicInfo, getCustomerContactsList, delCustomerContacts } from '@/api/admin/customer' import { saveCustomer, getCustomer, getQiXinBasicInfo, getCustomerContactsList,getStaffList, delCustomerContacts } from '@/api/admin/customer'
import { getCustomerContractList } from '@/api/admin/customerContract' import { getCustomerContractList } from '@/api/admin/customerContract'
import CustomerContactsModal from './modules/CustomerContactsModal.vue' import CustomerContactsModal from './modules/CustomerContactsModal.vue'
import CustomerAttachmentList from './modules/CustomerAttachmentList.vue' import CustomerAttachmentList from './modules/CustomerAttachmentList.vue'
@ -324,16 +325,12 @@ export default {
// //
contactsItemColumns: [ contactsItemColumns: [
{ {
title: '签订人', title: '昵称',
dataIndex: 'name' dataIndex: 'username',
}, },
{ {
title: '联系电话', title: '手机号',
dataIndex: 'phone' dataIndex: 'mobile',
},
{
title: '备注',
dataIndex: 'remark'
}, },
{ {
title: '操作', title: '操作',
@ -497,11 +494,11 @@ export default {
}, },
// //
getContastsList () { getContastsList () {
getCustomerContactsList({ customerId: this.$route.query.customerId }).then(res => { let param = {
// console.log(res) customerId: this.$route.query.customerId
if (res.code === 0) { }
this.contactsItemData = res.rows getStaffList(param).then(res =>{
} this.contactsItemData =res.rows
}) })
}, },
// //

View File

@ -1,48 +1,56 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered='false'>
<div class="table-page-search-wrapper"> <div class='table-page-search-wrapper'>
<a-form layout="inline"> <a-form layout='inline'>
<a-row :gutter="48"> <a-row :gutter='48'>
<a-col :md="5" :sm="15"> <a-col :md='5' :sm='15'>
<a-form-item label="姓名"> <a-form-item label='姓名'>
<a-input placeholder="请输入姓名" v-model="queryParam.username"/> <a-input placeholder='请输入姓名' v-model='queryParam.username' />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="5" :sm="15"> <a-col :md='5' :sm='15'>
<a-form-item label="电话"> <a-form-item label='电话'>
<a-input placeholder="请输入电话" v-model="queryParam.mobile"/> <a-input placeholder='请输入电话' v-model='queryParam.mobile' />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md='8' :sm='24'>
<span class="table-page-search-submitButtons"> <span class='table-page-search-submitButtons'>
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> <a-button style='margin-left: 8px' @click='() => queryParam = {}'>重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class='table-operator'>
<a-button v-if="addEnable" type="primary" icon="plus" @click="$refs.modal.add()">新建</a-button> <a-button v-if='addEnable' type='primary' icon='plus' @click='$refs.modal.add()'>新建</a-button>
<a-dropdown v-if="removeEnable&&selectedRowKeys.length > 0"> <a-dropdown v-if='removeEnable&&selectedRowKeys.length > 0'>
<a-button type="danger" icon="delete" @click="delByIds(selectedRowKeys)">删除</a-button> <a-button type='danger' icon='delete' @click='delByIds(selectedRowKeys)'>删除</a-button>
</a-dropdown> </a-dropdown>
</div> </div>
<s-table <s-table
size="default" size='default'
ref="table" ref='table'
rowKey="id" rowKey='id'
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
:columns="columns" :columns='columns'
:data="loadData" :data='loadData'
> >
<span slot="action" slot-scope="text, record"> <span slot='dataType' slot-scope='text,record'>
<a v-if="editEnabel" @click="handleEdit(record)">编辑</a> <a-tag v-if='record.dataType == 1' color='pink'>
<a-divider type="vertical" /> 企业员工
<a v-if="removeEnable" @click="delByIds([record.id])">删除</a> </a-tag>
<a-tag v-if='record.dataType == 2' color='green'>
临时访客
</a-tag>
</span>
<span slot='action' slot-scope='text, record'>
<a v-if='editEnabel' @click='handleEdit(record)'>编辑</a>
<a-divider type='vertical' />
<a v-if='removeEnable' @click='delByIds([record.id])'>删除</a>
</span> </span>
</s-table> </s-table>
<icsCustomerStaff-modal ref="modal" @ok="handleOk"/> <icsCustomerStaff-modal ref='modal' @ok='handleOk' />
</a-card> </a-card>
</template> </template>
@ -59,7 +67,7 @@ export default {
STable, STable,
IcsCustomerStaffModal IcsCustomerStaffModal
}, },
data () { data() {
return { return {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
@ -78,13 +86,18 @@ export default {
// //
columns: [ columns: [
{ {
title: '姓名', title: '用户昵称',
dataIndex: 'username' dataIndex: 'username'
}, },
{ {
title: '电话', title: '电话',
dataIndex: 'mobile' dataIndex: 'mobile'
}, },
{
title: '数据类型',
dataIndex: 'dataType',
scopedSlots: { customRender: 'dataType' }
},
{ {
title: '操作', title: '操作',
width: '200px', width: '200px',
@ -103,26 +116,25 @@ export default {
removeEnable: checkPermission('admin:staff:remove') removeEnable: checkPermission('admin:staff:remove')
} }
}, },
filters: { filters: {},
}, created() {
created () {
}, },
methods: { methods: {
onSelectChange (selectedRowKeys, selectedRows) { onSelectChange(selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows this.selectedRows = selectedRows
}, },
handleAdd () { handleAdd() {
this.$refs.modal.add() this.$refs.modal.add()
}, },
handleEdit (record) { handleEdit(record) {
this.$refs.modal.edit(record) this.$refs.modal.edit(record)
}, },
handleOk () { handleOk() {
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
console.log('handleSaveOk') console.log('handleSaveOk')
}, },
delByIds (ids) { delByIds(ids) {
delIcsCustomerStaff({ ids: ids.join(',') }).then(res => { delIcsCustomerStaff({ ids: ids.join(',') }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('删除成功') this.$message.success('删除成功')

View File

@ -14,20 +14,38 @@
<a-form-item style="display:none"> <a-form-item style="display:none">
<a-input v-decorator="['customerId']" /> <a-input v-decorator="['customerId']" />
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="请选择手机号">
<a-input placeholder="联系人" v-decorator="['name', {rules: [{required: true, message: '请输入联系人'}]}]"/> <!-- <a-input placeholder="联系人" v-decorator="['name', {rules: [{required: true, message: '请输入联系人'}]}]"/>-->
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话"> <a-select
<a-input placeholder="联系电话" v-decorator="['phone']"/> show-search
</a-form-item> v-decorator="['mobile', {rules: [{required: true, message: '请选择手机号码'}]}]"
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注"> placeholder="请选择手机号码"
<a-input placeholder="备注" v-decorator="['remark']"/> style="width: 200px"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="handleSearch"
@change="handleChange"
>
<a-select-option v-for="d in data" :key="d.id">
{{ d.mobile }}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">-->
<!-- <a-input placeholder="联系电话" v-decorator="['phone']"/>-->
<!-- </a-form-item>-->
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">-->
<!-- <a-input placeholder="备注" v-decorator="['remark']"/>-->
<!-- </a-form-item>-->
</a-form> </a-form>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import { saveCustomerContacts } from '@/api/admin/customer' import { saveCustomerContacts,getStaffList,updateStaff,getStaffListNotId } from '@/api/admin/customer'
import pick from 'lodash.pick' import pick from 'lodash.pick'
export default { export default {
name: 'CustomerContactsModal', name: 'CustomerContactsModal',
@ -37,6 +55,7 @@ export default {
}, },
data () { data () {
return { return {
staffId:'',
visible: false, visible: false,
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
@ -50,14 +69,30 @@ export default {
mdl: {}, mdl: {},
customerId: undefined, customerId: undefined,
contactId: undefined, contactId: undefined,
form: this.$form.createForm(this) form: this.$form.createForm(this),
data:[],
} }
}, },
beforeCreate () { beforeCreate () {
}, },
created () { created () {
}, },
methods: { methods: {
handleSearch(value){
let param = {
mobile:value
}
getStaffList(param).then(res =>{
this.data =res.rows
})
},
handleChange(value){
console.log(value);
this.staffId = value;
// fetch(value, data => (this.data = data));
},
add (contactInfo) { add (contactInfo) {
this.customerId = undefined this.customerId = undefined
this.customerId = contactInfo.customerId this.customerId = contactInfo.customerId
@ -65,6 +100,14 @@ export default {
this.contactId = contactInfo.id this.contactId = contactInfo.id
this.form.resetFields() this.form.resetFields()
this.edit(contactInfo) this.edit(contactInfo)
let param = {
icsCustomerId:contactInfo.customerId
}
getStaffListNotId(param).then(res =>{
this.data =res.rows
})
}, },
edit (record) { edit (record) {
this.mdl = Object.assign(record) this.mdl = Object.assign(record)
@ -81,8 +124,10 @@ export default {
if (!err) { if (!err) {
// values.customerId = this.customerId // values.customerId = this.customerId
console.log('Received values of form: ', values) console.log('Received values of form: ', values)
values.id = this.staffId
console.log(values)
this.confirmLoading = true this.confirmLoading = true
saveCustomerContacts(values).then(res => { updateStaff(values).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.$emit('ok') this.$emit('ok')

View File

@ -67,6 +67,30 @@
<a-select-option v-for="item in customerList" :key="item.value" >{{ item.text }}</a-select-option> <a-select-option v-for="item in customerList" :key="item.value" >{{ item.text }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="选择企业">
<!-- <a-select v-decorator="['customerId', {rules: [{ required: true, message: '请选择企业' }]}]">-->
<!-- <a-select-option v-for="item in customerList" :key="item.value" >{{ item.text }}</a-select-option>-->
<!-- </a-select>-->
<a-select
show-search
v-decorator="['staffId', {rules: [{required: true, message: '请选择手机号码'}]}]"
placeholder="请选择手机号码"
style="width: 200px"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="handleSearch"
@change="handleChange"
>
<a-select-option v-for="d in data" :key="d.id">
{{ d.mobile }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述">
<a-textarea :rows="3" placeholder="..." v-decorator="['remark']"/> <a-textarea :rows="3" placeholder="..." v-decorator="['remark']"/>
@ -77,6 +101,8 @@
</template> </template>
<script> <script>
import { getRoleAll, saveUser, getUser } from '@/api/system' import { getRoleAll, saveUser, getUser } from '@/api/system'
import { saveCustomerContacts,getStaffList,updateStaff,getStaffListNotId } from '@/api/admin/customer'
import { import {
getCustomerList getCustomerList
} from '@/api/admin/meeting/roomContent' } from '@/api/admin/meeting/roomContent'
@ -110,6 +136,7 @@ export default {
confirmLoading: false, confirmLoading: false,
roleAll: [], roleAll: [],
mdl: {}, mdl: {},
data:[],
customerList:[], customerList:[],
deptCheck: true, deptCheck: true,
spinning: false, spinning: false,
@ -146,6 +173,17 @@ export default {
this.loadRoleAll() this.loadRoleAll()
}, },
methods: { methods: {
handleSearch(value){
let param = {
mobile:value
}
getStaffList(param).then(res =>{
this.data =res.rows
})
},
handleChange(){
},
add () { add () {
this.form.resetFields() this.form.resetFields()
this.mdl = Object.assign({}, { id: 0, deptId: '' }) this.mdl = Object.assign({}, { id: 0, deptId: '' })
@ -153,6 +191,13 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'username', 'nickname', 'status', 'mobile', 'roleIds','customerId', 'remark', 'deptId', 'parkId', 'tenantId')) this.form.setFieldsValue(pick(this.mdl, 'id', 'username', 'nickname', 'status', 'mobile', 'roleIds','customerId', 'remark', 'deptId', 'parkId', 'tenantId'))
}) })
let param = {
}
getStaffListNotId(param).then(res =>{
this.data =res.rows
})
}, },
edit (record) { edit (record) {
if (record.id > 0) { if (record.id > 0) {