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

96
src/components/report/CusOrgOCX.vue

@ -2,15 +2,16 @@
<div style="display: flex;"> <div style="display: flex;">
<div v-if="useCusOrg" style="width: 258px;height:520px;border: 1px solid #EEE;"> <div v-if="useCusOrg" style="width: 258px;height:520px;border: 1px solid #EEE;">
<div style="margin:2px 2px 2px 2px;display: flex;"> <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 style="margin-top: 6px;" v-model="isOnlyCus" true-label="Y" false-label="N" size="small">
仅单位 仅单位
</el-checkbox> </el-checkbox>
-->
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" /> <el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
</div> </div>
<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 }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<div> <div>
<span class="treeicons"> <span class="treeicons">
@ -92,8 +93,8 @@
<el-radio label="creationTime">登记</el-radio> <el-radio label="creationTime">登记</el-radio>
<el-radio label="medicalStartDate">体检</el-radio> <el-radio label="medicalStartDate">体检</el-radio>
<el-radio label="checkDate">检查</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> </el-radio-group>
</div> </div>
<div style="margin-top: 5px;"> <div style="margin-top: 5px;">
@ -114,6 +115,8 @@ import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc"; import { arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc";
import { getTreePids, getTreeAllChildIdsById } from "../../utlis/tree"; import { getTreePids, getTreeAllChildIdsById } from "../../utlis/tree";
import { setDBCom, getDBCom } from "../../utlis/indexedDB";
export default { export default {
components: {}, components: {},
props: ["useCustomerOrg", "initDateType", "isUnit"], props: ["useCustomerOrg", "initDateType", "isUnit"],
@ -147,6 +150,9 @@ export default {
}, // }, //
summary_check_doctor_alias: ["总检", "审核"], summary_check_doctor_alias: ["总检", "审核"],
customerOrgTreeSeo: [], //
customerOrgTreeAll: [], //
orgDatasQuery: [], //
}; };
}, },
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree> //<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
@ -185,31 +191,54 @@ export default {
methods: { methods: {
// //
filterNode(value, data,node) {
filterNode(value, data, node) {
if (!value) return true; if (!value) return true;
return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1; return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1;
}, },
// //
filterParentNode(value) { filterParentNode(value) {
// console.log(value, data) // console.log(value, data)
// if (!value) return true; // 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; // 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() { 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 //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) { handleNode(data, node, prop) {
// console.log(data, node, prop); // console.log(data, node, prop);
@ -480,22 +502,22 @@ export default {
}, },
}, },
watch: { watch: {
"filterText"(newVal, oldVal) {
"filterText"(newVal, oldVal) {
if (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) 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> </script>

Loading…
Cancel
Save