deskPrescription.vue 124KB

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