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

deskPrescription.vue 60KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828
  1. <template>
  2. <div style="height: calc(100% - 56px);display: flex;flex-direction: column;margin-top: 56px;">
  3. <!-- <div style="border-top:1px solid #e5e5e5;margin-top:5px;">
  4. <div class="mainCell" style="margin-bottom:10px;float:right">
  5. <el-button size="small" @click="open(1)" type="primary" style="margin-left:10px;">保存</el-button>
  6. <el-button size="small" @click="open(2)" type="primary">打印</el-button>
  7. <el-button size="small" @click="open(4)" type="primary">选择模板</el-button>
  8. <el-button size="small" @click="open(5)" type="primary">存模板</el-button>
  9. </div>
  10. </div> -->
  11. <!-- <div class="backColor"></div> -->
  12. <div class="mainCenter">
  13. <div class="centerLeft">
  14. <el-form :model="form" ref="form" label-width="80px"
  15. style="display: flex;flex-wrap: wrap;justify-content: space-between;">
  16. <el-form-item label="姓名:" prop="name" label-position="right">
  17. <el-input v-model="patientInfo.name" placeholder="" readonly></el-input>
  18. </el-form-item>
  19. <el-form-item label="证件号: " prop="name" label-position="right">
  20. <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
  21. </el-form-item>
  22. <!--<el-form-item label="挂号类型: " prop="name">-->
  23. <!--<el-input v-model="hisPatientInfo.register_type" placeholder="" readonly></el-input>-->
  24. <!--</el-form-item>-->
  25. <el-form-item label="处方类型: " prop="name" label-position="right">
  26. <el-select style="width:100%;" v-model="register_type" placeholder="">
  27. <el-option
  28. v-for="(item,index) in getDictionaryDataConfig('system','prescription_type')"
  29. :key="index"
  30. :label="item.name"
  31. :value="item.id">
  32. </el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="疾病类型:" prop="name" label-position="right">
  36. <el-select style="width:100%;" v-model="state1" placeholder="">
  37. <el-option
  38. v-for="(item,index) in sick"
  39. :key="index"
  40. :label="item.class_name"
  41. :value="item.id">
  42. </el-option>
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="诊断:" prop="name" label-position="right">
  46. <el-select style="width:100%;" v-model="diagnose" placeholder="">
  47. <el-option
  48. v-for="(item,index) in diagnoses"
  49. :key="index"
  50. :label="item.class_name"
  51. :value="item.id">
  52. </el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item label="过敏病史: " prop="name" label-position="right">
  56. <el-autocomplete
  57. style="width:100%;"
  58. class="inline-input"
  59. v-model="state2"
  60. :fetch-suggestions="querySearch2"
  61. placeholder="请输入内容"
  62. ></el-autocomplete>
  63. </el-form-item>
  64. </el-form>
  65. <div class="tabsBox">
  66. <el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>
  67. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card" closable @tab-remove="removeTab"
  68. :before-leave="moreState" @tab-click="tabclickEvent">
  69. <el-tab-pane
  70. v-for="(item, index) in prescriptions"
  71. :key="index"
  72. :label="item.name"
  73. :name="item.name"
  74. >
  75. </el-tab-pane>
  76. <el-tab-pane name="more" closable><span slot="label"><i class="el-icon-plus" @click="addTab"></i></span>
  77. </el-tab-pane>
  78. <div class="RP">Rp
  79. <div style="float: right;margin-bottom:5px;margin-right:1%;">
  80. <el-button
  81. round
  82. size="small"
  83. @click="openLast(3)"
  84. >上一方
  85. </el-button>
  86. <el-button
  87. round
  88. size="small"
  89. @click="openNext(4)"
  90. >下一方
  91. </el-button>
  92. </div>
  93. </div>
  94. <prescription-table ref="prescription_tables" :prescription="curPrescriptions" :preDrugs="preDrugs"
  95. :activeType="customTabIndex"></prescription-table>
  96. </el-tabs>
  97. </div>
  98. <div class="costBox">
  99. <div>
  100. <span><span style="color: red">*</span>医生:</span>
  101. <el-select style="margin-right:5px;width:140px;" v-model="doctorValue" placeholder=""
  102. @change="changeDoctor">
  103. <el-option
  104. v-for="(item,index) in doctors"
  105. :key="index"
  106. :label="item.user_name"
  107. :value="item.admin_user_id">
  108. </el-option>
  109. </el-select>
  110. <span> <span style="color: red">*</span>科室:</span>
  111. <el-select style="margin-right:5px;width:140px;" v-model="departmentValue" placeholder="">
  112. <el-option
  113. v-for="(item,index) in department"
  114. :key="index"
  115. :label="item.name"
  116. :value="item.id">
  117. </el-option>
  118. </el-select>
  119. <span>当前处方总价:</span>
  120. <span style="color:red;">{{getTotalOne()?getTotalOne():''}}</span>元
  121. <span style="margin-left:10px;">总价:</span>
  122. <span style="color:red;">{{ getTotal()?getTotal():''}}</span>元
  123. </div>
  124. <span :class="order_status == '未收费' ? 'statusRed' : ''">{{order_status}}</span>
  125. </div>
  126. </div>
  127. <div class='centerRight'>
  128. <!-- <div class="rightTab">
  129. <p :class="rightTab == 1 ? 'activeP' : ''" @click="clickTab(1)">药品</p>
  130. <p :class="rightTab == 2 ? 'activeP' : ''" @click="clickTab(2)">项目</p>
  131. </div> -->
  132. <el-tabs class="borderCard" type="border-card" v-model="rightTab" @tab-click="clickTab"
  133. :before-leave='beforeLeave'>
  134. <el-tab-pane label="药品" :name="1">
  135. </el-tab-pane>
  136. <el-tab-pane label="项目" :name="2">
  137. </el-tab-pane>
  138. <div style="height:100%;" v-show="showOne">
  139. <el-tabs class="rightTabs" v-model="activeName">
  140. <el-tab-pane label="药品列表" name="1">
  141. <div style="margin-bottom:5px;display:flex;">
  142. <el-input style="width:50%;" @input="searchAction" @keyup.enter.native='searchAction'
  143. v-model.trim="search_keyword"
  144. placeholder="请输入药品名字"></el-input>
  145. <el-select style="margin-left:5px;width:50%;" v-model="value" placeholder="" @change="changeKind">
  146. <el-option
  147. label="全部"
  148. value="0">
  149. </el-option>
  150. <el-option
  151. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  152. :key="index"
  153. :label="item.name"
  154. :value="item.id">
  155. </el-option>
  156. </el-select>
  157. </div>
  158. <div style="width: 100%;flex:1;overflow: hidden;" ref="rightTable">
  159. <el-table ref="multipleTable" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  160. :data="drugs" border @select='selectDrugs'
  161. :row-style="{ color: '#303133' }"
  162. @select-all="changeAllGoodInfoTableData"
  163. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  164. highlight-current-row>
  165. <el-table-column type="selection" width="40" align="center"></el-table-column>
  166. <el-table-column label="名称">
  167. <template slot-scope="scope">{{ scope.row.drug_name }}</template>
  168. </el-table-column>
  169. <el-table-column label="规格" width="60">
  170. <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
  171. </el-table-column>
  172. <el-table-column label="库存" width="60">
  173. <template slot-scope="scope">{{
  174. stockInCount(scope.row) -
  175. salesReturnCount(scope.row) -
  176. stockOutCount(scope.row) +
  177. cancelStockCount(scope.row)
  178. }}
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="单价" width="40">
  182. <template slot-scope="scope">{{ scope.row.retail_price }}</template>
  183. </el-table-column>
  184. </el-table>
  185. </div>
  186. </el-tab-pane>
  187. <!--<el-tab-pane label="医嘱模板" name="2">-->
  188. <!--<div style="margin-bottom:5px;">-->
  189. <!--&lt;!&ndash;<el-input style="width:50%;" v-model="input" placeholder=""></el-input>&ndash;&gt;-->
  190. <!--<el-select style="float: right;width: 49%;" v-model="value" placeholder="">-->
  191. <!--<el-option-->
  192. <!--v-for="item in options"-->
  193. <!--:key="item.value"-->
  194. <!--:label="item.label"-->
  195. <!--:value="item.value">-->
  196. <!--</el-option>-->
  197. <!--</el-select>-->
  198. <!--</div>-->
  199. <!--<div style="width: 100%;flex:1;overflow-y: auto;">-->
  200. <!--<el-table ref="multipleTableTwo" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"-->
  201. <!--:data="advices_template" border-->
  202. <!--:row-style="{ color: '#303133' }"-->
  203. <!--:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"-->
  204. <!--highlight-current-row-->
  205. <!--@select='selectTemplate'-->
  206. <!--@select-all="changeTemplateData"-->
  207. <!--&gt;-->
  208. <!--<el-table-column type="selection" width="40" align="center"></el-table-column>-->
  209. <!--<el-table-column prop="name" label="名称">-->
  210. <!--<template slot-scope="scope">{{scope.row.name}}</template>-->
  211. <!--</el-table-column>-->
  212. <!--&lt;!&ndash;<el-table-column label="规格" width="60">&ndash;&gt;-->
  213. <!--&lt;!&ndash;<template slot-scope="scope">33</template>&ndash;&gt;-->
  214. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  215. <!--&lt;!&ndash;<el-table-column label="库存" width="60">&ndash;&gt;-->
  216. <!--&lt;!&ndash;<template slot-scope="scope">22</template>&ndash;&gt;-->
  217. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  218. <!--&lt;!&ndash;<el-table-column label="单价" width="40">&ndash;&gt;-->
  219. <!--&lt;!&ndash;<template slot-scope="scope">12</template>&ndash;&gt;-->
  220. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  221. <!--</el-table>-->
  222. <!--</div>-->
  223. <!--</el-tab-pane>-->
  224. </el-tabs>
  225. </div>
  226. <div style="height:100%;" v-show="showTwo">
  227. <el-tabs class="rightTabs" v-model="activeName">
  228. <el-tab-pane label="项目列表" name="1">
  229. <div style="width: 100%;flex:1;overflow-y: auto;">
  230. <el-table ref="tables" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  231. :data="tabProject" border @select='selectChange'
  232. :row-style="{ color: '#303133' }"
  233. @select-all="changeAllGoodInfoTableDataTwo"
  234. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  235. highlight-current-row>
  236. <el-table-column type="selection" width="40" align="center"></el-table-column>
  237. <el-table-column prop="name" label="名称">
  238. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  239. </el-table-column>
  240. <el-table-column label="规格" width="60">
  241. <template slot-scope="scope">{{ scope.row.single_dose }}</template>
  242. </el-table-column>
  243. <el-table-column label="单价" width="40">
  244. <template slot-scope="scope">{{ scope.row.price }}</template>
  245. </el-table-column>
  246. </el-table>
  247. </div>
  248. </el-tab-pane>
  249. <el-tab-pane label="项目组套" name="2">
  250. <div style="width: 100%;flex:1;overflow-y: auto;">
  251. <el-table :data="tabPrjectTeam" border
  252. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  253. :row-style="{ color: '#303133' }"
  254. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  255. highlight-current-row
  256. @select='selectTeam'>
  257. <el-table-column type="selection" width="40" align="center"></el-table-column>
  258. <el-table-column prop="name" label="名称">
  259. <template slot-scope="scope">{{scope.row.project_team}}</template>
  260. </el-table-column>
  261. </el-table>
  262. </div>
  263. </el-tab-pane>
  264. </el-tabs>
  265. </div>
  266. </el-tabs>
  267. <template>
  268. <div class="comfirmBox">
  269. <!-- <div>
  270. <span>药品类型:</span>
  271. <el-select style="margin-right:5px;width:100px;" v-model="value" placeholder="" @change="changeKind">
  272. <el-option
  273. label="全部"
  274. value="0">
  275. </el-option>
  276. <el-option
  277. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  278. :key="index"
  279. :label="item.name"
  280. :value="item.id">
  281. </el-option>
  282. </el-select>
  283. </div> -->
  284. <el-button type="primary" style="width:100%;" @click="comfirm">确定添加</el-button>
  285. </div>
  286. </template>
  287. </div>
  288. </div>
  289. <additionalCharges v-on:setData="setCharge" ref='additionalCharges' :hisPatientInfo="hisPatientInfo"
  290. :patientInfo="patientInfo" :additions="additions"></additionalCharges>
  291. <select-template ref='selectTemplate'></select-template>
  292. <save-template ref='saveTemplate'></save-template>
  293. <next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue"
  294. v-on:cancel="cancel"></next-or-last-prescription>
  295. <!--<next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue" v-on:cancel="cancel"></next-or-last-prescription>-->
  296. <call-prescription ref='call_prescription' v-on:call="call" v-on:call-cancel="callCancel"></call-prescription>
  297. </div>
  298. </template>
  299. <script>
  300. const moment = require('moment')
  301. import {
  302. createHisPrescription,
  303. delHisPrescription,
  304. getCallHisPrescription,
  305. getInitData,
  306. getNextOrLastHisPrescription,
  307. getPatientInfo,
  308. getSchedulePatientList
  309. } from '@/api/his/his'
  310. import {getDictionaryDataConfig} from '@/utils/data'
  311. import prescriptionTable from './prescriptionTable'
  312. import selectTemplate from './selectTemplate'
  313. import saveTemplate from './saveTemplate'
  314. import additionalCharges from './additionalCharges'
  315. import {addProjectTeam, getAllProjectTeam, getHisProject, getPojectListById} from '@/api/project/project'
  316. import {uParseTime} from '@/utils/tools'
  317. import NextOrLastPrescription from "./nextOrLastPrescription";
  318. import CallPrescription from "./callPrescription";
  319. export default {
  320. props: {
  321. patientInfo: Object,
  322. hisPatientInfo: Object,
  323. prescriptions: Array,
  324. record_date: String,
  325. search_keyword: '',
  326. addtions_charge: {
  327. type: Array,
  328. default: []
  329. },
  330. other_sick: {
  331. type: Array,
  332. default: []
  333. },
  334. },
  335. components: {
  336. CallPrescription,
  337. NextOrLastPrescription,
  338. selectTemplate,
  339. saveTemplate,
  340. prescriptionTable,
  341. additionalCharges
  342. },
  343. data() {
  344. return {
  345. register: [
  346. {value: 11, label: "普通门诊"},
  347. {value: 12, label: '门诊挂号'},
  348. {value: 13, label: "急诊"},
  349. {value: 14, label: "门诊慢性病"},
  350. {value: 15, label: "门诊统筹"},
  351. {value: 16, label: "门诊特殊病"},
  352. {value: 21, label: "普通住院"},
  353. ],
  354. isLastOrNextVisible: false,
  355. multipleTableHeight: '',
  356. register_type: '',
  357. value: '0',
  358. form: {
  359. name: ''
  360. },
  361. drugs: [],
  362. allDrugs: [],
  363. advices_template: [],
  364. additions: [],
  365. editableTabsValue: '处方1',
  366. editableTabs: [{
  367. title: '处方1',
  368. name: '1'
  369. }],
  370. tabIndex: this.prescriptions.length,
  371. currenet_inedx: 0,
  372. rightTab: 1,
  373. activeName: '1',
  374. curPrescriptions: this.prescriptions[0],
  375. drugTableData: [],
  376. preDrugs: [],
  377. curDrugs: [],
  378. doctorOptions: [],
  379. doctorValue: '',
  380. departmentOptions: [],
  381. departmentValue: '',
  382. total: 0,
  383. state1: '',
  384. request_record_date: '',
  385. state2: '',
  386. customTabIndex: 1,
  387. options: [],
  388. tabProject: [],
  389. strids: '',
  390. showOne: true,
  391. showTwo: false,
  392. tableData: [],
  393. tabPrjectTeam: [],
  394. teamList: [],
  395. doctors: [],
  396. departMent: [],
  397. curStatus: 0,
  398. order_status: '',
  399. register_types: [
  400. {id: 1, name: '医保'},
  401. {id: 2, name: '自费'}
  402. ],
  403. department: [],
  404. sick: [],
  405. diagnoses: [],
  406. diagnose: '',
  407. curTotal: 0,
  408. prescription_id: 0,
  409. tempDrugs: []
  410. }
  411. },
  412. methods: {
  413. call(val){
  414. this.prescriptions = []
  415. this.prescriptions = val
  416. for (let i = 0; i < this.prescriptions.length; i++) {
  417. this.prescriptions[i].name = "处方" + (i + 1)
  418. if (i == 0) {
  419. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  420. this.customTabIndex = 1
  421. this.curStatus = 1
  422. this.rightTab = 1
  423. this.showOne = true
  424. this.showTwo = false
  425. }
  426. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  427. this.customTabIndex = 2
  428. this.curStatus = 2
  429. this.rightTab = 2
  430. this.showTwo = true
  431. this.showOne = false
  432. }
  433. }
  434. }
  435. this.curPrescriptions = this.prescriptions[0]
  436. this.$refs.call_prescription.close()
  437. this.$emit('setData',this.prescriptions)
  438. },
  439. callCancel(){
  440. this.$refs.call_prescription.close()
  441. },
  442. cancel() {
  443. this.$refs.next_or_last_prescription.close()
  444. this.request_record_date = this.record_date
  445. },
  446. setValue(val) {
  447. this.prescriptions = []
  448. this.prescriptions = val
  449. this.$refs.next_or_last_prescription.close()
  450. for (let i = 0; i < this.prescriptions.length; i++) {
  451. this.prescriptions[i].name = "处方" + (i + 1)
  452. if (i == 0) {
  453. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  454. this.customTabIndex = 1
  455. this.curStatus = 1
  456. this.rightTab = 1
  457. this.showOne = true
  458. this.showTwo = false
  459. }
  460. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  461. this.customTabIndex = 2
  462. this.curStatus = 2
  463. this.rightTab = 2
  464. this.showTwo = true
  465. this.showOne = false
  466. }
  467. }
  468. }
  469. this.curPrescriptions = this.prescriptions[0]
  470. this.request_record_date = this.record_date
  471. this.$emit('setData',this.prescriptions)
  472. },
  473. GetNextOrLastHisPrescription(params) {
  474. getNextOrLastHisPrescription(params).then(response => {
  475. if (response.data.state == 1) {
  476. this.$refs.next_or_last_prescription.show(response.data.data.prescriptions, this.patientInfo.name, this.patientInfo.id, this.prescriptions)
  477. this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
  478. } else {
  479. this.$message.error(response.data.msg)
  480. }
  481. })
  482. },
  483. openLast(val) {
  484. if (this.curPrescriptions.order_status == 2) {
  485. this.$message.error('处方已经结算,无法添加')
  486. return
  487. }
  488. if (this.patientInfo.id == 0) {
  489. this.$message.error('请选择患者')
  490. return
  491. }
  492. if (val == 1) {
  493. this.isVisibility = false
  494. this.request_record_date = this.record_date
  495. let params = {
  496. patient_id: this.patientInfo.id,
  497. record_time: this.request_record_date,
  498. type: 1
  499. }
  500. this.GetNextOrLastHisPrescription(params)
  501. } else if (val == 3) {
  502. let params = {
  503. patient_id: this.patientInfo.id,
  504. record_time: this.request_record_date,
  505. type: 1
  506. }
  507. this.GetNextOrLastHisPrescription(params)
  508. }
  509. },
  510. openNext(val) {
  511. if (this.curPrescriptions.order_status == 2) {
  512. this.$message.error('处方已经结算,无法添加')
  513. return
  514. }
  515. if (this.patientInfo.id == 0) {
  516. this.$message.error('请选择患者')
  517. return
  518. }
  519. if (val == 2) {
  520. this.isVisibility = false
  521. this.request_record_date = this.record_date
  522. let params = {
  523. patient_id: this.patientInfo.id,
  524. record_time: this.request_record_date,
  525. type: 2
  526. }
  527. this.GetNextOrLastHisPrescription(params)
  528. } else if (val == 4) {
  529. let params = {
  530. patient_id: this.patientInfo.id,
  531. record_time: this.request_record_date,
  532. type: 2
  533. }
  534. this.GetNextOrLastHisPrescription(params)
  535. }
  536. },
  537. selectTemplate(selection, row) {
  538. this.tempDrugs = selection
  539. }, changeTemplateData(selection) {
  540. this.tempDrugs = selection
  541. },
  542. stockInCount: function (row) {
  543. let total = 0;
  544. if (row.stock_in != null) {
  545. for (let i = 0; i < row.stock_in.length; i++) {
  546. total = total + row.stock_in[i].warehousing_count;
  547. }
  548. }
  549. return total;
  550. },
  551. salesReturnCount: function (row) {
  552. let total = 0;
  553. if (row.sales_return != null) {
  554. for (let i = 0; i < row.sales_return.length; i++) {
  555. total = total + row.sales_return[i].count;
  556. }
  557. }
  558. return total;
  559. },
  560. stockOutCount: function (row) {
  561. let total = 0;
  562. if (row.stock_out != null) {
  563. for (let i = 0; i < row.stock_out.length; i++) {
  564. total = total + row.stock_out[i].count;
  565. }
  566. }
  567. return total;
  568. },
  569. cancelStockCount: function (row) {
  570. let total = 0;
  571. if (row.cancel_stock != null) {
  572. for (let i = 0; i < row.cancel_stock.length; i++) {
  573. total = total + row.cancel_stock[i].count;
  574. }
  575. }
  576. return total;
  577. },
  578. setCharge(additional_charges) {
  579. for (let i = 0; i < additional_charges.length; i++) {
  580. additional_charges[i].count = 1
  581. this.curPrescriptions.addition.push(additional_charges[i])
  582. }
  583. this.$refs.additionalCharges.hide()
  584. },
  585. searchAction() {
  586. if (this.search_keyword.length == 0) {
  587. this.drugs = this.allDrugs
  588. } else {
  589. let arr = []
  590. for (let i = 0; i < this.drugs.length; i++) {
  591. if (this.drugs[i].drug_name.indexOf(this.search_keyword) != -1) {
  592. arr = arr.concat(this.drugs[i])
  593. }
  594. }
  595. this.drugs = arr
  596. }
  597. },
  598. getTotalOne() {
  599. var total = 0
  600. console.log(this.prescriptions)
  601. for (let i = 0; i < this.prescriptions.length; i++) {
  602. if (this.prescriptions[i].name == this.editableTabsValue) {
  603. if (this.prescriptions[i].advices != null) {
  604. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  605. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  606. }
  607. }
  608. if (this.prescriptions[i].project != null) {
  609. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  610. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  611. }
  612. }
  613. if (this.prescriptions[i].addition != null) {
  614. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  615. total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
  616. }
  617. }
  618. total = Math.floor(total * 100) / 100
  619. }
  620. }
  621. return total
  622. },
  623. getCurTotal() {
  624. var total = 0
  625. if (this.curPrescriptions.type == 1) {
  626. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  627. total = total + this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number
  628. }
  629. return Math.floor(total * 100) / 100
  630. } else {
  631. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  632. total = total + this.curPrescriptions.project[a].price * this.curPrescriptions.project[a].total
  633. }
  634. return Math.floor(total * 100) / 100
  635. }
  636. },
  637. getTotal() {
  638. var total = 0
  639. for (let i = 0; i < this.prescriptions.length; i++) {
  640. if (this.prescriptions[i].advices != null) {
  641. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  642. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  643. }
  644. }
  645. if (this.prescriptions[i].project != null) {
  646. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  647. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  648. }
  649. }
  650. if (this.prescriptions[i].addition != null) {
  651. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  652. total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
  653. }
  654. }
  655. }
  656. return Math.floor(total * 100) / 100
  657. },
  658. createFilter(queryString) {
  659. return (restaurant) => {
  660. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  661. }
  662. },
  663. querySearch2(queryString, cb) {
  664. var restaurants = this.other_sick
  665. restaurants.map(item => {
  666. item.value = item.name
  667. })
  668. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  669. // 调用 callback 返回建议列表的数据
  670. cb(results)
  671. },
  672. changeKind(val) {
  673. this.drugs = []
  674. if (val == 0) {
  675. this.drugs = this.allDrugs
  676. } else {
  677. for (let i = 0; i < this.allDrugs.length; i++) {
  678. if (this.allDrugs[i].drug_type == val) {
  679. this.drugs.push(this.allDrugs[i])
  680. }
  681. }
  682. }
  683. },
  684. getDictionaryDataConfig(module, filed_name) {
  685. return getDictionaryDataConfig(module, filed_name)
  686. },
  687. getInitData() {
  688. getInitData().then(response => {
  689. if (response.data.state == 0) {
  690. this.$message.error(response.data.msg)
  691. return false
  692. } else {
  693. this.drugs = response.data.data.drugs
  694. this.allDrugs = response.data.data.drugs
  695. this.advices_template = response.data.data.advices_template
  696. this.doctors = response.data.data.doctors
  697. this.department = response.data.data.department
  698. this.sick = response.data.data.sick
  699. this.diagnoses = response.data.data.diagnose
  700. this.additions = response.data.data.additions
  701. // var info = response.data.data.info
  702. // if (info.user_type == 2 || info.user_type == 1) {
  703. // this.doctorValue = info.admin_user_id
  704. // if (info.department_id == 0) {
  705. // if (this.department.length > 0) {
  706. // this.departmentValue = this.department[0].id
  707. // } else {
  708. // this.departmentValue = ''
  709. //
  710. // }
  711. // } else {
  712. // this.departmentValue = info.department_id
  713. // }
  714. // }else{
  715. // this.doctorValue = this.doctors[0].admin_user_id
  716. // }
  717. }
  718. })
  719. },
  720. tabclickEvent(val) {
  721. for (let i = 0; i < this.prescriptions.length; i++) {
  722. console.log(this.prescriptions[i].name)
  723. if (this.prescriptions[i].name == val.name) {
  724. console.log("2323323", this.prescriptions)
  725. this.prescription_id = this.prescriptions[i].id
  726. this.$emit('event1', this.prescription_id)
  727. this.curPrescriptions = this.prescriptions[i]
  728. this.teamList = []
  729. this.curDrugs = []
  730. this.$refs.multipleTable.clearSelection()
  731. this.$refs.tables.clearSelection()
  732. //用来区分处方属于项目还是药品
  733. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  734. this.customTabIndex = 1
  735. this.curStatus = 1
  736. this.rightTab = 1
  737. this.showOne = true
  738. this.showTwo = false
  739. }
  740. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  741. this.customTabIndex = 2
  742. this.curStatus = 2
  743. this.rightTab = 2
  744. this.showTwo = true
  745. this.showOne = false
  746. }
  747. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  748. this.customTabIndex = this.rightTab
  749. this.curStatus = 0
  750. }
  751. }
  752. }
  753. },
  754. clearData() {
  755. this.curPrescriptions = []
  756. this.curStatus = 0
  757. this.curDrugs = []
  758. this.preDrugs = []
  759. this.teamList = []
  760. },
  761. setData(data, info, admin_info, doctors, department, hisPatientInfo) {
  762. this.prescription_id = data[0].id
  763. this.editableTabsValue = "处方1"
  764. this.$emit('event1', this.prescription_id)
  765. this.curStatus = 0
  766. this.prescriptions = data
  767. this.curPrescriptions = this.prescriptions[0]
  768. this.diagnose = info.diagnosis
  769. if (this.diagnose == 0) {
  770. this.diagnose = ""
  771. }
  772. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  773. this.curStatus = 1
  774. this.customTabIndex = 1
  775. this.rightTab = 1
  776. this.showOne = true
  777. this.showTwo = false
  778. }
  779. if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
  780. this.curStatus = 2
  781. this.customTabIndex = 2
  782. this.rightTab = 2
  783. this.showOne = false
  784. this.showTwo = true
  785. }
  786. this.state1 = info.sick_type
  787. if (this.state1 == 0) {
  788. this.state1 = ""
  789. }
  790. this.state2 = info.sick_history
  791. if (this.state2 == 0) {
  792. this.state2 = ""
  793. }
  794. // this.register_type = info.register_type
  795. if (info.prescription_status == 0) {
  796. this.order_status = ''
  797. }
  798. if (info.prescription_status == 1 || info.prescription_status == 2) {
  799. this.order_status = '未收费'
  800. }
  801. if (info.prescription_status == 3) {
  802. this.order_status = '已结算'
  803. }
  804. if (info.prescription_status == 4) {
  805. this.order_status = '已退费'
  806. }
  807. console.log(info)
  808. if (info.id > 0) {
  809. this.doctorValue = info.doctor_id
  810. this.departmentValue = info.department
  811. } else {
  812. if (hisPatientInfo.doctor != 0 && hisPatientInfo.department != 0) {
  813. this.doctorValue = hisPatientInfo.doctor
  814. this.departmentValue = hisPatientInfo.department
  815. } else {
  816. if (admin_info.user_type == 2 || admin_info.user_type == 1) {
  817. this.doctorValue = admin_info.admin_user_id
  818. if (admin_info.department_id == 0) {
  819. if (this.department.length > 0) {
  820. if (department && department.length > 0) {
  821. this.departmentValue = department[0].id
  822. } else {
  823. this.departmentValue = ''
  824. }
  825. } else {
  826. this.departmentValue = ''
  827. }
  828. } else {
  829. this.departmentValue = admin_info.department_id
  830. }
  831. } else {
  832. this.doctorValue = doctors[0].admin_user_id
  833. }
  834. if (this.doctorValue == 0) {
  835. this.doctorValue = ''
  836. }
  837. }
  838. }
  839. if (info.register_type == 0) {
  840. // if(hisPatientInfo.register_type != 0){
  841. // this.register_type = hisPatientInfo.register_type
  842. // }else{
  843. this.register_type = ''
  844. // }
  845. } else {
  846. this.register_type = info.register_type
  847. }
  848. },
  849. moreState(tab, event) {
  850. if (tab == 'more') {
  851. return false
  852. }
  853. },open_two(){
  854. if (this.curPrescriptions.order_status == 2) {
  855. this.$message.error('处方已经结算,无法添加')
  856. return
  857. }
  858. if (this.patientInfo == null || this.patientInfo.id == 0) {
  859. this.$message.error('请选择患者')
  860. return
  861. }
  862. let params = {
  863. end_time: this.record_date,
  864. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  865. patient_id: this.patientInfo.id
  866. }
  867. getCallHisPrescription(params).then(response => {
  868. if (response.data.state == 1) {
  869. this.$refs.call_prescription.show(this.patientInfo.name, this.patientInfo.id,params.end_time, params.start_time,this.prescriptions,response.data.data.prescriptions)
  870. } else {
  871. this.$message.error(response.data.msg)
  872. }
  873. })
  874. },
  875. open(index, isLoading) {
  876. if (this.curPrescriptions.order_status == 2) {
  877. this.$message.error('当前处方已经结算,无法保存')
  878. return
  879. }
  880. if (this.doctorValue.length <= 0) {
  881. this.$message.error('医生不能为空')
  882. return
  883. }
  884. if (this.departmentValue.length <= 0) {
  885. this.$message.error('科室不能为空')
  886. return
  887. }
  888. if (index == 1) {
  889. let params = {
  890. patient_id: this.patientInfo.id,
  891. diagnose: this.diagnose,
  892. sick_type: this.state1,
  893. sick_history: this.state2,
  894. doctor: this.doctorValue,
  895. department: this.departmentValue,
  896. record_date: this.record_date,
  897. his_patient_id: this.hisPatientInfo.id,
  898. reg_type: this.register_type
  899. }
  900. for (let i = 0; i < this.prescriptions.length; i++) {
  901. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  902. this.prescriptions[i]['type'] = 1
  903. }
  904. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  905. this.prescriptions[i]['type'] = 2
  906. }
  907. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  908. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  909. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  910. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  911. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  912. }
  913. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  914. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  915. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  916. }
  917. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  918. this.prescriptions[i].addition[b].id = parseInt(this.prescriptions[i].addition[b].id)
  919. this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
  920. this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
  921. this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
  922. }
  923. }
  924. let data = {
  925. 'prescriptions': this.prescriptions
  926. }
  927. isLoading = true
  928. console.log("prescriptions9999",this.prescriptions)
  929. console.log("params---",params)
  930. createHisPrescription(data, params).then(response => {
  931. if (response.data.state == 1) {
  932. this.$emit("change")
  933. this.$message.success('保存成功')
  934. }
  935. })
  936. } else if (index == 2) {
  937. this.$router.push('/outpatientDoctorStation/print')
  938. } else if (index == 4) {
  939. } else if (index == 5) {
  940. this.$refs.saveTemplate.show()
  941. }
  942. },
  943. addTab(targetName) {
  944. if (this.curPrescriptions.order_status >= 2) {
  945. this.$message.error('该处方已经结算或者退费,无法继续添加处方')
  946. return
  947. }
  948. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  949. this.$message.error('当前处方无数据,新增数据后才能新增处方')
  950. return
  951. }
  952. this.tabIndex = this.prescriptions.length
  953. ++this.tabIndex
  954. let newTabName = '处方' + this.tabIndex
  955. this.prescriptions.push({
  956. id: 0,
  957. name: newTabName,
  958. order_status: 0,
  959. advices: [],
  960. project: [],
  961. addition: []
  962. })
  963. this.editableTabsValue = newTabName
  964. this.curPrescriptions = this.prescriptions[this.prescriptions.length - 1]
  965. this.curStatus = 0
  966. },
  967. removeTab(targetName) {
  968. if (this.curPrescriptions.order_status == 2) {
  969. this.$message.error('该处方已经结算,无法删除')
  970. return
  971. }
  972. if (targetName == '处方1') {
  973. this.$message.error('该处方无法删除')
  974. return
  975. }
  976. this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
  977. confirmButtonText: '确 定',
  978. cancelButtonText: '取 消',
  979. type: 'warning'
  980. }).then(() => {
  981. let id = 0
  982. for (let i = 0; i < this.prescriptions.length; i++) {
  983. if (this.prescriptions[i].name == targetName) {
  984. id = this.prescriptions[i].id
  985. }
  986. }
  987. if (id == 0) {
  988. let tabs = this.prescriptions
  989. let activeName = this.editableTabsValue
  990. if (activeName === targetName) {
  991. tabs.forEach((tab, index) => {
  992. if (tab.name === targetName) {
  993. let nextTab = tabs[index + 1] || tabs[index - 1]
  994. if (nextTab) {
  995. activeName = nextTab.name
  996. }
  997. }
  998. })
  999. }
  1000. this.editableTabsValue = activeName
  1001. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1002. for (let i = 0; i < this.prescriptions.length; i++) {
  1003. if (activeName == this.prescriptions[i].name) {
  1004. this.curPrescriptions = this.prescriptions[i]
  1005. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1006. this.curStatus = 1
  1007. }
  1008. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1009. this.curStatus = 2
  1010. }
  1011. }
  1012. }
  1013. if (this.prescriptions.length == 0) {
  1014. this.curPrescriptions = []
  1015. this.curStatus = 0
  1016. }
  1017. } else {
  1018. let params = {
  1019. 'id': id
  1020. }
  1021. delHisPrescription(params).then(response => {
  1022. if (response.data.state == 1) {
  1023. this.$message.success('删除成功')
  1024. let tabs = this.prescriptions
  1025. let activeName = this.editableTabsValue
  1026. if (activeName === targetName) {
  1027. tabs.forEach((tab, index) => {
  1028. if (tab.name === targetName) {
  1029. let nextTab = tabs[index + 1] || tabs[index - 1]
  1030. if (nextTab) {
  1031. activeName = nextTab.name
  1032. }
  1033. }
  1034. })
  1035. }
  1036. this.editableTabsValue = activeName
  1037. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1038. for (let i = 0; i < this.prescriptions.length; i++) {
  1039. if (activeName == this.prescriptions[i].name) {
  1040. this.curPrescriptions = this.prescriptions[i]
  1041. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1042. this.curStatus = 1
  1043. }
  1044. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1045. this.curStatus = 2
  1046. }
  1047. }
  1048. }
  1049. if (this.prescriptions.length == 0) {
  1050. this.curPrescriptions = []
  1051. this.curStatus = 0
  1052. }
  1053. } else {
  1054. this.$message.success(response.data.msg)
  1055. }
  1056. })
  1057. }
  1058. }).catch(() => {
  1059. })
  1060. },
  1061. beforeLeave(activeName, oldActiveName) {
  1062. let index = activeName
  1063. if (index == 1) {
  1064. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1065. return false
  1066. }
  1067. } else {
  1068. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1069. return false
  1070. }
  1071. }
  1072. },
  1073. clickTab(tab) {
  1074. let index = parseInt(tab.name)
  1075. if (index == 1) {
  1076. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1077. this.$message.error('当前处方为项目,无法切换为药品,需要新开处方')
  1078. return
  1079. }
  1080. } else {
  1081. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1082. this.$message.error('当前处方为药品,无法切换为项目,需要新开处方')
  1083. return
  1084. }
  1085. }
  1086. if (index == 1) {
  1087. this.teamList = []
  1088. this.$refs.tables.clearSelection()
  1089. this.showOne = true
  1090. this.showTwo = false
  1091. this.$nextTick(() => {
  1092. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1093. })
  1094. this.customTabIndex = 1
  1095. }
  1096. if (index == 2) {
  1097. this.curDrugs = []
  1098. this.$refs.multipleTable.clearSelection()
  1099. this.showTwo = true
  1100. this.showOne = false
  1101. this.$nextTick(() => {
  1102. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1103. })
  1104. this.customTabIndex = 2
  1105. }
  1106. this.rightTab = index
  1107. //用来区分处方属于项目还是药品
  1108. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1109. this.customTabIndex = 1
  1110. this.curStatus = 1
  1111. }
  1112. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1113. this.customTabIndex = 2
  1114. this.curStatus = 2
  1115. }
  1116. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1117. // this.customTabIndex = this.rightTab
  1118. this.customTabIndex = index
  1119. this.curStatus = 0
  1120. }
  1121. }, changeAllGoodInfoTableData: function (selection) {
  1122. this.curDrugs = selection
  1123. }, addCharges() {
  1124. this.$refs.additionalCharges.show()
  1125. },
  1126. selectDrugs(selection, row) {
  1127. this.curDrugs = selection
  1128. },
  1129. comfirm() {
  1130. if (this.curPrescriptions.order_status >= 2) {
  1131. this.$message.error('该处方已经结算或者退费,无法继续添加药品或者项目')
  1132. this.teamList = []
  1133. this.curDrugs = []
  1134. this.tempDrugs = []
  1135. this.$refs.tables.clearSelection()
  1136. this.$refs.multipleTableTwo.clearSelection()
  1137. this.$refs.multipleTable.clearSelection()
  1138. return
  1139. }
  1140. if (this.curStatus == 1 && this.rightTab == 2) {
  1141. this.$message.error('改处方是药品,无法添加项目')
  1142. this.teamList = []
  1143. this.$refs.tables.clearSelection()
  1144. return
  1145. }
  1146. if (this.curStatus == 2 && this.rightTab == 1) {
  1147. this.$message.error('改处方是项目,无法添加药品')
  1148. this.curDrugs = []
  1149. this.tempDrugs = []
  1150. this.$refs.multipleTable.clearSelection()
  1151. this.$refs.multipleTableTwo.clearSelection()
  1152. return
  1153. }
  1154. for (let i = 0; i < this.teamList.length; i++) {
  1155. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  1156. if (this.teamList[i].id == this.curPrescriptions.project[a].project_id) {
  1157. this.$message.error('改处方存在相同的项目,无法添加相同的项目')
  1158. return
  1159. }
  1160. }
  1161. }
  1162. for (let i = 0; i < this.curDrugs.length; i++) {
  1163. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1164. if (this.curDrugs[i].id == this.curPrescriptions.advices[i].id) {
  1165. this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  1166. return
  1167. }
  1168. }
  1169. }
  1170. let templateDrugs = []
  1171. for (let i = 0; i < this.tempDrugs.length; i++) {
  1172. for (let a = 0; a < this.tempDrugs[i].advices.length; a++) {
  1173. templateDrugs.push(this.tempDrugs[i].advices[a])
  1174. }
  1175. }
  1176. // for (let i = 0; i < templateDrugs.length; i++) {
  1177. // for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1178. // if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
  1179. // this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  1180. // return
  1181. //
  1182. // }
  1183. // }
  1184. // }
  1185. for (let i = 0; i < this.prescriptions.length; i++) {
  1186. if (this.prescriptions[i].name == this.editableTabsValue) {
  1187. var temp = this.deepClone(this.curDrugs)
  1188. var temp2 = this.deepClone(this.teamList)
  1189. var temp3 = this.deepClone(templateDrugs)
  1190. if (temp3.length > 0) {
  1191. for (let b = 0; b < temp3.length; b++) {
  1192. let obj = {
  1193. advice_id: 0,
  1194. id: temp3[b].id,
  1195. drug_name: temp3[b].advice_name,
  1196. single_dose: temp3[b].single_dose,
  1197. delivery_way: temp3[b].delivery_way,
  1198. execution_frequency: temp3[b].execution_frequency,
  1199. retail_price: temp3[b].drug.retail_price.toString(),
  1200. remark: '',
  1201. day: 1,
  1202. prescribing_number: temp3[b].prescribing_number,
  1203. single_dose_unit: temp3[b].drug.min_unit,
  1204. prescribing_number_unit: temp3[b].drug.max_unit,
  1205. medical_insurance_number: temp3[b].drug.medical_insurance_number
  1206. }
  1207. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  1208. obj.prescribing_number = 1
  1209. }
  1210. this.prescriptions[i].advices.push(obj)
  1211. }
  1212. this.curStatus = 1
  1213. }
  1214. if (temp.length > 0) {
  1215. for (let b = 0; b < temp.length; b++) {
  1216. let obj = {
  1217. advice_id: 0,
  1218. id: temp[b].id,
  1219. drug_name: temp[b].drug_name,
  1220. single_dose: temp[b].single_dose,
  1221. delivery_way: temp[b].delivery_way,
  1222. execution_frequency: temp[b].execution_frequency,
  1223. retail_price: temp[b].retail_price.toString(),
  1224. remark: '',
  1225. day: 1,
  1226. prescribing_number: temp[b].prescribing_number,
  1227. single_dose_unit: temp[b].min_unit,
  1228. prescribing_number_unit: temp[b].max_unit,
  1229. medical_insurance_number: temp[b].medical_insurance_number
  1230. }
  1231. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  1232. obj.prescribing_number = 1
  1233. }
  1234. this.prescriptions[i].advices.push(obj)
  1235. }
  1236. this.curStatus = 1
  1237. }
  1238. if (temp2.length > 0) {
  1239. for (let b = 0; b < temp2.length; b++) {
  1240. let obj = {
  1241. id: 0,
  1242. project_id: temp2[b].id,
  1243. project_name: temp2[b].project_name,
  1244. statistical_classification: temp2[b].statistical_classification,
  1245. single_dose: temp2[b].single_dose,
  1246. delivery_way: temp2[b].delivery_way,
  1247. execution_frequency: temp2[b].execution_frequency,
  1248. number_days: temp2[b].number_days,
  1249. total: temp2[b].total,
  1250. price: temp2[b].price,
  1251. remark: '',
  1252. medical_code: temp2[b].medical_code,
  1253. unit: temp2[b].unit
  1254. }
  1255. if (obj.total == 0) {
  1256. obj.total = 1
  1257. }
  1258. this.prescriptions[i].project.push(obj)
  1259. }
  1260. this.curStatus = 2
  1261. }
  1262. this.curPrescriptions = this.prescriptions[i]
  1263. this.$refs.multipleTable.clearSelection()
  1264. this.$refs.tables.clearSelection()
  1265. }
  1266. }
  1267. this.curDrugs = []
  1268. this.preDrugs = []
  1269. this.teamList = []
  1270. }, changeAllGoodInfoTableDataTwo(row) {
  1271. this.teamList = row
  1272. },
  1273. selectChange(row) {
  1274. this.teamList = row
  1275. },
  1276. getlist() {
  1277. getHisProject().then(response => {
  1278. if (response.data.state == 1) {
  1279. var project = response.data.data.project
  1280. console.log('project', project)
  1281. this.tabProject = project
  1282. }
  1283. })
  1284. }, deepClone(source) {
  1285. if (!source && typeof source !== 'object') {
  1286. throw new Error('error arguments', 'shallowClone')
  1287. }
  1288. const targetObj = source.constructor === Array ? [] : {}
  1289. Object.keys(source).forEach((keys) => {
  1290. if (source[keys] && typeof source[keys] === 'object') {
  1291. targetObj[keys] = this.deepClone(source[keys])
  1292. } else {
  1293. targetObj[keys] = source[keys]
  1294. }
  1295. })
  1296. return targetObj
  1297. },
  1298. getAllProjectTeam() {
  1299. getAllProjectTeam().then(response => {
  1300. if (response.data.state == 1) {
  1301. var team = response.data.data.team
  1302. console.log('team', team)
  1303. this.tabPrjectTeam = team
  1304. }
  1305. })
  1306. },
  1307. selectTeam(row) {
  1308. console.log('row------', row)
  1309. var arr = []
  1310. for (let i = 0; i < row.length; i++) {
  1311. arr.push(row[i].project_id)
  1312. }
  1313. var ids = arr.join(',')
  1314. var strArr = ids.split(',')
  1315. var res = []//接收不重复的数据
  1316. for (var i = 0; i < strArr.length; i++) {
  1317. var flag = true
  1318. for (var j = 0; j < i; j++) {
  1319. if (strArr[i] === strArr[j]) {
  1320. flag = false
  1321. break
  1322. }
  1323. }
  1324. if (flag) {
  1325. res.push(strArr[i])
  1326. }
  1327. }
  1328. var idstr = res.join(',')
  1329. const params = {
  1330. project_id: idstr
  1331. }
  1332. console.log('params', params)
  1333. getPojectListById(params).then(response => {
  1334. if (response.data.state == 1) {
  1335. var project = response.data.data.project
  1336. console.log('project222', project)
  1337. this.teamList = []
  1338. this.teamList = project
  1339. }
  1340. })
  1341. }, changeDoctor(val) {
  1342. for (let i = 0; i < this.doctors.length; i++) {
  1343. if (this.doctors[i].admin_user_id == this.doctorValue) {
  1344. this.departmentValue = this.doctors[i].department_id
  1345. }
  1346. }
  1347. if (this.departmentValue == 0) {
  1348. this.departmentValue = ""
  1349. }
  1350. }
  1351. }, mounted() {
  1352. this.request_record_date = this.record_date
  1353. this.getInitData()
  1354. //获取所有项目
  1355. this.getlist()
  1356. //获取所以项目组套
  1357. this.getAllProjectTeam()
  1358. this.$nextTick(() => {
  1359. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  1360. })
  1361. },
  1362. watch: {
  1363. fullHeight(val) {
  1364. if (!this.timer) {
  1365. this.fullHeight = val
  1366. let tableHeight = val - 263
  1367. this.tableHeight = tableHeight
  1368. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  1369. this.timer = true
  1370. let that = this
  1371. setTimeout(function () {
  1372. that.timer = false
  1373. }, 400)
  1374. }
  1375. }
  1376. },
  1377. }
  1378. </script>
  1379. <style lang="scss" scoped>
  1380. .new-main-contain {
  1381. height: 100%;
  1382. display: flex;
  1383. flex-direction: column;
  1384. }
  1385. .app-container {
  1386. height: 100%;
  1387. }
  1388. .mainCell {
  1389. height: 36px;
  1390. display: flex;
  1391. align-items: center;
  1392. }
  1393. .mainLeft {
  1394. width: 200px;
  1395. height: 100%;
  1396. display: flex;
  1397. flex-direction: column;
  1398. margin-top: 2px;
  1399. .el-radio {
  1400. margin-right: 5px;
  1401. }
  1402. }
  1403. .mainRight {
  1404. margin-left: 20px;
  1405. flex: 1;
  1406. height: 100%;
  1407. display: flex;
  1408. flex-direction: column;
  1409. .cellSpan {
  1410. min-width: 80px;
  1411. display: inline-block;
  1412. margin-right: 10px;
  1413. }
  1414. }
  1415. .mainCenter {
  1416. display: flex;
  1417. flex: 1;
  1418. height: 100%;
  1419. }
  1420. .centerLeft {
  1421. flex: 1;
  1422. display: flex;
  1423. flex-direction: column;
  1424. position: relative;
  1425. .el-form-item {
  1426. width: 33%;
  1427. margin-bottom: 14px;
  1428. }
  1429. .el-form-item__label {
  1430. text-align: left;
  1431. }
  1432. }
  1433. .backColor {
  1434. background: #f6f8f9;
  1435. height: 5px;
  1436. margin-bottom: 5px;
  1437. }
  1438. .RP {
  1439. color: #409EFF;
  1440. font-size: 14px;
  1441. margin-bottom: 5px;
  1442. }
  1443. .tabsBox {
  1444. position: relative;
  1445. flex: 1;
  1446. overflow-y: auto;
  1447. margin-bottom: 60px;
  1448. margin-top: 4px;
  1449. .el-tabs__item {
  1450. padding: 0 10px;
  1451. }
  1452. }
  1453. .preTabs {
  1454. height: 100%;
  1455. display: flex;
  1456. flex-direction: column;
  1457. .el-tabs__content {
  1458. flex: 1;
  1459. overflow-y: auto;
  1460. }
  1461. }
  1462. .costBox {
  1463. width: 100%;
  1464. height: 60px;
  1465. background: #fff;
  1466. position: absolute;
  1467. bottom: 0;
  1468. display: flex;
  1469. align-items: center;
  1470. justify-content: space-between;
  1471. }
  1472. .statusRed {
  1473. color: red;
  1474. }
  1475. .addTab {
  1476. position: absolute;
  1477. right: 8px;
  1478. top: 3px;
  1479. z-index: 20;
  1480. }
  1481. .centerRight {
  1482. width: 300px;
  1483. margin-left: 10px;
  1484. display: flex;
  1485. flex-direction: column;
  1486. position: relative;
  1487. }
  1488. .rightTab {
  1489. height: 40px;
  1490. width: 100%;
  1491. border: 1px solid #d2d2d2;
  1492. box-sizing: border-box;
  1493. p {
  1494. width: 50%;
  1495. height: 40px;
  1496. line-height: 40px;
  1497. text-align: center;
  1498. background: #eee;
  1499. float: left;
  1500. }
  1501. > p:last-child {
  1502. border-left: 1px solid #d2d2d2;
  1503. float: right;
  1504. }
  1505. .activeP {
  1506. background: #409EFF;
  1507. color: #fff;
  1508. }
  1509. }
  1510. .rightTabs {
  1511. display: flex;
  1512. flex-direction: column;
  1513. }
  1514. .comfirmBox {
  1515. width: 100%;
  1516. height: 60px;
  1517. background: #fff;
  1518. position: absolute;
  1519. bottom: 0;
  1520. display: flex;
  1521. align-items: center;
  1522. justify-content: space-between;
  1523. z-index: 99;
  1524. }
  1525. .borderCard {
  1526. height: 100%;
  1527. display: flex;
  1528. flex-direction: column;
  1529. margin-bottom: 60px;
  1530. .el-tabs--border-card > .el-tabs__content {
  1531. padding: 0;
  1532. }
  1533. }
  1534. </style>
  1535. <style lang="scss">
  1536. .borderCard {
  1537. .el-tabs__nav {
  1538. width: 100%;
  1539. }
  1540. .el-tabs__item {
  1541. width: 50%;
  1542. text-align: center;
  1543. }
  1544. .el-tabs__content {
  1545. padding: 5px;
  1546. flex: 1;
  1547. }
  1548. }
  1549. .centerLeft {
  1550. .el-form-item__label {
  1551. text-align: left;
  1552. }
  1553. }
  1554. .tabsBox {
  1555. .el-tabs__item {
  1556. padding: 0 10px;
  1557. }
  1558. .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) {
  1559. padding: 0 10px;
  1560. }
  1561. .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 {
  1562. padding: 0 10px;
  1563. }
  1564. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  1565. padding: 0 10px;
  1566. }
  1567. }
  1568. .centerRight {
  1569. .el-tabs__nav-scroll {
  1570. display: flex;
  1571. }
  1572. .el-tabs__nav {
  1573. margin: 0 auto;
  1574. }
  1575. .el-table th .cell, .el-table td .cell {
  1576. padding: 0 2px;
  1577. }
  1578. }
  1579. .preTabs {
  1580. .el-tabs__content {
  1581. flex: 1;
  1582. overflow-y: auto;
  1583. padding: 5px 0 5px 5px;
  1584. }
  1585. }
  1586. .rightTabs {
  1587. height: 100%;
  1588. .el-tabs__nav {
  1589. width: auto;
  1590. }
  1591. .el-tabs__header {
  1592. margin-bottom: 5px;
  1593. }
  1594. .el-tabs__item {
  1595. width: auto;
  1596. text-align: inherit;
  1597. }
  1598. .el-tabs__content {
  1599. flex: 1;
  1600. overflow-y: auto;
  1601. }
  1602. .el-tab-pane {
  1603. display: flex;
  1604. flex-direction: column;
  1605. height: 100%;
  1606. }
  1607. }
  1608. #tab-more {
  1609. .el-icon-close {
  1610. display: none;
  1611. }
  1612. }
  1613. ::-webkit-scrollbar {
  1614. height: 15px;
  1615. }
  1616. </style>