PatientDispensing.vue 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. <template>
  2. <!--患者发药-->
  3. <div class="main-contain new-main-contain">
  4. <div class="position">
  5. <!-- <bread-crumb :crumbs='crumbs'></bread-crumb>-->
  6. <bread-crumb :crumbs="crumbs"></bread-crumb>
  7. </div>
  8. <div
  9. class="app-container"
  10. style="display: flex; flex: 1; padding: 10px 20px 0px 20px"
  11. >
  12. <div class="mainLeft">
  13. <div>
  14. <div class="list">
  15. <el-date-picker
  16. style="width: 200px"
  17. v-model="start_time"
  18. type="date"
  19. format="yyyy-MM-dd"
  20. value-format="yyyy-MM-dd"
  21. placeholder="选择日期"
  22. @change="changeTimes()"
  23. >
  24. </el-date-picker>
  25. </div>
  26. <!-- <el-button @click="testsss">调试1</el-button>-->
  27. <!-- <el-button @click="testsss2">调试2</el-button>-->
  28. <div class="list">
  29. <el-radio-group v-model="state" @change="lala()">
  30. <el-radio :label="1">待发药{{ waitmount }}人</el-radio>
  31. <el-radio :label="2">已发药{{ alreadmount }}人</el-radio>
  32. </el-radio-group>
  33. </div>
  34. <div
  35. class="list"
  36. style="display: flex; justify-content: space-between"
  37. >
  38. <el-input
  39. size="small"
  40. style="width: 130px"
  41. v-model="keywords"
  42. class="filter-item"
  43. placeholder="请输入患者名称"
  44. clearable
  45. />
  46. <el-button
  47. size="small"
  48. class="filter-item"
  49. type="primary"
  50. @click="searchAction"
  51. >搜索
  52. </el-button>
  53. </div>
  54. <el-table
  55. height="60vh"
  56. ref="table01"
  57. :data="waitmount_data"
  58. highlight-current-row
  59. @current-change="handleCurrentChange"
  60. border
  61. style="width: 100%"
  62. v-if="state == 1"
  63. :row-style="{ color: '#303133' }"
  64. :header-cell-style="{
  65. backgroundColor: 'rgb(245, 247, 250)',
  66. color: '#606266',
  67. }"
  68. >
  69. <el-table-column prop="date" label="患者姓名" width="100">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column prop="name" label="透析号" width="100">
  75. <template slot-scope="scope">
  76. <span>{{
  77. scope.row.DialysisNo ? scope.row.DialysisNo : ""
  78. }}</span>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <el-table
  83. :height="tableHeight"
  84. ref="table02"
  85. :data="alreadmount_data"
  86. highlight-current-row
  87. @current-change="handleCurrentChange"
  88. border
  89. :row-style="{ color: '#303133' }"
  90. :header-cell-style="{
  91. backgroundColor: 'rgb(245, 247, 250)',
  92. color: '#606266',
  93. }"
  94. style="width: 100%"
  95. v-if="state == 2"
  96. >
  97. <el-table-column prop="date" label="患者姓名" width="100">
  98. <template slot-scope="scope">
  99. <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="name" label="透析号" width="100">
  103. <template slot-scope="scope">
  104. <span>{{
  105. scope.row.DialysisNo ? scope.row.DialysisNo : ""
  106. }}</span>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. </div>
  111. </div>
  112. <div class="mainRight">
  113. <div class="titlelist">
  114. <div>
  115. 班次:
  116. <el-select
  117. v-model="shift"
  118. placeholder="请选择"
  119. @change="searchAction"
  120. >
  121. <el-option
  122. v-for="item in banshift"
  123. :key="item.value"
  124. :label="item.text"
  125. :value="item.value"
  126. >
  127. </el-option>
  128. </el-select>
  129. 分区:
  130. <el-select
  131. v-model="partition"
  132. placeholder="请选择"
  133. @change="searchAction"
  134. >
  135. <el-option
  136. v-for="item in fen"
  137. :key="item.id"
  138. :label="item.name"
  139. :value="item.id"
  140. >
  141. </el-option>
  142. </el-select>
  143. </div>
  144. <div>
  145. <el-button type="primary" @click="toExport" v-if="state == 2"
  146. >导出</el-button
  147. >
  148. <el-button type="primary" @click="dispense" v-if="state == 1"
  149. >发药</el-button
  150. >
  151. <el-button type="primary" @click="endispense" v-if="state == 2"
  152. >退药</el-button
  153. >
  154. <el-button type="primary" @click="toPrint">打印</el-button>
  155. <!-- <el-button @click="tiaoshi">调试</el-button>-->
  156. <el-button type="primary" v-if="state == 1" @click="toSetting"
  157. >设置</el-button
  158. >
  159. </div>
  160. </div>
  161. <el-divider style="margin-top: 10px"></el-divider>
  162. <div>
  163. <el-table
  164. :height="tableHeight"
  165. :data="tableData"
  166. border
  167. style="width: 100%"
  168. :row-style="{ color: '#303133' }"
  169. :header-cell-style="{
  170. backgroundColor: 'rgb(245, 247, 250)',
  171. color: '#606266',
  172. }"
  173. >
  174. <el-table-column
  175. type="index"
  176. label="序号"
  177. width="120"
  178. align="center"
  179. >
  180. </el-table-column>
  181. <el-table-column label="名称" width="200" align="center">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="规格" width="100" align="center">
  187. <template slot-scope="scope">
  188. <span>{{getSpecaiName(scope.row.DrugId)}}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="单次用量" width="100" align="center">
  192. <template slot-scope="scope">
  193. <span>{{
  194. scope.row.SingleDosage ? scope.row.SingleDosage : ""
  195. }}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="用法" width="100" align="center">
  199. <template slot-scope="scope">
  200. <span>{{ scope.row.Usage ? scope.row.Usage : "" }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column label="频率" width="100" align="center">
  204. <template slot-scope="scope">
  205. <span>{{
  206. scope.row.Frequency ? scope.row.Frequency : ""
  207. }}</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="天数" width="100" align="center">
  211. <template slot-scope="scope">
  212. <span>{{ scope.row.Days ? scope.row.Days : "" }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="总量" width="100" align="center">
  216. <template slot-scope="scope">
  217. <span>{{ scope.row.Total ? scope.row.Total : "" }}</span>
  218. </template>
  219. </el-table-column>
  220. <el-table-column label="生产厂商" width="100" align="center">
  221. <template slot-scope="scope">
  222. <span>{{ getManutuer(scope.row.DrugId) }}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="开立医生" width="150" align="center">
  226. <template slot-scope="scope">
  227. <span>{{ scope.row.Doctor ? scope.row.Doctor : "" }}</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column label="数据来源" width="162" align="center">
  231. <template slot-scope="scope">
  232. <span>{{
  233. scope.row.DataSources ? scope.row.DataSources : ""
  234. }}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="国家编码" width="162" align="center">
  238. <template slot-scope="scope">
  239. <span>{{getDrugName(scope.row.DrugId)}}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="备注" width="170" align="center">
  243. <template slot-scope="scope">
  244. <span>{{ scope.row.Remarks ? scope.row.Remarks : "" }}</span>
  245. </template>
  246. </el-table-column>
  247. </el-table>
  248. </div>
  249. <!-- <div v-if="state == 2" style="margin-top: 25px">诊断时间:{{ timedate }}</div>-->
  250. </div>
  251. <el-dialog title="设置" :visible.sync="dialogVisible" width="30%">
  252. <span style="font-size: 17px">请选择药品是否要通过药房管理出库</span>
  253. <span style="display: block; padding: 18px 25px">
  254. <el-radio v-model="is_open" label="1">是</el-radio>
  255. <el-radio v-model="is_open" label="2">否</el-radio>
  256. </span>
  257. <div
  258. style="
  259. height: 50px;
  260. background: #c7ebfc;
  261. border-radius: 5px;
  262. padding: 7px;
  263. "
  264. >
  265. <i class="el-icon-info" style="color: #3399ff; font-size: 17px"></i>
  266. 若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
  267. </div>
  268. <span slot="footer" class="dialog-footer">
  269. <el-button @click="dialogVisible = false">取 消</el-button>
  270. <el-button type="primary" @click="SaveSetting">保 存</el-button>
  271. </span>
  272. </el-dialog>
  273. </div>
  274. <patient-print
  275. ref="patientprint"
  276. :visibility="isVisibility"
  277. :propsTable="propsTable"
  278. >
  279. </patient-print>
  280. <patientPrintTwo ref="patientprintTwo"
  281. :visibility="isVisibilityTwo"
  282. :propsTable="propsTable"
  283. >
  284. </patientPrintTwo>
  285. </div>
  286. </template>
  287. <script>
  288. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  289. import patientPrint from "./print/patientPrint.vue";
  290. import patientPrintTwo from './print/patientPrintTwo'
  291. import { getPharmacyConfig, SaveSetting } from "@/api/his/advice";
  292. import {
  293. waitingdrug,
  294. issueddrugs,
  295. todaynumber,
  296. getpharmacycontent,
  297. dispensingmedicine,
  298. drugwithdrawal,
  299. getpartitionlist,
  300. } from "@/api/pharmacy";
  301. const moment = require("moment");
  302. export default {
  303. components: {
  304. BreadCrumb,
  305. patientPrint,
  306. patientPrintTwo
  307. },
  308. data() {
  309. return {
  310. patient_id: 0,
  311. crumbs: [
  312. { path: false, name: "药房管理" },
  313. { path: "/Pharmacy/patiantDispensing", name: "患者发药" },
  314. ],
  315. tableHeight: 400,
  316. start_time: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
  317. start_time2: moment(new Date()).add("year", 0).format("YYYY-MM-DD hh:mm"),
  318. state: 1, //1待发药,2已发药
  319. waitmount: 0, //待发药人数
  320. waitmount_data: [],
  321. alreadmount: 0, //已发药人数
  322. alreadmount_data: [],
  323. keywords: "",
  324. tableData: [],
  325. propsTable: [],
  326. tableData_list: [],
  327. isVisibility: false,
  328. isVisibilityTwo:false,
  329. currentRow: null,
  330. dialogVisible: false,
  331. is_open: "2",
  332. banshift: [
  333. { value: 0, text: "全部班" },
  334. { value: 1, text: "上午" },
  335. { value: 2, text: "下午" },
  336. { value: 3, text: "晚上" },
  337. ],
  338. shift: 0, //班次
  339. fen: [],
  340. partition: 0, //分区
  341. drugList:[],
  342. baseList:[],
  343. org_id:'',
  344. patients:{},
  345. doctors:[]
  346. };
  347. },
  348. watch: {},
  349. created() {
  350. this.init();
  351. this.gettodaynumber();
  352. this.fun3();
  353. this.getgetpartitionlist();
  354. this.org_id = this.$store.getters.xt_user.org.id
  355. // this.getwaitmount();//fun3
  356. // this.selectedbydefault();
  357. },
  358. methods: {
  359. getgetpartitionlist() {
  360. var params = {};
  361. getpartitionlist(params).then((res) => {
  362. if (res.data.state == 1) {
  363. this.fen = res.data.data.list;
  364. }
  365. });
  366. },
  367. tiaoshi() {
  368. console.log("this.shift", this.shift);
  369. console.log("this.partition", this.partition);
  370. console.log("this.waitmount_data", this.waitmount_data);
  371. console.log("this.alreadmount_data", this.alreadmount_data);
  372. console.log("this.waitmount", this.waitmount);
  373. console.log("this.alreadmount", this.alreadmount);
  374. },
  375. async fun3() {
  376. console.log("fun3");
  377. this.fun1().then((val) => {
  378. this.fun2();
  379. });
  380. },
  381. async fun4(tmp) {
  382. console.log("fun3");
  383. this.fun1().then((val) => {
  384. console.log("this.alreadmount_data", this.alreadmount_data);
  385. for (let i = 0; i < this.alreadmount_data.length; i++) {
  386. console.log("tmp = ", tmp);
  387. if (this.alreadmount_data[i].PatientID == tmp) {
  388. console.log("i = ", i);
  389. this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
  390. this.handleCurrentChange(this.alreadmount_data[i]);
  391. }
  392. }
  393. });
  394. },
  395. async fun5(tmp) {
  396. console.log("fun5555");
  397. this.fun1().then((val) => {
  398. console.log("this.alreadmount_data", this.waitmount_data);
  399. for (let i = 0; i < this.waitmount_data.length; i++) {
  400. console.log("tmp = ", tmp);
  401. if (this.waitmount_data[i].PatientID == tmp) {
  402. console.log("i = ", i);
  403. this.$refs.table01.setCurrentRow(this.waitmount_data[i]);
  404. this.handleCurrentChange(this.waitmount_data[i]);
  405. }
  406. }
  407. });
  408. },
  409. lala() {
  410. console.log("this.state!!!!!!", this.state);
  411. //初始化状态
  412. this.tableData = null;
  413. this.currentRow = null;
  414. this.selectedbydefault();
  415. },
  416. //选中行数
  417. handleCurrentChange(val) {
  418. console.log("state--",this.state)
  419. this.currentRow = val;
  420. console.log("this.currentRow", this.currentRow);
  421. if (this.state == 1) {
  422. this.getpatientdetails(0);
  423. }
  424. if (this.state == 2) {
  425. this.getpatientdetails(1);
  426. }
  427. },
  428. init() {
  429. // console.log("初始化了")
  430. this.state = 1;
  431. this.tableData = null;
  432. this.currentRow = null;
  433. this.partition = 0;
  434. this.shift = 0;
  435. },
  436. testsss() {
  437. this.state = 1;
  438. },
  439. //默认选中的
  440. selectedbydefault() {
  441. if (this.state == 1 && this.waitmount_data.length > 0) {
  442. this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
  443. this.handleCurrentChange(this.waitmount_data[0]);
  444. }
  445. if (this.state == 2 && this.alreadmount_data.length > 0) {
  446. this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
  447. this.handleCurrentChange(this.alreadmount_data[0]);
  448. }
  449. },
  450. //包装selectedbydefault
  451. fun2() {
  452. console.log("3333333this.waitmount_data", this.waitmount_data);
  453. // return new Promise((resolve, reject) => {
  454. if (this.state == 1 && this.waitmount_data.length > 0) {
  455. this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
  456. this.handleCurrentChange(this.waitmount_data[0]);
  457. }
  458. if (this.state == 2 && this.alreadmount_data.length > 0) {
  459. this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
  460. this.handleCurrentChange(this.alreadmount_data[0]);
  461. }
  462. // });
  463. },
  464. changeTimes() {
  465. this.gettodaynumber();
  466. this.getwaitmount();
  467. this.fun3();
  468. },
  469. //获取当天发药的人数
  470. gettodaynumber() {
  471. var params = {
  472. time: this.start_time,
  473. };
  474. todaynumber(params).then((res) => {
  475. if (res.data.state == 1) {
  476. console.log('3333333',res.data.data);
  477. this.waitmount = res.data.data.itotal;
  478. this.alreadmount = res.data.data.wtotal;
  479. this.drugList = res.data.data.drug
  480. }
  481. });
  482. // console.log("2222222")
  483. },
  484. //获取发药人列表
  485. getwaitmount() {
  486. var params = {
  487. keyword: this.keywords,
  488. time: this.start_time,
  489. shift: this.shift,
  490. partition: this.partition,
  491. };
  492. console.log("班次---------------------",params)
  493. waitingdrug(params).then((res) => {
  494. if (res.data.state == 1) {
  495. this.waitmount_data = res.data.data.list;
  496. this.baseList =[]
  497. this.baseList = res.data.data.baseList
  498. if (this.shift != 0 || this.partition != 0) {
  499. if (this.waitmount_data == null) {
  500. this.waitmount = 0;
  501. } else {
  502. this.waitmount = this.waitmount_data.length;
  503. }
  504. }
  505. }
  506. });
  507. issueddrugs(params).then((res) => {
  508. if (res.data.state == 1) {
  509. this.alreadmount_data = res.data.data.list;
  510. if (this.shift != 0 || this.partition != 0) {
  511. if (this.alreadmount_data == null) {
  512. this.alreadmount = 0;
  513. } else {
  514. this.alreadmount = this.alreadmount_data.length;
  515. }
  516. }
  517. }
  518. });
  519. },
  520. //包装getwaitmount
  521. async fun1() {
  522. // return new Promise((resolve, reject) => {
  523. var params = {
  524. keyword: this.keywords,
  525. time: this.start_time,
  526. shift: this.shift,
  527. partition: this.partition,
  528. };
  529. await waitingdrug(params).then((res) => {
  530. if (res.data.state == 1) {
  531. this.waitmount_data = res.data.data.list;
  532. console.log("1111111");
  533. }
  534. });
  535. await issueddrugs(params).then((res) => {
  536. if (res.data.state == 1) {
  537. this.alreadmount_data = res.data.data.list;
  538. console.log("1111111s");
  539. }
  540. });
  541. console.log("222222222");
  542. // })
  543. },
  544. //获取患者信息详情
  545. getpatientdetails(val) {
  546. console.log("val2332323223",this.currentRow)
  547. var params = {
  548. patient_id: this.currentRow.PatientID,
  549. is_medicine: val,
  550. time: this.start_time,
  551. };
  552. getpharmacycontent(params).then((res) => {
  553. if (res.data.state == 1) {
  554. var list = res.data.data.list;
  555. console.log("hhhhawoowowow",res.data.data)
  556. this.baseList =[]
  557. this.baseList = res.data.data.baseList
  558. this.doctors = res.data.data.doctors
  559. const obj={
  560. age:res.data.data.patients.age,
  561. gender: res.data.data.patients.gender,
  562. diagnose:res.data.data.patients.diagnose,
  563. zhixing:res.data.data.patients.created_time
  564. }
  565. this.patients =obj
  566. if(this.$store.getters.xt_user.org.id == 10188 || this.$store.getters.xt_user.org.id == 10217 || this.$store.getters.xt_user.org.id == 10387 || this.$store.getters.xt_user.org.id == 0 || this.$store.getters.xt_user.org.id == 10480 ){
  567. this.tableData = []
  568. if(list!=null && list.length >0){
  569. for(let i=0;i<list.length;i++){
  570. if(list[i].DataSources != "临时医嘱"){
  571. this.tableData.push(list[i])
  572. }
  573. }
  574. }
  575. }
  576. if(this.$store.getters.xt_user.org.id != 10188 && this.$store.getters.xt_user.org.id != 10217 && this.$store.getters.xt_user.org.id != 10387 && this.$store.getters.xt_user.org.id != 0 && this.$store.getters.xt_user.org.id != 10480 ){
  577. this.tableData = []
  578. this.tableData = list
  579. }
  580. console.log("tableDatawoowow",this.tableData)
  581. } else {
  582. this.$message.error(res.data.msg);
  583. }
  584. });
  585. },
  586. // 跳转打印页面
  587. toPrint() {
  588. if (this.tableData == null) {
  589. this.$message.error("未选择任何数据");
  590. return;
  591. }else{
  592. if(this.org_id != 10653 && this.org_id !=0){
  593. this.$refs.patientprint.show(
  594. this.tableData,
  595. this.currentRow,
  596. this.state,
  597. this.start_time
  598. );
  599. }else{
  600. this.$refs.patientprintTwo.show(
  601. this.tableData,
  602. this.currentRow,
  603. this.state,
  604. this.start_time2,
  605. this.baseList,
  606. this.patients,
  607. this.doctors
  608. )
  609. }
  610. }
  611. },
  612. toExport() {
  613. import("@/vendor/Export2Excel").then((excel) => {
  614. for (let i = 0; i < this.tableData.length; i++) {
  615. this.tableData[i].index = i + 1;
  616. this.tableData[i].time = this.start_time;
  617. this.tableData[i].uname = this.currentRow.Name;
  618. }
  619. const tHeader = [
  620. "序号",
  621. "日期",
  622. "患者名称",
  623. "名称",
  624. "单次用量",
  625. "用法",
  626. "频率",
  627. "天数",
  628. "总量",
  629. "开立医生",
  630. "数据来源",
  631. "备注",
  632. ];
  633. const filterVal = [
  634. "index",
  635. "time",
  636. "uname",
  637. "Name",
  638. "SingleDosage",
  639. "Usage",
  640. "Frequency",
  641. "Days",
  642. "Total",
  643. "Doctor",
  644. "DataSources",
  645. "Remarks",
  646. ];
  647. const data = this.formatJson(filterVal, this.tableData);
  648. excel.export_json_to_excel({
  649. header: tHeader,
  650. data,
  651. filename: "领药单",
  652. });
  653. this.downloadLoading = false;
  654. });
  655. },
  656. formatJson(filterVal, jsonData) {
  657. return jsonData.map((v) => filterVal.map((j) => v[j]));
  658. },
  659. // 搜索患者
  660. searchAction() {
  661. this.tableData = null;
  662. this.getwaitmount();
  663. if (this.shift != 0 || this.partition != 0) {
  664. } else {
  665. this.gettodaynumber();
  666. }
  667. },
  668. // 药品发药
  669. dispense() {
  670. var tmp = this.currentRow.PatientID;
  671. var params = {
  672. patient_id: this.currentRow.PatientID,
  673. time: this.start_time,
  674. };
  675. this.$confirm("确定是否对该患者进行发药?", "患者发药", {
  676. confirmButtonText: "确 定",
  677. cancelButtonText: "取 消",
  678. type: "warning",
  679. }).then(() => {
  680. dispensingmedicine(params).then((res) => {
  681. if (res.data.state == 1) {
  682. this.$message.success("操作成功");
  683. this.gettodaynumber();
  684. this.searchAction();
  685. this.tableData = null;
  686. this.fun4(tmp);
  687. this.state = 2;
  688. } else {
  689. this.$message.error(res.data.msg);
  690. }
  691. });
  692. })
  693. .catch(() => {});
  694. },
  695. toSetting() {
  696. getPharmacyConfig().then((response) => {
  697. if (response.data.state == 1) {
  698. this.dialogVisible = true;
  699. var config = response.data.data.config;
  700. this.is_open = config.is_open.toString();
  701. }
  702. });
  703. },
  704. SaveSetting() {
  705. var params = {
  706. is_open: parseInt(this.is_open),
  707. };
  708. SaveSetting(params).then((response) => {
  709. if (response.data.state == 1) {
  710. var config = response.data.data.config;
  711. this.$message.success("保存成功!");
  712. this.dialogVisible = false;
  713. }
  714. });
  715. },
  716. // 药品退药
  717. endispense() {
  718. var tmp = this.currentRow.PatientID;
  719. var params = {
  720. patient_id: this.currentRow.PatientID,
  721. time: this.start_time,
  722. };
  723. this.$confirm("确定是否对该患者进行退药?", "患者退药", {
  724. confirmButtonText: "确 定",
  725. cancelButtonText: "取 消",
  726. type: "warning",
  727. }).then(() => {
  728. drugwithdrawal(params).then((res) => {
  729. if (res.data.state == 1) {
  730. this.$message.success("操作成功");
  731. this.gettodaynumber();
  732. this.searchAction();
  733. this.tableData = null;
  734. this.fun5(tmp);
  735. this.state = 1;
  736. } else {
  737. this.$message.error(res.data.msg);
  738. }
  739. });
  740. })
  741. .catch(() => {});
  742. },
  743. getDrugName(drug_id){
  744. var medical_insurance_number = ""
  745. for(let i=0;i<this.drugList.length;i++){
  746. if(drug_id == this.drugList[i].id){
  747. medical_insurance_number = this.drugList[i].medical_insurance_number
  748. }
  749. }
  750. return medical_insurance_number
  751. },
  752. getManutuer(drug_id){
  753. var manufacturer_name = ""
  754. for(let i=0;i<this.baseList.length;i++){
  755. if(drug_id == this.baseList[i].id){
  756. manufacturer_name = this.baseList[i].manufacturer_name
  757. }
  758. }
  759. return manufacturer_name
  760. },
  761. getSpecaiName(drug_id){
  762. var spc =""
  763. for(let i=0;i<this.baseList.length;i++){
  764. if(drug_id == this.baseList[i].id){
  765. spc = this.baseList[i].dose + this.baseList[i].dose_unit +"*"+this.baseList[i].min_number+this.baseList[i].min_unit+"/"+this.baseList[i].max_unit
  766. }
  767. }
  768. return spc
  769. }
  770. },
  771. };
  772. </script>
  773. <style rel="stylesheet/css" lang="scss" scoped>
  774. .new-main-contain {
  775. height: 100%;
  776. display: flex;
  777. flex-direction: column;
  778. }
  779. .app-container {
  780. height: 100%;
  781. }
  782. .mainLeft {
  783. width: 200px;
  784. height: 100%;
  785. display: flex;
  786. flex-direction: column;
  787. .el-radio {
  788. margin-right: 5px;
  789. }
  790. .list {
  791. margin: 10px 0;
  792. }
  793. }
  794. .mainRight {
  795. margin-left: 10px;
  796. flex: 1;
  797. height: 100%;
  798. display: flex;
  799. flex-direction: column;
  800. overflow-y: auto;
  801. .titlelist {
  802. display: flex;
  803. justify-content: space-between;
  804. white-space: nowrap;
  805. color: #909399;
  806. font-size: 14px;
  807. /deep/ .el-input__inner {
  808. font-size: 13px !important;
  809. }
  810. }
  811. .el-table {
  812. margin-top: -13px;
  813. }
  814. .el-button {
  815. height: 34px;
  816. width: 65px;
  817. }
  818. /deep/ .el-divider {
  819. height: 2px;
  820. margin-top: 10px;
  821. }
  822. /deep/ .el-table__body-wrapper {
  823. overflow-x: scroll !important;
  824. }
  825. }
  826. /deep/ .el-input__inner {
  827. padding-right: 15px;
  828. }
  829. /deep/ .el-table--scrollable-x .el-table__body-wrapper {
  830. overflow: auto;
  831. overflow-x: hidden;
  832. }
  833. /deep/ .gutter {
  834. width: 15px !important;
  835. display: inline-block !important;
  836. }
  837. /deep/ .el-table__fixed-right-patch {
  838. width: 15px !important;
  839. }
  840. /deep/ .el-table__fixed-right {
  841. bottom: 0 !important;
  842. left: auto;
  843. right: 0;
  844. }
  845. /deep/ .el-table__body-wrapper::-webkit-scrollbar {
  846. width: 15px !important;
  847. height: 15px !important;
  848. }
  849. </style>