|
|
@ -95,6 +95,7 @@ import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { deepCopy } from "../../utlis/proFunc" |
|
|
import { deepCopy } from "../../utlis/proFunc" |
|
|
import CusOrgOCX from "./CusOrgOCX.vue" |
|
|
import CusOrgOCX from "./CusOrgOCX.vue" |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
|
|
|
import { setDBCom, getDBCom } from "../../utlis/indexedDB"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
@ -110,6 +111,7 @@ export default { |
|
|
|
|
|
|
|
|
customerOrg: [], |
|
|
customerOrg: [], |
|
|
customerOrgAll: [], |
|
|
customerOrgAll: [], |
|
|
|
|
|
|
|
|
query: { |
|
|
query: { |
|
|
dateType: '1', |
|
|
dateType: '1', |
|
|
startDate: '', |
|
|
startDate: '', |
|
|
@ -170,20 +172,44 @@ export default { |
|
|
...mapState(["window", "dict", "patientRegister", "report"]), |
|
|
...mapState(["window", "dict", "patientRegister", "report"]), |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
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) { |
|
|
if (res.code != -1) { |
|
|
this.customerOrgAll = res.data; |
|
|
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) => { |
|
|
getapi("/api/app/medical-type/in-filter").then((res) => { |
|
|
if (res.code > -1) { |
|
|
if (res.code > -1) { |
|
|
@ -195,18 +221,12 @@ export default { |
|
|
// 单位过滤 |
|
|
// 单位过滤 |
|
|
filterMethod(keyWords) { |
|
|
filterMethod(keyWords) { |
|
|
if (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 { |
|
|
} else { |
|
|
this.customerOrg = deepCopy(this.customerOrgAll); |
|
|
|
|
|
|
|
|
this.customerOrg = this.customerOrgAll.slice(0,20); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -221,7 +241,6 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|