diff --git a/src/components/report/NationHealthReport.vue b/src/components/report/NationHealthReport.vue index 8feb66d..170c10f 100644 --- a/src/components/report/NationHealthReport.vue +++ b/src/components/report/NationHealthReport.vue @@ -95,6 +95,7 @@ import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { deepCopy } from "../../utlis/proFunc" import CusOrgOCX from "./CusOrgOCX.vue" import moment from "moment"; +import { setDBCom, getDBCom } from "../../utlis/indexedDB"; export default { components: { @@ -110,6 +111,7 @@ export default { customerOrg: [], customerOrgAll: [], + query: { dateType: '1', startDate: '', @@ -170,20 +172,44 @@ export default { ...mapState(["window", "dict", "patientRegister", "report"]), }, methods: { - //获取初始数据 - dictInit() { - let today = moment(new Date()).format("YYYY-MM-DD") - this.query.startDate = today - this.query.endDate = today + // 获取顶级单位 + getOrg1() { + getDBCom('orgDatas1') + .then(localData => { + let now = Date.now() + // 24小时 = 86400000 毫秒 + if (localData?.createdat && localData.data.length > 0 && now - 43200000 < localData.createdat) { + this.customerOrgAll = localData.data + this.customerOrg = this.customerOrgAll.slice(0,20) + } else { + this.getOrg1Api() + } + }) + .catch(err => { + console.error(err) + this.getOrg1Api() + }) + }, - //获取单位列表 - getapi("/api/app/customer-org/parent-all").then((res) => { + getOrg1Api() { + postapi("/api/app/CustomerOrg/GetParentCustomerOrgSimple", { isPerson: 'N' }).then((res) => { if (res.code != -1) { this.customerOrgAll = res.data; - this.customerOrg = deepCopy(this.customerOrgAll); + // let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId); + // if (lfind > -1) this.customerOrgAll.splice(lfind, 1); + this.customerOrg = this.customerOrgAll.slice(0, 20) + setDBCom('orgDatas1', this.customerOrgAll) // 一级单位 } }); + }, + //获取初始数据 + dictInit() { + let today = moment(new Date()).format("YYYY-MM-DD") + this.query.startDate = today + this.query.endDate = today + + this.getOrg1() //体检类别 getapi("/api/app/medical-type/in-filter").then((res) => { if (res.code > -1) { @@ -195,18 +221,12 @@ export default { // 单位过滤 filterMethod(keyWords) { if (keyWords) { - this.customerOrg = []; - this.customerOrgAll.forEach((item) => { - if ( - item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 || - item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 - // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 - ) { - this.customerOrg.push(item); - } - }); + let org = this.customerOrgAll.filter(e => { + return e.displayName.indexOf(keyWords) > -1 || e.displayName.indexOf(keyWords.toUpperCase()) > -1 + }) + this.customerOrg = org.slice(0,20); } else { - this.customerOrg = deepCopy(this.customerOrgAll); + this.customerOrg = this.customerOrgAll.slice(0,20); } }, @@ -221,7 +241,6 @@ export default { }) }, - }, }; diff --git a/src/views/customerOrg/customerOrgGroup.vue b/src/views/customerOrg/customerOrgGroup.vue index 32e1262..cdaded6 100644 --- a/src/views/customerOrg/customerOrgGroup.vue +++ b/src/views/customerOrg/customerOrgGroup.vue @@ -452,22 +452,12 @@ export default { filterMethod(keyWords) { if (keyWords) { let org = this.customerOrgAll.filter(e => { - + return e.displayName.indexOf(keyWords) > -1 || e.displayName.indexOf(keyWords.toUpperCase()) > -1 }) - this.customerOrg = []; - this.customerOrgAll.forEach((item) => { - if ( - item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 || - item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 - // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 - ) { - this.customerOrg.push(item); - } - }); + this.customerOrg = org.slice(0,20); } else { this.customerOrg = this.customerOrgAll.slice(0,20); } - }, //选择单位 diff --git a/src/views/customerOrg/patientRegisterSign.vue b/src/views/customerOrg/patientRegisterSign.vue index 5284538..dbe494a 100644 --- a/src/views/customerOrg/patientRegisterSign.vue +++ b/src/views/customerOrg/patientRegisterSign.vue @@ -82,21 +82,19 @@ export default { }); //性别(查询) - getapi("/api/app/for-sex").then((res) => { - if (res.code == 1) { - this.dict.forSex = res.data; + // getapi("/api/app/for-sex").then((res) => { + // if (res.code == 1) { + // this.dict.forSex = res.data; + // } + // }); + + //体检类别 + getapi("/api/app/medical-type/in-filter").then((res) => { + if (res.code > -1) { + this.dict.medicalType = res.data; } }); - - - //体检类别 - getapi("/api/app/medical-type/in-filter").then((res) => { - if (res.code == 1) { - this.dict.medicalType = res.data.items; - } - }); - //人员类别 getapi("/api/app/personnel-type/in-filter").then((res) => { if (res.code == 1) { @@ -105,18 +103,18 @@ export default { }); //婚姻状况 - getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => { - if (res.code == 1) { - this.dict.maritalStatus = res.data; - } - }); - - - postapi("/api/app/asbitem/GetBasicList", { isFilterActive: 'Y' }).then((res) => { - if (res.code == 1) { - this.dict.asbItemAll = res.data; - } - }); + // getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => { + // if (res.code == 1) { + // this.dict.maritalStatus = res.data; + // } + // }); + + + // postapi("/api/app/asbitem/GetBasicList", { isFilterActive: 'Y' }).then((res) => { + // if (res.code == 1) { + // this.dict.asbItemAll = res.data; + // } + // }); console.log("dict", this.dict); }, diff --git a/src/views/report/report.vue b/src/views/report/report.vue index 3001548..0e2851f 100644 --- a/src/views/report/report.vue +++ b/src/views/report/report.vue @@ -84,22 +84,14 @@ export default { }); //体检中心 - getapi("/api/app/organization-units/organization-unit-by-is-peis").then( - (res) => { - if (res.code != -1) { - this.dict.organization = res.data; - } - } - ); - - //体检单位树 - // getapi("/api/app/customerorg/getbycodeall").then((res) => { - // if (res.code != -1) { - // this.patientRegister.customerOrgTreeAll = res.data; - // tcdate(this.patientRegister.customerOrgTreeAll); + // getapi("/api/app/organization-units/organization-unit-by-is-peis").then( + // (res) => { + // if (res.code != -1) { + // this.dict.organization = res.data; + // } // } - // }); - + // ); + //体检类别 getapi("/api/app/medical-type/in-filter").then((res) => { if (res.code != -1) { @@ -114,68 +106,7 @@ export default { } }); - //婚姻状况 - getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => { - if (res.code != -1) { - this.dict.maritalStatus = res.data; - } - }); - - //性激素期 - getapi("/api/app/sex-hormone-term/in-filter").then((res) => { - if (res.code != -1) { - this.dict.sexHormoneTerm = res.data; - } - }); - - //民族 - getapi("/api/app/nation/in-filter").then((res) => { - if (res.code != -1) { - this.dict.nation = res.data; - } - }); - - //籍惯 ,出生地 - getapi("/api/app/birth-place/in-filter").then((res) => { - if (res.code != -1) { - this.dict.birthPlace = res.data; - } - }); - - //套餐 - postapi("/api/app/medicalpackage/GetBasicList", {}).then((res) => { - if (res.code != -1) { - this.dict.medicalPackage = res.data; - } - }); - - //分组,所有分组,不限单位,不限次数 - // getapi("/api/app/customer-org-group").then((res) => { - // if (res.code != -1) { - // this.dict.customerOrgGroupAll = res.data.items; - // } - // }); - - //支付方式 - getapi("/api/app/pay-mode").then((res) => { - if (res.code != -1) { - this.dict.payMode = res.data; - } - }); - - //体检类别 树结构 - getapi("/api/app/item-type/by-code-all").then((res) => { - if (res.code != -1) { - this.dict.itemTypeTree = res.data; - tcdate(this.dict.itemTypeTree); - } - }); - - postapi("/api/app/asbitem/GetBasicList", {}).then((res) => { - if (res.code != -1) { - this.dict.asbItemAll = res.data; - } - }); + }, },