first commit
This commit is contained in:
@@ -0,0 +1,261 @@
|
||||
const addUser = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog title="添加用户" :visible.sync="visible" width="80%">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入姓名"
|
||||
style="width: 100%" v-model="pageForm.userName">
|
||||
</el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="工号">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入工号"
|
||||
style="width: 100%" v-model="pageForm.loginName">
|
||||
</el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
|
||||
<el-option :key="sex" :label="sex" :value="sex"
|
||||
v-for="sex in sexOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生日期">
|
||||
<el-date-picker
|
||||
v-model="pageForm.birthday"
|
||||
type="date"
|
||||
placeholder="选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生月份">
|
||||
<el-select
|
||||
v-model="pageForm.birthMonths"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择出生月份"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="month in 12"
|
||||
:key="month"
|
||||
:label="month + '月'"
|
||||
:value="month">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会">
|
||||
<el-select clearable filterable placeholder="请选择所属工会"
|
||||
style="width: 100%"
|
||||
@change="unionIdChange"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unionOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择所属单位" style="width: 100%"
|
||||
v-model="pageForm.unitIds">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unitOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="人员类型:">
|
||||
<dict-select clearable code="USER_PERSON_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员类型"
|
||||
v-model="pageForm.personTypes"></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="编制类别:">
|
||||
<dict-select clearable code="USER_PREPARED_BY_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择编制类别"
|
||||
v-model="pageForm.preparedBys"></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="在职状态:">
|
||||
<dict-select clearable code="USER_STATE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员状态"
|
||||
v-model="pageForm.userStates"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="是否会员">
|
||||
<el-select clearable placeholder="请选择是否会员" style="width: 100%"
|
||||
v-model="pageForm.isMember">
|
||||
<el-option label="全部" :value="null"></el-option>
|
||||
<el-option label="是" :value="true"></el-option>
|
||||
<el-option label="否" :value="false"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-table :data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
v-loading="tableLoading"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
projectId: null,
|
||||
pageForm: {
|
||||
userName: null,
|
||||
loginName: null,
|
||||
sex: null,
|
||||
birthday: null,
|
||||
birthMonths: [],
|
||||
unionId: null,
|
||||
unitIds: [],
|
||||
personTypes: [],
|
||||
preparedBys: [],
|
||||
userStates: [],
|
||||
isMember: null
|
||||
},
|
||||
sexOptions: ["男", "女"],
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号" },
|
||||
{ prop: "username", label: "姓名" },
|
||||
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
|
||||
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(id) {
|
||||
this.visible = true
|
||||
this.resetPageForm()
|
||||
this.pageForm.projectId = id
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.pageData()
|
||||
},
|
||||
|
||||
resetPageForm() {
|
||||
this.$set(this.pageForm, "userName", null)
|
||||
this.$set(this.pageForm, "loginName", null)
|
||||
this.$set(this.pageForm, "sex", null)
|
||||
this.$set(this.pageForm, "birthday", null)
|
||||
this.$set(this.pageForm, "birthMonths", [])
|
||||
this.$set(this.pageForm, "unionId", null)
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.$set(this.pageForm, "personTypes", [])
|
||||
this.$set(this.pageForm, "preparedBys", [])
|
||||
this.$set(this.pageForm, "userStates", [])
|
||||
this.$set(this.pageForm, "isMember", null)
|
||||
},
|
||||
|
||||
async unionIdChange(val) {
|
||||
if (val) {
|
||||
this.unitOptions = await this.$businessTool.listUnit(val)
|
||||
} else {
|
||||
this.pageForm.unitIds = []
|
||||
}
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/notWelfareUserPageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "数据保存中,请稍后...",
|
||||
spinner: "el-icon-loading"
|
||||
})
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/list/mange/addWelfareUser", {
|
||||
pageForm: JSON.stringify(this.pageForm),
|
||||
projectId: this.projectId
|
||||
})
|
||||
loading.close()
|
||||
if (code === 0) {
|
||||
this.$message.success(msg)
|
||||
this.visible = false
|
||||
this.$emit("refresh")
|
||||
} else {
|
||||
this.$message.error(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
let ADD_WELFARE_LIST_BY_SELECT = {
|
||||
template: `
|
||||
<div >
|
||||
<el-drawer :visible.sync="welfareListUserDrawer" direction="rtl" size="70%" title="">
|
||||
<div style="margin: 10px">
|
||||
<el-timeline>
|
||||
<el-timeline-item placement="top" timestamp="">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
style="width: 300px" v-model="pageForm.searchKeyword">
|
||||
<el-select slot="prepend" style="width: 80px;" v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
|
||||
</el-timeline-item>
|
||||
|
||||
<el-timeline-item placement="top" timestamp="">
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder" class="vi-table"
|
||||
ref="table" row-key="id" style="width: 100%"
|
||||
v-loading="tableLoading" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" :reserve-selection="true"></el-table-column>
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginname" sortable width="150px"></el-table-column>
|
||||
<el-table-column label="姓名" prop="username" sortable width="150px"></el-table-column>
|
||||
<el-table-column label="在职状态" prop="userState" sortable width="150px"></el-table-column>
|
||||
<el-table-column label="人事编制" prop="personType" sortable width="150px"></el-table-column>
|
||||
<el-table-column label="所在单位" prop="unitName" show-overflow-tooltip
|
||||
sortable></el-table-column>
|
||||
<el-table-column label="所在工会" prop="unionName" sortable></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<div style="display: flex;justify-content: flex-end">
|
||||
<el-button type="primary" @click="welfareListUserDrawer=false">关闭</el-button>
|
||||
<el-button type="primary" @click="doWelfareListUser">提交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
searchName: "username"
|
||||
},
|
||||
selectUserIds: [],
|
||||
welfareListUserDrawer: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.selectUserIds = val.map(v => v.id)
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post("/platform/welfare/list/mange/selectNotWelfareList", this.pageForm).then((res) => {
|
||||
this.tableLoading = false
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
})
|
||||
},
|
||||
selectNotWelfareList(id) {
|
||||
this.pageForm.id = id
|
||||
this.pageForm.searchKeyword = ""
|
||||
this.pageData()
|
||||
},
|
||||
async doWelfareListUser() {
|
||||
const confirm = await this.$confirm("确定要将当前选择的人加入到当前福利名单中吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.$axios.post("/platform/welfare/list/mange/doWelfareListUser", {
|
||||
ids: JSON.stringify(this.selectUserIds),
|
||||
id: this.pageForm.id
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
this.$emit("search")
|
||||
this.$refs.table.clearSelection()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
<!--#include("/platform/zhgh/welfare/addressManage/addressDialog.js"){}#-->
|
||||
let EDIT_WELFARE_DIALOG = {
|
||||
template: `
|
||||
<div>
|
||||
<el-dialog :visible.sync="exportWelfareListDialog" title="修改福利" width="50%">
|
||||
<el-form :model="editWelfareData" label-width="120px" ref="editWelfareForm">
|
||||
<el-form-item label="姓名">
|
||||
<el-input :value="editWelfareData.username" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号">
|
||||
<el-input :value="editWelfareData.loginname" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="福利"
|
||||
prop="optionIds">
|
||||
<el-row :gutter="10" :key="item.id" style="margin: 10px"
|
||||
v-for="(item,oidx) in welfareOptions">
|
||||
<el-col :span="12">
|
||||
<el-tag style="height:40px;line-height: 40px;width: 100%;">
|
||||
<span style="display: flex; justify-content: center;">{{item.optionName}}</span>
|
||||
</el-tag>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-input-number @change="numChange(item.selectNum,item,oidx)" :min="0"
|
||||
v-model="item.selectNum"></el-input-number>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择地址" style="color: red" v-if="ifReceiveAddress">
|
||||
<div style="display: flex; justify-content: space-between;column-gap: 20px">
|
||||
<div style="width: calc(100% - 126px)">
|
||||
<el-select @change="addressChange"
|
||||
filterable placeholder="请选择收货地址"
|
||||
style="width: 100%"
|
||||
v-model="editWelfareData.addressId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name+' '+item.defaultName"
|
||||
:value="item.id"
|
||||
v-for="item in addressOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-button
|
||||
@click="openAddress"
|
||||
type="primary">添加收货地址
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :rules="[{required:true,message:'选择收货地址后自动读取',trigger:['change','blur']}]"
|
||||
|
||||
label="收货地址"
|
||||
prop="receiveAddress"
|
||||
v-if="ifReceiveAddress">
|
||||
<el-input :rows="2" disabled placeholder="选择收货地址后自动读取" type="textarea"
|
||||
v-model="editWelfareData.receiveAddress"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="end" type="flex">
|
||||
<el-button @click="exportWelfareListDialog=false">取消</el-button>
|
||||
<el-button @click="doEditWelfareData" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<address-dialog ref="addressDialog" @select_user_address="selectUserAddress"></address-dialog>
|
||||
</div>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
addressOptions: [],
|
||||
userSelection: [],
|
||||
editWelfareData: {},
|
||||
ifReceiveAddress: false,
|
||||
exportWelfareListDialog: false,
|
||||
projectInfo: {},
|
||||
welfareOptions: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
welfare_options: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
project_type: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
"address-dialog": ADDRESS_DIALOG,
|
||||
},
|
||||
methods: {
|
||||
//数量更改
|
||||
numChange(value, option, optionIndex) {
|
||||
this.$nextTick(() => {
|
||||
// 查找+1按钮
|
||||
const plusButton = document.querySelector('.el-input-number__increase');
|
||||
// 添加点击事件监听器
|
||||
plusButton.addEventListener('click', this.handlePlusButtonClick(value, option, optionIndex));
|
||||
})
|
||||
},
|
||||
handlePlusButtonClick(value, option, optionIndex) {
|
||||
const {
|
||||
isCheckBox,
|
||||
multiSelectNum,
|
||||
singleOptionSupportMultipleSelection
|
||||
} = this.projectInfo
|
||||
if (isCheckBox === 'checkBox') {
|
||||
//判断是否支持单个多选
|
||||
if (!singleOptionSupportMultipleSelection && value > 1) {
|
||||
this.$set(this.welfareOptions[optionIndex], 'selectNum', 1)
|
||||
this.$message('此套餐最多只能选择1份');
|
||||
return;
|
||||
}
|
||||
}
|
||||
//获取用户当前选择的数量
|
||||
const selectNums = this.welfareOptions.map(v => v.selectNum)
|
||||
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
|
||||
if (sum > multiSelectNum) {
|
||||
this.$set(this.welfareOptions[optionIndex], 'selectNum', 0)
|
||||
this.$message('此次福利最多只能选择' + multiSelectNum + '份');
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
doEditWelfareData() {
|
||||
this.$refs['editWelfareForm'].validate(async valid => {
|
||||
if (valid) {
|
||||
//获取用户当前选择的数量
|
||||
const selectNums = this.welfareOptions.map(v => v.selectNum)
|
||||
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
|
||||
if (sum === 0) {
|
||||
this.notifyWarning("请先选择份数")
|
||||
return
|
||||
}
|
||||
const resp = await this.$axios.post("/platform/welfare/list/mange/doEditWelfareData", {
|
||||
editWelfareData: JSON.stringify(this.editWelfareData),
|
||||
welfareOptions: JSON.stringify(this.welfareOptions)
|
||||
})
|
||||
this.exportWelfareListDialog = false
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.$emit("doSearch")
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserSelection(id) {
|
||||
this.$axios.post('/platform/welfare/mine/getUserSelection', {
|
||||
projectId: this.editWelfareData.projectId,
|
||||
userId: id
|
||||
}).then(resp => {
|
||||
this.userSelection = resp.data
|
||||
this.echoUserSelection()
|
||||
})
|
||||
},
|
||||
echoUserSelection(){
|
||||
this.welfareOptions.map(v => {
|
||||
const selection = this.userSelection.find(u => u.selectOptionId === v.id)
|
||||
if (selection && selection.selectNum) {
|
||||
v.selectNum = selection.selectNum
|
||||
} else {
|
||||
v.selectNum = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
openEditWelfare(row, projectSelectOptions) {
|
||||
this.welfareOptions = this.welfare_options
|
||||
this.exportWelfareListDialog = true
|
||||
this.editWelfareData = {
|
||||
mobile: "",
|
||||
username: row.username,
|
||||
loginname: row.loginname,
|
||||
receiveAddress: row.receiveAddress,
|
||||
projectId: row.projectId,
|
||||
userId: row.id
|
||||
}
|
||||
this.projectInfo = projectSelectOptions.find(p => p.id === row.projectId)
|
||||
this.getUserSelection(row.id)
|
||||
this.selectUserAddress()
|
||||
this.optionIdsChange()
|
||||
},
|
||||
selectUserAddress() {
|
||||
this.$axios.post('/platform/welfare/addressManage/selectUserAddress', {userId: this.editWelfareData.userId}).then(resp => {
|
||||
resp.data.map(r => {
|
||||
let defaultName = r.isDefault ? "默认地址" : ""
|
||||
r.defaultName = defaultName
|
||||
r.name = "收货地址:" + r.province + r.city + r.county + r.addressDetail + ",收件人:" + r.userName + ",联系方式:" + r.tel
|
||||
})
|
||||
this.addressOptions = resp.data
|
||||
})
|
||||
},
|
||||
addressChange(val) {
|
||||
const address = this.addressOptions.find(a => a.id === val)
|
||||
if (address) {
|
||||
this.$set(this.editWelfareData, "receiveAddress", address.name)
|
||||
}
|
||||
},
|
||||
optionIdsChange() {
|
||||
if (this.project_type === 3) {
|
||||
this.ifReceiveAddress = true
|
||||
} else {
|
||||
this.editWelfareData.receiveAddress = null
|
||||
this.ifReceiveAddress = false
|
||||
}
|
||||
|
||||
},
|
||||
openAddress() {
|
||||
|
||||
this.$refs.addressDialog.dialogVisible = true
|
||||
this.$refs.addressDialog.formData = {userId: this.editWelfareData.userId}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
let IMPORT_COURIER_NUMBER_DIALOG = {
|
||||
template: `
|
||||
<div>
|
||||
<el-dialog :visible.sync="importExpressExcelDialog" title="导入快递单号" width="65%">
|
||||
<el-timeline>
|
||||
<el-timeline-item placement="top"
|
||||
timestamp="下载选择数据(提供给各供货商),如已下载可直接进行下一步选择导入。">
|
||||
<el-card shadow="never">
|
||||
<el-button @click="exportSelectData" icon="el-icon-download"
|
||||
size="medium"
|
||||
type="">下载选择数据
|
||||
</el-button>
|
||||
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item placement="top" timestamp="选择套餐供货商">
|
||||
<el-select style="width: 440px" v-model="importWelfareOptionId">
|
||||
<el-option :label="item.optionName" :value="item.id" :key="item.id"
|
||||
v-for="item in welfareOptions"></el-option>
|
||||
</el-select>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item placement="top" timestamp="导入供货商发货快递单号">
|
||||
<el-upload
|
||||
:action="'/platform/welfare/list/mange/importCourierNumber'"
|
||||
:auto-upload="false"
|
||||
:data="{
|
||||
projectId:projectId,
|
||||
optionId:importWelfareOptionId
|
||||
}"
|
||||
:file-list="importExpressExcelFile"
|
||||
:limit="1"
|
||||
:on-success="expressExcelHandleSuccess"
|
||||
drag
|
||||
ref="expressExcelUpload"
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传xls,xlsx文件</div>
|
||||
</el-upload>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<el-row justify="end" type="flex">
|
||||
<el-button @click="importExpressExcelDialog=false">取消</el-button>
|
||||
<el-button @click="doImportCourierNumber" type="primary">导入</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
importExpressExcelDialog: false,
|
||||
welfareOptions: [],
|
||||
importWelfareOptionId: "",
|
||||
projectId: "",
|
||||
importExpressExcelFile: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
exportSelectData() {
|
||||
this.$downLoad("/platform/welfare/list/mange/exportSelectData", {
|
||||
projectId: this.projectId
|
||||
})
|
||||
},
|
||||
expressExcelHandleSuccess(response, file, fileList) {
|
||||
if (response.code !== 0) {
|
||||
this.notifyWarning(response.msg)
|
||||
this.$refs.expressExcelUpload.clearFiles()
|
||||
} else {
|
||||
this.$message.success(response.msg)
|
||||
this.$refs.expressExcelUpload.clearFiles()
|
||||
this.importExpressExcelDialog = false
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
openImportExpressExcel(projectId, welfareOptions) {
|
||||
this.projectId = projectId
|
||||
this.welfareOptions = welfareOptions
|
||||
this.importExpressExcelDialog = true
|
||||
if (this.$refs.expressExcelUpload) {
|
||||
this.$refs.expressExcelUpload.clearFiles()
|
||||
}
|
||||
},
|
||||
doImportCourierNumber() {
|
||||
if (this.importWelfareOptionId == null || this.importWelfareOptionId === "") {
|
||||
this.$message.warning("请选择套餐供货商")
|
||||
return
|
||||
}
|
||||
if (this.$refs.expressExcelUpload.uploadFiles.length === 0) {
|
||||
this.$message.warning("请选择快递单号文件")
|
||||
return
|
||||
}
|
||||
const formData = new FormData()
|
||||
formData.append("file", this.$refs.expressExcelUpload.uploadFiles[0].raw, this.$refs.expressExcelUpload.uploadFiles[0].name)
|
||||
formData.append("projectId", this.projectId)
|
||||
formData.append("optionId", this.importWelfareOptionId)
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/importCourierNumber", formData, {})
|
||||
.then((response) => {
|
||||
if (response.code === 0) {
|
||||
this.$message.success("导入成功")
|
||||
this.importExpressExcelDialog = false
|
||||
} else {
|
||||
this.$message.warning(response.msg)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message.warning("导入失败,请联系管理员")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="请选择年度"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
@change="getWelfareList"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="福利项目">
|
||||
<el-select :clearable="false" filterable placeholder="请选择福利项目" style="width: 100%" v-model="pageForm.projectId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in projectSelectOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="姓名">
|
||||
<el-input
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable
|
||||
placeholder="请输入姓名"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userName"
|
||||
></el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="工号">
|
||||
<el-input
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable
|
||||
placeholder="请输入工号"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.loginName"
|
||||
></el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
|
||||
<el-option :key="sex" :label="sex" :value="sex" v-for="sex in sexOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生日期">
|
||||
<el-date-picker
|
||||
v-model="pageForm.birthday"
|
||||
type="date"
|
||||
placeholder="选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生月份">
|
||||
<el-select v-model="pageForm.birthMonths" multiple collapse-tags placeholder="请选择出生月份" style="width: 100%">
|
||||
<el-option v-for="month in 12" :key="month" :label="month + '月'" :value="month"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会">
|
||||
<el-select clearable filterable placeholder="请选择所属工会" style="width: 100%" v-model="pageForm.unionId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择所属单位"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unitIds"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="人员类型:">
|
||||
<dict-select
|
||||
clearable
|
||||
code="USER_PERSON_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员类型"
|
||||
v-model="pageForm.personTypes"
|
||||
></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="编制类别:">
|
||||
<dict-select
|
||||
clearable
|
||||
code="USER_PREPARED_BY_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择编制类别"
|
||||
v-model="pageForm.preparedBys"
|
||||
></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="在职状态:">
|
||||
<dict-select
|
||||
clearable
|
||||
code="USER_STATE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员状态"
|
||||
v-model="pageForm.userStates"
|
||||
></dict-select>
|
||||
</search-item>
|
||||
|
||||
<!-- <search-item label="所选福利:">-->
|
||||
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
|
||||
<!-- <el-option :key="item.id" :label="item.optionName" :value="item.id" v-for="item in pageFormProject"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </search-item>-->
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="福利名单">
|
||||
<el-button :disabled="!pageForm.projectId" @click="openExport" icon="el-icon-download" size="small" type="primary">
|
||||
导出名单
|
||||
</el-button>
|
||||
<el-button :disabled="!pageForm.projectId" @click="openImport" icon="el-icon-document-add" size="small" type="primary">
|
||||
导入名单
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="!pageForm.projectId"
|
||||
@click="$refs.addUserRef.onOpen(pageForm.projectId)"
|
||||
icon="el-icon-document-add"
|
||||
size="small"
|
||||
type="primary"
|
||||
>
|
||||
添加人员
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='isChoose'">
|
||||
<span class="text-primary" v-if="row.isChoose">已选择</span>
|
||||
<span class="text-danger" v-else>未选择</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='gist_list'">{{row.gist_list?row.gist_list:'暂无'}}</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='userSign'">
|
||||
<el-image :src="row.userSign" fit="cover" style="height: 60px" v-if="row.userSign"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="$refs.updateRemarkRef.onOpen(row)" size="mini" type="primary">备注</el-button>
|
||||
<el-button @click="doDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="importDialog" title="福利名单导入" width="50%">
|
||||
<file-import
|
||||
ref="viewImport"
|
||||
temp_url="/platform/welfare/list/mange/downloadImport"
|
||||
post_url="/platform/welfare/list/mange/doImport"
|
||||
is_show_radio
|
||||
@flush="successImport"
|
||||
:business_id="pageForm.projectId"
|
||||
></file-import>
|
||||
</el-dialog>
|
||||
|
||||
<add_welfare_list_by_select ref="addWelfareListUser" @search="doSearch"></add_welfare_list_by_select>
|
||||
|
||||
<!--添加福利人员-->
|
||||
<add-user ref="addUserRef" @refresh="doSearch"></add-user>
|
||||
|
||||
<!--人员备注-->
|
||||
<update-remark ref="updateRemarkRef" @refresh="doSearch"></update-remark>
|
||||
|
||||
<!--导入福利名单-->
|
||||
<excel-import
|
||||
ref="excelImportRef"
|
||||
url="/platform/welfare/list/mange/importByExcel"
|
||||
template_url="/platform/welfare/list/mange/downloadTemplate"
|
||||
:visible.sync="showImportDialog"
|
||||
title="导入用户数据"
|
||||
width="700px"
|
||||
:extra_params="{projectId:pageForm.projectId}"
|
||||
></excel-import>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("importCourierNumberDialog.js"){}#-->
|
||||
<!--#include("addWelfareListBySelect.js"){}#-->
|
||||
<!--#include("addUser.js"){}#-->
|
||||
<!--#include("updateRemark.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
computed: {
|
||||
pageFormProject() {
|
||||
if (this.pageForm.projectId) {
|
||||
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
|
||||
if (projectInfo) {
|
||||
return projectInfo.optionList
|
||||
}
|
||||
return null
|
||||
}
|
||||
return null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
add_welfare_list_by_select: ADD_WELFARE_LIST_BY_SELECT,
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime()),
|
||||
"add-user": addUser,
|
||||
"update-remark": updateRemark
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
searchName: "username",
|
||||
year: new Date().getFullYear().toString()
|
||||
},
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
sexOptions: ["男", "女"],
|
||||
projectSelectOptions: [],
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号" },
|
||||
{ prop: "username", label: "姓名" },
|
||||
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
|
||||
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
||||
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
|
||||
{ prop: "remark", label: "备注", sortable: true }
|
||||
],
|
||||
|
||||
importData: { fileList: [], isfg: 1 },
|
||||
importLoading: false,
|
||||
importDialog: false,
|
||||
|
||||
welfareListUserDrawer: false,
|
||||
|
||||
showImportDialog: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 导出名单
|
||||
openExport() {
|
||||
this.$downLoad("/platform/welfare/list/mange/exportXlsx", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
})
|
||||
},
|
||||
|
||||
successImport() {
|
||||
this.doSearch()
|
||||
this.importDialog = false
|
||||
},
|
||||
|
||||
// 打开导入名单
|
||||
openImport() {
|
||||
this.importData = {
|
||||
isfg: 1,
|
||||
fileList: []
|
||||
}
|
||||
this.showImportDialog = true
|
||||
},
|
||||
doDelete(row) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/welfare/list/mange/delete", { id: row.id })
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
getWelfareList() {
|
||||
this.$axios.post("/platform/welfare/project/mange/getWelfareList", { year: this.pageForm.year }).then((res) => {
|
||||
this.projectSelectOptions = res.data
|
||||
if (res.data && res.data.length > 0) {
|
||||
this.$set(this.pageForm, "projectId", res.data[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "projectId", null)
|
||||
}
|
||||
this.doSearch()
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/pageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
})
|
||||
.then((res) => {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
})
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getWelfareList()
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,59 @@
|
||||
const updateRemark = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog title="修改备注" :visible.sync="visible">
|
||||
<el-form :model="formData" label-width="80px">
|
||||
<el-form-item label="姓名">
|
||||
<el-input :value="formData.username" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号">
|
||||
<el-input :value="formData.loginname" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位">
|
||||
<el-input :value="formData.welfareUnitName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分工会">
|
||||
<el-input :value="formData.welfareUnionName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="请填写备注" :maxlength="100" type="textarea" maxlength="100" show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
formData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.visible = true
|
||||
this.formData = { ...row }
|
||||
},
|
||||
onSubmit() {
|
||||
this.$confirm("您确定修改吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/updateRemark", {
|
||||
id: this.formData.id,
|
||||
remark: this.formData.remark
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.$emit("refresh")
|
||||
this.visible = false
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user