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

deskPrescription.vue 143KB

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