first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,290 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.downLoadTemplate {
position: absolute;
right: 0;
top: 0;
}
.dividing-line {
display: flex;
justify-content: center;
position: relative;
margin: 10px 0;
}
.dividing-line::after {
content: '';
position: absolute;
border-bottom: 1px solid #ebeef5;
width: calc(100% + 40px);
bottom: 0;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" style="position: relative">
<template #header>
<h3 style="color: rgb(24, 103, 176);">补助计算(excel批量导入)</h3>
</template>
<el-row justify="center" style="position: relative" type="flex">
<div class="downLoadTemplate">
<el-button @click="downLoadTemplate" size="small"
type="primary">
下载模板
</el-button>
</div>
<el-upload
:action="uploadUrl"
:auto-upload="true"
:file-list="files"
:limit="1"
:on-error="handleError"
:on-exceed="()=>{this.notifyWarning('只能上传一个文件')}"
:on-progress="handleProgress"
:on-remove="(f,fl)=>{fileList = fl;tableData=[];globalYear=null;}"
:on-success="handleSuccess"
accept=".xls,.xlsx"
drag
ref="excelUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-row>
<div class="dividing-line"></div>
<div class="mt20" id="excel-table-container">
<vi-title2 title="计算结果">
<template #func>
<el-button :disabled="tableData.length===0" @click="checkAgain" size="small" type="primary">
重新校验
</el-button>
<el-button :disabled="tableData.length===0" @click="doImport" size="small" type="primary">导入数据
</el-button>
</template>
</vi-title2>
<el-table :data="tableData" :summary-method="summaryMethod" max-height="887" ref="table"
show-summary
v-loading="tableLoading"
v-sticky="{top: 0,parent: '#app'}">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="校验" prop="validMsg" show-overflow-tooltip>
<template scope="{row}">
<span :class="row.valid?'text-success':'text-danger'">{{row.validMsg.join('、')}}</span>
</template>
</el-table-column>
<el-table-column label="工号" prop="loginName" width="150">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="row.loginName" maxlength="10" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="姓名" prop="userName" width="150">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="row.userName" maxlength="10" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="单位" prop="unitName" show-overflow-tooltip width="150">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="row.unitName" maxlength="10" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="个人支付金额(元)" prop="selfPayMoney" width="200">
<!-- <template scope="{row}">-->
<!-- <el-input-number v-model="row.selfPayMoney" :min="0" :max="999999"-->
<!-- :precision="2" size="small" style="width: 100%"></el-input-number>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="计算金额(员)" prop="noLimitSubsidyMoney" width="200"></el-table-column>
<el-table-column label="补助金额(元)" prop="subsidyMoney" width="200">
<!-- <template scope="{row}">-->
<!-- <el-input-number v-model="row.subsidyMoney" :min="0" :max="999999"-->
<!-- :precision="2" size="small" style="width: 100%"></el-input-number>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="年度" prop="year" width="100">
<!-- <template #header>-->
<!-- <div style="display: flex;align-items: center">-->
<!-- <div style="width: 50px">-->
<!-- 年度-->
<!-- </div>-->
<!-- <el-date-picker-->
<!-- v-model="globalYear"-->
<!-- @change="globalYearChange"-->
<!-- type="year"-->
<!-- placeholder="一键选择年度"-->
<!-- value-format="yyyy"-->
<!-- size="small"-->
<!-- style="width: calc(200px - 50px)">-->
<!-- </el-date-picker>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template scope="{row}">-->
<!-- <el-date-picker-->
<!-- v-model="row.year"-->
<!-- type="year"-->
<!-- placeholder="选择年度"-->
<!-- value-format="yyyy"-->
<!-- size="small"-->
<!-- style="width: 100%">-->
<!-- </el-date-picker>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="上一次补助年度" prop="lastTimeSubsidyYear" width="150"></el-table-column>
<!-- <el-table-column label="自费金额补助比例" prop="selfPaySubsidyRatio" width="150">-->
<!-- <template scope="{row}">-->
<!-- {{row.selfPaySubsidyRatio * 1000 / 10 + '%'}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="额外补助比例" prop="otherSubsidyRatio" width="150">
<template scope="{row}">
{{row.otherSubsidyRatio * 1000 / 10 + '%'}}
</template>
</el-table-column>
<!-- <el-table-column label="总补助比例" prop="totalSubsidyRatio" width="150">-->
<!-- <template scope="{row}">-->
<!-- {{row.totalSubsidyRatio * 1000 / 10 + '%'}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="入会年限∕是否享受过补助" prop="subsidyDesc" width="200">-->
<!-- </el-table-column>-->
<el-table-column label="备注" prop="remarks">
<!-- <template scope="{row}">-->
<!-- <el-input v-model="formData.remarks" maxlength="20" size="small"></el-input>-->
<!-- </template>-->
</el-table-column>
</el-table>
<!-- <el-backtop target="#excel-table-container" :bottom="100"></el-backtop>-->
</div>
</el-card>
</guava>
</div>
<script>
</script>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
files: [],
globalYear: null,
uploadUrl: '/platform/sickHelp/import/readExcel',
tableHeight: null
}
},
methods: {
handleProgress() {
this.tableLoading = true
},
handleSuccess(resp) {
console.log('ok')
this.tableLoading = false
this.tableData = resp.data
},
handleError(err) {
console.log(err)
},
beforeUpload(file, files) {
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
const whiteList = ['xls', 'xlsx']
if (!whiteList.includes(fileSuffix)) {
this.files = []
this.$message.warning('上传文件只能是' + whiteList.join(',') + '格式')
return false
}
this.files = files
},
async checkAgain() {
this.tableLoading = true
const resp = await $.post('/platform/sickHelp/import/checkData', {sickHelps: JSON.stringify(this.tableData)})
console.log('ok....')
this.tableLoading = false
if (resp.code === 0) {
// resp.data.forEach(v => {
// v['year'] = v['year'] ? v['year'].toString() : null
// })
this.tableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async doImport() {
const hasErrorData = this.tableData.some(v => !v.valid)
if (hasErrorData) {
this.notifyWarning('数据校验不合格,无法导入')
return
}
const resp = await $.post('/platform/sickHelp/import/doImport', {sickHelps: JSON.stringify(this.tableData)})
if (resp.code === 0) {
this.tableData = []
this.globalYear = null
this.notifySuccess(resp.msg)
this.$refs.excelUpload.clearFiles()
}
},
globalYearChange(val) {
this.tableData.forEach(v => {
v['year'] = val
})
},
downLoadTemplate() {
window.open('/platform/sickHelp/import/downLoadTemplate')
},
summaryMethod(param) {
const {columns, data} = param
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
if (['selfPayMoney', 'subsidyMoney'].includes(column.property)) {
const values = data.map(item => Number(item[column.property]))
const sum = values.reduce((sum, value) => sum + value, 0)
sums[index] = sum.toFixed(2)
} else {
sums[index] = null
}
})
return sums
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,415 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.calcRow {
display: flex;
justify-content: center;
position: relative;
top: 20px;
padding: 20px 0;
}
.calcRow::before {
content: '';
position: absolute;
border-top: 1px solid #ebeef5;
width: calc(100% + 40px);
top: 0;
}
.calcRow button {
/*width: 10%;*/
}
.historySubsidy {
position: relative;
padding: 20px 0 0 0;
}
.historySubsidy::before {
content: '';
position: absolute;
border-top: 1px solid #ebeef5;
width: calc(100% + 40px);
top: 0;
}
.el-table__empty-block {
min-height: 240px !important;
background-size: unset !important;
}
.overflow-form-item .el-form-item__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.dividing-line {
display: flex;
justify-content: center;
position: relative;
margin: 10px 0;
}
.dividing-line::after {
content: '';
position: absolute;
border-bottom: 1px solid #ebeef5;
width: calc(100% + 40px);
bottom: 0;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<template #header>
<h3 style="color: rgb(24, 103, 176);">{{cardTitle}}</h3>
</template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form">
<vi-title2 title="填写补助数据"></vi-title2>
<el-row>
<el-col :lg="8" :xs="24">
<el-form-item label="工号" prop="loginName">
<el-select :disabled="formDisabled"
:remote-method="searchUser"
@change="userChange"
clearable
filterable
placeholder="输入工号或者姓名查询"
remote
reserve-keyword
style="width: 100%"
v-model="formData.loginName">
<el-option
:key="item.loginName"
:label="item.userName+'('+item.loginName+')'"
:value="item.loginName"
v-for="item in userList"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="姓名" prop="userName">
<el-input :disabled="!this.formData.id"
placeholder="输入工号之后自动显示"
v-model="formData.userName"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="单位" prop="unitName">
<el-input placeholder="输入工号之后自动显示"
v-model="formData.unitName"></el-input>
</el-form-item>
</el-col>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :lg="8" :xs="24">
<el-form-item label="个人支付金额" prop="selfPayMoney">
<el-input-number :max="99999999.99" :min="3000.00"
:precision="2"
:step="1"
placeholder="请输入个人支付金额"
readonly
style="width: 100%"
v-model="formData.selfPayMoney"></el-input-number>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="申报年度" prop="year">
<el-date-picker
@change="applyYearChange"
:disabled="formDisabled"
:picker-options="pickerOptions"
placeholder="选择申报年度"
style="width: 100%"
type="year"
v-model="formData.year"
value-format="yyyy">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :lg="24" :xs="24">
<el-form-item label="备注" prop="remarks">
<el-input
:rows="3"
maxlength="50"
placeholder="可输入备注"
type="textarea"
v-model="formData.remarks">
</el-input>
</el-form-item>
</el-col>
</el-row>
<div class="dividing-line"></div>
<vi-title2 title="计算结果"></vi-title2>
<el-row :gutter="20">
<!-- <el-col :lg="8" :xs="24">-->
<!-- <el-form-item label="自费金额补助比例" prop="selfPaySubsidyRatio" class="overflow-form-item">-->
<!-- <template #label>-->
<!-- <el-tooltip effect="dark" content="自费金额补助比例" placement="top-start">-->
<!-- <span>自费金额补助比例</span>-->
<!-- </el-tooltip>-->
<!-- </template>-->
<!-- <el-input :value="selfPaySubsidyRatioPercent" readonly></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :lg="8" :xs="24">
<el-form-item label="额外补助比例" prop="otherSubsidyRatio">
<el-input :value="otherSubsidyRatioPercent" readonly></el-input>
</el-form-item>
</el-col>
<!-- <el-col :lg="8" :xs="24">-->
<!-- <el-form-item label="总补助比例" prop="totalSubsidyRatio">-->
<!-- <el-input :value="totalSubsidyRatioPercent" readonly></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row :gutter="20">
<el-col :lg="8" :xs="24">
<el-form-item label="上一次补助年度" prop="lastTimeSubsidyYear">
<el-input readonly
v-model="formData.lastTimeSubsidyYear"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item class="overflow-form-item" label="入会年限∕是否享受过补助" prop="subsidyDesc">
<template #label>
<el-tooltip content="入会年限∕是否享受过补助" effect="dark" placement="top-start">
<span>入会年限∕是否享受过补助</span>
</el-tooltip>
</template>
<el-input readonly v-model="formData.subsidyDesc"></el-input>
</el-form-item>
</el-col>
<el-col :lg="8" :xs="24">
<el-form-item label="补助金额" prop="subsidyMoney">
<el-input-number :max="99999999.99" :min="0" :precision="2"
readonly
style="width: 100%" v-model="formData.subsidyMoney"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="historySubsidy">
<vi-title2 title="历史申请记录"></vi-title2>
<el-table :data="tableData" max-height="360">
<el-table-column label="年度" prop="year"></el-table-column>
<el-table-column label="个人支付金额" prop="selfPayMoney"></el-table-column>
<el-table-column label="个人支付金额补助比例" prop="selfPaySubsidyRatio">
<template scope="{row}">
{{row.selfPaySubsidyRatio ? row.selfPaySubsidyRatio * 1000 / 10 + '%' : null}}
</template>
</el-table-column>
<el-table-column label="额外补助比例" prop="otherSubsidyRatio">
<template scope="{row}">
{{row.otherSubsidyRatio!=null ? row.otherSubsidyRatio * 1000 / 10 + '%' : null}}
</template>
</el-table-column>
<el-table-column label="总补助比例" prop="totalSubsidyRatio">
<template scope="{row}">
{{row.totalSubsidyRatio ? row.totalSubsidyRatio * 1000 / 10 + '%' : null}}
</template>
</el-table-column>
<el-table-column label="补助金额" prop="subsidyMoney"></el-table-column>
<el-table-column label="上一次补助年度" prop="lastTimeSubsidyYear"></el-table-column>
<el-table-column label="备注" prop="remarks"></el-table-column>
<!-- <el-table-column label="是否接受补助" prop="isAccept">-->
<!-- <template scope="{row}">-->
<!-- <template v-if="row.isAccept!=null">-->
<!-- <span v-if="row.isAccept" class="text-success">-->
<!-- 接受-->
<!-- </span>-->
<!-- <span v-else class="text-danger">-->
<!-- 拒绝-->
<!-- </span>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <span class="text-info">无</span>-->
<!-- </template>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<div class="calcRow">
<el-button v-if="formData.id" @click="sublime.jumpPagePjax('/platform/sickHelp/list')">返回补助台账
</el-button>
<el-button @click="calcSubsidy" type="primary">计算补助结果</el-button>
<el-button :disabled="!valid" @click="submitSubsidy" type="primary">提交补助结果</el-button>
</div>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userList: [],
formData: {},
formRules: {
loginName: [{required: true, message: '请输入工号或者姓名查询用户', trigger: ['change', 'blur']}],
selfPayMoney: [{required: true, message: '请输入个人支付金额', trigger: ['change', 'blur']}],
year: [{required: true, message: '请选择申报年度', trigger: ['change', 'blur']}],
},
valid: false
}
},
computed: {
subsidyRatio() {
const subsidyRatio = this.formData.subsidyRatio
if (subsidyRatio) {
return subsidyRatio * 1000 / 10 + '%'
}
return null
},
pickerOptions() {
return {
disabledDate(time) {
return time.getTime() > Date.now()
}
}
},
selfPaySubsidyRatioPercent() {
if (this.formData.selfPaySubsidyRatio) {
return this.formData.selfPaySubsidyRatio * 1000 / 10 + '%'
}
return '0%'
},
otherSubsidyRatioPercent() {
if (this.formData.otherSubsidyRatio) {
return this.formData.otherSubsidyRatio * 1000 / 10 + '%'
}
return '0%'
},
totalSubsidyRatioPercent() {
if (this.formData.totalSubsidyRatio) {
return this.formData.totalSubsidyRatio * 1000 / 10 + '%'
}
return '0%'
},
cardTitle() {
return this.formData.id ? '编辑补助记录' : '新增补助记录'
},
formDisabled() {
return this.formData.id
}
},
methods: {
async calcSubsidy() {
try {
const valid = await this.$refs.form.validate()
if (!valid) return
const formData = clone(this.formData)
formData.selfPayMoney = formData.selfPayMoney.toFixed(2).toString()
const resp = await $.post('/platform/sickHelp/import/checkData', {sickHelps: JSON.stringify([formData])})
if (resp.code === 0) {
if (resp.data) {
const resp_data = resp.data[0]
if (resp_data.valid) {
this.valid = resp_data.valid
this.$set(this.formData, 'selfPaySubsidyRatio', resp_data.selfPaySubsidyRatio)
this.$set(this.formData, 'otherSubsidyRatio', resp_data.otherSubsidyRatio)
this.$set(this.formData, 'totalSubsidyRatio', resp_data.totalSubsidyRatio)
this.$set(this.formData, 'lastTimeSubsidyYear', resp_data.lastTimeSubsidyYear)
this.$set(this.formData, 'subsidyDesc', resp_data.subsidyDesc)
this.$set(this.formData, 'subsidyMoney', resp_data.subsidyMoney)
this.$set(this.formData, 'unitName', resp_data.unitName)
this.notifySuccess(resp_data.validMsg.join('、'))
} else {
this.notifyWarning(resp_data.validMsg.join('、'))
}
}
} else {
this.notifyWarning(resp.msg)
}
} catch (e) {
console.log(e)
}
},
async submitSubsidy() {
await this.calcSubsidy()
if (!this.valid) {
this.notifyWarning('数据校验不合格,无法提交')
return
}
const formData = clone(this.formData)
const resp = await $.post('/platform/sickHelp/import/doImport', {sickHelps: JSON.stringify([formData])})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$refs.form.resetFields()
this.tableData = []
} else {
this.notifyError(resp.msg)
}
},
async searchUser(key) {
const resp = await $.post('/platform/sickHelp/import/searchUser/' + key)
this.userList = resp.data
},
async userChange(val) {
debugger
const user = this.userList.find(v => v.loginName === val)
this.$set(this.formData, 'userName', user.userName)
this.$set(this.formData, 'unitName', user.unitName)
this.$set(this.formData, 'loginName', user.loginName)
await this.getHistoryApplyRecords(user.loginName, this.formData.year)
},
async getHistoryApplyRecords(loginName, year) {
const resp = await $.get('/platform/sickHelp/import/getHistorySubsidyByUser/' + loginName + '/' + year)
if (resp.code === 0) {
this.tableData = resp.data
}
},
applyYearChange() {
const {loginName, year} = this.formData
if (loginName && year) {
this.getHistoryApplyRecords(loginName, year)
}
},
async checkEdit() {
const id = GetQueryString("id")
if (!id) {
this.$set(this.formData, 'year', new Date().getFullYear() + '')
return
}
const resp = await $.get('/platform/sickHelp/import/findOne/' + id)
const loginName = resp.data.loginName
await this.searchUser(loginName)
resp.data.year = resp.data.year.toString()
this.formData = resp.data
await this.getHistoryApplyRecords(loginName, this.formData.year)
}
},
created() {
this.checkEdit()
}
})
</script>
<!--#
}
#-->