Files
zhgh_hhu/target/classes/views/platform/jf/activitybx/reimbursement.html
T
2026-09-20 15:46:34 +08:00

719 lines
32 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-divider--horizontal {
margin-top: 80px;
margin-bottom: 40px;
}
.el-divider__text {
color: #409EFF !important;
}
.el-divider {
background-color: #409EFF !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template name="el-zoom-in-center">
<search :page_form.sync="pageForm" @search="doSearch">
<template #column>
<div class="btn-group tool-button">
<el-select @change="flushUnits" @clear="flushUnits"
clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</div>
</template>
</search>
<!--申请记录展示-->
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
style="width: 100%"
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 align="center" header-align="center" label="活动名称"
prop="activity_name">
<template scope="scope">
<el-link @click="openView(scope.row)" type="primary">
{{scope.row.activity_name}}
</el-link>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="申请人姓名"
prop="user_name"></el-table-column>
<el-table-column align="center" header-align="center" label="工号"
prop="bxr_loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="所属工会"
prop="bxr_unionname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="活动主体类型"
prop="activity_type" sortable>
<template scope="{row}">
{{ row.activity_type == 40002 ? "分工会活动" : row.activity_type == 40003 ?
"协会(社团)活动" :
"校工会活动"}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="活动项目类型"
prop="absName" sortable>
<template slot-scope="{row}">
{{row.absName}}({{row.projectTypeCode}})
</template>
</el-table-column>
<!-- <el-table-column align="center" header-align="center" label="申请类型" prop="apply_type"
sortable>
<template scope="{row}">
{{ row.apply_type == 1 ? "经费申报" : "报销申请" }}
</template>
</el-table-column>-->
<el-table-column align="center" header-align="center" label="申请时间"
prop="apply_time"
sortable></el-table-column>
<!-- <el-table-column label="审核人" prop="shrname" header-align="center"
align="center">
<template slot-scope="{row:{shrname}}">
{{shrname?shrname:'暂无'}}
</template>
</el-table-column>
-->
<el-table-column align="center" header-align="center" label="申请状态"
prop="state_id" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.state_color">{{scope.row.state_name}}</span>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作"
width="120px">
<template slot-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:'edit',data:row}"
v-if="[1020,1025].includes(row.state_id)">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'uploadResults',data:row}"
v-if="[1030].includes(row.state_id)">
上传成果
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}"
v-if="[1020].includes(row.state_id)">
删除
</el-dropdown-item>
<el-dropdown-item
:command="{type:'exportWwj',data:row,apply_type:1}"
v-if="row.state_id==1060&&row.apply_type!=2">
导出申请表
</el-dropdown-item>
<!-- <el-dropdown-item v-if="[1060].includes(row.state_id)"
:command="{type:'exportWwj',data:row,apply_type:2}">
导出报销表
</el-dropdown-item>-->
<!--# if(@shiro.hasRole('sysadmin')){ #-->
<!-- <el-dropdown-item :command="{type:'edit',data:row}"
v-if="![1020].includes(row.state_id)">
编辑
</el-dropdown-item>-->
<el-dropdown-item :command="{type:'delete',data:row}"
v-if="![1020].includes(row.state_id)">
删除
</el-dropdown-item>
<!--# } #-->
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-form label-width="100px">
<el-form-item class="view-header" label="填写申请信息&emsp;" label-position="top"
label-width="135px">
</el-form-item>
</el-form>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="申请人姓名" prop="user_name">
<el-input disabled type="text" v-model="formData.user_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系方式" prop="mobile">
<el-input type="text" v-model="formData.mobile"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="活动名称" prop="activity_name">
<el-input disabled v-model="formData.activity_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动类型" prop="activity_type">
<el-select placeholder="请选择活动主体类型" style="width: 100%"
v-model="formData.activity_type">
<el-option
:key="item.id"
:label="item.name+' ('+item.code+')'"
:value="item.code"
v-for="item in activityType">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="20" v-if="formData.apply_type==2">
<el-col :span="12">
<el-form-item label="活动人数" prop="venue">
<el-input placeholder="请输入活动人数" type="number"
v-model="formData.activity_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动地点" prop="venue">
<el-input placeholder="请输入活动地点" type="text"
v-model="formData.venue"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报销金额" prop="activity_money">
<el-input disabled placeholder="输入物品单价自动计算"
type="number"
v-model="formData.activity_money"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报销卡号" prop="activity_card_number">
<el-input type="number"
v-model="formData.activity_card_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动时间" prop="activity_time">
<el-date-picker disabled
placeholder="活动时间"
style="width: 100%" type="date"
v-model="formData.activity_time"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="20" v-if="formData.apply_type==1">
<el-col :span="12">
<el-form-item label="项目编号" prop="projectCode">
<el-input disabled placeholder="选择活动类型自动生成"
v-model="formData.projectCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="申报(承办)单位" prop="fundsUnitName">
<el-input placeholder="请输入申报(承办)单位" type="text"
v-model="formData.fundsUnitName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动计划时间" prop="plannedDate">
<el-input disabled v-model="formData.plannedDate"></el-input>
<!-- <el-date-picker style="width: 100%"
v-model="formData.plannedDate"
type="date" value-format="yyyy-MM-dd"
placeholder="活动计划时间" disabled>
</el-date-picker>-->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="申报金额" prop="funds_money">
<el-input disabled placeholder="输入物品单价自动计算"
type="number"
v-model="formData.funds_money"></el-input>
</el-form-item>
</el-col>
</el-row>
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">购置物品及价格</el-divider>
<div style="padding-left: 10px;padding-top:60px">
<el-tooltip class="item" content="点击添加购置物品及价格" effect="dark"
placement="top">
<el-button @click="formData.goods.push({})" circle icon="el-icon-plus"
type="primary"></el-button>
</el-tooltip>
</div>
</div>
<el-form-item label-width="0">
<el-table :data="formData.goods" border size="mini" style="width: 100%">
<el-table-column align="center" header-align="center" label="序号" sortable
type="index" width="100">
</el-table-column>
<el-table-column align="center" header-align="center" label="物品名称"
prop="name">
<template slot-scope="{row}">
<el-input maxlength="50" placeholder="物品名称" type="text"
v-model="row.name"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="预算费用"
prop="price">
<template slot-scope="{row}">
<el-input @input="blur" maxlength="50" placeholder="预算费用"
type="number" v-model="row.price"></el-input>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" fixed="right"
header-align="center"
label="操作"
width="80px">
<template slot-scope="scope">
<el-button :disabled="formData.goods.length==0"
@click="delNotesItem(scope)" circle
icon="el-icon-delete"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">{{formData.apply_type==1?'活动方案及简介':'活动内容'}}</span>
</el-divider>
<el-form-item class="is-required" label-width="auto" prop="activity_content">
<div id="acEditor"></div>
</el-form-item>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">附&emsp;&emsp;件</span>
</el-divider>
<el-form-item label-width="auto" prop="files">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">签&emsp;&emsp;字</span>
</el-divider>
<el-form-item label-width="auto" prop="sign">
<sign :qz.sync="formData.sign" prefix="medicalAid"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="formData.id?doEdit():doAdd()" type="primary">确 定</el-button>
</div>
</template>
<template #view>
<activity-bx-info ref="act_info"></activity-bx-info>
</template>
</guava>
<el-dialog
:visible.sync="dialogVisible"
title="成果提交"
width="30%">
<file-upload :files.sync="formData.files" card></file-upload>
<span class="dialog-footer" slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button @click="uploadResults" type="primary">提交</el-button>
</span>
</el-dialog>
</div>
<script>
let E = window.wangEditor
let acEditor = null
const vue = new Vue({
el: '#app',
data() {
let validAc = (rule, value, callback) => {
if (!this.formData.activity_content || !dd3s.html2txt(this.formData.activity_content)) {
callback(new Error('请填写活动内容'));
} else {
callback();
}
};
return {
activityType: [],
unions: [],
units: [],
delNotesList: [],
tabLoading: false,
tableData: [],
formData: {},
formSign: {},
pageForm: {
...getPageForm(),
searchName: "username",
year: new Date().getFullYear() + "",
activity_name: "activity_name",
},
formRules: {
activity_name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activity_number: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// activity_time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
venue: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activity_type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activity_content: [{validator: validAc, trigger: ['blur', 'change']}],
},
activity: [],
dialogVisible: false,
}
},
components: {
'search': httpVueLoader('/components/activityBx/ActivityBxSearch.vue'),
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue?v=' + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0')
},
methods: {
dropdownCommand(command) {
const {type, data, apply_type} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'uploadResults') {
this.openUploadResults(data)
} else if (type == 'delete') {
this.doDelete(data)
} else if (type == 'exportWwj') {
this.exportWwj(data, apply_type)
}
},
async uploadResults() {
if (!this.formData.files || this.formData.files.length === 0) {
this.$message.error("请上传成果后在提交");
return
}
const confirm = await this.$confirm("确定要提交成果吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post("/platform/jf/activity_bx/reimbursement/doEdit", {
files: JSON.stringify(this.formData.files),
id: this.formData.id
})
if (resp.code === 0) {
this.$message({
message: resp.msg,
type: 'success'
});
this.doSearch()
this.dialogVisible = false
}
}
},
openUploadResults(data) {
this.formData = data
this.dialogVisible = true
},
exportWwj(row, apply_type) {
const {id, activity_id, activity_type, otherFiles, photoFiles, billFiles} = row
/*let filesName = null
if (billFiles == undefined || JSON.parse(billFiles).length == 0) filesName = "发票"
if (filesName != null) {
this.$confirm('您没有上传' + filesName + '是否需要去上传', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let activityType = ""
if (activity_type == 40001) activityType = "/school?id="
if (activity_type == 40002) activityType = "/union?id="
if (activity_type == 40003) activityType = "/club?id="
window.location.href = "/platform/activity/apply" + activityType + activity_id
}).catch(() => {
});
} else {
if (apply_type == 2) {
window.location.href = "/platform/jf/activity_bx/reimbursement/doExport?id=" + id
} else {
window.location.href = "/platform/jf/activity_bx/reimbursementview/doExport?id=" + id
}
}*/
window.open("/platform/jf/activity_bx/reimbursementview/doExport?id=" + id)
},
blur() {
let num = 0
this.formData.goods.forEach(v => {
num += parseFloat(v.price)
})
if (this.formData.apply_type == 2) {
this.$set(this.formData, "activity_money", num)
} else {
this.$set(this.formData, "funds_money", num)
}
},
delNotesItem(scope) {
this.delNotesList.push(scope.row.id)
this.formData.goods.splice(scope.$index, 1)
},
activityChange(val) {
const activity = this.activity.find(v => v.v_name == val)
this.$set(this.formData, 'activity_id', activity ? activity.id : null)
},
handleSelect(item) {
if (item.id) {
this.$set(this.formData, 'activity_time', item.be_time)
this.$set(this.formData, 'activity_number', item.number)
this.$set(this.formData, 'venue', item.address)
this.$set(this.formData, 'activity_id', item.id)
} else {
this.$set(this.formData, 'activity_id', null)
}
},
async querySearchAsync(queryString, cb) {
const {code, data} = await $.get(loc() + "/getActivity", {query: queryString})
if (code == 0) {
const arr = data.map(v => {
v.v_name = v.name + moment(v.be_time).format(" YYYY-MM-DD")
return {value: v.v_name, ...v}
})
this.activity = data
cb(arr)
} else {
cb([])
}
},
async doAdd() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(location.href + "/doAdd", {
activityBx: JSON.stringify(this.formData),
sign: this.formData.sign
})
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.$refs.guava.index()
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
doEdit() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(location.href + "/doEdit", {
activityBx: JSON.stringify(this.formData),
sign: this.formData.sign,
delNotesList: JSON.stringify(this.delNotesList)
})
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.$refs.guava.index()
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
openAdd() {
this.delNotesList = []
this.formData = {
goods: [],
files: [],
activity_money: null,
user_name: '${@shiro.getPrincipalProperty("username")}',
apply_time: moment().format('YYYY-MM-DD'),
activity_card_number: '${@shiro.getPrincipalProperty("bank_number")}'
}
this.$nextTick(() => {
$("#acEditor").html("")
acEditor = new E("#acEditor")
acEditor.config.onchange = (html) => {
this.formData.activity_content = html
}
acEditor.create()
})
this.$refs.guava.edit()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
},
openView(row) {
const {id} = row
this.$refs.act_info.getActInfo(id)
this.$refs.guava.view()
},
async openEdit(row) {
const {id} = row
/* this.formData = {
goods: [],
plannedDate: []
}
this.activityType = await getActivityTwoLevelType("40000")
const resp = await $.get(location.href + "/findOne", {id})
requestLaterFun(resp, (v) => {
v.activity_type = v.activity_type.toString()
v.goods = v.Goods
if (v.files && v.files.length > 0) v.files = JSON.parse(v.files)
v.plannedDate = (v.startPlannedDate + "——" + v.endPlannedDate)
this.formData = v
this.$nextTick(() => {
$("#acEditor").html("")
acEditor = new E("#acEditor")
acEditor.config.onchange = (html) => {
this.formData.activity_content = html
}
acEditor.create()
acEditor.txt.html(v.activity_content)
})
this.$refs.guava.edit()
})*/
window.location.href = "/platform/jf/Funds/apply?id=" + id
},
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("/platform/jf/activity_bx/reimbursement/doDelete", {id: id});
this.pageData()
}
}
});
},
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()}")
}
},
...pageSomeThing
},
async created() {
this.pageData();
if (getLocationVariable("action") == 'add') {
this.openAdd()
}
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->