12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328 |
- <template>
- <!--患者发药-->
- <div class="main-contain new-main-contain">
- <div class="position">
- <!-- <bread-crumb :crumbs='crumbs'></bread-crumb>-->
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- </div>
- <div
- class="app-container"
- style="display: flex; flex: 1; padding: 10px 20px 0px 20px"
- >
- <div class="mainLeft">
- <div>
- <div class="list">
- <el-date-picker
- style="width: 200px"
- v-model="start_time"
- type="date"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- placeholder="选择日期"
- @change="changeTimes()"
- >
- </el-date-picker>
- </div>
- <!-- <el-button @click="testsss">调试1</el-button>-->
- <!-- <el-button @click="testsss2">调试2</el-button>-->
- <div class="list">
- <el-radio-group v-model="state" @change="lala()">
- <el-radio :label="1">待发药{{ waitmount }}人</el-radio>
- <el-radio :label="2">已发药{{ alreadmount }}人</el-radio>
- </el-radio-group>
- </div>
- <div
- class="list"
- style="display: flex; justify-content: space-between"
- >
- <el-input
- size="small"
- style="width: 130px"
- v-model="keywords"
- class="filter-item"
- placeholder="请输入患者名称"
- clearable
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- @click="searchAction"
- >搜索
- </el-button>
- </div>
-
- <el-table
- height="60vh"
- ref="table01"
- :data="waitmount_data"
- highlight-current-row
- @current-change="handleCurrentChange"
- border
- style="width: 100%"
- v-if="state == 1"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- >
- <el-table-column prop="date" label="患者姓名" width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="透析号" width="100">
- <template slot-scope="scope">
- <span>{{
- scope.row.DialysisNo ? scope.row.DialysisNo : ""
- }}</span>
- </template>
- </el-table-column>
- </el-table>
- <el-table
- :height="tableHeight"
- ref="table02"
- :data="alreadmount_data"
- highlight-current-row
- @current-change="handleCurrentChange"
- border
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- style="width: 100%"
- v-if="state == 2"
- >
- <el-table-column prop="date" label="患者姓名" width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="透析号" width="100">
- <template slot-scope="scope">
- <span>{{
- scope.row.DialysisNo ? scope.row.DialysisNo : ""
- }}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div class="mainRight">
- <div class="titlelist">
- <div>
- 班次:
- <el-select
- v-model="shift"
- placeholder="请选择"
- @change="searchAction"
- >
- <el-option
- v-for="item in banshift"
- :key="item.value"
- :label="item.text"
- :value="item.value"
- >
- </el-option>
- </el-select>
- 分区:
- <el-select
- v-model="partition"
- placeholder="请选择"
- @change="searchAction"
- >
- <el-option
- v-for="item in fen"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
-
-
- <div>
- <el-button type="primary" @click="toExport" v-if="state == 2"
- >导出</el-button
- >
-
- <el-button type="primary" @click="dispense" v-if="state == 1"
- >发药</el-button
- >
- <el-button type="primary" @click="endispense" v-if="state == 2"
- >退药</el-button
- >
- <el-button type="primary" @click="toPrint">打印</el-button>
- <!-- <el-button @click="tiaoshi">调试</el-button>-->
- <el-button type="primary" v-if="state == 1" @click="toSetting"
- >设置</el-button
- >
- </div>
- </div>
- <el-divider style="margin-top: 10px"></el-divider>
- <div>
- <el-table
- :height="tableHeight"
- :data="tableData"
- border
- style="width: 100%"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- >
- <el-table-column
- type="index"
- label="序号"
- width="50"
- align="center"
- >
- </el-table-column>
- <el-table-column label="名称" width="100" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="规格" width="100" align="center">
- <template slot-scope="scope">
- <span>{{getSpecaiName(scope.row.DrugId)}}</span>
- </template>
- </el-table-column>
- <el-table-column label="单次用量" width="100" align="center">
- <template slot-scope="scope">
- <span>{{
- scope.row.SingleDosage ? scope.row.SingleDosage : ""
- }}</span>
- </template>
- </el-table-column>
- <el-table-column label="用法" width="100" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Usage ? scope.row.Usage : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="频率" width="100" align="center">
- <template slot-scope="scope">
- <span>{{
- scope.row.Frequency ? scope.row.Frequency : ""
- }}</span>
- </template>
- </el-table-column>
- <el-table-column label="天数" width="100" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Days ? scope.row.Days : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总量" width="100" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Total ? scope.row.Total : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="生产厂商" width="100" align="center">
- <template slot-scope="scope">
- <span>{{ getManutuer(scope.row.DrugId) }}</span>
- </template>
- </el-table-column>
- <el-table-column label="药品追溯码" width="162" align="center">
- <template slot-scope="scope">
- <div @click="getDrugCode(scope.row.ID,scope.row.DataSources,scope.row.DrugCode,scope.$index)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div>
- </template>
- </el-table-column>
- <el-table-column label="开立医生" width="150" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Doctor ? scope.row.Doctor : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数据来源" width="162" align="center">
- <template slot-scope="scope">
- <span>{{
- scope.row.DataSources ? scope.row.DataSources : ""
- }}</span>
- </template>
- </el-table-column>
- <el-table-column label="国家编码" width="162" align="center">
- <template slot-scope="scope">
- <span>{{getDrugName(scope.row.DrugId)}}</span>
- </template>
- </el-table-column>
-
-
- <el-table-column label="备注" width="170" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.Remarks ? scope.row.Remarks : "" }}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- <div v-if="state == 2" style="margin-top: 25px">诊断时间:{{ timedate }}</div>-->
- </div>
- <el-dialog title="设置" :visible.sync="dialogVisible" width="30%">
- <span style="font-size: 17px">请选择药品是否要通过药房管理出库</span>
- <span style="display: block; padding: 18px 25px">
- <el-radio v-model="is_open" label="1">是</el-radio>
- <el-radio v-model="is_open" label="2">否</el-radio>
- </span>
- <span style="font-size: 17px">请选择是否发药时上传追溯码</span>
- <span style="display: block; padding: 18px 25px">
- <el-radio v-model="is_drug_open" label="1">是</el-radio>
- <el-radio v-model="is_drug_open" label="2">否</el-radio>
- </span>
- <div
- style="
- height: 50px;
- background: #c7ebfc;
- border-radius: 5px;
- padding: 7px;
- "
- >
- <i class="el-icon-info" style="color: #3399ff; font-size: 17px"></i>
- 若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="SaveSetting">保 存</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="药品追溯码"
- :visible.sync="dialogVisibleOne"
- width="40%">
- <span>
- <el-input
- @keyup.native="changeText"
- type="textarea"
- placeholder="请输入内容"
- v-model="textarea"
- :rows="10"
- >
- </el-input>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleOne = false">取 消</el-button>
- <el-button type="primary" @click="saveTextArea()">确 定</el-button>
- </span>
- </el-dialog>
-
-
- </div>
-
- <patient-print
- ref="patientprint"
- :visibility="isVisibility"
- :propsTable="propsTable"
-
- >
- </patient-print>
- <patientPrintTwo ref="patientprintTwo"
- :visibility="isVisibilityTwo"
- :propsTable="propsTable"
- >
- </patientPrintTwo>
- </div>
- </template>
-
- <script>
- import BreadCrumb from "@/xt_pages/components/bread-crumb";
- import patientPrint from "./print/patientPrint.vue";
- import patientPrintTwo from './print/patientPrintTwo'
- import { getPharmacyConfig, SaveSetting } from "@/api/his/advice";
- import {
- waitingdrug,
- issueddrugs,
- todaynumber,
- getpharmacycontent,
- dispensingmedicine,
- drugwithdrawal,
- getpartitionlist,
- changeDrugCode
- } from "@/api/pharmacy";
- import dataDruguse from "../../router/modules/dataDruguse";
- import axios from 'axios'
- const moment = require("moment");
- export default {
- components: {
- BreadCrumb,
- patientPrint,
- patientPrintTwo
- },
- data() {
- return {
- patient_id: 0,
- crumbs: [
- { path: false, name: "药房管理" },
- { path: "/Pharmacy/patiantDispensing", name: "患者发药" },
- ],
- tableHeight: 400,
- start_time: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
- start_time2: moment(new Date()).add("year", 0).format("YYYY-MM-DD HH:mm"),
- state: 1, //1待发药,2已发药
- waitmount: 0, //待发药人数
- waitmount_data: [],
- alreadmount: 0, //已发药人数
- alreadmount_data: [],
- keywords: "",
- tableData: [],
- propsTable: [],
- tableData_list: [],
- isVisibility: false,
- isVisibilityTwo:false,
- currentRow: null,
- dialogVisible: false,
- is_open: "2",
- banshift: [
- { value: 0, text: "全部班" },
- { value: 1, text: "上午" },
- { value: 2, text: "下午" },
- { value: 3, text: "晚上" },
- ],
- shift: 0, //班次
- fen: [],
- partition: 0, //分区
- drugList:[],
- baseList:[],
- org_id:'',
- patients:{},
- doctors:[],
- diagnosearr:[],
- diagnosis:'',
- dialogVisibleOne:false,
- textarea:"",
- id:0,
- is_source:0,
- drug_code:0,
- currentRow:{},
- currentIndex:0,
- is_drug_open:"2",
- textarea:"",
- drug_code_open:0,
- patientList:[]
-
- };
- },
- watch: {},
- created() {
- this.init();
- this.gettodaynumber();
- this.fun3();
- this.getgetpartitionlist();
- this.org_id = this.$store.getters.xt_user.org.id
- // this.getwaitmount();//fun3
- // this.selectedbydefault();
- },
- methods: {
- getgetpartitionlist() {
- var params = {};
- getpartitionlist(params).then((res) => {
- if (res.data.state == 1) {
- this.fen = res.data.data.list;
- }
- });
- },
- tiaoshi() {
- console.log("this.shift", this.shift);
- console.log("this.partition", this.partition);
- console.log("this.waitmount_data", this.waitmount_data);
- console.log("this.alreadmount_data", this.alreadmount_data);
- console.log("this.waitmount", this.waitmount);
- console.log("this.alreadmount", this.alreadmount);
- },
- async fun3() {
- console.log("fun3");
- this.fun1().then((val) => {
- this.fun2();
- });
- },
- async fun4(tmp) {
- console.log("fun3");
- this.fun1().then((val) => {
- console.log("this.alreadmount_data", this.alreadmount_data);
- for (let i = 0; i < this.alreadmount_data.length; i++) {
- console.log("tmp = ", tmp);
- if (this.alreadmount_data[i].PatientID == tmp) {
- console.log("i = ", i);
- this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
- this.handleCurrentChange(this.alreadmount_data[i]);
- }
- }
- });
- },
- async fun5(tmp) {
- console.log("fun5555");
- this.fun1().then((val) => {
- console.log("this.alreadmount_data", this.waitmount_data);
- for (let i = 0; i < this.waitmount_data.length; i++) {
- console.log("tmp = ", tmp);
- if (this.waitmount_data[i].PatientID == tmp) {
- console.log("i = ", i);
- this.$refs.table01.setCurrentRow(this.waitmount_data[i]);
- this.handleCurrentChange(this.waitmount_data[i]);
- }
- }
- });
- },
-
- lala() {
- console.log("this.state!!!!!!", this.state);
- //初始化状态
- this.tableData = null;
- this.currentRow = null;
- this.selectedbydefault();
- },
- //选中行数
- handleCurrentChange(val) {
- console.log("state--",this.state)
- this.currentRow = val;
- console.log("this.currentRow", this.currentRow);
- if (this.state == 1) {
- this.getpatientdetails(0);
- }
- if (this.state == 2) {
- this.getpatientdetails(1);
- }
- },
- init() {
- // console.log("初始化了")
- this.state = 1;
- this.tableData = null;
- this.currentRow = null;
- this.partition = 0;
- this.shift = 0;
- },
- testsss() {
- this.state = 1;
- },
- //默认选中的
- selectedbydefault() {
- if (this.state == 1 && this.waitmount_data.length > 0) {
- this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
- this.handleCurrentChange(this.waitmount_data[0]);
- }
- if (this.state == 2 && this.alreadmount_data.length > 0) {
- this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
- this.handleCurrentChange(this.alreadmount_data[0]);
- }
- },
- //包装selectedbydefault
- fun2() {
- console.log("3333333this.waitmount_data", this.waitmount_data);
- // return new Promise((resolve, reject) => {
- if (this.state == 1 && this.waitmount_data.length > 0) {
- this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
- this.handleCurrentChange(this.waitmount_data[0]);
- }
- if (this.state == 2 && this.alreadmount_data.length > 0) {
- this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
- this.handleCurrentChange(this.alreadmount_data[0]);
- }
- // });
- },
- changeTimes() {
- this.gettodaynumber();
- this.getwaitmount();
- this.fun3();
- },
- //获取当天发药的人数
- gettodaynumber() {
- var params = {
- time: this.start_time,
- };
- todaynumber(params).then((res) => {
- if (res.data.state == 1) {
- console.log('3333333',res.data.data);
- this.waitmount = res.data.data.itotal;
- this.alreadmount = res.data.data.wtotal;
- this.drugList = res.data.data.drug
- this.drug_code_open = res.data.data.config.is_open
- }
- });
- // console.log("2222222")
- },
- //获取发药人列表
- getwaitmount() {
- var params = {
- keyword: this.keywords,
- time: this.start_time,
- shift: this.shift,
- partition: this.partition,
- };
-
- waitingdrug(params).then((res) => {
- if (res.data.state == 1) {
- this.waitmount_data=[]
- var list = res.data.data.list;
- this.baseList =[]
- this.baseList = res.data.data.baseList
- if (this.shift != 0 || this.partition != 0) {
- if (this.waitmount_data == null) {
- this.waitmount = 0;
- } else {
- this.waitmount = this.waitmount_data.length;
- }
- }
- this.patientList = []
- this.patientList = res.data.data.patientList
- var listTwo = res.data.data.listTwo
-
- var newArr =[]
- if(listTwo!=null && listTwo.length>0){
- for(let i=0;i<listTwo.length;i++){
- listTwo[i].PatientID = 0
- listTwo[i].Name=""
- listTwo[i].DialysisNo=""
- listTwo[i].PatientID = listTwo[i].patient_id
- listTwo[i].Name = listTwo[i].patient.name
- listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
- newArr.push(listTwo[i])
- }
- }
-
- if(list!=null && list.length>0){
- for(let i=0;i<list.length;i++){
- this.waitmount_data.push(list[i])
- }
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.waitmount_data.push(newArr[i])
- }
- }
- }
- if(this.waitmount_data==null){
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.waitmount_data.push(newArr[i])
- }
- }
-
- }
- if(list==null){
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.waitmount_data.push(newArr[i])
- }
- }
-
- }
-
- }
- });
- issueddrugs(params).then((res) => {
- if (res.data.state == 1) {
- this.alreadmount_data =[]
- var list = res.data.data.list;
- var listTwo =res.data.data.listTwo
-
- if (this.shift != 0 || this.partition != 0) {
- if (list == null) {
- this.alreadmount = 0;
- } else {
- this.alreadmount = list.length;
- }
- }
-
- var newArr =[]
- if(listTwo!=null && listTwo.length>0){
- for(let i=0;i<listTwo.length;i++){
- listTwo[i].PatientID = 0
- listTwo[i].Name=""
- listTwo[i].DialysisNo=""
- listTwo[i].PatientID = listTwo[i].patient_id
- listTwo[i].Name = listTwo[i].patient.name
- listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
- newArr.push(listTwo[i])
- }
- }
-
- if(list!=null && list.length>0){
- for(let i=0;i<list.length;i++){
- this.alreadmount_data.push(list[i])
- }
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.alreadmount_data.push(newArr[i])
- }
- }
- }
- if(this.waitmount_data==null){
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.alreadmount_data.push(newArr[i])
- }
- }
-
- }
- if(list==null){
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.alreadmount_data.push(newArr[i])
- }
- }
-
- }
- }
- });
- },
- //包装getwaitmount
- async fun1() {
- // return new Promise((resolve, reject) => {
- var params = {
- keyword: this.keywords,
- time: this.start_time,
- shift: this.shift,
- partition: this.partition,
- };
- await waitingdrug(params).then((res) => {
- if (res.data.state == 1) {
- this.waitmount_data=[]
- var list = res.data.data.list;
- this.patientList = []
- this.patientList = res.data.data.patientList
- var listTwo = res.data.data.listTwo
- var newArr =[]
- if(listTwo!=null && listTwo.length>0){
- for(let i=0;i<listTwo.length;i++){
- listTwo[i].PatientID = 0
- listTwo[i].Name=""
- listTwo[i].DialysisNo=""
- listTwo[i].PatientID = listTwo[i].patient_id
- listTwo[i].Name = listTwo[i].patient.name
- listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
- newArr.push(listTwo[i])
- }
- }
- if(list!=null && list.length>0){
- for(let i=0;i<list.length;i++){
- this.waitmount_data.push(list[i])
- }
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.waitmount_data.push(newArr[i])
- }
- }
- }
- if(list==null){
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.waitmount_data.push(newArr[i])
- }
- }
-
- }
-
- console.log("1111111");
- }
- });
- await issueddrugs(params).then((res) => {
- if (res.data.state == 1) {
- this.alreadmount_data = []
- var list = res.data.data.list;
- var listTwo = res.data.data.listTwo
- var newArr =[]
- if(listTwo!=null && listTwo.length>0){
- for(let i=0;i<listTwo.length;i++){
- listTwo[i].PatientID = 0
- listTwo[i].Name=""
- listTwo[i].DialysisNo=""
- listTwo[i].PatientID = listTwo[i].patient_id
- listTwo[i].Name = listTwo[i].patient.name
- listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
- newArr.push(listTwo[i])
- }
- }
- if(list!=null && list.length>0){
- for(let i=0;i<list.length;i++){
- this.alreadmount_data.push(list[i])
- }
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.alreadmount_data.push(newArr[i])
- }
- }
- }
- if(list==null){
- if(newArr!=null && newArr.length>0){
- for(let i=0;i<newArr.length;i++){
- this.alreadmount_data.push(newArr[i])
- }
- }
-
- }
-
- console.log("1111111s");
- }
- });
- console.log("222222222");
-
- // })
- },
- getPatientName(patient_id){
- var name = ""
- for(let i=0;i<this.patientList.length;i++){
- if(patient_id == this.patientList[i].id){
- name = this.patientList[i].name
- }
- }
- return name
- },
- getPatientDialysisNo(patient_id){
- var dialysis_no = ""
- for(let i=0;i<this.patientList.length;i++){
- if(patient_id == this.patientList[i].id){
- dialysis_no = this.patientList[i].dialysis_no
- }
- }
- return dialysis_no
- },
- //获取患者信息详情
- getpatientdetails(val) {
- console.log("val2332323223",this.currentRow)
- var params = {
- patient_id: this.currentRow.PatientID,
- is_medicine: val,
- time: this.start_time,
- };
- getpharmacycontent(params).then((res) => {
- if (res.data.state == 1) {
- var list = res.data.data.list;
- console.log("hhhhawoowowow",res.data.data)
- this.baseList =[]
- this.baseList = res.data.data.baseList
- this.doctors = res.data.data.doctors
- this.diagnosearr = res.data.data.diagnose
- this.diagnosis = res.data.data.prescription.diagnosis
- const obj={
- age:res.data.data.patients.age,
- gender: res.data.data.patients.gender,
- diagnose:res.data.data.patients.diagnose,
- zhixing:res.data.data.patients.created_time
- }
- this.patients =obj
- 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 ){
- this.tableData = []
- if(list!=null && list.length >0){
- for(let i=0;i<list.length;i++){
- if(list[i].DataSources != "临时医嘱"){
- this.tableData.push(list[i])
- }
- }
- }
-
- }
- 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 ){
- this.tableData = []
- this.tableData = list
- }
- console.log("tableDatawoowow",this.tableData)
- } else {
- this.$message.error(res.data.msg);
- }
- });
- },
- // 跳转打印页面
- toPrint() {
- console.log('10653',this.tableData);
-
- if (this.tableData == null) {
- this.$message.error("未选择任何数据");
- return;
- }else{
- if(this.org_id != 10653 && this.org_id !=0){
- this.$refs.patientprint.show(
- this.tableData,
- this.currentRow,
- this.state,
- this.start_time
- );
- }else{
- this.$refs.patientprintTwo.show(
- this.tableData,
- this.currentRow,
- this.state,
- this.start_time,
- this.baseList,
- this.patients,
- this.doctors,
- this.diagnosearr,
- this.diagnosis,
- )
- }
- }
-
-
-
- },
- toExport() {
- import("@/vendor/Export2Excel").then((excel) => {
- for (let i = 0; i < this.tableData.length; i++) {
- this.tableData[i].index = i + 1;
- this.tableData[i].time = this.start_time;
- this.tableData[i].uname = this.currentRow.Name;
- }
-
- const tHeader = [
- "序号",
- "日期",
- "患者名称",
- "名称",
- "单次用量",
- "用法",
- "频率",
- "天数",
- "总量",
- "开立医生",
- "数据来源",
- "备注",
- ];
- const filterVal = [
- "index",
- "time",
- "uname",
- "Name",
- "SingleDosage",
- "Usage",
- "Frequency",
- "Days",
- "Total",
- "Doctor",
- "DataSources",
- "Remarks",
- ];
-
- const data = this.formatJson(filterVal, this.tableData);
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: "领药单",
- });
- this.downloadLoading = false;
- });
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map((v) => filterVal.map((j) => v[j]));
- },
-
- // 搜索患者
- searchAction() {
- this.tableData = null;
- this.getwaitmount();
- if (this.shift != 0 || this.partition != 0) {
- } else {
- this.gettodaynumber();
- }
- },
-
- // 药品发药
- dispense() {
- if (this.is_drug_open == 1){
- var that= this
- axios.get('http://127.0.0.1:9532/test/net',{}).then(function(response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("数据异常,请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- var tmp = that.currentRow.PatientID;
- var params = {
- patient_id: that.currentRow.PatientID,
- time: that.start_time,
- };
- that.$confirm("确定是否对该患者进行发药?", "患者发药", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- dispensingmedicine(params).then((res) => {
- if (res.data.state == 1) {
- that.$message.success("操作成功");
- that.gettodaynumber();
- that.searchAction();
- that.tableData = null;
- that.fun4(tmp);
- that.state = 2;
-
- //进行追溯码上传
- axios.get('http://127.0.0.1:9532/api/changedrug/four', {
- params:params
- })
- .then(function(response) {
- if (response.data.state == 0) {
- that.$message.error(response.data.msg)
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
-
- } else {
-
- }
- }
- })
- .catch(function(error) {
- })
- } else {
- that.$message.error(res.data.msg);
- }
- });
- })
- .catch(() => {});
- })
- .catch(() => {});
- return false
- } else {
-
- }
- }).catch(function(error) {
- that.$confirm("数据异常,请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {});
- })
-
- }else{
- var tmp = this.currentRow.PatientID;
- var params = {
- patient_id: this.currentRow.PatientID,
- time: this.start_time,
- };
- this.$confirm("确定是否对该患者进行发药?", "患者发药", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- dispensingmedicine(params).then((res) => {
- if (res.data.state == 1) {
- this.$message.success("操作成功");
- this.gettodaynumber();
- this.searchAction();
- this.tableData = null;
- this.fun4(tmp);
- this.state = 2;
-
-
- } else {
- this.$message.error(res.data.msg);
- }
- });
- })
- .catch(() => {});
- }
-
-
-
- },
-
- toSetting() {
- getPharmacyConfig().then((response) => {
- if (response.data.state == 1) {
- this.dialogVisible = true;
- var config = response.data.data.config;
- this.is_open = config.is_open.toString();
- var codeConfig = response.data.data.codeConfig
- this.is_drug_open = codeConfig.is_open.toString()
- }
- });
- },
- SaveSetting() {
- var params = {
- is_open: parseInt(this.is_open),
- is_drug_open:parseInt(this.is_drug_open)
- };
- SaveSetting(params).then((response) => {
- if (response.data.state == 1) {
- var config = response.data.data.config;
- this.$message.success("保存成功!");
-
- this.dialogVisible = false;
- }
- });
- },
- // 药品退药
- endispense() {
- if (this.is_drug_open == 1){
- var that= this
- axios.get('http://127.0.0.1:9532/test/net',{}).then(function(response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("数据异常,请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
-
- })
- .catch(() => {
-
- });
- return false
- } else {
- var tmp = that.currentRow.PatientID;
- var params = {
- patient_id: that.currentRow.PatientID,
- time: that.start_time,
- };
- that.$confirm("确定是否对该患者进行退药?", "患者退药", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- drugwithdrawal(params).then((res) => {
- if (res.data.state == 1) {
- that.$message.success("操作成功");
- that.gettodaynumber();
- that.searchAction();
- that.tableData = null;
- that.fun5(tmp);
- that.state = 1;
-
- //进行追溯码上传
- axios.get('http://127.0.0.1:9532/api/delete_xs_bg_two', {
- params:params
- })
- .then(function(response) {
- if (response.data.state == 0) {
- that.$message.error(response.data.msg)
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
-
- } else {
-
- }
- }
- })
- .catch(function(error) {
- })
-
- } else {
- that.$message.error(res.data.msg);
- }
- });
- })
- .catch(() => {});
-
- }
- }).catch(function(error) {
- that.$confirm("数据异常,请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {});
- })
- }else{
- var tmp = this.currentRow.PatientID;
- var params = {
- patient_id: this.currentRow.PatientID,
- time: this.start_time,
- };
- this.$confirm("确定是否对该患者进行退药?", "患者退药", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- drugwithdrawal(params).then((res) => {
- if (res.data.state == 1) {
- this.$message.success("操作成功");
- this.gettodaynumber();
- this.searchAction();
- this.tableData = null;
- this.fun5(tmp);
- this.state = 1;
-
-
- } else {
- this.$message.error(res.data.msg);
- }
- });
- })
- .catch(() => {});
-
- }
-
- },
- getDrugName(drug_id){
-
- var medical_insurance_number = ""
- for(let i=0;i<this.drugList.length;i++){
- if(drug_id == this.drugList[i].id){
- medical_insurance_number = this.drugList[i].medical_insurance_number
- }
- }
- return medical_insurance_number
- },
- getManutuer(drug_id){
- var manufacturer_name = ""
- for(let i=0;i<this.baseList.length;i++){
- if(drug_id == this.baseList[i].id){
- manufacturer_name = this.baseList[i].manufacturer_name
- }
- }
- return manufacturer_name
- },
- getSpecaiName(drug_id){
- var spc =""
- for(let i=0;i<this.baseList.length;i++){
- if(drug_id == this.baseList[i].id){
- 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
- }
- }
- return spc
- },
- getDrugCode(id,DataSources,DrugCode,index){
- this.id = id
- var is_source =0
- if (DataSources == "his处方"){
- is_source = 1
- }
- if (DataSources == "临时医嘱"){
- is_source = 2
- }
- this.is_source = is_source
- this.textarea = DrugCode
- this.currentIndex = index
- this.dialogVisibleOne = true
-
- },
- saveTextArea(){
- var params = {
- id:this.id,
- data_source:this.is_source,
- drug_code:this.textarea,
- }
- console.log("paramss",params)
- changeDrugCode(params).then(response=>{
- if(response.data.state == 1){
- this.$message.success("保存成功!")
- for(let i=0;i<this.tableData.length;i++){
- if(this.currentIndex == i){
- this.tableData[i].DrugCode = this.textarea
- }
- }
- this.dialogVisibleOne = false
- }
- })
- },
- changeText(event){
- // 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
- if (event.key === 'Enter') {
- var textarea = ""
- textarea += this.textarea + ","
-
- this.textarea = textarea
- }
-
-
- },
-
-
- },
- };
- </script>
-
- <style rel="stylesheet/css" lang="scss" scoped>
- .new-main-contain {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
-
- .app-container {
- height: 100%;
- }
- .mainLeft {
- width: 200px;
- height: 100%;
- display: flex;
- flex-direction: column;
-
- .el-radio {
- margin-right: 5px;
- }
-
- .list {
- margin: 10px 0;
- }
- }
- .mainRight {
- margin-left: 10px;
- flex: 1;
- height: 100%;
- display: flex;
- flex-direction: column;
- overflow-y: auto;
- .titlelist {
- display: flex;
- justify-content: space-between;
- white-space: nowrap;
- color: #909399;
- font-size: 14px;
- /deep/ .el-input__inner {
- font-size: 13px !important;
- }
- }
- .el-table {
- margin-top: -13px;
- }
- .el-button {
- height: 34px;
- width: 65px;
- }
- /deep/ .el-divider {
- height: 2px;
- margin-top: 10px;
- }
-
- /deep/ .el-table__body-wrapper {
- overflow-x: scroll !important;
- }
- }
-
- /deep/ .el-input__inner {
- padding-right: 15px;
- }
-
- /deep/ .el-table--scrollable-x .el-table__body-wrapper {
- overflow: auto;
- overflow-x: hidden;
- }
- /deep/ .gutter {
- width: 15px !important;
- display: inline-block !important;
- }
- /deep/ .el-table__fixed-right-patch {
- width: 15px !important;
- }
-
- /deep/ .el-table__fixed-right {
- bottom: 0 !important;
- left: auto;
- right: 0;
- }
- /deep/ .el-table__body-wrapper::-webkit-scrollbar {
- width: 15px !important;
- height: 15px !important;
- }
- </style>
|