1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <div>
- <el-button
- size="small"
- icon="el-icon-printer"
- :disabled="selecting_schs.length == 0"
- @click="signPrintAction"
- type="primary"
- style="margin-right:10"
- >标签打印
- </el-button>
- <el-button
- size="small"
- icon="el-icon-printer"
- :disabled="selecting_schs.length == 0"
- @click="batchPrintAction"
- type="primary"
- >医嘱打印
- </el-button>
- </div>
- </div>
- <div class="app-container">
- <div class="filter-container">
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model.trim="listQuery.keyword"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="false"
- placeholder="患者姓名"
- @select="handleSelect"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.name }}</div>
- </template>
- </el-autocomplete>
- <el-button type="primary" @click="toSeach">搜索</el-button>
- </div>
- <div class="cell clearfix">
- <label class="title">
- <span class="name">日期查询:</span>
- </label>
- <el-date-picker
- v-model="time"
- prefix-icon="el-icon-date"
- @change="changeTime"
- :editable="false"
- style="width: 250px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="timestamp"
- ></el-date-picker>
- </div>
-
- <div class="cell clearfix">
- <label class="title">
- <span class="name">排序:</span>
- </label>
- <el-select v-model="sort" placeholder="请选择" @change="selectSortType">
- <el-option
- v-for="item in options"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
-
-
- <div class="cell clearfix">
- <label class="title"> <span class="name">排班班次</span> : </label>
- <div class="time">
- <ul class>
- <li
- :class="item.value == schedulType ? 'active' : ''"
- @click="selectSchedulType(item.value)"
- v-for="item in schedulArr"
- :key="item.value"
- >
- {{ item.label }}
- </li>
- </ul>
- </div>
- </div>
- <div class="cell clearfix">
- <label class="title"> <span class="name">收费状态</span> : </label>
- <div class="time">
- <ul class>
- <li
- :class="item.id == costType ? 'active' : ''"
- @click="selectCostType(item.id)"
- v-for="item in costArr"
- :key="item.id"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
-
- <div class="cell clearfix">
- <label class="title"> <span class="name">分区</span> : </label>
- <div class="time">
- <ul class>
- <li
- :class="item.id == partitionType ? 'active' : ''"
- @click="selectPartitionType(item.id)"
- v-for="item in partitionArr"
- :key="item.id"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
-
- <div class="cell clearfix">
- <label class="title"> <span class="name">给药途径</span> : </label>
- <div class="time">
- <ul class>
- <li
- :class="item.id == delivery_way ? 'active' : ''"
- @click="selectDeliveryWay(item.id)"
- v-for="item in deliveryWay"
- :key="item.id"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
-
- <div class="cell clearfix">
- <label class="title"> <span class="name">执行状态</span> : </label>
- <div class="time">
- <ul class>
- <li
- :class="item.id == excution_way ? 'active' : ''"
- @click="selectExcutionWay(item.id)"
- v-for="item in executionList"
- :key="item.id"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- <!-- <div style="margin-top: 10px;margin-left:600px;margin-bottom:10px">
- <el-button type="primary" size="small" @click="toExcution">执行医嘱</el-button>
- <el-button type="primary" size="small" @click="toCheck">医嘱核对</el-button>
- <el-button type="primary" size="small" @click="toSettle">收费</el-button>
- </div> -->
-
- <div style="margin-top: 10px;margin-bottom:10px">
- <el-button type="primary" size="small" @click="toStatic">统计</el-button>
- </div>
-
-
- <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
- @selection-change="handleSelectionChange"
- :span-method="objectSpanMethod"
- :cell-class-name="adviceNameShow"
- :modal-append-to-body="false"
- highlight-current-row
- @current-change="handleCurrentChangeList"
- v-show="show"
- @row-click="handleRowClick">
- <el-table-column type="selection" width="55" align="center"></el-table-column>
- <el-table-column prop="date" label="姓名" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- <br>
- ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
- <br>
- <span v-if="scope.row.mode_id == 1">(HD)</span>
- <span v-if="scope.row.mode_id == 2">(HDF)</span>
- <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
- <span v-if="scope.row.mode_id == 4">(HP)</span>
- <span v-if="scope.row.mode_id == 5">(HF)</span>
- <span v-if="scope.row.mode_id == 6">(SCUF)</span>
- <span v-if="scope.row.mode_id == 7">(IUF)</span>
- <span v-if="scope.row.mode_id == 8">(HFHD)</span>
- <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
- <span v-if="scope.row.mode_id == 10">(PHF)</span>
- <span v-if="scope.row.mode_id == 11">(HFR)</span>
- <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
- <span v-if="scope.row.mode_id == 13">(CRRT)</span>
- <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
- <span v-if="scope.row.mode_id == 24">I-HDF</span>
- </template>
- </el-table-column>
- <el-table-column label="分区床位" width="100">
- <template slot-scope="scope" >
- {{scope.row.zone_name}}/{{scope.row.number}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="透析器" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ scope.row.dialyzer_perfusion_apparatus }}</span>
- <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
- <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</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('{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" v-if="scope.row.parent_id == 0">
- {{ getAdviceContent(scope.row, 1)}}
- </span>
- </el-dropdown>
-
- <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
- <span class="el-dropdown-link">
-  {{ getAdviceContent(scope.row, 2)}}
- </span>
- </el-dropdown>
- </template>
- </el-table-column>
- <el-table-column
- prop="start_time"
- align="center"
- min-width="30px"
- label="执行时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.execution_time != 0">
- {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id == 0">
- {{getXuserName(scope.row.execution_staff)}}
- </span>
- <span v-else>{{getXuserName(scope.row.execution_staff)}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
- <template slot-scope="scope">
- <span v-if="scope.row.parent_id == 0">
- {{getXuserName(scope.row.checker)}}
- </span>
- <span v-else>{{getXuserName(scope.row.checker)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="check_time"
- align="center"
- min-width="30px"
- label="校对时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.check_time != 0">
- {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else>
-
- </span>
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="created_time"
- align="center"
- min-width="30px"
- label="校对时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.created_time != 0">
- {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column
- prop="created_time"
- align="center"
- min-width="30px"
- label="收费状态"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.is_settle == 1">
- 已收费
- </span>
- <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
- 未收费
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- </el-table>
-
-
- <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
- @selection-change="handleSelectionChangeOne"
- @current-change="handleCurrentChangeList"
- :span-method="objectSpanMethod"
- :cell-class-name="adviceNameShow"
- highlight-current-row
- :modal-append-to-body="false"
- v-show="showOne">
- <el-table-column type="selection" width="55" align="center"></el-table-column>
- <el-table-column prop="date" label="姓名" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- <br>
- ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
- <br>
- <span v-if="scope.row.mode_id == 1">(HD)</span>
- <span v-if="scope.row.mode_id == 2">(HDF)</span>
- <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
- <span v-if="scope.row.mode_id == 4">(HP)</span>
- <span v-if="scope.row.mode_id == 5">(HF)</span>
- <span v-if="scope.row.mode_id == 6">(SCUF)</span>
- <span v-if="scope.row.mode_id == 7">(IUF)</span>
- <span v-if="scope.row.mode_id == 8">(HFHD)</span>
- <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
- <span v-if="scope.row.mode_id == 10">(PHF)</span>
- <span v-if="scope.row.mode_id == 11">(HFR)</span>
- <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
- <span v-if="scope.row.mode_id == 13">(CRRT)</span>
- <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
- <span v-if="scope.row.mode_id == 24">I-HDF</span>
- </template>
- </el-table-column>
- <el-table-column prop="date" label="透析器" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>
- {{ scope.row.dialyzer_perfusion_apparatus }}
- <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
- <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
- </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('{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" v-if="scope.row.parent_id == 0">
- {{ getAdviceContent(scope.row, 1)}}
- </span>
- </el-dropdown>
-
- <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
- <span class="el-dropdown-link">
-  {{ getAdviceContent(scope.row, 2)}}
- </span>
- </el-dropdown>
- </template>
- </el-table-column>
- <el-table-column
- prop="start_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 prop="checker" align="center" min-width="30px" 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-column
- prop="check_time"
- align="center"
- min-width="30px"
- label="校对时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.check_time != 0">
- {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
- <template slot-scope="scope">
- <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="created_time"
- align="center"
- min-width="30px"
- label="校对时间"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.created_time != 0">
- {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
-
- <el-table-column
- prop="created_time"
- align="center"
- min-width="30px"
- label="收费状态"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.is_settle == 1">
- 已收费
- </span>
- <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
- 未收费
- </span>
- <span v-else></span>
- </template>
- </el-table-column>
- </el-table>
-
- <el-dialog
- title="选择执行时间"
- :visible.sync="execTimeDialogVisible"
- width="400px"
- :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="execTimeDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="excutionDoctorAdvice" :loading="exceLoading">保 存</el-button>
- </span>
- </el-dialog>
-
-
- <el-dialog
- title="选择执行时间"
- :visible.sync="execTimeDialogVisibleOne"
- width="400px"
- :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="execTimeDialogVisibleOne = false">取 消</el-button>
- <el-button type="primary" @click="excutionDoctorAdviceOne" :loading="exceLoading">保 存</el-button>
- </span>
- </el-dialog>
-
-
-
- <el-dialog
- title="药品统计表"
- :visible.sync="startdialogVisible"
- width="70%">
- <span>
- <div class="cell clearfix" style="margin-bottom:10px">
- <label class="title"> <span class="name">排班班次</span> : </label>
- <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType">
- <el-option
- v-for="item in schedulArr"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <label class="title"> <span class="name">病区选择</span> : </label>
- <el-select v-model="partion_type" placeholder="请选择" @change="changePartionType">
- <el-option
- v-for="item in partitionArr"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- <el-button size="small" icon="el-icon-printer" @click="toPrintOne" type="primary">打印</el-button>
- <el-button size="small" @click="toExportListOne" type="primary">导出</el-button>
- </div>
-
- <el-table
- :data="tableList"
- border
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- >
- <el-table-column align="center" label="序号">
- <template slot-scope="scope">
- {{scope.$index+1}}
- </template>
- </el-table-column>
- <el-table-column align="center" label="药品名称">
- <template slot-scope="scope">
- {{scope.row.advice_name}}
- </template>
- </el-table-column>
- <el-table-column align="center" label="规格">
- <template slot-scope="scope">
- {{scope.row.specification_name}}
- </template>
- </el-table-column>
-
- <el-table-column align="center" label="数量">
- <template slot-scope="scope">
- <span v-if="config.is_open!=1">{{getCount(scope.row.child)}}</span>
- <span v-if="config.is_open ==1">{{getHisCount(scope.row.child,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
- </template>
- </el-table-column>
-
-
-
- </el-table>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="startdialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="startdialogVisible = false">确 定</el-button>
- </span>
- </el-dialog>
- </div>
-
-
- </div>
- </template>
-
- <script>
- const moment = require('moment')
- import { getSchedualPatient, GetAllZone,getDialysisAdviceToday } from "@/api/dialysis";
- import { parseTime } from "@/utils";
- import BreadCrumb from "@/xt_pages/components/bread-crumb";
- import { getPrintTemplate } from "@/api/data";
- import { getNewSchedualDoctors,excutionDoctorAdvice,checkNewDoctorAdvice,settleNewDoctorAdvice,excutionDoctorAdviceById } from '@/api/advice'
- import { PostSearch } from '@/api/patient'
- export default {
- name: "Patient",
- data() {
- return {
- crumbs: [
- { path: false, name: "透析管理" },
- { path: false, name: "透析监测" }
- ],
- loading: false,
- time: "",
-
- search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
- patient_search_keyword: "",
-
- SchedualPatientsTableData: [],
- active: true,
- schedulType: 0,
- schedulArr: [
- { value: 0, label: "全部" },
- { value: 1, label: "上午" },
- { value: 2, label: "下午" },
- { value: 3, label: "晚上" }
- ],
- template_id: 0,
-
- partitionType: 0,
- costType:0,
- total: 0,
- listQuery: {
- page: 1,
- limit: 10,
- schedul_type: 0,
- partition_type: 0,
- schedul_time: "",
- keywords: "",
- },
- selecting_schs: [],
- partitionArr: [],
-
- scheduleMap:[],
- show:true,
- showOne:false,
- deliveryWay:[],
- executionList:[
- {id:0,name:"全部"},
- {id:1,name:"已执行"},
- {id:2,name:"未执行"},
- ],
- delivery_way:0,
- patient_id:0,
- org_id:0,
- excution_way:0,
- options:[
- {id:0,name:"请选择"},
- {id:1,name:"按床位排序"},
- {id:2,name:"按签到时间排序"},
- ],
- costArr:[
- {id:0,name:"全部"},
- {id:1,name:"已收费"},
- {id:2,name:"未收费"}
- ],
- sort:0,
- config:{},
- execTime: '',
- execTimeDialogVisible:false,
- exceLoading:false,
- is_sort:0,
- hoverOrderArr:[],
- is_status:0,
- execTimeDialogVisibleOne:false,
- current_row:{},
- tableList:[],
- startdialogVisible:false,
- schedule_type:0,
- partion_type:0,
- druglist:[],
- config:{},
- };
- },
- created() {
- var date = new Date();
- this.time = date;
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var day = date.getDate();
- if (month < 10) {
- month = "0" + month;
- }
- if (day < 10) {
- day = "0" + day;
- }
- var nowDate = year + "-" + month + "-" + day;
- var date = new Date(nowDate + " 00:00:00");
- this.listQuery.schedul_time = date.getTime();
- this.getAllZone();
- this.getTemplateInfo();
- this.requestSchedualDoctors(this.time)
- this.org_id = this.$store.getters.xt_user.template_info.org_id;
- },
- methods: {
- getTemplateInfo() {
- getPrintTemplate().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- var template = response.data.data.template;
- this.template_id = template.template_id;
- }
- });
- },
- clickCurrent(val) {
- console.log(val);
- this.$router.push({
- path: "/dialysis/details",
- query: { patient_id: val.patient_id, date: val.sch_time_int,mode_id:val.mode_id }
- });
- },
-
- selectSchedulType(scheduleType) {
-
- this.schedulType = scheduleType;
- this.listQuery.schedul_type = scheduleType;
- this.requestSchedualDoctors(this.time);
- },
- selectPartitionType(partitionType) {
- this.partitionType = partitionType;
- this.listQuery.partition_type = partitionType;
- this.requestSchedualDoctors(this.time);
- },
- selectCostType(costType){
- this.costType = costType
- this.requestSchedualDoctors(this.time);
- },
-
- selectDeliveryWay(val){
- this.delivery_way = val
- this.requestSchedualDoctors(this.time)
- },
-
- selectExcutionWay(val){
- this.excution_way = val
- this.requestSchedualDoctors(this.time)
- },
-
-
- changeTime() {
- this.listQuery.schedul_time = this.time;
- this.requestSchedualDoctors(this.time)
- },
- getAllZone: function() {
- GetAllZone().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.partitionArr = response.data.data.zone;
- this.partitionArr.unshift({ id: 0, name: "全部" });
- var dics = response.data.data.dics
- var obj = {id:0,name:"全部"}
- this.deliveryWay.push(obj)
- this.deliveryWay.push(...dics)
- }
- });
- },
- requestSchedualDoctors (time) {
-
- var name = ""
- for(let i=0;i<this.deliveryWay.length;i++){
- if(this.delivery_way == this.deliveryWay[i].id){
- name = this.deliveryWay[i].name
- }
- }
- if(name == '全部'){
- name = ""
- }
-
- let newTime = moment(time).format('YYYY-MM-DD')
-
- var schedule_type = this.listQuery.schedul_type
- var partition_type = this.listQuery.partition_type
-
- getNewSchedualDoctors({date: newTime,patient_type: 0,advice_type: 2,delivery_way:name,schedule_type:schedule_type,partition_type:partition_type,patient_id:this.patient_id,excution_way:this.excution_way,cost_type:this.costType}).then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- this.admin_users = resp.data.adminUser
-
-
- var config = resp.data.config
- this.config = config
- let project_config = resp.data.project_config
-
- if(project_config.is_open == 1){
- this.project = resp.data.project
- console.log("wode 2o2o3o3o23o32o32o23o32o32o", this.project)
-
- let projectArr = []
- if(this.org_id!= 10318 && this.org_id!=10265){
- this.project.map(item => {
- resp.data.hisAdvices.map(it => {
- if(item.patient_id == it.patient_id){
- projectArr.push(item)
- }
- })
- })
- console.log("projectArr2332323232323232",projectArr)
- resp.data.hisAdvices.map((item,index) => {
- if(projectArr[index].project && projectArr[index].project.length > 0){
- projectArr[index].project.map(it => {
-
- let obj = {
- advice_doctor: it.doctor,
- start_time:it.start_time,
- advice_name:it.team_id > 0 && it.is_check_team == 1 ? it.team.project_team : it.type == 2 ? it.project.project_name+' '+it.count + it.project.unit : it.good_info.good_name +' '+it.count+ it.good_info.packing_unit,
- execution_time:it.execution_time,
- execution_state:it.execution_state,
- execution_staff:it.execution_staff,
- check_time:it.check_time,
- check_state:it.check_state,
- checker:it.checker,
- created_time:it.ctime,
- delivery_way:'',
- execution_frequency:'',
- remark:'',
- id:it.id,
- patient_id:it.patient_id,
- parent_id:0,
- groupno:0,
- sort:item.device_number.sort,
- assess_time:item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- }
- item.doctor_advice.push(obj)
- })
- }
- })
- console.log("hh3oo1o3o123o3oo312o132o312o31o132o",resp.data.hisAdvices)
- }
- }
-
-
-
-
- if(config.is_open == 0 || config.is_open == 2){
- var schedules = resp.data.scheduals
-
-
-
- var newList = []
- if(this.is_sort == 0){
- newList = schedules
- }
- if(this.is_sort == 1){
- schedules.map(item => {
- item.is_sort = item.device_number.sort
- item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- })
-
- newList = schedules.sort(this.compare('is_sort'))
-
-
-
- }
- if(this.is_sort == 2){
- schedules.map(item => {
- item.is_sort = item.device_number.sort
- item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- })
- newList = schedules.sort(this.compare('assess_time'))
- }
-
- this.show = true
- this.showOne = false
- let arr = []
- let newArr = []
- let newSchedules = []
-
- newList.map(item => {
- item.doctor_advice.map(it =>{
- it.name = item.patient.name
- if(item.prescription != null){
- it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
- it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
- it.dialysis_irrigation = item.prescription.dialysis_irrigation
- }
- it.schedule_type = item.schedule_type
- it.zoneId = item.device_number.zone.id
- it.dialysis_no = item.patient.dialysis_no
- it.mode_id = item.mode_id
- it.number = item.device_number.number
- it.zone_name = item.device_number.zone.name
- it.sort = item.device_number.sort,
- arr.push(it)
- })
- item.is_sort = item.device_number.sort
- item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- })
-
- console.log("schedules9999999998888888888",schedules)
-
-
-
-
- if(this.schedulType == 0){
- newSchedules = arr
- }else{
- arr.map(item => {
- if (item.schedule_type == this.schedulType) {
- newSchedules.push(item)
- }
- })
- }
-
-
- if(this.partitionType == 0){
- this.scheduleMap = newSchedules
- }else {
- let a = []
- arr.map(item => {
- if(this.partitionType == item.zoneId){
- a.push(item)
- }
- })
- this.scheduleMap = a
- }
-
- this.scheduleMap.map(ele => {
- let firstIndex = this.scheduleMap.findIndex(item => {
- return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
- })
- if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
- newArr.push({
- length: this.scheduleMap.filter(item => {
- return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
- }).length,
- firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
- })
- }
- })
- this.indexInfoList = newArr
- console.log("this.scheduleMap", this.scheduleMap)
-
-
- }
-
- if(config.is_open == 1){
- this.show = false
- this.showOne = true
- var schedules = resp.data.hisAdvices
-
- let arr = []
- let newArr = []
- let newSchedules = []
- var newList = []
- if(this.is_sort == 0){
- newList = schedules
- }
- if(this.is_sort == 1){
- schedules.map(item => {
- item.is_sort = item.device_number.sort
- item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- })
-
- newList = schedules.sort(this.compare('is_sort'))
-
-
-
- }
- if(this.is_sort == 2){
- schedules.map(item => {
- item.is_sort = item.device_number.sort
- item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- })
- newList = schedules.sort(this.compare('assess_time'))
- }
- newList.map(item => {
- item.doctor_advice.map(it =>{
- it.name = item.patient.name
- if(item.prescription != null){
- it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
- it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
- it.dialysis_irrigation = item.prescription.dialysis_irrigation
- }
- it.schedule_type = item.schedule_type
- it.zoneId = item.device_number.zone.id
- it.dialysis_no = item.patient.dialysis_no
- it.mode_id = item.mode_id
- it.number = item.device_number.number
- it.zone_name = item.device_number.zone.name
- it.sort = item.device_number.sort,
- arr.push(it)
- })
- item.is_sort = item.device_number.sort
-
- item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
- })
- if(this.schedulType == 0){
- newSchedules = arr
- }else{
- arr.map(item => {
- if (item.schedule_type == this.schedulType) {
- newSchedules.push(item)
- }
- })
- }
-
-
- if(this.partitionType == 0){
- this.scheduleMap = newSchedules
- }else {
- let a = []
- arr.map(item => {
- if(this.partitionType == item.zoneId){
- a.push(item)
- }
- })
- this.scheduleMap = a
- }
-
- this.scheduleMap.map(ele => {
- let firstIndex = this.scheduleMap.findIndex(item => {
- return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
- })
- if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
- newArr.push({
- length: this.scheduleMap.filter(item => {
- return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
- }).length,
- firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
- })
- }
- })
- this.indexInfoList = newArr
- }
- }
-
- })
-
- },
- compare:function (k) {
- return function (a, b) {
- var M = a[k];
- var N = b[k];
- return M - N; // 从低向高排
- // return N - M; // 从高向低排
- }
- },
- getValue: function(val) {
- if (val != undefined) {
- return val.value;
- } else {
- return "";
- }
- },
-
- handleCurrentChange(val) {
- this.listQuery.page = val;
- this.getSchedualPatientList();
- },
- changeSearchMode: function() {
- if (this.search_mode == 1) {
- this.search_mode = 2;
- } else {
- this.search_mode = 1;
- }
- },
- searchPatientAction: function() {
- this.listQuery.keywords = this.patient_search_keyword;
- console.log(this.patient_search_keyword);
- if (this.patient_search_keyword.length == 0) {
- return;
- }
- this.getSchedualPatientList();
- },
- handleSizeChange(val) {
- this.listQuery.limit = val;
- this.getSchedualPatientList();
- },
- batchPrintAction: function() {
- if (this.selecting_schs.length === 0) {
- this.$message.error("请至少选择一条需要打印的内容");
- return false;
- }
- // 模板ID为6
- var sch_ids = [];
-
- for (let index = 0; index < this.selecting_schs.length; index++) {
- sch_ids.push(this.selecting_schs[index].patient_id);
- }
-
- this.$store.dispatch("SetAdviceIDs", sch_ids);
- var name = ""
- for(let i=0;i<this.deliveryWay.length;i++){
- if(this.delivery_way == this.deliveryWay[i].id){
- name = this.deliveryWay[i].name
- }
- }
- if(name == '全部'){
- name = ""
- }
- this.$router.push({ path: "/dialysis/doctorAdvicePrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
-
- },
- signPrintAction:function(){
- if (this.selecting_schs.length === 0) {
- this.$message.error("请至少选择一条需要打印的内容");
- return false;
- }
- // 模板ID为6
- var sch_ids = [];
-
- for (let index = 0; index < this.selecting_schs.length; index++) {
- sch_ids.push(this.selecting_schs[index].patient_id);
- }
-
- this.$store.dispatch("SetAdviceIDs", sch_ids);
- var name = ""
- for(let i=0;i<this.deliveryWay.length;i++){
- if(this.delivery_way == this.deliveryWay[i].id){
- name = this.deliveryWay[i].name
- }
- }
- if(name == '全部'){
- name = ""
- }
- this.$router.push({ path: "/dialysis/signPrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
-
- },
- batchPrintActionOne: function() {
- if (this.selecting_schs.length === 0) {
- this.$message.error("请至少选择一条需要打印的内容");
- return false;
- }
- var sch_ids = [];
- for (let index = 0; index < this.selecting_schs.length; index++) {
- sch_ids.push(this.selecting_schs[index].sch_id);
- }
- this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
- if (this.template_id == 2 || this.template_id == 0) {
- this.$router.push({ path: "/dialysis/print/batch/otherone" });
- } else if (this.template_id == 1) {
- this.$router.push({ path: "/dialysis/print/batch" });
- } else if (this.template_id == 5) {
- this.$router.push({ path: "/dialysis/print/batch/fiveone" });
- } else if (this.template_id == 22) {
- this.$router.push({ path: "/dialysis/print/batch/twentyTwo_one" });
- }
- },
- batchPrintActionTwo: function() {
- if (this.selecting_schs.length === 0) {
- this.$message.error("请至少选择一条需要打印的内容");
- return false;
- }
- var sch_ids = [];
- for (let index = 0; index < this.selecting_schs.length; index++) {
- sch_ids.push(this.selecting_schs[index].sch_id);
- }
- this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
- if (this.template_id == 2 || this.template_id == 0) {
- this.$router.push({ path: "/dialysis/print/batch/othertwo" });
- } else if (this.template_id == 1) {
- this.$router.push({ path: "/dialysis/print/batch" });
- } else if (this.template_id == 5) {
- this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
- } else if (this.template_id == 22) {
- this.$router.push({ path: "/dialysis/print/batch/twentyTwo_two" });
- }
- },
- compare (property) {
- return function (a, b) {
- var value1 = a[property]
- var value2 = b[property]
- return value1 - value2
- }
- },
- // 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'
- // }
- // }
- // },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- let index = this.indexInfoList.findIndex(item => { //遍历数组
- return item.firstIndex === rowIndex
- })
- if (index > -1) {
- return {
- rowspan: this.indexInfoList[index].length,
- colspan: 1
- }
- } else {
- return {
- rowspan: 0,
- colspan: 0
- }
- }
- }
-
- if (columnIndex === 1) {
- let index = this.indexInfoList.findIndex(item => { //遍历数组
- return item.firstIndex === rowIndex
- })
- if (index > -1) {
- return {
- rowspan: this.indexInfoList[index].length,
- colspan: 1
- }
- } else {
- return {
- rowspan: 0,
- colspan: 0
- }
- }
- }
- if (columnIndex === 2) {
- let index = this.indexInfoList.findIndex(item => { //遍历数组
- return item.firstIndex === rowIndex
- })
- if (index > -1) {
- return {
- rowspan: this.indexInfoList[index].length,
- colspan: 1
- }
- } else {
- return {
- rowspan: 0,
- colspan: 0
- }
- }
- }
- },
- adviceNameShow({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 2) {
- return 'dialysisadvicenamedisplay'
- } else {
- return ''
- }
- },
- 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
- },
- 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 : '' + '' + row.single_dose_unit ? row.single_dose_unit : ''
- }
- }
-
- if (row.advice_desc) {
- tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
- }
-
- if (isChild == 1) {
- // 不是子药
- // console.log(tempDrugSpecDesc)
- // console.log(tempPrescribingNumberDesc)
- // console.log(tempSingleDoseDesc)
- // console.log(11,row.delivery_way)
- // console.log(22,row.execution_frequency)
-
- return (
- row.advice_name +
- tempDrugSpecDesc +
- ' ' +
- tempPrescribingNumberDesc +
- tempSingleDoseDesc +
- ' ' +
- row.delivery_way +
- ' ' +
- row.execution_frequency
- )
- } else {
- // 是子药
- return (
- row.advice_name +
- tempDrugSpecDesc +
- ' ' +
- tempPrescribingNumberDesc +
- tempSingleDoseDesc
- )
- }
- },
- handleSelectionChange(val){
- console.log("val88888888",val)
- this.selecting_schs = val;
- this.is_status = 1
- },
- handleSelectionChangeOne(val){
- this.selecting_schs = val;
- this.is_status = 1
- console.log("val32323323223",val)
- },
-
- querySearchAsync(keyword, cb) {
- let key = '';
- if (keyword != undefined) {
- key = keyword
- }
- let searchArray = []
- PostSearch(key).then(response => {
- if (response.data.state == 1) {
- searchArray = response.data.data.patient
- console.log('searcharrya', searchArray)
- cb(searchArray)
- }
- })
- return searchArray
- },
- handleSelect(val) {
- this.patient_id = val.id
- this.requestSchedualDoctors(this.time)
- },
- toSeach(){
- this.patient_id = 0
- this.requestSchedualDoctors(this.time)
- },
- toExcution(){
-
- if(this.selecting_schs.length ==0){
- this.$message.error("请勾选需要执行的医嘱")
- return false
- }
- console.log("hhhahhhahhh",this.is_status)
- if(this.is_status == 1){
- this.execTimeDialogVisible = true
- }
- if(this.is_status == 2){
- this.execTimeDialogVisibleOne = true
- }
- },
-
- excutionDoctorAdvice(){
-
- if (this.execTime.length == 0) {
- this.$message.error('请选择执行时间!')
- return false
- }
- var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
- var ids=[]
- if(this.selecting_schs!=null && this.selecting_schs.length >0){
- for(let i=0;i<this.selecting_schs.length;i++){
- ids.push(this.selecting_schs[i].patient_id)
- }
- }
- var str = ids.join(",")
-
- var params = {
- str:str,
- advice_date: moment(this.time).format('YYYY-MM-DD'),
- is_open:this.config.is_open,
- exec_time:execTime
- }
- console.log("params232322323wo",params)
- this.exceLoading = true
-
- excutionDoctorAdvice(params).then(response=>{
- if(response.data.state == 1){
- if(response.data.data.msg == 2){
- var drug_name = response.data.data.drug.drug_name
- var dose = response.data.data.drug.dose
- var dose_unit = response.data.data.drug.dose_unit
- var min_number = response.data.data.drug.min_number
- var max_unit = response.data.data.drug.max_unit
- var min_unit = response.data.data.drug.min_unit
- var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
- this.$message.error(str +"库存不足,执行失败!")
- this.exceLoading = false
- this.execTimeDialogVisible = false
- this.requestSchedualDoctors(this.time)
- }
- if(response.data.data.msg == 3){
- this.$message.error("执行人和核对人不能是同一个人,执行失败!")
- }
-
- }
- })
- },
- toCheck(){
-
- if(this.selecting_schs.length ==0){
- this.$message.error("请勾选需要执行的医嘱")
- return false
- }
-
-
- var ids=[]
- if(this.selecting_schs!=null && this.selecting_schs.length >0){
- for(let i=0;i<this.selecting_schs.length;i++){
- ids.push(this.selecting_schs[i].patient_id)
- }
- }
- var str = ids.join(",")
- var params = {
- str:str,
- advice_date: moment(this.time).format('YYYY-MM-DD'),
- is_open:this.config.is_open,
- }
- checkNewDoctorAdvice(params).then(response=>{
- if(response.data.state == 1){
- if(response.data.data.msg == 2){
- var advice = response.data.data.advice
- this.$message.error(advice.advice_name +"执行人和核对人不能是同一个人,核对失败!")
- this.requestSchedualDoctors(this.time)
- }else{
- this.$message.success("核对成功!")
- this.requestSchedualDoctors(this.time)
- }
-
- }
- })
- },
- toSettle(){
- if(this.selecting_schs.length ==0){
- this.$message.error("请勾选需要执行的医嘱")
- return false
- }
- var ids=[]
- if(this.selecting_schs!=null && this.selecting_schs.length >0){
- for(let i=0;i<this.selecting_schs.length;i++){
- ids.push(this.selecting_schs[i].patient_id)
- }
- }
- var str = ids.join(",")
- var params = {
- str:str,
- advice_date: moment(this.time).format('YYYY-MM-DD'),
- is_open:this.config.is_open,
- }
- settleNewDoctorAdvice(params).then(response=>{
- if(response.data.state == 1){
- this.$message.success("收费成功!")
- this.requestSchedualDoctors(this.time)
- }
- })
- },
- selectSortType(id){
- this.is_sort = id
- this.requestSchedualDoctors(this.time);
- },
- handleRowClick (row) {
- console.log("row232323232",row)
- },
- tableRowClassName({row, rowIndex}) {
- row.index = rowIndex
- if(row.index = rowIndex){
- return 'success-row'
- }
-
- },
- handleCurrentChangeList(row){
- console.log("row233232232332",row)
- this.selecting_schs.push(row)
- this.current_row= row
- this.is_status = 2
-
- },
- excutionDoctorAdviceOne(){
- if(this.current_row.execution_state == 1){
- 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)
- var params= {
- advice_id:this.current_row.id,
- advice_date: moment(this.time).format('YYYY-MM-DD'),
- exec_time:execTime,
- }
- excutionDoctorAdviceById(params).then(response=>{
- if(response.data.state == 1){
- if(response.data.data.msg == 2){
- var drug_name = response.data.data.drug.drug_name
- var dose = response.data.data.drug.dose
- var dose_unit = response.data.data.drug.dose_unit
- var min_number = response.data.data.drug.min_number
- var max_unit = response.data.data.drug.max_unit
- var min_unit = response.data.data.drug.min_unit
- var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
- this.$message.error(str +"库存不足,执行失败!")
- this.exceLoading = false
- this.execTimeDialogVisibleOne = false
- this.requestSchedualDoctors(this.time)
- }
- if(response.data.data.msg == 1){
- var msg = response.data.data.msg
- this.$message.success("执行成功!")
- this.exceLoading = false
- this.execTimeDialogVisibleOne = false
- this.requestSchedualDoctors(this.time)
- }
- if(response.data.data.msg == 3){
- this.$message.error("执行人与核对人不能是同一个人,执行失败!")
- }
- }
- })
- },
-
- toStatic() {
- this.tableList = []
- var params = {
- schedule_type:this.schedule_type,
- partion_type:this.partion_type,
- selected_date: moment(this.time).format('YYYY-MM-DD'),
- }
- console.log("params2332232wo",params)
- getDialysisAdviceToday(params).then(response=>{
- if(response.data.state == 1){
- var doctorList = []
- var druglist = response.data.data.drug
- this.druglist = druglist
- this.startdialogVisible = true
- var list = response.data.data.list
-
- var config = response.data.data.config
-
-
- if(list!=null && list.length > 0){
- for(let i=0;i<list.length;i++){
- for(let j=0;j<list[i].xt_doctor_advice.length;j++){
- doctorList.push(list[i].xt_doctor_advice[j])
- }
- }
- }
-
- if(config.is_open!=1){
- if(doctorList!=null && doctorList.length > 0){
- let dataInfo = {}
- doctorList.forEach((item, index) => {
- let { advice_name } = item
- if (!dataInfo[advice_name]) {
- dataInfo[advice_name] = {
- advice_name:item.advice_name,
- child: [],
- count:0,
- drug_id:item.drug_id,
- specification_name:item.advice_desc +item.drug_spec_unit,
- patient_id:item.patient_id,
- }
- }
- })
- let arr = Object.values(dataInfo)
- // console.log("arr23332323232",arr)
-
-
- if(arr.length > 0){
- for(let i=0;i<doctorList.length;i++){
- for(let j=0;j<arr.length;j++){
- if(doctorList[i].advice_name == arr[j].advice_name){
- arr[j].child.push(doctorList[i])
- }
- }
- }
- }
-
- this.tableList = []
- for(let i=0;i<list.length;i++){
- for(let j=0;j<arr.length;j++){
- if(list[i].patient_id == arr[j].patient_id){
- this.tableList.push(arr[j])
- }
- }
- }
-
- }
- }
-
- var his_doctor_advice = []
-
- for(let i=0;i<list.length;i++){
- for(let j=0;j<list[i].his_doctor_advice.length;j++){
- his_doctor_advice.push(list[i].his_doctor_advice[j])
- }
- }
- console.log("his_doctor_advice",his_doctor_advice)
-
- var newHisArr = []
- for(let i=0;i<his_doctor_advice.length;i++){
- his_doctor_advice[i].count_one = 0
- if(his_doctor_advice[i].prescribing_number_unit == his_doctor_advice[i].drug.max_unit){
- his_doctor_advice[i].prescribing_number = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
- his_doctor_advice[i].count_one = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
- }
- }
-
- for(let i=0;i<his_doctor_advice.length;i++){
- for(let j=0;j<druglist.length;j++){
- if(his_doctor_advice[i].drug_id == druglist[j].id){
- newHisArr.push(his_doctor_advice[i])
- }
- }
- }
- console.log("下盘子3223323223",newHisArr)
-
- if(config.is_open == 1){
- if(newHisArr!=null && newHisArr.length > 0){
- let dataInfoOne = {}
- newHisArr.forEach((item, index) => {
- let { advice_name } = item
- if (!dataInfoOne[advice_name]) {
- dataInfoOne[advice_name] = {
- advice_name:item.advice_name,
- child: [],
- count:0,
- specification_name:this.getSpecification(item.drug_id),
- drug_id:item.drug_id,
- patient_id:item.patient_id,
- min_number:item.drug.min_number,
- max_unit:item.drug.max_unit,
- min_unit:item.drug.min_unit
- }
- }
- })
- let hisarr = Object.values(dataInfoOne)
- console.log("hisarr233232233232",hisarr)
- if(hisarr.length > 0){
- for(let i=0;i<newHisArr.length;i++){
- for(let j=0;j<hisarr.length;j++){
- if(newHisArr[i].drug_id == hisarr[j].drug_id){
- hisarr[j].child.push(newHisArr[i])
- }
- }
- }
- }
- console.log("hisarr",hisarr)
- this.tableList = []
- this.tableList = hisarr
- }
-
- console.log("中国人民解放军",this.tableList)
- }
- }
- })
-
- },
-
- getSpecification(id){
- var specification_name = ""
- for(let i=0;i<this.druglist.length;i++){
- if(id == this.druglist[i].id){
- specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_number+this.druglist[i].min_unit +"/"+this.druglist[i].max_unit
- }
- }
- return specification_name
- },
- getCount(val){
- var count = 0
- if(val!=null && val.length > 0){
- for(let i=0;i<val.length;i++){
- count += parseInt(val[i].prescribing_number)
- }
- }
- if(count > 0){
- return count
- }else{
- return 0
- }
- },
- getHisCount(val,max_unit,min_unit,min_number){
- var total = 0
- var max_str = "";
- var min_str = "";
- for(let i=0;i<val.length;i++){
- total+=parseInt(val[i].prescribing_number)
- }
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- return max_str + min_str;
-
- },
- toPrintOne(){
- var schedule_date = moment(this.time).format('YYYY-MM-DD')
- this.$router.push({path:"/dialysis/doctorAdviceStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_type+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
- },
- toExportListOne(){
- import('@/vendor/Export2Excel').then(excel => {
-
- if(this.tableList!=null && this.tableList.length > 0){
- for(let i=0;i<this.tableList.length;i++){
- this.tableList[i].index = i+1
- if(this.config.is_open == 1){
- this.tableList[i].total_count = this.getHisCount(this.tableList[i].child,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
- }
- if(this.config.is_open!=1){
- this.tableList[i].total_count = this.getCount(this.tableList[i].child)
- }
-
- }
- }
- const tHeader = ['序号','药品名称','规格','数量']
- const filterVal = ['index','advice_name','specification_name','total_count']
-
- const data = this.formatJson(filterVal, this.tableList)
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: '药品统计'
- })
- this.downloadLoading = false
- })
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => v[j]));
- },
- changeScheduleType(){
- this.tableList = []
- this.toStatic()
- },
- changePartionType(){
- this.tableList = []
- this.toStatic()
- }
- },
- components: {
- BreadCrumb
- }
- };
- </script>
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .app-container {
- // margin: 20px;
- font-size: 15px;
- .filter-container {
- padding-bottom: 5px;
- }
- .cqd-dataTitle {
- color: #303133;
- font-size: 14px;
- border-bottom: 2px #e4e7ed solid;
- height: 36px;
- line-height: 36px;
- margin: 0 0 25px 0;
- position: relative;
- }
- .cqd-dataTitle::before {
- position: absolute;
- left: 0;
- bottom: -2px;
- content: "";
- width: 42px;
- height: 2px;
- background: #409eff;
- }
- .search-component {
- width: 500px;
- .searchBox {
- width: 300px;
- height: 36px;
- line-height: 36px;
- padding-left: 15px;
- border: 1px #dcdfe6 solid;
- border-right: none;
- outline: none;
- float: left;
- border-radius: 6px 0 0 6px;
- font-size: 14px;
- color: #333;
- background: #fff;
- box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
- }
- .searchBtn {
- background-color: #409eff;
- color: #fff;
- font-size: 15px;
- text-align: center;
- height: 36px;
- line-height: 36px;
- float: left;
- outline: none;
- width: 70px;
- border: none;
- border-radius: 0 6px 6px 0;
- font-family: "Microsoft Yahei";
- cursor: pointer;
- }
- }
- .amount {
- font-weight: normal;
- padding: 10px 0 0 0;
- color: #606266;
- font-size: 14px;
- span {
- color: #ef2525;
- font-family: "Arial";
- padding: 0 2px;
- }
- }
- }
- .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;
- }
- .el-checkbox__inner::after {
- height: 10px;
- left: 7px;
- }
- .el-checkbox__inner {
- width: 20px;
- height: 20px;
- }
- </style>
- <style lang="scss" scoped>
- .page_consumables {
-
- .clearfix:after {
- content: none;
- }
-
- }
- </style>
|