Browse Source

regeist

master
pengjun 2 years ago
parent
commit
2f5ae65a42
  1. 47
      src/components/customerOrg/customerOrgEdit.vue
  2. 13
      src/components/patientRegister/patientRegisterQuery.vue
  3. 216
      src/views/charge/charge.vue

47
src/components/customerOrg/customerOrgEdit.vue

@ -516,31 +516,28 @@ export default {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
//console.log('{patientRegisterIds}',{patientRegisterIds})
return deletapi(`/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`);
})
.then((res) => {
if (res.code != -1) {
this.$message.success("删除 操作成功");
this.getCustomerOrgTree("delete", this.customerOrg.customerOrgRd.id);
this.customerOrg.customerOrgRegisterList = []
this.customerOrg.contactPersonList = []
this.customerOrg.contactMethodList = []
this.setData({ key: "customerOrg.customerOrgRd", value: { id: "" } });
this.$refs[formName].resetFields();
this.customerOrg.oprStatus = ''
this.customerOrg.customerOrgId = ''
}
})
.catch((err) => {
if (err == "cancel") {
this.$message.info("已取消删除");
} else {
this.$message.error("操作失败,原因:" + err);
}
});
}).then(() => {
//console.log('{patientRegisterIds}',{patientRegisterIds})
return deletapi(`/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`);
}).then((res) => {
if (res.code != -1) {
this.$message.success("删除 操作成功");
this.getCustomerOrgTree("delete", this.customerOrg.customerOrgRd.id);
this.customerOrg.customerOrgRegisterList = []
this.customerOrg.contactPersonList = []
this.customerOrg.contactMethodList = []
this.setData({ key: "customerOrg.customerOrgRd", value: { id: "" } });
this.$refs[formName].resetFields();
this.customerOrg.oprStatus = ''
this.customerOrg.customerOrgId = ''
}
}).catch((err) => {
if (err == "cancel") {
this.$message.info("已取消删除");
} else {
this.$message.error("操作失败,原因:" + err);
}
});
},
},

13
src/components/patientRegister/patientRegisterQuery.vue

