This commit is contained in:
Paidax
2024-08-02 08:48:00 +08:00
parent 048a7c13b3
commit c2b5989e10
65 changed files with 8291 additions and 14 deletions
@@ -35,6 +35,9 @@ layout("/layouts/platform.html"){
:highlight-current-row="true"
:key="tableKey"
:load="loadChild"
:expand-row-keys="expandedRowKeysRenew"
@expand-change="handleExpandChange"
ref="tableData"
lazy
row-key="id"
style="width: 100%">
@@ -159,10 +162,10 @@ layout("/layouts/platform.html"){
tabindex="7" type="text" v-model="formData.icon"></el-input>
<span :class="formData.icon"></span>
</el-form-item>
<el-form-item label="操作指南" prop="description">
<!--<el-form-item label="操作指南" prop="description">
<file-upload :files.sync="formData.description" :max="1" :type="['doc','docx','pdf']">
</file-upload>
</el-form-item>
</el-form-item>-->
<el-form-item label="启用状态" prop="disabled">
<el-switch
active-color="#ff4949"
@@ -402,7 +405,10 @@ layout("/layouts/platform.html"){
}
}, "json");
}
}
},
// 保存展开状态的数组
expandedRowKeysRenew: [],
tableTreeRefreshTool:[],
}
},
methods: {
@@ -543,7 +549,7 @@ layout("/layouts/platform.html"){
type: 'success'
});
self.addDialogVisible = false;
self.initTreeTable();
self.loadChildByExpandedKeys();
} else {
self.$message({
message: data.msg,
@@ -569,7 +575,7 @@ layout("/layouts/platform.html"){
type: 'success'
});
self.editMenuDialogVisible = false;
self.initTreeTable();
self.loadChildByExpandedKeys();
} else {
self.$message({
message: data.msg,
@@ -592,7 +598,7 @@ layout("/layouts/platform.html"){
type: 'success'
});
self.editDataDialogVisible = false;
self.initTreeTable();
self.loadChildByExpandedKeys();
} else {
self.$message({
message: data.msg,
@@ -606,15 +612,23 @@ layout("/layouts/platform.html"){
initTreeTable: function () {
var self = this;
var url = base + "/platform/sys/menu/child";
// 在更新数据前保存当前的展开状态
$.post(url, {pid: "",menuName:this.menuName}, function (data) {
if (data.code == 0) {
if (data.code === 0) {
self.tableData = data.data;
self.tableKey = +new Date();
// 恢复展开状态
}
}, "json");
},
loadChild: function (tree, treeNode, resolve) {
// 在之前声明的全局变量中,增加一个key为 本条数据的id,id可替换为你数据中的任意唯一值
this.tableTreeRefreshTool[tree.id] = {}
// 重要!保存resolve方法,以便后续使用
this.tableTreeRefreshTool[tree.id].resolve = resolve
// 记录展开次数,具体作用后续介绍
this.tableTreeRefreshTool[tree.id].expandCount = 0
var url = base + "/platform/sys/menu/child";
$.post(url, {pid: tree.id}, function (data) {
if (data.code == 0) {
@@ -690,7 +704,7 @@ layout("/layouts/platform.html"){
message: data.msg,
type: 'success'
});
// self.initTreeTable();
self.loadChildByExpandedKeys();
} else {
self.$message({
message: data.msg,
@@ -702,8 +716,32 @@ layout("/layouts/platform.html"){
}
});
}
},
handleExpandChange(row, expanded) {
if ((row.parentId === '' || row.parentId == null) && !expanded) {
this.expandedRowKeysRenew = []
return
}
if (expanded) {
this.expandedRowKeysRenew.push(row.id)
} else {
const index = this.expandedRowKeysRenew.findIndex(v => v === row.id)
this.expandedRowKeysRenew.splice(index, 1)
}
},
loadChildByExpandedKeys() {
if (this.expandedRowKeysRenew && this.expandedRowKeysRenew.length > 0) {
this.expandedRowKeysRenew.forEach((v) => {
const curr = this.tableTreeRefreshTool[v]
// api请求
$.get('/platform/sys/menu/child', {pid: v}).then(res => {
curr.resolve(res.data)
})
})
} else {
this.initTreeTable()
}
}
},
created: function () {
this.initTreeTable();
@@ -0,0 +1,432 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-descriptions__table {
table-layout: fixed !important;
}
.el-descriptions-item__cell {
text-align: center !important;
}
</style>
<div id="app" v-cloak>
<guava>
<tree-layout style="height: calc(100vh - 70px)">
<template #tree>
<div style="padding: 20px;">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText">
</el-input>
</div>
<el-tree ref="tree" :data="treeData" class="v-tree" node-key="id"
:props="defaultProps"
default-expand-all :expand-on-click-node="false"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node"><i
class="el-icon-s-home"></i>&nbsp;
{{ data.unionname }}
</div>
<div v-if="node.level==2"
style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
<i class="el-icon-star-off" v-else></i>
&nbsp; {{ data.unionname }}
<span style="color: #f76c6c">{{ '(' + data.revelCount + ')'}}</span>
</div>
</div>
</el-tree>
</template>
<template>
<el-card shadow="never" style="margin: 0 10px">
<div class="btn-group tool-button">
<el-date-picker
placeholder="选择年度" style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
<div class="btn-group tool-button">
<el-input style="width: 250px;" placeholder="请输入类型名称查询" v-model="pageForm.revelName"></el-input>
</div>
<div class="btn-group tool-button">
<el-select clearable v-model="pageForm.typeId" filterable placeholder="请选择资料类型">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button type="primary" size="medium" @click="openAdd"><i
class="ti-plus"></i> 添加资料
</el-button>
</div>
</el-card>
<el-card shadow="never" style="margin:10px 10px 0 10px">
<vi-title2 title="资料列表"></vi-title2>
<el-table :data="tableData" @sort-change='pageOrder' height="626">
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column prop="revelName" label="资料名称"></el-table-column>
<el-table-column sortable prop="typeName" label="资料类型"></el-table-column>
<el-table-column sortable prop="username" label="上传人"></el-table-column>
<el-table-column sortable prop="unionName" label="工会"></el-table-column>
<el-table-column sortable prop="time" label="上传时间"></el-table-column>
<el-table-column prop="userOnline" label="操作" width="100px">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini"><i class="ti-settings"></i><span
class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}">
预览
</el-dropdown-item>
<el-dropdown-item
v-if="(${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')})"
:command="{type:'edit',data:scope.row}">
编辑
</el-dropdown-item>
<el-dropdown-item
v-if="(${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')})"
:command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</template>
</tree-layout>
</guava>
<el-dialog title="新建资料" :visible.sync="addDialogVisible">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-form-item label="上传人">
<el-input readonly value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
<el-form-item prop="revelName" label="资料名称">
<el-input placeholder="请填写工作资料名称" v-model="formData.revelName"></el-input>
</el-form-item>
<el-form-item prop="typeId" label="资料类型">
<el-select v-model="formData.typeId" placeholder="选择资料类型" style="width: 100%">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="files" label="附件上传">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
</el-form>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="编辑资料" :visible.sync="editDialogVisible">
<el-form :model="formData" ref="editForm" :rules="rules" label-width="100px">
<el-form-item label="上传人">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
<el-form-item prop="revelName" label="资料名称">
<el-input placeholder="请填写工作资料名称" v-model="formData.revelName"></el-input>
</el-form-item>
<el-form-item prop="typeId" label="资料类型">
<el-select v-model="formData.typeId" placeholder="选择资料类型" style="width: 100%">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="files" label="附件上传">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="资料阅览" :visible.sync="viewDialogVisible">
<el-descriptions class="margin-top" title="" :column="2" border>
<el-descriptions-item span="2">
<template slot="label">资料名称</template>
<div v-html="formData.revelName"></div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">上传人</template>
<div v-html="formData.username"></div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">上传时间</template>
<div v-html="formData.time"></div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">所属工会</template>
<div v-html="formData.unionName"></div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">资料类型</template>
<div v-html="formData.typeName"></div>
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">附件</template>
<div>
<file-upload :files.sync="formData.files" view></file-upload>
</div>
</el-descriptions-item>
</el-descriptions>
<span slot="footer" class="dialog-footer">
<el-button @click="viewDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: "#app",
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
},
data() {
return {
filterText: '',
treeData: [],
defaultProps: {
children: 'child',
label: 'unionname',
},
addDialogVisible: false,
editDialogVisible: false,
viewDialogVisible: false,
tableData: [],
jdhList: [],
typeList: [],
fileList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
},
formData: {},
rules: {
revelName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
typeId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
delFiles: [],
unionOptions: [],
checkData: {},
checkNode: {},
}
},
methods: {
async handleNodeClick(data, node) {
this.checkData = data
this.checkNode = node
await this.pageData()
},
filterNode(value, data, node) {
if (!value) return true;
return data.unionname.indexOf(value) !== -1
},
openView(row) {
const formData = clone(row)
formData.files = JSON.parse(formData.files || "[]")
this.formData = formData
this.viewDialogVisible = true
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'edit') {
this.openEdit(data)
} else if (type === 'delete') {
this.doDelete(data.id)
} else if (type === 'audit') {
this.doAudit(data.id)
}
},
doDelete(id) {
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const resp = await $.get(loc() + '/doDelete', {id: id})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.warning('操作失败')
}
})
},
doEdit() {
this.$refs.editForm.validate(async (valid) => {
if (valid) {
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post('/platform/wakeshome/data/revel/doEdit', formData)
loading.close()
if (resp.code === 0) {
this.editDialogVisible = false
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.warning('操作失败')
}
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.loadTree()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.pageData()
},
pageNumberChange(val) {
this.pageForm.pageNumber = val;
this.pageData()
},
pageSizeChange(val) {
this.pageForm.pageSize = val;
this.pageData()
},
async pageData() {
sublime.showLoadingbar()
this.pageForm.unionId = this.checkData.id
const resp = await $.post('/platform/wakeshome/data/revel/pageData', this.pageForm)
sublime.closeLoadingbar()
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
},
openEdit(obj) {
if (this.$refs["editForm"])
this.$refs["editForm"].resetFields()
const formData = clone(obj)
formData.files = JSON.parse(formData.files || "[]")
formData.ispass = formData.ispass === 1
this.formData = formData
this.editDialogVisible = true
},
openAdd() {
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
this.formData = {files: []}
this.addDialogVisible = true
},
doAdd() {
this.$refs.addForm.validate(async (valid) => {
if (valid) {
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post('/platform/wakeshome/data/revel/doAdd', formData)
loading.close()
if (resp.code === 0) {
this.addDialogVisible = false
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.warning('操作失败')
}
}
})
},
async loadTree() {
const res = await $.post('/platform/wakeshome/data/revel/getTreeData', this.pageForm)
if (res.code === 0) {
this.treeData = res.data
const isAdmin = "${@shiro.hasAnyRoles('sysadmin', 'A06')}" === 'true'
if (isAdmin) {
const data = res.data[0].children && res.data[0].children.length > 0 ? {id: res.data[0].children[0].id} : {id: ''}
await this.handleNodeClick({data}, {level: 2})
} else {
const data = res.data[0].children && res.data[0].children.length > 0 ? {id: res.data[0].children[0].id} : {id: ''}
await this.handleNodeClick(data, {level: 2})
}
}
},
async getAllWakesHomeDataType() {
const resp = await $.post('/platform/wakeshome/data/type/getAllWakesHomeDataType')
if (resp.code === 0) {
this.typeList = resp.data
}
},
},
async created() {
await this.getAllWakesHomeDataType()
this.loadTree()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,217 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">类型名称:</div>
<div class="search-item-option">
<el-input v-model="pageForm.typeName" placeholder="请输入类型名称" clearable></el-input>
</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 type="primary" size="small" @click="openAdd"><i class="ti-plus"></i> 新增工作资料类型
</el-button>
</template>
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder" v-loading="tableLoading"
: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" label="资料类型编码" prop="code"></el-table-column>
<el-table-column align="center" header-align="center" label="资料类型名称" prop="typeName"></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="150px">
<template scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini"><i class="ti-settings"></i><span
class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'top',data:scope.row}"
v-if="scope.row.serialNum!==1">
上移
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:scope.row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
<el-dropdown-item :command="{type:'bottom',data:scope.row}"
v-if="scope.row.serialNum!==pageForm.totalCount">
下移
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog title="新增工作资料类型" :visible.sync="addDialogVisible" width="40%">
<el-form :model="formData" ref="addForm" :rules="rules">
<el-form-item prop="code" label="类型编码">
<el-input v-model="formData.code" placeholder="请输入工作资料类型编码"></el-input>
</el-form-item>
<el-form-item prop="typeName" label="类型名称">
<el-input v-model="formData.typeName" placeholder="请输入工作资料类型名称"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="编辑工作资料类型" :visible.sync="editDialogVisible" width="40%">
<el-form :model="formData" ref="editForm" :rules="rules">
<el-form-item prop="code" label="类型编码">
<el-input v-model="formData.code" placeholder="请输入工作资料类型编码"></el-input>
</el-form-item>
<el-form-item prop="typeName" label="类型名称">
<el-input v-model="formData.typeName" placeholder="请输入工作资料类型名称"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data: {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
typeName: ''
},
addDialogVisible: false,
editDialogVisible: false,
formData: {},
rules: {
typeName: [{required: true, message: '请输入工作资料类型名称', trigger: ['change', 'blur']}],
code: [{required: true, message: '请输入工作资料类型编码', trigger: ['change', 'blur']}]
},
tableData: []
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type === 'top') {
this.rowChange(data, false)
} else if (type === 'edit') {
this.openEdit(data)
} else if (type === 'delete') {
this.doDelete(data.id)
} else if (type === 'bottom') {
this.rowChange(data, true)
}
},
async rowChange(row, toDown) {
const resp = await $.post('/platform/wakeshome/data/type/serialNumChange', {
id: row.id,
serialNum: row.serialNum,
toDown
})
if (resp.code === 0) {
this.doSearch()
}
},
openAdd() {
this.formData = {}
this.addDialogVisible = true
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
},
doAdd() {
this.$refs['addForm'].validate(async valid => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const resp = await $.post('/platform/wakeshome/data/type/doAdd', this.formData)
loading.close()
if (resp.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
}
})
},
openEdit(obj) {
this.formData = JSON.parse(JSON.stringify(obj))
this.editDialogVisible = true
},
doEdit() {
this.$refs['editForm'].validate(async valid => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post('/platform/wakeshome/data/type/doEdit', this.formData)
loading.close()
if (resp.code === 0) {
this.editDialogVisible = false
this.pageData()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
}
})
},
doDelete(id) {
this.$confirm('此操作将删除工作资料类型,确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post('/platform/wakeshome/data/type/doDelete', {id: id})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
})
}
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,156 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select, .el-form .el-date-editor {
width: 100%;
}
.el-divider {
background-color: #1867b0;
}
.el-divider__text {
color: #1867b0;
}
.w-e-text-container {
height: 250px !important;
}
</style>
<div id="app" v-clock>
<guava ref="guava">
<template>
<el-card shadow="never">
<template #header>
<el-row justify="space-between" type="flex">
<h3 style="color: rgb(24, 103, 176);">
{{id?'信息编辑':'信息填写'}}
</h3>
</el-row>
</template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form">
<vi-title title="职工建家申报信息"></vi-title>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="填报人" prop="username">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="填报人工号" prop="loginName">
<el-input readonly v-model="formData.loginName"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系方式" prop="mobile">
<el-input v-model="formData.mobile" maxlength="11"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="填报单位" prop="unionName">
<el-input readonly v-model="formData.unionName"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="填报时间" prop="applyTime">
<el-input readonly v-model="formData.applyTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="基层工会简况" prop="basicInformation">
<el-input type="textarea" v-model="formData.basicInformation" maxlength="500" show-word-limit></el-input>
</el-form-item>
</el-col>
</el-row>
<vi-title title="职工建家建设方案"></vi-title>
<el-form-item prop="constructionPlan">
<text-editor v-model="formData.constructionPlan"></text-editor>
</el-form-item>
</el-form>
<el-row class="mt10" justify="center" type="flex">
<el-button @click="doSave()" style="width: 200px" type="primary">保 存</el-button>
<el-button @click="doSubmit()" style="width: 200px" type="primary">提 交</el-button>
</el-row>
</el-card>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data:{
id: '',
formData: {},
formRules: {
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号格式', trigger: 'blur' }],
basicInformation: [{required: true, message: '必填', trigger: ['blur', 'change']}],
constructionPlan: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
},
methods:{
async doSave(){
const resp = await $.post('/platform/wakeshome/declaration/apply/doSave',this.formData)
if (resp.code === 0) {
this.$message.success('保存成功')
setTimeout(() => {
sublime.jumpPagePjax('/platform/wakeshome/declaration/mine')
}, 500)
} else {
this.$message.warning('操作失败')
}
},
async doSubmit(){
try {
const valid = await this.$refs.form.validate()
if (valid) {
const resp = await $.post('/platform/wakeshome/declaration/apply/doSubmit',this.formData)
if (resp.code === 0) {
this.$message.success('提交成功')
setTimeout(() => {
sublime.jumpPagePjax('/platform/wakeshome/declaration/mine')
}, 500)
} else {
this.$message.warning('操作失败')
}
}
} catch (e) {
this.$message.warning('操作失败')
}
},
async initFormData() {
if (!this.id) {
this.$set(this.formData, 'username', "${@shiro.getPrincipalProperty('username')}")
this.$set(this.formData, 'loginName', "${@shiro.getPrincipalProperty('loginname')}")
this.$set(this.formData, 'mobile', "${@shiro.getPrincipalProperty('mobile')}")
this.$set(this.formData, 'applyTime', moment().format('YYYY-MM-DD'))
this.$set(this.formData, 'unionName', "${@shiro.getPrincipalProperty('union').getUnionname()}")
} else {
const resp = await $.get('/platform/wakeshome/mine/getInfoById',{id:this.id})
if (resp.code === 0){
this.formData = resp.data
}
}
},
},
async created(){
this.id = GetQueryString("id")
this.initFormData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,170 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</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="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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">
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tableLoading" :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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop === 'applyDate'">
<span>{{ moment(row.applyDate).format('YYYY年MM月DD日') }}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="280px">
<template scope="{row}">
<el-button @click="openView(row)" v-if="!['10000'].includes(row.state) && row.state"
size="mini" type="primary">查看
</el-button>
<el-button @click="openView(row)" v-if="['10030'].includes(row.state) && row.state"
size="mini" type="primary">申报表导出
</el-button>
<el-button @click="openEdit(row)" v-if="['10000'].includes(row.state) || !row.state"
size="mini" type="primary">编辑
</el-button>
<el-button @click="doDelete(row)" v-if="['10000'].includes(row.state) || !row.state"
size="mini" type="danger">删除
</el-button>
<el-button @click="doDelete(row)"
v-if="!['10000'].includes(row.state) && row.state && (${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')})"
size="mini" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<wakes-info-apply ref="viewInfo"></wakes-info-apply>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
pageForm: {
isAudit: false,
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'unionName', label: '申报工会', sortable: true},
{prop: 'username', label: '申报人', sortable: true},
{prop: 'loginName', label: '申报人工号', sortable: true},
{prop: 'mobile', label: '联系方式', sortable: true},
{prop: 'basicInformation', label: '基本情况简介', sortable: true},
{prop: 'applyDate', label: '申报日期', sortable: true},
{prop: 'stateName', label: '审核状态', sortable: true},
],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'wakes-info-apply': httpVueLoader('/components/wakeshome/declaration/WakesHomeInfoApply.vue')
},
methods: {
openView(row) {
this.$refs.guava.view()
this.$refs.viewInfo.openView(row.id)
},
async doDelete(row) {
this.$confirm('确定删除该申报记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.get(loc() + '/doDelete', {id: row.id})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.pageData();
} else {
this.$message.warning(resp.msg)
}
})
},
openEdit(row) {
window.location.href = '/platform/wakeshome/declaration/apply?id=' + row.id;
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created() {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,241 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-clock>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</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="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tableLoading" :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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop === 'applyDate'">
<span>{{ moment(row.applyDate).format('YYYY年MM月DD日') }}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="150px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="openAudit(row)" v-if="['10010'].includes(row.state) || !row.state"
size="mini" type="primary">审核
</el-button>
<el-button @click="doRollBack(row.id)"
v-if="['10015','10020'].includes(row.state) || !row.state" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<wakes-info-apply ref="viewInfo"></wakes-info-apply>
</template>
<template #edit>
<wakes-info-apply ref="auditInfo">
<template #handle>
<el-tab-pane label="基层党组织审核" name="organizationAudit">
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input value="${@shiro.getPrincipalProperty('username')}"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="time" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-form-item prop="auditSign" label="审核签字">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
<el-button type="primary" @click="doReview(true)">通过</el-button>
</div>
</el-tab-pane>
</template>
</wakes-info-apply>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data: {
id:'',
unions:[],
pageForm:{
isAudit:false,
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'unionName', label: '申报工会', sortable: true},
{prop: 'username', label: '申报人', sortable: true},
{prop: 'loginName', label: '申报人工号', sortable: true},
{prop: 'mobile', label: '联系方式', sortable: true},
{prop: 'basicInformation', label: '基本情况简介', sortable: true},
{prop: 'applyDate', label: '申报日期', sortable: true},
{prop: 'stateName', label: '审核状态', sortable: true},
],
formRules: {
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
},
components: {
'wakes-info-apply': httpVueLoader('/components/wakeshome/declaration/WakesHomeInfoApply.vue')
},
methods: {
doReview(row){
this.$refs['form'].validate(valid => {
if (valid) {
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.formData.auditPass = row
const {code, msg} = await $.post(loc() + '/doAudit', {
audit: JSON.stringify(this.formData),
id: this.id,
isPass: row,
})
if (code === 0) {
this.pageData()
this.$message.success(msg)
this.$refs.guava.index()
} else {
this.$message.warning(msg)
}
})
}
})
},
openView(row){
this.$refs.guava.view()
this.$refs.viewInfo.openView(row.id)
},
openAudit(row){
this.formData={}
this.id = row.id
this.$set(this.formData, 'auditTime', moment().format('YYYY-MM-DD'))
this.$refs.guava.edit()
this.$refs.auditInfo.activeName = 'organizationAudit'
this.$refs.auditInfo.openView(row.id)
},
async doRollBack(id){
const confirm = await this.$confirm('确定要撤回该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ("confirm" === confirm) {
const resp = await $.get(loc() + '/doRollBack',{id:id})
if (resp.code === 0){
this.pageData();
this.$message.success(resp.msg)
}else {
this.$message.warning(resp.msg)
}
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created(){
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,240 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-clock>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</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="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tableLoading" :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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop === 'applyDate'">
<span>{{ moment(row.applyDate).format('YYYY年MM月DD日') }}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="150px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="openAudit(row)" v-if="['10020'].includes(row.state) || !row.state"
size="mini" type="primary">审核
</el-button>
<el-button @click="doRollBack(row.id)"
v-if="['10025','10030'].includes(row.state) || !row.state" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<wakes-info-apply ref="viewInfo"></wakes-info-apply>
</template>
<template #edit>
<wakes-info-apply ref="auditInfo">
<template #handle>
<el-tab-pane label="校工会审核" name="schoolAudit">
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input value="${@shiro.getPrincipalProperty('username')}"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="time" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-form-item prop="auditSign" label="审核签字">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
<el-button type="primary" @click="doReview(true)">通过</el-button>
</div>
</el-tab-pane>
</template>
</wakes-info-apply>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data: {
id:'',
unions:[],
pageForm:{
isAudit:false,
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'unionName', label: '申报工会', sortable: true},
{prop: 'username', label: '申报人', sortable: true},
{prop: 'loginName', label: '申报人工号', sortable: true},
{prop: 'mobile', label: '联系方式', sortable: true},
{prop: 'basicInformation', label: '基本情况简介', sortable: true},
{prop: 'applyDate', label: '申报日期', sortable: true},
{prop: 'stateName', label: '审核状态', sortable: true},
],
formRules: {
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
},
components: {
'wakes-info-apply': httpVueLoader('/components/wakeshome/declaration/WakesHomeInfoApply.vue')
},
methods: {
doReview(row){
this.$refs['form'].validate(valid => {
if (valid) {
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.formData.auditPass = row
const {code, msg} = await $.post(loc() + '/doAudit', {
audit: JSON.stringify(this.formData),
id: this.id
})
if (code === 0) {
this.pageData()
this.$message.success(msg)
this.$refs.guava.index()
} else {
this.$message.warning(msg)
}
})
}
})
},
openView(row){
this.$refs.guava.view()
this.$refs.viewInfo.openView(row.id)
},
openAudit(row){
this.formData={}
this.id = row.id
this.$set(this.formData, 'auditTime', moment().format('YYYY-MM-DD'))
this.$refs.guava.edit()
this.$refs.auditInfo.activeName = 'schoolAudit'
this.$refs.auditInfo.openView(row.id)
},
async doRollBack(id){
const confirm = await this.$confirm('确定要撤回该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ("confirm" === confirm) {
const resp = await $.get(loc() + '/doRollBack',{id:id})
if (resp.code === 0){
this.pageData();
this.$message.success(resp.msg)
}else {
this.$message.warning(resp.msg)
}
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created(){
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,340 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select, .el-form .el-date-editor {
width: 100%;
}
.el-divider {
background-color: #1867b0;
}
.el-divider__text {
color: #1867b0;
}
.w-e-text-container {
height: 250px !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<template #header>
<el-row justify="space-between" type="flex">
<h3 style="color: rgb(24, 103, 176);">
{{id?'信息编辑':'信息填写'}}
</h3>
</el-row>
</template>
<el-form :model="formData" :rules="formRules" label-width="100px" ref="AddForm">
<!-- <el-divider content-position="left">职工之家申请信息</el-divider>-->
<vi-title title="职工之家申请信息"></vi-title>
<el-row :gutter="20">
<el-col :lg="8" :sm="24">
<el-form-item label="填报人" prop="username">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :sm="24">
<el-form-item label="联系方式" prop="mobile">
<el-input v-model="formData.mobile"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :sm="24">
<el-form-item label="填报时间" prop="applyTime">
<el-input readonly v-model="formData.applyTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :lg="8" :sm="24">
<el-form-item label="填报类别" prop="category">
<el-radio-group v-model="formData.category" size="small" @change="doChangeCategory">
<el-radio label="校工会" border></el-radio>
<el-radio label="分工会" border></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="8" :sm="24">
<el-form-item label="填报单位" prop="unionName">
<el-input readonly v-model="formData.unionName"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-divider content-position="left">职工之家详细信息</el-divider>-->
<vi-title title="职工之家详细信息"></vi-title>
<el-row :gutter="20">
<el-col :lg="8" :sm="24">
<el-form-item label="创办时间" prop="foundTime">
<el-date-picker
v-model="formData.foundTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创办日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="8" :sm="24">
<el-form-item label="单位位置" prop="position">
<el-input placeholder="请填写单位位置" v-model="formData.position"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :sm="24">
<el-form-item label="单位面积" prop="area">
<el-input placeholder="请填写单位面积" v-model="formData.area"></el-input>
</el-form-item>
</el-col>
<el-col :lg="24" :sm="24">
<el-form-item label="单位信息" prop="details">
<el-input type="textarea" :rows="4"
placeholder="请填写单位信息"
v-model="formData.details"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-divider content-position="left">职工之家荣誉信息</el-divider>-->
<vi-title title="职工之家荣誉信息"></vi-title>
<el-row :gutter="20">
<el-col :lg="24" :sm="24">
<el-form-item class="is-required" label="获奖情况" prop="payStandard">
<el-button
@click="formData.awardInfo.push({awardTime:'',awardUnit:'',awardName:'',awardPic:''})"
icon="el-icon-plus" size="mini"
style="float: right;margin-bottom: 10px">
添加
</el-button>
<span style="color: red">说明:各奖项图片只能上传一张。</span>
<el-table
:data="formData.awardInfo"
border
v-fit-columns
size="mini"
style="width: 100%">
<el-table-column label="获奖日期" prop="awardTime">
<template scope="{row,$index}">
<el-form-item :prop="'awardInfo.'+$index+'.awardTime'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"
label-width="0">
<el-date-picker
v-model="row.awardTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择获奖日期">
</el-date-picker>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="获奖单位" prop="awardUnit">
<template scope="{row,$index}">
<el-form-item :prop="'awardInfo.'+$index+'.awardUnit'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"
label-width="0">
<el-input clearable maxlength="100" placeholder="请输入获奖单位"
v-model="row.awardUnit"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="奖项名称" prop="awardName">
<template slot-scope="{row,$index}">
<el-input clearable maxlength="100" placeholder="请输入奖项名称"
v-model="row.awardName"></el-input>
</template>
</el-table-column>
<el-table-column label="奖项照片" prop="awardPic">
<template scope="{row,$index}">
<image-upload :limit="1" v-model="row.awardPic"></image-upload>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="80">
<template slot-scope="scope">
<el-button :disabled="formData.awardInfo.length<=1"
@click="formData.awardInfo.splice(scope.$index,1)" circle
icon="el-icon-delete"
size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-row>
<!-- <el-divider content-position="left">职工之家材料上传</el-divider>-->
<vi-title title="职工之家材料上传"></vi-title>
<el-row gutter="20">
<el-col :lg="24" :sm="24">
<el-form-item required label="图片上传" prop="picFiles">
<file-upload :files.sync="formData.picFiles" card :max="10"
:type="['jpg', 'png', 'jpeg']">
<template #el-upload__tip>
</template>
</file-upload>
<div class="el-upload__tip">请上传jpg、png、jpeg格式的图片,最多不超过10张</div>
</el-form-item>
</el-col>
<el-col :lg="24" :sm="24">
<el-form-item required label="附件上传" prop="files">
<file-upload :files.sync="formData.files" card :max="10"
:type="['doc','docx','xls','xlsx','pdf','ppt','mp4', 'jpg', 'png', 'jpeg']">
<template #el-upload__tip>
</template>
</file-upload>
<div class="el-upload__tip">可上传照片、视频、文档等资料,视频只能上传MP4格式</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row class="mt10" v-if="disabled" justify="center" type="flex">
<el-button @click="doSave()" style="width: 300px" type="primary">保 存
</el-button>
<el-button @click="doSubmit()" style="width: 300px" type="primary">提 交
</el-button>
</el-row>
</el-card>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
id: '',
formRules: {
position: [{required: true, message: '必填', trigger: ['blur', 'change']}],
picFiles: [{required: true, message: '必填', trigger: ['blur', 'change']}],
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
formData: {
category: '分工会',
awardInfo: [{awardTime: '', awardUnit: '', awardName: '', awardPic: ''}]
},
disabled: false,
}
},
methods: {
async doSave() {
let postUrl = ''
if (this.formData.id) {
postUrl = '/platform/wakeshome/apply/doEdit'
} else {
postUrl = '/platform/wakeshome/apply/doAdd'
}
const formData = this.doJsonStr(this.formData)
formData.isSubmit = false;
const resp = await $.post(postUrl, formData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
setTimeout(() => {
sublime.jumpPagePjax('/platform/wakeshome/mine')
}, 500)
} else {
this.notifyWarning(resp.msg)
}
},
async doSubmit() {
try {
const valid = await this.$refs['AddForm'].validate()
if (valid) {
let postUrl = ''
if (this.formData.id) {
postUrl = '/platform/wakeshome/apply/doEdit'
} else {
postUrl = '/platform/wakeshome/apply/doAdd'
}
const formData = this.doJsonStr(this.formData)
formData.isSubmit = true
const resp = await $.post(postUrl, formData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
setTimeout(() => {
sublime.jumpPagePjax('/platform/wakeshome/mine')
}, 500)
} else {
this.notifyWarning(resp.msg)
}
}
} catch (e) {
console.log(e)
}
},
doChangeCategory() {
if (this.formData.category === '校工会') {
this.formData.unionName = '校工会'
this.formData.unionId = null
} else {
this.formData.unionName = "${@shiro.getPrincipalProperty('union').getUnionname()}"
this.formData.unionId = "${@shiro.getPrincipalProperty('union').getId()}"
}
},
async initFormData() {
if (!this.id) {
this.$set(this.formData, 'username', "${@shiro.getPrincipalProperty('username')}")
this.$set(this.formData, 'mobile', "${@shiro.getPrincipalProperty('mobile')}")
this.$set(this.formData, 'applyTime', moment().format('YYYY-MM-DD'))
this.$set(this.formData, 'unionName', "${@shiro.getPrincipalProperty('union').getUnionname()}")
} else {
const resp = await $.get('/platform/wakeshome/mine/getInfoById',{id:this.id})
if (resp.code === 0){
this.formData = {...resp.data}
}
}
},
doJsonStr(data) {
const formData = clone(data)
formData.awardInfo = JSON.stringify(this.formData.awardInfo)
formData.picFiles = JSON.stringify(this.formData.picFiles)
formData.files = JSON.stringify(this.formData.files)
return formData;
},
async validateApply(){
const resp = await $.get(loc() + '/validateApply')
if (resp.code === 0) {
this.disabled = true
} else {
this.disabled = false
this.$confirm('未获取到单位的建家申报记录,是否前往申报?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
setTimeout(() => {
sublime.jumpPagePjax('/platform/wakeshome/declaration/apply')
}, 500)
})
}
}
},
async created() {
this.id = GetQueryString("id")
this.initFormData()
await this.validateApply()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,235 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-row {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.el-row .el-card {
min-width: 100%;
height: 100%;
margin-right: 20px;
transition: all .5s;
}
.el-form-item {
margin-bottom: 0 !important;
}
.pagination-container {
margin-top: -3px;
margin-bottom: 30px;
}
.box-card {
.header {
min-height: 20px;
position: relative;
.label {
padding: 1px 6px;
background-color: #fdf0da;
font-size: 15px;
color: #f19901;
}
.header-label {
padding: 1px 6px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 200px;
}
.card-header-tag-blue {
position: absolute;
width: 68px;
height: 30px;
top: -14px;
right: -15px;
/*background-image: url("~@/assets/images/img_dpj_t.png");*/
display: inline-block;
}
.card-header-tag-green {
position: absolute;
width: 68px;
height: 30px;
top: -14px;
right: -15px;
/*background-image: url("~@/assets/images/img_ypj_t.png");*/
display: inline-block;
}
}
.footer {
font-size: 18px !important;
background-color: rgb(245, 247, 251);
display: flex;
height: 50px;
justify-content: space-evenly;
}
.card-label {
color: rgb(197, 197, 197);
margin-right: 8px;
width: 70px;
display: inline-block;
margin-bottom: 5px;
}
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</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="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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 type="primary" size="small">添加信息</el-button>-->
</template>
</table-tool>
<el-row :gutter="20" style="margin-right: 15px;margin-left: -5px" type="flex" v-loading="loading">
<el-col v-for="(item, index) in tableData" :key="index" :span="6" style="margin-top: 10px">
<el-card class="box-card" shadow="always" :body-style="{ padding: '0px' }">
<div slot="header" class="header">
<span class="label">{{item.unionName}}</span>
<div style="display:flex; align-items: center;color: #cccccc;margin-left: 20px">|</div>
<el-tooltip class="item" effect="dark" :content="item.position" placement="top-start">
<span class="header-label">位置:{{item.position}}</span>
</el-tooltip>
<!--<span class="header-label"></span>-->
</div>
<div style="margin: 15px">
<div>
<el-carousel height="150px">
<el-carousel-item v-for="o in item.picFiles" :key="item">
<el-image @click="PREVIEW_IMAGE(o.filepath)"
:src="CREATE_PREVIEW_URL(o.filepath)"
style="width: 100%;height: 100%"></el-image>
</el-carousel-item>
</el-carousel>
</div>
</div>
<div class="footer">
<div style="display: flex;align-items: center">
<span style="color: #18c8bd;font-size: 14px">面积:{{item.area}}(㎡)</span>
<div style="display:flex; align-items: center;color: #cccccc;margin: 0 10px">|</div>
<span style="color: #18c8bd;font-size: 14px">申报日期:{{item.applyTime}}</span>
</div>
<div style="display:flex; align-items: center;color: #cccccc">|</div>
<div style="display: flex;align-items: center">
<el-button type="text"
:style="item.status === '2' ? 'color: #18c8bd' : 'color: rgb(34, 125, 251)'"
style="color: #18c8bd"></el-button>
<el-button type="text" style="color: #18c8bd;" @click="openView(item.id)">查看
</el-button>
</div>
</div>
</el-card>
</el-col>
</el-row>
</el-card>
</template>
<template #view>
<wakes-info ref="viewInfo"></wakes-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
loading: false,
unions: [],
tableData: [],
pageForm: {
year: moment().format('YYYY'),
}
}
},
methods: {
openView(row) {
this.$refs.guava.view()
this.$refs.viewInfo.openView(row)
},
async pageData() {
const resp = await $.post(loc() + '/pageData', this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data
this.tableData.forEach(item => {
item.picFiles = JSON.parse(item.picFiles)
})
}
},
flushUnits() {
},
},
components: {
'wakes-info': httpVueLoader('/components/wakeshome/info/WakesHomeInfo.vue')
},
async created() {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.unions.unshift({id: '校工会', unionname: '校工会'})
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,151 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</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="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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">
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tableLoading" :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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="150px">
<template scope="{row}">
<el-button @click="openView(row)" v-if="![8100].includes(row.state) && row.state" size="mini" type="primary">查看</el-button>
<el-button @click="openEdit(row)" v-if="[8100].includes(row.state) || !row.state" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row)" v-if="[8100].includes(row.state) || !row.state" size="mini" type="danger">删除</el-button>
<el-button @click="doDelete(row)" v-if="![8100].includes(row.state) && row.state && (${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')})" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<wakes-info ref="viewInfo"></wakes-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el:'#app',
mixins:[initTableMixins],
data(){
return{
unions:[],
pageForm:{
isAudit:false,
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'unionName', label: '申报工会', sortable: true},
{prop: 'username', label: '申报人', sortable: true},
{prop: 'mobile', label: '联系方式', sortable: true},
{prop: 'position', label: '地址', sortable: true},
{prop: 'area', label: '面积', sortable: true},
{prop: 'foundTime', label: '创立时间', sortable: true},
{prop: 'applyTime', label: '申报日期', sortable: true},
{prop: 'stateName', label: '状态', sortable: true},
],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'wakes-info': httpVueLoader('/components/wakeshome/info/WakesHomeInfo.vue')
},
methods:{
openView(row){
this.$refs.guava.view()
this.$refs.viewInfo.openView(row.id)
},
async doDelete(row){
const resp = await $.get(loc() + '/doRemove',{id:row.id})
if (resp.code === 0){
this.notifySuccess(resp.msg)
this.pageData();
} else {
this.notifyWarning(resp.msg)
}
},
openEdit(row){
window.location.href = '/platform/wakeshome/apply?id=' + row.id;
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created(){
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
this.unions.unshift({id:'校工会',unionname:'校工会'})
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,242 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
@change="doSearch"
style="width: 100%"
placeholder="请选择年度">
</el-date-picker>
</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="doSearch"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tableLoading" :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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="150px">
<template scope="{row}">
<el-button @click="openView(row)" v-if="![8120].includes(row.state) && row.state" size="mini" type="primary">查看</el-button>
<el-button @click="openAudit(row)" v-if="[8120].includes(row.state) || !row.state" size="mini" type="primary">审核</el-button>
<el-button @click="doRollBack(row.id)" v-if="[8125,8130].includes(row.state) || !row.state" size="mini" type="danger">撤回</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<wakes-info ref="viewInfo"></wakes-info>
</template>
<template #edit>
<wakes-info ref="auditInfo">
<template #handle>
<el-tab-pane label="校工会审核" name="schoolAudit">
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input value="${@shiro.getPrincipalProperty('username')}"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="time" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<!-- <el-form-item prop="auditSign" label="审核签字">-->
<!-- <sign :qz.sync="formData.auditSign"></sign>-->
<!-- </el-form-item>-->
</el-form>
<div style="float: right;margin: 20px 0">
<el-button type="danger" @click="doReview(0)">
拒绝
</el-button>
<el-button type="primary" @click="doReview(1)">
通过
</el-button>
</div>
</el-tab-pane>
</template>
</wakes-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el:'#app',
mixins:[initTableMixins],
data(){
return{
id:'',
unions:[],
pageForm:{
isAudit:false,
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'unionName', label: '申报工会', sortable: true},
{prop: 'username', label: '申报人', sortable: true},
{prop: 'mobile', label: '联系方式', sortable: true},
{prop: 'position', label: '地址', sortable: true},
{prop: 'area', label: '面积', sortable: true},
{prop: 'foundTime', label: '创立时间', sortable: true},
{prop: 'applyTime', label: '申报日期', sortable: true},
{prop: 'stateName', label: '状态', sortable: true},
],
formRules: {
// auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'wakes-info': httpVueLoader('/components/wakeshome/info/WakesHomeInfo.vue')
},
methods:{
doReview(row){
this.$refs['form'].validate(valid => {
if (valid) {
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const {code, msg} = await $.post(loc() + '/doAudit', {
audit: JSON.stringify(this.formData),
id: this.id,
isPass: row,
})
if (code === 0) {
this.pageData()
this.notifySuccess(msg)
this.$refs.guava.index()
} else {
this.notifyWarning(msg)
}
})
}
})
},
openView(row){
this.$refs.guava.view()
this.$refs.viewInfo.openView(row.id)
},
openAudit(row){
this.formData={}
this.id = row.id
this.$set(this.formData, 'auditTime', moment().format('YYYY-MM-DD'))
this.$refs.guava.edit()
this.$refs.auditInfo.activeName = 'schoolAudit'
this.$refs.auditInfo.openView(row.id)
},
async doRollBack(id){
const confirm = await this.$confirm('确定要撤回该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ("confirm" === confirm) {
const resp = await $.get(loc() + '/doRollBack',{id:id})
if (resp.code === 0){
this.pageData();
this.notifySuccess(resp.msg)
}else {
this.notifyError(resp.msg)
}
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created(){
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.unions.unshift({id:'校工会',unionname:'校工会'})
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,318 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
height: 100%;
overflow-y: unset !important;
}
.el-form {
height: calc(100vh - 100px) !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:picker-options="pickerOptions"
v-model="pageForm.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">评议名称:</div>
<div class="search-item-option">
<el-input v-model="pageForm.assessment" placeholder="根据测评名称查询"></el-input>
</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="mt20">
<table-tool label="项目列表" :app="this">
<template #func>
<!--<el-button type="primary" size="small">添加信息</el-button>-->
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" width="300px"
sortable align="center">
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center"
show-overflow-tooltipalign="center"></el-table-column>
<el-table-column label="评测模式" prop="assessmentMode" header-align="center"
show-overflow-tooltipalign="center">
<template scope="{row}">
{{row.assessmentMode===1?'工会评家':'主席/副主席评家'}}
</template>
</el-table-column>
<el-table-column label="打分模式" prop="scoringMode" header-align="center"
show-overflow-tooltipalign="center">
<template scope="{row}">
{{row.scoringMode===1?'评分模式':'选择模式'}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="250px">
<template scope="scope">
<el-button size="mini" type="primary" @click="openView(scope.row.id)">
查看
</el-button>
<el-button size="mini" type="primary" @click="doReview(scope.row)">
去评测
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" style="float: right;margin-top: 5px;margin-left: 10px;" @click="doSaveOrSubmit('submit')">提交</el-button>
<!-- <el-button type="primary" plain style="float: right;margin-top: 5px" @click="doSaveOrSubmit('save')">保存</el-button>-->
</template>
<template #edit>
<el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<vi-title title="评议内容"></vi-title>
<el-form-item label="" label-width="0" v-for="o,idx in formData.nrs" :key="nr.id">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="o.content" readonly maxlength="30" style="width: 50%">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="o.bzs" style="width: 100%" border show-summary
:summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="100px">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly></el-input>
</template>
</el-table-column>
<template v-if="formData.scoringMode===1">
<el-table-column label="标准分" prop="score" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.resultScore" readonly></el-input>
</template>
</el-table-column>
<el-table-column label="评议分" prop="resultScore" header-align="center"
align="center" width="250px">
<template slot-scope="{row}">
<el-input v-model="row.resultScore" maxlength="4" @blur="changeScore(row)"
placeholder="请填写评议分"></el-input>
</template>
</el-table-column>
</template>
<template v-if="formData.scoringMode===2">
<el-table-column label="满意度" prop="resultScore" header-align="center"
align="center" width="250px">
<template slot-scope="{row}">
<el-radio-group v-model="row.resultScore" size="small">
<el-radio label="满意">满意</el-radio>
<el-radio label="基本满意">基本满意</el-radio>
<el-radio label="不满意">不满意</el-radio>
</el-radio-group>
</template>
</el-table-column>
</template>
</el-table>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
<el-input type="textarea" :rows="2" maxlength="300" show-word-limit
v-model="o.remark" placeholder="请输入备注"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<template v-if="formData.scoringMode===2">
<el-form-item label="备注">
<el-input type="textarea" :rows="2" maxlength="300" show-word-limit
v-model="presidentOpinions" placeholder="请输入备注"></el-input>
</el-form-item>
</template>
<template v-if="formData.reviewMode===1">
<el-form-item label="职工评家总结" prop="files">
<file-upload :files.sync="formData.files" card :max="3"
:type="['doc','docx','xls','xlsx','pdf', 'jpg', 'png', 'jpeg']">
<template #el-upload__tip>
<div class="el-upload__tip" slot="tip">
图片类请上传jpg/png/jpeg等格式,文档类请上传doc/docx/xls/xlsx/pdf等格式,最多上传3个文件
</div>
</template>
</file-upload>
</el-form-item>
</template>
</el-form>
</template>
<template #view>
<union-comment-zb :data="viewData" :is_view="true"></union-comment-zb>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tabLoading: false,
loading: true,
activeName: '1',
tableData: [],
formData: {},
viewData: {
nrs: [{
bzs: [{}]
}],
},
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
presidentOpinions:'',
isShowSubmit: true,
isReadOnly: true
}
},
components: {
'union-comment-zb': httpVueLoader('/components/wakeshome/review/UnionCommentZb.vue?v=' + moment(new Date()).unix()),
},
methods: {
changeScore(row) {
if (Number(row.score) < Number(row.resultScore)) {
row.resultScore = null;
this.$message.warning('评议分不能超过标准分');
}
},
async doReview(o){
//自评模式
if (o.reviewMode == 1 && !o.canJoin) {
this.$message.warning('您不在自评人员范围中');
return
}
const isExist = await getScopeUser(o.activityGroupId)
if ((o.commentTarget == 1 && !isExist) || (o.commentTarget == 3 && !o.canJoin)) {
this.$message.warning('您不在自评人员范围中');
return
}
const res = await $.get('/mobile/wakeshome/review/appraisal/isAssess',{id:o.id})
if (res.data > 0){
this.$message.warning('您已经填写过该评议,请点击评议结果可查看评议详情')
return
}
const resp = await $.get('/mobile/wakeshome/review/appraisal/getById',{id:o.id})
if (resp.code === 0) {
this.formData = resp.data
if (this.formData.assessmentMode === 2) {
this.formData.nrs.forEach(v => {
v.bzs.forEach(o => {
o.resultScore = '满意'
})
})
await this.getPresidents()
}
}
},
async getPresidents(){
const resp = await $.get('/mobile/wakeshome/review/appraisal/getPresidents')
if (resp.code === 0) {
this.userList = resp.data
this.userList.forEach(v => {
this.presidentList.push({value: v.id, text: v.presidents})
})
}
this.president = this.presidentList[0].value
await this.presidentChange();
},
async presidentChange() {
const resp = await $.get('/mobile/wakeshome/review/appraisal/isAssess', {
id: this.id,
evaluatedPersonId: this.president,
})
if (resp.data > 0) {
this.$message.warning('您已经评测过该主席(副主席),请在点击评议结果可查看评议信息,或更换主席(副主席)进行测评')
this.isShowSubmit = true;
this.isReadOnly = true
}
},
async openView(id) {
this.$refs.guava.view()
this.loading = true;
const {code, data, msg} = await $.get(loc() + '/edit', {id})
if (code === 0) {
this.viewData = data
}
this.loading = false;
},
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,202 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
overflow-y: unset !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-date-picker
:picker-options="pickerOptions"
v-model="pageForm.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-input v-model="pageForm.assessment" placeholder="根据测评名称查询"></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" width="300px"
sortable align="center">
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center"
show-overflow-tooltipalign="center"></el-table-column>
<el-table-column label="评测模式" prop="assessmentMode" header-align="center"
show-overflow-tooltipalign="center">
<template scope="{row}">
{{row.assessmentMode===1?'工会评家':'主席/副主席评家'}}
</template>
</el-table-column>
<el-table-column label="打分模式" prop="scoringMode" header-align="center"
show-overflow-tooltipalign="center">
<template scope="{row}">
{{row.scoringMode===1?'评分模式':'选择模式'}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="250px">
<template scope="scope">
<el-button size="mini" type="primary" @click="openView(scope.row.id)">
查看
</el-button>
<el-button size="mini" type="primary" @click="openEdit(scope.row.id)">
编辑
</el-button>
<el-button size="mini" type="danger" @click="doDelete(scope.row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" style="float: right;margin-top: 5px"
@click="doEdit()">提交
</el-button>
</template>
<template #edit>
<union-comment-zb :data="formData" @change="v=>{this.formData=v}"></union-comment-zb>
</template>
<template #view>
<union-comment-zb :data="viewData" :is_view="true"></union-comment-zb>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tabLoading: false,
loading: true,
activeName: '1',
tableData: [],
formData: {},
viewData: {
nrs: [{
bzs: [{}]
}],
},
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
components: {
'union-comment-zb': httpVueLoader('/components/wakeshome/review/UnionCommentZb.vue?v=' + moment(new Date()).unix()),
},
methods: {
async openEdit(id) {
const {code, data, msg} = await $.get(loc() + '/edit', {id})
if (code === 0) {
this.formData = data
if (this.formData.startTime && this.formData.endTime) {
this.formData.applyTime = [this.formData.startTime, this.formData.endTime]
}
this.$refs.guava.edit()
}
},
doEdit() {
$.post(loc() + "/doEdit", {kh_zb: JSON.stringify(this.formData)}, (res) => {
const {code, data, msg} = res
if (code == 0) {
this.$message({
message: msg,
type: 'success'
});
} else {
this.$message({
message: msg,
type: 'error'
});
}
this.$refs.guava.index()
this.pageData()
},
)
},
doDelete(id) {
this.$confirm('您确定要删除吗!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (a, b) => {
if ("confirm" == a) {//确认后再执行
$.post(loc() + "/delete", {id: id}, (data) => {
if (data.code === 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.pageData();
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
}
});
},
async openView(id) {
this.$refs.guava.view()
this.loading = true;
const {code, data, msg} = await $.get(loc() + '/edit', {id})
if (code == 0) {
this.viewData = data
}
this.loading = false;
},
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,413 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:picker-options="pickerOptions"
@change="getZbList"
style="width: 100%"
v-model="pageForm.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</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.zbId" placeholder="请选择评测名称" filterable
clearable
@change="doSearch();zbData = zbList.find(v => v.id === pageForm.zbId)"
style="width: 100%">
<el-option
v-for="item in zbList"
:key="item.id"
:label="item.annual+item.assessment"
: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 placeholder="所属工会" v-model="pageForm.unionId"
style="width: 100%;"
clearable
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
@change="doSearch"
filterable>
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-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="mt20">
<table-tool label="工会列表" :app="this">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
:size="tableSize"
v-loading="tableLoading" ref="table" 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 prop="userOnline" align="center" header-align="center" label="操作"
width="100px"
fixed="right">
<template scope="{row}">
<el-button plain size="mini" @click="openView(row)">
查看
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">工号/姓名:</div>
<div class="search-item-option">
<el-input placeholder="请输入工号/姓名" v-model="userPageForm.searchKeyword">
<template slot="prepend">姓名/工号</template>
</el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-option">
<el-radio-group v-model="userPageForm.reviewResult"
@change="doUserSearch">
<el-radio-button label="">
全部
<span class="ml2">
{{reviewResultData.bmy+reviewResultData.jbmy+reviewResultData.my}}
</span>
</el-radio-button>
<el-radio-button label="满意">满意
<span class="ml2">{{reviewResultData.my}}</span>
</el-radio-button>
<el-radio-button label="基本满意">基本满意
<span class="ml2">{{reviewResultData.jbmy}}</span>
</el-radio-button>
<el-radio-button label="不满意">不满意
<span class="ml2">{{reviewResultData.bmy}}</span>
</el-radio-button>
</el-radio-group>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doUserSearch">搜索
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="userTableData" style="width: 100%" row-key="id"
:size="tableSize"
v-loading="tableLoading" ref="table" 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 userTableColumns"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
</el-table-column>
<el-table-column prop="evaluatedPersonName" align="center" show-overflow-tooltip
label="被测评人" v-if="zbData.assessmentMode==2"></el-table-column>
<el-table-column prop="presidentOpinions" align="center" show-overflow-tooltip
label="意见建议" v-if="zbData.assessmentMode==2"></el-table-column>
<el-table-column prop="reviewTime" align="center"
label="测评时间"></el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作"
width="100px"
fixed="right">
<template scope="{row}">
<el-button plain size="mini" @click="openUserView(row)">
查看
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="userPageSizeChange"
@current-change="userPageNumberChange"
:current-page="userPageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="userPageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="userPageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</template>
</guava>
<el-drawer
title=""
size="60%"
:visible.sync="userDrawer"
direction="rtl">
<el-form class="el_form" label-width="120px">
<el-row gutter="20">
<el-col :span="12" v-if="zpxx.zbxx.assessmentMode===2">
<el-form-item prop="evaluatedPersonName" label="被测评人姓名">
{{zpxx.commentPeo.evaluatedPersonName}}
</el-form-item>
</el-col>
<el-col :span="12" v-if="zpxx.zbxx.assessmentMode===2">
<el-form-item prop="evaluatedPersonName" label="现任职务">
{{zpxx.commentPeo.evaluatedPersonName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="evaluatedPersonName" label="测评结果">
{{zpxx.commentPeo.reviewResult}}
</el-form-item>
</el-col>
<el-col :span="24" v-if="zpxx.zbxx.assessmentMode===2">
<el-form-item prop="presidentOpinions" label="意见建议">
{{zpxx.commentPeo.presidentOpinions}}
</el-form-item>
</el-col>
</el-row>
<vi-title2 title="测评内容"></vi-title2>
<el-form-item label="" label-width="0" v-for="(nr,idx) in zpxx.zbxx.nrs">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" disabled maxlength="30"
style="width: 50%"
placeholder="请填写测评内容">
<template slot="prepend">
<span v-model="nr.contentNumber">{{ nr.contentNumber = idx + 1 }}</span>
</template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border
size="small">
<el-table-column align="center" header-align="center" label="序号"
type="index"
width="100px">
<template scope="{$index,row}">
{{ row.contentNumber = $index + 1 }}
</template>
</el-table-column>
<el-table-column label="测评标准" prop="inspection" header-align="center"
align="center">
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center"
align="center"
width="100px" v-if="zpxx.zbxx.scoringMode===1">
</el-table-column>
<el-table-column label="评分" prop="resultScore" header-align="center"
align="center"
width="100px">
</el-table-column>
<el-table-column label="意见建议" prop="options" header-align="center"
align="center"
width="100px" v-if="zpxx.zbxx.scoringMode===1">
</el-table-column>
</el-table>
</el-row>
<el-row class="mt10 mb10"
style="border-top: 1px dashed rgb(229, 225, 225)"></el-row>
</el-form-item>
</el-form>
</el-drawer>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userDrawer: false,
zbData: {},
zpxx: {
commentPeo: {},
zbxx: []
},
unions: [],
zbList: [],
pageForm: {
annual: new Date().getFullYear() + ''
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
tableColumns: [
{prop: 'unionName', label: '分工会名称'},
{prop: 'num', label: '测评人数'},
],
tableData: [],
userTableData: [],
userTableColumns: [
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位'},
{prop: 'reviewResult', label: '测评结果'},
],
userPageForm: {
reviewResult: "",
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
reviewResultData: {}
}
},
components: {},
methods: {
async getReviewResultNum(row) {
const res = await $.post(loc() + "/getReviewResultNum", {
zbId: this.userPageForm.zbId,
unionId: row.id
})
this.reviewResultData = res.data
},
async openUserView(row) {
const res = await $.post(loc() + "/getBzById", {peoId: row.id})
this.zpxx = res.data
this.userDrawer = true
},
doUserSearch() {
this.tableKey = new Date().getTime()
this.userPageForm.pageNumber = 1
this.userPageData()
},
userPageNumberChange(val) {
this.userPageForm.pageNumber = val;
this.userPageData();
},
userPageSizeChange(val) {
this.userPageForm.pageSize = val;
this.userPageData();
},
userPageData() {
sublime.showLoadingbar();
this.tableLoading = true
$.post(loc() + "/getUserPeoByZbIdOrUnionId", this.userPageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code == 0) {
this.userTableData = data.data.list;
this.userPageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
},
async openView(row) {
this.userPageForm.searchKeyword = ''
this.userPageForm.unionId = row.id
this.userPageForm.zbId = this.pageForm.zbId
this.userPageData()
await this.getReviewResultNum(row)
this.$refs.guava.view()
},
async getZbList() {
const res = await $.get("/platform/unionComment/Xjkhzb/getZbList", {year: this.pageForm.annual})
this.zbList = res.data
if (res.data && res.data.length > 0) {
this.$set(this.pageForm, "zbId", res.data[0].id)
} else {
this.$set(this.pageForm, "zbId", null)
}
this.doSearch()
},
},
async created() {
await this.getZbList()
this.unions = await getUnions(null)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,135 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-card__header {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<template #header>
<div>
<h3 style="color: #1867b0">新建考核指标</h3>
</div>
<div>
<el-button type="primary" @click="doAdd()">
提交
</el-button>
</div>
</template>
<template>
<union-comment-zb ref="unionZb" :data="formData" @change="v=>{this.formData=v}"></union-comment-zb>
</template>
</el-card>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
v: 'index',
formData: {},
}
},
components: {
'union-comment-zb': httpVueLoader('/components/wakeshome/review/UnionCommentZb.vue?v=' + moment(new Date()).unix()),
},
methods: {
async doAdd() {
const {
annual,
assessment,
assessmentMode,
scoringMode,
commentTarget,
activityGroupId
} = this.formData
let flag = true
if (!annual) {
this.$message.warning("年度不能为空")
return
}
if (!assessment) {
this.$message.warning("测评名称不能为空")
return
}
if (!scoringMode) {
this.$message.warning("打分模式不能为空")
return
}
if (!assessmentMode) {
this.$message.warning("评测模式不能为空")
return
}
if (!commentTarget) {
this.$message.warning("测评对象不能为空")
return
}
if (commentTarget == 1 && !activityGroupId) {
this.$message.warning("发送人员范围不能为空")
return
}
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (!nr.content) {
this.$message.error("测评内容不能为空")
flag = false;
throw Error()
} else if (!bz.inspection) {
this.$message.error("测评标准不能为空")
flag = false;
throw Error()
}
})
})
if (!(this.formData.applyTime && this.formData.applyTime.length > 0)) {
this.$message.warning('评议时间不能为空')
return
}
if (this.formData.commentTarget == 3 && !(this.formData.unionIds && this.formData.unionIds.length > 0)) {
this.$message.warning('请选择评议分工会')
return
}
if (flag) {
if (this.formData.applyTime && this.formData.applyTime.length > 0) {
this.formData.startTime = this.formData.applyTime[0]
this.formData.endTime = this.formData.applyTime[1]
}
const res = await $.post(loc() + "/doAdd", {kh_zb: JSON.stringify(this.formData)})
if (res.code === 0) {
this.$set(this.formData, "nrs", [{bzs: [{}]}])
this.$set(this.formData, "annual", null)
this.$set(this.formData, "assessment", null)
this.$set(this.formData, "assessmentMode", null)
this.$set(this.formData, "workersNum", null)
this.$set(this.formData, "scoringMode", null)
this.$set(this.formData, "activityGroupId", null)
this.$set(this.formData, "commentTarget", null)
this.$set(this.formData, "zbId", null)
this.$set(this.formData, "applyTime", undefined)
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
}
}
}
})
</script>
<!--#
}
#-->