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

index.vue 14KB

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