开放平台管理

异常通知管理
This commit is contained in:
andy 2026-09-29 08:58:41 +08:00
parent 7882f5b24f
commit c77d12b9ef
9 changed files with 831 additions and 31 deletions

View File

@ -0,0 +1,40 @@
import request from '@/utils/request'
export function listExceptionNotification(query) {
return request({
url: '/system/exceptionNotification/list',
method: 'get',
params: query
})
}
export function addExceptionNotification(data) {
return request({
url: '/system/exceptionNotification',
method: 'post',
data: data
})
}
export function getExceptionNotification(id) {
return request({
url: '/system/exceptionNotification/' + id,
method: 'get'
})
}
export function updateExceptionNotification(data) {
return request({
url: '/system/exceptionNotification',
method: 'put',
data: data
})
}
export function deleteExceptionNotification(id) {
return request({
url: '/system/exceptionNotification/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,64 @@
import request from '@/utils/request'
// 查询员工管理列表
export function list(query) {
return request({
url: '/system/platform/list',
method: 'get',
params: query
})
}
// 查询员工管理详细
export function getDetail(id) {
return request({
url: '/system/platform/' + id,
method: 'get'
})
}
// 新增员工管理
export function add(data) {
return request({
url: '/system/platform',
method: 'post',
data: data
})
}
// 修改员工管理
export function update(data) {
return request({
url: '/system/platform',
method: 'put',
data: data
})
}
export function resetKey(data) {
return request({
url: '/system/platform/resetKey',
method: 'put',
data: data
})
}
// 删除员工管理
export function del(id) {
return request({
url: '/system/platform/' + id,
method: 'delete'
})
}
// 查询员工管理列表
export function serviceList() {
return request({
url: '/system/platform/service/list',
method: 'get',
})
}

View File

@ -19,6 +19,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:staff:import']">导入统计</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -348,7 +349,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 考勤统计导入对话框 --> <!-- 考勤统计导入对话框 -->
<el-dialog :title="upload.title" v-dialog-drag :visible.sync="upload.open" width="400px" append-to-body> <!-- <el-dialog :title="upload.title" v-dialog-drag :visible.sync="upload.open" width="400px" append-to-body>
<el-upload <el-upload
ref="upload" ref="upload"
:limit="1" :limit="1"
@ -371,7 +372,7 @@
<el-button type="primary" @click="submitFileForm">确 定</el-button> <el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button> <el-button @click="upload.open = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog> -->
<el-drawer <el-drawer
:title="info.title" :title="info.title"
@ -393,6 +394,32 @@
</div> </div>
</el-drawer> </el-drawer>
<el-dialog :title="upload.title" v-dialog-drag :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<el-link type="primary" :underline="false" style="font-size:20px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
<h3 style="color: red;">仅允许导入xls、xlsx格式文件。</h3>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -509,6 +536,17 @@ export default {
}, },
methods: { methods: {
/** 详情导入 */
handleImport() {
this.upload.title = "员工导入";
this.upload.open = true;
},
//下载模版
importTemplate() {
this.download('attendance/statistical/importTemplate', {
}, `考勤统计模版_${new Date().getTime()}.xlsx`)
},
viewInfo(row){ viewInfo(row){
this.info.title=row.name+" ["+DateUtils.formatDate(row.month, 'yyyy-MM') +"] 操作记录"; this.info.title=row.name+" ["+DateUtils.formatDate(row.month, 'yyyy-MM') +"] 操作记录";
getAttendanceOper(row.id).then(response => { getAttendanceOper(row.id).then(response => {

View File

@ -48,7 +48,7 @@
v-if="scope.row.status ==='待审核'" v-if="scope.row.status ==='待审核'"
icon="el-icon-check" icon="el-icon-check"
@click="handleComfirm(scope.row)" @click="handleComfirm(scope.row)"
v-hasPermi="['finance:financeStatistics:comfirm']" v-hasPermi="['finance:financeStatistics:confirm']"
>确认发放</el-button> >确认发放</el-button>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -57,6 +57,7 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
v-hasPermi="['restaurant:images:remove']"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>

View File

@ -56,9 +56,10 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
> >
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column> <el-table-column prop="deptName" label="部门名称" width="200"></el-table-column>
<el-table-column prop="leader" label="负责人" width="260"></el-table-column> <el-table-column prop="deptCode" label="部门编码" width="100"></el-table-column>
<el-table-column prop="phone" label="联系电话" width="260"></el-table-column> <el-table-column prop="leader" label="负责人" width="100"></el-table-column>
<el-table-column prop="phone" label="联系电话" width="120"></el-table-column>
<el-table-column prop="isOverTime" label="是否加班" width="180"> <el-table-column prop="isOverTime" label="是否加班" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@ -138,14 +139,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="部门状态"> <el-form-item label="部门编码" prop="deptCode">
<el-radio-group v-model="form.status"> <el-input v-model="form.deptCode" placeholder="请输入对应的金蝶部门编码" />
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -179,6 +174,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="部门状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>

View File

@ -0,0 +1,302 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="98px">
<el-form-item label="异常类型:" prop="notificationType">
<el-select v-model="queryParams.notificationType" placeholder="请选择异常类型" clearable>
<el-option
v-for="dict in dict.type.notification_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:exceptionNotification:add']">新增</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="enotificationList" >
<el-table-column label="异常订阅类型" align="center" width="180" fixed="left" prop="notificationType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.notification_type" :value="scope.row.notificationType"/>
</template>
</el-table-column>
<el-table-column label="异常等级天数" align="center" prop="day" width="180">
<template slot-scope="scope">
{{scope.row.day}}天
</template>
</el-table-column>
<el-table-column label="异常接收人" align="center" prop="userNames" />
<el-table-column label="异常订阅部门" align="center" prop="deptNames" />
<el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:exceptionNotification:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-info" @click="handleDelete(scope.row)" v-hasPermi="['system:exceptionNotification:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改员工对话框 -->
<el-dialog v-dialog-drag :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="128px">
<el-row>
<el-col :span="24">
<el-form-item label="异常类型:" prop="notificationType">
<el-select v-model="form.notificationType" style="width: 100%;">
<el-option
v-for="dict in dict.type.notification_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="异常等级天数:" prop="day">
<el-input-number v-model="form.day" :min="5" :max="20" />
<!-- <el-input v-model="form.day" placeholder="异常等级天数" /> -->
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="异常接收人:" prop="userIds">
<el-select v-model="form.userIds" multiple filterable style="width: 100%;">
<el-option
v-for="user in userList"
:key="user.userId"
:label="user.name"
:value="user.userId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="菜单权限">
<!-- <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event)">展开/折叠</el-checkbox> -->
<!-- <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event)">全选/全不选</el-checkbox> -->
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event)">父子联动</el-checkbox>
<el-tree
class="tree-border"
:data="deptOptions"
show-checkbox
ref="dept"
:default-expand-all="true"
node-key="id"
:check-strictly="!form.deptCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listExceptionNotification, addExceptionNotification, getExceptionNotification, updateExceptionNotification,deleteExceptionNotification } from '@/api/system/exceptionNotification'
import { listStaffAll } from '@/api/system/staff'
import { listAllDepts } from '@/api/system/dept';
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "exceptionNotification",
dicts: ['notification_type'],
data() {
return {
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
notificationType: null,
},
// 遮罩层
loading: true,
//总数, 是否显示统计数
total:0,
//异常表格数据
enotificationList: [],
// 是否显示弹出层
open: false,
menuExpand: false,
menuNodeAll: false,
// 弹出层标题
title: "",
// 表单参数
form: {
id: null,
notificationType: null,
day: 5,
userIds:[],
deptids:[],
},
userList:[],
// 部门列表
deptOptions: [],
defaultProps: {
children: "children",
label: "label"
},
// 表单校验
rules: {
}
};
},
created() {
this.getOptions();
this.getList();
this.getDeptList();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.form.day = 5;
this.open = true;
this.title = "添加异常订阅";
},
// 树权限(父子联动)
handleCheckedTreeConnect(value) {
this.form.deptCheckStrictly = value ? true: false;
},
/** 查询用户数据 */
getOptions() {
listStaffAll().then(response => {
this.userList = response;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.userIds){
this.form.userIds = this.form.userIds.join(',')
}
this.form.deptIds = this.getDeptAllCheckedKeys();
if(this.form.deptIds){
this.form.deptIds = this.form.deptIds.join(',')
}
if (this.form.id != null) {
updateExceptionNotification(this.form).then(response => {
this.$modal.msgSuccess("修改订阅成功");
this.open = false;
this.getList();
});
} else {
addExceptionNotification(this.form).then(response => {
this.$modal.msgSuccess("新增订阅成功");
this.open = false;
this.getList();
});
}
}
});
},
// 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
let checkedKeys = this.$refs.dept.getCheckedKeys();
// 半选中的部门节点
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
/** 获取部门 */
getDeptList(){
listAllDepts().then(response => {
this.deptOptions = response;
});
},
/** 查询员工管理列表 */
getList() {
this.loading = true;
listExceptionNotification(this.queryParams).then(response => {
this.enotificationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
notificationType: null,
day: 5,
userIds:[],
deptids:[],
};
this.resetForm("form");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
getExceptionNotification(row.id).then(response => {
this.form = response.data;
this.form.userIds = response.data.userIds ? response.data.userIds.split(",").map(Number) : [];
this.form.deptIds = response.data.deptIds ? response.data.deptIds.split(",").map(Number) : [];
this.open = true;
this.$nextTick(() => {
this.$refs.dept.setCheckedKeys(this.form.deptIds);
});
this.title = "修改异常订阅";
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除异常订阅吗?').then(function() {
return deleteExceptionNotification(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除异常订阅成功");
}).catch(() => {});
},
}
};
</script>

View File

@ -0,0 +1,293 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="平台名称:" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入平台名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:platform:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" >
<el-table-column label="平台" align="center" fixed="left" prop="name" />
<el-table-column label="唯一码" align="center" fixed="left" prop="uniqueCode" />
<el-table-column label="授权秘钥" align="center" prop="secretKey" />
<!-- <el-table-column label="授权接口" align="center" prop="allowAccessService" >
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-info"
v-if="scope.row.status!=-1"
@click="handleDetail(scope.row)"
>查看</el-button>
</template>
</el-table-column> -->
<!-- <el-table-column label="备注" align="center" prop="remarks" /> -->
<el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-refresh"
@click="handleRefresh(scope.row)"
v-hasPermi="['system:platform:edit']"
>刷新秘钥</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:platform:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDelete(scope.row)"
v-hasPermi="['system:platform:delete']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改员工对话框 -->
<el-dialog v-dialog-drag :title="title" :visible.sync="open" width="80%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="128px">
<el-row>
<el-col :span="24">
<el-form-item label="平台名称:" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="24">
<el-form-item label="授权服务:" prop="address">
<el-checkbox-group v-model="checkList">
<el-checkbox v-for="checkbox in serviceList" :key="checkbox" :label="checkbox" :value="checkbox">{{checkbox}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-tabs type="border-card">
<el-tab-pane v-for="tab in checkList" :key="tab" :label="tab">{{tab}}</el-tab-pane>
</el-tabs>
</el-row> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 150px;
height: 137px;
line-height: 137px;
text-align: center;
}
.avatar {
width: 150px;
height: 137px;
display: block;
}
</style>
<script>
import { list, getDetail, del, add, update,serviceList,resetKey } from '@/api/system/platform'
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Platform",
dicts: ['sys_user_sex', 'sys_level','sys_yes_no','sys_worker_status','sys_contract','sys_company','time_clock','job_info'],
data() {
return {
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
//列表数据列表
dataList:[],
serviceList:[],
//授权服务
checkList:[],
//弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 员工信息导入
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
name: [
{ required: true, message: "平台名称不能为空", trigger: "blur" }
]
}
};
},
created() {
// this.getAllowAdjustment();
this.getList();
this.getServiceList();
// this.getDeptList();
// this.getSubsidyList();
},
methods: {
/** 查询员工管理列表 */
getList() {
this.loading = true;
list(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getServiceList() {
serviceList().then(response => {
this.serviceList = response;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加对接平台";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
getDetail(row.id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改对接平台";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
update(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
add(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('确认删除对接平台"' + row.name + '"的信息吗?').then(function() {
return del(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
handleRefresh(row) {
this.$modal.confirm('秘钥刷新后, 原始秘钥将作废, 确认刷新 '+ row.name +' 的秘钥吗?').then(function() {
return resetKey(row);
}).then(() => {
this.getList();
this.$modal.msgSuccess("刷新成功");
}).catch(() => {});
},
//查看详情
// handleDetail(row){
// getDetailByUser(row.userId).then(response => {
// this.infoForm = response.data;
// this.openInfo = true;
// });
// },
}
};
</script>

View File

@ -195,9 +195,10 @@
<span>{{ parseTime(scope.row.employmentDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.employmentDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="试用期限" align="center" prop="workerTerm"> <el-table-column label="转正日期" align="center" prop="regularDate" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.workerTerm }}月</span> <!-- <span>{{ scope.row.workerTerm }}月</span> -->
<span>{{ parseTime(scope.row.regularDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="在职状态" align="center" prop="status" > <el-table-column label="在职状态" align="center" prop="status" >
@ -448,8 +449,9 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="岗位:" prop="jobCode"> <el-form-item label="岗位:" prop="jobCode">
<el-select v-model="form.jobCode" filterable placeholder="请选择岗位"> <el-select v-model="form.jobCode" filterable placeholder="请选择岗位">
<!-- dict.type.job_info -->
<el-option <el-option
v-for="dict in dict.type.job_info" v-for="dict in jobInfoOptions"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -478,11 +480,22 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="试用期限:" prop="workerTerm"> <el-form-item label="转正日期:" prop="regularDate">
<el-date-picker clearable style="width: 200px;"
v-model="form.regularDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择转正日期:">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="试用期限:" prop="workerTerm">
<el-input v-model="form.workerTerm" placeholder="请输入试用期限" > <el-input v-model="form.workerTerm" placeholder="请输入试用期限" >
<template slot="append">月</template> <template slot="append">月</template>
</el-input> </el-input>
</el-form-item> </el-form-item> -->
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -944,6 +957,7 @@ import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import { getAllowAdjustment } from "@/api/system/allowAdjustment"; import { getAllowAdjustment } from "@/api/system/allowAdjustment";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getDicts } from "@/api/system/dict/data";
export default { export default {
name: "Staff", name: "Staff",
@ -960,13 +974,6 @@ export default {
callback() // 校验通过 callback() // 校验通过
} }
}); });
// 假设后台返回 { code: 0, data: true } true=已存在
// if (res.data.data) {
// callback(new Error('姓名【'+value+'】已存在,所有员工(含离职)不可重名'))
// } else {
// callback() // 校验通过
// }
} }
return { return {
@ -982,6 +989,8 @@ export default {
//部门列表 //部门列表
deptOptions: [], deptOptions: [],
deptOpt:[], deptOpt:[],
//岗位信息
jobInfoOptions: [],
//补贴列表 //补贴列表
subsidyOptions: [], subsidyOptions: [],
// 弹出层标题 // 弹出层标题
@ -1111,9 +1120,9 @@ export default {
imageUrl:[ imageUrl:[
{ required: true, message: "请上传员工头像", trigger: "blur" }, { required: true, message: "请上传员工头像", trigger: "blur" },
], ],
// timeClockList: [ timeClockList: [
// { required: true, message: "打卡机不能为空", trigger: "blur" } { required: true, message: "打卡机不能为空", trigger: "blur" }
// ], ],
jobCode: [ jobCode: [
{ required: true, message: "请选择员工岗位信息", trigger: "blur" } { required: true, message: "请选择员工岗位信息", trigger: "blur" }
], ],
@ -1133,8 +1142,53 @@ export default {
this.getDeptList(); this.getDeptList();
this.getSubsidyList(); this.getSubsidyList();
}, },
methods: {
watch: {
'form.deptId'(newVal, oldVal) {
if(newVal != undefined && newVal != null){
this.buildJobInfo(newVal[newVal.length-1]);
}
}
},
methods: {
buildJobInfo(deptId){
if(!deptId){
return;
}
this.jobInfoOptions = [];
const deptCode= this.getDeptCode(this.deptOptions, deptId);
console.log("部门code", deptCode);
if(!deptCode){
return;
}
for (let job of this.dict.type.job_info) {
const jobCodes = job.value.split("_");
console.log("部门code", jobCodes[1], jobCodes);
if(jobCodes[1] === deptCode){
this.jobInfoOptions.push(job);
}
}
},
getDeptCode(dataList, deptId){
for (let item of dataList) {
// 当前节点匹配
if (item.id === deptId) {
return item.extend.deptCode
}
// 存在子节点则递归查找子树
if (item.children && item.children.length > 0) {
const res = this.getDeptCode(item.children, deptId)
// 递归有结果就直接返回,不再继续循环
if (res) {
return res
}
}
}
// 整棵树没找到返回null
return null
},
//上传头像 //上传头像
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {