You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1653 lines
61 KiB

<template>
<div style="font-size: 14px;">
<div>
<div class="contenttitle">
体检登记 /<span class="contenttitleBold">体检收费</span>
</div>
<el-tabs v-model="activeName">
<el-tab-pane label="体检收费" name="peis">
<div style="display: flex; width: 100%;">
<!-- 查询条件 与列表 -->
<div :style="`display: block;width: ${Math.floor(bodyWidth * 3 / 5)}px;`">
<!-- 查询条件 -->
<div style="height: 60px;padding: 10px;border-radius: 8px;background-color: #fff;margin-bottom: 10px;">
<div style="display:flex;">
<div>
<span>{{ dateTypeName }}日期</span>
<el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small"
style="width:90px;" :picker-options="pickerOptions" />
<span style="margin: 0 3px;">至</span>
<el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small"
style="width:90px;" :picker-options="pickerOptions" />
</div>
<div>
<span class="query">条码号</span>
<el-input ref="tmh" placeholder="条码号" v-model="query.patientRegisterNo" size="small"
style="width: 120px;" clearable />
</div>
<div>
<span class="query">档案号</span>
<el-input placeholder="档案号" v-model="query.patientNo" size="small" style="width: 90px;" clearable />
</div>
</div>
<div style="display:flex;justify-content: space-between;">
<div style="display:flex;">
<div>
<span>姓名</span>
<el-input placeholder="姓名" v-model="query.patientName" size="small" style="width: 100px;"
clearable />
</div>
<el-radio-group v-model="query.chargeFlag" @input="btnQuery" size="mini"
style="margin-top:8px;margin-left: 21px;">
<el-radio label="N">未收费</el-radio>
<el-radio label="Y">已收费</el-radio>
<el-radio label="B">已退费</el-radio>
</el-radio-group>
<div v-if="query.chargeFlag != 'N'" style="margin-left:21px;">
<span>发票号</span>
<el-input placeholder="发票/收据号" v-model="query.invoiceNo" size="small" style="width: 90px;"
clearable />
</div>
</div>
<div>
<el-button type="primary" class="commonbutton" @click="btnQuery" size="small"
style="width:60px;">查询</el-button>
</div>
</div>
</div>
<!-- 列表 -->
<div style="padding: 10px;border-radius: 8px;background-color: #fff;">
<el-table :data="patientList" border highlight-current-row ref="patientList" :height="tableListHeight"
@row-click="rowClick" size="small">
<!--
<el-table-column prop="patientRegisterId" label="体检记录ID" />
-->
<el-table-column type="index" label="序号" width="40" align="center" />
<el-table-column v-if="query.chargeFlag == 'Y'" label="收费时间" prop="chargeTime" width="140"
align="center" />
<el-table-column v-if="query.chargeFlag == 'Y'" label="收费人" prop="chargeName" width="80"
align="center" />
<el-table-column v-if="query.chargeFlag == 'Y'" label="收费金额" prop="chargeMoney" width="80"
align="center" />
<el-table-column v-if="query.chargeFlag == 'B'" label="退费时间" prop="chargeBackTime" width="140"
align="center" />
<el-table-column v-if="query.chargeFlag == 'B'" label="退费人" prop="chargeBackName" width="80"
align="center" />
<el-table-column v-if="query.chargeFlag == 'B'" label="退费金额" prop="chargeBackMoney" width="80"
align="center" />
<el-table-column prop="customerOrgParentName" label="单位" width="150">
<template slot-scope="scope">
<div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName :
scope.row.customerOrgName }}
</div>
</template>
</el-table-column>
<el-table-column prop="patientName" label="姓名" />
<el-table-column prop="sexId" label="性别" width="40" align="center" />
<el-table-column prop="age" label="年龄" width="40" align="center" />
<el-table-column prop="patientRegisterNo" label="条码号" width="120" align="center" />
<el-table-column prop="patientNo" label="档案号" width="80" align="center" />
<el-table-column prop="medicalTimes" label="体检次数" width="80" align="center" />
<el-table-column prop="isVip" label="VIP" width="30" align="center">
<template slot-scope="scope">
<div>{{ scope.row.isVip == "Y" ? "是" : "否" }}</div>
</template>
</el-table-column>
<el-table-column prop="salesman" label="介绍人" />
<el-table-column prop="invoiceNo" label="发票号" />
<el-table-column prop="invoiceOrgName" label="发票抬头" />
<!--
<el-table-column prop="chargeId" label="介绍人" />
<el-table-column prop="chargeBackId" label="介绍人" />
-->
<el-table-column prop="email" label="邮箱" width="180" />
<el-table-column prop="idNo" label="身份证" width="150" />
<el-table-column prop="mobileTelephone" label="手机" width="100" />
<el-table-column prop="telephone" label="电话" width="100" />
<el-table-column prop="address" label="地址" width="300" />
</el-table>
</div>
</div>
<!-- 收费操作 -->
<div :style="`display: block;margin-left:10px;width: ${Math.floor(bodyWidth * 2 / 5)}px;`">
<!-- 人员信息 -->
<div style="height: 40px; background-color: #fff;border-radius: 8px;margin-bottom: 10px;">
<div style="display: flex; flex-wrap: wrap;height:40px; width: 100%;align-items: center;">
<div class="query">
<span>条码号</span>
<el-input v-model="info.patientRegisterNo" size="small" style="margin-left: 3px; width: 120px;"
disabled />
</div>
<div class="query">
<span>档案号</span>
<el-input v-model="info.patientNo" size="small" style="margin-left: 3px; width: 90px;" disabled />
</div>
<div class="query">
<span>姓名</span>
<el-input v-model="info.patientName" size="small" style="margin-left: 3px; width: 80px;" disabled />
</div>
</div>
</div>
<!-- 收费信息 -->
<div>
<!-- charge -->
<div style="padding: 10px;margin-bottom: 7px;background-color: rgb(255, 255, 255);border-radius: 8px;">
<el-form ref="form" :model="form" label-width="80px" :rules="rules" size="medium"
:disabled="query.chargeFlag != 'N'">
<el-row>
<el-col :span="12">
<el-form-item label="发票号" prop="invoiceNo">
<el-input v-model="form.invoiceNo" size="small" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开票抬头" prop="invoiceOrgName">
<el-input v-model="form.invoiceOrgName" size="small" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="折扣" prop="discount">
<el-input v-model="form.discount" @input="discountToDetails" size="small" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="应收金额" prop="total">
<el-input v-model="form.total" @input="totalToDetails" size="small" />
</el-form-item>
</el-col>
</el-row>
<el-row v-if="query.chargeFlag == 'N'">
<el-col :span="12">
<el-form-item label="预收金额" prop="preTotal">
<el-input v-model="form.preTotal" disabled size="small" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="找零" prop="balance">
<el-input v-model="form.balance" disabled size="small" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- charge_pay -->
<div style="padding: 10px;background-color: #fff;margin-bottom: 7px;border-radius: 8px;">
<div style="font-size:10px;">{{ query.chargeFlag == 'B' ? '退' : '收' }}费方式:</div>
<el-table :data="chargePays" border highlight-current-row size="small"
:height="Math.floor((tableListHeight - 155) / 2)">
<el-table-column prop="payModeId" :label="(query.chargeFlag == 'B' ? '退' : '收') + '费方式'"
min-width="100">
<template slot-scope="scope">
<div>{{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}</div>
</template>
</el-table-column>
<el-table-column prop="chargeMoney" label="金额" min-width="80">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.chargeMoney" size="small" @input="inputMoney"
:disabled="query.chargeFlag == 'B'" />
</template>
</el-table-column>
<!-- 旧的选卡方式
<el-table-column prop="cardRegisterId" label="会员卡">
<template slot-scope="scope">
<el-select v-model="scope.row.cardRegisterId" placeholder="请选择" size="small" filterable
clearable :disabled="scope.row.payModeId == '05' && query.chargeFlag != 'B' ? false : true">
<el-option v-for="item in cardRegister" :key="item.id" :label="item.cardNo"
:value="item.id" />
</el-select>
</template>
</el-table-column>
-->
<el-table-column prop="cardRegisterId" label="会员卡" min-width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.cardNo" size="small" disabled />
</template>
</el-table-column>
<el-table-column v-if="query.chargeFlag == 'N'" width="60" align="center">
<template slot-scope="scope">
<i class="el-icon-search" @click="getCardId(scope.$index)" v-if="scope.row.payModeId == '05'"
style="font-size: 24px;color: blue;cursor:pointer;"></i>
<i class="el-icon-s-open" @click="brushCard(scope.$index)" v-if="scope.row.payModeId == '05'"
style="font-size: 24px;color: red;cursor:pointer;"></i>
</template>
</el-table-column>
</el-table>
</div>
<!-- asbitem -->
<div style="padding: 10px;background-color: rgb(255, 255, 255);border-radius: 8px;">
<div style="font-size:10px;">{{ query.chargeFlag == 'N' ? '待收' : (query.chargeFlag == 'Y' ?
'已收' : '已退') }}费项目:</div>
<el-table :data="asbItemsForFee" border highlight-current-row
:height="Math.floor((tableListHeight - 155) / 2)" size="small"
@selection-change="handleSelectionChange" ref="asbItemsForFeeTable">
<el-table-column type="selection" align="center" v-if="query.chargeFlag == 'N'" />
<el-table-column label="组合项目" width="120" prop="asbitemName" />
<el-table-column label="标准价格" prop="standardPrice" width="80" align="center" />
<el-table-column label="折扣" prop="discount" width="60" align="center">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.discount" v-if="query.chargeFlag == 'N'"
:disabled="scope.row.isCharge == 'Y' ? true : false" size="small"
@input="changeDiscount(scope.row)" />
<div v-if="query.chargeFlag != 'N'">{{ scope.row.discount }}</div>
</template>
</el-table-column>
<el-table-column label="数量" prop="amount" width="50" align="center" />
<el-table-column label="实收价格" prop="chargePrice" width="80" align="center">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.chargePrice" v-if="query.chargeFlag == 'N'"
:disabled="scope.row.isCharge == 'Y' ? true : false" size="small"
@input="changePrice(scope.row)" />
<div v-if="query.chargeFlag != 'N'">{{ scope.row.chargePrice }}</div>
</template>
</el-table-column>
<el-table-column prop="total" label="金额" width="70" v-if="false" />
<el-table-column prop="standardPrice" label="标准金额" width="80" v-if="false" />
<el-table-column label="支付方式" prop="payTypeFlag" width="100" align="center">
<template slot-scope="scope">
<div>{{ dddw(dict.payType, "id", scope.row.payTypeFlag, "displayName") }}</div>
</template>
</el-table-column>
<el-table-column prop="checkCompleteFlag" label="状态" align="center">
<template slot-scope="scope">
<div>{{ dddw(dict.checkCompleteFlag, "id", scope.row.checkCompleteFlag, "displayName") }}</div>
</template>
</el-table-column>
<el-table-column prop="creatorName" label="登记人" align="center" />
<el-table-column prop="creationTime" label="登记日期" width="90" align="center">
<template slot-scope="scope">
<div v-if="scope.row.creationTime">{{ moment(scope.row.creationTime).format('yyyy-MM-DD') }}
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="btnDivClass">
<div class="btnListClass">
<el-button type="primary" class="commonbutton" @click="btnCharge"
:disabled="query.chargeFlag == 'N' ? false : true">收费</el-button>
</div>
<div class="btnListClass">
<el-button type="danger" class="commonbutton" @click="btnChargeBack"
:disabled="query.chargeFlag == 'Y' ? false : true">退费</el-button>
</div>
<div class="btnListClass">
<el-button type="success" class="commonbutton" @click="chargePrint('0007', false, form.id)"
:disabled="query.chargeFlag == 'B' ? true : false">打印</el-button>
</div>
<div class="btnListClass">
<el-button type="success" class="commonbutton" @click="chargePrint('0007', true, form.id)"
:disabled="query.chargeFlag == 'B' ? true : false">打印预览</el-button>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="小程序退费" name="web">
<WebChargeBack />
</el-tab-pane>
</el-tabs>
</div>
<!--弹窗-->
<!--选卡号-->
<el-dialog title="选卡" :visible.sync="winDialog.queryCard" width="800px" height="500" :show-close="false"
:close-on-click-modal="false" :append-to-body="true">
<!--查询条件-->
<div style="display: flex;justify-content: space-between;">
<div>
<el-select v-model="queryCard.queryCol" placeholder="请选择" clearable size="small">
<el-option label="卡号" value="cardNo" />
<el-option label="姓名" value="customerName" />
<el-option label="身份证号" value="idNo" />
<el-option label="手机号" value="phone" />
</el-select>
<el-input placeholder="卡号" v-model="queryCard.value" size="small" clearable style="width: 190px"
@change="btnQueryCard" />
</div>
<div class="query">
<el-button class="commonbutton" @click="btnQueryCard">查询</el-button>
</div>
</div>
<el-table :data="cardDatas" border height="400" row-key="id" size="small" highlight-current-row
@row-click="cardRowClick" @row-dblclick="rowDblclick" ref="patientList">
<el-table-column prop="cardTypeName" label="卡类别" min-width="70" />
<el-table-column prop="cardNo" label="会员卡号" min-width="150" />
<el-table-column prop="discount" label="折扣率" min-width="80" />
<el-table-column prop="cardBalance" label="卡余额" min-width="80" />
<el-table-column prop="expiryDate" label="有效期限" min-width="120">
<template slot-scope="scope">
<div v-if="scope.row.expiryDate">
{{ moment(scope.row.expiryDate).format("yyyy-MM-DD") }}
</div>
</template>
</el-table-column>
<el-table-column prop="customerName" label="卡主姓名" min-width="80" />
<el-table-column prop="idNo" label="卡主身份证号" min-width="200" />
<el-table-column prop="telephone" label="卡主电话" min-width="150" />
<el-table-column prop="mobileTelephone" label="卡主手机号" min-width="150" />
<el-table-column prop="remark" label="备注" min-width="200" />
<!--
<el-table-column prop="creatorName" label="创建人员" min-width="100" />
<el-table-column prop="creationTime" label="创建日期" min-width="150">
<template slot-scope="scope">
<div v-if="scope.row.creationTime">
{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}
</div>
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改人员" width="100" />
<el-table-column prop="lastModificationTime" label="修改日期" width="150">
<template slot-scope="scope">
<div v-if="scope.row.lastModificationTime">
{{
moment(scope.row.lastModificationTime).format("yyyy-MM-DD")
}}
</div>
</template>
</el-table-column>
-->
</el-table>
<span slot="footer" class="dialog-footer">
<el-button class="commonbutton" type="primary" @click="btnOkCard" style="width:90px;">确定</el-button>
<el-button class="commonbutton" @click="winDialog.queryCard = false" style="width:90px;">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import moment from 'moment';
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, dddw, arrayExistObj, arrayExistObjPos, deepCopy } from "../../utlis/proFunc";
import PatientRegisterQuery from "../../components/patientRegister/patientRegisterQuery.vue";
import PatientRegisterRefuseList from "../../components/patientRegister/PatientRegisterRefuseList.vue";
import WebChargeBack from "./WebChargeBack.vue";
export default {
components: {
PatientRegisterQuery,
PatientRegisterRefuseList,
WebChargeBack,
},
props: ["patientRegisterNo"],
data() {
return {
activeName: "peis",
query: {
chargeFlag: 'N', // N:未收费,Y:已收费,B:已退费
dateRange: null,
startDate: null,
endDate: null,
patientRegisterNo: '',
patientNo: '',
invoiceNo: '',
patientName: '',
},//查询条件
info: {
patientRegisterNo: '',
patientNo: '',
patientName: ''
},
patientList: [],//人员列表
formInit: {},
form: {
id: null,
patientRegisterId: null,
invoiceNo: '',
invoiceOrgName: '',
chargeFlag: '0',
discount: 100,
total: 0, //应收金额
preTotal: 0, //预收金额
balance: 0, //找零
}, //收费主表
rules: {
// invoiceNo: [
// { required: true, message: "请填写发票/收据号", trigger: "blur" },
// ],
total: [
{ required: true, message: "请填写应收金额", trigger: "blur" },
],
},
// pickerOptions: {
// shortcuts: [
// {
// text: "最近一周",
// onClick(picker) {
// const end = new Date();
// const start = new Date();
// start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
// picker.$emit("pick", [start, end]);
// },
// },
// {
// text: "最近一个月",
// onClick(picker) {
// const end = new Date();
// const start = new Date();
// start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
// picker.$emit("pick", [start, end]);
// },
// },
// {
// text: "最近三个月",
// onClick(picker) {
// const end = new Date();
// const start = new Date();
// start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
// picker.$emit("pick", [start, end]);
// },
// },
// ],
// },
chargePays: [], //收支方式
chargePaysInit: [], //收支方式(初始状态)
asbItemsForFee: [], //待收费项目
selectedData: [], //选中项目
cardRegister: [{ id: '00000000-0000-0000-0000-000000000000', cardNo: '0001' }], //当前客户的会员卡
cardRegisterAll: [], //所有客户的会员卡
queryCard: {
// <el-option label="卡号" value="cardNo" />
// <el-option label="姓名" value="customerName" />
// <el-option label="身份证号" value="idNo" />
// <el-option label="手机号" value="mobileTelephone" />
queryCol: "cardNo",
value: "",
},
cardDatas: [], //卡数据
cardSeq: 0, // 当前选卡的记录行数
cardChoosed: {}, //选中卡
winDialog: {
queryCard: false,
},
charge_normal_card: 1, // 单次收费允许使用多少张充值卡
};
},
created() {
this.formInit = Object.assign({}, this.form)
this.dictInit();
},
//挂载完成
mounted() {
this.enterToQuery()
if (this.patientRegisterNo) {
this.query.patientRegisterNo = this.patientRegisterNo
this.query.chargeFlag = 'N'
}
this.btnQuery();
},
computed: {
...mapState(["pickerOptions", "window", "dict", "dataTransOpts", "patientRegister", "customerOrg"]),
dateTypeName() {
let ret = '登记'
switch (this.query.chargeFlag) {
case 'N':
break;
case 'Y':
ret = '收费'
break;
case 'B':
ret = '退费'
break;
default:
break;
}
return ret
},
tableListHeight() {
let tempH = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
return tempH - 175 - 30 - 35
},
bodyWidth() {
let tempW = this.window.pageWidth < 600 ? 600 : this.window.pageWidth
return tempW - 110 - 25
}
},
methods: {
...mapActions(["getCustomerOrgGroup"]),
dddw, moment,
//查询人员列表数据
btnQuery() {
let url = '', body = {};
// {
// "skipCount": 2147483647,
// "sorting": "string",
// "patientName": "string",
// "patientNo": "string",
// "patientRegisterNo": "string",
// "invoiceNo": "string",
// "startDate": "string",
// "endDate": "string",
// "maxResultCount": 0
// }
//console.log('query', this.query);
if (this.query.patientRegisterNo) {
body = { patientRegisterNo: this.query.patientRegisterNo };
} else if (this.query.patientNo) {
body = { patientNo: this.query.patientNo };
} else if (this.query.invoiceNo && this.query.chargeFlag != 'N') {
body = { invoiceNo: this.query.invoiceNo };
} else {
if (this.query.startDate && this.query.endDate) {
body.startDate = moment(this.query.startDate).format("yyyy-MM-DD")
body.endDate = moment(this.query.endDate).format("yyyy-MM-DD")
if (body.startDate > body.endDate) {
this.$message.warning("起始日期不能大于截止日期,数据校验不通过!")
return
}
if (this.query.patientName) body.patientName = this.query.patientName
}
}
switch (this.query.chargeFlag) {
case 'Y':
//已收费
url = '/api/app/patientregister/getpatientregisterchargelist';
break;
case 'B':
//已退费
url = '/api/app/patientregister/getpatientregisterchargebacklist';
break;
default:
//未收费
url = '/api/app/patientregister/getpatientregisternotchargedlist'
break;
}
// 查询前,清除其他收费或人员信息数据
this.info.patientName = ''
this.info.patientNo = ''
this.info.patientRegisterNo = ''
this.form = Object.assign({}, this.formInit)
this.chargePays = []
this.asbItemsForFee = []
// const loading = this.$loading({
// lock: true,
// text: 'Loading',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// });
postapi(url, body).then(res => {
console.log(url, body, res)
if (res.code != - 1) {
this.patientList = res.data.items;
//this.patientList.length == 1 && this.query.chargeFlag == 'N'
if (this.patientList.length > 0) {
// this.query.patientRegisterNo = this.patientList[0].patientRegisterNo;
// this.query.patientName = this.patientList[0].patientName;
// this.query.patientNo = this.patientList[0].patientNo;
this.$nextTick(() => {
setTimeout(() => {
this.$refs['patientList'].setCurrentRow(this.patientList[0])
this.rowClick(this.patientList[0])
}, 20)
})
} else {
this.asbItemsForFee = []
this.form = Object.assign({}, this.formInit)
}
}
// loading.close();
})
.catch((err) => {
console.error(err)
// loading.close();
});
},
//人员列表点击
rowClick(row) {
this.info.patientRegisterNo = row.patientRegisterNo;
this.info.patientName = row.patientName;
this.info.patientNo = row.patientNo;
this.chargePays = deepCopy(this.chargePaysInit);
//console.log(this.chargePays, this.chargePaysInit);
if (this.query.chargeFlag == 'B') {
this.form.chargeFlag = '1';
} else {
this.form.chargeFlag = '0';
}
if (row.chargeId) {
this.form.id = row.chargeId;
this.form.invoiceNo = row.invoiceNo;
this.form.invoiceOrgName = row.patientName;
} else {
this.form.id = null;
this.form.invoiceNo = '';
this.form.invoiceOrgName = row.patientName;
}
//获取个人会员卡信息 (废弃)
//this.getCardRegister(row.idNo);
switch (this.query.chargeFlag) {
case 'N':
this.getAsbItemsForFee(row.patientRegisterId);
break;
case 'Y':
this.getChargePayByChargeId(row.chargeId);
this.getChargeAsbByChargeid(row.chargeId);
break;
default:
this.getChargeBackPayByChargeBackId(row.chargeBackId);
this.getChargeAsbByChargeid(row.chargeId);
break;
}
},
//获取项目列表
async getAsbItemsForFee(patientRegisterId) {
//待收费项目列表
this.asbItemsForFee = [];
getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${patientRegisterId}`)
.then(res => {
if (res.code == 1) {
this.asbItemsForFee = res.data;
for (let i = this.asbItemsForFee.length - 1; i >= 0; i--) {
if (this.asbItemsForFee[i].isCharge == 'Y' || this.asbItemsForFee[i].payTypeFlag !== '0') {
this.asbItemsForFee.splice(i, 1);
continue;
}
this.asbItemsForFee[i].chargePriceOri = this.asbItemsForFee[i].chargePrice;
this.asbItemsForFee[i].discount = Math.round(10000 * this.asbItemsForFee[i].chargePrice / this.asbItemsForFee[i].standardPrice) / 100;
this.asbItemsForFee[i].standTotal = this.asbItemsForFee[i].amount * this.asbItemsForFee[i].standardPrice;
this.asbItemsForFee[i].total = this.asbItemsForFee[i].amount * this.asbItemsForFee[i].chargePrice;
}
//勾选已收费项目
this.toCharge(patientRegisterId);
}
});
},
// "chargeId": "3a0d5685-b3a0-0186-0dd4-3b3ac0d2d08c",
// "asbitemId": "3a0c657d-4e73-9bab-68da-56ab2f088bb1",
// "asbitemName": "身高体重",
// "asbitemPrice": 17,
// "chargePrice": 18,
// "amount": 1,
// "registerAsbitemId": "3a0c6589-9b27-68d1-32f6-51082031d11c",
// "creatorName": "admin",
// "lastModifierName": null,
// "lastModificationTime": null,
// "lastModifierId": null,
// "creationTime": "2023-08-30T10:49:48.753174",
// "creatorId": "3a0c4180-107c-0c89-b25b-0bd34666dcec",
// "id": "3a0d5685-b3bb-8dc2-0d14-56af1ddd11f9"
// 获取个人充值卡
getCardRegister(idNo) {
this.cardRegister = [];
if (!idNo) return;
let body = { cardModeId: '0', idNo };
postapi(`/api/app/cardregister/getcardregisterlist`, body).then(res => {
if (res.code != - 1) {
this.cardRegister = res.data;
}
});
},
// 清除选的卡
brushCard(index) {
this.chargePays[index].cardNo = ''
this.chargePays[index].cardRegisterId = ''
this.chargePays[index].chargeMoney = 0
delete this.chargePays[index].discount
delete this.chargePays[index].cardBalance
// 刷新预收金额 及 找零
this.inputMoney()
},
// 弹出卡号查询窗口
getCardId(index) {
console.log('index', index)
this.cardSeq = index
this.cardDatas = [] //清除原来的卡列表数据
this.queryCard.value = ''
this.cardChoosed = {}
this.winDialog.queryCard = true // 显示选卡页面
},
// 根据条件查询卡列表数据
btnQueryCard() {
let body = {}
body[this.queryCard.queryCol] = this.queryCard.value
// body = {
// "cardModeId": "string",
// "cardNo": "string",
// "customerName": "string",
// "idNo": "string",
// "phone": "string"
// }
postapi('/api/app/CardRegister/GetCardRegisterCharge', body)
.then(res => {
if (res.code > -1) {
this.cardDatas = res.data
}
})
},
// 选中卡记录
cardRowClick(row) {
this.cardChoosed = Object.assign({}, row)
},
// 确定选中卡记录
btnOkCard() {
if(!this.cardChoosed.id){
this.$message.warning({showClose:true,message:'请选择会员卡'})
return
}
// 单次收费不允重复同一张卡
let lfind = arrayExistObj(this.chargePays, 'cardRegisterId', this.cardChoosed.id)
if (lfind > -1) {
this.$message.warning({ showClose: true, message: '单次收费不允重复同一张卡!' })
return
}
// 单次收费不允出现不同折扣的充值卡
let diffDiscount = false //默认相同折扣
let preDiscount = 100
let curDiscount = this.cardChoosed.discount || 100
this.chargePays.forEach(e => {
if (e.payModeId == '05' && e.discount) {
if (Number(e.discount) !== Number(curDiscount)) {
preDiscount = e.discount
diffDiscount = true
}
}
});
// 多张卡时,出现不同折扣,则返回
if (diffDiscount) {
this.$message.warning({ showClose: true, message: `当前所选卡折扣 ${curDiscount} 与 上次所选卡折扣 ${preDiscount} 不同,不可执行此操作` })
return
}
this.chargePays[this.cardSeq].cardNo = this.cardChoosed.cardNo + ' 余:' + this.cardChoosed.cardBalance + ' 折:' + curDiscount
this.chargePays[this.cardSeq].discount = curDiscount
this.chargePays[this.cardSeq].cardBalance = this.cardChoosed.cardBalance
this.chargePays[this.cardSeq].cardRegisterId = this.cardChoosed.id
// 将折扣带回,并触发
this.form.discount = curDiscount
this.discountToDetails()
this.winDialog.queryCard = false
},
// 双击选中卡记录
rowDblclick(row) {
this.cardRowClick(row)
this.btnOkCard()
},
//获取收费单包含的组合项目
getChargeAsbByChargeid(ChargeId) {
this.asbItemsForFee = [];
getapi(`/api/app/chargeasbitem/getchargeasbiteminchargeid?ChargeId=${ChargeId}`).then(res => {
if (res.code != - 1) {
res.data.forEach(e => {
this.asbItemsForFee.push({
asbitemName: e.asbitemName,
standardPrice: e.asbitemPrice,
chargePrice: e.chargePrice,
chargePriceOri: e.chargePrice,
amount: e.amount,
discount: Math.round(10000 * e.chargePrice / e.asbitemPrice) / 100,
payTypeFlag: e.payTypeFlag,
checkCompleteFlag: e.checkCompleteFlag,
creatorName: e.creatorName,
creationTime: e.creationTime,
});
});
this.sumTotal(this.asbItemsForFee, this.form);
}
});
},
//获取收费方式明细
getChargePayByChargeId(ChargeId) {
let curPayModeId = ''
let lfind = -1;
getapi(`/api/app/chargepay/getchargepayinchargeid?ChargeId=${ChargeId}`).then(res => {
if (res.code != - 1) {
res.data.forEach(e => {
if (curPayModeId != e.payModeId) lfind = -1
lfind++
console.log('lfind', lfind)
lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId, lfind);
if (lfind > - 1) {
this.chargePays[lfind].chargeMoney = e.chargeMoney;
this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
this.chargePays[lfind].cardNo = e.cardNo;
}
curPayModeId = e.payModeId
});
}
});
},
//获取退费方式明细
getChargeBackPayByChargeBackId(ChargeBackId) {
let curPayModeId = ''
let lfind = -1;
getapi(`/api/app/chargebackpay/getchargebackpayinchargebackid?ChargeBackId=${ChargeBackId}`).then(res => {
if (res.code != - 1) {
res.data.forEach(e => {
if (curPayModeId != e.payModeId) lfind = -1
lfind++
console.log('lfind', lfind)
lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId, lfind);
if (lfind > - 1) {
this.chargePays[lfind].chargeMoney = e.backMoeny;
this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
this.chargePays[lfind].cardNo = e.cardNo;
}
curPayModeId = e.payModeId
});
}
});
},
//待收费数据分析
toCharge(patientRegisterId) {
//默认全部选中
this.selectedData = [...this.asbItemsForFee];
this.$nextTick(function () {
this.selectedData.forEach(row => {
this.$refs['asbItemsForFeeTable'].toggleRowSelection(row)
})
});
this.form.patientRegisterId = patientRegisterId;
},
//根据明细算总价与折扣
sumTotal(details, head) {
let total = 0, totalOri = 0;
details.forEach(e => {
totalOri += Math.round(e.amount * e.chargePriceOri * 100) / 100; //原始实收价格
total += Math.round(e.amount * e.chargePrice * 100) / 100; //当前实收价格
//console.log(total, e.chargePrice, e.amount)
});
total = Math.round(total * 100) / 100;
totalOri = Math.round(totalOri * 100) / 100;
head.total = total;
//head.preTotal = total;
if (totalOri == 0) {
head.discount = 100;
} else {
head.discount = Math.round(10000 * total / totalOri) / 100;
}
//
this.findBalance()
},
//通过折扣计算总价与明细价格
discountToDetails() {
let discount = this.form.discount;
let totalOri = 0, totalCompute = 0, totalPlan = 0;
let lfind = -1;
this.selectedData.forEach(e => {
totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id)
if (lfind > -1 && e.chargePriceOri != 0) {
e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
totalCompute += Math.round(e.chargePrice * e.amount * 100) / 100;
}
});
totalPlan = Math.round(totalOri * discount) / 100;
this.form.total = totalPlan;
//this.form.preTotal = totalPlan;
//明细和与总金额不符处理
this.handleBalance(totalPlan, totalCompute);
this.findBalance()
},
//通过总价计算折扣与明细价格
totalToDetails() {
let discount = 100;
let totalOri = 0, totalCompute = 0, totalPlan = Number(this.form.total);
let lfind = -1;
this.selectedData.forEach(e => {
totalOri += Math.round(100 * e.amount * e.chargePriceOri) / 100; //原始实收价格
});
if (totalOri != 0) {
discount = Math.round(10000 * totalPlan / totalOri) / 100;
this.form.discount = discount;
}
//
this.selectedData.forEach(e => {
lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id);
if (lfind > -1) {
e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
totalCompute += Math.round(100 * e.chargePrice * e.amount) / 100;
}
});
//this.form.preTotal = totalPlan;
//明细和与总金额不符处理
this.handleBalance(totalPlan, Math.round(100 * totalCompute) / 100);
this.findBalance()
},
// 明细合计金额与总金额不一致时,处理
handleBalance(totalPlan, totalCompute) {
if (totalPlan != totalCompute) {
//console.log('明细合计金额与总金额不一致时', totalPlan, totalCompute, this.selectedData)
for (let i = this.selectedData.length - 1; i >= 0; i--) {
// lfind = arrayExistObj(this.asbItemsForFee, 'id', this.selectedData[i].id);
// if (lfind > -1 && this.selectedData[i].amount == 1) {
// this.asbItemsForFee[lfind].chargePrice = this.asbItemsForFee[lfind].chargePrice + totalPlan - totalCompute;
// this.selectedData[i].chargePrice = this.asbItemsForFee[lfind].chargePrice;
// break;
// }
//console.log('this.selectedData[i].amount', this.selectedData[i].amount)
if (this.selectedData[i].amount == 1) {
let chargePrice = this.selectedData[i].chargePrice
this.selectedData[i].chargePrice = Math.round((Number(chargePrice) + Number(totalPlan) - totalCompute)*100)/100 ;
this.selectedData[i].discount = Math.round(this.selectedData[i].chargePrice * 10000/this.selectedData[i].standardPrice)/100
//console.log('平衡金额 行数,前,后:', i, chargePrice, this.selectedData[i].chargePrice)
break;
}
}
}
},
//输入预收金额,计算找零
findBalance() {
this.form.balance = Math.round((this.form.preTotal - this.form.total) * 100) / 100;
},
//输入收费方式金额
inputMoney() {
// 现金 id = 01
let err = ''
let cashTotal = Number(0), unCashTotal = Number(0);
this.chargePays.forEach(e => {
console.log('e', e)
if (e.payModeId == '01') {
cashTotal += Number(e.chargeMoney);
} else {
unCashTotal += Number(e.chargeMoney);
}
if (e.payModeId == '05') {
if (Number(e.cardBalance) < Number(e.chargeMoney)) {
err = `会员卡【${e.cardNo}】 余额不足`
}
}
});
if (err) {
this.$message.warning({ showClose: true, message: err })
return
}
this.form.preTotal = cashTotal + unCashTotal
this.findBalance()
if (unCashTotal > this.form.total) this.$message.warning(`数据校验失败:输入的非现金金额${unCashTotal}不能超过应收金额${this.form.total}`);
},
//勾选要收费的项目
handleSelectionChange(v) {
this.selectedData = v;
this.sumTotal(this.selectedData, this.form);
},
//调整明细折扣
changeDiscount(row) {
let total = this.form.total;
let totalDetailsOri = Math.round(100 * row.amount * row.chargePrice) / 100;
let totalDetailsCur = 0;
row.chargePrice = Math.round(row.discount * row.standardPrice) / 100;
let lfind = arrayExistObj(this.selectedData, 'id', row.id);
if (lfind > -1) {
totalDetailsCur = Math.round(100 * row.amount * row.chargePrice) / 100;
this.form.total = total + totalDetailsCur - totalDetailsOri;
}
this.sumTotal(this.selectedData, this.form);
},
//调整明细实收价格
changePrice(row) {
if (row.chargePriceOri != 0) {
row.discount = Math.round(10000 * row.chargePrice / row.standardPrice) / 100;
}
this.sumTotal(this.selectedData, this.form);
},
//收费
btnCharge() {
let body = {};
let unCashTotal = Number(0), cashTotal = Number(0);
let msg = '';
let chargePays = [];
let asbitems = [];
if (this.form.id) {
this.$message.warning("已收费,不可重复操作!");
return;
}
this.$refs['form'].validate((valid, fields) => {
if (!valid) {
msg = fields[Object.keys(fields)[0]][0].message;
return;
}
});
if (msg) {
this.$message.warning(msg);
return;
}
this.chargePays.forEach(e => {
if (e.payModeId == '01') {
cashTotal += Number(e.chargeMoney);
} else {
unCashTotal += Number(e.chargeMoney);
}
if (e.payModeId == '05' && e.chargeMoney) {
//console.log(e.payModeId,e.chargeMoney,e.cardRegisterId);
if (!e.cardRegisterId) msg = dddw(this.dict.payMode, "id", e.payModeId, "displayName") + '付费,必需选择会员卡号';
if (Number(e.cardBalance) < Number(e.chargeMoney)) msg = `会员卡【${e.cardNo}】 余额不足`
} else {
e.cardRegisterId = null;
}
});
/**/
if (msg) {
this.$message.warning(msg);
return;
}
//规避套现
if (unCashTotal > this.form.total) {
this.$message.warning("非现金收款不可大于应收金额!");
return;
}
if (unCashTotal + cashTotal < this.form.total) {
this.$message.warning("收费方式合计收款不可小于应收金额!");
return;
}
let chargeMoney = Number(0)
this.chargePays.forEach(e => {
if (e.chargeMoney) {
if (e.payModeId == '01') {
//现金支付,数据库中存找零后的现金
chargePays.push({
payModeId: e.payModeId,
chargeMoney: e.chargeMoney - this.form.balance,
cardRegisterId: e.cardRegisterId,
});
} else {
chargePays.push({
payModeId: e.payModeId,
chargeMoney: e.chargeMoney,
cardRegisterId: e.cardRegisterId,
});
}
chargeMoney += Number(e.chargeMoney)
}
});
let detailsTotal = 0
this.selectedData.forEach(e => {
asbitems.push({
asbitemId: e.asbitemId,
chargePrice: e.chargePrice,
amount: e.amount,
registerAsbitemId: e.id,
});
detailsTotal += Math.round(100 * e.amount * e.chargePrice) / 100
});
if (Math.round(chargeMoney * 100) / 100 !== Math.round(detailsTotal * 100) / 100) {
this.$message.warning({ showClose: true, message: `明细合计 ${Math.round(detailsTotal * 100) / 100} 与 总金额 ${Math.round(chargeMoney * 100) / 100} 不一致` })
return
}
body = {
patientRegisterId: this.form.patientRegisterId,
invoiceNo: this.form.invoiceNo,
invoiceOrgName: this.form.invoiceOrgName,
chargePays,
asbitems,
};
// {
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "invoiceNo": "string",
// "invoiceOrgName": "string",
// "chargePays": [
// {
// "payModeId": "string",
// "chargeMoney": 0,
// "cardRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// ],
// "asbitems": [
// {
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "chargePrice": 0,
// "amount": 0,
// "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// ]
// }
//console.log('body',body);
postapi('/api/app/registerasbitem/registerasbitemcharge', body).then(res => {
if (res.code != -1) {
this.form.id = res.data.chargeId; //可防止重复提交收费
// 壳端 才有打印提示
this.$confirm("操作成功, 是否打印发票?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
}).then(() => {
this.chargePrint('0007', false, res.data.chargeId)
setTimeout(() => {
this.btnQuery();
}, 1000)
}).catch((err) => {
if (err == "cancel") {
//this.$message.info("已取消删除");
this.btnQuery();
}
});
}
});
},
//退费
btnChargeBack() {
let chargeId = this.form.id;
let msg = '';
let chargeBackPays = [];
let total = 0;
let body = {};
if (!chargeId) {
this.$message.warning("请选择待退费的记录!");
return;
}
if (this.form.chargeFlag == '1') {
this.$message.warning("已退费,不可重复操作!");
return;
}
this.$confirm("是否确定执行退费操作?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
}).then(() => {
this.chargePays.forEach(e => {
total += Number(e.chargeMoney);
if (e.payModeId == '05' && e.chargeMoney) {
if (!e.cardRegisterId) msg = '请先择会员卡号';
} else {
e.cardRegisterId = null;
}
return e;
});
if (msg) {
this.$message.warning(msg);
return;
}
if (total != this.form.total) {
this.$message.warning("退费方式合计金额与退费总金额不符");
return;
}
this.chargePays.forEach(e => {
if (e.chargeMoney) {
chargeBackPays.push({
payModeId: e.payModeId,
backMoeny: e.chargeMoney,
cardRegisterId: e.cardRegisterId,
});
}
});
// {
// "chargeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "chargeBackPays": [
// {
// "payModeId": "string",
// "backMoeny": 0,
// "cardRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// ]
// }
body = {
chargeId, chargeBackPays
}
postapi('/api/app/registerasbitem/registerasbitemchargeback', body).then(res => {
if (res.code != -1) {
console.log("操作成功!");
this.form.chargeFlag = '1'; //防止重复提交退费
this.btnQuery();
}
});
}).catch((err) => {
if (err == "cancel") {
this.$message.info("已取消删除");
}
});
},
//收费打印
chargePrint(ReportCode, isPreview, chargeId) {
console.log('ReportCode, isPreview, chargeId', ReportCode, isPreview, chargeId)
if (!chargeId) {
this.$message.info("人员信息尚未保存,不可执行此操作!");
return;
}
if (!this.$peisAPI) {
this.$message.info("此功能,需要在壳客户端才可运行!")
return
}
let token = window.sessionStorage.getItem('token');
let user = window.sessionStorage.getItem('user');
let toOutShell = {
ReportCode, token,
isBuildImage: 'N',
IsUploadPdf: 'N',
preViewCanPrint: 'Y',
Parameters: [
{ Name: 'printer', Value: user },
{ Name: 'hisLog', Value: 'pic/hisLog.jpg' },
],
BusinessCode: chargeId,
};
if (isPreview) {
/*
postapi(`/api/app/printreport/getchargereport?ChargeId=${chargeId}`)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = res.data;
console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
return this.$peisAPI.printPre(JSON.stringify(toOutShell));
}
})
.then(res => {
console.log(res)
if (JSON.parse(res).code < 0) {
this.$message.error(JSON.parse(res).message)
}
})
.catch(err => {
this.$message.warning(err);
});
*/
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(res).message });
}
})
.catch((err) => {
console.log('打印发票错误', err)
this.$message.warning({ showClose: true, message: `${err}` });
});
} else {
/*
postapi(`/api/app/printreport/getchargereport?ChargeId=${chargeId}`)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = res.data;
console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
return this.$peisAPI.print(JSON.stringify(toOutShell));
}
})
.then(res => {
console.log(res)
if (JSON.parse(res).code < 0) {
this.$message.error(JSON.parse(res).message)
}
})
.catch(err => {
this.$message.warning(err);
});
*/
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(res).message });
}
})
.catch((err) => {
console.log('打印发票错误', err)
this.$message.warning({ showClose: true, message: `${err}` });
});
}
},
// 获取系统参数 charge_normal_card 的值
getChargeNormalCard() {
return new Promise((resolve, reject) => {
// 获取系统参数(pacs系统条码类型:0:检查条码,1:人员条码)
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'charge_normal_card' })
.then(res => {
if (res.code > -1) {
try {
this.charge_normal_card = Number(res.data || "1") || 1
} catch (error) {
console.log('charge_normal_card', error)
}
}
})
.finally(() => {
resolve()
})
})
},
//数据初始化
dictInit() {
this.query.startDate = new Date()
this.query.endDate = this.query.startDate
/*
//性别(仅档案用)
getapi("/api/app/sex").then((res) => {
if (res.code == 1) {
this.dict.sex = res.data;
}
});
//性别(查询)
getapi("/api/app/for-sex").then((res) => {
if (res.code == 1) {
this.dict.forSex = res.data;
}
});
//体检单位
getapi("/api/app/customerorg/getbycodeall").then((res) => {
this.patientRegister.customerOrgTreeAll = res.data;
tcdate(this.patientRegister.customerOrgTreeAll)
});
//体检中心
getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
(res) => {
if (res.code == 1) {
this.dict.organization = res.data;
}
}
);
//体检单位
getapi("/api/app/customer-org/in-filter").then((res) => {
if (res.code == 1) {
this.dict.customerOrg = res.data;
}
});
//体检类别
getapi("/api/app/medical-type/in-filter").then((res) => {
if (res.code == 1) {
this.dict.medicalType = res.data;
}
});
//人员类别
getapi("/api/app/personnel-type/in-filter").then((res) => {
if (res.code == 1) {
this.dict.personnelType = res.data;
}
});
//婚姻状况
getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => {
if (res.code == 1) {
this.dict.maritalStatus = res.data;
}
});
//性激素期
getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
if (res.code == 1) {
this.dict.sexHormoneTerm = res.data;
}
});
//民族
getapi("/api/app/nation/in-filter").then((res) => {
if (res.code == 1) {
this.dict.nation = res.data;
}
});
//籍惯 ,出生地
getapi("/api/app/birth-place/in-filter").then((res) => {
if (res.code == 1) {
this.dict.birthPlace = res.data;
}
});
//套餐
postapi("/api/app/medicalpackage/GetBasicList", {}).then((res) => {
if (res.code == 1) {
this.dict.medicalPackage = res.data;
}
});
//分组,所有分组,不限单位,不限次数
postapi("/api/app/CustomerOrgGroup/GetBasicList").then((res) => {
if (res.code > -1) {
this.dict.customerOrgGroupAll = res.data;
}
});
//体检类别 树结构
getapi("/api/app/item-type/by-code-all").then((res) => {
if (res.code == 1) {
this.dict.itemTypeTree = res.data;
tcdate(this.dict.itemTypeTree);
}
});
*/
//支付方式 /api/app/pay-mode(全部)
this.getChargeNormalCard()
.then(() => {
return getapi("/api/app/paymode/getlistinisactive")
})
.then((res) => {
if (res.code == 1) {
this.dict.payMode = res.data;
//未收费时
this.chargePaysInit = [];
this.dict.payMode.forEach(e => {
if (e.id == '05') {
for (let index = 0; index < this.charge_normal_card; index++) {
this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null, cardRegisterId: '', cardNo: '' })
}
} else {
this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null, cardRegisterId: '', cardNo: '' })
}
});
this.chargePays = deepCopy(this.chargePaysInit);
}
});
// postapi("/api/app/asbitem/getasbitemlist", {}).then((res) => {
// if (res.code == 1) {
// this.dict.asbItemAll = res.data;
// }
// });
console.log("dict", this.dict);
},
//回车替代查询
enterToQuery() {
// console.log('enterToTab');
this.$nextTick(() => {
let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
// 为每个输入框添加键盘事件监听器
inputs.forEach((input, i) => {
// console.log('input',input);
input.addEventListener('keydown', (event) => {
if (event.keyCode === 13) {
// 阻止回车键的默认行为(换行)
event.preventDefault();
// 如果按下的是回车查询
console.log(input.getAttribute('placeholder'), input.value)
let placeholder = input.getAttribute('placeholder')
switch (placeholder) {
case '条码号':
case '档案号':
case '发票/收据号':
if (input.value) this.btnQuery()
input.select()
break;
case '卡号':
if (input.value) this.btnQueryCard()
input.select()
break;
}
}
});
input.addEventListener('click', (event) => {
let placeholder = input.getAttribute('placeholder')
switch (placeholder) {
case '条码号':
case '档案号':
case '姓名':
case '检查条码':
case '检验条码':
input.select()
break;
}
});
});
});
},
},
//监听事件()
watch: {
// 从登记页面,跳至收费页面时,始终默认为未收费方式
"dataTransOpts.refresh.charge.S": {
//immediate: true, // 立即执行
// // deep: true, // 深度监听复杂类型内变化
handler(newVal, oldVal) {
console.log(`watch: 收费 newVal: ${newVal}, oldVal: ${oldVal}, 人员条码号: `, this.patientRegisterNo)
this.query.patientRegisterNo = this.patientRegisterNo
this.query.chargeFlag = 'N'
this.btnQuery()
}
},
},
};
</script>
<style scoped>
@import '../../assets/css/global_button.css';
@import '../../assets/css/global_card.css';
@import '../../assets/css/global_dialog.css';
@import '../../assets/css/global_form.css';
@import '../../assets/css/global_input.css';
@import '../../assets/css/global_table.css';
@import '../../assets/css/global.css';
.query {
margin-left: 5px;
font-size: 14px;
color: #232748;
font-weight: 400;
font-family: "NotoSansSC-Regular";
}
.btnDivClass {
display: block;
width: 100px;
margin-left: 10px;
}
.btnListClass {
margin-top: 10px;
}
.btnClass {
width: 100px;
}
:deep .el-form-item--mini.el-form-item,
.el-form-item--small.el-form-item {
margin-bottom: 10px;
}
</style>