添加员工分配标签页面
This commit is contained in:
parent
6ed4014704
commit
bd72faa11e
|
@ -11,6 +11,13 @@ enum Api {
|
||||||
deleteBatch = '/bizEmployeesInfo/bizEmployeesInfo/deleteBatch',
|
deleteBatch = '/bizEmployeesInfo/bizEmployeesInfo/deleteBatch',
|
||||||
importExcel = '/bizEmployeesInfo/bizEmployeesInfo/importExcel',
|
importExcel = '/bizEmployeesInfo/bizEmployeesInfo/importExcel',
|
||||||
exportXls = '/bizEmployeesInfo/bizEmployeesInfo/exportXls',
|
exportXls = '/bizEmployeesInfo/bizEmployeesInfo/exportXls',
|
||||||
|
|
||||||
|
getEmployeesList = '/serviceTag/serviceTag/getEmployeesList',
|
||||||
|
queryTagsById = '/serviceTag/serviceTag/queryById',
|
||||||
|
checkTags='/bizEmployeesInfo/nuBizEmployeesServcieTags/add',
|
||||||
|
removeTags = '/bizEmployeesInfo/nuBizEmployeesServcieTags/delete',
|
||||||
|
getEmployessServiceTags = '/serviceTag/serviceTag/getEmployessServiceTags',
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +36,10 @@ export const getImportUrl = Api.importExcel;
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
export const getEmployessServiceTags = (params) => defHttp.get({ url: Api.getEmployessServiceTags, params });
|
||||||
|
export const getEmployeesList = (params) => defHttp.get({ url: Api.getEmployeesList, params });
|
||||||
|
|
||||||
|
export const queryTagsById = (params) => defHttp.get({ url: Api.queryTagsById, params });
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
* @param params
|
* @param params
|
||||||
|
@ -70,3 +80,14 @@ export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export const checkTags = (params) => {
|
||||||
|
let url = Api.checkTags;
|
||||||
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
|
}
|
||||||
|
export const removeTags = (params) => {
|
||||||
|
let url = Api.removeTags;
|
||||||
|
return defHttp.delete({ url: url, params }, {joinParamsToUrl: true});
|
||||||
|
}
|
|
@ -232,3 +232,56 @@ export const superQuerySchema = {
|
||||||
regional: {title: '区域',order: 32,view: 'text', type: 'string',},
|
regional: {title: '区域',order: 32,view: 'text', type: 'string',},
|
||||||
serviceTag: {title: '服务标签',order: 33,view: 'text', type: 'string',},
|
serviceTag: {title: '服务标签',order: 33,view: 'text', type: 'string',},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//列表数据
|
||||||
|
export const serviceTagcolumns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '服务标签名称',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'tagName',
|
||||||
|
width:'50%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'description'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
//列表数据
|
||||||
|
export const employeesTagcolumns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'rowIndex',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 60,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function ({ text }) {
|
||||||
|
if (text == undefined) {
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
return parseInt(text) + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务标签名称',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'tagName',
|
||||||
|
width:'50%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'description'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key:'action',
|
||||||
|
align: "center",
|
||||||
|
width:'140px',
|
||||||
|
},
|
||||||
|
];
|
|
@ -0,0 +1,227 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="name">
|
||||||
|
<template #label><span title="姓名">姓名</span></template>
|
||||||
|
<a-input placeholder="请输入姓名" v-model:value="queryParam.name" allow-clear ></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" v-auth="'bizEmployeesInfo:biz_employees_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
<a-button type="primary" v-auth="'bizEmployeesInfo:biz_employees_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
|
<j-upload-button type="primary" v-auth="'bizEmployeesInfo:biz_employees_info:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)"/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<BizEmployeesInfoModal ref="registerModal" @success="handleSuccess"></BizEmployeesInfoModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="bizEmployeesInfo-bizEmployeesInfo" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns, superQuerySchema } from './BizEmployeesInfo.data';
|
||||||
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BizEmployeesInfo.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import BizEmployeesInfoModal from './components/BizEmployeesInfoModal.vue'
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
const registerModal = ref();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
tableProps: {
|
||||||
|
title: '员工信息',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize:false,
|
||||||
|
useSearchForm: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
|
},
|
||||||
|
beforeFetch: async (params) => {
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
exportConfig: {
|
||||||
|
name: "员工信息",
|
||||||
|
url: getExportUrl,
|
||||||
|
params: queryParam,
|
||||||
|
},
|
||||||
|
importConfig: {
|
||||||
|
url: getImportUrl,
|
||||||
|
success: handleSuccess
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs:24,
|
||||||
|
sm:4,
|
||||||
|
xl:6,
|
||||||
|
xxl:4
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: 24,
|
||||||
|
sm: 20,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级查询事件
|
||||||
|
*/
|
||||||
|
function handleSuperQuery(params) {
|
||||||
|
Object.keys(params).map((k) => {
|
||||||
|
queryParam[k] = params[k];
|
||||||
|
});
|
||||||
|
searchQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleAdd() {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.add();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
function handleEdit(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除事件
|
||||||
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteOne({ id: record.id }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '编辑',
|
||||||
|
onClick: handleEdit.bind(null, record),
|
||||||
|
auth: 'bizEmployeesInfo:biz_employees_info:edit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}, {
|
||||||
|
label: '删除',
|
||||||
|
popConfirm: {
|
||||||
|
title: '是否确认删除',
|
||||||
|
confirm: handleDelete.bind(null, record),
|
||||||
|
placement: 'topLeft',
|
||||||
|
},
|
||||||
|
auth: 'bizEmployeesInfo:biz_employees_info:delete'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
padding: 0;
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.query-group-cust{
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
.query-group-split-cust{
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
.ant-form-item:not(.ant-form-item-with-help){
|
||||||
|
margin-bottom: 16px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
:deep(.ant-picker),:deep(.ant-input-number){
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -34,7 +34,7 @@
|
||||||
<a-button type="primary" @click="handleEdit(item)">编辑</a-button>
|
<a-button type="primary" @click="handleEdit(item)">编辑</a-button>
|
||||||
</span>
|
</span>
|
||||||
<span class="buttonMargin">
|
<span class="buttonMargin">
|
||||||
<a-button type="primary">工作内容</a-button>
|
<a-button type="primary" @click="handleFwbq(item)">服务标签</a-button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -70,6 +70,7 @@
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<BizEmployeesInfoModal ref="registerModal" @success="handleSuccess"></BizEmployeesInfoModal>
|
<BizEmployeesInfoModal ref="registerModal" @success="handleSuccess"></BizEmployeesInfoModal>
|
||||||
|
<EmployeesServiceTagModal ref="registerServiceTagModal" @success="handleSuccess"></EmployeesServiceTagModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -79,14 +80,16 @@
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BizEmployeesInfo.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BizEmployeesInfo.api';
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import BizEmployeesInfoModal from './components/BizEmployeesInfoModal.vue'
|
import BizEmployeesInfoModal from './components/BizEmployeesInfoModal.vue'
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import EmployeesServiceTagModal from '/@/views/biz/bizEmployeesInfo/employeesServiceTag/employeesServiceTagModal.vue'
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
import { Pagination } from 'ant-design-vue';
|
import { Pagination } from 'ant-design-vue';
|
||||||
const APagination = Pagination;
|
const APagination = Pagination;
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
|
const registerServiceTagModal = ref();
|
||||||
const dataList = ref<any[]>([]);
|
const dataList = ref<any[]>([]);
|
||||||
const current = ref(1);
|
const current = ref(1);
|
||||||
const pageSize = ref(8);
|
const pageSize = ref(8);
|
||||||
|
@ -103,6 +106,7 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
sm: 20,
|
sm: 20,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//当没有员工头像时,默认展示企业logo
|
||||||
function handleHeadPath(headPath){
|
function handleHeadPath(headPath){
|
||||||
console.log('headPath--->',headPath);
|
console.log('headPath--->',headPath);
|
||||||
if(headPath){
|
if(headPath){
|
||||||
|
@ -110,7 +114,12 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
}else{
|
}else{
|
||||||
return '../../../../../public/resource/img/logo.png';
|
return '../../../../../public/resource/img/logo.png';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//分配服务标签
|
||||||
|
function handleFwbq(info){
|
||||||
|
registerServiceTagModal.value.disableSubmit = false;
|
||||||
|
registerServiceTagModal.value.init(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,206 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="rowA">
|
||||||
|
<div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" >
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
可选服务标签
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<!--字段回显插槽-->
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
</div>
|
||||||
|
<div style="padding: 8px;">
|
||||||
|
<div>已选服务标签</div>
|
||||||
|
<a-table :dataSource="employeesDataSource" :columns="employeesTagcolumns" style="margin-top:8px;" bordered size="small" :pagination="false">
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'action'" >
|
||||||
|
<a @click="handleYichu(record)">移除</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a @click="handleEmlDetail(record)">详情</a>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="rowB" style="padding: 8px;">
|
||||||
|
<div style="border: 1px solid rgb(243, 239, 239);padding: 8px;">
|
||||||
|
详情
|
||||||
|
<a-list item-layout="horizontal" :data-source="tagsDetailData" >
|
||||||
|
<template #renderItem="{ item ,index}">
|
||||||
|
<a-list-item>
|
||||||
|
<a-list-item-meta :description="item.serviceContent">
|
||||||
|
<template #title>
|
||||||
|
{{ (index+1) +'、 '+ item.categoryName +'-'+item.typeName +'-'+item.directiveName }}
|
||||||
|
<span v-if="item.tagsName">({{item.tagsName}})</span>
|
||||||
|
</template>
|
||||||
|
</a-list-item-meta>
|
||||||
|
</a-list-item>
|
||||||
|
</template>
|
||||||
|
</a-list>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="bizEmployeesInfo-nuBizEmployeesServcieTags" setup>
|
||||||
|
import {ref, reactive, computed, unref} from 'vue';
|
||||||
|
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||||
|
import {useModal} from '/@/components/Modal';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage'
|
||||||
|
import { serviceTagcolumns ,employeesTagcolumns } from '../BizEmployeesInfo.data';
|
||||||
|
import { getEmployeesList,queryTagsById,checkTags,removeTags,getEmployessServiceTags } from '../BizEmployeesInfo.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import { number } from 'vue-types';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const checkedKeys = ref<Array<string | number>>([]);
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
const rowA = ref<number>(24);
|
||||||
|
const rowB = ref<number>(0);
|
||||||
|
const employeesDataSource = ref<any[]>([]);
|
||||||
|
const tagsDetailData = ref<any[]>([]);
|
||||||
|
const employeesInfo = reactive<any>({});
|
||||||
|
//注册model
|
||||||
|
const [registerModal, {openModal}] = useModal();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||||
|
tableProps:{
|
||||||
|
title: '员工配置的服务标签',
|
||||||
|
api: getEmployeesList,
|
||||||
|
columns: serviceTagcolumns,
|
||||||
|
canResize:false,
|
||||||
|
immediate: false,
|
||||||
|
showIndexColumn: true,
|
||||||
|
formConfig: {
|
||||||
|
//labelWidth: 120,
|
||||||
|
autoSubmitOnEnter:true,
|
||||||
|
showAdvancedButton:true,
|
||||||
|
fieldMapToNumber: [
|
||||||
|
],
|
||||||
|
fieldMapToTime: [
|
||||||
|
],
|
||||||
|
},
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed:'right'
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const [registerTable, {reload}] = tableContext
|
||||||
|
/**
|
||||||
|
* 选择
|
||||||
|
*/
|
||||||
|
async function handleXuanze(record) {
|
||||||
|
const model = {employeesId:employeesInfo.value.id,tagsId:record.id};
|
||||||
|
await checkTags(model).then((res) => {
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reload();
|
||||||
|
getEmployessServiceTagsList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 移除
|
||||||
|
*/
|
||||||
|
async function handleYichu(record) {
|
||||||
|
const model = {id:record.id};
|
||||||
|
await removeTags(model).then((res) => {
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reload();
|
||||||
|
getEmployessServiceTagsList();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工选择服务标签后的详情
|
||||||
|
*/
|
||||||
|
function handleEmlDetail(record) {
|
||||||
|
console.log(record);
|
||||||
|
rowA.value = 18;
|
||||||
|
rowB.value = 6;
|
||||||
|
|
||||||
|
queryTagsById({ id: record.employeesTagsId }).then(item => {
|
||||||
|
console.log(item);
|
||||||
|
tagsDetailData.value = item.directives;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 服务标签列表详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record) {
|
||||||
|
rowA.value = 18;
|
||||||
|
rowB.value = 6;
|
||||||
|
console.log(record);
|
||||||
|
|
||||||
|
queryTagsById({ id: record.id }).then(item => {
|
||||||
|
console.log(item);
|
||||||
|
tagsDetailData.value = item.directives;
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record){
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '选择',
|
||||||
|
onClick: handleXuanze.bind(null, record),
|
||||||
|
ifShow: record.employeesTagsId == '0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取员工已获取的服务标签
|
||||||
|
function getEmployessServiceTagsList(){
|
||||||
|
const model = {employeesId:employeesInfo.value.id};
|
||||||
|
getEmployessServiceTags(model).then(item => {
|
||||||
|
employeesDataSource.value = item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function init(record){
|
||||||
|
//初始化
|
||||||
|
queryParam.employeesId = record.id;
|
||||||
|
employeesInfo.value= record;
|
||||||
|
rowA.value = 24;
|
||||||
|
rowB.value = 0;
|
||||||
|
reload();
|
||||||
|
getEmployessServiceTagsList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
init,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(.ant-picker),:deep(.ant-input-number){
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<EmployeesServiceTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></EmployeesServiceTagForm>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import EmployeesServiceTagForm from './EmployeesServiceTagForm.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<string>('90%');
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function init(record) {
|
||||||
|
title.value = '服务标签';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.init(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
init,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
Loading…
Reference in New Issue