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

deskPrescription.vue 150KB

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