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

deskPrescription.vue 164KB

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