123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627 |
- <template>
- <!--处方模板-->
- <div class="main-contain new-main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <div class="btn_crumbs">
- <el-button type="primary" @click="batchAdds">批量新增</el-button>
- <el-button type="primary" @click="batchReplace">批量替换</el-button>
- <el-button type="danger" @click="batchDeletes">批量删除</el-button>
- <el-button type="primary" @click="add" style="width:70px;">新增</el-button>
- </div>
- </div>
-
- <div
- class="app-container"
- style="display: flex; flex: 1; padding: 10px 20px 0px 20px"
- >
- <div class="mainLeft">
- <div class="mainCell" style="margin-bottom: 10px">
- <el-input
- size="small"
- placeholder="请输入姓名或者透析号"
- v-model="search_input"
- class="filter-item"
- @input="searchAction"
- @keyup.enter.native="searchAction"
- />
- <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
- <!--@click="searchAction">-->
- <!--搜索-->
- <!--</el-button>-->
- </div>
- <div>
- <el-table
- :data="data"
- :height="tableHeight"
- @row-click="choosePatient"
- border
- style="width: 100%"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- highlight-current-row
- ref="tab"
- >
- <el-table-column type="index" align="center" label="序号" width="60">
- </el-table-column>
- <el-table-column prop="name" label="姓名">
- <template slot-scope="scope"
- >{{ scope.row.name }}({{ scope.row.dialysis_no }})</template
- >
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div class="mainRight">
- <el-table
- :data="templates"
- :height="tableHeight"
- border
- style="width: 100%"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- highlight-current-row
- >
- <el-table-column prop="name" label="模版名称">
- <template slot-scope="scope">{{ scope.row.name }}</template>
- </el-table-column>
- <el-table-column prop="name" label="透析模式">
- <template slot-scope="scope">{{
- getMode(scope.row.mode)
- }}</template>
- </el-table-column>
- <el-table-column prop="name" label="操作">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="primary"
- @click="jumpDetail(scope.row)"
- >编辑</el-button
- >
- <el-button
- size="mini"
- type="danger"
- @click="deleteTemplate(scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
-
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 50, 100]"
- :page-size="10"
- background
- align="right"
- style="margin-top: 20px"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
- </div>
-
- </div>
- </template>
-
- <script>
- import BreadCrumb from "@/xt_pages/components/bread-crumb";
- import {
- delHisPrescriptionTemplate,
- getPatientListTwenty,
- getPrescriptionTemplateList,
- } from "@/api/his/his_config";
- import { uParseTime } from "@/utils/tools";
-
- const moment = require("moment");
- export default {
- components: {
- BreadCrumb,
- },
- data() {
- return {
- crumbs: [
- { path: false, name: "门诊医生站" },
- { path: false, name: "处方模版" },
- ],
- search_input: "",
- templates: [],
- tableHeight: "",
- fullHeight: document.documentElement.clientHeight,
- isloading: false,
- data: [],
- all_data: [],
- page: 1,
- limit: 20,
- patient_id: 0,
- total: 0,
- patient_name: "",
- mode_str: "",
- };
- },
- methods: {
- // 搜索
- searchAction() {
- this.data = [];
- if (this.search_input.length == 0) {
- this.data = this.all_data;
- } else {
- for (let i = 0; i < this.all_data.length; i++) {
- if (
- this.all_data[i].name.indexOf(this.search_input) != -1 ||
- this.all_data[i].dialysis_no.indexOf(this.search_input) != -1 ||
- this.all_data[i].first_letter.indexOf(this.search_input) != -1
- ) {
- this.data.push(this.all_data[i]);
- }
- }
- }
- },
- deleteTemplate(row) {
- this.$confirm("处方模版删除后不可恢复,是否确认删除", "删除", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- })
- .then(() => {
- let params = {
- id: row.id,
- };
- delHisPrescriptionTemplate(params).then((response) => {
- if (response.data.state == 1) {
- this.GetPrescriptionTemplateList();
- }
- });
- })
- .catch(() => {});
- },
- jumpDetail(row) {
- this.$router.push(
- "/hisTool/prescriptionTemplatedetail?id=" +
- row.id +
- "&patient_id=" +
- this.patient_id +
- "&patient_name=" +
- this.patient_name +
- "&modes=" +
- this.mode_str
- );
- },
- getMode(id) {
- let name = "";
- this.treatment_mode = Object.values(this.$store.getters.treatment_mode);
- this.treatment_mode.map((item) => {
- if (item.id == id) {
- name = item.name;
- }
- });
- return name;
- },
- handleSizeChange(val) {
- this.limit = val;
- this.GetPrescriptionTemplateList();
- },
- handleCurrentChange(val) {
- this.page = val;
- this.GetPrescriptionTemplateList();
- },
- GetPrescriptionTemplateList() {
- let params = {
- patient_id: this.patient_id,
- page: this.page,
- limit: this.limit,
- };
- getPrescriptionTemplateList(params).then((response) => {
- if (response.data.state == 1) {
- this.templates = response.data.data.list;
- let modes = [];
- for (let i = 0; i < this.templates.length; i++) {
- modes.push(this.templates[i].mode);
- }
- this.mode_str = modes.join(",");
-
- this.total = response.data.data.total;
- }
- });
- },
- choosePatient(val, column) {
- this.page = 1;
- this.limit = 10;
- this.patient_id = val.id;
- this.patient_name = val.name;
- this.id = val.id;
- sessionStorage.setItem("templateIndex", val.id);
- let params = {
- patient_id: val.id,
- page: this.page,
- limit: this.limit,
- };
- getPrescriptionTemplateList(params).then((response) => {
- if (response.data.state == 1) {
- this.templates = response.data.data.list;
- let modes = [];
- for (let i = 0; i < this.templates.length; i++) {
- modes.push(this.templates[i].mode);
- }
- this.mode_str = modes.join(",");
-
- this.total = response.data.data.total;
- }
- });
- },
- // 数据源
- getList(id) {
- getPatientListTwenty().then((response) => {
- if (response.data.state == 1) {
- this.data = response.data.data.list;
- this.all_data = response.data.data.list;
- let index = null;
- if (
- sessionStorage.getItem("templateIndex") &&
- sessionStorage.getItem("templateIndex") != ""
- ) {
- this.data.map((item, i) => {
- if (sessionStorage.getItem("templateIndex") == item.id) {
- index = i;
- }
- });
- this.$refs.tab.setCurrentRow(this.data[index]);
- this.patient_id = this.data[index].id;
- this.patient_name = this.data[index].name;
- } else {
- this.$refs.tab.setCurrentRow(this.data[0]);
- this.patient_id = this.data[0].id;
- this.patient_name = this.data[0].name;
- }
-
- this.GetPrescriptionTemplateList();
- }
- });
- },
- getTime(val, temp) {
- if (val != 0) {
- return uParseTime(val, temp);
- } else {
- return "";
- }
- },
- batchAdds() {
- this.$router.push("/hisTool/batchTemplate");
- },
- batchDeletes() {
- this.$router.push("/hisTool/batchDelete");
- },
- batchReplace() {
- this.$router.push("/hisTool/batchReplacement");
- },
- add() {
- if (this.patient_id == 0) {
- this.$message.error("请选择病人");
- return;
- }
- this.$router.push(
- "/hisTool/prescriptionTemplatedetail?id=" +
- 0 +
- "&patient_id=" +
- this.patient_id +
- "&patient_name=" +
- this.patient_name +
- "&modes=" +
- this.mode_str
- );
- },
- },
- created() {
- var nowDate = new Date();
- var nowYear = nowDate.getFullYear();
- var nowMonth = nowDate.getMonth() + 1;
- var nowDay = nowDate.getDate();
- this.record_date =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
- this.getList();
- let tableHeight = document.body.clientHeight - 263;
- this.tableHeight = tableHeight;
- },
- mounted() {
- const that = this;
- window.onresize = () => {
- return (() => {
- window.fullHeight = document.documentElement.clientHeight;
- that.fullHeight = window.fullHeight;
- })();
- };
- },
- watch: {
- fullHeight(val) {
- if (!this.timer) {
- this.fullHeight = val;
- let tableHeight = val - 263;
- this.tableHeight = tableHeight;
- this.timer = true;
- let that = this;
- setTimeout(function () {
- that.timer = false;
- }, 400);
- }
- },
- },
- };
- </script>
-
- <style lang="scss" scoped>
- .new-main-contain {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
-
- .app-container {
- height: 100%;
- }
-
- .mainCell {
- height: 36px;
- display: flex;
- align-items: center;
- }
-
- .mainLeft {
- width: 200px;
- height: 100%;
- display: flex;
- flex-direction: column;
-
- .el-radio {
- margin-right: 5px;
- }
- }
- .mainRight {
- margin-left: 10px;
- flex: 1;
- height: 100%;
- display: flex;
- flex-direction: column;
- overflow-y: auto;
-
- .cellSpan {
- min-width: 80px;
- display: inline-block;
- margin-right: 10px;
- }
- }
- .mainCenter {
- display: flex;
- flex: 1;
- }
-
- .centerLeft {
- flex: 1;
- display: flex;
- flex-direction: column;
- position: relative;
-
- .el-form-item {
- width: 32%;
- margin-right: 1%;
- float: left;
- }
-
- .el-form-item__label {
- text-align: left;
- }
- }
- .backColor {
- background: #f6f8f9;
- height: 5px;
- margin-bottom: 5px;
- }
-
- .tabsBox {
- position: relative;
- height: 76%;
- overflow-y: auto;
- margin-bottom: 60px;
-
- .el-tabs__item {
- padding: 0 10px;
- }
- }
- .preTabs {
- height: 100%;
- display: flex;
- flex-direction: column;
-
- .el-tabs__content {
- flex: 1;
- overflow-y: auto;
- }
- }
-
- .costBox {
- width: 100%;
- height: 60px;
- background: #fff;
- position: absolute;
- bottom: 0;
- display: flex;
- align-items: center;
- }
-
- .addTab {
- position: absolute;
- right: 0;
- top: 14px;
- z-index: 20;
- }
-
- .centerRight {
- width: 300px;
- margin-left: 10px;
- display: flex;
- flex-direction: column;
- position: relative;
- }
-
- .rightTab {
- height: 40px;
- width: 100%;
- border: 1px solid #d2d2d2;
- box-sizing: border-box;
-
- p {
- width: 50%;
- height: 40px;
- line-height: 40px;
- text-align: center;
- background: #eee;
- float: left;
- }
-
- > p:last-child {
- border-left: 1px solid #d2d2d2;
- float: right;
- }
-
- .activeP {
- background: #409eff;
- color: #fff;
- }
- }
- .comfirmBox {
- width: 100%;
- height: 60px;
- background: #fff;
- position: absolute;
- bottom: 0;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
-
- .mainHeader {
- width: 100%;
- background: #fff;
- position: fixed;
- z-index: 100;
- height: 36px;
- }
-
- .titleBox {
- position: fixed;
- z-index: 99;
- background: #fff;
- }
-
- .fixedCell {
- position: fixed;
- z-index: 99;
- right: 30px;
- background: #fff;
- width: 300px;
- display: flex;
- justify-content: space-between;
- }
- .btn_crumbs {
- .el-button {
- text-align: center;
- font-size: 12px;
- padding: 10px 11px;
- }
- }
- </style>
-
- <style lang="scss">
- .centerLeft {
- .el-form-item__label {
- text-align: left;
- }
- }
- .tabsBox {
- .el-tabs__item {
- padding: 0 10px;
- }
-
- .el-tabs--bottom
- .el-tabs--left
- > .el-tabs__header
- .el-tabs__item:nth-child(2),
- .el-tabs--bottom
- .el-tabs--right
- > .el-tabs__header
- .el-tabs__item:nth-child(2),
- .el-tabs--bottom.el-tabs--border-card
- > .el-tabs__header
- .el-tabs__item:nth-child(2),
- .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2),
- .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2),
- .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2),
- .el-tabs--top.el-tabs--border-card
- > .el-tabs__header
- .el-tabs__item:nth-child(2),
- .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
- padding: 0 10px;
- }
-
- .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child,
- .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child,
- .el-tabs--bottom.el-tabs--border-card
- > .el-tabs__header
- .el-tabs__item:last-child,
- .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child,
- .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child,
- .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child,
- .el-tabs--top.el-tabs--border-card
- > .el-tabs__header
- .el-tabs__item:last-child,
- .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
- padding: 0 10px;
- }
-
- .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
- padding: 0 10px;
- }
- }
- .centerRight {
- .el-tabs__nav-scroll {
- display: flex;
- }
-
- .el-tabs__nav {
- margin: 0 auto;
- }
-
- .el-table th .cell,
- .el-table td .cell {
- padding: 0 2px;
- }
- }
- .preTabs {
- .el-tabs__content {
- }
- }
- .rightTabs {
- height: 100%;
-
- .el-tabs__content {
- }
- }
- .centerDialog {
- .el-dialog__body {
- max-height: calc(100vh - 100px) !important;
- padding: 0 20px;
- }
- }
- </style>
|