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

deskPrescription.vue 159KB

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