pengjun 2 weeks ago
parent
commit
1877f25d45
  1. 100
      src/components/report/CusOrgOCX.vue

100
src/components/report/CusOrgOCX.vue

@ -2,15 +2,16 @@
<div style="display: flex;">
<div v-if="useCusOrg" style="width: 258px;height:520px;border: 1px solid #EEE;">
<div style="margin:2px 2px 2px 2px;display: flex;">
<!--
<el-checkbox style="margin-top: 6px;" v-model="isOnlyCus" true-label="Y" false-label="N" size="small">
仅单位
仅单位
</el-checkbox>
-->
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
</div>
<div>
<el-tree style="overflow: scroll;width: 200px;height:480px;" :data="patientRegister.customerOrgTreeAll"
:props="treeprops" node-key="id" @node-click="handleNode" :filter-node-method="filterNode"
ref="customerOrgTree">
<el-tree style="overflow: scroll;width: 200px;height:480px;" :data="customerOrgTreeSeo" :props="treeprops"
node-key="id" @node-click="handleNode" ref="customerOrgTree">
<span class="custom-tree-node" slot-scope="{ node, data }">
<div>
<span class="treeicons">
@ -92,8 +93,8 @@
<el-radio label="creationTime">登记</el-radio>
<el-radio label="medicalStartDate">体检</el-radio>
<el-radio label="checkDate">检查</el-radio>
<el-radio label="summaryDate">{{summary_check_doctor_alias[0]||'总检'}}</el-radio>
<el-radio label="sumCheckDate">{{summary_check_doctor_alias[1]||'审核'}}</el-radio>
<el-radio label="summaryDate">{{ summary_check_doctor_alias[0] || '总检' }}</el-radio>
<el-radio label="sumCheckDate">{{ summary_check_doctor_alias[1] || '审核' }}</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 5px;">
@ -114,6 +115,8 @@ import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc";
import { getTreePids, getTreeAllChildIdsById } from "../../utlis/tree";
import { setDBCom, getDBCom } from "../../utlis/indexedDB";
export default {
components: {},
props: ["useCustomerOrg", "initDateType", "isUnit"],
@ -147,6 +150,9 @@ export default {
}, //
summary_check_doctor_alias: ["总检", "审核"],
customerOrgTreeSeo: [], //
customerOrgTreeAll: [], //
orgDatasQuery: [], //
};
},
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
@ -185,31 +191,54 @@ export default {
methods: {
//
filterNode(value, data,node) {
filterNode(value, data, node) {
if (!value) return true;
return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1;
},
//
filterParentNode(value) {
// console.log(value, data)
// 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;
console.log(this.patientRegister.customerOrgs)
this.patientRegister.customerOrgTreeAll = this.patientRegister.customerOrgs.filter(e => {
console.log(e)
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1 || e.shortName.indexOf(value) > -1
})
//console.log(this.patientRegister.customerOrgs)
if(value){
let org = this.customerOrgTreeAll.filter(e => {
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1
})
this.customerOrgTreeSeo = org.slice(0,100)
}else{
this.customerOrgTreeSeo = this.customerOrgTreeAll.slice(0,100)
}
},
//
getCustomerOrgTree() {
getapi("/api/app/customerorg/getbycodeall").then((res) => {
if (res.code > -1) {
this.patientRegister.customerOrgTreeAll = reMadeOrgTree(deepCopy(res.data));
this.patientRegister.customerOrgs = deepCopy(this.patientRegister.customerOrgTreeAll)
//tcdate(this.patientRegister.customerOrgTreeAll)
}
});
getDBCom('orgDatasQuery')
.then(localData => {
let now = Date.now()
// 24 = 86400000
if (localData?.createdat && now - 43200000 < localData.createdat) {
this.orgDatasQuery = localData.data
// console.log('this.orgDatas.length',this.orgDatas.length)
if (this.orgDatasQuery.length > 0) {
let treeData = reMadeOrgTree(deepCopy(this.orgDatasQuery));
this.customerOrgTreeAll = treeData;
this.customerOrgTreeSeo = treeData.slice(0, 100)
}
} else {
getapi("/api/app/customerorg/getbycodeall").then((res) => {
if (res.code > -1) {
this.orgDatasQuery = res.data
let treeData = reMadeOrgTree(deepCopy(this.orgDatasQuery));
this.customerOrgTreeAll = treeData;
this.customerOrgTreeSeo = treeData.slice(0, 100)
setDBCom('orgDatasQuery', res.data)
}
});
}
})
},
//ID api/app/customer-org/parent/[CustomerOrgld
@ -226,13 +255,6 @@ export default {
});
},
//
treeclick(data) {
this.patientRegister.query.customerOrgId = data.id;
this.getCustomerOrgParentId(data.id);
this.patientRegister.query.times++; //
},
//--
handleNode(data, node, prop) {
// console.log(data, node, prop);
@ -480,22 +502,22 @@ export default {
},
},
watch: {
"filterText"(newVal, oldVal) {
"filterText"(newVal, oldVal) {
if (newVal != oldVal) {
if (this.isOnlyCus == 'N') {
this.$refs['customerOrgTree'].filter(newVal);
} else {
// if (this.isOnlyCus == 'N') {
// this.$refs['customerOrgTree'].filter(newVal);
// } else {
this.filterParentNode(newVal)
}
// }
}
},
"isOnlyCus"(newVal, oldVal) {
if (newVal == 'N') {
this.$refs['customerOrgTree'].filter(this.filterText);
} else {
this.filterParentNode(this.filterText)
}
}
// "isOnlyCus"(newVal, oldVal) {
// if (newVal == 'N') {
// this.$refs['customerOrgTree'].filter(this.filterText);
// } else {
// this.filterParentNode(this.filterText)
// }
// }
},
};
</script>

Loading…
Cancel
Save