deskPrescription.vue 124KB

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