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

doctorDesk.vue 61KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709
  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>处方编号</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"></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(){
  223. this.radio = 2
  224. this.change()
  225. },
  226. setData(val) {
  227. this.prescriptions = val
  228. },
  229. getDictionaryDataConfig(module, filed_name) {
  230. return getDictionaryDataConfig(module, filed_name)
  231. },
  232. searchAction() {
  233. if (this.search_input.length == 0) {
  234. this.patientTableData = this.patientTableDataTwo
  235. } else {
  236. let arr = []
  237. for (let i = 0; i < this.patientTableData.length; i++) {
  238. if (this.patientTableData[i].name.indexOf(this.search_input) != -1 || this.patientTableData[i].his_patient.number.indexOf(this.search_input) != -1) {
  239. arr = arr.concat(this.patientTableData[i])
  240. }
  241. }
  242. this.patientTableData = arr
  243. }
  244. },
  245. // changeTab() {
  246. // this.saveLoading = false
  247. //
  248. // this.radio = 2
  249. // let params = {
  250. // 'record_date': this.record_date,
  251. // 'type': this.radio
  252. // }
  253. // this.patientTableData = []
  254. // getSchedulePatientList(params).then(response => {
  255. // if (response.data.state == 0) {
  256. // this.$message.error(response.data.msg)
  257. // return false
  258. // } else {
  259. // this.patientTableData = response.data.data.list
  260. // this.patientTableDataTwo = response.data.data.list
  261. // this.cal_one = response.data.data.total_one
  262. // this.cal_two = response.data.data.total_two
  263. // this.admin_info = response.data.data.info
  264. // for (let i = 0; i < this.patientTableData.length; i++) {
  265. // if (this.patientTableData[i].id == this.patientid) {
  266. // this.$refs.tab.setCurrentRow(this.patientTableData[i])
  267. // this.getPatientInfo(this.patientTableData[i])
  268. //
  269. // }
  270. // }
  271. //
  272. //
  273. // }
  274. // })
  275. //
  276. // },
  277. change() {
  278. let params = {
  279. 'record_date': this.record_date,
  280. 'type': this.radio
  281. }
  282. this.patientTableData = []
  283. getSchedulePatientList(params).then(response => {
  284. if (response.data.state == 0) {
  285. this.$message.error(response.data.msg)
  286. return false
  287. } else {
  288. this.patientTableData = response.data.data.list
  289. this.patientTableDataTwo = response.data.data.list
  290. this.cal_one = response.data.data.total_one
  291. this.cal_two = response.data.data.total_two
  292. this.admin_info = response.data.data.info
  293. if (this.patientTableData.length > 0) {
  294. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  295. this.oldCurrentRow = this.patientTableData[0]
  296. this.getPatientInfo(this.patientTableData[0])
  297. }
  298. this.prescriptionList = response.data.data.list.prescription
  299. // this.patientid = this.patientTableData[0].patient_id
  300. }
  301. })
  302. },
  303. setMonthPrescription(month_prescriptions) {
  304. console.log("11111111")
  305. console.log(month_prescriptions)
  306. this.month_prescriptions = []
  307. let drug_month_prescriptions = {
  308. advices: []
  309. }
  310. let drug_ids = []
  311. let project_month_prescriptions = {
  312. project: []
  313. }
  314. let project_ids = []
  315. let addition_month_prescriptions = {
  316. addition: []
  317. }
  318. let additions_ids = []
  319. for (let i = 0; i < month_prescriptions.length; i++) {
  320. if (month_prescriptions[i].type == 1) { //药品
  321. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  322. let obj = {
  323. id: month_prescriptions[i].advices[a].drug_id,
  324. price:month_prescriptions[i].advices[a].price,
  325. }
  326. drug_ids.push(obj)
  327. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  328. }
  329. } else if (month_prescriptions[i].type == 2) { //项目
  330. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  331. let obj = {
  332. id: month_prescriptions[i].project[a].project_id,
  333. price:month_prescriptions[i].project[a].price,
  334. }
  335. project_ids.push(obj)
  336. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  337. }
  338. }
  339. //附加收费
  340. for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  341. let obj = {
  342. id: month_prescriptions[i].addition[a].item_id,
  343. price:month_prescriptions[i].addition[a].price,
  344. }
  345. additions_ids.push(obj)
  346. addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  347. }
  348. }
  349. console.log("00000000000000")
  350. console.log(drug_ids)
  351. console.log(project_ids)
  352. console.log(additions_ids)
  353. console.log("00000000000000")
  354. const obj = {}
  355. const obj1 = {}
  356. const obj2 = {}
  357. drug_ids = drug_ids.reduce((cur, next) => {
  358. obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
  359. return cur
  360. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  361. project_ids = project_ids.reduce((cur, next) => {
  362. obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
  363. return cur
  364. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  365. additions_ids = additions_ids.reduce((cur, next) => {
  366. obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
  367. return cur
  368. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  369. let drugs = []
  370. let projects = []
  371. let additions = []
  372. for (let i = 0; i < drug_ids.length; i++) {
  373. let obj = {}
  374. let count = 0
  375. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  376. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
  377. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  378. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  379. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  380. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  381. obj['day'] = drug_month_prescriptions.advices[a].day
  382. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  383. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  384. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  385. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  386. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  387. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  388. count = count + drug_month_prescriptions.advices[a].prescribing_number
  389. }
  390. }
  391. obj['prescribing_number'] = count
  392. drugs.push(obj)
  393. }
  394. for (let i = 0; i < project_ids.length; i++) {
  395. let obj = {}
  396. let count = 0
  397. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  398. if (project_ids[i].price == project_month_prescriptions.project[a].price) {
  399. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  400. obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  401. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  402. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  403. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  404. obj['number_days'] = project_month_prescriptions.project[a].day
  405. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  406. obj['unit'] = project_month_prescriptions.project[a].unit
  407. obj['project_id'] = project_month_prescriptions.project[a].project_id
  408. count = count + project_month_prescriptions.project[a].count
  409. // price = price + project_month_prescriptions.project[a].price
  410. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  411. }
  412. }
  413. obj['total'] = count
  414. projects.push(obj)
  415. }
  416. for (let i = 0; i < additions_ids.length; i++) {
  417. let obj = {}
  418. let count = 0
  419. console.log(addition_month_prescriptions.addition)
  420. if (addition_month_prescriptions.addition) {
  421. for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  422. if (project_ids[i].price == addition_month_prescriptions.addition[a].price) {
  423. obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  424. obj['id'] = addition_month_prescriptions.addition[a].id
  425. obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  426. count = count + addition_month_prescriptions.addition[a].count
  427. obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
  428. }
  429. }
  430. obj['count'] = count
  431. additions.push(obj)
  432. }
  433. }
  434. console.log(drugs)
  435. console.log(projects)
  436. console.log(additions)
  437. let p1 = {
  438. name: '处方' + 1,
  439. advices: drugs,
  440. project: [],
  441. type: 1,
  442. addition: additions
  443. }
  444. let p2 = {
  445. name: '处方' + 2,
  446. type: 2,
  447. project: projects,
  448. advices: [],
  449. addition: []
  450. }
  451. this.month_prescriptions.push(p1)
  452. this.month_prescriptions.push(p2)
  453. this.curMonthPrescriptions = this.month_prescriptions[0]
  454. },
  455. // setMonthPrescription(month_prescriptions){
  456. // let drug_month_prescriptions = {
  457. // advices:[],
  458. // }
  459. // let drug_ids=[]
  460. // let project_month_prescriptions ={
  461. // project:[],
  462. //
  463. // }
  464. // let project_ids=[]
  465. //
  466. // let addition_month_prescriptions ={
  467. // addtions:[],
  468. //
  469. // }
  470. // let additions_ids=[]
  471. //
  472. //
  473. // for (let i = 0; i < month_prescriptions.length; i++){
  474. // if(month_prescriptions[i].type == 1){ //药品
  475. // for (let a = 0; a < month_prescriptions[i].advices.length; a++){
  476. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  477. // drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  478. // }
  479. //
  480. // }else if(month_prescriptions[i].type == 2){ //项目
  481. // for (let a = 0; a < month_prescriptions[i].project.length; a++){
  482. // project_ids.push(month_prescriptions[i].project[a].project_id)
  483. // project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  484. // }
  485. // }
  486. // //附加收费
  487. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  488. // additions_ids.push(month_prescriptions[i].addition[a].item_id)
  489. // addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
  490. // }
  491. //
  492. // }
  493. //
  494. //
  495. //
  496. //
  497. // const obj = {}
  498. // const obj1 = {}
  499. // const obj2 = {}
  500. //
  501. // drug_ids = drug_ids.reduce((cur, next) => {
  502. // obj[next] ? '' : obj[next] = true && cur.push(next)
  503. // return cur
  504. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  505. // project_ids = project_ids.reduce((cur, next) => {
  506. // obj1[next] ? '' : obj1[next] = true && cur.push(next)
  507. // return cur
  508. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  509. // additions_ids = additions_ids.reduce((cur, next) => {
  510. // obj2[next] ? '' : obj2[next] = true && cur.push(next)
  511. // return cur
  512. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  513. //
  514. //
  515. //
  516. //
  517. //
  518. // let drugs =[]
  519. // let projects =[]
  520. // let additions =[]
  521. //
  522. //
  523. // for (let i = 0; i < drug_ids.length; i++){
  524. // let obj = {}
  525. // let price = 0
  526. // let count = 0
  527. // for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
  528. // if(drug_ids[i] == drug_month_prescriptions.advices[a].drug_id){
  529. // obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  530. // obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  531. // obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  532. // obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  533. // obj['day'] = drug_month_prescriptions.advices[a].day
  534. // // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  535. // obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  536. // obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  537. // obj['id'] = drug_month_prescriptions.advices[a].drug_id
  538. // // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  539. //
  540. //
  541. // count = count + drug_month_prescriptions.advices[a].prescribing_number
  542. // price = price + drug_month_prescriptions.advices[a].price
  543. //
  544. // }
  545. // }
  546. // obj['retail_price'] = price
  547. // obj['prescribing_number'] = count
  548. // drugs.push(obj)
  549. // }
  550. //
  551. //
  552. //
  553. //
  554. // for (let i = 0; i < project_ids.length; i++){
  555. // let obj = {}
  556. // let price = 0
  557. // let count = 0
  558. // for (let a = 0; a < project_month_prescriptions.project.length; a++){
  559. // if(project_ids[i] == project_month_prescriptions.project[a].project_id){
  560. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  561. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  562. // obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  563. // obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  564. // obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  565. // obj['number_days'] = project_month_prescriptions.project[a].day
  566. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  567. // obj['unit'] = project_month_prescriptions.project[a].unit
  568. // obj['project_id'] = project_month_prescriptions.project[a].project_id
  569. // count = count + project_month_prescriptions.project[a].count
  570. // price = price + project_month_prescriptions.project[a].price
  571. // }
  572. // }
  573. // obj['price'] = price
  574. // obj['total'] = count
  575. // projects.push(obj)
  576. // }
  577. //
  578. //
  579. // for (let i = 0; i < additions_ids.length; i++){
  580. // let obj = {}
  581. // let price = 0
  582. // let count = 0
  583. // for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
  584. // if(project_ids[i] == addition_month_prescriptions.addition[a].item_id){
  585. // obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  586. // obj['id'] = addition_month_prescriptions.addition[a].id
  587. // obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  588. // count = count + addition_month_prescriptions.addition[a].count
  589. // price = price + addition_month_prescriptions.addition[a].price
  590. // }
  591. // }
  592. // obj['price'] = price
  593. // obj['count'] = count
  594. // additions.push(obj)
  595. // }
  596. //
  597. //
  598. // let p1 = {
  599. // name: '处方' + 1,
  600. // advices: drugs,
  601. // project: [],
  602. // type:1,
  603. // addition: additions,
  604. // }
  605. // let p2 = {
  606. // name: '处方' + 2,
  607. // type:2,
  608. // project: projects,
  609. // advices: [],
  610. // }
  611. // this.month_prescriptions.push(p1)
  612. // this.month_prescriptions.push(p2)
  613. //
  614. // },
  615. getList() {
  616. let params = {
  617. 'record_date': this.record_date,
  618. 'type': this.radio
  619. }
  620. this.patientTableData = []
  621. getSchedulePatientList(params).then(response => {
  622. if (response.data.state == 0) {
  623. this.$message.error(response.data.msg)
  624. return false
  625. } else {
  626. this.patientTableData = response.data.data.list
  627. this.patientTableDataTwo = response.data.data.list
  628. this.cal_one = response.data.data.total_one
  629. this.cal_two = response.data.data.total_two
  630. this.admin_info = response.data.data.info
  631. if (this.patientTableData.length > 0) {
  632. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  633. this.oldCurrentRow = this.patientTableData[0]
  634. this.getPatientInfo(this.patientTableData[0])
  635. }
  636. this.prescriptionList = response.data.data.list.prescription
  637. // this.patientid = this.patientTableData[0].patient_id
  638. }
  639. })
  640. },
  641. getPatientInfo(val) {
  642. var nowDate = new Date()
  643. var nowYear = nowDate.getFullYear()
  644. var nowMonth = nowDate.getMonth() + 1
  645. var nowDay = nowDate.getDate()
  646. var hours = nowDate.getHours()
  647. var min = nowDate.getMinutes()
  648. var nowTime =
  649. nowYear +
  650. '-' +
  651. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  652. '-' +
  653. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (hours < 10 ? '0' + hours : hours) +
  654. ':' + (min < 10 ? '0' + min : min)
  655. this.patientid = val.id
  656. let params = {
  657. 'record_date': this.record_date,
  658. 'patient_id': val.id,
  659. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  660. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD")
  661. }
  662. this.isloading = true
  663. getPatientInfo(params).then(response => {
  664. if (response.data.state == 0) {
  665. this.$message.error(response.data.msg)
  666. this.isloading = false
  667. return false
  668. } else {
  669. this.isloading = false
  670. this.prescriptions = []
  671. this.month_prescriptions = []
  672. this.patientInfo = response.data.data.xt_info
  673. this.hisPatientInfo = response.data.data.his_info
  674. this.case_history = response.data.data.case_history
  675. this.info = response.data.data.info
  676. this.doctors = response.data.data.doctors
  677. this.department = response.data.data.department
  678. var month_prescriptions = response.data.data.month_prescriptions
  679. this.setMonthPrescription(month_prescriptions)
  680. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  681. if (this.case_history.temperature <= 0) {
  682. this.case_history.temperature = ''
  683. }
  684. if (this.case_history.blood_sugar <= 0) {
  685. this.case_history.blood_sugar = ''
  686. }
  687. if (this.case_history.pulse <= 0) {
  688. this.case_history.pulse = ''
  689. }
  690. if (this.case_history.sbp <= 0) {
  691. this.case_history.sbp = ''
  692. }
  693. if (this.case_history.dbp <= 0) {
  694. this.case_history.dbp = ''
  695. }
  696. if (this.case_history.height <= 0) {
  697. this.case_history.height = ''
  698. }
  699. if (this.case_history.blood_fat <= 0) {
  700. this.case_history.blood_fat = ''
  701. }
  702. if (this.case_history.sick_type <= 0) {
  703. this.case_history.sick_type = ''
  704. }
  705. if (this.case_history.sick <= 0) {
  706. this.case_history.sick = ''
  707. }
  708. if (this.case_history.diagnose <= 0) {
  709. this.case_history.diagnose = ''
  710. }
  711. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  712. if (this.case_history.is_infect == 1) {
  713. this.case_history.is_infect = true
  714. } else {
  715. this.case_history.is_infect = false
  716. }
  717. //处方相关
  718. this.prescriptionList = response.data.data.prescription
  719. if (response.data.data.prescription.length > 0) {
  720. for (let i = 0; i < response.data.data.prescription.length; i++) {
  721. var prescription = response.data.data.prescription[i]
  722. let tempAdvice = []
  723. let tempProject = []
  724. let tempAddition = []
  725. //药品
  726. for (let b = 0; b < prescription.advices.length; b++) {
  727. let obj = {
  728. advice_id: prescription.advices[b].id,
  729. drug_name: prescription.advices[b].advice_name,
  730. single_dose: prescription.advices[b].single_dose,
  731. delivery_way: prescription.advices[b].delivery_way,
  732. execution_frequency: prescription.advices[b].execution_frequency,
  733. retail_price: prescription.advices[b].price.toString(),
  734. remark: prescription.advices[b].remark,
  735. day: prescription.advices[b].day,
  736. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  737. single_dose_unit: prescription.advices[b].single_dose_unit,
  738. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  739. medical_insurance_number: prescription.advices[b].med_list_codg,
  740. id: prescription.advices[b].drug_id
  741. }
  742. tempAdvice.push(obj)
  743. }
  744. //项目
  745. for (let b = 0; b < prescription.project.length; b++) {
  746. let obj = {
  747. id: prescription.project[b].id,
  748. project_id: prescription.project[b].project_id,
  749. project_name: prescription.project[b].project.project_name,
  750. statistical_classification: prescription.project[b].project.statistical_classification,
  751. single_dose: prescription.project[b].single_dose,
  752. delivery_way: prescription.project[b].delivery_way,
  753. execution_frequency: prescription.project[b].execution_frequency,
  754. number_days: prescription.project[b].day,
  755. total: prescription.project[b].count.toString(),
  756. price: prescription.project[b].price,
  757. remark: prescription.project[b].remark,
  758. medical_code: prescription.project[b].project.medical_code,
  759. unit: prescription.project[b].project.unit,
  760. }
  761. tempProject.push(obj)
  762. }
  763. //附加收费
  764. for (let b = 0; b < prescription.addition.length; b++) {
  765. let obj = {
  766. id: prescription.addition[b].id,
  767. item_name: prescription.addition[b].item_name,
  768. price: prescription.addition[b].price,
  769. count: prescription.addition[b].count,
  770. item_id: prescription.addition[b].item_id,
  771. }
  772. tempAddition.push(obj)
  773. }
  774. var preTime = ""
  775. if (prescription.pre_time == 0) {
  776. preTime = nowTime
  777. } else {
  778. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  779. }
  780. let index = i + 1
  781. let obj = {
  782. id: prescription.id,
  783. name: '处方' + index,
  784. advices: tempAdvice,
  785. project: tempProject,
  786. addition: tempAddition,
  787. order_status: prescription.order_status,
  788. pre_time: preTime
  789. }
  790. this.prescriptions.push(obj)
  791. }
  792. } else {
  793. let obj = {
  794. id: 0,
  795. name: '处方' + 1,
  796. advices: [],
  797. project: [],
  798. addition: [],
  799. orderStatus: 0,
  800. pre_time: nowTime,
  801. }
  802. this.prescriptions.push(obj)
  803. }
  804. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions)
  805. }
  806. })
  807. },
  808. choosePatient(val) {
  809. var nowDate = new Date()
  810. var nowYear = nowDate.getFullYear()
  811. var nowMonth = nowDate.getMonth() + 1
  812. var nowDay = nowDate.getDate()
  813. var hours = nowDate.getHours()
  814. var min = nowDate.getMinutes()
  815. var nowTime =
  816. nowYear +
  817. '-' +
  818. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  819. '-' +
  820. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (hours < 10 ? '0' + hours : hours) +
  821. ':' + (min < 10 ? '0' + min : min)
  822. var last_month = nowDate.getMonth() < 10 ? '0' + nowDate.getMonth().toString() : nowDate.getMonth() //获取当前月份(0-11,0代表1月)
  823. var endTime =
  824. nowYear +
  825. '-' +
  826. last_month +
  827. '-' +
  828. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (hours < 10 ? '0' + hours : hours) +
  829. ':' + (min < 10 ? '0' + min : min)
  830. let isShowDailog = false
  831. for (let i = 0; i < this.prescriptions.length; i++) {
  832. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  833. isShowDailog = true
  834. }
  835. }
  836. if (isShowDailog) {
  837. this.patientTableData.map((item, index) => {
  838. if (item.patient_id == this.oldCurrentRow.patient_id) {
  839. this.$refs.tab.setCurrentRow(this.patientTableData[index])
  840. return
  841. }
  842. })
  843. this.$confirm('是否保存当前处方', '保存', {
  844. confirmButtonText: '确 定',
  845. cancelButtonText: '取 消',
  846. type: 'warning'
  847. }).then(() => {
  848. this.open(1)
  849. }).catch(() => {
  850. this.patientTableData.map((item, index) => {
  851. if (item.patient_id == val.patient_id) {
  852. this.$refs.tab.setCurrentRow(this.patientTableData[index])
  853. }
  854. })
  855. this.patientid = val.id
  856. let params = {
  857. 'record_date': this.record_date,
  858. 'patient_id': val.id,
  859. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  860. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD")
  861. }
  862. getPatientInfo(params).then(response => {
  863. if (response.data.state == 0) {
  864. this.$message.error(response.data.msg)
  865. return false
  866. } else {
  867. this.prescriptions = []
  868. this.patientInfo = response.data.data.xt_info
  869. this.hisPatientInfo = response.data.data.his_info
  870. this.case_history = response.data.data.case_history
  871. var case_history = response.data.data.case_history
  872. var month_prescriptions = response.data.data.month_prescriptions
  873. this.setMonthPrescription(month_prescriptions)
  874. this.doctors = response.data.data.doctors
  875. this.department = response.data.data.department
  876. this.case_history = case_history
  877. this.info = response.data.data.info
  878. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  879. if (this.case_history.breathing <= 0) {
  880. this.case_history.breathing = ""
  881. }
  882. if (this.case_history.sick <= 0) {
  883. this.case_history.sick = ""
  884. }
  885. if (this.case_history.diagnose <= 0) {
  886. this.case_history.diagnose = ""
  887. }
  888. if (this.case_history.temperature <= 0) {
  889. this.case_history.temperature = ''
  890. }
  891. if (this.case_history.blood_sugar <= 0) {
  892. this.case_history.blood_sugar = ''
  893. }
  894. if (this.case_history.pulse <= 0) {
  895. this.case_history.pulse = ''
  896. }
  897. if (this.case_history.sbp <= 0) {
  898. this.case_history.sbp = ''
  899. }
  900. if (this.case_history.dbp <= 0) {
  901. this.case_history.dbp = ''
  902. }
  903. if (this.case_history.height <= 0) {
  904. this.case_history.height = ''
  905. }
  906. if (this.case_history.blood_fat <= 0) {
  907. this.case_history.blood_fat = ''
  908. }
  909. if (this.case_history.sick_type <= 0) {
  910. this.case_history.sick_type = ''
  911. }
  912. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  913. if (this.case_history.is_infect == 1) {
  914. this.case_history.is_infect = true
  915. } else {
  916. this.case_history.is_infect = false
  917. }
  918. this.prescriptionList = response.data.data.prescription
  919. if (response.data.data.prescription.length > 0) {
  920. for (let i = 0; i < response.data.data.prescription.length; i++) {
  921. var prescription = response.data.data.prescription[i]
  922. let tempAdvice = []
  923. let tempProject = []
  924. let tempAddition = []
  925. for (let b = 0; b < prescription.advices.length; b++) {
  926. let obj = {
  927. advice_id: prescription.advices[b].id,
  928. drug_name: prescription.advices[b].advice_name,
  929. single_dose: prescription.advices[b].single_dose,
  930. delivery_way: prescription.advices[b].delivery_way,
  931. execution_frequency: prescription.advices[b].execution_frequency,
  932. retail_price: prescription.advices[b].price.toString(),
  933. remark: prescription.advices[b].remark,
  934. day: prescription.advices[b].day,
  935. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  936. single_dose_unit: prescription.advices[b].single_dose_unit,
  937. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  938. medical_insurance_number: prescription.advices[b].med_list_codg,
  939. id: prescription.advices[b].drug_id
  940. }
  941. tempAdvice.push(obj)
  942. }
  943. for (let b = 0; b < prescription.project.length; b++) {
  944. let obj = {
  945. id: prescription.project[b].id,
  946. project_id: prescription.project[b].project_id,
  947. project_name: prescription.project[b].project.project_name,
  948. statistical_classification: prescription.project[b].project.statistical_classification,
  949. single_dose: prescription.project[b].single_dose,
  950. delivery_way: prescription.project[b].delivery_way,
  951. execution_frequency: prescription.project[b].execution_frequency,
  952. number_days: prescription.project[b].day,
  953. total: prescription.project[b].count.toString(),
  954. price: prescription.project[b].price,
  955. remark: prescription.project[b].remark,
  956. medical_code: prescription.project[b].project.medical_code,
  957. unit: prescription.project[b].unit
  958. }
  959. tempProject.push(obj)
  960. }
  961. for (let b = 0; b < prescription.addition.length; b++) {
  962. let obj = {
  963. id: prescription.addition[b].id,
  964. item_name: prescription.addition[b].item_name,
  965. price: prescription.addition[b].price,
  966. count: prescription.addition[b].count,
  967. item_id: prescription.addition[b].item_id,
  968. }
  969. tempAddition.push(obj)
  970. }
  971. var preTime = ""
  972. if (prescription.pre_time == 0) {
  973. preTime = nowTime
  974. } else {
  975. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  976. }
  977. let index = i + 1
  978. let obj = {
  979. id: prescription.id,
  980. name: '处方' + index,
  981. advices: tempAdvice,
  982. project: tempProject,
  983. addition: tempAddition,
  984. order_status: prescription.order_status,
  985. pre_time: preTime
  986. }
  987. this.prescriptions.push(obj)
  988. }
  989. } else {
  990. let obj = {
  991. id: 0,
  992. name: '处方' + 1,
  993. advices: [],
  994. project: [],
  995. addition: [],
  996. orderStatus: 0,
  997. pre_time: nowTime
  998. }
  999. this.prescriptions.push(obj)
  1000. }
  1001. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions)
  1002. }
  1003. })
  1004. })
  1005. // this.$message.error('需要保存保存处方才能切换')
  1006. } else {
  1007. this.patientid = val.id
  1008. let params = {
  1009. 'record_date': this.record_date,
  1010. 'patient_id': val.id,
  1011. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1012. 'end_time': moment(new Date()).add('year', 0).format("YYYY-MM-DD")
  1013. }
  1014. getPatientInfo(params).then(response => {
  1015. if (response.data.state == 0) {
  1016. this.$message.error(response.data.msg)
  1017. return false
  1018. } else {
  1019. this.prescriptions = []
  1020. this.month_prescriptions = []
  1021. var month_prescriptions = response.data.data.month_prescriptions
  1022. this.setMonthPrescription(month_prescriptions)
  1023. this.patientInfo = response.data.data.xt_info
  1024. this.hisPatientInfo = response.data.data.his_info
  1025. this.case_history = response.data.data.case_history
  1026. var case_history = response.data.data.case_history
  1027. this.case_history = case_history
  1028. this.info = response.data.data.info
  1029. this.doctors = response.data.data.doctors
  1030. this.department = response.data.data.department
  1031. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  1032. if (this.case_history.breathing <= 0) {
  1033. this.case_history.breathing = ""
  1034. }
  1035. if (this.case_history.sick <= 0) {
  1036. this.case_history.sick = ""
  1037. }
  1038. if (this.case_history.diagnose <= 0) {
  1039. this.case_history.diagnose = ""
  1040. }
  1041. if (this.case_history.temperature <= 0) {
  1042. this.case_history.temperature = ''
  1043. }
  1044. if (this.case_history.blood_sugar <= 0) {
  1045. this.case_history.blood_sugar = ''
  1046. }
  1047. if (this.case_history.pulse <= 0) {
  1048. this.case_history.pulse = ''
  1049. }
  1050. if (this.case_history.sbp <= 0) {
  1051. this.case_history.sbp = ''
  1052. }
  1053. if (this.case_history.dbp <= 0) {
  1054. this.case_history.dbp = ''
  1055. }
  1056. if (this.case_history.height <= 0) {
  1057. this.case_history.height = ''
  1058. }
  1059. if (this.case_history.blood_fat <= 0) {
  1060. this.case_history.blood_fat = ''
  1061. }
  1062. if (this.case_history.sick_type <= 0) {
  1063. this.case_history.sick_type = ''
  1064. }
  1065. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  1066. if (this.case_history.is_infect == 1) {
  1067. this.case_history.is_infect = true
  1068. } else {
  1069. this.case_history.is_infect = false
  1070. }
  1071. this.prescriptionList = response.data.data.prescription
  1072. if (response.data.data.prescription.length > 0) {
  1073. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1074. var prescription = response.data.data.prescription[i]
  1075. let tempAdvice = []
  1076. let tempProject = []
  1077. let tempAddition = []
  1078. for (let b = 0; b < prescription.advices.length; b++) {
  1079. let obj = {
  1080. advice_id: prescription.advices[b].id,
  1081. drug_name: prescription.advices[b].advice_name,
  1082. single_dose: prescription.advices[b].single_dose,
  1083. delivery_way: prescription.advices[b].delivery_way,
  1084. execution_frequency: prescription.advices[b].execution_frequency,
  1085. retail_price: prescription.advices[b].price.toString(),
  1086. remark: prescription.advices[b].remark,
  1087. day: prescription.advices[b].day,
  1088. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1089. single_dose_unit: prescription.advices[b].single_dose_unit,
  1090. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1091. medical_insurance_number: prescription.advices[b].med_list_codg,
  1092. id: prescription.advices[b].drug_id
  1093. }
  1094. tempAdvice.push(obj)
  1095. }
  1096. for (let b = 0; b < prescription.project.length; b++) {
  1097. let obj = {
  1098. id: prescription.project[b].id,
  1099. project_id: prescription.project[b].project_id,
  1100. project_name: prescription.project[b].project.project_name,
  1101. statistical_classification: prescription.project[b].project.statistical_classification,
  1102. single_dose: prescription.project[b].single_dose,
  1103. delivery_way: prescription.project[b].delivery_way,
  1104. execution_frequency: prescription.project[b].execution_frequency,
  1105. number_days: prescription.project[b].day,
  1106. total: prescription.project[b].count.toString(),
  1107. price: prescription.project[b].price,
  1108. remark: prescription.project[b].remark,
  1109. medical_code: prescription.project[b].project.medical_code,
  1110. unit: prescription.project[b].unit
  1111. }
  1112. tempProject.push(obj)
  1113. }
  1114. for (let b = 0; b < prescription.addition.length; b++) {
  1115. let obj = {
  1116. id: prescription.addition[b].id,
  1117. item_name: prescription.addition[b].item_name,
  1118. price: prescription.addition[b].price,
  1119. count: prescription.addition[b].count,
  1120. item_id: prescription.addition[b].item_id,
  1121. }
  1122. tempAddition.push(obj)
  1123. }
  1124. var preTime = ""
  1125. if (prescription.pre_time == 0) {
  1126. preTime = nowTime
  1127. } else {
  1128. preTime = this.getTime(prescription.pre_time, "{y}-{m}-{d} {h}:{i}")
  1129. }
  1130. let index = i + 1
  1131. let obj = {
  1132. id: prescription.id,
  1133. name: '处方' + index,
  1134. advices: tempAdvice,
  1135. project: tempProject,
  1136. addition: tempAddition,
  1137. order_status: prescription.order_status,
  1138. pre_time: preTime
  1139. }
  1140. this.prescriptions.push(obj)
  1141. }
  1142. } else {
  1143. let obj = {
  1144. id: 0,
  1145. name: '处方' + 1,
  1146. advices: [],
  1147. project: [],
  1148. addition: [],
  1149. orderStatus: 0,
  1150. pre_time: nowTime,
  1151. }
  1152. this.prescriptions.push(obj)
  1153. }
  1154. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department,this.hisPatientInfo, this.month_prescriptions)
  1155. }
  1156. })
  1157. }
  1158. },
  1159. currentChange(currentRow, oldCurrentRow) {
  1160. let isShowDailog = false
  1161. for (let i = 0; i < this.prescriptions.length; i++) {
  1162. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  1163. isShowDailog = true
  1164. }
  1165. }
  1166. if (!isShowDailog) {
  1167. this.oldCurrentRow = currentRow
  1168. return
  1169. }
  1170. }, open_two() {
  1171. this.$refs.prescriptions.open_two()
  1172. },
  1173. open(index) {
  1174. this.index = index
  1175. if (index == 1) {
  1176. this.$refs.prescriptions.open(1, this.saveLoading)
  1177. } else if (index == 2) {
  1178. this.getPrescriptionList(this.patientInfo.id)
  1179. // this.$router.push("/outpatientDoctorStation/print?record="+this.record_date+"&prescription_id="+this.prescription_id)
  1180. } else if (index == 3) {
  1181. this.$refs.prescriptions.open(3)
  1182. } else if (index == 4) {
  1183. this.$refs.prescriptions.open(4)
  1184. } else if (index == 6) {
  1185. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  1186. this.getPrescriptionList(this.patientInfo.id)
  1187. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  1188. }
  1189. },
  1190. opentwo(index) {
  1191. if (index == 1) {
  1192. if (this.patientInfo.id == undefined) {
  1193. this.$message.error("请先选择病人")
  1194. return
  1195. }
  1196. this.$refs.child.createCaseHistory()
  1197. } else if (index == 2) {
  1198. this.recordVisible = true
  1199. // this.$router.push('/outpatientDoctorStation/recordPrint?record='+this.record_date+"&patient_id="+this.patientid)
  1200. } else if (index == 3) {
  1201. var mode_status = this.$refs.saveRecordTemplate.mode_status
  1202. this.$refs.medicalRecord.show(mode_status)
  1203. } else if (index == 4) {
  1204. this.$refs.saveRecordTemplate.show(this.case_history)
  1205. }
  1206. },
  1207. // changePatient(val){
  1208. // console.log("患者val",val)
  1209. // this.hisPatientInfo = val.hisPatientInfo
  1210. // console.log("333333",this.hisPatientInfo)
  1211. // }
  1212. getMsgFormSon(id) {
  1213. this.detalid = id
  1214. },
  1215. changetwo(data) {
  1216. this.prescription_id = data
  1217. },
  1218. getPrescriptionList(id) {
  1219. getPrescriptionList(id).then(response => {
  1220. if (response.data.state == 1) {
  1221. this.centerDialogVisible = true
  1222. var list = response.data.data.list
  1223. this.tableData = list
  1224. }
  1225. })
  1226. },
  1227. handleSelectionChange(val) {
  1228. this.selecting_schs = val
  1229. // console.log("99999",this.selecting_schs)
  1230. },
  1231. handleClick() {
  1232. },
  1233. savePrint() {
  1234. var arr = []
  1235. for (let i = 0; i < this.selecting_schs.length; i++) {
  1236. arr.push(this.selecting_schs[i].id)
  1237. }
  1238. var ids = arr.join(",")
  1239. if (this.index == 2) {
  1240. let obj = {
  1241. record: this.record_date,
  1242. prescription_id: this.prescription_id,
  1243. ids: ids,
  1244. patient_id: this.patientid
  1245. }
  1246. this.paramsObj = obj
  1247. this.innerVisible = true
  1248. // this.$router.push("/outpatientDoctorStation/print?record="+this.record_date+"&prescription_id="+this.prescription_id+"&ids="+ids+"&patient_id="+this.patientid)
  1249. }
  1250. if (this.index == 6) {
  1251. let obj = {
  1252. record: this.record_date,
  1253. prescription_id: this.prescription_id,
  1254. ids: ids,
  1255. patient_id: this.patientid
  1256. }
  1257. this.paramsObj = obj
  1258. this.innerVisible = true
  1259. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id+"&ids="+ids+"&patient_id="+this.patientid)
  1260. }
  1261. }, getTime(val, temp) {
  1262. if (val != 0) {
  1263. return uParseTime(val, temp)
  1264. } else {
  1265. return ''
  1266. }
  1267. }
  1268. },
  1269. created() {
  1270. var nowDate = new Date()
  1271. var nowYear = nowDate.getFullYear()
  1272. var nowMonth = nowDate.getMonth() + 1
  1273. var nowDay = nowDate.getDate()
  1274. this.record_date =
  1275. nowYear +
  1276. '-' +
  1277. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1278. '-' +
  1279. (nowDay < 10 ? '0' + nowDay : nowDay)
  1280. this.getList()
  1281. this.diagnoses = this.getDictionaryDataConfig('system', 'diagnose')
  1282. this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history')
  1283. let tableHeight = document.body.clientHeight - 263
  1284. this.tableHeight = tableHeight
  1285. },
  1286. mounted() {
  1287. const that = this
  1288. window.onresize = () => {
  1289. return (() => {
  1290. window.fullHeight = document.documentElement.clientHeight
  1291. that.fullHeight = window.fullHeight
  1292. })()
  1293. }
  1294. },
  1295. watch: {
  1296. fullHeight(val) {
  1297. if (!this.timer) {
  1298. this.fullHeight = val
  1299. let tableHeight = val - 263
  1300. this.tableHeight = tableHeight
  1301. this.timer = true
  1302. let that = this
  1303. setTimeout(function () {
  1304. that.timer = false
  1305. }, 400)
  1306. }
  1307. },
  1308. }
  1309. }
  1310. </script>
  1311. <style lang="scss" scoped>
  1312. .new-main-contain {
  1313. height: 100%;
  1314. display: flex;
  1315. flex-direction: column;
  1316. }
  1317. .app-container {
  1318. height: 100%;
  1319. }
  1320. .mainCell {
  1321. height: 36px;
  1322. display: flex;
  1323. align-items: center;
  1324. }
  1325. .mainLeft {
  1326. width: 200px;
  1327. height: 100%;
  1328. display: flex;
  1329. flex-direction: column;
  1330. .el-radio {
  1331. margin-right: 5px;
  1332. }
  1333. }
  1334. .mainRight {
  1335. margin-left: 10px;
  1336. flex: 1;
  1337. height: 100%;
  1338. display: flex;
  1339. flex-direction: column;
  1340. overflow-y: auto;
  1341. .cellSpan {
  1342. min-width: 80px;
  1343. display: inline-block;
  1344. margin-right: 10px;
  1345. }
  1346. }
  1347. .mainCenter {
  1348. display: flex;
  1349. flex: 1;
  1350. }
  1351. .centerLeft {
  1352. flex: 1;
  1353. display: flex;
  1354. flex-direction: column;
  1355. position: relative;
  1356. .el-form-item {
  1357. width: 32%;
  1358. margin-right: 1%;
  1359. float: left;
  1360. }
  1361. .el-form-item__label {
  1362. text-align: left;
  1363. }
  1364. }
  1365. .backColor {
  1366. background: #f6f8f9;
  1367. height: 5px;
  1368. margin-bottom: 5px;
  1369. }
  1370. .tabsBox {
  1371. position: relative;
  1372. height: 76%;
  1373. overflow-y: auto;
  1374. margin-bottom: 60px;
  1375. .el-tabs__item {
  1376. padding: 0 10px;
  1377. }
  1378. }
  1379. .preTabs {
  1380. height: 100%;
  1381. display: flex;
  1382. flex-direction: column;
  1383. .el-tabs__content {
  1384. flex: 1;
  1385. overflow-y: auto;
  1386. }
  1387. }
  1388. .costBox {
  1389. width: 100%;
  1390. height: 60px;
  1391. background: #fff;
  1392. position: absolute;
  1393. bottom: 0;
  1394. display: flex;
  1395. align-items: center;
  1396. }
  1397. .addTab {
  1398. position: absolute;
  1399. right: 0;
  1400. top: 14px;
  1401. z-index: 20;
  1402. }
  1403. .centerRight {
  1404. width: 300px;
  1405. margin-left: 10px;
  1406. display: flex;
  1407. flex-direction: column;
  1408. position: relative;
  1409. }
  1410. .rightTab {
  1411. height: 40px;
  1412. width: 100%;
  1413. border: 1px solid #d2d2d2;
  1414. box-sizing: border-box;
  1415. p {
  1416. width: 50%;
  1417. height: 40px;
  1418. line-height: 40px;
  1419. text-align: center;
  1420. background: #eee;
  1421. float: left;
  1422. }
  1423. > p:last-child {
  1424. border-left: 1px solid #d2d2d2;
  1425. float: right;
  1426. }
  1427. .activeP {
  1428. background: #409EFF;
  1429. color: #fff;
  1430. }
  1431. }
  1432. .comfirmBox {
  1433. width: 100%;
  1434. height: 60px;
  1435. background: #fff;
  1436. position: absolute;
  1437. bottom: 0;
  1438. display: flex;
  1439. align-items: center;
  1440. justify-content: space-between;
  1441. }
  1442. .mainHeader {
  1443. width: 100%;
  1444. background: #fff;
  1445. position: fixed;
  1446. z-index: 100;
  1447. height: 36px;
  1448. }
  1449. .titleBox {
  1450. position: fixed;
  1451. z-index: 99;
  1452. background: #fff;
  1453. }
  1454. .fixedCell {
  1455. position: fixed;
  1456. z-index: 99;
  1457. right: 30px;
  1458. background: #fff;
  1459. width: 300px;
  1460. display: flex;
  1461. justify-content: space-between;
  1462. }
  1463. </style>
  1464. <style lang="scss">
  1465. .centerLeft {
  1466. .el-form-item__label {
  1467. text-align: left;
  1468. }
  1469. }
  1470. .tabsBox {
  1471. .el-tabs__item {
  1472. padding: 0 10px;
  1473. }
  1474. .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) {
  1475. padding: 0 10px;
  1476. }
  1477. .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 {
  1478. padding: 0 10px;
  1479. }
  1480. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  1481. padding: 0 10px;
  1482. }
  1483. }
  1484. .centerRight {
  1485. .el-tabs__nav-scroll {
  1486. display: flex;
  1487. }
  1488. .el-tabs__nav {
  1489. margin: 0 auto;
  1490. }
  1491. .el-table th .cell, .el-table td .cell {
  1492. padding: 0 2px;
  1493. }
  1494. }
  1495. .preTabs {
  1496. .el-tabs__content {
  1497. }
  1498. }
  1499. .rightTabs {
  1500. height: 100%;
  1501. .el-tabs__content {
  1502. }
  1503. }
  1504. .centerDialog {
  1505. .el-dialog__body {
  1506. max-height: calc(100vh - 100px) !important;
  1507. padding: 0 20px;
  1508. }
  1509. }
  1510. </style>