123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997 |
- <template>
- <div>
- <div class="Dialog" v-show="index==0" style="width: 16.8rem;">
- <div class="DialogTit" @click="$emit('orderDialog')">
- <span class="iconfont"></span>
- <h1 class="name">临时医嘱</h1>
- <span class="success"> </span>
- <!-- <span class="success" @click="$emit('orderDialog')">完成</span> -->
- </div>
- <div class="DialogContent choose" id="dialogTop">
- <div class="content clearfix">
- <div class="yzNav" style="width:80%;">
- <span @click="openNewAdvice">新增医嘱</span>
- <!-- <span>修改医嘱</span> -->
- <span @click="deleteAdvice">删除医嘱</span>
- <span @click="execAdvice">执行医嘱</span>
- <span @click="checkAdvice">医嘱核对</span>
- <span @click="openNewChild">添加子药</span>
- </div>
- <table class="table">
- <tr @click="selectRow(-1, null)">
- <th width="12%">开嘱医生</th>
- <th width="18%">开始时间</th>
- <th width="30%">医嘱内容</th>
- <th width="15%">执行时间</th>
- <th width="12%">执行护士</th>
- <th width="12%">核对人员</th>
- </tr>
- <tr
- v-for="(advice,index) in adviceList"
- :key="index"
- :value="advice.advice_name"
- @click="selectRow(index, advice)"
- :class="index==currentIndex?rowClass:''"
- >
- <td>
- <span v-if="advice.parent_id==0">{{getXuserName(advice.advice_doctor)}}</span>
- <span v-else></span>
- </td>
- <td>
- <span
- v-if="advice.parent_id==0"
- >{{ uParseTime(advice.start_time, "{y}-{m}-{d} {h}:{i}")}}</span>
- <span v-else></span>
- </td>
- <td>
- <span>{{advice.advice_name }}</span>
- <span
- v-if="advice.prescribing_number"
- >{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
- <!-- <span >{{advice.advice_desc}}</span> -->
- <span
- v-if="advice.single_dose"
- >单次用量 {{advice.single_dose}}{{advice.single_dose_unit}}</span>
- <span>{{advice.delivery_way}}</span>
- <span>{{advice.execution_frequency}}</span>
- </td>
- <td>
- <span
- v-if="advice.execution_time!=0"
- >{{ uParseTime(advice.execution_time, "{y}-{m}-{d} {h}:{i}")}}</span>
- </td>
- <td>
- <span v-if="advice.parent_id==0">{{getXuserName(advice.execution_staff)}}</span>
- </td>
- <td>{{getXuserName(advice.checker)}}</td>
- </tr>
- </table>
- </div>
- <!-- <div class="footer">
- 开嘱医生:{{doctor}} 医生
- </div>-->
- </div>
- </div>
- <div class="Dialog" v-show="index==2&&isShowDialog">
- <div class="DialogTit">
- <div class="back" @click="index=0">
- <span class="iconfont"></span>返回
- </div>
- <h1 class="name">编辑医嘱</h1>
- <span class="success" @click="submitNewAdvice">完成</span>
- </div>
- <div class="DialogContent choose advice-top" id="advice-top">
- <div class="content clearfix">
- <div>
- <div class="cell">
- <label>医嘱类型</label>
- <!-- <input type="text" class="inputBox" disabled value="临时"> -->
-
- <el-input ref="advice_type" value="临时" disabled></el-input>
- </div>
- <div class="cell">
- <label>医嘱时间</label>
- <el-input v-model="adviceForm.advice_date" readonly></el-input>
- <!-- <input type="text" class="inputBox" v-model="adviceForm.advice_date" readonly> -->
- </div>
- <div class="cell">
- <label>开始时间</label>
- <el-input v-model="adviceForm.start_time" readonly @focus="chooseTime"></el-input>
- <!-- <input type="text" class="inputBox" v-model="adviceForm.start_time" readonly @click="chooseTime"> -->
- </div>
- <div class="cell">
- <label>医嘱名称</label>
- <el-input v-model="adviceForm.advice_name"></el-input>
-
- <!-- <el-input v-model="adviceForm.advice_name" readonly @focus="showSubMenu('advice_name')" ></el-input> -->
-
- <!-- <el-select v-model="adviceForm.advice_name" @change="changeAdviceName" filterable placeholder="请选择(输入可搜索)" >
- <el-option v-for="item in drugOptions" :key="item.id" :label="item.name" :value="item.id">
- <span >{{ item.name }}</span>
- <span >{{ item.spec }}</span>
- </el-option>
- </el-select>-->
- </div>
- <div class="cell">
- <label>给药途径</label>
-
- <el-input
- v-model="adviceForm.delivery_way"
- readonly
- @focus="showSubMenu('delivery_way')"
- :disabled="adviceForm.parent_id==0?false:true"
- ></el-input>
-
- <!-- <el-select v-model="adviceForm.delivery_way" :disabled="adviceForm.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>-->
- </div>
- <div class="cell">
- <label>执行频率</label>
- <!-- <el-select v-model="adviceForm.execution_frequency" :disabled="adviceForm.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-input
- v-model="adviceForm.execution_frequency"
- readonly
- @focus="showSubMenu('execution_frequency')"
- :disabled="adviceForm.parent_id==0?false:true"
- ></el-input>
- </div>
- <div class="cell">
- <label>医嘱描述</label>
- <!-- <input type="text" class="inputBox" v-model="adviceForm.advice_desc"> -->
- <el-input v-model="adviceForm.advice_desc"></el-input>
- </div>
- <div class="cell">
- <label>单次用量</label>
- <input
- type="number"
- class="inputBox"
- style="width:60%"
- v-model="adviceForm.single_dose"
- >
- <input
- type="text"
- readonly
- class="inputBox"
- style="width:35%"
- v-model="adviceForm.single_dose_unit"
- @focus="showSubMenu('single_dose_unit')"
- >
- </div>
- <div class="cell">
- <label>开药数量</label>
- <input
- type="number"
- class="inputBox"
- style="width:60%"
- v-model="adviceForm.prescribing_number"
- >
- <input
- type="text"
- readonly
- class="inputBox"
- style="width:35%"
- v-model="adviceForm.prescribing_number_unit"
- @focus="showSubMenu('prescribing_number_unit')"
- >
- </div>
- <div class="cell width">
- <label>开嘱医生:</label>
- <span>{{doctor}}</span>
- </div>
- <!-- <div class="cell width center">
- <button @click="submitNewAdvice">提交</button>
- <button class="smt-danger" @click="index=0">返回</button>
- </div>-->
- </div>
- </div>
- <!-- <div class="footer">
- 开嘱医生:{{doctor}} 医生
- </div>-->
- </div>
- </div>
-
- <add-new-order-dialog
- v-show="index==1&&isShowDialog"
- @back-action="index = 0"
- :patient_id="patient.id"
- :delivery_way_options="deliveryWayOptions"
- :execution_frequency_options="executionFrequencyOptions"
- :single_dose_unit_options="unitsOption"
- :prescribing_number_unit_options="unitsOption"
- :drug_spec_unit_options="unitsOption"
- :advice_templates="adviceTemplates"
- @did-create-advices="didCreateAdvices"
- ></add-new-order-dialog>
-
- <mt-datetime-picker ref="picker" type="datetime" @confirm="handleConfirm" v-model="nowTime"></mt-datetime-picker>
-
- <mt-datetime-picker
- ref="exec_time"
- type="datetime"
- @confirm="handleExecTime"
- v-model="nowExecTime"
- ></mt-datetime-picker>
-
- <check-box-sub-menu
- :visibility="visibility"
- v-on:menu-cancle="menuCancle"
- v-on:menu-comfirm="menuComfirm"
- :propsForm="propForm"
- ></check-box-sub-menu>
- </div>
- </template>
-
- <script>
- import { Dialog, DatetimePicker, Toast } from "vant";
- import {
- getAdviceConfig,
- CreateDoctorAdvice,
- DeleteDoctorAdvice,
- ExecDoctorAdvice,
- CheckDoctorAdvice
- } from "@/api/advice";
- import { uParseTime } from "@/utils/tools";
- import CheckBoxSubMenu from "./subMenu/checkBoxSubMenu";
- import { getDataConfig } from "@/utils/data";
- import AddNewOrderDialog from "./new_order/AddNewOrders";
-
- export default {
- name: "OrdersDialog",
- data() {
- return {
- isShowDialog: true,
-
- visibility: false,
- propForm: {
- title: "",
- list: [],
- optionList: [],
- isMultiple: 2,
- result: [], //选中的值
- type: 1, //用来区分不同子菜单,方便对返回值进行赋值
- selectId: 0
- },
-
- showDeliveryWayBtn: false,
- showAdviceNameBtn: false,
- showExecutionFrequencyBtn: false,
- rowClass: "row-class-active",
- currentIndex: -1,
- currentRow: null,
- title: "临时医嘱",
- index: 0,
- doctor: "",
- adviceTemplates: [],
- adviceTemplateMaps: {},
- drugOptions: {},
- deliveryWayOptions: [],
- deliveryWayOjb: {},
- executionFrequencyOptions: [],
- executionFrequencyObj: {},
- unitsOption: [],
- unitsObj: [],
- record_date: "",
- nowTime: new Date(),
- nowExecTime: new Date(),
- patient: {
- id: 0
- },
- admin_users: [],
- adviceForm: {
- 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
- },
- adviceList: [],
- parent_id: 0
- };
- },
- methods: {
- didCreateAdvices: function(advices) {
- for (let index = 0; index < advices.length; index++) {
- const advice = advices[index];
- this.adviceList.push(advice);
- this.$emit("new_create", advice);
- }
- this.index = 0;
- },
- showSubMenu: function(val) {
- switch (val) {
- case "advice_name":
- this.propForm.type = 1;
- this.isShowDialog = false;
- this.propForm.title = "选择";
- this.visibility = true;
- this.propForm.list = [];
- this.propForm.optionList = this.adviceTemplateMaps;
- this.propForm.isMultiple = 1;
- this.propForm.selectId = this.adviceForm.template_id;
- break;
- case "delivery_way":
- this.propForm.type = 2;
- this.isShowDialog = false;
- this.propForm.title = "选择";
- this.visibility = true;
- this.propForm.list = [];
- this.propForm.optionList = this.deliveryWayOptions;
- this.propForm.isMultiple = 1;
- this.propForm.selectId = this.adviceForm.jjtj_id;
- break;
- case "execution_frequency":
- this.propForm.type = 3;
- this.isShowDialog = false;
- this.propForm.title = "选择";
- this.visibility = true;
- this.propForm.list = [];
- this.propForm.optionList = this.executionFrequencyOptions;
- this.propForm.isMultiple = 1;
- this.propForm.selectId = this.adviceForm.zxpl_id;
- break;
- case "single_dose_unit":
- this.propForm.type = 4;
- this.isShowDialog = false;
- this.propForm.title = "选择";
- this.visibility = true;
- this.propForm.list = [];
- this.propForm.optionList = this.unitsOption;
- this.propForm.isMultiple = 1;
- this.propForm.selectId = this.adviceForm.sdu_id;
- break;
-
- case "prescribing_number_unit":
- this.propForm.type = 5;
- this.isShowDialog = false;
- this.propForm.title = "选择";
- this.visibility = true;
- this.propForm.list = [];
- this.propForm.optionList = this.unitsOption;
- this.propForm.isMultiple = 1;
- this.propForm.selectId = this.adviceForm.pnu_id;
- break;
- }
- },
- menuCancle: function() {
- this.visibility = false;
- this.isShowDialog = true;
- },
- menuComfirm: function(val) {
- this.visibility = false;
- this.isShowDialog = true;
-
- switch (val.type) {
- case 1:
- if (val.selectId in this.adviceTemplateMaps) {
- this.selectAdviceName(val.selectId);
- this.adviceForm.template_id = val.selectId;
- }
- break;
- case 2:
- if (val.selectId in this.deliveryWayOjb) {
- this.adviceForm.jjtj_id = val.selectId;
- this.adviceForm.delivery_way = this.deliveryWayOjb[
- val.selectId
- ].name;
- }
- break;
- case 3:
- if (val.selectId in this.executionFrequencyObj) {
- this.adviceForm.zxpl_id = val.selectId;
- this.adviceForm.execution_frequency = this.executionFrequencyObj[
- val.selectId
- ].name;
- }
- break;
- case 4:
- if (val.selectId in this.unitsObj) {
- this.adviceForm.sdu_id = val.selectId;
- this.adviceForm.single_dose_unit = this.unitsObj[val.selectId].name;
- }
- break;
- case 5:
- if (val.selectId in this.unitsObj) {
- this.adviceForm.pnu_id = val.selectId;
- this.adviceForm.prescribing_number_unit = this.unitsObj[
- val.selectId
- ].name;
- }
- break;
- }
- },
-
- selectRow(index, row) {
- this.currentIndex = index;
- this.currentRow = row;
- },
- uParseTime(time, format) {
- return uParseTime(time, format);
- },
- 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;
- },
- submitNewAdvice() {
- if (this.adviceForm.advice_name.length == 0) {
- Toast("请填写医嘱名称");
- return;
- }
- if (this.adviceForm.start_time.length == 0) {
- Toast("请选择开始时间");
- return;
- }
- Toast.loading({ forbidClick: true, duration: 0 });
- CreateDoctorAdvice(this.patient.id, this.adviceForm).then(response => {
- if (response.data.state == 0) {
- Toast.fail(response.data.msg);
- return false;
- } else {
- Toast.success("添加成功");
- if (this.adviceForm.parent_id > 0) {
- var spliceIndex = -1;
- for (let index = this.adviceList.length - 1; ; index--) {
- if (
- this.adviceList[index].parent_id === this.adviceForm.parent_id
- ) {
- spliceIndex = index;
- break;
- } else if (
- this.adviceList[index].id === this.adviceForm.parent_id
- ) {
- spliceIndex = index;
- break;
- }
- }
- if (spliceIndex > -1) {
- spliceIndex += 1;
- if (spliceIndex === this.adviceList.length) {
- this.adviceList.push(response.data.data.advice);
- } else {
- var swapData = this.adviceList.splice(spliceIndex);
- this.adviceList.push(response.data.data.advice);
- for (var index in swapData) {
- this.adviceList.push(swapData[index]); // = this.doctor_advices.concat(swapData);
- }
-
- // this.adviceList = this.adviceList.concat(swapData);
- }
- }
- } else {
- this.adviceList.unshift(response.data.data.advice);
- }
- this.currentIndex = -1;
- this.currentRow = null;
- this.index = 0;
- this.$emit("new_create", response.data.data.advice);
- return false;
- }
- });
- },
- chooseTime() {
- this.$refs.picker.open();
- },
- changeAdviceName(change) {
- this.adviceForm.advice_name = this.drugOptions[change].name;
- this.adviceForm.advice_desc = this.drugOptions[change].spec;
- this.adviceForm.single_dose_unit = this.drugOptions[change].spec_unit;
- this.adviceForm.prescribing_number_unit = this.drugOptions[
- change
- ].form_unit;
- },
- selectAdviceName(key) {
- if (key in this.adviceTemplateMaps) {
- this.adviceForm.advice_name = this.adviceTemplateMaps[key].advice_name;
- this.adviceForm.advice_desc = this.adviceTemplateMaps[key].advice_desc;
- this.adviceForm.single_dose_unit = this.adviceTemplateMaps[
- key
- ].single_dose_unit;
- this.adviceForm.prescribing_number_unit = this.adviceTemplateMaps[
- key
- ].prescribing_number_unit;
- this.adviceForm.single_dose =
- this.adviceTemplateMaps[key].single_dose + "";
- this.adviceForm.prescribing_number =
- this.adviceTemplateMaps[key].prescribing_number + "";
- this.adviceForm.delivery_way = this.adviceTemplateMaps[
- key
- ].delivery_way;
- this.adviceForm.execution_frequency = this.adviceTemplateMaps[
- key
- ].execution_frequency;
- }
- },
- 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;
-
- var dl = this.deliveryWayOptions.length;
- for (let index = 0; index < dl; index++) {
- this.deliveryWayOjb[
- this.deliveryWayOptions[index].id
- ] = this.deliveryWayOptions[index];
- }
- var el = this.executionFrequencyOptions.length;
- for (let index = 0; index < el; index++) {
- this.executionFrequencyObj[
- this.executionFrequencyOptions[index].id
- ] = this.executionFrequencyOptions[index];
- }
-
- 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++) {
- var item = this.adviceTemplates[index];
- // item['name'] = item.advice_name
- this.$set(
- this.adviceTemplateMaps,
- this.adviceTemplates[index].id,
- item
- );
- }
- }
- });
- },
- handleConfirm(time) {
- this.adviceForm.start_time = this.handleTime(time);
- },
-
- handleExecTime(time) {
- var exceTime = this.handleTime(time);
- var exceParams = {
- id: this.currentRow.id,
- patient: this.patient.id,
- parent_id: this.currentRow.parent_id,
- execution_time: exceTime
- };
-
- Toast.loading({ forbidClick: true, duration: 0 });
- ExecDoctorAdvice(exceParams).then(response => {
- if (response.data.state == 0) {
- Toast.fail("执行失败!");
- return false;
- } else {
- Toast.success("执行成功!");
- var exid = response.data.data.advice.id;
- var pxid = response.data.data.advice.parent_id;
- if (pxid > 0) {
- exid = pxid;
- }
-
- 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;
-
- // if (exceParams.parent_id > 0) {
- // exid = exceParams.parent_id;
- // }
- var alen = this.adviceList.length;
- for (let index = 0; index < alen; index++) {
- if (
- this.adviceList[index].id == exid ||
- this.adviceList[index].parent_id == exid
- ) {
- this.adviceList[index].execution_state = 1;
- this.adviceList[index].execution_staff =
- response.data.data.advice.execution_staff;
- this.adviceList[index].execution_time = Math.round(
- time.getTime() / 1000
- );
- // this.adviceList[index].checker =
- // response.data.data.advice.checker;
- this.$emit("execution", this.adviceList[index]);
- }
- }
-
- return false;
- }
- });
- },
- handleTime(time) {
- var year = time.getFullYear();
- var month = time.getMonth() + 1;
- var day = time.getDate();
- var hour = time.getHours();
- var minute = time.getMinutes();
- if (month < 10) {
- month = "0" + month;
- }
- if (day < 10) {
- day = "0" + day;
- }
- if (hour < 10) {
- hour = "0" + hour;
- }
- if (minute < 10) {
- minute = "0" + minute;
- }
- return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":00";
- },
- deleteAdvice() {
- if (this.currentIndex < 0 || this.currentRow == null) {
- Toast.fail("请先选择要删除的医嘱!");
- return false;
- }
- Dialog.confirm({
- title: "医嘱删除",
- message: "确认删除些条医嘱?"
- })
- .then(() => {
- Toast.loading({ forbidClick: true, duration: 0 });
- DeleteDoctorAdvice(this.currentRow.id).then(response => {
- if (response.data.state == 0) {
- Toast.fail(response.data.msg);
- return false;
- } else {
- Toast.success("医嘱已经删除");
- this.deleteResetData(this.currentIndex, this.currentRow);
- this.$emit("delete", this.adviceList[this.currentIndex]);
- this.currentIndex = -1;
- this.currentRow = null;
- }
- });
- })
- .catch(() => {
- // on cancel
- });
- },
- deleteResetData(index, row) {
- if (row.parent_id > 0) {
- this.adviceList.splice(index, 1);
- } else {
- var spliceIndex = -1;
- var splitNums = 0;
- for (var kndex in this.adviceList) {
- if (this.adviceList[kndex].id == row.id) {
- spliceIndex = kndex;
- splitNums++;
- } else if (this.adviceList[kndex].parent_id == row.id) {
- splitNums++;
- }
- }
- this.adviceList.splice(spliceIndex, splitNums);
- }
- },
- checkAdvice() {
- if (this.currentIndex < 0 || this.currentRow == null) {
- Toast.fail("请先选择要核对的医嘱!");
- return false;
- }
- if (this.currentRow.check_state == 1) {
- Toast.fail("所选医嘱已核对");
- return false;
- }
-
- if (
- this.currentRow.execution_staff > 0 &&
- this.currentRow.execution_staff == this.$store.getters.user.user.id
- ) {
- Toast.fail("核对与执行不能是同一人");
- return false;
- }
-
- Dialog.confirm({
- title: "医嘱核对",
- message: "确认提交核对?"
- })
- .then(() => {
- Toast.loading({ forbidClick: true, duration: 0 });
- var params = {
- id: this.currentRow.id,
- patient: this.patient.id
- };
- CheckDoctorAdvice(params).then(response => {
- if (response.data.state == 0) {
- Toast.fail(response.data.msg);
- return false;
- } else {
- Toast.success("核对成功!");
- var exid = response.data.data.advice.id;
- var pxid = response.data.data.advice.parent_id;
- if (pxid > 0) {
- exid = pxid;
- }
- var alen = this.adviceList.length;
- this.currentRow.check_state = 1;
- this.currentRow.checker = response.data.data.advice.checker;
- this.currentRow.check_time = response.data.data.check_time;
- for (let index = 0; index < alen; index++) {
- if (
- this.adviceList[index].id == exid ||
- this.adviceList[index].parent_id == exid
- ) {
- this.adviceList[index].check_state = 1;
- this.adviceList[index].check_time =
- response.data.data.check_time;
- this.adviceList[index].checker =
- response.data.data.advice.checker;
- this.$emit("execution", this.adviceList[index]);
- }
- }
-
- return false;
- }
- });
- })
- .catch(() => {
- // on cancel
- });
- },
- execAdvice() {
- if (this.currentIndex < 0 || this.currentRow == null) {
- Toast.fail("请先选择要执行的医嘱!");
- return false;
- }
- if (
- this.currentRow.stop_state == 1 ||
- this.currentRow.execution_state == 1
- ) {
- Toast.fail("所选医嘱已停止或执行");
- return false;
- }
-
- if (
- this.currentRow.checker > 0 &&
- this.currentRow.checker == this.$store.getters.user.user.id
- ) {
- Toast.fail("核对与执行不能是同一人");
- return false;
- }
-
- this.$refs.exec_time.open();
- },
- openNewChild() {
- if (this.currentIndex < 0 || this.currentRow == null) {
- Toast.fail("请先选择要添加子药的医嘱!");
- return false;
- }
- if (
- this.currentRow.stop_state == 1 ||
- this.currentRow.execution_state == 1
- ) {
- Toast.fail("所选医嘱已停止或执行");
- return false;
- }
-
- this.index = 2; //1;
-
- this.adviceForm = {
- id: 0,
- advice_type: 2,
- advice_date: this.record_date,
- start_time: uParseTime(
- this.currentRow.start_time,
- "{y}-{m}-{d} {h}:{i}"
- ),
- advice_name: "",
- advice_desc: "",
- 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
- };
- },
- openNewAdvice() {
- this.index = 1;
- this.currentIndex = -1;
- this.currentRow = null;
- this.adviceForm = {
- 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
- };
-
- // document.getElementById("advice-top").scrollIntoView();
-
- // document.querySelector("#advice-top").scrollTop = 0;
- this.$el.querySelector("#advice-top").scrollIntoView();
- },
- open: function() {
- this.index = 0;
- this.visibility = false;
- this.menuCancle();
- this.$refs.picker.close();
- var dialogTop = document.querySelector("#dialogTop");
- if (dialogTop != null) {
- this.$nextTick(() => {
- dialogTop.scrollTop = 0;
- });
- }
- }
- },
- props: {
- patient_prop: {
- type: Object
- },
- advice_list_prop: {
- type: Array
- },
- admin_users_prop: {
- type: Array
- }
- },
- created() {
- var date = this.$route.query && this.$route.query.date;
- date *= 1000;
- var newDate = new Date(date);
-
- var y = newDate.getFullYear();
- var m = newDate.getMonth() + 1;
- var d = newDate.getDate();
- if (isNaN(y) || isNaN(m) || isNaN(d)) {
- newDate = new Date();
- y = newDate.getFullYear();
- m = newDate.getMonth() + 1;
- d = newDate.getDate();
- }
- this.record_date =
- y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
-
- this.patient = this.patient_prop;
- this.adviceList = this.advice_list_prop;
- this.admin_users = this.admin_users_prop;
- this.doctor = this.$store.getters.user.user.user_name;
- this.adviceForm.advice_date = this.record_date;
- this.getAdviceConfig();
-
- this.unitsOption = getDataConfig("hemodialysis", "units");
- for (var index in this.unitsOption) {
- this.unitsObj[this.unitsOption[index].id] = this.unitsOption[index];
- }
- },
-
- components: {
- CheckBoxSubMenu,
- AddNewOrderDialog
- }
- };
- </script>
-
- <style style="stylesheet/scss" lang="scss" scoped>
- .DialogContent {
- // padding-bottom: 2.5rem !important;
- }
- .table {
- width: 100%;
- tr {
- th {
- background: $main-color;
- color: #fff;
- height: 0.88rem;
- line-height: 0.88rem;
- }
- td {
- line-height: 0.4rem;
- }
- }
- }
- .content {
- .cell {
- float: left;
- width: 3.42rem;
- // width: 100%;
- margin: 0.35rem 0.3rem 0 0.4rem;
- label {
- display: block;
- height: 0.55rem;
- line-height: 0.55rem;
- color: $pgh-color;
- }
- select {
- width: 100%;
- padding: 0.2rem 0;
- border: 1px $border-color solid;
- border-radius: 2px;
- padding-left: 5px;
- }
-
- .inputBox {
- border: 1px $border-color solid;
- border-radius: 2px;
- padding: 0.18rem 0;
- padding-left: 5px;
- }
-
- .textarea {
- width: 100%;
- height: 1.22rem;
- border: 1px $border-color solid;
- border-radius: 2px;
- padding-left: 5px;
- }
- }
- .width {
- width: 90%;
- @include box-sizing;
- margin-top: 1rem;
- label {
- display: inline-block;
- }
- button {
- background: $main-color;
- color: #fff;
- border-radius: 6px;
- width: 3rem;
- height: 0.9rem;
- line-height: 0.9rem;
- text-align: center;
- margin: 0 0.1rem 0.6rem 0.1rem;
- border: 1px $main-color solid;
- &.smt-danger {
- background: #fff;
- color: $main-color;
- }
- }
- }
- .center {
- text-align: center;
- }
- .row-class-active > td {
- background: #badcff;
- }
- }
- </style>
-
|