Files
UNION_NSI/target/classes/views/platform/theRapyRecuperation/process/lineAdjustment.html
T
2026-09-08 19:49:21 +08:00

373 lines
16 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.companion_card {
border: 1px #1867b0 solid;
}
.row-expand-cover .el-table__expand-icon {
visibility: hidden !important;
}
/*
.column-expand:before {
content: '123'
}*/
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
@change="doSearch"
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">线路:</div>
<div class="search-item-option">
<el-select @change="doSearch"
clearable
filterable
style="width: 100%"
v-model="pageForm.lineId">
<el-option :label="item.lineName"
:value="item.id"
v-for="item in schoolFreeLineList"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">关键字:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入内容"
style="width: 100%"
v-model="pageForm.keywords">
</el-input>
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item-label">分工会:</div>
<div class="search-item-option">
<el-select @change="doSearch"
clearable
filterable
style="width: 100%"
v-model="pageForm.unionId">
<el-option :key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionOptions"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="线路列表">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center"
header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
:width="column.width"
v-for="column in tableColumns"
>
<template scope="{row:{signUpMode}}" v-if="column.prop==='signUpMode'">
{{signUpModeName(signUpMode)}}
</template>
<template scope="{row:{createMode}}" v-else-if="column.prop==='createMode'">
{{createModeName(createMode)}}
</template>
<template scope="{row}" v-else-if="column.prop==='isDisabled'">
<el-switch
:active-value="false"
:inactive-value="true"
@change="(val)=>{lineStatusChange(row.id)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isDisabled">
</el-switch>
</template>
<template scope="{row}" v-else-if="column.prop==='signUpUserAndFamilyNum'">
<span class="text-primary">
{{row.signUpUserNum + row.signUpUserFamilyNum}}
</span>
</template>
<template scope="{row}" v-else-if="column.prop==='playTime'">
<template v-if="row.playStartTime">{{row.playStartTime + '至' + row.playEndTime}}</template>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<template scope="{row}">
<el-button @click="openViewSignUpUsers(row.id,row.unionId)" size="mini" type="primary">调整
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<vi-title2 title="报名人员">
<template #func>
<el-button @click="aKeyToAdjust" size="small" type="primary">一键调整
</el-button>
<el-button @click="smsAlerts" size="small" type="primary">短信提醒
</el-button>
</template>
</vi-title2>
<el-table :row-class-name="getRowClassName" :cell-class-name="getColumnClassName"
:data="schoolFreeSignUpUserList" ref="adjustTable">
<el-table-column :selectable="(row)=>{return row.isNormal}" type="selection"></el-table-column>
<el-table-column label="序号" type="expand" width="150px">
<template scope="{row}">
<el-card class="companion_card" shadow="never">
<h4 slot="header" style="color: #1867b0">
家属信息
</h4>
<el-table :data="row.companionList">
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
<el-table-column label="身份证号" prop="idCard"></el-table-column>
</el-table>
</el-card>
</template>
</el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="单位" prop="unitName" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="工会" prop="unionName" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="报名时间" prop="signingUptime"></el-table-column>
<el-table-column label="家属人数" prop="companionCount">
<template scope="{row}">
<span class="text-primary">
{{row.companionCount}}
</span>
</template>
</el-table-column>
<el-table-column label="是否调整" prop="isNormal">
<template scope="{row}">
<span class="text-success" v-if="row.isNormal">
未调整
</span>
<span class="text-danger" v-else>
已调整
</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button @click="adjustmentUser(row.loginName,row.isNormal)" size="mini" type="primary"
v-if="row.isNormal">调整
</el-button>
<el-button @click="adjustmentUser(row.loginName,row.isNormal)" size="mini" type="success"
v-if="!row.isNormal">恢复
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
data() {
return {
schoolFreeLineList: [],
pageForm: {
year: new Date().getFullYear().toString(),
lineId: null,
unionId: null
},
tableColumns: [
{label: '年度', prop: 'year', sortable: true},
{label: '线路名称', prop: 'lineName', sortable: true},
{label: '线路编号', prop: 'serialNumber', sortable: true},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true, width: '150px'},
{label: '所属分工会', prop: 'selectUnionName'},
{label: '出行时间', prop: 'playTime', sortable: true},
// {label: '创建工会', prop: 'createUnionName', sortable: true},
{label: '线路类型', prop: 'regionalNature', sortable: true},
// {label: '组织形式', prop: 'signUpMode', sortable: true},
{label: '创建模式', prop: 'createMode'},
// {label: '报名模式', prop: 'signUpMode'},
{label: '最少成团人数', prop: 'minimumGroupSize'},
{label: '报名人数(含家属)', prop: 'signUpUserAndFamilyNum', width: '150px'},
{label: '是否启用', prop: 'isDisabled', sortable: true}
],
schoolFreeSignUpUserList: [],
currentLineId: null,
currentLineSelectUnionId: null,
unionOptions: []
}
},
methods: {
getRowClassName({row, rowIndex}) {
if (row.companionCount === 0) {
return 'row-expand-cover'
}
},
getColumnClassName({row, column, rowIndex, columnIndex}) {
if (columnIndex === 1) {
document.styleSheets[0].insertRule('.column-expand' + rowIndex + ':before{content: "' + (rowIndex + 1) + '"; position: absolute; left: 60px}')
return 'column-expand' + rowIndex
}
},
async findUnionSignUpModeLineList() {
const {year} = this.pageForm
const resp = await $.post(loc() + '/findUnionSignUpModeLineList', year)
if (resp.code === 0) {
this.schoolFreeLineList = resp.data
}
},
createModeName(val) {
const d = this.createModeList.find(v => v.value === val)
return d ? d.label : null
},
signUpModeName(val) {
const d = this.signUpModeList.find(v => v.value === val)
return d ? d.label : null
},
async pageData() {
sublime.showLoadingbar()
this.tableLoading = true
const resp = await $.post(loc() + '/pageData', this.pageForm)
sublime.closeLoadingbar()
this.tableLoading = false
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.notifyWarning(resp.msg)
}
},
async openViewSignUpUsers(lineId, unionId) {
this.currentLineId = lineId
this.currentLineSelectUnionId = unionId
const resp = await $.post(loc() + '/findUnionSignUpModeUserList', {lineId, unionId})
if (resp.code === 0) {
if (this.$refs.guava.v !== 'edit') {
this.$refs.guava.edit()
}
this.schoolFreeSignUpUserList = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
//调整人员
async adjustmentUser(loginName, isNormal) {
const msg = isNormal ? '确定要调整吗?' : '确定要恢复吗?'
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const lineId = this.currentLineId
const resp = await $.post(loc() + '/adjustmentUser', {lineId, loginNames: JSON.stringify([loginName])})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.openViewSignUpUsers(this.currentLineId, this.currentLineSelectUnionId)
} else {
this.notifyWarning(resp.msg)
}
},
async aKeyToAdjust() {
if (this.$refs.adjustTable.selection.length === 0) {
this.notifyWarning('请选择需要调整的人员')
return
}
const confirm = await this.$confirm('您确定要一键调整吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const lineId = this.currentLineId
const selection = this.$refs.adjustTable.selection
const loginNames = selection.map(v => v.loginName)
const resp = await $.post(loc() + '/adjustmentUser', {lineId, loginNames: JSON.stringify(loginNames)})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.openViewSignUpUsers(this.currentLineId, this.currentLineSelectUnionId)
} else {
this.notifyWarning(resp.msg)
}
},
smsAlerts() {
},
async lineStatusChange(id) {
const resp = await $.post('/platform/theRapyRecuperation/line/openClosedLine/' + id)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
},
async created() {
this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode')
this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode')
this.unionOptions = await getUnions(null)
await this.findUnionSignUpModeLineList()
await this.pageData()
}
})
</script>
<!--#
}
#-->