deskPrescription.vue 122KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204
  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="">
  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. // var info = response.data.data.info
  1579. // if (info.user_type == 2 || info.user_type == 1) {
  1580. // this.doctorValue = info.admin_user_id
  1581. // if (info.department_id == 0) {
  1582. // if (this.department.length > 0) {
  1583. // this.departmentValue = this.department[0].id
  1584. // } else {
  1585. // this.departmentValue = ''
  1586. //
  1587. // }
  1588. // } else {
  1589. // this.departmentValue = info.department_id
  1590. // }
  1591. // }else{
  1592. // this.doctorValue = this.doctors[0].admin_user_id
  1593. // }
  1594. }
  1595. })
  1596. },
  1597. monthTabclickEvent(val) {
  1598. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1599. if (this.month_prescriptions[i].name == val.name) {
  1600. if (this.dayorMonth == 'month') {
  1601. if (this.isShowDayPrescription) {
  1602. this.curDayPrescriptions = this.month_prescriptions[i]
  1603. //用来区分处方属于项目还是药品
  1604. if (this.curDayPrescriptions.advices.length > 0 && this.curDayPrescriptions.project.length == 0) {
  1605. this.monthCustomTabIndex = 1
  1606. }
  1607. if (this.curDayPrescriptions.advices.length == 0 && this.curDayPrescriptions.project.length > 0) {
  1608. this.monthCustomTabIndex = 2
  1609. }
  1610. } else {
  1611. this.curMonthPrescriptions = this.month_prescriptions[i]
  1612. //用来区分处方属于项目还是药品
  1613. if (this.curMonthPrescriptions.advices.length > 0 && this.curMonthPrescriptions.project.length == 0) {
  1614. this.monthCustomTabIndex = 1
  1615. }
  1616. if (this.curMonthPrescriptions.advices.length == 0 && this.curMonthPrescriptions.project.length > 0) {
  1617. this.monthCustomTabIndex = 2
  1618. }
  1619. }
  1620. }
  1621. this.teamList = []
  1622. this.curDrugs = []
  1623. this.$refs.multipleTable.clearSelection()
  1624. this.$refs.tables.clearSelection()
  1625. }
  1626. }
  1627. },
  1628. tabclickEvent(val) {
  1629. for (let i = 0; i < this.prescriptions.length; i++) {
  1630. if (this.prescriptions[i].name == val.name) {
  1631. this.prescription_id = this.prescriptions[i].id
  1632. this.$emit('event1', this.prescription_id)
  1633. this.curPrescriptions = this.prescriptions[i]
  1634. this.teamList = []
  1635. this.curDrugs = []
  1636. this.$refs.multipleTable.clearSelection()
  1637. this.$refs.tables.clearSelection()
  1638. //用来区分处方属于项目还是药品
  1639. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1640. this.customTabIndex = 1
  1641. this.curStatus = 1
  1642. this.rightTab = 1
  1643. this.showOne = true
  1644. this.showTwo = false
  1645. }
  1646. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1647. this.customTabIndex = 2
  1648. this.curStatus = 2
  1649. this.rightTab = 2
  1650. this.showTwo = true
  1651. this.showOne = false
  1652. }
  1653. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1654. this.customTabIndex = this.rightTab
  1655. this.curStatus = 0
  1656. }
  1657. }
  1658. }
  1659. if (this.curPrescriptions.order_status == 0) {
  1660. this.order_status = ''
  1661. }
  1662. if (this.curPrescriptions.order_status == 1) {
  1663. this.order_status = '未收费'
  1664. }
  1665. if (this.curPrescriptions.order_status == 2) {
  1666. this.order_status = '已结算'
  1667. }
  1668. if (this.curPrescriptions.order_status == 3) {
  1669. this.order_status = '已退费'
  1670. }
  1671. },
  1672. clearData() {
  1673. this.curPrescriptions = []
  1674. this.curStatus = 0
  1675. this.curDrugs = []
  1676. this.preDrugs = []
  1677. this.teamList = []
  1678. },
  1679. setData(data, info, admin_info, doctors, department, hisPatientInfo, month_data) {
  1680. this.curMonthPrescriptions = {}
  1681. this.curPrescriptions = {}
  1682. // this.$refs.tabProjectTeam.clearSelection()
  1683. console.log(doctors)
  1684. for (let i = 0; i < doctors.length; i++) {
  1685. if (doctors[i].user_type == 1) {
  1686. doctors.splice(i, 1)
  1687. }
  1688. }
  1689. this.prescription_id = data[0].id
  1690. this.editableTabsValue = '处方1'
  1691. this.dayorMonth = 'day'
  1692. this.$emit('event1', this.prescription_id)
  1693. this.curStatus = 0
  1694. if (month_data && month_data.length > 0) {
  1695. this.curMonthPrescriptions = month_data[0]
  1696. } else {
  1697. this.curMonthPrescriptions = {}
  1698. }
  1699. if (data && data.length > 0) {
  1700. this.curPrescriptions = data[0]
  1701. } else {
  1702. this.curPrescriptions = {}
  1703. }
  1704. this.diagnose = info.diagnosis
  1705. if (this.diagnose == 0) {
  1706. this.diagnose = ""
  1707. for (let i = 0; i < this.diagnoses.length; i++) {
  1708. this.diagnose = this.diagnoses[0].id
  1709. }
  1710. }
  1711. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1712. this.curStatus = 1
  1713. this.customTabIndex = 1
  1714. this.rightTab = 1
  1715. this.showOne = true
  1716. this.showTwo = false
  1717. }
  1718. if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
  1719. this.curStatus = 2
  1720. this.customTabIndex = 2
  1721. this.rightTab = 2
  1722. this.showOne = false
  1723. this.showTwo = true
  1724. }
  1725. this.state1 = info.sick_type
  1726. if (this.state1 == 0) {
  1727. this.state1 = ''
  1728. for (let i = 0; i < this.sick.length; i++) {
  1729. this.state1 = this.sick[0].id
  1730. }
  1731. }
  1732. this.state2 = info.sick_history
  1733. if (this.state2 == 0) {
  1734. this.state2 = ''
  1735. }
  1736. if (info.prescription_status == 0) {
  1737. this.order_status = ''
  1738. }
  1739. if (this.curPrescriptions.order_status == 1) {
  1740. this.order_status = '未收费'
  1741. }
  1742. if (this.curPrescriptions.order_status == 2) {
  1743. this.order_status = '已结算'
  1744. }
  1745. if (this.curPrescriptions.order_status == 3) {
  1746. this.order_status = '已退费'
  1747. }
  1748. if (info.id > 0) {
  1749. this.doctorValue = info.doctor_id
  1750. this.departmentValue = info.departments
  1751. } else {
  1752. if (hisPatientInfo.doctor != 0 && hisPatientInfo.department != 0) {
  1753. this.doctorValue = hisPatientInfo.doctor
  1754. this.departmentValue = hisPatientInfo.department
  1755. } else {
  1756. if (admin_info.user_type == 2) {
  1757. this.doctorValue = admin_info.admin_user_id
  1758. if (admin_info.department_id == 0) {
  1759. if (this.department.length > 0) {
  1760. if (department && department.length > 0) {
  1761. this.departmentValue = department[0].id
  1762. } else {
  1763. this.departmentValue = ''
  1764. }
  1765. } else {
  1766. this.departmentValue = ''
  1767. }
  1768. } else {
  1769. this.departmentValue = admin_info.department_id
  1770. }
  1771. } else {
  1772. this.doctorValue = doctors[0].admin_user_id
  1773. }
  1774. if (this.doctorValue == 0) {
  1775. this.doctorValue = ''
  1776. }
  1777. }
  1778. }
  1779. console.log(info.register_type)
  1780. if (info.register_type == 0) {
  1781. for (let i = 0; i < this.register.length; i++) {
  1782. this.register_type = this.register[0].value
  1783. }
  1784. } else {
  1785. this.register_type = info.register_type
  1786. }
  1787. if (this.diagnose == 0) {
  1788. this.diagnose = ""
  1789. }
  1790. },
  1791. moreState(tab, event) {
  1792. if (tab == 'more') {
  1793. return false
  1794. }
  1795. }, open_three() {
  1796. console.log(this.prescriptions)
  1797. for (let i = 0; i < this.prescriptions.length; i++) {
  1798. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  1799. if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
  1800. this.$message.error('药品处方总量不能为0')
  1801. return
  1802. }
  1803. }
  1804. }
  1805. for (let i = 0; i < this.prescriptions.length; i++) {
  1806. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1807. if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
  1808. this.$message.error('项目处方总量不能为0')
  1809. return
  1810. }
  1811. }
  1812. }
  1813. this.$refs.saveTemplate.show(this.prescriptions)
  1814. }, open_two() {
  1815. if (this.dayorMonth == 'day') {
  1816. if (this.patientInfo == null || this.patientInfo.id == 0) {
  1817. this.$message.error('请选择患者')
  1818. return
  1819. }
  1820. let params = {
  1821. end_time: this.record_date,
  1822. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1823. patient_id: this.patientInfo.id,
  1824. p_type: 2
  1825. }
  1826. getCallHisPrescription(params).then(response => {
  1827. if (response.data.state == 1) {
  1828. this.$refs.call_prescription.show(this.patientInfo.name, this.patientInfo.id, params.end_time, params.start_time, this.prescriptions, response.data.data.prescriptions)
  1829. } else {
  1830. this.$message.error(response.data.msg)
  1831. }
  1832. })
  1833. } else {
  1834. this.$message.error('当前属于月结状态,无法试用处方调用')
  1835. }
  1836. },
  1837. open(index, isLoading) {
  1838. if (this.dayorMonth == 'day') {
  1839. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  1840. this.$message.error('请先开处方')
  1841. return
  1842. }
  1843. }
  1844. if (this.dayorMonth == 'day') {
  1845. if (this.curPrescriptions.order_status == 2) {
  1846. this.$message.error('当前处方已经结算,无法保存')
  1847. return
  1848. }
  1849. if (this.doctorValue.length <= 0) {
  1850. this.$message.error('医生不能为空')
  1851. return
  1852. }
  1853. if (this.departmentValue.length <= 0) {
  1854. this.$message.error('科室不能为空')
  1855. return
  1856. }
  1857. if (this.state1 <= 0) {
  1858. this.$message.error('疾病类型不能为空')
  1859. return
  1860. }
  1861. console.log(this.prescriptions)
  1862. for (let i = 0; i < this.prescriptions.length; i++) {
  1863. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  1864. if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
  1865. this.$message.error('药品处方总量不能为0')
  1866. return
  1867. }
  1868. }
  1869. }
  1870. for (let i = 0; i < this.prescriptions.length; i++) {
  1871. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1872. if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
  1873. this.$message.error('项目处方总量不能为0')
  1874. return
  1875. }
  1876. }
  1877. }
  1878. for (let i = 0; i < this.prescriptions.length; i++) {
  1879. if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
  1880. this.$message.error('处方医疗类型不能为空')
  1881. return
  1882. }
  1883. }
  1884. if (index == 1) {
  1885. let params = {
  1886. p_type: 2,
  1887. patient_id: this.patientInfo.id,
  1888. diagnose: this.diagnose,
  1889. sick_type: this.state1,
  1890. sick_history: this.state2,
  1891. doctor: this.doctorValue,
  1892. department: this.departmentValue,
  1893. record_date: this.record_date,
  1894. his_patient_id: this.hisPatientInfo.id,
  1895. reg_type: this.register_type
  1896. }
  1897. for (let i = 0; i < this.prescriptions.length; i++) {
  1898. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  1899. this.prescriptions[i]['type'] = 1
  1900. }
  1901. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  1902. this.prescriptions[i]['type'] = 2
  1903. }
  1904. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  1905. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  1906. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  1907. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  1908. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  1909. }
  1910. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1911. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  1912. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  1913. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  1914. this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
  1915. }
  1916. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1917. this.prescriptions[i].addition[b].id = prarseInt(this.prescriptions[i].addition[b].id)
  1918. this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
  1919. this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
  1920. this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
  1921. }
  1922. }
  1923. let data = {
  1924. 'prescriptions': this.prescriptions
  1925. }
  1926. isLoading = true
  1927. createHisPrescription(data, params).then(response => {
  1928. if (response.data.state == 1) {
  1929. this.$emit('change', this.patientInfo.id)
  1930. this.$message.success('保存成功')
  1931. } else {
  1932. this.$message.error(response.data.msg)
  1933. }
  1934. })
  1935. } else if (index == 2) {
  1936. this.$router.push('/outpatientDoctorStation/print')
  1937. } else if (index == 4) {
  1938. } else if (index == 5) {
  1939. this.$refs.saveTemplate.show()
  1940. }
  1941. } else if (this.dayorMonth == 'month') {
  1942. if (this.isShowDayPrescription) {
  1943. // if (this.curDayPrescriptions.order_status == 2) {
  1944. // this.$message.error('当前处方已经结算,无法保存')
  1945. // return
  1946. // }
  1947. if (this.doctorValue.length <= 0) {
  1948. this.$message.error('医生不能为空')
  1949. return
  1950. }
  1951. if (this.departmentValue.length <= 0) {
  1952. this.$message.error('科室不能为空')
  1953. return
  1954. }
  1955. if (index == 1) {
  1956. let params = {
  1957. patient_id: this.patientInfo.id,
  1958. diagnose: this.diagnose,
  1959. sick_type: this.state1,
  1960. sick_history: this.state2,
  1961. doctor: this.doctorValue,
  1962. department: this.departmentValue,
  1963. record_date: this.end_time,
  1964. his_patient_id: this.hisPatientInfo.id,
  1965. reg_type: this.register_type,
  1966. p_type: 2
  1967. }
  1968. var month_prescriptions = this.deepClone(this.month_prescriptions)
  1969. for (let i = 0; i < month_prescriptions.length; i++) {
  1970. if (month_prescriptions[i].advices.length > 0 && month_prescriptions[i].project.length == 0) {
  1971. month_prescriptions[i]['type'] = 1
  1972. }
  1973. if (month_prescriptions[i].advices.length == 0 && month_prescriptions[i].project.length > 0) {
  1974. month_prescriptions[i]['type'] = 2
  1975. }
  1976. for (let b = 0; b < month_prescriptions[i].advices.length; b++) {
  1977. month_prescriptions[i].advices[b].single_dose = month_prescriptions[i].advices[b].single_dose.toString()
  1978. month_prescriptions[i].advices[b].prescribing_number = month_prescriptions[i].advices[b].prescribing_number.toString()
  1979. month_prescriptions[i].advices[b].retail_price = month_prescriptions[i].advices[b].retail_price.toString()
  1980. month_prescriptions[i].advices[b].day = parseInt(month_prescriptions[i].advices[b].day)
  1981. }
  1982. for (let b = 0; b < month_prescriptions[i].project.length; b++) {
  1983. month_prescriptions[i].project[b].price = month_prescriptions[i].project[b].price.toString()
  1984. month_prescriptions[i].project[b].total = month_prescriptions[i].project[b].total.toString()
  1985. month_prescriptions[i].project[b].delivery_way = month_prescriptions[i].project[b].delivery_way.toString()
  1986. }
  1987. for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  1988. month_prescriptions[i].addition[b].id = parseInt(month_prescriptions[i].addition[b].id)
  1989. month_prescriptions[i].addition[b].item_id = parseInt(month_prescriptions[i].addition[b].item_id)
  1990. month_prescriptions[i].addition[b].price = month_prescriptions[i].addition[b].price.toString()
  1991. month_prescriptions[i].addition[b].count = month_prescriptions[i].addition[b].count.toString()
  1992. }
  1993. }
  1994. let data = {
  1995. 'prescriptions': month_prescriptions
  1996. }
  1997. editHisPrescription(data, params).then(response => {
  1998. if (response.data.state == 1) {
  1999. this.month_prescriptions = month_prescriptions
  2000. this.$message.success('编辑成功')
  2001. }
  2002. })
  2003. }
  2004. }
  2005. }
  2006. },
  2007. addTab(targetName) {
  2008. // if (this.curPrescriptions.order_status == 2) {
  2009. // this.$message.error('该处方已经结算或者退费,无法继续添加处方')
  2010. // return
  2011. // }
  2012. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  2013. this.$message.error('当前处方无数据,新增数据后才能新增处方')
  2014. return
  2015. }
  2016. this.tabIndex = this.prescriptions.length
  2017. ++this.tabIndex
  2018. let newTabName = '处方' + this.tabIndex
  2019. var nowDate = new Date()
  2020. var nowYear = nowDate.getFullYear()
  2021. var nowMonth = nowDate.getMonth() + 1
  2022. var nowDay = nowDate.getDate()
  2023. var hours = nowDate.getHours()
  2024. var min = nowDate.getMinutes()
  2025. var nowTime =
  2026. nowYear +
  2027. '-' +
  2028. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  2029. '-' +
  2030. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  2031. ':' + (min < 10 ? '0' + min : min)
  2032. let obj = {
  2033. id: 0,
  2034. name: newTabName,
  2035. order_status: 0,
  2036. advices: [],
  2037. project: [],
  2038. addition: [],
  2039. pre_time: this.prescriptions[0].pre_time,
  2040. }
  2041. 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){
  2042. obj.med_type = 13
  2043. }else{
  2044. obj.med_type = 14
  2045. }
  2046. this.prescriptions.push(obj)
  2047. this.editableTabsValue = newTabName
  2048. this.curPrescriptions = this.prescriptions[this.prescriptions.length - 1]
  2049. this.curStatus = 0
  2050. if (this.curPrescriptions.order_status == 0) {
  2051. this.order_status = '未收费'
  2052. }
  2053. if (this.curPrescriptions.order_status == 1) {
  2054. this.order_status = '未收费'
  2055. }
  2056. if (this.curPrescriptions.order_status == 2) {
  2057. this.order_status = '已结算'
  2058. }
  2059. if (this.curPrescriptions.order_status == 3) {
  2060. this.order_status = '已退费'
  2061. }
  2062. },
  2063. removeTab(targetName) {
  2064. if (this.curPrescriptions.order_status == 2) {
  2065. this.$message.error('该处方已经结算,无法删除')
  2066. return
  2067. }
  2068. if (targetName == '处方1') {
  2069. this.$message.error('该处方无法删除')
  2070. return
  2071. }
  2072. this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
  2073. confirmButtonText: '确 定',
  2074. cancelButtonText: '取 消',
  2075. type: 'warning'
  2076. }).then(() => {
  2077. let id = 0
  2078. for (let i = 0; i < this.prescriptions.length; i++) {
  2079. if (this.prescriptions[i].name == targetName) {
  2080. id = this.prescriptions[i].id
  2081. }
  2082. }
  2083. if (id == 0) {
  2084. let tabs = this.prescriptions
  2085. let activeName = this.editableTabsValue
  2086. if (activeName === targetName) {
  2087. tabs.forEach((tab, index) => {
  2088. if (tab.name === targetName) {
  2089. let nextTab = tabs[index + 1] || tabs[index - 1]
  2090. if (nextTab) {
  2091. activeName = nextTab.name
  2092. }
  2093. }
  2094. })
  2095. }
  2096. this.editableTabsValue = activeName
  2097. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  2098. for (let i = 0; i < this.prescriptions.length; i++) {
  2099. if (activeName == this.prescriptions[i].name) {
  2100. this.curPrescriptions = this.prescriptions[i]
  2101. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2102. this.curStatus = 1
  2103. }
  2104. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2105. this.curStatus = 2
  2106. }
  2107. }
  2108. }
  2109. if (this.prescriptions.length == 0) {
  2110. this.curPrescriptions = []
  2111. this.curStatus = 0
  2112. }
  2113. } else {
  2114. let params = {
  2115. 'id': id
  2116. }
  2117. delHisPrescription(params).then(response => {
  2118. if (response.data.state == 1) {
  2119. this.$message.success('删除成功')
  2120. let tabs = this.prescriptions
  2121. let activeName = this.editableTabsValue
  2122. if (activeName === targetName) {
  2123. tabs.forEach((tab, index) => {
  2124. if (tab.name === targetName) {
  2125. let nextTab = tabs[index + 1] || tabs[index - 1]
  2126. if (nextTab) {
  2127. activeName = nextTab.name
  2128. }
  2129. }
  2130. })
  2131. }
  2132. this.editableTabsValue = activeName
  2133. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  2134. for (let i = 0; i < this.prescriptions.length; i++) {
  2135. if (activeName == this.prescriptions[i].name) {
  2136. this.curPrescriptions = this.prescriptions[i]
  2137. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2138. this.curStatus = 1
  2139. }
  2140. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2141. this.curStatus = 2
  2142. }
  2143. }
  2144. }
  2145. if (this.prescriptions.length == 0) {
  2146. this.curPrescriptions = []
  2147. this.curStatus = 0
  2148. }
  2149. } else {
  2150. this.$message.success(response.data.msg)
  2151. }
  2152. })
  2153. }
  2154. }).catch(() => {
  2155. })
  2156. },
  2157. beforeLeave(activeName, oldActiveName) {
  2158. let index = activeName
  2159. if (index == 1) {
  2160. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2161. return false
  2162. }
  2163. } else {
  2164. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2165. return false
  2166. }
  2167. }
  2168. },
  2169. clickTab(tab) {
  2170. let index = parseInt(tab.name)
  2171. if (index == 1) {
  2172. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2173. this.$message.error('当前处方为项目,无法切换为药品,需要新开处方')
  2174. return
  2175. }
  2176. } else {
  2177. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2178. this.$message.error('当前处方为药品,无法切换为项目,需要新开处方')
  2179. return
  2180. }
  2181. }
  2182. if (index == 1) {
  2183. this.teamList = []
  2184. this.$refs.tables.clearSelection()
  2185. this.showOne = true
  2186. this.showTwo = false
  2187. this.$nextTick(() => {
  2188. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  2189. })
  2190. this.customTabIndex = 1
  2191. }
  2192. if (index == 2) {
  2193. this.curDrugs = []
  2194. this.$refs.multipleTable.clearSelection()
  2195. this.showTwo = true
  2196. this.showOne = false
  2197. this.$nextTick(() => {
  2198. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  2199. })
  2200. this.customTabIndex = 2
  2201. }
  2202. this.rightTab = index
  2203. //用来区分处方属于项目还是药品
  2204. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  2205. this.customTabIndex = 1
  2206. this.curStatus = 1
  2207. }
  2208. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  2209. this.customTabIndex = 2
  2210. this.curStatus = 2
  2211. }
  2212. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  2213. // this.customTabIndex = this.rightTab
  2214. this.customTabIndex = index
  2215. this.curStatus = 0
  2216. }
  2217. }, changeAllGoodInfoTableData: function(selection) {
  2218. this.curDrugs = selection
  2219. }, addCharges() {
  2220. this.$refs.additionalCharges.show()
  2221. },
  2222. selectDrugs(selection, row) {
  2223. this.curDrugs = selection
  2224. },
  2225. comfirm() {
  2226. // if (this.curPrescriptions.order_status == 2) {
  2227. // this.$message.error('该处方已经结算,无法继续添加药品或者项目')
  2228. // this.teamList = []
  2229. // this.curDrugs = []
  2230. // this.tempDrugs = []
  2231. // this.$refs.tables.clearSelection()
  2232. // this.$refs.multipleTableTwo.clearSelection()
  2233. // this.$refs.multipleTable.clearSelection()
  2234. // return
  2235. // }
  2236. if (this.curStatus == 1 && this.rightTab == 2) {
  2237. this.$message.error('改处方是药品,无法添加项目')
  2238. this.teamList = []
  2239. this.$refs.tables.clearSelection()
  2240. return
  2241. }
  2242. if (this.curStatus == 2 && this.rightTab == 1) {
  2243. this.$message.error('改处方是项目,无法添加药品')
  2244. this.curDrugs = []
  2245. this.tempDrugs = []
  2246. this.$refs.multipleTable.clearSelection()
  2247. this.$refs.multipleTableTwo.clearSelection()
  2248. return
  2249. }
  2250. for (let i = 0; i < this.teamList.length; i++) {
  2251. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  2252. if (this.teamList[i].id == this.curPrescriptions.project[a].project_id) {
  2253. this.$message.error('当前处方存在相同的药品,无法添加相同的项目')
  2254. return
  2255. }
  2256. }
  2257. }
  2258. for (let i = 0; i < this.curDrugs.length; i++) {
  2259. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2260. if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
  2261. this.$message.error('当前处方存在相同的药品,无法添加相同的药品')
  2262. return
  2263. }
  2264. }
  2265. }
  2266. let templateDrugs = []
  2267. for (let i = 0; i < this.tempDrugs.length; i++) {
  2268. for (let a = 0; a < this.tempDrugs[i].advices.length; a++) {
  2269. templateDrugs.push(this.tempDrugs[i].advices[a])
  2270. }
  2271. }
  2272. // for (let i = 0; i < templateDrugs.length; i++) {
  2273. // for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2274. // if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
  2275. // this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  2276. // return
  2277. //
  2278. // }
  2279. // }
  2280. // }
  2281. for (let i = 0; i < this.prescriptions.length; i++) {
  2282. if (this.prescriptions[i].name == this.editableTabsValue) {
  2283. var temp = this.deepClone(this.curDrugs)
  2284. var temp2 = this.deepClone(this.teamList)
  2285. var temp3 = this.deepClone(templateDrugs)
  2286. if (temp3.length > 0) {
  2287. for (let b = 0; b < temp3.length; b++) {
  2288. let obj = {
  2289. advice_id: 0,
  2290. id: temp3[b].id,
  2291. drug_name: temp3[b].advice_name,
  2292. single_dose: temp3[b].single_dose.toString(),
  2293. delivery_way: temp3[b].delivery_way,
  2294. execution_frequency: temp3[b].execution_frequency,
  2295. retail_price: temp3[b].drug.retail_price.toString(),
  2296. remark: '',
  2297. day: "1",
  2298. prescribing_number: temp3[b].prescribing_number,
  2299. single_dose_unit: temp3[b].drug.min_unit,
  2300. prescribing_number_unit: temp3[b].drug.max_unit,
  2301. medical_insurance_number: temp3[b].drug.medical_insurance_number
  2302. }
  2303. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  2304. obj.prescribing_number = 1
  2305. }
  2306. this.prescriptions[i].advices.push(obj)
  2307. }
  2308. this.curStatus = 1
  2309. }
  2310. if (temp.length > 0) {
  2311. for (let b = 0; b < temp.length; b++) {
  2312. let obj = {
  2313. advice_id: 0,
  2314. id: temp[b].id,
  2315. drug_name: temp[b].drug_name,
  2316. single_dose: temp[b].single_dose,
  2317. delivery_way: temp[b].delivery_way,
  2318. execution_frequency: temp[b].execution_frequency,
  2319. retail_price: temp[b].retail_price.toString(),
  2320. remark: '',
  2321. day: temp[b].drug_day ? temp[b].drug_day : 1,
  2322. prescribing_number: temp[b].prescribing_number,
  2323. single_dose_unit: temp[b].min_unit,
  2324. prescribing_number_unit: temp[b].max_unit,
  2325. medical_insurance_number: temp[b].medical_insurance_number,
  2326. drug: temp[b]
  2327. }
  2328. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  2329. obj.prescribing_number = 1
  2330. }
  2331. console.log('obj',obj)
  2332. this.prescriptions[i].advices.push(obj)
  2333. }
  2334. this.curStatus = 1
  2335. }
  2336. // if(this.activeName == 2){
  2337. //
  2338. // for(let i = 0; i<temp2.length;i++){
  2339. // for(let j=0;j<this.hisList.length;j++){
  2340. // if(temp2[i].id == this.hisList[j].project_id){
  2341. // temp2[i].total = this.hisList[j].number
  2342. // }
  2343. // }
  2344. // }
  2345. // }
  2346. if (temp2.length > 0) {
  2347. for (let b = 0; b < temp2.length; b++) {
  2348. let obj = {
  2349. id: 0,
  2350. project_id: temp2[b].id,
  2351. project_name: temp2[b].project_name,
  2352. statistical_classification: temp2[b].statistical_classification,
  2353. single_dose: temp2[b].single_dose.toString(),
  2354. delivery_way: temp2[b].delivery_way,
  2355. execution_frequency: temp2[b].execution_frequency,
  2356. number_days: temp2[b].number_days.toString(),
  2357. total: temp2[b].total,
  2358. price: temp2[b].price,
  2359. remark: '',
  2360. medical_code: temp2[b].medical_code,
  2361. unit: temp2[b].unit,
  2362. type: temp2[b].type
  2363. }
  2364. if (obj.total == 0 || obj.total == undefined) {
  2365. obj.total = 1
  2366. }
  2367. if (obj.type == 3) {
  2368. obj.single_dose = 1
  2369. }
  2370. this.prescriptions[i].project.push(obj)
  2371. }
  2372. this.curStatus = 2
  2373. }
  2374. this.curPrescriptions = this.prescriptions[i]
  2375. this.$refs.multipleTable.clearSelection()
  2376. this.$refs.tables.clearSelection()
  2377. this.clearSelection()
  2378. }
  2379. }
  2380. this.curDrugs = []
  2381. this.preDrugs = []
  2382. this.teamList = []
  2383. }, changeAllGoodInfoTableDataTwo(row) {
  2384. this.teamList = row
  2385. },
  2386. selectChange(row) {
  2387. this.teamList = row
  2388. },
  2389. getlist() {
  2390. this.tabProject = []
  2391. getHisProject().then(response => {
  2392. if (response.data.state == 1) {
  2393. var project = response.data.data.project
  2394. for (let i = 0; i < project.length; i++) {
  2395. let obj = {
  2396. id: project[i].id,
  2397. project_name: project[i].project_name,
  2398. statistical_classification: project[i].statistical_classification,
  2399. single_dose: project[i].single_dose,
  2400. delivery_way: project[i].delivery_way,
  2401. execution_frequency: project[i].execution_frequency,
  2402. number_days: project[i].number_days,
  2403. price: project[i].price,
  2404. medical_code: project[i].medical_code,
  2405. unit: project[i].unit,
  2406. type: 2
  2407. }
  2408. this.tabProject.push(obj)
  2409. }
  2410. var good_info = response.data.data.good_info
  2411. for (let i = 0; i < good_info.length; i++) {
  2412. let obj = {
  2413. id: good_info[i].id,
  2414. project_name: good_info[i].good_name,
  2415. statistical_classification: 0,
  2416. single_dose: 1,
  2417. delivery_way: '',
  2418. execution_frequency: '',
  2419. number_days: 1,
  2420. price: good_info[i].retail_price,
  2421. medical_code: good_info[i].medical_insurance_number,
  2422. unit: this.getGoodUnit(good_info[i].good_unit),
  2423. type: 3
  2424. }
  2425. this.tabProject.push(obj)
  2426. }
  2427. this.allProject = this.tabProject
  2428. }
  2429. })
  2430. }, deepClone(source) {
  2431. if (!source && typeof source !== 'object') {
  2432. throw new Error('error arguments', 'shallowClone')
  2433. }
  2434. const targetObj = source.constructor === Array ? [] : {}
  2435. Object.keys(source).forEach((keys) => {
  2436. if (source[keys] && typeof source[keys] === 'object') {
  2437. targetObj[keys] = this.deepClone(source[keys])
  2438. } else {
  2439. targetObj[keys] = source[keys]
  2440. }
  2441. })
  2442. return targetObj
  2443. }, getGoodUnit(id) {
  2444. var goodUnit = this.$store.getters.good_unit
  2445. for (let i = 0; i < goodUnit.length; i++) {
  2446. if (goodUnit[i].id == id) {
  2447. return goodUnit[i].name
  2448. }
  2449. }
  2450. },
  2451. getAllProjectTeam() {
  2452. getAllProjectTeam().then(response => {
  2453. if (response.data.state == 1) {
  2454. var team = response.data.data.team
  2455. this.tabPrjectTeam = team
  2456. this.allTabPrjectTeam = team
  2457. this.projectList = team
  2458. }
  2459. })
  2460. },
  2461. selectTeam(row) {
  2462. var arr = []
  2463. for (let i = 0; i < row.length; i++) {
  2464. arr.push(row[i].item_id)
  2465. }
  2466. var ids = arr.join(',')
  2467. var strArr = ids.split(',')
  2468. var res = []//接收不重复的数据
  2469. for (var i = 0; i < strArr.length; i++) {
  2470. var flag = true
  2471. for (var j = 0; j < i; j++) {
  2472. if (strArr[i] === strArr[j]) {
  2473. flag = false
  2474. break
  2475. }
  2476. }
  2477. if (flag) {
  2478. res.push(strArr[i])
  2479. }
  2480. }
  2481. var idstr = res.join(',')
  2482. const params = {
  2483. project_id: idstr
  2484. }
  2485. getPojectListById(params).then(response => {
  2486. if (response.data.state == 1) {
  2487. this.teamList = []
  2488. var project = response.data.data.project
  2489. for (let i = 0; i < project.length; i++) {
  2490. if (project[i].type == 2 && project[i].status == 1) {
  2491. let obj = {
  2492. id: project[i].project_id,
  2493. project_name: project[i].project.project_name,
  2494. statistical_classification: project[i].project.statistical_classification,
  2495. single_dose: project[i].project.single_dose,
  2496. delivery_way: project[i].project.delivery_way,
  2497. execution_frequency: project[i].project.execution_frequency,
  2498. number_days: project[i].project.number_days,
  2499. total: project[i].number,
  2500. price: project[i].project.price,
  2501. remark: '',
  2502. medical_code: project[i].project.medical_code,
  2503. unit: project[i].project.unit,
  2504. type: project[i].type
  2505. }
  2506. if (obj.total == 0 || obj.total == undefined) {
  2507. obj.total = 1
  2508. }
  2509. this.teamList.push(obj)
  2510. } else if (project[i].type == 3 && project[i].status == 1) {
  2511. let obj = {
  2512. id: project[i].project_id,
  2513. project_name: project[i].good_info.good_name,
  2514. statistical_classification: '',
  2515. single_dose: '',
  2516. delivery_way: '',
  2517. execution_frequency: '',
  2518. number_days: '',
  2519. total: project[i].number,
  2520. price: project[i].good_info.retail_price,
  2521. remark: '',
  2522. medical_code: project[i].good_info.medical_insurance_number,
  2523. unit: project[i].good_info.unit,
  2524. type: project[i].type
  2525. }
  2526. if (obj.total == 0 || obj.total == undefined) {
  2527. obj.total = 1
  2528. }
  2529. this.teamList.push(obj)
  2530. }
  2531. }
  2532. }
  2533. })
  2534. }, changeDoctor(val) {
  2535. for (let i = 0; i < this.doctors.length; i++) {
  2536. if (this.doctors[i].admin_user_id == this.doctorValue) {
  2537. this.departmentValue = this.doctors[i].department_id
  2538. }
  2539. }
  2540. if (this.departmentValue == 0) {
  2541. this.departmentValue = ''
  2542. }
  2543. },
  2544. changeDayOrMonth(tab) {
  2545. if (this.dayorMonth == 'day') {
  2546. } else if (this.dayorMonth == 'month') {
  2547. }
  2548. },
  2549. getAllProjectList() {
  2550. getAllProjectList().then(response => {
  2551. if (response.data.state == 1) {
  2552. var hisprojectlist = response.data.data.hisprojectlist
  2553. this.hisList = hisprojectlist
  2554. }
  2555. })
  2556. },
  2557. clearSelection() {
  2558. this.$refs.tabProjectTeam.clearSelection()
  2559. }
  2560. }, mounted() {
  2561. this.request_record_date = this.record_date
  2562. this.getInitData()
  2563. //获取所有项目
  2564. this.getlist()
  2565. //获取所以项目组套
  2566. this.getAllProjectTeam()
  2567. this.getAllProjectList()
  2568. this.$nextTick(() => {
  2569. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2570. })
  2571. },
  2572. watch: {
  2573. fullHeight(val) {
  2574. if (!this.timer) {
  2575. this.fullHeight = val
  2576. let tableHeight = val - 263
  2577. this.tableHeight = tableHeight
  2578. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2579. this.timer = true
  2580. let that = this
  2581. setTimeout(function() {
  2582. that.timer = false
  2583. }, 400)
  2584. }
  2585. }
  2586. }
  2587. }
  2588. </script>
  2589. <style lang="scss" scoped>
  2590. .new-main-contain {
  2591. height: 100%;
  2592. display: flex;
  2593. flex-direction: column;
  2594. }
  2595. .app-container {
  2596. height: 100%;
  2597. }
  2598. .mainCell {
  2599. height: 36px;
  2600. display: flex;
  2601. align-items: center;
  2602. }
  2603. .mainLeft {
  2604. width: 200px;
  2605. height: 100%;
  2606. display: flex;
  2607. flex-direction: column;
  2608. margin-top: 2px;
  2609. .el-radio {
  2610. margin-right: 5px;
  2611. }
  2612. }
  2613. .mainRight {
  2614. margin-left: 20px;
  2615. flex: 1;
  2616. height: 100%;
  2617. display: flex;
  2618. flex-direction: column;
  2619. .cellSpan {
  2620. min-width: 80px;
  2621. display: inline-block;
  2622. margin-right: 10px;
  2623. }
  2624. }
  2625. .mainCenter {
  2626. display: flex;
  2627. flex: 1;
  2628. height: 100%;
  2629. }
  2630. .centerLeft {
  2631. flex: 1;
  2632. display: flex;
  2633. flex-direction: column;
  2634. position: relative;
  2635. .el-form-item {
  2636. width: 33%;
  2637. margin-bottom: 14px;
  2638. }
  2639. .el-form-item__label {
  2640. text-align: left;
  2641. }
  2642. }
  2643. .backColor {
  2644. background: #f6f8f9;
  2645. height: 5px;
  2646. margin-bottom: 5px;
  2647. }
  2648. .RP {
  2649. color: #409EFF;
  2650. font-size: 14px;
  2651. margin-bottom: 5px;
  2652. }
  2653. .tabsBox {
  2654. position: relative;
  2655. flex: 1;
  2656. overflow-y: auto;
  2657. margin-bottom: 60px;
  2658. /*/ / margin-top: 4 px;*/
  2659. .el-tabs__item {
  2660. padding: 0 10px;
  2661. }
  2662. }
  2663. .preTabs {
  2664. height: 100%;
  2665. display: flex;
  2666. flex-direction: column;
  2667. .el-tabs__content {
  2668. flex: 1;
  2669. overflow-y: auto;
  2670. }
  2671. }
  2672. .costBox {
  2673. width: 100%;
  2674. height: 60px;
  2675. background: #fff;
  2676. position: absolute;
  2677. bottom: 0;
  2678. display: flex;
  2679. align-items: center;
  2680. justify-content: space-between;
  2681. }
  2682. .statusRed {
  2683. color: red;
  2684. }
  2685. .addTab {
  2686. position: absolute;
  2687. right: 8px;
  2688. top: 3px;
  2689. z-index: 20;
  2690. }
  2691. .centerRight {
  2692. width: 300px;
  2693. margin-left: 10px;
  2694. display: flex;
  2695. flex-direction: column;
  2696. position: relative;
  2697. }
  2698. .rightTab {
  2699. height: 40px;
  2700. width: 100%;
  2701. border: 1px solid #d2d2d2;
  2702. box-sizing: border-box;
  2703. p {
  2704. width: 50%;
  2705. height: 40px;
  2706. line-height: 40px;
  2707. text-align: center;
  2708. background: #eee;
  2709. float: left;
  2710. }
  2711. > p:last-child {
  2712. border-left: 1px solid #d2d2d2;
  2713. float: right;
  2714. }
  2715. .activeP {
  2716. background: #409EFF;
  2717. color: #fff;
  2718. }
  2719. }
  2720. .rightTabs {
  2721. display: flex;
  2722. flex-direction: column;
  2723. }
  2724. .comfirmBox {
  2725. width: 100%;
  2726. height: 60px;
  2727. background: #fff;
  2728. position: absolute;
  2729. bottom: 0;
  2730. display: flex;
  2731. align-items: center;
  2732. justify-content: space-between;
  2733. z-index: 99;
  2734. }
  2735. .borderCard {
  2736. height: 100%;
  2737. display: flex;
  2738. flex-direction: column;
  2739. margin-bottom: 60px;
  2740. .el-tabs--border-card > .el-tabs__content {
  2741. padding: 0;
  2742. }
  2743. }
  2744. </style>
  2745. <style lang="scss">
  2746. .borderCard {
  2747. .el-tabs__nav {
  2748. width: 100%;
  2749. }
  2750. .el-tabs__item {
  2751. width: 50%;
  2752. text-align: center;
  2753. }
  2754. .el-tabs__content {
  2755. padding: 5px;
  2756. flex: 1;
  2757. }
  2758. }
  2759. .centerLeft {
  2760. .el-form-item__label {
  2761. text-align: left;
  2762. }
  2763. }
  2764. .tabsBox {
  2765. .el-tabs__item {
  2766. padding: 0 10px;
  2767. }
  2768. .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) {
  2769. padding: 0 10px;
  2770. }
  2771. .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 {
  2772. padding: 0 10px;
  2773. }
  2774. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  2775. padding: 0 10px;
  2776. }
  2777. }
  2778. .centerRight {
  2779. .el-tabs__nav-scroll {
  2780. display: flex;
  2781. }
  2782. .el-tabs__nav {
  2783. margin: 0 auto;
  2784. }
  2785. .el-table th .cell, .el-table td .cell {
  2786. padding: 0 2px;
  2787. }
  2788. }
  2789. .preTabs {
  2790. .el-tabs__content {
  2791. flex: 1;
  2792. overflow-y: auto;
  2793. padding: 5px 0 5px 5px;
  2794. }
  2795. }
  2796. .rightTabs {
  2797. height: 100%;
  2798. .el-tabs__nav {
  2799. width: auto;
  2800. }
  2801. .el-tabs__header {
  2802. margin-bottom: 5px;
  2803. }
  2804. .el-tabs__item {
  2805. width: auto;
  2806. text-align: inherit;
  2807. }
  2808. .el-tabs__content {
  2809. flex: 1;
  2810. overflow-y: auto;
  2811. }
  2812. .el-tab-pane {
  2813. display: flex;
  2814. flex-direction: column;
  2815. height: 100%;
  2816. }
  2817. }
  2818. #tab-more {
  2819. .el-icon-close {
  2820. display: none;
  2821. }
  2822. }
  2823. ::-webkit-scrollbar {
  2824. height: 15px;
  2825. }
  2826. </style>