From b5cb047de1308844583d07d7fc5ff5c5c2accec7 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期四, 12 十二月 2024 13:56:55 +0800 Subject: [PATCH] 修改表格 --- src/views/doctor/checkAll/index.vue | 205 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 146 insertions(+), 59 deletions(-) diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue index b99cdc6..ef54aa3 100644 --- a/src/views/doctor/checkAll/index.vue +++ b/src/views/doctor/checkAll/index.vue @@ -247,7 +247,7 @@ <div class="top"> <table style=" - width: 98%; + width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse; @@ -311,32 +311,32 @@ <div style="margin-right: 10px; display: flex" class="btnbox"> <div class="btn1" v-if="msgtuwen == 'y' || msgtuwen == 'Y'"> - <el-button @click="Graphicreport()" type="primary" - >鍥炬枃鎶ュ憡</el-button - > + <el-button @click="Graphicreport()" type="primary"> + <span class="vertical-text">鍥炬枃鎶ュ憡</span> + </el-button> </div> <div class="btn1"> <el-button @click="historicalreport()" type="primary" - >鍘嗗彶鎶ュ憡</el-button + ><span class="vertical-text">鍘嗗彶鎶ュ憡</span></el-button > </div> <div v-if="tableAll.tjCategory == '02'" class="btn1"> <el-button @click="medicalhistory()" type="primary" - >鑱屼笟鐥呭彶</el-button + ><span class="vertical-text">鑱屼笟鐥呭彶</span></el-button > </div> <div class="btn1" v-if="msgjianqian == 'y' || msgjianqian == 'Y'"> - <el-button @click="jianqian()" type="primary">妫�鍓嶉棶璇�</el-button> + <el-button @click="jianqian()" type="primary"><span class="vertical-text">妫�鍓嶉棶璇�</span></el-button> </div> <div class="btn1"> <el-button @click="xiangmuqingkuang()" type="primary" - >椤圭洰鎯呭喌</el-button + ><span class="vertical-text">椤圭洰鎯呭喌</span></el-button > </div> <div class="btn1"> <el-button @click="yichangjieguo()" type="primary" - >寮傚父缁撴灉</el-button + ><span class="vertical-text">寮傚父缁撴灉</span></el-button > </div> </div> @@ -346,7 +346,7 @@ style=" font-size: 14px; height: calc(100% - 11%); - width: 1300px; + width: 1100px; margin-left: 10px; " > @@ -368,7 +368,7 @@ :row-style="changRed" :header-cell-style="{ background: '#aad8df' }" > - <el-table-column align="center" label="妫�娴嬮」鐩�" width="240"> + <el-table-column align="center" label="妫�娴嬮」鐩�" width="464"> <template slot-scope="scope"> <div>{{ scope.row.proName }}</div> </template> @@ -611,7 +611,7 @@ <div class="rightbox"> <div class="right"> - <template v-if="status == 0"> + <template v-if="status1 == 0"> <div v-for="(item, index) in yichangList" :key="index"> <div style=" @@ -622,15 +622,36 @@ > {{ item.proName || "" }} </div> - <el-table + <template v-if="item.jyjc == '0'"> + <el-table :stripe="true" :row-style="red" :data="item.sone" border style="width: 100%" :header-cell-style="{ background: '#67C23A' }" + :expand-row-keys="expends" + :row-key="getRowKeys" > - <el-table-column align="center" label="妫�娴嬮」鐩�" width="220"> + <el-table-column type="expand"> + <template slot-scope="props"> + <div + v-if="props.row.advices && props.row.advices.length > 0" + > + <div + v-for="(jianyi, index1) in props.row.advices" + :key="index1" + style="padding: 0 10px; margin-bottom: 10px" + > + <div>鏍囬锛歿{ jianyi.bt || "" }}</div> + <div>鍐呭锛歿{ jianyi.nr || "" }}</div> + </div> + </div> + <div v-else style="padding: 0 10px">鏆傛棤鍐呭</div> + </template> + </el-table-column> + + <el-table-column align="center" label="妫�娴嬮」鐩�" width="335"> <template slot-scope="scope"> <div>{{ scope.row.proName }}</div> </template> @@ -639,7 +660,7 @@ align="center" prop="proResult" label="妫�娴嬬粨鏋�" - width="160" + width="85" > </el-table-column> @@ -647,14 +668,65 @@ align="center" prop="stanId" label=" 鍙傝�冭寖鍥�" + width="117" > </el-table-column> - <el-table-column align="center" prop="proAdvice" label="鍗曚綅"> + + <el-table-column + align="center" + prop="proAdvice" + label="鍗曚綅" + width="78" + > </el-table-column> </el-table> + </template> + <template v-if="item.jyjc == '1'"> + <el-table + :stripe="true" + :row-style="red" + :data="item.sone" + border + style="width: 100%" + :header-cell-style="{ background: '#67C23A' }" + :expand-row-keys="expends" + :row-key="getRowKeys" + > + <el-table-column type="expand"> + <template slot-scope="props"> + <div + v-if="props.row.advices && props.row.advices.length > 0" + > + <div + v-for="(jianyi, index1) in props.row.advices" + :key="index1" + style="padding: 0 10px; margin-bottom: 10px" + > + <div>鏍囬锛歿{ jianyi.bt || "" }}</div> + <div>鍐呭锛歿{ jianyi.nr || "" }}</div> + </div> + </div> + <div v-else style="padding: 0 10px">鏆傛棤鍐呭</div> + </template> + </el-table-column> + + <el-table-column align="center" label="妫�娴嬮」鐩�" width="250"> + <template slot-scope="scope"> + <div>{{ scope.row.proName }}</div> + </template> + </el-table-column> + <el-table-column + align="center" + prop="proResult" + label="妫�娴嬬粨鏋�" + width="366" + > + </el-table-column> + </el-table> + </template> </div> </template> - <template v-if="status == 1"> + <template v-if="status1 == 1"> <div> <div style=" @@ -670,19 +742,12 @@ :data="statusList" style="width: 100%" :header-cell-style="{ background: '#e6a23c' }" - :expand-row-keys="expends" - :row-key="getRowKeys" :stripe="true" > - <el-table-column type="expand"> - <template slot-scope="props"> - <span>{{ props.row.deptName }}</span> - </template> - </el-table-column> <el-table-column align="center" label="閮ㄩ棬" - width="160" + width="185" prop="deptName" > </el-table-column> @@ -690,7 +755,7 @@ align="center" prop="proName" label="椤圭洰" - width="160" + width="260" > </el-table-column> @@ -1362,7 +1427,7 @@ tjCategory: undefined, payType: undefined, }, - status: 0, // 0灞曠ず寮傚父1灞曠ず椤圭洰鎯呭喌 + status1: 0, // 0灞曠ず寮傚父1灞曠ず椤圭洰鎯呭喌 viewportHeight: 0, expends: [], }; @@ -1395,18 +1460,21 @@ }, //璁剧疆table涓殑鎵╁睍椤癸紝灞曞紑鐨刬d锛屾澶勬垜闇�瑕佸叏閮ㄥ睍寮� getExpends() { - var proId = this.statusList.map((item) => item.proId); - this.expends = proId; + // 閫氳繃flatMap灏嗘瘡涓猻one鏁扮粍涓殑ID鎻愬彇鍑烘潵锛屽苟杩斿洖涓�涓墎骞冲寲鐨処D鏁扮粍 + this.expends = this.yichangList.flatMap((item) => + item.sone.map((subItem) => subItem.proId) + ); }, + getRowKeys(row) { return row.proId; }, // 椤圭洰鎯呭喌 xiangmuqingkuang() { cSWebGetPro(this.tjNumber).then((res) => { - this.status = 1; + this.status1 = 1; this.statusList = res.data; - this.getExpends(); + if (this.statusList.length == 0) { _this.$message.msgSuccess("鏆傛棤椤圭洰鎯呭喌"); } @@ -1416,14 +1484,18 @@ this.drawer = false; }, yichangjieguo() { - this.status = 0; + this.status1 = 0; let _this = this; yichang({ tjNum: this.tjNumber, }).then((res) => { this.yichangList = res.data; - if (this.yichangList.length == 0) { - _this.$message.msgSuccess("鏆傛棤寮傚父鎶ュ憡"); + this.getExpends(); + if(!this.yichangList){ + this.$message({ + type: "warning ", + message: "鏆傛棤寮傚父鎶ュ憡", + }); } }); }, @@ -1883,8 +1955,8 @@ getState(this.tjNumber).then((res) => { this.status = res.data; - - if (this.status.status === "1") { + if (this.status) { + if (this.status.status === "1") { this.yichangjieguo(); getInfo().then((response) => { this.userId = response.user.userId; @@ -2009,6 +2081,13 @@ this.drawer = false; } + } else { + this.$message({ + type: "warning", + message: "璇风◢鍚庨噸璇�", + }); + } + }); // 鑾峰彇灏忕粨 @@ -2255,69 +2334,68 @@ .btn { margin: 20px 0px; } -/* 鎸夐挳鐨勫垵濮嬬姸鎬� */ .btnbox { display: flex; flex-direction: column; gap: 10px; /* 鎸夐挳涔嬮棿鐨勯棿璺� */ position: fixed; /* 浣挎暣涓寜閽尯鍩熷浐瀹氬湪椤甸潰 */ - right: 0; /* 鍥哄畾鍦ㄩ〉闈㈠彸渚� */ - top: 20%; /* 鍒濆浣嶇疆 */ + right: 0; /* 鍥哄畾鍦ㄩ〉闈㈠彸渚� */ + top: 20%; /* 鍒濆浣嶇疆 */ z-index: 10; } /* 姣忎釜鎸夐挳鐨勬牱寮� */ .btn1 { - animation: fadeInUp 0.5s ease-out forwards; /* 鎸夐挳鍔犺浇鏃剁殑娣″叆鍔ㄧ敾 */ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; + animation: fadeInUp 0.5s ease-out forwards; /* 鎸夐挳鍔犺浇鏃剁殑娣″叆鍔ㄧ敾 */ cursor: pointer; - writing-mode: vertical-rl; /* 鎸夐挳鏂囨湰绔栫洿鎺掑垪 */ - text-align: center; /* 鏂囧瓧灞呬腑 */ + text-align: center; +} +.vertical-text { + writing-mode: vertical-rl; + text-orientation: upright; + } /* 璁剧疆鍔ㄧ敾鏁堟灉 */ @keyframes fadeInUp { 0% { opacity: 0; - transform: translateY(20px) scale(0.5); /* 鍒濆鐘舵�侊細閫忔槑涓旂缉灏� */ + transform: translateY(20px) scale(0.5); /* 鍒濆鐘舵�侊細閫忔槑涓旂缉灏� */ } 100% { opacity: 1; - transform: translateY(0) scale(1); /* 鏈�缁堢姸鎬侊細瀹屽叏鏄剧ず涓旀甯稿ぇ灏� */ + transform: translateY(0) scale(1); /* 鏈�缁堢姸鎬侊細瀹屽叏鏄剧ず涓旀甯稿ぇ灏� */ } } /* 姣忎釜鎸夐挳鐨勪綅缃拰鍔ㄧ敾寤惰繜 */ .btnbox > div:nth-child(1) { - top: 20%; /* 绗竴涓寜閽殑浣嶇疆 */ - animation-delay: 0s; /* 鏃犲欢杩� */ + top: 20%; /* 绗竴涓寜閽殑浣嶇疆 */ + animation-delay: 0s; /* 鏃犲欢杩� */ } .btnbox > div:nth-child(2) { - top: 30%; /* 绗簩涓寜閽殑浣嶇疆 */ + top: 30%; /* 绗簩涓寜閽殑浣嶇疆 */ animation-delay: 0.2s; } .btnbox > div:nth-child(3) { - top: 40%; /* 绗笁涓寜閽殑浣嶇疆 */ + top: 40%; /* 绗笁涓寜閽殑浣嶇疆 */ animation-delay: 0.4s; } .btnbox > div:nth-child(4) { - top: 50%; /* 绗洓涓寜閽殑浣嶇疆 */ + top: 50%; /* 绗洓涓寜閽殑浣嶇疆 */ animation-delay: 0.6s; } .btnbox > div:nth-child(5) { - top: 60%; /* 绗簲涓寜閽殑浣嶇疆 */ + top: 60%; /* 绗簲涓寜閽殑浣嶇疆 */ animation-delay: 0.8s; } .btnbox > div:nth-child(6) { - top: 70%; /* 绗叚涓寜閽殑浣嶇疆 */ + top: 70%; /* 绗叚涓寜閽殑浣嶇疆 */ animation-delay: 1s; } @@ -2345,7 +2423,13 @@ -moz-border-radius: 2em; border-radius: 2em; } - +::v-deep .el-dialog { + width: 1200px; + height: 800px; +} +::v-deep .el-button--medium { + padding: 10px; +} /* .el-dialog { width: 1264px; height: 800px; @@ -2381,7 +2465,7 @@ align-items: center; padding: 0px 20px; z-index: 1000; /* 纭繚鎸夐挳灞傜骇鍦ㄥ叾浠栧唴瀹逛笂鏂� */ - width: 100%; + width: 300px; background-color: white; /* 鍙牴鎹渶瑕佽皟鏁磋儗鏅鑹� */ } @@ -2404,11 +2488,11 @@ } .rightbox { - margin-left: 30px; + margin-left: 60px; overflow-y: scroll; position: sticky; top: 0px; - + width: 684px; .right { position: sticky; top: 0px; @@ -2437,6 +2521,9 @@ .kong { box-shadow: none; } +::v-deep .el-table--medium .el-table__cell { + padding: 5px 0; +} </style> -- Gitblit v1.8.0