Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

CheckAll.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <div class="page_checkAll">
  3. <div class="cell clearfix">
  4. <el-form :inline="true" :model="listQuery">
  5. <el-form-item label>
  6. <!-- <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
  7. <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button> -->
  8. <el-autocomplete
  9. class="checkSearch"
  10. popper-class="my-autocomplete"
  11. v-model.trim="listQuery.search"
  12. :fetch-suggestions="querySearchAsync"
  13. :trigger-on-focus="false"
  14. placeholder="输入病人透析号/姓名"
  15. @select="handleSelect"
  16. >
  17. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  18. <template slot-scope="{ item }">
  19. <div class="name">{{ item.name }}</div>
  20. </template>
  21. </el-autocomplete>
  22. </el-form-item>
  23. </el-form>
  24. <label class="title">
  25. <span class="name">日期查询</span> :
  26. </label>
  27. <el-date-picker
  28. v-model="listQuery.start_time"
  29. prefix-icon="el-icon-date"
  30. @change="changeTime"
  31. :editable="false"
  32. style="width: 196px;"
  33. type="date"
  34. placeholder="选择日期时间"
  35. align="right"
  36. format="yyyy-MM-dd"
  37. value-format="yyyy-MM-dd"
  38. ></el-date-picker>
  39. <span class>-</span>
  40. <el-date-picker
  41. v-model="listQuery.end_time"
  42. prefix-icon="el-icon-date"
  43. @change="changeEndTime"
  44. :editable="false"
  45. style="width: 196px;"
  46. type="date"
  47. placeholder="选择日期时间"
  48. align="right"
  49. format="yyyy-MM-dd"
  50. value-format="yyyy-MM-dd"
  51. ></el-date-picker>
  52. </div>
  53. <el-container>
  54. <div style="width:150px">
  55. <div class="tableTitle">患者列表</div>
  56. <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
  57. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  58. highlight-current-row
  59. @current-change="handleChange">
  60. <el-table-column prop="dialysis_no" label="透析号" width="80">
  61. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  62. </el-table-column>
  63. <el-table-column prop="name" label="姓名" width="80">
  64. <template slot-scope="scope">{{ scope.row.name }}</template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. <div style="padding-left:10px;flex:1;width:0">
  69. <div class="tableTitle">统计表</div>
  70. <el-table :data="tableData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  71. <el-table-column prop="name" label="姓名" fixed>
  72. <template slot-scope="scope">{{ scope.row.name}}</template>
  73. </el-table-column>
  74. <el-table-column
  75. :label="modeItem.project_name+'('+modeItem.inspection_frequency+'天)'"
  76. property="number"
  77. align="center"
  78. min-width="110"
  79. v-for="(modeItem, index) in tableName"
  80. :key="index"
  81. >
  82. <template slot-scope="scope">
  83. <span v-if="Math.floor(90/modeItem.inspection_frequency) <= scope.row.data[index].Count" style="color:black">{{ scope.row.data[index].Count}}</span>
  84. <span v-if="Math.floor(90/modeItem.inspection_frequency) > scope.row.data[index].Count" style="color:red">{{ scope.row.data[index].Count}}</span>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <el-pagination
  89. align="right"
  90. @size-change="handleSizeChange"
  91. @current-change="handleCurrentChange"
  92. :current-page="listQuery.page"
  93. :page-sizes="[10, 20, 30, 40,50]"
  94. :page-size="10"
  95. background
  96. style="margin-top:20px;"
  97. layout="total, sizes, prev, pager, next, jumper"
  98. :total="total"
  99. ></el-pagination>
  100. </div>
  101. </el-container>
  102. </div>
  103. </template>
  104. <script>
  105. import { PostSearch} from '@/api/patient'
  106. import {getCurrentOrgPatients,getAllMajorInspection,getPatientList,getPatientDetailCheck,SearchDetailCheck } from "@/api/common/common"
  107. export default {
  108. data() {
  109. return {
  110. listQuery: {
  111. start_time: "",
  112. end_time: "",
  113. page: 1,
  114. limit: 10
  115. },
  116. value: "请选项",
  117. tableData: [],
  118. patientsData:[],
  119. total:0,
  120. tableName:[],
  121. ObjectData:{},
  122. patient_id:0,
  123. patient_name:"",
  124. };
  125. },
  126. methods: {
  127. handleDelete(index, row) {
  128. console.log(index, row);
  129. },
  130. changeTime(val) {
  131. var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
  132. if (time > 0) {
  133. this.$message.error("结束时间不能小于开始时间");
  134. this.listQuery.start_time = "";
  135. } else {
  136. this.getPatientList()
  137. }
  138. },
  139. onSearch(){
  140. getPatientDetailCheck(this.patient_id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
  141. if(response.data.state === 1){
  142. var checkDetail = response.data.data.checkDetail
  143. var arr = []
  144. for(let i=0;i<checkDetail.length;i++){
  145. for(let j=0;j<this.tableName.length;j++){
  146. if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
  147. arr.push(checkDetail[i])
  148. }
  149. }
  150. }
  151. let projectArr = []
  152. this.newArr.map(item => {
  153. projectArr.push(item.project_name)
  154. })
  155. projectArr.forEach((item,index) => {
  156. if(!(arr[index] && item == arr[index].ProjectName)){
  157. arr.splice(index,0,{Count:0, ProjectName: item,name: this.listQuery.search})
  158. }
  159. })
  160. this.tableData = []
  161. let obj = {}
  162. obj.name = this.listQuery.search
  163. obj.data = arr
  164. this.tableData.push(obj)
  165. this.total = 1
  166. }
  167. })
  168. },
  169. handleSizeChange(limit) {
  170. this.listQuery.limit = limit;
  171. this.getPatientList()
  172. },
  173. handleCurrentChange(page) {
  174. this.listQuery.page = page;
  175. this.getPatientList()
  176. },
  177. changeEndTime(val) {
  178. var time =
  179. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  180. if (time < 0) {
  181. this.$message.error("结束时间不能小于开始时间");
  182. this.listQuery.end_time = "";
  183. } else {
  184. this.getPatientList()
  185. }
  186. },
  187. //获取病人列表
  188. getCurrentOrgPatients(){
  189. getCurrentOrgPatients().then(response=>{
  190. if(response.data.state === 1){
  191. var patients = response.data.data.patients
  192. this.patientsData = patients
  193. }
  194. })
  195. },
  196. //获取检验检查项目
  197. getAllMajorInspection(){
  198. getAllMajorInspection().then(response=>{
  199. if(response.data.state === 1){
  200. var inspection = response.data.data.inspection
  201. console.log("inspection",inspection)
  202. var a=[];
  203. for(let i=0;i<inspection.length;i++){
  204. a.push(inspection[i])
  205. }
  206. this.newArr = a
  207. var arr = this.arrayToObj(a)
  208. this.ObjectData = arr
  209. this.tableName = inspection
  210. }
  211. })
  212. },
  213. getPatientList(){
  214. this.tableData = []
  215. getPatientList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.limit,this.listQuery.page).then(response=>{
  216. if(response.data.state === 1){
  217. var patientInfo = response.data.data.patientInfo
  218. console.log("patientInfo",patientInfo)
  219. var total = response.data.data.total
  220. this.total = total
  221. var list = response.data.data.list
  222. console.log("counts",list)
  223. var dtd = []
  224. for(let i=0;i<list.length;i++){
  225. for(let j=0;j<this.tableName.length;j++){
  226. if(list[i].ProjectId == this.tableName[j].inspection_major){
  227. dtd.push(list[i])
  228. }
  229. }
  230. }
  231. var dd = {};
  232. for (const index in dtd) {
  233. if (!(dtd[index].name in dd)) {
  234. dd[dtd[index].name] = {};
  235. }
  236. if (!(dtd[index].ProjectId in dd[dtd[index].name]) && dtd[index].ProjectId != 0) {
  237. dd[dtd[index].name][dtd[index].ProjectName] = dtd[index];
  238. }
  239. }
  240. for(const key in dd){
  241. for(const mkey in this.ObjectData){
  242. if (!(this.ObjectData[mkey].project_name in dd[key])) {
  243. dd[key][this.ObjectData[mkey].project_name] = {
  244. ProjectName: this.ObjectData[mkey].project_name,
  245. name: mkey,
  246. Count: 0
  247. };
  248. }
  249. }
  250. this.tableData.push({ name: key, data: dd[key]});
  251. }
  252. console.log("表哥",this.tableData)
  253. let projectArr = []
  254. this.newArr.map(item => {
  255. projectArr.push(item.project_name)
  256. })
  257. this.tableData.map(item => {
  258. let arr = Object.values(item.data);
  259. arr.sort((a,b)=>{
  260. return projectArr.indexOf(a.ProjectName)-projectArr.indexOf(b.ProjectName);
  261. });
  262. item.data = arr
  263. })
  264. }
  265. })
  266. },
  267. handleChange(val){
  268. getPatientDetailCheck(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
  269. if(response.data.state === 1){
  270. var checkDetail = response.data.data.checkDetail
  271. var arr = []
  272. for(let i=0;i<checkDetail.length;i++){
  273. for(let j=0;j<this.tableName.length;j++){
  274. if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
  275. arr.push(checkDetail[i])
  276. }
  277. }
  278. }
  279. let projectArr = []
  280. this.newArr.map(item => {
  281. projectArr.push(item.project_name)
  282. })
  283. projectArr.forEach((item,index) => {
  284. if(!(arr[index] && item == arr[index].ProjectName)){
  285. arr.splice(index,0,{Count:0, ProjectName: item,name: val.name})
  286. }
  287. })
  288. this.tableData = []
  289. let obj = {}
  290. obj.name = val.name
  291. obj.data = arr
  292. this.tableData.push(obj)
  293. this.total = 1
  294. }
  295. })
  296. },
  297. arrayToObj(arr){
  298. return Object.assign({},arr);
  299. },
  300. querySearchAsync(keyword, cb) {
  301. let key = ''
  302. if (keyword != undefined) {
  303. key = keyword
  304. }
  305. let searchArray = []
  306. PostSearch(key).then(response => {
  307. if (response.data.state == 1) {
  308. searchArray = response.data.data.patient
  309. console.log("searchArray",searchArray)
  310. cb(searchArray)
  311. } else {
  312. cb([])
  313. }
  314. })
  315. },
  316. handleSelect(val) {
  317. this.listQuery.search = val.name
  318. this.patient_id = val.id
  319. this.onSearch()
  320. },
  321. },
  322. created(){
  323. var nowDate = new Date();
  324. var nowYear = nowDate.getFullYear();
  325. var nowMonth = nowDate.getMonth() + 1;
  326. var nowDay = nowDate.getDate();
  327. this.listQuery.end_time =
  328. nowYear +
  329. "-" +
  330. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  331. "-" +
  332. (nowDay < 10 ? "0" + nowDay : nowDay);
  333. nowDate.setMonth(nowDate.getMonth() - 3);
  334. nowYear = nowDate.getFullYear();
  335. nowMonth = nowDate.getMonth() + 1;
  336. nowDay = nowDate.getDate();
  337. this.listQuery.start_time =
  338. nowYear +
  339. "-" +
  340. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  341. "-" +
  342. (nowDay < 10 ? "0" + nowDay : nowDay);
  343. //获取该机构下的所有患者
  344. this.getCurrentOrgPatients()
  345. //获取检验检查项目
  346. this.getAllMajorInspection()
  347. //获取列表数据
  348. this.getPatientList()
  349. }
  350. };
  351. </script>
  352. <style lang="scss" scoped>
  353. .tableTitle {
  354. font-size: 16px;
  355. color: #000;
  356. font-weight: bold;
  357. margin-bottom: 10px;
  358. }
  359. </style>
  360. <style lang="scss">
  361. .page_checkAll {
  362. .cell {
  363. text-align: center;
  364. }
  365. ::-webkit-scrollbar{
  366. height: 15px !important;
  367. }
  368. }
  369. </style>