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

deskPrescription.vue 124KB

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