diff --git a/src/views/customerOrg/customerOrgGroup.vue b/src/views/customerOrg/customerOrgGroup.vue index c02d482..afa0ef1 100644 --- a/src/views/customerOrg/customerOrgGroup.vue +++ b/src/views/customerOrg/customerOrgGroup.vue @@ -10,9 +10,9 @@
体检单位: - + {{ item.displayName }} @@ -104,13 +104,9 @@
- +
@@ -139,6 +135,7 @@ import { import CustomerOrgGroupAsbitem from "../../components/customerOrg/customerOrgGroupAsbitem.vue"; import CustomerOrgGroupEdit from "./CustomerOrgGroupEdit.vue"; +import { setDBCom, getDBCom } from "../../utlis/indexedDB"; export default { components: { @@ -150,7 +147,7 @@ export default { routeUrlorPageName: "customerOrgGroup", //当前页面归属路由或归属页面权限名称 privs: [], // 页面权限 }, - customerOrgAll:[], // 所有顶级单位 + customerOrgAll: [], // 所有顶级单位 customerOrg: [], //体检单位 customerOrgGroups: [], //体检单位分组 customerOrgId: "", //当前选中的体检单位id @@ -382,17 +379,37 @@ export default { } }, + // 获取顶级单位 + getOrg1() { + getDBCom('orgDatas1') + .then(localData => { + let now = Date.now() + // 24小时 = 86400000 毫秒 + if (localData?.createdat && now - 43200000 < localData.createdat) { + this.customerOrgAll = localData.data + } + // console.log('this.orgDatas.length',this.orgDatas.length) + if (this.customerOrgAll.length > 0) { + this.customerOrg = deepCopy(this.customerOrgAll) + } else { + postapi("/api/app/CustomerOrg/GetParentCustomerOrgSimple",{isPerson:'N'}).then((res) => { + if (res.code != -1) { + this.customerOrgAll = res.data; + // let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId); + // if (lfind > -1) this.customerOrgAll.splice(lfind, 1); + this.customerOrg = deepCopy(this.customerOrgAll); + setDBCom('orgDatas1', this.customerOrgAll) // 一级单位 + } + }); + } + }) + }, + + //获取初始数据 dictInit() { - //获取单位列表 - getapi("/api/app/customer-org/parent-all").then((res) => { - if (res.code != -1) { - this.customerOrgAll = res.data; - let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId); - if (lfind > -1) this.customerOrgAll.splice(lfind, 1); - this.customerOrg = deepCopy(this.customerOrgAll); - } - }); + + this.getOrg1() //获取适用性别 getapi("/api/app/for-sex").then((res) => { diff --git a/src/views/customerReport/unitStatistics.vue b/src/views/customerReport/unitStatistics.vue index 01f194a..dc46a88 100644 --- a/src/views/customerReport/unitStatistics.vue +++ b/src/views/customerReport/unitStatistics.vue @@ -4,12 +4,11 @@
客户报表 / - 单位体检统计 + 单位费用汇总
-
+ ">
体检单位: - + value: 'id', + label: 'displayName', + children: 'treeChildren', + expandTrigger: 'hover', + multiple: true, + emitPath: false, + checkStrictly: true + }" filterable size="small" collapse-tags>
开始日期: - +
结束日期: - +
- 查询 + 查询
- 导出excel + 导出excel
- 打印 + 打印
-
- +
+ - + @@ -139,6 +91,7 @@ import { import { exportToExcel } from "../../utlis/Export2Excel"; import html2canvas from "html2canvas"; import printJs from "print-js"; +import { setDBCom, getDBCom } from "../../utlis/indexedDB"; export default { data() { @@ -147,7 +100,8 @@ export default { startDate: "", endDate: "", customerOrgIds: [], - flag: true + flag: true, + customerOrgTreeAll: [], }; }, @@ -161,22 +115,41 @@ export default { }, computed: { - ...mapState(["window", "dict", "patientRegister", "report"]), + ...mapState(["window", "dict", "report"]), }, methods: { moment, dddw, + + //获取体检单位列表树信息 + getCustomerOrgTree() { + getDBCom('orgDatasQuery') + .then(localData => { + let now = Date.now() + // 24小时 = 86400000 毫秒 + if (localData?.createdat && now - 43200000 < localData.createdat) { + this.customerOrgTreeAll = localData.data; + tcdate(this.customerOrgTreeAll); + } else { + //体检单位树 + getapi("/api/app/customerorg/getbycodeall").then((res) => { + if (res.code == 1) { + this.customerOrgTreeAll = res.data; + tcdate(this.customerOrgTreeAll); + //this.customerOrgTreeAll = reMadeOrgTree(deepCopy(res.data)); + setDBCom('orgDatasQuery', res.data) + } + }); + } + }) + }, + //数据初始化 dictInit() { //体检单位树 - getapi("/api/app/customerorg/getbycodeall").then((res) => { - if (res.code == 1) { - this.patientRegister.customerOrgTreeAll = res.data; - tcdate(this.patientRegister.customerOrgTreeAll); - } - }); - console.log("patientRegister", this.patientRegister); + this.getCustomerOrgTree() + }, onchange(v) { console.log(v) @@ -218,7 +191,7 @@ export default { }, //查询 btnQuery() { - let that = this; + let that = this; if (this.startDate == "") { return this.$message({ message: "请先选择开始日期", @@ -232,11 +205,11 @@ export default { }); } postapi( - "/api/app/CustomerReport/GetSummaryOfUnitCostsReport",{ - customerOrgIds:that.customerOrgIds, - startDate:that.startDate, - endDate:that.endDate - }).then((res) => { + "/api/app/CustomerReport/GetSummaryOfUnitCostsReport", { + customerOrgIds: that.customerOrgIds, + startDate: that.startDate, + endDate: that.endDate + }).then((res) => { if (res.code != -1) { that.dataList = res.data; that.$nextTick(() => { @@ -295,6 +268,7 @@ export default { @import "../../assets/css/global_form.css"; @import "../../assets/css/global_input.css"; @import "../../assets/css/global.css"; + .query { margin-right: 10px; display: flex; @@ -305,10 +279,12 @@ export default { font-size: 400; font-family: "NotoSansSC-Regular"; } + .box { display: flex; flex-direction: column; } + ::v-deep .el-input__inner { /*text-align: center;*/ padding-left: 5px; @@ -328,10 +304,12 @@ export default { ::v-deep .el-icon-search:before { color: #00f; } + .query:last-child { margin-right: 0; } -::v-deep .el-cascader__search-input{ - margin: 0 0 0 5px; + +::v-deep .el-cascader__search-input { + margin: 0 0 0 5px; }