This commit is contained in:
duanxiaohai 2024-09-14 17:17:26 +08:00
commit 8f3d1e468c
2 changed files with 77 additions and 84 deletions

View File

@ -41,15 +41,15 @@
</div> </div>
<div style="width: 100%; height: calc(100% - 110px)" class="table-els"> <div style="width: 100%; height: calc(100% - 110px)" class="table-els">
<div class="tabelHead"> <div class="tabelHead">
<!-- <div><span>姓名</span>{{ data.tableData.xq.xm }}</div> --> <div><span>姓名</span>{{data.xq.xm }}</div>
<div><span>地址</span>{{ data.character.dz }}</div> <div><span>地址</span>{{ data.xq.dz }}</div>
<div><span>年龄</span>{{ data.character.age }}</div> <div><span>年龄</span>{{data.xq.nl }}</div>
<div><span>标签</span>{{ data.character.titleName }}</div> <div><span>标签</span>{{ data.xq.bq }}</div>
<div class="status"> <div class="status">
<div class="statusMessage"> <div class="statusMessage">
<span>状态</span> <span>状态</span>
<img <img
:src="lampImages[data.character.deng]" :src="lampImages[data.xq.deng]"
@click="escalation" @click="escalation"
/> />
</div> </div>
@ -64,10 +64,9 @@
</div> </div>
</div> </div>
<el-table <el-table
:data="data.tableData" :data="data.tableData"
height="100%" height="100%"
:key="tableKey"
:header-cell-style="{ background: 'rgba(0, 143, 205, 0.63)' }" :header-cell-style="{ background: 'rgba(0, 143, 205, 0.63)' }"
@row-click="handleRowClick" @row-click="handleRowClick"
> >
@ -81,9 +80,10 @@
> >
<template #default="scope"> <template #default="scope">
<!-- 状态 --> <!-- 状态 -->
<div v-if="item.property == 'zt'"> <div v-if="item.property == 'deng'">
<div v-if="scope.row.zt == 1" class="progressGreen"></div>
<div v-if="scope.row.zt == 2" class="progressYellow"></div> <div v-if="scope.row.deng == 1" class="progressGreen"></div>
<div v-if="scope.row.deng == 2" class="progressYellow"></div>
<!-- <div v-for="index in 3" :key="index"> <!-- <div v-for="index in 3" :key="index">
<img <img
style="width: 30px; height: 30px" style="width: 30px; height: 30px"
@ -112,18 +112,6 @@
</el-table> </el-table>
</div> </div>
<!-- <div class="pagePart">
<el-pagination
background
layout="prev, pager, next,total"
:page-size="pagination.pageSize"
:total="pagination.total"
prev-text="上一页"
next-text="下一页"
@current-change="handle"
v-model:current-page="pagination.currentPage"
/>
</div> -->
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -246,7 +234,7 @@ const data = reactive({
typeId: "", typeId: "",
columns: [], columns: [],
tableData: [], tableData: [],
character: [], xq:{},
// pagination: {}, // pagination: {},
}); });
// 使 // 使
@ -263,49 +251,63 @@ const lampImages = {
}; };
const gridData = []; const gridData = [];
// //
const tableKey = ref(Math.random());
// //
watch( watch(
() => props.dialogShow, () => props.dialogShow,
(newVal, oldVal) => { (newVal, oldVal) => {
console.log(11111111);
dialogShow.value = newVal; dialogShow.value = newVal;
if(props.dialogShow==true){
console.log(333);
console.log(props.tableData);
data.xq=props.tableData.data.xq;
// data.tableData=props.tableData.data;
data.title=props.tableData.title;
data.columns=props.tableData.columns;
if(props.tableData.data.wxs.length>0){
props.tableData.data.wxs.forEach((item,index)=>{
let obj={
deng:2,
fwsx:item.fwsx,
}
data.tableData.push(obj);
})
}
if(props.tableData.data.ysx.length>0){
console.log(444);
props.tableData.data.ysx.forEach((item,index)=>{
let obj={
deng:1,
fwsx:item.fwsx,
}
data.tableData.push(obj);
})
}
}
// data.tableData = props.tableData; // data.tableData = props.tableData;
data.columns = props.columns; // data.columns = props.columns;
console.log("状态5", props.columns);
}
);
watch(
() => props.typeId,
(newVal, oldVal) => {
dialogShow.value = newVal;
data.typeId = props.typeId;
console.log("状态6", props.typeId);
} }
); );
watch( watch(
() => props.tableData, () => props.tableData,
(newVal, oldVal) => { (newVal, oldVal) => {
data.tableData = props.tableData;
console.log("状态7", props.tableData); // data.tableData = props.tableData;
// tableKey.value = Math.random(); // console.log("1", data);
} }
); );
// watch(
// () => props.character,
// (newVal, oldVal) => {
// data.character = props.character;
// }
// );
// 使 // 使
onMounted(() => { onMounted(() => {
dialogShow.value = props.dialogShow; dialogShow.value = props.dialogShow;
data.columns = props.columns; // data.columns = props.columns;
data.title = props.title; // data.title = props.title;
data.typeId = props.typeId; // data.tableData = props.tableData;
data.tableData = props.tableData; // console.log("", data);
console.log("状态", props.tableData);
// const paginationTotal = document.querySelector(".el-pagination__total");
// paginationTotal.innerText = ` ${props.pagination.total} `;
}); });
// onBeforeMount(() => { // onBeforeMount(() => {
// dialogShow.value = props.dialogShow; // dialogShow.value = props.dialogShow;
@ -322,10 +324,6 @@ const closeDialog = () => {
clicked.value = false; clicked.value = false;
emit("close"); emit("close");
}; };
//
const handle = (current) => {
emit("handle", current);
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -169,7 +169,7 @@
style="width: 30px; height: 30px" style="width: 30px; height: 30px"
v-if="scope.row.deng == 0" v-if="scope.row.deng == 0"
:src="lampImages[1]" :src="lampImages[1]"
@click="statusDetails(scope.row)"
/> />
<img <img
style="width: 30px; height: 30px" style="width: 30px; height: 30px"
@ -215,9 +215,7 @@
<DialogLamp <DialogLamp
:dialogShow="dialogShow" :dialogShow="dialogShow"
:title="tableType.title" :title="tableType.title"
:typeId="tableType.typeId" :tableData="tableType"
:tableData="tableType.data"
:columns="tableType.columns"
@close="closeJj" @close="closeJj"
> >
</DialogLamp> </DialogLamp>
@ -411,7 +409,7 @@ const lampScreen = (val) => {
const dialogShow = ref(false); const dialogShow = ref(false);
const tableType = reactive({ const tableType = reactive({
url: `/api/ggfwyth/pg/fwjgqdxq`, url: `/api/ggfwyth/pg/fwjgqdxq`,
title: "", title: "服务详情",
typeId: "", typeId: "",
data: [], data: [],
columns: [ columns: [
@ -422,31 +420,31 @@ const tableType = reactive({
align: "center", align: "center",
}, },
{ {
label: "姓名", label: "服务内容",
property: "xm", property: "fwsx",
width: "110",
}, },
{ {
label: "结果", label: "结果",
property: "deng", property: "deng",
width: "90", width: "290",
align: "center", align: "center",
type: "slot", type: "slot",
}, },
{ // {
label: "地址", // label: "",
property: "dz", // property: "dz",
}, // },
{ // {
label: "年龄", // label: "",
property: "nl", // property: "nl",
width: "60", // width: "60",
}, // },
{ // {
label: "人口标签", // label: "",
property: "bq", // property: "bq",
type: "slot", // type: "slot",
}, // },
// { // {
// label: "", // label: "",
@ -465,8 +463,6 @@ const tableType = reactive({
}); });
// //
const statusDetails = (val) => { const statusDetails = (val) => {
tableType.title = `服务详情`;
data.identNo = val.sfzhm; data.identNo = val.sfzhm;
if (data.identNo == null) { if (data.identNo == null) {
ElMessage.warning({ ElMessage.warning({
@ -475,9 +471,7 @@ const statusDetails = (val) => {
}); });
} else { } else {
getTable1(tableType); getTable1(tableType);
setTimeout(() => {
dialogShow.value = true;
}, 300);
} }
}; };
// //
@ -525,7 +519,8 @@ const getTable1 = (pagination) => {
http.get(`${pagination.url}?sfzhm=${data.identNo}`).then((res) => { http.get(`${pagination.url}?sfzhm=${data.identNo}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
tableType.data = res.data; tableType.data = res.data;
tableType.typeId = routers.query.id; tableType.typeId = routers.query.id;
dialogShow.value = true;
} }
}); });
}; };