pengjun 2 weeks ago
parent
commit
df37aecd57
  1. 109
      src/components/customerOrg/customerOrgTree.vue
  2. 6
      src/components/doctorCheck/CheckPicture.vue
  3. 4
      src/store/index.js
  4. 41
      src/views/customerOrg/customerOrgGroup.vue

109
src/components/customerOrg/customerOrgTree.vue

@ -1,13 +1,16 @@
<template>
<div>
<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 :data="customerOrg.customerOrgTree" :props="treeprops" node-key="id" :filter-node-method="filterNode"
<!-- :filter-node-method="filterNode" -->
<el-tree :data="customerOrgTreeSeo" :props="treeprops" node-key="id"
:style="'overflow: scroll;width:200px;height:' + (window.pageHeight < 600 ? 465 : window.pageHeight - 135) + 'px;'"
:default-expanded-keys="customerOrg.defaultExpandedKeys" @node-click="treeclick" highlight-current draggable
:allow-drag="allowDrag" :allow-drop="allowDrop" @node-drop="nodeDrop" ref="customerOrgTree">
@ -30,6 +33,8 @@ import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, deepCopy, reMadeOrgTree } from "../../utlis/proFunc";
import { getTreePids, getTreeNode } from "../../utlis/tree";
import { setDBCom, getDBCom } from "../../utlis/indexedDB";
export default {
components: {},
@ -37,6 +42,8 @@ export default {
return {
isOnlyCus: 'N',
filterText: '',
customerOrgTreeSeo: [],
customerOrgTreeAll: [],
treeprops: {
label: "displayName", // label/displayName
value: "id",
@ -45,7 +52,7 @@ export default {
}, //
};
},
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
//<el-tree :data="$store.state.customerOrgTreeSeo" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
computed: {
...mapState(["customerOrg", "window", "dataTransOpts"]),
},
@ -63,23 +70,40 @@ export default {
methods: {
...mapMutations(["setData"]),
// /
//
getCustomerOrgTree() {
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);
getDBCom('orgDatasEdit')
.then(localData => {
let now = Date.now()
// 24 = 86400000
if (localData?.createdat && now - 43200000 < localData.createdat) {
// console.log('this.orgDatas.length',this.orgDatas.length)
if (localData.data.length > 0) {
let treeData = reMadeOrgTree(deepCopy(localData.data));
this.customerOrgTreeAll = treeData;
this.customerOrgTreeSeo = treeData.slice(0, 100)
}else{
this.getOrgTreeApi()
}
} else {
this.getOrgTreeApi()
}
});
}
})
.catch(err => {
console.error(err)
this.getOrgTreeApi()
})
},
getOrgTreeApi() {
getapi("/api/app/customerorg/getbycodeall?IsHidePerson=1").then((res) => {
if (res.code > -1) {
let treeData = reMadeOrgTree(deepCopy(res.data));
this.customerOrgTreeAll = treeData;
this.customerOrgTreeSeo = treeData.slice(0, 100)
setDBCom('orgDatasEdit', res.data)
}
});
},
//
@ -104,19 +128,17 @@ export default {
let body = { itemList: [] }
if (draggingNode.data.parentId) {
let parentNode = getTreeNode(this.customerOrg.customerOrgTree, 'treeChildren', 'id', draggingNode.data.parentId)
let parentNode = getTreeNode(this.customerOrgTreeSeo, '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) => {
this.customerOrgTreeSeo.forEach((e, i) => {
body.itemList.push({ id: e.id, displayOrder: i })
});
}
// console.log('body',body)
putapi('/api/app/customerorg/updatesortmany', body)
@ -144,7 +166,7 @@ export default {
this.dataTransOpts.tableS.customer_org.id = data.id //ID
this.dataTransOpts.tableS.customer_org.parent_id = data.id //ID
if (data.parentId) {
let pids = getTreePids(this.customerOrg.customerOrgTree, "treeChildren", 'parentId', 'id', data.id)
let pids = getTreePids(this.customerOrgTreeSeo, "treeChildren", 'parentId', 'id', data.id)
this.dataTransOpts.tableS.customer_org.parent_id = pids[pids.length - 2]
}
this.dataTransOpts.refresh.customer_org.S++
@ -154,20 +176,23 @@ export default {
},
//
filterNode(value, data) {
//console.log(value,data)
if (!value) return true;
return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1;
},
// filterNode(value, data) {
// //console.log(value,data)
// 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;
this.customerOrg.customerOrgTree = this.customerOrg.customerOrgTreeBak.filter(e => {
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1 || e.shortName.indexOf(value) > -1
})
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)
}
},
@ -184,20 +209,20 @@ export default {
},
"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)
// }
// }
},
};

