1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202 |
- <template>
- <div class="patient-container">
- <patient-sidebar :id="patientID" defaultActive="1-4" v-on:tran-patient="onTranPatient"></patient-sidebar>
- <div class="patient-app-container advice-container app-container">
- <div class="cellButton" style="float:right;">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" size="small" @click="openNew" type="primary" icon="el-icon-circle-plus-outline" >新增</el-button>
- <el-button size="small" @click="printThisInfo()" :type="adviceType==1 || adviceType == 3?'primary':'warning'" icon="el-icon-printer" >打印</el-button>
- </div>
- <div class="cell clearfix">
- <el-input style="width: 400px;" v-model="listQuery.keywords" class="filter-item" size="small" />
- <el-button size="small" type="primary" icon="el-icon-search" @click="changeKey" >搜索</el-button>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">医嘱类型</span> : </label>
- <div class="time ">
- <ul class="">
- <li :class="item.value==adviceType?'active':''" @click='selectAdviceType(item.value)' v-for="item in adviceTypeArr" :key="item.value" >{{item.label}}</li>
- </ul>
- </div>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">显示范围</span> : </label>
- <div class="time ">
- <ul class="">
- <li :class="item.value==stopType?'active':''" @click='selectStopType(item.value)' v-for="item in stopTypeArr" :key="item.value" >{{item.label}}</li>
- </ul>
- </div>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">日期查询</span> : </label>
- <el-date-picker size="small" v-model="listQuery.start_time" prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right" :picker-options="pickerOptions" format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </el-date-picker>
- <span class="cellLine"> - </span>
- <el-date-picker size="small" v-model="listQuery.end_time" prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right" :picker-options="pickerOptions" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> </el-date-picker>
- </div>
- <el-table @cell-click="clickuseradvicecell" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" row-class-name="user-advice-table-row" :span-method="mergeSpan" ref="multipleTable" :data="adviceTableData" border fit highlight-current-row @select="selectAdvice" @selection-change="changeAdvice" style="width: 100%;margin-top: 10px;" >
-
- <el-table-column align="center" label="全选" width="60px" type="selection" fixed></el-table-column>
- <!--<el-table-column type="index" :index="indexMethod" label="序号" width="60px" align="center"></el-table-column>-->
- <el-table-column label="期效" width="60px" property="advice_type" align="center" fixed>
- <template slot-scope="scope">
- <span v-if="scope.row.advice_type==1">长嘱</span>
- <span v-else-if="scope.row.advice_type==3">临嘱</span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column label="开始时间" width="180" property="start_time" align="center">
- <template slot-scope="scope">
- <span v-if="isShowStartTime(scope.$index, scope.row)">{{scope.row.start_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column label="医嘱内容" property="advice_name" width="180" style="word-break: keep-all;white-space:nowrap;">
- <template slot-scope="scope">
- <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
- <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
- {{ scope.row.advice_name }}<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
-
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.advice_type == 1" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openStop(scope.$index, scope.row)">停止医嘱</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.advice_type == 3" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openExec(scope.$index, scope.row)">执行医嘱</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.advice_type == 3" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openCheck(scope.$index, scope.row)">核对医嘱</el-dropdown-item>
- <el-dropdown-item :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
- <el-dropdown-item :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openNewChild(scope.$index, scope.row)">新增子药</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
- <span class="el-dropdown-link" >
-   {{ scope.row.advice_name }}<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
- <el-dropdown-item :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
-
- </el-table-column>
- <!-- <el-table-column label="药品规格*数量" width="180" property="drug_spec" align="center">
- <template slot-scope="scope" >
- <span v-if="scope.row.drug_spec!=0">
- {{scope.row.drug_spec}}{{scope.row.drug_spec_unit}}
- </span>
- <span v-if="scope.row.prescribing_number!=0">*{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
-
- </template>
- </el-table-column> -->
- <el-table-column label="规格" width="180" property="advice_desc" align="center">
- </el-table-column>
- <el-table-column label="开药数量" width="180" property="prescribing_number" align="center">
- <template slot-scope="scope" >
- <span v-if="scope.row.prescribing_number!=0">{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="单次用量" width="180" property="single_dose" align="center">
- <template slot-scope="scope" >
- <span v-if="scope.row.single_dose!=0">{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="频率" width="180" property="execution_frequency" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id==0">{{scope.row.execution_frequency}}</span>
- </template>
- </el-table-column>
- <el-table-column label="用法" width="180" property="delivery_way" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id==0">{{scope.row.delivery_way}}</span>
- </template>
- </el-table-column>
- <el-table-column label="执行时间" width="180" property="execution_time" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.execution_state==1"> {{scope.row.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- </template>
- </el-table-column>
- <el-table-column label="终止时间" width="180" property="stop_time" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.stop_state==1"> {{scope.row.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- </template>
- </el-table-column>
- <el-table-column label="执行护士" width="180" property="execution_staff" v-show="adviceType==3" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.execution_staff)}}</span>
- </template>
- </el-table-column>
-
- <el-table-column label="开嘱医生" width="180" property="advice_doctor" align="center">
- <template slot-scope="scope">
- {{getXuserName(scope.row.advice_doctor)}}
- </template>
- </el-table-column>
-
- <el-table-column label="开嘱时间" width="180" property="created_time" align="center">
- <template slot-scope="scope">
- {{scope.row.created_time | parseTime("{y}-{m}-{d} {h}:{i}")}}
- </template>
- </el-table-column>
-
- <el-table-column label="校对护士" width="180" property="checker" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.checker)}}</span>
- </template>
- </el-table-column>
-
- <el-table-column label="校对时间" width="180" property="check_time" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.check_state==1">{{scope.row.created_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- </template>
- </el-table-column>
-
- <!-- <template v-if="adviceType==3">
- <el-table-column key="advice_doctor_3" label="开嘱医生" min-width="80" property="advice_doctor" align="center">
- <template slot-scope="scope">
- {{getXuserName(scope.row.advice_doctor)}}
- </template>
- </el-table-column>
- <el-table-column key="execution_time_3" label="执行时间" min-width="80" property="execution_time" v-show="adviceType==3" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.execution_state==1&&scope.row.parent_id==0"> {{scope.row.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- </template>
- </el-table-column>
- <el-table-column key="execution_staff_3" label="执行人员" min-width="80" property="execution_staff" v-show="adviceType==3" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.execution_staff)}}</span>
- </template>
- </el-table-column>
- <el-table-column key="checker_3" label="核对人员" min-width="80" property="checker" v-show="adviceType==3" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.checker)}}</span>
- </template>
- </el-table-column>
- <el-table-column key="remark_3" label="备注" min-width="80" property="remark" align="center"> </el-table-column>
- </template>
- <template v-if="adviceType==1">
- <el-table-column key="advice_doctor_1" label="开嘱医生" min-width="80" property="advice_doctor" align="center">
- <template slot-scope="scope">
- {{getXuserName(scope.row.advice_doctor)}}
- </template>
- </el-table-column>
- <el-table-column key="advice_affirm_1" label="开嘱确认" min-width="80" property="advice_affirm" v-show="adviceType==0" align="center"> </el-table-column>
- <el-table-column key="stop_time_1" label="停止时间" min-width="80" property="stop_time" v-show="adviceType==1" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.stop_state==1&&scope.row.parent_id==0"> {{scope.row.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- </template>
- </el-table-column>
-
- <el-table-column key="stop_doctor_1" label="停嘱医生" min-width="80" property="stop_doctor" v-show="adviceType==1" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.stop_state==1&&scope.row.parent_id==0"> {{getXuserName(scope.row.stop_doctor)}}</span>
- </template>
- </el-table-column>
- </template> -->
- <el-table-column label="操作" width="180" align="center" fixed="right">
- <template slot-scope="scope">
- <!-- <el-button-group> -->
- <el-tooltip class="item" effect="dark" content="编辑" placement="top">
- <el-button icon="el-icon-edit-outline" type="primary" size="small" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click="scope.row.groupno>0?openEditGroupAdvice(scope.row.groupno):openEdit(scope.$index, scope.row)" v-if="isShowStartTime(scope.$index, scope.row)"></el-button>
- </el-tooltip>
- <el-tooltip class="item" effect="dark" content="删除" placement="top">
- <el-button icon="el-icon-delete" type="danger" size="small" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click="scope.row.groupno>0?DeleteGroupAdvice(scope.row.groupno):openDelete(scope.$index, scope.row)" v-if="isShowStartTime(scope.$index, scope.row)"></el-button>
- </el-tooltip>
- <!-- </el-button-group> -->
- </template>
- </el-table-column>
- </el-table>
-
- <el-dialog title="新增医嘱" :visible.sync="groupFormVisible" width="700px">
- <el-form ref="groupForm" :rules="groupRules" :model="groupForm" label-width="90px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="医嘱类型 :" required prop="advice_type">
- <el-select v-model="groupForm.advice_type" placeholder="请选择">
- <el-option :label="item.label" :key="item.value" :value="item.value" v-for="item in adviceTypeOptions"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开始时间 :" required prop="start_time" style="width:100%;">
- <el-date-picker style="width:100%;" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间" v-model="groupForm.start_time" ></el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-form-item label="备注 :">
- <el-input type="textarea" v-model="groupForm.remark"></el-input>
- </el-form-item>
- <el-row>
- <el-col :span="12">
- <el-form-item label="开嘱医生 :" >
- <span>{{adminusername}} </span>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开嘱时间 :" >
- <span>{{groupForm.advice_date}} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="2">
-
- </el-col>
- <el-col :span="5">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" round @click="openAdviceTemplate()">选择医嘱模板</el-button>
- </el-col>
- <el-col :span="5">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" round @click="openGroupAdvice(0)">新增医嘱内容</el-button>
- </el-col>
- <el-col :span="5">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" round @click="openDeleteGroupAdvice()">删除医嘱内容</el-button>
- </el-col>
- <el-col :span="5">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" round @click="openGroupAdvice(1)">修改医嘱内容</el-button>
- </el-col>
-
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" id="user-advice-name-table" :data="groupForm.adviceNames" border fit highlight-current-row :row-class-name="groupClassName" @current-change="selectGroupAdvice" style="width: 100%;margin-top: 10px;margin-bottom: 10px;" :row-key="getRowKey" ref="advicenametable" :expand-row-keys="expandRowKeys" type="expand" default-expand-all>
- <el-table-column label="医嘱内容" property="advice_name" style="word-break: keep-all;white-space:nowrap;">
-
- </el-table-column>
- <!-- <el-table-column label="药品规格*数量" min-width="80" property="drug_spec" align="center">
- <template slot-scope="scope" >
- <span v-if="scope.row.drug_spec!=0">{{scope.row.drug_spec}}{{scope.row.drug_spec_unit}}</span>
- <span v-if="scope.row.prescribing_number!=0">*{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="规格" min-width="80" property="advice_desc" align="center">
- </el-table-column>
- <el-table-column label="开药数量" min-width="80" property="prescribing_number" align="center">
- <template slot-scope="scope" >
- <span v-if="scope.row.prescribing_number!=0">{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="单次用量" min-width="80" property="single_dose" align="center">
- <template slot-scope="scope" >
- <span v-if="scope.row.single_dose!=0">{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="给药途径" min-width="80" property="delivery_way" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_row==0">{{scope.row.delivery_way}}</span>
- </template>
- </el-table-column>
- <el-table-column label="执行频率" min-width="80" property="execution_frequency" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
- </template>
- </el-table-column>
-
- </el-table>
- </el-col>
- </el-row>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3 || groupForm.adviceNames.length == 0?true:false" type="primary" @click="submitgroupAdvice('groupForm')">保 存</el-button>
- </div>
- </el-dialog>
-
- <el-dialog title="选择医嘱模板" :close-on-click-modal="false" :visible.sync="templateFormVisible" width="72%">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-table
- :data="adviceTemplates"
- ref="templatetable"
- border
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- highlight-current-row
- @current-change="templateTableChange"
- style="width: 100%">
- <el-table-column
- prop="name"
- label="模板名称">
- </el-table-column>
- </el-table>
- </el-col>
- <el-col :span="16">
- <el-table
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- id='user-advice-select-template-table'
- :data="selectedTemp.list"
- border
- :span-method="spanselecttable"
- @select="selectTemplateAdvice"
- @selection-change="changeTemplateAdvice"
- @select-all="selectAllTemplateAdvice"
- row-key="row_key"
- ref="selecttemplatetable"
- style="width: 100%"
- >
- <el-table-column
- type="selection"
- width="55">
- </el-table-column>
- <el-table-column
- label="医嘱内容"
- property="advice_name"
- style="word-break: keep-all;white-space:nowrap;"
- ></el-table-column>
- <el-table-column
- label="规格"
- property="advice_desc"
- ></el-table-column>
- <el-table-column label="开药数量" min-width="80" property="prescribing_number" align="center">
- <template slot-scope="scope">
- <span
- v-if="scope.row.prescribing_number!=0"
- >{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="单次用量" min-width="80" property="single_dose" align="center">
- <template slot-scope="scope">
- <span
- v-if="scope.row.single_dose!=0"
- >{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="
-
- " min-width="80" property="delivery_way" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_row==0">{{scope.row.delivery_way}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="执行频率"
- min-width="80"
- property="execution_frequency"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
-
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancleDialog()">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
- type="primary"
- @click="newAddTempForm()"
- >保 存</el-button>
- </div>
- </el-dialog>
-
- <el-dialog title="选择医嘱模板" :visible.sync="oldTemplateFormVisible" width="700px">
- <el-form ref="templateForm" :rules="templateRules" :model="templateForm" >
- <el-row>
- <el-col :span="24">
- <el-form-item prop="id" >
- <el-select v-model="templateForm.id" filterable clearable placeholder="请选择(输入可搜索)" style="width:100%" >
- <el-option
- v-for="item in adviceTemplates"
- :key="item.id"
- :label="item.name"
- :value="item.id" >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="templateFormVisible = false">取 消</el-button>
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="addTempForm('templateForm')">保 存</el-button>
- </div>
- </el-dialog>
-
- <el-dialog :title="nameFormTitle" :visible.sync="nameFormVisible" width="700px">
- <el-form ref="nameForm" :rules="nameRules" :model="nameForm" label-width="90px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="医嘱内容 :" required prop="advice_name">
- <el-input v-model="nameForm.advice_name" ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="规格 :" prop="advice_desc">
- <el-input v-model="nameForm.advice_desc" ></el-input>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="12">
- <el-form-item label="药品规格 :" prop="drug_spec" >
- <el-col :span="8">
- <el-input v-model="nameForm.drug_spec"></el-input>
- </el-col>
- <el-col class="line" :span="2"> </el-col>
- <el-col :span="14">
- <el-select v-model="nameForm.drug_spec_unit" filterable clearable allow-create placeholder="选择" >
- <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
- </el-option>
- </el-select>
-
- </el-col>
- </el-form-item>
- </el-col> -->
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="单次用量 :" prop="single_dose" >
- <el-col :span="8">
- <el-input v-model="nameForm.single_dose"></el-input>
- </el-col>
- <el-col class="line" :span="2"> </el-col>
- <el-col :span="14">
- <el-select v-model="nameForm.single_dose_unit" filterable clearable allow-create placeholder="选择" >
- <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
- </el-option>
- </el-select>
-
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开药数量 :" prop="prescribing_number">
- <el-col :span="8">
- <el-input v-model="nameForm.prescribing_number"></el-input>
- </el-col>
- <el-col class="line" :span="2"> </el-col>
- <el-col :span="14">
- <el-select v-model="nameForm.prescribing_number_unit" filterable clearable allow-create placeholder="选择" >
- <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
- </el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="给药途径 :" prop="delivery_way" >
- <el-select v-model="nameForm.delivery_way" filterable clearable allow-create :disabled='isChild' placeholder="请选择(输入可搜索)" style="width:100%" >
- <el-option
- v-for="item in deliveryWayOptions"
- :key="item.id"
- :label="item.name "
- :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="执行频率 :" prop="execution_frequency">
- <el-select v-model="nameForm.execution_frequency" filterable clearable allow-create :disabled='isChild' placeholder="请选择(输入可搜索)" style="width:100%" >
- <el-option
- v-for="item in executionFrequencyOptions"
- :key="item.id"
- :label="item.name"
- :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="nameFormVisible = false">取消</el-button>
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="submitNameForm('nameForm')">保 存</el-button>
- </div>
- </el-dialog>
-
- <edit-group-advice :adviceTemplates="adviceTemplates" :groupFormVisible="groupEditFormVisible" :groupForm="groupForm" :adviceTypeOptions="adviceTypeOptions" :executionFrequencyOptions="executionFrequencyOptions" :adminusername="adminusername" :unitsOption="unitsOption" :deliveryWayOptions="deliveryWayOptions" :rowKey="rowKey" :adviceTemplateMaps="adviceTemplateMaps" :patientID="patientID" :adviceType="adviceType" :adviceTableData="adviceTableData" ref="editGroupForm"></edit-group-advice>
-
- <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" width="700px">
- <el-form ref="adviceForm" :rules="adviceRules" :model="adviceForm" label-width="90px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="医嘱类型 :" required prop="advice_type">
- <el-select v-model="adviceForm.advice_type" :disabled="isEdit||adviceForm.parent_id>0?true:false" placeholder="请选择">
- <el-option :label="item.label" :key="item.value" :value="item.value" v-for="item in adviceTypeOptions"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开嘱时间 :" required prop="advice_date" >
- <el-date-picker type="date" readonly format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期" v-model="adviceForm.advice_date" style="width: 100%;"></el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开始时间 :" required prop="start_time" style="width:280px;">
- <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间" v-model="adviceForm.start_time" :disabled="adviceForm.parent_id==0?false:true" ></el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="医嘱内容 :" required prop="advice_name">
- <el-input v-model="adviceForm.advice_name" ></el-input>
- <!--<el-select v-model="adviceForm.advice_name" @change="changeAdviceName" filterable clearable allow-create placeholder="请选择(输入可搜索)" style="width:50%" >-->
- <!--<el-option-->
- <!--v-for="item in adviceTemplates"-->
- <!--:key="item.id"-->
- <!--:label="item.advice_name"-->
- <!--:value="item.id"-->
- <!-->-->
- <!--<span >{{ item.advice_name }}</span>-->
- <!--<span >{{ item.advice_spec }}</span>-->
- <!--</el-option>-->
- <!--</el-select>-->
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="药品规格 :" prop="drug_spec" >
- <el-col :span="9">
- <el-input v-model="adviceForm.drug_spec"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select v-model="adviceForm.drug_spec_unit" filterable clearable allow-create placeholder="选择" >
- <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
- </el-option>
- </el-select>
-
- </el-col>
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="单次用量 :" prop="single_dose" >
- <el-col :span="9">
- <el-input v-model="adviceForm.single_dose"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <!-- <el-input v-model="adviceForm.single_dose_unit" ></el-input> -->
-
- <el-select v-model="adviceForm.single_dose_unit" filterable clearable allow-create placeholder="选择" >
- <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
- </el-option>
- </el-select>
-
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开药数量 :" prop="prescribing_number">
- <el-col :span="9">
- <el-input v-model="adviceForm.prescribing_number"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select v-model="adviceForm.prescribing_number_unit" filterable clearable allow-create placeholder="选择" >
- <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
- </el-option>
- </el-select>
-
- <!-- <el-input v-model="adviceForm.prescribing_number_unit" ></el-input> -->
- </el-col>
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="给药途径 :" prop="delivery_way" >
- <el-select v-model="adviceForm.delivery_way" :disabled="adviceForm.parent_id==0?false:true" filterable clearable allow-create placeholder="请选择(输入可搜索)" style="width:100%" >
- <el-option
- v-for="item in deliveryWayOptions"
- :key="item.id"
- :label="item.name "
- :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="执行频率 :" prop="execution_frequency" style="width:100%;">
- <el-select v-model="adviceForm.execution_frequency" :disabled="adviceForm.parent_id==0?false:true" filterable clearable allow-create placeholder="请选择(输入可搜索)" style="width:100%" >
- <el-option
- v-for="item in executionFrequencyOptions"
- :key="item.id"
- :label="item.name"
- :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="备注 :">
- <el-input type="textarea" v-model="adviceForm.remark"></el-input>
- </el-form-item>
-
- <el-form-item label="开嘱医生 :" >
- <span>{{adminusername}} </span>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <template v-if="isEdit">
- <el-button @click="dialogFormVisible = false">取消</el-button>
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="submitEditAdvice('adviceForm')">保 存</el-button>
- </template>
- <template v-else>
- <el-button @click="dialogFormVisible = false" v-if="adviceForm.parent_id>0">取 消</el-button>
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="submitNewAdvice('adviceForm', 're')" v-if="adviceForm.parent_id==0">继 续</el-button>
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="submitNewAdvice('adviceForm', 'on')">保 存</el-button>
-
- </template>
- </div>
- </el-dialog>
- <el-dialog title="停止医嘱" :visible.sync="dialogStopFormVisible" width="600px">
- <el-form ref="stopForm" :model="stopForm" :rules="stopRules" label-width="90px">
- <el-form-item label="停止时间 :" required prop="stop_time">
- <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间" v-model="stopForm.stop_time" style="width:50%" ></el-date-picker>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogStopFormVisible = false">取消</el-button>
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="submitStopAdvice('stopForm')">保 存</el-button>
- </div>
- </el-dialog>
-
- <el-dialog title="执行医嘱" :visible.sync="execTimeDialogVisible" width="600px">
- <el-form ref="execForm" :model="execForm" :rules="execRules" label-width="90px">
- <el-form-item label="执行时间 :" required prop="exec_time">
- <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间" v-model="execForm.exec_time" style="width:50%" ></el-date-picker>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="submitExecAdvice('execForm')">保 存</el-button>
- <el-button type="primary" @click="execTimeDialogVisible = false">取消</el-button>
- </div>
- </el-dialog>
- </div>
-
- <div style="display:none">
- <div class="printForm" id="printCQadvice">
- <h2 class="hospital_title">{{orgname}}</h2>
- <h1 class="title">长期医嘱单 </h1>
- <div class="info">
- <ul>
- <li>
- <span class="name" >姓名:</span>
- <!-- <input type="text" class="InputBox" v-model="currentPatient.name"> -->
- <span class="InputBox" > {{currentPatient.name}}</span>
- </li>
- <li>
- <span class="name" >性别:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > {{tranSex(currentPatient.gender)}}</span>
- </li>
- <li>
- <span class="name" >年龄:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > {{tranAge(currentPatient.birthday)}}岁</span>
- </li>
- <li>
- <span class="name" >科别:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > </span>
- </li>
- <li>
- <span class="name" >透析号:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > {{currentPatient.dialysis_no}} </span>
- </li>
-
- </ul>
- </div>
- <table border="1" style="border:1px #999 solid;margin-top:20px;" bordercolorlight="#fff" bordercolordark="#fff" width="100%" cellpadding="0" cellspacing="0" class="printTable" >
- <tbody>
- <tr align="center">
- <th style="width:20%;" colspan="2" align="center" >起始</th>
- <th style="width:20%;" rowspan="2" align="">医嘱</th>
- <th style="width:8%;" rowspan="2" align="center" >医师签名</th>
- <th style="width:6%;" rowspan="2" align="center" >执行护士签名</th>
- <th style="width:42%;" colspan="4" align="center" >停止</th>
- </tr>
- <tr align="center">
- <th align="center">日期</th>
- <th align="center">时间</th>
- <th style="width:10%;" align="center">日期</th>
- <th style="width:10%;" align="center">时间</th>
- <th style="width:10%;" align="center">医师签名</th>
- <th style="width:6%;" align="center">执行护士签名</th>
- </tr>
- <tr align="center" v-for="(advice, index) in cqtableData" :key="advice.id">
- <td>
- <span v-if="isShowCQStartTime(index, advice)">{{advice.start_time | parseTime("{y}-{m}-{d}")}}</span>
- </td>
- <td>
- <span v-if="isShowCQStartTime(index, advice)">{{advice.start_time | parseTime("{h}:{i}")}}</span>
- </td>
- <td style="text-align:left">
- <span v-if="advice.parent_id>0">▲</span>
- <span >{{advice.advice_name }}</span>
- <span >{{advice.advice_desc}}</span>
- <!-- <span v-if="advice.drug_spec">{{advice.drug_spec}}{{advice.drug_spec_unit}}</span> -->
- <span v-if="advice.prescribing_number">*{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
- <span v-if="advice.single_dose != 0"> 单次用量 {{advice.single_dose}}{{advice.single_dose_unit}}</span>
- <span >{{advice.delivery_way}}</span>
- <span >{{advice.execution_frequency}}</span>
- </td>
- <td>
- <div v-if="isShowCQStartTime(index, advice)">
- <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{getXuserName(advice.advice_doctor)}}</span>
- <img class="es-img" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else>
- </div>
- </td>
- <td>
- </td>
- <td>
- <span v-if="advice.stop_state==1&&isShowCQStartTime(index, advice)">{{advice.stop_time | parseTime("{y}-{m}-{d}")}}</span>
- </td>
- <td>
- <span v-if="advice.stop_state==1&&isShowCQStartTime(index, advice)">{{advice.stop_time | parseTime("{h}:{i}")}}</span>
- </td>
- <td>
- <div v-if="isShowCQStartTime(index, advice)">
- <span v-if="setAdminUserES(advice.stop_doctor) == ''">{{getXuserName(advice.stop_doctor)}}</span>
- <img class="es-img" :src="setAdminUserES(advice.stop_doctor)" alt="" srcset="" v-else>
- </div>
- </td>
- <td></td>
- </tr>
-
- </tbody>
- </table>
- </div>
- </div>
- <div style="display:none">
- <div class="printForm" id="printLSadvice">
- <h2 class="hospital_title">{{orgname}}</h2>
- <h1 class="title">临时医嘱单</h1>
- <div class="info">
- <ul>
- <li>
- <span class="name" style="width:50px;" >姓名:</span>
- <!-- <input type="text" class="InputBox" v-model="currentPatient.name"> -->
- <span class="InputBox" > {{currentPatient.name}}</span>
- </li>
- <li>
- <span class="name" style="width:50px;" >性别:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > {{tranSex(currentPatient.gender)}}</span>
- </li>
- <li>
- <span class="name" style="width:50px;" >年龄:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > {{tranAge(currentPatient.birthday)}}岁</span>
- </li>
- <li>
- <span class="name" style="width:30px;" >科:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > </span>
- </li>
- <li>
- <span class="name" style="width:30px;" >区:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > </span>
- </li>
- <li>
- <span class="name" style="width:30px;" >房:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > </span>
- </li>
- <li>
- <span class="name" style="width:30px;" >床:</span>
- <!-- <input type="text" class="InputBox"> -->
- <span class="InputBox" > </span>
- </li>
- <li>
- <span class="name" style="width:70px;" >透析号:</span>
- <span class="InputBox" > {{currentPatient.dialysis_no}} </span>
-
- <!-- <input type="text" class="InputBox"> -->
- </li>
- </ul>
- </div>
- <table border="1" style="border:1px #999 solid;margin-top:20px;" bordercolorlight="#fff" bordercolordark="#fff" width="100%" cellpadding="0" cellspacing="0" class="printTable" >
- <tbody>
- <tr align="center">
- <th style="width:10%;" align="center">日期</th>
- <th style="width:10%;" align="center">时间</th>
- <th style="width:10%;" align="center">医生签名</th>
- <th style="width:40%;" align="" >医嘱内容</th>
- <th style="width:10%;" align="center">执行时间</th>
- <th style="width:10%;" align="center">护士签名</th>
- </tr>
- <tr align="center" v-for="advice in lstableData" :key="advice.id">
- <td>
- <span v-if="advice.parent_id==0">{{advice.start_time | parseTime("{y}-{m}-{d}")}}</span>
- </td>
- <td>
- <span v-if="advice.parent_id==0">{{advice.start_time | parseTime("{h}:{i}")}}</span>
- </td>
- <td>
- <div v-if="isShowCQStartTime(index, advice)">
- <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{getXuserName(advice.advice_doctor)}}</span>
- <img class="es-img" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else>
- </div>
- </td>
- <td style="text-align:left">
- <span v-if="advice.parent_id>0">▲</span>
- <span >{{advice.advice_name }}</span>
- <span >{{advice.advice_desc}}</span>
- <!-- <span v-if="advice.drug_spec">{{advice.drug_spec}}{{advice.drug_spec_unit}}</span> -->
- <span v-if="advice.prescribing_number">*{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
- <span v-if="advice.single_dose != 0">单次用量 {{advice.single_dose}}{{advice.single_dose_unit}}</span>
- <span >{{advice.delivery_way}}</span>
- <span >{{advice.execution_frequency}}</span>
- </td>
- <td>
- <span v-if="advice.execution_time!=0" >{{advice.execution_time| parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
- </td>
- <td>
-
- <div v-if="isShowCQStartTime(index, advice)">
- <span v-if="setAdminUserES(advice.execution_staff) == ''">{{getXuserName(advice.execution_staff)}}</span>
- <img class="es-img" :src="setAdminUserES(advice.execution_staff)" alt="" srcset="" v-else>
- </div>
- </td>
-
-
- </tr>
-
- </tbody>
- </table>
- </div>
- </div>
-
- <div style="display:none;">
- <div id="printCQadvice_fq" class="advice-order">
- <div class="ls-title">{{orgname}}</div>
- <div class="ls-type">长期医嘱单</div>
- <div class="ls-name">
- <div>姓名:<span class="item-value">{{currentPatient.name}}</span></div>
- <div>透析号:<span class="item-value">{{currentPatient.dialysis_no}}</span></div>
- </div>
- <table cellspacing="0" cellpadding="0" border="1" class="el-table__body" style="width: 100%;">
- <tbody>
- <tr style="text-align:center;">
- <td colspan="3">
- 开始
- </td>
- <td colspan="2">
- 停止
- </td>
- <td rowspan="2">
- 备注
- </td>
- </tr>
- <tr style="text-align:center;">
- <td>时间</td>
- <td style="max-width:50%">医嘱</td>
- <td>医生</td>
- <td>时间</td>
- <td>医生</td>
- </tr>
- <tr v-for="(advice, index) in cqtableData" :key="advice.id">
- <td>
- <span v-if="isShowCQStartTime(index, advice)">{{advice.start_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- <span v-else></span>
- </td>
- <td>
-
- <span >{{advice.advice_name }}</span>
- <span >{{advice.advice_desc}}</span>
- <span v-if="advice.single_dose">{{advice.single_dose}}{{advice.single_dose_unit}}</span>
- <span v-if="advice.prescribing_number">*{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
- <span >{{advice.delivery_way}}</span>
- <span >{{advice.execution_frequency}}</span>
- </td>
- <td><span v-if="advice.parent_id==0" >{{getXuserName(advice.advice_doctor)}}</span>
- </td>
- <td>
- <span v-if="advice.stop_state==1&&advice.parent_id==0">{{advice.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- <span v-else></span>
- </td>
- <td>
- <span v-if="advice.stop_state==1&&advice.parent_id==0">{{getXuserName(advice.stop_doctor)}}</span>
- <span v-else></span>
- </td>
- <td>
- {{advice.remark}}
- </td>
- </tr>
-
- </tbody>
- </table>
-
- </div>
- </div>
- <div style="display:none;">
- <div id="printLSadvice_fq" class="advice-order">
- <div class="ls-title">{{orgname}}</div>
- <div class="ls-type">临时医嘱单</div>
- <div class="ls-name">
- <div>姓名:<span class="item-value">{{currentPatient.name}}</span></div>
- <div>透析号:<span class="item-value">{{currentPatient.dialysis_no}}</span></div>
- </div>
- <table cellspacing="0" cellpadding="0" border="1" class="el-table__body" style="width: 100%;">
- <thead>
- <th>时间</th>
- <th>医嘱</th>
- <th>医生</th>
- <th>执行护士</th>
- <th>执行时间</th>
- </thead>
- <tbody>
- <tr v-for="(advice, index) in lstableData" :key="advice.id">
- <td>
- <span v-if="isShowLSStartTime(index, advice)">{{advice.start_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
- <span v-else></span>
- </td>
- <td>
-
- <span >{{advice.advice_name }}</span>
- <span >{{advice.advice_desc}}</span>
- <span v-if="advice.single_dose">{{advice.single_dose}}{{advice.single_dose_unit}}</span>
- <span v-if="advice.drug_spec">{{advice.drug_spec}}{{advice.drug_spec_unit}}</span>
- <span v-if="advice.prescribing_number">*{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
- <span >{{advice.delivery_way}}</span>
- <span >{{advice.execution_frequency}}</span>
- </td>
- <td><span v-if="advice.parent_id==0" >{{getXuserName(advice.advice_doctor)}}</span>
- </td>
- <td><span v-if="advice.parent_id==0" >{{getXuserName(advice.execution_staff)}}</span>
- </td>
- <td><span v-if="advice.execution_time!=0" >{{advice.execution_time| parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
- </td>
- </tr>
-
- </tbody>
- </table>
-
- </div>
- </div>
- </div>
- </template>
- <script>
- import PatientSidebar from "./components/PatientSidebar";
- import EditGroupAdvice from "./components/EditGroupAdvice";
- import { fetchAllDoctorAndNurse, fetchAllAdminUsers } from "@/api/doctor";
- import {
- getAdviceConfig,
- CreateDoctorAdvice,
- getDoctorAdviceList,
- EditDoctorAdvice,
- StopDoctorAdvice,
- StopGroupAdvice,
- ExecGroupAdvice,
- CheckGroupAdvice,
- DeleteDoctorAdvice,
- CreateGroupAdvice,
- DeleteGroupAdvice
- } from "@/api/advice";
- import { uParseTime, jsGetAge } from "@/utils/tools";
- import print from "print-js";
- import { getDataConfig } from "@/utils/data";
-
- let rowIndex = 1;
- let rowKey = 0;
-
- export default {
- name: "doctorAdvice",
-
- data() {
- return {
- rowKey: 0,
- nameFormTitle: "",
- adminusername: "",
- aminuserid: 0,
- orgname: "",
- tempArr: [],
- currentPatient: {},
- currentIndex: -1,
- dialogTitle: "新增",
- dialogFormVisible: false,
- groupEditFormVisible: false,
- nameFormVisible: false,
- templateFormVisible: false,
- oldTemplateFormVisible: false,
- dialogStopFormVisible: false,
- execTimeDialogVisible: false,
- groupFormVisible: false,
- isEdit: false,
- isChild: false,
- searchKey: "",
- pickerOptions: {
- shortcuts: [
- {
- text: "今天",
- onClick(picker) {
- picker.$emit("pick", new Date());
- }
- },
- {
- text: "昨天",
- onClick(picker) {
- const date = new Date();
- date.setTime(date.getTime() - 3600 * 1000 * 24);
- picker.$emit("pick", date);
- }
- },
- {
- text: "一周前",
- onClick(picker) {
- const date = new Date();
- date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit("pick", date);
- }
- },
- {
- text: "清空",
- onClick(picker) {
- picker.$emit("pick");
- }
- }
- ]
- },
- adviceType: 0,
- adviceTypeArr: [
- { value: 0, label: "全部" },
- { value: 1, label: "长期" },
- { value: 3, label: "临时" }
- ],
- adviceTypeOptions: [
- { value: 1, label: "长期" },
- { value: 3, label: "临时" }
- ],
- stopType: 0,
- stopTypeArr: [
- { value: 0, label: "全部" },
- { value: 2, label: "未停止" },
- { value: 1, label: "已停止" }
- ],
- adviceTableData: [],
- doctorOptions: [],
- adminUserOptions: null,
- adviceTemplates: [],
- adviceTemplateMaps: {},
- drugOptions: [],
- deliveryWayOptions: [],
- executionFrequencyOptions: [],
- unitsOption: [],
- templateForm: { id: "" },
- adviceForm: {
- advice_type: "",
- advice_date: "",
- start_time: "",
- advice_name: "",
- advice_desc: "",
- single_dose: "",
- single_dose_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- delivery_way: "",
- execution_frequency: "",
- advice_doctor: "",
- remark: "",
- parent_id: 0
- },
- nameForm: {
- advice_name: "",
- single_dose: "",
- single_dose_unit: "",
- drug_spec: "",
- drug_spec_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- delivery_way: "",
- execution_frequency: "",
- isEdit: 0,
- index: 0,
- id: 0,
- children: []
- },
- groupForm: {
- advice_type: "",
- advice_date: "",
- start_time: "",
- adviceNames: [],
- advice_doctor: "",
- remark: "",
- parent_id: 0
- },
- stopForm: {
- id: 0,
- stop_time: "",
- stop_reason: ""
- },
- execForm: {
- exec_time: "",
- groupno: ""
- },
- templateRules: {
- id: [{ required: true, message: "请选择医嘱模板" }]
- },
- adviceRules: {
- advice_type: [{ required: true, message: "请选择医嘱类型" }],
- advice_date: [{ required: true, message: "请选择开嘱时间" }],
- start_time: [{ required: true, message: "请选择开始时间" }],
- advice_name: [{ required: true, message: "请填写医嘱内容" }],
- advice_doctor: [{ required: true, message: "请选择开嘱医生" }]
- },
- nameRules: {
- advice_name: [{ required: true, message: "请填写医嘱内容" }]
- },
- groupRules: {
- advice_type: [{ required: true, message: "请选择医嘱类型" }],
- advice_date: [{ required: true, message: "请选择开嘱时间" }],
- start_time: [{ required: true, message: "请选择开始时间" }],
- advice_name: [{ required: true, message: "请填写医嘱内容" }],
- advice_doctor: [{ required: true, message: "请选择开嘱医生" }]
- },
- stopRules: {
- stop_time: [{ required: true, message: "请选择停止时间" }]
- },
- execRules: {
- exec_time: [{ required: true, message: "请选择时间" }]
- },
- listQuery: {
- start_time: "",
- end_time: "",
- advice_type: 0,
- stop_state: "",
- keywords: "",
- id: 0
- },
- lstableData: [],
- cqtableData: [],
- groupSelectRow: null,
- expandRowKeys: [],
- operators: [],
- operatorMaps: {},
- selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
- selectedTemplate: [],
- allSelectedTemplate: []
- };
- },
- methods: {
- clickuseradvicecell(row, column, cell, event) {},
- onTranPatient: function(tranPatient) {
- this.currentPatient = tranPatient;
- },
- submitEditAdvice(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- EditDoctorAdvice(
- this.patientID,
- this.adviceForm.id,
- this.adviceForm
- ).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "修改医嘱成功",
- type: "success",
- duration: 2000
- });
- this.dialogFormVisible = false;
- this.resetForm(formName);
- var advice = response.data.data.advice;
- this.adviceTableData[this.currentIndex].drug_spec =
- advice.drug_spec;
- this.adviceTableData[this.currentIndex].drug_spec_unit =
- advice.drug_spec_unit;
- this.adviceTableData[this.currentIndex].start_time =
- advice.start_time;
- this.adviceTableData[this.currentIndex].advice_name =
- advice.advice_name;
- this.adviceTableData[this.currentIndex].advice_desc =
- advice.advice_desc;
- this.adviceTableData[this.currentIndex].single_dose =
- advice.single_dose;
- this.adviceTableData[this.currentIndex].single_dose_unit =
- advice.single_dose_unit;
- this.adviceTableData[this.currentIndex].delivery_way =
- advice.delivery_way;
- this.adviceTableData[this.currentIndex].execution_frequency =
- advice.execution_frequency;
- this.adviceTableData[this.currentIndex].prescribing_number =
- advice.prescribing_number;
- this.adviceTableData[this.currentIndex].prescribing_number_unit =
- advice.prescribing_number_unit;
- this.adviceTableData[this.currentIndex].advice_doctor =
- advice.advice_doctor;
- this.adviceTableData[this.currentIndex].remark = advice.remark;
- this.currentIndex = -1;
- return false;
- }
- });
- }
- });
- },
- submitgroupAdvice(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- var submitForm = {
- advice_type: this.groupForm.advice_type,
- advice_date: this.groupForm.advice_date,
- start_time: this.groupForm.start_time,
- adviceNames: [],
- advice_doctor: this.groupForm.advice_doctor,
- remark: this.groupForm.remark,
- parent_id: this.groupForm.parent_id
- };
-
- var adviceNames = [];
- for (const index in this.groupForm.adviceNames) {
- adviceNames.unshift(this.groupForm.adviceNames[index]);
- }
- submitForm.adviceNames = adviceNames;
- CreateGroupAdvice(this.patientID, 0, submitForm).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "新增成功",
- type: "success",
- duration: 2000
- });
-
- if (
- this.adviceType == this.groupForm.advice_type ||
- this.adviceType == 0
- ) {
- var childMap = {};
- for (const index in response.data.data.advices) {
- if (response.data.data.advices[index].parent_id == 0) {
- continue;
- }
- if (
- false ===
- response.data.data.advices[index].parent_id in childMap
- ) {
- childMap[response.data.data.advices[index].parent_id] = [];
- }
- childMap[response.data.data.advices[index].parent_id].unshift(
- response.data.data.advices[index]
- );
- }
- var parentArr = [];
- for (const index in response.data.data.advices) {
- if (response.data.data.advices[index].parent_id > 0) {
- continue;
- }
- parentArr.push(response.data.data.advices[index]);
- }
-
- for (const index in parentArr) {
- if (parentArr[index].id in childMap) {
- for (const j in childMap[parentArr[index].id]) {
- this.adviceTableData.unshift(
- childMap[parentArr[index].id][j]
- );
- }
- }
- this.adviceTableData.unshift(parentArr[index]);
- }
- }
-
- this.resetForm(formName);
- this.groupFormVisible = false;
- return false;
- }
- });
- }
- });
- },
- submitNewAdvice(formName, action) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- CreateDoctorAdvice(this.patientID, this.adviceForm).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "新增医嘱成功",
- type: "success",
- duration: 2000
- });
- if (action != "re") {
- this.dialogFormVisible = false;
- }
- if (
- this.adviceType == this.adviceForm.advice_type ||
- this.adviceType == 0
- ) {
- if (this.adviceForm.parent_id > 0) {
- var spliceIndex = -1;
- for (let index = this.adviceTableData.length - 1; ; index--) {
- if (
- this.adviceTableData[index].parent_id ===
- this.adviceForm.parent_id
- ) {
- spliceIndex = index;
- break;
- } else if (
- this.adviceTableData[index].id ===
- this.adviceForm.parent_id
- ) {
- spliceIndex = index;
- break;
- }
- }
-
- if (spliceIndex > -1) {
- spliceIndex += 1;
- if (spliceIndex === this.adviceTableData.length) {
- this.adviceTableData.push(response.data.data.advice);
- } else {
- var swapData = this.adviceTableData.splice(spliceIndex);
- this.adviceTableData.push(response.data.data.advice);
- this.adviceTableData = this.adviceTableData.concat(
- swapData
- );
- }
- }
- } else {
- this.adviceTableData.unshift(response.data.data.advice);
- }
- }
- this.resetForm(formName);
- this.currentIndex = -1;
- return false;
- }
- });
- }
- });
- },
- submitStopAdvice(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- // StopDoctorAdvice(this.stopForm.id, this.stopForm).then(response=>{
- StopGroupAdvice(this.stopForm.groupno, this.stopForm).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "医嘱已经停止",
- type: "success",
- duration: 2000
- });
- // this.stopResetData(this.stopForm.id);
- var atlen = this.adviceTableData.length;
- for (let index = atlen - 1; index >= 0; index--) {
- if (
- this.adviceTableData[index].groupno == this.stopForm.groupno
- ) {
- this.adviceTableData.splice(index, 1);
- }
- }
- this.dialogStopFormVisible = false;
- }
- }
- );
- }
- });
- },
-
- submitExecAdvice(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- ExecGroupAdvice(this.execForm.groupno, this.execForm.exec_time).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "医嘱已经执行",
- type: "success",
- duration: 2000
- });
- var atlen = this.adviceTableData.length;
- for (const index in this.adviceTableData) {
- if (
- this.adviceTableData[index].groupno == this.execForm.groupno
- ) {
- this.adviceTableData[index].execution_time =
- response.data.data.advice.execution_time;
- this.adviceTableData[index].execution_staff =
- response.data.data.advice.execution_staff;
- this.adviceTableData[index].execution_state = 1;
- }
- }
- this.execTimeDialogVisible = false;
- }
- }
- );
- }
- });
- },
- openAdviceTemplate() {
- this.templateForm = { id: "" };
- this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
- this.selectedTemplate = [];
- if (typeof this.$refs.templatetable != "undefined") {
- this.$refs.templatetable.setCurrentRow(null);
- }
- this.templateFormVisible = true;
- },
- openGroupChild() {
- if (this.groupSelectRow === null) {
-
- this.$message.error("未选择医嘱内容,无法添加子药")
-
- return;
- } else if (this.groupSelectRow.parent_row > 0) {
-
- this.$message.error("子药不能添加子药")
-
- return;
- }
- this.nameForm = {
- advice_name: "",
- single_dose: "",
- single_dose_unit: "",
- drug_spec: "",
- drug_spec_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- delivery_way: this.groupSelectRow.delivery_way,
- execution_frequency: this.groupSelectRow.execution_frequency,
- isEdit: 0,
- index: 0,
- children: [],
- parent_row: this.groupSelectRow.row_key,
- id: 0
- };
- this.isChild = true;
- this.nameFormVisible = true;
- this.nameFormTitle = "添加子药内容";
- },
- openGroupAdvice(isEdit) {
- this.isChild = false;
- if (isEdit) {
- if (this.groupSelectRow === null) {
-
- this.$message.error("未选择要修改的医嘱内容")
-
- return;
-
- }
- if (this.groupSelectRow.parent_row) {
- this.isChild = true;
- }
-
- this.nameForm = {
- advice_name: this.groupSelectRow.advice_name,
- advice_desc: this.groupSelectRow.advice_desc,
- single_dose: this.groupSelectRow.single_dose,
- single_dose_unit: this.groupSelectRow.single_dose_unit,
- drug_spec: this.groupSelectRow.drug_spec,
- drug_spec_unit: this.groupSelectRow.drug_spec_unit,
- prescribing_number: this.groupSelectRow.prescribing_number,
- prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
- delivery_way: this.isChild ? "" : this.groupSelectRow.delivery_way,
- execution_frequency: this.isChild
- ? ""
- : this.groupSelectRow.execution_frequency,
- isEdit: 1,
- index: this.groupSelectRow.index,
- id: this.groupSelectRow.id,
- children: [],
- parent_row: this.groupSelectRow.parent_row
- // row_key:this.groupSelectRow.row_key,
- };
- this.nameFormTitle = "修改医嘱内容";
- } else {
- this.nameForm = {
- advice_name: "",
- advice_desc: "",
- single_dose: "",
- single_dose_unit: "",
- drug_spec: "",
- drug_spec_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- delivery_way: "",
- execution_frequency: "",
- isEdit: 0,
- index: 0,
- id: 0,
- children: [],
- parent_row: 0
- };
- this.nameFormTitle = "添加医嘱内容";
- }
- this.nameFormVisible = true;
- },
- openDeleteGroupAdvice() {
- if (this.groupSelectRow === null) {
- this.$message.error("未选择要删除的医嘱内容")
- return;
- }
- var content = "";
- if (this.groupSelectRow.children.length > 0) {
- content = "确认删除此医嘱内容,包括它的子药?";
- } else {
- content = "确认删除此医嘱内容?";
- }
-
- var isChild = this.groupSelectRow.parent_row ? true : false;
- var title = isChild ? "删除子药内容" : "删除医嘱内容";
- var msg = isChild ? "确认删除此子药内容?" : content;
- this.$confirm(msg, title, {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- if (isChild) {
- for (const index in this.groupForm.adviceNames) {
- if (
- this.groupForm.adviceNames[index].row_key ==
- this.groupSelectRow.parent_row
- ) {
- for (const j in this.groupForm.adviceNames[index].children) {
- if (
- this.groupForm.adviceNames[index].children[j].row_key ==
- this.groupSelectRow.row_key
- ) {
- this.groupForm.adviceNames[index].children.splice(j, 1);
- this.$set(
- this.groupForm.adviceNames,
- index,
- this.groupForm.adviceNames[index]
- );
- this.toggleRowExpansion();
- break;
- }
- }
- }
- }
- } else {
- for (const index in this.groupForm.adviceNames) {
- if (
- this.groupForm.adviceNames[index].row_key ==
- this.groupSelectRow.row_key
- ) {
- this.groupForm.adviceNames.splice(index, 1);
- this.toggleRowExpansion();
- break;
- }
- }
- }
- })
- .catch(() => {});
- },
- DeleteGroupAdvice(groupno) {
- this.$confirm("确认删除这组医嘱?", "医嘱删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- DeleteGroupAdvice(groupno).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "医嘱已经删除",
- type: "success",
- duration: 2000
- });
-
- var resetTableData = this.adviceTableData;
- this.adviceTableData = [];
- var that = this;
- for (const key in resetTableData) {
- if (resetTableData[key].groupno != groupno) {
- that.adviceTableData.push(resetTableData[key]);
- }
- }
- }
- });
- })
- .catch(() => {});
- },
- openDelete(index, row) {
- this.$confirm("确认删除此条医嘱?", "医嘱删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- DeleteDoctorAdvice(row.id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "医嘱已经删除",
- type: "success",
- duration: 2000
- });
- this.deleteResetData(index, row);
- }
- });
- })
- .catch(() => {});
- },
- resetForm(formName) {
- this.$refs[formName].resetFields();
- },
- changeTime() {
- this.getList();
- },
- changeKey() {
- this.getList();
- },
-
- openExec(index, row) {
- if (row.stop_state == 1 || row.execution_state == 1) {
- this.$message.error("所选医嘱已停止或执行");
- return false;
- }
-
- this.execForm = {
- exec_time: "",
- groupno: row.groupno
- };
- this.execTimeDialogVisible = true;
- this.currentIndex = index;
- },
- openCheck(index, row) {
- if (row.check_state == 1) {
- this.$message.error("所选医嘱已核对");
- return false;
- }
- if (row.execution_state != 1) {
- this.$message.error("所选医嘱未执行,无法核对");
- return false;
- }
- if (
- row.execution_staff > 0 &&
- row.execution_staff == this.$store.getters.xt_user.user.id
- ) {
- this.$message.error("核对与执行不能是同一人");
- return false;
- }
-
- this.$confirm("确认提交核对?", "医嘱核对", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- closeOnClickModal: false,
- type: "warning"
- })
- .then(() => {
- this.deleLoading = true;
- CheckGroupAdvice(row.groupno).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "核对成功",
- type: "success",
- duration: 2000
- });
-
- var atlen = this.adviceTableData.length;
- for (const index in this.adviceTableData) {
- if (this.adviceTableData[index].groupno == row.groupno) {
- this.adviceTableData[index].checker =
- response.data.data.advice.checker;
- this.adviceTableData[index].check_time =
- response.data.data.advice.check_time;
- this.adviceTableData[index].check_state = 1;
- }
- }
- }
- });
- })
- .catch(() => {});
- },
- openStop(index, row) {
- if (row.stop_state == 1 || row.execution_state == 1) {
- this.$message.error("所选医嘱已停止!");
- return false;
- }
-
- this.stopForm = {
- id: row.parent_id > 0 ? row.parent_id : row.id,
- stop_time: "",
- stop_reason: "",
- groupno: row.groupno
- };
- this.currentIndex = index;
- this.dialogStopFormVisible = true;
- },
- openNew() {
- var theDate = new Date();
- var year = theDate.getFullYear();
- var month = theDate.getMonth() + 1;
- var dat = theDate.getDate();
- month = month < 10 ? "0" + month : month;
- dat = dat < 10 ? "0" + dat : dat;
- var adviceDate = year + "-" + month + "-" + dat;
- // this.groupForm.advice_date = adviceDate;
- this.groupForm = {
- advice_type: "",
- advice_date: adviceDate,
- start_time: "",
- adviceNames: [],
- advice_doctor: "",
- remark: "",
- parent_id: 0
- };
- this.rowKey = 0;
- this.groupFormVisible = true;
- },
- openEditGroupAdvice(groupno) {
- var groups = [];
- this.rowKey = 0;
- for (const index in this.adviceTableData) {
- if (groupno == this.adviceTableData[index].groupno) {
- groups.push(this.adviceTableData[index]);
- }
- }
- if (groups.length == 0) {
- return false;
- }
- this.groupForm = {
- advice_type: groups[0].advice_type,
- advice_date: uParseTime(groups[0].advice_date, "{y}-{m}-{d}"),
- start_time: uParseTime(groups[0].start_time, "{y}-{m}-{d} {h}:{i}:{s}"),
- adviceNames: [],
- advice_doctor: "",
- remark: groups[0].remark,
- groupno: groupno
- };
-
- var childMap = {};
- for (const index in groups) {
- if (groups[index].parent_id == 0) {
- continue;
- }
- if (false === groups[index].parent_id in childMap) {
- childMap[groups[index].parent_id] = [];
- }
- childMap[groups[index].parent_id].push(groups[index]);
- }
-
- for (const index in groups) {
- if (groups[index].parent_id > 0) {
- continue;
- }
- this.rowKey++;
- var item = {
- advice_name: groups[index].advice_name,
- advice_desc: groups[index].advice_desc,
- single_dose: "" + groups[index].single_dose,
- single_dose_unit: groups[index].single_dose_unit,
- drug_spec: "" + groups[index].drug_spec,
- drug_spec_unit: groups[index].drug_spec_unit,
- prescribing_number: "" + groups[index].prescribing_number,
- prescribing_number_unit: groups[index].prescribing_number_unit,
- delivery_way: groups[index].delivery_way,
- execution_frequency: groups[index].execution_frequency,
- isEdit: 0,
- index: 0,
- id: groups[index].id,
- children: [],
- parent_row: 0,
- row_key: this.rowKey
- };
- if (item.id in childMap) {
- for (const key in childMap[item.id]) {
- this.rowKey++;
- var child = {
- advice_name: childMap[item.id][key].advice_name,
- advice_desc: childMap[item.id][key].advice_desc,
- single_dose: "" + childMap[item.id][key].single_dose,
- single_dose_unit: childMap[item.id][key].single_dose_unit,
- drug_spec: "" + childMap[item.id][key].drug_spec,
- drug_spec_unit: childMap[item.id][key].drug_spec_unit,
- prescribing_number:
- "" + childMap[item.id][key].prescribing_number,
- prescribing_number_unit:
- childMap[item.id][key].prescribing_number_unit,
- delivery_way: childMap[item.id][key].delivery_way,
- execution_frequency: childMap[item.id][key].execution_frequency,
- isEdit: 0,
- index: 0,
- id: childMap[item.id][key].id,
- children: [],
- parent_row: item.row_key,
- row_key: this.rowKey
- };
- item.children.push(child);
- }
- this.$set(item, "children", item.children);
- }
- this.groupForm.adviceNames.push(item);
- }
-
- this.$refs.editGroupForm.open();
- },
-
- openEdit(index, row) {
- this.currentIndex = index;
- (this.dialogTitle = "修改医嘱"), (this.isEdit = true);
-
- if (row.stop_state == 1 || row.execution_state == 1) {
- this.$message.error("所选医嘱已停止,不能修改!");
- return false;
- }
- // if (row.advice_doctor != this.aminuserid) {
- // this.$message.error("不能修改非本人添加的医嘱!");
- // return false;
- // }
-
- this.setAdviceForm(row);
- this.dialogFormVisible = true;
- },
- openNewChild(index, row) {
- this.currentIndex = index;
- this.dialogTitle = "新增子药";
- this.isEdit = false;
- if (row.stop_state == 1 || row.execution_state == 1) {
- this.$message.error("所选医嘱已停止");
- return false;
- }
- this.adviceForm = {
- advice_type: row.advice_type,
- advice_date: uParseTime(row.advice_date, "{y}-{m}-{d}"),
- start_time: uParseTime(row.start_time, "{y}-{m}-{d} {h}:{i}:{s}"),
- advice_name: "",
- advice_desc: "",
- single_dose: "",
- single_dose_unit: "",
- drug_spec: "",
- drug_spec_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- delivery_way: row.delivery_way,
- execution_frequency: row.execution_frequency,
- advice_doctor: row.advice_doctor,
- remark: "",
- parent_id: row.parent_id > 0 ? row.parent_id : row.id
- };
- this.dialogFormVisible = true;
- },
- changeAdviceName(key) {
- if (key in this.adviceTemplateMaps) {
- this.adviceForm.advice_name = this.adviceTemplateMaps[key].advice_name;
- this.adviceForm.advice_desc = this.adviceTemplateMaps[key].advice_desc;
- this.adviceForm.single_dose_unit = this.adviceTemplateMaps[
- key
- ].single_dose_unit;
- this.adviceForm.single_dose =
- this.adviceTemplateMaps[key].single_dose + "";
- this.adviceForm.prescribing_number_unit = this.adviceTemplateMaps[
- key
- ].prescribing_number_unit;
- this.adviceForm.prescribing_number =
- this.adviceTemplateMaps[key].prescribing_number + "";
- this.adviceForm.delivery_way = this.adviceTemplateMaps[
- key
- ].delivery_way;
- this.adviceForm.execution_frequency = this.adviceTemplateMaps[
- key
- ].execution_frequency;
- }
- },
- indexMethod(index) {
- if (index === 0) {
- rowIndex = 1;
- }
- var row = this.adviceTableData[index];
- if (row.parent_id > 0) {
- return "";
- } else if (
- index > 0 &&
- row.groupno > 0 &&
- row.groupno == this.adviceTableData[index - 1].groupno
- ) {
- return "";
- }
- return rowIndex++;
- },
- isShowStartTime(index, row) {
- if (row.parent_id > 0) {
- return false;
- } else if (
- index > 0 &&
- row.groupno > 0 &&
- row.groupno == this.adviceTableData[index - 1].groupno
- ) {
- return false;
- }
- return true;
- },
- isShowCQStartTime(index, row) {
- if (row.parent_id > 0) {
- return false;
- } else if (
- index > 0 &&
- row.groupno > 0 &&
- row.groupno == this.cqtableData[index - 1].groupno
- ) {
- return false;
- }
- return true;
- },
- isShowLSStartTime(index, row) {
- if (row.parent_id > 0) {
- return false;
- } else if (
- index > 0 &&
- row.groupno > 0 &&
- row.groupno == this.lstableData[index - 1].groupno
- ) {
- return false;
- }
- return true;
- },
- selectAdviceType(type) {
- this.adviceType = type;
- this.listQuery.advice_type = type;
- this.getList();
- },
- selectStopType(type) {
- this.stopType = type;
- this.listQuery.stop_state = type;
- this.getList();
- },
- deleteResetData(index, row) {
- if (row.parent_id > 0) {
- this.adviceTableData.splice(index, 1);
- } else {
- var resetTableData = this.adviceTableData;
- this.adviceTableData = [];
- var that = this;
- resetTableData.forEach(function(item, itemindex) {
- if (item.id != row.id && item.parent_id != row.id) {
- that.adviceTableData.push(item);
- }
- });
- }
- },
- stopResetData(id) {
- var resetTableData = this.adviceTableData;
- this.adviceTableData = [];
- var that = this;
- resetTableData.forEach(function(item, index) {
- if (item.id != id && item.parent_id != id) {
- that.adviceTableData.push(item);
- }
- });
- },
- fetchAllDoctorAndNurse() {
- fetchAllDoctorAndNurse().then(response => {
- if (response.data.state == 1) {
- this.doctorOptions = response.data.data.doctors;
- }
- });
- },
- fetchAllAdminUsers() {
- fetchAllAdminUsers().then(response => {
- if (response.data.state == 1) {
- this.adminUserOptions = response.data.data.users;
- var alen = this.adminUserOptions.length;
- for (let index = 0; index < alen; index++) {
- if (this.adminUserOptions[index].user_type == 2) {
- this.doctorOptions.push(this.adminUserOptions[index]);
- }
- }
- }
- });
- },
-
- getAdviceConfig() {
- getAdviceConfig().then(response => {
- if (response.data.state == 1) {
- this.deliveryWayOptions =
- response.data.data.drugways === null
- ? []
- : response.data.data.drugways;
- this.executionFrequencyOptions =
- response.data.data.efs === null ? [] : response.data.data.efs;
- this.adviceTemplates =
- response.data.data.advice_templates === null
- ? []
- : response.data.data.advice_templates;
-
- var templateLen = this.adviceTemplates.length;
- for (let index = 0; index < templateLen; index++) {
- if (!this.adviceTemplates[index].DoctorAdviceTemplate) {
- continue;
- }
-
- var DoctorAdviceTemplate = this.adviceTemplates[index]
- .DoctorAdviceTemplate;
- for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
- DoctorAdviceTemplate[i].selection = false;
- }
-
- var item = this.adviceTemplates[index];
- item.DoctorAdviceTemplate = [];
- var datMap = {};
- for (const key in DoctorAdviceTemplate) {
- if (DoctorAdviceTemplate[key].parent_id == 0) {
- datMap[DoctorAdviceTemplate[key].id] =
- DoctorAdviceTemplate[key];
- }
- }
-
- for (const key in DoctorAdviceTemplate) {
- if (DoctorAdviceTemplate[key].parent_id in datMap) {
- if ("children" in datMap[DoctorAdviceTemplate[key].parent_id]) {
- datMap[DoctorAdviceTemplate[key].parent_id].children.push(
- DoctorAdviceTemplate[key]
- );
- } else {
- datMap[DoctorAdviceTemplate[key].parent_id].children = [];
- datMap[DoctorAdviceTemplate[key].parent_id].children.push(
- DoctorAdviceTemplate[key]
- );
- }
- }
- }
- for (const key in datMap) {
- item.DoctorAdviceTemplate.push(datMap[key]);
- }
-
- this.$set(
- this.adviceTemplateMaps,
- this.adviceTemplates[index].id,
- item
- );
- }
- }
- });
- },
- getDoctorName(doctorid) {
- if (doctorid <= 0) {
- return "";
- }
- var name = "";
- if (
- this.doctorOptions == null ||
- typeof this.doctorOptions.length == "undefined"
- ) {
- return name;
- }
- var leng = this.doctorOptions.length;
- if (leng == 0) {
- return name;
- }
- for (let index = 0; index < leng; index++) {
- if (this.doctorOptions[index].id == doctorid) {
- name = this.doctorOptions[index].name;
- break;
- }
- }
- return name;
- },
- getXuserName(id) {
- if (id <= 0) {
- return "";
- }
- var name = "";
- if (
- this.adminUserOptions == null ||
- typeof this.adminUserOptions.length == "undefined"
- ) {
- return name;
- }
- var leng = this.adminUserOptions.length;
- if (leng == 0) {
- return name;
- }
- for (let index = 0; index < leng; index++) {
- if (this.adminUserOptions[index].id == id) {
- name = this.adminUserOptions[index].name;
- break;
- }
- }
- return name;
- },
- setAdviceForm(row) {
- this.adviceForm = {
- advice_type: row.advice_type,
- advice_date: uParseTime(row.advice_date, "{y}-{m}-{d}"),
- start_time: uParseTime(row.start_time, "{y}-{m}-{d} {h}:{i}:{s}"),
- advice_name: row.advice_name,
- advice_desc: row.advice_desc,
- drug_spec: row.drug_spec != 0 ? row.drug_spec : "",
- drug_spec_unit: row.drug_spec_unit,
- single_dose: row.single_dose != 0 ? row.single_dose : "",
- single_dose_unit: row.single_dose_unit,
- prescribing_number:
- row.prescribing_number != 0 ? row.prescribing_number : "",
- prescribing_number_unit: row.prescribing_number_unit,
- delivery_way: row.delivery_way,
- execution_frequency: row.execution_frequency,
- advice_doctor: row.advice_doctor,
- remark: row.remark,
- id: row.id,
- parent_id: row.parent_id
- };
- },
- getList() {
- getDoctorAdviceList(this.listQuery).then(response => {
- if (response.data.state == 1) {
- this.adviceTableData = response.data.data.advices;
- this.operators = response.data.data.operators;
- if (this.operators.length > 0) {
- var operatorsLen = this.operators.length;
- for (var index = 0; index < operatorsLen; index++) {
- this.$set(
- this.operatorMaps,
- this.operators[index].creator,
- this.operators[index]
- );
- }
- }
- } else {
- this.adviceTableData = [];
- }
-
- this.handleSpanTempArr();
- });
- },
- changeAdvice(selection) {
- if (this.adviceType == 3) {
- this.lstableData = selection;
- } else if (this.adviceType == 1) {
- this.cqtableData = selection;
- }
- },
- groupClassName({ row, rowIndex }) {
- row.index = rowIndex;
- // row.row_key = rowIndex+1;
- },
- getRowKey(row) {
- return row.row_key;
- },
- getMaxRowKey() {
- return this.rowKey;
- },
- selectGroupAdvice(row) {
- this.groupSelectRow = row;
- },
- selectAdvice(selection, row) {
- if (this.adviceType != 3) {
- this.lstableData = [];
- } else if (this.adviceType != 1) {
- this.cqtableData = [];
- }
- this.$refs.multipleTable.toggleRowSelection(row);
- var dlen = this.adviceTableData.length;
- if (row.parent_id > 0) {
- for (let index = 0; index < dlen; index++) {
- if (
- this.adviceTableData[index].id == row.parent_id ||
- this.adviceTableData[index].parent_id == row.parent_id
- ) {
- this.$refs.multipleTable.toggleRowSelection(
- this.adviceTableData[index]
- );
- }
- }
- } else {
- for (let index = 0; index < dlen; index++) {
- if (
- this.adviceTableData[index].parent_id == row.id ||
- this.adviceTableData[index].id == row.id ||
- this.adviceTableData[index].groupno == row.groupno
- ) {
- this.$refs.multipleTable.toggleRowSelection(
- this.adviceTableData[index]
- );
- }
- }
- }
- },
- printThisInfo() {
- if (this.adviceType == 1) {
- if (this.cqtableData.length == 0) {
- this.$message.error("请勾选需要打印的医嘱!");
- return false;
- }
- const style =
- "@media print {.printForm{width:960px} .printForm .hospital_title{font-size:20px;font-weight:400;text-align:center;letter-spacing:5px}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .info ul{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;align-items:center;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-justify-content:space-around;-moz-justify-content:space-around;-ms-justify-content:space-around;-o-justify-content:space-around;justify-content:space-around}.printForm .info ul li{display:flex;box-sizing:border-box;justify-content:space-around}.printForm .info ul li .InputBox{padding:0;border:0;border-bottom:1px #e5e5e5 solid;outline:0;width: 80px;}.printForm .printTable tr{padding:2px}.printForm .printTable tr>th{padding:6px 4px}.printForm .printTable tr>td{padding:6px 4px} .es-img {height: 25px;}";
-
- setTimeout(() => {
- printJS({
- printable: "printCQadvice",
- type: "html",
- style: style,
- scanStyles: false
- });
- }, 1);
- } else if (this.adviceType == 3) {
- if (this.lstableData.length == 0) {
- this.$message.error("请勾选需要打印的医嘱!");
- return false;
- }
- const style =
- "@media print {.printForm{width:960px} .printForm .hospital_title{font-size:20px;font-weight:400;text-align:center;letter-spacing:5px}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .info ul{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;align-items:center;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-justify-content:space-around;-moz-justify-content:space-around;-ms-justify-content:space-around;-o-justify-content:space-around;justify-content:space-around}.printForm .info ul li{display:flex;box-sizing:border-box;justify-content:space-around}.printForm .info ul li .InputBox{padding:0;border:0;border-bottom:1px #e5e5e5 solid;outline:0;width: 80px;}.printForm .printTable tr{padding:2px}.printForm .printTable tr>th{padding:6px 4px}.printForm .printTable tr>td{padding:6px 4px} .es-img {height: 25px;}";
-
- setTimeout(() => {
- printJS({
- printable: "printLSadvice",
- type: "html",
- style: style,
- scanStyles: false
- });
- }, 1);
- } else {
- this.$message.error(
- "请先将医嘱类型切换到长期或临时,将勾选需要打印的医嘱!"
- );
- return false;
- }
- },
- cellClassName({ row, column, rowIndex, columnIndex }) {
- return "ls-table-row";
- },
- tranAge(birthday) {
- var birth = uParseTime(birthday, "{y}-{m}-{d}");
- return jsGetAge(birth, "-");
- },
- changeTemplateAdvice(selection) {
- this.selectedTemplate = selection;
- },
- selectAllTemplateAdvice(selection) {
- var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
- .DoctorAdviceTemplate;
- for (let y = 0; y < adviceArray.length; y++) {
- adviceArray[y].selection = false;
- }
- if (selection.length > 0) {
- for (let y = 0; y < adviceArray.length; y++) {
- for (let i = 0; i < selection.length; i++) {
- if (adviceArray[y].id == selection[i].advice_id) {
- adviceArray[y].selection = true;
- }
- }
- }
- }
- },
- selectTemplateAdvice(selection, row) {
- var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
- .DoctorAdviceTemplate;
- for (let y = 0; y < adviceArray.length; y++) {
- adviceArray[y].selection = false;
- }
- if (selection.length > 0) {
- for (let y = 0; y < adviceArray.length; y++) {
- for (let i = 0; i < selection.length; i++) {
- if (adviceArray[y].id == selection[i].advice_id) {
- adviceArray[y].selection = true;
- }
- }
- }
- }
-
- if (row.children.length > 0) {
- for (const index in row.children) {
- this.$refs.selecttemplatetable.toggleRowSelection(
- row.children[index]
- );
- }
- }
-
- //下面两步的作用是为了上选中的数据的输出顺序不变
- for (const index in this.selectedTemp.list) {
- this.$refs.selecttemplatetable.toggleRowSelection(
- this.selectedTemp.list[index]
- );
- if (this.selectedTemp.list[index].children.length > 0) {
- for (const j in this.selectedTemp.list[index].children) {
- this.$refs.selecttemplatetable.toggleRowSelection(
- this.selectedTemp.list[index].children[j]
- );
- }
- }
- }
-
- for (const index in this.selectedTemp.list) {
- this.$refs.selecttemplatetable.toggleRowSelection(
- this.selectedTemp.list[index]
- );
- if (this.selectedTemp.list[index].children.length > 0) {
- for (const j in this.selectedTemp.list[index].children) {
- this.$refs.selecttemplatetable.toggleRowSelection(
- this.selectedTemp.list[index].children[j]
- );
- }
- }
- }
- },
- spanselecttable({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 0) {
- const _row = this.selectedTemp.rows[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- },
- calcselectedTemp() {
- var rowKeys = 0;
- for (const index in this.selectedTemp.list) {
- var pkey = rowKeys;
- this.selectedTemp.rows[rowKeys] = 1;
- if (this.selectedTemp.list[index].children.length > 0) {
- for (const childindex in this.selectedTemp.list[index].children) {
- rowKeys++;
- this.selectedTemp.rows[pkey] += 1;
- this.selectedTemp.rows[rowKeys] = 0;
- }
- }
- rowKeys++;
- this.$nextTick(function() {
- if (this.selectedTemp.list[index].selection) {
- this.$refs.selecttemplatetable.toggleRowSelection(
- this.selectedTemp.list[index]
- );
- }
- });
- }
- },
- templateTableChange(currentRow, oldCurrentRow) {
- this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
- if (currentRow == null) {
- return false;
- }
-
- this.selectedTemp.id = currentRow.id;
- this.selectedTemp.name = currentRow.name;
- this.selectedTemp.org_id = currentRow.org_id;
- if (this.selectedTemp.id in this.adviceTemplateMaps) {
- var mapid = this.selectedTemp.id;
- var thisRowKey = 0;
- for (const index in this.adviceTemplateMaps[mapid]
- .DoctorAdviceTemplate) {
- thisRowKey++;
- var item = {
- advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].advice_name,
- advice_desc: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].advice_desc,
- single_dose:
- "" +
- this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .single_dose,
- single_dose_unit: this.adviceTemplateMaps[mapid]
- .DoctorAdviceTemplate[index].single_dose_unit,
- drug_spec:
- "" +
- this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .drug_spec,
- drug_spec_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].drug_spec_unit,
- prescribing_number:
- "" +
- this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .prescribing_number,
- prescribing_number_unit: this.adviceTemplateMaps[mapid]
- .DoctorAdviceTemplate[index].prescribing_number_unit,
- delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].delivery_way,
- execution_frequency: this.adviceTemplateMaps[mapid]
- .DoctorAdviceTemplate[index].execution_frequency,
- advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].id,
- selection: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].selection,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: 0,
- row_key: thisRowKey
- };
- if (
- "children" in
- this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] &&
- this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children
- .length > 0
- ) {
- var parentRow = thisRowKey;
- var children = this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
- index
- ].children;
- for (const key in children) {
- thisRowKey++;
- var child = {
- advice_id: children[key].id,
- advice_name: children[key].advice_name,
- advice_desc: children[key].advice_desc,
- single_dose: "" + children[key].single_dose,
- single_dose_unit: children[key].single_dose_unit,
- drug_spec: "" + children[key].drug_spec,
- drug_spec_unit: children[key].drug_spec_unit,
- prescribing_number: "" + children[key].prescribing_number,
- prescribing_number_unit: children[key].prescribing_number_unit,
- delivery_way: children[key].delivery_way,
- execution_frequency: children[key].execution_frequency,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: parentRow,
- row_key: thisRowKey
- };
- item.children.push(child);
- }
- this.$set(item, "children", item.children);
- }
-
- this.selectedTemp.list.unshift(item);
- }
- }
- },
- newAddTempForm() {
- this.allSelectedTemplate = [];
- var thisRowKey = 0;
- for (const indexs in this.adviceTemplateMaps) {
- let adviceTemplate = this.adviceTemplateMaps[indexs];
- for (const index in adviceTemplate.DoctorAdviceTemplate) {
- if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
- thisRowKey++;
- var item = {
- advice_name:
- adviceTemplate.DoctorAdviceTemplate[index].advice_name,
- advice_desc:
- adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
- single_dose:
- "" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
- single_dose_unit:
- adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
- drug_spec:
- "" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
- drug_spec_unit:
- adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
- prescribing_number:
- "" +
- adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
- prescribing_number_unit:
- adviceTemplate.DoctorAdviceTemplate[index]
- .prescribing_number_unit,
- delivery_way:
- adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
- execution_frequency:
- adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
- advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
- selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: 0,
- row_key: thisRowKey
- };
- if (
- "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
- adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
- ) {
- var parentRow = thisRowKey;
- var children =
- adviceTemplate.DoctorAdviceTemplate[index].children;
- for (const key in children) {
- thisRowKey++;
- var child = {
- advice_id: children[key].id,
- advice_name: children[key].advice_name,
- advice_desc: children[key].advice_desc,
- single_dose: "" + children[key].single_dose,
- single_dose_unit: children[key].single_dose_unit,
- drug_spec: "" + children[key].drug_spec,
- drug_spec_unit: children[key].drug_spec_unit,
- prescribing_number: "" + children[key].prescribing_number,
- prescribing_number_unit:
- children[key].prescribing_number_unit,
- delivery_way: children[key].delivery_way,
- execution_frequency: children[key].execution_frequency,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: parentRow,
- row_key: thisRowKey
- };
- item.children.push(child);
- this.allSelectedTemplate.unshift(child);
- }
- this.$set(item, "children", item.children);
- }
- this.allSelectedTemplate.unshift(item);
- adviceTemplate.DoctorAdviceTemplate[index].selection = false;
- }
- }
- }
-
- var childMap = {};
- for (const index in this.allSelectedTemplate) {
- if (this.allSelectedTemplate[index].parent_row > 0) {
- if (!(this.allSelectedTemplate[index].parent_row in childMap)) {
- childMap[this.allSelectedTemplate[index].parent_row] = [];
- }
- childMap[this.allSelectedTemplate[index].parent_row].push(
- this.allSelectedTemplate[index]
- );
- }
- }
-
- for (const index in this.allSelectedTemplate) {
- if (this.allSelectedTemplate[index].parent_row > 0) {
- continue;
- }
- this.rowKey++;
- var item = {
- advice_name: this.allSelectedTemplate[index].advice_name,
- advice_desc: this.allSelectedTemplate[index].advice_desc,
- single_dose: "" + this.allSelectedTemplate[index].single_dose,
- single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
- drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
- drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
- prescribing_number:
- "" + this.allSelectedTemplate[index].prescribing_number,
- prescribing_number_unit: this.allSelectedTemplate[index]
- .prescribing_number_unit,
- delivery_way: this.allSelectedTemplate[index].delivery_way,
- execution_frequency: this.allSelectedTemplate[index]
- .execution_frequency,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: 0,
- row_key: this.rowKey
- };
-
- if (this.allSelectedTemplate[index].children.length > 0) {
- if (this.allSelectedTemplate[index].row_key in childMap) {
- var parentRow = this.rowKey;
- var children = childMap[this.allSelectedTemplate[index].row_key];
- for (const key in children) {
- this.rowKey++;
- var child = {
- advice_name: children[key].advice_name,
- advice_desc: children[key].advice_desc,
- single_dose: "" + children[key].single_dose,
- single_dose_unit: children[key].single_dose_unit,
- drug_spec: "" + children[key].drug_spec,
- drug_spec_unit: children[key].drug_spec_unit,
- prescribing_number: "" + children[key].prescribing_number,
- prescribing_number_unit: children[key].prescribing_number_unit,
- delivery_way: children[key].delivery_way,
- execution_frequency: children[key].execution_frequency,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: parentRow,
- row_key: this.rowKey
- };
- item.children.push(child);
- }
- this.$set(item, "children", item.children);
- }
- }
- this.groupForm.adviceNames.push(item);
- }
- this.templateFormVisible = false;
- //清除数据源的选中记录
- },
- addTempForm(formName) {
- var _this = this;
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (_this.templateForm.id in _this.adviceTemplateMaps) {
- var mapid = _this.templateForm.id;
- for (const index in _this.adviceTemplateMaps[mapid]
- .DoctorAdviceTemplate) {
- this.rowKey++;
- var item = {
- advice_name:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .advice_name,
- advice_desc:
- "" +
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .advice_desc,
- single_dose:
- "" +
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .single_dose,
- single_dose_unit:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .single_dose_unit,
- drug_spec:
- "" +
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .drug_spec,
- drug_spec_unit:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .drug_spec_unit,
- prescribing_number:
- "" +
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .prescribing_number,
- prescribing_number_unit:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .prescribing_number_unit,
- delivery_way:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .delivery_way,
- execution_frequency:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .execution_frequency,
- parent_id:
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .parent_id,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: 0,
- row_key: this.rowKey
- };
- if (
- "children" in
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] &&
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .children
- ) {
- var parentRow = this.rowKey;
- var children =
- _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
- .children;
- for (const key in children) {
- this.rowKey++;
- var child = {
- advice_name: children[key].advice_name,
- advice_desc: children[key].advice_desc,
- single_dose: "" + children[key].single_dose,
- single_dose_unit: children[key].single_dose_unit,
- drug_spec: "" + children[key].drug_spec,
- drug_spec_unit: children[key].drug_spec_unit,
- prescribing_number: "" + children[key].prescribing_number,
- prescribing_number_unit:
- children[key].prescribing_number_unit,
- delivery_way: children[key].delivery_way,
- execution_frequency: children[key].execution_frequency,
- isEdit: 0,
- id: 0,
- children: [],
- parent_row: parentRow,
- row_key: this.rowKey
- };
- item.children.push(child);
- }
- _this.$set(item, "children", item.children);
- }
-
- _this.groupForm.adviceNames.unshift(item);
-
- // _this.groupForm.adviceNames.unshift(item);
-
- _this.toggleRowExpansion();
- }
- }
- _this.templateFormVisible = false;
- }
- });
- },
- submitNameForm(formName) {
- var _this = this;
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (_this.nameForm.isEdit) {
- var ale = _this.groupForm.adviceNames.length;
- if (_this.isChild) {
- for (let index = 0; index < ale; index++) {
- if (
- _this.groupSelectRow.parent_row ==
- _this.groupForm.adviceNames[index].row_key
- ) {
- var cle = _this.groupForm.adviceNames[index].children.length;
- var children = _this.groupForm.adviceNames[index].children;
- for (let j = 0; j < ale; j++) {
- if (_this.groupSelectRow.row_key == children[j].row_key) {
- _this.groupForm.adviceNames[index].children[
- j
- ].advice_name =
- _this.nameForm.advice_name;
- _this.groupForm.adviceNames[index].children[
- j
- ].advice_desc =
- _this.nameForm.advice_desc;
- _this.groupForm.adviceNames[index].children[
- j
- ].single_dose =
- "" + _this.nameForm.single_dose;
- _this.groupForm.adviceNames[index].children[
- j
- ].single_dose_unit =
- _this.nameForm.single_dose_unit;
- _this.groupForm.adviceNames[index].children[j].drug_spec =
- "" + _this.nameForm.drug_spec;
- _this.groupForm.adviceNames[index].children[
- j
- ].drug_spec_unit =
- _this.nameForm.drug_spec_unit;
- _this.groupForm.adviceNames[index].children[
- j
- ].prescribing_number =
- "" + _this.nameForm.prescribing_number;
- _this.groupForm.adviceNames[index].children[
- j
- ].prescribing_number_unit =
- _this.nameForm.prescribing_number_unit;
- _this.groupForm.adviceNames[index].children[
- j
- ].delivery_way =
- _this.nameForm.delivery_way;
- _this.groupForm.adviceNames[index].children[
- j
- ].execution_frequency =
- _this.nameForm.execution_frequency;
-
- _this.$set(
- _this.groupForm.adviceNames[index].children,
- j,
- _this.groupForm.adviceNames[index].children[j]
- );
- _this.toggleRowExpansion();
- break;
- }
- }
- }
- }
- } else {
- for (let index = 0; index < ale; index++) {
- if (
- _this.groupSelectRow.row_key ==
- _this.groupForm.adviceNames[index].row_key
- ) {
- _this.groupForm.adviceNames[index].advice_name =
- _this.nameForm.advice_name;
- _this.groupForm.adviceNames[index].advice_desc =
- _this.nameForm.advice_desc;
- _this.groupForm.adviceNames[index].single_dose =
- "" + _this.nameForm.single_dose;
- _this.groupForm.adviceNames[index].single_dose_unit =
- _this.nameForm.single_dose_unit;
- _this.groupForm.adviceNames[index].drug_spec =
- "" + _this.nameForm.drug_spec;
- _this.groupForm.adviceNames[index].drug_spec_unit =
- _this.nameForm.drug_spec_unit;
- _this.groupForm.adviceNames[index].prescribing_number =
- "" + _this.nameForm.prescribing_number;
- _this.groupForm.adviceNames[index].prescribing_number_unit =
- _this.nameForm.prescribing_number_unit;
- _this.groupForm.adviceNames[index].delivery_way =
- _this.nameForm.delivery_way;
- _this.groupForm.adviceNames[index].execution_frequency =
- _this.nameForm.execution_frequency;
-
- _this.$set(
- _this.groupForm.adviceNames,
- index,
- _this.groupForm.adviceNames[index]
- );
- _this.toggleRowExpansion();
- break;
- }
- }
- }
- } else {
- if (_this.isChild) {
- _this.rowKey++;
- _this.nameForm.row_key = _this.rowKey;
-
- var ale = _this.groupForm.adviceNames.length;
- for (let index = 0; index < ale; index++) {
- if (
- _this.nameForm.parent_row ==
- _this.groupForm.adviceNames[index].row_key
- ) {
- _this.groupForm.adviceNames[index].children.push(
- _this.nameForm
- );
- _this.$set(
- _this.groupForm.adviceNames,
- index,
- _this.groupForm.adviceNames[index]
- );
- // _this.$refs.advicenametable.doLayout();
-
- _this.toggleRowExpansion();
- break;
- }
- }
- } else {
- _this.rowKey++;
- _this.nameForm.row_key = _this.rowKey;
- _this.groupForm.adviceNames.push(_this.nameForm);
- _this.toggleRowExpansion();
- }
- }
- _this.nameFormVisible = false;
- }
- });
- },
-
- setAdminUserES(id) {
- if (id == 0) {
- return "";
- }
- if (id in this.operatorMaps) {
- return this.operatorMaps[id].url;
- } else {
- return "";
- }
- },
- tranSex(gender) {
- var sex = "未知";
- switch (gender) {
- case 1:
- sex = "男";
- break;
- case 2:
- sex = "女";
- break;
- default:
- break;
- }
- return sex;
- },
- load(tree, treeNode, resolve) {},
- toggleRowExpansion() {
- for (const index in this.groupForm.adviceNames) {
- this.$refs.advicenametable.toggleRowExpansion(
- this.groupForm.adviceNames[index],
- true
- );
- }
- },
- handleSpanTempArr() {
- this.tempArr = [];
-
- for (let i = 0; i < this.adviceTableData.length; i++) {
- if (i === 0) {
- this.tempArr.push(1);
- this.pos = 0;
- } else {
- // 判断当前元素与上一个元素是否相同
- if (
- this.adviceTableData[i].groupno ===
- this.adviceTableData[i - 1].groupno
- ) {
- this.tempArr[this.pos] += 1;
- this.tempArr.push(0);
- } else {
- this.tempArr.push(1);
- this.pos = i;
- }
- }
- }
-
- // let sameRowArr = [], sIdx = 0;
- // this.adviceTemplates.forEach((item, index) => {
- // item.index = index
- // if (index === 0) {
- // sameRowArr.push([index])
- // } else {
- // if (item.template_id === this.adviceTemplates[index - 1].template_id) {
- // sameRowArr[sIdx].push(index)
- // } else {
- // sIdx = sIdx + 1;
- // sameRowArr.push([index])
- // }
- // }
- // })
- // this.sameRowArr = sameRowArr;
- },
- mergeSpan({ row, column, rowIndex, columnIndex }) {
- if (
- columnIndex === 0 ||
- columnIndex === 1 ||
- columnIndex === 2 ||
- columnIndex >= 9
- ) {
- const _row = this.tempArr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- },
- cancleDialog() {
- this.templateFormVisible = false;
-
- for (const indexs in this.adviceTemplateMaps) {
- let adviceTemplate = this.adviceTemplateMaps[indexs];
- for (const index in adviceTemplate.DoctorAdviceTemplate) {
- adviceTemplate.DoctorAdviceTemplate[index].selection = false;
- }
- }
- }
- },
- watch: {
- adviceTableData: function() {
- this.handleSpanTempArr();
- },
- "selectedTemp.list": function() {
- this.calcselectedTemp();
- }
- },
- components: {
- PatientSidebar,
- EditGroupAdvice
- },
- created() {
- const id = this.$route.params && this.$route.params.id;
- this.patientID = parseInt(id);
- if (isNaN(this.patientID) || this.patientID <= 0) {
- this.$notify.error({
- title: "错误",
- message: "无效的id"
- });
- this.$router.push("/patients/patients");
- }
- this.listQuery.id = this.patientID;
-
- var nowDate = new Date();
- var nowYear = nowDate.getFullYear();
- var nowMonth = nowDate.getMonth() + 1;
- var nowDay = nowDate.getDate();
-
- this.listQuery.end_time =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
-
- nowDate.setMonth(nowDate.getMonth() - 1);
- nowYear = nowDate.getFullYear();
- nowMonth = nowDate.getMonth() + 1;
- nowDay = nowDate.getDate();
-
- this.listQuery.start_time =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
-
- // this.fetchAllDoctorAndNurse();
- this.fetchAllAdminUsers();
- this.getAdviceConfig();
- this.getList();
-
- var xtuser = this.$store.getters.xt_user;
- this.orgname = xtuser.org.org_name;
- this.adminusername = xtuser.user.user_name;
- this.aminuserid = xtuser.user.id;
- this.unitsOption = getDataConfig("hemodialysis", "units");
- }
- };
- </script>
-
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .printForm {
- width: 960px;
- }
- .printForm .hospital_title {
- font-size: 20px;
- font-weight: 400;
- text-align: center;
- letter-spacing: 5px;
- }
- .printForm .title {
- font-size: 30px;
- font-weight: 500;
- text-align: center;
- }
-
- .printForm .title {
- font-size: 30px;
- font-weight: 500;
- text-align: center;
- }
-
- .printForm .info ul {
- display: -webkit-box;
- display: -moz-box;
- display: -ms-flexbox;
- display: -webkit-flex;
- display: flex;
- align-items: center;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -o-box-sizing: border-box;
- -ms-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-justify-content: space-around;
- -moz-justify-content: space-around;
- -ms-justify-content: space-around;
- -o-justify-content: space-around;
- justify-content: space-around;
- }
- .printForm .info ul li {
- display: flex;
- box-sizing: border-box;
- justify-content: space-around;
- }
- .printForm .info ul li .InputBox {
- padding: 0;
- border: none;
- border-bottom: 1px #e5e5e5 solid;
- outline: none;
- width: 80px;
- }
- .printForm .printTable tr {
- padding: 2px;
- }
- .printForm .printTable tr > th {
- padding: 6px 4px;
- }
- .printForm .printTable tr > td {
- padding: 6px 4px;
- }
-
- .es-img {
- height: 25px;
- }
-
- .advice-container {
- font-size: 15px;
- .filter-container {
- padding-bottom: 5px;
- }
- .search-component {
- width: 500px;
- .searchBox {
- width: 300px;
- height: 36px;
- line-height: 36px;
- padding-left: 15px;
- border: 1px #dcdfe6 solid;
- border-right: none;
- outline: none;
- float: left;
- border-radius: 6px 0 0 6px;
- font-size: 14px;
- color: #333;
- background: #fff;
- box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
- }
- .searchBtn {
- background-color: #409eff;
- color: #fff;
- font-size: 15px;
- text-align: center;
- height: 36px;
- line-height: 36px;
- float: left;
- outline: none;
- width: 70px;
- border: none;
- border-radius: 0 6px 6px 0;
- font-family: "Microsoft Yahei";
- cursor: pointer;
- }
- }
- .amount {
- font-weight: normal;
- padding: 10px 0 0 0;
- color: #606266;
- font-size: 14px;
- span {
- color: #ef2525;
- font-family: "Arial";
- padding: 0 2px;
- }
- }
- .el-dropdown-link {
- cursor: pointer;
- }
- }
-
- .advice-order .ls-title {
- text-align: center;
- font-weight: 600;
- font-size: 30px;
- line-height: 80px;
- margin-bottom: 20px;
- }
- .advice-order .ls-type {
- text-align: center;
- margin-bottom: 20px;
- }
- .advice-order .ls-name {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 30px 2em;
- }
- </style>
- <style>
- .advice-order .el-table__body {
- border: 1px solid #333;
- }
- .advice-order .el-table__body td {
- border: 1px solid #333;
- }
- .advice-order .item-value {
- flex: 1;
- border-bottom: 1px solid #333;
- }
- .advice-order th,
- .advice-order td {
- padding: 5px 10px;
- }
- #user-advice-name-table .expanded {
- display: table-row !important;
- }
- #user-advice-name-table .el-table__expand-icon {
- -webkit-transform: rotate(90deg) !important;
- transform: rotate(90deg) !important;
- }
-
- .user-advice-table-row:hover > td {
- background: #fff !important;
- }
- .user-advice-table-row td:hover {
- background: #fff !important;
- }
- #user-advice-select-template-table .el-table__row {
- display: table-row !important;
- }
- #user-advice-select-template-table .el-table__expand-icon {
- -webkit-transform: rotate(90deg) !important;
- transform: rotate(90deg) !important;
- }
- </style>
-
|