|
|
|
@ -15,12 +15,7 @@ |
|
|
|
margin-bottom: 10px; |
|
|
|
"> |
|
|
|
<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"> |
|
|
|
<el-select v-model="query.dateType" placeholder="请选择" style="width: 80px" size="small"> |
|
|
|
<el-option label="登记日期" :value="'1'" /> |
|
|
|
@ -38,16 +33,24 @@ |
|
|
|
<div class="query"> |
|
|
|
<span class="spanClass">体检单位</span> |
|
|
|
<el-select v-model="query.customerOrgIds" placeholder="请选择体检单位" :filter-method="filterMethod" |
|
|
|
default-first-option clearable filterable style="margin-left: 10px;width: 300px;" size="small" multiple collapse-tags> |
|
|
|
default-first-option clearable filterable style="margin-left: 10px;width: 300px;" size="small" multiple |
|
|
|
collapse-tags> |
|
|
|
<el-option v-for="item in customerOrg" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
{{ item.displayName }} |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
<div class="query"> |
|
|
|
<span class="spanClass">含预登记</span> |
|
|
|
<el-checkbox v-model="query.isPreRegistration" true-label="Y" false-label="N" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="display: flex;flex-wrap: wrap;margin-top: 2px; height: 32px;align-items: center;"> |
|
|
|
<div class="query"> |
|
|
|
<span class="spanClass">体检类别</span> |
|
|
|
<el-select v-model="query.medicalTypeIds" placeholder="请选择体检类别" :filter-method="filterMethodM" |
|
|
|
default-first-option clearable filterable style="margin-left: 10px" size="small" multiple collapse-tags> |
|
|
|
default-first-option clearable filterable style="margin-left: 10px;width: 200px;" size="small" multiple |
|
|
|
collapse-tags> |
|
|
|
<el-option v-for="item in medicalType" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
{{ item.displayName }} |
|
|
|
</el-option> |
|
|
|
@ -56,7 +59,8 @@ |
|
|
|
<div class="query"> |
|
|
|
<span class="spanClass">人员类别</span> |
|
|
|
<el-select v-model="query.personnelTypeIds" placeholder="请选择人员类别" :filter-method="filterMethodP" |
|
|
|
default-first-option clearable filterable style="margin-left: 10px" size="small" multiple collapse-tags> |
|
|
|
default-first-option clearable filterable style="margin-left: 10px;width: 200px;" size="small" multiple |
|
|
|
collapse-tags> |
|
|
|
<el-option v-for="item in personnelType" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
{{ item.displayName }} |
|
|
|
</el-option> |
|
|
|
@ -64,7 +68,10 @@ |
|
|
|
</div> |
|
|
|
<div class="query"> |
|
|
|
<span class="spanClass">业务员</span> |
|
|
|
<el-input v-model="salesmans" placeholder="请输入业务员姓名" size="small" style="width: 150px; margin-left: 10px" /> |
|
|
|
<el-select v-model="query.salesmans" placeholder="请输入业务员姓名" default-first-option clearable filterable |
|
|
|
style="margin-left: 10px" size="small" multiple collapse-tags> |
|
|
|
<el-option v-for="item in dictSalesman" :key="item.id" :label="item.surname" :value="item.surname" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
<div class="query"> |
|
|
|
<span class="spanClass">包含预登记</span> |
|
|
|
@ -82,33 +89,81 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="tableData"> |
|
|
|
<el-table :data="tableData" border :height="window.pageHeight - 195" highlight-current-row size="small" |
|
|
|
row-key="id" :summary-method="getSummaries" show-summary ref="refTable"> |
|
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
|
<el-table-column prop="salesman" 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" /> |
|
|
|
</el-table> |
|
|
|
<u-table :data="tableData" border :height="window.pageHeight - 220" highlight-current-row size="small" |
|
|
|
row-key="id" ref="refTable" id="refTable" :row-height="28" use-virtual @table-body-scroll="scrollQuery" :data-changes-scroll-top="false"> |
|
|
|
<u-table-column type="index" label="序号" width="50" align="center" /> |
|
|
|
<u-table-column prop="medicalStartDate" label="体检日期" min-width="100" align="center" sortable /> |
|
|
|
<u-table-column prop="customerOrgName" label="单位" min-width="180" align="center" sortable /> |
|
|
|
<u-table-column prop="deptName" label="部门" min-width="120" align="center" sortable /> |
|
|
|
<u-table-column prop="patientName" label="姓名" min-width="80" align="center" sortable /> |
|
|
|
<u-table-column prop="sexName" label="性别" min-width="50" align="center" sortable /> |
|
|
|
<u-table-column prop="age" label="年龄" min-width="50" align="center" sortable /> |
|
|
|
<u-table-column prop="birthDate" label="出生日期" min-width="100" align="center" sortable /> |
|
|
|
<u-table-column prop="idNo" label="身份证号" min-width="160" align="center" sortable> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ "\u200C" + scope.row.idNo }} |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
|
<u-table-column prop="patientRegisterNo" label="条码号" min-width="160" align="center" sortable> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ "\u200C" + scope.row.patientRegisterNo }} |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
|
<u-table-column prop="patientNo" label="档案号" min-width="160" align="center" sortable> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ "\u200C" + scope.row.patientNo }} |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
|
<u-table-column prop="medicalTimes" label="次数" min-width="50" align="center" sortable /> |
|
|
|
<u-table-column prop="groupPack" label="分组/套餐" min-width="150" sortable /> |
|
|
|
<u-table-column prop="mobileTelephone" label="手机号" min-width="150" align="center" sortable> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ "\u200C" + scope.row.mobileTelephone }} |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
|
<u-table-column prop="maritalStatusName" label="婚姻" min-width="50" align="center" sortable /> |
|
|
|
<u-table-column prop="medicalTypeName" label="体检类别" min-width="150" align="center" sortable /> |
|
|
|
<u-table-column prop="personnelTypeName" label="人员类别" min-width="150" align="center" sortable /> |
|
|
|
<u-table-column prop="completeFlag" label="状态" min-width="80" align="center" sortable> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ dddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }} |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
|
<u-table-column prop="remark" label="备注" min-width="200" align="center" sortable /> |
|
|
|
<u-table-column prop="salesman" label="业务员" min-width="80" align="center" /> |
|
|
|
<u-table-column prop="standardAmount" label="标准金额" min-width="100" align="center" /> |
|
|
|
<u-table-column prop="receivableAmount" label="应收金额" min-width="100" align="center" /> |
|
|
|
<u-table-column prop="chargePayMode" label="支付方式" min-width="100" align="center" /> |
|
|
|
<u-table-column prop="chargeAmount" label="实收金额" min-width="100" align="center" /> |
|
|
|
</u-table> |
|
|
|
<div style="display: flex; justify-content: space-between"> |
|
|
|
<div> |
|
|
|
<span style="font-size: 12px"> |
|
|
|
合计: 标准金额 {{ loadOpts.standardAmount }} 应收金额 {{ loadOpts.receivableAmount }} |
|
|
|
实收金额 {{ loadOpts.chargeAmount }} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<span style="font-size: 12px"> |
|
|
|
共:{{ loadOpts.totalCount }} 条记录,当前显示:{{ tableData.length }}条。 |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { deepCopy } from "../../utlis/proFunc"; |
|
|
|
import { deepCopy, dddw } from "../../utlis/proFunc"; |
|
|
|
import CusOrgOCX from "./CusOrgOCX.vue"; |
|
|
|
import { UTable, UTableColumn } from "umy-ui"; |
|
|
|
import moment from "moment"; |
|
|
|
import FileSaver from "file-saver"; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
CusOrgOCX, |
|
|
|
CusOrgOCX, UTable, UTableColumn |
|
|
|
}, |
|
|
|
props: ["orgEnable"], |
|
|
|
data() { |
|
|
|
@ -122,6 +177,7 @@ export default { |
|
|
|
customerOrgAll: [], |
|
|
|
medicalType: [], |
|
|
|
personnelType: [], |
|
|
|
dictSalesman: [], |
|
|
|
|
|
|
|
query: { |
|
|
|
dateType: "1", |
|
|
|
@ -135,42 +191,37 @@ export default { |
|
|
|
// isMedicalTypeId: 'Y', |
|
|
|
isPreRegistration: "N", |
|
|
|
}, |
|
|
|
salesmans: "", |
|
|
|
|
|
|
|
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); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
scolling: false, //用于滚动加载数据 |
|
|
|
// lazyLoading: false, //是否懒加载中 |
|
|
|
loadOpts: { |
|
|
|
totalCount: 0, |
|
|
|
standardAmount: 0, |
|
|
|
receivableAmount: 0, |
|
|
|
chargeAmount: 0, |
|
|
|
skipCount: 0, |
|
|
|
maxResultCount: 100, |
|
|
|
}, |
|
|
|
loadOptsInit: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
created() { }, |
|
|
|
created() { |
|
|
|
try { |
|
|
|
let LocalConfig = JSON.parse( |
|
|
|
window.localStorage.getItem("LocalConfig") || null |
|
|
|
); |
|
|
|
if (LocalConfig?.normal?.maxResultCount) { |
|
|
|
this.loadOpts.maxResultCount = LocalConfig.normal.maxResultCount; |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.log('window.localStorage.getItem("LocalConfig")', error); |
|
|
|
} |
|
|
|
|
|
|
|
this.loadOptsInit = Object.assign({}, this.loadOpts); |
|
|
|
}, |
|
|
|
|
|
|
|
//挂载完成 |
|
|
|
mounted() { |
|
|
|
@ -178,15 +229,16 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
updated() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs["refTable"].doLayout(); |
|
|
|
}); |
|
|
|
// this.$nextTick(() => { |
|
|
|
// this.$refs["refTable"].doLayout(); |
|
|
|
// }); |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapState(["window", "dict", "patientRegister", "report"]), |
|
|
|
...mapState(["pickerOptions", "window", "dict", "patientRegister", "report"]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
dddw, |
|
|
|
//获取初始数据 |
|
|
|
dictInit() { |
|
|
|
let today = moment(new Date()).format("YYYY-MM-DD"); |
|
|
|
@ -216,6 +268,14 @@ export default { |
|
|
|
this.personnelType = res.data; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 业务员 { |
|
|
|
postapi('/api/identity/users/GetUserListBySaleRole') |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.dictSalesman = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//通用导出 |
|
|
|
@ -278,66 +338,90 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询 |
|
|
|
|
|
|
|
// 按钮查询 |
|
|
|
btnQuery() { |
|
|
|
this.query.salesmans = []; |
|
|
|
if (this.salesmans.replace(/\s+/g, '') != '') { |
|
|
|
this.query.salesmans.push(this.salesmans.replace(/\s+/g, '')); |
|
|
|
} |
|
|
|
postapi( |
|
|
|
"/api/app/CustomerReport/GetSalesPersonPhysicalExaminationStatistics", |
|
|
|
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); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
this.loadOpts = Object.assign({}, this.loadOptsInit) |
|
|
|
this.queryEvent() |
|
|
|
}, |
|
|
|
|
|
|
|
//合计 |
|
|
|
getSummaries(param) { |
|
|
|
console.log("getSummaries param", param); |
|
|
|
// if(!param){ |
|
|
|
// param = { |
|
|
|
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}], |
|
|
|
// data:this.customerOrgGroupAsbitems |
|
|
|
// 触发滚动 |
|
|
|
scrollQuery(scroll, event) { |
|
|
|
// 是否拉到底部 |
|
|
|
if (!scroll.judgeFlse) return; |
|
|
|
|
|
|
|
if (this.scolling) return |
|
|
|
|
|
|
|
// this.dom = document.getElementById("refTable") |
|
|
|
// this.dom = this.$refs["refTable"].bodyWrapper; |
|
|
|
// console.log('this.dom', this.dom) |
|
|
|
|
|
|
|
// this.dom.addEventListener('scroll', () => { |
|
|
|
// // // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight); |
|
|
|
// if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight) { |
|
|
|
// this.scolling = false |
|
|
|
// }else{ |
|
|
|
// this.scolling = true |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
const { columns, data } = param; |
|
|
|
const sumCol = [2, 3, 4, 7, 8, 9]; //需合计的列 |
|
|
|
const sums = []; |
|
|
|
columns.forEach((column, index) => { |
|
|
|
//console.log('column, index,data',column, index,data) |
|
|
|
//显示合计列 |
|
|
|
if (index === 1) { |
|
|
|
sums[index] = "合计"; |
|
|
|
return; |
|
|
|
} |
|
|
|
// }) |
|
|
|
|
|
|
|
//不合计的列 |
|
|
|
if (sumCol.indexOf(index) == -1) { |
|
|
|
sums[index] = ""; |
|
|
|
return; |
|
|
|
} |
|
|
|
// if (this.scolling) return |
|
|
|
this.loadOpts.skipCount++ |
|
|
|
if ( |
|
|
|
this.loadOpts.skipCount != 0 && |
|
|
|
this.loadOpts.skipCount * this.loadOpts.maxResultCount >= |
|
|
|
this.loadOpts.totalCount |
|
|
|
) { |
|
|
|
// this.$message.warning({ showClose: true, message: '没有可拉取的数据了' }) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
sums[index] = 0; |
|
|
|
data.forEach((e) => { |
|
|
|
if (!isNaN(e[column.property])) |
|
|
|
sums[index] += Number(e[column.property]); // * e['amount'] |
|
|
|
}); |
|
|
|
sums[index] = sums[index].toFixed(2); //+ ' 元'; |
|
|
|
this.scolling = true |
|
|
|
this.queryEvent() |
|
|
|
.finally(() => { |
|
|
|
this.scolling = false |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 查询事件 |
|
|
|
queryEvent() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
let body = Object.assign({}, this.query, this.loadOpts) |
|
|
|
postapi("/api/app/CustomerReport/GetCustomerOrgPhysicalExaminationDetailStatistics", 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() |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
resolve() |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//合计 |
|
|
|
getSummaries() { |
|
|
|
this.loadOpts.standardAmount = 0 |
|
|
|
this.loadOpts.receivableAmount = 0 |
|
|
|
this.loadOpts.chargeAmount = 0 |
|
|
|
this.tableData.forEach(e => { |
|
|
|
this.loadOpts.standardAmount = Number(this.loadOpts.standardAmount) + Number(e.standardAmount) |
|
|
|
this.loadOpts.receivableAmount = Number(this.loadOpts.receivableAmount) + Number(e.receivableAmount) |
|
|
|
this.loadOpts.chargeAmount = Number(this.loadOpts.chargeAmount) + Number(e.chargeAmount) |
|
|
|
}); |
|
|
|
// this.groupPrice = sums[7]; |
|
|
|
// console.log('getSummaries',sums) |
|
|
|
// if (!this.totalFoucs) this.total = sums[5]; |
|
|
|
// if (!this.discountFoucs) this.discount = Number(this.total * 100 / this.totalStand).toFixed(2); |
|
|
|
return sums; |
|
|
|
this.loadOpts.standardAmount = Math.round(this.loadOpts.standardAmount * 100) / 100 |
|
|
|
this.loadOpts.receivableAmount = Math.round(this.loadOpts.receivableAmount * 100) / 100 |
|
|
|
this.loadOpts.chargeAmount = Math.round(this.loadOpts.chargeAmount * 100) / 100 |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|