This commit is contained in:
姚宇浩 2024-08-16 14:07:47 +08:00
commit 80af4af2c3
2 changed files with 136 additions and 21 deletions

View File

@ -25,6 +25,21 @@
> >
<template v-for="item in data.columns"> <template v-for="item in data.columns">
<el-table-column <el-table-column
v-if="item.type == 'slot'"
:label="item.label"
:prop="item.property"
:width="item.width || ''"
>
<template #default="scope">
<!-- 补助类型 -->
<div v-if="item.property == 'bzlx'">
<div v-if="scope.row.bzlx == '1'">高龄津贴</div>
<div v-else>老年人综合能力评估</div>
</div>
</template>
</el-table-column>
<el-table-column
v-else
:label="item.label" :label="item.label"
:width="item.width || ''" :width="item.width || ''"
:prop="item.property" :prop="item.property"
@ -85,8 +100,7 @@
:total="pagination1.total" :total="pagination1.total"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
@size-change="handleSizeChange" @current-change="handlePagination1"
@current-change="handleCurrentChange"
v-model:current-page="pagination1.currentPage" v-model:current-page="pagination1.currentPage"
/> />
</div> </div>
@ -116,6 +130,7 @@
@click="change" @click="change"
/> />
</span> </span>
<div v-else class="text_1">未享受对象</div>
</div> </div>
</div> </div>
<div style="width: 97.5%; position: relative"> <div style="width: 97.5%; position: relative">
@ -131,6 +146,21 @@
> >
<template v-for="item in data.column_2"> <template v-for="item in data.column_2">
<el-table-column <el-table-column
v-if="item.type == 'slot'"
:label="item.label"
:prop="item.property"
:width="item.width || ''"
>
<template #default="scope">
<!-- 补助类型 -->
<div v-if="item.property == 'bzlx'">
<div v-if="scope.row.bzlx == 1">高龄津贴</div>
<div v-else>老年人综合能力评估</div>
</div>
</template>
</el-table-column>
<el-table-column
v-else
:label="item.label" :label="item.label"
:width="item.width || ''" :width="item.width || ''"
:prop="item.property" :prop="item.property"
@ -144,7 +174,7 @@
:total="pagination2.total" :total="pagination2.total"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
@current-change="handle2" @current-change="handlePagination2"
v-model:current-page="pagination2.currentPage" v-model:current-page="pagination2.currentPage"
/> />
</div> </div>
@ -161,9 +191,9 @@ const router = useRouter();
const routers = useRoute(); const routers = useRoute();
const data = reactive({ const data = reactive({
name: "", name: "",
tabelshow: false, tabelshow: true,
pagedData: [], pagedData: [],
first: true, first: 1,
columns: [], columns: [],
column_1: [], column_1: [],
column_2: [], column_2: [],
@ -611,12 +641,12 @@ const formData = reactive({
columns: [ columns: [
{ {
label: "姓名", label: "姓名",
property: "fullName", property: "xm",
width: "90", width: "90",
}, },
{ {
label: "地址", label: "地址",
property: "address", property: "dz",
}, },
{ {
label: "年龄", label: "年龄",
@ -625,8 +655,13 @@ const formData = reactive({
}, },
{ {
label: "补助类型", label: "补助类型",
property: "subsidyType", property: "bzlx", //10
type: "slot",
}, },
// {
// label: "",
// property: "identNo",
// },
], ],
column_1: [ column_1: [
{ {
@ -654,12 +689,12 @@ const formData = reactive({
column_2: [ column_2: [
{ {
label: "姓名", label: "姓名",
property: "fullName", property: "xm",
width: "90", width: "90",
}, },
{ {
label: "地址", label: "地址",
property: "address", property: "dz",
}, },
{ {
label: "年龄", label: "年龄",
@ -668,7 +703,8 @@ const formData = reactive({
}, },
{ {
label: "补助类型", label: "补助类型",
property: "subsidyType", property: "bzlx", //10
type: "slot",
}, },
], ],
tableData: [ tableData: [
@ -1414,16 +1450,19 @@ const formData = reactive({
}); });
// 123 // 123
const pagination = reactive({ const pagination = reactive({
url: "",
total: 10, total: 10,
pageSize: 20, pageSize: 20,
currentPage: 1, currentPage: 1,
}); });
const pagination1 = reactive({ const pagination1 = reactive({
url: "",
total: 10, total: 10,
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
}); });
const pagination2 = reactive({ const pagination2 = reactive({
url: "",
total: 10, total: 10,
pageSize: 20, pageSize: 20,
currentPage: 1, currentPage: 1,
@ -1432,13 +1471,48 @@ const pagination2 = reactive({
const handlePagination = (current) => { const handlePagination = (current) => {
// console.log(current,"page1"); // console.log(current,"page1");
pagination.currentPage = current; pagination.currentPage = current;
getTable("/api/ggfwyth/pg/lyxsdbrymd", pagination.currentPage); switch (data.name) {
case "最低生活保障":
getTable(pagination);
break;
case "老年人福利补贴":
getServiceList(pagination, 1);
break;
case "慢性病患者健康管理":
break;
case "义务教育学生生活补助":
break;
case "义务教育学生营养改善计划":
break;
default:
break;
}
}; };
const handleSizeChange = (val) => { const handlePagination1 = (val) => {
const startIndex = (val - 1) * 10; const startIndex = (val - 1) * 10;
const endIndex = val * 10; const endIndex = val * 10;
data.pagedData = data.tableData1.slice(startIndex, endIndex); data.pagedData = data.tableData1.slice(startIndex, endIndex);
}; };
const handlePagination2 = (current) => {
pagination2.currentPage = current;
switch (data.name) {
case "最低生活保障":
// getTable(pagination);
break;
case "老年人福利补贴":
getServiceList(pagination2, 0);
break;
case "慢性病患者健康管理":
break;
case "义务教育学生生活补助":
break;
case "义务教育学生营养改善计划":
break;
default:
break;
}
};
const handleCurrentChange = (val) => { const handleCurrentChange = (val) => {
console.log(data.tableData1, val); console.log(data.tableData1, val);
const startIndex = (val - 1) * 10; const startIndex = (val - 1) * 10;
@ -1481,12 +1555,15 @@ const rowState = (row) => {
} }
}; };
const change = (name, index) => { const change = () => {
data.first = !data.first; data.first = data.first == 1 ? 0 : 1;
console.log(data.first);
}; };
const getTable = async (url, currentPage) => { const getTable = async (pagination) => {
await http await http
.get(`${url}?page=${currentPage}&size=${pagination.pageSize}`) .get(
`${pagination.url}?page=${pagination.currentPage}&size=${pagination.pageSize}`
)
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
data.tableData = res.data; data.tableData = res.data;
@ -1495,6 +1572,31 @@ const getTable = async (url, currentPage) => {
} }
}); });
}; };
/**
* 服务清单
* @param {*} pagination - 分页对象包含当前页码和每页显示的条数和请求的URL地址
* @param {number} sfxs - 是否享受1表示是0表示否
*/
const getServiceList = async (pagination, sfxs) => {
await http
.get(
`${pagination.url}?page=${pagination.currentPage}&size=${pagination.pageSize}&sfxs=${sfxs}`
)
.then((res) => {
if (res.code == 200) {
if (sfxs) {
data.tableData = res.data;
pagination.total = res.count;
console.log(data.tableData2);
} else {
data.tableData2 = res.data;
pagination2.total = res.count;
}
}
});
};
const handleRowClick = (row, column, event) => { const handleRowClick = (row, column, event) => {
// row // row
console.log(row); console.log(row);
@ -1523,13 +1625,18 @@ const listAssignment = () => {
case "最低生活保障": case "最低生活保障":
updateFormDataAndTable("低保", formData.dbTableData); updateFormDataAndTable("低保", formData.dbTableData);
data.tableData2 = formData.dbTableData.resultsList; data.tableData2 = formData.dbTableData.resultsList;
getTable("/api/ggfwyth/pg/lyxsdbrymd", pagination.currentPage); pagination.url = "/api/ggfwyth/pg/lyxsdbrymd";
getTable(pagination);
break; break;
case "老年人福利补贴": case "老年人福利补贴":
data.tabelshow = false;
updateFormDataAndTable("户籍老年人", formData.hjlnrTableData); updateFormDataAndTable("户籍老年人", formData.hjlnrTableData);
pagination.url = "/api/ggfwyth/pg/lnrfw";
pagination2.url = "/api/ggfwyth/pg/lnrfw";
getServiceList(pagination, 1);
getServiceList(pagination2, 0);
break; break;
case "慢性病患者健康管理": case "慢性病患者健康管理":
data.tabelshow = true;
updateFormDataAndTable("两慢病患者", formData.lmbhzTableData); updateFormDataAndTable("两慢病患者", formData.lmbhzTableData);
break; break;
case "义务教育学生生活补助": case "义务教育学生生活补助":
@ -1819,6 +1926,7 @@ onMounted(() => {
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
span { span {
font-size: 23px; font-size: 23px;
font-weight: 500; font-weight: 500;
@ -1907,6 +2015,13 @@ onMounted(() => {
top: 1px; top: 1px;
align-items: center; align-items: center;
} }
.text_1 {
font-size: 20px;
font-weight: 500;
color: #4787a8;
font-family: titleNore;
margin-right: 20px;
}
.gTitle { .gTitle {
position: absolute; position: absolute;
color: #acd1f1; color: #acd1f1;

View File

@ -3317,9 +3317,9 @@ onMounted(async () => {
font-size: 16px; font-size: 16px;
line-height: 28px; line-height: 28px;
background: rgba(124, 151, 180, 0.8); background: rgba(124, 151, 180, 0.8);
// padding: 10px;
margin-bottom: 4px; margin-bottom: 4px;
position: relative; position: relative;
// padding: 10px;
/* 必须设置 position 属性以便伪元素定位 */ /* 必须设置 position 属性以便伪元素定位 */
// border-radius: 5px; // border-radius: 5px;
} }