365 lines
16 KiB
HTML
365 lines
16 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 placeholder="查询" slot="prepend" style="width: 100px;"
|
|
v-model="pageForm.searchName">
|
|
<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 filterable placeholder="请选择教代会" style="width:180px;" v-model="pageForm.teacherMeetId">
|
|
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
|
|
v-for="item in teacherMeets"></el-option>
|
|
</el-select>
|
|
</div>
|
|
<div class="btn-group tool-button">
|
|
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
|
|
</div>
|
|
|
|
<div class="btn-group tool-button pull-right offscreen-right">
|
|
<el-button @click="openPreselectionDialog" icon="el-icon-plus" size="medium" type="primary">预选
|
|
</el-button>
|
|
<el-button @click="doConfirmMany" icon="el-icon-plus" size="medium" type="primary">批量上报</el-button>
|
|
<el-button @click="doExport" icon="el-icon-download" size="medium" type="primary">导出</el-button>
|
|
</div>
|
|
</el-card>
|
|
|
|
<el-card class="mt20" shadow="never">
|
|
<el-table :data="tableData" @selection-change="(val)=>{tableSelections=val}" @sort-change='pageOrder'
|
|
ref="multipleTable">
|
|
<el-table-column
|
|
:selectable="(row)=>{return row.stateCode===0}"
|
|
type="selection"
|
|
width="55">
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="序号" type="index">
|
|
<template scope="scope">
|
|
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="姓名" prop="userName"
|
|
sortable></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="工号" prop="loginName"></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="性别" prop="sex"
|
|
sortable>
|
|
<template scope="{row}">
|
|
<el-select v-if="row.stateCode===0" v-model="row.sex">
|
|
<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 align="center" header-align="center" label="民族" prop="nation" width="100">
|
|
<template scope="{row}">
|
|
<el-select filterable v-if="row.stateCode===0" v-model="row.nation">
|
|
<el-option :key="n" :label="n" :value="n" v-for="n in nation"></el-option>
|
|
</el-select>
|
|
<span v-else>{{row.stateCode}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="政治面貌"
|
|
prop="politicalOutlook" show-overflow-tooltip>
|
|
<template scope="{row}">
|
|
<el-input maxlength="20" v-if="row.stateCode===0" v-model="row.politicalOutlook"></el-input>
|
|
<span v-else>{{row.politicalOutlook}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="学历" prop="education"
|
|
show-overflow-tooltip
|
|
width="150px">
|
|
<template scope="{row}">
|
|
<dict-select code="Education" v-if="row.stateCode===0"
|
|
v-model="row.education"></dict-select>
|
|
<span v-else>{{row.education}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="行政职务" prop="administrativeTitle"
|
|
width="100">
|
|
<template scope="{row}">
|
|
<el-input v-if="row.stateCode===0" v-model="row.administrativeTitle"></el-input>
|
|
<span v-else>{{row.administrativeTitle}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="技术职务" prop="technicalTitle"
|
|
width="100">
|
|
<template scope="{row}">
|
|
<el-input v-if="row.stateCode===0" v-model="row.technicalTitle"></el-input>
|
|
<span v-else>{{row.technicalTitle}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="年龄<=40" prop="age" width="80px">
|
|
<template scope="{row}">
|
|
<el-input v-if="row.stateCode===0" v-model="row.age"></el-input>
|
|
<span v-else>{{row.age}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="教学科研及双肩挑人员" prop="twoWork">
|
|
<template scope="{row}">
|
|
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
|
|
v-model="row.twoWork"></el-checkbox>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="教代会代表"
|
|
prop="isJdh">
|
|
<template scope="{row}">
|
|
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
|
|
v-model="row.isJdh"></el-checkbox>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="工代会代表" prop="isGdh">
|
|
<template scope="{row}">
|
|
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
|
|
v-model="row.isGdh"></el-checkbox>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column align="center" header-align="center" label="备注" prop="bz"
|
|
width="100">
|
|
<template scope="{row}">
|
|
<el-input v-if="row.stateCode===0" v-model="row.bz"></el-input>
|
|
<span v-else>{{row.bz}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column align="center" header-align="center" label="状态" prop="dbzt" sortable>
|
|
<template scope="{row}">
|
|
{{row.stateName}}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" label="操作" width="200">
|
|
<template slot-scope="{row}">
|
|
<el-button @click="doConfirm(row)" size="mini" type="primary" v-if="row.stateCode===0">上报
|
|
</el-button>
|
|
<el-button @click="doRevoke(row)" size="mini" type="warning" v-if="row.stateCode===100">撤回
|
|
</el-button>
|
|
<el-button @click="doDelete(row)" size="mini" type="danger" v-if="row.stateCode===0">删除
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-card>
|
|
</template>
|
|
|
|
</guava>
|
|
|
|
<el-dialog
|
|
:close-on-click-modal="false"
|
|
:visible.sync="dialogVisible"
|
|
title="添加人员"
|
|
width="45%"
|
|
>
|
|
<el-transfer
|
|
:data="userData"
|
|
:filter-method="filterMethod"
|
|
:props="{key: 'id',label: 'name'}"
|
|
:right-default-checked="rightChecked"
|
|
:titles="['可报人员名单', '当前选择']"
|
|
@change="rightChange"
|
|
@right-check-change="rightCheckChange"
|
|
filterable
|
|
ref="transfer"
|
|
v-model="userValue">
|
|
</el-transfer>
|
|
<span class="dialog-footer" slot="footer">
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="addPreselectionDb" type="primary">确 定</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: []
|
|
}
|
|
},
|
|
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
|
|
})
|
|
closeLoadingFunc(loading, resp, async () => {
|
|
this.pageData()
|
|
this.dialogVisible = false
|
|
}, (data, 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
|
|
},
|
|
|
|
},
|
|
components: {
|
|
'db-info': httpVueLoader('/components/jdh/dbinfo.vue'),
|
|
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue'),
|
|
},
|
|
async created() {
|
|
this.teacherMeets = await teacherMeet.getOpenJdh()
|
|
if (this.teacherMeets && this.teacherMeets.length > 0) this.$set(this.pageForm, "teacherMeetId", this.teacherMeets[0].id)
|
|
this.pageData()
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#-->
|
|
|