first commit

This commit is contained in:
2026-09-23 09:38:39 +08:00
commit 98a8b8cace
6257 changed files with 1266718 additions and 0 deletions
@@ -0,0 +1,147 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.table_fixed {
table-layout: fixed !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
placeholder="选择年度"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">项目名称:</div>
<div class="search-item-option">
<el-select v-model="pageForm.projectId" placeholder="请选择项目名称" filterable clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in projectList"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工&emsp;&emsp;会:</div>
<div class="search-item-option">
<el-select clearable filterable placeholder="请选择部门工会" style="width: 100%"
v-model="pageForm.unionId">
<el-option v-for="item in unionList" :label="item.unionname" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="登记台账">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
<template scope="{row}" v-if="column.prop === 'buyCount'">
<el-link @click="openView(row)" type="primary" :underline="false">{{ row.buyCount }}</el-link>
</template>
</el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<vi-title title="购买服装人员名单"></vi-title>
<el-table :data="buyClothesUserData">
<el-table-column label="姓名" prop="username" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="工号" prop="loginname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="性别" prop="sex" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="单位" prop="unitname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="所属工会" prop="unionname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="联系方式" prop="mobile" align="center" header-align="center" show-overflow-tooltip></el-table-column>
</el-table>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{label: '年度', prop: 'year'},
{label: '项目', prop: 'projectName'},
{label: '工会', prop: 'unionname'},
{label: '登记人', prop: 'username'},
{label: '购买人数', prop: 'buyCount'},
],
buyClothesUserData: [],
projectList: [],
unionList: [],
}
},
methods: {
async openView(row) {
const {id} = row
const resp = await $.get('/platform/clothing/record/findBuyClothesUser', {
projectId: row.projectId,
userId: row.userId
})
if (resp.code === 0) {
this.buyClothesUserData = clone(resp.data)
this.$refs['guava'].view()
}
},
//获取所有买服装的项目
async getBuyClothesProject() {
const {data} = await $.post('/platform/clothing/register/getBuyClothesProject')
return data
},
},
async created() {
this.projectList = await this.getBuyClothesProject()
this.unionList = await getUnion()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,233 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.table_fixed {
table-layout: fixed !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
placeholder="选择年度"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">项目名称:</div>
<div class="search-item-option">
<el-select v-model="pageForm.projectId" placeholder="请选择项目名称" filterable clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in projectList"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="登记记录">
<template #func>
<el-button @click="openAdd" size="medium" type="primary">服装登记</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
<template scope="{row}" v-if="column.prop === 'buyCount'">
<el-link @click="openView(row)" type="primary" :underline="false">{{ row.buyCount }}</el-link>
</template>
</el-table-column>
<el-table-column label="操作" width="300px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doExport(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 #view>
<vi-title title="购买服装人员名单"></vi-title>
<el-table :data="buyClothesUserData">
<el-table-column label="姓名" prop="username" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="工号" prop="loginname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="性别" prop="sex" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="单位" prop="unitname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="所属工会" prop="unionname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="联系方式" prop="mobile" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column v-if="note === 'edit'" label="操作" width="200px">
<template scope="{row}">
<el-button @click="deleteBuyUser(row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{label: '年度', prop: 'year'},
{label: '项目', prop: 'projectName'},
{label: '工会', prop: 'unionname'},
{label: '登记人', prop: 'username'},
{label: '购买人数', prop: 'buyCount'},
],
buyClothesUserData: [],
projectList: [],
note: '',
clickRow: {},
}
},
methods: {
async deleteBuyUser(row) {
const confirm = await this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + '/deleteBuyUser', {id: row.id})
if (resp.code === 0) {
this.notifySuccess("删除成功")
this.doSearch()
this.$refs['guava'].index()
} else {
this.notifyWarning(resp.msg)
}
}
},
openAdd() {
sublime.jumpPagePjax('/platform/clothing/register')
},
async openEdit(row) {
this.note = 'edit'
await this.commonView(row)
},
async openView(row) {
this.note = 'view'
await this.commonView(row)
},
async commonView(row) {
this.clickRow = row
const resp = await $.get('/platform/clothing/record/findBuyClothesUser', {
projectId: row.projectId,
userId: row.userId,
year: row.year,
})
if (resp.code === 0) {
this.buyClothesUserData = clone(resp.data)
this.$refs['guava'].view()
}
},
async doDelete(row) {
const confirm = await this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + '/doDelete', {
projectId: row.projectId,
year: row.year,
userId: row.userId,
})
if(resp.code === 0) {
this.notifySuccess("删除成功")
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
}
},
//获取所有买服装的项目
async getBuyClothesProject() {
const {data} = await $.post('/platform/clothing/register/getBuyClothesProject')
return data
},
doExport(row) {
const loading = this.$loading({
lock: true,
text: '正在努力导出中,感谢您的耐心等待!',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const param = {
year: row.year,
projectId: row.projectId,
userId: row.userId,
}
axios({
url: '/platform/clothing/record/doExport',
method: 'post',
params: param,
headers:{
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
},
responseType: 'blob',
}).then((res) => {
const { data, headers } = res
const fileName = headers['content-disposition'].replace(/\w+;filename=(.*)/, '$1')
// 此处当返回json文件时需要先对data进行JSON.stringify处理,其他类型文件不用做处理
//const blob = new Blob([JSON.stringify(data)], ...)
const blob = new Blob([data], {type: headers['content-type']})
let dom = document.createElement('a')
let url = window.URL.createObjectURL(blob)
dom.href = url
dom.download = decodeURI(fileName)
dom.style.display = 'none'
document.body.appendChild(dom)
dom.click()
dom.parentNode.removeChild(dom)
window.URL.revokeObjectURL(url)
loading.close();
}).catch((err) => {})
},
},
async created() {
this.projectList = await this.getBuyClothesProject()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,276 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-input-group {
width: auto;
}
.el-input {
width: auto;
}
.user_body .el-card__body {
height: 100%;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
placeholder="选择年度"
type="year" disabled
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">项目名称:</div>
<div class="search-item-option">
<el-select v-model="pageForm.projectId" placeholder="请选择项目名称" filterable
@change="doSearch" style="width: 100%">
<el-option
v-for="item in projectList"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">近两年内:</div>
<div class="search-item-option">
<el-radio-group @change="(val) => doSearch()" v-model="pageForm.isBuy">
<el-radio-button :label="true">已购买</el-radio-button>
<el-radio-button :label="false">未购买</el-radio-button>
</el-radio-group>
</div>
</div>
</div>
</el-card>
<el-card class="user_body" shadow="never" style="margin-top: 10px; height: calc(100vh - 170px);">
<tree-layout>
<template #tree>
<div style="padding: 0 20px;border-right: 2px solid rgb(240,240,240);">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText" clearable>
</el-input>
</div>
<el-tree :data="treeUnionList" ref="tree" :expand-on-click-node="false" class="v-tree"
:props="defaultProps"
default-expand-all
@node-click="handleNodeClick" :filter-node-method="filterNode"
highlight-current style="padding: 10px 0">
<div class="custom-tree-node" style="display: inline-block;"
slot-scope="{ node, data }">
<div v-if="node.level === 1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;
{{ data.unionname }}
</div>
<div v-if="node.level==2" style="font-size: 15px" :title="data.unionname" class="v-node">
<i class="el-icon-school"></i>
&nbsp; {{ data.unionname }}
</div>
</div>
</el-tree>
</template>
<template>
<div style="padding: 0px 20px">
<div>
<vi-title2 :title="(pageForm.isBuy ? '已购买' : '未购买') + '人员名单'">
<template slot="func">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 120px;">
<el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option>
</el-select>
</el-input>
<el-select @change="doSearch" filterable clearable v-model="pageForm.sex" placeholder="请选择性别">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</template>
</vi-title2>
</div>
<el-table ref="multipleTable" @selection-change="handleSelectionChange" :data="userData" max-height="600"
:row-key="(val) => val.id">
<el-table-column :reserve-selection="true" type="selection" width="55"></el-table-column>
<el-table-column label="姓名" prop="username" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="工号" prop="loginname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="性别" prop="sex" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="单位" prop="unitname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="所属工会" prop="unionname" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="联系方式" prop="mobile" align="center" header-align="center" show-overflow-tooltip></el-table-column>
</el-table>
<div style="display: flex; justify-content: space-between; margin-top: 6px">
<div> <!--#include("/layouts/pagination.html"){}#--></div>
<div>
<el-row justify="end" type="flex">
<el-button v-if="!pageForm.isBuy" @click="doHandler" type="primary">提交</el-button>
<el-button v-else @click="doHandler" type="danger">移除</el-button>
</el-row>
</div>
</div>
</div>
</template>
</tree-layout>
</el-card>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
data() {
return {
pageForm: {
year: moment().format('YYYY'),
isBuy: false,
searchName: 'u.username'
},
projectList: [],
userData: [],
userValue: [],
treeUnionList: [],
filterText: '',
defaultProps: {
children: 'childrens',
label: 'unionname',
disabled: 'disabled'
},
}
},
methods: {
handleSelectionChange(val) {
this.userValue = val.length > 0 ? val.map(o => o.id) : []
},
filterNode(value, data, node) {
if (!value || node.level === 1) return true;
return data.unionname.indexOf(value) !== -1
},
handleNodeClick(data, node) {
if (node.level === 1 && "${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" !== 'true') {
return
}
if (data) {
this.pageForm.unionId = data.unioncode
this.pageData()
}
},
async doHandler() {
if(!this.pageForm.projectId) {
this.notifyWarning('请选择项目!')
return
}
if(this.userValue.length === 0) {
this.notifyWarning('请选择人员!')
return
}
const confirm = await this.$confirm('您选择了' + this.userValue.length + '人, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post('/platform/clothing/register/doHandler', {
ids: JSON.stringify(this.userValue),
projectId: this.pageForm.projectId,
year: this.pageForm.year,
isBuy: this.pageForm.isBuy,
})
if(resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
}
},
doSearch() {
this.$refs.multipleTable.clearSelection()
this.pageData()
},
//查询人员名单
async pageData() {
const resp = await $.post('/platform/clothing/register/pageData', this.pageForm)
if (resp.code === 0) {
this.userData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.$message.error(resp.msg)
}
},
//获取所有买服装的项目
async getBuyClothesProject() {
const {data} = await $.post('/platform/clothing/register/getBuyClothesProject')
return data
},
async unionTree() {
const resp = await $.post('/platform/clothing/register/getTreeUnionList')
if(resp.code === 0) {
this.sysadmin = resp.data.sysadmin
this.treeUnionList = [resp.data]
if (this.sysadmin) {
this.handleNodeClick({unioncode: ''}, {level: 1})
} else {
let data;
if (resp.data.childrens === null || resp.data.childrens === undefined) {
data = {
unioncode: ''
}
} else {
data = {
unioncode: Array.isArray(resp.data.childrens) ? resp.data.childrens[0].unioncode : resp.data.childrens.unioncode
}
}
this.handleNodeClick(data, {
level: 2, data: data
})
}
}
},
},
async created() {
this.projectList = await this.getBuyClothesProject()
if (this.projectList && this.projectList.length > 0) {
this.pageForm.projectId = this.projectList[0].code
}
await this.unionTree()
this.pageData()
}
})
</script>
<!--#
}
#-->