123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545 |
- <template>
- <div>
- <div
- style="display: flex; justify-content: space-between; margin-bottom: 10px"
- >
- <div>
- <el-select
- size="small"
- v-model="item_type"
- placeholder="请选择"
- style="width: 150px; margin-left: 10px"
- @change="changeItem"
- >
- <el-option label="全部" value=0> </el-option>
- <el-option
- v-for="(item, index) in items"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
-
- <el-input
- size="small"
- style="width: 150px"
- v-model="keywords"
- class="filter-item"
- placeholder="请输入项目名称"
- />
- <el-button
- size="small"
- style="margin: 0 10px"
- class="filter-item"
- type="primary"
- @click="searchAction"
- >搜索
- </el-button>
- <el-date-picker
- v-model="chargeDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- @change="changeDate"
- end-placeholder="结束日期"
- >
- </el-date-picker>
- <el-button type="primary" size="small" @click="toPrint">打印</el-button>
- </div>
- <div></div>
- </div>
- <el-table
- :data="tableData"
- border
- :row-style="{ color: '#303133' }"
- ref="table"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- max-height="600"
- show-summary
- v-loading="detail_loading"
- highlight-current-row
- >
- <el-table-column type="index" label="序号" width="60px" align="center">
- <template slot-scope="scope">
- {{ scope.row.index }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="处方日期">
- <template slot-scope="scope">{{
- getTime(scope.row.record_date)
- }}</template>
- </el-table-column>
- <el-table-column align="center" label="费用编码">
- <template slot-scope="scope">
- {{ scope.row.number }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="项目名称">
- <template slot-scope="scope">
- <span v-if="scope.row.advice_id > 0">{{
- scope.row.advice.advice_name
- }}</span>
- <span v-if="scope.row.project_id > 0">
- <span v-if="scope.row.project.type == 2">{{
- scope.row.project.project.project_name
- }}</span>
- <span v-if="scope.row.project.type == 3">{{
- scope.row.project.good_info.good_name
- }}</span>
- </span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="规格">
- <template slot-scope="scope">
- <span v-if="scope.row.advice_id > 0"
- >{{ scope.row.advice.drug.dose
- }}{{ scope.row.advice.drug.dose_unit }}*{{
- scope.row.advice.drug.min_number
- }}{{ scope.row.advice.drug.min_unit }}/{{
- scope.row.advice.drug.max_unit
- }}</span
- >
- <span v-if="scope.row.project_id > 0">
- <span v-if="scope.row.project.type == 2">{{
- scope.row.project.project.project_name
- }}</span>
- <span v-if="scope.row.project.type == 3">{{
- scope.row.project.good_info.specification_name
- }}</span>
- </span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="数量">
- <template slot-scope="scope">
- {{ scope.row.cnt }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="单位">
- <template slot-scope="scope">
- <span v-if="scope.row.advice_id > 0">{{
- scope.row.advice.prescribing_number_unit
- }}</span>
- <span v-if="scope.row.project_id > 0">
- <span v-if="scope.row.project.type == 2">{{
- scope.row.project.project.unit
- }}</span>
- <span v-if="scope.row.project.type == 3">{{
- scope.row.project.good_info.packing_unit
- }}</span>
- </span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="单价">
- <template slot-scope="scope">
- {{ scope.row.pric }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="金额" prop="total_price">
- <template slot-scope="scope">
- <div>
- {{ scope.row.total_price }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="备注">
- <template slot-scope="scope">
- <div>
- <span v-if="scope.row.advice_id > 0">{{
- scope.row.advice.remark
- }}</span>
- <span v-if="scope.row.project_id > 0">
- <span v-if="scope.row.project.type == 2">{{
- scope.row.project.remark
- }}</span>
- <span v-if="scope.row.project.type == 3">{{
- scope.row.project.remark
- }}</span>
- </span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div style="display: flex; justify-content: space-around; margin-top: 25px">
- <div>总费用:{{ getAllPice() }}</div>
- <div>
- 个人支付:
- <span v-if="his_patient.balance_accounts_type == 2">{{ getAllPice() }}</span>
- <span v-if="his_patient.balance_accounts_type != 2">{{ getActPay() }}</span>
-
- </div>
- <div>基金支付记账:{{ getFundPaySumamt() }}</div>
- <div>补充医疗支付记账:{{ getHifesPay() }}</div>
- <div>救助支付金额:{{ getMafPay() }}</div>
- </div>
- </div>
-
- <!-- </div> -->
- </template>
-
-
- <script>
- import BreadCrumb from "@/xt_pages/components/bread-crumb";
- import { getHisSummaryDetailList } from "@/api/his/his_tools";
- const moment = require("moment");
- import { uParseTime } from "@/utils/tools";
- export default {
- components: {
- BreadCrumb,
- },
- props: {
- patient_id: {
- type: Number,
- default: 0,
- },
- },
-
- data() {
- return {
- detail_loading: false,
- tempArr: [],
- pos: 0,
- search_input: "",
-
- sameRowArr: [],
- keywords: "",
- tableData: [],
- chargeDate: [
- moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
- moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
- ],
- item_type: "0",
- items: [
- { id: 1, name: "药品" },
- { id: 2, name: "项目" },
- { id: 3, name: "耗材" },
- ],
- list: [],
- his_patient: {},
- id: 0,
- start_time: "",
- end_time: "",
- org_id:0,
- };
- },
- methods: {
- getTime(val) {
- if (val <= 0) {
- return "";
- }
- if (val == "") {
- return "";
- } else {
- return uParseTime(val, "{y}-{m}-{d}");
- }
- },
- searchAction() {
- let table_id = this.$store.getters.pagedata.list.table_id;
- if (table_id == undefined) {
- this.$store.commit("SET_PAGEDATA", {
- table_id: 0,
- type_id: this.id,
- keywords: this.keywords,
- start_time: this.chargeDate[0],
- end_time: this.chargeDate[1],
- patient_id: this.patient_id,
- });
- } else {
- this.$store.commit("SET_PAGEDATA", {
- table_id: table_id,
- type_id: this.id,
- keywords: this.keywords,
- start_time: this.chargeDate[0],
- end_time: this.chargeDate[1],
- patient_id: this.patient_id,
- });
- }
- this.getHisSummaryDetailList();
- },
- changeDate() {
- this.start_time = this.chargeDate[0];
- this.end_time = this.chargeDate[1];
- this.getHisSummaryDetailList();
- },
- changeItem(id) {
- this.id = id;
- let table_id = this.$store.getters.pagedata.list.table_id;
- if (table_id == undefined) {
- this.$store.commit("SET_PAGEDATA", {
- table_id: 0,
- type_id: this.id,
- keywords: this.keywords,
- start_time: this.chargeDate[0],
- end_time: this.chargeDate[1],
- patient_id: this.patient_id,
- });
- } else {
- this.$store.commit("SET_PAGEDATA", {
- table_id: table_id,
- type_id: this.id,
- keywords: this.keywords,
- start_time: this.chargeDate[0],
- end_time: this.chargeDate[1],
- patient_id: this.patient_id,
- });
- }
- this.getHisSummaryDetailList();
- },
- getHisSummaryDetailList() {
- let start_time = this.chargeDate[0];
- let end_time = this.chargeDate[1];
- let params = {
- patient_id: this.patient_id,
- start_time: start_time,
- end_time: end_time,
- type: this.item_type,
- keyword: this.keywords,
- };
- getHisSummaryDetailList(params).then((response) => {
- if (response.data.state == 1) {
- var list = response.data.data.list;
- this.his_patient = response.data.data.his_patient;
- this.list = list;
- this.tableData = [];
- for (let i = 0; i < list.length; i++) {
- for (let j = 0; j < list[i].orders.length; j++) {
- for (let z = 0; z < list[i].orders[j].order_info.length; z++) {
- list[i].orders[j].order_info[z].record_date =
- list[i].orders[j].settle_accounts_date;
- list[i].orders[j].order_info[z].number =
- list[i].orders[j].number;
- this.tableData.push(list[i].orders[j].order_info[z]);
- }
- }
- }
-
- var obj = { index: "合计", total_price: 0, record_date: "0" };
- for (let i = 0; i < this.tableData.length; i++) {
- this.tableData[i].index = i + 1;
- this.tableData[i].total_price = 0;
- this.tableData[i].total_price = (
- this.tableData[i].cnt * this.tableData[i].pric
- ).toFixed(2);
- obj.total_price += this.tableData[i].cnt * this.tableData[i].pric;
- }
- obj.total_price = obj.total_price.toFixed(2);
-
- var new_arr = [];
-
- let list_1 = this.$store.getters.pagedata.list;
- if (list_1.keywords == undefined) {
- this.keywords = "";
- } else {
- this.keywords = list_1.keywords;
- }
- this.id = list_1.type_id;
- this.item_type = this.id
-
- if (this.keywords != "") {
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].index != "合计") {
- if (this.tableData[i].advice_id > 0) {
- if (
- this.tableData[i].advice.advice_name.indexOf(
- this.keywords
- ) > -1
- ) {
- new_arr.push(this.tableData[i]);
- }
- }
- if (this.tableData[i].project_id > 0) {
- if (this.tableData[i].project.type == 2) {
- if (
- this.tableData[i].project.project.project_name.indexOf(
- this.keywords
- ) > -1
- ) {
- new_arr.push(this.tableData[i]);
- }
- }
- if (this.tableData[i].project.type == 3) {
- if (
- this.tableData[i].project.good_info.good_name.indexOf(
- this.keywords
- ) > -1
- ) {
- new_arr.push(this.tableData[i]);
- }
- }
- }
- }
- }
- var objs = { index: "合计", total_price: 0, record_date: "0" };
- objs.total_price = this.getPrice(new_arr);
- this.tableData = new_arr;
- }
-
- if (this.id == 1) {
- var obj = { index: "合计", total_price: 0, record_date: "0" };
- var new_arr = [];
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].index != "合计") {
- if (this.tableData[i].advice_id > 0) {
- new_arr.push(this.tableData[i]);
- }
- }
- }
- this.tableData = [];
- obj.total_price = this.getPrice(new_arr);
- this.tableData = new_arr;
- }
- if (this.id == 2) {
- var obj = { index: "合计", total_price: 0, record_date: "0" };
- var new_arr = [];
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].index != "合计") {
- if (this.tableData[i].project_id > 0) {
- if (this.tableData[i].project.type == 2) {
- new_arr.push(this.tableData[i]);
- }
- }
- }
- }
- this.tableData = [];
- obj.total_price = this.getPrice(new_arr);
- this.tableData = new_arr;
- }
-
- if (this.id == 3) {
- var new_arr = [];
- var obj = { index: "合计", total_price: 0, record_date: "0" };
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].index != "合计") {
- if (this.tableData[i].project_id > 0) {
- if (this.tableData[i].project.type == 3) {
- new_arr.push(this.tableData[i]);
- }
- }
- }
- }
- this.tableData = [];
- obj.total_price = this.getPrice(new_arr);
- this.tableData = new_arr;
- }
- }
- });
- },
-
- getAllPice() {
- var total_price = 0;
- for (let i = 0; i < this.tableData.length; i++) {
- total_price += this.tableData[i].pric * this.tableData[i].cnt;
- }
- return total_price.toFixed(2);
- },
- getActPay() {
- var act_pay = 0;
- for (let i = 0; i < this.list.length; i++) {
- for (let j = 0; j < this.list[i].orders.length; j++) {
- act_pay += this.list[i].orders[j].acct_pay;
- }
- }
- return act_pay.toFixed(2)
- },
- getFundPaySumamt() {
- var fund_pay_sumamt = 0;
- for (let i = 0; i < this.list.length; i++) {
- for (let j = 0; j < this.list[i].orders.length; j++) {
- fund_pay_sumamt += this.list[i].orders[j].fund_pay_sumamt;
- }
- }
- return fund_pay_sumamt;
- },
- getHifesPay() {
- var hifes_pay = 0;
- for (let i = 0; i < this.list.length; i++) {
- for (let j = 0; j < this.list[i].orders.length; j++) {
- hifes_pay += this.list[i].orders[j].hifes_pay;
- }
- }
- return hifes_pay;
- },
- getMafPay() {
- var maf_pay = 0;
- for (let i = 0; i < this.list.length; i++) {
- for (let j = 0; j < this.list[i].orders.length; j++) {
- maf_pay += this.list[i].orders[j].maf_pay;
- }
- }
- return maf_pay;
- },
- toPrint() {
- this.$router.push({
- path:
- "/hisTool/detailPrint?patient_id=" +
- this.patient_id +
- "&start_time=" +
- this.start_time +
- "&end_time=" +
- this.end_time +
- "&type=" +
- this.item_type +
- "&keyword=" +
- this.keywords +
- "&id=" +
- this.id +
- "&balance_accounts_type=" +
- this.his_patient.balance_accounts_type,
- });
-
- // ======打印时将查询参数保存至store中======
- // table_id: 左栏表格下标
- // type_id: 下拉框id
- // keywords: 输入框
- // start_time: this.chargeDate[0],
- // end_time: this.chargeDate[1],
- // patient_id:this.patient_id
- let table_id = this.$store.getters.pagedata.list.table_id;
- if (table_id == undefined) {
- this.$store.commit("SET_PAGEDATA", {
- table_id: 0,
- type_id: this.id,
- keywords: this.keywords,
- start_time: this.chargeDate[0],
- end_time: this.chargeDate[1],
- patient_id: this.patient_id,
- });
- } else {
- this.$store.commit("SET_PAGEDATA", {
- table_id: table_id,
- type_id: this.id,
- keywords: this.keywords,
- start_time: this.chargeDate[0],
- end_time: this.chargeDate[1],
- patient_id: this.patient_id,
- });
- }
- },
- getPrice(val) {
- var total_price = 0;
- for (let i = 0; i < val.length; i++) {
- total_price += val[i].cnt * val[i].pric;
- }
- return total_price.toFixed(2);
- },
- },
- created() {
- this.org_id = this.$store.getters.xt_user.org.id;
- console.log("org_id233232323232",this.org_id)
- this.start_time = this.chargeDate[0];
- this.end_time = this.chargeDate[1];
- this.getHisSummaryDetailList();
- },
- watch: {
- patient_id: function () {
- this.patient_id = this.patient_id;
- this.getHisSummaryDetailList();
- },
- },
- };
- </script>
|