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

index.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button
  6. size="small"
  7. @click="setting"
  8. class="filter-item"
  9. style="float:right;"
  10. type="primary"
  11. >设置
  12. </el-button>
  13. </div>
  14. <div class="app-container">
  15. <div class="cell clearfix" style="margin-bottom:0px;">
  16. <el-date-picker
  17. v-model="start_time"
  18. prefix-icon="el-icon-date"
  19. :editable="false"
  20. style="width: 160px;margin-right:10px;"
  21. type="date"
  22. placeholder="选择日期时间"
  23. align="right"
  24. format="yyyy-MM-dd"
  25. value-format="yyyy-MM-dd"
  26. @change="changeStartime"
  27. ></el-date-picker>
  28. <el-autocomplete
  29. style="margin:16px 5px"
  30. popper-class="my-autocomplete"
  31. v-model.trim="search_input"
  32. :fetch-suggestions="querySearchAsync"
  33. :trigger-on-focus="false"
  34. placeholder="病人名字或者透析号"
  35. @select="handleSelect"
  36. >
  37. <i class="el-icon-search el-input__icon" slot="suffix"> </i>
  38. <template slot-scope="{ item }">
  39. <div class="name">{{ item.name }}</div>
  40. </template>
  41. </el-autocomplete>
  42. <el-button type="primary" @click="toSeachPatient">搜索</el-button>
  43. </div>
  44. <el-container>
  45. <div style="width:160px;">
  46. <div class="tablesTitle">患者列表</div>
  47. <el-table :data="tablePatient" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row
  48. @current-change="handleCurrentChange" ref="monthlyPlanTable"
  49. >
  50. <el-table-column align="center" prop="dialysis_no" label="透析号" width="70">
  51. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  52. </el-table-column>
  53. <el-table-column align="center" prop="name" label="姓名" width="90">
  54. <template slot-scope="scope">{{ scope.row.name }}</template>
  55. </el-table-column>
  56. </el-table>
  57. </div>
  58. <div style="flex:1;margin-left:20px;">
  59. <div style="display:flex;justify-content: space-between;align-items: center;">
  60. <div class="tablesTitle">自备药列表</div>
  61. <div>
  62. <el-button type="primary" size="mini" @click="openForm(1)">添加</el-button>
  63. <el-button type="primary" size="mini" @click="openForm(2)">入库</el-button>
  64. <el-button type="primary" size="mini" @click="openForm(3)">出库</el-button>
  65. </div>
  66. </div>
  67. <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  68. <el-table-column align="center" prop="dialysis_no" label="药品名称" width="120">
  69. <template slot-scope="scope">{{scope.row.drug_name}}</template>
  70. </el-table-column>
  71. <el-table-column align="center" prop="name" label="规格名称">
  72. <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
  73. </el-table-column>
  74. <el-table-column align="center" prop="dialysis_no" label="单位" width="60">
  75. <template slot-scope="scope">{{scope.row.min_unit}}</template>
  76. </el-table-column>
  77. <el-table-column align="center" prop="name" label="自备数量" width="90">
  78. <template slot-scope="scope">
  79. {{getTotal(scope.row.patient_id,scope.row.id)}}
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="center" prop="name" label="已使用" width="90">
  83. <template slot-scope="scope">{{getCountTwo(scope.row.patient_id,scope.row.drug_name,scope.row.drug_spec)}}</template>
  84. </el-table-column>
  85. <el-table-column align="center" prop="name" label="剩余" width="90">
  86. <template slot-scope="scope">{{getTotal(scope.row.patient_id,scope.row.id)- getCountTwo(scope.row.patient_id,scope.row.drug_name,scope.row.drug_spec)}}</template>
  87. </el-table-column>
  88. <!-- <el-table-column align="center" prop="name" label="停用" width="90">
  89. <template slot-scope="scope">
  90. <el-switch v-model="value1">
  91. </el-switch>
  92. </template>
  93. </el-table-column> -->
  94. <el-table-column align="center" prop="name" label="备注">
  95. <!-- <template slot-scope="scope">{{ scope.row.remarks }}</template> -->
  96. <template slot-scope="scope">
  97. {{getRemarks(scope.row.patient_id,scope.row.id)}}
  98. </template>
  99. </el-table-column>
  100. <el-table-column align="center" prop="name" label="操作" width="180">
  101. <template slot-scope="scope">
  102. <el-button size="mini" type="primary" @click="toDetail(scope.row.drug_name,scope.row.drug_spec,scope.row.patient_id)">明细</el-button>
  103. <el-button size="mini" type="danger" @click="DeleteDrugNameById(scope.row.id,scope.row.drug_name,scope.row.patient_id,scope.$index)">删除</el-button>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. </div>
  108. </el-container>
  109. </div>
  110. <el-dialog
  111. title="设置"
  112. :visible.sync="dialogVisible"
  113. width="600px"
  114. :before-close="handleClose">
  115. <p style="margin-bottom:20px;">启用“自备药”后,在开透析医嘱时,医生可以选择自备药中的药品,且将自动出库</p>
  116. <el-radio v-model="radio" label="1">开启</el-radio>
  117. <el-radio v-model="radio" label="2">不开启</el-radio>
  118. <span slot="footer" class="dialog-footer">
  119. <el-button @click="dialogVisible = false">取 消</el-button>
  120. <el-button type="primary" @click="saveRadio">确 定</el-button>
  121. </span>
  122. </el-dialog>
  123. <add-medicine ref="addMedicine" @getlist="getlist"></add-medicine>
  124. <medicine-detail ref="medicineDetail"></medicine-detail>
  125. <warehousing ref="warehousing" @getlist="getlist"></warehousing>
  126. <warehouse-out ref="warehouseOut" @getlist="getlist"></warehouse-out>
  127. </div>
  128. </template>
  129. <script>
  130. import BreadCrumb from "../../components/bread-crumb";
  131. import addMedicine from "./components/addMedicine"
  132. import medicineDetail from "./components/medicineDetail"
  133. import warehousing from "./components/warehousing"
  134. import warehouseOut from "./components/warehouseOut"
  135. const moment = require('moment')
  136. import { PostSearch } from '@/api/patient'
  137. import { getCurrentPatient,saveRadio,getStockList,DeleteDrugNameById,getDrugSet,getPatientDetail} from "@/api/drug/drug"
  138. export default {
  139. components:{
  140. BreadCrumb,
  141. addMedicine,
  142. medicineDetail,
  143. warehousing,
  144. warehouseOut
  145. },
  146. data(){
  147. return{
  148. crumbs: [
  149. { path: false, name: "库存管理" },
  150. { path: false, name: "自备药管理" },
  151. { path: false, name: "自备药管理" },
  152. ],
  153. // options: [{
  154. // value: '1',
  155. // label: '上午'
  156. // }, {
  157. // value: '2',
  158. // label: '下午'
  159. // }, {
  160. // value: '3',
  161. // label: '晚上'
  162. // }],
  163. value: '',
  164. tableData:[],
  165. dialogVisible:false,
  166. radio:'2',
  167. tablePatient:[],
  168. disableBtton:false,
  169. currentRow: null,
  170. patient_name:"",
  171. patient_id:"",
  172. start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  173. search_input:"",
  174. patient_id:0,
  175. stockList:[],
  176. outStocklist:[],
  177. outList:[]
  178. }
  179. },
  180. methods:{
  181. setting(){
  182. this.dialogVisible = true
  183. },
  184. handleCurrentChange(val){
  185. this.currentRow = val
  186. this.patient_name = val.name
  187. this.patient_id = val.id
  188. if(val.name !=""){
  189. this.disableBtton = true
  190. }
  191. this.getlist()
  192. },
  193. changeStartime(){
  194. this.getlist()
  195. },
  196. handleClose(){
  197. this.dialogVisible = false
  198. },
  199. openForm(index){
  200. if(index == 1){
  201. if(this.disableBtton == true){
  202. this.$refs.addMedicine.show(this.patient_name,this.patient_id);
  203. }
  204. if(this.disableBtton == false){
  205. this.$message.error("请选择患者!")
  206. }
  207. }else if(index == 2){
  208. this.$refs.warehousing.show(this.patient_name,this.patient_id);
  209. }else if(index == 3){
  210. this.$refs.warehouseOut.show(this.patient_name,this.patient_id);
  211. }
  212. },
  213. toDetail(drugname,drugspec,patientid){
  214. this.$refs.medicineDetail.show(drugname,drugspec,patientid);
  215. },
  216. getCurrentPatient(){
  217. getCurrentPatient().then(response=>{
  218. if(response.data.state == 1){
  219. this.tablePatient = response.data.data.patient
  220. }
  221. })
  222. },
  223. searchAction(){
  224. this.patient_id = 0
  225. this.getlist()
  226. },
  227. saveRadio(){
  228. const params = {
  229. radio:this.radio
  230. }
  231. saveRadio(params).then(response=>{
  232. if(response.data.state == 1){
  233. var drugset = response.data.data.drugSet
  234. this.$message.success("保存成功")
  235. this.dialogVisible = false
  236. }
  237. })
  238. },
  239. getlist(){
  240. const params = {
  241. id:this.patient_id,
  242. start_time:this.start_time,
  243. keyword:this.search_input,
  244. }
  245. getStockList(params).then(response=>{
  246. if(response.data.state == 1){
  247. var medicalList = response.data.data.medicalList
  248. console.log("medicalist2222",medicalList)
  249. this.tableData = medicalList
  250. var stocklist = response.data.data.stocklist
  251. console.log("stocklist",stocklist)
  252. this.stockList = stocklist
  253. var outstocklist = response.data.data.outStocklist
  254. this.outStocklist = outstocklist
  255. var outList = response.data.data.outList
  256. console.log("outList",outList)
  257. this.outList = outList
  258. }
  259. })
  260. },
  261. DeleteDrugNameById(id,name,patientid,index){
  262. console.log("id",id)
  263. console.log("name",name)
  264. console.log("patientid",patientid)
  265. this.$confirm('确认删除吗?', '删除', {
  266. confirmButtonText: '确 定',
  267. cancelButtonText: '取 消',
  268. type: 'warning'
  269. }).then(() => {
  270. const params = {
  271. id:id,
  272. drugname:name,
  273. patientid:patientid
  274. }
  275. DeleteDrugNameById(params).then(response => {
  276. if (response.data.state == 1) {
  277. var msg = response.data.data.msg
  278. this.tableData.splice(index, 1);
  279. this.$message.success("删除成功")
  280. } else {
  281. this.$message.error("药品已经出库不能删除")
  282. }
  283. })
  284. })
  285. .catch(() => {
  286. })
  287. },
  288. getCount(patientid,drugname,drugspec){
  289. var total = 0
  290. for(let i=0;i<this.outStocklist.length;i++){
  291. if(patientid == this.outStocklist[i].patient_id && drugname == this.outStocklist[i].drug_name && drugspec == this.outStocklist[i].drug_spec){
  292. total = this.outStocklist[i].Count
  293. }
  294. }
  295. return total
  296. },
  297. getCountTwo(patientid,drugname,drugspec){
  298. var total = 0
  299. for(let i=0;i<this.outList.length;i++){
  300. if(patientid == this.outList[i].patient_id && drugname == this.outList[i].drug_name && drugspec == this.outList[i].drug_spec){
  301. total += this.outList[i].outstore_number
  302. }
  303. }
  304. return total
  305. },
  306. getDrugSet(){
  307. getDrugSet().then(response=>{
  308. if(response.data.state == 1){
  309. var drugset = response.data.data.drugSet
  310. this.radio = drugset.drug_start.toString()
  311. }
  312. })
  313. },
  314. getTotal(patientid,id){
  315. var total = 0
  316. for(let i=0;i<this.stockList.length;i++){
  317. if(patientid == this.stockList[i].patient_id && id == this.stockList[i].medic_id){
  318. total = this.stockList[i].Total
  319. }
  320. }
  321. return total
  322. },
  323. getRemarks(patientid,id){
  324. var remarks = ""
  325. for(let i=0;i<this.stockList.length;i++){
  326. if(patientid == this.stockList[i].patient_id && id == this.stockList[i].medic_id){
  327. remarks = this.stockList[i].remarks
  328. }
  329. }
  330. return remarks
  331. },
  332. querySearchAsync(keyword, cb) {
  333. let key = ''
  334. if (keyword != undefined) {
  335. key = keyword
  336. }
  337. let searchArray = []
  338. console.log("key",key)
  339. PostSearch(key).then(response => {
  340. if (response.data.state == 1) {
  341. searchArray = response.data.data.patient
  342. console.log("searchArray",searchArray)
  343. cb(searchArray)
  344. }
  345. })
  346. return searchArray
  347. },
  348. handleSelect(val){
  349. this.search_input = val.name
  350. for(let i=0;i<this.tablePatient.length;i++){
  351. if(this.tablePatient[i].id == val.id){
  352. this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[i])
  353. }
  354. }
  355. this.getlist()
  356. this.getPatientDetail(val.id)
  357. },
  358. getPatientDetail(id){
  359. getPatientDetail(id).then(response=>{
  360. if(response.data.state == 1){
  361. var patientDetail = response.data.data.patientDetail
  362. console.log("patientDetail",patientDetail)
  363. var arr = []
  364. arr.push(patientDetail)
  365. this.tablePatient = arr
  366. }
  367. })
  368. },
  369. toSeachPatient(){
  370. this.getCurrentPatient()
  371. }
  372. },
  373. created(){
  374. //获取当前机构下的所有患者
  375. this.getCurrentPatient()
  376. this.getDrugSet()
  377. },
  378. watch: {
  379. tablePatient: function() {
  380. this.$nextTick(function() {
  381. this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[0])
  382. })
  383. }
  384. },
  385. }
  386. </script>
  387. <style lang="scss" scoped>
  388. .tablesTitle{
  389. font-size: 16px;
  390. color: #000;
  391. font-weight: bold;
  392. height: 40px;
  393. line-height: 40px;
  394. }
  395. </style>