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

deskPrescription.vue 131KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659
  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-button size="small"-->
  15. <!-- @click="open(1)"-->
  16. <!-- type="primary">入院登记-->
  17. <!-- </el-button>-->
  18. <el-tabs v-model="dayorMonth" @tab-click="changeDayOrMonth">
  19. <el-tab-pane label="日结" name="day"></el-tab-pane>
  20. <el-tab-pane label="月结" name="month"></el-tab-pane>
  21. </el-tabs>
  22. <el-form :model="form" ref="form" label-width="80px"
  23. style="display: flex;flex-wrap: wrap;justify-content: space-between;">
  24. <el-form-item label="姓名:" prop="name" label-position="right">
  25. <el-input v-model="patientInfo.name" placeholder="" readonly></el-input>
  26. </el-form-item>
  27. <el-form-item label="证件号: " prop="name" label-position="right">
  28. <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
  29. </el-form-item>
  30. <!--<el-form-item label="处方类型: " prop="name" label-position="right">-->
  31. <!--<el-select style="width:100%;" v-model="register_type" placeholder="">-->
  32. <!--<el-option-->
  33. <!--v-for="(item,index) in register"-->
  34. <!--:key="index"-->
  35. <!--:label="item.label"-->
  36. <!--:value="item.value">-->
  37. <!--</el-option>-->
  38. <!--</el-select>-->
  39. <!--</el-form-item>-->
  40. <el-form-item label="疾病类型:" prop="name" label-position="right">
  41. <el-select filterable style="width:100%;" v-model="state1" placeholder="">
  42. <el-option
  43. v-for="(item,index) in sick"
  44. :key="index"
  45. :label="item.class_name"
  46. :value="item.id">
  47. </el-option>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item label="诊断:" prop="name" label-position="right" style="width:66.6%;">
  51. <el-select style="width:100%;" v-model="diagnose" placeholder="" multiple filterable>
  52. <el-option
  53. v-for="(item,index) in diagnoses"
  54. :key="index"
  55. :label="item.class_name"
  56. :value="item.id">
  57. </el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item label="过敏病史: " prop="name" label-position="right">
  61. <el-autocomplete
  62. style="width:100%;"
  63. class="inline-input"
  64. v-model="state2"
  65. :fetch-suggestions="querySearch2"
  66. placeholder="请输入内容"
  67. ></el-autocomplete>
  68. </el-form-item>
  69. </el-form>
  70. <div class="tabsBox">
  71. <el-button v-if="dayorMonth == 'day'" type="text" class="addTab" @click="addCharges"
  72. icon="el-icon-circle-plus">附加收费
  73. </el-button>
  74. <div class="RP" v-if="dayorMonth == 'month'">Rp
  75. <el-date-picker
  76. v-model="start_time"
  77. prefix-icon="el-icon-date"
  78. @change="changeTime"
  79. :editable="false"
  80. style="width: 150px;"
  81. type="date"
  82. placeholder="选择开始时间"
  83. align="right"
  84. format="yyyy-MM-dd"
  85. :picker-options="pickerBeginDateBefore"
  86. value-format="yyyy-MM-dd">
  87. </el-date-picker>
  88. <span class>-</span>
  89. <el-date-picker
  90. v-model="end_time"
  91. prefix-icon="el-icon-date"
  92. @change="changeEndTime"
  93. :editable="false"
  94. :picker-options="pickerBeginDateAfter"
  95. style="width: 150px;"
  96. type="date"
  97. placeholder="选择结束时间"
  98. align="right"
  99. format="yyyy-MM-dd"
  100. value-format="yyyy-MM-dd">
  101. </el-date-picker>
  102. </div>
  103. <el-tabs v-show="dayorMonth == 'day'" class="preTabs" v-model="editableTabsValue" type="border-card"
  104. closable
  105. @tab-remove="removeTab"
  106. :before-leave="moreState" @tab-click="tabclickEvent">
  107. <el-tab-pane
  108. v-for="(item, index) in prescriptions"
  109. :key="index"
  110. :label="item.name"
  111. :name="item.name"
  112. >
  113. <div class="RP">Rp
  114. <el-date-picker
  115. v-model="item.pre_time"
  116. type="datetime"
  117. :clearable="false"
  118. format="yyyy-MM-dd HH:mm"
  119. value-format="yyyy-MM-dd HH:mm"
  120. placeholder="选择日期">
  121. </el-date-picker>
  122. <el-select style="width:50%;" v-model="item.med_type" placeholder="医疗类型"
  123. @change="changevalue">
  124. <el-option
  125. v-for="(item,index) in register"
  126. :key="index"
  127. :label="item.label"
  128. :value="item.value">
  129. </el-option>
  130. </el-select>
  131. <div style="float: right;margin-bottom:5px;margin-right:1%;">
  132. <el-button
  133. round
  134. size="small"
  135. @click="openLast(3)"
  136. >上一方
  137. </el-button>
  138. <el-button
  139. round
  140. size="small"
  141. @click="openNext(4)"
  142. >下一方
  143. </el-button>
  144. </div>
  145. </div>
  146. </el-tab-pane>
  147. <el-tab-pane name="more" closable v-if="dayorMonth == 'day'"><span slot="label"><i
  148. class="el-icon-plus"
  149. @click="addTab"></i></span>
  150. </el-tab-pane>
  151. <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
  152. :prescription="curPrescriptions"
  153. :preDrugs="preDrugs"
  154. :activeType="customTabIndex"></prescription-table>
  155. </el-tabs>
  156. <el-tabs v-show="dayorMonth == 'month'" class="preTabs" v-model="editableTabsValueTwo"
  157. type="border-card"
  158. :before-leave="moreState" @tab-click="monthTabclickEvent">
  159. <el-tab-pane
  160. v-for="(item, index) in month_prescriptions"
  161. :key="index"
  162. :label="item.name"
  163. :name="item.name"
  164. >
  165. </el-tab-pane>
  166. <month-prescription-table v-if="dayorMonth == 'month' && !isShowDayPrescription"
  167. ref="month_prescription_tables"
  168. :prescription="curMonthPrescriptions"
  169. :activeType="monthCustomTabIndex"></month-prescription-table>
  170. <day-prescription-table v-if="dayorMonth == 'month' && isShowDayPrescription"
  171. ref="month_prescription_tables" :prescription="curDayPrescriptions"
  172. :activeType="monthCustomTabIndex"></day-prescription-table>
  173. </el-tabs>
  174. </div>
  175. <div class="costBox">
  176. <div>
  177. <span><span style="color: red">*</span>医生:</span>
  178. <el-select style="margin-right:5px;width:140px;" v-model="doctorValue" placeholder=""
  179. @change="changeDoctor">
  180. <el-option
  181. v-for="(item,index) in doctors"
  182. :key="index"
  183. :label="item.user_name"
  184. :value="item.admin_user_id">
  185. </el-option>
  186. </el-select>
  187. <span> <span style="color: red">*</span>科室:</span>
  188. <el-select style="margin-right:5px;width:140px;" v-model="departmentValue" placeholder="">
  189. <el-option
  190. v-for="(item,index) in department"
  191. :key="index"
  192. :label="item.name"
  193. :value="item.id">
  194. </el-option>
  195. </el-select>
  196. <span>当前处方总价:</span>
  197. <span style="color:red;" v-if="dayorMonth == 'day'">{{ getTotalOne() ? getTotalOne() : '' }}元</span>
  198. <span style="color:red;" v-if="dayorMonth == 'month'">{{ getTotalTwo() ? getTotalTwo() : '' }}元</span>
  199. <span style="margin-left:10px;">总价:</span>
  200. <span style="color:red;" v-if="dayorMonth == 'day'">{{ getTotal() ? getTotal() : '' }}元</span>
  201. <span style="color:red;"
  202. v-if="dayorMonth == 'month'">{{ getMonthTotal() ? getMonthTotal() : '' }}元</span>
  203. </div>
  204. <span :class="order_status == '未收费' ? 'statusRed' : ''">{{ order_status }}</span>
  205. </div>
  206. </div>
  207. <div class='centerRight'>
  208. <!-- <div class="rightTab">
  209. <p :class="rightTab == 1 ? 'activeP' : ''" @click="clickTab(1)">药品</p>
  210. <p :class="rightTab == 2 ? 'activeP' : ''" @click="clickTab(2)">项目</p>
  211. </div> -->
  212. <el-tabs class="borderCard" type="border-card" v-model="rightTab" @tab-click="clickTab"
  213. :before-leave='beforeLeave'>
  214. <el-tab-pane label="药品" :name="1">
  215. </el-tab-pane>
  216. <el-tab-pane label="项目" :name="2">
  217. </el-tab-pane>
  218. <div style="height:100%;" v-show="showOne">
  219. <el-tabs class="rightTabs" v-model="drug_activeName">
  220. <el-tab-pane label="药品列表" name="1">
  221. <div style="margin-bottom:5px;display:flex;">
  222. <el-input style="width:50%;" @input="searchAction"
  223. @keyup.enter.native='searchAction'
  224. v-model.trim="search_keyword"
  225. placeholder="请输入药品名字"></el-input>
  226. <el-select style="margin-left:5px;width:50%;" v-model="value" placeholder=""
  227. @change="changeKind">
  228. <el-option
  229. label="全部"
  230. value="0">
  231. </el-option>
  232. <el-option
  233. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  234. :key="index"
  235. :label="item.name"
  236. :value="item.id">
  237. </el-option>
  238. </el-select>
  239. </div>
  240. <div style="width: 100%;flex:1;overflow: hidden;" ref="rightTable">
  241. <el-table ref="multipleTable"
  242. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  243. :data="drugs" border @select='selectDrugs'
  244. :row-style="{ color: '#303133' }"
  245. @select-all="changeAllGoodInfoTableData"
  246. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  247. highlight-current-row>
  248. <el-table-column type="selection" width="40" align="center"></el-table-column>
  249. <el-table-column label="名称">
  250. <template slot-scope="scope">{{ scope.row.drug_name }}</template>
  251. </el-table-column>
  252. <el-table-column label="规格" width="60">
  253. <template slot-scope="scope">
  254. <!-- {{ scope.row.drug_spec }} -->
  255. <span
  256. v-if="scope.row.min_unit != scope.row.dose_unit">{{ scope.row.dose }}{{ scope.row.dose_unit }}&nbsp;* &nbsp;</span>{{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="库存" width="60">
  260. <template slot-scope="scope">
  261. <span
  262. v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10188 || org_id == 10245 || org_id == 9919 || org_id ==10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
  263. <span
  264. v-if="scope.row.count/scope.row.min_number>0">{{ Math.floor(scope.row.count / scope.row.min_number) }}{{ scope.row.max_unit }}</span>
  265. <span
  266. v-if="scope.row.count%scope.row.min_number>0"> {{ scope.row.count % scope.row.min_number }}{{ scope.row.min_unit }}</span>
  267. </span>
  268. <span v-else> {{ scope.row.total }}{{ scope.row.total ? scope.row.min_unit : '' }}</span>
  269. </template>
  270. </el-table-column>
  271. <el-table-column label="单价" width="40">
  272. <template slot-scope="scope">{{ scope.row.min_price }}</template>
  273. </el-table-column>
  274. </el-table>
  275. <!-- <div>{{3*(2/3)}}</div> -->
  276. </div>
  277. </el-tab-pane>
  278. <!--<el-tab-pane label="医嘱模板" name="2">-->
  279. <!--<div style="margin-bottom:5px;">-->
  280. <!--&lt;!&ndash;<el-input style="width:50%;" v-model="input" placeholder=""></el-input>&ndash;&gt;-->
  281. <!--<el-select style="float: right;width: 49%;" v-model="value" placeholder="">-->
  282. <!--<el-option-->
  283. <!--v-for="item in options"-->
  284. <!--:key="item.value"-->
  285. <!--:label="item.label"-->
  286. <!--:value="item.value">-->
  287. <!--</el-option>-->
  288. <!--</el-select>-->
  289. <!--</div>-->
  290. <!--<div style="width: 100%;flex:1;overflow-y: auto;">-->
  291. <!--<el-table ref="multipleTableTwo" :height="multipleTableHeight != '' ? multipleTableHeight : '200'"-->
  292. <!--:data="advices_template" border-->
  293. <!--:row-style="{ color: '#303133' }"-->
  294. <!--:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"-->
  295. <!--highlight-current-row-->
  296. <!--@select='selectTemplate'-->
  297. <!--@select-all="changeTemplateData"-->
  298. <!--&gt;-->
  299. <!--<el-table-column type="selection" width="40" align="center"></el-table-column>-->
  300. <!--<el-table-column prop="name" label="名称">-->
  301. <!--<template slot-scope="scope">{{scope.row.name}}</template>-->
  302. <!--</el-table-column>-->
  303. <!--&lt;!&ndash;<el-table-column label="规格" width="60">&ndash;&gt;-->
  304. <!--&lt;!&ndash;<template slot-scope="scope">33</template>&ndash;&gt;-->
  305. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  306. <!--&lt;!&ndash;<el-table-column label="库存" width="60">&ndash;&gt;-->
  307. <!--&lt;!&ndash;<template slot-scope="scope">22</template>&ndash;&gt;-->
  308. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  309. <!--&lt;!&ndash;<el-table-column label="单价" width="40">&ndash;&gt;-->
  310. <!--&lt;!&ndash;<template slot-scope="scope">12</template>&ndash;&gt;-->
  311. <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
  312. <!--</el-table>-->
  313. <!--</div>-->
  314. <!--</el-tab-pane>-->
  315. </el-tabs>
  316. </div>
  317. <div style="height:100%;" v-show="showTwo">
  318. <el-tabs class="rightTabs" v-model="activeName">
  319. <el-tab-pane label="项目列表" name="1">
  320. <div style="margin-bottom:5px;">
  321. <!--<el-input style="width:50%;" v-model="input" placeholder=""></el-input>-->
  322. <el-input style="width:50%;" @input="searchProjectAction"
  323. @keyup.enter.native='searchProjectAction'
  324. v-model.trim="search_project_keyword"
  325. placeholder="请输入项目名称"></el-input>
  326. <el-select style="float: right;width: 49%;" v-model="value" placeholder=""
  327. @change="changeClass">
  328. <el-option
  329. label="全部"
  330. value="0">
  331. </el-option>
  332. <el-option
  333. v-for="(item, index) in getDictionaryDataConfig('system','cost_classify')"
  334. :key="index"
  335. :label="item.name"
  336. :value="item.id">
  337. </el-option>
  338. </el-select>
  339. </div>
  340. <div style="width: 100%;flex:1;overflow-y: auto;">
  341. <el-table ref="tables"
  342. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  343. :data="tabProject" border @select='selectChange'
  344. :row-style="{ color: '#303133' }"
  345. @select-all="changeAllGoodInfoTableDataTwo"
  346. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  347. highlight-current-row>
  348. <el-table-column type="selection" width="40" align="center"></el-table-column>
  349. <el-table-column prop="name" label="名称">
  350. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  351. </el-table-column>
  352. <el-table-column label="规格" width="60">
  353. <template slot-scope="scope">{{ scope.row.single_dose }}</template>
  354. </el-table-column>
  355. <el-table-column label="库存" width="40">
  356. <template slot-scope="scope">
  357. <span
  358. v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id ==10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
  359. {{ scope.row.stock_count }}
  360. </span>
  361. <span v-else> {{ scope.row.total }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="单价" width="40">
  365. <template slot-scope="scope">{{ scope.row.price }}</template>
  366. </el-table-column>
  367. </el-table>
  368. </div>
  369. </el-tab-pane>
  370. <el-tab-pane label="项目组套" name="2">
  371. <el-input style="width:50%;" @input="searchProjectTeamAction"
  372. @keyup.enter.native='searchProjectTeamAction'
  373. v-model.trim="search_project_team_keyword"
  374. placeholder="请输入项目组套名称"></el-input>
  375. <div style="width: 100%;flex:1;overflow-y: auto;">
  376. <el-table :data="tabPrjectTeam" border ref="tabProjectTeam"
  377. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  378. :row-style="{ color: '#303133' }"
  379. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  380. highlight-current-row
  381. @select='selectTeam'>
  382. <el-table-column type="selection" width="40" align="center"></el-table-column>
  383. <el-table-column prop="name" label="名称">
  384. <template slot-scope="scope">{{ scope.row.project_team }}</template>
  385. </el-table-column>
  386. </el-table>
  387. </div>
  388. </el-tab-pane>
  389. </el-tabs>
  390. </div>
  391. </el-tabs>
  392. <template>
  393. <div class="comfirmBox">
  394. <!-- <div>
  395. <span>药品类型:</span>
  396. <el-select style="margin-right:5px;width:100px;" v-model="value" placeholder="" @change="changeKind">
  397. <el-option
  398. label="全部"
  399. value="0">
  400. </el-option>
  401. <el-option
  402. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  403. :key="index"
  404. :label="item.name"
  405. :value="item.id">
  406. </el-option>
  407. </el-select>
  408. </div> -->
  409. <el-button type="primary" style="width:100%;" @click="comfirm">确定添加</el-button>
  410. </div>
  411. </template>
  412. </div>
  413. </div>
  414. <additionalCharges v-on:setData="setCharge" ref='additionalCharges' :hisPatientInfo="hisPatientInfo"
  415. :patientInfo="patientInfo" :additions="additions"></additionalCharges>
  416. <select-template ref='selectTemplate'></select-template>
  417. <save-template ref='saveTemplate' v-on:save_template="saveTemplate"></save-template>
  418. <next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue"
  419. v-on:cancel="cancel"></next-or-last-prescription>
  420. <!--<next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue" v-on:cancel="cancel"></next-or-last-prescription>-->
  421. <call-prescription ref='call_prescription' v-on:call="call" v-on:call-cancel="callCancel"></call-prescription>
  422. </div>
  423. </template>
  424. <script>
  425. import MonthPrescriptionTable from '../../outpatientCharges/components/monthPrescriptionTable'
  426. import {
  427. createdTemplate,
  428. createHisPrescription,
  429. delHisPrescription,
  430. editHisPrescription,
  431. getCallHisPrescription,
  432. getDayOrMonthHisPrescription,
  433. getNextOrLastHisPrescription
  434. } from '@/api/his/his'
  435. import { getDictionaryDataConfig } from '@/utils/data'
  436. import prescriptionTable from './prescriptionTable'
  437. import selectTemplate from './selectTemplate'
  438. import saveTemplate from './saveTemplate'
  439. import additionalCharges from './additionalCharges'
  440. import { getAllProjectList, getAllProjectTeam, getHisProject, getPojectListById } from '@/api/project/project'
  441. import { uParseTime } from '@/utils/tools'
  442. import NextOrLastPrescription from './nextOrLastPrescription'
  443. import CallPrescription from './callPrescription'
  444. import DayPrescriptionTable from '../../outpatientCharges/components/dayPrescriptionTable'
  445. const moment = require('moment')
  446. export default {
  447. props: {
  448. drugs: Array,
  449. allDrugs: Array,
  450. advices_template: Array,
  451. doctors: Array,
  452. department: Array,
  453. sick: Array,
  454. diagnoses: Array,
  455. additions: Array,
  456. patientInfo: Object,
  457. hisPatientInfo: Object,
  458. prescriptions: Array,
  459. record_date: String,
  460. search_keyword: '',
  461. month_prescriptions: Array,
  462. isloading: false,
  463. loading: false,
  464. org_id: Number,
  465. other_sick: {
  466. type: Array,
  467. default: function() {
  468. return []
  469. }
  470. }
  471. },
  472. components: {
  473. DayPrescriptionTable,
  474. MonthPrescriptionTable,
  475. CallPrescription,
  476. NextOrLastPrescription,
  477. selectTemplate,
  478. saveTemplate,
  479. prescriptionTable,
  480. additionalCharges
  481. },
  482. data() {
  483. return {
  484. settle_total:0,
  485. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  486. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  487. register: [
  488. { value: 11, label: '普通门诊' },
  489. // { value: 12, label: '门诊挂号' },
  490. // { value: 13, label: '急诊' },
  491. { value: 14, label: '门诊特殊病' },
  492. { value: 1112, label: '精二' }
  493. // { value: 15, label: '门诊统筹' },
  494. // { value: 16, label: '门诊慢性病' },
  495. // { value: 21, label: '普通住院' }
  496. ],
  497. medical_care: [
  498. { value: 11, label: '普通门诊' },
  499. { value: 12, label: '家庭通道' },
  500. { value: 13, label: '门诊大病' },
  501. { value: 14, label: '重疾特药' },
  502. { value: 15, label: '门诊慢病' },
  503. { value: 16, label: '门诊特检' },
  504. { value: 17, label: '健康体检' },
  505. { value: 18, label: '预防接种' },
  506. { value: 19, label: '门诊输血' },
  507. { value: 91, label: '新冠肺炎门诊' },
  508. { value: 1111, label: '精一' },
  509. { value: 1112, label: '精二' }
  510. ],
  511. isLastOrNextVisible: false,
  512. multipleTableHeight: '',
  513. register_type: '',
  514. value: '0',
  515. search_project_keyword: '',
  516. search_project_team_keyword: '',
  517. form: {
  518. name: ''
  519. },
  520. drugs: [],
  521. allDrugs: [],
  522. advices_template: [],
  523. additions: [],
  524. editableTabsValueTwo: '处方1',
  525. editableTabsValue: '处方1',
  526. editableTabs: [{
  527. title: '处方1',
  528. name: '1'
  529. }],
  530. tabIndex: this.prescriptions.length,
  531. curDayPrescriptions: null,
  532. dayPrescriptions: [],
  533. currenet_inedx: 0,
  534. rightTab: 1,
  535. activeName: '1',
  536. drug_activeName: '1',
  537. curPrescriptions: null,
  538. curMonthPrescriptions: this.month_prescriptions[0],
  539. drugTableData: [],
  540. preDrugs: [],
  541. curDrugs: [],
  542. doctorOptions: [],
  543. doctorValue: '',
  544. departmentOptions: [],
  545. departmentValue: '',
  546. total: 0,
  547. request_record_date: '',
  548. state2: '',
  549. customTabIndex: 1,
  550. options: [],
  551. tabProject: [],
  552. allProject: [],
  553. strids: '',
  554. showOne: true,
  555. showTwo: false,
  556. tableData: [],
  557. tabPrjectTeam: [],
  558. allTabPrjectTeam: [],
  559. teamList: [],
  560. doctors: [],
  561. departMent: [],
  562. curStatus: 0,
  563. isShowDayPrescription: false,
  564. monthCustomTabIndex: 1,
  565. order_status: '',
  566. register_types: [
  567. { id: 1, name: '医保' },
  568. { id: 2, name: '自费' }
  569. ],
  570. pickerOptions: {
  571. disabledDate(time) {
  572. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
  573. return time.getTime() > Date.now() || time.getTime() < threeMonths
  574. }
  575. },
  576. department: [],
  577. sick: [],
  578. diagnoses: [],
  579. diagnose: [],
  580. state1: '',
  581. curTotal: 0,
  582. prescription_id: 0,
  583. tempDrugs: [],
  584. dayorMonth: 'day',
  585. pickerBeginDateBefore: {
  586. disabledDate: (time) => {
  587. let beginDateVal = this.end_time
  588. if (beginDateVal) {
  589. return time.getTime() > new Date(beginDateVal).getTime()
  590. }
  591. }
  592. },
  593. pickerBeginDateAfter: {
  594. disabledDate: (time) => {
  595. let beginDateVal = this.start_time
  596. if (beginDateVal) {
  597. return time.getTime() <= new Date(beginDateVal).getTime()
  598. }
  599. }
  600. },
  601. hisList: []
  602. }
  603. },
  604. methods: {
  605. changeClass(id) {
  606. this.tabProject = []
  607. if (id == 0) {
  608. this.tabProject = this.allProject
  609. } else {
  610. for (let i = 0; i < this.allProject.length; i++) {
  611. if (this.allProject[i].cost_classify == id) {
  612. this.tabProject.push(this.allProject[i])
  613. }
  614. }
  615. }
  616. },
  617. setMonthPrescription(month_prescriptions) {
  618. console.log('~~~~~~~~')
  619. this.month_prescriptions = []
  620. let drug_month_prescriptions = {
  621. advices: []
  622. }
  623. let drug_ids = []
  624. let drug_ids2 = []
  625. let project_month_prescriptions = {
  626. project: []
  627. }
  628. let project_ids = []
  629. let addition_month_prescriptions = {
  630. addition: []
  631. }
  632. let additions_ids = []
  633. for (let i = 0; i < month_prescriptions.length; i++) {
  634. if (month_prescriptions[i].type == 1) { //药品
  635. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  636. let obj = {
  637. id: month_prescriptions[i].advices[a].drug_id,
  638. price: month_prescriptions[i].advices[a].price
  639. }
  640. if (month_prescriptions[i].advices[a].drug_id == 1280) {
  641. drug_ids2.push(obj)
  642. }
  643. drug_ids.push(obj)
  644. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  645. }
  646. } else if (month_prescriptions[i].type == 2) { //项目
  647. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  648. let obj = {
  649. id: month_prescriptions[i].project[a].project_id,
  650. price: month_prescriptions[i].project[a].price
  651. }
  652. project_ids.push(obj)
  653. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  654. }
  655. }
  656. //附加收费
  657. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  658. // let obj = {
  659. // id: month_prescriptions[i].addition[a].item_id,
  660. // price: month_prescriptions[i].addition[a].price
  661. //
  662. // }
  663. // additions_ids.push(obj)
  664. // addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  665. //
  666. // }
  667. }
  668. const obj = {}
  669. const obj1 = {}
  670. const obj2 = {}
  671. drug_ids = this.unique(drug_ids)
  672. project_ids = this.unique(project_ids)
  673. additions_ids = this.unique(additions_ids)
  674. let drugs = []
  675. let projects = []
  676. let additions = []
  677. for (let i = 0; i < drug_ids.length; i++) {
  678. let obj = {}
  679. let count = 0
  680. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  681. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  682. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  683. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  684. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  685. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  686. obj['day'] = drug_month_prescriptions.advices[a].day
  687. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  688. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  689. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  690. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  691. // obj['single_dose_unit'] = drug_month_prescriptions.advices[a].single_dose_unit
  692. obj['single_dose_unit'] = drug_month_prescriptions.advices[a].drug.dose_unit
  693. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  694. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  695. obj['drug'] = drug_month_prescriptions.advices[a].drug
  696. count = count + drug_month_prescriptions.advices[a].prescribing_number
  697. }
  698. }
  699. obj['prescribing_number'] = count
  700. drugs.push(obj)
  701. }
  702. for (let i = 0; i < project_ids.length; i++) {
  703. let obj = {}
  704. let count = 0
  705. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  706. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  707. if (project_month_prescriptions.project[a].type == 2) {
  708. obj['statistical_classification'] = ''
  709. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  710. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  711. obj['project'] = project_month_prescriptions.project[a].project
  712. } else if (project_month_prescriptions.project[a].type == 3) {
  713. obj['statistical_classification'] = ''
  714. obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
  715. obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
  716. obj['good_info'] = project_month_prescriptions.project[a].good_info
  717. }
  718. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name;
  719. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification;
  720. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  721. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  722. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  723. obj['number_days'] = project_month_prescriptions.project[a].day
  724. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code;
  725. obj['unit'] = project_month_prescriptions.project[a].unit
  726. obj['project_id'] = project_month_prescriptions.project[a].project_id
  727. count = count + parseFloat(project_month_prescriptions.project[a].count)
  728. // price = price + project_month_prescriptions.project[a].price
  729. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  730. }
  731. }
  732. obj['total'] = count
  733. projects.push(obj)
  734. }
  735. for (let i = 0; i < additions_ids.length; i++) {
  736. let obj = {}
  737. let count = 0
  738. if (addition_month_prescriptions.addition) {
  739. for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  740. if (additions_ids[i].price == addition_month_prescriptions.addition[a].price) {
  741. obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  742. obj['id'] = addition_month_prescriptions.addition[a].id
  743. obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  744. count = count + addition_month_prescriptions.addition[a].count
  745. obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
  746. }
  747. }
  748. obj['count'] = count
  749. additions.push(obj)
  750. }
  751. }
  752. let p1 = {
  753. name: '处方' + 1,
  754. advices: drugs,
  755. project: [],
  756. type: 1,
  757. addition: additions
  758. }
  759. let p2 = {
  760. name: '处方' + 2,
  761. type: 2,
  762. project: projects,
  763. advices: [],
  764. addition: []
  765. }
  766. this.month_prescriptions.push(p1)
  767. this.month_prescriptions.push(p2)
  768. if (this.editableTabsValueTwo == '处方1') {
  769. this.monthCustomTabIndex = 1
  770. this.curMonthPrescriptions = this.month_prescriptions[0]
  771. } else {
  772. this.monthCustomTabIndex = 2
  773. this.curMonthPrescriptions = this.month_prescriptions[1]
  774. }
  775. },
  776. // setMonthPrescription(month_prescriptions) {
  777. // let drug_month_prescriptions = {
  778. // advices: [],
  779. // }
  780. // let drug_ids = []
  781. // let project_month_prescriptions = {
  782. // project: [],
  783. //
  784. // }
  785. // let project_ids = []
  786. //
  787. // let addition_month_prescriptions = {
  788. // addtions: [],
  789. //
  790. // }
  791. // let additions_ids = []
  792. //
  793. //
  794. // for (let i = 0; i < month_prescriptions.length; i++) {
  795. // if (month_prescriptions[i].type == 1) { //药品
  796. // for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  797. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  798. // drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  799. // }
  800. //
  801. // } else if (month_prescriptions[i].type == 2) { //项目
  802. // for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  803. // project_ids.push(month_prescriptions[i].project[a].project_id)
  804. // project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  805. // }
  806. // }
  807. // //附加收费
  808. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  809. // additions_ids.push(month_prescriptions[i].addition[a].item_id)
  810. // addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
  811. // }
  812. //
  813. // }
  814. //
  815. // console.log(drug_ids)
  816. // console.log(drug_month_prescriptions)
  817. // console.log(project_ids)
  818. // console.log(project_month_prescriptions)
  819. // console.log(additions_ids)
  820. // console.log(addition_month_prescriptions)
  821. //
  822. //
  823. // const obj = {}
  824. // const obj1 = {}
  825. // const obj2 = {}
  826. //
  827. // drug_ids = drug_ids.reduce((cur, next) => {
  828. // obj[next] ? '' : obj[next] = true && cur.push(next)
  829. // return cur
  830. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  831. // project_ids = project_ids.reduce((cur, next) => {
  832. // obj1[next] ? '' : obj1[next] = true && cur.push(next)
  833. // return cur
  834. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  835. // additions_ids = additions_ids.reduce((cur, next) => {
  836. // obj2[next] ? '' : obj2[next] = true && cur.push(next)
  837. // return cur
  838. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  839. //
  840. //
  841. // console.log(drug_ids)
  842. // console.log(project_ids)
  843. // console.log(additions_ids)
  844. //
  845. //
  846. // let drugs = []
  847. // let projects = []
  848. // let additions = []
  849. //
  850. //
  851. // for (let i = 0; i < drug_ids.length; i++) {
  852. // let obj = {}
  853. // let price = 0
  854. // let count = 0
  855. // for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  856. // if (drug_ids[i] == drug_month_prescriptions.advices[a].drug_id) {
  857. // obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  858. // obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  859. // obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  860. // obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  861. // obj['day'] = drug_month_prescriptions.advices[a].day
  862. // // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  863. // obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  864. // obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  865. // obj['id'] = drug_month_prescriptions.advices[a].drug_id
  866. // // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  867. //
  868. //
  869. // count = count + drug_month_prescriptions.advices[a].prescribing_number
  870. // price = price + drug_month_prescriptions.advices[a].price
  871. //
  872. // }
  873. // }
  874. // obj['retail_price'] =this.formatDecimal(price,2)
  875. // obj['prescribing_number'] = count
  876. // drugs.push(obj)
  877. // }
  878. //
  879. //
  880. // for (let i = 0; i < project_ids.length; i++) {
  881. // let obj = {}
  882. // let price = 0
  883. // let count = 0
  884. // for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  885. // if (project_ids[i] == project_month_prescriptions.project[a].project_id) {
  886. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  887. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  888. // obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  889. // obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  890. // obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  891. // obj['number_days'] = project_month_prescriptions.project[a].day
  892. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  893. // obj['unit'] = project_month_prescriptions.project[a].unit
  894. // obj['project_id'] = project_month_prescriptions.project[a].project_id
  895. // count = count + project_month_prescriptions.project[a].count
  896. // price = price + project_month_prescriptions.project[a].price
  897. // }
  898. // }
  899. // obj['price'] = this.formatDecimal(price,2)
  900. // obj['total'] = count
  901. // projects.push(obj)
  902. // }
  903. //
  904. //
  905. // for (let i = 0; i < additions_ids.length; i++) {
  906. // let obj = {}
  907. // let price = 0
  908. // let count = 0
  909. // for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  910. // if (project_ids[i] == addition_month_prescriptions.addition[a].item_id) {
  911. // obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  912. // obj['id'] = addition_month_prescriptions.addition[a].id
  913. // obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  914. // count = count + addition_month_prescriptions.addition[a].count
  915. // price = price + addition_month_prescriptions.addition[a].price
  916. // }
  917. // }
  918. // obj['price'] = this.formatDecimal(price,2)
  919. // obj['count'] = count
  920. // additions.push(obj)
  921. // }
  922. //
  923. // console.log(drugs)
  924. // console.log(projects)
  925. // console.log(additions)
  926. //
  927. //
  928. // if (drugs.length > 0) {
  929. // let p1 = {
  930. // name: '处方' + 1,
  931. // advices: drugs,
  932. // project: [],
  933. // type: 1,
  934. // addition: additions,
  935. // }
  936. // this.month_prescriptions.push(p1)
  937. //
  938. // }
  939. //
  940. // if (projects.length > 0) {
  941. // let p2 = {
  942. // name: '处方' + 2,
  943. // type: 2,
  944. // project: projects,
  945. // advices: [],
  946. // }
  947. // this.month_prescriptions.push(p2)
  948. // }
  949. //
  950. // console.log(this.month_prescriptions)
  951. //
  952. // },
  953. formatDecimal(num, decimal) {
  954. num = num.toString()
  955. let index = num.indexOf('.')
  956. if (index !== -1) {
  957. num = num.substring(0, decimal + index + 1)
  958. } else {
  959. num = num.substring(0)
  960. }
  961. return parseFloat(num).toFixed(decimal)
  962. },
  963. changeTime(val) {
  964. if (val == this.end_time) {
  965. this.isShowDayPrescription = true
  966. } else {
  967. this.isShowDayPrescription = false
  968. }
  969. let params = {
  970. patient_id: this.patientInfo.id,
  971. start_time: val,
  972. end_time: this.end_time,
  973. p_type: 1
  974. }
  975. getDayOrMonthHisPrescription(params).then(response => {
  976. if (response.data.state == 1) {
  977. this.month_prescriptions = []
  978. this.settle_total = response.data.data.settle_total
  979. if (val == this.end_time) {
  980. var day_prescription = response.data.data.day_prescription
  981. // this.month_prescriptions = day_prescription
  982. if (day_prescription.length > 0) {
  983. for (let i = 0; i < day_prescription.length; i++) {
  984. var prescription = day_prescription[i]
  985. let tempAdvice = []
  986. let tempProject = []
  987. let tempAddition = []
  988. //药品
  989. for (let b = 0; b < prescription.advices.length; b++) {
  990. let obj = {
  991. advice_id: prescription.advices[b].id,
  992. drug_name: prescription.advices[b].advice_name,
  993. single_dose: prescription.advices[b].single_dose,
  994. delivery_way: prescription.advices[b].delivery_way,
  995. execution_frequency: prescription.advices[b].execution_frequency,
  996. retail_price: prescription.advices[b].price.toString(),
  997. remark: prescription.advices[b].remark,
  998. day: prescription.advices[b].day,
  999. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1000. single_dose_unit: prescription.advices[b].single_dose_unit,
  1001. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1002. medical_insurance_number: prescription.advices[b].med_list_codg,
  1003. id: prescription.advices[b].drug_id,
  1004. drug: prescription.advices[b].drug
  1005. }
  1006. tempAdvice.push(obj)
  1007. }
  1008. //项目
  1009. for (let b = 0; b < prescription.project.length; b++) {
  1010. let obj = {
  1011. id: prescription.project[b].id,
  1012. project_id: prescription.project[b].project_id,
  1013. // project_name: prescription.project[b].project.project_name,
  1014. // statistical_classification: prescription.project[b].project.statistical_classification,
  1015. single_dose: prescription.project[b].single_dose,
  1016. delivery_way: prescription.project[b].delivery_way,
  1017. execution_frequency: prescription.project[b].execution_frequency,
  1018. number_days: prescription.project[b].day,
  1019. total: prescription.project[b].count.toString(),
  1020. price: prescription.project[b].price,
  1021. remark: prescription.project[b].remark,
  1022. // medical_code: prescription.project[b].project.medical_code,
  1023. unit: prescription.project[b].unit
  1024. }
  1025. if (prescription.project[b].type == 2) {
  1026. obj['statistical_classification'] = prescription.project[b].team.project_team
  1027. obj['medical_code'] = prescription.project[b].project.medical_code
  1028. obj['project_name'] = prescription.project[b].project.project_name
  1029. obj['project'] = prescription.project[b].project
  1030. } else if (prescription.project[b].type == 3) {
  1031. if (prescription.project[b].team_id > 0) {
  1032. obj['statistical_classification'] = prescription.project[b].team.project_team
  1033. }
  1034. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1035. obj['project_name'] = prescription.project[b].good_info.good_name
  1036. obj['good_info'] = prescription.project[b].good_info
  1037. }
  1038. tempProject.push(obj)
  1039. }
  1040. //附加收费
  1041. // for (let b = 0; b < prescription.addition.length; b++) {
  1042. // let obj = {
  1043. // id: prescription.addition[b].id,
  1044. // item_name: prescription.addition[b].item_name,
  1045. // price: prescription.addition[b].price,
  1046. // count: prescription.addition[b].count,
  1047. // item_id: prescription.addition[b].item_id
  1048. // }
  1049. // tempAddition.push(obj)
  1050. // }
  1051. let index = i + 1
  1052. let obj = {
  1053. id: prescription.id,
  1054. name: '处方' + index,
  1055. advices: tempAdvice,
  1056. project: tempProject,
  1057. addition: tempAddition,
  1058. order_status: prescription.order_status
  1059. }
  1060. this.month_prescriptions.push(obj)
  1061. }
  1062. this.curDayPrescriptions = this.month_prescriptions[0]
  1063. }
  1064. } else {
  1065. this.setMonthPrescription(response.data.data.day_prescription)
  1066. // this.editableTabsValueTwo = "处方1"
  1067. }
  1068. } else {
  1069. this.$message.error(response.data.msg)
  1070. }
  1071. })
  1072. },
  1073. changeEndTime(val) {
  1074. if (val == this.start_time) {
  1075. this.isShowDayPrescription = true
  1076. } else {
  1077. this.isShowDayPrescription = false
  1078. }
  1079. let params = {
  1080. patient_id: this.patientInfo.id,
  1081. start_time: this.start_time,
  1082. end_time: val,
  1083. p_type: 1
  1084. }
  1085. getDayOrMonthHisPrescription(params).then(response => {
  1086. if (response.data.state == 1) {
  1087. this.month_prescriptions = []
  1088. this.settle_total = response.data.data.settle_total
  1089. if (val == this.start_time) {
  1090. var day_prescription = response.data.data.day_prescription
  1091. // this.month_prescriptions = day_prescription
  1092. if (day_prescription.length > 0) {
  1093. for (let i = 0; i < day_prescription.length; i++) {
  1094. var prescription = day_prescription[i]
  1095. let tempAdvice = []
  1096. let tempProject = []
  1097. let tempAddition = []
  1098. //药品
  1099. for (let b = 0; b < prescription.advices.length; b++) {
  1100. let obj = {
  1101. advice_id: prescription.advices[b].id,
  1102. drug_name: prescription.advices[b].advice_name,
  1103. single_dose: prescription.advices[b].single_dose,
  1104. delivery_way: prescription.advices[b].delivery_way,
  1105. execution_frequency: prescription.advices[b].execution_frequency,
  1106. retail_price: prescription.advices[b].price.toString(),
  1107. remark: prescription.advices[b].remark,
  1108. day: prescription.advices[b].day,
  1109. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1110. single_dose_unit: prescription.advices[b].single_dose_unit,
  1111. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1112. medical_insurance_number: prescription.advices[b].med_list_codg,
  1113. id: prescription.advices[b].drug_id,
  1114. drug: prescription.advices[b].drug
  1115. }
  1116. tempAdvice.push(obj)
  1117. }
  1118. //项目
  1119. for (let b = 0; b < prescription.project.length; b++) {
  1120. let obj = {
  1121. id: prescription.project[b].id,
  1122. project_id: prescription.project[b].project_id,
  1123. // project_name: prescription.project[b].project.project_name,
  1124. // statistical_classification: prescription.project[b].project.statistical_classification,
  1125. single_dose: prescription.project[b].single_dose,
  1126. delivery_way: prescription.project[b].delivery_way,
  1127. execution_frequency: prescription.project[b].execution_frequency,
  1128. number_days: prescription.project[b].day,
  1129. total: prescription.project[b].count.toString(),
  1130. price: prescription.project[b].price,
  1131. remark: prescription.project[b].remark,
  1132. // medical_code: prescription.project[b].project.medical_code,
  1133. unit: prescription.project[b].unit
  1134. }
  1135. if (prescription.project[b].type == 2) {
  1136. obj['statistical_classification'] = prescription.project[b].team.project_team
  1137. obj['medical_code'] = prescription.project[b].project.medical_code
  1138. obj['project_name'] = prescription.project[b].project.project_name
  1139. obj['project'] = prescription.project[b].project
  1140. } else if (prescription.project[b].type == 3) {
  1141. if (prescription.project[b].team_id > 0) {
  1142. obj['statistical_classification'] = prescription.project[b].team.project_team
  1143. }
  1144. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1145. obj['project_name'] = prescription.project[b].good_info.good_name
  1146. obj['good_info'] = prescription.project[b].good_info
  1147. }
  1148. tempProject.push(obj)
  1149. }
  1150. //附加收费
  1151. // for (let b = 0; b < prescription.addition.length; b++) {
  1152. // let obj = {
  1153. // id: prescription.addition[b].id,
  1154. // item_name: prescription.addition[b].item_name,
  1155. // price: prescription.addition[b].price,
  1156. // count: prescription.addition[b].count,
  1157. // item_id: prescription.addition[b].item_id
  1158. // }
  1159. // tempAddition.push(obj)
  1160. // }
  1161. let index = i + 1
  1162. let obj = {
  1163. id: prescription.id,
  1164. name: '处方' + index,
  1165. advices: tempAdvice,
  1166. project: tempProject,
  1167. addition: tempAddition,
  1168. order_status: prescription.order_status
  1169. }
  1170. this.month_prescriptions.push(obj)
  1171. }
  1172. this.curDayPrescriptions = this.month_prescriptions[0]
  1173. }
  1174. } else {
  1175. this.setMonthPrescription(response.data.data.day_prescription)
  1176. // this.curMonthPrescriptions = this.month_prescriptions[0]
  1177. }
  1178. } else {
  1179. this.$message.error(response.data.msg)
  1180. }
  1181. })
  1182. }, saveTemplate(val) {
  1183. let params = {
  1184. name: val.name,
  1185. mode: val.mode,
  1186. patient_id: this.patientInfo.id
  1187. }
  1188. let data = {
  1189. 'prescriptions': val.prescriptions
  1190. }
  1191. createdTemplate(params, data).then(response => {
  1192. if (response.data.state == 1) {
  1193. this.$refs.saveTemplate.hide()
  1194. this.$message.success('保存成功')
  1195. } else {
  1196. this.$message.error(response.data.msg)
  1197. }
  1198. })
  1199. },
  1200. call(val) {
  1201. this.prescriptions = []
  1202. this.prescriptions = val
  1203. for (let i = 0; i < this.prescriptions.length; i++) {
  1204. var nowDate = new Date()
  1205. var nowYear = nowDate.getFullYear()
  1206. var nowMonth = nowDate.getMonth() + 1
  1207. var nowDay = nowDate.getDate()
  1208. var hours = nowDate.getHours()
  1209. var min = nowDate.getMinutes()
  1210. var nowTime =
  1211. nowYear +
  1212. '-' +
  1213. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1214. '-' +
  1215. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1216. ':' + (min < 10 ? '0' + min : min)
  1217. this.prescriptions[i]['pre_time'] = nowTime
  1218. this.prescriptions[i].name = '处方' + (i + 1)
  1219. if (i == 0) {
  1220. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  1221. this.customTabIndex = 1
  1222. this.curStatus = 1
  1223. this.rightTab = 1
  1224. this.showOne = true
  1225. this.showTwo = false
  1226. }
  1227. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  1228. this.customTabIndex = 2
  1229. this.curStatus = 2
  1230. this.rightTab = 2
  1231. this.showTwo = true
  1232. this.showOne = false
  1233. }
  1234. }
  1235. }
  1236. this.curPrescriptions = this.prescriptions[0]
  1237. this.$refs.call_prescription.close()
  1238. this.$emit('setData', this.prescriptions)
  1239. }, changevalue(val) {
  1240. this.$forceUpdate()
  1241. },
  1242. callCancel() {
  1243. this.$refs.call_prescription.close()
  1244. },
  1245. cancel() {
  1246. this.$refs.next_or_last_prescription.close()
  1247. this.request_record_date = this.record_date
  1248. },
  1249. setValue(val) {
  1250. this.prescriptions = []
  1251. this.prescriptions = val
  1252. this.$refs.next_or_last_prescription.close()
  1253. var nowDate = new Date()
  1254. var nowYear = nowDate.getFullYear()
  1255. var nowMonth = nowDate.getMonth() + 1
  1256. var nowDay = nowDate.getDate()
  1257. var hours = nowDate.getHours()
  1258. var min = nowDate.getMinutes()
  1259. var nowTime =
  1260. nowYear +
  1261. '-' +
  1262. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1263. '-' +
  1264. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1265. ':' + (min < 10 ? '0' + min : min)
  1266. for (let i = 0; i < this.prescriptions.length; i++) {
  1267. this.prescriptions[i].name = '处方' + (i + 1)
  1268. this.prescriptions[i]['pre_time'] = nowTime
  1269. if (i == 0) {
  1270. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  1271. this.customTabIndex = 1
  1272. this.curStatus = 1
  1273. this.rightTab = 1
  1274. this.showOne = true
  1275. this.showTwo = false
  1276. }
  1277. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  1278. this.customTabIndex = 2
  1279. this.curStatus = 2
  1280. this.rightTab = 2
  1281. this.showTwo = true
  1282. this.showOne = false
  1283. }
  1284. }
  1285. }
  1286. this.curPrescriptions = this.prescriptions[0]
  1287. this.request_record_date = this.record_date
  1288. this.$emit('setData', this.prescriptions)
  1289. },
  1290. GetNextOrLastHisPrescription(params) {
  1291. getNextOrLastHisPrescription(params).then(response => {
  1292. if (response.data.state == 1) {
  1293. if (this.dayorMonth == 'day') {
  1294. this.$refs.next_or_last_prescription.show(response.data.data.prescriptions, this.patientInfo.name, this.patientInfo.id, this.prescriptions)
  1295. this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
  1296. } else {
  1297. this.$message.error('当前处于月结,无法使用上一方或下一方功能')
  1298. }
  1299. } else {
  1300. this.$message.error(response.data.msg)
  1301. }
  1302. })
  1303. },
  1304. openLast(val) {
  1305. // if (this.curPrescriptions.order_status == 2) {
  1306. // this.$message.error('处方已经结算,无法添加')
  1307. // return
  1308. // }
  1309. if (this.patientInfo.id == 0) {
  1310. this.$message.error('请选择患者')
  1311. return
  1312. }
  1313. if (val == 1) {
  1314. this.isVisibility = false
  1315. this.request_record_date = this.record_date
  1316. let params = {
  1317. patient_id: this.patientInfo.id,
  1318. record_time: this.request_record_date,
  1319. type: 1,
  1320. p_type: 1
  1321. }
  1322. this.GetNextOrLastHisPrescription(params)
  1323. } else if (val == 3) {
  1324. let params = {
  1325. patient_id: this.patientInfo.id,
  1326. record_time: this.request_record_date,
  1327. type: 1,
  1328. p_type: 1
  1329. }
  1330. this.GetNextOrLastHisPrescription(params)
  1331. }
  1332. },
  1333. openNext(val) {
  1334. // if (this.curPrescriptions.order_status == 2) {
  1335. // this.$message.error('处方已经结算,无法添加')
  1336. // return
  1337. // }
  1338. if (this.patientInfo.id == 0) {
  1339. this.$message.error('请选择患者')
  1340. return
  1341. }
  1342. if (val == 2) {
  1343. this.isVisibility = false
  1344. this.request_record_date = this.record_date
  1345. let params = {
  1346. patient_id: this.patientInfo.id,
  1347. record_time: this.request_record_date,
  1348. type: 2,
  1349. p_type: 1
  1350. }
  1351. this.GetNextOrLastHisPrescription(params)
  1352. } else if (val == 4) {
  1353. let params = {
  1354. patient_id: this.patientInfo.id,
  1355. record_time: this.request_record_date,
  1356. type: 2,
  1357. p_type: 1
  1358. }
  1359. this.GetNextOrLastHisPrescription(params)
  1360. }
  1361. },
  1362. selectTemplate(selection, row) {
  1363. this.tempDrugs = selection
  1364. }, changeTemplateData(selection) {
  1365. this.tempDrugs = selection
  1366. },
  1367. stockInCount: function(row) {
  1368. let total = 0
  1369. if (row.stock_in != null) {
  1370. for (let i = 0; i < row.stock_in.length; i++) {
  1371. total = total + row.stock_in[i].warehousing_count
  1372. }
  1373. }
  1374. return total
  1375. },
  1376. salesReturnCount: function(row) {
  1377. let total = 0
  1378. if (row.sales_return != null) {
  1379. for (let i = 0; i < row.sales_return.length; i++) {
  1380. total = total + row.sales_return[i].count
  1381. }
  1382. }
  1383. return total
  1384. },
  1385. stockOutCount: function(row) {
  1386. let total = 0
  1387. if (row.stock_out != null) {
  1388. for (let i = 0; i < row.stock_out.length; i++) {
  1389. total = total + row.stock_out[i].count
  1390. }
  1391. }
  1392. return total
  1393. },
  1394. cancelStockCount: function(row) {
  1395. let total = 0
  1396. if (row.cancel_stock != null) {
  1397. for (let i = 0; i < row.cancel_stock.length; i++) {
  1398. total = total + row.cancel_stock[i].count
  1399. }
  1400. }
  1401. return total
  1402. },
  1403. setCharge(additional_charges) {
  1404. for (let i = 0; i < additional_charges.length; i++) {
  1405. additional_charges[i].count = 1
  1406. this.curPrescriptions.addition.push(additional_charges[i])
  1407. }
  1408. this.$refs.additionalCharges.hide()
  1409. }, searchProjectAction() {
  1410. console.log('~~~~')
  1411. console.log(this.allProject)
  1412. console.log(this.allProject)
  1413. if (this.search_project_keyword.length == 0) {
  1414. this.tabProject = this.allProject
  1415. } else {
  1416. let arr = []
  1417. for (let i = 0; i < this.allProject.length; i++) {
  1418. if (this.allProject[i].project_name.indexOf(this.search_project_keyword) != -1) {
  1419. arr = arr.concat(this.allProject[i])
  1420. }
  1421. }
  1422. this.tabProject = arr
  1423. }
  1424. }, searchProjectTeamAction() {
  1425. if (this.search_project_team_keyword.length == 0) {
  1426. this.tabPrjectTeam = this.allTabPrjectTeam
  1427. } else {
  1428. let arr = []
  1429. for (let i = 0; i < this.allTabPrjectTeam.length; i++) {
  1430. if (this.allTabPrjectTeam[i].project_team.indexOf(this.search_project_team_keyword) != -1) {
  1431. arr = arr.concat(this.allTabPrjectTeam[i])
  1432. }
  1433. }
  1434. this.tabPrjectTeam = arr
  1435. }
  1436. },
  1437. searchAction() {
  1438. if (this.search_keyword.length == 0) {
  1439. this.drugs = this.allDrugs
  1440. } else {
  1441. let arr = []
  1442. for (let i = 0; i < this.drugs.length; i++) {
  1443. 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) {
  1444. arr = arr.concat(this.drugs[i])
  1445. }
  1446. }
  1447. this.drugs = arr
  1448. }
  1449. },
  1450. getTotalOne() {
  1451. var total = 0
  1452. for (let i = 0; i < this.prescriptions.length; i++) {
  1453. if (this.prescriptions[i].name == this.editableTabsValue) {
  1454. if (this.prescriptions[i].advices != null) {
  1455. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1456. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  1457. }
  1458. }
  1459. if (this.prescriptions[i].project != null) {
  1460. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1461. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  1462. }
  1463. }
  1464. if (this.prescriptions[i].addition != null) {
  1465. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1466. total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
  1467. }
  1468. }
  1469. total = total.toFixed(2)
  1470. }
  1471. }
  1472. return total
  1473. },
  1474. getTotalTwo() {
  1475. var total = 0
  1476. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1477. if (this.month_prescriptions[i].name == this.editableTabsValueTwo) {
  1478. if (this.month_prescriptions[i].advices != null) {
  1479. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1480. total = total + this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number
  1481. }
  1482. }
  1483. if (this.month_prescriptions[i].project != null) {
  1484. for (let b = 0; b < this.month_prescriptions[i].project.length; b++) {
  1485. total = total + this.month_prescriptions[i].project[b].price * this.month_prescriptions[i].project[b].total
  1486. }
  1487. }
  1488. if (this.month_prescriptions[i].addition != null) {
  1489. for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  1490. total = total + this.month_prescriptions[i].addition[b].price * this.month_prescriptions[i].addition[b].count
  1491. }
  1492. }
  1493. }
  1494. }
  1495. return total.toFixed(2)
  1496. },
  1497. getCurTotal() {
  1498. var total = 0
  1499. if (this.curPrescriptions.type == 1) {
  1500. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1501. total = total + this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number
  1502. }
  1503. return Math.floor(total * 100) / 100
  1504. } else {
  1505. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  1506. total = total + this.curPrescriptions.project[a].price * this.curPrescriptions.project[a].total
  1507. }
  1508. return total.toFixed(2)
  1509. }
  1510. },
  1511. getTotal() {
  1512. var total = 0
  1513. for (let i = 0; i < this.prescriptions.length; i++) {
  1514. if (this.prescriptions[i].advices != null) {
  1515. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1516. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  1517. }
  1518. }
  1519. if (this.prescriptions[i].project != null) {
  1520. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1521. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  1522. }
  1523. }
  1524. if (this.prescriptions[i].addition != null) {
  1525. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1526. total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
  1527. }
  1528. }
  1529. }
  1530. return total.toFixed(2)
  1531. }, getMonthTotal() {
  1532. // var total = 0
  1533. // for (let i = 0; i < this.month_prescriptions.length; i++) {
  1534. // if (this.month_prescriptions[i].advices != null) {
  1535. // for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1536. // total = total + (this.month_prescriptions[i].advices[a].retail_price* this.month_prescriptions[i].advices[a].prescribing_number)
  1537. // }
  1538. // }
  1539. // if (this.month_prescriptions[i].project != null) {
  1540. // for (let b = 0; b < this.month_prescriptions[i].project.length; b++) {
  1541. // total = total+ (this.month_prescriptions[i].project[b].price * this.month_prescriptions[i].project[b].total)
  1542. // }
  1543. // }
  1544. //
  1545. // if (this.month_prescriptions[i].addition != null) {
  1546. // for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  1547. // total = total + this.month_prescriptions[i].addition[b].price * this.month_prescriptions[i].addition[b].count
  1548. // }
  1549. // }
  1550. // }
  1551. console.log("~~~~~~"+this.settle_total)
  1552. return this.settle_total
  1553. },
  1554. createFilter(queryString) {
  1555. return (restaurant) => {
  1556. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  1557. }
  1558. },
  1559. querySearch2(queryString, cb) {
  1560. var restaurants = this.sick
  1561. restaurants.map(item => {
  1562. item.value = item.name
  1563. })
  1564. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  1565. // 调用 callback 返回建议列表的数据
  1566. cb(results)
  1567. },
  1568. changeKind(val) {
  1569. this.drugs = []
  1570. if (val == 0) {
  1571. this.drugs = this.allDrugs
  1572. } else {
  1573. for (let i = 0; i < this.allDrugs.length; i++) {
  1574. if (this.allDrugs[i].drug_type == val) {
  1575. this.drugs.push(this.allDrugs[i])
  1576. }
  1577. }
  1578. }
  1579. },
  1580. getDictionaryDataConfig(module, filed_name) {
  1581. return getDictionaryDataConfig(module, filed_name)
  1582. },
  1583. // getInitData() {
  1584. // getInitData().then(response => {
  1585. // if (response.data.state == 0) {
  1586. // this.$message.error(response.data.msg)
  1587. // return false
  1588. // } else {
  1589. // this.drugs = response.data.data.drugs
  1590. // this.allDrugs = response.data.data.drugs
  1591. // this.advices_template = response.data.data.advices_template
  1592. // this.doctors = response.data.data.doctors
  1593. // for (let i = 0; i < this.doctors.length; i++) {
  1594. // if (this.doctors[i].user_type == 1) {
  1595. // this.doctors.splice(i, 1)
  1596. // }
  1597. // }
  1598. // this.department = response.data.data.department
  1599. // this.sick = response.data.data.sick
  1600. // this.diagnoses = response.data.data.diagnose
  1601. // this.additions = response.data.data.additions
  1602. //
  1603. // }
  1604. // })
  1605. //
  1606. // },
  1607. monthTabclickEvent(val) {
  1608. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1609. if (this.month_prescriptions[i].name == val.name) {
  1610. if (this.dayorMonth == 'month') {
  1611. if (this.isShowDayPrescription) {
  1612. this.curDayPrescriptions = this.month_prescriptions[i]
  1613. //用来区分处方属于项目还是药品
  1614. if (this.curDayPrescriptions.advices.length > 0 && this.curDayPrescriptions.project.length == 0) {
  1615. this.monthCustomTabIndex = 1
  1616. }
  1617. if (this.curDayPrescriptions.advices.length == 0 && this.curDayPrescriptions.project.length > 0) {
  1618. this.monthCustomTabIndex = 2
  1619. }
  1620. } else {
  1621. this.curMonthPrescriptions = this.month_prescriptions[i]
  1622. //用来区分处方属于项目还是药品
  1623. if (this.curMonthPrescriptions.advices.length > 0 && this.curMonthPrescriptions.project.length == 0) {
  1624. this.monthCustomTabIndex = 1
  1625. }
  1626. if (this.curMonthPrescriptions.advices.length == 0 && this.curMonthPrescriptions.project.length > 0) {
  1627. this.monthCustomTabIndex = 2
  1628. }
  1629. }
  1630. }
  1631. this.teamList = []
  1632. this.curDrugs = []
  1633. this.$refs.multipleTable.clearSelection()
  1634. this.$refs.tables.clearSelection()
  1635. }
  1636. }
  1637. },
  1638. tabclickEvent(val) {
  1639. for (let i = 0; i < this.prescriptions.length; i++) {
  1640. if (this.prescriptions[i].name == val.name) {
  1641. this.prescription_id = this.prescriptions[i].id
  1642. this.$emit('event1', this.prescription_id)
  1643. this.curPrescriptions = this.prescriptions[i]
  1644. this.teamList = []
  1645. this.curDrugs = []
  1646. this.$refs.multipleTable.clearSelection()
  1647. this.$refs.tables.clearSelection()
  1648. //用来区分处方属于项目还是药品
  1649. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1650. this.customTabIndex = 1
  1651. this.curStatus = 1
  1652. this.rightTab = 1
  1653. this.showOne = true
  1654. this.showTwo = false
  1655. }
  1656. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1657. this.customTabIndex = 2
  1658. this.curStatus = 2
  1659. this.rightTab = 2
  1660. this.showTwo = true
  1661. this.showOne = false
  1662. }
  1663. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1664. this.customTabIndex = this.rightTab
  1665. this.curStatus = 0
  1666. }
  1667. }
  1668. }
  1669. if (this.curPrescriptions.order_status == 0) {
  1670. this.order_status = ''
  1671. }
  1672. if (this.curPrescriptions.order_status == 1) {
  1673. this.order_status = '未收费'
  1674. }
  1675. if (this.curPrescriptions.order_status == 2) {
  1676. this.order_status = '已结算'
  1677. }
  1678. if (this.curPrescriptions.order_status == 3) {
  1679. this.order_status = '已退费'
  1680. }
  1681. },
  1682. clearData() {
  1683. this.curPrescriptions = []
  1684. this.curStatus = 0
  1685. this.curDrugs = []
  1686. this.preDrugs = []
  1687. this.teamList = []
  1688. },
  1689. setData(data, info, admin_info, doctors, department, hisPatientInfo, month_data, last_info, sick, diagnoses) {
  1690. this.sick = sick
  1691. this.diagnoses = diagnoses
  1692. this.department = department
  1693. // this.curMonthPrescriptions = {}
  1694. // this.curPrescriptions = {}
  1695. // this.$refs.tabProjectTeam.clearSelection()
  1696. for (let i = 0; i < doctors.length; i++) {
  1697. if (doctors[i].user_type == 1) {
  1698. doctors.splice(i, 1)
  1699. }
  1700. }
  1701. this.prescription_id = data[0].id
  1702. this.editableTabsValue = '处方1'
  1703. this.dayorMonth = 'day'
  1704. this.$emit('event1', this.prescription_id)
  1705. this.curStatus = 0
  1706. if (month_data && month_data.length > 0) {
  1707. this.curMonthPrescriptions = month_data[0]
  1708. } else {
  1709. this.curMonthPrescriptions = {}
  1710. }
  1711. console.log("~~~~~~")
  1712. console.log(data[0])
  1713. if (data && data.length > 0) {
  1714. console.log("c")
  1715. this.curPrescriptions = data[0]
  1716. } else {
  1717. console.log("b")
  1718. this.curPrescriptions = {}
  1719. }
  1720. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1721. this.curStatus = 1
  1722. this.customTabIndex = 1
  1723. this.rightTab = 1
  1724. this.showOne = true
  1725. this.showTwo = false
  1726. }
  1727. if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
  1728. this.curStatus = 2
  1729. this.customTabIndex = 2
  1730. this.rightTab = 2
  1731. this.showOne = false
  1732. this.showTwo = true
  1733. }
  1734. if (this.curPrescriptions.project.length == 0 && this.curPrescriptions.advices.length == 0) {
  1735. this.curStatus = 1
  1736. this.customTabIndex = 1
  1737. this.rightTab = 1
  1738. this.showOne = true
  1739. this.showTwo = false
  1740. }
  1741. if (info.prescription_status == 0) {
  1742. this.order_status = ''
  1743. }
  1744. if (this.curPrescriptions.order_status == 1) {
  1745. this.order_status = '未收费'
  1746. }
  1747. if (this.curPrescriptions.order_status == 2) {
  1748. this.order_status = '已结算'
  1749. }
  1750. if (this.curPrescriptions.order_status == 3) {
  1751. this.order_status = '已退费'
  1752. }
  1753. this.state1 = info.sick_type
  1754. if (this.state1 == 0 || this.state1 == '') {
  1755. this.state1 = ''
  1756. for (let i = 0; i < this.sick.length; i++) {
  1757. this.state1 = this.sick[0].id
  1758. }
  1759. }
  1760. if (this.departmentValue == '' || this.departmentValue == 0) {
  1761. if (department.length > 0) {
  1762. this.departmentValue = department[0].id
  1763. }
  1764. }
  1765. if (info.id > 0) {
  1766. this.doctorValue = info.doctor_id
  1767. this.departmentValue = info.departments
  1768. } else {
  1769. if (admin_info.id > 0 && admin_info.user_type == 2) {
  1770. this.doctorValue = admin_info.admin_user_id
  1771. this.departmentValue = department[0].id
  1772. } else {
  1773. this.doctorValue = doctors[0].admin_user_id
  1774. this.departmentValue = department[0].id
  1775. }
  1776. }
  1777. // if (info.register_type == 0) {
  1778. // for (let i = 0; i < this.register.length; i++) {
  1779. // this.register_type = this.register[0].value
  1780. // }
  1781. // } else {
  1782. // this.register_type = info.register_type
  1783. // }
  1784. this.diagnose = []
  1785. if (info.id == 0) {
  1786. if (last_info.diagnosis.length == 0) {
  1787. this.diagnose = []
  1788. } else {
  1789. console.log(last_info.diagnosis)
  1790. for (let i = 0; i < last_info.diagnosis.split(",").length; i++) {
  1791. this.diagnose.push(parseInt(last_info.diagnosis.split(',')[i]))
  1792. }
  1793. }
  1794. if (last_info.sick_history == 0) {
  1795. this.state2 = ''
  1796. } else {
  1797. this.state2 = last_info.sick_history
  1798. }
  1799. } else {
  1800. this.state2 = info.sick_history
  1801. if (this.state2 == 0) {
  1802. this.state2 = ''
  1803. }
  1804. if (info.diagnosis.length == 0) {
  1805. this.diagnose = []
  1806. } else {
  1807. for (let i = 0; i < info.diagnosis.split(",").length; i++) {
  1808. this.diagnose.push(parseInt(info.diagnosis.split(',')[i]))
  1809. }
  1810. }
  1811. }
  1812. this.state1 = info.sick_type
  1813. if (this.state1 == 0 || this.state1 == '') {
  1814. this.state1 = ''
  1815. for (let i = 0; i < this.sick.length; i++) {
  1816. this.state1 = this.sick[0].id
  1817. }
  1818. }
  1819. if (this.departmentValue == '' || this.departmentValue == 0) {
  1820. if (department.length > 0) {
  1821. this.departmentValue = department[0].id
  1822. }
  1823. }
  1824. },
  1825. setMonthData(info, admin_info, doctors, department, hisPatientInfo, month_data, last_info,settle_total) {
  1826. this.curMonthPrescriptions = {}
  1827. this.curPrescriptions = {}
  1828. this.start_time = moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD')
  1829. this.end_time = moment(new Date()).add('year', 0).format('YYYY-MM-DD')
  1830. // this.$refs.tabProjectTeam.clearSelection()
  1831. for (let i = 0; i < doctors.length; i++) {
  1832. if (doctors[i].user_type == 1) {
  1833. doctors.splice(i, 1)
  1834. }
  1835. }
  1836. this.editableTabsValue = '处方1'
  1837. // this.curStatus = 0
  1838. // if (month_data && month_data.length > 0) {
  1839. // this.curMonthPrescriptions = month_data[0]
  1840. // } else {
  1841. // this.curMonthPrescriptions = {}
  1842. // }
  1843. if (info.prescription_status == 0) {
  1844. this.order_status = ''
  1845. }
  1846. if (info.id > 0) {
  1847. this.doctorValue = info.doctor_id
  1848. this.departmentValue = info.departments
  1849. } else {
  1850. if (admin_info.id > 0 && admin_info.user_type == 2) {
  1851. this.doctorValue = admin_info.admin_user_id
  1852. this.departmentValue = this.department[0].id
  1853. } else {
  1854. this.doctorValue = this.doctors[0].admin_user_id
  1855. this.departmentValue = this.department[0].id
  1856. }
  1857. }
  1858. if (info.register_type == 0) {
  1859. for (let i = 0; i < this.register.length; i++) {
  1860. this.register_type = this.register[0].value
  1861. }
  1862. } else {
  1863. this.register_type = info.register_type
  1864. }
  1865. this.diagnose = []
  1866. if (info.id == 0) {
  1867. if (last_info.diagnosis.length == 0) {
  1868. this.diagnose = []
  1869. } else {
  1870. for (let i = 0; i < last_info.diagnosis.split(",").length; i++) {
  1871. this.diagnose.push(parseInt(last_info.diagnosis.split(',')[i]))
  1872. }
  1873. }
  1874. if (last_info.sick_history == 0) {
  1875. this.state2 = ''
  1876. } else {
  1877. this.state2 = last_info.sick_history
  1878. }
  1879. } else {
  1880. this.state2 = info.sick_history
  1881. if (this.state2 == 0) {
  1882. this.state2 = ''
  1883. }
  1884. if (info.diagnosis.length == 0) {
  1885. this.diagnose = []
  1886. } else {
  1887. for (let i = 0; i < info.diagnosis.split(",").length; i++) {
  1888. this.diagnose.push(parseInt(info.diagnosis.split(',')[i]))
  1889. }
  1890. }
  1891. }
  1892. this.state1 = info.sick_type
  1893. if (this.state1 == 0 || this.state1 == '') {
  1894. this.state1 = ''
  1895. for (let i = 0; i < this.sick.length; i++) {
  1896. this.state1 = this.sick[0].id
  1897. }
  1898. }
  1899. if (this.departmentValue == '' || this.departmentValue == 0) {
  1900. if (this.department.length > 0) {
  1901. this.departmentValue = this.department[0].id
  1902. }
  1903. }
  1904. if (this.editableTabsValueTwo == '处方1') {
  1905. this.monthCustomTabIndex = 1
  1906. this.curMonthPrescriptions = month_data[0]
  1907. } else {
  1908. this.monthCustomTabIndex = 2
  1909. this.curMonthPrescriptions = month_data[1]
  1910. }
  1911. this.settle_total = settle_total
  1912. },
  1913. moreState(tab, event) {
  1914. if (tab == 'more') {
  1915. return false
  1916. }
  1917. }, open_three() {
  1918. console.log(this.prescriptions)
  1919. for (let i = 0; i < this.prescriptions.length; i++) {
  1920. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  1921. if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
  1922. this.$message.error('药品处方总量不能为0')
  1923. return
  1924. }
  1925. }
  1926. }
  1927. for (let i = 0; i < this.prescriptions.length; i++) {
  1928. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1929. if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
  1930. this.$message.error('项目处方总量不能为0')
  1931. return
  1932. }
  1933. }
  1934. }
  1935. this.$refs.saveTemplate.show(this.prescriptions)
  1936. }, open_two() {
  1937. if (this.dayorMonth == 'day') {
  1938. if (this.patientInfo == null || this.patientInfo.id == 0) {
  1939. this.$message.error('请选择患者')
  1940. return
  1941. }
  1942. let params = {
  1943. end_time: this.record_date,
  1944. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1945. patient_id: this.patientInfo.id,
  1946. p_type: 1
  1947. }
  1948. getCallHisPrescription(params).then(response => {
  1949. if (response.data.state == 1) {
  1950. this.$refs.call_prescription.show(this.patientInfo.name, this.patientInfo.id, params.end_time, params.start_time, this.prescriptions, response.data.data.prescriptions)
  1951. } else {
  1952. this.$message.error(response.data.msg)
  1953. }
  1954. })
  1955. } else {
  1956. this.$message.error('当前属于月结状态,无法试用处方调用')
  1957. }
  1958. },
  1959. open(index, isLoading) {
  1960. if (!isLoading) {
  1961. if (this.dayorMonth == 'day') {
  1962. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  1963. this.$message.error('请先开处方')
  1964. return
  1965. }
  1966. if (this.dayorMonth == 'day') {
  1967. if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 4) {
  1968. this.$message.error('当前处方已经结算或者已经上传医保系统,无法保存')
  1969. return
  1970. }
  1971. if (this.doctorValue.length <= 0) {
  1972. this.$message.error('医生不能为空')
  1973. return
  1974. }
  1975. if (this.departmentValue.length <= 0) {
  1976. this.$message.error('科室不能为空')
  1977. return
  1978. }
  1979. if (this.state1 <= 0) {
  1980. this.$message.error('疾病类型不能为空')
  1981. return
  1982. }
  1983. for (let i = 0; i < this.prescriptions.length; i++) {
  1984. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  1985. if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
  1986. this.$message.error('药品处方总量不能为0')
  1987. return
  1988. }
  1989. }
  1990. }
  1991. for (let i = 0; i < this.prescriptions.length; i++) {
  1992. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1993. if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
  1994. this.$message.error('项目处方总量不能为0')
  1995. return
  1996. }
  1997. }
  1998. }
  1999. for (let i = 0; i < this.prescriptions.length; i++) {
  2000. if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
  2001. this.$message.error('处方医疗类型不能为空')
  2002. return
  2003. }
  2004. }
  2005. if (index == 1) {
  2006. // for (let i = 0; i < this.prescriptions.length; i++) {
  2007. // for(let b = 0; b < this.prescriptions[i].advices.length; b++){
  2008. // if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
  2009. // this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,开非特病类型的药")
  2010. // return
  2011. // }
  2012. // }
  2013. // for(let c = 0; c < this.prescriptions[i].project.length; c++){
  2014. // if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2 && this.prescriptions[i].project[c].project.disease_directory != 1) {
  2015. // this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的项目")
  2016. // return
  2017. // }
  2018. //
  2019. // if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 3 && this.prescriptions[i].project[c].good_info.is_special_diseases != 1) {
  2020. // this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的耗材")
  2021. // return
  2022. // }
  2023. // }
  2024. // }
  2025. //
  2026. for (let i = 0; i < this.prescriptions.length; i++) {
  2027. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length == 0) {
  2028. this.$message.error('处方内容不能为空')
  2029. return
  2030. }
  2031. }
  2032. this.$emit('editKeepLoad', true)
  2033. let params = {
  2034. p_type: 1,
  2035. patient_id: this.patientInfo.id,
  2036. diagnose: this.diagnose.join(','),
  2037. sick_type: this.state1,
  2038. sick_history: this.state2,
  2039. doctor: this.doctorValue,
  2040. department: this.departmentValue,
  2041. record_date: this.record_date,
  2042. his_patient_id: this.hisPatientInfo.id,
  2043. reg_type: this.register_type,
  2044. }
  2045. for (let i = 0; i < this.prescriptions.length; i++) {
  2046. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  2047. this.prescriptions[i]['type'] = 1
  2048. }
  2049. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  2050. this.prescriptions[i]['type'] = 2
  2051. }
  2052. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  2053. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  2054. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  2055. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  2056. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  2057. this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
  2058. }
  2059. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  2060. if(this.prescriptions[i].advices[b].delivery_way == "" ){
  2061. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}用法未填写`)
  2062. this.$emit('editKeepLoad', false)
  2063. return
  2064. }
  2065. if(this.prescriptions[i].advices[b].execution_frequency == "" ){
  2066. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}频率未填写`)
  2067. this.$emit('editKeepLoad', false)
  2068. return
  2069. }
  2070. if(this.prescriptions[i].advices[b].day == NaN){
  2071. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}天数未填写`)
  2072. this.$emit('editKeepLoad', false)
  2073. return
  2074. }
  2075. if(this.prescriptions[i].advices[b].day == 0){
  2076. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}天数不能为0`)
  2077. this.$emit('editKeepLoad', false)
  2078. return
  2079. }
  2080. if(this.prescriptions[i].advices[b].prescribing_number == ""){
  2081. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}总量未填写`)
  2082. this.$emit('editKeepLoad', false)
  2083. return
  2084. }
  2085. if(this.prescriptions[i].advices[b].prescribing_number == "0"){
  2086. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}总量不能为0`)
  2087. this.$emit('editKeepLoad', false)
  2088. return
  2089. }
  2090. if(this.prescriptions[i].advices[b].prescribing_number_unit == ""){
  2091. this.$message.error(`处方${i+1}的${this.prescriptions[i].advices[b].drug_name}总量单位未填写`)
  2092. this.$emit('editKeepLoad', false)
  2093. return
  2094. }
  2095. }
  2096. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  2097. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  2098. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  2099. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  2100. this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
  2101. }
  2102. // for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  2103. // if(this.prescriptions[i].project[b].delivery_way == "" ){
  2104. // this.$message.error(`处方${i+1}的${this.prescriptions[i].project[b].project_name}用法未填写`)
  2105. // this.$emit('editKeepLoad', false)
  2106. // return
  2107. // }
  2108. // if(this.prescriptions[i].project[b].execution_frequency == "" ){
  2109. // this.$message.error(`处方${i+1}的${this.prescriptions[i].project[b].project_name}频率未填写`)
  2110. // this.$emit('editKeepLoad', false)
  2111. // return
  2112. // }
  2113. // if(this.prescriptions[i].project[b].day == " "){
  2114. // this.$message.error(`处方${i+1}的${this.prescriptions[i].project[b].number_days}天数未填写`)
  2115. // this.$emit('editKeepLoad', false)
  2116. // return
  2117. // }
  2118. // if(this.prescriptions[i].project[b].day == "0"){
  2119. // this.$message.error(`处方${i+1}的${this.prescriptions[i].project[b].number_days}天数不能为0`)
  2120. // this.$emit('editKeepLoad', false)
  2121. // return
  2122. // }
  2123. // }
  2124. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  2125. this.prescriptions[i].addition[b].id = prarseInt(this.prescriptions[i].addition[b].id)
  2126. this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
  2127. this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
  2128. this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
  2129. }
  2130. }
  2131. let data = {
  2132. 'prescriptions': this.prescriptions
  2133. }
  2134. isLoading = true
  2135. console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
  2136. let num = 0
  2137. // this.prescriptions.map(item => {
  2138. // if (item.advices.length > 0) {
  2139. // item.advices.map(it => {
  2140. // if (it.drug.total <= 0) {
  2141. // num++
  2142. // setTimeout(() => {
  2143. // this.$message.error(it.drug.drug_name + '库存不足')
  2144. // }, 100)
  2145. // }
  2146. // })
  2147. // }
  2148. // })
  2149. if (num == 0) {
  2150. createHisPrescription(data, params).then(response => {
  2151. if (response.data.state == 1) {
  2152. this.$emit('change', this.patientInfo.id)
  2153. this.$message.success('保存成功')
  2154. this.$emit('editKeepLoad', false)
  2155. } else {
  2156. this.$message.error(response.data.msg)
  2157. this.$emit('editKeepLoad', false)
  2158. }
  2159. })
  2160. }
  2161. }
  2162. } else if (index == 2) {
  2163. this.$router.push('/outpatientDoctorStation/print')
  2164. } else if (index == 4) {
  2165. } else if (index == 5) {
  2166. this.$refs.saveTemplate.show()
  2167. }
  2168. } else if (this.dayorMonth == 'month') {
  2169. if (this.isShowDayPrescription) {
  2170. // if (this.curDayPrescriptions.order_status == 2) {
  2171. // this.$message.error('当前处方已经结算,无法保存')
  2172. // return
  2173. // }
  2174. if (this.doctorValue.length <= 0) {
  2175. this.$message.error('医生不能为空')
  2176. return
  2177. }
  2178. if (this.departmentValue.length <= 0) {
  2179. this.$message.error('科室不能为空')
  2180. return
  2181. }
  2182. if (index == 1) {
  2183. let params = {
  2184. patient_id: this.patientInfo.id,
  2185. diagnose: this.diagnose.join(','),
  2186. sick_type: this.state1,
  2187. sick_history: this.state2,
  2188. doctor: this.doctorValue,
  2189. department: this.departmentValue,
  2190. record_date: this.end_time,
  2191. his_patient_id: this.hisPatientInfo.id,
  2192. reg_type: this.register_type,
  2193. p_type: 1
  2194. }
  2195. var month_prescriptions = this.deepClone(this.month_prescriptions)
  2196. for (let i = 0; i < month_prescriptions.length; i++) {
  2197. if (month_prescriptions[i].advices.length > 0 && month_prescriptions[i].project.length == 0) {
  2198. month_prescriptions[i]['type'] = 1
  2199. }
  2200. if (month_prescriptions[i].advices.length == 0 && month_prescriptions[i].project.length > 0) {
  2201. month_prescriptions[i]['type'] = 2
  2202. }
  2203. for (let b = 0; b < month_prescriptions[i].advices.length; b++) {
  2204. month_prescriptions[i].advices[b].single_dose = month_prescriptions[i].advices[b].single_dose.toString()
  2205. month_prescriptions[i].advices[b].prescribing_number = month_prescriptions[i].advices[b].prescribing_number.toString()
  2206. month_prescriptions[i].advices[b].retail_price = month_prescriptions[i].advices[b].retail_price.toString()
  2207. month_prescriptions[i].advices[b].day = parseInt(month_prescriptions[i].advices[b].day)
  2208. }
  2209. for (let b = 0; b < month_prescriptions[i].project.length; b++) {
  2210. month_prescriptions[i].project[b].price = month_prescriptions[i].project[b].price.toString()
  2211. month_prescriptions[i].project[b].total = month_prescriptions[i].project[b].total.toString()
  2212. month_prescriptions[i].project[b].delivery_way = month_prescriptions[i].project[b].delivery_way.toString()
  2213. }
  2214. for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  2215. month_prescriptions[i].addition[b].id = parseInt(month_prescriptions[i].addition[b].id)
  2216. month_prescriptions[i].addition[b].item_id = parseInt(month_prescriptions[i].addition[b].item_id)
  2217. month_prescriptions[i].addition[b].price = month_prescriptions[i].addition[b].price.toString()
  2218. month_prescriptions[i].addition[b].count = month_prescriptions[i].addition[b].count.toString()
  2219. }
  2220. }
  2221. let data = {
  2222. 'prescriptions': month_prescriptions
  2223. }
  2224. editHisPrescription(data, params).then(response => {
  2225. if (response.data.state == 1) {
  2226. this.month_prescriptions = month_prescriptions
  2227. this.$message.success('编辑成功')
  2228. }
  2229. })
  2230. }
  2231. }
  2232. }
  2233. }
  2234. },
  2235. addTab(targetName) {
  2236. // if (this.curPrescriptions.order_status == 2) {
  2237. // this.$message.error('该处方已经结算或者退费,无法继续添加处方')
  2238. // return
  2239. // }
  2240. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  2241. this.$message.error('当前处方无数据,新增数据后才能新增处方')
  2242. return
  2243. }
  2244. this.tabIndex = this.prescriptions.length
  2245. var str = this.prescriptions[this.prescriptions.length - 1].name
  2246. var reg = /[\u4e00-\u9fa5]/g
  2247. // var str= " 阿达 adas 123132 一二三 ";
  2248. // str= str.replace(/[ ]/g, "");//去空格
  2249. str = str.replace(reg, '')//去除中文
  2250. this.tabIndex = parseInt(str.replace(reg, ''))
  2251. ++this.tabIndex
  2252. let newTabName = '处方' + this.tabIndex
  2253. var nowDate = new Date()
  2254. var nowYear = nowDate.getFullYear()
  2255. var nowMonth = nowDate.getMonth() + 1
  2256. var nowDay = nowDate.getDate()
  2257. var hours = nowDate.getHours()
  2258. var min = nowDate.getMinutes()
  2259. var nowTime =
  2260. nowYear +
  2261. '-' +
  2262. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  2263. '-' +
  2264. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  2265. ':' + (min < 10 ? '0' + min : min)
  2266. let obj = {
  2267. id: 0,
  2268. name: newTabName,
  2269. order_status: 0,
  2270. advices: [],
  2271. project: [],
  2272. addition: [],
  2273. pre_time: this.prescriptions[0].pre_time
  2274. }
  2275. obj.med_type = 14
  2276. this.prescriptions.push(obj)
  2277. this.editableTabsValue = newTabName
  2278. this.curPrescriptions = this.prescriptions[this.prescriptions.length - 1]
  2279. this.curStatus = 0
  2280. if (this.curPrescriptions.order_status == 0) {
  2281. this.order_status = '未收费'
  2282. }
  2283. if (this.curPrescriptions.order_status == 1) {
  2284. this.order_status = '未收费'
  2285. }
  2286. if (this.curPrescriptions.order_status == 2) {
  2287. this.order_status = '已结算'
  2288. }
  2289. if (this.curPrescriptions.order_status == 3) {
  2290. this.order_status = '已退费'
  2291. }
  2292. },
  2293. removeTab(targetName) {
  2294. if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 4) {
  2295. this.$message.error('该处方已经结算或者已经上传医保系统,无法删除')
  2296. return
  2297. }
  2298. if (targetName == '处方1') {
  2299. this.$message.error('该处方无法删除')
  2300. return
  2301. }
  2302. this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
  2303. confirmButtonText: '确 定',
  2304. cancelButtonText: '取 消',
  2305. type: 'warning'
  2306. }).then(() => {
  2307. let id = 0
  2308. for (let i = 0; i < this.prescriptions.length; i++) {
  2309. if (this.prescriptions[i].name == targetName) {
  2310. id = this.prescriptions[i].id
  2311. }
  2312. }
  2313. if (id == 0) {
  2314. let tabs = this.prescriptions
  2315. let activeName = this.editableTabsValue
  2316. if (activeName === targetName) {
  2317. tabs.forEach((tab, index) => {
  2318. if (tab.name === targetName) {
  2319. let nextTab = tabs[index + 1] || tabs[index - 1]
  2320. if (nextTab) {
  2321. activeName = nextTab.name
  2322. }
  2323. }
  2324. })
  2325. }
  2326. this.editableTabsValue = activeName
  2327. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  2328. for (let i = 0; i < this.prescriptions.length; i++) {
  2329. if (activeName == this.prescriptions[i].name) {
  2330. this.curPrescriptions = this.prescriptions[i]
  2331. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2332. this.curStatus = 1
  2333. }
  2334. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2335. this.curStatus = 2
  2336. }
  2337. }
  2338. }
  2339. if (this.prescriptions.length == 0) {
  2340. this.curPrescriptions = []
  2341. this.curStatus = 0
  2342. }
  2343. } else {
  2344. let params = {
  2345. 'id': id
  2346. }
  2347. delHisPrescription(params).then(response => {
  2348. if (response.data.state == 1) {
  2349. this.$message.success('删除成功')
  2350. let tabs = this.prescriptions
  2351. let activeName = this.editableTabsValue
  2352. if (activeName === targetName) {
  2353. tabs.forEach((tab, index) => {
  2354. if (tab.name === targetName) {
  2355. let nextTab = tabs[index + 1] || tabs[index - 1]
  2356. if (nextTab) {
  2357. activeName = nextTab.name
  2358. }
  2359. }
  2360. })
  2361. }
  2362. this.editableTabsValue = activeName
  2363. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  2364. for (let i = 0; i < this.prescriptions.length; i++) {
  2365. if (activeName == this.prescriptions[i].name) {
  2366. this.curPrescriptions = this.prescriptions[i]
  2367. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2368. this.curStatus = 1
  2369. }
  2370. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2371. this.curStatus = 2
  2372. }
  2373. }
  2374. }
  2375. if (this.prescriptions.length == 0) {
  2376. this.curPrescriptions = []
  2377. this.curStatus = 0
  2378. }
  2379. } else {
  2380. this.$message.success(response.data.msg)
  2381. }
  2382. })
  2383. }
  2384. }).catch(() => {
  2385. })
  2386. },
  2387. beforeLeave(activeName, oldActiveName) {
  2388. let index = activeName
  2389. if (index == 1) {
  2390. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2391. return false
  2392. }
  2393. } else {
  2394. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2395. return false
  2396. }
  2397. }
  2398. },
  2399. clickTab(tab) {
  2400. let index = parseInt(tab.name)
  2401. if (index == 1) {
  2402. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2403. this.$message.error('当前处方为项目,无法切换为药品,需要新开处方')
  2404. return
  2405. }
  2406. } else {
  2407. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2408. this.$message.error('当前处方为药品,无法切换为项目,需要新开处方')
  2409. return
  2410. }
  2411. }
  2412. if (index == 1) {
  2413. this.teamList = []
  2414. this.$refs.tables.clearSelection()
  2415. this.showOne = true
  2416. this.showTwo = false
  2417. this.$nextTick(() => {
  2418. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  2419. })
  2420. this.customTabIndex = 1
  2421. }
  2422. if (index == 2) {
  2423. this.curDrugs = []
  2424. this.$refs.multipleTable.clearSelection()
  2425. this.showTwo = true
  2426. this.showOne = false
  2427. this.$nextTick(() => {
  2428. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  2429. })
  2430. this.customTabIndex = 2
  2431. }
  2432. this.rightTab = index
  2433. //用来区分处方属于项目还是药品
  2434. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2435. this.customTabIndex = 1
  2436. this.curStatus = 1
  2437. }
  2438. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2439. this.customTabIndex = 2
  2440. this.curStatus = 2
  2441. }
  2442. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  2443. // this.customTabIndex = this.rightTab
  2444. this.customTabIndex = index
  2445. this.curStatus = 0
  2446. }
  2447. }, changeAllGoodInfoTableData: function(selection) {
  2448. this.curDrugs = selection
  2449. }, addCharges() {
  2450. this.$refs.additionalCharges.show()
  2451. },
  2452. selectDrugs(selection, row) {
  2453. if (this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340) {
  2454. if (row.count <= 0) {
  2455. if (selection) {
  2456. selection.forEach(row => {
  2457. if (row.count <= 0) {
  2458. this.$refs.multipleTable.toggleRowSelection(row)
  2459. }
  2460. })
  2461. } else {
  2462. this.$refs.multipleTable.clearSelection()
  2463. }
  2464. this.$message.error(row.drug_name + '库存不足')
  2465. return
  2466. }
  2467. } else {
  2468. if (row.total <= 0) {
  2469. if (selection) {
  2470. selection.forEach(row => {
  2471. if (row.total <= 0) {
  2472. this.$refs.multipleTable.toggleRowSelection(row)
  2473. }
  2474. })
  2475. } else {
  2476. this.$refs.multipleTable.clearSelection()
  2477. }
  2478. this.$message.error(row.drug_name + '库存不足')
  2479. return
  2480. }
  2481. }
  2482. this.curDrugs = selection
  2483. },
  2484. comfirm() {
  2485. // if (this.curDrugs.length > 0) {
  2486. // for (let i = 0; i < this.curDrugs.length; i++) {
  2487. // if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  2488. // this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  2489. // return
  2490. // }
  2491. //
  2492. // }
  2493. // }
  2494. // if (this.teamList.length > 0) {
  2495. // for (let i = 0; i < this.teamList.length; i++) {
  2496. // if (this.curPrescriptions.med_type == 14 && this.teamList[i].is_special_diseases != 1) {
  2497. // this.$message.error('该处方属于特病类型处方,请开特病类型的项目')
  2498. // // return
  2499. // }
  2500. //
  2501. // }
  2502. //
  2503. // let arr = this.teamList
  2504. // let newArr = []
  2505. // arr.map(item => {
  2506. // if (this.curPrescriptions.med_type != 14) {
  2507. // newArr.push(item)
  2508. // }
  2509. // if (this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1) {
  2510. // newArr.push(item)
  2511. // }
  2512. // })
  2513. // this.teamList = newArr
  2514. // }
  2515. //
  2516. // if (this.curDrugs.length == 0) {
  2517. // for (let i = 0; i < this.curDrugs.length; i++) {
  2518. // if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  2519. // this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  2520. // return
  2521. // }
  2522. // }
  2523. // }
  2524. // if (this.curPrescriptions.order_status == 2) {
  2525. // this.$message.error('该处方已经结算,无法继续添加药品或者项目')
  2526. // this.teamList = []
  2527. // this.curDrugs = []
  2528. // this.tempDrugs = []
  2529. // this.$refs.tables.clearSelection()
  2530. // this.$refs.multipleTableTwo.clearSelection()
  2531. // this.$refs.multipleTable.clearSelection()
  2532. // return
  2533. // }
  2534. let isAdd = true
  2535. for (let i = 0; i < this.prescriptions.length; i++) {
  2536. if(this.prescriptions[i].order_status == 4 || this.prescriptions[i].order_status == 2){
  2537. isAdd = false
  2538. }
  2539. }
  2540. if(!isAdd){
  2541. this.$message.error("该患者已经上传明细或者已经结算,无法新增药品或耗材")
  2542. return
  2543. }
  2544. if (this.curStatus == 1 && this.rightTab == 2) {
  2545. this.$message.error('改处方是药品,无法添加项目')
  2546. this.teamList = []
  2547. this.$refs.tables.clearSelection()
  2548. return
  2549. }
  2550. if (this.curStatus == 2 && this.rightTab == 1) {
  2551. this.$message.error('改处方是项目,无法添加药品')
  2552. this.curDrugs = []
  2553. this.tempDrugs = []
  2554. this.$refs.multipleTable.clearSelection()
  2555. this.$refs.multipleTableTwo.clearSelection()
  2556. return
  2557. }
  2558. console.log('this.teamList', this.teamList)
  2559. console.log('this.curPrescriptions.project', this.curPrescriptions.project)
  2560. for (let i = 0; i < this.teamList.length; i++) {
  2561. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  2562. if (this.teamList[i].id == this.curPrescriptions.project[a].project_id && this.teamList[i].type == this.curPrescriptions.project[a].type) {
  2563. this.$message.error('当前处方存在相同的药品,无法添加相同的项目')
  2564. return
  2565. }
  2566. }
  2567. }
  2568. for (let i = 0; i < this.curDrugs.length; i++) {
  2569. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2570. if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
  2571. this.$message.error('当前处方存在相同的药品,无法添加相同的药品')
  2572. return
  2573. }
  2574. }
  2575. }
  2576. let templateDrugs = []
  2577. for (let i = 0; i < this.tempDrugs.length; i++) {
  2578. for (let a = 0; a < this.tempDrugs[i].advices.length; a++) {
  2579. templateDrugs.push(this.tempDrugs[i].advices[a])
  2580. }
  2581. }
  2582. // for (let i = 0; i < templateDrugs.length; i++) {
  2583. // for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2584. // if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
  2585. // this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  2586. // return
  2587. //
  2588. // }
  2589. // }
  2590. // }
  2591. for (let i = 0; i < this.prescriptions.length; i++) {
  2592. if (this.prescriptions[i].name == this.editableTabsValue) {
  2593. var temp = this.deepClone(this.curDrugs)
  2594. var temp2 = this.deepClone(this.teamList)
  2595. var temp3 = this.deepClone(templateDrugs)
  2596. console.log('hhhhhhhhhhhhhh', temp)
  2597. console.log('hhhh23', temp2)
  2598. console.log('hhhh23', temp3)
  2599. if (temp3.length > 0) {
  2600. for (let b = 0; b < temp3.length; b++) {
  2601. let obj = {
  2602. advice_id: 0,
  2603. id: temp3[b].id,
  2604. drug_name: temp3[b].advice_name,
  2605. single_dose: temp3[b].single_dose.toString(),
  2606. delivery_way: temp3[b].delivery_way,
  2607. execution_frequency: temp3[b].execution_frequency,
  2608. retail_price: temp3[b].drug.retail_price.toString(),
  2609. remark: '',
  2610. day: '1',
  2611. prescribing_number: temp3[b].prescribing_number,
  2612. single_dose_unit: temp3[b].drug.drug_dose_unit,
  2613. prescribing_number_unit: temp3[b].drug.prescribing_number_unit,
  2614. medical_insurance_number: temp3[b].drug.medical_insurance_number
  2615. }
  2616. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  2617. obj.prescribing_number = 1
  2618. }
  2619. this.prescriptions[i].advices.push(obj)
  2620. }
  2621. this.curStatus = 1
  2622. }
  2623. let index = 0
  2624. if (this.curPrescriptions.advices.length > 0) {
  2625. index = this.curPrescriptions.advices.length
  2626. }
  2627. if (temp.length > 0) {
  2628. for (let b = 0; b < temp.length; b++) {
  2629. let temp_index = b + 1
  2630. let obj = {
  2631. advice_id: 0,
  2632. id: temp[b].id,
  2633. drug_name: temp[b].drug_name,
  2634. single_dose: temp[b].drug_dose,
  2635. delivery_way: temp[b].delivery_way,
  2636. execution_frequency: temp[b].execution_frequency,
  2637. retail_price: temp[b].prescribing_number_unit == temp[b].max_unit ? temp[b].retail_price.toString() : temp[b].min_price.toString(),
  2638. remark: '',
  2639. day: temp[b].drug_day ? temp[b].drug_day : 1,
  2640. prescribing_number: temp[b].prescribing_number,
  2641. single_dose_unit: temp[b].dose_unit,
  2642. prescribing_number_unit: temp[b].prescribing_number_unit,
  2643. medical_insurance_number: temp[b].medical_insurance_number,
  2644. drug: temp[b],
  2645. groupno: index + temp_index,
  2646. hosp_appr_flag: '1'
  2647. }
  2648. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  2649. obj.prescribing_number = 1
  2650. }
  2651. console.log('obj', obj)
  2652. this.prescriptions[i].advices.push(obj)
  2653. }
  2654. this.curStatus = 1
  2655. }
  2656. if (temp2.length > 0) {
  2657. for (let b = 0; b < temp2.length; b++) {
  2658. let obj = {
  2659. id: 0,
  2660. project_id: temp2[b].id,
  2661. project_name: temp2[b].project_name,
  2662. statistical_classification: '',
  2663. single_dose: temp2[b].single_dose.toString(),
  2664. delivery_way: temp2[b].delivery_way,
  2665. execution_frequency: temp2[b].execution_frequency,
  2666. number_days: temp2[b].number_days.toString(),
  2667. total: temp2[b].cus_total,
  2668. price: temp2[b].price,
  2669. remark: '',
  2670. medical_code: temp2[b].medical_code,
  2671. unit: temp2[b].unit,
  2672. type: temp2[b].type
  2673. }
  2674. if (temp2[b].type == 2) {
  2675. obj['project'] = temp2[b].project
  2676. } else if (temp2[b].type == 3) {
  2677. obj['good_info'] = temp2[b].good_info
  2678. }
  2679. if (temp2[b].team_id == undefined) {
  2680. obj['team_id'] = 0
  2681. } else {
  2682. obj['team_id'] = temp2[b].team_id
  2683. }
  2684. if (obj.total == 0 || obj.total == undefined) {
  2685. obj.total = 1
  2686. }
  2687. if (obj.type == 3) {
  2688. obj.single_dose = 1
  2689. }
  2690. console.log('项目obj', temp2)
  2691. this.prescriptions[i].project.push(obj)
  2692. }
  2693. this.curStatus = 2
  2694. }
  2695. this.curPrescriptions = this.prescriptions[i]
  2696. this.$refs.multipleTable.clearSelection()
  2697. this.$refs.tables.clearSelection()
  2698. this.clearSelection()
  2699. }
  2700. }
  2701. this.curDrugs = []
  2702. this.preDrugs = []
  2703. this.teamList = []
  2704. }, changeAllGoodInfoTableDataTwo(row) {
  2705. this.teamList = row
  2706. },
  2707. selectChange(selection, row) {
  2708. console.log('row', row)
  2709. if (this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 10188 || this.org_id == 9956 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340) {
  2710. if (row.stock_count <= 0) {
  2711. if (row.type == 3) {
  2712. if (selection) {
  2713. selection.forEach(row => {
  2714. if (row.stock_count <= 0) {
  2715. this.$refs.tables.toggleRowSelection(row)
  2716. }
  2717. })
  2718. } else {
  2719. this.$refs.tables.clearSelection()
  2720. }
  2721. this.$message.error(row.project_name + '库存不足')
  2722. return
  2723. }
  2724. }
  2725. } else {
  2726. if (row.total <= 0) {
  2727. if (row.type == 3) {
  2728. if (selection) {
  2729. selection.forEach(row => {
  2730. if (row.total <= 0) {
  2731. this.$refs.tables.toggleRowSelection(row)
  2732. }
  2733. })
  2734. } else {
  2735. this.$refs.tables.clearSelection()
  2736. }
  2737. this.$message.error(row.project_name + '库存不足')
  2738. return
  2739. }
  2740. }
  2741. }
  2742. this.teamList.push(row)
  2743. },
  2744. getlist() {
  2745. this.tabProject = []
  2746. getHisProject().then(response => {
  2747. if (response.data.state == 1) {
  2748. var project = response.data.data.project
  2749. for (let i = 0; i < project.length; i++) {
  2750. let obj = {
  2751. id: project[i].id,
  2752. project_name: project[i].project_name,
  2753. statistical_classification: '',
  2754. single_dose: project[i].single_dose,
  2755. delivery_way: project[i].delivery_way,
  2756. execution_frequency: project[i].execution_frequency,
  2757. number_days: project[i].number_days,
  2758. price: project[i].price,
  2759. medical_code: project[i].medical_code,
  2760. cus_total: 1,
  2761. unit: project[i].unit,
  2762. type: 2,
  2763. total: project[i].total,
  2764. is_special_diseases: project[i].disease_directory,
  2765. project: project[i],
  2766. stock_count: 0
  2767. }
  2768. this.tabProject.push(obj)
  2769. }
  2770. var good_info = response.data.data.good_info
  2771. for (let i = 0; i < good_info.length; i++) {
  2772. good_info[i].stock_count = 0
  2773. if (good_info[i].good_stock_in&&good_info[i].good_stock_in.length > 0) {
  2774. for (let j = 0; j < good_info[i].good_stock_in.length; j++) {
  2775. good_info[i].stock_count += good_info[i].good_stock_in[j].stock_count
  2776. }
  2777. }
  2778. let obj = {
  2779. id: good_info[i].id,
  2780. project_name: good_info[i].good_name,
  2781. statistical_classification: '',
  2782. single_dose: good_info[i].specification_name,
  2783. delivery_way: '',
  2784. execution_frequency: '',
  2785. number_days: 1,
  2786. cus_total: 1,
  2787. price: good_info[i].packing_price,
  2788. medical_code: good_info[i].medical_insurance_number,
  2789. unit: this.getGoodUnit(good_info[i].good_unit),
  2790. type: 3,
  2791. total: good_info[i].total,
  2792. is_special_diseases: good_info[i].is_special_diseases,
  2793. good_info: good_info[i],
  2794. stock_count: good_info[i].stock_count
  2795. }
  2796. this.tabProject.push(obj)
  2797. }
  2798. this.allProject = this.tabProject
  2799. }
  2800. })
  2801. }, deepClone(source) {
  2802. if (!source && typeof source !== 'object') {
  2803. throw new Error('error arguments', 'shallowClone')
  2804. }
  2805. const targetObj = source.constructor === Array ? [] : {}
  2806. Object.keys(source).forEach((keys) => {
  2807. if (source[keys] && typeof source[keys] === 'object') {
  2808. targetObj[keys] = this.deepClone(source[keys])
  2809. } else {
  2810. targetObj[keys] = source[keys]
  2811. }
  2812. })
  2813. return targetObj
  2814. }, getGoodUnit(id) {
  2815. var goodUnit = this.$store.getters.good_unit
  2816. for (let i = 0; i < goodUnit.length; i++) {
  2817. if (goodUnit[i].id == id) {
  2818. return goodUnit[i].name
  2819. }
  2820. }
  2821. },
  2822. getAllProjectTeam() {
  2823. getAllProjectTeam().then(response => {
  2824. if (response.data.state == 1) {
  2825. var team = response.data.data.team
  2826. this.tabPrjectTeam = team
  2827. this.allTabPrjectTeam = team
  2828. this.projectList = team
  2829. }
  2830. })
  2831. },
  2832. selectTeam(row) {
  2833. console.log(row)
  2834. // var arr = []
  2835. // for (let i = 0; i < row.length; i++) {
  2836. // arr.push(row[i].item_id)
  2837. // }
  2838. // console.log(arr)
  2839. // var ids = arr.join(',')
  2840. // console.log(ids)
  2841. // var strArr = ids.split(',')
  2842. // console.log(strArr)
  2843. // var res = []//接收不重复的数据
  2844. //
  2845. // for (var i = 0; i < strArr.length; i++) {
  2846. // var flag = true
  2847. //
  2848. // for (var j = 0; j < i; j++) {
  2849. // if (strArr[i] === strArr[j]) {
  2850. // flag = false
  2851. // break
  2852. // }
  2853. // }
  2854. // if (flag) {
  2855. // res.push(strArr[i])
  2856. // }
  2857. // }
  2858. // console.log(res)
  2859. // var idstr = res.join(',')
  2860. let teamList = []
  2861. for (let i = 0; i < row.length; i++) {
  2862. let team_id = row[i].id
  2863. console.log(team_id)
  2864. const params = {
  2865. project_id: row[i].item_id
  2866. }
  2867. getPojectListById(params).then(response => {
  2868. if (response.data.state == 1) {
  2869. var project = response.data.data.project
  2870. let num = 0
  2871. for (let i = 0; i < project.length; i++) {
  2872. if (project[i].type == 2 && project[i].status == 1) {
  2873. let obj = {
  2874. id: project[i].project_id,
  2875. project_name: project[i].project.project_name,
  2876. statistical_classification: '',
  2877. single_dose: project[i].project.single_dose,
  2878. delivery_way: project[i].project.delivery_way,
  2879. execution_frequency: project[i].project.execution_frequency,
  2880. number_days: project[i].project.number_days,
  2881. cus_total: project[i].number,
  2882. price: project[i].project.price,
  2883. remark: '',
  2884. medical_code: project[i].project.medical_code,
  2885. unit: project[i].project.unit,
  2886. type: project[i].type,
  2887. is_special_diseases: project[i].project.disease_directory,
  2888. team_id: team_id,
  2889. project: project[i].project
  2890. }
  2891. if (obj.cus_total == 0 || obj.cus_total == undefined) {
  2892. obj.cus_total = 1
  2893. }
  2894. teamList.push(obj)
  2895. } else if (project[i].type == 3 && project[i].status == 1) {
  2896. if (project[i].good_info.total <= 0) {
  2897. num++
  2898. this.$refs.tabProjectTeam.toggleRowSelection(row)
  2899. this.$message.error(project[i].good_info.good_name + '库存不足')
  2900. }
  2901. if (num > 0) {
  2902. this.$refs.tabProjectTeam.clearSelection()
  2903. }
  2904. let obj = {
  2905. id: project[i].project_id,
  2906. project_name: project[i].good_info.good_name,
  2907. statistical_classification: '',
  2908. single_dose: '',
  2909. delivery_way: '',
  2910. execution_frequency: '',
  2911. number_days: '',
  2912. cus_total: project[i].number,
  2913. price: project[i].good_info.retail_price,
  2914. remark: '',
  2915. medical_code: project[i].good_info.medical_insurance_number,
  2916. unit: project[i].good_info.unit,
  2917. type: project[i].type,
  2918. is_special_diseases: project[i].good_info.is_special_diseases,
  2919. team_id: team_id,
  2920. good_info: project[i].good_info
  2921. }
  2922. if (obj.cus_total == 0 || obj.cus_total == undefined) {
  2923. obj.cus_total = 1
  2924. }
  2925. teamList.push(obj)
  2926. }
  2927. }
  2928. this.teamList = this.teamList.concat(teamList)
  2929. console.log(this.teamList)
  2930. }
  2931. })
  2932. }
  2933. }, changeDoctor(val) {
  2934. for (let i = 0; i < this.doctors.length; i++) {
  2935. if (this.doctors[i].admin_user_id == this.doctorValue) {
  2936. this.departmentValue = this.doctors[i].department_id
  2937. }
  2938. }
  2939. if (this.departmentValue == 0) {
  2940. this.departmentValue = ''
  2941. }
  2942. },
  2943. changeDayOrMonth(tab) {
  2944. if (this.dayorMonth == 'day') {
  2945. this.$emit('day')
  2946. } else if (this.dayorMonth == 'month') {
  2947. let form = {
  2948. id: this.patientInfo.id,
  2949. his_patient_id: this.hisPatientInfo.id
  2950. }
  2951. console.log(form)
  2952. this.$emit('month', form)
  2953. }
  2954. },
  2955. getAllProjectList() {
  2956. getAllProjectList().then(response => {
  2957. if (response.data.state == 1) {
  2958. var hisprojectlist = response.data.data.hisprojectlist
  2959. this.hisList = hisprojectlist
  2960. }
  2961. })
  2962. },
  2963. clearSelection() {
  2964. this.$refs.tabProjectTeam.clearSelection()
  2965. }, unique(array) {
  2966. // res用来存储结果
  2967. var res = []
  2968. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  2969. for (var j = 0, resLen = res.length; j < resLen; j++) {
  2970. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  2971. break
  2972. }
  2973. }
  2974. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  2975. if (j === resLen) {
  2976. res.push(array[i])
  2977. }
  2978. }
  2979. return res
  2980. }
  2981. },
  2982. mounted() {
  2983. this.request_record_date = this.record_date
  2984. // this.getInitData()
  2985. //获取所有项目
  2986. this.getlist()
  2987. //获取所以项目组套
  2988. this.getAllProjectTeam()
  2989. this.getAllProjectList()
  2990. this.$nextTick(() => {
  2991. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2992. })
  2993. },
  2994. watch: {
  2995. fullHeight(val) {
  2996. if (!this.timer) {
  2997. this.fullHeight = val
  2998. let tableHeight = val - 263
  2999. this.tableHeight = tableHeight
  3000. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  3001. this.timer = true
  3002. let that = this
  3003. setTimeout(function() {
  3004. that.timer = false
  3005. }, 400)
  3006. }
  3007. }
  3008. }
  3009. }
  3010. </script>
  3011. <style lang="scss" scoped>
  3012. .new-main-contain {
  3013. height: 100%;
  3014. display: flex;
  3015. flex-direction: column;
  3016. }
  3017. .app-container {
  3018. height: 100%;
  3019. }
  3020. .mainCell {
  3021. height: 36px;
  3022. display: flex;
  3023. align-items: center;
  3024. }
  3025. .mainLeft {
  3026. width: 200px;
  3027. height: 100%;
  3028. display: flex;
  3029. flex-direction: column;
  3030. margin-top: 2px;
  3031. .el-radio {
  3032. margin-right: 5px;
  3033. }
  3034. }
  3035. .mainRight {
  3036. margin-left: 20px;
  3037. flex: 1;
  3038. height: 100%;
  3039. display: flex;
  3040. flex-direction: column;
  3041. .cellSpan {
  3042. min-width: 80px;
  3043. display: inline-block;
  3044. margin-right: 10px;
  3045. }
  3046. }
  3047. .mainCenter {
  3048. display: flex;
  3049. flex: 1;
  3050. height: 100%;
  3051. }
  3052. .centerLeft {
  3053. flex: 1;
  3054. display: flex;
  3055. flex-direction: column;
  3056. position: relative;
  3057. .el-form-item {
  3058. width: 33%;
  3059. margin-bottom: 14px;
  3060. }
  3061. .el-form-item__label {
  3062. text-align: left;
  3063. }
  3064. }
  3065. .backColor {
  3066. background: #f6f8f9;
  3067. height: 5px;
  3068. margin-bottom: 5px;
  3069. }
  3070. .RP {
  3071. color: #409EFF;
  3072. font-size: 14px;
  3073. margin-bottom: 5px;
  3074. }
  3075. .tabsBox {
  3076. position: relative;
  3077. flex: 1;
  3078. overflow-y: auto;
  3079. margin-bottom: 60px;
  3080. /*/ / margin-top: 4 px;*/
  3081. .el-tabs__item {
  3082. padding: 0 10px;
  3083. }
  3084. }
  3085. .preTabs {
  3086. height: 100%;
  3087. display: flex;
  3088. flex-direction: column;
  3089. .el-tabs__content {
  3090. flex: 1;
  3091. overflow-y: auto;
  3092. }
  3093. }
  3094. .costBox {
  3095. width: 100%;
  3096. height: 60px;
  3097. background: #fff;
  3098. position: absolute;
  3099. bottom: 0;
  3100. display: flex;
  3101. align-items: center;
  3102. justify-content: space-between;
  3103. }
  3104. .statusRed {
  3105. color: red;
  3106. }
  3107. .addTab {
  3108. position: absolute;
  3109. right: 8px;
  3110. top: 3px;
  3111. z-index: 20;
  3112. }
  3113. .centerRight {
  3114. width: 300px;
  3115. margin-left: 10px;
  3116. display: flex;
  3117. flex-direction: column;
  3118. position: relative;
  3119. }
  3120. .rightTab {
  3121. height: 40px;
  3122. width: 100%;
  3123. border: 1px solid #d2d2d2;
  3124. box-sizing: border-box;
  3125. p {
  3126. width: 50%;
  3127. height: 40px;
  3128. line-height: 40px;
  3129. text-align: center;
  3130. background: #eee;
  3131. float: left;
  3132. }
  3133. > p:last-child {
  3134. border-left: 1px solid #d2d2d2;
  3135. float: right;
  3136. }
  3137. .activeP {
  3138. background: #409EFF;
  3139. color: #fff;
  3140. }
  3141. }
  3142. .rightTabs {
  3143. display: flex;
  3144. flex-direction: column;
  3145. }
  3146. .comfirmBox {
  3147. width: 100%;
  3148. height: 60px;
  3149. background: #fff;
  3150. position: absolute;
  3151. bottom: 0;
  3152. display: flex;
  3153. align-items: center;
  3154. justify-content: space-between;
  3155. z-index: 99;
  3156. }
  3157. .borderCard {
  3158. height: 100%;
  3159. display: flex;
  3160. flex-direction: column;
  3161. margin-bottom: 60px;
  3162. .el-tabs--border-card > .el-tabs__content {
  3163. padding: 0;
  3164. }
  3165. }
  3166. </style>
  3167. <style lang="scss">
  3168. .borderCard {
  3169. .el-tabs__nav {
  3170. width: 100%;
  3171. }
  3172. .el-tabs__item {
  3173. width: 50%;
  3174. text-align: center;
  3175. }
  3176. .el-tabs__content {
  3177. padding: 5px;
  3178. flex: 1;
  3179. }
  3180. }
  3181. .centerLeft {
  3182. .el-form-item__label {
  3183. text-align: left;
  3184. }
  3185. }
  3186. .tabsBox {
  3187. .el-tabs__item {
  3188. padding: 0 10px;
  3189. }
  3190. .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) {
  3191. padding: 0 10px;
  3192. }
  3193. .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 {
  3194. padding: 0 10px;
  3195. }
  3196. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  3197. padding: 0 10px;
  3198. }
  3199. }
  3200. .centerRight {
  3201. .el-tabs__nav-scroll {
  3202. display: flex;
  3203. }
  3204. .el-tabs__nav {
  3205. margin: 0 auto;
  3206. }
  3207. .el-table th .cell, .el-table td .cell {
  3208. padding: 0 2px;
  3209. }
  3210. }
  3211. .preTabs {
  3212. .el-tabs__content {
  3213. flex: 1;
  3214. overflow-y: auto;
  3215. padding: 5px 0 5px 5px;
  3216. }
  3217. }
  3218. .rightTabs {
  3219. height: 100%;
  3220. .el-tabs__nav {
  3221. width: auto;
  3222. }
  3223. .el-tabs__header {
  3224. margin-bottom: 5px;
  3225. }
  3226. .el-tabs__item {
  3227. width: auto;
  3228. text-align: inherit;
  3229. }
  3230. .el-tabs__content {
  3231. flex: 1;
  3232. overflow-y: auto;
  3233. }
  3234. .el-tab-pane {
  3235. display: flex;
  3236. flex-direction: column;
  3237. height: 100%;
  3238. }
  3239. }
  3240. #tab-more {
  3241. .el-icon-close {
  3242. display: none;
  3243. }
  3244. }
  3245. ::-webkit-scrollbar {
  3246. height: 15px;
  3247. }
  3248. </style>