Commit 2bd76526 by 唐玉峰

下载明细

parent 535b9496
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"dayjs": "^1.11.8",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"sass": "^1.18.0", "sass": "^1.18.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="utf-8" />
<!-- <meta base="/his/"> -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="favicon.ico" />
<link rel="stylesheet" href="../src/assets/font/complete/iconfont.css" />
<head> <title>基于病种精准管理系统</title>
<meta charset="utf-8"> </head>
<!-- <meta base="/his/"> -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="../src/assets//font/complete/iconfont.css">
<title> <body>
基于病种精准管理系统 <noscript>
</title> <strong
</head> >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong
>
<body> </noscript>
<noscript> <div id="app"></div>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <!-- built files will be auto injected -->
</noscript> </body>
<div id="app"></div> </html>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
...@@ -9,45 +9,46 @@ ...@@ -9,45 +9,46 @@
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ" * @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
* @returns 返回拼接后的时间字符串 * @returns 返回拼接后的时间字符串
*/ */
import dayjs from "dayjs";
export function formatDate(date, format) { export function formatDate(date, format) {
const we = date.getDay(); // 星期 const we = date.getDay(); // 星期
const z = getWeek(date); // 周 const z = getWeek(date); // 周
const qut = Math.floor((date.getMonth() + 3) / 3).toString(); // 季度 const qut = Math.floor((date.getMonth() + 3) / 3).toString(); // 季度
const opt = { const opt = {
'Y+': date.getFullYear().toString(), // 年 "Y+": date.getFullYear().toString(), // 年
'm+': (date.getMonth() + 1).toString(), // 月(月份从0开始,要+1) "m+": (date.getMonth() + 1).toString(), // 月(月份从0开始,要+1)
'd+': date.getDate().toString(), // 日 "d+": date.getDate().toString(), // 日
'H+': date.getHours().toString(), // 时 "H+": date.getHours().toString(), // 时
'M+': date.getMinutes().toString(), // 分 "M+": date.getMinutes().toString(), // 分
'S+': date.getSeconds().toString(), // 秒 "S+": date.getSeconds().toString(), // 秒
'q+': qut, // 季度 "q+": qut, // 季度
}; };
// 中文数字 (星期) // 中文数字 (星期)
const week = { const week = {
0: '日', 0: "日",
1: '一', 1: "一",
2: '二', 2: "二",
3: '三', 3: "三",
4: '四', 4: "四",
5: '五', 5: "五",
6: '六', 6: "六",
}; };
// 中文数字(季度) // 中文数字(季度)
const quarter = { const quarter = {
1: '一', 1: "一",
2: '二', 2: "二",
3: '三', 3: "三",
4: '四', 4: "四",
}; };
if (/(W+)/.test(format)) { if (/(W+)/.test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length > 1 ? (RegExp.$1.length > 2 ? '星期' + week[we] : '周' + week[we]) : week[we]); format = format.replace(RegExp.$1, RegExp.$1.length > 1 ? (RegExp.$1.length > 2 ? "星期" + week[we] : "周" + week[we]) : week[we]);
} }
if (/(Q+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 4 ? '第' + quarter[qut] + '季度' : quarter[qut]); if (/(Q+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 4 ? "第" + quarter[qut] + "季度" : quarter[qut]);
if (/(Z+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 3 ? '第' + z + '周' : z + ''); if (/(Z+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 3 ? "第" + z + "周" : z + "");
for (const k in opt) { for (const k in opt) {
const r = new RegExp('(' + k + ')').exec(format); const r = new RegExp("(" + k + ")").exec(format);
// 若输入的长度不为1,则前面补零 // 若输入的长度不为1,则前面补零
if (r) format = format.replace(r[1], RegExp.$1.length == 1 ? opt[k] : opt[k].padStart(RegExp.$1.length, '0')); if (r) format = format.replace(r[1], RegExp.$1.length == 1 ? opt[k] : opt[k].padStart(RegExp.$1.length, "0"));
} }
return format; return format;
} }
...@@ -90,12 +91,12 @@ export function formatPast(param, format) { ...@@ -90,12 +91,12 @@ export function formatPast(param, format) {
// 获取js 时间戳 // 获取js 时间戳
let time = new Date().getTime(); let time = new Date().getTime();
// 是否是对象 // 是否是对象
typeof param === 'string' || 'object' ? (t = new Date(param).getTime()) : (t = param); typeof param === "string" || "object" ? (t = new Date(param).getTime()) : (t = param);
// 当前时间戳 - 传入时间戳 // 当前时间戳 - 传入时间戳
time = Number.parseInt(`${time - t}`); time = Number.parseInt(`${time - t}`);
if (time < 10000) { if (time < 10000) {
// 10秒内 // 10秒内
return '刚刚'; return "刚刚";
} else if (time < 60000 && time >= 10000) { } else if (time < 60000 && time >= 10000) {
// 超过10秒少于1分钟内 // 超过10秒少于1分钟内
s = Math.floor(time / 1000); s = Math.floor(time / 1000);
...@@ -114,7 +115,7 @@ export function formatPast(param, format) { ...@@ -114,7 +115,7 @@ export function formatPast(param, format) {
return `${s}天前`; return `${s}天前`;
} else { } else {
// 超过3天 // 超过3天
const date = typeof param === 'string' || 'object' ? new Date(param) : param; const date = typeof param === "string" || "object" ? new Date(param) : param;
return formatDate(date, format); return formatDate(date, format);
} }
} }
...@@ -127,38 +128,29 @@ export function formatPast(param, format) { ...@@ -127,38 +128,29 @@ export function formatPast(param, format) {
*/ */
export function formatAxis(param) { export function formatAxis(param) {
const hour = new Date(param).getHours(); const hour = new Date(param).getHours();
if (hour < 6) return '凌晨好'; if (hour < 6) return "凌晨好";
else if (hour < 9) return '早上好'; else if (hour < 9) return "早上好";
else if (hour < 12) return '上午好'; else if (hour < 12) return "上午好";
else if (hour < 14) return '中午好'; else if (hour < 14) return "中午好";
else if (hour < 17) return '下午好'; else if (hour < 17) return "下午好";
else if (hour < 19) return '傍晚好'; else if (hour < 19) return "傍晚好";
else if (hour < 22) return '晚上好'; else if (hour < 22) return "晚上好";
else return '夜里好'; else return "夜里好";
} }
export function transformTimestamp(timestamp) { export function transformTimestamp(timestamp) {
const date = new Date(timestamp); const dateString = dayjs(timestamp).format("YYYY-MM-DD HH:mm:ss");
const Y = date.getFullYear();
const M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
const D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
const s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds(); // 秒
const dateString = `${Y}-${M}-${D} ${h}${m}${s}`;
return dateString; return dateString;
} }
export function transformTimestamps(timestamp) { export function transformTimestamps(timestamp) {
const date = new Date(timestamp); const date = new Date(timestamp);
const Y = date.getFullYear(); const Y = date.getFullYear();
const M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; const M = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
const D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); const D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; const h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'; const m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
const s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds(); // 秒 const s = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); // 秒
const dateString = `${Y}-${M}-${D}`; const dateString = `${Y}-${M}-${D}`;
return dateString; return dateString;
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="outpatientDetails_top_div1"> <div class="outpatientDetails_top_div1">
<span class="span1">患者信息</span> <span class="span1">患者信息</span>
<div> <div>
<el-button size="mini" type="primary" class="outpatientDetails_top_div1_button" @click="topage"> 病案质控</el-button> <!-- <el-button size="mini" type="primary" class="outpatientDetails_top_div1_button" @click="topage"> 病案质控</el-button> -->
<el-button class="outpatientDetails_top_div1_button" type="primary" size="mini" @click="getControl">医嘱质控</el-button> <el-button class="outpatientDetails_top_div1_button" type="primary" size="mini" @click="getControl">医嘱质控</el-button>
</div> </div>
</div> </div>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="outpatientDetails_top_message_left" style="width: 12%"> <div class="outpatientDetails_top_message_left" style="width: 12%">
<span class="outpatientDetails_top_message_left_tu1"> <img src="../assets/img/peo.png" alt="" /></span> <span class="outpatientDetails_top_message_left_tu1"> <img src="../assets/img/peo.png" alt="" /></span>
<div class="outpatientDetails_top_message_left_t1"> <div class="outpatientDetails_top_message_left_t1">
住院号:<span>{{ HistoryInfo.name }}</span> 姓名:<span>{{ HistoryInfo.name }}</span>
</div> </div>
</div> </div>
<div class="outpatientDetails_top_message_left"> <div class="outpatientDetails_top_message_left">
...@@ -177,20 +177,22 @@ ...@@ -177,20 +177,22 @@
</el-table> </el-table>
</div> </div>
<!-- 中间有数据样式 表格--> <!-- 中间有数据样式 表格-->
<div class="outpatientDetails_bottom_leftShowBox_right" v-if="tableData.length !== 0"> <div class="outpatientDetails_bottom_leftShowBox_right">
<div class="outpatientDetails_bottom_leftShowBox_right_treebtn"> <div class="outpatientDetails_bottom_leftShowBox_right_treebtn">
<span <div class="treebtn1">
v-for="(item, ind) in btnoptions" <span
:key="ind" v-for="(item, ind) in btnoptions"
class="outpatientDetails_bottom_leftShowBox_right_treebtn_span" :key="ind"
:class="{ class="patientDetails_bottom_leftShowBox_right_treebtn_span"
outpatientDetails_bottom_leftShowBox_right_treebtn_span1: ind == btnspanind, :class="{ span1: ind == btnspanind }"
}" @click="treebtn(item.value, ind)"
@click="treebtn(item.value, ind)" >{{ item.title }}</span
>{{ item.title }}</span >
> </div>
<el-button size="mini" type="primary" style="background-color: #2cabe3" @click="EexcelDownload">导出明细</el-button>
</div> </div>
<el-table <el-table
v-if="tableData.length !== 0"
:data="tableData" :data="tableData"
border border
size="medium" size="medium"
...@@ -215,22 +217,7 @@ ...@@ -215,22 +217,7 @@
</el-table-column> </el-table-column>
<el-table-column label="支付类型" prop="carD_TYPE"></el-table-column> <el-table-column label="支付类型" prop="carD_TYPE"></el-table-column>
</el-table> </el-table>
</div> <div class="outpatientDetails_bottom_leftShowBox_right_box" v-else>
<!-- 中间表格无数据 -->
<div class="outpatientDetails_bottom_leftShowBox_right" v-else>
<div class="outpatientDetails_bottom_leftShowBox_right_treebtn">
<span
v-for="(item, ind) in btnoptions"
:key="ind"
class="outpatientDetails_bottom_leftShowBox_right_treebtn_span"
:class="{
outpatientDetails_bottom_leftShowBox_right_treebtn_span1: ind == btnspanind,
}"
@click="treebtn(item.value, ind)"
>{{ item.title }}</span
>
</div>
<div class="outpatientDetails_bottom_leftShowBox_right_box">
<img class="outpatientDetails_bottom_leftShowBox_right_box_img" src="../assets/img/nodata.png" alt="" /> <img class="outpatientDetails_bottom_leftShowBox_right_box_img" src="../assets/img/nodata.png" alt="" />
<div class="outpatientDetails_bottom_leftShowBox_right_box_text">暂无数据</div> <div class="outpatientDetails_bottom_leftShowBox_right_box_text">暂无数据</div>
</div> </div>
...@@ -310,14 +297,10 @@ ...@@ -310,14 +297,10 @@
</template> </template>
<script> <script>
import http from "../utils/http"; import http from "../utils/http";
import { reactive, toRefs, onMounted, nextTick, computed, ref } from "@vue/composition-api";
import { decimal } from "../utils/decimal"; import { decimal } from "../utils/decimal";
import { transformTimestamp } from "../utils/formatTime";
import { Message } from "element-ui"; import { Message } from "element-ui";
import { useRoute, useRouter } from "../utils/useVueRouter";
import { setItem, getItem } from "../utils/auth";
import { Loading } from "element-ui"; import { Loading } from "element-ui";
export default { export default {
name: "outpatientDetails", name: "outpatientDetails",
data() { data() {
...@@ -409,6 +392,11 @@ export default { ...@@ -409,6 +392,11 @@ export default {
spinner: "el-icon-loading", spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.5)", background: "rgba(0, 0, 0, 0.5)",
}, },
objbtn: {
0: "全部",
1: "医保",
2: "自费",
},
}; };
}, },
mounted() { mounted() {
...@@ -447,6 +435,8 @@ export default { ...@@ -447,6 +435,8 @@ export default {
http.post(`/medical/Post/getHisStaChargeType?code=${this.$route.query.id}`, {}) http.post(`/medical/Post/getHisStaChargeType?code=${this.$route.query.id}`, {})
.then((data) => { .then((data) => {
this.tableData1 = data; this.tableData1 = data;
this.setId(this.tableData1);
console.log(this.tableData1);
if (this.tableData1 != []) { if (this.tableData1 != []) {
this.eowclick(this.tableData1[0]); this.eowclick(this.tableData1[0]);
//默认高亮第一行 //默认高亮第一行
...@@ -574,7 +564,15 @@ export default { ...@@ -574,7 +564,15 @@ export default {
this.btnvalue = value; this.btnvalue = value;
this.getInpatFeesByREGCODE(this.Lefttype); this.getInpatFeesByREGCODE(this.Lefttype);
}, },
setId(arr) {
arr.map((item, i) => {
if (item.inpat_FeeDatas && item.inpat_FeeDatas.length) {
item.inpat_FeeDatas.map((el, i) => {
el.id = item.id + "-" + i;
});
}
});
},
//费用分类接口 //费用分类接口
getInpatFeesByREGCODE(types) { getInpatFeesByREGCODE(types) {
var loadingInstance1 = Loading.service(this.loadingOption1); var loadingInstance1 = Loading.service(this.loadingOption1);
...@@ -587,9 +585,29 @@ export default { ...@@ -587,9 +585,29 @@ export default {
loadingInstance1.close(); loadingInstance1.close();
}); });
}, },
EexcelDownload() {
var loadingInstance1 = Loading.service(this.loadingOption1);
http.post(`/medical/Get/EexcelDownload?code=${this.$route.query.id}&state=${this.btnvalue}`, this.Lefttype, { responseType: "blob" })
.then((data) => {
loadingInstance1.close();
const blob = new Blob([data], {
type: "application/vnd.ms-excel",
});
// 存在浏览器兼容性;
scrollToFoods(index) { const href = URL.createObjectURL(blob);
// this.checkindex = index; const alink = document.createElement("a");
alink.style.display = "none";
alink.download = `${this.HistoryInfo.name} ${this.objbtn[this.btnvalue]}项目明细清单 ${transformTimestamp(new Date())}.xlsx`; //下载后文件名
alink.href = href;
document.body.appendChild(alink);
alink.click();
document.body.removeChild(alink); //下载完成移除元素
URL.revokeObjectURL(href); //释放掉blob对象
})
.catch((error) => {
loadingInstance1.close();
});
}, },
}, },
}; };
...@@ -1295,8 +1313,32 @@ export default { ...@@ -1295,8 +1313,32 @@ export default {
//中间有数据 //中间有数据
&_treebtn { &_treebtn {
display: flex; display: flex;
justify-content: flex-start; justify-content: space-between;
align-items: center;
margin: 5px 10px 15px 10px; margin: 5px 10px 15px 10px;
.treebtn1 {
display: flex;
justify-content: flex-start;
span {
display: flex;
justify-content: center;
color: #5d5d5d;
width: 60px;
height: 21px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
align-items: center;
align-content: center;
line-height: 21px;
background: #f3fafd;
cursor: pointer;
}
.span1 {
background-color: #2cabe3;
color: #fff;
}
}
&_span { &_span {
display: flex; display: flex;
justify-content: center; justify-content: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment