Files
UNION_NJUST/target/classes/views/platform/zgfw/condolence/index.html
T
2026-09-23 09:38:39 +08:00

436 lines
20 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
input[type="file"] {
display: none
}
.el-input-number input {
text-align: left !important;
}
.el-input-number__decrease, .el-input-number__increase {
display: none;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-date-picker
v-model="pageForm.year"
type="year"
value-format="yyyy" style="width: 150px"
placeholder="选择年">
</el-date-picker>
</div>
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 140px;">
<el-option label="慰问对象姓名" value="be.username"></el-option>
<el-option label="慰问对象工号" value="be.loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm.type" placeholder="请选择慰问类型" clearable>
<el-option v-for="item in typeOptions" :value="item.id"
:label="item.name+' ('+item.code+')'"></el-option>
</el-select>
</div>
<!-- <div class="btn-group tool-button">
<el-select v-model="pageForm.way" placeholder="请选择慰问方式" clearable>
<el-option
v-for="(v,k) in condolence.way"
:key="k"
:label="v"
:value="v">
</el-option>
</el-select>
</div>-->
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="nerver" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="120px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="慰问对象" prop="be_username" header-align="center"
align="center"></el-table-column>
<el-table-column label="慰问对象工号" prop="be_loginname" header-align="center"
align="center"></el-table-column>
<el-table-column label="申请人" prop="sqr_username" header-align="center"
align="center"></el-table-column>
<el-table-column show-overflow-tooltip label="所在工会" prop="be_unionname" header-align="center"
sortable
align="center"></el-table-column>
<el-table-column show-overflow-tooltip label="所在单位" prop="be_unitname" header-align="center"
sortable
align="center"></el-table-column>
<el-table-column header-align="center" label="联系方式" prop="be_user_mobile" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="慰问类型" prop="type_name" header-align="center" sortable
align="center"></el-table-column>
<el-table-column label="慰问方式" prop="way" header-align="center"
align="center"></el-table-column>
<!-- <el-table-column label="随从人员" prop="personnel" header-align="center" sortable
align="center"></el-table-column>-->
<el-table-column label="申请时间" prop="apply_time" header-align="center" sortable
align="center"></el-table-column>
<!-- <el-table-column label="审核人" prop="shrname" header-align="center"
show-overflow-tooltip align="center">
<template slot-scope="{row:{shrname}}">
{{shrname?shrname:'暂无'}}
</template>
</el-table-column>-->
<el-table-column align="center" prop="state_id" header-align="center" label="申请状态" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.state_color">{{scope.row.state_name}}</span>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
min-width="100px">
<template scope="{row}">
<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:row}">
查看
</el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'Print',data:row}">
阅览
</el-dropdown-item>-->
<el-dropdown-item :disabled="row.state_id>2000" :command="{type:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
:command="{type:'delete',data:row}">
删除
</el-dropdown-item>
<el-dropdown-item
:command="{type:'delete',data:row}"
:disabled="row.state_id!=2000"
v-else>
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<info ref="info"></info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
delNotesList: [],
tabLoading: false,
userLoading: false,
userOptions: [],
formData: {
hospital_stay: [],
goods: []
},
tableData: [],
typeOptions: [],
pageForm: {
searchName: "be.username",
year: new Date().getFullYear() + ""
},
serPayees: [],
userPayees: [],
formRules: {
be_user: [{required: true, message: '必填', trigger: ['blur', 'change']}],
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
disease_type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
way: [{required: true, message: '必填', trigger: ['blur', 'change']}],
money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
subDis: false,
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
'sign': httpVueLoader('/components/sign/sign.vue?v' + new Date().getTime()),
'info': httpVueLoader('/components/condolence/Info.vue'),
},
methods: {
async payeeChange() {
const payeeData = await this.getUserData(this.formData.payee);
if (this.formData.payee_bank_number === null) {
this.$set(this.formData, 'payee_bank_number', payeeData.bank_number)
}
},
async queryUser(query) {
const {data} = await $.get("/platform/fw/condolence/applyWrite/queryUser", {query})
return data
},
async userPayee(query) {
if (query) {
this.userLoading = true
const arr = await this.queryUser(query)
this.userPayees = arr
this.userLoading = false
}
},
blur() {
let num = 0
this.formData.goods.forEach(v => {
num += parseFloat(v.price)
})
this.$set(this.formData, "money", num)
},
async typeChange(id) {
const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id})
if (data) {
this.$set(this.formData, "money", data.money)
this.$set(this.formData, "way", data.way)
}
},
delNotesItem(scope) {
this.delNotesList.push(scope.row.id)
this.formData.goods.splice(scope.$index, 1)
},
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)
} else if (type == 'export') {
condolence.doExport(data.id)
} else if (type == 'Print') {
condolence.doPrint(data.id)
}
},
openView(row) {
const {id} = row
this.$refs.info.getInfo(id)
this.$refs.guava.view()
},
async doEdit() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.files = JSON.stringify(formData.files)
if (formData.hospital_stay) {
formData.hospital_stay_1 = formData.hospital_stay[0]
formData.hospital_stay_2 = formData.hospital_stay[1]
}
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(loc() + "/doEdit", {
data: JSON.stringify(formData),
sign: this.formData.manager_sign,
hospital_stay_1: formData.hospital_stay_1,
hospital_stay_2: formData.hospital_stay_2,
delNotesList: JSON.stringify(this.delNotesList)
})
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.$refs.guava.index()
}, (data, msg) => {
this.$message.error(msg);
})
}
});
},
async getUserData(userId) {
const {data} = await $.get("/platform/fw/condolence/apply/getUserData", {userId})
return data
},
async userChange(be_user) {
const userData = await this.getUserData(be_user);
this.$set(this.formData, 'sex', userData.sex)
this.$set(this.formData, 'birthday', userData.birthday)
this.$set(this.formData, 'idcard', userData.idcard)
},
async openEdit(row) {
const {id} = row
sublime.jumpPagePjax('/platform/fw/condolence/applyWrite?id=' + id)
// this.formData = {}
// this.$set(row, "editLoading", true)
// const resp = await $.get(loc() + "/findOne", {id})
// requestLaterFun(resp, async (v) => {
// condolence.toFormData(v)
// this.formData = v
// this.formData.hospital_stay = [v.starting_time, v.end_time]
// await this.userChange(v.be_user)
// await this.userPayee(v.payee_loginname)
// if (this.userPayees > 0) {
// this.$set(this.formData, 'payee', arr[0].id)
// }
// this.$refs.guava.edit()
// }, () => {
// this.$notify.error({
// title: '错误',
// message: '获取信息失败'
// });
// }, () => {
// this.$set(row, "editLoading", false)
// })
},
doDelete(row) {
const {id} = row
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
this.$set(row, "delLoading", true)
const resp = await $.post(loc() + "/doDelete", {id: id});
requestLaterMsgFun(vue, resp, async () => {
this.pageData()
}, () => {
}, () => {
this.$set(row, "delLoading", false)
})
}
}
});
},
async doAdd() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.sign = null
formData.hospital_time = formData.hospital_time.toString()
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(location.href + "/doAdd", {
data: JSON.stringify(formData),
sign: this.formData.sign
})
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.$refs.guava.index()
}, (data, msg) => {
this.$message.error(msg);
})
}
});
},
openAdd() {
this.formData = {
files: [],
hospital_time: [],
user_name: '${@shiro.getPrincipalProperty("username")}',
sex: '${@shiro.getPrincipalProperty("sex")}',
user_age: moment().diff(moment('${@shiro.getPrincipalProperty("birthday")}'), 'years'),
unit_name: '${@shiro.getPrincipalProperty("unit").getName()}',
mobile: '${@shiro.getPrincipalProperty("mobile")}',
}
const zzzt = '${@shiro.getPrincipalProperty("zzzt")}'
if (zzzt == '在职') {
this.$set(this.formData, "on_job", true)
} else if (zzzt == '退休') {
this.$set(this.formData, "on_job", false)
}
this.$refs.guava.edit()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
},
async getTypeOptions() {
const {code, data} = await $.get("/platform/condolence/type/getAll")
if (code == 0) {
this.typeOptions = data
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.pageData();
this.getTypeOptions()
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->