12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs='crumbs'></bread-crumb>
- </div>
-
- <el-dialog title="透析处方长期医嘱医生确认推送提醒" :visible.sync="dialogConfigVisible">
- <el-form>
- <el-form-item label="是否开启推送:">
- <el-radio-group v-model="is_open_remind" @change="changeRemind">
- <el-radio :label="1">开启</el-radio>
- <el-radio :label="2">不开启</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-form>
- </el-dialog>
-
-
- <div class="app-container">
- <el-tabs>
- <el-tab-pane label="医嘱模板 ">
- <div>
- <div class="filter-container">
- <el-button size="small"
- style="float: right;"
- @click="dialogConfigVisible = true"
- type="primary">长期医嘱提醒配置
- </el-button>
-
- <el-button
- class="filter-item"
- style="margin-left: 10px;margin-right: 10px"
- @click="handleCreateTemplate"
- type="primary"
- size="small"
- icon="el-icon-circle-plus-outline"
- >{{$t('table.add')}}
- </el-button>
- </div>
- <el-table
- :data="adviceTemplates"
- border
- fit
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- @cell-mouse-leave="cellMouseLeave"
- @cell-mouse-enter="cellMouseEnter"
- :row-class-name="tableRowClassNames"
- :span-method="merge"
- style="width: 100%;min-height:500px;"
- >
- <el-table-column
- prop="id"
- label="模版名称"
- align="center"
- width="100">
- <template slot-scope="scope">
- <span v-if="isShow(scope.$index, scope.row)">{{scope.row.name}}</span>
- <span v-else></span>
- </template>
- </el-table-column>
-
-
- <el-table-column
- label="模版类型"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <div>{{scope.row.advice_type == 1 ? '长期' : '临时'}}</div>
- </template>
-
- </el-table-column>
-
- <el-table-column
- prop="amount1"
- align="center"
- label="医嘱内容">
- <template slot-scope="scope">
-
- <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
- <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
- {{scope.row.advice_name}}<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
-
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
- <el-dropdown-item @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
- <el-dropdown-item @click.native="openNewChild(scope.$index, scope.row)">新增子药</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
-
-
- <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
- <span class="el-dropdown-link">
-   {{ scope.row.advice_name }}<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
-
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- @click.native="openEdit(scope.$index, scope.row)">修改子药
- </el-dropdown-item>
- <el-dropdown-item
- @click.native="openDeleteChild(scope.$index, scope.row)">删除子药
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
-
-
- </template>
- </el-table-column>
-
-
- <el-table-column
- prop="amount1"
- align="center"
- label="药品规格">
- <!-- {{drugDesc(scope.row)}} -->
- <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
- prop="amount2"
- width="90"
- align="center"
- label="开药数量">
- <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
- <span>{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
-
- </template>
- </el-table-column>
-
- <el-table-column
- prop="amount2"
- width="90"
- align="center"
- label="单次用量">
- <template slot-scope="scope" v-if="scope.row.single_dose != ''">
- <span>{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
-
- </template>
- </el-table-column>
-
- <el-table-column
- prop="amount3"
- align="center"
- label="给药途径">
- <template slot-scope="scope" v-if="scope.row.parent_id == 0">
- <span>{{scope.row.delivery_way}}</span>
- </template>
- </el-table-column>
-
-
- <el-table-column
- prop="amount3"
- align="center"
-
- label="执行频率">
- <template slot-scope="scope" v-if="scope.row.parent_id == 0">
- <span>{{scope.row.execution_frequency}}</span>
- </template>
- </el-table-column>
-
-
-
-
- <el-table-column prop="blood_flow_volume" align="center" label="提醒频率">
- <template slot-scope="scope">
- <span v-if="scope.row.frequency_type == 1">每次必推</span>
- <span v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/1次</span>
- <span v-if="scope.row.frequency_type == 3">每周{{scope.row.week_days}}</span>
- </template>
- </el-table-column>
-
- <el-table-column
- align="center"
- label="操作"
- width="180"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" content="编辑" placement="top">
- <el-button
- type="primary"
- size="small"
- icon="el-icon-edit-outline"
- v-if="isShow(scope.$index, scope.row)"
- @click="handleUpdateAdviceTemplate(scope.row, scope.$index)"
- >
- </el-button>
- </el-tooltip>
- <el-tooltip class="item" effect="dark" content="删除" placement="top">
- <el-button
- size="small"
- type="danger"
- icon="el-icon-delete"
- @click="handleDeleteAdviceTemplate(scope.row, scope.$index)"
- >
- </el-button>
- </el-tooltip>
- </template>
- </el-table-column>
-
- </el-table>
-
-
- <!--增删改查都是本地处理的dialog-->
- <el-dialog title="新增医嘱模版" :visible.sync="templateTableVisible" width="700px" :close-on-click-modal="false">
- <div>
- <el-form ref="form" :model="form" :rule="formRules" label-width="100px">
- <el-form-item label="模版名称" style="width: 300px" prop="name">
- <el-input v-model="form.name"></el-input>
- </el-form-item>
-
- <el-form-item label="模版类型" prop="advice_type">
- <el-radio-group v-model="form.advice_type">
- <el-radio :label="0">临时</el-radio>
- <el-radio :label="1">长期</el-radio>
- </el-radio-group>
- </el-form-item>
-
- </el-form>
- <div class="txsj" style="text-align: center;margin-bottom: 30px">
- <el-button round @click="newRecordAction">新增医嘱内容</el-button>
- <el-button round @click="modifyRecordAction">修改医嘱内容</el-button>
- <el-button round @click="deleteRecordAction">删除医嘱内容</el-button>
- </div>
- <el-table
- ref="table" :data="adviceTableData"
- border
- highlight-current-row
- max-height="300"
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- :row-class-name="tableRow"
- @row-click="onRowClick"
- style="width: 100%">
- <el-table-column label="医嘱内容" align="center" width="144">
- <template slot-scope="scope">
- {{scope.row.advice_name}}
- </template>
- </el-table-column>
- <el-table-column align="center" label="药品规格">
- <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 prop="prescribing_number" align="center" label="开药数量">
- <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
- {{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}
- </template>
- </el-table-column>
- <el-table-column prop="single_dose" align="center" label="单次用量">
- <template slot-scope="scope" v-if="scope.row.single_dose != ''">
- {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
- </template>
-
- </el-table-column>
- <el-table-column prop="breathing_rate" align="center" label="给药途径">
- <template slot-scope="scope">
-
- {{scope.row.delivery_way}}
- </template>
-
- </el-table-column>
- <el-table-column prop="blood_flow_volume" align="center" label="执行频率">
- <template slot-scope="scope">
- {{scope.row.execution_frequency}}
- </template>
- </el-table-column>
-
- <el-table-column prop="blood_flow_volume" align="center" label="提醒频率" v-if="form.advice_type == 1">
- <template slot-scope="scope">
- <span v-if="scope.row.frequency_type == 1">每次必推</span>
- <span v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/1次</span>
- <span v-if="scope.row.frequency_type == 3">每周{{scope.row.weekdays}}</span>
- </template>
- </el-table-column>
-
- </el-table>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelTableHandle">取消</el-button>
- <el-button type="primary" @click="submitTableTemplate('form')">保 存</el-button>
- </div>
- </el-dialog>
- <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="700px">
- <el-form
- ref="templateForm"
- :rules="templateRules"
- :model="templateForm"
- label-width="90px"
- >
-
- <el-row>
- <el-col :span="12">
- <el-form-item label="医嘱内容 :" required prop="advice_name">
- <el-input v-model="templateForm.advice_name"></el-input>
- </el-form-item>
- </el-col>
-
-
-
- <el-col :span="12">
- <el-form-item label="药品规格 :" prop="advice_desc">
- <el-col :span="8">
- <el-input v-model="templateForm.advice_desc"></el-input>
- </el-col>
- <el-col class="line" :span="2"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateForm.drug_spec_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开药数量 :" prop="prescribing_number">
- <el-col :span="9">
- <el-input v-model="templateForm.prescribing_number"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateForm.prescribing_number_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="单次用量 :" prop="single_dose">
- <el-col :span="9">
- <el-input v-model="templateForm.single_dose"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateForm.single_dose_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="!isAddChild">
- <el-form-item label="给药途径 :" prop="delivery_way">
- <el-select
- v-model="templateForm.delivery_way"
- filterable
- clearable
- allow-create
- placeholder="请选择(输入可搜索)"
- style="width:100%"
- >
- <el-option
- v-for="item in drugways"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="!isAddChild">
- <el-form-item label="执行频率 :" prop="execution_frequency">
- <el-select
- v-model="templateForm.execution_frequency"
- clearable
- allow-create
- filterable
- placeholder="请选择(输入可搜索)"
- style="width:100%"
- >
- <el-option
- v-for="item in executionFrequencyOptions"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
-
- <el-col :span="24" v-if="form.advice_type&&!isAddChild">
- <el-form-item label="周期提醒 :">
- <el-radio-group v-model="templateForm.frequency_type">
- <el-radio :label="1">每次必推</el-radio>
- <el-radio :label="2">天数频率</el-radio>
- <el-radio :label="3">星期频率</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
-
-
- <el-col :span="12" v-if="templateForm.frequency_type == 2">
- <el-form-item prop="day_count">
- <el-input style="width: 50px" v-model="templateForm.day_count"></el-input>
- 天/一次
- </el-form-item>
- </el-col>
-
- <el-col :span="24" v-if="templateForm.frequency_type == 3">
- <el-form-item prop="weekday">
- <el-checkbox-group v-model="templateForm.weekday">
- <el-checkbox label="周一" name="type"></el-checkbox>
- <el-checkbox label="周二" name="type"></el-checkbox>
- <el-checkbox label="周三" name="type"></el-checkbox>
- <el-checkbox label="周四" name="type"></el-checkbox>
- <el-checkbox label="周五" name="type"></el-checkbox>
- <el-checkbox label="周六" name="type"></el-checkbox>
- <el-checkbox label="周日" name="type"></el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-col>
-
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelHandle('templateForm')">取消</el-button>
- <el-button type="primary" @click="submitTemplate('templateForm')">保 存</el-button>
- </div>
- </el-dialog>
- <!--TODO-->
-
-
- <el-dialog :title="editDialogTitle" :visible.sync="templateEditFormVisible" width="700px">
- <el-form
- ref="templateFormEdit"
- :rules="templateEditRules"
- :model="templateFormEdit"
- label-width="90px"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item :label="edit_advice_name" required prop="advice_name">
- <el-input v-model="templateFormEdit.advice_name"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
-
- <el-form-item label="药品规格 :" prop="advice_desc">
- <el-col :span="8">
- <el-input v-model="templateFormEdit.advice_desc"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateFormEdit.drug_spec_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开药数量 :" prop="prescribing_number">
- <el-col :span="9">
- <el-input v-model="templateFormEdit.prescribing_number"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateFormEdit.prescribing_number_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="单次用量 :" prop="single_dose">
- <el-col :span="9">
- <el-input v-model="templateFormEdit.single_dose"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateFormEdit.single_dose_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="templateFormEdit.parent_id == 0">
- <el-form-item label="给药途径 :" prop="delivery_way">
- <el-select
- v-model="templateFormEdit.delivery_way"
- filterable
- clearable
- allow-create
- placeholder="请选择(输入可搜索)"
- style="width:100%"
- >
- <el-option
- v-for="item in drugways"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
-
- <el-col :span="12" v-if="templateFormEdit.parent_id == 0">
- <el-form-item label="执行频率 :" prop="execution_frequency">
- <el-select
- v-model="templateFormEdit.execution_frequency"
- clearable
- allow-create
- filterable
- placeholder="请选择(输入可搜索)"
- style="width:100%"
- >
- <el-option
- v-for="item in executionFrequencyOptions"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
-
-
- <el-col :span="24">
- <el-form-item label="周期提醒 :">
- <el-radio-group v-model="templateFormEdit.frequency_type">
- <el-radio :label="1">每次必推</el-radio>
- <el-radio :label="2">天数频率</el-radio>
- <el-radio :label="3">星期频率</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
-
-
- <el-col :span="12" v-if="templateFormEdit.frequency_type == 2">
- <el-form-item prop="day_count">
- <el-input style="width: 50px" v-model="templateFormEdit.day_count"></el-input>
- 天/一次
- </el-form-item>
- </el-col>
-
- <el-col :span="24" v-if="templateFormEdit.frequency_type == 3">
- <el-form-item>
- <el-checkbox-group v-model="templateFormEdit.weekday">
- <el-checkbox label="周一" name="type"></el-checkbox>
- <el-checkbox label="周二" name="type"></el-checkbox>
- <el-checkbox label="周三" name="type"></el-checkbox>
- <el-checkbox label="周四" name="type"></el-checkbox>
- <el-checkbox label="周五" name="type"></el-checkbox>
- <el-checkbox label="周六" name="type"></el-checkbox>
- <el-checkbox label="周日" name="type"></el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-col>
-
-
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelEditHandle">取消</el-button>
- <el-button type="primary" @click="submitEditTemplate('templateFormEdit')">保 存</el-button>
- </div>
- </el-dialog>
-
-
- <!--增删改查都请求网络类型的dialog-->
- <el-dialog title="编辑医嘱模版" :visible.sync="templateTableTwoVisible" width="800px">
- <div>
- <!--<el-form ref="form" :model="form" :rule="formRules" label-width="100px">-->
- <!--<el-form-item label="模版名称" style="width: 300px" prop="name">-->
- <!--<el-input v-model="form.name" ></el-input>-->
- <!--</el-form-item>-->
- <!--</el-form>-->
-
-
- <div class="txsj" style="text-align: center;margin-bottom: 30px">
- <el-button round @click="newRecordActionTwo">新增医嘱内容</el-button>
- <!--<el-button round @click="deleteRecordActionTwo">删除医嘱内容</el-button>-->
- <!--<el-button round @click="modifyRecordActionTwo">修改医嘱内容</el-button>-->
- </div>
-
-
- <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" ref="table"
- :data="adviceTableDataTwo" border highlight-current-row max-height="300">
- <el-table-column label="医嘱内容">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id == 0">{{scope.row.advice_name}}</span>
- <span v-if="scope.row.parent_id > 0">  {{scope.row.advice_name}}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="药品规格">
- <!-- {{drugDesc(scope.row)}} -->
- <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 prop="prescribing_number" align="center" label="开药数量">
- <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
- {{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}
- </template>
- </el-table-column>
- <el-table-column align="center" label="单次用量">
- <template slot-scope="scope" v-if="scope.row.single_dose != ''">
- {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
- </template>
-
- </el-table-column>
- <el-table-column align="center" label="给药途径">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id == 0">{{scope.row.delivery_way}}</span>
- </template>
-
- </el-table-column>
- <el-table-column align="center" label="执行频率">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id == 0">{{scope.row.execution_frequency}}</span>
- </template>
- </el-table-column>
-
- <el-table-column align="center" label="提醒频率" v-if="form.advice_type == 1">
- <template slot-scope="scope">
- <span v-if="scope.row.frequency_type == 1">每次必推</span>
- <span v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/1次</span>
- <span v-if="scope.row.frequency_type == 3">每周{{scope.row.week_days}}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelTableHandleTwo">取消</el-button>
- <el-button type="primary" @click="modifyTemplateName">保 存</el-button>
- </div>
- </el-dialog>
-
-
- <el-dialog title="新增医嘱" :visible.sync="templateFormTwoVisible" width="700px">
- <el-form
- ref="templateForm"
- :rules="templateEditRules"
- :model="templateForm"
- label-width="90px"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item label="医嘱内容 :" required prop="advice_name">
- <el-input v-model="templateForm.advice_name"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
-
- <el-form-item label="药品规格 :" prop="advice_desc">
- <el-col :span="9">
- <el-input v-model="templateForm.advice_desc"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateForm.drug_spec_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开药数量 :" prop="prescribing_number">
- <el-col :span="9">
- <el-input v-model="templateForm.prescribing_number"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateForm.prescribing_number_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="单次用量 :" prop="single_dose">
- <el-col :span="9">
- <el-input v-model="templateForm.single_dose"></el-input>
- </el-col>
- <el-col class="line" :span="1"> </el-col>
- <el-col :span="14">
- <el-select
- v-model="templateForm.single_dose_unit"
- filterable
- clearable
- allow-create
- placeholder="选择"
- >
- <el-option
- v-for="item in unitsOption"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-col>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="给药途径 :" prop="delivery_way">
- <el-select
- v-model="templateForm.delivery_way"
- filterable
- clearable
- allow-create
- placeholder="请选择(输入可搜索)"
- style="width:100%"
- >
- <el-option
- v-for="item in drugways"
- :key="item.id"
- :label="item.name "
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="执行频率 :" prop="execution_frequency">
- <el-select
- v-model="templateForm.execution_frequency"
- clearable
- allow-create
- filterable
- placeholder="请选择(输入可搜索)"
- style="width:100%"
- >
- <el-option
- v-for="item in executionFrequencyOptions"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
-
-
- <el-col :span="24" v-if="form.advice_type == 1">
- <el-form-item label="周期提醒 :">
- <el-radio-group v-model="templateForm.frequency_type">
- <el-radio :label="1">每次必推</el-radio>
- <el-radio :label="2">天数频率</el-radio>
- <el-radio :label="3">星期频率</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
-
-
- <el-col :span="12" v-if="templateForm.frequency_type == 2">
- <el-form-item prop="day_count">
- <el-input style="width: 50px" v-model="templateForm.day_count"></el-input>
- 天/一次
- </el-form-item>
- </el-col>
-
- <el-col :span="24" v-if="templateForm.frequency_type == 3">
- <el-form-item>
- <el-checkbox-group v-model="templateForm.weekday">
- <el-checkbox label="周一" name="type"></el-checkbox>
- <el-checkbox label="周二" name="type"></el-checkbox>
- <el-checkbox label="周三" name="type"></el-checkbox>
- <el-checkbox label="周四" name="type"></el-checkbox>
- <el-checkbox label="周五" name="type"></el-checkbox>
- <el-checkbox label="周六" name="type"></el-checkbox>
- <el-checkbox label="周日" name="type"></el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-col>
- </el-row>
-
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelHandleTwo">取消</el-button>
- <el-button type="primary" @click="submitTemplateTwo('templateForm')">保 存</el-button>
- </div>
- </el-dialog>
- <!--<el-dialog title="编辑医嘱" :visible.sync="templateEditFormTwoVisible" width="700px">-->
- <!--<el-form-->
- <!--ref="templateFormEdit"-->
- <!--:rules="templateEditRules"-->
- <!--:model="templateFormEdit"-->
- <!--label-width="90px"-->
- <!-->-->
- <!--<el-form-item label="医嘱名称 :" required prop="advice_name">-->
- <!--<el-input v-model="templateFormEdit.advice_name" style="width:50%"></el-input>-->
- <!--</el-form-item>-->
-
- <!--<el-row>-->
- <!--<el-col :span="12">-->
- <!--<el-form-item label="药品规格 :" prop="drug_spec">-->
- <!--<el-col :span="8">-->
- <!--<el-input v-model="templateFormEdit.drug_spec"></el-input>-->
- <!--</el-col>-->
- <!--<el-col class="line" :span="2"> </el-col>-->
- <!--<el-col :span="14">-->
- <!--<el-select-->
- <!--v-model="templateFormEdit.drug_spec_unit"-->
- <!--filterable-->
- <!--clearable-->
- <!--allow-create-->
- <!--placeholder="选择"-->
- <!-->-->
- <!--<el-option-->
- <!--v-for="item in unitsOption"-->
- <!--:key="item.id"-->
- <!--:label="item.name "-->
- <!--:value="item.name"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-col>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <!--<el-col :span="12">-->
- <!--<el-form-item label="单次用量 :" prop="single_dose">-->
- <!--<el-col :span="8">-->
- <!--<el-input v-model="templateFormEdit.single_dose"></el-input>-->
- <!--</el-col>-->
- <!--<el-col class="line" :span="2"> </el-col>-->
- <!--<el-col :span="14">-->
- <!--<el-select-->
- <!--v-model="templateFormEdit.single_dose_unit"-->
- <!--filterable-->
- <!--clearable-->
- <!--allow-create-->
- <!--placeholder="选择"-->
- <!-->-->
- <!--<el-option-->
- <!--v-for="item in unitsOption"-->
- <!--:key="item.id"-->
- <!--:label="item.name "-->
- <!--:value="item.name"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-col>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <!--<el-col :span="12">-->
- <!--<el-form-item label="开药数量 :" prop="prescribing_number">-->
- <!--<el-col :span="8">-->
- <!--<el-input v-model="templateFormEdit.prescribing_number"></el-input>-->
- <!--</el-col>-->
- <!--<el-col class="line" :span="2"> </el-col>-->
- <!--<el-col :span="14">-->
- <!--<el-select-->
- <!--v-model="templateFormEdit.prescribing_number_unit"-->
- <!--filterable-->
- <!--clearable-->
- <!--allow-create-->
- <!--placeholder="选择"-->
- <!-->-->
- <!--<el-option-->
- <!--v-for="item in unitsOption"-->
- <!--:key="item.id"-->
- <!--:label="item.name "-->
- <!--:value="item.name"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-col>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <!--<el-col :span="12">-->
- <!--<el-form-item label="给药途径 :" prop="delivery_way">-->
- <!--<el-select-->
- <!--v-model="templateFormEdit.delivery_way"-->
- <!--filterable-->
- <!--clearable-->
- <!--allow-create-->
- <!--placeholder="请选择(输入可搜索)"-->
- <!--style="width:90%"-->
- <!-->-->
- <!--<el-option-->
- <!--v-for="item in drugways"-->
- <!--:key="item.id"-->
- <!--:label="item.name "-->
- <!--:value="item.name"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <!--</el-row>-->
- <!--<el-row>-->
-
- <!--<el-col :span="12">-->
- <!--<el-form-item label="执行频率 :" prop="execution_frequency">-->
- <!--<el-select-->
- <!--v-model="templateFormEdit.execution_frequency"-->
- <!--clearable-->
- <!--allow-create-->
- <!--filterable-->
- <!--placeholder="请选择(输入可搜索)"-->
- <!--style="width:90%"-->
- <!-->-->
- <!--<el-option-->
- <!--v-for="item in executionFrequencyOptions"-->
- <!--:key="item.id"-->
- <!--:label="item.name"-->
- <!--:value="item.name"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <!--</el-row>-->
- <!--</el-form>-->
- <!--<div slot="footer" class="dialog-footer">-->
- <!--<el-button @click="cancelEditHandleTwo">取消</el-button>-->
- <!--<el-button type="primary" @click="submitEditTemplateTwo('templateFormEdit')">保 存</el-button>-->
- <!--</div>-->
- <!--</el-dialog>-->
-
-
- </div>
- </el-tab-pane>
- <el-tab-pane label="给药途径">
- <div class="">
- <div class="filter-container">
- <el-button
- class="filter-item"
- style="margin-left: 10px;"
- @click="handleCreateDrugWay"
- type="primary"
- icon="el-icon-circle-plus-outline"
- size="small"
- >{{$t('table.add')}}
- </el-button>
- </div>
-
- <el-table
- :data="drugways"
- border
- fit
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- highlight-current-row
- style="width: 100%;min-height:500px;"
- >
- <el-table-column align="center" label="名称">
- <template slot-scope="scope">
- <span>{{scope.row.name}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- :label="$t('table.actions')"
- width="230"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <el-button type="text" size="mini" v-show="scope.row.org_id==0" disabled>系统设定</el-button>
- <el-button
- v-show="scope.row.org_id!=0"
- type="primary"
- size="small"
- icon="el-icon-edit-outline"
- @click="handleUpdateDrugWay(scope.row, scope.$index)"
- >
- </el-button>
- <el-button
- v-show="scope.row.org_id!=0"
- size="small"
- type="danger"
- icon="el-icon-delete"
- @click="handleDeleteDrugWay(scope.row, scope.$index)"
- >
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-dialog :title="dialogTitle" :visible.sync="drugwayFormVisible" width="700px">
- <el-form
- ref="drugwayForm"
- :rules="drugwayRules"
- :model="drugwayForm"
- label-width="90px"
- >
- <el-form-item label="给药途径 :" required prop="name">
- <el-input v-model="drugwayForm.name" placeholder="给药途径"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="drugwayFormVisible = false">取消</el-button>
- <el-button type="primary" @click="submitDrugWay('drugwayForm')">保 存</el-button>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="执行频率">
- <div class="">
- <div class="filter-container">
- <el-button
- class="filter-item"
- style="margin-left: 10px;"
- @click="handleCreateEF"
- type="primary"
- icon="el-icon-circle-plus-outline"
- size="small"
- >{{$t('table.add')}}
- </el-button>
- </div>
-
- <el-table
- :data="executionFrequencyOptions"
- border
- fit
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- highlight-current-row
- style="width: 100%;min-height:500px;"
- >
- <el-table-column align="center" label="名称">
- <template slot-scope="scope">
- <span>{{scope.row.name}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- :label="$t('table.actions')"
- width="230"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <el-button type="text" size="mini" v-show="scope.row.org_id==0" disabled>系统设定</el-button>
- <el-button
- v-show="scope.row.org_id!=0"
- type="primary"
- size="small"
- icon="el-icon-edit-outline"
- @click="handleUpdateEF(scope.row, scope.$index)"
- >
- </el-button>
- <el-button
- v-show="scope.row.org_id!=0"
- size="small"
- type="danger"
- icon="el-icon-delete"
- @click="handleDeleteEF(scope.row, scope.$index)"
- >
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-dialog :title="dialogTitle" :visible.sync="efFormVisible" width="700px">
- <el-form ref="efForm" :rules="efRules" :model="efForm" label-width="90px">
- <el-form-item label="执行频率 :" required prop="name">
- <el-input v-model="efForm.name" placeholder="执行频率"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="efFormVisible = false">取消</el-button>
- <el-button type="primary" @click="submitEF('efForm')">保 存</el-button>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
-
- </template>
-
-
- <style>
- @import "../../../static/css/table_row.css";
-
- .filter-item {
- float: right;
- }
- </style>
-
- <script>
- import {
- CreateAdviceTemplate,
- CreateDrugDic,
- CreateDrugWay,
- CreateExecutionFrequency,
- CreateSingleAdviceTemplate,
- CreateSubAdvice,
- DeleteAdviceTemplate,
- DeleteDrugDic,
- DeleteDrugWay,
- DeleteExecutionFrequency,
- DeleteParentAdviceTemplate,
- getAllAdviceConfig,
- getAllAdviceTemplate,
- postAdviceTemplate,
- UpdateAdviceTemplate,
- UpdateDrugDic,
- UpdateDrugWay,
- UpdateExecutionFrequency,
- updateTemplateName,
- getDoctorAdviceConfig,
- postDoctorAdviceConfig
- } from '@/api/advice'
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
-
- import { getDataConfig } from '@/utils/data'
-
- export default {
- name: 'tab',
- components: { BreadCrumb },
- data() {
- return {
- day_count: '',
-
- crumbs: [
- { path: false, name: '数据字典' },
- { path: 'data/druguse', name: '医嘱模版' }
- ],
- rowIndex: -1,
- current_template_id: 0,
- currentObject: {},
- tempArr: [],
- sameRowArr: [],
- advice_content_name: '',
- table_current_index: -1,
- adviceTableData: [],
- templateName: '',
- adviceTableDataTwo: [],
- table_current_index_two: -1,
- currentIndex: -1,
- isEdit: false,
- dialogTitle: '',
- is_open_remind:0,
- isAddChild: false,
- parent_id: 0,
- editDialogTitle: '编辑医嘱',
- drugdicFormVisible: false,
- drugwayFormVisible: false,
- templateFormVisible: false,
- templateTableTwoVisible: false,
- templateEditFormVisible: false,
- edit_advice_name: '',
- templateTableVisible: false,
- templateFormTwoVisible: false,
- templateEditFormTwoVisible: false,
- efFormVisible: false,
- activeName: 'drugdic',
- hoverOrderArr: [],
- createdTimes: 0,
- drugdics: [],
- adviceTemplates: [],
- current_template_name: '',
- editForm: {
- name: ''
-
- },
-
- drugways: [],
- executionFrequencyOptions: [],
- drugdicRules: {
- name: [{ required: true, message: '请填写医嘱内容' }]
- },
- formRules: {
- name: [
- { required: true, message: '请输入模版名称', trigger: 'blur' }
- ],
- advice_type: [
- { required: true, message: '请选择模版类型', trigger: 'change' }
- ]
- },
-
- drugwayRules: {
- name: [{ required: true, message: '请填写给药途径' }]
- },
- efRules: {
- name: [{ required: true, message: '请填写执行频率' }]
- },
- templateRules: {
- advice_name: [{ required: true, message: '请填写医嘱内容' }]
-
- },
- templateEditRules: {
- advice_name: [{ required: true, message: '请填写医嘱内容' }]
- },
- templateForm: {
- frequency_type: 1,
- day_count: '',
- weekday: [],
- drug_spec: '',
- drug_spec_unit: '',
- advice_name: '',
- advice_desc: '',
- single_dose: '',
- single_dose_unit: '',
- prescribing_number: '',
- prescribing_number_unit: '',
- delivery_way: '',
- execution_frequency: '',
- id: 0
- },
- dialogConfigVisible:false,
- templateFormEdit: {
- frequency_type: 0,
- day_count: '',
- weekday: [],
- week_days: '',
- drug_spec: '',
- drug_spec_unit: '',
- advice_name: '',
- advice_desc: '',
- single_dose: '',
- single_dose_unit: '',
- prescribing_number: '',
- prescribing_number_unit: '',
- delivery_way: '',
- execution_frequency: '',
- id: 0
- },
- drugdicForm: {
- name: '',
- spec: '',
- spec_unit: '',
- form: '',
- form_unit: '',
- id: 0
- },
- form: {
- name: '',
- advice_type: 0
-
- },
- drugwayForm: {
- name: '',
- id: 0
- },
- efForm: {
- name: '',
- id: 0
- },
-
- drugforms: [
- { lable: 1, name: '胶囊' },
- { lable: 2, name: '注射剂' },
- { lable: 3, name: '片剂' },
- { lable: 4, name: '注射液' },
- { lable: 5, name: '栓剂' },
- { lable: 6, name: '膏' },
- { lable: 7, name: '颗粒剂' },
- { lable: 8, name: '粉剂' },
- { lable: 9, name: '口服液' },
- { lable: 10, name: '干混悬剂' },
- { lable: 11, name: '丸剂' },
- { lable: 12, name: '气雾剂' },
- { lable: 13, name: '内服溶液' },
- { lable: 14, name: '外用溶液' },
- { lable: 15, name: '软膏剂' },
- { lable: 16, name: '胶剂' }
- ]
- }
- },
- created() {
- this.getAdviceConfig()
- this.unitsOption = getDataConfig('hemodialysis', 'units')
- this.getDoctorAdviceConfig()
- },
- methods: {
- getDoctorAdviceConfig(){
- getDoctorAdviceConfig().then(response => {
- if (response.data.state == 1) {
- this.is_open_remind = response.data.data.config.is_open_remind
- } else {
- this.$message.error(response.data.msg)
- }
- })
- },
- adviceNameShow({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 1) {
- return 'templateadvicenamedisplay'
- } else {
- return ''
- }
- },
- showCreatedTimes() {
- this.createdTimes = this.createdTimes + 1
- },
- handleUpdateDrugDic(row, index) {
- this.currentIndex = index
- this.drugdicForm = {
- name: row.name,
- spec: row.spec,
- spec_unit: row.spec_unit,
- form: row.form,
- form_unit: row.form_unit,
- id: row.id
- }
-
- this.drugdicFormVisible = true
- this.dialogTitle = '编辑医嘱模版'
- this.isEdit = true
- },
- handleCreateDrugDic() {
- this.drugdicForm = {
- name: '',
- spec: '',
- spec_unit: '',
- form: '',
- form_unit: '',
- id: 0
- }
- this.drugdicFormVisible = true
- this.dialogTitle = '新增医嘱模版'
- this.isEdit = false
- },
- cancelHandle(formName) {
- this.table_current_index = -1
- this.resetForm(formName)
- if (this.isAddChild) {
- this.templateFormVisible = false
- } else {
- this.templateFormVisible = false
- this.templateTableVisible = true
- }
- },
- handleCreateTemplate() {
- this.form.advice_type = 0
- this.templateTableVisible = true
- },
- newRecordAction() {
- this.dialogTitle = '新增医嘱内容'
- this.advice_content_name = '医嘱内容'
- this.isEdit = false
- this.parent_id = 0
- this.isAddChild = false
- this.templateTableVisible = false
- this.templateFormVisible = true
-
- }, deleteRecordAction: function() {
- if (this.table_current_index == -1) {
- this.$message.error('请选择一条医嘱记录')
- return
- }
- this.$confirm('删除记录', '是否删除该医嘱记录', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- this.adviceTableData.splice(this.table_current_index, 1)
- this.table_current_index = -1
- }).catch(() => {
- })
- }, tableRow({ row, rowIndex }) {
- // 把每一行的索引放进row
- row.index = rowIndex
- },
- onRowClick(row, event, column) {
- this.table_current_index = row.index
- }, modifyRecordAction: function() {
- if (this.table_current_index == -1) {
- this.$message.error('请选择一条医嘱记录')
- return
- }
-
- this.isEdit = true
- const adviceTable = this.adviceTableData[this.table_current_index]
- for (var index in adviceTable) {
- this.templateForm[index] = adviceTable[index]
- }
- this.templateForm.weekday = adviceTable.weekdays.split(',')
-
- this.templateFormVisible = true
- this.templateTableVisible = false
- this.dialogTitle = '编辑医嘱内容'
- this.advice_content_name = '医嘱内容'
- }, cancelTableHandle: function() {
- this.$confirm('放弃编辑', '是否放弃编辑,已编辑的数据将无法恢复', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- this.adviceTableData = []
- this.form.name = ''
- this.templateFormVisible = false
- this.templateTableVisible = false
- }).catch(() => {
- })
- }, submitTableTemplate(formName) {
- if (this.adviceTableData.length <= 0) {
- this.$message.error('至少添加一条医嘱信息')
- return
- }
-
- const params = {
- 'data': this.adviceTableData
- }
- this.form.name = encodeURIComponent(this.form.name)
- postAdviceTemplate(params, this.form.name, this.form.advice_type).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('添加模版成功')
-
- var template = response.data.data.template
- if (template.DoctorAdviceTemplate.length > 0) {
- for (let i = 0; i < template.DoctorAdviceTemplate.length; i++) {
- const object = {}
- const DoctorAdviceTemplate = template.DoctorAdviceTemplate[i]
- for (const key in DoctorAdviceTemplate) {
- object[key] = DoctorAdviceTemplate[key]
- }
- object['name'] = template.name
- object['isNoSub'] = 2
- this.adviceTemplates.unshift(object)
- }
- }
- this.handleSpanTempArr()
-
- this.form.name = ''
- this.adviceTableData = []
- this.templateFormVisible = false
- this.templateTableVisible = false
- }
- })
- },
- resetForm(formName) {
- this.$refs[formName].resetFields()
- },
- handleDeleteDrugDic(row, index) {
- this.$confirm('确认删除此医嘱模板?', '删除', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- })
- .then(() => {
- DeleteDrugDic(row.id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('删除成功')
- this.drugdics.splice(index, 1)
- }
- })
- })
- .catch(() => {
- })
- },
- handleDeleteAdviceTemplate(row, index) {
- this.$confirm('确认删除此医嘱模板?', '删除', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- })
- .then(() => {
- DeleteParentAdviceTemplate(row.template_id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('删除成功')
-
- // console.log(this.adviceTemplates.length)
- // for(let i = 0;i < this.adviceTemplates.length; i++){
- // if(this.adviceTemplates[i].template_id == row.template_id){
- // this.adviceTemplates.splice(i,1);
- // }
- // }
- this.getAdviceConfig()
- }
- })
- })
- .catch(() => {
- })
- },
- submitDrugDic(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (this.isEdit) {
- UpdateDrugDic(this.drugdicForm.id, this.drugdicForm).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('修改成功')
-
- this.drugdicFormVisible = false
- this.resetForm(formName)
- var drugdic = response.data.data.drugdic
- this.drugdics[this.currentIndex].name = drugdic.name
- this.drugdics[this.currentIndex].spec = drugdic.spec
- this.drugdics[this.currentIndex].spec_unit =
- drugdic.spec_unit
- this.drugdics[this.currentIndex].form = drugdic.form
- this.drugdics[this.currentIndex].form_unit =
- drugdic.form_unit
- this.drugdics[this.currentIndex].updated_time =
- drugdic.updated_time
- this.currentIndex = -1
- return false
- }
- }
- )
- } else {
- CreateDrugDic(this.drugdicForm).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('添加成功')
-
- this.drugdicFormVisible = false
- this.resetForm(formName)
- this.drugdics.unshift(response.data.data.drugdic)
- return false
- }
- })
- }
- }
- })
- },
- submitTemplate(formName) {
- this.$refs[formName].validate(valid => {
- this.templateForm.single_dose = parseFloat(this.templateForm.single_dose)
- this.templateForm.prescribing_number = parseFloat(this.templateForm.prescribing_number)
-
- if (isNaN(this.templateForm.single_dose)) {
- this.templateForm.single_dose = 0
- }
- if (isNaN(this.templateForm.prescribing_number)) {
- this.templateForm.prescribing_number = 0
- }
-
- if (valid) {
- const templateFormTwo = {}
- templateFormTwo.template_id = this.current_template_id
- templateFormTwo.advice_name = this.templateForm.advice_name
- templateFormTwo.advice_desc = this.templateForm.advice_desc
- templateFormTwo.drug_spec = this.templateForm.drug_spec
- templateFormTwo.drug_spec_unit = this.templateForm.drug_spec_unit
- templateFormTwo.single_dose = this.templateForm.single_dose
- templateFormTwo.single_dose_unit = this.templateForm.single_dose_unit
- templateFormTwo.prescribing_number = this.templateForm.prescribing_number
- templateFormTwo.prescribing_number_unit = this.templateForm.prescribing_number_unit
- templateFormTwo.delivery_way = this.templateForm.delivery_way
- templateFormTwo.execution_frequency = this.templateForm.execution_frequency
- templateFormTwo.parent_id = this.parent_id
-
- if (this.isAddChild) {
- CreateSubAdvice(templateFormTwo).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('添加成功')
-
- var spliceIndex = -1
- for (let index = this.adviceTemplates.length - 1; ; index--) {
- if (this.adviceTemplates[index].parent_id === templateFormTwo.parent_id) {
- spliceIndex = index
- break
- } else if (this.adviceTemplates[index].id === templateFormTwo.parent_id) {
- spliceIndex = index
- break
- }
- }
-
- if (spliceIndex > -1) {
- spliceIndex += 1
- if (spliceIndex === this.adviceTemplates.length) {
- const template = response.data.data.template
- template['isNoSub'] = 2
- this.adviceTemplates.push(template)
- } else {
- const template = response.data.data.template
- template['isNoSub'] = 2
- var swapData = this.adviceTemplates.splice(spliceIndex)
- this.adviceTemplates.push(template)
- this.adviceTemplates = this.adviceTemplates.concat(swapData)
- }
- }
- this.handleSpanTempArr()
- this.templateFormVisible = false
- this.resetForm(formName)
- return false
- }
- })
- } else {
-
- const templateFormTwo = {}
- templateFormTwo.advice_name = this.templateForm.advice_name
- templateFormTwo.advice_desc = this.templateForm.advice_desc
- templateFormTwo.drug_spec = this.templateForm.drug_spec
- templateFormTwo.drug_spec_unit = this.templateForm.drug_spec_unit
- templateFormTwo.single_dose = this.templateForm.single_dose
- templateFormTwo.single_dose_unit = this.templateForm.single_dose_unit
- templateFormTwo.prescribing_number = this.templateForm.prescribing_number
- templateFormTwo.prescribing_number_unit = this.templateForm.prescribing_number_unit
- templateFormTwo.delivery_way = this.templateForm.delivery_way
- templateFormTwo.execution_frequency = this.templateForm.execution_frequency
- templateFormTwo.parent_id = this.parent_id
-
- if (this.templateForm.frequency_type == 1) {
- templateFormTwo.frequency_type = this.templateForm.frequency_type
- templateFormTwo.day_count = '0'
- templateFormTwo.weekdays = ''
-
- } else if (this.templateForm.frequency_type == 2) {
-
- templateFormTwo.frequency_type = this.templateForm.frequency_type
- templateFormTwo.day_count = this.templateForm.day_count
- templateFormTwo.weekdays = ''
-
- } else if (this.templateForm.frequency_type == 3) {
- templateFormTwo.frequency_type = this.templateForm.frequency_type
- templateFormTwo.day_count = '0'
- templateFormTwo.weekdays = this.templateForm.weekday.filter(function(s) {
- return s && s.trim()
- }).join(',')
-
- }
-
- this.templateForm.advice_name = ''
- this.templateForm.advice_desc = ''
- this.templateForm.frequency_type = 1
- this.templateForm.day_count = ''
- this.templateForm.weekday = []
-
- console.log(templateFormTwo)
- if (this.isEdit) {
- for (let i = 0; i < this.adviceTableData.length; i++) {
- if (i == this.table_current_index) {
- this.adviceTableData[i].advice_name = templateFormTwo.advice_name
- this.adviceTableData[i].advice_desc = templateFormTwo.advice_desc
- this.adviceTableData[i].drug_spec = templateFormTwo.drug_spec
- this.adviceTableData[i].drug_spec_unit = templateFormTwo.drug_spec_unit
- this.adviceTableData[i].single_dose = templateFormTwo.single_dose
- this.adviceTableData[i].single_dose_unit = templateFormTwo.single_dose_unit
- this.adviceTableData[i].prescribing_number = templateFormTwo.prescribing_number
- this.adviceTableData[i].prescribing_number_unit = templateFormTwo.prescribing_number_unit
- this.adviceTableData[i].delivery_way = templateFormTwo.delivery_way
- this.adviceTableData[i].execution_frequency = templateFormTwo.execution_frequency
- this.adviceTableData[i].frequency_type = templateFormTwo.frequency_type
- this.adviceTableData[i].day_count = templateFormTwo.day_count
- this.adviceTableData[i].weekdays = templateFormTwo.weekdays
- }
- }
- } else {
- this.adviceTableData.unshift(templateFormTwo)
- console.log(this.adviceTableData)
- }
- this.templateFormVisible = false
- this.templateTableVisible = true
- }
-
- this.$refs[formName].resetFields()
- }
- })
- },
- handleCreateDrugWay() {
- this.drugwayForm = {
- name: '',
- id: 0
- }
- this.drugwayFormVisible = true
- this.dialogTitle = '新增给药途径'
- this.isEdit = false
- },
- handleUpdateDrugWay(row, index) {
- this.currentIndex = index
- this.drugwayForm = {
- name: row.name,
- id: row.id
- }
-
- this.drugwayFormVisible = true
- this.dialogTitle = '编辑给药途径'
- this.isEdit = true
- },
- submitDrugWay(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (this.isEdit) {
- UpdateDrugWay(this.drugwayForm.id, this.drugwayForm).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('修改成功')
-
- this.drugwayFormVisible = false
- this.resetForm(formName)
- var drugway = response.data.data.drugway
- this.drugways[this.currentIndex].name = drugway.name
- this.drugways[this.currentIndex].updated_time =
- drugway.updated_time
- this.currentIndex = -1
- return false
- }
- }
- )
- } else {
- CreateDrugWay(this.drugwayForm).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('添加成功')
- this.drugwayFormVisible = false
- this.resetForm(formName)
- this.drugways.unshift(response.data.data.drugway)
- return false
- }
- })
- }
- }
- })
- },
- handleDeleteDrugWay(row, index) {
- this.$confirm('确认删除此给药途径?', '删除', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- })
- .then(() => {
- DeleteDrugWay(row.id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('删除成功')
-
- this.drugways.splice(index, 1)
- }
- })
- })
- .catch(() => {
- })
- },
- handleCreateEF() {
- this.efForm = {
- name: '',
- id: 0
- }
- this.efFormVisible = true
- this.dialogTitle = '新增执行频率'
- this.isEdit = false
- },
- handleUpdateEF(row, index) {
- this.currentIndex = index
- this.efForm = {
- name: row.name,
- id: row.id
- }
-
- this.efFormVisible = true
- this.dialogTitle = '编辑执行频率'
- this.isEdit = true
- },
- submitEF(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (this.isEdit) {
- UpdateExecutionFrequency(this.efForm.id, this.efForm).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('修改成功')
-
- this.efFormVisible = false
- this.resetForm(formName)
- var ef = response.data.data.ef
- this.executionFrequencyOptions[this.currentIndex].name =
- ef.name
- this.executionFrequencyOptions[
- this.currentIndex
- ].updated_time = ef.updated_time
- this.currentIndex = -1
- return false
- }
- }
- )
- } else {
- CreateExecutionFrequency(this.efForm).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.error('添加成功')
-
- this.efFormVisible = false
- this.resetForm(formName)
- this.executionFrequencyOptions.unshift(response.data.data.ef)
- return false
- }
- })
- }
- }
- })
- },
- handleDeleteEF(row, index) {
- this.$confirm('确认删除此执行频率?', '删除', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- })
- .then(() => {
- DeleteExecutionFrequency(row.id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.error('删除成功')
-
- this.executionFrequencyOptions.splice(index, 1)
- }
- })
- })
- .catch(() => {
- })
- },
-
- getAdviceConfig() {
- this.adviceTemplates = []
- getAllAdviceConfig().then(response => {
- if (response.data.state == 1) {
- this.drugways = response.data.data.drugways
- this.executionFrequencyOptions = response.data.data.efs
- this.drugdics = response.data.data.drugs
- const len = response.data.data.advice_templates.length
-
- for (let i = 0; i < len; i++) {
- // 对于空医嘱模版的处理
- if (response.data.data.advice_templates[i] != null && response.data.data.advice_templates[i].DoctorAdviceTemplate.length == 0) {
- const object = {}
- object['name'] = response.data.data.advice_templates[i].name
- object['isNoSub'] = 1
- object['template_id'] = response.data.data.advice_templates[i].id
- this.adviceTemplates.push(object)
- }
-
- // 非空模版的处理
- for (let y = 0; y < response.data.data.advice_templates[i].DoctorAdviceTemplate.length; y++) {
- if (response.data.data.advice_templates[i].id == response.data.data.advice_templates[i].DoctorAdviceTemplate[y].template_id) {
- const object = {}
- const DoctorAdviceTemplate = response.data.data.advice_templates[i].DoctorAdviceTemplate[y]
- for (const key in DoctorAdviceTemplate) {
- object[key] = DoctorAdviceTemplate[key]
- }
- object['isNoSub'] = 2
- object['name'] = response.data.data.advice_templates[i].name
- this.adviceTemplates.push(object)
- }
- }
- }
-
- console.log(this.adviceTemplates)
-
- // 处理单元格合并的数据
- this.handleSpanTempArr()
- }
- })
- }, isShow(index, row) {
- if (index > 0 && row.name == this.adviceTemplates[index - 1].name) {
- return false
- }
- return true
- }, cancelEditHandle() {
- // this.templateTableVisible = true
- this.templateEditFormVisible = false
- }, submitEditTemplate(formName) {
- this.$refs[formName].validate(valid => {
- this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
- this.templateFormEdit.prescribing_number = parseFloat(this.templateFormEdit.prescribing_number)
-
- if (isNaN(this.templateFormEdit.single_dose)) {
- this.templateFormEdit.single_dose = 0
- }
- if (isNaN(this.templateFormEdit.prescribing_number)) {
- this.templateFormEdit.prescribing_number = 0
- }
- if (valid) {
- console.log(this.templateFormEdit)
-
- if (this.templateFormEdit.frequency_type == 1) {
-
- this.templateFormEdit.day_count = 0
- this.templateFormEdit.week_days = ''
-
- } else if (this.templateFormEdit.frequency_type == 2) {
- this.templateFormEdit.day_count = parseInt(this.templateFormEdit.day_count)
- this.templateFormEdit.week_days = ''
-
- } else if (this.templateFormEdit.frequency_type == 3) {
- this.templateFormEdit.day_count = 0
- this.templateFormEdit.week_days = this.templateFormEdit.weekday.filter(function(s) {
- return s && s.trim()
- }).join(',')
- }
-
- UpdateAdviceTemplate(this.templateFormEdit.id, this.templateFormEdit).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('修改成功')
- this.templateEditFormVisible = false
- this.resetForm(formName)
- var template = response.data.data.template
- this.adviceTemplates[this.currentIndex].advice_name = template.advice_name
- this.adviceTemplates[this.currentIndex].advice_desc = template.advice_desc
- this.adviceTemplates[this.currentIndex].drug_spec = template.drug_spec
- this.adviceTemplates[this.currentIndex].drug_spec_unit = template.drug_spec_unit
- this.adviceTemplates[this.currentIndex].single_dose = template.single_dose
- this.adviceTemplates[this.currentIndex].single_dose_unit = template.single_dose_unit
- this.adviceTemplates[this.currentIndex].delivery_way = template.delivery_way
- this.adviceTemplates[this.currentIndex].execution_frequency = template.execution_frequency
- this.adviceTemplates[this.currentIndex].prescribing_number = template.prescribing_number
- this.adviceTemplates[this.currentIndex].prescribing_number_unit = template.prescribing_number_unit
- this.adviceTemplates[this.currentIndex].day_count = template.day_count
- this.adviceTemplates[this.currentIndex].week_days = template.week_days
- this.adviceTemplates[this.currentIndex].frequency_type = template.frequency_type
- this.currentIndex = -1
- return false
- }
- }
- )
- }
- })
- }, drugDesc(row) {
- if (row.isNoSub == 2) {
- if (row.drug_spec.length <= 0) {
- return ''
- } else {
- if (row.prescribing_number == 0) {
- return row.drug_spec + '' + row.drug_spec_unit
- } else {
- return row.drug_spec + '' + row.drug_spec_unit + ' * ' + row.prescribing_number + row.prescribing_number_unit
- }
- }
- }
- }, drugDescTwo(row) {
- if (row.drug_spec.length <= 0) {
- return ''
- } else {
- if (row.prescribing_number == 0) {
- return row.drug_spec + '' + row.drug_spec_unit
- } else {
- return row.drug_spec + '' + row.drug_spec_unit + ' * ' + row.prescribing_number + row.prescribing_number_unit
- }
- }
- }, newRecordActionTwo() {
- this.templateFormTwoVisible = true
- }, deleteRecordActionTwo() {
- if (this.table_current_index_two == -1) {
- this.$message.error('请选择一条医嘱记录')
- return
- }
- this.$confirm('删除记录', '是否删除该医嘱记录', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- const id = this.adviceTableDataTwo[this.table_current_index_two].id
- const template_id = this.adviceTableDataTwo[this.table_current_index_two].template_id
-
- DeleteAdviceTemplate(id, template_id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('删除成功')
-
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- console.log(this.adviceTemplates[i].id)
- if (this.adviceTemplates[i].id == this.adviceTableDataTwo[this.table_current_index_two].id) {
- this.adviceTemplates.splice(i, 1)
- }
- }
- this.adviceTableDataTwo.splice(this.table_current_index_two, 1)
-
- this.table_current_index_two = -1
- }
- })
- }).catch(() => {
- })
- }, modifyRecordActionTwo() {
- if (this.table_current_index_two == -1) {
- this.$message.error('请选择一条医嘱记录')
- return
- }
-
- this.templateFormEdit = {
- drug_spec: this.adviceTableDataTwo[this.table_current_index_two].drug_spec,
- drug_spec_unit: this.adviceTableDataTwo[this.table_current_index_two].drug_spec_unit,
- advice_name: this.adviceTableDataTwo[this.table_current_index_two].advice_name,
- advice_desc: this.adviceTableDataTwo[this.table_current_index_two].advice_desc,
- single_dose: this.adviceTableDataTwo[this.table_current_index_two].single_dose,
- single_dose_unit: this.adviceTableDataTwo[this.table_current_index_two].single_dose_unit,
- prescribing_number: this.adviceTableDataTwo[this.table_current_index_two].prescribing_number,
- prescribing_number_unit: this.adviceTableDataTwo[this.table_current_index_two].prescribing_number_unit,
- delivery_way: this.adviceTableDataTwo[this.table_current_index_two].delivery_way,
- execution_frequency: this.adviceTableDataTwo[this.table_current_index_two].execution_frequency,
- id: this.adviceTableDataTwo[this.table_current_index_two].id
- }
- this.templateEditFormTwoVisible = true
- }, tableRowClassNameTwo({ row, rowIndex }) {
- // 把每一行的索引放进row
- row.index = rowIndex
- },
- onRowClickTwo(row, event, column) {
- this.table_current_index_two = row.index
- }, cancelHandleTwo() {
- this.templateFormTwoVisible = false
- }, submitTemplateTwo(formName) {
- this.templateForm['template_id'] = this.current_template_id
- this.templateForm['advice_type'] = this.form.advice_type
-
- if (this.templateForm.frequency_type == 1) {
- this.templateForm.day_count = 0
- this.templateForm.week_days = ''
- } else if (this.templateForm.frequency_type == 2) {
- this.templateForm.day_count = parseInt(this.templateForm.day_count)
- this.templateForm.week_days = ''
- } else if (this.templateForm.frequency_type == 3) {
- this.templateForm.day_count = 0
- this.templateForm.week_days = this.templateForm.weekday.filter(function(s) {
- return s && s.trim()
- }).join(',')
- }
- CreateSingleAdviceTemplate(this.templateForm).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- const source = response.data.data.template
- const objects = {}
- for (const keys in source) {
- objects[keys] = source[keys]
- }
- objects['name'] = this.current_template_name
- objects['isNoSub'] = 2
-
- this.adviceTableDataTwo.unshift(response.data.data.template)
- this.getAdviceConfig()
- this.resetForm(formName)
- this.templateFormTwoVisible = false
- this.$message.success('添加成功')
- this.templateForm.day_count = ''
- this.templateForm.weekday = []
- this.templateForm.frequency_type = 1
-
- return false
- }
- })
- }, cancelTableHandleTwo() {
- this.templateTableTwoVisible = false
- this.adviceTableDataTwo = []
- }, cancelEditHandleTwo() {
- this.templateEditFormTwoVisible = false
- }, submitEditTemplateTwo(formName) {
- this.$refs[formName].validate(valid => {
- this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
- this.templateFormEdit.prescribing_number = parseFloat(this.templateFormEdit.prescribing_number)
-
- if (isNaN(this.templateFormEdit.single_dose)) {
- this.templateFormEdit.single_dose = 0
- }
- if (isNaN(this.templateFormEdit.prescribing_number)) {
- this.templateFormEdit.prescribing_number = 0
- }
- if (valid) {
- UpdateAdviceTemplate(this.templateFormEdit.id, this.templateFormEdit).then(
- response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('修改成功')
-
- this.templateEditFormTwoVisible = false
- this.resetForm(formName)
- var template = response.data.data.template
- this.adviceTableDataTwo[this.table_current_index_two].advice_name = template.advice_name
- this.adviceTableDataTwo[this.table_current_index_two].advice_desc = template.advice_desc
- this.adviceTableDataTwo[this.table_current_index_two].drug_spec = template.drug_spec
- this.adviceTableDataTwo[this.table_current_index_two].drug_spec_unit = template.drug_spec_unit
- this.adviceTableDataTwo[this.table_current_index_two].single_dose = template.single_dose
- this.adviceTableDataTwo[this.table_current_index_two].single_dose_unit = template.single_dose_unit
- this.adviceTableDataTwo[this.table_current_index_two].delivery_way = template.delivery_way
- this.adviceTableDataTwo[this.table_current_index_two].execution_frequency = template.execution_frequency
- this.adviceTableDataTwo[this.table_current_index_two].prescribing_number = template.prescribing_number
- this.adviceTableDataTwo[this.table_current_index_two].prescribing_number_unit = template.prescribing_number_unit
-
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].id == this.adviceTableDataTwo[this.table_current_index_two].id) {
- this.adviceTemplates[i].advice_name = template.advice_name
- this.adviceTemplates[i].advice_desc = template.advice_desc
- this.adviceTemplates[i].drug_spec = template.drug_spec
- this.adviceTemplates[i].drug_spec_unit = template.drug_spec_unit
- this.adviceTemplates[i].single_dose = template.single_dose
- this.adviceTemplates[i].single_dose_unit = template.single_dose_unit
- this.adviceTemplates[i].delivery_way = template.delivery_way
- this.adviceTemplates[i].execution_frequency = template.execution_frequency
- this.adviceTemplates[i].prescribing_number = template.prescribing_number
- this.adviceTemplates[i].prescribing_number_unit = template.prescribing_number_unit
- }
- }
- return false
- }
- }
- )
- }
- })
- }, merge({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0 || columnIndex === 1 || columnIndex === 9) {
- const _row = this.tempArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- }, tableRowClassNames({ row, rowIndex }) {
- const arr = this.hoverOrderArr
- for (let i = 0; i < arr.length; i++) {
- if (rowIndex == arr[i]) {
- return 'success-row'
- }
- }
- }, cellMouseEnter: function(row, column, cell, event) {
- if (column.label == '模版名称') {
- this.sameRowArr.forEach((arr, i) => {
- if (arr.indexOf(row.index) != -1) {
- this.hoverOrderArr = arr
- }
- })
- } else if (column.label == '操作') {
- this.sameRowArr.forEach((arr, i) => {
- if (arr.indexOf(row.index) != -1) {
- this.hoverOrderArr = arr
- }
- })
- } else {
- this.hoverOrderArr = []
- }
- }, cellMouseLeave: function(row, column, cell, event) {
- this.hoverOrderArr = []
- }, openEdit(index, row) {
- console.log(row)
- this.hoverOrderArr = []
- this.currentIndex = index
- this.templateFormEdit.drug_spec_unit = row.drug_spec_unit
- this.templateFormEdit.drug_spec = row.drug_spec
- this.templateFormEdit.advice_desc = row.advice_desc
- this.templateFormEdit.advice_name = row.advice_name
- this.templateFormEdit.delivery_way = row.delivery_way
- this.templateFormEdit.execution_frequency = row.execution_frequency
- this.templateFormEdit.prescribing_number = row.prescribing_number
- this.templateFormEdit.prescribing_number_unit = row.prescribing_number_unit
- this.templateFormEdit.single_dose = row.single_dose
- this.templateFormEdit.single_dose_unit = row.single_dose_unit
- this.templateFormEdit.id = row.id
- this.templateFormEdit.parent_id = row.parent_id
- this.templateFormEdit.day_count = row.day_count
- this.templateFormEdit.frequency_type = row.frequency_type
- this.templateFormEdit.weekday = row.week_days.split(',')
-
- this.templateEditFormVisible = true
- if (row.parent_id > 0) {
- this.editDialogTitle = '编辑子药'
- this.edit_advice_name = '子药名称'
- } else {
- this.editDialogTitle = '编辑医嘱'
- this.edit_advice_name = '医嘱内容'
- }
- }, openDelete(index, row) {
- this.hoverOrderArr = []
-
- this.$confirm('删除记录', '是否删除该医嘱', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- const id = row.id
- const template_id = row.template_id
- const parent_id = row.parent_id
- DeleteAdviceTemplate(id, template_id, parent_id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('删除成功')
-
- if (row.parent_id > 0) { // 删除子医嘱
- this.adviceTemplates.splice(index, 1)
- } else { // 如果医嘱下面包含子医嘱,删除医嘱和子医嘱
- // 删除子医嘱
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].parent_id == row.id) {
- this.adviceTemplates.splice(i--, 1)
- }
- }
- // 删除医嘱
- this.adviceTemplates.splice(index, 1)
-
- // 当该模版下没有医嘱的时候,创建一个空模版
- let count = 0 // 用于计数
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].template_id == row.template_id) {
- count = count + 1
- }
- }
- if (count == 0) {
- const object = {}
- object['name'] = row.name
- object['isNoSub'] = 1
- object['template_id'] = row.template_id
- this.adviceTemplates.splice(index, 0, object)
- }
- }
-
- // 处理单元格合并的数据
- this.handleSpanTempArr()
- }
- })
- }).catch(() => {
- })
- }, openDeleteChild(index, row) {
- this.hoverOrderArr = []
-
- this.$confirm('删除子药', '是否删除该子药', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- const id = row.id
- const template_id = row.template_id
- const parent_id = row.parent_id
- DeleteAdviceTemplate(id, template_id, parent_id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('删除成功')
-
- if (row.parent_id > 0) { // 删除子医嘱
- this.adviceTemplates.splice(index, 1)
- } else { // 如果医嘱下面包含子医嘱,删除医嘱和子医嘱
- // 删除子医嘱
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].parent_id == row.id) {
- this.adviceTemplates.splice(i--, 1)
- }
- }
- // 删除医嘱
- this.adviceTemplates.splice(index, 1)
-
- // 当该模版下没有医嘱的时候,创建一个空模版
- let count = 0 // 用于计数
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].template_id == row.template_id) {
- count = count + 1
- }
- }
- if (count == 0) {
- const object = {}
- object['name'] = row.name
- object['isNoSub'] = 1
- object['template_id'] = row.template_id
- this.adviceTemplates.splice(index, 0, object)
- }
- }
-
- // 处理单元格合并的数据
- this.handleSpanTempArr()
- }
- })
- }).catch(() => {
- })
- },
- openNewChild(index, row) {
- this.hoverOrderArr = []
-
- this.current_template_id = row.template_id
- this.parent_id = row.id
- this.isAddChild = true
- this.isEdit = false
- this.templateFormVisible = true
- this.dialogTitle = '新增子药'
- this.advice_content_name = '子药名称'
- }, deleteRecordAction: function() {
- if (this.table_current_index == -1) {
- this.$message.error('请选择一条医嘱记录')
- return
- }
- this.$confirm('删除记录', '是否删除该医嘱记录', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- this.adviceTableData.splice(this.table_current_index, 1)
- this.table_current_index = -1
- }).catch(() => {
- })
- }, handleSpanTempArr() {
- this.tempArr = []
-
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (i === 0) {
- this.tempArr.push(1)
- this.pos = 0
- } else {
- // 判断当前元素与上一个元素是否相同
- if (this.adviceTemplates[i].template_id === this.adviceTemplates[i - 1].template_id) {
- this.tempArr[this.pos] += 1
- this.tempArr.push(0)
- } else {
- this.tempArr.push(1)
- this.pos = i
- }
- }
- }
-
- let sameRowArr = [], sIdx = 0
- this.adviceTemplates.forEach((item, index) => {
- item.index = index
- if (index === 0) {
- sameRowArr.push([index])
- } else {
- if (item.template_id === this.adviceTemplates[index - 1].template_id) {
- sameRowArr[sIdx].push(index)
- } else {
- sIdx = sIdx + 1
- sameRowArr.push([index])
- }
- }
- })
- this.sameRowArr = sameRowArr
- }, handleUpdateAdviceTemplate(row, index) {
- this.current_template_id = row.template_id
- this.current_template_name = row.name
- this.form.name = row.name
- this.form.advice_type = row.advice_type
- this.templateTableTwoVisible = true
- this.adviceTableDataTwo = []
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].template_id == row.template_id) {
- this.adviceTableDataTwo.push(this.adviceTemplates[i])
- }
- }
- }, modifyTemplateName() {
- const params = {
- template_name: this.form.name,
- template_id: this.current_template_id
- }
- updateTemplateName(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$message.success('修改成功')
-
- this.templateTableTwoVisible = false
-
- for (let i = 0; i < this.adviceTemplates.length; i++) {
- if (this.adviceTemplates[i].template_id == this.current_template_id) {
- this.adviceTemplates[i].name = response.data.data.template_name
- }
- }
- }
- })
- }, changeRemind(val) {
- let params = {
- 'is_open_remind': val,
- }
-
- postDoctorAdviceConfig(params).then(response => {
- if (response.data.state == 1) {
- this.is_open_remind = response.data.data.is_open_remind
- if (response.data.data.is_open_remind == 1) {
- this.$message.success('开启成功')
- } else {
- this.$message.success('关闭成功')
- }
- } else {
- this.$message.error(response.data.msg)
-
- }
- })
-
- }
- }
- }
- </script>
- <style>
- .center th .cell {
- text-align: center !important;
- }
-
- .templateadvicenamedisplay .cell {
- float: left;
- text-align: left;
- }
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- </style>
-
|