1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959 |
- <template>
- <div class="doctor-advice-box">
- <el-dialog
- :title="add_title"
- :visible.sync="isLastOrNextVisible"
- width="1010px"
- @close="resetDialog"
- :modal = 'false'
- :close-on-click-modal="false"
- >
-
- <div class="txsj">
- <el-button
- round
-
- @click="openLast(3)"
- >上一方
- </el-button>
-
- <el-button
- round
- @click="openNext(4)"
- >下一方
- </el-button>
- </div>
-
-
-
- <el-form
- ref="adForm"
- :rules="adRules"
- :model="adForm"
- label-width="90px"
- >
- <el-row>
-
- <el-col :span="12">
- <el-form-item
- label="开始时间 :"
- required
- prop="other_start_time"
- style="width:100%;"
- >
- <el-date-picker
- type="datetime"
- format="yyyy-MM-dd HH:mm"
- value-format="yyyy-MM-dd HH:mm"
- placeholder="选择时间"
- v-model="adForm.other_start_time"
- style="width:100%;"
- ></el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
-
- </el-form>
- <div style='margin-bottom:20px;'>
- {{getContent()}}
- </div>
-
- <el-table
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- :data="other_doctor_advices"
- border
- style="width: 100%"
- ref="advices_list"
-
- >
- <el-table-column
- label="医嘱内容"
- property="advice_name"
- style="word-break: keep-all;white-space:nowrap;"
- align="center"
- ></el-table-column>
- <el-table-column label="药品规格" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.advice_desc">{{ scope.row.advice_desc}}{{ scope.row.drug_spec_unit }}</span>
- </template>
- </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>
-
-
- <div slot="footer" class="dialog-footer">
- <el-button @click="isLastOrNextVisible = false">取 消</el-button>
- <el-button type="primary" @click="AddNewAdvice('adForm')">设为本次临嘱</el-button>
- </div>
- </el-dialog>
-
- <el-dialog
- :title="title"
- :visible.sync="isVisibility"
- width="1010px"
- @close="resetDialog"
- :modal = 'false'
- :close-on-click-modal="false"
- >
- <div class="txsj">
- <el-button
- round
- v-if="his_is_open != 1 || is_advice_open == 1"
- @click="openLast(1)"
- >上一方
- </el-button>
-
- <el-button
- round
- v-if="his_is_open != 1 || is_advice_open == 1"
- @click="openNext(2)"
- >下一方
- </el-button>
- </div>
-
- <div class="txsj" v-show="showAdvicePanel">
- <el-button
- round
- @click="openGroupFrom"
- :loading="deleLoading"
- v-if="his_is_open != 1 || is_advice_open == 1"
- :disabled="!is_has_create"
- >新增医嘱
- </el-button>
-
- <el-button
- v-if="currentRow != null"
- round
- :disabled="!is_has_exce"
- @click="execAdvice"
- :loading="deleLoading"
-
- >执行医嘱
- </el-button>
- <el-button v-else disabled round @click="execAdvice" :loading="deleLoading">执行医嘱</el-button>
-
- <el-button
- v-if="currentRow != null"
- round
- :disabled="!is_has_check"
- @click="checkAdvice"
- :loading="deleLoading"
- >医嘱核对
- </el-button>
- <el-button v-else disabled round @click="checkAdvice" :loading="deleLoading">医嘱核对</el-button>
-
- <el-button
-
- v-if="groupSelectRow != null || his_is_open != 1"
- :disabled="!is_has_modify && !is_has_modify_other"
- round
- @click="openEditGroupAdvice"
- :loading="deleLoading"
- >修改医嘱
- </el-button>
-
- <el-button v-else disabled round @click="openEditGroupAdvice" :loading="deleLoading">修改医嘱</el-button>
-
- <el-button
- v-if="groupSelectRow != null || his_is_open != 1"
- :disabled="!is_has_del && !is_has_del_other"
- round
- @click="openDeleteGroupAdvice"
- :loading="deleLoading"
- >删除医嘱
- </el-button>
- <el-button v-else disabled round @click="openDeleteGroupAdvice" :loading="deleLoading">删除医嘱</el-button>
-
- </div>
-
- <!-- <el-table
- v-if="his_is_open !=1 && is_advice_open!=1"
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- :data="doctor_advices"
- border
- style="width: 100%"
- v-show="showAdvicePanel"
- ref="advices_list"
- @row-click="cellMouseEnter"
- :row-class-name="tableRowClassName"
- :span-method="objectSpanMethod"
- :cell-class-name="adviceNameShow"
- :modal-append-to-body="false"
- highlight-current-row
-
- >
-
- <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
- </template>
- </el-table-column>
-
- <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
- <template slot-scope="scope">
- <span>
- {{scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
- <template slot-scope="scope">
- <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
- <span class="el-dropdown-link">
- {{ getAdviceContent(scope.row, 1)}}
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if=" his_is_open != 1" @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open != 1 " @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open != 1 " @click.native="openNewChildTwo(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">
-  {{ getAdviceContent(scope.row, 2)}}
-
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if=" his_is_open != 1" @click.native="openEdit(scope.$index, scope.row)">修改子药</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open != 1" @click.native="openDelete(scope.$index, scope.row)">删除子药</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
-
- <el-table-column
- prop="execution_time"
- align="center"
- min-width="30px"
- label="执行时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.execution_time != 0">
- {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
- <template slot-scope="scope">
- <span>
- {{getXuserName(scope.row.execution_staff)}}
- </span>
-
- </template>
- </el-table-column>
- <el-table-column
- v-if="(template_id != 6 && org_id!=10223 && org_id!=10445) || org_id == 10460"
- prop="checker"
- min-width="30px"
- align="center"
- label="核对人员"
- >
- <template slot-scope="scope">
- <span>
- {{getXuserName(scope.row.checker)}}
- </span>
- </template>
- </el-table-column>
- </el-table> -->
-
-
-
- <el-table
- v-if="his_is_open !=1 && is_advice_open!=1"
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- :data="doctor_advices_one"
- border
- style="width: 100%"
- v-show="showAdvicePanel"
- ref="advices_list"
- @row-click="cellMouseEnter"
- :row-class-name="tableRowClassName"
-
- :cell-class-name="adviceNameShow"
- :modal-append-to-body="false"
- highlight-current-row
-
- >
-
- <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
- </template>
- </el-table-column>
-
- <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
- <template slot-scope="scope">
- <span>
- {{scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
- <template slot-scope="scope">
- <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
- <span class="el-dropdown-link">
- {{ getAdviceContent(scope.row, 1)}}
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if=" his_is_open != 1" @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open != 1 " @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open != 1 " @click.native="openNewChildTwo(scope.$index, scope.row)">新增子药</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
-
- <el-dropdown trigger="click">
- <span class="el-dropdown-link" v-for="(it,index) in scope.row.children" :key="index">
-  {{ getAdviceContentOne(it, 2)}}
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if=" his_is_open != 1" @click.native="openEdit(scope.$index, scope.row)">修改子药</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open != 1" @click.native="openDelete(scope.$index, scope.row)">删除子药</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
-
- <el-table-column
- prop="execution_time"
- align="center"
- min-width="30px"
- label="执行时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.execution_time != 0">
- {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士"><!--bug642-->
- <template slot-scope="scope">
- <span>
- {{getXuserName(scope.row.execution_staff)}}
- </span>
-
- </template>
- </el-table-column>
- <el-table-column
- v-if="(template_id != 6 && org_id!=10223 && org_id!=10445) || org_id == 10460"
- prop="checker"
- min-width="30px"
- align="center"
- label="核对人员"
- >
- <template slot-scope="scope">
- <span>
- {{getXuserName(scope.row.checker)}}
- </span>
- </template>
- </el-table-column>
- </el-table>
-
- <el-table
- v-if="his_is_open == 1 || is_advice_open == 1"
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- :data="doctor_advices"
- border
- style="width: 100%"
- v-show="showAdvicePanel"
- ref="advices_list"
- @row-click="cellMouseEnter"
- :row-class-name="tableRowClassName"
- :cell-class-name="adviceNameShow"
- :modal-append-to-body="false"
- highlight-current-row
- >
- <!-- <el-table-column type="selection" width="55"></el-table-column> -->
- <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
- </template>
- </el-table-column>
-
- <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
- <template slot-scope="scope">
- <span>
- {{scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
- <template slot-scope="scope">
- <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
- <span class="el-dropdown-link">
- {{ getAdviceContent(scope.row, 1)}}<!--修改这里医嘱内容s-->
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if=" his_is_open == 1 && scope.row.origin == 1 " @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open == 1 && scope.row.origin == 1" @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open == 1 && scope.row.origin == 1" @click.native="openNewChildTwo(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">
- <span>
-  {{getAdviceContent(scope.row, 2)}}
- </span>
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if=" his_is_open == 1 && scope.row.origin == 1" @click.native="openEdit(scope.$index, scope.row)">修改子药</el-dropdown-item>
- <el-dropdown-item v-if=" his_is_open == 1 && scope.row.origin == 1" @click.native="openDelete(scope.$index, scope.row)">删除子药</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
-
- <el-table-column
- prop="execution_time"
- align="center"
- min-width="30px"
- label="执行时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.execution_time != 0">
- {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
- <template slot-scope="scope">
- <span>
- {{getXuserName(scope.row.execution_staff)}}
- </span>
- <!-- <span v-else>{{getXuserName(scope.row.execution_staff)}}</span> -->
- </template>
- </el-table-column>
- <el-table-column
- v-if="template_id != 6"
- prop="checker"
- min-width="30px"
- align="center"
- label="核对人员"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id == 0">
- {{getXuserName(scope.row.checker)}}
- </span>
- <span v-else>{{getXuserName(scope.row.checker)}}</span>
- </template>
- </el-table-column>
-
- </el-table>
-
-
- <!-- 新增医嘱(子药)表单 || 新增子药表单 -->
- <!-- 医嘱表单 -->
- <el-form ref="form" :model="form" label-width="100px" v-show="showAdviceForm">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="开始时间:">
- <el-date-picker
- format="yyyy-MM-dd HH:mm"
- value-format="yyyy-MM-dd HH:mm"
- type="datetime"
- :disabled="form.parent_id == 0 ? false : true"
- placeholder="选择日期"
- v-model="form.start_time"
- style="width: 100%;"
- ></el-date-picker>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="医嘱名称:">
-
- <el-autocomplete
- style="width:100%;"
- class="inline-input"
- v-model="form.advice_name"
- :fetch-suggestions="querySearch"
- placeholder="请输入内容"
- @select="handleSelect"
- @input="changeDrugName"
- ></el-autocomplete>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="药品规格:"><!--li-->
- <el-autocomplete
- style="width:100px;"
- class="inline-input"
- v-model="form.advice_desc"
- :fetch-suggestions="querySearch1"
- placeholder="请输入内容"
- @input="changeDrugDesc"
- ></el-autocomplete>
-
- <el-select
- v-model="form.drug_spec_unit"
- style="width: 100px;"
- filterable
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="开药数量:">
- <el-input v-model="form.prescribing_number" style="width: 40%;"></el-input>
- <el-select
- v-model="form.prescribing_number_unit"
- style="width: 56%;"
- filterable
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="单次用量:">
- <el-input v-model="form.single_dose" style="width: 40%;"></el-input>
- <el-select
- v-model="form.single_dose_unit"
- style="width: 56%;"
- filterable
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="给药途径:">
- <el-select
- v-model="form.delivery_way"
- :disabled="form.parent_id == 0 ? false : true"
- filterable
- placeholder="请选择(输入可搜索)"
- >
- <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-row>
-
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="执行频率:">
- <el-select
- v-model="form.execution_frequency"
- :disabled="form.parent_id == 0 ? false : true"
- filterable
- placeholder="请选择(输入可搜索)"
- >
- <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" v-show="showAdviceForm">
- <el-button @click="hideForm">取 消</el-button>
- <el-button type="primary" v-if="form.id == 0" @click="submitAdvice" :loading="loading">保 存</el-button><!--新增子药保存按钮(选择医嘱名称前)保 存1-->
- <el-button type="primary" v-else @click="submitEditAdvice" :loading="loading">保 存</el-button><!--新增子药保存按钮(编辑医嘱存2-->
- </div>
- <!-- 医嘱表单 end -->
- </el-dialog>
- <el-dialog
- title="选择执行时间"
- :visible.sync="execTimeDialogVisible"
- width="400px"
- @close="closeTimePanel"
- :show-close="isClose"
- :close-on-click-modal="isClose"
- :close-on-press-escape="isClose"
- ::modal = 'false'
- >
- <el-date-picker
- v-model="execTime"
- format="yyyy-MM-dd HH:mm:00"
- value-format="yyyy-MM-dd HH:mm:00"
- type="datetime"
- placeholder="选择执行时间"
- style="width:100%"
- ></el-date-picker>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeTimePanel" :loading="exceLoading">取 消</el-button>
- <el-button type="primary" @click="submitExce" :loading="exceLoading">保 存</el-button>
- </span>
- </el-dialog>
-
- <add-group-advice
- :predialysis="predialysis"
- :adviceTemplates="adviceTemplates"
- :executionFrequencyOptions="executionFrequencyOptions"
- :unitsOption="unitsOption"
- :deliveryWayOptions="deliveryWayOptions"
- :adviceTemplateMaps="adviceTemplateMaps"
- :patientID="patient.id"
- :adviceTableData="doctor_advices"
- :recordDate="record_date"
- :schedulePatient="schedulePatient"
- ref="addGroupForm"
- ></add-group-advice>
-
- <edit-group-advice
- :adviceTemplates="adviceTemplates"
- :executionFrequencyOptions="executionFrequencyOptions"
- :unitsOption="unitsOption"
- :deliveryWayOptions="deliveryWayOptions"
- :adviceTemplateMaps="adviceTemplateMaps"
- :patientID="patient.id"
- :adviceTableData="doctor_advices"
- :recordDate="record_date"
- ref="editGroupForm"
- v-on:add-new-order="addNewOrder"
- :admin_users="admin_users"
- ></edit-group-advice>
- </div>
- </template>
-
- <script>
- import AddGroupAdvice from './adviceDialog/AddGroupAdvice'
- import EditGroupAdvice from './adviceDialog/EditGroupAdvice'
- import { uParseTime } from '@/utils/tools'
- import {
- CheckDoctorAdvice,
- CreateDoctorAdvice,
- CreateGroupAdvice,
- DeleteDoctorAdvice,
- DeleteGroupAdvice,
- EditDoctorAdvice,
- ExecDoctorAdvice,
- getAdviceConfig,
- GetLastOrNextDoctorAdvice,
- getPatientSchedule
- } from '@/api/advice'
- import { getDataConfig } from '@/utils/data'
- import { saveInformation } from '@/api/dialysis'
- import request from '@/utils/request'
- import { getDialysisScheduleDetail } from '@/api/dialysis_record'
- import { getSelfMedicalList } from "@/api/drug/drug"
- export default {
- name: 'DoctorAdviceDialog',
- props: {
- dialysis_order: {
- // 透析记录
- type: Object,
- default: () => {
- return { id: 0 }
- }
- },
- patient: {
- // 患者信息
- type: Object,
- default: () => {
- return { id: 0 }
- }
- },
- doctor_advices: {
- type: Array
- },
- admin_users: {
- // 系统用户列表
- type: Array,
- default: () => {
- return []
- }
- },
- predialysis: {
- type: Object,
- default: () => {
- return { id: 0 }
- }
- },
- },
- data() {
- return {
- adRules: {
- start_time: [{ required: true, message: '请选择开始时间' }]
- },
- adForm: {
- other_start_time: ''
- },
- request_record_date: '',
- isLastOrNextVisible: false,
- other_doctor_advices: [],
- sch: null,
- is_has_create: true,
- is_has_exce: true,
- is_has_check: true,
- is_has_modify_exce: true,
- is_has_modify: true,
- is_has_modify_other: true,
- is_has_del: true,
- is_has_del_other: true,
- tempArr: [],
- execTimeDialogVisible: false,
- currentBoxClass: 'current-box-class',
- isClose: false,
- isShow: false,
- loading: false,
- sameRowArr: [],
- hoverOrderArr: [],
- isVisibility: false,
- record_date: '',
- template_id: 0,
- deleLoading: false,
- exceLoading: false,
- execTime: '',
- current_group_index: -1,
- title: '临时医嘱',
- add_title: '新增医嘱',
- his_is_open:0,
- is_advice_open:0,
- showAdviceForm: false,
- showAdvicePanel: true,
- showNameForm: false,
- showGroupForm: false,
- showTemplateForm: false,
- current_template_id: -1,
- adviceTemplates: [],
- adviceTemplateMaps: {},
- deliveryWayOptions: [],
- executionFrequencyOptions: [],
- unitsOption: [],
- // admin_users: [],
-
- templateRules: {
- id: [{ required: true, message: '请选择医嘱模板' }]
- },
- nameRules: {
- advice_name: [{ required: true, message: '请填写医嘱内容' }]
- },
- form: {
- id: 0,
- advice_type: 2,
- 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,
- drug_id:0,
- drug_name_id:0,
- way: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
- },
- groupForm: {
- advice_type: 2,
- advice_date: '',
- start_time: '',
- adviceNames: [],
- advice_doctor: '',
- remark: '',
- parent_id: 0
- },
- adviceList: [],
- currentIndex: -1,
- currentRow: null,
- groupSelectRow: null,
-
- templateForm: { id: '' },
- doctorAdvices: [],
- patientid: '',
- drugSpec:[],
- medicals:[],
- all_drug:[],
- current_drug_name:"",
- current_drug_spec: "",
- drug_id: 0,
- src_type:"",
- org_id:0,
- schedulePatient:{},
- tempArrOne:[],
- doctor_advices_one:[]
- }
- },
- watch: {
- 'assessment_after_dislysis.id': function() {
- if (this.assessment_after_dislysis.id > 0) {
- for (var index in this.form) {
- this.form[index] = this.assessment_after_dislysis[index]
- }
- }
- },
- 'dialysis_order.id': function() {
- this.form['dialysis_order_id'] = this.dialysis_order.id
- },
-
- 'doctor_advices': function() {
-
- this.handleSpanTempArrOne();
- },
-
- },
- methods: {
- handleSpanTempArrOne() {
- this.tempArrOne = [];
-
- for (let i = 0; i < this.doctor_advices.length; i++) {
- if (i === 0) {
- this.tempArrOne.push(1);
- this.pos = 0;
- } else {
- // 判断当前元素与上一个元素是否相同
- if (
- this.doctor_advices[i].groupno ===
- this.doctor_advices[i - 1].groupno
- ) {
- this.tempArrOne[this.pos] += 1;
- this.tempArrOne.push(0);
- } else {
- this.tempArrOne.push(1);
- this.pos = i;
- }
- }
- }
- },
- handleSelectionChange(){
-
- },
-
-
- //调试
- lili(index,row){
- // console.log("==index==",index)
- // console.log("==row==",row)
- console.log("==doctor_advices==",this.doctor_advices)
- console.log("==this.form==",this.form)
- },
- getContent: function() {
- if (this.sch != null) {
- var date = uParseTime(this.sch.schedule_date, '{y}-{m}-{d}')
- var week = ''
- var sch_type = ''
-
- switch (this.sch.schedule_week) {
- case 1:
- week = '周一'
- break
- case 2:
- week = '周二'
-
- break
- case 3:
- week = '周三'
-
- break
- case 4:
- week = '周四'
-
- break
- case 5:
- week = '周五'
-
- break
- case 6:
- week = '周六'
-
- break
- case 7:
- week = '周日'
- break
- }
- switch (this.sch.schedule_type) {
- case 1:
- sch_type = '上午'
- break
- case 2:
- sch_type = '下午'
-
- break
- case 3:
- sch_type = '晚上'
-
- break
- }
- return date + '(' + week + '/' + sch_type + ')'
- } else {
-
- return ''
-
- }
-
- },
- // 上一方
- AddNewAdvice(name) {
- for(let i=0;i<this.other_doctor_advices.length;i++){
- this.other_doctor_advices[i].single_dose = this.other_doctor_advices[i].single_dose.toString()
- this.other_doctor_advices[i].prescribing_number = this.other_doctor_advices[i].prescribing_number.toString()
- }
- this.$refs[name].validate(valid => {
- if (valid) {
- var submitForm = {
- advice_type: 2,
- advice_date: this.record_date,
- start_time: this.adForm.other_start_time,
- adviceNames: this.other_doctor_advices,
- remark: ''
- }
-
- let mode = '1'
- CreateGroupAdvice(this.patientid, 0, submitForm, mode).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "新增成功",
- type: "success",
- duration: 2000
- });
- this.$refs[name].resetFields();
- this.isLastOrNextVisible = false;
- this.$parent.$parent.getScheduleDetail()
- return false;
- }
- }
- );
- }
- });
-
- },
-
- // isPermission () {
- // if(this.$store.getters.xt_user.user.user_type == 3 ) {
- // return false
- // } else {
- // return true
- // }
- // },
- adviceNameShow({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 2) {
- return 'dialysisadvicenamedisplay'
- } else {
- return ''
- }
- },
-
- submitEditAdvice() {
- // console.log()
- console.log("保存22222222222222")
- console.log("==this.src_type==",this.src_type)
- if (this.form.advice_name.length == 0) {
- this.$message.error('请填写医嘱名称')
- return
- }
- if (this.form.start_time.length == 0) {
- this.$message.error('请选择开始时间')
- return
- }
- if (!(this.patient.id > 0)) {
- this.$message.error('没有选择患者')
- return false
- }
-
- let mode = '2'
- if (this.form.advice_doctor != this.$store.getters.xt_user.user.id) {
- mode = '3'
- }
- EditDoctorAdvice(this.patient.id, this.form.id, this.form, mode).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '修改医嘱成功',
- type: 'success',
- duration: 2000
- })
-
- this.showAdviceForm = false
- this.showAdvicePanel = true
- var advice = response.data.data.advice
- var single_dose_unit = ""
- if(advice.single_dose_unit > 0){
- single_dose_unit = this.getUnit(advice.single_dose_unit)
- }else{
- single_dose_unit = advice.single_dose_unit
- }
- this.doctor_advices[this.currentIndex].drug_spec = advice.drug_spec
- this.doctor_advices[this.currentIndex].drug_spec_unit =
- advice.drug_spec_unit
- this.doctor_advices[this.currentIndex].start_time =
- advice.start_time
- this.doctor_advices[this.currentIndex].advice_name =
- advice.advice_name
- this.doctor_advices[this.currentIndex].advice_desc =
- advice.advice_desc
- this.doctor_advices[this.currentIndex].single_dose =
- advice.single_dose
- this.doctor_advices[this.currentIndex].single_dose_unit = single_dose_unit
- this.doctor_advices[this.currentIndex].delivery_way =
- advice.delivery_way
- this.doctor_advices[this.currentIndex].execution_frequency =
- advice.execution_frequency
- this.doctor_advices[this.currentIndex].prescribing_number =
- advice.prescribing_number
- this.doctor_advices[this.currentIndex].prescribing_number_unit =
- advice.prescribing_number_unit
- this.doctor_advices[this.currentIndex].advice_doctor =
- advice.advice_doctor
- this.doctor_advices[this.currentIndex].remark = advice.remark
- this.doctor_advice[this.currentIndex].drug_id = advice.drug_id
- this.doctor_advice[this.currentIndex].drug_name_id = advice.drug_name_id
- this.doctor.advice[this.currentIndex].way = advice.way
- this.currentIndex = -1
- return false
- }
- }
- )
- }
- ,
-
- // submitGroupAdvice() {
- // if (this.groupForm.start_time.length == 0) {
- // this.$message.error('请选择开始时间')
- // return
- // }
- // CreateGroupAdvice(this.patient.id, this.groupForm).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.currentIndex = -1
- // this.currentRow = null
- // this.setCurrent()
- // this.hideGroupForm()
- // for (const index in response.data.data.advices) {
- // this.doctor_advices.unshift(response.data.data.advices[index])
- // }
- // this.groupForm = {
- // advice_type: 2,
- // advice_date: '',
- // start_time: '',
- // adviceNames: [],
- // advice_doctor: '',
- // remark: '',
- // parent_id: 0
- // }
- // return false
- // }
- // })
- // },
- // submitTempForm() {
- // var _this = this
- // if (this.templateForm.id.length == 0) {
- // this.$message.error('请选择医嘱模板')
- // return
- // }
- // if (_this.templateForm.id in _this.adviceTemplateMaps) {
- // var mapid = _this.templateForm.id
- // for (const index in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
- // var item = {
- // advice_name: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
- // 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,
- // isEdit: 0,
- // index: 0
- // }
- // _this.groupForm.adviceNames.push(item)
- // }
- // }
- // this.title = '新增医嘱'
- // this.showTemplateForm = false
- // this.showGroupForm = true
- // },
- openAdviceTemplate() {
- this.templateForm = { id: '' }
- this.title = '选择医嘱模板'
- this.showTemplateForm = true
- this.showGroupForm = false
- }
- ,
- submitNameForm() {
- if (this.nameForm.advice_name.length == 0) {
- this.$message.error('请填写医嘱名称')
- return
- }
- if (this.nameForm.isEdit) {
- this.groupForm.adviceNames[
- this.nameForm.index
- ].advice_name = this.nameForm.advice_name
- this.groupForm.adviceNames[
- this.nameForm.index
- ].single_dose = this.nameForm.single_dose
- this.groupForm.adviceNames[
- this.nameForm.index
- ].single_dose_unit = this.nameForm.single_dose_unit
- this.groupForm.adviceNames[
- this.nameForm.index
- ].drug_spec = this.nameForm.drug_spec
- this.groupForm.adviceNames[
- this.nameForm.index
- ].drug_spec_unit = this.nameForm.drug_spec_unit
- this.groupForm.adviceNames[
- this.nameForm.index
- ].prescribing_number = this.nameForm.prescribing_number
- this.groupForm.adviceNames[
- this.nameForm.index
- ].prescribing_number_unit = this.nameForm.prescribing_number_unit
- this.groupForm.adviceNames[
- this.nameForm.index
- ].delivery_way = this.nameForm.delivery_way
- this.groupForm.adviceNames[this.nameForm.index].execution_frequency = this.nameForm.execution_frequency
- this.groupForm.adviceNames[this.nameForm.index].drug_name_id = this.nameForm.drug_name_id
- this.groupForm.adviceNames[this.nameForm.index].way = this.nameForm.way
- this.groupForm.adviceNames[this.nameForm.index].drug_id = this.nameForm.drug_id
- } else {
- this.groupForm.adviceNames.push(this.nameForm)
- }
-
- this.title = '新增医嘱'
- this.showNameForm = false
- this.showGroupForm = true
- }
- ,
- groupClassName({ row, rowIndex }) {
- row.index = rowIndex
- }
- ,
- selectGroupAdvice(row) {
- this.groupSelectRow = row
- }
- ,
- openDeleteGroupAdvice(val) {
- if(this.currentRow.is_medicine == 1){
- this.$message.error('已发药,不可删除')
- return
- }
- if (this.groupSelectRow === null) {
- this.$message.error('未选择要删除的医嘱内容')
- return
- }
- if(this.groupSelectRow!=null){
- if(this.groupSelectRow.origin == 2){
- this.$message.error('处方医嘱不能删除')
- return
- }
- }
- if(this.groupSelectRow.execution_state == 1){
- this.$message.error("已执行的医嘱无法删除!")
- return
- }
- this.DeleteGroupAdvice(this.groupSelectRow.groupno)
-
- // this.$confirm('确认删除些条医嘱内容?', '删除医嘱内容', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning'
- // }).then(() => {
- // this.groupForm.adviceNames.splice(this.groupSelectRow.index, 1);
- // }).catch(() => {
- // });
- }
- ,
- openAdviceName(isEdit) {
- if (isEdit) {
- if (this.groupSelectRow === null) {
- this.$message.error('未选择要修改的医嘱内容')
-
- return
- }
-
- this.nameForm = {
- advice_name: this.groupSelectRow.advice_name,
- 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.groupSelectRow.delivery_way,
- execution_frequency: this.groupSelectRow.execution_frequency,
-
- isEdit: 1,
- index: this.groupSelectRow.index
- }
-
- } else {
- this.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
- }
- }
-
- this.title = '新增医嘱内容'
- this.showNameForm = true
- this.showGroupForm = false
- }
- ,
- tableRowClassName({ row, rowIndex }) {
- // if (row.stop_state == 1 || row.execution_state == 1) {
- // return 'stoped-row';
- // }
- // return 'success-rows'
- row.index = rowIndex
- const arr = this.hoverOrderArr
- for (let i = 0; i < arr.length; i++) {
- if (rowIndex == arr[i]) {
- return 'success-row'
- }
- }
- }
- ,
- changeAdviceName(key) {
- if (key in this.adviceTemplateMaps) {
- this.form.advice_name = this.adviceTemplateMaps[key].advice_name
- this.form.advice_desc = this.adviceTemplateMaps[key].advice_desc
- this.form.single_dose_unit = this.adviceTemplateMaps[
- key
- ].single_dose_unit
- this.form.single_dose = this.adviceTemplateMaps[key].single_dose + ''
- this.form.prescribing_number_unit = this.adviceTemplateMaps[
- key
- ].prescribing_number_unit
- this.form.prescribing_number =
- this.adviceTemplateMaps[key].prescribing_number + ''
- this.form.delivery_way = this.adviceTemplateMaps[key].delivery_way
- this.form.execution_frequency = this.adviceTemplateMaps[key].execution_frequency
- this.form.drug_name_id = this.adviceTemplateMaps[key].drug_name_id
- this.form.drug_id = this.adviceTemplateMaps[key].drug_id
- this.form.way = this.adviceTemplateMaps[key].way
- }
- }
- ,
- submitExce() {
-
- if (this.currentRow == null) {
- this.$message.error('请先选择要执行的医嘱!')
- return false
- }
- if (this.execTime.length == 0) {
- this.$message.error('请选择执行时间!')
- return false
- }
-
- var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
- if (execTime < this.currentRow.start_time) {
- this.$message.error('执行医嘱不能在开始之前!')
- return false
- }
- this.exceLoading = true
- let mode = '6'
-
-
- ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode,this.currentRow.origin).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- this.exceLoading = false
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '执行医嘱成功',
- type: 'success',
- duration: 2000
- })
- var msg = response.data.data.msg
- if(msg == 1){
- var exid = response.data.data.advice.id
- if (response.data.data.advice.parent_id > 0) {
- exid = response.data.data.advice.parent_id
- }
-
- this.currentRow.execution_state = 1
- this.currentRow.execution_staff =
- response.data.data.advice.execution_staff
- this.currentRow.execution_time =
- response.data.data.advice.execution_time
- var alen = this.doctor_advices.length
-
- for (var index in this.doctor_advices) {
- if (
- this.doctor_advices[index].id == exid ||
- this.doctor_advices[index].parent_id == exid
- ) {
- this.doctor_advices[index].execution_state = 1
- this.doctor_advices[index].execution_staff =
- response.data.data.advice.execution_staff
- this.doctor_advices[index].execution_time =
- response.data.data.advice.execution_time
- // this.doctor_advices[index].checker = response.data.data.advice.checker;
- break
- }
- }
- this.execTimeDialogVisible = false
-
- return false
- }
-
- if(msg == 2){
- this.$message.error("执行失败,库存不足,请入库")
- this.execTimeDialogVisible = false
- return false
- }
- if(msg == 3){
- this.$message.error("执行失败,无库存,请入库")
- this.execTimeDialogVisible = false
- return false
- }
-
- if(msg == 6){
- this.$message.error("执行失败,请重新执行")
- this.execTimeDialogVisible = false
- return false
- }
-
- }
- })
- .catch(() => {
- this.exceLoading = false
- })
- }
- ,
- submitAdvice() {
- if (this.form.advice_name.length == 0) {
- this.$message.error('请填写医嘱名称')
- return
- }
- if (this.form.start_time.length == 0) {
- this.$message.error('请选择开始时间')
- return
- }
- if (!(this.patient.id > 0)) {
- this.$message.error('没有选择患者')
- return false
- }
- let mode = '1'
- // console.log("sry2332322332",this.src_type)
- if(this.src_type == ""){
- this.form.way = 1
- }
-
- if(this.src_type == 2){ //自备药
- var arr = this.form.advice_name.split("(自备药)")
- this.form.advice_name = arr[0]
- }
-
- CreateDoctorAdvice(this.patient.id, this.form, mode).then(response => {
- this.loading = false
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '新增医嘱成功',
- type: 'success',
- duration: 2000
- })
-
- this.currentIndex = -1
- this.currentRow = null
- this.setCurrent()
- this.hideForm()
-
-
- if (this.form.parent_id > 0) {
- var spliceIndex = -1
- for (let index = this.doctor_advices.length - 1; ; index--) {
- if (this.doctor_advices[index].parent_id === this.form.parent_id) {
- spliceIndex = index
- break
- } else if (this.doctor_advices[index].id === this.form.parent_id) {
- spliceIndex = index
- break
- }
- }
-
- if (spliceIndex > -1) {
- spliceIndex += 1
- if (spliceIndex === this.doctor_advices.length) {
- this.doctor_advices.push(response.data.data.advice)
- } else {
- var swapData = this.doctor_advices.splice(spliceIndex)
- this.doctor_advices.push(response.data.data.advice)
- for (var index in swapData) {
- this.doctor_advices.push(swapData[index])
- }
- }
-
-
- }
- } else {
- this.doctor_advices.unshift(response.data.data.advice)
- }
- return false
- }
- }).catch(v => {
- this.loading = false
- })
- // location. reload()
- // this.getDialysisScheduleDetail()
-
- }
- ,
- openNewChildTwo(index, row) {
- if(this.currentRow.is_medicine == 1){
- this.$message.error('已发药,不可操作')
- return
- }
- this.currentRow = row
- if (this.currentRow == null) {
- this.$message.error('请先选择要新增子药的医嘱!')
- return false
- }
- if (
- this.currentRow.stop_state == 1 ||
- this.currentRow.execution_state == 1
- ) {
- this.$message.error('所选医嘱已停止或执行')
- return false
- }
-
- this.title = '新增子药'
- this.showAdviceForm = true
- this.showAdvicePanel = false
-
- this.form = {
- id: 0,
- advice_type: 2,
- advice_date: this.record_date,
- start_time: uParseTime(
- this.currentRow.start_time,
- '{y}-{m}-{d} {h}:{i}'
- ),
- advice_name: '',
- drug_spec: '',
- drug_spec_unit: '',
- single_dose: '',
- single_dose_unit: '',
- prescribing_number: '',
- prescribing_number_unit: '',
- delivery_way: this.currentRow.delivery_way,
- execution_frequency: this.currentRow.execution_frequency,
- advice_doctor: '',
- remark: '',
- parent_id: this.currentRow.id,
- drug_id:0,
- drug_name_id:0,
- way:0,
- }
- }
- ,
-
- openNewChild() {
- if (this.currentRow == null) {
- this.$message.error('请先选择要新增子药的医嘱!')
- return false
- }
- if (
- this.currentRow.stop_state == 1 ||
- this.currentRow.execution_state == 1
- ) {
- this.$message.error('所选医嘱已停止或执行')
- return false
- }
-
- this.title = '新增子药'
- this.showAdviceForm = true
- this.showAdvicePanel = false
-
- this.form = {
- id: 0,
- advice_type: 2,
- advice_date: this.record_date,
- start_time: uParseTime(
- this.currentRow.start_time,
- '{y}-{m}-{d} {h}:{i}'
- ),
- advice_name: '',
- drug_spec: '',
- drug_spec_unit: '',
- single_dose: '',
- single_dose_unit: '',
- prescribing_number: '',
- prescribing_number_unit: '',
- delivery_way: this.currentRow.delivery_way,
- execution_frequency: this.currentRow.execution_frequency,
- advice_doctor: '',
- remark: '',
- parent_id: this.currentRow.id
- }
- }
- ,
-
- openEdit(index, row) {
- console.log("lilili",this.currentRow)
- if(this.currentRow.is_medicine == 1){
- this.$message.error('已发药不可修改')
- return
- }
- if (row.stop_state == 1 || row.execution_state == 1) {
- this.$message.error('所选医嘱已停止或执行')
- return false
- }
-
- this.title = row.parent_id > 0 ? '编辑子药' : '编辑医嘱'
- this.showAdviceForm = true
- this.showAdvicePanel = false
- this.currentIndex = index
-
- this.form = {
- id: row.id,
- advice_type: 2,
- advice_date: uParseTime(row.advice_date, '{y}-{m}-{d}'),
- start_time: uParseTime(row.start_time, '{y}-{m}-{d} {h}:{i}'),
- advice_desc: row.advice_desc,
- advice_name: row.advice_name,
- 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,
- parent_id: row.parent_id,
- drug_id:row.drug_id,
- way:row.way,
- drug_name_id:0,
- }
- }
- ,
-
- openEditGroupAdvice() {
- console.log("thissssss",this.currentRow)
- if(this.currentRow.is_medicine == 1){
- this.$message.error('已发药不可修改')
- return
- }
- if (this.groupSelectRow === null) {
- this.$message.error('未选择要修改的医嘱内容')
- return
- }
- if(this.groupSelectRow!=null){
- if(this.groupSelectRow.origin == 2){
- this.$message.error("处方医嘱不能修改")
- return
- }
- }
- this.$refs.editGroupForm.open(this.groupSelectRow.groupno)
- }
- ,
-
- openGroupFrom() {
-
- this.$refs.addGroupForm.open()
-
- // this.title="新增医嘱";
-
- // this.showGroupForm = true;
- // this.showAdviceForm = false;
- // this.showAdvicePanel = false;
- // this.$refs.advices_list.setCurrentRow(null);
-
- // this.currentIndex = -1;
- // this.currentRow = null;
-
- // this.groupForm.advice_date = this.record_date;
- // this.form = {
- // id: 0,
- // advice_type: 2,
- // advice_date: this.record_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
- // };
- }
- ,
- checkAdvice() {
- if (this.currentRow == null) {
- this.$message.error('请先选择要核对的医嘱!')
- return false
- }
- if (this.currentRow.check_state == 1) {
- this.$message.error('所选医嘱已核对')
- return false
- }
-
- if (
- this.currentRow.execution_staff > 0 &&
- this.currentRow.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
- let mode = '7'
-
- CheckDoctorAdvice(this.patient.id, this.currentRow.id, mode,this.currentRow.origin).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- this.deleLoading = false
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '核对成功',
- type: 'success',
- duration: 2000
- })
-
- var exid = response.data.data.advice.id
- if (response.data.data.advice.parent_id > 0) {
- exid = response.data.data.advice.parent_id
- }
- // if (this.currentRow.parent_id > 0) {
- // exid = this.currentRow.parent_id;
- // }
- this.currentRow.check_state = 1
- this.currentRow.check_time =
- response.data.data.advice.check_time
- this.currentRow.checker = response.data.data.advice.checker
- var alen = this.doctor_advices.length
-
- for (var index in this.doctor_advices) {
- if (
- this.doctor_advices[index].id == exid ||
- this.doctor_advices[index].parent_id == exid
- ) {
- this.doctor_advices[index].check_state = 1
- this.doctor_advices[index].check_time =
- response.data.data.advice.check_time
- this.doctor_advices[index].checker =
- response.data.data.advice.checker
- // break;
- }
- }
-
- this.deleLoading = false
- }
- }
- )
- })
- .catch(() => {
- this.deleLoading = false
- })
- }
- ,
- execAdvice() {
-
- if (this.is_has_exce == false) {
- this.$message.error('你没有执行医嘱的权限')
- return false
- }
- // if(this.org_id == 9671){
- // if(this.currentRow.checker == 0){
- // this.$message.error("请先核对医嘱")
- // return
- // }
- // }
- this.execTimeDialogVisible = true
- if (this.current_select_object == 1) {
- var isExecution = true
- var adviceArr = this.advice_groups[this.current_group_index].advices
- for (let i = 0; i < adviceArr.length; i++) {
- if (
- adviceArr[i].execution_state == 2 &&
- adviceArr[i].is_selected == 1
- ) {
- isExecution = false
- }
- }
- if (isExecution) {
- this.$message.error('所选医嘱已停止或执行')
- return false
- }
- for (let i = 0; i < adviceArr.length; i++) {
- if (
- adviceArr[i].is_selected == 1 &&
- adviceArr[i].checker > 0 &&
- adviceArr[i].checker == this.$store.getters.user.admin.id
- ) {
- this.$message.error('核对医嘱与执行不能是同一人')
- return false
- }
- }
- var currentAdviceIdArr = []
- for (let i = 0; i < adviceArr.length; i++) {
- if (adviceArr[i].is_selected == 1) {
- currentAdviceIdArr.push(adviceArr[i].id)
- }
- }
- this.currentAdviceIdsStr = currentAdviceIdArr.join(',')
- this.nowExecTime = new Date(adviceArr[0].start_time * 1000)
- } else {
- if (!(this.current_group_index >= 0 && this.current_advice_index < 0)) {
- return
- }
- var isExecution = true
- var group_top_advice = this.advice_groups[this.current_group_index]
- .advices[0]
-
- var adviceArr = this.advice_groups[this.current_group_index].advices
- for (let i = 0; i < adviceArr.length; i++) {
- if (
- adviceArr[i].is_selected == 1 &&
- adviceArr[i].execution_state == 2
- ) {
- isExecution = false
- }
- }
- if (isExecution) {
- this.$message.error('所选医嘱已停止或执行')
- return false
- }
-
- for (let i = 0; i < adviceArr.length; i++) {
- if (
- adviceArr[i].is_selected == 1 &&
- adviceArr[i].checker > 0 &&
- adviceArr[i].checker == this.$store.getters.user.admin.id
- ) {
- this.$message.error('核对与执行不能是同一人')
- return false
- }
- }
-
- this.nowExecTime = new Date(group_top_advice.start_time * 1000)
- }
- this.$refs.exec_time.open()
- // if (this.currentRow == null) {
- // this.$message.error("请先选择要执行的医嘱!");
- // return false;
- // }
- //
- // if (
- // this.currentRow.stop_state == 1 ||
- // this.currentRow.execution_state == 1
- // ) {
- // this.$message.error("所选医嘱已停止或执行");
- // return false;
- // }
- //
- // if (
- // this.currentRow.checker > 0 &&
- // this.currentRow.checker == this.$store.getters.xt_user.user.id
- // ) {
- // this.$message.error("核对与执行不能是同一人");
- // return false;
- // }
- //
- // this.execTimeDialogVisible = true;
- // this.deleLoading = true;
- }
- ,
-
- DeleteGroupAdvice(groupno) {
- this.$confirm('确认删除这组医嘱?', '医嘱删除', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
-
- let mode = '4'
- if (
- this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id
- ) {
- mode = '5'
- }
- DeleteGroupAdvice(groupno, mode).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '医嘱已经删除',
- type: 'success',
- duration: 2000
- })
-
- var alen = this.doctor_advices.length
- for (let index = alen - 1; index >= 0; index--) {
- if (this.doctor_advices[index].groupno === groupno) {
- this.doctor_advices.splice(index, 1)
- }
- }
- }
- })
- })
- .catch(() => {
- })
- }
- ,
- openDelete(index, row) {
- if(this.currentRow.is_medicine == 1){
- this.$message.error('已发药不可删除')
- return
- }
- this.currentRow = row
- this.$confirm('确认删除此条医嘱?', '医嘱删除', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- closeOnClickModal: false,
- type: 'warning'
- })
- .then(() => {
- this.deleLoading = true
-
- let mode = '4'
- if (
- this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id
- ) {
- mode = '5'
- }
-
- DeleteDoctorAdvice(this.currentRow.id, mode).then(response => {
- this.deleLoading = false
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '医嘱已经删除',
- type: 'success',
- duration: 2000
- })
- this.deleteResetData(this.currentRow)
- this.currentRow = null
- this.setCurrent()
- }
- })
- })
- .catch(() => {
- this.deleLoading = false
- })
- }
- ,
- deleteAdvice() {
- if (this.currentRow == null) {
- this.$message.error('请先选择要删除的医嘱!')
- return false
- }
- this.$confirm('确认删除此条医嘱?', '医嘱删除', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- closeOnClickModal: false,
- type: 'warning'
- })
- .then(() => {
- this.deleLoading = true
- let mode = '4'
- if (
- this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id
- ) {
- mode = '5'
- }
- DeleteDoctorAdvice(this.currentRow.id, mode).then(response => {
- this.deleLoading = false
- if (response.data.state == 0) {
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '医嘱已经删除',
- type: 'success',
- duration: 2000
- })
- this.deleteResetData(this.currentRow)
- this.currentRow = null
- this.setCurrent()
- }
- })
- })
- .catch(() => {
- this.deleLoading = false
- })
- }
- ,
-
- deleteResetData(row) {
- if (row.parent_id > 0) {
- for (var index in this.doctor_advices) {
- if (this.doctor_advices[index].id == row.id) {
- this.doctor_advices.splice(index, 1)
- break
- }
- }
- } else {
- var spliceIndex = -1
- var splitNums = 0
- for (var index in this.doctor_advices) {
- if (this.doctor_advices[index].id == row.id) {
- spliceIndex = index
- splitNums++
- } else if (this.doctor_advices[index].parent_id == row.id) {
- splitNums++
- }
- }
- this.doctor_advices.splice(spliceIndex, splitNums)
- }
- }
- ,
- selectRow(row) {
- this.currentRow = row
- }
- ,
- 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
- )
- }
- }
- })
- }
- ,
- getXuserName(id) {
- if (id <= 0) {
- return ''
- }
- var name = ''
- if (
- this.admin_users == null ||
- typeof this.admin_users.length === 'undefined'
- ) {
- return name
- }
- var leng = this.admin_users.length
- if (leng == 0) {
- return name
- }
- for (let index = 0; index < leng; index++) {
- if (this.admin_users[index].id == id) {
- name = this.admin_users[index].name
- break
- }
- }
- return name
- }
- ,
- addNewOrder() {
- this.$refs.addGroupForm.open()
- }
- ,
- show(his_is_open,is_advice_open) {
-
- var childMap = {}
- for (const index in this.doctor_advices) {
- if (this.doctor_advices[index].parent_id == 0) {
- continue
- }
- if (!(this.doctor_advices[index].parent_id in childMap)) {
- childMap[this.doctor_advices[index].parent_id] = []
- }
- childMap[this.doctor_advices[index].parent_id].push(this.doctor_advices[index])
- }
-
- var advices = [];
- for (const index in this.doctor_advices) {
- if (this.doctor_advices[index].parent_id > 0) {
- continue;
- }
- var item = this.doctor_advices[index];
- if (item.id in childMap) {
- item.children = childMap[item.id];
- } else {
- item.children = [];
- }
- advices.push(item);
- }
-
-
- console.log("我的世纪东方",advices)
- this.doctor_advices_one = []
- this.doctor_advices_one = advices
-
- this.his_is_open = his_is_open
- this.is_advice_open = is_advice_open
- this.isVisibility = true
- this.getPermission()
-
-
- }
- ,
- hide() {
- this.isVisibility = false
- }
- ,
- hideForm() {
- this.title = '临时医嘱'
- this.showGroupForm = false
- this.showAdviceForm = false
- this.showAdvicePanel = true
- }
- ,
- hideNameForm() {
- this.title = '新增医嘱'
- this.showGroupForm = true
- this.showNameForm = false
- }
- ,
- hideTemplateForm() {
- this.title = '新增医嘱'
- this.showGroupForm = true
- this.showTemplateForm = false
- }
- ,
- hideGroupForm() {
- this.title = '临时医嘱'
- this.showAdviceForm = false
- this.showGroupForm = false
- this.showAdvicePanel = true
- }
- ,
- resetDialog() {
- this.hoverOrderArr = []
- this.title = '临时医嘱'
- this.showAdviceForm = false
- this.showGroupForm = false
- this.showAdvicePanel = true
- this.currentRow = null
- this.groupSelectRow = null
- this.setCurrent()
- }
- ,
- closeTimePanel() {
- this.execTimeDialogVisible = false
- this.deleLoading = false
- this.exceLoading = false
- this.execTime = ''
- }
- ,
- setCurrent(row) {
- this.$refs.advices_list.setCurrentRow(row)
- }
- ,
- isShowStartTime(index, row) {
- if (row.parent_id > 0) {
- return false
- } else if (
- index > 0 &&
- row.groupno > 0 &&
- row.groupno == this.doctor_advices[index - 1].groupno
- ) {
- return false
- }
- return true
- }
- ,
- mergeSpan({ row, column, rowIndex, columnIndex }) {
- if (columnIndex != 2) {
- const _row = this.tempArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- }
- ,
- handleSpanTempArr() {
- this.tempArr = []
-
- for (let i = 0; i < this.doctor_advices.length; i++) {
- if (i === 0) {
- this.tempArr.push(1)
- this.pos = 0
- } else {
- // 判断当前元素与上一个元素是否相同
- if (
- this.doctor_advices[i].created_time ===
- this.doctor_advices[i - 1].created_time
- ) {
- this.tempArr[this.pos] += 1
- this.tempArr.push(0)
- } else {
- this.tempArr.push(1)
- this.pos = i
- }
- }
- }
- },
- cellMouseEnter: function(row, column, event) {
- console.log("row323323322323233232",row)
- this.currentRow = row
- this.groupSelectRow = row
- // this.sameRowArr.forEach((arr, i) => {
- // if (arr.indexOf(row.index) != -1) {
- // this.hoverOrderArr = arr
- // }
- // })
- }
- ,
- cellMouseLeave: function(row, column, cell, event) {
- this.hoverOrderArr = []
- }
- ,
- handleStyle() {
- let sameRowArr = [],
- sIdx = 0
-
- this.doctor_advices.forEach((item, index) => {
- item.index = index
- if (index === 0) {
- sameRowArr.push([index])
- } else {
- if (item.created_time === this.doctor_advices[index - 1].created_time) {
- sameRowArr[sIdx].push(index)
- } else {
- sIdx = sIdx + 1
- sameRowArr.push([index])
- }
- }
- })
-
- this.sameRowArr = sameRowArr
- }
- ,
- getAdviceContent(row, isChild) {
- // alert("来")
- console.log("this.doctor_advices",this.doctor_advices)
- console.log("row",row)
- console.log("isChild",isChild)
- let tempSingleDoseDesc = ''
- let tempDrugSpecDesc = ''
- let tempPrescribingNumberDesc = ''
-
- if (row.prescribing_number) {
- tempPrescribingNumberDesc = row.prescribing_number + '' + row.prescribing_number_unit
- }
-
- if(this.org_id == 10188 ){
- tempPrescribingNumberDesc = ""
- }
-
- if (row.single_dose) {
- if (this.template_id != 6) {
- tempSingleDoseDesc =' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
- } else {
- tempSingleDoseDesc = row.single_dose + '' + row.single_dose_unit
- }
- }
-
- if (row.advice_desc) {
- tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')' + " " + row.remark
- }
- if (isChild == 1) {
- // 不是子药
- return (
- row.advice_name +
- tempDrugSpecDesc +
- ' ' +
- tempPrescribingNumberDesc +
- tempSingleDoseDesc +
- ' ' +
- row.delivery_way +
- ' ' +
- row.execution_frequency
- )
- } else {
- // 是子药
- return (row.advice_name +tempDrugSpecDesc +' ' +tempPrescribingNumberDesc + tempSingleDoseDesc
- )
- }
- },
-
- getAdviceContentOne(row, isChild) {
- // alert("来")
- console.log("row",row)
- let tempSingleDoseDesc = ''
- let tempDrugSpecDesc = ''
- let tempPrescribingNumberDesc = ''
-
- if (row.prescribing_number) {
- tempPrescribingNumberDesc = row.prescribing_number + '' + row.prescribing_number_unit
- }
-
- if(this.org_id == 10188 ){
- tempPrescribingNumberDesc = ""
- }
-
- if (row.single_dose) {
- if (this.template_id != 6) {
- tempSingleDoseDesc =' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
- } else {
- tempSingleDoseDesc = row.single_dose + '' + row.single_dose_unit
- }
- }
-
- if (row.advice_desc) {
- tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')' + " " + row.remark
- }
-
- return row.advice_name +tempDrugSpecDesc +' ' +tempPrescribingNumberDesc + tempSingleDoseDesc
- },
- getPermission() {
- request
- .get('/api/func_per/get', {
- params: {
- create_url: '/api/patients/advice/creategroup?mode=1',
- modify_url: '/api/patients/advice/edit?mode=2',
- modify_other_url: '/api/patients/advice/edit?mode=3',
- del_url: '/api/patients/advice/delete?mode=4',
- del_other_url: '/api/patients/advice/delete?mode=5',
- exce_url: '/api/patients/advice/exec?mode=6',
- check_url: '/api/patients/advice/check?mode=7',
- module: 4
- }
- }).then(res => {
- if (res.data.state == 0) {
- this.hasPermission = false
- } else if (res.data.state == 1) {
- this.is_has_create = res.data.data.is_has_create
- this.is_has_exce = res.data.data.is_has_exce
- this.is_has_check = res.data.data.is_has_check
- this.is_has_modify = res.data.data.is_has_modify
- this.is_has_modify_other = res.data.data.is_has_modify_other
- this.is_has_modify_exce = res.data.data.is_has_modify_exce
- this.is_has_del = res.data.data.is_has_del
- this.is_has_del_other = res.data.data.is_has_del_other
- }
- })
- }
- ,
- arraySpanMethod({ row, column, rowIndex, columnIndex }) {
- if (rowIndex % 2 === 0) {
- if (columnIndex === 0) {
- return [1, 2]
- } else if (columnIndex === 1) {
- return [0, 0]
- }
- }
- }
- ,
- handleCurrentChange(row) {
-
- this.currentRow = row;
- // this.groupSelectRow = row;
- // this.sameRowArr.forEach((arr, i) => {
- // if (arr.indexOf(row.index) != -1) {
- // this.hoverOrderArr = arr;
- // }
- // });
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-
- if (columnIndex === 0) {
- if (rowIndex % 2 === 0) {
- return {
- rowspan: 2,
- colspan: 1
- }
- } else {
- return {
- rowspan: 0,
- colspan: 0
- }
- }
- }
-
- if (columnIndex === 1) {
- if (rowIndex % 2 === 0) {
- return {
- rowspan: 2,
- colspan: 1
- }
- } else {
- return {
- rowspan: 0,
- colspan: 0
- }
- }
- }
- }
- ,
- GetLastOrNextDoctorAdvice(params) {
- GetLastOrNextDoctorAdvice(params).then(response => {
- if (response.data.state == 1) {
-
- var doctor_advices = response.data.data.advices
-
- this.other_doctor_advices = doctor_advices
- this.request_record_date = uParseTime(this.other_doctor_advices[0].record_date, '{y}-{m}-{d}')
- this.sch = response.data.data.schedule
- } else {
- this.$message.error(response.data.msg)
-
- }
- })
-
- },
- getDialysisScheduleDetail() {
- if(this.$route.query.showView && this.$route.query.showView == true){
- return
- }
- getDialysisScheduleDetail(this.patientid, this.record_date).then(response => {
- if (response.data.state == 1) {
- this.doctor_advices = []
- var doctor_advices = response.data.data.doctor_advices
- this.doctorAdvices = doctor_advices
- if(doctor_advices !=undefined && doctor_advices.length > 0){
- for(let i=0;i<doctor_advices.length;i++){
- doctor_advices[i]['origin'] = 1
- this.doctor_advices.push(doctor_advices[i])
- }
- }
- var his_advices = response.data.data.his_advices
- if(his_advices!=undefined && his_advices.length > 0){
- for(let i=0;i<his_advices.length;i++){
- his_advices[i]['origin'] = 2
- this.doctor_advices.push(his_advices[i])
- }
- }
- this.currentIndex = -1
- this.currentRow = null
- this.setCurrent()
- this.hideForm()
-
- }
- })
- }
- ,
- openLast(val) {
- if (val == 1) {
- this.isLastOrNextVisible = true
- this.isVisibility = false
- this.request_record_date = this.record_date
-
- let params = {
- patient_id: this.patientid,
- record_time: this.request_record_date,
- type: 1
- }
-
- this.GetLastOrNextDoctorAdvice(params)
- } else if (val == 3) {
-
- let params = {
- patient_id: this.patientid,
- record_time: this.request_record_date,
- type: 1
- }
-
- this.GetLastOrNextDoctorAdvice(params)
-
- }
- },
- openNext(val) {
- if (val == 2) {
- this.isLastOrNextVisible = true
- this.isVisibility = false
- this.request_record_date = this.record_date
-
- let params = {
- patient_id: this.patientid,
- record_time: this.request_record_date,
- type: 2
- }
-
- this.GetLastOrNextDoctorAdvice(params)
- } else if (val == 4) {
- let params = {
- patient_id: this.patientid,
- record_time: this.request_record_date,
- type: 2
- }
- this.GetLastOrNextDoctorAdvice(params)
-
- }
- },
-
- getSelfMedicalList(){
- const params = {
- patient_id:this.$route.query.patient_id
- }
- getSelfMedicalList(params).then(response=>{
- if (response.data.state == 1) {
- this.arr_drug = []
- var medicalList = response.data.data.private_drug_list
- var base_drug_list = response.data.data.base_drug_list
- var base_drug_cofig = response.data.data.base_drug_config
- var private_drug_cofig = response.data.data.private_drug_config
-
-
- if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
-
- for (let i = 0; i < medicalList.length; i++) {
- if(medicalList[i].drug_specs != null) {
- for (let a = 0; a < medicalList[i].drug_specs.length; a++) {
- medicalList[i].drug_specs[a]['type'] = 2
- }
- }
- let obj = {
- drug_name: "",
- drug_desc: "",
- delivery_way: "",
- execution_frequency: "",
- single_dose: "",
- single_dose_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- type_id: "",
- type: "",
- custom_id: "",
- drug_specs: [],
- }
-
- medicalList[i].drug_name = medicalList[i].drug_name + "(自备药)"
- obj.drug_name = medicalList[i].drug_name
- obj.delivery_way = medicalList[i].delivery_way
- obj.execution_frequency = medicalList[i].execution_frequency
- obj.single_dose = medicalList[i].single_dose
- obj.prescribing_number = medicalList[i].prescribing_number
- obj.type_id = medicalList[i].id
- obj.type = 2
- obj.custom_id = this.rand(10000000, 99999999)
- obj.drug_specs = medicalList[i].drug_specs
- this.all_drug.push(obj)
- }
- }
-
-
- for (let i = 0; i < base_drug_list.length; i++) {
- if(base_drug_list[i].drug_specs != null) {
- for (let a = 0; a < base_drug_list[i].drug_specs.length; a++) {
- base_drug_list[i].drug_specs[a]['type'] = 1
- }
- }
- let obj = {
- drug_name: "",
- drug_desc: "",
- delivery_way: "",
- execution_frequency: "",
- single_dose: "",
- single_dose_unit: "",
- prescribing_number: "",
- prescribing_number_unit: "",
- type_id: "",
- type: "",
- custom_id: "",
- drug_specs: [],
- }
-
- obj.drug_name = base_drug_list[i].drug_name
- obj.delivery_way = base_drug_list[i].delivery_way
- obj.execution_frequency = base_drug_list[i].execution_frequency
- obj.single_dose = base_drug_list[i].single_dose
- obj.prescribing_number = base_drug_list[i].prescribing_number
- obj.type_id = base_drug_list[i].id
- obj.type = 1
- obj.custom_id = this.rand(10000000, 99999999)
- obj.drug_specs = base_drug_list[i].drug_specs
- this.all_drug.push(obj)
- }
- }
- })
- },
- changeDrugName(name){
- this.current_drug_name = name
- this.form.advice_desc = ""
- this.$forceUpdate()
- this.drugSpec = []
- for (let i = 0; i < this.all_drug.length; i++) {
- if (this.all_drug[i].drug_name == name) {
- this.drugSpec = this.all_drug[i].drug_specs
- }
- }
- },
- changeDrugDesc(name) {
- this.$forceUpdate()
- this.current_drug_spec = name
- for (let i = 0; i < this.drugSpec.length; i++) {
- if (this.drugSpec[i].drug_spec == name) {
- this.form.advice_desc = this.drugSpec[i].drug_spec
- this.form.prescribing_number = this.drugSpec[i].prescribing_number.toString()
- this.form.single_dose = this.drugSpec[i].single_dose.toString()
- this.form.delivery_way = this.drugSpec[i].delivery_way.toString()
- this.form.execution_frequency = this.drugSpec[i].execution_frequency.toString()
- this.form.drug_id = this.drugSpec[i].id
- this.src_type = this.drugSpec[i].type
- this.form.drug_id = this.drugSpec[i].id
- this.form.way = this.drugSpec[i].type
-
- this.form.drug_spec_unit = this.drugSpec[i].min_unit
- this.form.prescribing_number_unit = this.drugSpec[i].min_unit
- this.form.single_dose_unit = this.drugSpec[i].min_unit
- if(this.drugSpec[i].drug_name_id){
- this.form.drug_name_id = this.drugSpec[i].drug_name_id
- }else{
- this.form.drug_name_id = 0
- }
-
- }
- }
- },
- rand(min, max) {
- return Math.floor(Math.random() * (max - min)) + min;
- },
-
- querySearch(queryString, cb) {
-
- var restaurants = this.all_drug;
- restaurants.map(item => {
- item.value = item.drug_name
- })
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
- // 调用 callback 返回建议列表的数据
-
- cb(results);
- },
-
- createFilter(queryString) {
- return (restaurant) => {
- return (restaurant.drug_name.toLowerCase().indexOf(queryString.toLowerCase()) !=-1);
- };
- },
-
- querySearch1(queryString, cb) {
-
- var restaurants = this.drugSpec;
-
- restaurants.map(item => {
- item.value = item.drug_spec
- })
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
- // 调用 callback 返回建议列表的数据
- cb(results);
- },
- //<!--li-->
- handleSelect(val){
- console.log("==val==",val)
- var tmp = val.drug_specs[0]
- console.log("==tmp==",tmp)
- //药品规格
- this.form.advice_desc = tmp.dose+tmp.dose_unit+"*"+tmp.min_number+tmp.min_unit+"/"//药品规格
- this.form.drug_spec_unit = tmp.max_unit
- //开药数量
- this.form.prescribing_number = tmp.prescribing_number//开药数量
- this.form.prescribing_number_unit = tmp.prescribing_number_unit
- //单次用量
- this.form.single_dose = tmp.single_dose//单次用量
- this.form.single_dose_unit = tmp.drug_dose_unit
-
- this.form.drug_id = tmp.id
- console.log("!!!!!!!!!!!!this.form.drug_id = tmp.id")
- console.log("tmp.id",tmp.id)
- console.log("this.form.drug_id",this.form.drug_id)
-
- // this.form.id = tmp.id
- },
- getPatientSchedule(){
- var params = {
- patient_id:this.$route.query.patient_id,
- schedule_date:this.$route.query.date,
- }
- getPatientSchedule(params).then(response=>{
- if(response.data.state == 1){
- var schedulePatient = response.data.data.schedulePatient
- console.log("schedulePatient23332322323wo",schedulePatient)
- this.schedulePatient = schedulePatient
- }
- })
- },
- getDataConfig(module, filed_name) {
- return getDataConfig(module, filed_name)
- },
- getUnit(id){
- var name = ""
- for(let i=0;i<this.unitsOption.length;i++){
- if(id == this.unitsOption[i].id){
- name = this.unitsOption[i].name
- }
- }
- console.log("nam e23233232322323wo",name)
- return name
- },
-
- saveInformation(){
- var params = {
- selected_date:this.selected_date,
- patient_id:this.$route.query.patient_id,
- record_date:this.$route.query.date,
- module:2,
- remark:this.remark,
- }
- saveInformation(params).then(response=>{
- if(response.data.state == 1){
- var information = response.data.data.information
- this.$message.success("提交成功!")
- this.infoDialogVisible = false
- }
- })
- }
-
- },
- created() {
-
- var date = this.$route.query && this.$route.query.date
- this.record_date = uParseTime(date, '{y}-{m}-{d}')
- this.form.advice_date = this.record_date
- this.getAdviceConfig()
- this.unitsOption = this.getDataConfig('hemodialysis', 'units')
- this.template_id = this.$store.getters.xt_user.template_info.template_id
- this.org_id = this.$store.getters.xt_user.org.id
- this.patientid = this.$route.query.patient_id
- this.request_record_date = this.record_date
-
-
- // this.getDialysisScheduleDetail()
- //获取自备药
- this.getSelfMedicalList()
- this.getPatientSchedule()
- },
- components: {
- AddGroupAdvice,
- EditGroupAdvice
- }
- }
- </script>
-
- <style>
- @import "../../../../../static/css/table_row.css";
-
- .txsj {
- text-align: center;
- margin-bottom: 20px;
- }
-
- .dialysisadvicenamedisplay .cell {
- float: left;
- text-align: left;
- }
- </style>
-
- <style lang="scss" scoped>
- .table {
- width: 100%;
-
- .tableTh {
-
- th {
- padding: 10px 0px;
- background-color: rgb(245, 247, 250);
- color: #909399;
- font-weight: bold;
- text-align: center;
- }
-
- }
- tr {
-
- th {
- /*/ / background: $ main-color;*/
- /*/ / color: #fff;*/
- /*/ / height: 1.2 rem;*/
- /*/ / line-height: 1.2 rem;*/
- /*/ /*/
- }
-
- td {
- line-height: 0.6rem;
-
- .txt {
- /*/ / float: left;*/
- padding: 0 10px 0 10px;
- /*/ / width: 75 %;*/
- text-align: left;
- }
-
- .ico {
- float: right;
- width: 60px;
- text-align: right;
- padding-right: 3px;
- }
-
- .iconfont {
- font-size: 20px;
- padding: 0 2px;
- color: #7b8a97;
- }
-
- .handle {
- color: #409eff;
- /*/ / padding: 0 7 px;*/
- }
-
- }
- .advice_content {
- /*/ / background: #eff6fc;*/
- }
-
- .subadvice_content {
- /*/ / background: #fafcfe;*/
- padding-left: 20px;
- }
-
- .td-active {
- background: #badcff !important;
- }
-
- }
- .row-class-active {
-
- td {
- background: #badcff;
- }
-
- }
- }
- </style>
-
- <!--<style scoped>-->
-
- <!--.txsj{-->
- <!--text-align: center;-->
- <!--margin-bottom: 20px;-->
- <!--}-->
- <!--</style>-->
-
- <!--<style rel="stylesheet/scss" lang="scss" >-->
- <!--.row-class-active {-->
- <!--background: #badcff;-->
- <!--}-->
-
- <!--.doctor-advice-box .current-box-class .current-row>td{-->
- <!--background: #6fb5fa;-->
- <!--color:#fff;-->
- <!--}-->
- <!--.doctor-advice-box .current-box-class .current-row:hover>td{-->
- <!--background: #6fb5fa;-->
- <!--}-->
- <!--// .doctor-advice-box .current-box-class .stoped-row>td{-->
- <!--// background: #c9c9c9;-->
- <!--// color:#000;-->
- <!--// }-->
- <!--// .doctor-advice-box .current-box-class .stoped-row:hover>td{-->
- <!--// background: #c9c9c9;-->
- <!--// }-->
-
- <!--</style>-->
|