-
+
@@ -333,7 +365,7 @@
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 { tcdate, dddw, arrayExistObj, arrayExistObjPos, deepCopy } from "../../utlis/proFunc";
import PatientRegisterQuery from "../../components/patientRegister/patientRegisterQuery.vue";
import PatientRegisterRefuseList from "../../components/patientRegister/PatientRegisterRefuseList.vue";
@@ -359,6 +391,13 @@ export default {
invoiceNo: '',
patientName: '',
},//查询条件
+
+ info:{
+ patientRegisterNo: '',
+ patientNo: '',
+ patientName:''
+ },
+
patientList: [],//人员列表
formInit: {},
form: {
@@ -444,19 +483,37 @@ export default {
//挂载完成
mounted() {
- //this.enterToQuery()
-
- if (this.patientRegisterNo) {
- this.Query('patientRegisterNo');
- } else {
- this.Query();
+ 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
@@ -474,8 +531,8 @@ export default {
dddw, moment,
//查询人员列表数据
- Query(type) {
- let url = '', ltype = type, body = {};
+ btnQuery() {
+ let url = '', body = {};
// {
@@ -488,36 +545,28 @@ export default {
// "startDate": "string",
// "endDate": "string",
// "maxResultCount": 0
- // }
-
- if (this.patientRegisterNo) {
- this.query.patientRegisterNo = this.patientRegisterNo
- ltype = 'patientRegisterNo'
- }
-
+ // }
- console.log('query', ltype, this.query, this.patientRegisterNo);
+ //console.log('query', this.query);
- if (ltype == 'patientRegisterNo') {
- if (!this.query.patientRegisterNo) return;
+ if(this.query.patientRegisterNo){
body = { patientRegisterNo: this.query.patientRegisterNo };
- } else if (ltype == 'patientNo') {
- if (!this.query.patientNo) return;
+ }else if(this.query.patientNo){
body = { patientNo: this.query.patientNo };
- } else if (ltype == 'invoiceNo' && this.query.chargeFlag != 'N') {
- if (!this.query.invoiceNo) return;
+ }else if(this.query.invoiceNo && this.query.chargeFlag != 'N'){
body = { invoiceNo: this.query.invoiceNo };
- } else {
+ }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")
+ 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':
//已收费
@@ -533,6 +582,14 @@ export default {
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',
@@ -570,9 +627,10 @@ export default {
//人员列表点击
rowClick(row) {
- this.query.patientRegisterNo = row.patientRegisterNo;
- this.query.patientName = row.patientName;
- this.query.patientNo = row.patientNo;
+
+ 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);
@@ -593,10 +651,8 @@ export default {
this.form.invoiceOrgName = row.patientName;
}
- //获取个人会员卡信息
- this.getCardRegister(row.idNo);
-
-
+ //获取个人会员卡信息 (废弃)
+ //this.getCardRegister(row.idNo);
switch (this.query.chargeFlag) {
case 'N':
@@ -624,7 +680,7 @@ export default {
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' ) {
+ if (this.asbItemsForFee[i].isCharge == 'Y' || this.asbItemsForFee[i].payTypeFlag !== '0') {
this.asbItemsForFee.splice(i, 1);
continue;
}
@@ -671,8 +727,8 @@ export default {
},
// 清除选的卡
- brushCard(index){
- this.chargePays[index].cardNo = ''
+ brushCard(index) {
+ this.chargePays[index].cardNo = ''
this.chargePays[index].cardRegisterId = ''
this.chargePays[index].chargeMoney = 0
@@ -683,7 +739,7 @@ export default {
this.inputMoney()
},
-
+
// 弹出卡号查询窗口
getCardId(index) {
@@ -723,29 +779,29 @@ export default {
// 确定选中卡记录
btnOkCard() {
// 单次收费不允重复同一张卡
- let lfind = arrayExistObj(this.chargePays,'cardRegisterId',this.cardChoosed.id)
- if(lfind > -1){
- this.$message.warning({showClose:true,message:'单次收费不允重复同一张卡!'})
+ 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
+ let curDiscount = this.cardChoosed.discount || 100
this.chargePays.forEach(e => {
- if(e.payModeId == '05' && e.discount){
- if(Number(e.discount) !== Number(curDiscount)){
+ 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} 不同,不可执行此操作`})
+ 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
@@ -794,10 +850,10 @@ export default {
getapi(`/api/app/chargepay/getchargepayinchargeid?ChargeId=${ChargeId}`).then(res => {
if (res.code != - 1) {
res.data.forEach(e => {
- if(curPayModeId != e.payModeId) lfind = -1
+ if (curPayModeId != e.payModeId) lfind = -1
lfind++
- console.log('lfind',lfind)
- lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId,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;
@@ -815,10 +871,10 @@ export default {
getapi(`/api/app/chargebackpay/getchargebackpayinchargebackid?ChargeBackId=${ChargeBackId}`).then(res => {
if (res.code != - 1) {
res.data.forEach(e => {
- if(curPayModeId != e.payModeId) lfind = -1
+ if (curPayModeId != e.payModeId) lfind = -1
lfind++
- console.log('lfind',lfind)
- lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId,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;
@@ -952,14 +1008,14 @@ export default {
unCashTotal += Number(e.chargeMoney);
}
- if(e.payModeId == '05'){
- if(Number(e.cardBalance) < 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})
+ if (err) {
+ this.$message.warning({ showClose: true, message: err })
return
}
this.form.preTotal = cashTotal + unCashTotal
@@ -1033,7 +1089,7 @@ export default {
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}】 余额不足`
+ if (Number(e.cardBalance) < Number(e.chargeMoney)) msg = `会员卡【${e.cardNo}】 余额不足`
} else {
e.cardRegisterId = null;
}
@@ -1055,7 +1111,7 @@ export default {
this.$message.warning("收费方式合计收款不可小于应收金额!");
return;
}
-
+
this.chargePays.forEach(e => {
if (e.chargeMoney) {
if (e.payModeId == '01') {
@@ -1114,22 +1170,22 @@ export default {
//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)
+ this.chargePrint('0007', false, res.data.chargeId)
setTimeout(() => {
- this.Query();
+ this.btnQuery();
}, 1000)
}).catch((err) => {
if (err == "cancel") {
//this.$message.info("已取消删除");
- this.Query();
+ this.btnQuery();
}
});
}
@@ -1207,7 +1263,7 @@ export default {
if (res.code != -1) {
console.log("操作成功!");
this.form.chargeFlag = '1'; //防止重复提交退费
- this.Query();
+ this.btnQuery();
}
});
@@ -1448,13 +1504,13 @@ export default {
//未收费时
this.chargePaysInit = [];
this.dict.payMode.forEach(e => {
- if(e.id == '05'){
+ 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: '' })
+ this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null, cardRegisterId: '', cardNo: '' })
}
- }else{
+ } else {
this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null, cardRegisterId: '', cardNo: '' })
- }
+ }
});
this.chargePays = deepCopy(this.chargePaysInit);
}
@@ -1486,9 +1542,15 @@ export default {
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()
+ input.select()
break;
}
}
@@ -1515,13 +1577,15 @@ export default {
//监听事件()
watch: {
+ // 从登记页面,跳至收费页面时,始终默认为未收费方式
"dataTransOpts.refresh.charge.S": {
//immediate: true, // 立即执行
// // deep: true, // 深度监听复杂类型内变化
handler(newVal, oldVal) {
- console.log(`watch: 收费 newVal: ${newVal}, oldVal: ${oldVal}, 人员条码号: `, this.patientRegisterNo)
+ console.log(`watch: 收费 newVal: ${newVal}, oldVal: ${oldVal}, 人员条码号: `, this.patientRegisterNo)
this.query.patientRegisterNo = this.patientRegisterNo
- this.Query("patientRegisterNo")
+ this.query.chargeFlag = 'N'
+ this.btnQuery()
}
},
},