first commit
This commit is contained in:
@@ -0,0 +1,491 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div slot="header" style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<h3 style="color: var(--color-primary)">省级互助保障</h3>
|
||||
<el-button type="primary" size="small" @click="onDownloadTemplate">下载模板</el-button>
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="140px" label-position="right"
|
||||
label-suffix=":">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item prop="projectId" label="所属事项">
|
||||
<el-select v-model="formData.projectId"
|
||||
style="width: 100%"
|
||||
placeholder="请选择所属事项">
|
||||
<el-option v-for="item in projectList" :key="item.id" :label="item.projectName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div style="margin-top: 8px">
|
||||
<span style="color: #0a84ff;cursor: pointer;" @click="onView">查看详情</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="mode" label="申请模式">
|
||||
<el-select v-model="formData.mode" placeholder="申请模式" @change="modeChange"
|
||||
style="width: 100%">
|
||||
<el-option label="本人申请" value="本人申请"></el-option>
|
||||
<el-option
|
||||
v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
|
||||
label="替他人申请" value="替他人申请"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="proxyUserName" label="填写人姓名">
|
||||
<el-input readonly v-model="formData.proxyUserName" placeholder="请输入姓名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="proxyLoginName" label="填写人工号">
|
||||
<el-input readonly v-model="formData.proxyLoginName"
|
||||
placeholder="请输入工号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="userId" label="申请人" label-width="140px">
|
||||
<el-select :remote-method="queryRecipients"
|
||||
@change="userChange"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
placeholder="输入工号或者姓名查找"
|
||||
style="width: 100%"
|
||||
v-model="formData.userId"
|
||||
v-if="formData.mode == '替他人申请'">
|
||||
<el-option :key="o.id"
|
||||
:label="o.username+'('+o.loginname+')'"
|
||||
:value="o.id"
|
||||
v-for="o in subsidizedList"></el-option>
|
||||
</el-select>
|
||||
<el-input v-else
|
||||
readonly
|
||||
v-model="formData.userName"
|
||||
placeholder="申请人姓名">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="loginName" label="工号">
|
||||
<el-input readonly v-model="formData.loginName" placeholder="请输入工号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="unitName" label="所属单位">
|
||||
<el-input readonly v-model="formData.unitName" placeholder="请输入所属单位"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="unionName" label="所属工会">
|
||||
<el-input readonly v-model="formData.unionName" placeholder="请输入所属工会"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="sex" label="性别">
|
||||
<el-input readonly v-model="formData.sex" placeholder="请输入性别"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="mobile" label="手机号">
|
||||
<el-input v-model="formData.mobile" placeholder="请输入手机号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="idCard" label="身份证号">
|
||||
<el-input v-model="formData.idCard" placeholder="请输入身份证号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="age" label="年龄">
|
||||
<el-input v-model="formData.age" placeholder="请输入年龄" type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item prop="planNumber" label="计划书号码">-->
|
||||
<!-- <el-input v-model="formData.planNumber" placeholder="请输入计划书号码"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item prop="isRenewal" label="是否续保">-->
|
||||
<!-- <el-select v-model="formData.isRenewal" placeholder="请选择是否续保" style="width: 100%">-->
|
||||
<!-- <el-option label="是" value="1"></el-option>-->
|
||||
<!-- <el-option label="否" value="0"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item prop="guaranteedStartTime" label="保障开始时间">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="formData.guaranteedStartTime"-->
|
||||
<!-- type="date"-->
|
||||
<!-- format="yyyy-MM-dd"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请选择保障开始时间"-->
|
||||
<!-- @change="calculateEndTime">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item prop="guaranteedEndTime" label="保障结束时间">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="formData.guaranteedEndTime"-->
|
||||
<!-- type="date"-->
|
||||
<!-- format="yyyy-MM-dd"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请选择保障结束时间"-->
|
||||
<!-- :readonly="true">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="dangerTime" label="入院时间">
|
||||
<el-date-picker
|
||||
v-model="formData.dangerTime"
|
||||
type="datetime"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
value-format="yyyy-MM-dd HH:mm"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择出险时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="dangerAddress" label="入院地点">
|
||||
<el-input v-model="formData.dangerAddress" placeholder="请输入出险地点"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="address" label="住址">
|
||||
<el-input v-model="formData.address" placeholder="请输入住址"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="bankUserName" label="开户名">
|
||||
<el-input v-model="formData.bankUserName" placeholder="请输入开户名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="bankOfDeposit" label="开户支行">
|
||||
<el-input v-model="formData.bankOfDeposit" placeholder="请输入开户支行"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="bankCardNumber" label="银行卡账号">
|
||||
<el-input v-model="formData.bankCardNumber" placeholder="请输入银行卡账号"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="出险原因、经过、结果" prop="content">
|
||||
<text-editor v-model="formData.dangerEvent"></text-editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item prop="files" label="附件">
|
||||
<file-upload :value.sync="formData.files"
|
||||
upload_mode="drag"
|
||||
:upload_number="10" upload_result_category="array"
|
||||
accept=".doc, .docx, .xls, .xlsx, .pdf, .ppt, .jpg, .jpeg, .png"
|
||||
complete_result></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sign" label="签字">
|
||||
<pc-signature v-model="formData.sign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
<el-button type="primary" plain @click="onSave">提交</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<project-info ref="projectInfoRef"></project-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../common/projectInfo.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
dicts: ["USER_STATE", "USER_MEDICINE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'project-info': projectInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bizId: GetQueryString("bizId"),
|
||||
taskId: GetQueryString("taskId"),
|
||||
formData: {
|
||||
mode: '本人申请' // 默认为本人申请
|
||||
},
|
||||
// 替他人申请相关
|
||||
subsidizedList: [],
|
||||
formRules: {
|
||||
projectId: [{required: true, message: '请选择所属事项', trigger: 'change'}],
|
||||
mode: [{required: true, message: '请选择申请模式', trigger: 'change'}],
|
||||
proxyUserName: [{required: true, message: '请填写填写人姓名', trigger: 'blur'}],
|
||||
proxyLoginName: [{required: true, message: '请填写填写人工号', trigger: 'blur'}],
|
||||
userId: [{required: true, message: '请选择申请人', trigger: 'change'}],
|
||||
loginName: [{required: true, message: '请填写工号', trigger: 'blur'}],
|
||||
unitName: [{required: true, message: '请填写所属单位', trigger: 'blur'}],
|
||||
unionName: [{required: true, message: '请填写所属工会', trigger: 'blur'}],
|
||||
sex: [{required: true, message: '请填写性别', trigger: 'blur'}],
|
||||
mobile: [{required: true, message: '请填写手机号', trigger: 'blur'}, {
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
idCard: [{
|
||||
required: true,
|
||||
message: '请填写身份证号',
|
||||
trigger: 'blur'
|
||||
}, {
|
||||
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||
message: '请输入正确的身份证号码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
age: [{required: true, message: '请输入年龄', trigger: 'blur'}, {
|
||||
type: 'number',
|
||||
min: 16,
|
||||
max: 60,
|
||||
message: '年龄必须在16-60岁之间',
|
||||
trigger: 'blur',
|
||||
transform: (value) => Number(value)
|
||||
}],
|
||||
bankCardNumber: [{
|
||||
pattern: /^([1-9]{1})(\d{15}|\d{18})$/,
|
||||
message: '请输入正确的银行卡号',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
projectList: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听 projectId 变化,自动设置 projectName
|
||||
'formData.projectId': {
|
||||
handler(newVal) {
|
||||
if (newVal && this.projectList.length > 0) {
|
||||
const project = this.projectList.find(item => item.id === newVal);
|
||||
if (project) {
|
||||
this.$set(this.formData, 'projectName', project.projectName);
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 申请模式切换
|
||||
modeChange(val) {
|
||||
const user = this.$store.state.user;
|
||||
if (val === "本人申请") {
|
||||
// 本人申请
|
||||
this.$set(this.formData, 'userId', user.id);
|
||||
this.$set(this.formData, 'userName', user.username);
|
||||
this.$set(this.formData, 'loginName', user.loginname);
|
||||
this.$set(this.formData, 'proxyUserId', user.id);
|
||||
this.$set(this.formData, 'proxyUserName', user.username);
|
||||
this.$set(this.formData, 'proxyLoginName', user.loginname);
|
||||
this.$set(this.formData, 'unitId', user.unit.id);
|
||||
this.$set(this.formData, 'unitName', user.unit.name);
|
||||
this.$set(this.formData, 'unionId', user.union.id);
|
||||
this.$set(this.formData, 'unionName', user.union.name);
|
||||
this.$set(this.formData, 'sex', user.sex);
|
||||
this.$set(this.formData, 'nation', user.nation);
|
||||
this.$set(this.formData, 'birthday', user.birthday);
|
||||
this.$set(this.formData, 'mobile', user.mobile);
|
||||
this.$set(this.formData, 'idCard', user.idCard);
|
||||
} else {
|
||||
// 替他人申请,清空被帮助人信息
|
||||
this.$set(this.formData, 'proxyUserId', user.id);
|
||||
this.$set(this.formData, 'proxyUserName', user.username);
|
||||
this.$set(this.formData, 'proxyLoginName', user.loginname);
|
||||
this.$set(this.formData, 'userId', null);
|
||||
this.$set(this.formData, 'userName', null);
|
||||
this.$set(this.formData, 'loginName', null);
|
||||
this.$set(this.formData, 'unitId', null);
|
||||
this.$set(this.formData, 'unitName', null);
|
||||
this.$set(this.formData, 'unionId', null);
|
||||
this.$set(this.formData, 'unionName', null);
|
||||
this.$set(this.formData, 'sex', null);
|
||||
this.$set(this.formData, 'nation', null);
|
||||
this.$set(this.formData, 'birthday', null);
|
||||
this.$set(this.formData, 'mobile', null);
|
||||
// 清空年龄和身份证号
|
||||
this.$set(this.formData, 'idCard', null);
|
||||
}
|
||||
},
|
||||
|
||||
// 用户选择变化
|
||||
async userChange() {
|
||||
const user = this.subsidizedList.find(item => item.id === this.formData.userId);
|
||||
if (user) {
|
||||
this.$set(this.formData, 'userId', user.id);
|
||||
this.$set(this.formData, 'userName', user.username);
|
||||
this.$set(this.formData, 'loginName', user.loginname);
|
||||
this.$set(this.formData, 'sex', user.sex);
|
||||
this.$set(this.formData, 'unitId', user.unitId);
|
||||
this.$set(this.formData, 'unitName', user.unitName);
|
||||
this.$set(this.formData, 'unionId', user.unionId);
|
||||
this.$set(this.formData, 'unionName', user.unionName);
|
||||
this.$set(this.formData, 'birthday', user.birthday);
|
||||
this.$set(this.formData, 'mobile', user.mobile);
|
||||
this.$set(this.formData, 'idCard', user.idCard);
|
||||
} else {
|
||||
this.$set(this.formData, 'userId', null);
|
||||
this.$set(this.formData, 'userName', null);
|
||||
this.$set(this.formData, 'loginName', null);
|
||||
this.$set(this.formData, 'sex', null);
|
||||
this.$set(this.formData, 'unitId', null);
|
||||
this.$set(this.formData, 'unitName', null);
|
||||
this.$set(this.formData, 'unionId', null);
|
||||
this.$set(this.formData, 'unionName', null);
|
||||
this.$set(this.formData, 'birthday', null);
|
||||
this.$set(this.formData, 'mobile', null);
|
||||
this.$set(this.formData, 'idCard', null);
|
||||
}
|
||||
},
|
||||
|
||||
// 修改 calculateEndTime 方法中的模板字符串部分
|
||||
calculateEndTime(startDate) {
|
||||
if (startDate) {
|
||||
const start = new Date(startDate);
|
||||
const end = new Date(start);
|
||||
end.setFullYear(start.getFullYear() + 1);
|
||||
// 格式化为 yyyy-MM-dd (转义反引号)
|
||||
const year = end.getFullYear();
|
||||
const month = String(end.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(end.getDate()).padStart(2, '0');
|
||||
this.$set(this.formData, 'guaranteedEndTime', year + '-' + month + '-' + day);
|
||||
} else {
|
||||
this.$set(this.formData, 'guaranteedEndTime', null);
|
||||
}
|
||||
},
|
||||
|
||||
// 查询受助人
|
||||
queryRecipients(key) {
|
||||
this.$axios.get("/platform/mutualInsurance/apply/queryRecipients", {
|
||||
params: {key}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.subsidizedList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 保存
|
||||
async onSave() {
|
||||
const isValid = await this.validateBeforeSubmit();
|
||||
if (!isValid) return;
|
||||
|
||||
this.$confirm("您确定要提交吗?(需准备证明材料、伤残、入、出院记录、病理报告或交通事故责任认定书等)", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/mutualInsurance/apply/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush('/platform/mutualInsurance/mine/index')
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 提交验证
|
||||
validateBeforeSubmit() {
|
||||
return new Promise((resolve) => {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
resolve(true);
|
||||
} else {
|
||||
this.$message.error('请完善必填信息');
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
onDownloadTemplate() {
|
||||
window.open('/platform/mutualInsurance/apply/downloadTemplate');
|
||||
},
|
||||
onView() {
|
||||
if (!this.formData.projectId) {
|
||||
this.$message.warning('请先选择所属事项');
|
||||
return;
|
||||
}
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.projectInfoRef.onOpen(this.formData.projectId)
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
commonUtil.pjaxPush('/platform/mutualInsurance/apply/index?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
|
||||
},
|
||||
async findOne(id) {
|
||||
const resp = await $.get('/platform/mutualInsurance/apply/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
}
|
||||
},
|
||||
async listProject() {
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
const resp = await $.post('/platform/mutualInsurance/apply/listProject', {year: currentYear})
|
||||
if (resp.code === 0) {
|
||||
this.projectList = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.$set(this.formData, 'projectId', resp.data[0].id)
|
||||
this.$set(this.formData, 'projectName', resp.data[0].projectName)
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
if (this.bizId) {
|
||||
this.findOne(this.bizId).then(async data => {
|
||||
this.formData = data
|
||||
})
|
||||
} else {
|
||||
// 初始化为本人申请模式
|
||||
this.modeChange("本人申请");
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
this.listProject()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,193 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择年度"
|
||||
style="width: 100%"
|
||||
@change="getProjectByYear"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="事项名称">
|
||||
<el-select v-model="pageForm.projectId" placeholder="请选择事项名称" clearable style="width: 100%" @change="doSearch">
|
||||
<el-option v-for="item in projectList"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.projectName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="性别">
|
||||
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择所属工会" clearable>
|
||||
<el-option v-for="item in unionOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select v-model="pageForm.unitId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择所属单位" clearable>
|
||||
<el-option v-for="item in unitOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="onExport" icon="el-icon-s-promotion" type="primary" size="small">导出</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="age" label="年龄"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="projectName" label="所属事项" width="300px"></el-table-column>
|
||||
<el-table-column prop="applyTime" label="申请时间"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #view>
|
||||
<user-info ref="userInfoInfoRef"></user-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../common/userInfo.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
//分页数据
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"user-info": userInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: "/platform/mutualInsurance/collect/pageData",
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
userOptions: [],
|
||||
projectList: [],
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
onExport() {
|
||||
this.$downLoad('/platform/mutualInsurance/collect/onExport', this.pageForm)
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.view(()=>{
|
||||
this.$refs.userInfoInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
commonUtil.pjaxPush('/platform/mutualInsurance/apply/index?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/mutualInsurance/collect/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 根据年度获取项目列表
|
||||
async getProjectByYear() {
|
||||
if (!this.pageForm.year) {
|
||||
this.projectList = [];
|
||||
this.pageForm.projectId = "";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 修改为互助保障项目的查询接口
|
||||
const res = await this.$axios.post("/platform/mutualInsurance/apply/listProject", {
|
||||
year: this.pageForm.year
|
||||
});
|
||||
if (res.code === 0) {
|
||||
this.projectList = res.data;
|
||||
// 如果当前选中的项目不在新列表中,清空选择
|
||||
if (this.pageForm.projectId && !res.data.some(item => item.id === this.pageForm.projectId)) {
|
||||
this.pageForm.projectId = "";
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取项目列表失败:", error);
|
||||
this.projectList = [];
|
||||
this.pageForm.projectId = "";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
// 设置默认年份为当前年份
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
this.$set(this.pageForm, 'year', currentYear);
|
||||
// 获取当前年份的项目列表
|
||||
this.getProjectByYear();
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
//单位查询
|
||||
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,179 @@
|
||||
const formEdit = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog :title="formData.id ? '编辑项目' : '新增项目'" :visible="visible" width="70%" :close-on-click-modal="false" :before-close="handleClose">
|
||||
<el-form :model="formData" :rules="formRules" label-width="110px" ref="form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="事项名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入事项名称" maxlength="50"
|
||||
show-word-limit></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="activityGroupId" label="可报名人员范围">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select prop="groupId" placeholder="参加人员范围"
|
||||
v-model="formData.activityGroupId"
|
||||
style="width: 99%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in activityGroupList"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
:key="item.groupId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click="$refs.drawerUserScope.userScopeDialog = true"
|
||||
type="primary">设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker v-model="formData.startTime" type="datetime"
|
||||
placeholder="请选择活动开始时间"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker v-model="formData.endTime" type="datetime"
|
||||
placeholder="请选择活动结束时间"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="内容详情" prop="content">
|
||||
<text-editor v-model="formData.content"></text-editor>
|
||||
</el-form-item>
|
||||
<el-form-item prop="files" label="附件">
|
||||
<file-upload :upload_number="5" :value.sync="formData.files"
|
||||
upload_result_type="url"
|
||||
upload_text="请上传附件"
|
||||
complete_result upload_mode="drag"
|
||||
upload_result_category="array"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="cover" label="封面">
|
||||
<file-upload :upload_number="5" :value.sync="formData.cover"
|
||||
upload_result_type="url"
|
||||
upload_text="请上传封面"
|
||||
complete_result upload_mode="drag"
|
||||
upload_result_category="array"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" style="text-align: right">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button @click="doSubmit" type="primary" :loading="submitting">确定</el-button>
|
||||
</div>
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.activityGroupId"
|
||||
></drawer-user-scope>
|
||||
</el-dialog>
|
||||
`,
|
||||
components: {
|
||||
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue")
|
||||
},
|
||||
data() {
|
||||
// 日期验证器
|
||||
const validateDateRange = (rule, value, callback) => {
|
||||
const { startTime, endTime } = this.formData
|
||||
|
||||
if (rule.field === "endTime" && startTime && endTime) {
|
||||
if (new Date(endTime) <= new Date(startTime)) {
|
||||
callback(new Error("结束时间必须晚于开始时间"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
callback()
|
||||
}
|
||||
|
||||
return {
|
||||
visible: false,
|
||||
submitting: false,
|
||||
formData: {},
|
||||
activityGroupList: [],
|
||||
formRules: {
|
||||
projectName: [
|
||||
{ required: true, message: "请输入事项名称", trigger: "blur" },
|
||||
{ min: 1, max: 50, message: "长度在 1 到 50 个字符", trigger: "blur" }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: "请选择活动开始时间", trigger: "blur" }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: "请选择活动结束时间", trigger: "blur" },
|
||||
{ validator: validateDateRange, trigger: "blur" }
|
||||
],
|
||||
content: [{ required: true, message: "内容详情", trigger: "blur" }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 处理关闭弹窗
|
||||
handleClose() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
// 打开表单
|
||||
onOpen(id) {
|
||||
this.visible = true
|
||||
this.formData = {}
|
||||
|
||||
if (id) {
|
||||
// 如果是编辑模式,加载数据
|
||||
this.$axios.post("/platform/mutualInsurance/project/findOne", { id: id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const { data } = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
||||
this.activityGroupList = data
|
||||
},
|
||||
|
||||
async doSubmit() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (!valid) return
|
||||
|
||||
this.submitting = true
|
||||
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/mutualInsurance/project/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.visible = false
|
||||
this.$message.success(res.msg)
|
||||
this.submitting = false
|
||||
// 通过 $emit 触发父组件的刷新方法
|
||||
this.$emit('refresh')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.submitting = false;
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityGroup()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
const projectInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<div class="process-title">事项信息</div>
|
||||
|
||||
<el-descriptions :column="2" border class="flow-task-form">
|
||||
<el-descriptions-item label="年度">{{viewData.year}}</el-descriptions-item>
|
||||
<el-descriptions-item label="事项名称">{{viewData.projectName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">{{viewData.startTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">{{viewData.endTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="详细信息" :span="2">
|
||||
<div v-html="stripHtmlTags(viewData.content)"></div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" :span="2">
|
||||
<file-preview v-if="viewData.files && viewData.files.length > 0" :files="viewData.files" complete_result></file-preview>
|
||||
<span v-else>暂无附件</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
viewData: {},
|
||||
row: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开
|
||||
onOpen(projectId) {
|
||||
this.projectId = projectId
|
||||
this.visible = true
|
||||
this.getInfo()
|
||||
},
|
||||
// 获取申请信息
|
||||
getInfo() {
|
||||
this.$axios.post('/platform/mutualInsurance/project/findOne', {id: this.projectId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 去除HTML标签的方法
|
||||
stripHtmlTags(html) {
|
||||
if (!html) return '';
|
||||
// 去除所有HTML标签
|
||||
return html.replace(/<[^>]*>/g, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
const userInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<table-tool label="人员信息"></table-tool>
|
||||
<el-descriptions :column="2" border class="flow-task-form">
|
||||
<el-descriptions-item label="所属事项">{{viewData.projectName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请模式">{{ viewData.mode}}</el-descriptions-item>
|
||||
<el-descriptions-item label="填写人姓名">{{ viewData.proxyUserName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="填写人工号">{{ viewData.proxyLoginName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请人">{{viewData.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">{{viewData.loginName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属单位">{{viewData.unitName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">{{viewData.unionName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{viewData.sex}}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号">{{viewData.mobile}}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{viewData.idCard}}</el-descriptions-item>
|
||||
<el-descriptions-item label="年龄">{{viewData.age}}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="计划书号码">{{viewData.planNumber}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="是否续保">{{viewData.isRenewal}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="保障开始时间">{{viewData.guaranteedStartTime}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="保障结束时间">{{viewData.guaranteedEndTime}}</el-descriptions-item>-->
|
||||
<el-descriptions-item label="入院时间">{{viewData.dangerTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="入院地点">{{viewData.dangerAddress}}</el-descriptions-item>
|
||||
<el-descriptions-item label="住址">{{viewData.address}}</el-descriptions-item>
|
||||
<el-descriptions-item label="开户名">{{viewData.bankUserName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="开户支行">{{viewData.bankOfDeposit}}</el-descriptions-item>
|
||||
<el-descriptions-item label="银行卡账号" >{{viewData.bankCardNumber}}</el-descriptions-item>
|
||||
<el-descriptions-item label="赔付金额" :span="2">{{viewData.amount}}</el-descriptions-item>
|
||||
<el-descriptions-item label="出险原因、经过、结果" :span="2">{{viewData.dangerEvent}}</el-descriptions-item>
|
||||
<el-descriptions-item :span="3" label="附件">
|
||||
<file-preview :files="viewData.files" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签字" >
|
||||
<el-image v-if="viewData.sign"
|
||||
:src="viewData.sign"
|
||||
class="signature-image"
|
||||
style="height: 60px"
|
||||
></el-image>
|
||||
<span v-else>暂无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<slot></slot>
|
||||
<snaker-chart ref="snakerChartRef"></snaker-chart>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
viewData: {},
|
||||
doneTasks: [],
|
||||
row: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 打开
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.visible = true
|
||||
this.getInfo()
|
||||
this.getDoneTasks()
|
||||
},
|
||||
|
||||
// 获取申请信息
|
||||
getInfo() {
|
||||
this.$axios.post('/platform/mutualInsurance/apply/findOne', {id: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
// 格式化日期只显示年月日
|
||||
if (this.viewData.guaranteedStartTime) {
|
||||
this.viewData.guaranteedStartTime = this.viewData.guaranteedStartTime.substring(0, 10);
|
||||
}
|
||||
if (this.viewData.guaranteedEndTime) {
|
||||
this.viewData.guaranteedEndTime = this.viewData.guaranteedEndTime.substring(0, 10);
|
||||
}
|
||||
// 去除 dangerEvent 字段的 <p> 标签
|
||||
if (this.viewData.dangerEvent) {
|
||||
this.viewData.dangerEvent = this.viewData.dangerEvent.replace(/^<p>/, '').replace(/<\/p>$/, '');
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" placeholder="请选择年度"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool></table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="age" label="年龄"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="projectName" label="所属事项" width="300px"></el-table-column>
|
||||
<el-table-column prop="applyTime" label="申请时间"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="350px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="onDelete(row.id)" size="mini" type="danger" >删除</el-button>
|
||||
<el-button @click="doExportApply(row)" size="mini" type="primary" >申请表导出</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #view>
|
||||
<user-info ref="userInfoInfoRef"></user-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../common/userInfo.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
//分页数据
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"user-info": userInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: "/platform/mutualInsurance/mine/pageData",
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
// 导出示例
|
||||
doExportApply(row){
|
||||
this.$downLoad('/platform/mutualInsurance/mine/doExportApply?id=' + row.id)
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.view(()=>{
|
||||
this.$refs.userInfoInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
commonUtil.pjaxPush('/platform/mutualInsurance/apply/index?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/mutualInsurance/mine/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,118 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker placeholder="请选择年度" type="year" style="width: 100%" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="事项名称">
|
||||
<el-input placeholder="请输入事项名称查询" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openAdd">新增</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="projectName" label="事项名称" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="year" label="年度" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="startTime" label="开始时间"></el-table-column>
|
||||
<el-table-column prop="endTime" label="结束时间"></el-table-column>
|
||||
<el-table-column prop="isOpen" label="是否发布">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch @change="switchChange(row)" active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
v-model="row.isOpen"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" type="danger" @click="onDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<form-edit ref="formEditRef" @refresh="doSearch"></form-edit>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../common/formEdit.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"form-edit": formEdit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY') + "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 重写分页数据获取方法,使用正确的接口路径
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
this.$axios
|
||||
.post("/platform/mutualInsurance/project/pageData", this.pageForm)
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.formEditRef.onOpen()
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.formEditRef.onOpen(row.id)
|
||||
},
|
||||
async switchChange(row) {
|
||||
const resp = await this.$axios.post("/platform/mutualInsurance/project/switchChange", row)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(async () => {
|
||||
const { code, msg } = await this.$axios.post("/platform/mutualInsurance/project/delete", { id: id })
|
||||
if (code === 0) {
|
||||
this.$message.success(msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user