|
|
@ -11,7 +11,7 @@ |
|
|
<div style="display:block;"> |
|
|
<div style="display:block;"> |
|
|
<div style="display: flex;flex-wrap: wrap;height: 32px;align-items: center;"> |
|
|
<div style="display: flex;flex-wrap: wrap;height: 32px;align-items: center;"> |
|
|
<div class="query"> |
|
|
<div class="query"> |
|
|
<el-select v-model="query.dateType" placeholder="请选择" style="width: 80px" size="small"> |
|
|
|
|
|
|
|
|
<el-select v-model="query.dateType" placeholder="请选择" style="width: 80px" size="small" disabled> |
|
|
<el-option label="登记日期" :value="'1'" /> |
|
|
<el-option label="登记日期" :value="'1'" /> |
|
|
<el-option label="体检日期" :value="'2'" /> |
|
|
<el-option label="体检日期" :value="'2'" /> |
|
|
<el-option label="总检日期" :value="'3'" /> |
|
|
<el-option label="总检日期" :value="'3'" /> |
|
|
@ -81,7 +81,7 @@ |
|
|
<div> |
|
|
<div> |
|
|
<el-button type="primary" class="commonbutton" @click="btnQuery" size="small">查询</el-button> |
|
|
<el-button type="primary" class="commonbutton" @click="btnQuery" size="small">查询</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-top: 5px;"> |
|
|
|
|
|
|
|
|
<div style="margin-top: 5px;"> |
|
|
<el-button class="commonbutton" @click="btnExport('tableData')" size="small">导出</el-button> |
|
|
<el-button class="commonbutton" @click="btnExport('tableData')" size="small">导出</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -90,23 +90,27 @@ |
|
|
<el-table :data="tableData" border :height="window.pageHeight - 192" highlight-current-row size="small" |
|
|
<el-table :data="tableData" border :height="window.pageHeight - 192" highlight-current-row size="small" |
|
|
row-key="id" :summary-method="getSummaries" show-summary ref="refTable"> |
|
|
row-key="id" :summary-method="getSummaries" show-summary ref="refTable"> |
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
<el-table-column prop="customerOrgName" label="单位名称" min-width="240"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div>{{ query.isChild == 'Y' ? scope.row.customerOrgName + (scope.row.departmentName && |
|
|
|
|
|
scope.row.customerOrgName != scope.row.departmentName ? |
|
|
|
|
|
'--' + scope.row.departmentName : '') : scope.row.customerOrgName }}</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
<el-table-column prop="customerOrgName" label="单位名称" min-width="240" /> |
|
|
<el-table-column v-if="query.isCustomerOrgRegister == 'Y' ? true : false" prop="medicalTimes" label="单位次数" |
|
|
<el-table-column v-if="query.isCustomerOrgRegister == 'Y' ? true : false" prop="medicalTimes" label="单位次数" |
|
|
min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column prop="registerCount" label="登记人数" min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column prop="startMedical" label="检查人数" min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column prop="checkCount" label="总检人数" min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column prop="avgStandardPrice" label="标准平均单价" min-width="100" align="center" /> |
|
|
|
|
|
<el-table-column prop="avgChargePrice" label="应收平均单价" min-width="100" align="center" /> |
|
|
|
|
|
<el-table-column prop="sumStandardPrice" label="标准金额" min-width="100" align="center" /> |
|
|
|
|
|
<el-table-column prop="sumChargePrice" label="应收金额" min-width="100" align="center" /> |
|
|
|
|
|
<el-table-column prop="sumReceivedPrice" label="实收金额" min-width="100" align="center" /> |
|
|
|
|
|
|
|
|
min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column label="收款" align="center" > |
|
|
|
|
|
<el-table-column prop="chargeCount" label="人数" min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column prop="chargeTotal" label="金额" min-width="80" align="center" /> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="退款" min-width="80" align="center" > |
|
|
|
|
|
<el-table-column prop="refundCount" label="人数" min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column prop="refundTotal" label="金额" min-width="80" align="center" /> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="营收金额" min-width="80" align="center" > |
|
|
|
|
|
<el-table-column prop="turnoverTotal" label="汇总" min-width="80" align="center" /> |
|
|
|
|
|
<el-table-column v-for="(col,index) in asyncCols" :key="index" :prop="col" :label="col" min-width="80" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tooltip class="item" :content="`收款:${scope.row[col+'_p']} 退款:${scope.row[col+'_b']}`" placement="top"> |
|
|
|
|
|
<div v-if="scope.row[col] !=0 ? true:false">{{ scope.row[col] }}</div> |
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -138,7 +142,7 @@ export default { |
|
|
dictSalesman: [], |
|
|
dictSalesman: [], |
|
|
|
|
|
|
|
|
query: { |
|
|
query: { |
|
|
dateType: '1', |
|
|
|
|
|
|
|
|
dateType: '6', |
|
|
startDate: '', |
|
|
startDate: '', |
|
|
endDate: '', |
|
|
endDate: '', |
|
|
customerOrgIds: [], |
|
|
customerOrgIds: [], |
|
|
@ -151,33 +155,7 @@ export default { |
|
|
isCustomerOrgRegister: 'N', // 是否显示单位体检次数 |
|
|
isCustomerOrgRegister: 'N', // 是否显示单位体检次数 |
|
|
}, |
|
|
}, |
|
|
tableData: [], |
|
|
tableData: [], |
|
|
|
|
|
|
|
|
pickerOptions: { |
|
|
|
|
|
disabledDate(time) { |
|
|
|
|
|
return time.getTime() > Date.now(); |
|
|
|
|
|
}, |
|
|
|
|
|
shortcuts: [{ |
|
|
|
|
|
text: '今天', |
|
|
|
|
|
onClick(picker) { |
|
|
|
|
|
picker.$emit('pick', new Date()); |
|
|
|
|
|
} |
|
|
|
|
|
}, { |
|
|
|
|
|
text: '昨天', |
|
|
|
|
|
onClick(picker) { |
|
|
|
|
|
const date = new Date(); |
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24); |
|
|
|
|
|
picker.$emit('pick', date); |
|
|
|
|
|
} |
|
|
|
|
|
}, { |
|
|
|
|
|
text: '一周前', |
|
|
|
|
|
onClick(picker) { |
|
|
|
|
|
const date = new Date(); |
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); |
|
|
|
|
|
picker.$emit('pick', date); |
|
|
|
|
|
} |
|
|
|
|
|
}] |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
asyncCols: [], // 动态列 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -199,7 +177,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computed: { |
|
|
computed: { |
|
|
...mapState(["window", "dict", "patientRegister", "report"]), |
|
|
|
|
|
|
|
|
...mapState(["pickerOptions","window", "dict", "patientRegister", "report"]), |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//获取初始数据 |
|
|
//获取初始数据 |
|
|
@ -273,20 +251,55 @@ export default { |
|
|
btnQuery() { |
|
|
btnQuery() { |
|
|
//let body = deepCopy(this.query) |
|
|
//let body = deepCopy(this.query) |
|
|
postapi("/api/app/CustomerReport/GetCustomerOrgAmountReceivedStatistics", this.query).then(res => { |
|
|
postapi("/api/app/CustomerReport/GetCustomerOrgAmountReceivedStatistics", this.query).then(res => { |
|
|
if (res.code > -1) { |
|
|
|
|
|
this.tableData = res.data |
|
|
|
|
|
if (Array.isArray(this.tableData) && this.tableData.length > 0) { |
|
|
|
|
|
this.tableData.forEach(e => { |
|
|
|
|
|
e.startMedical = Number(e.partCheckCount) + Number(e.checkCount) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if (res.code > -1) { |
|
|
|
|
|
if (Array.isArray(res.data) && res.data.length > 0) { |
|
|
|
|
|
// 动态生成新的显示数据 |
|
|
|
|
|
this.makeDispData(res.data) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 动态生成新的显示数据 |
|
|
|
|
|
makeDispData(orgData) { |
|
|
|
|
|
this.tableData = [] |
|
|
|
|
|
this.asyncCols = [] |
|
|
|
|
|
orgData.forEach(e => { |
|
|
|
|
|
if (this.query.isChild == 'Y') { |
|
|
|
|
|
e.customerOrgName = (e.customerOrgName == e.departmentName ? e.customerOrgName : e.customerOrgName + '--' + e.departmentName) |
|
|
|
|
|
} |
|
|
|
|
|
e.chargeTotal = 0 |
|
|
|
|
|
e.refundTotal = 0 |
|
|
|
|
|
e.feeDetail.forEach(c => { |
|
|
|
|
|
e.chargeTotal = Number(e.chargeTotal) + Number(c.chargeMoney) |
|
|
|
|
|
e.refundTotal = Number(e.refundTotal) + Number(c.refundMoney) |
|
|
|
|
|
if(!this.asyncCols.includes(c.payModeName)){ |
|
|
|
|
|
this.asyncCols.push(c.payModeName) |
|
|
|
|
|
} |
|
|
|
|
|
e[c.payModeName] = Math.round((Number(c.chargeMoney) + Number(c.refundMoney)) * 100) / 100 |
|
|
|
|
|
e[c.payModeName + '_p'] = c.chargeMoney // 收 |
|
|
|
|
|
e[c.payModeName + '_b'] = c.refundMoney // 退 |
|
|
|
|
|
}); |
|
|
|
|
|
e.chargeTotal = Math.round(e.chargeTotal * 100) / 100 |
|
|
|
|
|
e.refundTotal = Math.round(e.refundTotal * 100) / 100 |
|
|
|
|
|
e.turnoverTotal = Math.round((Number(e.chargeTotal) + Number(e.refundTotal)) * 100) / 100 |
|
|
|
|
|
this.tableData.push(e) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.tableData.forEach(e => { |
|
|
|
|
|
this.asyncCols.forEach(col => { |
|
|
|
|
|
if(!e[col]){ |
|
|
|
|
|
e[col] = 0 |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
// console.log('this.tableData',this.tableData) |
|
|
|
|
|
// console.log('this.asyncCols',this.asyncCols) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//合计 |
|
|
//合计 |
|
|
getSummaries(param) { |
|
|
getSummaries(param) { |
|
|
console.log('getSummaries param', param) |
|
|
|
|
|
|
|
|
// console.log('getSummaries param', param) |
|
|
// if(!param){ |
|
|
// if(!param){ |
|
|
// param = { |
|
|
// param = { |
|
|
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}], |
|
|
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}], |
|
|
@ -295,10 +308,22 @@ export default { |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
const { columns, data } = param; |
|
|
const { columns, data } = param; |
|
|
const sumCol = [2, 3, 4, 7, 8, 9] //需合计的列 |
|
|
|
|
|
|
|
|
let count = 7,sumCol = [] //需合计的列 |
|
|
const sums = []; |
|
|
const sums = []; |
|
|
|
|
|
|
|
|
|
|
|
if (this.query.isCustomerOrgRegister == 'Y'){ |
|
|
|
|
|
sumCol = [2,3,4,5,6,7] |
|
|
|
|
|
count = 8 |
|
|
|
|
|
}else{ |
|
|
|
|
|
sumCol = [2,3,4,5,6] |
|
|
|
|
|
} |
|
|
|
|
|
this.asyncCols.forEach(() => { |
|
|
|
|
|
sumCol.push(count++) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
console.log('sumCol',sumCol) |
|
|
columns.forEach((column, index) => { |
|
|
columns.forEach((column, index) => { |
|
|
//console.log('column, index,data',column, index,data) |
|
|
|
|
|
|
|
|
console.log('column.property, index,data',column.property, index,data) |
|
|
//显示合计列 |
|
|
//显示合计列 |
|
|
if (index === 1) { |
|
|
if (index === 1) { |
|
|
sums[index] = '合计'; |
|
|
sums[index] = '合计'; |
|
|
|