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

deskPrescription.vue 102KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863
  1. <template>
  2. <div style="height: calc(100% - 58px);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" v-loading="loading">
  13. <div class="centerLeft">
  14. <el-tabs v-model="dayorMonth" @tab-click="changeDayOrMonth">
  15. <el-tab-pane label="日结" name="day"></el-tab-pane>
  16. <el-tab-pane label="月结" name="month"></el-tab-pane>
  17. </el-tabs>
  18. <el-form :model="form" ref="form" label-width="80px"
  19. style="display: flex;flex-wrap: wrap;justify-content: space-between;">
  20. <el-form-item label="姓名:" prop="name" label-position="right">
  21. <el-input v-model="patientInfo.name" placeholder="" readonly></el-input>
  22. </el-form-item>
  23. <el-form-item label="证件号: " prop="name" label-position="right">
  24. <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
  25. </el-form-item>
  26. <el-form-item label="处方类型: " prop="name" label-position="right">
  27. <el-select style="width:100%;" v-model="register_type" placeholder="">
  28. <el-option
  29. v-for="(item,index) in register"
  30. :key="index"
  31. :label="item.label"
  32. :value="item.value">
  33. </el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="疾病类型:" prop="name" label-position="right">
  37. <el-select style="width:100%;" v-model="state1" placeholder="">
  38. <el-option
  39. v-for="(item,index) in sick"
  40. :key="index"
  41. :label="item.class_name"
  42. :value="item.id">
  43. </el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item label="诊断:" prop="name" label-position="right">
  47. <el-select style="width:100%;" v-model="diagnose" placeholder="">
  48. <el-option
  49. v-for="(item,index) in diagnoses"
  50. :key="index"
  51. :label="item.class_name"
  52. :value="item.id">
  53. </el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="过敏病史: " prop="name" label-position="right">
  57. <el-autocomplete
  58. style="width:100%;"
  59. class="inline-input"
  60. v-model="state2"
  61. :fetch-suggestions="querySearch2"
  62. placeholder="请输入内容"
  63. ></el-autocomplete>
  64. </el-form-item>
  65. </el-form>
  66. <div class="tabsBox">
  67. <el-button v-if="dayorMonth == 'day'" type="text" class="addTab" @click="addCharges"
  68. icon="el-icon-circle-plus">附加收费
  69. </el-button>
  70. <div class="RP" v-if="dayorMonth == 'month'">Rp
  71. <el-date-picker
  72. v-model="start_time"
  73. prefix-icon="el-icon-date"
  74. @change="changeTime"
  75. :editable="false"
  76. style="width: 150px;"
  77. type="date"
  78. placeholder="选择开始时间"
  79. align="right"
  80. format="yyyy-MM-dd"
  81. :picker-options="pickerBeginDateBefore"
  82. value-format="yyyy-MM-dd">
  83. </el-date-picker>
  84. <span class>-</span>
  85. <el-date-picker
  86. v-model="end_time"
  87. prefix-icon="el-icon-date"
  88. @change="changeEndTime"
  89. :editable="false"
  90. :picker-options="pickerBeginDateAfter"
  91. style="width: 150px;"
  92. type="date"
  93. placeholder="选择结束时间"
  94. align="right"
  95. format="yyyy-MM-dd"
  96. value-format="yyyy-MM-dd">
  97. </el-date-picker>
  98. </div>
  99. <el-tabs v-show="dayorMonth == 'day'" class="preTabs" v-model="editableTabsValue" type="border-card" closable
  100. @tab-remove="removeTab"
  101. :before-leave="moreState" @tab-click="tabclickEvent">
  102. <el-tab-pane
  103. v-for="(item, index) in prescriptions"
  104. :key="index"
  105. :label="item.name"
  106. :name="item.name"
  107. >
  108. <div class="RP">Rp
  109. <el-date-picker
  110. v-model="item.pre_time"
  111. type="datetime"
  112. :clearable="false"
  113. format="yyyy-MM-dd HH:mm"
  114. value-format="yyyy-MM-dd HH:mm"
  115. placeholder="选择日期">
  116. </el-date-picker>
  117. <div style="float: right;margin-bottom:5px;margin-right:1%;">
  118. <el-button
  119. round
  120. size="small"
  121. @click="openLast(3)"
  122. >上一方
  123. </el-button>
  124. <el-button
  125. round
  126. size="small"
  127. @click="openNext(4)"
  128. >下一方
  129. </el-button>
  130. </div>
  131. </div>
  132. </el-tab-pane>
  133. <el-tab-pane name="more" closable v-if="dayorMonth == 'day'"><span slot="label"><i class="el-icon-plus"
  134. @click="addTab"></i></span>
  135. </el-tab-pane>
  136. <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables" :prescription="curPrescriptions"
  137. :preDrugs="preDrugs"
  138. :activeType="customTabIndex"></prescription-table>
  139. </el-tabs>
  140. <el-tabs v-show="dayorMonth == 'month'" class="preTabs" v-model="editableTabsValueTwo" type="border-card"
  141. :before-leave="moreState" @tab-click="monthTabclickEvent">
  142. <el-tab-pane
  143. v-for="(item, index) in month_prescriptions"
  144. :key="index"
  145. :label="item.name"
  146. :name="item.name"
  147. >
  148. </el-tab-pane>
  149. <month-prescription-table v-if="dayorMonth == 'month' && !isShowDayPrescription"
  150. ref="month_prescription_tables"
  151. :prescription="curMonthPrescriptions"
  152. :activeType="monthCustomTabIndex"></month-prescription-table>
  153. <day-prescription-table v-if="dayorMonth == 'month' && isShowDayPrescription"
  154. ref="month_prescription_tables" :prescription="curDayPrescriptions"
  155. :activeType="monthCustomTabIndex"></day-prescription-table>
  156. </el-tabs>
  157. </div>
  158. <div class="costBox">
  159. <div>
  160. <span><span style="color: red">*</span>医生:</span>
  161. <el-select style="margin-right:5px;width:140px;" v-model="doctorValue" placeholder=""
  162. @change="changeDoctor">
  163. <el-option
  164. v-for="(item,index) in doctors"
  165. :key="index"
  166. :label="item.user_name"
  167. :value="item.admin_user_id">
  168. </el-option>
  169. </el-select>
  170. <span> <span style="color: red">*</span>科室:</span>
  171. <el-select style="margin-right:5px;width:140px;" v-model="departmentValue" placeholder="">
  172. <el-option
  173. v-for="(item,index) in department"
  174. :key="index"
  175. :label="item.name"
  176. :value="item.id">
  177. </el-option>
  178. </el-select>
  179. <span>当前处方总价:</span>
  180. <span style="color:red;" v-if="dayorMonth == 'day'">{{getTotalOne()?getTotalOne():''}}元</span>
  181. <span style="color:red;" v-if="dayorMonth == 'month'">{{getTotalTwo()?getTotalTwo():''}}元</span>
  182. <span style="margin-left:10px;">总价:</span>
  183. <span style="color:red;" v-if="dayorMonth == 'day'">{{ getTotal()?getTotal():''}}元</span>
  184. <span style="color:red;" v-if="dayorMonth == 'month'">{{ getMonthTotal()?getMonthTotal():''}}元</span>
  185. </div>
  186. <span :class="order_status == '未收费' ? 'statusRed' : ''">{{order_status}}</span>
  187. </div>
  188. </div>
  189. <div class='centerRight'>
  190. <!-- <div class="rightTab">
  191. <p :class="rightTab == 1 ? 'activeP' : ''" @click="clickTab(1)">药品</p>
  192. <p :class="rightTab == 2 ? 'activeP' : ''" @click="clickTab(2)">项目</p>
  193. </div> -->
  194. <el-tabs class="borderCard" type="border-card" v-model="rightTab" @tab-click="clickTab"
  195. :before-leave='beforeLeave'>
  196. <el-tab-pane label="药品" :name="1">
  197. </el-tab-pane>
  198. <el-tab-pane label="项目" :name="2">
  199. </el-tab-pane>
  200. <div style="height:100%;" v-show="showOne">
  201. <el-tabs class="rightTabs" v-model="drug_activeName">
  202. <el-tab-pane label="药品列表" name="1">
  203. <div style="margin-bottom:5px;display:flex;">
  204. <el-input style="width:50%;" @input="searchAction" @keyup.enter.native='searchAction'
  205. v-model.trim="search_keyword"
  206. placeholder="请输入药品名字"></el-input>
  207. <el-select style="margin-left:5px;width:50%;" v-model="value" placeholder="" @change="changeKind">
  208. <el-option
  209. label="全部"
  210. value="0">
  211. </el-option>
  212. <el-option
  213. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  214. :key="index"
  215. :label="item.name"
  216. :value="item.id">
  217. </el-option>
  218. </el-select>
  219. </div>
  220. <div style="width: 100%;flex:1;overflow: hidden;" ref="rightTable">
  221. <el-table ref="multipleTable" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  222. :data="drugs" border @select='selectDrugs'
  223. :row-style="{ color: '#303133' }"
  224. @select-all="changeAllGoodInfoTableData"
  225. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  226. highlight-current-row>
  227. <el-table-column type="selection" width="40" align="center"></el-table-column>
  228. <el-table-column label="名称">
  229. <template slot-scope="scope">{{ scope.row.drug_name }}</template>
  230. </el-table-column>
  231. <el-table-column label="规格" width="60">
  232. <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
  233. </el-table-column>
  234. <el-table-column label="库存" width="60">
  235. <template slot-scope="scope">{{
  236. stockInCount(scope.row) -
  237. salesReturnCount(scope.row) -
  238. stockOutCount(scope.row) +
  239. cancelStockCount(scope.row)
  240. }}
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="单价" width="40">
  244. <template slot-scope="scope">{{ scope.row.retail_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="margin-bottom:5px;">-->
  251. <!--&lt;!&ndash;<el-input style="width:50%;" v-model="input" placeholder=""></el-input>&ndash;&gt;-->
  252. <!--<el-select style="float: right;width: 49%;" v-model="value" placeholder="">-->
  253. <!--<el-option-->
  254. <!--v-for="item in options"-->
  255. <!--:key="item.value"-->
  256. <!--:label="item.label"-->
  257. <!--:value="item.value">-->
  258. <!--</el-option>-->
  259. <!--</el-select>-->
  260. <!--</div>-->
  261. <!--<div style="width: 100%;flex:1;overflow-y: auto;">-->
  262. <!--<el-table ref="multipleTableTwo" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"-->
  263. <!--:data="advices_template" border-->
  264. <!--:row-style="{ color: '#303133' }"-->
  265. <!--:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"-->
  266. <!--highlight-current-row-->
  267. <!--@select='selectTemplate'-->
  268. <!--@select-all="changeTemplateData"-->
  269. <!--&gt;-->
  270. <!--<el-table-column type="selection" width="40" align="center"></el-table-column>-->
  271. <!--<el-table-column prop="name" label="名称">-->
  272. <!--<template slot-scope="scope">{{scope.row.name}}</template>-->
  273. <!--</el-table-column>-->
  274. <!--&lt;!&ndash;<el-table-column label="规格" width="60">&ndash;&gt;-->
  275. <!--&lt;!&ndash;<template slot-scope="scope">33</template>&ndash;&gt;-->
  276. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  277. <!--&lt;!&ndash;<el-table-column label="库存" width="60">&ndash;&gt;-->
  278. <!--&lt;!&ndash;<template slot-scope="scope">22</template>&ndash;&gt;-->
  279. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  280. <!--&lt;!&ndash;<el-table-column label="单价" width="40">&ndash;&gt;-->
  281. <!--&lt;!&ndash;<template slot-scope="scope">12</template>&ndash;&gt;-->
  282. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  283. <!--</el-table>-->
  284. <!--</div>-->
  285. <!--</el-tab-pane>-->
  286. </el-tabs>
  287. </div>
  288. <div style="height:100%;" v-show="showTwo">
  289. <el-tabs class="rightTabs" v-model="activeName" >
  290. <el-tab-pane label="项目列表" name="1">
  291. <div style="margin-bottom:5px;">
  292. <!--<el-input style="width:50%;" v-model="input" placeholder=""></el-input>-->
  293. <el-input style="width:50%;" @input="searchProjectAction" @keyup.enter.native='searchProjectAction'
  294. v-model.trim="search_project_keyword"
  295. placeholder="请输入项目名称"></el-input>
  296. <el-select style="float: right;width: 49%;" v-model="value" placeholder="" @change="changeClass">
  297. <el-option
  298. label="全部"
  299. value="0">
  300. </el-option>
  301. <el-option
  302. v-for="(item, index) in getDictionaryDataConfig('system','cost_classify')"
  303. :key="index"
  304. :label="item.name"
  305. :value="item.id">
  306. </el-option>
  307. </el-select>
  308. </div>
  309. <div style="width: 100%;flex:1;overflow-y: auto;">
  310. <el-table ref="tables" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  311. :data="tabProject" border @select='selectChange'
  312. :row-style="{ color: '#303133' }"
  313. @select-all="changeAllGoodInfoTableDataTwo"
  314. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  315. highlight-current-row>
  316. <el-table-column type="selection" width="40" align="center"></el-table-column>
  317. <el-table-column prop="name" label="名称">
  318. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  319. </el-table-column>
  320. <el-table-column label="规格" width="60">
  321. <template slot-scope="scope">{{ scope.row.single_dose }}</template>
  322. </el-table-column>
  323. <el-table-column label="单价" width="40">
  324. <template slot-scope="scope">{{ scope.row.price }}</template>
  325. </el-table-column>
  326. </el-table>
  327. </div>
  328. </el-tab-pane>
  329. <el-tab-pane label="项目组套" name="2">
  330. <div style="width: 100%;flex:1;overflow-y: auto;">
  331. <el-table :data="tabPrjectTeam" border
  332. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  333. :row-style="{ color: '#303133' }"
  334. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  335. highlight-current-row
  336. @select='selectTeam'>
  337. <el-table-column type="selection" width="40" align="center"></el-table-column>
  338. <el-table-column prop="name" label="名称">
  339. <template slot-scope="scope">{{scope.row.project_team}}</template>
  340. </el-table-column>
  341. </el-table>
  342. </div>
  343. </el-tab-pane>
  344. </el-tabs>
  345. </div>
  346. </el-tabs>
  347. <template>
  348. <div class="comfirmBox">
  349. <!-- <div>
  350. <span>药品类型:</span>
  351. <el-select style="margin-right:5px;width:100px;" v-model="value" placeholder="" @change="changeKind">
  352. <el-option
  353. label="全部"
  354. value="0">
  355. </el-option>
  356. <el-option
  357. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  358. :key="index"
  359. :label="item.name"
  360. :value="item.id">
  361. </el-option>
  362. </el-select>
  363. </div> -->
  364. <el-button type="primary" style="width:100%;" @click="comfirm">确定添加</el-button>
  365. </div>
  366. </template>
  367. </div>
  368. </div>
  369. <additionalCharges v-on:setData="setCharge" ref='additionalCharges' :hisPatientInfo="hisPatientInfo"
  370. :patientInfo="patientInfo" :additions="additions"></additionalCharges>
  371. <select-template ref='selectTemplate'></select-template>
  372. <save-template ref='saveTemplate'></save-template>
  373. <next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue"
  374. v-on:cancel="cancel"></next-or-last-prescription>
  375. <!--<next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue" v-on:cancel="cancel"></next-or-last-prescription>-->
  376. <call-prescription ref='call_prescription' v-on:call="call" v-on:call-cancel="callCancel"></call-prescription>
  377. </div>
  378. </template>
  379. <script>
  380. import MonthPrescriptionTable from '../../outpatientCharges/components/monthPrescriptionTable'
  381. import {
  382. createHisPrescription,
  383. delHisPrescription,
  384. editHisPrescription,
  385. getCallHisPrescription,
  386. getDayOrMonthHisPrescription,
  387. getInitData,
  388. getNextOrLastHisPrescription,
  389. getPatientInfo,
  390. getSchedulePatientList
  391. } from '@/api/his/his'
  392. import { getDictionaryDataConfig } from '@/utils/data'
  393. import prescriptionTable from './prescriptionTable'
  394. import selectTemplate from './selectTemplate'
  395. import saveTemplate from './saveTemplate'
  396. import additionalCharges from './additionalCharges'
  397. import { addProjectTeam, getAllProjectTeam, getHisProject, getPojectListById,getAllProjectList } from '@/api/project/project'
  398. import { uParseTime } from '@/utils/tools'
  399. import NextOrLastPrescription from './nextOrLastPrescription'
  400. import CallPrescription from './callPrescription'
  401. import DayPrescriptionTable from '../../outpatientCharges/components/dayPrescriptionTable'
  402. const moment = require('moment')
  403. export default {
  404. props: {
  405. patientInfo: Object,
  406. hisPatientInfo: Object,
  407. prescriptions: Array,
  408. record_date: String,
  409. search_keyword: '',
  410. month_prescriptions: Array,
  411. isloading: false,
  412. loading: false,
  413. other_sick: {
  414. type: Array,
  415. default: function() {
  416. return []
  417. }
  418. }
  419. },
  420. components: {
  421. DayPrescriptionTable,
  422. MonthPrescriptionTable,
  423. CallPrescription,
  424. NextOrLastPrescription,
  425. selectTemplate,
  426. saveTemplate,
  427. prescriptionTable,
  428. additionalCharges
  429. },
  430. data() {
  431. return {
  432. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  433. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  434. register: [
  435. { value: 11, label: '普通门诊' },
  436. { value: 12, label: '门诊挂号' },
  437. { value: 13, label: '急诊' },
  438. { value: 14, label: '门诊特殊病' },
  439. { value: 15, label: '门诊统筹' },
  440. { value: 16, label: '门诊慢性病' },
  441. { value: 21, label: '普通住院' }
  442. ],
  443. isLastOrNextVisible: false,
  444. multipleTableHeight: '',
  445. register_type: '',
  446. value: '0',
  447. search_project_keyword: '',
  448. form: {
  449. name: ''
  450. },
  451. drugs: [],
  452. allDrugs: [],
  453. advices_template: [],
  454. additions: [],
  455. editableTabsValueTwo: '处方1',
  456. editableTabsValue: '处方1',
  457. editableTabs: [{
  458. title: '处方1',
  459. name: '1'
  460. }],
  461. tabIndex: this.prescriptions.length,
  462. curDayPrescriptions: null,
  463. dayPrescriptions: [],
  464. currenet_inedx: 0,
  465. rightTab: 1,
  466. activeName: '1',
  467. drug_activeName: '1',
  468. curPrescriptions: null,
  469. curMonthPrescriptions: this.month_prescriptions[0],
  470. drugTableData: [],
  471. preDrugs: [],
  472. curDrugs: [],
  473. doctorOptions: [],
  474. doctorValue: '',
  475. departmentOptions: [],
  476. departmentValue: '',
  477. total: 0,
  478. state1: '',
  479. request_record_date: '',
  480. state2: '',
  481. customTabIndex: 1,
  482. options: [],
  483. tabProject: [],
  484. allProject: [],
  485. strids: '',
  486. showOne: true,
  487. showTwo: false,
  488. tableData: [],
  489. tabPrjectTeam: [],
  490. teamList: [],
  491. doctors: [],
  492. departMent: [],
  493. curStatus: 0,
  494. isShowDayPrescription: false,
  495. monthCustomTabIndex: 1,
  496. order_status: '',
  497. register_types: [
  498. { id: 1, name: '医保' },
  499. { id: 2, name: '自费' }
  500. ],
  501. pickerOptions: {
  502. disabledDate(time) {
  503. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
  504. return time.getTime() > Date.now() || time.getTime() < threeMonths
  505. }
  506. },
  507. department: [],
  508. sick: [],
  509. diagnoses: [],
  510. diagnose: '',
  511. curTotal: 0,
  512. prescription_id: 0,
  513. tempDrugs: [],
  514. dayorMonth: 'day',
  515. pickerBeginDateBefore: {
  516. disabledDate: (time) => {
  517. let beginDateVal = this.end_time
  518. if (beginDateVal) {
  519. return time.getTime() > new Date(beginDateVal).getTime()
  520. }
  521. }
  522. },
  523. pickerBeginDateAfter: {
  524. disabledDate: (time) => {
  525. let beginDateVal = this.start_time
  526. if (beginDateVal) {
  527. return time.getTime() <= new Date(beginDateVal).getTime()
  528. }
  529. }
  530. },
  531. hisList:[]
  532. }
  533. },
  534. methods: {
  535. changeClass(id) {
  536. this.tabProject = []
  537. if (id == 0) {
  538. this.tabProject = this.allProject
  539. } else {
  540. for (let i = 0; i < this.allProject.length; i++) {
  541. if (this.allProject[i].cost_classify == id) {
  542. this.tabProject.push(this.allProject[i])
  543. }
  544. }
  545. }
  546. },
  547. setMonthPrescription(month_prescriptions) {
  548. this.month_prescriptions = []
  549. let drug_month_prescriptions = {
  550. advices: []
  551. }
  552. let drug_ids = []
  553. let project_month_prescriptions = {
  554. project: []
  555. }
  556. let project_ids = []
  557. let addition_month_prescriptions = {
  558. addition: []
  559. }
  560. let additions_ids = []
  561. for (let i = 0; i < month_prescriptions.length; i++) {
  562. if (month_prescriptions[i].type == 1) { //药品
  563. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  564. let obj = {
  565. id: month_prescriptions[i].advices[a].drug_id,
  566. price: month_prescriptions[i].advices[a].price
  567. }
  568. drug_ids.push(obj)
  569. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  570. }
  571. } else if (month_prescriptions[i].type == 2) { //项目
  572. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  573. let obj = {
  574. id: month_prescriptions[i].project[a].project_id,
  575. price: month_prescriptions[i].project[a].price
  576. }
  577. project_ids.push(obj)
  578. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  579. }
  580. }
  581. //附加收费
  582. for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  583. let obj = {
  584. id: month_prescriptions[i].addition[a].item_id,
  585. price: month_prescriptions[i].addition[a].price
  586. }
  587. additions_ids.push(obj)
  588. addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  589. }
  590. }
  591. const obj = {}
  592. const obj1 = {}
  593. const obj2 = {}
  594. drug_ids = drug_ids.reduce((cur, next) => {
  595. obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
  596. return cur
  597. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  598. project_ids = project_ids.reduce((cur, next) => {
  599. obj1[next.price] ? '' : obj1[next.price] = true && cur.push(next)
  600. return cur
  601. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  602. additions_ids = additions_ids.reduce((cur, next) => {
  603. obj2[next.price] ? '' : obj2[next.price] = true && cur.push(next)
  604. return cur
  605. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  606. console.log(drug_ids)
  607. console.log(project_ids)
  608. console.log(additions_ids)
  609. console.log(additions_ids)
  610. let drugs = []
  611. let projects = []
  612. let additions = []
  613. for (let i = 0; i < drug_ids.length; i++) {
  614. let obj = {}
  615. let count = 0
  616. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  617. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
  618. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  619. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  620. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  621. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  622. obj['day'] = drug_month_prescriptions.advices[a].day
  623. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  624. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  625. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  626. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  627. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  628. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  629. count = count + drug_month_prescriptions.advices[a].prescribing_number
  630. }
  631. }
  632. obj['prescribing_number'] = count
  633. drugs.push(obj)
  634. }
  635. for (let i = 0; i < project_ids.length; i++) {
  636. let obj = {}
  637. let count = 0
  638. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  639. if (project_ids[i].price == project_month_prescriptions.project[a].price) {
  640. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  641. obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  642. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  643. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  644. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  645. obj['number_days'] = project_month_prescriptions.project[a].day
  646. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  647. obj['unit'] = project_month_prescriptions.project[a].unit
  648. obj['project_id'] = project_month_prescriptions.project[a].project_id
  649. count = count + project_month_prescriptions.project[a].count
  650. // price = price + project_month_prescriptions.project[a].price
  651. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  652. }
  653. }
  654. obj['total'] = count
  655. projects.push(obj)
  656. }
  657. for (let i = 0; i < additions_ids.length; i++) {
  658. let obj = {}
  659. let count = 0
  660. console.log(addition_month_prescriptions.addition)
  661. if (addition_month_prescriptions.addition) {
  662. for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  663. if (additions_ids[i].price == addition_month_prescriptions.addition[a].price) {
  664. obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  665. obj['id'] = addition_month_prescriptions.addition[a].id
  666. obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  667. count = count + addition_month_prescriptions.addition[a].count
  668. obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
  669. }
  670. }
  671. obj['count'] = count
  672. additions.push(obj)
  673. }
  674. }
  675. console.log(drugs)
  676. console.log(projects)
  677. console.log(additions)
  678. let p1 = {
  679. name: '处方' + 1,
  680. advices: drugs,
  681. project: [],
  682. type: 1,
  683. addition: additions
  684. }
  685. let p2 = {
  686. name: '处方' + 2,
  687. type: 2,
  688. project: projects,
  689. advices: [],
  690. addition: []
  691. }
  692. console.log(this.month_prescriptions)
  693. console.log(this.curMonthPrescriptions)
  694. this.month_prescriptions.push(p1)
  695. this.month_prescriptions.push(p2)
  696. this.curMonthPrescriptions = this.month_prescriptions[0]
  697. },
  698. // setMonthPrescription(month_prescriptions) {
  699. // let drug_month_prescriptions = {
  700. // advices: [],
  701. // }
  702. // let drug_ids = []
  703. // let project_month_prescriptions = {
  704. // project: [],
  705. //
  706. // }
  707. // let project_ids = []
  708. //
  709. // let addition_month_prescriptions = {
  710. // addtions: [],
  711. //
  712. // }
  713. // let additions_ids = []
  714. //
  715. //
  716. // for (let i = 0; i < month_prescriptions.length; i++) {
  717. // if (month_prescriptions[i].type == 1) { //药品
  718. // for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  719. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  720. // drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  721. // }
  722. //
  723. // } else if (month_prescriptions[i].type == 2) { //项目
  724. // for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  725. // project_ids.push(month_prescriptions[i].project[a].project_id)
  726. // project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  727. // }
  728. // }
  729. // //附加收费
  730. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  731. // additions_ids.push(month_prescriptions[i].addition[a].item_id)
  732. // addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
  733. // }
  734. //
  735. // }
  736. //
  737. // console.log(drug_ids)
  738. // console.log(drug_month_prescriptions)
  739. // console.log(project_ids)
  740. // console.log(project_month_prescriptions)
  741. // console.log(additions_ids)
  742. // console.log(addition_month_prescriptions)
  743. //
  744. //
  745. // const obj = {}
  746. // const obj1 = {}
  747. // const obj2 = {}
  748. //
  749. // drug_ids = drug_ids.reduce((cur, next) => {
  750. // obj[next] ? '' : obj[next] = true && cur.push(next)
  751. // return cur
  752. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  753. // project_ids = project_ids.reduce((cur, next) => {
  754. // obj1[next] ? '' : obj1[next] = true && cur.push(next)
  755. // return cur
  756. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  757. // additions_ids = additions_ids.reduce((cur, next) => {
  758. // obj2[next] ? '' : obj2[next] = true && cur.push(next)
  759. // return cur
  760. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  761. //
  762. //
  763. // console.log(drug_ids)
  764. // console.log(project_ids)
  765. // console.log(additions_ids)
  766. //
  767. //
  768. // let drugs = []
  769. // let projects = []
  770. // let additions = []
  771. //
  772. //
  773. // for (let i = 0; i < drug_ids.length; i++) {
  774. // let obj = {}
  775. // let price = 0
  776. // let count = 0
  777. // for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  778. // if (drug_ids[i] == drug_month_prescriptions.advices[a].drug_id) {
  779. // obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  780. // obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  781. // obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  782. // obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  783. // obj['day'] = drug_month_prescriptions.advices[a].day
  784. // // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  785. // obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  786. // obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  787. // obj['id'] = drug_month_prescriptions.advices[a].drug_id
  788. // // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  789. //
  790. //
  791. // count = count + drug_month_prescriptions.advices[a].prescribing_number
  792. // price = price + drug_month_prescriptions.advices[a].price
  793. //
  794. // }
  795. // }
  796. // obj['retail_price'] =this.formatDecimal(price,2)
  797. // obj['prescribing_number'] = count
  798. // drugs.push(obj)
  799. // }
  800. //
  801. //
  802. // for (let i = 0; i < project_ids.length; i++) {
  803. // let obj = {}
  804. // let price = 0
  805. // let count = 0
  806. // for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  807. // if (project_ids[i] == project_month_prescriptions.project[a].project_id) {
  808. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  809. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  810. // obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  811. // obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  812. // obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  813. // obj['number_days'] = project_month_prescriptions.project[a].day
  814. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  815. // obj['unit'] = project_month_prescriptions.project[a].unit
  816. // obj['project_id'] = project_month_prescriptions.project[a].project_id
  817. // count = count + project_month_prescriptions.project[a].count
  818. // price = price + project_month_prescriptions.project[a].price
  819. // }
  820. // }
  821. // obj['price'] = this.formatDecimal(price,2)
  822. // obj['total'] = count
  823. // projects.push(obj)
  824. // }
  825. //
  826. //
  827. // for (let i = 0; i < additions_ids.length; i++) {
  828. // let obj = {}
  829. // let price = 0
  830. // let count = 0
  831. // for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  832. // if (project_ids[i] == addition_month_prescriptions.addition[a].item_id) {
  833. // obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  834. // obj['id'] = addition_month_prescriptions.addition[a].id
  835. // obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  836. // count = count + addition_month_prescriptions.addition[a].count
  837. // price = price + addition_month_prescriptions.addition[a].price
  838. // }
  839. // }
  840. // obj['price'] = this.formatDecimal(price,2)
  841. // obj['count'] = count
  842. // additions.push(obj)
  843. // }
  844. //
  845. // console.log(drugs)
  846. // console.log(projects)
  847. // console.log(additions)
  848. //
  849. //
  850. // if (drugs.length > 0) {
  851. // let p1 = {
  852. // name: '处方' + 1,
  853. // advices: drugs,
  854. // project: [],
  855. // type: 1,
  856. // addition: additions,
  857. // }
  858. // this.month_prescriptions.push(p1)
  859. //
  860. // }
  861. //
  862. // if (projects.length > 0) {
  863. // let p2 = {
  864. // name: '处方' + 2,
  865. // type: 2,
  866. // project: projects,
  867. // advices: [],
  868. // }
  869. // this.month_prescriptions.push(p2)
  870. // }
  871. //
  872. // console.log(this.month_prescriptions)
  873. //
  874. // },
  875. formatDecimal(num, decimal) {
  876. num = num.toString()
  877. let index = num.indexOf('.')
  878. if (index !== -1) {
  879. num = num.substring(0, decimal + index + 1)
  880. } else {
  881. num = num.substring(0)
  882. }
  883. return parseFloat(num).toFixed(decimal)
  884. },
  885. changeTime(val) {
  886. if (val == this.end_time) {
  887. this.isShowDayPrescription = true
  888. } else {
  889. this.isShowDayPrescription = false
  890. }
  891. let params = {
  892. patient_id: this.patientInfo.id,
  893. start_time: val,
  894. end_time: this.end_time
  895. }
  896. getDayOrMonthHisPrescription(params).then(response => {
  897. if (response.data.state == 1) {
  898. this.month_prescriptions = []
  899. if (val == this.end_time) {
  900. var day_prescription = response.data.data.day_prescription
  901. // this.month_prescriptions = day_prescription
  902. if (day_prescription.length > 0) {
  903. for (let i = 0; i < day_prescription.length; i++) {
  904. var prescription = day_prescription[i]
  905. let tempAdvice = []
  906. let tempProject = []
  907. let tempAddition = []
  908. //药品
  909. for (let b = 0; b < prescription.advices.length; b++) {
  910. let obj = {
  911. advice_id: prescription.advices[b].id,
  912. drug_name: prescription.advices[b].advice_name,
  913. single_dose: prescription.advices[b].single_dose,
  914. delivery_way: prescription.advices[b].delivery_way,
  915. execution_frequency: prescription.advices[b].execution_frequency,
  916. retail_price: prescription.advices[b].price.toString(),
  917. remark: prescription.advices[b].remark,
  918. day: prescription.advices[b].day,
  919. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  920. single_dose_unit: prescription.advices[b].single_dose_unit,
  921. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  922. medical_insurance_number: prescription.advices[b].med_list_codg,
  923. id: prescription.advices[b].drug_id
  924. }
  925. tempAdvice.push(obj)
  926. }
  927. //项目
  928. for (let b = 0; b < prescription.project.length; b++) {
  929. let obj = {
  930. id: prescription.project[b].id,
  931. project_id: prescription.project[b].project_id,
  932. project_name: prescription.project[b].project.project_name,
  933. statistical_classification: prescription.project[b].project.statistical_classification,
  934. single_dose: prescription.project[b].single_dose,
  935. delivery_way: prescription.project[b].delivery_way,
  936. execution_frequency: prescription.project[b].execution_frequency,
  937. number_days: prescription.project[b].day,
  938. total: prescription.project[b].count.toString(),
  939. price: prescription.project[b].price,
  940. remark: prescription.project[b].remark,
  941. medical_code: prescription.project[b].project.medical_code,
  942. unit: prescription.project[b].project.unit
  943. }
  944. tempProject.push(obj)
  945. }
  946. //附加收费
  947. for (let b = 0; b < prescription.addition.length; b++) {
  948. let obj = {
  949. id: prescription.addition[b].id,
  950. item_name: prescription.addition[b].item_name,
  951. price: prescription.addition[b].price,
  952. count: prescription.addition[b].count,
  953. item_id: prescription.addition[b].item_id
  954. }
  955. tempAddition.push(obj)
  956. }
  957. let index = i + 1
  958. let obj = {
  959. id: prescription.id,
  960. name: '处方' + index,
  961. advices: tempAdvice,
  962. project: tempProject,
  963. addition: tempAddition,
  964. order_status: prescription.order_status
  965. }
  966. this.month_prescriptions.push(obj)
  967. }
  968. this.curDayPrescriptions = this.month_prescriptions[0]
  969. }
  970. } else {
  971. this.setMonthPrescription(response.data.data.day_prescription)
  972. this.curMonthPrescriptions = this.month_prescriptions[0]
  973. }
  974. } else {
  975. this.$message.error(response.data.msg)
  976. }
  977. })
  978. },
  979. changeEndTime(val) {
  980. if (val == this.start_time) {
  981. this.isShowDayPrescription = true
  982. } else {
  983. this.isShowDayPrescription = false
  984. }
  985. let params = {
  986. patient_id: this.patientInfo.id,
  987. start_time: this.start_time,
  988. end_time: val
  989. }
  990. getDayOrMonthHisPrescription(params).then(response => {
  991. if (response.data.state == 1) {
  992. console.log(val)
  993. console.log(this.end_time)
  994. this.month_prescriptions = []
  995. if (val == this.start_time) {
  996. var day_prescription = response.data.data.day_prescription
  997. // this.month_prescriptions = day_prescription
  998. if (day_prescription.length > 0) {
  999. for (let i = 0; i < day_prescription.length; i++) {
  1000. var prescription = day_prescription[i]
  1001. let tempAdvice = []
  1002. let tempProject = []
  1003. let tempAddition = []
  1004. //药品
  1005. for (let b = 0; b < prescription.advices.length; b++) {
  1006. let obj = {
  1007. advice_id: prescription.advices[b].id,
  1008. drug_name: prescription.advices[b].advice_name,
  1009. single_dose: prescription.advices[b].single_dose,
  1010. delivery_way: prescription.advices[b].delivery_way,
  1011. execution_frequency: prescription.advices[b].execution_frequency,
  1012. retail_price: prescription.advices[b].price.toString(),
  1013. remark: prescription.advices[b].remark,
  1014. day: prescription.advices[b].day,
  1015. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1016. single_dose_unit: prescription.advices[b].single_dose_unit,
  1017. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1018. medical_insurance_number: prescription.advices[b].med_list_codg,
  1019. id: prescription.advices[b].drug_id
  1020. }
  1021. tempAdvice.push(obj)
  1022. }
  1023. //项目
  1024. for (let b = 0; b < prescription.project.length; b++) {
  1025. let obj = {
  1026. id: prescription.project[b].id,
  1027. project_id: prescription.project[b].project_id,
  1028. project_name: prescription.project[b].project.project_name,
  1029. statistical_classification: prescription.project[b].project.statistical_classification,
  1030. single_dose: prescription.project[b].single_dose,
  1031. delivery_way: prescription.project[b].delivery_way,
  1032. execution_frequency: prescription.project[b].execution_frequency,
  1033. number_days: prescription.project[b].day,
  1034. total: prescription.project[b].count.toString(),
  1035. price: prescription.project[b].price,
  1036. remark: prescription.project[b].remark,
  1037. medical_code: prescription.project[b].project.medical_code,
  1038. unit: prescription.project[b].project.unit
  1039. }
  1040. tempProject.push(obj)
  1041. }
  1042. //附加收费
  1043. for (let b = 0; b < prescription.addition.length; b++) {
  1044. let obj = {
  1045. id: prescription.addition[b].id,
  1046. item_name: prescription.addition[b].item_name,
  1047. price: prescription.addition[b].price,
  1048. count: prescription.addition[b].count,
  1049. item_id: prescription.addition[b].item_id
  1050. }
  1051. tempAddition.push(obj)
  1052. }
  1053. let index = i + 1
  1054. let obj = {
  1055. id: prescription.id,
  1056. name: '处方' + index,
  1057. advices: tempAdvice,
  1058. project: tempProject,
  1059. addition: tempAddition,
  1060. order_status: prescription.order_status
  1061. }
  1062. this.month_prescriptions.push(obj)
  1063. }
  1064. this.curDayPrescriptions = this.month_prescriptions[0]
  1065. }
  1066. } else {
  1067. this.setMonthPrescription(response.data.data.day_prescription)
  1068. this.curMonthPrescriptions = this.month_prescriptions[0]
  1069. }
  1070. } else {
  1071. this.$message.error(response.data.msg)
  1072. }
  1073. })
  1074. },
  1075. call(val) {
  1076. this.prescriptions = []
  1077. this.prescriptions = val
  1078. for (let i = 0; i < this.prescriptions.length; i++) {
  1079. var nowDate = new Date()
  1080. var nowYear = nowDate.getFullYear()
  1081. var nowMonth = nowDate.getMonth() + 1
  1082. var nowDay = nowDate.getDate()
  1083. var hours = nowDate.getHours()
  1084. var min = nowDate.getMinutes()
  1085. var nowTime =
  1086. nowYear +
  1087. '-' +
  1088. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1089. '-' +
  1090. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1091. ':' + (min < 10 ? '0' + min : min)
  1092. this.prescriptions[i]['pre_time'] = nowTime
  1093. this.prescriptions[i].name = '处方' + (i + 1)
  1094. if (i == 0) {
  1095. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  1096. this.customTabIndex = 1
  1097. this.curStatus = 1
  1098. this.rightTab = 1
  1099. this.showOne = true
  1100. this.showTwo = false
  1101. }
  1102. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  1103. this.customTabIndex = 2
  1104. this.curStatus = 2
  1105. this.rightTab = 2
  1106. this.showTwo = true
  1107. this.showOne = false
  1108. }
  1109. }
  1110. }
  1111. this.curPrescriptions = this.prescriptions[0]
  1112. this.$refs.call_prescription.close()
  1113. this.$emit('setData', this.prescriptions)
  1114. },
  1115. callCancel() {
  1116. this.$refs.call_prescription.close()
  1117. },
  1118. cancel() {
  1119. this.$refs.next_or_last_prescription.close()
  1120. this.request_record_date = this.record_date
  1121. },
  1122. setValue(val) {
  1123. this.prescriptions = []
  1124. this.prescriptions = val
  1125. this.$refs.next_or_last_prescription.close()
  1126. var nowDate = new Date()
  1127. var nowYear = nowDate.getFullYear()
  1128. var nowMonth = nowDate.getMonth() + 1
  1129. var nowDay = nowDate.getDate()
  1130. var hours = nowDate.getHours()
  1131. var min = nowDate.getMinutes()
  1132. var nowTime =
  1133. nowYear +
  1134. '-' +
  1135. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1136. '-' +
  1137. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1138. ':' + (min < 10 ? '0' + min : min)
  1139. for (let i = 0; i < this.prescriptions.length; i++) {
  1140. this.prescriptions[i].name = '处方' + (i + 1)
  1141. this.prescriptions[i]['pre_time'] = nowTime
  1142. if (i == 0) {
  1143. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  1144. this.customTabIndex = 1
  1145. this.curStatus = 1
  1146. this.rightTab = 1
  1147. this.showOne = true
  1148. this.showTwo = false
  1149. }
  1150. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  1151. this.customTabIndex = 2
  1152. this.curStatus = 2
  1153. this.rightTab = 2
  1154. this.showTwo = true
  1155. this.showOne = false
  1156. }
  1157. }
  1158. }
  1159. this.curPrescriptions = this.prescriptions[0]
  1160. this.request_record_date = this.record_date
  1161. this.$emit('setData', this.prescriptions)
  1162. },
  1163. GetNextOrLastHisPrescription(params) {
  1164. getNextOrLastHisPrescription(params).then(response => {
  1165. if (response.data.state == 1) {
  1166. if (this.dayorMonth == 'day') {
  1167. this.$refs.next_or_last_prescription.show(response.data.data.prescriptions, this.patientInfo.name, this.patientInfo.id, this.prescriptions)
  1168. this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
  1169. } else {
  1170. this.$message.error('当前处于月结,无法使用上一方或下一方功能')
  1171. return
  1172. }
  1173. } else {
  1174. this.$message.error(response.data.msg)
  1175. }
  1176. })
  1177. },
  1178. openLast(val) {
  1179. if (this.curPrescriptions.order_status == 2) {
  1180. this.$message.error('处方已经结算,无法添加')
  1181. return
  1182. }
  1183. if (this.patientInfo.id == 0) {
  1184. this.$message.error('请选择患者')
  1185. return
  1186. }
  1187. if (val == 1) {
  1188. this.isVisibility = false
  1189. this.request_record_date = this.record_date
  1190. let params = {
  1191. patient_id: this.patientInfo.id,
  1192. record_time: this.request_record_date,
  1193. type: 1
  1194. }
  1195. this.GetNextOrLastHisPrescription(params)
  1196. } else if (val == 3) {
  1197. let params = {
  1198. patient_id: this.patientInfo.id,
  1199. record_time: this.request_record_date,
  1200. type: 1
  1201. }
  1202. this.GetNextOrLastHisPrescription(params)
  1203. }
  1204. },
  1205. openNext(val) {
  1206. if (this.curPrescriptions.order_status == 2) {
  1207. this.$message.error('处方已经结算,无法添加')
  1208. return
  1209. }
  1210. if (this.patientInfo.id == 0) {
  1211. this.$message.error('请选择患者')
  1212. return
  1213. }
  1214. if (val == 2) {
  1215. this.isVisibility = false
  1216. this.request_record_date = this.record_date
  1217. let params = {
  1218. patient_id: this.patientInfo.id,
  1219. record_time: this.request_record_date,
  1220. type: 2
  1221. }
  1222. this.GetNextOrLastHisPrescription(params)
  1223. } else if (val == 4) {
  1224. let params = {
  1225. patient_id: this.patientInfo.id,
  1226. record_time: this.request_record_date,
  1227. type: 2
  1228. }
  1229. this.GetNextOrLastHisPrescription(params)
  1230. }
  1231. },
  1232. selectTemplate(selection, row) {
  1233. this.tempDrugs = selection
  1234. }, changeTemplateData(selection) {
  1235. this.tempDrugs = selection
  1236. },
  1237. stockInCount: function(row) {
  1238. let total = 0
  1239. if (row.stock_in != null) {
  1240. for (let i = 0; i < row.stock_in.length; i++) {
  1241. total = total + row.stock_in[i].warehousing_count
  1242. }
  1243. }
  1244. return total
  1245. },
  1246. salesReturnCount: function(row) {
  1247. let total = 0
  1248. if (row.sales_return != null) {
  1249. for (let i = 0; i < row.sales_return.length; i++) {
  1250. total = total + row.sales_return[i].count
  1251. }
  1252. }
  1253. return total
  1254. },
  1255. stockOutCount: function(row) {
  1256. let total = 0
  1257. if (row.stock_out != null) {
  1258. for (let i = 0; i < row.stock_out.length; i++) {
  1259. total = total + row.stock_out[i].count
  1260. }
  1261. }
  1262. return total
  1263. },
  1264. cancelStockCount: function(row) {
  1265. let total = 0
  1266. if (row.cancel_stock != null) {
  1267. for (let i = 0; i < row.cancel_stock.length; i++) {
  1268. total = total + row.cancel_stock[i].count
  1269. }
  1270. }
  1271. return total
  1272. },
  1273. setCharge(additional_charges) {
  1274. for (let i = 0; i < additional_charges.length; i++) {
  1275. additional_charges[i].count = 1
  1276. this.curPrescriptions.addition.push(additional_charges[i])
  1277. }
  1278. this.$refs.additionalCharges.hide()
  1279. }, searchProjectAction() {
  1280. if (this.search_project_keyword.length == 0) {
  1281. this.tabProject = this.allProject
  1282. } else {
  1283. let arr = []
  1284. for (let i = 0; i < this.allProject.length; i++) {
  1285. if (this.allProject[i].project_name.indexOf(this.search_project_keyword) != -1 || this.allProject[i].wubi.indexOf(this.search_project_keyword) != -1 || this.allProject[i].pinyin.indexOf(this.search_project_keyword) != -1) {
  1286. arr = arr.concat(this.allProject[i])
  1287. }
  1288. }
  1289. this.tabProject = arr
  1290. }
  1291. },
  1292. searchAction() {
  1293. if (this.search_keyword.length == 0) {
  1294. this.drugs = this.allDrugs
  1295. } else {
  1296. let arr = []
  1297. for (let i = 0; i < this.drugs.length; i++) {
  1298. if (this.drugs[i].drug_name.indexOf(this.search_keyword) != -1 || this.drugs[i].wubi.indexOf(this.search_keyword) != -1 || this.drugs[i].pinyin.indexOf(this.search_keyword) != -1) {
  1299. arr = arr.concat(this.drugs[i])
  1300. }
  1301. }
  1302. this.drugs = arr
  1303. }
  1304. },
  1305. getTotalOne() {
  1306. var total = 0
  1307. for (let i = 0; i < this.prescriptions.length; i++) {
  1308. if (this.prescriptions[i].name == this.editableTabsValue) {
  1309. if (this.prescriptions[i].advices != null) {
  1310. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1311. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  1312. }
  1313. }
  1314. if (this.prescriptions[i].project != null) {
  1315. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1316. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  1317. }
  1318. }
  1319. if (this.prescriptions[i].addition != null) {
  1320. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1321. total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
  1322. }
  1323. }
  1324. total = Math.floor(total * 100) / 100
  1325. }
  1326. }
  1327. return total
  1328. }, getTotalTwo() {
  1329. var total = 0
  1330. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1331. if (this.month_prescriptions[i].name == this.editableTabsValueTwo) {
  1332. if (this.month_prescriptions[i].advices != null) {
  1333. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1334. total = total + this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number
  1335. }
  1336. }
  1337. if (this.month_prescriptions[i].project != null) {
  1338. for (let b = 0; b < this.month_prescriptions[i].project.length; b++) {
  1339. total = total + this.month_prescriptions[i].project[b].price * this.month_prescriptions[i].project[b].total
  1340. }
  1341. }
  1342. if (this.month_prescriptions[i].addition != null) {
  1343. for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  1344. total = total + this.month_prescriptions[i].addition[b].price * this.month_prescriptions[i].addition[b].count
  1345. }
  1346. }
  1347. total = Math.floor(total * 100) / 100
  1348. }
  1349. }
  1350. return total
  1351. },
  1352. getCurTotal() {
  1353. var total = 0
  1354. if (this.curPrescriptions.type == 1) {
  1355. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1356. total = total + this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number
  1357. }
  1358. return Math.floor(total * 100) / 100
  1359. } else {
  1360. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  1361. total = total + this.curPrescriptions.project[a].price * this.curPrescriptions.project[a].total
  1362. }
  1363. return Math.floor(total * 100) / 100
  1364. }
  1365. },
  1366. getTotal() {
  1367. var total = 0
  1368. for (let i = 0; i < this.prescriptions.length; i++) {
  1369. if (this.prescriptions[i].advices != null) {
  1370. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1371. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  1372. }
  1373. }
  1374. if (this.prescriptions[i].project != null) {
  1375. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1376. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  1377. }
  1378. }
  1379. if (this.prescriptions[i].addition != null) {
  1380. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1381. total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
  1382. }
  1383. }
  1384. }
  1385. return Math.floor(total * 100) / 100
  1386. }, getMonthTotal() {
  1387. var total = 0
  1388. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1389. if (this.month_prescriptions[i].advices != null) {
  1390. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1391. total = total + this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number
  1392. }
  1393. }
  1394. if (this.month_prescriptions[i].project != null) {
  1395. for (let b = 0; b < this.month_prescriptions[i].project.length; b++) {
  1396. total = total + this.month_prescriptions[i].project[b].price * this.month_prescriptions[i].project[b].total
  1397. }
  1398. }
  1399. if (this.month_prescriptions[i].addition != null) {
  1400. for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  1401. total = total + this.month_prescriptions[i].addition[b].price * this.month_prescriptions[i].addition[b].count
  1402. }
  1403. }
  1404. }
  1405. return Math.floor(total * 100) / 100
  1406. },
  1407. createFilter(queryString) {
  1408. return (restaurant) => {
  1409. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  1410. }
  1411. },
  1412. querySearch2(queryString, cb) {
  1413. var restaurants = this.other_sick
  1414. restaurants.map(item => {
  1415. item.value = item.name
  1416. })
  1417. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  1418. // 调用 callback 返回建议列表的数据
  1419. cb(results)
  1420. },
  1421. changeKind(val) {
  1422. this.drugs = []
  1423. if (val == 0) {
  1424. this.drugs = this.allDrugs
  1425. } else {
  1426. for (let i = 0; i < this.allDrugs.length; i++) {
  1427. if (this.allDrugs[i].drug_type == val) {
  1428. this.drugs.push(this.allDrugs[i])
  1429. }
  1430. }
  1431. }
  1432. },
  1433. getDictionaryDataConfig(module, filed_name) {
  1434. return getDictionaryDataConfig(module, filed_name)
  1435. },
  1436. getInitData() {
  1437. getInitData().then(response => {
  1438. if (response.data.state == 0) {
  1439. this.$message.error(response.data.msg)
  1440. return false
  1441. } else {
  1442. this.drugs = response.data.data.drugs
  1443. this.allDrugs = response.data.data.drugs
  1444. this.advices_template = response.data.data.advices_template
  1445. this.doctors = response.data.data.doctors
  1446. for (let i = 0; i < this.doctors.length; i++){
  1447. if(this.doctors[i].user_type == 1){
  1448. this.doctors.splice(i,1)
  1449. }
  1450. }
  1451. this.department = response.data.data.department
  1452. this.sick = response.data.data.sick
  1453. this.diagnoses = response.data.data.diagnose
  1454. this.additions = response.data.data.additions
  1455. // var info = response.data.data.info
  1456. // if (info.user_type == 2 || info.user_type == 1) {
  1457. // this.doctorValue = info.admin_user_id
  1458. // if (info.department_id == 0) {
  1459. // if (this.department.length > 0) {
  1460. // this.departmentValue = this.department[0].id
  1461. // } else {
  1462. // this.departmentValue = ''
  1463. //
  1464. // }
  1465. // } else {
  1466. // this.departmentValue = info.department_id
  1467. // }
  1468. // }else{
  1469. // this.doctorValue = this.doctors[0].admin_user_id
  1470. // }
  1471. }
  1472. })
  1473. },
  1474. monthTabclickEvent(val) {
  1475. console.log(val)
  1476. console.log(this.month_prescriptions)
  1477. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1478. if (this.month_prescriptions[i].name == val.name) {
  1479. if (this.dayorMonth == 'month') {
  1480. if (this.isShowDayPrescription) {
  1481. this.curDayPrescriptions = this.month_prescriptions[i]
  1482. console.log(this.curDayPrescriptions)
  1483. //用来区分处方属于项目还是药品
  1484. if (this.curDayPrescriptions.advices.length > 0 && this.curDayPrescriptions.project.length == 0) {
  1485. this.monthCustomTabIndex = 1
  1486. }
  1487. if (this.curDayPrescriptions.advices.length == 0 && this.curDayPrescriptions.project.length > 0) {
  1488. this.monthCustomTabIndex = 2
  1489. }
  1490. } else {
  1491. this.curMonthPrescriptions = this.month_prescriptions[i]
  1492. //用来区分处方属于项目还是药品
  1493. if (this.curMonthPrescriptions.advices.length > 0 && this.curMonthPrescriptions.project.length == 0) {
  1494. this.monthCustomTabIndex = 1
  1495. }
  1496. if (this.curMonthPrescriptions.advices.length == 0 && this.curMonthPrescriptions.project.length > 0) {
  1497. this.monthCustomTabIndex = 2
  1498. }
  1499. }
  1500. }
  1501. this.teamList = []
  1502. this.curDrugs = []
  1503. this.$refs.multipleTable.clearSelection()
  1504. this.$refs.tables.clearSelection()
  1505. }
  1506. }
  1507. },
  1508. tabclickEvent(val) {
  1509. for (let i = 0; i < this.prescriptions.length; i++) {
  1510. if (this.prescriptions[i].name == val.name) {
  1511. this.prescription_id = this.prescriptions[i].id
  1512. this.$emit('event1', this.prescription_id)
  1513. this.curPrescriptions = this.prescriptions[i]
  1514. this.teamList = []
  1515. this.curDrugs = []
  1516. this.$refs.multipleTable.clearSelection()
  1517. this.$refs.tables.clearSelection()
  1518. //用来区分处方属于项目还是药品
  1519. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1520. this.customTabIndex = 1
  1521. this.curStatus = 1
  1522. this.rightTab = 1
  1523. this.showOne = true
  1524. this.showTwo = false
  1525. }
  1526. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1527. this.customTabIndex = 2
  1528. this.curStatus = 2
  1529. this.rightTab = 2
  1530. this.showTwo = true
  1531. this.showOne = false
  1532. }
  1533. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1534. this.customTabIndex = this.rightTab
  1535. this.curStatus = 0
  1536. }
  1537. }
  1538. }
  1539. },
  1540. clearData() {
  1541. this.curPrescriptions = []
  1542. this.curStatus = 0
  1543. this.curDrugs = []
  1544. this.preDrugs = []
  1545. this.teamList = []
  1546. },
  1547. setData(data, info, admin_info, doctors, department, hisPatientInfo, month_data) {
  1548. for (let i = 0; i < doctors.length; i++){
  1549. if(doctors[i].user_type == 1){
  1550. doctors.splice(i,1)
  1551. }
  1552. }
  1553. this.curMonthPrescriptions = {}
  1554. this.curPrescriptions = {}
  1555. this.prescription_id = data[0].id
  1556. this.editableTabsValue = '处方1'
  1557. this.dayorMonth = 'day'
  1558. this.$emit('event1', this.prescription_id)
  1559. this.curStatus = 0
  1560. this.curPrescriptions = {}
  1561. this.curMonthPrescriptions = {}
  1562. if (month_data && month_data.length > 0) {
  1563. this.curMonthPrescriptions = month_data[0]
  1564. } else {
  1565. this.curMonthPrescriptions = {}
  1566. }
  1567. if (data && data.length > 0) {
  1568. this.curPrescriptions = data[0]
  1569. } else {
  1570. this.curPrescriptions = {}
  1571. }
  1572. this.diagnose = info.diagnosis
  1573. if (this.diagnose == 0) {
  1574. this.diagnose = ''
  1575. }
  1576. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1577. this.curStatus = 1
  1578. this.customTabIndex = 1
  1579. this.rightTab = 1
  1580. this.showOne = true
  1581. this.showTwo = false
  1582. }
  1583. if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
  1584. this.curStatus = 2
  1585. this.customTabIndex = 2
  1586. this.rightTab = 2
  1587. this.showOne = false
  1588. this.showTwo = true
  1589. }
  1590. this.state1 = info.sick_type
  1591. if (this.state1 == 0) {
  1592. this.state1 = ''
  1593. }
  1594. this.state2 = info.sick_history
  1595. if (this.state2 == 0) {
  1596. this.state2 = ''
  1597. }
  1598. if (info.prescription_status == 0) {
  1599. this.order_status = ''
  1600. }
  1601. if (info.prescription_status == 1 || info.prescription_status == 2) {
  1602. this.order_status = '未收费'
  1603. }
  1604. if (info.prescription_status == 3) {
  1605. this.order_status = '已结算'
  1606. }
  1607. if (info.prescription_status == 4) {
  1608. this.order_status = '已退费'
  1609. }
  1610. if (info.id > 0) {
  1611. this.doctorValue = info.doctor_id
  1612. this.departmentValue = info.departments
  1613. } else {
  1614. if (hisPatientInfo.doctor != 0 && hisPatientInfo.department != 0) {
  1615. this.doctorValue = hisPatientInfo.doctor
  1616. this.departmentValue = hisPatientInfo.department
  1617. } else {
  1618. if (admin_info.user_type == 2 || admin_info.user_type == 1) {
  1619. this.doctorValue = admin_info.admin_user_id
  1620. if (admin_info.department_id == 0) {
  1621. if (this.department.length > 0) {
  1622. if (department && department.length > 0) {
  1623. this.departmentValue = department[0].id
  1624. } else {
  1625. this.departmentValue = ''
  1626. }
  1627. } else {
  1628. this.departmentValue = ''
  1629. }
  1630. } else {
  1631. this.departmentValue = admin_info.department_id
  1632. }
  1633. } else {
  1634. this.doctorValue = doctors[0].admin_user_id
  1635. }
  1636. if (this.doctorValue == 0) {
  1637. this.doctorValue = ''
  1638. }
  1639. }
  1640. }
  1641. if (info.register_type == 0) {
  1642. this.register_type = ''
  1643. } else {
  1644. this.register_type = info.register_type
  1645. }
  1646. },
  1647. moreState(tab, event) {
  1648. if (tab == 'more') {
  1649. return false
  1650. }
  1651. }, open_two() {
  1652. if (this.dayorMonth == 'day') {
  1653. if (this.curPrescriptions.order_status == 2) {
  1654. this.$message.error('处方已经结算,无法添加')
  1655. return
  1656. }
  1657. if (this.patientInfo == null || this.patientInfo.id == 0) {
  1658. this.$message.error('请选择患者')
  1659. return
  1660. }
  1661. let params = {
  1662. end_time: this.record_date,
  1663. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1664. patient_id: this.patientInfo.id
  1665. }
  1666. getCallHisPrescription(params).then(response => {
  1667. if (response.data.state == 1) {
  1668. this.$refs.call_prescription.show(this.patientInfo.name, this.patientInfo.id, params.end_time, params.start_time, this.prescriptions, response.data.data.prescriptions)
  1669. } else {
  1670. this.$message.error(response.data.msg)
  1671. }
  1672. })
  1673. } else {
  1674. this.$message.error('当前属于月结状态,无法试用处方调用')
  1675. return
  1676. }
  1677. },
  1678. open(index, isLoading) {
  1679. if (this.dayorMonth == 'day') {
  1680. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  1681. this.$message.error('请先开处方')
  1682. return
  1683. }
  1684. }
  1685. if (this.dayorMonth == 'day') {
  1686. if (this.curPrescriptions.order_status == 2) {
  1687. this.$message.error('当前处方已经结算,无法保存')
  1688. return
  1689. }
  1690. if (this.doctorValue.length <= 0) {
  1691. this.$message.error('医生不能为空')
  1692. return
  1693. }
  1694. if (this.departmentValue.length <= 0) {
  1695. this.$message.error('科室不能为空')
  1696. return
  1697. }
  1698. if (this.state1 <= 0) {
  1699. this.$message.error('疾病类型不能为空')
  1700. return
  1701. }
  1702. if (index == 1) {
  1703. let params = {
  1704. patient_id: this.patientInfo.id,
  1705. diagnose: this.diagnose,
  1706. sick_type: this.state1,
  1707. sick_history: this.state2,
  1708. doctor: this.doctorValue,
  1709. department: this.departmentValue,
  1710. record_date: this.record_date,
  1711. his_patient_id: this.hisPatientInfo.id,
  1712. reg_type: this.register_type
  1713. }
  1714. for (let i = 0; i < this.prescriptions.length; i++) {
  1715. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  1716. this.prescriptions[i]['type'] = 1
  1717. }
  1718. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  1719. this.prescriptions[i]['type'] = 2
  1720. }
  1721. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  1722. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  1723. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  1724. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  1725. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  1726. }
  1727. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1728. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  1729. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  1730. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  1731. }
  1732. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1733. this.prescriptions[i].addition[b].id = parseInt(this.prescriptions[i].addition[b].id)
  1734. this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
  1735. this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
  1736. this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
  1737. }
  1738. }
  1739. let data = {
  1740. 'prescriptions': this.prescriptions
  1741. }
  1742. isLoading = true
  1743. createHisPrescription(data, params).then(response => {
  1744. if (response.data.state == 1) {
  1745. this.$emit('change')
  1746. this.$message.success('保存成功')
  1747. }
  1748. })
  1749. } else if (index == 2) {
  1750. this.$router.push('/outpatientDoctorStation/print')
  1751. } else if (index == 4) {
  1752. } else if (index == 5) {
  1753. this.$refs.saveTemplate.show()
  1754. }
  1755. } else if (this.dayorMonth == 'month') {
  1756. if (this.isShowDayPrescription) {
  1757. if (this.curDayPrescriptions.order_status == 2) {
  1758. this.$message.error('当前处方已经结算,无法保存')
  1759. return
  1760. }
  1761. if (this.doctorValue.length <= 0) {
  1762. this.$message.error('医生不能为空')
  1763. return
  1764. }
  1765. if (this.departmentValue.length <= 0) {
  1766. this.$message.error('科室不能为空')
  1767. return
  1768. }
  1769. if (index == 1) {
  1770. let params = {
  1771. patient_id: this.patientInfo.id,
  1772. diagnose: this.diagnose,
  1773. sick_type: this.state1,
  1774. sick_history: this.state2,
  1775. doctor: this.doctorValue,
  1776. department: this.departmentValue,
  1777. record_date: this.end_time,
  1778. his_patient_id: this.hisPatientInfo.id,
  1779. reg_type: this.register_type
  1780. }
  1781. var month_prescriptions = this.deepClone(this.month_prescriptions)
  1782. for (let i = 0; i < month_prescriptions.length; i++) {
  1783. if (month_prescriptions[i].advices.length > 0 && month_prescriptions[i].project.length == 0) {
  1784. month_prescriptions[i]['type'] = 1
  1785. }
  1786. if (month_prescriptions[i].advices.length == 0 && month_prescriptions[i].project.length > 0) {
  1787. month_prescriptions[i]['type'] = 2
  1788. }
  1789. for (let b = 0; b < month_prescriptions[i].advices.length; b++) {
  1790. month_prescriptions[i].advices[b].single_dose = month_prescriptions[i].advices[b].single_dose.toString()
  1791. month_prescriptions[i].advices[b].prescribing_number = month_prescriptions[i].advices[b].prescribing_number.toString()
  1792. month_prescriptions[i].advices[b].retail_price = month_prescriptions[i].advices[b].retail_price.toString()
  1793. month_prescriptions[i].advices[b].day = parseInt(month_prescriptions[i].advices[b].day)
  1794. }
  1795. for (let b = 0; b < month_prescriptions[i].project.length; b++) {
  1796. console.log('~~~~~~~')
  1797. month_prescriptions[i].project[b].price = month_prescriptions[i].project[b].price.toString()
  1798. month_prescriptions[i].project[b].total = month_prescriptions[i].project[b].total.toString()
  1799. month_prescriptions[i].project[b].delivery_way = month_prescriptions[i].project[b].delivery_way.toString()
  1800. }
  1801. for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  1802. month_prescriptions[i].addition[b].id = parseInt(month_prescriptions[i].addition[b].id)
  1803. month_prescriptions[i].addition[b].item_id = parseInt(month_prescriptions[i].addition[b].item_id)
  1804. month_prescriptions[i].addition[b].price = month_prescriptions[i].addition[b].price.toString()
  1805. month_prescriptions[i].addition[b].count = month_prescriptions[i].addition[b].count.toString()
  1806. }
  1807. }
  1808. let data = {
  1809. 'prescriptions': month_prescriptions
  1810. }
  1811. editHisPrescription(data, params).then(response => {
  1812. if (response.data.state == 1) {
  1813. this.month_prescriptions = month_prescriptions
  1814. this.$message.success('编辑成功')
  1815. }
  1816. })
  1817. }
  1818. }
  1819. }
  1820. },
  1821. addTab(targetName) {
  1822. if (this.curPrescriptions.order_status == 2) {
  1823. this.$message.error('该处方已经结算或者退费,无法继续添加处方')
  1824. return
  1825. }
  1826. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1827. this.$message.error('当前处方无数据,新增数据后才能新增处方')
  1828. return
  1829. }
  1830. this.tabIndex = this.prescriptions.length
  1831. ++this.tabIndex
  1832. let newTabName = '处方' + this.tabIndex
  1833. var nowDate = new Date()
  1834. var nowYear = nowDate.getFullYear()
  1835. var nowMonth = nowDate.getMonth() + 1
  1836. var nowDay = nowDate.getDate()
  1837. var hours = nowDate.getHours()
  1838. var min = nowDate.getMinutes()
  1839. var nowTime =
  1840. nowYear +
  1841. '-' +
  1842. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1843. '-' +
  1844. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1845. ':' + (min < 10 ? '0' + min : min)
  1846. this.prescriptions.push({
  1847. id: 0,
  1848. name: newTabName,
  1849. order_status: 0,
  1850. advices: [],
  1851. project: [],
  1852. addition: [],
  1853. pre_time: nowTime
  1854. })
  1855. this.editableTabsValue = newTabName
  1856. this.curPrescriptions = this.prescriptions[this.prescriptions.length - 1]
  1857. this.curStatus = 0
  1858. },
  1859. removeTab(targetName) {
  1860. if (this.curPrescriptions.order_status == 2) {
  1861. this.$message.error('该处方已经结算,无法删除')
  1862. return
  1863. }
  1864. if (targetName == '处方1') {
  1865. this.$message.error('该处方无法删除')
  1866. return
  1867. }
  1868. this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
  1869. confirmButtonText: '确 定',
  1870. cancelButtonText: '取 消',
  1871. type: 'warning'
  1872. }).then(() => {
  1873. let id = 0
  1874. for (let i = 0; i < this.prescriptions.length; i++) {
  1875. if (this.prescriptions[i].name == targetName) {
  1876. id = this.prescriptions[i].id
  1877. }
  1878. }
  1879. if (id == 0) {
  1880. let tabs = this.prescriptions
  1881. let activeName = this.editableTabsValue
  1882. if (activeName === targetName) {
  1883. tabs.forEach((tab, index) => {
  1884. if (tab.name === targetName) {
  1885. let nextTab = tabs[index + 1] || tabs[index - 1]
  1886. if (nextTab) {
  1887. activeName = nextTab.name
  1888. }
  1889. }
  1890. })
  1891. }
  1892. this.editableTabsValue = activeName
  1893. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1894. for (let i = 0; i < this.prescriptions.length; i++) {
  1895. if (activeName == this.prescriptions[i].name) {
  1896. this.curPrescriptions = this.prescriptions[i]
  1897. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1898. this.curStatus = 1
  1899. }
  1900. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1901. this.curStatus = 2
  1902. }
  1903. }
  1904. }
  1905. if (this.prescriptions.length == 0) {
  1906. this.curPrescriptions = []
  1907. this.curStatus = 0
  1908. }
  1909. } else {
  1910. let params = {
  1911. 'id': id
  1912. }
  1913. delHisPrescription(params).then(response => {
  1914. if (response.data.state == 1) {
  1915. this.$message.success('删除成功')
  1916. let tabs = this.prescriptions
  1917. let activeName = this.editableTabsValue
  1918. if (activeName === targetName) {
  1919. tabs.forEach((tab, index) => {
  1920. if (tab.name === targetName) {
  1921. let nextTab = tabs[index + 1] || tabs[index - 1]
  1922. if (nextTab) {
  1923. activeName = nextTab.name
  1924. }
  1925. }
  1926. })
  1927. }
  1928. this.editableTabsValue = activeName
  1929. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1930. for (let i = 0; i < this.prescriptions.length; i++) {
  1931. if (activeName == this.prescriptions[i].name) {
  1932. this.curPrescriptions = this.prescriptions[i]
  1933. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1934. this.curStatus = 1
  1935. }
  1936. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1937. this.curStatus = 2
  1938. }
  1939. }
  1940. }
  1941. if (this.prescriptions.length == 0) {
  1942. this.curPrescriptions = []
  1943. this.curStatus = 0
  1944. }
  1945. } else {
  1946. this.$message.success(response.data.msg)
  1947. }
  1948. })
  1949. }
  1950. }).catch(() => {
  1951. })
  1952. },
  1953. beforeLeave(activeName, oldActiveName) {
  1954. let index = activeName
  1955. if (index == 1) {
  1956. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1957. return false
  1958. }
  1959. } else {
  1960. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1961. return false
  1962. }
  1963. }
  1964. },
  1965. clickTab(tab) {
  1966. let index = parseInt(tab.name)
  1967. if (index == 1) {
  1968. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1969. this.$message.error('当前处方为项目,无法切换为药品,需要新开处方')
  1970. return
  1971. }
  1972. } else {
  1973. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1974. this.$message.error('当前处方为药品,无法切换为项目,需要新开处方')
  1975. return
  1976. }
  1977. }
  1978. if (index == 1) {
  1979. this.teamList = []
  1980. this.$refs.tables.clearSelection()
  1981. this.showOne = true
  1982. this.showTwo = false
  1983. this.$nextTick(() => {
  1984. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1985. })
  1986. this.customTabIndex = 1
  1987. }
  1988. if (index == 2) {
  1989. this.curDrugs = []
  1990. this.$refs.multipleTable.clearSelection()
  1991. this.showTwo = true
  1992. this.showOne = false
  1993. this.$nextTick(() => {
  1994. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1995. })
  1996. this.customTabIndex = 2
  1997. }
  1998. this.rightTab = index
  1999. //用来区分处方属于项目还是药品
  2000. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2001. this.customTabIndex = 1
  2002. this.curStatus = 1
  2003. }
  2004. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2005. this.customTabIndex = 2
  2006. this.curStatus = 2
  2007. }
  2008. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  2009. // this.customTabIndex = this.rightTab
  2010. this.customTabIndex = index
  2011. this.curStatus = 0
  2012. }
  2013. }, changeAllGoodInfoTableData: function(selection) {
  2014. this.curDrugs = selection
  2015. }, addCharges() {
  2016. this.$refs.additionalCharges.show()
  2017. },
  2018. selectDrugs(selection, row) {
  2019. this.curDrugs = selection
  2020. },
  2021. comfirm() {
  2022. console.log("222222222222",this.curPrescriptions)
  2023. if (this.curPrescriptions.order_status == 2) {
  2024. this.$message.error('该处方已经结算,无法继续添加药品或者项目')
  2025. this.teamList = []
  2026. this.curDrugs = []
  2027. this.tempDrugs = []
  2028. this.$refs.tables.clearSelection()
  2029. this.$refs.multipleTableTwo.clearSelection()
  2030. this.$refs.multipleTable.clearSelection()
  2031. return
  2032. }
  2033. if (this.curStatus == 1 && this.rightTab == 2) {
  2034. this.$message.error('改处方是药品,无法添加项目')
  2035. this.teamList = []
  2036. this.$refs.tables.clearSelection()
  2037. return
  2038. }
  2039. if (this.curStatus == 2 && this.rightTab == 1) {
  2040. this.$message.error('改处方是项目,无法添加药品')
  2041. this.curDrugs = []
  2042. this.tempDrugs = []
  2043. this.$refs.multipleTable.clearSelection()
  2044. this.$refs.multipleTableTwo.clearSelection()
  2045. return
  2046. }
  2047. for (let i = 0; i < this.teamList.length; i++) {
  2048. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  2049. if (this.teamList[i].id == this.curPrescriptions.project[a].project_id) {
  2050. this.$message.error('当前处方存在相同的药品,无法添加相同的项目')
  2051. return
  2052. }
  2053. }
  2054. }
  2055. console.log( this.curDrugs)
  2056. console.log( this.curPrescriptions.advices)
  2057. for (let i = 0; i < this.curDrugs.length; i++) {
  2058. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2059. if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
  2060. this.$message.error('当前处方存在相同的药品,无法添加相同的药品')
  2061. return
  2062. }
  2063. }
  2064. }
  2065. let templateDrugs = []
  2066. for (let i = 0; i < this.tempDrugs.length; i++) {
  2067. for (let a = 0; a < this.tempDrugs[i].advices.length; a++) {
  2068. templateDrugs.push(this.tempDrugs[i].advices[a])
  2069. }
  2070. }
  2071. // for (let i = 0; i < templateDrugs.length; i++) {
  2072. // for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2073. // if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
  2074. // this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  2075. // return
  2076. //
  2077. // }
  2078. // }
  2079. // }
  2080. for (let i = 0; i < this.prescriptions.length; i++) {
  2081. if (this.prescriptions[i].name == this.editableTabsValue) {
  2082. var temp = this.deepClone(this.curDrugs)
  2083. var temp2 = this.deepClone(this.teamList)
  2084. var temp3 = this.deepClone(templateDrugs)
  2085. if (temp3.length > 0) {
  2086. for (let b = 0; b < temp3.length; b++) {
  2087. let obj = {
  2088. advice_id: 0,
  2089. id: temp3[b].id,
  2090. drug_name: temp3[b].advice_name,
  2091. single_dose: temp3[b].single_dose,
  2092. delivery_way: temp3[b].delivery_way,
  2093. execution_frequency: temp3[b].execution_frequency,
  2094. retail_price: temp3[b].drug.retail_price.toString(),
  2095. remark: '',
  2096. day: 1,
  2097. prescribing_number: temp3[b].prescribing_number,
  2098. single_dose_unit: temp3[b].drug.min_unit,
  2099. prescribing_number_unit: temp3[b].drug.max_unit,
  2100. medical_insurance_number: temp3[b].drug.medical_insurance_number
  2101. }
  2102. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  2103. obj.prescribing_number = 1
  2104. }
  2105. this.prescriptions[i].advices.push(obj)
  2106. }
  2107. this.curStatus = 1
  2108. }
  2109. if (temp.length > 0) {
  2110. for (let b = 0; b < temp.length; b++) {
  2111. let obj = {
  2112. advice_id: 0,
  2113. id: temp[b].id,
  2114. drug_name: temp[b].drug_name,
  2115. single_dose: temp[b].single_dose,
  2116. delivery_way: temp[b].delivery_way,
  2117. execution_frequency: temp[b].execution_frequency,
  2118. retail_price: temp[b].retail_price.toString(),
  2119. remark: '',
  2120. day: 1,
  2121. prescribing_number: temp[b].prescribing_number,
  2122. single_dose_unit: temp[b].min_unit,
  2123. prescribing_number_unit: temp[b].max_unit,
  2124. medical_insurance_number: temp[b].medical_insurance_number
  2125. }
  2126. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  2127. obj.prescribing_number = 1
  2128. }
  2129. this.prescriptions[i].advices.push(obj)
  2130. }
  2131. this.curStatus = 1
  2132. }
  2133. if(this.activeName == 2){
  2134. for(let i = 0; i<temp2.length;i++){
  2135. for(let j=0;j<this.hisList.length;j++){
  2136. if(temp2[i].id == this.hisList[j].project_id){
  2137. temp2[i].total = this.hisList[j].number
  2138. }
  2139. }
  2140. }
  2141. }
  2142. if (temp2.length > 0) {
  2143. console.log("temp2222222222",temp2)
  2144. for (let b = 0; b < temp2.length; b++) {
  2145. let obj = {
  2146. id: 0,
  2147. project_id: temp2[b].id,
  2148. project_name: temp2[b].project_name,
  2149. statistical_classification: temp2[b].statistical_classification,
  2150. single_dose: temp2[b].single_dose,
  2151. delivery_way: temp2[b].delivery_way,
  2152. execution_frequency: temp2[b].execution_frequency,
  2153. number_days: temp2[b].number_days,
  2154. total: temp2[b].total,
  2155. price: temp2[b].price,
  2156. remark: '',
  2157. medical_code: temp2[b].medical_code,
  2158. unit: temp2[b].unit
  2159. }
  2160. if (obj.total == 0) {
  2161. obj.total = 1
  2162. }
  2163. this.prescriptions[i].project.push(obj)
  2164. }
  2165. this.curStatus = 2
  2166. }
  2167. this.curPrescriptions = this.prescriptions[i]
  2168. this.$refs.multipleTable.clearSelection()
  2169. this.$refs.tables.clearSelection()
  2170. }
  2171. }
  2172. this.curDrugs = []
  2173. this.preDrugs = []
  2174. this.teamList = []
  2175. }, changeAllGoodInfoTableDataTwo(row) {
  2176. this.teamList = row
  2177. },
  2178. selectChange(row) {
  2179. this.teamList = row
  2180. },
  2181. getlist() {
  2182. getHisProject().then(response => {
  2183. if (response.data.state == 1) {
  2184. var project = response.data.data.project
  2185. this.tabProject = project
  2186. this.allProject = project
  2187. }
  2188. })
  2189. }, deepClone(source) {
  2190. if (!source && typeof source !== 'object') {
  2191. throw new Error('error arguments', 'shallowClone')
  2192. }
  2193. const targetObj = source.constructor === Array ? [] : {}
  2194. Object.keys(source).forEach((keys) => {
  2195. if (source[keys] && typeof source[keys] === 'object') {
  2196. targetObj[keys] = this.deepClone(source[keys])
  2197. } else {
  2198. targetObj[keys] = source[keys]
  2199. }
  2200. })
  2201. return targetObj
  2202. },
  2203. getAllProjectTeam() {
  2204. getAllProjectTeam().then(response => {
  2205. if (response.data.state == 1) {
  2206. var team = response.data.data.team
  2207. console.log("team2222",team)
  2208. this.tabPrjectTeam = team
  2209. }
  2210. })
  2211. },
  2212. selectTeam(row) {
  2213. console.log("row",row)
  2214. var arr = []
  2215. for (let i = 0; i < row.length; i++) {
  2216. arr.push(row[i].project_id)
  2217. }
  2218. var ids = arr.join(',')
  2219. var strArr = ids.split(',')
  2220. var res = []//接收不重复的数据
  2221. for (var i = 0; i < strArr.length; i++) {
  2222. var flag = true
  2223. for (var j = 0; j < i; j++) {
  2224. if (strArr[i] === strArr[j]) {
  2225. flag = false
  2226. break
  2227. }
  2228. }
  2229. if (flag) {
  2230. res.push(strArr[i])
  2231. }
  2232. }
  2233. var idstr = res.join(',')
  2234. const params = {
  2235. project_id: idstr
  2236. }
  2237. getPojectListById(params).then(response => {
  2238. if (response.data.state == 1) {
  2239. var project = response.data.data.project
  2240. this.teamList = []
  2241. this.teamList = project
  2242. }
  2243. })
  2244. }, changeDoctor(val) {
  2245. for (let i = 0; i < this.doctors.length; i++) {
  2246. if (this.doctors[i].admin_user_id == this.doctorValue) {
  2247. this.departmentValue = this.doctors[i].department_id
  2248. }
  2249. }
  2250. if (this.departmentValue == 0) {
  2251. this.departmentValue = ''
  2252. }
  2253. },
  2254. changeDayOrMonth(tab) {
  2255. if (this.dayorMonth == 'day') {
  2256. } else if (this.dayorMonth == 'month') {
  2257. }
  2258. },
  2259. getAllProjectList(){
  2260. getAllProjectList().then(response=>{
  2261. if(response.data.state == 1){
  2262. var hisprojectlist = response.data.data.hisprojectlist
  2263. console.log("hisprojectlist",hisprojectlist)
  2264. this.hisList = hisprojectlist
  2265. }
  2266. })
  2267. }
  2268. }, mounted() {
  2269. this.request_record_date = this.record_date
  2270. this.getInitData()
  2271. //获取所有项目
  2272. this.getlist()
  2273. //获取所以项目组套
  2274. this.getAllProjectTeam()
  2275. this.getAllProjectList()
  2276. this.$nextTick(() => {
  2277. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2278. })
  2279. },
  2280. watch: {
  2281. fullHeight(val) {
  2282. if (!this.timer) {
  2283. this.fullHeight = val
  2284. let tableHeight = val - 263
  2285. this.tableHeight = tableHeight
  2286. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2287. this.timer = true
  2288. let that = this
  2289. setTimeout(function() {
  2290. that.timer = false
  2291. }, 400)
  2292. }
  2293. }
  2294. }
  2295. }
  2296. </script>
  2297. <style lang="scss" scoped>
  2298. .new-main-contain {
  2299. height: 100%;
  2300. display: flex;
  2301. flex-direction: column;
  2302. }
  2303. .app-container {
  2304. height: 100%;
  2305. }
  2306. .mainCell {
  2307. height: 36px;
  2308. display: flex;
  2309. align-items: center;
  2310. }
  2311. .mainLeft {
  2312. width: 200px;
  2313. height: 100%;
  2314. display: flex;
  2315. flex-direction: column;
  2316. margin-top: 2px;
  2317. .el-radio {
  2318. margin-right: 5px;
  2319. }
  2320. }
  2321. .mainRight {
  2322. margin-left: 20px;
  2323. flex: 1;
  2324. height: 100%;
  2325. display: flex;
  2326. flex-direction: column;
  2327. .cellSpan {
  2328. min-width: 80px;
  2329. display: inline-block;
  2330. margin-right: 10px;
  2331. }
  2332. }
  2333. .mainCenter {
  2334. display: flex;
  2335. flex: 1;
  2336. height: 100%;
  2337. }
  2338. .centerLeft {
  2339. flex: 1;
  2340. display: flex;
  2341. flex-direction: column;
  2342. position: relative;
  2343. .el-form-item {
  2344. width: 33%;
  2345. margin-bottom: 14px;
  2346. }
  2347. .el-form-item__label {
  2348. text-align: left;
  2349. }
  2350. }
  2351. .backColor {
  2352. background: #f6f8f9;
  2353. height: 5px;
  2354. margin-bottom: 5px;
  2355. }
  2356. .RP {
  2357. color: #409EFF;
  2358. font-size: 14px;
  2359. margin-bottom: 5px;
  2360. }
  2361. .tabsBox {
  2362. position: relative;
  2363. flex: 1;
  2364. overflow-y: auto;
  2365. margin-bottom: 60px;
  2366. /*/ / margin-top: 4 px;*/
  2367. .el-tabs__item {
  2368. padding: 0 10px;
  2369. }
  2370. }
  2371. .preTabs {
  2372. height: 100%;
  2373. display: flex;
  2374. flex-direction: column;
  2375. .el-tabs__content {
  2376. flex: 1;
  2377. overflow-y: auto;
  2378. }
  2379. }
  2380. .costBox {
  2381. width: 100%;
  2382. height: 60px;
  2383. background: #fff;
  2384. position: absolute;
  2385. bottom: 0;
  2386. display: flex;
  2387. align-items: center;
  2388. justify-content: space-between;
  2389. }
  2390. .statusRed {
  2391. color: red;
  2392. }
  2393. .addTab {
  2394. position: absolute;
  2395. right: 8px;
  2396. top: 3px;
  2397. z-index: 20;
  2398. }
  2399. .centerRight {
  2400. width: 300px;
  2401. margin-left: 10px;
  2402. display: flex;
  2403. flex-direction: column;
  2404. position: relative;
  2405. }
  2406. .rightTab {
  2407. height: 40px;
  2408. width: 100%;
  2409. border: 1px solid #d2d2d2;
  2410. box-sizing: border-box;
  2411. p {
  2412. width: 50%;
  2413. height: 40px;
  2414. line-height: 40px;
  2415. text-align: center;
  2416. background: #eee;
  2417. float: left;
  2418. }
  2419. > p:last-child {
  2420. border-left: 1px solid #d2d2d2;
  2421. float: right;
  2422. }
  2423. .activeP {
  2424. background: #409EFF;
  2425. color: #fff;
  2426. }
  2427. }
  2428. .rightTabs {
  2429. display: flex;
  2430. flex-direction: column;
  2431. }
  2432. .comfirmBox {
  2433. width: 100%;
  2434. height: 60px;
  2435. background: #fff;
  2436. position: absolute;
  2437. bottom: 0;
  2438. display: flex;
  2439. align-items: center;
  2440. justify-content: space-between;
  2441. z-index: 99;
  2442. }
  2443. .borderCard {
  2444. height: 100%;
  2445. display: flex;
  2446. flex-direction: column;
  2447. margin-bottom: 60px;
  2448. .el-tabs--border-card > .el-tabs__content {
  2449. padding: 0;
  2450. }
  2451. }
  2452. </style>
  2453. <style lang="scss">
  2454. .borderCard {
  2455. .el-tabs__nav {
  2456. width: 100%;
  2457. }
  2458. .el-tabs__item {
  2459. width: 50%;
  2460. text-align: center;
  2461. }
  2462. .el-tabs__content {
  2463. padding: 5px;
  2464. flex: 1;
  2465. }
  2466. }
  2467. .centerLeft {
  2468. .el-form-item__label {
  2469. text-align: left;
  2470. }
  2471. }
  2472. .tabsBox {
  2473. .el-tabs__item {
  2474. padding: 0 10px;
  2475. }
  2476. .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) {
  2477. padding: 0 10px;
  2478. }
  2479. .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 {
  2480. padding: 0 10px;
  2481. }
  2482. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  2483. padding: 0 10px;
  2484. }
  2485. }
  2486. .centerRight {
  2487. .el-tabs__nav-scroll {
  2488. display: flex;
  2489. }
  2490. .el-tabs__nav {
  2491. margin: 0 auto;
  2492. }
  2493. .el-table th .cell, .el-table td .cell {
  2494. padding: 0 2px;
  2495. }
  2496. }
  2497. .preTabs {
  2498. .el-tabs__content {
  2499. flex: 1;
  2500. overflow-y: auto;
  2501. padding: 5px 0 5px 5px;
  2502. }
  2503. }
  2504. .rightTabs {
  2505. height: 100%;
  2506. .el-tabs__nav {
  2507. width: auto;
  2508. }
  2509. .el-tabs__header {
  2510. margin-bottom: 5px;
  2511. }
  2512. .el-tabs__item {
  2513. width: auto;
  2514. text-align: inherit;
  2515. }
  2516. .el-tabs__content {
  2517. flex: 1;
  2518. overflow-y: auto;
  2519. }
  2520. .el-tab-pane {
  2521. display: flex;
  2522. flex-direction: column;
  2523. height: 100%;
  2524. }
  2525. }
  2526. #tab-more {
  2527. .el-icon-close {
  2528. display: none;
  2529. }
  2530. }
  2531. ::-webkit-scrollbar {
  2532. height: 15px;
  2533. }
  2534. </style>