疗休养
This commit is contained in:
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div style="padding: 20px 50px">
|
||||
<el-timeline>
|
||||
<el-timeline-item timestamp="下载模板" placement="top">
|
||||
<el-card>
|
||||
<el-button size="medium" style="width: 200px" @click="location.href = temp_url" icon="el-icon-download">下载模板</el-button>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item timestamp="上传文件" placement="top">
|
||||
<el-card>
|
||||
<el-form>
|
||||
<el-form-item label="请选择更新模式" v-if="is_show_radio">
|
||||
<el-radio-group v-model="importData.isFlag">
|
||||
<el-radio-button label="true">清空更新</el-radio-button>
|
||||
<el-radio-button label="false">追加</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-upload
|
||||
name="file"
|
||||
ref="upload"
|
||||
:on-remove="
|
||||
(file, fileList) => {
|
||||
importData.fileList = fileHandleRemove(file, fileList)
|
||||
importResult = {
|
||||
errorCount: 0,
|
||||
successCount: 0,
|
||||
totalCount: 0,
|
||||
errorList: []
|
||||
}
|
||||
}
|
||||
"
|
||||
:on-change="
|
||||
(file, fileList) => {
|
||||
importData.fileList = fileHandleChange(file, fileList, { type: ['xls', 'xlsx'] })
|
||||
}
|
||||
"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:file-list="importData.fileList"
|
||||
>
|
||||
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件</el-button>
|
||||
<div class="el-upload__tip" slot="tip" style="color: #f56c6c">只能上传 xls/xlsx 文件{{ "," + text }}</div>
|
||||
</el-upload>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item placement="top" timestamp="导入结果">
|
||||
<el-card shadow="never">
|
||||
<p>总记录数:{{ errorInfoData.totalCount }}</p>
|
||||
<p>
|
||||
成功数:
|
||||
<span class="text-success">{{ errorInfoData.successCount }}</span>
|
||||
</p>
|
||||
<p>
|
||||
错误数:
|
||||
<span class="text-danger">{{ errorInfoData.errorCount }}</span>
|
||||
</p>
|
||||
<el-link @click="exportErrors" type="primary" v-if="errorInfoData.errorCount > 0">下载错误记录</el-link>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<div style="text-align: right">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="$emit('flush')">关 闭</el-button>
|
||||
<el-button type="primary" @click="doImport">导 入</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
temp_url: { type: String },
|
||||
post_url: { type: String },
|
||||
project_id: { type: String, default: "" },
|
||||
text: { type: String, default: "" },
|
||||
is_show_radio: { type: Boolean, default: false }
|
||||
},
|
||||
mounted() {
|
||||
const s = document.createElement("script")
|
||||
s.type = "text/javascript"
|
||||
s.src = "/assets/platform/plugins/xlsx/xlsx.full.min.js"
|
||||
document.body.appendChild(s)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// importVisible: false,
|
||||
importLoading: false,
|
||||
importData: {
|
||||
fileList: [],
|
||||
isFlag: false
|
||||
},
|
||||
errorInfoData: {
|
||||
totalCount: 0,
|
||||
successCount: 0,
|
||||
errorCount: 0,
|
||||
errorList: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resetImportData() {
|
||||
this.importData = {
|
||||
fileList: [],
|
||||
isFlag: false
|
||||
}
|
||||
this.errorInfoData = {
|
||||
totalCount: 0,
|
||||
successCount: 0,
|
||||
errorCount: 0,
|
||||
errorList: 0
|
||||
}
|
||||
this.importLoading = false
|
||||
},
|
||||
doImport() {
|
||||
if (!this.importData.fileList || this.importData.fileList.length === 0) {
|
||||
this.$message.warning("请选择文件")
|
||||
return
|
||||
}
|
||||
const data = new FormData()
|
||||
data.append("isFlag", this.importData.isFlag)
|
||||
data.append("projectId", this.project_id)
|
||||
this.importData.fileList.forEach((val) => {
|
||||
data.append("file", val.raw, val.raw.name)
|
||||
})
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "导入中,请稍后...",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
url: this.post_url,
|
||||
type: "post",
|
||||
data: data,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: (data) => {
|
||||
loading.close()
|
||||
if (data.code === 0) {
|
||||
if (data.data) {
|
||||
this.errorInfoData = data.data
|
||||
this.$message.success("导入成功条数:" + data.data.successCount + ",错误条数:" + data.data.errorCount)
|
||||
if (this.errorInfoData.errorCount <= 0) {
|
||||
this.$emit("flush")
|
||||
}
|
||||
} else {
|
||||
this.importVisible = false
|
||||
this.$emit("flush")
|
||||
this.$message.success("导入成功")
|
||||
}
|
||||
} else {
|
||||
loading.close()
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
},
|
||||
error: (data) => {
|
||||
loading.close()
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
exportErrors() {
|
||||
const data = this.errorInfoData.errorList
|
||||
|
||||
// 创建工作簿
|
||||
const workbook = XLSX.utils.book_new()
|
||||
|
||||
// 创建工作表
|
||||
const worksheet = XLSX.utils.json_to_sheet(data)
|
||||
|
||||
// 将工作表添加到工作簿
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1")
|
||||
|
||||
// 将工作簿转换为二进制对象
|
||||
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" })
|
||||
|
||||
// 将二进制对象转换为Blob对象
|
||||
const blob = new Blob([excelBuffer], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" })
|
||||
|
||||
// 创建下载链接并设置相关属性
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement("a")
|
||||
link.href = url
|
||||
link.download = "错误记录.xlsx"
|
||||
|
||||
// 模拟点击下载链接
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
// 清理下载链接
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
},
|
||||
fileHandleRemove(file, fileList) {
|
||||
return fileList
|
||||
},
|
||||
fileHandleChange(file, fileList, { type, size }) {
|
||||
const removeFile = () => {
|
||||
fileList.splice(fileList.findIndex((v) => v === file))
|
||||
}
|
||||
|
||||
if (!file.size) {
|
||||
this.$notify.warning("您选择的是空文件!")
|
||||
removeFile()
|
||||
}
|
||||
|
||||
if (type && type.length && !type.includes(file.name.split(".").pop().toLowerCase())) {
|
||||
this.$notify.warning(`文件只能是 ${type.map((v) => v.toUpperCase()).join("/")} 格式!`)
|
||||
removeFile()
|
||||
}
|
||||
|
||||
if (size && !file.size < size) {
|
||||
this.$notify.warning(`文件大小不能超过 ${size / 1024 / 1024}MB!`)
|
||||
removeFile()
|
||||
}
|
||||
|
||||
return fileList
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-card__body {
|
||||
padding: 25px;
|
||||
}
|
||||
</style>
|
||||
+69
-1
@@ -21,7 +21,7 @@ layout("/layouts/platform.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<h3 style="color: rgb(24, 103, 176);font-family: Microsoft YaHei;">疗休养配置</h3>
|
||||
@@ -61,6 +61,7 @@ layout("/layouts/platform.html"){
|
||||
<el-form-item label="省外名额分配模式" prop="outsideQuotaMode">
|
||||
<el-radio-group v-model="formData.outsideQuotaMode" size="small">
|
||||
<el-radio label="fixedRatio" border>固定比例</el-radio>
|
||||
<el-radio label="fixedUser" border>固定人员</el-radio>
|
||||
<el-radio label="unionRatio" border>分工会名额</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
@@ -76,6 +77,16 @@ layout("/layouts/platform.html"){
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formData.outsideQuotaMode == 'fixedUser'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="导入人员" prop="outsideQuotaUser">
|
||||
<el-button @click="openImport" type="primary" size="small">导入人员</el-button>
|
||||
<el-button @click="showUser" type="primary" size="small">查看人员</el-button>
|
||||
<el-button @click="clearUser" type="danger" size="small">清空人员</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formData.outsideQuotaMode == 'unionRatio'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分工会名额分配" prop="unionLimit">
|
||||
@@ -250,6 +261,11 @@ layout("/layouts/platform.html"){
|
||||
<el-button type="primary" @click="deleteLotById">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<template #view>
|
||||
<show-user ref="showUserRef"></show-user>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
<drawer-user-scope
|
||||
@@ -324,9 +340,23 @@ layout("/layouts/platform.html"){
|
||||
<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="importDialog" title="导入省外名额人员" top="50px">
|
||||
<file-import
|
||||
ref="viewImport"
|
||||
temp_url="/platform/theRapyRecuperation/TheRapyConfig/downloadImportTemp"
|
||||
post_url="/platform/theRapyRecuperation/TheRapyConfig/doImport"
|
||||
is_show_radio
|
||||
@flush="successImport"
|
||||
></file-import>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("showCanApplyOutUser.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
@@ -415,12 +445,50 @@ layout("/layouts/platform.html"){
|
||||
unionUserNumCalc: [{}],
|
||||
unionUserNumOneKeyRatio: null,
|
||||
summaryCount: 0,
|
||||
|
||||
// 导入相关
|
||||
importDialog: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue?v=1.0.1'),
|
||||
'file-import': httpVueLoader('/components/plugins/FileImport.vue'),
|
||||
'show-user': SHOW_CAN_APPLY_OUT_USER
|
||||
},
|
||||
methods: {
|
||||
// 省外名额,固定人员分配相关
|
||||
openImport() {
|
||||
this.importDialog = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.viewImport.resetImportData()
|
||||
})
|
||||
},
|
||||
successImport() {
|
||||
this.importDialog = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs.viewImport.resetImportData()
|
||||
})
|
||||
},
|
||||
showUser(){
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.showUserRef.pageData()
|
||||
})
|
||||
},
|
||||
clearUser(){
|
||||
this.$confirm('您确定要清空省外名额人员吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post('/platform/theRapyRecuperation/TheRapyConfig/clearUser')
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 设置分工会比例相关==============================================start
|
||||
async doAllocationUnionRatio(){
|
||||
this.setUpUnionLimitDialog = true
|
||||
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
const SHOW_CAN_APPLY_OUT_USER = {
|
||||
template: /* language=HTML */ `
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input clearable placeholder="请输入姓名或工号查询" @key.enter="doSearch"
|
||||
v-model="pageForm.searchKeyword"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">组成单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unitId" style="width: 100%" filterable
|
||||
clearable @change="doSearch"
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in units"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">性别:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.sex" style="width: 100%" clearable
|
||||
placeholder="请选择">
|
||||
<el-option v-for="sex in sexOptions" :label="sex"
|
||||
:value="sex"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.userState"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
placeholder="在职状态"
|
||||
code="USER_STATE"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员类型:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.personType"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
placeholder="人员类型"
|
||||
code="PERSON_TYPE"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员性质:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.preparedBy"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
placeholder="人员性质"
|
||||
code="PREPARED_BY"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="数据列表" :app="this">
|
||||
<template #func>
|
||||
<el-button @click="openAddList" size="small" type="primary">添加人员</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" :size="tableSize" class="vi-table">
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
:label="column.label"
|
||||
:prop="column.prop" :width="column.width" min-width="100px">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-dialog :visible.sync="addListDialog" title="添加省外名额人员" width="50%" append-to-body>
|
||||
<el-form label-width="120px" ref="addForm">
|
||||
<el-form-item label="添加人员">
|
||||
<el-select
|
||||
v-model="userIds"
|
||||
value-key="id"
|
||||
filterable
|
||||
remote
|
||||
style="width: 100%"
|
||||
multiple
|
||||
reserve-keyword
|
||||
@change="$refs.userSelect.$children[1].clear()"
|
||||
ref="userSelect"
|
||||
placeholder="请输入工号或者姓名查询"
|
||||
:remote-method="queryNotListUsers">
|
||||
<el-option
|
||||
v-for="item in notListUsers"
|
||||
:key="item.id"
|
||||
:label="item.username+'-'+item.loginname+'-'+item.unitname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="end" type="flex">
|
||||
<el-button @click="addListDialog=false">取消</el-button>
|
||||
<el-button @click="doAddList" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data(){
|
||||
return {
|
||||
unions: [],
|
||||
units: [],
|
||||
sexOptions: ['男', '女'],
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
|
||||
{prop: 'mobile', label: '联系方式', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'preparedBy', label: '人员性质', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
],
|
||||
|
||||
// 添加人员相关
|
||||
userIds: [],
|
||||
addListDialog: false,
|
||||
notListUsers: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async queryNotListUsers(key){
|
||||
const resp = await $.post('/platform/theRapyRecuperation/TheRapyConfig/queryNotListUsers', {
|
||||
query: key
|
||||
})
|
||||
|
||||
if (resp.code === 0) {
|
||||
this.notListUsers = resp.data.list
|
||||
}
|
||||
},
|
||||
openAddList(){
|
||||
this.userIds = []
|
||||
this.addListDialog = true
|
||||
},
|
||||
doAddList(){
|
||||
this.$confirm('确定要添加吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/platform/theRapyRecuperation/TheRapyConfig/addList', {
|
||||
userIds: JSON.stringify(this.userIds)
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('添加成功')
|
||||
this.addListDialog = false
|
||||
this.notListUsers = []
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id){
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/theRapyRecuperation/TheRapyConfig/deleteCanApplyOutUser', {id: id}).then(async resp => {
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.$message.success('删除成功')
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await this.$axios.post('/platform/theRapyRecuperation/TheRapyConfig/getCanApplyOutUserPageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
}
|
||||
},
|
||||
},
|
||||
async created(){
|
||||
this.unions = await getUnionList(null)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user