6
src/components/doctorCheck/CheckPicture.vue

@ -53,7 +53,7 @@
<div style="margin: -6px 2px 0 1px">
<el-tooltip content="是否打印" placement="bottom" effect="light">
<el-checkbox v-model="item.isPrintTrans" @change="btnSavePic"
:disabled="doctorBtnDisabled('btnSavePic')"></el-checkbox>
:readonly="doctorBtnDisabled('btnSavePic')"></el-checkbox>
</el-tooltip>
</div>
<!--
@ -62,10 +62,10 @@
<div style="font-size: 15px; margin: -5px 2px 0 2px">
<el-tooltip content="保存后,图片将按序号从小到大排序" placement="bottom" effect="light">
<input placeholder="排序" v-model="item.displayOrder" @onkeyup="validateInteger(e, index)"
style="width: 30px" :disabled="doctorBtnDisabled('btnSavePic')" />
style="width: 30px" :readonly="doctorBtnDisabled('btnSavePic')" />
</el-tooltip>
</div>
<div style="margin: -6px 0 0 2px">
<div v-if="false" style="margin: -6px 0 0 2px">
<el-tooltip content="是否报告图片" placement="bottom" effect="light">
<el-checkbox v-model="item.pictureFileType" @change="btnSavePic" true-label="1" false-label="0"
:disabled="doctorBtnDisabled('btnSavePic')"></el-checkbox>

4
src/store/index.js

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

41
src/views/customerOrg/customerOrgGroup.vue

@ -385,24 +385,29 @@ export default {
.then(localData => {
let now = Date.now()
// 24 = 86400000
if (localData?.createdat && now - 43200000 < localData.createdat) {
this.customerOrgAll = localData.data
}
// console.log('this.orgDatas.length',this.orgDatas.length)
if (this.customerOrgAll.length > 0) {
this.customerOrg = deepCopy(this.customerOrgAll)
if (localData?.createdat && localData.data.length > 0 && now - 43200000 < localData.createdat) {
this.customerOrgAll = localData.data
this.customerOrg = this.customerOrgAll.slice(0,20)
} else {
postapi("/api/app/CustomerOrg/GetParentCustomerOrgSimple",{isPerson:'N'}).then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
// let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId);
// if (lfind > -1) this.customerOrgAll.splice(lfind, 1);
this.customerOrg = deepCopy(this.customerOrgAll);
setDBCom('orgDatas1', this.customerOrgAll) //
}
});
this.getOrg1Api()
}
})
.catch(err => {
console.error(err)
this.getOrg1Api()
})
},
getOrg1Api() {
postapi("/api/app/CustomerOrg/GetParentCustomerOrgSimple", { isPerson: 'N' }).then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
// 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) //
}
});
},
@ -446,6 +451,9 @@ export default {
filterMethod(keyWords) {
if (keyWords) {
let org = this.customerOrgAll.filter(e => {
})
this.customerOrg = [];
this.customerOrgAll.forEach((item) => {
if (
@ -457,8 +465,9 @@ export default {
}
});
} else {
this.customerOrg = deepCopy(this.customerOrgAll);
this.customerOrg = this.customerOrgAll.slice(0,20);
}
},
//

Loading…
Cancel
Save