子女信息管理
This commit is contained in:
@@ -303,11 +303,14 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
//查询慰问对象
|
||||
selectQueryUser(keyword, options) {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
},
|
||||
userChange(val) {
|
||||
@@ -403,31 +406,6 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
// 初始化
|
||||
async init() {
|
||||
this.reimburseProjectList = await this.$businessTool.getDictOptions("UNION_REIMBURSE_PROJECT")
|
||||
if (this.bizId) {
|
||||
this.$axios.post("/platform/unionReimburse/apply/info", {id: this.bizId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
this.selectQueryUser(this.formData.loginName, this.userOptions)
|
||||
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const { username, loginname, id, unit, union, mobile } = this.$store.state.user
|
||||
this.formData = {
|
||||
userName: username,
|
||||
loginName: loginname,
|
||||
unitId: unit?.id,
|
||||
unitName: unit?.name,
|
||||
unionId: union?.id,
|
||||
unionName: union?.name,
|
||||
reimburseType: "UNION_REIMBURSE_TYPE_1",
|
||||
mobile: mobile
|
||||
}
|
||||
}
|
||||
},
|
||||
//慰问类型查询
|
||||
queryCondolenceType() {
|
||||
this.$axios.post("/platform/unionReimburse/apply/queryCondolenceType")
|
||||
@@ -499,8 +477,50 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, 'fundBalance', '查询失败');
|
||||
this.$message.error("经费余额查询失败");
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
// 初始化
|
||||
async init() {
|
||||
this.reimburseProjectList = await this.$businessTool.getDictOptions("UNION_REIMBURSE_PROJECT")
|
||||
if (this.bizId) {
|
||||
this.$axios.post("/platform/unionReimburse/apply/info", {id: this.bizId}).then(async (res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
// 确保在加载用户列表后再设置默认值
|
||||
await this.selectQueryUser('', this.userOptions)
|
||||
// 如果有慰问对象ID,确保userOptions中有对应数据
|
||||
if (this.formData.condolenceId) {
|
||||
// 检查userOptions中是否已存在该用户
|
||||
const existingUser = this.userOptions.find(user => user.id === this.formData.condolenceId);
|
||||
if (!existingUser && this.formData.condolenceName) {
|
||||
// 如果不存在但有名称信息,则手动添加
|
||||
this.userOptions.unshift({
|
||||
id: this.formData.condolenceId,
|
||||
userName: this.formData.condolenceName,
|
||||
mobile: this.formData.condolenceMobile || '',
|
||||
loginName: this.formData.condolenceLoginName || '',
|
||||
unitName: this.formData.condolenceUnitName || '',
|
||||
sex: this.formData.condolenceSex || ''
|
||||
});
|
||||
}
|
||||
}
|
||||
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const { username, loginname, id, unit, union, mobile } = this.$store.state.user
|
||||
this.formData = {
|
||||
userName: username,
|
||||
loginName: loginname,
|
||||
unitId: unit?.id,
|
||||
unitName: unit?.name,
|
||||
unionId: union?.id,
|
||||
unionName: union?.name,
|
||||
reimburseType: "UNION_REIMBURSE_TYPE_1",
|
||||
mobile: mobile,
|
||||
userId: id,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.queryCondolenceType()
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
const childManageInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
|
||||
<div>
|
||||
<div class="process-title">
|
||||
子女信息
|
||||
</div>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="就读年级">
|
||||
<dict-tag :options="dict.type.CHILD_MANAGE_GRADE"
|
||||
:value="viewData.childrenGrade">
|
||||
</dict-tag></el-descriptions-item>
|
||||
<el-descriptions-item label="入学年份">{{viewData.childrenYear}}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{viewData.childrenName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{viewData.childrenIdCard}}</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">{{viewData.childrenBirthday}}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{viewData.childrenSex}}</el-descriptions-item>
|
||||
<el-descriptions-item label="国籍">{{viewData.childrenCountry}}</el-descriptions-item>
|
||||
<el-descriptions-item label="就读学校">{{viewData.childrenCurrentSchool}}</el-descriptions-item>
|
||||
<el-descriptions-item label="中考总成绩">{{viewData.childrenMiddleScore}}</el-descriptions-item>
|
||||
<el-descriptions-item label="学科组合">{{viewData.childrenSubjectCombination}}</el-descriptions-item>
|
||||
<el-descriptions-item label="户籍所在地" :span="2">{{viewData.childrenHuKouAddress}}</el-descriptions-item>
|
||||
<el-descriptions-item label="监护人1">{{viewData.guardianUserName1}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{viewData.guardianMobile1}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工作单位">{{viewData.guardianUnitName1}}</el-descriptions-item>
|
||||
<el-descriptions-item label="监护人2">{{viewData.guardianUserName2}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{viewData.guardianMobile2}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工作单位">{{viewData.guardianUnitName2}}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{viewData.note}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<slot></slot>
|
||||
|
||||
</div>
|
||||
`,
|
||||
dicts: ["CHILD_MANAGE_GRADE"],
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
row: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.getInfo()
|
||||
},
|
||||
// 获取申请信息
|
||||
getInfo() {
|
||||
this.$axios.post('/platform/childManage/write/findOne', {id: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="就读年级">
|
||||
<el-select clearable placeholder="请选择就读年级"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.childrenGrade">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in dict.type.CHILD_MANAGE_GRADE"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="模糊查询">
|
||||
<el-input @keyup.enter.native="doSearch" clearable
|
||||
placeholder="请输入内容"
|
||||
v-model="pageForm.searchKeyword">
|
||||
<el-select placeholder="查询类型" slot="prepend"
|
||||
style="width: 100px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="子女姓名" value="info.childrenName"></el-option>
|
||||
<el-option label="监护人" value="info.guardianUserName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</search-item>
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.childrenSex">
|
||||
<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" placeholder="请选择分工会" clearable style="width: 100%"
|
||||
@change="flushUnits" @clear="flushUnits">
|
||||
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" style="width: 100%" v-model="pageForm.unitId" clearable
|
||||
filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool label="统计列表">
|
||||
<el-button @click="doExportExcel" size="mini" type="primary">导出汇总名单
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<!-- 添加横向滚动容器 -->
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 2000px">
|
||||
<el-table-column type="index" width="60" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="childrenGrade" label="年级" width="100">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.CHILD_MANAGE_GRADE"
|
||||
:value="row.childrenGrade">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="childrenYear" label="入学年份" width="100"></el-table-column>
|
||||
<el-table-column prop="childrenName" label="子女姓名" width="120"></el-table-column>
|
||||
<el-table-column prop="childrenSex" label="性别" width="80"></el-table-column>
|
||||
<el-table-column prop="childrenBirthday" label="出生日期" width="120"></el-table-column>
|
||||
<el-table-column prop="childrenBirthday" label="年龄" width="80">
|
||||
<template v-slot="scope">
|
||||
<span>{{ calculateAge(scope.row.childrenBirthday) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="childrenCurrentSchool" label="就读学校" width="150"></el-table-column>
|
||||
<el-table-column prop="guardianUserName1" label="监护人1" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianMobile1" label="手机号码" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianUnitName1" label="所在单位" width="150"></el-table-column>
|
||||
<el-table-column prop="guardianUserName2" label="监护人2" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianMobile2" label="手机号码" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianUnitName2" label="所在单位" width="150"></el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="250">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
<template #view>
|
||||
<child-manage-info ref="childManageInfoRef">
|
||||
</child-manage-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["CHILD_MANAGE_GRADE", "CHILD_MANAGE_GRADE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"child-manage-info": childManageInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: "/platform/childManage/manage/pageData",
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"),
|
||||
},
|
||||
unionOptions: [],
|
||||
unitOptions: []
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.childManageInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
}
|
||||
},
|
||||
calculateAge(birthday) {
|
||||
console.log('Birthday:', birthday);
|
||||
if (!birthday) return '';
|
||||
const birthDate = new Date(birthday);
|
||||
if (isNaN(birthDate.getTime())) {
|
||||
console.log('Invalid date:', birthday);
|
||||
return '';
|
||||
}
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
|
||||
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
}
|
||||
|
||||
console.log('Calculated age:', age);
|
||||
return age >= 0 ? age : '未出生';
|
||||
},
|
||||
openEdit(row) {
|
||||
window.location.href = '/platform/childManage/write?bizId=' + row.id + '&manage=1'
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/childManage/manage/doDelete", {id: id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
doExportExcel() {
|
||||
this.$downLoad("/platform/childManage/manage/doExportExcel", {
|
||||
data: JSON.stringify(this.pageForm)
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.table-container {
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 确保操作列在滚动时保持固定 */
|
||||
.el-table .el-table__fixed-right {
|
||||
height: 100% !important;
|
||||
background-color: #fff;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 设置表格单元格的最小宽度 */
|
||||
.el-table .el-table__body td {
|
||||
min-width: 60px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,173 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="填报列表">
|
||||
</table-tool>
|
||||
<!-- 添加一个带有横向滚动的容器 -->
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 2000px">
|
||||
<el-table-column type="index" width="60" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="childrenGrade" label="年级" width="100">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.CHILD_MANAGE_GRADE"
|
||||
:value="row.childrenGrade">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="childrenYear" label="入学年份" width="100"></el-table-column>
|
||||
<el-table-column prop="childrenName" label="子女姓名" width="120"></el-table-column>
|
||||
<el-table-column prop="childrenSex" label="性别" width="80"></el-table-column>
|
||||
<el-table-column prop="childrenBirthday" label="出生日期" width="120"></el-table-column>
|
||||
<el-table-column prop="childrenBirthday" label="年龄" width="80">
|
||||
<template v-slot="scope">
|
||||
<span>{{ calculateAge(scope.row.childrenBirthday) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="childrenCurrentSchool" label="就读学校" width="150"></el-table-column>
|
||||
<el-table-column prop="guardianUserName1" label="监护人1" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianMobile1" label="手机号码" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianUnitName1" label="所在单位" width="150"></el-table-column>
|
||||
<el-table-column prop="guardianUserName2" label="监护人2" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianMobile2" label="手机号码" width="120"></el-table-column>
|
||||
<el-table-column prop="guardianUnitName2" label="所在单位" width="150"></el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="250">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
|
||||
<template #view>
|
||||
<child-manage-info ref="childManageInfoRef">
|
||||
</child-manage-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["CHILD_MANAGE_GRADE"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"child-manage-info": childManageInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: "/platform/childManage/mine/pageData",
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"),
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(()=>{
|
||||
this.$refs.childManageInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
calculateAge(birthday) {
|
||||
console.log('Birthday:', birthday);
|
||||
if (!birthday) return '';
|
||||
const birthDate = new Date(birthday);
|
||||
if (isNaN(birthDate.getTime())) {
|
||||
console.log('Invalid date:', birthday);
|
||||
return '';
|
||||
}
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
|
||||
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
}
|
||||
|
||||
console.log('Calculated age:', age);
|
||||
return age >= 0 ? age : '未出生';
|
||||
},
|
||||
openEdit(row) {
|
||||
window.location.href = '/platform/childManage/write?bizId=' + row.id
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/childManage/mine/doDelete", {id: id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.table-container {
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 确保操作列在滚动时保持固定 */
|
||||
.el-table .el-table__fixed-right {
|
||||
height: 100% !important;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* 设置表格单元格的最小宽度 */
|
||||
.el-table .el-table__body td {
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
/* 确保固定列显示在最上层 */
|
||||
.el-table__fixed-right {
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,358 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<snaker-start slot="header" label="信息填报" define_key="XXTB"></snaker-start>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<table-tool label="子女信息"></table-tool>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="就读年级">
|
||||
<el-form-item prop="childRelationship">
|
||||
<el-select clearable placeholder="请选择就读年级"
|
||||
style="width: 100%;"
|
||||
v-model="formData.childrenGrade">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in dict.type.CHILD_MANAGE_GRADE"></el-option>
|
||||
</el-select>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="入学年份">
|
||||
<el-form-item prop="childrenBirthday">
|
||||
<el-date-picker
|
||||
v-model="formData.childrenYear"
|
||||
type="year"
|
||||
placeholder="请选择入学年份"
|
||||
style="width: 100%;"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
<el-form-item prop="childrenName">
|
||||
<el-input v-model="formData.childrenName" placeholder="请输入子女姓名"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">
|
||||
<el-form-item prop="childrenIdCard">
|
||||
<el-input v-model="formData.childrenIdCard" placeholder="请输入身份证号"
|
||||
maxlength="19">
|
||||
<el-button slot="append" icon="el-icon-search" @click="getIsRepeatByIdCard"></el-button>
|
||||
</el-input>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">
|
||||
<el-form-item prop="childrenBirthday">
|
||||
<el-date-picker
|
||||
v-model="formData.childrenBirthday"
|
||||
type="date"
|
||||
placeholder="请选择子女出生年月"
|
||||
style="width: 100%;"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<el-form-item prop="childrenSex">
|
||||
<el-select clearable placeholder="请选择性别"
|
||||
style="width: 100%;"
|
||||
v-model="formData.childrenSex">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
</el-select>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="国籍">
|
||||
<el-form-item prop="childrenCountry">
|
||||
<el-input v-model="formData.childrenCountry" placeholder="请输入子女国籍"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="就读学校">
|
||||
<el-form-item prop="childrenCurrentSchool">
|
||||
<el-input v-model="formData.childrenCurrentSchool" placeholder="请输入现就读学校"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="中考总成绩">
|
||||
<el-form-item prop="childrenMiddleScore">
|
||||
<el-input v-model="formData.childrenMiddleScore" placeholder="请输入中考总成绩"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item></el-descriptions-item></el-descriptions-item>
|
||||
<el-descriptions-item label="学科组合">
|
||||
<el-form-item prop="childrenSubjectCombination">
|
||||
<el-input v-model="formData.childrenSubjectCombination" placeholder="请输入学科组合"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item></el-descriptions-item></el-descriptions-item>
|
||||
<el-descriptions-item label="户籍所在地">
|
||||
<el-form-item prop="childrenHuKouAddress">
|
||||
<el-input v-model="formData.childrenHuKouAddress" placeholder="请输入户籍所在地"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item></el-descriptions-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<table-tool label="监护人信息"></table-tool>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="监护人1">
|
||||
<el-form-item label="监护人1" prop="guardianUserName1">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="formData.guardianUserName1"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名或工号查询"
|
||||
:remote-method="createRemoteMethod(userOptions)"
|
||||
@change="handleFatherChange"
|
||||
@clear="clearUserInfo"
|
||||
allow-create
|
||||
default-first-option>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName+'('+item.loginName+')'+'('+item.unitName+')'+'('+item.sex+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item></el-descriptions-item>
|
||||
<el-descriptions-item label="工号" >
|
||||
<el-form-item prop="guardianLoginName1">{{formData.guardianLoginName1}}
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号码">
|
||||
<el-form-item prop="guardianMobile1">
|
||||
<el-input v-model="formData.guardianMobile1" placeholder="请输入手机号码" maxlength="30"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所在单位">
|
||||
<el-form-item prop="unitName1">
|
||||
<el-input v-model="formData.guardianUnitName1" placeholder="请输入所在单位" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监护人2">
|
||||
<el-form-item label="监护人2" prop="guardianUserName2">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="formData.guardianUserName2"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名或工号查询"
|
||||
:remote-method="createRemoteMethod(userOptions2)"
|
||||
@change="handleMotherChange"
|
||||
@clear="clearUserInfo2"
|
||||
allow-create
|
||||
default-first-option>
|
||||
<el-option
|
||||
v-for="item in userOptions2"
|
||||
:key="item.id"
|
||||
:label="item.userName+'('+item.loginName+')'+'('+item.unitName+')'+'('+item.sex+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
<el-form-item prop="guardianLoginName2">{{formData.guardianLoginName2}}
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号码">
|
||||
<el-form-item prop="guardianMobile2">
|
||||
<el-input v-model="formData.guardianMobile2" placeholder="请输入手机号码" maxlength="30"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所在单位">
|
||||
<el-form-item prop="guardianUnitName2">
|
||||
<el-input v-model="formData.guardianUnitName2" placeholder="请输入所在单位" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">
|
||||
<el-form-item prop="note">
|
||||
<el-input v-model="formData.note" placeholder="请填写备注"
|
||||
maxlength="50"></el-input>
|
||||
</el-form-item></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
<el-button type="primary" plain @click="onSave">保存</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
dicts: ["CHILD_MANAGE_GRADE"],
|
||||
data() {
|
||||
return {
|
||||
bizId: GetQueryString("bizId"),
|
||||
formData: {},
|
||||
userOptions: [],
|
||||
userOptions2: [], // 添加母亲的用户选项
|
||||
formRules: {
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clearUserInfo() {
|
||||
// 清空监护人1相关信息
|
||||
this.$set(this.formData, "guardianUserName1", "")
|
||||
this.$set(this.formData, "guardianLoginName1", "")
|
||||
this.$set(this.formData, "guardianMobile1", "")
|
||||
this.$set(this.formData, "guardianUnitName1", "")
|
||||
},
|
||||
|
||||
clearUserInfo2() {
|
||||
// 清空监护人2相关信息
|
||||
this.$set(this.formData, "guardianUserName2", "")
|
||||
this.$set(this.formData, "guardianLoginName2", "")
|
||||
this.$set(this.formData, "guardianMobile2", "")
|
||||
this.$set(this.formData, "guardianUnitName2", "")
|
||||
},
|
||||
|
||||
createRemoteMethod(options) {
|
||||
return (keyword) => {
|
||||
this.selectQueryUser(keyword, options)
|
||||
}
|
||||
},
|
||||
|
||||
// 查询监护人对象
|
||||
selectQueryUser(keyword, options) {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/childManage/write/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 监护人1选择变化处理(支持手动输入)
|
||||
handleFatherChange(val) {
|
||||
// 先查找是否是选择的用户
|
||||
const user = this.userOptions.find(o => o.userName === val || o.id === val);
|
||||
if (user) {
|
||||
// 如果是选择的用户,保存完整信息
|
||||
this.$set(this.formData, "guardianUserName1", user.userName);
|
||||
this.$set(this.formData, "guardianUserId1", user.id);
|
||||
this.$set(this.formData, "guardianLoginName1", user.loginName);
|
||||
this.$set(this.formData, "guardianUnionId1", user.unionId);
|
||||
this.$set(this.formData, "guardianUnionName1", user.unionName);
|
||||
this.$set(this.formData, "guardianMobile1", user.mobile);
|
||||
this.$set(this.formData, "guardianUnitId1", user.unitId);
|
||||
this.$set(this.formData, "guardianUnitName1", user.unitName);
|
||||
} else {
|
||||
// 如果是手动输入的姓名,只设置姓名,其他字段清空
|
||||
this.$set(this.formData, "guardianUserName1", val || "")
|
||||
this.$set(this.formData, "guardianUserId1", "")
|
||||
this.$set(this.formData, "guardianLoginName1", "")
|
||||
this.$set(this.formData, "guardianUnionId1", "")
|
||||
this.$set(this.formData, "guardianUnionName1", "")
|
||||
this.$set(this.formData, "guardianMobile1", "")
|
||||
this.$set(this.formData, "guardianUnitId1", "")
|
||||
this.$set(this.formData, "guardianUnitName1", "")
|
||||
}
|
||||
},
|
||||
|
||||
// 监护人2选择变化处理(支持手动输入)
|
||||
handleMotherChange(val) {
|
||||
// 先查找是否是选择的用户
|
||||
const user = this.userOptions2.find(o => o.userName === val || o.id === val);
|
||||
if (user) {
|
||||
// 如果是选择的用户,保存完整信息
|
||||
this.$set(this.formData, "guardianUserId2", user.id);
|
||||
this.$set(this.formData, "guardianUserName2", user.userName);
|
||||
this.$set(this.formData, "guardianLoginName2", user.loginName);
|
||||
this.$set(this.formData, "guardianUnionId2", user.unionId);
|
||||
this.$set(this.formData, "guardianUnionName2", user.unionName);
|
||||
this.$set(this.formData, "guardianMobile2", user.mobile);
|
||||
this.$set(this.formData, "guardianUnitId2", user.unitId);
|
||||
this.$set(this.formData, "guardianUnitName2", user.unitName);
|
||||
} else {
|
||||
// 如果是手动输入的姓名,只设置姓名,其他字段清空
|
||||
this.$set(this.formData, "guardianUserName2", val || "")
|
||||
this.$set(this.formData, "guardianUserId2", "")
|
||||
this.$set(this.formData, "guardianLoginName2", "")
|
||||
this.$set(this.formData, "guardianUnionId2", "")
|
||||
this.$set(this.formData, "guardianUnionName2", "")
|
||||
this.$set(this.formData, "guardianMobile2", "")
|
||||
this.$set(this.formData, "guardianUnitId2", "")
|
||||
this.$set(this.formData, "guardianUnitName2", "")
|
||||
}
|
||||
},
|
||||
|
||||
async getIsRepeatByIdCard() {
|
||||
if (!this.formData.childrenIdCard) {
|
||||
this.$message.error("请填写子女身份证号码")
|
||||
return
|
||||
}
|
||||
const res = await this.$axios.post('/platform/childManage/write/getIsRepeatByIdCard', {
|
||||
idCard: this.formData.childrenIdCard,
|
||||
id: this.formData.id
|
||||
})
|
||||
if (res.code === 0) {
|
||||
if (res.data > 0) {
|
||||
this.$message.error("该身份证在本年度已填报!")
|
||||
return true
|
||||
} else {
|
||||
this.$message.success("该身份证在本年度暂未填报!")
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
// 保存方法
|
||||
onSave() {
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/childManage/write/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
if (GetQueryString('manage') === '1') {
|
||||
window.location.href = '/platform/childManage/manage'
|
||||
}else {
|
||||
window.location.href = '/platform/childManage/mine'
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
async findOne(id) {
|
||||
const resp = await $.get('/platform/childManage/write/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
}
|
||||
},
|
||||
|
||||
init() {
|
||||
if (this.bizId) {
|
||||
this.findOne(this.bizId).then(async data => {
|
||||
this.formData = data
|
||||
})
|
||||
} else {
|
||||
const {id, username, loginname, mobile, union, unit} = this.$store.state.user
|
||||
this.formData = {
|
||||
userId: id,
|
||||
userName: username,
|
||||
loginName: loginname,
|
||||
unitName: unit.name,
|
||||
unitId: unit.id,
|
||||
unionName: union.name,
|
||||
unionId: union.id,
|
||||
mobile: mobile,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user