patient.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-input style="width: 400px;" v-model="searchKey" class="filter-item" />
  5. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search" >搜索</el-button>
  6. <!-- <el-button class="filter-item" type="primary" style="float:right;" icon="el-icon-download" >批量导入</el-button> -->
  7. <el-button @click="$router.push({path:'/patients/create'})" class="filter-item" style="float:right;" type="primary" icon="el-icon-edit" >新增病人</el-button>
  8. </div>
  9. <!-- <div class="search-component clearfix">
  10. <input type="text" class="searchBox" placeholder="姓名/首拼/透析号" v-model="searchVal">
  11. <button class="searchBtn">搜 索</button>
  12. </div> -->
  13. <div class="cell clearfix">
  14. <label class="title"><span class="name">日期查询</span> : </label>
  15. <el-date-picker size="small" v-model="listQuery.start_time" prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </el-date-picker>
  16. <span class="cellLine"> - </span>
  17. <el-date-picker size="small" v-model="listQuery.end_time" prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> </el-date-picker>
  18. </div>
  19. <div class="cell clearfix">
  20. <label class="title"><span class="name">排班班次</span> : </label>
  21. <div class="time ">
  22. <ul class="">
  23. <li :class="item.value==schedulType?'active':''" @click='selectSchedulType(item.value)' v-for="item in schedulArr" :key="item.value" >{{item.label}}</li>
  24. </ul>
  25. </div>
  26. </div>
  27. <div class="cell clearfix">
  28. <label class="title"><span class="name">状态</span> : </label>
  29. <div class="time ">
  30. <ul class="">
  31. <li :class="item.value==systemType?'active':''" @click="selectSystemType(item.value)" v-for="item in systemArr" :key="item.value" >{{item.label}}</li>
  32. </ul>
  33. </div>
  34. </div>
  35. <div class="cell clearfix">
  36. <label class="title"><span class="name">病人来源</span> : </label>
  37. <div class="time ">
  38. <ul class="">
  39. <li :class="item.value==sourceType?'active':''" :style="item.source>0&&lapsetoType!=1?'display:none;':''" @click="selectLapseTo(item.value, item.source, item.lapseto)" v-for="item in sourceArr" :key="item.value" >{{item.label}}</li>
  40. </ul>
  41. </div>
  42. </div>
  43. <div class="cell clearfix">
  44. <label class="title"><span class="name">其它查询</span> : </label>
  45. <el-select v-model="listQuery.contagion" clearable placeholder="传染病" @change="changeOtherSearch">
  46. <el-option
  47. v-for="item in contagionList"
  48. :key="item.id"
  49. :label="item.name"
  50. :value="item.id">
  51. </el-option>
  52. </el-select>
  53. <el-select v-model="listQuery.reimbursement_way" clearable placeholder="付费方式" @change="changeOtherSearch">
  54. <el-option
  55. v-for="item in reimbursement_ways"
  56. :key="item.id"
  57. :label="item.name"
  58. :value="item.id">
  59. </el-option>
  60. </el-select>
  61. <el-select
  62. v-model="listQuery.isscheduling"
  63. collapse-tags
  64. style="margin-left: 10px;"
  65. clearable
  66. placeholder="排班情况" @change="changeOtherSearch">
  67. <el-option
  68. v-for="item in scheduling"
  69. :key="item.value"
  70. :label="item.label"
  71. :value="item.value">
  72. </el-option>
  73. </el-select>
  74. <el-select
  75. v-model="listQuery.isprescription"
  76. collapse-tags
  77. style="margin-left:10px;"
  78. clearable
  79. placeholder="透析处方" @change="changeOtherSearch">
  80. <el-option
  81. v-for="item in prescription"
  82. :key="item.value"
  83. :label="item.label"
  84. :value="item.value">
  85. </el-option>
  86. </el-select>
  87. </div>
  88. <div class="amount" >总<span>{{pageTotal}}</span>条 已选择{{pageSelect}}位患者</div>
  89. <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  90. ref="multipleTable" :data="tableData" border fit highlight-current-row style="width: 100%;margin-top: 10px;" @selection-change="handleSelectionChange">
  91. <!-- <el-table-column type="selection" label="全选" width="60px" align="center">
  92. <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
  93. </el-table-column> -->
  94. <el-table-column align="center" label="全选" width="60px" type="selection" ></el-table-column>
  95. <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
  96. <el-table-column label="透析号" min-width="80" property="dialysis_no" align="center"></el-table-column>
  97. <el-table-column label="住院号" min-width="80" property="admission_number" align="center"> </el-table-column>
  98. <el-table-column property="name" label="姓名" min-width="80" align="center">
  99. <template slot-scope="scope" >
  100. <router-link :to="'/patients/edit/'+scope.row.id" style="color:#409eff;width:100%;display:block;" >{{scope.row.name}}</router-link>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="性别" min-width="80" align="center">
  104. <template slot-scope="scope" >
  105. <span v-if="scope.row.gender==1">男</span>
  106. <span v-else-if="scope.row.gender==2">女</span>
  107. <span v-else>未知</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="来源" min-width="80" align="center">
  111. <template slot-scope="scope" >
  112. <span v-if="scope.row.source==1">门诊</span>
  113. <span v-else-if="scope.row.source==2">住院</span>
  114. <span v-else>未知</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column property="total_dialysis" label="透析次数" min-width="94" align="center">
  118. <template slot-scope="scope" >
  119. <span>{{getCount(scope.row)}}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column min-width="150" label="二维码" align="center">
  123. <template slot-scope="scope" type="text">
  124. <a style="color:#409eff" v-if="scope.row.binding_state==1" @click="openWechatBindDialog">已绑定</a>
  125. <a style="color:#409eff" v-else @click="openWechatBindDialog">生成</a>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="日期" min-width="144" align="center">
  129. <template slot-scope="scope">
  130. <span>{{scope.row.created_time | parseTime('{y}-{m}-{d}')}}</span>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <!-- <pagi-nation title="分页"></pagi-nation> -->
  135. <el-pagination
  136. @size-change="handleSizeChange"
  137. @current-change="handleCurrentChange"
  138. :current-page="listQuery.pate"
  139. :page-sizes="[10, 20, 50, 100]"
  140. :page-size="10"
  141. background
  142. style="margin-top:20px;"
  143. layout="total, sizes, prev, pager, next, jumper"
  144. :total="total">
  145. </el-pagination>
  146. <el-dialog
  147. title="微信绑定"
  148. :visible.sync="bindWechatDialog"
  149. width="30%"
  150. center>
  151. <img :src="wechatbindimg" width="100%" alt="" v-if="wechatbindimg" >
  152. <i class="el-icon-loading" v-else></i>
  153. <span slot="footer" class="dialog-footer">
  154. <el-button type="primary" @click="bindWechatDialog = false">关闭</el-button>
  155. </span>
  156. </el-dialog>
  157. </div>
  158. </template>
  159. <script>
  160. import { fetchList } from "@/api/patient";
  161. import pagiNation from '@/components/pagimg/pagiNation'
  162. export default {
  163. name: "Patient",
  164. data() {
  165. return {
  166. checkAll: false,
  167. isIndeterminate: true,
  168. wechatbindimg:"",
  169. active: true,
  170. schedulType: 0,
  171. schedulArr: [
  172. { value: 0, label: "全部" },
  173. { value: 1, label: "上午" },
  174. { value: 2, label: "下午" },
  175. { value: 3, label: "晚上" }
  176. ],
  177. systemType: 0,
  178. systemArr: [
  179. { value: 0, label: "全部" },
  180. { value: 1, label: "已绑定" },
  181. { value: 2, label: "未绑定" }
  182. ],
  183. sourceType: 0,
  184. sourceID: 0,
  185. lapsetoType: 0,
  186. sourceArr: [
  187. { value: 0, label: "全部", source: 0, lapseto: 0 },
  188. { value: 1, label: "转出", source: 0, lapseto: 2 },
  189. { value: 2, label: "留治", source: 0, lapseto: 1 },
  190. { value: 3, label: "门诊", source: 1, lapseto: 1 },
  191. { value: 4, label: "住院", source: 2, lapseto: 1 }
  192. ],
  193. scheduling: [
  194. {
  195. value: 1,
  196. label: "已排班"
  197. },
  198. {
  199. value: 2,
  200. label: "未排班"
  201. }
  202. ],
  203. prescription: [
  204. {
  205. value: 1,
  206. label: "有处方"
  207. },
  208. {
  209. value: 2,
  210. label: "无处方"
  211. }
  212. ],
  213. tableData: null,
  214. pickerOptions1: {
  215. shortcuts: [
  216. {
  217. text: "今天",
  218. onClick(picker) {
  219. picker.$emit("pick", new Date());
  220. }
  221. },
  222. {
  223. text: "昨天",
  224. onClick(picker) {
  225. const date = new Date();
  226. date.setTime(date.getTime() - 3600 * 1000 * 24);
  227. picker.$emit("pick", date);
  228. }
  229. },
  230. {
  231. text: "一周前",
  232. onClick(picker) {
  233. const date = new Date();
  234. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  235. picker.$emit("pick", date);
  236. }
  237. },
  238. {
  239. text:"清空",
  240. onClick(picker) {
  241. picker.$emit("pick");
  242. }
  243. }
  244. ]
  245. },
  246. searchKey: "",
  247. // value2: '',
  248. total: 0,
  249. pageTotal: 0,
  250. pageSelect: 0,
  251. listQuery: {
  252. page: 1,
  253. limit: 10,
  254. schedul_type: 0,
  255. binding_state: 0,
  256. lapseto: 0,
  257. source: 0,
  258. start_time: "",
  259. end_time: "",
  260. keywords: "",
  261. contagion: "",
  262. reimbursement_way:'',
  263. isscheduling:"",
  264. isprescription:"",
  265. },
  266. multipleSelection: [],
  267. bindWechatDialog: false,
  268. contagionList:[],
  269. reimbursement_ways:[],
  270. };
  271. },
  272. created() {
  273. this.getList();
  274. this.contagionList = this.$store.getters.contagions;
  275. this.reimbursement_ways = this.$store.getters.reimbursement_ways;
  276. },
  277. methods: {
  278. putOnRecord(){
  279. },
  280. getCount(row){
  281. console.log(row)
  282. return row.total_dialysis + row.user_sys_before_count
  283. },
  284. openWechatBindDialog(){
  285. this.bindWechatDialog = true;
  286. },
  287. handleCheckAllChange(val) {
  288. console.log(val);
  289. console.log(this.checkAll);
  290. console.log(this.isIndeterminate);
  291. },
  292. handleSelectionChange(val) {
  293. this.multipleSelection = val;
  294. this.pageSelect = this.multipleSelection.length;
  295. },
  296. handleCheckedCitiesChange(value) {
  297. let checkedCount = value.length;
  298. this.checkAll = checkedCount === this.cities.length;
  299. this.isIndeterminate =
  300. checkedCount > 0 && checkedCount < this.cities.length;
  301. },
  302. changeCategoryId(categoryId) {
  303. this.categoryId = categoryId;
  304. },
  305. selectSchedulType(scheduleType) {
  306. // alert(scheduleType);/
  307. this.schedulType = scheduleType;
  308. this.listQuery.schedul_type = scheduleType;
  309. this.getList();
  310. },
  311. selectSystemType(systemType) {
  312. this.systemType = systemType;
  313. this.listQuery.binding_state = systemType;
  314. this.getList();
  315. },
  316. selectLapseTo(sourceType, sourceID, lapseto) {
  317. this.sourceType = sourceType;
  318. this.sourceID = sourceID;
  319. this.lapsetoType = lapseto;
  320. this.listQuery.source = sourceID;
  321. this.listQuery.lapseto = lapseto;
  322. this.getList();
  323. },
  324. changeTime(){
  325. this.getList();
  326. },
  327. search(){
  328. this.listQuery.keywords = this.searchKey;
  329. this.getList();
  330. },
  331. changeOtherSearch(){
  332. this.getList();
  333. },
  334. getList() {
  335. fetchList(this.listQuery).then(response => {
  336. if (response.data.state == 0) {
  337. this.$message.error(response.data.msg);
  338. return false;
  339. } else {
  340. this.tableData = response.data.data.patients;
  341. this.pageTotal = this.tableData.length;
  342. this.total = response.data.data.total;
  343. }
  344. });
  345. },
  346. // components:{
  347. // pagiNation
  348. // }
  349. }
  350. }
  351. </script>
  352. <style rel="stylesheet/scss" lang="scss" scoped>
  353. .app-container {
  354. // margin: 20px;
  355. font-size: 15px;
  356. .filter-container {
  357. padding-bottom: 5px;
  358. }
  359. .search-component {
  360. width: 500px;
  361. .searchBox {
  362. width: 300px;
  363. height: 36px;
  364. line-height: 36px;
  365. padding-left: 15px;
  366. border: 1px #dcdfe6 solid;
  367. border-right: none;
  368. outline: none;
  369. float: left;
  370. border-radius: 6px 0 0 6px;
  371. font-size: 14px;
  372. color: #333;
  373. background: #fff;
  374. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  375. }
  376. .searchBtn {
  377. background-color: #409eff;
  378. color: #fff;
  379. font-size: 15px;
  380. text-align: center;
  381. height: 36px;
  382. line-height: 36px;
  383. float: left;
  384. outline: none;
  385. width: 70px;
  386. border: none;
  387. border-radius: 0 6px 6px 0;
  388. font-family: "Microsoft Yahei";
  389. cursor: pointer;
  390. }
  391. }
  392. .amount {
  393. font-weight: normal;
  394. padding: 10px 0 0 0;
  395. color: #606266;
  396. font-size: 14px;
  397. span {
  398. color: #ef2525;
  399. font-family: "Arial";
  400. padding: 0 2px;
  401. }
  402. }
  403. }
  404. </style>