<template>
|
<div>
|
<el-dialog
|
:title="title"
|
:visible.sync="open"
|
width="1200px"
|
append-to-body
|
>
|
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
<el-form-item label="名称" prop="pacName">
|
<el-input v-model="queryParams.pacName" placeholder="请输入名称" clearable
|
@keyup.enter.native="handleQuery" style="width: 130px;" />
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
</el-form-item>
|
</el-form> -->
|
|
<el-form inline @submit.native.prevent="search">
|
<el-form-item>
|
<el-radio-group v-model="tjproposal" @input="radiotjproposalChange">
|
<el-radio-button label="0">常用建议</el-radio-button>
|
<el-radio-button label="1">快捷建议</el-radio-button>
|
</el-radio-group>
|
</el-form-item>
|
<el-form-item v-show="tjproposal == 0">
|
<el-input
|
v-model="searchAdv"
|
style="width: 180px"
|
placeholder="请输入搜索内容"
|
clearable
|
@clear="search"
|
></el-input>
|
</el-form-item>
|
<el-button type="primary" @click="search" v-show="tjproposal == 0"
|
>搜索</el-button
|
>
|
</el-form>
|
|
<el-table
|
v-if="tjproposal == '0'"
|
:data="advicerulesList"
|
ref="elTable"
|
v-loading="loading"
|
@selection-change="handleSelectionChange"
|
border
|
height="500px"
|
>
|
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column label="科室" width="70" align="center" prop="ks" />
|
<el-table-column
|
label="建议名称"
|
width="120"
|
align="center"
|
prop="jymc"
|
/>
|
<el-table-column label="建议内容" align="left" prop="jynr" />
|
</el-table>
|
<div class="pag" v-if="tjproposal == '0'">
|
<div class="pag1">
|
<pagination
|
v-show="total1 > 0"
|
:total="total1"
|
:page.sync="queryParams1.pageNum"
|
:limit.sync="queryParams1.pageSize"
|
@pagination="radiotjproposalChange"
|
/>
|
</div>
|
</div>
|
|
<el-table
|
v-if="tjproposal == '1'"
|
:data="dataList"
|
ref="elTable"
|
v-loading="loading"
|
@selection-change="handleSelectionChange"
|
border
|
height="500px"
|
>
|
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column label="编码" width="70" align="center" prop="id" />
|
<el-table-column label="标题" width="120" align="center" prop="title" />
|
<el-table-column label="建议内容" align="left" prop="advice" />
|
<!-- <el-table-column
|
label="创建人"
|
align="center"
|
prop="createBy"
|
width="110px"
|
/>
|
<el-table-column
|
label="创建时间"
|
width="160px"
|
align="center"
|
prop="createTime"
|
/> -->
|
</el-table>
|
<div class="pag" v-if="tjproposal == '1'">
|
<div class="pag1">
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="queryParams.page"
|
:limit.sync="queryParams.pageSize"
|
@pagination="radiotjproposalChange"
|
/>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="open = false">取 消</el-button>
|
<el-button type="primary" @click="handleOk">确 定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import {
|
getKjTjAdviceKjbqBySex,
|
getCyTjAdviceKjbqBySex,
|
} from "@/api/hosp/project";
|
import { listAdvicerules } from "@/api/hosp/advicerules";
|
import { getInfo } from "@/api/login";
|
import { get } from "sortablejs";
|
export default {
|
name: "Packagese",
|
props: {
|
cusobj: Object,
|
},
|
data() {
|
return {
|
tjproposal: "0",
|
open: false,
|
openone: false,
|
// 弹出层标题
|
title: "",
|
total: 0,
|
total1: 0,
|
dataList: [],
|
advicerulesList: [],
|
|
// 遮罩层
|
loading: false,
|
searchAdv: "",
|
queryParams: {
|
sex: "",
|
isZj: "",
|
userId: "",
|
page: 1,
|
pageSize: 10,
|
},
|
queryParams1: {
|
pageNum: 1,
|
pageSize: 10,
|
jymc: "",
|
sex: "",
|
isZj: "",
|
userId: "",
|
},
|
list: [],
|
fList: {},
|
};
|
},
|
watch: {
|
cusobj(val, newVla) {
|
console.log(val, newVla, 1111);
|
this.fList = val;
|
this.queryParams.sex = val.sex;
|
this.queryParams.isZj = val.isZj;
|
this.tjproposal = "0";
|
this.getList();
|
},
|
},
|
|
methods: {
|
getAllList() {
|
this.loading = true;
|
this.openone = true;
|
getTjHyBgList(this.queryParams).then((res) => {
|
console.log(res, 6666);
|
|
this.dataList = res.data.records;
|
this.loading = false;
|
});
|
},
|
getList() {
|
this.loading = true;
|
/* getKjTjAdviceKjbqBySex(this.queryParams).then((res) => {
|
this.dataList = res.data.records;
|
this.total = res.data.total;
|
this.loading = false;
|
}); */
|
listAdvicerules(this.queryParams1)
|
.then((response) => {
|
this.advicerulesList = response.rows;
|
this.total1 = response.total;
|
this.loading = false;
|
})
|
.catch((error) => {
|
console.error("筛选快捷建议失败:", error);
|
this.$message.error("筛选快捷建议失败");
|
});
|
},
|
handleQuery() {
|
this.getAllList();
|
},
|
handleSelectionChange(selection) {
|
// if (selection.length > 1) {
|
// this.$refs.elTable.clearSelection(); // 清空所有选择
|
// this.$refs.elTable.toggleRowSelection(selection.pop()); // 设置选择项
|
// }
|
this.list = selection;
|
console.log(this.list);
|
},
|
search() {
|
this.queryParams1.jymc = this.searchAdv;
|
this.queryParams1.pageNum = 1;
|
this.loading = true;
|
listAdvicerules(this.queryParams1).then((res) => {
|
this.advicerulesList = res.rows;
|
this.total1 = res.total;
|
this.loading = false;
|
});
|
},
|
radiotjproposalChange() {
|
if (this.tjproposal == "0") {
|
this.searchAdv = "";
|
this.queryParams1.isZj = this.fList.isZj;
|
this.queryParams1.userId = null;
|
this.getList();
|
} else {
|
this.loading = true;
|
getInfo().then((res) => {
|
this.queryParams1.userId = res.user.userId;
|
this.queryParams1.isZj = null;
|
getCyTjAdviceKjbqBySex(this.queryParams1).then((res) => {
|
if (res.data) {
|
this.advicerulesList = res.data.records;
|
this.total1 = res.data.total;
|
this.dataList = res.data.records;
|
this.total = res.data.total;
|
} else {
|
this.advicerulesList = [];
|
this.total1 = 0;
|
this.dataList = [];
|
this.total = 0;
|
this.$modal.msgError(res.msg);
|
}
|
this.loading = false;
|
});
|
});
|
}
|
},
|
handleOk() {
|
this.open = false;
|
if (this.list.length != 0) {
|
this.$emit("event1", this.list);
|
}
|
},
|
},
|
};
|
</script>
|
|
<style scoped>
|
.pag {
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
}
|
|
.pag1 {
|
width: 30%;
|
}
|
::v-deep .el-dialog__body {
|
padding: 7px 20px;
|
}
|
</style>
|
|