pengjun 2 weeks ago
parent
commit
d41b809e74
  1. 44
      src/components/customerOrg/customerOrgTree.vue
  2. 24
      src/components/patientRegister/PatientRegisterRecoverList.vue
  3. 102
      src/components/patientRegister/customerOrgTreeAll.vue
  4. 2
      src/components/patientRegister/patientRegisterQuery.vue
  5. 632
      src/components/patientRegister/patientRegisterRecoverListQuery.vue
  6. 2
      src/store/index.js
  7. 219
      src/utlis/indexedDB.js
  8. 45
      src/utlis/proFunc.js
  9. 11
      src/views/workload/examinedoctor.vue

44
src/components/customerOrg/customerOrgTree.vue

@ -63,31 +63,23 @@ export default {
methods: {
...mapMutations(["setData"]),
//
// /
getCustomerOrgTree() {
//let customerOrgTree = []
// [
// {
// displayName: "", //
// id: "00000000-0000-0000-0000-000000000000", //
// //treeChildren: [],
// },
// {
// displayName: "", //
// id: "10000000-0000-0000-0000-000000000000", //
// //treeChildren: [],
// },
// ];
//console.log('getCustomerOrgTree start')
// api/app/organization-units/organization-unit-by-is-peis // api/app/customer-org/by-code-all
getapi("/api/app/customerorg/getbycodeall?IsHidePerson=1").then((res) => {
//customerOrgTree = res.data;
if (res.code != -1) {
this.customerOrg.customerOrgTreeBak = reMadeOrgTree(deepCopy(res.data))
this.customerOrg.customerOrgTree = deepCopy(this.customerOrg.customerOrgTreeBak)
// tcdate(this.customerOrg.customerOrgTree);
}
});
if (this.dataTransOpts.orgDataSet.length > 0) {
this.customerOrg.customerOrgTreeBak = reMadeOrgTree(deepCopy(this.dataTransOpts.orgDataSet))
this.customerOrg.customerOrgTree = deepCopy(this.customerOrg.customerOrgTreeBak)
} else {
getapi("/api/app/customerorg/getbycodeall?IsHidePerson=1").then((res) => {
//customerOrgTree = res.data;
if (res.code > -1) {
this.dataTransOpts.orgDataSet = res.data
this.customerOrg.customerOrgTreeBak = reMadeOrgTree(deepCopy(this.dataTransOpts.orgDataSet))
this.customerOrg.customerOrgTree = deepCopy(this.customerOrg.customerOrgTreeBak)
// tcdate(this.customerOrg.customerOrgTree);
}
});
}
},
//
@ -112,10 +104,10 @@ export default {
let body = { itemList: [] }
if (draggingNode.data.parentId) {
let parentNode = getTreeNode(this.customerOrg.customerOrgTree, 'treeChildren', 'id', draggingNode.data.parentId)
let parentNode = getTreeNode(this.customerOrg.customerOrgTree, 'treeChildren', 'id', draggingNode.data.parentId)
parentNode.treeChildren.forEach((e, i) => {
body.itemList.push({ id: e.id, displayOrder: i })
});
});
} else {
this.customerOrg.customerOrgTree.forEach((e, i) => {
body.itemList.push({ id: e.id, displayOrder: i })

24
src/components/patientRegister/PatientRegisterRecoverList.vue

@ -2,9 +2,9 @@
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'">
<el-table :data="tableData" width="100%" border :height="window.pageHeight < 600 ? 330 : window.pageHeight - 240" row-key="id"
size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange" @row-click="rowClick" @table-body-scroll="scrollFull">
size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange" @row-click="rowClick">
<el-table-column type="selection" width="40" align="center" />
<el-table-column prop="isRecoverGuide" label="回收1" align="center" width="50">
<el-table-column prop="isRecoverGuide" label="回收" align="center" width="50">
<template slot-scope="scope">
<el-checkbox :value="scope.row.isRecoverGuide == 'Y'" />
</template>
@ -92,13 +92,11 @@
</el-table>
<div style="display: flex; justify-content: space-between">
<div></div>
<div style="display: flex;">
<div>
<span style="font-size: 12px">{{ loadOpts.totalCount }} 条记录当前显示{{
tableData.length
}}
</span>
<i class="el-icon-bottom" style="font-size: 18px;" @click="load" />
</span>
</div>
</div>
</div>
@ -158,7 +156,8 @@ export default {
maxResultCount: 100,
},
loadOptsInit: {},
lazyLoading:false
lazyLoading:false,
dom:null,
};
},
@ -300,6 +299,7 @@ export default {
async load() {
this.loadOpts.skipCount++;
await this.getPrList();
this.lazyLoading = false
},
//
@ -503,14 +503,14 @@ export default {
//
scrollFull() {
let obj = this.$refs['dataList'].bodyWrapper
console.log('obj', obj)
this.dom = this.$refs['dataList'].bodyWrapper
console.log('obj', this.dom)
obj.addEventListener('scroll', async () => {
this.dom.addEventListener('scroll', async () => {
// console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
if (obj.scrollTop + obj.clientHeight + 20 > obj.scrollHeight && !this.lazyLoading) {
if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
//
console.log('scrollTop', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight);
//console.log('scrollTop', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight);
if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
this.lazyLoading = false
} else {

102
src/components/patientRegister/customerOrgTreeAll.vue

@ -35,7 +35,9 @@
<script>
import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, deepCopy, reMadeOrgTree, arrayExistObj } from "../../utlis/proFunc";
import { tcdate, deepCopy, reMadeOrgTree, arrayExistObj, updateDBCom, getDBCom } from "../../utlis/proFunc";
import { madeTree, getTreeAllChildIdsById, getTreeNode } from "@/utlis/tree";
import { now } from "moment";
export default {
@ -55,19 +57,20 @@ export default {
dispCustomerOrgCode: 'N', // -- customerOrgCode
}
},
customerOrgTreeAll: [],
customerOrgTreeAll: [], //
orgDatas: [], //
//
cusQuery: {
treeDataAll: [], //
treeDataTop1: [], //
haveSunCus: 'N', //
haveSunCus: 'Y', //
times: 0, // times > 0
}
};
},
computed: {
...mapState(["window", "dict", "dataTransOpts", "customerOrg", "patientRegister"]),
},
@ -86,8 +89,7 @@ export default {
//
mounted() {
// (Y:N)
// (Y:N)
//
if (this.cusQuery.haveSunCus == 'Y') {
this.getCustomerOrgAll()
@ -110,47 +112,69 @@ export default {
},
methods: {
//
getCustomerOrgAll() {
//
getOrgDatas() {
return new Promise((resolve, reject) => {
let url = '/api/app/CustomerOrg/GetSimpleByCodeAll'
if(this.LocalConfig.patientRegister.dispCustomerOrgCode == 'Y'){
if (this.LocalConfig.patientRegister.dispCustomerOrgCode == 'Y') {
url = "/api/app/customerorg/getbycodeall"
getapi(url)
.then((res) => {
if (res.code > -1) {
let treeData = reMadeOrgTree(deepCopy(res.data), this.LocalConfig.patientRegister.dispCustomerOrgCode);
this.cusQuery.times += 1
//console.log('getCustomerOrgAll.treeData', treeData)
//console.log('getTreeNode', getTreeNode(treeData, "treeChildren", 'id', '3a1d3736-d7c6-a9fb-c165-675335dc0e9b').treeChildren)
this.cusQuery.treeDataAll = treeData
resolve(treeData)
} else {
reject(res.message)
}
})
.catch(err => {
reject(err)
})
}else{
.then((res) => {
if (res.code > -1) {
this.orgDatas = res.data
updateDBCom('orgDatas',res.data) //
resolve()
} else {
reject(res.message)
}
})
.catch(err => {
reject(err)
})
} else {
postapi(url)
.then((res) => {
if (res.code > -1) {
let treeData = reMadeOrgTree(deepCopy(res.data), this.LocalConfig.patientRegister.dispCustomerOrgCode);
.then((res) => {
if (res.code > -1) {
this.orgDatas = res.data
updateDBCom('orgDatas',res.data)
resolve()
} else {
reject(res.message)
}
})
.catch(err => {
reject(err)
})
}
})
},
//
getCustomerOrgAll() {
return new Promise((resolve, reject) => {
if (this.dataTransOpts.orgDatas.length > 0) {
let treeData = reMadeOrgTree(deepCopy(this.dataTransOpts.orgDatas), this.LocalConfig.patientRegister.dispCustomerOrgCode);
this.cusQuery.times += 1
//console.log('getCustomerOrgAll.treeData', treeData)
//console.log('getTreeNode', getTreeNode(treeData, "treeChildren", 'id', '3a1d3736-d7c6-a9fb-c165-675335dc0e9b').treeChildren)
this.cusQuery.treeDataAll = treeData
resolve(treeData)
} else {
this.getOrgDatas()
.then(() => {
let treeData = reMadeOrgTree(deepCopy(this.dataTransOpts.orgDatas), this.LocalConfig.patientRegister.dispCustomerOrgCode);
this.cusQuery.times += 1
//console.log('getCustomerOrgAll.treeData', treeData)
//console.log('getTreeNode', getTreeNode(treeData, "treeChildren", 'id', '3a1d3736-d7c6-a9fb-c165-675335dc0e9b').treeChildren)
this.cusQuery.treeDataAll = treeData
resolve(treeData)
} else {
reject(res.message)
}
})
.catch(err => {
reject(err)
})
})
.catch(err => {
reject(err)
})
}
})
},
@ -159,7 +183,7 @@ export default {
return new Promise((resolve, reject) => {
console.log('new Date()3', now())
let url = '/api/app/CustomerOrg/GetCustomerOrgSimpleByParentId'
if(this.LocalConfig.patientRegister.dispCustomerOrgCode == 'Y'){
if (this.LocalConfig.patientRegister.dispCustomerOrgCode == 'Y') {
url = '/api/app/CustomerOrg/GetCustomerOrgByParentId'
}
postapi(url, { parentId })
@ -273,8 +297,8 @@ export default {
console.log('filterParentNode', value)
// if (!value) return true;
// return data['displayName'].indexOf(value) > -1 || data['simpleCode'].indexOf(value.toUpperCase()) > -1 || data['shortName'].indexOf(value) > -1 || data['customerOrgCode'].indexOf(value) > -1;
this.customerOrgTreeAll = this.cusQuery.treeDataTop1.filter(e => {
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1
this.customerOrgTreeAll = this.cusQuery.treeDataTop1.filter(e => {
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1
})
},

2
src/components/patientRegister/patientRegisterQuery.vue

@ -127,7 +127,7 @@
<!-- 按钮区域 -->
<div style="margin-left: 10px;margin-top: -10px;">
<div v-show="checkPagePriv(pagePriv.privs, '查询')" class="listBtn">
<div class="listBtn">
<el-button class="commonbutton" @click="btnQuery">查询</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '读身份证')" class="listBtn">

632
src/components/patientRegister/patientRegisterRecoverListQuery.vue

@ -0,0 +1,632 @@
<template>
<div>
<div class="contenttitle">
体检查询 /<span class="contenttitleBold">回收表格查询</span>
</div>
<div style="display: flex;">
<div style="display: flex;">
<div class="query">
<el-select v-model="patientRegister.query.dateType" placeholder="请选择" style="width: 80px" size="small">
<el-option label="登记日期" :value="'1'" />
<el-option label="体检日期" :value="'2'" />
<el-option label="登记或体检" :value="'3'" />
</el-select>
<!-- dateType 1 登记2 体检3 体检或登记-->
<el-date-picker v-model="patientRegister.query.startDate" type="date" placeholder="起始日期" size="small"
style="width:90px;" value-format="yyyy-MM-dd" :picker-options="pickerOptions" />
<span class="spanClass"></span>
<el-date-picker v-model="patientRegister.query.endDate" type="date" placeholder="截止日期" size="small"
style="width:90px;" value-format="yyyy-MM-dd" :picker-options="pickerOptions" />
</div>
<!--
<div class="query">
<span class="spanClass">连续扫码</span>
<el-checkbox v-model="patientRegister.query.isSeries" size="small" true-label="Y" false-label="N" />
</div>
<div class="query">
<span class="spanClass">条码号</span>
<el-input placeholder="条码号" v-model="patientRegister.query.patientRegisterNo" size="small" clearable
style="width: 120px" />
</div>
<div class="query">
<span class="spanClass">档案号</span>
<el-input placeholder="档案号" v-model="patientRegister.query.patientNo" size="small" clearable
style="width: 80px" />
</div>
<div class="query">
<span class="spanClass">姓名</span>
<el-input placeholder="姓名" v-model="patientRegister.query.patientName" size="small" clearable
style="width: 60px" />
</div>
<div class="query">
<span class="spanClass">检查条码</span>
<el-input placeholder="检查条码" v-model="patientRegister.query.pacsNo" size="small" clearable
style="width: 120px" />
</div>
<div class="query">
<span class="spanClass">检验条码</span>
<el-input placeholder="检验条码" v-model="patientRegister.query.lisNo" size="small" clearable
style="width: 120px" />
</div>
<div class="query">
<span class="spanClass">性别</span>
<el-select v-model="patientRegister.query.sex" placeholder="性别" style="width: 50px" size="small" clearable>
<el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id">
</el-option>
</el-select>
</div>
<div class="query">
<span class="spanClass">手机号</span>
<el-input placeholder="手机号/电话" v-model="patientRegister.query.phone" size="small" clearable
style="width: 100px" />
</div>
<div class="query">
<span class="spanClass">身份证</span>
<el-input placeholder="身份证" v-model="patientRegister.query.idCardNo" size="small" clearable
style="width: 150px" />
</div>
<div class="query">
<el-tooltip class="item" effect="dark" content="单位作为查询条件" placement="top">
<el-checkbox v-model="patientRegister.query.customerOrgFlag"></el-checkbox>
</el-tooltip>
<el-input placeholder="请选择单位" v-model="patientRegister.query.customerOrgName" size="small" disabled
style="width: 120px" />
<el-cascader v-model="patientRegister.query.customerOrgId" :options="patientRegister.customerOrgTreeAll"
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" placeholder="请选择单位"
:show-all-levels="false" clearable :disabled="orgEnable == 'Y' ? false : true" size="small"
style="width:120px;">
</el-cascader>
</div>
<div v-show="dispTimes" class="query">
<span class="spanClass">次数</span>
<el-select v-model="patientRegister.query.customerOrgRegister" placeholder="次数" clearable
@change="changeCustomerOrgRegister" style="width: 50px;" size="small" value-key="id">
<el-option v-for="item in customerOrgRegisterList" :key="item.id" :label="item.medicalTimes"
:value="item">{{
item.medicalTimes + '次' }}</el-option>
</el-select>
</div>
<div v-show="dispTimes" class="query">
<span class="spanClass">分组</span>
<el-select v-model="patientRegister.query.customerOrgGroupIds" placeholder="请选择" clearable filterable
style="width: 150px" size="small" multiple collapse-tags>
<el-option v-for="item in dict.customerOrgGroup" :key="item.id" :label="item.displayName"
:value="item.id" />
</el-select>
</div>
<div class="query">
<span class="spanClass">体检类别</span>
<el-select v-model="patientRegister.query.medicalTypeIds" placeholder="请选择" clearable filterable
style="width: 170px" size="small" multiple collapse-tags>
<el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</div>
<div class="query">
<span class="spanClass">状态</span>
<el-select v-model="patientRegister.query.completeFlags" placeholder="请选择" clearable style="width: 100px"
size="small" multiple collapse-tags>
<el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName" :value="item.id">
</el-option>
</el-select>
</div>
-->
<div class="query">
<span class="spanClass">人员类别</span>
<el-select v-model="patientRegister.query.personnelTypeIds" placeholder="请选择" clearable filterable
style="width: 170px" size="small" multiple collapse-tags>
<el-option v-for="item in dict.personnelType" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</div>
<div class="query">
<span class="spanClass">表回收</span>
<el-select v-model="patientRegister.query.isRecoverGuide" placeholder="请选择" clearable style="width: 80px"
size="small">
<el-option label="未回收" value="N" />
<el-option label="已回收" value="Y" />
</el-select>
</div>
</div>
<!-- 按钮区域 -->
<div style="margin-left: 10px;margin-top: -10px;">
<div class="listBtn">
<el-button class="commonbutton" @click="btnQuery">查询</el-button>
</div>
<div class="listBtn">
<el-button type="danger" class="commonbutton" @click="btnClear">清除条件</el-button>
</div>
</div>
</div>
<div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'">
<el-table :data="tableData" width="100%" border :height="window.pageHeight < 600 ? 330 : window.pageHeight - 240"
row-key="id" size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange"
@row-click="rowClick">
<el-table-column type="selection" width="40" align="center" />
<el-table-column prop="isRecoverGuide" label="回收" align="center" width="50">
<template slot-scope="scope">
<el-checkbox :value="scope.row.isRecoverGuide == 'Y'" />
</template>
</el-table-column>
<el-table-column prop="completeFlag" label="体检进度">
<template slot-scope="scope">
<div>{{ dddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}</div>
</template>
</el-table-column>
<el-table-column prop="isLock" label="锁住" width="50">
<template slot-scope="scope">
<i class="el-icon-lock" v-if="scope.row.isLock == 'Y'" style="font-size: 20px; color: red" />
</template>
</el-table-column>
<el-table-column prop="customerOrgParentName" label="单位" width="180">
<template slot-scope="scope">
<div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}
</div>
</template>
</el-table-column>
<el-table-column prop="customerOrgName" label="部门" width="180">
<template slot-scope="scope">
<div>{{ scope.row.customerOrgParentName == scope.row.customerOrgName ? "" : scope.row.customerOrgName }}
</div>
</template>
</el-table-column>
<el-table-column prop="patientName" label="姓名" />
<el-table-column prop="sexName" label="性别">
</el-table-column>
<el-table-column prop="age" label="年龄" />
<el-table-column prop="patientRegisterNo" label="条码号" width="150" />
<el-table-column prop="patientNo" label="档案号" />
<el-table-column prop="medicalTimes" label="体检次数"></el-table-column>
<el-table-column label="分组/套餐" width="150">
<template slot-scope="scope">
<div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
{{ scope.row.medicalPackageName }}
</div>
<div v-else>
{{ scope.row.customerOrgGroupName }}
</div>
</template>
</el-table-column>
<el-table-column prop="nationName" label="民族">
</el-table-column>
<el-table-column prop="idNo" label="身份证" width="150" />
<el-table-column prop="birthDate" label="出生日期" width="100">
<template slot-scope="scope">
<div v-if="scope.row.birthDate">
{{ moment(scope.row.birthDate).format("yyyy-MM-DD") }}
</div>
</template>
</el-table-column>
<el-table-column prop="email" label="邮箱" width="100" />
<el-table-column prop="mobileTelephone" label="手机" width="100" />
<el-table-column prop="telephone" label="电话" width="100" />
<el-table-column prop="address" label="地址" width="300" />
<el-table-column prop="medicalCardNo" label="体检卡号" />
<el-table-column prop="jobCardNo" label="工卡号" />
<el-table-column prop="maritalStatusName" label="婚姻状况">
</el-table-column>
<el-table-column prop="medicalTypeName" label="体检类别">
</el-table-column>
<el-table-column prop="personnelTypeName" label="人员类别">
</el-table-column>
<el-table-column prop="jobPost" label="职务" />
<el-table-column prop="jobTitle" label="职称" />
<el-table-column prop="salesman" label="介绍人" />
<el-table-column prop="isVip" label="VIP">
<template slot-scope="scope">
<el-checkbox :value="scope.row.isVip == 'Y'" />
</template>
</el-table-column>
<el-table-column prop="creatorName" label="登记人" />
<el-table-column prop="creationTime" label="登记日期" width="100">
<template slot-scope="scope">
<div>{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}</div>
</template>
</el-table-column>
<el-table-column prop="isUpload" label="上传">
<template slot-scope="scope">
<el-checkbox :value="scope.row.isUpload == 'Y'" />
</template>
</el-table-column>
</el-table>
<div style="display: flex; justify-content: space-between">
<div></div>
<div>
<span style="font-size: 12px">{{ loadOpts.totalCount }} 条记录当前显示{{
tableData.length
}}
</span>
</div>
</div>
</div>
</div>
</template>
<script>
import moment from "moment";
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { dddw, objCopy, arrayReduce, arrayExistObj } from "@/utlis/proFunc";
import { savePeoplePhoto } from "../../utlis/proApi";
import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
import Camera from "../../components/patientRegister/Camera.vue";
export default {
components: {
PatientRegisterEdit,
Camera,
},
data() {
return {
tableData: [], //
multipleSelection: [], //
tableDataCurrentRow: {}, //
patientRegisterNo: '',
LocalConfig: {
normal: {
maxResultCount: 100, //
},
},
loadOpts: {
totalCount: 0,
skipCount: 0,
maxResultCount: 100,
},
loadOptsInit: {},
lazyLoading: false,
dom: null,
};
},
created() {
try {
let LocalConfig = JSON.parse(window.localStorage.getItem("LocalConfig") || null)
if (LocalConfig?.normal?.maxResultCount) {
this.LocalConfig.normal.maxResultCount = LocalConfig.normal.maxResultCount
}
} catch (error) {
console.log('window.localStorage.getItem("LocalConfig")', error);
}
// console.log('this.LocalConfig',this.LocalConfig)
this.loadOpts.maxResultCount = Number(
this.LocalConfig.normal.maxResultCount || 100
);
this.loadOptsInit = Object.assign({}, this.loadOpts);
},
//
mounted() {
this.$nextTick(() => {
this.scrollFull()
})
},
computed: {
...mapState(["window", "dict", "patientRegister", "customerOrg"]),
},
methods: {
...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
dddw, moment,
handleSelectionChange(val) {
this.multipleSelection = val;
},
rowClick(row) {
this.tableDataCurrentRow = row
},
//
signByPatientRegisterNo() {
let patientRegisterNos = [this.patientRegisterNo]
let body = {
patientRegisterNos
}
//console.log(`/api/app/patientregister/getpatientregisterorpatient`, body)
postapi('/api/app/PatientRegister/BatchRecoverGuideByPatientRegisterNo', body)
.then((res) => {
if (res.code > -1) {
this.patientRegisterNo = ''
this.$message.success({ showClose: true, message: '操作成功!' })
}
});
},
//
async Query() {
//
this.tableDataCurrentRow = {}; //
if (
!(
this.patientRegister.query.isSeries == "Y" &&
this.patientRegister.query.patientRegisterNo
)
) {
this.tableData = [];
}
this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit);
await this.getPrList();
},
//
async load() {
this.loadOpts.skipCount++;
await this.getPrList();
this.lazyLoading = false
},
//
async getPrList() {
if (
this.loadOpts.skipCount != 0 &&
this.loadOpts.skipCount * this.loadOpts.maxResultCount >=
this.loadOpts.totalCount
)
return;
// console.log('getPrList', this.loadOpts)
let body = {
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount,
};
// console.log(`this.patientRegister.query`, this.patientRegister.query);
if (this.patientRegister.query.customerOrgFlag) {
// if (this.patientRegister.query.CustomerOrgParentId) {
// body.customerOrgId = this.patientRegister.query.CustomerOrgParentId;
// } else {
// if (this.patientRegister.query.customerOrgId)
// body.customerOrgId = this.patientRegister.query.customerOrgId;
// }
if (this.patientRegister.query.customerOrgId)
body.customerOrgId = this.patientRegister.query.customerOrgId;
//
try {
if (
this.patientRegister.query.customerOrgId &&
this.patientRegister.query.customerOrgId != this.dict.personOrgId &&
this.patientRegister.query.customerOrgRegister.id
) {
body.customerOrgRegisterId =
this.patientRegister.query.customerOrgRegister.id;
body.customerOrgGroupIds =
this.patientRegister.query.customerOrgGroupIds;
}
} catch (error) {
console.error(error)
}
}
if (this.patientRegister.query.sex)
body.sexId = this.patientRegister.query.sex;
if (this.patientRegister.query.patientName)
body.patientName = this.patientRegister.query.patientName;
if (
this.patientRegister.query.medicalTypeIds &&
this.patientRegister.query.medicalTypeIds.length > 0
)
body.medicalTypeIds = this.patientRegister.query.medicalTypeIds;
if (
this.patientRegister.query.completeFlags &&
this.patientRegister.query.completeFlags.length > 0
)
body.completeFlags = this.patientRegister.query.completeFlags;
if (
this.patientRegister.query.personnelTypeIds &&
this.patientRegister.query.personnelTypeIds.length > 0
)
body.personnelTypeIds = this.patientRegister.query.personnelTypeIds;
if (this.patientRegister.query.isRecoverGuide)
body.isRecoverGuide = this.patientRegister.query.isRecoverGuide;
//StartDate EndDate
if (
this.patientRegister.query.startDate &&
this.patientRegister.query.endDate
) {
body.dateType = this.patientRegister.query.dateType;
body.startDate = moment(this.patientRegister.query.startDate).format(
"yyyy-MM-DD"
);
body.endDate = moment(this.patientRegister.query.endDate).format(
"yyyy-MM-DD"
);
if (body.startDate > body.endDate) {
this.$message.warning({
showClose: true,
message: "起始日期不能大于截止日期,数据校验不通过!",
});
return;
}
}
if (this.patientRegister.query.phone)
body.phone = this.patientRegister.query.phone;
if (this.patientRegister.query.idCardNo) {
body.idNo = this.patientRegister.query.idCardNo;
try {
let sysParmId = "patient_register_query_idno";
let sysParam = await postapi(
"/api/app/SysParmValue/GetSysParmValueBySysParmId",
{ sysParmId }
);
// console.log('sysParam', sysParam)
if (sysParam.data != "N") {
body = {
idNo: this.patientRegister.query.idCardNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount,
};
}
} catch (error) {
console.log(error);
}
}
if (this.patientRegister.query.patientNo)
body = {
patientNo: this.patientRegister.query.patientNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount,
};
if (this.patientRegister.query.patientRegisterNo)
body = {
patientRegisterNo: this.patientRegister.query.patientRegisterNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount,
};
// console.log("/api/app/patientregister/getlistinfilter", body);
let upPhoto = "patient_register_read_idno_upPhoto"; //
let upPhotoParam = await postapi(
"/api/app/SysParmValue/GetSysParmValueBySysParmId",
{ sysParmId: upPhoto }
);
let photo = this.patientRegister.photo;
this.patientRegister.photo = "";
postapi("/api/app/patientregister/getlistinfilter", body).then(
async (res) => {
if (res.code > -1) {
//
this.loadOpts.totalCount = res.data.totalCount;
let curLoad = res.data.items;
// let oldCount = 0
//
// 1/
// 2()
curLoad.forEach((e) => {
// 1/
if (e.customerOrgId == this.dict.personOrgId) {
e.groupPack = e.medicalPackageId;
} else {
e.groupPack = e.customerOrgGroupId;
}
// 2()
if (upPhotoParam != "N" && photo) {
if (!e.photo) {
savePeoplePhoto(e.id, photo);
}
}
});
// ()
console.log(
"this.patientRegister.query",
this.patientRegister.query.isSeries,
this.patientRegister.query.patientRegisterNo
);
if (
!(
this.patientRegister.query.isSeries == "Y" &&
this.patientRegister.query.patientRegisterNo
)
) {
if (body.skipCount == 0) {
//
this.tableData = [];
}
}
this.tableData = this.tableData.concat(curLoad);
// else {
// // ,
// oldCount = this.tableData.length
// }
// curLoad.forEach((e, index) => {
// this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
// })
}
}
);
},
//
scrollFull() {
this.dom = this.$refs['dataList'].bodyWrapper
console.log('obj', this.dom)
this.dom.addEventListener('scroll', async () => {
// 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.lazyLoading) {
//
//console.log('scrollTop', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight);
if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
this.lazyLoading = false
} else {
this.lazyLoading = true
this.load()
// this.dom.scrollTop = this.dom.scrollTop - 100
}
}
})
},
},
//
watch: {
//
"patientRegister.query.times"(newVal, oldVal) {
if (newVal != oldVal) {
//alert('')
this.Query();
}
},
},
};
</script>
<style scoped>
.listBtn {
margin-top: 10px;
}
.btnClass {
width: 100px;
}
.query {
margin-right: 10px;
font-size: 14px;
color: #232748;
font-weight: 400;
font-family: "NotoSansSC-Regular";
}
.spanClass {
font-size: 14px;
padding: 0 2px 0 0;
}
</style>

2
src/store/index.js

@ -417,6 +417,8 @@ export default new Vuex.Store({
// 多层数据传递时使用(统一归结在此,便于管理)
dataTransOpts: {
orgDatas:[], // 未处理所有单位的数据
orgDataSet:[], // 单位设置处使用
// 强制刷新(如触发数据刷新的ID值没有变化时,但也想强制刷新数据:
// S--single 单记录刷新,M--more 多记录刷新,D--detail
// 当父子组件都在存在多记录刷新时 父组件用 M,子组件用 D

219
src/utlis/indexedDB.js

@ -0,0 +1,219 @@
/**
* 打开数据库
* @param {object} dbName 数据库的名字
* @param {string} storeName 仓库名称
* @param {string} version 数据库的版本
* @return {object} 该函数会返回一个数据库实例
*/
function openDB(dbName, version = 1) {
return new Promise((resolve, reject) => {
// 兼容浏览器
var indexedDB =
window.indexedDB ||
window.mozIndexedDB ||
window.webkitIndexedDB ||
window.msIndexedDB;
let db;
// 打开数据库,若没有则会创建
const request = indexedDB.open(dbName, version);
// 数据库打开成功回调
request.onsuccess = function (event) {
db = event.target.result; // 数据库对象
// console.log("indexedDB 数据库打开成功");
resolve(db);
};
// 数据库打开失败的回调
request.onerror = function (event) {
console.log("indexedDB 数据库打开报错", event)
reject("indexedDB 数据库打开报错");
};
// 数据库有更新时候的回调
request.onupgradeneeded = function (event) {
// 数据库创建或升级的时候会触发
// console.log("onupgradeneeded");
db = event.target.result; // 数据库对象
// 创建表 keyPath 表示主键,插入更新数据时,必须存在 主键
// 可放在配置中,读取文件后,循环创建 ObjectStore(表)
// let tables = Object.keys(dbSQL.dddw)
// tables.forEach(e => {
// if (!db.objectStoreNames.contains(e)) createObjectStore(db,e,'id')
// });
//if (!db.objectStoreNames.contains('dict')) db.createObjectStore('dict', { keyPath: "id" }) // tableName作为id值
// 创建表 storeName 相当于表的概念
createObjectStore(db, 'dict', 'id') // 创建字典表,数据说明:id = tableName
createObjectStore(db, 'sort', 'id') // 创建排序信息表,数据说明:id = user_id + _ + tableName + _ + pageName
createObjectStore(db, 'drag', 'id') // 创建数据列拖拽表,数据说明:id = user_id + _ + tableName + _ + pageName
createObjectStore(db, 'form', 'id') // 创建表单设计表,数据说明:id = user_id + _ + tableName + _ + pageName
createObjectStore(db, 'query', 'id') // 创建高级查询表,数据说明:id = user_id + _ + tableName + _ + pageName
createObjectStore(db, 'localConfig', 'id') // 创建本地参数,数据说明:本地客户端个性化设置
createObjectStore(db, 'route', 'id') // 路由数据, id = path
createObjectStore(db, 'other', 'id') // 创建本地参数,数据说明:其他存本地参数,如:用户权限
// var objectStore; //相当于表名
// // 创建存储库
// objectStore = db.createObjectStore("signalChat", {
// keyPath: "sequenceId", // 这是主键
// // autoIncrement: true // 实现自增
// });
// // 创建索引,在后面查询数据的时候可以根据索引查
// objectStore.createIndex("link", "link", { unique: false });
// objectStore.createIndex("sequenceId", "sequenceId", { unique: false });
// objectStore.createIndex("messageType", "messageType", {
// unique: false,
// });
};
});
}
function createObjectStore(db, objectStoreName, keyPath) {
if (!db.objectStoreNames.contains(objectStoreName)) db.createObjectStore(objectStoreName, { keyPath: keyPath || "id" })
}
/**
* 更新数据 (插入也可以用此接口)
* @param {object} db 数据库实例
* @param {string} storeName 仓库名称
* @param {object} data 数据 {id:'data',records:[],updatedat:Date.now()}
* @param {string} devMode 是否开发模式 Y 打印日志
*/
function updateDB(db, pkey, data, devMode) {
return updateDBCom(db, 'dict', pkey, data, devMode)
}
function updateDBCom(db, storeName, pkey, data, devMode) {
return new Promise((resolve, reject) => {
let request = db
.transaction([storeName], "readwrite") // 事务对象
.objectStore(storeName) // 仓库对象
.put({ id: pkey, data, createdat: Date.now() });
request.onsuccess = function () {
if (devMode == 'Y') console.log("indexedDB 数据更新成功:storeName, pkey ", storeName, pkey);
resolve("indexedDB 数据更新成功");
};
request.onerror = function () {
if (devMode == 'Y') console.log("indexedDB 数据更新失败");
reject("数据更新失败")
};
})
}
/**
* 通过主键读取数据
* @param {object} db 数据库实例
* @param {string} storeName 仓库名称
* @param {string} key 主键值
* @param {string} devMode 是否开发模式 Y 打印日志
*/
function getDataByKey(db, pkey, devMode) {
return getDataByKeyCom(db, 'dict', pkey, devMode)
}
function getDataByKeyCom(db, storeName, pkey, devMode) {
return new Promise((resolve, reject) => {
var transaction = db.transaction([storeName]); // 事务
var objectStore = transaction.objectStore(storeName); // 仓库对象
var request = objectStore.get(pkey); // 通过主键获取数据
request.onerror = function (event) {
let err = `indexedDB 缓存数据库,读取 ${db}.${storeName} id=${pkey} 记录失败`
if (devMode == 'Y') console.error(err, event);
reject(err)
};
request.onsuccess = function () {
if (devMode == 'Y') console.log(`indexedDB 缓存数据库,读取 ${db}.${storeName} id=${pkey} 记录成功:`, request.result);
resolve(request.result);
};
});
}
/**
* 通过主键删除数据
* @param {object} db 数据库实例
* @param {string} storeName 仓库名称
* @param {object} pkey 主键值
* @param {string} devMode 是否开发模式 Y 打印日志
*/
function deleteDB(db, storeName, pkey, devMode) {
return new Promise((resolve, reject) => {
var request = db
.transaction([storeName], "readwrite")
.objectStore(storeName)
.delete(pkey);
request.onsuccess = function () {
let msg = `indexedDB缓存数据 ${db}.${storeName} id=${pkey} 记录删除成功`
if (devMode == 'Y') console.log(msg);
resolve(msg);
};
request.onerror = function () {
let err = `indexedDB缓存数据 ${db}.${storeName} id=${pkey} 记录删除失败`
if (devMode == 'Y') console.error(err);
reject(err)
};
});
}
/**
* 关闭数据库
* @param {object} db 数据库实例
*/
function closeDB(db) {
db.close();
// console.log("数据库已关闭");
}
// 删库
const dropDB = (dbName, devMode) => {
return new Promise((resolve, reject) => {
let request = indexedDB.deleteDatabase(dbName);
request.onsuccess = () => {
let msg = `indexedDB缓存数据库 ${dbName} 已删除成功`
if (devMode == 'Y') console.log(msg);
resolve(msg);
};
request.onerror = (event) => {
if (devMode == 'Y') console.error(`indexedDB缓存数据库 ${dbName} 删除失败:`, event.target.error);
reject(`indexedDB缓存数据库 ${dbName} 删除失败:${event.target.error}`)
};
request.onblocked = () => {
let wMsg = `indexedDB存在未关闭的缓存数据库 ${dbName} 连接,删除被暂时阻塞`
if (devMode == 'Y') console.warn(wMsg);
reject(wMsg)
};
})
}
// 清单个表,保留表结构
const clearStore = (db, storeName) => {
return new Promise((resolve, reject) => {
const transaction = db.transaction(storeName, 'readwrite');
const objectStore = transaction.objectStore(storeName);
const clearRequest = objectStore.clear();
clearRequest.onsuccess = function () {
resolve(`清除表【${storeName}】数据成功!`);
};
clearRequest.onerror = function (error) {
reject(`清除表【${storeName}】数据失败,原因: ` + error);
};
});
}
export default {
openDB, updateDBCom, getDataByKeyCom, deleteDB, dropDB, clearStore, closeDB,
updateDB, getDataByKey
}

45
src/utlis/proFunc.js

@ -1,3 +1,4 @@
const indexedDB = require('./indexedDB');
//多级联动选择数据处理 add by pengjun
function tcdate(date) {
@ -482,6 +483,50 @@ function isValidMobileNumber(tel) {
}
exports.isValidMobileNumber = isValidMobileNumber;
// 本地储存
function updateDBCom(pkey,data){
return new Promise((resolve, reject) => {
let db
indexedDB.openDB('peis','1')
.then(res => {
db = res
return indexedDB.updateDBCom(db, 'dict', pkey, data, 'Y')
})
.then(() => {
resolve()
})
.catch(err => {
console.error(err)
reject(err)
})
.finally(() => {
if (db) indexedDB.closeDB(db) // 关闭indexedDB
})
})
}
exports.updateDBCom = updateDBCom;
function getDBCom(pkey){
return new Promise((resolve, reject) => {
let db
indexedDB.openDB('peis','1')
.then(res => {
db = res
return indexedDB.getDataByKeyCom(db,'dict',pkey,'Y')
})
.then((res) => {
resolve(res)
})
.catch(err => {
console.error(err)
reject(err)
})
.finally(() => {
if (db) indexedDB.closeDB(db) // 关闭indexedDB
})
})
}
exports.getDBCom = getDBCom;

11
src/views/workload/examinedoctor.vue

@ -5,7 +5,7 @@
<div class="contenttitle">
工作量统计 /
<span class="contenttitleBold"
>审核医生工作量统计</span
>总检审核医生工作量统计</span
>
</div>
</div>
@ -31,7 +31,7 @@
</el-select>
</div>
<div class="query">
<span>开始日期</span>
<span>审核日期</span>
<el-date-picker
type="date"
placeholder="选择开始日期"
@ -112,9 +112,12 @@
></el-table-column>
<el-table-column
prop="auditCount"
label="人数"
label="人数" align="center"
></el-table-column>
<el-table-column prop="percentage" label="占登记总人数百分比">
<el-table-column prop="percentage" label="占登记总人数百分比" align="center">
<template slot-scope="scope">
<div>{{ scope.row.percentage+'%' }}</div>
</template>
</el-table-column>
</el-table-column>
</el-table-column>

Loading…
Cancel
Save