diff --git a/src/components/report/TurnoverReportOrg.vue b/src/components/report/TurnoverReportOrg.vue
index 617dff5..853d20f 100644
--- a/src/components/report/TurnoverReportOrg.vue
+++ b/src/components/report/TurnoverReportOrg.vue
@@ -93,22 +93,22 @@
{{ queryCondition }}
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -154,27 +154,37 @@ export default {
isPreRegistration: "N",
itemTypeIds: [],
},
-
tableData: [
{
itemTypeName: 'CT',
- djrs: 4, yjrs: 2, bzje: 6, ysje: 8, ssje: 10,
- itemDetails: [
+ asbitemDetails: [
{
- asbitemName: '胸部CT', djrs: 4, yjrs: 2, bzje: 6, ysje: 8, ssje: 10,
+ asbitemName: '胸部CT',
details: [
- { org: 'C座', djrs: 3, yjrs: 2, bzje: 3, ysje: 4, ssje: 6 },
- { org: 'B座', djrs: 1, yjrs: 0, bzje: 3, ysje: 4, ssje: 2 }
+ { medicalCenterName: 'C座', registerCount: 3, checkCount: 2, standardAmount: 3, receivableAmount: 4, receivedAmount: 6 },
+ { medicalCenterName: 'B座', registerCount: 1, checkCount: 0, standardAmount: 3, receivableAmount: 4, receivedAmount: 2 }
]
},
{
- asbitemName: '头部CT', djrs: 2, yjrs: 1, bzje: 3, ysje: 4, ssje: 5,
+ asbitemName: '头部CT',
details: [
- { org: 'C座', djrs: 2, yjrs: 1, bzje: 3, ysje: 4, ssje: 5 },
- { org: 'B座', djrs: 0, yjrs: 0, bzje: 0, ysje: 0, ssje: 0 }
+ { medicalCenterName: 'C座', registerCount: 2, checkCount: 1, standardAmount: 3, receivableAmount: 4, receivedAmount: 5 },
+ { medicalCenterName: 'B座', registerCount: 0, checkCount: 0, standardAmount: 0, receivableAmount: 0, receivedAmount: 0 }
]
}
]
+ },
+ {
+ itemTypeName: '放射',
+ asbitemDetails: [
+ {
+ asbitemName: '胸部正位片',
+ details: [
+ { medicalCenterName: 'C座', registerCount: 13, checkCount: 12, standardAmount: 13, receivableAmount: 14, receivedAmount: 16 },
+ { medicalCenterName: 'B座', registerCount: 11, checkCount: 10, standardAmount: 8, receivableAmount: 9, receivedAmount: 12 }
+ ]
+ }
+ ]
}
], //原始数据
asyncCols: ['C座', 'B座'], // 动态体检中心
@@ -200,6 +210,8 @@ export default {
//挂载完成
mounted() {
this.dictInit();
+ // 解析数据测试用
+ //this.tableDataTran()
},
updated() {
@@ -407,87 +419,118 @@ export default {
}
},
- //
- tableDataTran() {
- this.tableDataTrans = []
- // tableData: [
- // {
- // itemTypeName: 'CT',
- // itemDetails: [
- // {
- // asbitemName: '胸部CT',
- // details: [
- // { org: 'C座', djrs: 3, yjrs: 2, bzje: 3, ysje: 4, ssje: 6 },
- // { org: 'B座', djrs: 1, yjrs: 0, bzje: 3, ysje: 4, ssje: 2 }
- // ]
- // },
- // {
- // asbitemName: '头部CT',
- // details: [
- // { org: 'C座', djrs: 2, yjrs: 1, bzje: 3, ysje: 4, ssje: 5 },
- // { org: 'B座', djrs: 0, yjrs: 0, bzje: 0, ysje: 0, ssje: 0 }
- // ]
- // }
- // ]
- // }
- // ],
+ // 数据转换
+ tableDataTran() {
+ let itemTotals = []
+ this.tableDataTrans = []
let pojo = {};
this.tableData.forEach(e1 => {
pojo = Object.assign({}, { itemTypeName: e1.itemTypeName })
- if (e1.itemDetails.length > 0) {
+ //console.log('pojo1',pojo)
+ if (e1.asbitemDetails.length > 0) {
let asb_pojos = []
- e1.itemDetails.forEach(e2 => {
- asb_pojo = this.tableDataTranForOrg(e2)
- pojo = Object({}, pojo, asb_pojo)
+ e1.asbitemDetails.forEach(e2 => {
+ let asb_pojo = this.tableDataTranForOrg(e2)
+ //console.log('asb_pojo',asb_pojo)
+ pojo = Object.assign({}, pojo, asb_pojo)
+
this.tableDataTrans.push(pojo)
asb_pojos.push(pojo)
});
// 如果有多条记录时,再增加一条科室汇总
- if(e1.itemDetails.length > 1){
- // pojo
+ if (e1.asbitemDetails.length > 1) {
+ let asbTotal = this.conTotals(asb_pojos,'')
+ this.tableDataTrans.push(asbTotal)
+ itemTotals.push(asbTotal)
+ } else {
+ itemTotals.push(pojo)
}
-
}
-
-
});
- },
+ // 总合计
+ if(this.tableData.length > 1){
+ this.tableDataTrans.push(this.conTotals(itemTotals,'总合计'))
+ }
+ // console.log('this.tableDataTrans',this.tableDataTrans)
+ },
// 将多行体检中心数据 ,转成列形式数据
tableDataTranForOrg(asbitem) {
- let initData = { asb_djrs: 0, asb_yjrs: 0, asb_bzje: 0, asb_ysje: 0, asb_ssje: 0 }
+ let initData = { registerCount: 0, checkCount: 0, standardAmount: 0, receivableAmount: 0, receivedAmount: 0 }
let asb_pojo = Object.assign({}, { asbitemName: asbitem.asbitemName }, initData)
let lfind
this.asyncCols.forEach(col => {
- lfind = arrayExistObj(asbitem.details, 'org', col)
+ lfind = arrayExistObj(asbitem.details, 'medicalCenterName', col)
if (lfind > -1) {
- asb_pojo[`${col}_djrs`] = asbitem.details[lfind].djrs
- asb_pojo[`${col}_yjrs`] = asbitem.details[lfind].yjrs
- asb_pojo[`${col}_bzje`] = asbitem.details[lfind].bzje
- asb_pojo[`${col}_ysje`] = asbitem.details[lfind].ysje
- asb_pojo[`${col}_ssje`] = asbitem.details[lfind].ssje
-
- asb_pojo.asb_djrs = Number(asb_pojo.asb_djrs) + asbitem.details[lfind].djrs
- asb_pojo.asb_yjrs = Number(asb_pojo.asb_yjrs) + asbitem.details[lfind].yjrs
- asb_pojo.asb_bzje = Number(asb_pojo.asb_bzje) + asbitem.details[lfind].bzje
- asb_pojo.asb_ysje = Number(asb_pojo.asb_ysje) + asbitem.details[lfind].ysje
- asb_pojo.asb_ssje = Number(asb_pojo.asb_ssje) + asbitem.details[lfind].ssje
+ asb_pojo[`${col}_registerCount`] = asbitem.details[lfind].registerCount
+ asb_pojo[`${col}_checkCount`] = asbitem.details[lfind].checkCount
+ asb_pojo[`${col}_standardAmount`] = asbitem.details[lfind].standardAmount
+ asb_pojo[`${col}_receivableAmount`] = asbitem.details[lfind].receivableAmount
+ asb_pojo[`${col}_receivedAmount`] = asbitem.details[lfind].receivedAmount
+
+ asb_pojo.registerCount = Math.round((Number(asb_pojo.registerCount) + Number(asbitem.details[lfind].registerCount)) * 100) / 100;
+ asb_pojo.checkCount = Math.round((Number(asb_pojo.checkCount) + Number(asbitem.details[lfind].checkCount)) * 100) / 100;
+ asb_pojo.standardAmount = Math.round((Number(asb_pojo.standardAmount) + Number(asbitem.details[lfind].standardAmount)) * 100) / 100;
+ asb_pojo.receivableAmount = Math.round((Number(asb_pojo.receivableAmount) + Number(asbitem.details[lfind].receivableAmount)) * 100) / 100;
+ asb_pojo.receivedAmount = Math.round((Number(asb_pojo.receivedAmount) + Number(asbitem.details[lfind].receivedAmount)) * 100) / 100;
+
+
} else {
- asb_pojo[`${col}_djrs`] = 0
- asb_pojo[`${col}_yjrs`] = 0
- asb_pojo[`${col}_bzje`] = 0
- asb_pojo[`${col}_ysje`] = 0
- asb_pojo[`${col}_ssje`] = 0
+ asb_pojo[`${col}_registerCount`] = 0
+ asb_pojo[`${col}_checkCount`] = 0
+ asb_pojo[`${col}_standardAmount`] = 0
+ asb_pojo[`${col}_receivableAmount`] = 0
+ asb_pojo[`${col}_receivedAmount`] = 0
}
});
return asb_pojo
},
+ // 科室合计或总合计
+ conTotals(sources, itemTypeName) {
+ let retPojo = {}
+ let cols = Object.keys(sources[0])
+
+ sources.forEach((e, i) => {
+ let totalCol = false //是否统计列
+ if (i == 0) {
+ retPojo = Object.assign({}, e)
+ } else {
+ cols.forEach(col => {
+ if (col.includes('registerCount')) {
+ totalCol = true
+ } else if (col.includes('registerCount')) {
+ totalCol = true
+ } else if (col.includes('registerCount')) {
+ totalCol = true
+ } else if (col.includes('registerCount')) {
+ totalCol = true
+ } else if (col.includes('registerCount')) {
+ totalCol = true
+ }
+ // 是合计列时,
+ if(totalCol){
+ retPojo[col] = Math.round((Number(retPojo[col]) + Number(e[col])) * 100) / 100;
+ }
+ });
+ }
+
+ });
+
+ if(itemTypeName == '总合计'){
+ retPojo.itemTypeName = itemTypeName
+ retPojo.asbitemName = ''
+ }else{
+ retPojo.asbitemName = '合计'
+ }
+ return retPojo
+ },
+
// 按钮查询
btnQuery() {
this.tableData = []
@@ -548,19 +591,11 @@ export default {
if (!body.startDate) body.startDate = '1900-01-01'
if (!body.endDate) body.endDate = moment(new Date()).format('yyyy-MM-DD')
}
- postapi("/api/app/CustomerReport/GetCustomerOrgPhysicalExaminationDetailStatistics", body)
+ postapi("/api/app/CustomerReport/GetRegisterItemByMedicalCenterIdStatistics", body)
.then(res => {
- if (res.code > -1) {
- this.loadOpts.totalCount = res.data.totalCount
- let arrs = [].concat(res.data.items);
- arrs.forEach(e => {
- e.groupPack = e.customerOrgGroupName || e.medicalPackageName
- e.deptName = (e.customerOrgName == e.departmentName ? '' : e.departmentName)
- e.birthDate = e?.birthDate.substring(0, 10) || e.birthDate
- e.medicalStartDate = e?.medicalStartDate.substring(0, 10) || e.medicalStartDate
- });
- this.tableData = [].concat(this.tableData, arrs)
- this.getSummaries()
+ if (res.code > -1) {
+ this.tableData = res.data
+ this.tableDataTran()
}
})
.finally(() => {