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

doctorDesk.vue 88KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292
  1. <template>
  2. <div class="main-contain new-main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
  7. <div class="mainLeft">
  8. <div class="mainCell" style="justify-content: space-between;">
  9. <p style="font-size:14px;">未就诊:<span>{{cal_one}}</span>人</p>
  10. <p style="font-size:14px;">已就诊:<span>{{cal_two}}</span>人</p>
  11. </div>
  12. <div class="mainCell">
  13. <el-radio-group v-model="radio" @change="change">
  14. <el-radio :label="1">未就诊</el-radio>
  15. <el-radio :label="2">已就诊</el-radio>
  16. <el-radio :label="0">全部</el-radio>
  17. </el-radio-group>
  18. </div>
  19. <div class="mainCell" style="margin-bottom:10px;">
  20. <el-input size="small" placeholder="请输入姓名或就诊号" @input="searchAction" @keyup.enter.native='searchAction'
  21. v-model="search_input" class="filter-item"/>
  22. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary" @click="searchAction">
  23. 搜索
  24. </el-button>
  25. </div>
  26. <div>
  27. <el-table :data="patientTableData" :height="tableHeight" @row-click='choosePatient'
  28. @current-change='currentChange' border style="width: 100%;"
  29. :row-style="{ color: '#303133' }"
  30. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  31. highlight-current-row
  32. ref="tab"
  33. >
  34. <el-table-column prop="name" label="姓名" width='89'>
  35. <template slot-scope="scope">{{scope.row.name}}</template>
  36. </el-table-column>
  37. <el-table-column prop="name" label="就诊号" width="110">
  38. <template slot-scope="scope">{{ scope.row.his_patient ?scope.row.his_patient.number:''}}</template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. </div>
  43. <div class="mainRight">
  44. <div class="mainHeader">
  45. <el-tabs v-model="titleType" @tab-click="handleClick"
  46. style="position: fixed;width: calc(100% - 490px);background:#fff;">
  47. <el-tab-pane label="电子处方" name="电子处方"></el-tab-pane>
  48. <el-tab-pane label="电子病历" name="电子病历"></el-tab-pane>
  49. </el-tabs>
  50. <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子处方'">
  51. <el-button size="small" ref="button_one" @click="open(1)" type="primary" v-loading="saveLoading">保存
  52. </el-button>
  53. <el-button size="small" ref="button_three" @click="open_two()" type="primary">处方调用</el-button>
  54. <el-popover
  55. placement="bottom"
  56. width="200"
  57. trigger="click">
  58. <el-button size="small" ref="button_two" @click="open(2)">处方单</el-button>
  59. <el-button size="small" ref="button_six" @click="open(6)">治疗单</el-button>
  60. <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
  61. </el-popover>
  62. <!--<el-button size="small" ref="button_four" @click="open(5)" type="primary" :disabled='prescriptions && prescriptions[0].advices && prescriptions[0].project ? prescriptions[0].advices.length == 0 && prescriptions[0].project.length == 0 : false'>存模板</el-button> -->
  63. </div>
  64. <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子病历'">
  65. <el-button size="small" @click="opentwo(1)" type="primary">保存</el-button>
  66. <el-button size="small" @click="opentwo(2)" type="primary">打印</el-button>
  67. <el-button size="small" @click="opentwo(3)" type="primary">病历调用</el-button>
  68. <el-button size="small" @click="opentwo(4)" type="primary">存模板</el-button>
  69. </div>
  70. </div>
  71. <!--<desk-prescription ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"-->
  72. <!--v-if="titleType == '处方'" style="flex:1;"></desk-prescription>-->
  73. <desk-prescription v-on:setData="setData" :diagnoses="diagnoses" :loading="isloading"
  74. :other_sick="other_sick" :record_date="record_date"
  75. v-on:change="changeOther"
  76. :month_prescriptions="month_prescriptions"
  77. ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
  78. :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
  79. v-if="titleType == '电子处方'" style="flex:1;" ></desk-prescription>
  80. <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
  81. :hisPatientInfo="hisPatientInfo" v-if="titleType == '电子病历'" :detalid="detalid"
  82. ref="child"></desk-record>
  83. <medicalRecord ref='medicalRecord' @func="getMsgFormSon"></medicalRecord>
  84. <saveRecordTemplate ref='saveRecordTemplate'></saveRecordTemplate>
  85. </div>
  86. </div>
  87. <el-dialog
  88. title="处方打印"
  89. :visible.sync="centerDialogVisible"
  90. width="600px"
  91. center>
  92. <el-table
  93. ref="multipleTable"
  94. :data="tableData"
  95. tooltip-effect="dark"
  96. style="width: 600px"
  97. @selection-change="handleSelectionChange">
  98. <el-table-column
  99. align='center'
  100. type="selection"
  101. width="50">
  102. </el-table-column>
  103. <el-table-column
  104. align='center'
  105. label="处方编号"
  106. width="120">
  107. <template slot-scope="scope">
  108. <span>处方 {{scope.$index + 1}}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="处方号">
  112. <template slot-scope="scope">
  113. <span>
  114. <el-input v-model="scope.row.prescription_number" :disabled="true"></el-input>
  115. </span>
  116. </template>
  117. </el-table-column>
  118. </el-table>
  119. <el-dialog
  120. class="centerDialog"
  121. width="600px"
  122. title="打印"
  123. :visible.sync="innerVisible"
  124. append-to-body>
  125. <print v-if="index == 2" :paramsObj='paramsObj'></print>
  126. <treatPrint v-if="index == 6" :paramsObj='paramsObj'></treatPrint>
  127. </el-dialog>
  128. <span slot="footer" class="dialog-footer">
  129. <el-button @click="centerDialogVisible = false">取 消</el-button>
  130. <el-button type="primary" @click="savePrint">确 定</el-button>
  131. </span>
  132. </el-dialog>
  133. <el-dialog
  134. class="centerDialog"
  135. width="600px"
  136. title="打印"
  137. :visible.sync="recordVisible">
  138. <recordPrint :patientid="patientid" ref="recordPrint"></recordPrint>
  139. </el-dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  144. import deskPrescription from './components/deskPrescription'
  145. import deskRecord from './components/deskRecord'
  146. import {createCaseHistory, getPatientInfo, getSchedulePatientList} from '@/api/his/his'
  147. import {getDictionaryDataConfig} from '@/utils/data'
  148. import medicalRecord from './components/medicalRecord'
  149. import saveRecordTemplate from './components/saveRecordTemplate'
  150. import {uParseTime} from '@/utils/tools'
  151. import {getPrescriptionList} from "@/api/project/project"
  152. import print from './print'
  153. import treatPrint from './treatPrint'
  154. import recordPrint from './recordPrint'
  155. const moment = require('moment');
  156. export default {
  157. components: {
  158. BreadCrumb,
  159. deskPrescription,
  160. deskRecord,
  161. medicalRecord,
  162. saveRecordTemplate,
  163. print,
  164. treatPrint,
  165. recordPrint
  166. },
  167. data() {
  168. return {
  169. tableHeight: '',
  170. saveloading: false,
  171. fullHeight: document.documentElement.clientHeight,
  172. month_prescriptions: [],
  173. isloading:false,
  174. prescriptions: [
  175. {
  176. name: '处方1',
  177. advices: [],
  178. project: [],
  179. addition: [],
  180. }
  181. ],
  182. search_input: '',
  183. cal_one: 0,
  184. cal_two: 0,
  185. radio: 1,
  186. record_date: '',
  187. crumbs: [
  188. {path: false, name: '门诊医生站'},
  189. {path: false, name: '医生工作台'}
  190. ],
  191. titleType: '电子处方',
  192. patientTableData: [{}],
  193. patientTableDataTwo: [{}],
  194. patientInfo: {},
  195. hisPatientInfo: {},
  196. case_history: {},
  197. patient_id: 0,
  198. diagnoses: [],
  199. other_sick: [],
  200. info: {},
  201. templatedetail: {},
  202. detalid: 0,
  203. prescription_id: 0,
  204. doctors: [],
  205. department: [],
  206. patientid: 0,
  207. prescriptionList: [],
  208. centerDialogVisible: false,
  209. tableData: [],
  210. selecting_schs: [],
  211. index: 0,
  212. admin_info: {},
  213. saveLoading: false,
  214. innerVisible: false,
  215. paramsObj: {},
  216. recordVisible: false,
  217. recordObj: {},
  218. additions: [],
  219. }
  220. },
  221. methods: {
  222. changeOther(patient_id){
  223. this.radio = 2;
  224. let params = {
  225. 'record_date': this.record_date,
  226. 'type': this.radio
  227. };
  228. this.patientTableData = [];
  229. getSchedulePatientList(params).then(response => {
  230. if (response.data.state == 0) {
  231. this.$message.error(response.data.msg);
  232. return false
  233. } else {
  234. this.patientTableData = response.data.data.list;
  235. this.patientTableDataTwo = response.data.data.list;
  236. this.cal_one = response.data.data.total_one;
  237. this.cal_two = response.data.data.total_two;
  238. this.admin_info = response.data.data.info;
  239. if (this.patientTableData.length > 0) {
  240. for(let i = 0; i < this.patientTableData.length; i++){
  241. if (this.patientTableData[i].id == patient_id){
  242. this.$refs.tab.setCurrentRow(this.patientTableData[i]);
  243. this.oldCurrentRow = this.patientTableData[i];
  244. this.getPatientInfo(this.patientTableData[i])
  245. }
  246. }
  247. }
  248. this.prescriptionList = response.data.data.list.prescription
  249. }
  250. })
  251. },
  252. setData(val) {
  253. this.prescriptions = val
  254. },
  255. getDictionaryDataConfig(module, filed_name) {
  256. return getDictionaryDataConfig(module, filed_name)
  257. },
  258. searchAction() {
  259. if (this.search_input.length == 0) {
  260. this.patientTableData = this.patientTableDataTwo
  261. } else {
  262. let arr = [];
  263. for (let i = 0; i < this.patientTableData.length; i++) {
  264. if (this.patientTableData[i].name.indexOf(this.search_input) != -1 || this.patientTableData[i].his_patient.number.indexOf(this.search_input) != -1) {
  265. arr = arr.concat(this.patientTableData[i])
  266. }
  267. }
  268. this.patientTableData = arr
  269. }
  270. },
  271. // changeTab() {
  272. // this.saveLoading = false
  273. //
  274. // this.radio = 2
  275. // let params = {
  276. // 'record_date': this.record_date,
  277. // 'type': this.radio
  278. // }
  279. // this.patientTableData = []
  280. // getSchedulePatientList(params).then(response => {
  281. // if (response.data.state == 0) {
  282. // this.$message.error(response.data.msg)
  283. // return false
  284. // } else {
  285. // this.patientTableData = response.data.data.list
  286. // this.patientTableDataTwo = response.data.data.list
  287. // this.cal_one = response.data.data.total_one
  288. // this.cal_two = response.data.data.total_two
  289. // this.admin_info = response.data.data.info
  290. // for (let i = 0; i < this.patientTableData.length; i++) {
  291. // if (this.patientTableData[i].id == this.patientid) {
  292. // this.$refs.tab.setCurrentRow(this.patientTableData[i])
  293. // this.getPatientInfo(this.patientTableData[i])
  294. //
  295. // }
  296. // }
  297. //
  298. //
  299. // }
  300. // })
  301. //
  302. // },
  303. change() {
  304. let params = {
  305. 'record_date': this.record_date,
  306. 'type': this.radio
  307. };
  308. this.patientTableData = [];
  309. getSchedulePatientList(params).then(response => {
  310. if (response.data.state == 0) {
  311. this.$message.error(response.data.msg);
  312. return false
  313. } else {
  314. this.patientTableData = response.data.data.list;
  315. this.patientTableDataTwo = response.data.data.list;
  316. this.cal_one = response.data.data.total_one;
  317. this.cal_two = response.data.data.total_two;
  318. this.admin_info = response.data.data.info;
  319. if (this.patientTableData.length > 0) {
  320. this.$refs.tab.setCurrentRow(this.patientTableData[0]);
  321. this.oldCurrentRow = this.patientTableData[0];
  322. this.getPatientInfo(this.patientTableData[0])
  323. }
  324. this.prescriptionList = response.data.data.list.prescription
  325. // this.patientid = this.patientTableData[0].patient_id
  326. }
  327. })
  328. },
  329. setMonthPrescription(month_prescriptions) {
  330. console.log("11111111");
  331. console.log(month_prescriptions);
  332. this.month_prescriptions = [];
  333. let drug_month_prescriptions = {
  334. advices: []
  335. };
  336. let drug_ids = [];
  337. let project_month_prescriptions = {
  338. project: []
  339. };
  340. let project_ids = [];
  341. let addition_month_prescriptions = {
  342. addition: []
  343. };
  344. let additions_ids = [];
  345. for (let i = 0; i < month_prescriptions.length; i++) {
  346. if (month_prescriptions[i].type == 1) { //药品
  347. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  348. let obj = {
  349. id: month_prescriptions[i].advices[a].drug_id,
  350. price:month_prescriptions[i].advices[a].price,
  351. };
  352. drug_ids.push(obj);
  353. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  354. }
  355. } else if (month_prescriptions[i].type == 2) { //项目
  356. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  357. let obj = {
  358. id: month_prescriptions[i].project[a].project_id,
  359. price:month_prescriptions[i].project[a].price,
  360. };
  361. project_ids.push(obj);
  362. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  363. }
  364. }
  365. //附加收费
  366. for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  367. let obj = {
  368. id: month_prescriptions[i].addition[a].item_id,
  369. price:month_prescriptions[i].addition[a].price,
  370. };
  371. additions_ids.push(obj);
  372. addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  373. }
  374. }
  375. console.log("00000000000000");
  376. console.log(drug_ids);
  377. console.log(project_ids);
  378. console.log(additions_ids);
  379. console.log("00000000000000");
  380. const obj = {};
  381. const obj1 = {};
  382. const obj2 = {};
  383. drug_ids = drug_ids.reduce((cur, next) => {
  384. obj[next.price] ? '' : obj[next.price] = true && cur.push(next);
  385. return cur
  386. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  387. project_ids = project_ids.reduce((cur, next) => {
  388. obj[next.price] ? '' : obj[next.price] = true && cur.push(next);
  389. return cur
  390. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  391. additions_ids = additions_ids.reduce((cur, next) => {
  392. obj[next.price] ? '' : obj[next.price] = true && cur.push(next);
  393. return cur
  394. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  395. let drugs = [];
  396. let projects = [];
  397. let additions = [];
  398. for (let i = 0; i < drug_ids.length; i++) {
  399. let obj = {};
  400. let count = 0;
  401. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  402. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
  403. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name;
  404. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose;
  405. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way;
  406. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency;
  407. obj['day'] = drug_month_prescriptions.advices[a].day;
  408. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  409. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit;
  410. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number;
  411. obj['id'] = drug_month_prescriptions.advices[a].drug_id;
  412. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  413. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price);
  414. count = count + drug_month_prescriptions.advices[a].prescribing_number
  415. }
  416. }
  417. obj['prescribing_number'] = count;
  418. drugs.push(obj)
  419. }
  420. for (let i = 0; i < project_ids.length; i++) {
  421. let obj = {};
  422. let count = 0;
  423. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  424. if (project_ids[i].price == project_month_prescriptions.project[a].price) {
  425. obj['project_name'] = project_month_prescriptions.project[a].project.project_name;
  426. obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification;
  427. obj['single_dose'] = project_month_prescriptions.project[a].single_dose;
  428. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way;
  429. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency;
  430. obj['number_days'] = project_month_prescriptions.project[a].day;
  431. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code;
  432. obj['unit'] = project_month_prescriptions.project[a].unit;
  433. obj['project_id'] = project_month_prescriptions.project[a].project_id;
  434. count = count + project_month_prescriptions.project[a].count;
  435. // price = price + project_month_prescriptions.project[a].price
  436. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  437. }
  438. }
  439. obj['total'] = count;
  440. projects.push(obj)
  441. }
  442. for (let i = 0; i < additions_ids.length; i++) {
  443. let obj = {};
  444. let count = 0;
  445. console.log(addition_month_prescriptions.addition);
  446. if (addition_month_prescriptions.addition) {
  447. for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  448. if (project_ids[i].price == addition_month_prescriptions.addition[a].price) {
  449. obj['item_name'] = addition_month_prescriptions.addition[a].item_name;
  450. obj['id'] = addition_month_prescriptions.addition[a].id;
  451. obj['item_id'] = addition_month_prescriptions.addition[a].item_id;
  452. count = count + addition_month_prescriptions.addition[a].count;
  453. obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
  454. }
  455. }
  456. obj['count'] = count;
  457. additions.push(obj)
  458. }
  459. }
  460. console.log(drugs);
  461. console.log(projects);
  462. console.log(additions);
  463. let p1 = {
  464. name: '处方' + 1,
  465. advices: drugs,
  466. project: [],
  467. type: 1,
  468. addition: additions
  469. };
  470. let p2 = {
  471. name: '处方' + 2,
  472. type: 2,
  473. project: projects,
  474. advices: [],
  475. addition: []
  476. };
  477. this.month_prescriptions.push(p1);
  478. this.month_prescriptions.push(p2);
  479. this.curMonthPrescriptions = this.month_prescriptions[0]
  480. },
  481. // setMonthPrescription(month_prescriptions){
  482. // let drug_month_prescriptions = {
  483. // advices:[],
  484. // }
  485. // let drug_ids=[]
  486. // let project_month_prescriptions ={
  487. // project:[],
  488. //
  489. // }
  490. // let project_ids=[]
  491. //
  492. // let addition_month_prescriptions ={
  493. // addtions:[],
  494. //
  495. // }
  496. // let additions_ids=[]
  497. //
  498. //
  499. // for (let i = 0; i < month_prescriptions.length; i++){
  500. // if(month_prescriptions[i].type == 1){ //药品
  501. // for (let a = 0; a < month_prescriptions[i].advices.length; a++){
  502. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  503. // drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  504. // }
  505. //
  506. // }else if(month_prescriptions[i].type == 2){ //项目
  507. // for (let a = 0; a < month_prescriptions[i].project.length; a++){
  508. // project_ids.push(month_prescriptions[i].project[a].project_id)
  509. // project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  510. // }
  511. // }
  512. // //附加收费
  513. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  514. // additions_ids.push(month_prescriptions[i].addition[a].item_id)
  515. // addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
  516. // }
  517. //
  518. // }
  519. //
  520. //
  521. //
  522. //
  523. // const obj = {}
  524. // const obj1 = {}
  525. // const obj2 = {}
  526. //
  527. // drug_ids = drug_ids.reduce((cur, next) => {
  528. // obj[next] ? '' : obj[next] = true && cur.push(next)
  529. // return cur
  530. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  531. // project_ids = project_ids.reduce((cur, next) => {
  532. // obj1[next] ? '' : obj1[next] = true && cur.push(next)
  533. // return cur
  534. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  535. // additions_ids = additions_ids.reduce((cur, next) => {
  536. // obj2[next] ? '' : obj2[next] = true && cur.push(next)
  537. // return cur
  538. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  539. //
  540. //
  541. //
  542. //
  543. //
  544. // let drugs =[]
  545. // let projects =[]
  546. // let additions =[]
  547. //
  548. //
  549. // for (let i = 0; i < drug_ids.length; i++){
  550. // let obj = {}
  551. // let price = 0
  552. // let count = 0
  553. // for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
  554. // if(drug_ids[i] == drug_month_prescriptions.advices[a].drug_id){
  555. // obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  556. // obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  557. // obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  558. // obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  559. // obj['day'] = drug_month_prescriptions.advices[a].day
  560. // // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  561. // obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  562. // obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  563. // obj['id'] = drug_month_prescriptions.advices[a].drug_id
  564. // // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  565. //
  566. //
  567. // count = count + drug_month_prescriptions.advices[a].prescribing_number
  568. // price = price + drug_month_prescriptions.advices[a].price
  569. //
  570. // }
  571. // }
  572. // obj['retail_price'] = price
  573. // obj['prescribing_number'] = count
  574. // drugs.push(obj)
  575. // }
  576. //
  577. //
  578. //
  579. //
  580. // for (let i = 0; i < project_ids.length; i++){
  581. // let obj = {}
  582. // let price = 0
  583. // let count = 0
  584. // for (let a = 0; a < project_month_prescriptions.project.length; a++){
  585. // if(project_ids[i] == project_month_prescriptions.project[a].project_id){
  586. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  587. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  588. // obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  589. // obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  590. // obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  591. // obj['number_days'] = project_month_prescriptions.project[a].day
  592. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  593. // obj['unit'] = project_month_prescriptions.project[a].unit
  594. // obj['project_id'] = project_month_prescriptions.project[a].project_id
  595. // count = count + project_month_prescriptions.project[a].count
  596. // price = price + project_month_prescriptions.project[a].price
  597. // }
  598. // }
  599. // obj['price'] = price
  600. // obj['total'] = count
  601. // projects.push(obj)
  602. // }
  603. //
  604. //
  605. // for (let i = 0; i < additions_ids.length; i++){
  606. // let obj = {}
  607. // let price = 0
  608. // let count = 0
  609. // for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
  610. // if(project_ids[i] == addition_month_prescriptions.addition[a].item_id){
  611. // obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  612. // obj['id'] = addition_month_prescriptions.addition[a].id
  613. // obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  614. // count = count + addition_month_prescriptions.addition[a].count
  615. // price = price + addition_month_prescriptions.addition[a].price
  616. // }
  617. // }
  618. // obj['price'] = price
  619. // obj['count'] = count
  620. // additions.push(obj)
  621. // }
  622. //
  623. //
  624. // let p1 = {
  625. // name: '处方' + 1,
  626. // advices: drugs,
  627. // project: [],
  628. // type:1,
  629. // addition: additions,
  630. // }
  631. // let p2 = {
  632. // name: '处方' + 2,
  633. // type:2,
  634. // project: projects,
  635. // advices: [],
  636. // }
  637. // this.month_prescriptions.push(p1)
  638. // this.month_prescriptions.push(p2)
  639. //
  640. // },
  641. getList() {
  642. let params = {
  643. 'record_date': this.record_date,
  644. 'type': this.radio
  645. };
  646. this.patientTableData = [];
  647. getSchedulePatientList(params).then(response => {
  648. if (response.data.state == 0) {
  649. this.$message.error(response.data.msg);
  650. return false
  651. } else {
  652. this.patientTableData = response.data.data.list;
  653. this.patientTableDataTwo = response.data.data.list;
  654. this.cal_one = response.data.data.total_one;
  655. this.cal_two = response.data.data.total_two;
  656. this.admin_info = response.data.data.info;
  657. if (this.patientTableData.length > 0) {
  658. this.$refs.tab.setCurrentRow(this.patientTableData[0]);
  659. this.oldCurrentRow = this.patientTableData[0];
  660. this.getPatientInfo(this.patientTableData[0])
  661. }
  662. this.prescriptionList = response.data.data.list.prescription
  663. // this.patientid = this.patientTableData[0].patient_id
  664. }
  665. })
  666. },
  667. getPatientInfo(val) {
  668. var nowDate = new Date();
  669. var nowYear = nowDate.getFullYear();
  670. var nowMonth = nowDate.getMonth() + 1;
  671. var nowDay = nowDate.getDate();
  672. var hours = nowDate.getHours();
  673. var min = nowDate.getMinutes();
  674. var nowTime =
  675. nowYear +
  676. '-' +
  677. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  678. '-' +
  679. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (hours < 10 ? '0' + hours : hours) +
  680. ':' + (min < 10 ? '0' + min : min);
  681. this.patientid = val.id;
  682. let params = {
  683. 'record_date': this.record_date,
  684. 'patient_id': val.id,
  685. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  686. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD"),
  687. 'p_type':2,
  688. };
  689. this.isloading = true;
  690. getPatientInfo(params).then(response => {
  691. if (response.data.state == 0) {
  692. this.$message.error(response.data.msg);
  693. this.isloading = false;
  694. return false
  695. } else {
  696. this.isloading = false;
  697. this.prescriptions = [];
  698. this.month_prescriptions = [];
  699. this.patientInfo = response.data.data.xt_info;
  700. this.hisPatientInfo = response.data.data.his_info;
  701. this.case_history = response.data.data.case_history;
  702. console.log("病历222222",this.case_history);
  703. this.info = response.data.data.info;
  704. this.doctors = response.data.data.doctors;
  705. this.department = response.data.data.department;
  706. for (let i = 0; i < this.doctors.length; i++){
  707. if(this.doctors[i].user_type == 1){
  708. this.doctors.splice(i,1)
  709. }
  710. }
  711. var month_prescriptions = response.data.data.month_prescriptions;
  712. this.setMonthPrescription(month_prescriptions);
  713. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
  714. if (this.case_history.temperature <= 0) {
  715. this.case_history.temperature = ''
  716. }
  717. if (this.case_history.blood_sugar <= 0) {
  718. this.case_history.blood_sugar = ''
  719. }
  720. if (this.case_history.pulse <= 0) {
  721. this.case_history.pulse = ''
  722. }
  723. if (this.case_history.sbp <= 0) {
  724. this.case_history.sbp = ''
  725. }
  726. if (this.case_history.dbp <= 0) {
  727. this.case_history.dbp = ''
  728. }
  729. if (this.case_history.height <= 0) {
  730. this.case_history.height = ''
  731. }
  732. if (this.case_history.blood_fat <= 0) {
  733. this.case_history.blood_fat = ''
  734. }
  735. if (this.case_history.sick_type <= 0) {
  736. this.case_history.sick_type = ''
  737. }
  738. if (this.case_history.sick <= 0) {
  739. this.case_history.sick = ''
  740. }
  741. if (this.case_history.diagnose <= 0) {
  742. this.case_history.diagnose = ''
  743. }
  744. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}');
  745. if (this.case_history.is_infect == 1) {
  746. this.case_history.is_infect = true
  747. } else {
  748. this.case_history.is_infect = false
  749. }
  750. //处方相关
  751. this.prescriptionList = response.data.data.prescription;
  752. if (response.data.data.prescription.length > 0) {
  753. for (let i = 0; i < response.data.data.prescription.length; i++) {
  754. var prescription = response.data.data.prescription[i];
  755. let tempAdvice = [];
  756. let tempProject = [];
  757. let tempAddition = [];
  758. //药品
  759. for (let b = 0; b < prescription.advices.length; b++) {
  760. let obj = {
  761. advice_id: prescription.advices[b].id,
  762. drug_name: prescription.advices[b].advice_name,
  763. single_dose: prescription.advices[b].single_dose,
  764. delivery_way: prescription.advices[b].delivery_way,
  765. execution_frequency: prescription.advices[b].execution_frequency,
  766. retail_price: prescription.advices[b].price.toString(),
  767. remark: prescription.advices[b].remark,
  768. day: prescription.advices[b].day,
  769. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  770. single_dose_unit: prescription.advices[b].single_dose_unit,
  771. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  772. medical_insurance_number: prescription.advices[b].med_list_codg,
  773. id: prescription.advices[b].drug_id
  774. };
  775. tempAdvice.push(obj)
  776. }
  777. //项目
  778. for (let b = 0; b < prescription.project.length; b++) {
  779. let obj = {
  780. id: prescription.project[b].id,
  781. project_id: prescription.project[b].project_id,
  782. project_name: prescription.project[b].project.project_name,
  783. statistical_classification: prescription.project[b].project.statistical_classification,
  784. single_dose: prescription.project[b].single_dose,
  785. delivery_way: prescription.project[b].delivery_way,
  786. execution_frequency: prescription.project[b].execution_frequency,
  787. number_days: prescription.project[b].day,
  788. total: prescription.project[b].count.toString(),
  789. price: prescription.project[b].price,
  790. remark: prescription.project[b].remark,
  791. medical_code: prescription.project[b].project.medical_code,
  792. unit: prescription.project[b].project.unit,
  793. };
  794. tempProject.push(obj)
  795. }
  796. //附加收费
  797. for (let b = 0; b < prescription.addition.length; b++) {
  798. let obj = {
  799. id: prescription.addition[b].id,
  800. item_name: prescription.addition[b].item_name,
  801. price: prescription.addition[b].price,
  802. count: prescription.addition[b].count,
  803. item_id: prescription.addition[b].item_id,
  804. };
  805. tempAddition.push(obj)
  806. }
  807. var preTime = "";
  808. if (prescription.pre_time == 0) {
  809. preTime = nowTime
  810. } else {
  811. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  812. }
  813. let index = i + 1;
  814. let obj = {
  815. id: prescription.id,
  816. name: '处方' + index,
  817. advices: tempAdvice,
  818. project: tempProject,
  819. addition: tempAddition,
  820. order_status: prescription.order_status,
  821. pre_time: preTime
  822. };
  823. this.prescriptions.push(obj)
  824. }
  825. } else {
  826. let obj = {
  827. id: 0,
  828. name: '处方' + 1,
  829. advices: [],
  830. project: [],
  831. addition: [],
  832. orderStatus: 0,
  833. pre_time: nowTime,
  834. };
  835. this.prescriptions.push(obj)
  836. }
  837. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions)
  838. }
  839. })
  840. },
  841. choosePatient(val) {
  842. console.log(val);
  843. if(this.titleType == '电子病历'){
  844. console.log('this.$refs.child.watchSign',this.$refs.child.watchSign);
  845. if(this.$refs.child.watchSign > 2){
  846. this.$confirm('是否保存当前病例', '保存', {
  847. confirmButtonText: '确 定',
  848. cancelButtonText: '取 消',
  849. type: 'warning'
  850. }).then(() => {
  851. this.$refs.child.createCaseHistory(this.newPatientId);
  852. this.patientid = val.id;
  853. let params = {
  854. 'record_date': this.record_date,
  855. 'patient_id': val.id,
  856. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  857. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD"),
  858. 'p_type':2,
  859. };
  860. getPatientInfo(params).then(response => {
  861. if (response.data.state == 0) {
  862. this.$message.error(response.data.msg);
  863. return false
  864. } else {
  865. this.prescriptions = [];
  866. this.month_prescriptions = [];
  867. var month_prescriptions = response.data.data.month_prescriptions;
  868. this.setMonthPrescription(month_prescriptions);
  869. this.patientInfo = response.data.data.xt_info;
  870. this.hisPatientInfo = response.data.data.his_info;
  871. this.case_history = response.data.data.case_history;
  872. console.log("数据是22222多少",this.case_history);
  873. this.info = response.data.data.info;
  874. this.doctors = response.data.data.doctors;
  875. this.department = response.data.data.department;
  876. for (let i = 0; i < this.doctors.length; i++){
  877. if(this.doctors[i].user_type == 1){
  878. this.doctors.splice(i,1)
  879. }
  880. }
  881. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
  882. if (this.case_history.breathing <= 0) {
  883. this.case_history.breathing = ""
  884. }
  885. if (this.case_history.sick <= 0) {
  886. this.case_history.sick = ""
  887. }
  888. if (this.case_history.diagnose <= 0) {
  889. this.case_history.diagnose = ""
  890. }
  891. if (this.case_history.temperature <= 0) {
  892. this.case_history.temperature = ''
  893. }
  894. if (this.case_history.blood_sugar <= 0) {
  895. this.case_history.blood_sugar = ''
  896. }
  897. if (this.case_history.pulse <= 0) {
  898. this.case_history.pulse = ''
  899. }
  900. if (this.case_history.sbp <= 0) {
  901. this.case_history.sbp = ''
  902. }
  903. if (this.case_history.dbp <= 0) {
  904. this.case_history.dbp = ''
  905. }
  906. if (this.case_history.height <= 0) {
  907. this.case_history.height = ''
  908. }
  909. if (this.case_history.blood_fat <= 0) {
  910. this.case_history.blood_fat = ''
  911. }
  912. if (this.case_history.sick_type <= 0) {
  913. this.case_history.sick_type = ''
  914. }
  915. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}');
  916. if (this.case_history.is_infect == 1) {
  917. this.case_history.is_infect = true
  918. } else {
  919. this.case_history.is_infect = false
  920. }
  921. this.prescriptionList = response.data.data.prescription;
  922. if (response.data.data.prescription.length > 0) {
  923. for (let i = 0; i < response.data.data.prescription.length; i++) {
  924. var prescription = response.data.data.prescription[i];
  925. let tempAdvice = [];
  926. let tempProject = [];
  927. let tempAddition = [];
  928. for (let b = 0; b < prescription.advices.length; b++) {
  929. let obj = {
  930. advice_id: prescription.advices[b].id,
  931. drug_name: prescription.advices[b].advice_name,
  932. single_dose: prescription.advices[b].single_dose,
  933. delivery_way: prescription.advices[b].delivery_way,
  934. execution_frequency: prescription.advices[b].execution_frequency,
  935. retail_price: prescription.advices[b].price.toString(),
  936. remark: prescription.advices[b].remark,
  937. day: prescription.advices[b].day,
  938. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  939. single_dose_unit: prescription.advices[b].single_dose_unit,
  940. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  941. medical_insurance_number: prescription.advices[b].med_list_codg,
  942. id: prescription.advices[b].drug_id
  943. };
  944. tempAdvice.push(obj)
  945. }
  946. for (let b = 0; b < prescription.project.length; b++) {
  947. let obj = {
  948. id: prescription.project[b].id,
  949. project_id: prescription.project[b].project_id,
  950. project_name: prescription.project[b].project.project_name,
  951. statistical_classification: prescription.project[b].project.statistical_classification,
  952. single_dose: prescription.project[b].single_dose,
  953. delivery_way: prescription.project[b].delivery_way,
  954. execution_frequency: prescription.project[b].execution_frequency,
  955. number_days: prescription.project[b].day,
  956. total: prescription.project[b].count.toString(),
  957. price: prescription.project[b].price,
  958. remark: prescription.project[b].remark,
  959. medical_code: prescription.project[b].project.medical_code,
  960. unit: prescription.project[b].unit
  961. };
  962. tempProject.push(obj)
  963. }
  964. for (let b = 0; b < prescription.addition.length; b++) {
  965. let obj = {
  966. id: prescription.addition[b].id,
  967. item_name: prescription.addition[b].item_name,
  968. price: prescription.addition[b].price,
  969. count: prescription.addition[b].count,
  970. item_id: prescription.addition[b].item_id,
  971. };
  972. tempAddition.push(obj)
  973. }
  974. var preTime = "";
  975. if (prescription.pre_time == 0) {
  976. preTime = nowTime
  977. } else {
  978. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  979. }
  980. let index = i + 1;
  981. let obj = {
  982. id: prescription.id,
  983. name: '处方' + index,
  984. advices: tempAdvice,
  985. project: tempProject,
  986. addition: tempAddition,
  987. order_status: prescription.order_status,
  988. pre_time: preTime
  989. };
  990. this.prescriptions.push(obj)
  991. }
  992. } else {
  993. let obj = {
  994. id: 0,
  995. name: '处方' + 1,
  996. advices: [],
  997. project: [],
  998. addition: [],
  999. orderStatus: 0,
  1000. pre_time: nowTime,
  1001. };
  1002. this.prescriptions.push(obj)
  1003. }
  1004. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions);
  1005. this.$refs.child.watchSign = 0
  1006. }
  1007. });
  1008. this.$refs.child.watchSign = 0
  1009. }).catch(() => {
  1010. this.patientid = val.id;
  1011. let params = {
  1012. 'record_date': this.record_date,
  1013. 'patient_id': val.id,
  1014. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1015. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD"),
  1016. 'p_type':2,
  1017. };
  1018. getPatientInfo(params).then(response => {
  1019. if (response.data.state == 0) {
  1020. this.$message.error(response.data.msg);
  1021. return false
  1022. } else {
  1023. this.prescriptions = [];
  1024. this.month_prescriptions = [];
  1025. var month_prescriptions = response.data.data.month_prescriptions;
  1026. this.setMonthPrescription(month_prescriptions);
  1027. this.patientInfo = response.data.data.xt_info;
  1028. this.hisPatientInfo = response.data.data.his_info;
  1029. this.case_history = response.data.data.case_history;
  1030. console.log("数据是22222多少",this.case_history);
  1031. this.info = response.data.data.info;
  1032. this.doctors = response.data.data.doctors;
  1033. this.department = response.data.data.department;
  1034. for (let i = 0; i < this.doctors.length; i++){
  1035. if(this.doctors[i].user_type == 1){
  1036. this.doctors.splice(i,1)
  1037. }
  1038. }
  1039. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
  1040. if (this.case_history.breathing <= 0) {
  1041. this.case_history.breathing = ""
  1042. }
  1043. if (this.case_history.sick <= 0) {
  1044. this.case_history.sick = ""
  1045. }
  1046. if (this.case_history.diagnose <= 0) {
  1047. this.case_history.diagnose = ""
  1048. }
  1049. if (this.case_history.temperature <= 0) {
  1050. this.case_history.temperature = ''
  1051. }
  1052. if (this.case_history.blood_sugar <= 0) {
  1053. this.case_history.blood_sugar = ''
  1054. }
  1055. if (this.case_history.pulse <= 0) {
  1056. this.case_history.pulse = ''
  1057. }
  1058. if (this.case_history.sbp <= 0) {
  1059. this.case_history.sbp = ''
  1060. }
  1061. if (this.case_history.dbp <= 0) {
  1062. this.case_history.dbp = ''
  1063. }
  1064. if (this.case_history.height <= 0) {
  1065. this.case_history.height = ''
  1066. }
  1067. if (this.case_history.blood_fat <= 0) {
  1068. this.case_history.blood_fat = ''
  1069. }
  1070. if (this.case_history.sick_type <= 0) {
  1071. this.case_history.sick_type = ''
  1072. }
  1073. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}');
  1074. if (this.case_history.is_infect == 1) {
  1075. this.case_history.is_infect = true
  1076. } else {
  1077. this.case_history.is_infect = false
  1078. }
  1079. this.prescriptionList = response.data.data.prescription;
  1080. if (response.data.data.prescription.length > 0) {
  1081. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1082. var prescription = response.data.data.prescription[i];
  1083. let tempAdvice = [];
  1084. let tempProject = [];
  1085. let tempAddition = [];
  1086. for (let b = 0; b < prescription.advices.length; b++) {
  1087. let obj = {
  1088. advice_id: prescription.advices[b].id,
  1089. drug_name: prescription.advices[b].advice_name,
  1090. single_dose: prescription.advices[b].single_dose,
  1091. delivery_way: prescription.advices[b].delivery_way,
  1092. execution_frequency: prescription.advices[b].execution_frequency,
  1093. retail_price: prescription.advices[b].price.toString(),
  1094. remark: prescription.advices[b].remark,
  1095. day: prescription.advices[b].day,
  1096. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1097. single_dose_unit: prescription.advices[b].single_dose_unit,
  1098. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1099. medical_insurance_number: prescription.advices[b].med_list_codg,
  1100. id: prescription.advices[b].drug_id
  1101. };
  1102. tempAdvice.push(obj)
  1103. }
  1104. for (let b = 0; b < prescription.project.length; b++) {
  1105. let obj = {
  1106. id: prescription.project[b].id,
  1107. project_id: prescription.project[b].project_id,
  1108. project_name: prescription.project[b].project.project_name,
  1109. statistical_classification: prescription.project[b].project.statistical_classification,
  1110. single_dose: prescription.project[b].single_dose,
  1111. delivery_way: prescription.project[b].delivery_way,
  1112. execution_frequency: prescription.project[b].execution_frequency,
  1113. number_days: prescription.project[b].day,
  1114. total: prescription.project[b].count.toString(),
  1115. price: prescription.project[b].price,
  1116. remark: prescription.project[b].remark,
  1117. medical_code: prescription.project[b].project.medical_code,
  1118. unit: prescription.project[b].unit
  1119. };
  1120. tempProject.push(obj)
  1121. }
  1122. for (let b = 0; b < prescription.addition.length; b++) {
  1123. let obj = {
  1124. id: prescription.addition[b].id,
  1125. item_name: prescription.addition[b].item_name,
  1126. price: prescription.addition[b].price,
  1127. count: prescription.addition[b].count,
  1128. item_id: prescription.addition[b].item_id,
  1129. };
  1130. tempAddition.push(obj)
  1131. }
  1132. var preTime = "";
  1133. if (prescription.pre_time == 0) {
  1134. preTime = nowTime
  1135. } else {
  1136. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  1137. }
  1138. let index = i + 1;
  1139. let obj = {
  1140. id: prescription.id,
  1141. name: '处方' + index,
  1142. advices: tempAdvice,
  1143. project: tempProject,
  1144. addition: tempAddition,
  1145. order_status: prescription.order_status,
  1146. pre_time: preTime
  1147. };
  1148. this.prescriptions.push(obj)
  1149. }
  1150. } else {
  1151. let obj = {
  1152. id: 0,
  1153. name: '处方' + 1,
  1154. advices: [],
  1155. project: [],
  1156. addition: [],
  1157. orderStatus: 0,
  1158. pre_time: nowTime,
  1159. };
  1160. this.prescriptions.push(obj)
  1161. }
  1162. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions);
  1163. this.$refs.child.watchSign = 0
  1164. }
  1165. })
  1166. });
  1167. this.$refs.child.watchSign = 0
  1168. }else{
  1169. this.patientid = val.id;
  1170. let params = {
  1171. 'record_date': this.record_date,
  1172. 'patient_id': val.id,
  1173. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1174. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD"),
  1175. 'p_type':2,
  1176. };
  1177. getPatientInfo(params).then(response => {
  1178. if (response.data.state == 0) {
  1179. this.$message.error(response.data.msg);
  1180. return false
  1181. } else {
  1182. this.prescriptions = [];
  1183. this.month_prescriptions = [];
  1184. var month_prescriptions = response.data.data.month_prescriptions;
  1185. this.setMonthPrescription(month_prescriptions);
  1186. this.patientInfo = response.data.data.xt_info;
  1187. this.hisPatientInfo = response.data.data.his_info;
  1188. this.case_history = response.data.data.case_history;
  1189. console.log("数据是22222多少",this.case_history);
  1190. this.info = response.data.data.info;
  1191. this.doctors = response.data.data.doctors;
  1192. this.department = response.data.data.department;
  1193. for (let i = 0; i < this.doctors.length; i++){
  1194. if(this.doctors[i].user_type == 1){
  1195. this.doctors.splice(i,1)
  1196. }
  1197. }
  1198. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
  1199. if (this.case_history.breathing <= 0) {
  1200. this.case_history.breathing = ""
  1201. }
  1202. if (this.case_history.sick <= 0) {
  1203. this.case_history.sick = ""
  1204. }
  1205. if (this.case_history.diagnose <= 0) {
  1206. this.case_history.diagnose = ""
  1207. }
  1208. if (this.case_history.temperature <= 0) {
  1209. this.case_history.temperature = ''
  1210. }
  1211. if (this.case_history.blood_sugar <= 0) {
  1212. this.case_history.blood_sugar = ''
  1213. }
  1214. if (this.case_history.pulse <= 0) {
  1215. this.case_history.pulse = ''
  1216. }
  1217. if (this.case_history.sbp <= 0) {
  1218. this.case_history.sbp = ''
  1219. }
  1220. if (this.case_history.dbp <= 0) {
  1221. this.case_history.dbp = ''
  1222. }
  1223. if (this.case_history.height <= 0) {
  1224. this.case_history.height = ''
  1225. }
  1226. if (this.case_history.blood_fat <= 0) {
  1227. this.case_history.blood_fat = ''
  1228. }
  1229. if (this.case_history.sick_type <= 0) {
  1230. this.case_history.sick_type = ''
  1231. }
  1232. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}');
  1233. if (this.case_history.is_infect == 1) {
  1234. this.case_history.is_infect = true
  1235. } else {
  1236. this.case_history.is_infect = false
  1237. }
  1238. this.prescriptionList = response.data.data.prescription;
  1239. if (response.data.data.prescription.length > 0) {
  1240. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1241. var prescription = response.data.data.prescription[i];
  1242. let tempAdvice = [];
  1243. let tempProject = [];
  1244. let tempAddition = [];
  1245. for (let b = 0; b < prescription.advices.length; b++) {
  1246. let obj = {
  1247. advice_id: prescription.advices[b].id,
  1248. drug_name: prescription.advices[b].advice_name,
  1249. single_dose: prescription.advices[b].single_dose,
  1250. delivery_way: prescription.advices[b].delivery_way,
  1251. execution_frequency: prescription.advices[b].execution_frequency,
  1252. retail_price: prescription.advices[b].price.toString(),
  1253. remark: prescription.advices[b].remark,
  1254. day: prescription.advices[b].day,
  1255. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1256. single_dose_unit: prescription.advices[b].single_dose_unit,
  1257. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1258. medical_insurance_number: prescription.advices[b].med_list_codg,
  1259. id: prescription.advices[b].drug_id
  1260. };
  1261. tempAdvice.push(obj)
  1262. }
  1263. for (let b = 0; b < prescription.project.length; b++) {
  1264. let obj = {
  1265. id: prescription.project[b].id,
  1266. project_id: prescription.project[b].project_id,
  1267. project_name: prescription.project[b].project.project_name,
  1268. statistical_classification: prescription.project[b].project.statistical_classification,
  1269. single_dose: prescription.project[b].single_dose,
  1270. delivery_way: prescription.project[b].delivery_way,
  1271. execution_frequency: prescription.project[b].execution_frequency,
  1272. number_days: prescription.project[b].day,
  1273. total: prescription.project[b].count.toString(),
  1274. price: prescription.project[b].price,
  1275. remark: prescription.project[b].remark,
  1276. medical_code: prescription.project[b].project.medical_code,
  1277. unit: prescription.project[b].unit
  1278. };
  1279. tempProject.push(obj)
  1280. }
  1281. for (let b = 0; b < prescription.addition.length; b++) {
  1282. let obj = {
  1283. id: prescription.addition[b].id,
  1284. item_name: prescription.addition[b].item_name,
  1285. price: prescription.addition[b].price,
  1286. count: prescription.addition[b].count,
  1287. item_id: prescription.addition[b].item_id,
  1288. };
  1289. tempAddition.push(obj)
  1290. }
  1291. var preTime = "";
  1292. if (prescription.pre_time == 0) {
  1293. preTime = nowTime
  1294. } else {
  1295. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  1296. }
  1297. let index = i + 1;
  1298. let obj = {
  1299. id: prescription.id,
  1300. name: '处方' + index,
  1301. advices: tempAdvice,
  1302. project: tempProject,
  1303. addition: tempAddition,
  1304. order_status: prescription.order_status,
  1305. pre_time: preTime
  1306. };
  1307. this.prescriptions.push(obj)
  1308. }
  1309. } else {
  1310. let obj = {
  1311. id: 0,
  1312. name: '处方' + 1,
  1313. advices: [],
  1314. project: [],
  1315. addition: [],
  1316. orderStatus: 0,
  1317. pre_time: nowTime,
  1318. };
  1319. this.prescriptions.push(obj)
  1320. }
  1321. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions);
  1322. this.$refs.child.watchSign = 0
  1323. }
  1324. });
  1325. this.$refs.child.watchSign = 0
  1326. }
  1327. }else{
  1328. var nowDate = new Date();
  1329. var nowYear = nowDate.getFullYear();
  1330. var nowMonth = nowDate.getMonth() + 1;
  1331. var nowDay = nowDate.getDate();
  1332. var hours = nowDate.getHours();
  1333. var min = nowDate.getMinutes();
  1334. var nowTime =
  1335. nowYear +
  1336. '-' +
  1337. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1338. '-' +
  1339. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (hours < 10 ? '0' + hours : hours) +
  1340. ':' + (min < 10 ? '0' + min : min);
  1341. var last_month = nowDate.getMonth() < 10 ? '0' + nowDate.getMonth().toString() : nowDate.getMonth(); //获取当前月份(0-11,0代表1月)
  1342. var endTime =
  1343. nowYear +
  1344. '-' +
  1345. last_month +
  1346. '-' +
  1347. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (hours < 10 ? '0' + hours : hours) +
  1348. ':' + (min < 10 ? '0' + min : min);
  1349. let isShowDailog = false;
  1350. for (let i = 0; i < this.prescriptions.length; i++) {
  1351. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  1352. isShowDailog = true
  1353. }
  1354. }
  1355. if (isShowDailog) {
  1356. this.patientTableData.map((item, index) => {
  1357. if (item.patient_id == this.oldCurrentRow.patient_id) {
  1358. this.$refs.tab.setCurrentRow(this.patientTableData[index]);
  1359. }
  1360. });
  1361. this.$confirm('是否保存当前处方', '保存', {
  1362. confirmButtonText: '确 定',
  1363. cancelButtonText: '取 消',
  1364. type: 'warning'
  1365. }).then(() => {
  1366. this.open(1)
  1367. }).catch(() => {
  1368. this.patientTableData.map((item, index) => {
  1369. if (item.patient_id == val.patient_id) {
  1370. this.$refs.tab.setCurrentRow(this.patientTableData[index])
  1371. }
  1372. });
  1373. this.patientid = val.id;
  1374. let params = {
  1375. 'record_date': this.record_date,
  1376. 'patient_id': val.id,
  1377. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1378. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD"),
  1379. 'p_type':2,
  1380. };
  1381. getPatientInfo(params).then(response => {
  1382. if (response.data.state == 0) {
  1383. this.$message.error(response.data.msg);
  1384. return false
  1385. } else {
  1386. this.prescriptions = [];
  1387. this.patientInfo = response.data.data.xt_info;
  1388. this.hisPatientInfo = response.data.data.his_info;
  1389. this.case_history = response.data.data.case_history;
  1390. console.log("数据列表是多少",this.case_history);
  1391. var month_prescriptions = response.data.data.month_prescriptions;
  1392. this.setMonthPrescription(month_prescriptions);
  1393. this.doctors = response.data.data.doctors;
  1394. this.department = response.data.data.department;
  1395. for (let i = 0; i < this.doctors.length; i++){
  1396. if(this.doctors[i].user_type == 1){
  1397. this.doctors.splice(i,1)
  1398. }
  1399. }
  1400. this.case_history = case_history;
  1401. this.info = response.data.data.info;
  1402. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
  1403. if (this.case_history.breathing <= 0) {
  1404. this.case_history.breathing = ""
  1405. }
  1406. if (this.case_history.sick <= 0) {
  1407. this.case_history.sick = ""
  1408. }
  1409. if (this.case_history.diagnose <= 0) {
  1410. this.case_history.diagnose = ""
  1411. }
  1412. if (this.case_history.temperature <= 0) {
  1413. this.case_history.temperature = ''
  1414. }
  1415. if (this.case_history.blood_sugar <= 0) {
  1416. this.case_history.blood_sugar = ''
  1417. }
  1418. if (this.case_history.pulse <= 0) {
  1419. this.case_history.pulse = ''
  1420. }
  1421. if (this.case_history.sbp <= 0) {
  1422. this.case_history.sbp = ''
  1423. }
  1424. if (this.case_history.dbp <= 0) {
  1425. this.case_history.dbp = ''
  1426. }
  1427. if (this.case_history.height <= 0) {
  1428. this.case_history.height = ''
  1429. }
  1430. if (this.case_history.blood_fat <= 0) {
  1431. this.case_history.blood_fat = ''
  1432. }
  1433. if (this.case_history.sick_type <= 0) {
  1434. this.case_history.sick_type = ''
  1435. }
  1436. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}');
  1437. if (this.case_history.is_infect == 1) {
  1438. this.case_history.is_infect = true
  1439. } else {
  1440. this.case_history.is_infect = false
  1441. }
  1442. this.prescriptionList = response.data.data.prescription;
  1443. if (response.data.data.prescription.length > 0) {
  1444. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1445. var prescription = response.data.data.prescription[i];
  1446. let tempAdvice = [];
  1447. let tempProject = [];
  1448. let tempAddition = [];
  1449. for (let b = 0; b < prescription.advices.length; b++) {
  1450. let obj = {
  1451. advice_id: prescription.advices[b].id,
  1452. drug_name: prescription.advices[b].advice_name,
  1453. single_dose: prescription.advices[b].single_dose,
  1454. delivery_way: prescription.advices[b].delivery_way,
  1455. execution_frequency: prescription.advices[b].execution_frequency,
  1456. retail_price: prescription.advices[b].price.toString(),
  1457. remark: prescription.advices[b].remark,
  1458. day: prescription.advices[b].day,
  1459. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1460. single_dose_unit: prescription.advices[b].single_dose_unit,
  1461. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1462. medical_insurance_number: prescription.advices[b].med_list_codg,
  1463. id: prescription.advices[b].drug_id
  1464. };
  1465. tempAdvice.push(obj)
  1466. }
  1467. for (let b = 0; b < prescription.project.length; b++) {
  1468. let obj = {
  1469. id: prescription.project[b].id,
  1470. project_id: prescription.project[b].project_id,
  1471. project_name: prescription.project[b].project.project_name,
  1472. statistical_classification: prescription.project[b].project.statistical_classification,
  1473. single_dose: prescription.project[b].single_dose,
  1474. delivery_way: prescription.project[b].delivery_way,
  1475. execution_frequency: prescription.project[b].execution_frequency,
  1476. number_days: prescription.project[b].day,
  1477. total: prescription.project[b].count.toString(),
  1478. price: prescription.project[b].price,
  1479. remark: prescription.project[b].remark,
  1480. medical_code: prescription.project[b].project.medical_code,
  1481. unit: prescription.project[b].unit
  1482. };
  1483. tempProject.push(obj)
  1484. }
  1485. for (let b = 0; b < prescription.addition.length; b++) {
  1486. let obj = {
  1487. id: prescription.addition[b].id,
  1488. item_name: prescription.addition[b].item_name,
  1489. price: prescription.addition[b].price,
  1490. count: prescription.addition[b].count,
  1491. item_id: prescription.addition[b].item_id,
  1492. };
  1493. tempAddition.push(obj)
  1494. }
  1495. var preTime = "";
  1496. if (prescription.pre_time == 0) {
  1497. preTime = nowTime
  1498. } else {
  1499. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  1500. }
  1501. let index = i + 1;
  1502. let obj = {
  1503. id: prescription.id,
  1504. name: '处方' + index,
  1505. advices: tempAdvice,
  1506. project: tempProject,
  1507. addition: tempAddition,
  1508. order_status: prescription.order_status,
  1509. pre_time: preTime
  1510. };
  1511. this.prescriptions.push(obj)
  1512. }
  1513. } else {
  1514. let obj = {
  1515. id: 0,
  1516. name: '处方' + 1,
  1517. advices: [],
  1518. project: [],
  1519. addition: [],
  1520. orderStatus: 0,
  1521. pre_time: nowTime
  1522. };
  1523. this.prescriptions.push(obj)
  1524. }
  1525. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions)
  1526. }
  1527. })
  1528. })
  1529. // this.$message.error('需要保存保存处方才能切换')
  1530. } else {
  1531. this.patientid = val.id;
  1532. let params = {
  1533. 'record_date': this.record_date,
  1534. 'patient_id': val.id,
  1535. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1536. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD"),
  1537. 'p_type':2,
  1538. };
  1539. getPatientInfo(params).then(response => {
  1540. if (response.data.state == 0) {
  1541. this.$message.error(response.data.msg);
  1542. return false
  1543. } else {
  1544. this.prescriptions = [];
  1545. this.month_prescriptions = [];
  1546. var month_prescriptions = response.data.data.month_prescriptions;
  1547. this.setMonthPrescription(month_prescriptions);
  1548. this.patientInfo = response.data.data.xt_info;
  1549. this.hisPatientInfo = response.data.data.his_info;
  1550. this.case_history = response.data.data.case_history;
  1551. console.log("数据是22222多少",this.case_history);
  1552. this.info = response.data.data.info;
  1553. this.doctors = response.data.data.doctors;
  1554. this.department = response.data.data.department;
  1555. for (let i = 0; i < this.doctors.length; i++){
  1556. if(this.doctors[i].user_type == 1){
  1557. this.doctors.splice(i,1)
  1558. }
  1559. }
  1560. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
  1561. if (this.case_history.breathing <= 0) {
  1562. this.case_history.breathing = ""
  1563. }
  1564. if (this.case_history.sick <= 0) {
  1565. this.case_history.sick = ""
  1566. }
  1567. if (this.case_history.diagnose <= 0) {
  1568. this.case_history.diagnose = ""
  1569. }
  1570. if (this.case_history.temperature <= 0) {
  1571. this.case_history.temperature = ''
  1572. }
  1573. if (this.case_history.blood_sugar <= 0) {
  1574. this.case_history.blood_sugar = ''
  1575. }
  1576. if (this.case_history.pulse <= 0) {
  1577. this.case_history.pulse = ''
  1578. }
  1579. if (this.case_history.sbp <= 0) {
  1580. this.case_history.sbp = ''
  1581. }
  1582. if (this.case_history.dbp <= 0) {
  1583. this.case_history.dbp = ''
  1584. }
  1585. if (this.case_history.height <= 0) {
  1586. this.case_history.height = ''
  1587. }
  1588. if (this.case_history.blood_fat <= 0) {
  1589. this.case_history.blood_fat = ''
  1590. }
  1591. if (this.case_history.sick_type <= 0) {
  1592. this.case_history.sick_type = ''
  1593. }
  1594. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}');
  1595. if (this.case_history.is_infect == 1) {
  1596. this.case_history.is_infect = true
  1597. } else {
  1598. this.case_history.is_infect = false
  1599. }
  1600. this.prescriptionList = response.data.data.prescription;
  1601. if (response.data.data.prescription.length > 0) {
  1602. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1603. var prescription = response.data.data.prescription[i];
  1604. let tempAdvice = [];
  1605. let tempProject = [];
  1606. let tempAddition = [];
  1607. for (let b = 0; b < prescription.advices.length; b++) {
  1608. let obj = {
  1609. advice_id: prescription.advices[b].id,
  1610. drug_name: prescription.advices[b].advice_name,
  1611. single_dose: prescription.advices[b].single_dose,
  1612. delivery_way: prescription.advices[b].delivery_way,
  1613. execution_frequency: prescription.advices[b].execution_frequency,
  1614. retail_price: prescription.advices[b].price.toString(),
  1615. remark: prescription.advices[b].remark,
  1616. day: prescription.advices[b].day,
  1617. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1618. single_dose_unit: prescription.advices[b].single_dose_unit,
  1619. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1620. medical_insurance_number: prescription.advices[b].med_list_codg,
  1621. id: prescription.advices[b].drug_id
  1622. };
  1623. tempAdvice.push(obj)
  1624. }
  1625. for (let b = 0; b < prescription.project.length; b++) {
  1626. let obj = {
  1627. id: prescription.project[b].id,
  1628. project_id: prescription.project[b].project_id,
  1629. project_name: prescription.project[b].project.project_name,
  1630. statistical_classification: prescription.project[b].project.statistical_classification,
  1631. single_dose: prescription.project[b].single_dose,
  1632. delivery_way: prescription.project[b].delivery_way,
  1633. execution_frequency: prescription.project[b].execution_frequency,
  1634. number_days: prescription.project[b].day,
  1635. total: prescription.project[b].count.toString(),
  1636. price: prescription.project[b].price,
  1637. remark: prescription.project[b].remark,
  1638. medical_code: prescription.project[b].project.medical_code,
  1639. unit: prescription.project[b].unit
  1640. };
  1641. tempProject.push(obj)
  1642. }
  1643. for (let b = 0; b < prescription.addition.length; b++) {
  1644. let obj = {
  1645. id: prescription.addition[b].id,
  1646. item_name: prescription.addition[b].item_name,
  1647. price: prescription.addition[b].price,
  1648. count: prescription.addition[b].count,
  1649. item_id: prescription.addition[b].item_id,
  1650. };
  1651. tempAddition.push(obj)
  1652. }
  1653. var preTime = "";
  1654. if (prescription.pre_time == 0) {
  1655. preTime = nowTime
  1656. } else {
  1657. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  1658. }
  1659. let index = i + 1;
  1660. let obj = {
  1661. id: prescription.id,
  1662. name: '处方' + index,
  1663. advices: tempAdvice,
  1664. project: tempProject,
  1665. addition: tempAddition,
  1666. order_status: prescription.order_status,
  1667. pre_time: preTime
  1668. };
  1669. this.prescriptions.push(obj)
  1670. }
  1671. } else {
  1672. let obj = {
  1673. id: 0,
  1674. name: '处方' + 1,
  1675. advices: [],
  1676. project: [],
  1677. addition: [],
  1678. orderStatus: 0,
  1679. pre_time: nowTime,
  1680. };
  1681. this.prescriptions.push(obj)
  1682. }
  1683. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions)
  1684. }
  1685. })
  1686. }
  1687. }
  1688. },
  1689. currentChange(currentRow, oldCurrentRow) {
  1690. this.newPatientId = oldCurrentRow.id;
  1691. console.log('老数据',oldCurrentRow.id);
  1692. this.patientid = oldCurrentRow.id;
  1693. let isShowDailog = false;
  1694. for (let i = 0; i < this.prescriptions.length; i++) {
  1695. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  1696. isShowDailog = true
  1697. }
  1698. }
  1699. if (!isShowDailog) {
  1700. this.oldCurrentRow = currentRow;
  1701. }
  1702. }, open_two() {
  1703. this.$refs.prescriptions.open_two()
  1704. },
  1705. open(index) {
  1706. this.index = index;
  1707. if (index == 1) {
  1708. this.$refs.prescriptions.open(1, this.saveLoading)
  1709. } else if (index == 2) {
  1710. this.getPrescriptionList(this.patientInfo.id)
  1711. // this.$router.push("/outpatientDoctorStation/print?record="+this.record_date+"&prescription_id="+this.prescription_id)
  1712. } else if (index == 3) {
  1713. this.$refs.prescriptions.open(3)
  1714. } else if (index == 4) {
  1715. this.$refs.prescriptions.open(4)
  1716. } else if (index == 6) {
  1717. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  1718. this.getPrescriptionList(this.patientInfo.id)
  1719. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  1720. }
  1721. },
  1722. opentwo(index) {
  1723. if (index == 1) {
  1724. if (this.patientInfo.id == undefined) {
  1725. this.$message.error("请先选择病人");
  1726. return
  1727. }
  1728. this.$refs.child.createCaseHistory()
  1729. } else if (index == 2) {
  1730. console.log("患者ID",this.patientid);
  1731. this.recordVisible = true;
  1732. this.$refs.recordPrint.show(this.patientid)
  1733. } else if (index == 3) {
  1734. var mode_status = this.$refs.saveRecordTemplate.mode_status;
  1735. this.$refs.medicalRecord.show(mode_status)
  1736. } else if (index == 4) {
  1737. this.$refs.saveRecordTemplate.show(this.case_history)
  1738. }
  1739. },
  1740. // changePatient(val){
  1741. // console.log("患者val",val)
  1742. // this.hisPatientInfo = val.hisPatientInfo
  1743. // console.log("333333",this.hisPatientInfo)
  1744. // }
  1745. getMsgFormSon(id) {
  1746. this.detalid = id
  1747. },
  1748. changetwo(data) {
  1749. this.prescription_id = data
  1750. },
  1751. getPrescriptionList(id) {
  1752. getPrescriptionList(id).then(response => {
  1753. if (response.data.state == 1) {
  1754. this.centerDialogVisible = true;
  1755. var list = response.data.data.list;
  1756. console.log("list2222222",list);
  1757. for(let i=0;i<list.length;i++){
  1758. list[i].prescription_number = list[i].prescription_number + i
  1759. }
  1760. this.tableData = list
  1761. }
  1762. })
  1763. },
  1764. handleSelectionChange(val) {
  1765. this.selecting_schs = val
  1766. // console.log("99999",this.selecting_schs)
  1767. },
  1768. handleClick() {
  1769. },
  1770. savePrint() {
  1771. var arr = [];
  1772. for (let i = 0; i < this.selecting_schs.length; i++) {
  1773. arr.push(this.selecting_schs[i].id)
  1774. }
  1775. var ids = arr.join(",");
  1776. if (this.index == 2) {
  1777. let obj = {
  1778. record: this.record_date,
  1779. prescription_id: this.prescription_id,
  1780. ids: ids,
  1781. patient_id: this.patientid
  1782. };
  1783. this.paramsObj = obj;
  1784. this.innerVisible = true
  1785. // this.$router.push("/outpatientDoctorStation/print?record="+this.record_date+"&prescription_id="+this.prescription_id+"&ids="+ids+"&patient_id="+this.patientid)
  1786. }
  1787. if (this.index == 6) {
  1788. let obj = {
  1789. record: this.record_date,
  1790. prescription_id: this.prescription_id,
  1791. ids: ids,
  1792. patient_id: this.patientid
  1793. };
  1794. this.paramsObj = obj;
  1795. this.innerVisible = true
  1796. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id+"&ids="+ids+"&patient_id="+this.patientid)
  1797. }
  1798. }, getTime(val, temp) {
  1799. if (val != 0) {
  1800. return uParseTime(val, temp)
  1801. } else {
  1802. return ''
  1803. }
  1804. }
  1805. },
  1806. created() {
  1807. var nowDate = new Date();
  1808. var nowYear = nowDate.getFullYear();
  1809. var nowMonth = nowDate.getMonth() + 1;
  1810. var nowDay = nowDate.getDate();
  1811. this.record_date =
  1812. nowYear +
  1813. '-' +
  1814. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1815. '-' +
  1816. (nowDay < 10 ? '0' + nowDay : nowDay);
  1817. this.getList();
  1818. this.diagnoses = this.getDictionaryDataConfig('system', 'diagnose');
  1819. this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history');
  1820. let tableHeight = document.body.clientHeight - 263;
  1821. this.tableHeight = tableHeight
  1822. },
  1823. mounted() {
  1824. const that = this;
  1825. window.onresize = () => {
  1826. return (() => {
  1827. window.fullHeight = document.documentElement.clientHeight;
  1828. that.fullHeight = window.fullHeight
  1829. })()
  1830. }
  1831. },
  1832. watch: {
  1833. fullHeight(val) {
  1834. if (!this.timer) {
  1835. this.fullHeight = val;
  1836. let tableHeight = val - 263;
  1837. this.tableHeight = tableHeight;
  1838. this.timer = true;
  1839. let that = this;
  1840. setTimeout(function () {
  1841. that.timer = false
  1842. }, 400)
  1843. }
  1844. },
  1845. }
  1846. }
  1847. </script>
  1848. <style lang="scss" scoped>
  1849. .new-main-contain {
  1850. height: 100%;
  1851. display: flex;
  1852. flex-direction: column;
  1853. }
  1854. .app-container {
  1855. height: 100%;
  1856. }
  1857. .mainCell {
  1858. height: 36px;
  1859. display: flex;
  1860. align-items: center;
  1861. }
  1862. .mainLeft {
  1863. width: 200px;
  1864. height: 100%;
  1865. display: flex;
  1866. flex-direction: column;
  1867. .el-radio {
  1868. margin-right: 5px;
  1869. }
  1870. }
  1871. .mainRight {
  1872. margin-left: 10px;
  1873. flex: 1;
  1874. height: 100%;
  1875. display: flex;
  1876. flex-direction: column;
  1877. overflow-y: auto;
  1878. .cellSpan {
  1879. min-width: 80px;
  1880. display: inline-block;
  1881. margin-right: 10px;
  1882. }
  1883. }
  1884. .mainCenter {
  1885. display: flex;
  1886. flex: 1;
  1887. }
  1888. .centerLeft {
  1889. flex: 1;
  1890. display: flex;
  1891. flex-direction: column;
  1892. position: relative;
  1893. .el-form-item {
  1894. width: 32%;
  1895. margin-right: 1%;
  1896. float: left;
  1897. }
  1898. .el-form-item__label {
  1899. text-align: left;
  1900. }
  1901. }
  1902. .backColor {
  1903. background: #f6f8f9;
  1904. height: 5px;
  1905. margin-bottom: 5px;
  1906. }
  1907. .tabsBox {
  1908. position: relative;
  1909. height: 76%;
  1910. overflow-y: auto;
  1911. margin-bottom: 60px;
  1912. .el-tabs__item {
  1913. padding: 0 10px;
  1914. }
  1915. }
  1916. .preTabs {
  1917. height: 100%;
  1918. display: flex;
  1919. flex-direction: column;
  1920. .el-tabs__content {
  1921. flex: 1;
  1922. overflow-y: auto;
  1923. }
  1924. }
  1925. .costBox {
  1926. width: 100%;
  1927. height: 60px;
  1928. background: #fff;
  1929. position: absolute;
  1930. bottom: 0;
  1931. display: flex;
  1932. align-items: center;
  1933. }
  1934. .addTab {
  1935. position: absolute;
  1936. right: 0;
  1937. top: 14px;
  1938. z-index: 20;
  1939. }
  1940. .centerRight {
  1941. width: 300px;
  1942. margin-left: 10px;
  1943. display: flex;
  1944. flex-direction: column;
  1945. position: relative;
  1946. }
  1947. .rightTab {
  1948. height: 40px;
  1949. width: 100%;
  1950. border: 1px solid #d2d2d2;
  1951. box-sizing: border-box;
  1952. p {
  1953. width: 50%;
  1954. height: 40px;
  1955. line-height: 40px;
  1956. text-align: center;
  1957. background: #eee;
  1958. float: left;
  1959. }
  1960. > p:last-child {
  1961. border-left: 1px solid #d2d2d2;
  1962. float: right;
  1963. }
  1964. .activeP {
  1965. background: #409EFF;
  1966. color: #fff;
  1967. }
  1968. }
  1969. .comfirmBox {
  1970. width: 100%;
  1971. height: 60px;
  1972. background: #fff;
  1973. position: absolute;
  1974. bottom: 0;
  1975. display: flex;
  1976. align-items: center;
  1977. justify-content: space-between;
  1978. }
  1979. .mainHeader {
  1980. width: 100%;
  1981. background: #fff;
  1982. position: fixed;
  1983. z-index: 100;
  1984. height: 36px;
  1985. }
  1986. .titleBox {
  1987. position: fixed;
  1988. z-index: 99;
  1989. background: #fff;
  1990. }
  1991. .fixedCell {
  1992. position: fixed;
  1993. z-index: 99;
  1994. right: 30px;
  1995. background: #fff;
  1996. width: 300px;
  1997. display: flex;
  1998. justify-content: space-between;
  1999. }
  2000. </style>
  2001. <style lang="scss">
  2002. .centerLeft {
  2003. .el-form-item__label {
  2004. text-align: left;
  2005. }
  2006. }
  2007. .tabsBox {
  2008. .el-tabs__item {
  2009. padding: 0 10px;
  2010. }
  2011. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
  2012. padding: 0 10px;
  2013. }
  2014. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
  2015. padding: 0 10px;
  2016. }
  2017. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  2018. padding: 0 10px;
  2019. }
  2020. }
  2021. .centerRight {
  2022. .el-tabs__nav-scroll {
  2023. display: flex;
  2024. }
  2025. .el-tabs__nav {
  2026. margin: 0 auto;
  2027. }
  2028. .el-table th .cell, .el-table td .cell {
  2029. padding: 0 2px;
  2030. }
  2031. }
  2032. .preTabs {
  2033. .el-tabs__content {
  2034. }
  2035. }
  2036. .rightTabs {
  2037. height: 100%;
  2038. .el-tabs__content {
  2039. }
  2040. }
  2041. .centerDialog {
  2042. .el-dialog__body {
  2043. max-height: calc(100vh - 100px) !important;
  2044. padding: 0 20px;
  2045. }
  2046. }
  2047. </style>