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

deskPrescription.vue 131KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660
  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. type: temp2[b].type
  2672. }
  2673. if (temp2[b].type == 2) {
  2674. obj['project'] = temp2[b].project
  2675. obj['unit'] = temp2[b].project.unit
  2676. } else if (temp2[b].type == 3) {
  2677. obj['good_info'] = temp2[b].good_info
  2678. obj['unit'] = temp2[b].good_info.packing_unit
  2679. }
  2680. if (temp2[b].team_id == undefined) {
  2681. obj['team_id'] = 0
  2682. } else {
  2683. obj['team_id'] = temp2[b].team_id
  2684. }
  2685. if (obj.total == 0 || obj.total == undefined) {
  2686. obj.total = 1
  2687. }
  2688. if (obj.type == 3) {
  2689. obj.single_dose = 1
  2690. }
  2691. console.log('项目obj', temp2)
  2692. this.prescriptions[i].project.push(obj)
  2693. }
  2694. this.curStatus = 2
  2695. }
  2696. this.curPrescriptions = this.prescriptions[i]
  2697. this.$refs.multipleTable.clearSelection()
  2698. this.$refs.tables.clearSelection()
  2699. this.clearSelection()
  2700. }
  2701. }
  2702. this.curDrugs = []
  2703. this.preDrugs = []
  2704. this.teamList = []
  2705. }, changeAllGoodInfoTableDataTwo(row) {
  2706. this.teamList = row
  2707. },
  2708. selectChange(selection, row) {
  2709. console.log('row', row)
  2710. 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) {
  2711. if (row.stock_count <= 0) {
  2712. if (row.type == 3) {
  2713. if (selection) {
  2714. selection.forEach(row => {
  2715. if (row.stock_count <= 0) {
  2716. this.$refs.tables.toggleRowSelection(row)
  2717. }
  2718. })
  2719. } else {
  2720. this.$refs.tables.clearSelection()
  2721. }
  2722. this.$message.error(row.project_name + '库存不足')
  2723. return
  2724. }
  2725. }
  2726. } else {
  2727. if (row.total <= 0) {
  2728. if (row.type == 3) {
  2729. if (selection) {
  2730. selection.forEach(row => {
  2731. if (row.total <= 0) {
  2732. this.$refs.tables.toggleRowSelection(row)
  2733. }
  2734. })
  2735. } else {
  2736. this.$refs.tables.clearSelection()
  2737. }
  2738. this.$message.error(row.project_name + '库存不足')
  2739. return
  2740. }
  2741. }
  2742. }
  2743. this.teamList.push(row)
  2744. },
  2745. getlist() {
  2746. this.tabProject = []
  2747. getHisProject().then(response => {
  2748. if (response.data.state == 1) {
  2749. var project = response.data.data.project
  2750. for (let i = 0; i < project.length; i++) {
  2751. let obj = {
  2752. id: project[i].id,
  2753. project_name: project[i].project_name,
  2754. statistical_classification: '',
  2755. single_dose: project[i].single_dose,
  2756. delivery_way: project[i].delivery_way,
  2757. execution_frequency: project[i].execution_frequency,
  2758. number_days: project[i].number_days,
  2759. price: project[i].price,
  2760. medical_code: project[i].medical_code,
  2761. cus_total: 1,
  2762. unit: project[i].unit,
  2763. type: 2,
  2764. total: project[i].total,
  2765. is_special_diseases: project[i].disease_directory,
  2766. project: project[i],
  2767. stock_count: 0
  2768. }
  2769. this.tabProject.push(obj)
  2770. }
  2771. var good_info = response.data.data.good_info
  2772. for (let i = 0; i < good_info.length; i++) {
  2773. good_info[i].stock_count = 0
  2774. if (good_info[i].good_stock_in&&good_info[i].good_stock_in.length > 0) {
  2775. for (let j = 0; j < good_info[i].good_stock_in.length; j++) {
  2776. good_info[i].stock_count += good_info[i].good_stock_in[j].stock_count
  2777. }
  2778. }
  2779. let obj = {
  2780. id: good_info[i].id,
  2781. project_name: good_info[i].good_name,
  2782. statistical_classification: '',
  2783. single_dose: good_info[i].specification_name,
  2784. delivery_way: '',
  2785. execution_frequency: '',
  2786. number_days: 1,
  2787. cus_total: 1,
  2788. price: good_info[i].packing_price,
  2789. medical_code: good_info[i].medical_insurance_number,
  2790. unit: this.getGoodUnit(good_info[i].good_unit),
  2791. type: 3,
  2792. total: good_info[i].total,
  2793. is_special_diseases: good_info[i].is_special_diseases,
  2794. good_info: good_info[i],
  2795. stock_count: good_info[i].stock_count
  2796. }
  2797. this.tabProject.push(obj)
  2798. }
  2799. this.allProject = this.tabProject
  2800. }
  2801. })
  2802. }, deepClone(source) {
  2803. if (!source && typeof source !== 'object') {
  2804. throw new Error('error arguments', 'shallowClone')
  2805. }
  2806. const targetObj = source.constructor === Array ? [] : {}
  2807. Object.keys(source).forEach((keys) => {
  2808. if (source[keys] && typeof source[keys] === 'object') {
  2809. targetObj[keys] = this.deepClone(source[keys])
  2810. } else {
  2811. targetObj[keys] = source[keys]
  2812. }
  2813. })
  2814. return targetObj
  2815. }, getGoodUnit(id) {
  2816. var goodUnit = this.$store.getters.good_unit
  2817. for (let i = 0; i < goodUnit.length; i++) {
  2818. if (goodUnit[i].id == id) {
  2819. return goodUnit[i].name
  2820. }
  2821. }
  2822. },
  2823. getAllProjectTeam() {
  2824. getAllProjectTeam().then(response => {
  2825. if (response.data.state == 1) {
  2826. var team = response.data.data.team
  2827. this.tabPrjectTeam = team
  2828. this.allTabPrjectTeam = team
  2829. this.projectList = team
  2830. }
  2831. })
  2832. },
  2833. selectTeam(row) {
  2834. console.log(row)
  2835. // var arr = []
  2836. // for (let i = 0; i < row.length; i++) {
  2837. // arr.push(row[i].item_id)
  2838. // }
  2839. // console.log(arr)
  2840. // var ids = arr.join(',')
  2841. // console.log(ids)
  2842. // var strArr = ids.split(',')
  2843. // console.log(strArr)
  2844. // var res = []//接收不重复的数据
  2845. //
  2846. // for (var i = 0; i < strArr.length; i++) {
  2847. // var flag = true
  2848. //
  2849. // for (var j = 0; j < i; j++) {
  2850. // if (strArr[i] === strArr[j]) {
  2851. // flag = false
  2852. // break
  2853. // }
  2854. // }
  2855. // if (flag) {
  2856. // res.push(strArr[i])
  2857. // }
  2858. // }
  2859. // console.log(res)
  2860. // var idstr = res.join(',')
  2861. let teamList = []
  2862. for (let i = 0; i < row.length; i++) {
  2863. let team_id = row[i].id
  2864. console.log(team_id)
  2865. const params = {
  2866. project_id: row[i].item_id
  2867. }
  2868. getPojectListById(params).then(response => {
  2869. if (response.data.state == 1) {
  2870. var project = response.data.data.project
  2871. let num = 0
  2872. for (let i = 0; i < project.length; i++) {
  2873. if (project[i].type == 2 && project[i].status == 1) {
  2874. let obj = {
  2875. id: project[i].project_id,
  2876. project_name: project[i].project.project_name,
  2877. statistical_classification: '',
  2878. single_dose: project[i].project.single_dose,
  2879. delivery_way: project[i].project.delivery_way,
  2880. execution_frequency: project[i].project.execution_frequency,
  2881. number_days: project[i].project.number_days,
  2882. cus_total: project[i].number,
  2883. price: project[i].project.price,
  2884. remark: '',
  2885. medical_code: project[i].project.medical_code,
  2886. unit: project[i].project.unit,
  2887. type: project[i].type,
  2888. is_special_diseases: project[i].project.disease_directory,
  2889. team_id: team_id,
  2890. project: project[i].project
  2891. }
  2892. if (obj.cus_total == 0 || obj.cus_total == undefined) {
  2893. obj.cus_total = 1
  2894. }
  2895. teamList.push(obj)
  2896. } else if (project[i].type == 3 && project[i].status == 1) {
  2897. if (project[i].good_info.total <= 0) {
  2898. num++
  2899. this.$refs.tabProjectTeam.toggleRowSelection(row)
  2900. this.$message.error(project[i].good_info.good_name + '库存不足')
  2901. }
  2902. if (num > 0) {
  2903. this.$refs.tabProjectTeam.clearSelection()
  2904. }
  2905. let obj = {
  2906. id: project[i].project_id,
  2907. project_name: project[i].good_info.good_name,
  2908. statistical_classification: '',
  2909. single_dose: '',
  2910. delivery_way: '',
  2911. execution_frequency: '',
  2912. number_days: '',
  2913. cus_total: project[i].number,
  2914. price: project[i].good_info.retail_price,
  2915. remark: '',
  2916. medical_code: project[i].good_info.medical_insurance_number,
  2917. unit: project[i].good_info.unit,
  2918. type: project[i].type,
  2919. is_special_diseases: project[i].good_info.is_special_diseases,
  2920. team_id: team_id,
  2921. good_info: project[i].good_info
  2922. }
  2923. if (obj.cus_total == 0 || obj.cus_total == undefined) {
  2924. obj.cus_total = 1
  2925. }
  2926. teamList.push(obj)
  2927. }
  2928. }
  2929. this.teamList = this.teamList.concat(teamList)
  2930. console.log(this.teamList)
  2931. }
  2932. })
  2933. }
  2934. }, changeDoctor(val) {
  2935. for (let i = 0; i < this.doctors.length; i++) {
  2936. if (this.doctors[i].admin_user_id == this.doctorValue) {
  2937. this.departmentValue = this.doctors[i].department_id
  2938. }
  2939. }
  2940. if (this.departmentValue == 0) {
  2941. this.departmentValue = ''
  2942. }
  2943. },
  2944. changeDayOrMonth(tab) {
  2945. if (this.dayorMonth == 'day') {
  2946. this.$emit('day')
  2947. } else if (this.dayorMonth == 'month') {
  2948. let form = {
  2949. id: this.patientInfo.id,
  2950. his_patient_id: this.hisPatientInfo.id
  2951. }
  2952. console.log(form)
  2953. this.$emit('month', form)
  2954. }
  2955. },
  2956. getAllProjectList() {
  2957. getAllProjectList().then(response => {
  2958. if (response.data.state == 1) {
  2959. var hisprojectlist = response.data.data.hisprojectlist
  2960. this.hisList = hisprojectlist
  2961. }
  2962. })
  2963. },
  2964. clearSelection() {
  2965. this.$refs.tabProjectTeam.clearSelection()
  2966. }, unique(array) {
  2967. // res用来存储结果
  2968. var res = []
  2969. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  2970. for (var j = 0, resLen = res.length; j < resLen; j++) {
  2971. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  2972. break
  2973. }
  2974. }
  2975. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  2976. if (j === resLen) {
  2977. res.push(array[i])
  2978. }
  2979. }
  2980. return res
  2981. }
  2982. },
  2983. mounted() {
  2984. this.request_record_date = this.record_date
  2985. // this.getInitData()
  2986. //获取所有项目
  2987. this.getlist()
  2988. //获取所以项目组套
  2989. this.getAllProjectTeam()
  2990. this.getAllProjectList()
  2991. this.$nextTick(() => {
  2992. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2993. })
  2994. },
  2995. watch: {
  2996. fullHeight(val) {
  2997. if (!this.timer) {
  2998. this.fullHeight = val
  2999. let tableHeight = val - 263
  3000. this.tableHeight = tableHeight
  3001. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  3002. this.timer = true
  3003. let that = this
  3004. setTimeout(function() {
  3005. that.timer = false
  3006. }, 400)
  3007. }
  3008. }
  3009. }
  3010. }
  3011. </script>
  3012. <style lang="scss" scoped>
  3013. .new-main-contain {
  3014. height: 100%;
  3015. display: flex;
  3016. flex-direction: column;
  3017. }
  3018. .app-container {
  3019. height: 100%;
  3020. }
  3021. .mainCell {
  3022. height: 36px;
  3023. display: flex;
  3024. align-items: center;
  3025. }
  3026. .mainLeft {
  3027. width: 200px;
  3028. height: 100%;
  3029. display: flex;
  3030. flex-direction: column;
  3031. margin-top: 2px;
  3032. .el-radio {
  3033. margin-right: 5px;
  3034. }
  3035. }
  3036. .mainRight {
  3037. margin-left: 20px;
  3038. flex: 1;
  3039. height: 100%;
  3040. display: flex;
  3041. flex-direction: column;
  3042. .cellSpan {
  3043. min-width: 80px;
  3044. display: inline-block;
  3045. margin-right: 10px;
  3046. }
  3047. }
  3048. .mainCenter {
  3049. display: flex;
  3050. flex: 1;
  3051. height: 100%;
  3052. }
  3053. .centerLeft {
  3054. flex: 1;
  3055. display: flex;
  3056. flex-direction: column;
  3057. position: relative;
  3058. .el-form-item {
  3059. width: 33%;
  3060. margin-bottom: 14px;
  3061. }
  3062. .el-form-item__label {
  3063. text-align: left;
  3064. }
  3065. }
  3066. .backColor {
  3067. background: #f6f8f9;
  3068. height: 5px;
  3069. margin-bottom: 5px;
  3070. }
  3071. .RP {
  3072. color: #409EFF;
  3073. font-size: 14px;
  3074. margin-bottom: 5px;
  3075. }
  3076. .tabsBox {
  3077. position: relative;
  3078. flex: 1;
  3079. overflow-y: auto;
  3080. margin-bottom: 60px;
  3081. /*/ / margin-top: 4 px;*/
  3082. .el-tabs__item {
  3083. padding: 0 10px;
  3084. }
  3085. }
  3086. .preTabs {
  3087. height: 100%;
  3088. display: flex;
  3089. flex-direction: column;
  3090. .el-tabs__content {
  3091. flex: 1;
  3092. overflow-y: auto;
  3093. }
  3094. }
  3095. .costBox {
  3096. width: 100%;
  3097. height: 60px;
  3098. background: #fff;
  3099. position: absolute;
  3100. bottom: 0;
  3101. display: flex;
  3102. align-items: center;
  3103. justify-content: space-between;
  3104. }
  3105. .statusRed {
  3106. color: red;
  3107. }
  3108. .addTab {
  3109. position: absolute;
  3110. right: 8px;
  3111. top: 3px;
  3112. z-index: 20;
  3113. }
  3114. .centerRight {
  3115. width: 300px;
  3116. margin-left: 10px;
  3117. display: flex;
  3118. flex-direction: column;
  3119. position: relative;
  3120. }
  3121. .rightTab {
  3122. height: 40px;
  3123. width: 100%;
  3124. border: 1px solid #d2d2d2;
  3125. box-sizing: border-box;
  3126. p {
  3127. width: 50%;
  3128. height: 40px;
  3129. line-height: 40px;
  3130. text-align: center;
  3131. background: #eee;
  3132. float: left;
  3133. }
  3134. > p:last-child {
  3135. border-left: 1px solid #d2d2d2;
  3136. float: right;
  3137. }
  3138. .activeP {
  3139. background: #409EFF;
  3140. color: #fff;
  3141. }
  3142. }
  3143. .rightTabs {
  3144. display: flex;
  3145. flex-direction: column;
  3146. }
  3147. .comfirmBox {
  3148. width: 100%;
  3149. height: 60px;
  3150. background: #fff;
  3151. position: absolute;
  3152. bottom: 0;
  3153. display: flex;
  3154. align-items: center;
  3155. justify-content: space-between;
  3156. z-index: 99;
  3157. }
  3158. .borderCard {
  3159. height: 100%;
  3160. display: flex;
  3161. flex-direction: column;
  3162. margin-bottom: 60px;
  3163. .el-tabs--border-card > .el-tabs__content {
  3164. padding: 0;
  3165. }
  3166. }
  3167. </style>
  3168. <style lang="scss">
  3169. .borderCard {
  3170. .el-tabs__nav {
  3171. width: 100%;
  3172. }
  3173. .el-tabs__item {
  3174. width: 50%;
  3175. text-align: center;
  3176. }
  3177. .el-tabs__content {
  3178. padding: 5px;
  3179. flex: 1;
  3180. }
  3181. }
  3182. .centerLeft {
  3183. .el-form-item__label {
  3184. text-align: left;
  3185. }
  3186. }
  3187. .tabsBox {
  3188. .el-tabs__item {
  3189. padding: 0 10px;
  3190. }
  3191. .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) {
  3192. padding: 0 10px;
  3193. }
  3194. .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 {
  3195. padding: 0 10px;
  3196. }
  3197. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  3198. padding: 0 10px;
  3199. }
  3200. }
  3201. .centerRight {
  3202. .el-tabs__nav-scroll {
  3203. display: flex;
  3204. }
  3205. .el-tabs__nav {
  3206. margin: 0 auto;
  3207. }
  3208. .el-table th .cell, .el-table td .cell {
  3209. padding: 0 2px;
  3210. }
  3211. }
  3212. .preTabs {
  3213. .el-tabs__content {
  3214. flex: 1;
  3215. overflow-y: auto;
  3216. padding: 5px 0 5px 5px;
  3217. }
  3218. }
  3219. .rightTabs {
  3220. height: 100%;
  3221. .el-tabs__nav {
  3222. width: auto;
  3223. }
  3224. .el-tabs__header {
  3225. margin-bottom: 5px;
  3226. }
  3227. .el-tabs__item {
  3228. width: auto;
  3229. text-align: inherit;
  3230. }
  3231. .el-tabs__content {
  3232. flex: 1;
  3233. overflow-y: auto;
  3234. }
  3235. .el-tab-pane {
  3236. display: flex;
  3237. flex-direction: column;
  3238. height: 100%;
  3239. }
  3240. }
  3241. #tab-more {
  3242. .el-icon-close {
  3243. display: none;
  3244. }
  3245. }
  3246. ::-webkit-scrollbar {
  3247. height: 15px;
  3248. }
  3249. </style>