@ -52,7 +52,7 @@
<span class="spanClass">次数</span>
<el-select
v-model="patientRegister.query.customerOrgRegister"
placeholder="次数"
placeholder="次数" @change="changeCustomerOrgRegister"
style="width: 60px;"
size="small"
value-key="id"
@ -114,12 +114,22 @@ export default {
...mapState(["window", "dict", "patientRegister", "customerOrg"]),
},
methods: {
//
btnQuery() {
this.patientRegister.query.times++;
console.log("this.patientRegister.query", this.patientRegister.query);
},
changeCustomerOrgRegister(v){
this.patientRegister.query.startDate = new Date(v.beginTime)
if(v.isComplete == 'Y'){
this.patientRegister.query.endDate = new Date(v.endTime)
}else{
this.patientRegister.query.endDate = new Date()
}
},
//
readIdCard() {
if(!this.$peisAPI) {
@ -167,6 +177,7 @@ export default {
this.customerOrgRegisterList = res.data;
if (res.data.length > 0) {
this.patientRegister.query.customerOrgRegister = res.data[res.data.length - 1];
this.changeCustomerOrgRegister(res.data[res.data.length - 1])
}
this.patientRegister.query.times++
// console.log('this.patientRegister.query.customerOrgRegister',this.patientRegister.query.customerOrgRegister)

216
src/views/charge/charge.vue

@ -126,7 +126,7 @@
<el-row v-if="query.chargeFlag == 'N'">
<el-col :span="12">
<el-form-item label="预收金额" prop="preTotal">
<el-input v-model="form.preTotal" @input="findBalance" />
<el-input v-model="form.preTotal" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -213,11 +213,11 @@
</div>
<div class="btnDivClass">
<div class="btnListClass">
<el-button type="primary" class="btnClass" @click="charge"
<el-button type="primary" class="btnClass" @click="btnCharge"
:disabled="query.chargeFlag == 'N' ? false : true">收费</el-button>
</div>
<div class="btnListClass">
<el-button type="danger" class="btnClass" @click="chargeBack"
<el-button type="danger" class="btnClass" @click="btnChargeBack"
:disabled="query.chargeFlag == 'Y' ? false : true">退费</el-button>
</div>
<div class="btnListClass">
@ -614,13 +614,16 @@ export default {
totalOri = Math.round(totalOri * 100) / 100;
head.total = total;
head.preTotal = total;
//head.preTotal = total;
if (totalOri == 0) {
head.discount = 100;
} else {
head.discount = Math.round(10000 * total / totalOri) / 100;
}
//
this.findBalance()
},
//
@ -639,10 +642,11 @@ export default {
});
totalPlan = Math.round(totalOri * discount) / 100;
this.form.total = totalPlan;
this.form.preTotal = totalPlan;
//this.form.preTotal = totalPlan;
//
this.handleBalance(totalPlan, totalCompute);
this.findBalance()
},
//
@ -668,9 +672,11 @@ export default {
totalCompute += Math.round(100 * e.chargePrice * e.amount) / 100;
}
});
this.form.preTotal = totalPlan;
//this.form.preTotal = totalPlan;
//
this.handleBalance(totalPlan, totalCompute);
this.findBalance()
},
//
@ -688,19 +694,29 @@ export default {
},
//
findBalance() {
this.form.balance = this.form.preTotal - this.form.total;
findBalance() {
this.form.balance = Math.round((this.form.preTotal - this.form.total)*100)/100;
},
//
inputMoney() {
let total = Number(0);
// id = 01
let cashTotal= Number(0), unCashTotal= Number(0);
this.chargePays.forEach(e => {
total += Number(e.chargeMoney);
console.log('e',e)
if(e.payModeId == '01'){
cashTotal += Number(e.chargeMoney);
}else{
unCashTotal += Number(e.chargeMoney);
}
});
if (total > this.form.total) this.$message.warning("输入金额超过总金额");
this.form.preTotal = cashTotal + unCashTotal
this.findBalance()
if (unCashTotal > this.form.total) this.$message.warning(`数据校验失败:输入的非现金金额${unCashTotal}不能超过应收金额${this.form.total}`);
},
//
handleSelectionChange(v) {
this.selectedData = v;
@ -732,9 +748,9 @@ export default {
},
//
charge() {
btnCharge() {
let body = {};
let total = 0;
let unCashTotal = Number(0) , cashTotal = Number(0);
let msg = '';
let chargePays = [];
let asbitems = [];
@ -757,14 +773,17 @@ export default {
}
this.chargePays.forEach(e => {
total += Number(e.chargeMoney);
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 = '请先择会员卡号';
if (!e.cardRegisterId) msg = dddw(this.dict.payMode, "id", e.payModeId, "displayName") + '付费,必需选择会员卡号';
} else {
e.cardRegisterId = null;
}
return e;
}
});
if (msg) {
@ -772,20 +791,34 @@ export default {
return;
}
if (total != this.form.total) {
this.$message.warning("收费方式合计金额与收费总金额不符");
//
if (unCashTotal > this.form.total) {
this.$message.warning("非现金收款不可大于应收金额!");
return;
}
if (unCashTotal + cashTotal < this.form.total) {
this.$message.warning("收费方式合计收款不可小于应收金额!");
return;
}
this.chargePays.forEach(e => {
if (e.chargeMoney) {
chargePays.push({
payModeId: e.payModeId,
chargeMoney: e.chargeMoney,
cardRegisterId: e.cardRegisterId,
});
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,
});
}
}
});
@ -828,16 +861,31 @@ export default {
//console.log('body',body);
postapi('/api/app/registerasbitem/registerasbitemcharge', body).then(res => {
if (res.code != -1) {
this.$message.success("操作成功!");
this.form.id = "操作成功!"; //
this.Query();
this.form.id = res.data.chargeId; //
this.$confirm("操作成功, 是否打印发票?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
}).then(() => {
this.chargePrint('0007', false, res.data.chargeId)
setTimeout(() => {
this.Query();
}, 1000)
}).catch((err) => {
if (err == "cancel") {
//this.$message.info("");
this.Query();
}
});
}
});
},
//退
chargeBack() {
btnChargeBack() {
let chargeId = this.form.id;
let msg = '';
let chargeBackPays = [];
@ -855,61 +903,73 @@ export default {
}
this.chargePays.forEach(e => {
total += Number(e.chargeMoney);
if (e.payModeId == '05' && e.chargeMoney) {
if (!e.cardRegisterId) msg = '请先择会员卡号';
} else {
e.cardRegisterId = null;
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;
}
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,
});
}
});
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) {
this.$message.success("操作成功!");
this.form.chargeFlag = '1'; //退
this.Query();
}
});
// {
// "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) {
this.$message.success("操作成功!");
this.form.chargeFlag = '1'; //退
this.Query();
}).catch((err) => {
if (err == "cancel") {
this.$message.info("已取消删除");
}
});
});
},
//
chargePrint(ReportCode, isPreview, chargeId) {
if (chargeId.length < 1) {
console.log('ReportCode, isPreview, chargeId',ReportCode, isPreview, chargeId)
if (!chargeId) {
this.$message.info("人员信息尚未保存,不可执行此操作!");
return;
}
@ -938,6 +998,12 @@ export default {
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);
});
@ -950,6 +1016,12 @@ export default {
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);
});

Loading…
Cancel
Save