Files
UNION_NSI/target/classes/views/platform/jdh/db/push.html
T
2026-09-08 19:49:21 +08:00

391 lines
18 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select {
width: 100% !important;
}
.wp-upload .wp-upload-button-select-file {
margin: 0 !important;
}
.el-transfer {
display: flex;
align-items: center;
}
.el-transfer-panel {
flex: 2.5;
}
.el-transfer__buttons {
flex: 1;
text-align: center;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select placeholder="请选择教代会" v-model="pageForm.teacherMeetId" filterable style="width:180px;">
<el-option v-for="item in teacherMeets" :label="item.jdhallname" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
<div class="btn-group tool-button pull-right offscreen-right">
<el-button type="primary" size="medium" icon="el-icon-plus" @click="openPreselectionDialog">预选
</el-button>
<el-button type="primary" size="medium" icon="el-icon-plus" @click="doConfirmMany">批量上报</el-button>
<el-button type="primary" size="medium" icon="el-icon-download" @click="doExport">导出</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" @sort-change='pageOrder' @selection-change="(val)=>{tableSelections=val}"
ref="multipleTable">
<el-table-column
:selectable="(row)=>{return row.stateCode===0}"
type="selection"
width="55">
</el-table-column>
<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 sortable label="姓名" prop="userName" header-align="center"
align="center"></el-table-column>
<el-table-column label="工号" prop="loginName" header-align="center" align="center"></el-table-column>
<el-table-column sortable label="性别" prop="sex" header-align="center"
align="center">
<template scope="{row}">
<el-select v-model="row.sex" v-if="row.stateCode===0">
<el-option value="男"></el-option>
<el-option value="女"></el-option>
</el-select>
<span v-else>{{row.sex}}</span>
</template>
</el-table-column>
<el-table-column label="民族" prop="nation" header-align="center" align="center" width="100">
<template scope="{row}">
<el-select filterable v-model="row.nation" v-if="row.stateCode===0">
<el-option v-for="n in nation" :key="n" :value="n" :label="n"></el-option>
</el-select>
<span v-else>{{row.nation}}</span>
</template>
</el-table-column>
<el-table-column label="政治面貌" prop="politicalOutlook" header-align="center"
align="center" show-overflow-tooltip>
<template scope="{row}">
<el-input maxlength="20" v-model="row.politicalOutlook" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.politicalOutlook}}</span>
</template>
</el-table-column>
<el-table-column label="学历" prop="education" header-align="center" align="center"
width="150px"
show-overflow-tooltip>
<template scope="{row}">
<dict-select v-model="row.education" code="Education"
v-if="row.stateCode===0"></dict-select>
<span v-else>{{row.education}}</span>
</template>
</el-table-column>
<el-table-column label="行政职务" prop="administrativeTitle" header-align="center" align="center"
width="100">
<template scope="{row}">
<el-input v-model="row.administrativeTitle" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.administrativeTitle}}</span>
</template>
</el-table-column>
<el-table-column label="专业技术职务" prop="technicalTitle" header-align="center" align="center"
width="200" show-overflow-tooltip>
<template scope="{row}">
<el-select v-model="row.technicalTitle" placeholder="请选择专业技术职务" v-if="row.stateCode===0">
<el-option-group
v-for="group in technicalTitleOptions"
:key="group.label"
:label="group.label">
<el-option
v-for="item in group.options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-option-group>
</el-select>
<!-- <dict-select v-model="row.technicalTitle" code="technical_position"-->
<!-- v-if="row.stateCode===0"></dict-select>-->
<!-- <el-input v-model="row.technicalTitle" v-if="row.stateCode===0"></el-input>-->
<span v-else>{{row.technicalTitle}}</span>
</template>
</el-table-column>
<el-table-column label="年龄<=40" prop="age" header-align="center" align="center" width="80px">
<template scope="{row}">
<el-input v-model="row.age" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.age}}</span>
</template>
</el-table-column>
<el-table-column label="教学科研及双肩挑人员" prop="twoWork" header-align="center" align="center">
<template scope="{row}">
<el-checkbox v-model="row.twoWork"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="教代会代表" prop="isJdh" header-align="center"
align="center">
<template scope="{row}">
<el-checkbox v-model="row.isJdh"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="工代会代表" prop="isGdh" header-align="center" align="center">
<template scope="{row}">
<el-checkbox v-model="row.isGdh"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="备注" prop="bz" header-align="center" align="center"
width="100">
<template scope="{row}">
<el-input v-model="row.bz" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.bz}}</span>
</template>
</el-table-column>
<el-table-column sortable label="状态" prop="dbzt" header-align="center" align="center">
<template scope="{row}">
{{row.stateName}}
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center" fixed="right">
<template slot-scope="{row}">
<el-button v-if="row.stateCode===0" size="mini" @click="doConfirm(row)" type="primary">上报
</el-button>
<el-button v-if="row.stateCode===100" size="mini" @click="doRevoke(row)" type="warning">撤回
</el-button>
<el-button v-if="row.stateCode===0" size="mini" @click="doDelete(row)" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
<el-dialog
title="添加人员"
:visible.sync="dialogVisible"
width="45%"
:close-on-click-modal="false"
>
<el-transfer
@right-check-change="rightCheckChange"
@change="rightChange"
ref="transfer"
:titles="['可报人员名单', '当前选择']"
filterable
:props="{key: 'id',label: 'name'}"
:filter-method="filterMethod"
:right-default-checked="rightChecked"
v-model="userValue"
:data="userData">
</el-transfer>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addPreselectionDb">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
searchName: "u.username",
teacherMeetId: null
},
userValue: [],
userData: [],
rightChecked: [],
dialogVisible: false,
teacherMeets: [],
tableData: [],
tableSelections: [],
technicalTitleOptions: []
}
},
methods: {
async doConfirmMany() {
if (this.tableSelections.length === 0) {
this.$notify.warning('请先勾选需要上报的代表!')
return
}
const keys = ['sex', 'nation', 'politicalOutlook', 'education', 'administrativeTitle', 'technicalTitle',
'age']
const flag = this.tableSelections.some(row => {
if (keys.some(v => row[v] === '' || row[v] == null)) {
this.$notify.warning('推选代表的信息不完整,请完善!')
return true
}
if (!row.isJdh && !row.isGdh) {
this.$notify.warning('请确认是教代会还是工代会代表!')
return true
}
return false
})
if (flag) {
return
}
const resp = await $.post(loc() + '/doCofirmMany', {data: JSON.stringify(this.tableSelections)})
this.doSearch()
this.$notify.success(resp.msg)
},
async doConfirm(row) {
const keys = ['sex', 'nation', 'politicalOutlook', 'education', 'administrativeTitle', 'technicalTitle',
'age']
if (keys.some(v => row[v] === '' || row[v] == null)) {
this.$notify.warning('推选代表的信息不完整,请完善!')
return
}
if (!row.isJdh && !row.isGdh) {
this.$notify.warning('请确认是教代会还是工代会代表!')
return;
}
const resp = await $.post(loc() + '/doUpdate', row)
this.doSearch()
this.$notify.success(resp.msg)
},
async doRevoke(row) {
const resp = await $.post(loc() + '/doRevoke', {id: row.id})
this.doSearch()
this.$notify.success(resp.msg)
},
async doDelete(row) {
const resp = await $.post(loc() + '/doDelete', {id: row.id})
this.doSearch()
this.$notify.success(resp.msg)
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
rightCheckChange(v, v2) {
this.rightChecked = v
},
filterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
async openPreselectionDialog() {
this.userValue = []
this.userData = []
const {data} = await $.get(loc() + "/getUnionUser", {teacherMeetId: this.pageForm.teacherMeetId})
data.userData.forEach(v => {
this.userData.push({id: v.id, name: v.username + "-" + v.loginname})
})
/* data.userValue.forEach(v => {
this.userValue.push(v.userId)
})*/
this.dialogVisible = true
},
async addPreselectionDb() {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.get(loc() + "/addPreselectionDb", {
userValue: JSON.stringify(this.userValue),
teacherMeetId: this.pageForm.teacherMeetId
})
loading.close()
if(resp.code===0){
this.pageData()
this.dialogVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
async pageData() {
const {data} = await $.get(loc() + '/pageData', this.pageForm)
data.forEach(v => {
v.jdhdb = v.dbzt === 2
})
this.tableData = data
},
rightChange(v) {
},
doExport() {
if (!this.pageForm.teacherMeetId) {
this.$notify({
title: '警告',
message: '请选择教代会',
type: 'warning'
});
return
}
location.href = '/platform/jdh/db/dbyl/doExport?jdhid=' + this.pageForm.teacherMeetId
},
async getTechnicalTitleOptions() {
const resp = await $.get(loc() + '/getTechnicalTitleOptions')
if (resp.code === 0) {
this.technicalTitleOptions = resp.data
}
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue'),
},
async created() {
await this.getTechnicalTitleOptions()
this.teacherMeets = await getAllMeeting()
if (this.teacherMeets && this.teacherMeets.length > 0) this.$set(this.pageForm, "teacherMeetId", this.teacherMeets[0].id)
this.pageData()
}
})
</script>
<!--#
}
#-->