123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911 |
- <template>
- <div class="doctor-advice-box">
- <el-dialog
- :title="title"
- :visible.sync="isVisibility"
- width="1010px"
- @close="resetDialog"
- :modal-append-to-body="false"
- >
- <div class="txsj" v-show="showAdvicePanel">
- <el-button
- round
- @click="openGroupFrom"
- :loading="deleLoading"
- :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"
- :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"
- :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>
- <!-- 医嘱列表 -->
- <!--<!–:header-cell-style="{ backgroundColor: 'rgb(64, 158, 255)', color: 'white'}"–>@current-change="selectRow"-->
- <el-table
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- :data="doctor_advices"
- border
- style="width: 100%"
- v-show="showAdvicePanel"
- ref="advices_list"
- :row-class-name="tableRowClassName"
- :span-method="objectSpanMethod"
- @row-click="cellMouseEnter"
- :cell-class-name="adviceNameShow"
- :modal-append-to-body="false"
- highlight-current-row
- @current-change="handleCurrentChange"
- >
- <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
- @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="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
- @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-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.start_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 -->
-
- <!-- 医嘱表单 -->
- <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-input value="临时" disabled></el-input>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <!--<el-col :span="8">-->
- <!--<el-form-item label="医嘱时间:">-->
- <!--<el-input v-model="form.advice_date" readonly></el-input>-->
- <!--<!– <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker> –>-->
- <!--</el-form-item>-->
- <!--</el-col>-->
- <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-input v-model="form.advice_name"></el-input>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="药品规格:">
- <el-input
- v-model="form.advice_desc"
- style="width: 40%;"
- ></el-input>
- <el-select
- v-model="form.drug_spec_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-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-input v-model="form.prescribing_number_unit" style="width: 40%;"></el-input> -->
- </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-input v-model="form.single_dose_unit" style="width: 40%;"></el-input> -->
- </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,
- DeleteDoctorAdvice,
- DeleteGroupAdvice,
- EditDoctorAdvice,
- ExecDoctorAdvice,
- getAdviceConfig
- } from "@/api/advice";
- import { getDataConfig } from "@/utils/data";
-
- import request from "@/utils/request";
-
- 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 {
- 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: "临时医嘱",
- 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
- },
- 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: "" }
- };
- },
- 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: {
- // 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;
- // console.log("advice-------", 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.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;
- } 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
- };
- } 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;
- }
- },
- submitExce() {
- if (this.currentRow == null) {
- this.$message.error("请先选择要执行的医嘱!");
- return false;
- }
- if (this.execTime.length == 0) {
- this.$message.error("请选择执行时间!");
- return false;
- }
-
- var execTime = Math.round(new Date(this.execTime).getTime() / 1000);
- if (execTime < this.currentRow.start_time) {
- this.$message.error("执行医嘱不能在开始之前!");
- return false;
- }
- this.exceLoading = true;
- let mode = "6";
-
- ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode)
- .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";
-
- 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
- };
- },
-
- 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
- };
- },
-
- openEditGroupAdvice() {
- if (this.groupSelectRow === null) {
- this.$message.error("未选择要修改的医嘱内容");
- return;
- }
-
- this.$refs.editGroupForm.open(this.groupSelectRow.groupno);
- },
-
- openGroupFrom() {
- this.$refs.addGroupForm.open();
-
- // this.title="新增医嘱";
-
- // this.showGroupForm = true;
- // this.showAdviceForm = false;
- // this.showAdvicePanel = false;
- // this.$refs.advices_list.setCurrentRow(null);
-
- // this.currentIndex = -1;
- // this.currentRow = null;
-
- // this.groupForm.advice_date = this.record_date;
- // this.form = {
- // id: 0,
- // advice_type: 2,
- // advice_date: this.record_date,
- // start_time: "",
- // advice_name: "",
- // advice_desc: "",
- // single_dose: "",
- // single_dose_unit: "",
- // prescribing_number: "",
- // prescribing_number_unit: "",
- // delivery_way: "",
- // execution_frequency: "",
- // advice_doctor: "",
- // remark: "",
- // parent_id: 0
- // };
- },
- checkAdvice() {
- 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).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;
- }
-
- // 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;
- }
- console.log("b");
- 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);
- }
- }
- console.log("c");
- 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() {
- 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].groupno ===
- this.doctor_advices[i - 1].groupno
- ) {
- this.tempArr[this.pos] += 1;
- this.tempArr.push(0);
- } else {
- this.tempArr.push(1);
- this.pos = i;
- }
- }
- }
- },
- cellMouseEnter: function(row, column, event) {
- 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.groupno === this.doctor_advices[index - 1].groupno) {
- 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 + ")";
- }
-
- 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(val) {
- console.log("val是什么", val);
- },
- 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
- };
- }
- }
- }
- },
- 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;
- console.log("医嘱----", this.doctor_advices);
- },
- 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 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>-->
|