12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699 |
- <template>
- <div class="doctor-advice-box">
- <el-dialog
- :title="add_title"
- :visible.sync="isLastOrNextVisible"
- width="1010px"
- @close="resetDialog"
- :modal-append-to-body="false"
- >
-
- <div class="txsj">
- <el-button
- round
-
- @click="openLast(3)"
- >上一方
- </el-button>
-
- <el-button
- round
- @click="openNext(4)"
- >下一方
- </el-button>
- </div>
-
-
- <!--<el-table-->
- <!--:header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"-->
- <!--:data="other_doctor_advices"-->
- <!--border-->
- <!--style="width: 100%"-->
- <!--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-->
- <!--@current-change="handleCurrentChange"-->
- <!-->-->
-
- <!--<el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">-->
- <!--<template slot-scope="scope">-->
- <!--<span class="el-dropdown-link">-->
- <!--{{ getAdviceContent(scope.row, 1)-->
- <!--}}-->
- <!--<i class="el-icon-arrow-down el-icon--right"></i>-->
- <!--</span>-->
- <!--</template>-->
- <!--</el-table-column>-->
-
-
- <!--</el-table>-->
- <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-append-to-body="false"
- >
- <div class="txsj">
- <el-button
- round
- v-if="his_is_open != 1"
- @click="openLast(1)"
- >上一方
- </el-button>
-
- <el-button
- round
- v-if="his_is_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"
- :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>
-
- <!--<el-button round @click="openNewChild" :loading="deleLoading">新增子药</el-button>-->
- </div>
- <!-- 医嘱列表 -->
- <!-- @row-click="cellMouseEnter" -->
- <!--<!–:header-cell-style="{ backgroundColor: 'rgb(64, 158, 255)', color: 'white'}"–>@current-change="selectRow"-->
- <el-table
- v-if="his_is_open == 0"
- :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 v-if="scope.row.parent_id == 0">
- {{getXuserName(scope.row.execution_staff)}}
- </span>
- <span v-else></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></span>
- </template>
- </el-table-column>
- </el-table>
- <el-table
- v-else
- :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 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 v-if="scope.row.parent_id == 0">
- {{getXuserName(scope.row.execution_staff)}}
- </span>
- <span v-else></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></span>
- </template>
- </el-table-column>
- </el-table>
-
- <!-- 医嘱列表 end -->
-
- <!-- 新医嘱列表 -->
- <!-- <div class="orderTable">
- <table class="table">
- <tr @click="cancelAdviceSelect" class="tableTh">
- <th width="8%">开嘱医生</th>
- <th width="12%">开始时间</th>
- <th width="52%">医嘱内容</th>
- <th width="12%">执行时间</th>
- <th width="8%">执行护士</th>
- <th v-if="template_id != 6" width="8%">核对人员</th>
- </tr>
- <template v-for="(group, group_index) in advice_groups">
- <tr
- v-for="(advice, advice_index) in group.advices"
- :key="advice.id"
- :class="{ 'row-class-active': current_group_index == group_index && current_advice_index < 0 }"
- >
- <td
- v-if="advice_index == 0"
- :rowspan="group.advices.length"
- @click="selectGroupAdviceAction(group_index, -1, null,group)"
- >
- <span v-if="advice.parent_id==0">{{getXuserName(advice.advice_doctor)}}</span>
- <span v-else></span>
- </td>
-
- <td
- v-if="advice_index == 0"
- :rowspan="group.advices.length"
- @click="selectGroupAdviceAction(group_index, -1, null,group)"
- >
- <span>{{uParseTime(advice.start_time, '{m}-{d} {h}:{i}')}}</span>
- </td>
-
- <td
- :class="{ 'advice_content': advice.parent_id == 0, 'subadvice_content': advice.parent_id > 0, 'td-active':current_group_index == group_index && advice.is_selected == 1 }"
- @click="selectAdviceAction(group_index, advice_index, advice)"
- >
- <div class="txt">
- <span>{{advice.advice_name }}</span>
- <span
- v-if="advice.advice_desc"
- >({{ advice.advice_desc }}{{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 && template_id == 6"
- >{{advice.single_dose}}{{advice.single_dose_unit}}</span>
- <span
- v-if="advice.single_dose && template_id != 6"
- >单次用量{{advice.single_dose}}{{advice.single_dose_unit}}</span>
-
- <span v-if="advice.parent_id == 0">{{advice.delivery_way}}</span>
- <span v-if="advice.parent_id == 0">{{advice.execution_frequency}}</span>
- <span v-if="advice.parent_id == 0 && advice.remark.length > 0">({{advice.remark}})</span>
- </div>
- </td>
-
- <td
- :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
- @click="selectAdviceAction(group_index,advice_index, advice)"
- >{{uParseTime(advice.execution_time, '{m}-{d} {h}:{i}')}}</td>
-
- <td
- :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
- @click="selectAdviceAction(group_index,advice_index, advice)"
- >{{getXuserName(advice.execution_staff)}}</td>
- <td
- v-if="template_id != 6"
- :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
- @click="selectAdviceAction(group_index,advice_index, advice)"
- >{{getXuserName(advice.checker)}}</td>
- </tr>
- </template>
- </table>
- </div>-->
- <!-- 新医嘱列表 -->
-
-
- <!-- 新增医嘱(子药)表单 -->
- <!-- 医嘱表单 -->
- <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="药品规格:">
- <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.name"
- ></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>
- <el-button type="primary" v-else @click="submitEditAdvice" :loading="loading">保 存</el-button>
- </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-append-to-body="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
- :adviceTemplates="adviceTemplates"
- :executionFrequencyOptions="executionFrequencyOptions"
- :unitsOption="unitsOption"
- :deliveryWayOptions="deliveryWayOptions"
- :adviceTemplateMaps="adviceTemplateMaps"
- :patientID="patient.id"
- :adviceTableData="doctor_advices"
- :recordDate="record_date"
- 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
- } from '@/api/advice'
- import { getDataConfig } from '@/utils/data'
-
- 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 []
- }
- }
- },
- 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,
- 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:""
- }
- },
- 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.handleSpanTempArr()
- // this.hoverOrderArr = []
- // this.handleStyle()
- }
- },
- methods: {
- 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: ''
- }
- console.log("2223333",submitForm)
-
- let mode = '1'
- CreateGroupAdvice(this.patientid, 0, submitForm, mode).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.$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() {
- 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
- }
- // console.log(this.form)
- 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)
- return false
- } else {
- this.$notify({
- title: '成功',
- message: '修改医嘱成功',
- type: 'success',
- duration: 2000
- })
-
- this.showAdviceForm = false
- this.showAdvicePanel = true
- var advice = response.data.data.advice
- 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 =
- advice.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() {
- if (this.groupSelectRow === null) {
- 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
- }
- console.log("88888888",this.nameForm)
- } 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() {
- console.log(this.currentRow.origin)
- 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)
- this.exceLoading = 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.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
- }
- })
- .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'
-
- if(this.src_type == ""){
- this.form.way = 0
- this.form.drug_id = 0
- this.form.drug_name_id = 0
- }
-
- if(this.src_type == 2){ //自备药
- var arr = this.form.advice_name.split("(自备药)")
- this.form.advice_name = arr[0]
- }
-
- console.log("新增医嘱子药",this.form)
-
- CreateDoctorAdvice(this.patient.id, this.form, mode)
- .then(response => {
- this.loading = false
- 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.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]) // = this.doctor_advices.concat(swapData);
- }
- }
- }
- } else {
- this.doctor_advices.unshift(response.data.data.advice)
- }
- // this.$emit("new_create", response.data.data.advice);
- return false
- }
- })
- .catch(v => {
- this.loading = false
- })
- }
- ,
- openNewChildTwo(index, row) {
- 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) {
- 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:0,
- way:0,
- drug_name_id:0,
- }
- }
- ,
-
- openEditGroupAdvice() {
- if (this.groupSelectRow === null) {
- this.$message.error('未选择要修改的医嘱内容')
- return
- }
- console.log("22222",this.groupSelectRow.groupno)
- 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() {
- console.log(this.currentRow)
- // console.log(this.$store.getters.xt_user)
- 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)
-
- 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
- }
- this.execTimeDialogVisible = true
- // if (this.currentAdvices.length <= 0) {
- // return;
- // }
- 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(() => {
- console.log(this.currentRow)
- 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)
- 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(() => {
- })
- // this.handleSpanTempArr()
- }
- ,
- openDelete(index, row) {
- 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)
- 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) {
- 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
- )
- }
- }
- })
-
- // this.handleSpanTempArr()
- // this.handleStyle()
- }
- ,
- 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) {
- this.his_is_open = his_is_open
- console.log(this.his_is_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("数据是",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) {
- let tempSingleDoseDesc = ''
- let tempDrugSpecDesc = ''
- let tempPrescribingNumberDesc = ''
-
- if (row.prescribing_number) {
- tempPrescribingNumberDesc =
- row.prescribing_number + '' + row.prescribing_number_unit
- }
-
- 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
- )
- }
- }
- ,
- 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 => {
- console.log(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
- console.log("doctor_advices",doctor_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) {
- var doctor_advices = response.data.data.doctor_advices
- this.doctorAdvices = doctor_advices
- }
- })
- }
- ,
- 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
- console.log("222",this.all_drug)
- 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)
- console.log("2222",this.all_drug)
- }
- }
- })
- },
- 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) {
- console.log('queryString',queryString)
- var restaurants = this.all_drug;
- restaurants.map(item => {
- item.value = item.drug_name
- })
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
- // 调用 callback 返回建议列表的数据
- console.log('results',results)
- cb(results);
- },
-
- createFilter(queryString) {
- return (restaurant) => {
- return (restaurant.drug_name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
- };
- },
-
- querySearch1(queryString, cb) {
- console.log('queryString',queryString)
- var restaurants = this.drugSpec;
- console.log(restaurants)
- restaurants.map(item => {
- item.value = item.drug_spec
- })
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
- // 调用 callback 返回建议列表的数据
- console.log('results',results)
- cb(results);
- },
- handleSelect(){
-
- }
- },
- 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 = getDataConfig('hemodialysis', 'units')
- this.template_id = this.$store.getters.xt_user.template_info.template_id
- this.patientid = this.$route.query.patient_id
- this.request_record_date = this.record_date
-
- this.getDialysisScheduleDetail()
- //获取自备药
- this.getSelfMedicalList()
- },mounted(){
- console.log("~~~~~")
- console.log(this.his_is_open)
- console.log("~~~~~")
-
-
- },
- 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>-->
|