Commit 71cac618 authored by 任鸿志's avatar 任鸿志

refactor(jiesuan): 优化结算功能

- 修改了多个组件中的结算逻辑,增加了 settle_fee_id 参数
- 优化了自费预结算和普通预结算的处理流程
- 调整了订单和费用的处理方式,提高了代码的可读性和可维护性
parent 05d111f1
...@@ -750,7 +750,7 @@ export default { ...@@ -750,7 +750,7 @@ export default {
jsroundData: {}, jsroundData: {},
ismb: false, ismb: false,
channel: '', channel: '',
settleType:'' settleType: '',
} }
}, },
mounted() { mounted() {
...@@ -760,7 +760,7 @@ export default { ...@@ -760,7 +760,7 @@ export default {
// if (this.$route.query?.jobNumber) { // if (this.$route.query?.jobNumber) {
// localStorage.setItem('jobNumber', this.$route.query.jobNumber) // localStorage.setItem('jobNumber', this.$route.query.jobNumber)
// } // }
this.settleType=this.$route.query?.settleType || '' this.settleType = this.$route.query?.settleType || ''
this.channel = this.$route.query?.channel || '' this.channel = this.$route.query?.channel || ''
this.titleshow = this.$route.query?.layoutShow || '' this.titleshow = this.$route.query?.layoutShow || ''
this.cardNo = this.$route.query?.cardNo || '' this.cardNo = this.$route.query?.cardNo || ''
...@@ -1700,13 +1700,13 @@ export default { ...@@ -1700,13 +1700,13 @@ export default {
settle_type: '', settle_type: '',
} }
this.ismb = false this.ismb = false
console.log(this.orders,'oooooooooooooo') console.log(this.orders, 'oooooooooooooo')
this.orders.forEach(element => { this.orders.forEach(element => {
if (element) { if (element) {
this.ismb = true this.ismb = true
} }
}) })
if (((!this.ismb || this.man_name == true) || this.channel == '4')) { if (!this.ismb || this.man_name == true || this.channel == '4') {
if (this.orders.length > 0) { if (this.orders.length > 0) {
this.ybjs() this.ybjs()
} else { } else {
...@@ -1758,7 +1758,7 @@ export default { ...@@ -1758,7 +1758,7 @@ export default {
}, },
ybjs() { ybjs() {
if (this.checktipes() && this.man_name == false) { if (this.checktipes() && this.man_name == false) {
if (this.settleType=='mjzys') { if (this.settleType == 'mjzys') {
this.$message({ this.$message({
message: '器械临床试验门诊、药物临床试验门诊禁止医保结算', message: '器械临床试验门诊、药物临床试验门诊禁止医保结算',
type: 'error', type: 'error',
...@@ -2114,10 +2114,16 @@ export default { ...@@ -2114,10 +2114,16 @@ export default {
var orders = [] var orders = []
var costint = [] var costint = []
var cost_ids = [] var cost_ids = []
var order_no = []
var serial_arr = []
x.slice(0, x.length - 1).forEach(function (element) { x.slice(0, x.length - 1).forEach(function (element) {
total += element.total * 1 * 1 total += element.total * 1 * 1
orders.push(element.settle_type.is_mb) orders.push(element.settle_type.is_mb)
cost_ids.push(element.serial_no) cost_ids.push(element.serial_no)
order_no.push(element.order_no)
obj['serial_no']=element.serial_no
obj['order_no']=element.order_no
serial_arr.push(obj)
costint.push(element) costint.push(element)
}) })
...@@ -2127,6 +2133,7 @@ export default { ...@@ -2127,6 +2133,7 @@ export default {
if (array.length != 0) { if (array.length != 0) {
info({ info({
order_no:serial_arr,
serial_no: cost_ids.toString(), serial_no: cost_ids.toString(),
patient_id: this.patientData.patient_id, patient_id: this.patientData.patient_id,
settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '', settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '',
...@@ -2154,11 +2161,16 @@ export default { ...@@ -2154,11 +2161,16 @@ export default {
var orders = [] var orders = []
var costint = [] var costint = []
var cost_ids = [] var cost_ids = []
var order_no = []
var serial_arr = [];
array.forEach(function (element) { array.forEach(function (element) {
total += element.total * 1 * 1 total += element.total * 1 * 1
orders.push(element.settle_type.is_mb) orders.push(element.settle_type.is_mb)
cost_ids.push(element.serial_no) cost_ids.push(element.serial_no)
costint.push(element) costint.push(element)
obj['serial_no']=element.serial_no
obj['order_no']=element.order_no
serial_arr.push(obj)
}) })
this.cost_id = cost_ids this.cost_id = cost_ids
...@@ -2167,6 +2179,7 @@ export default { ...@@ -2167,6 +2179,7 @@ export default {
if (array.length != 0) { if (array.length != 0) {
info({ info({
order_no:serial_arr,
serial_no: cost_ids.toString(), serial_no: cost_ids.toString(),
patient_id: this.patientData.patient_id, patient_id: this.patientData.patient_id,
settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '', settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '',
...@@ -2270,7 +2283,7 @@ export default { ...@@ -2270,7 +2283,7 @@ export default {
//获取自付比例 //获取自付比例
getProp(row) { getProp(row) {
get_zfbl({ get_zfbl({
patient_id:this.patientData.patient_id, patient_id: this.patientData.patient_id,
item_code: row.item_code, item_code: row.item_code,
//yltclb:row.settle_type.is_mb==true?'4':'6', //yltclb:row.settle_type.is_mb==true?'4':'6',
rqlb: this.is_sy ? 'E' : this.patientData.crowd_type, rqlb: this.is_sy ? 'E' : this.patientData.crowd_type,
...@@ -2288,7 +2301,7 @@ export default { ...@@ -2288,7 +2301,7 @@ export default {
if (row.item_code == element.item_code) { if (row.item_code == element.item_code) {
// element.zfbl=response.data.dw_data[0].zfbl // element.zfbl=response.data.dw_data[0].zfbl
// element.zfbl_desc.push(response.data.zfbl_desc) // element.zfbl_desc.push(response.data.zfbl_desc)
element.zfbl_desc=response.data.zfbl_desc element.zfbl_desc = response.data.zfbl_desc
// response.data.zfbl_desc.forEach(elements => { // response.data.zfbl_desc.forEach(elements => {
// element.zfbl_desc = response.data.zfbl_desc //[elements.key]=elements.value // element.zfbl_desc = response.data.zfbl_desc //[elements.key]=elements.value
// }) // })
...@@ -2417,7 +2430,12 @@ export default { ...@@ -2417,7 +2430,12 @@ export default {
this.form = {} this.form = {}
this.form = data this.form = data
this.form.rqlbName = data.rqlb == 'A' ? '职工' : data.rqlb == 'B' ? '居民' : '' this.form.rqlbName = data.rqlb == 'A' ? '职工' : data.rqlb == 'B' ? '居民' : ''
let costIDarr = []
this.costlist.forEach(element => {
costIDarr.push(element.settle_fee_id)
})
settlementPre({ settlementPre({
settle_fee_id: costIDarr.toString(),
sy: this.is_sy, sy: this.is_sy,
is_gz: this.gz_name, is_gz: this.gz_name,
injury_date: this.GSdatatime, injury_date: this.GSdatatime,
...@@ -2438,8 +2456,8 @@ export default { ...@@ -2438,8 +2456,8 @@ export default {
this.moreLoading = false this.moreLoading = false
this.bxxxinfo = res.data this.bxxxinfo = res.data
this.bxxxinfo.settle_type.name = //this.bxxxinfo.settle_type.name this.bxxxinfo.settle_type.name = //this.bxxxinfo.settle_type.name
this.man_name ?'自费':this.gz_name?"纯个账": this.bxxxinfo.settle_type.name this.man_name ? '自费' : this.gz_name ? '纯个账' : this.bxxxinfo.settle_type.name
console.log(this.bxxxinfo,'+++++++++++++++++++') console.log(this.bxxxinfo, '+++++++++++++++++++')
familybalanceinfor({ familybalanceinfor({
patient_id: this.patientData.patient_id, patient_id: this.patientData.patient_id,
pre_key: res.data.pre_key, pre_key: res.data.pre_key,
...@@ -2528,20 +2546,29 @@ export default { ...@@ -2528,20 +2546,29 @@ export default {
// 自费预结算 // 自费预结算
zfBeforePre() { zfBeforePre() {
this.yujiesuanLoading = true this.yujiesuanLoading = true
this.xj_amount = 0
this.source_pay_amount = 0
this.form = {} this.form = {}
console.log(this.bxxxinfo,'33333333333') let costIDarr=[]
settleSelfPre({ patient_id: this.patientData.patient_id, prescription_nos: this.cost_id, settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '' }) this.costlist.forEach(element => {
costIDarr.push(element.settle_fee_id)
})
settleSelfPre({
settle_fee_id:costIDarr.toString(),
patient_id: this.patientData.patient_id,
prescription_nos: this.cost_id,
settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : ''
})
.then(res => { .then(res => {
this.yujiesuanLoading = false this.yujiesuanLoading = false
this.dialogVisible = true this.dialogVisible = true
this.bxxxinfo = res.data this.bxxxinfo = res.data
this.bxxxinfo.gjzhzf = 0 this.bxxxinfo.gjzhzf = 0
this.bxxxinfo.his_deduct_amount = 0 this.bxxxinfo.his_deduct_amount = 0
this.bxxxinfo.grzhzf = 0 this.bxxxinfo.grzhzf = 0
this.bxxxinfo.settle_type={name:''} this.bxxxinfo.settle_type = { name: '' }
this.bxxxinfo.settle_type.name = //this.bxxxinfo.settle_type.name this.bxxxinfo.settle_type.name = //this.bxxxinfo.settle_type.name
this.man_name ?'自费':this.gz_name?"纯个账": this.selectTableArr[0].settle_type.name this.man_name ? '自费' : this.gz_name ? '纯个账' : this.selectTableArr[0].settle_type.name
let djf = this.round(this.round(this.round(this.bxxxinfo.patient_burden - this.bxxxinfo.gjzhzf, 2) - this.bxxxinfo.his_deduct_amount, 2) - this.bxxxinfo.grzhzf, 2) let djf = this.round(this.round(this.round(this.bxxxinfo.patient_burden - this.bxxxinfo.gjzhzf, 2) - this.bxxxinfo.his_deduct_amount, 2) - this.bxxxinfo.grzhzf, 2)
if (this.bxxxinfo.cash_balance >= djf) { if (this.bxxxinfo.cash_balance >= djf) {
......
...@@ -1730,7 +1730,7 @@ export default { ...@@ -1730,7 +1730,7 @@ export default {
var costint = [] var costint = []
var cost_ids = [] var cost_ids = []
var order_no = [] var order_no = []
var serial_arr = []; var serial_arr = []
x.slice(0, x.length - 1).forEach(function (element) { x.slice(0, x.length - 1).forEach(function (element) {
let obj={} let obj={}
total += element.total * 1 * 1 total += element.total * 1 * 1
...@@ -2046,7 +2046,12 @@ export default { ...@@ -2046,7 +2046,12 @@ export default {
if (this.man_name == '5') { if (this.man_name == '5') {
this.isGS=true this.isGS=true
} }
let costIDarr=[]
this.costlist.forEach(element => {
costIDarr.push(element.settle_fee_id)
})
await settlementPre({ await settlementPre({
settle_fee_id:costIDarr.toString(),
sy: this.is_sy, sy: this.is_sy,
is_gs: this.isGS, is_gs: this.isGS,
channel: this.channel, channel: this.channel,
...@@ -2168,7 +2173,12 @@ export default { ...@@ -2168,7 +2173,12 @@ export default {
this.xj_amount = 0 this.xj_amount = 0
this.source_pay_amount = 0 this.source_pay_amount = 0
this.form = {} this.form = {}
let costIDarr=[]
this.costlist.forEach(element => {
costIDarr.push(element.settle_fee_id)
})
await settleSelfPre({ await settleSelfPre({
settle_fee_id:costIDarr.toString(),
patient_id: this.patientData.patient_id, patient_id: this.patientData.patient_id,
prescription_nos: this.cost_id, prescription_nos: this.cost_id,
settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '', settle_type: this.selectTableArr[0] ? this.selectTableArr[0].settle_type.code : '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment