|
|
|
@ -42,7 +42,7 @@ |
|
|
|
</el-select> |
|
|
|
--> |
|
|
|
<el-cascader v-model="query.customerOrgIds" :options="customerOrgAll" |
|
|
|
style="width:400px;" filterable popper-class="example" |
|
|
|
style="width:500px;" filterable popper-class="example" |
|
|
|
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, leaf: 'isLeaf' }" |
|
|
|
size="small"> |
|
|
|
</el-cascader> |
|
|
|
@ -390,6 +390,7 @@ import { |
|
|
|
} from "@/utlis/proFunc"; |
|
|
|
import ElProgressOCX from "../../components/report/ElProgressOCX.vue"; |
|
|
|
import { setDBCom, getDBCom } from "../../utlis/indexedDB"; |
|
|
|
import { filterTreeNode, getTreePids } from "../../utlis/tree"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
@ -410,7 +411,7 @@ export default { |
|
|
|
mobileTelephone: "", |
|
|
|
}, //查询条件 |
|
|
|
|
|
|
|
customerOrg: [], |
|
|
|
customerOrgDisp: [], |
|
|
|
customerOrgAll: [], |
|
|
|
dictSalesman: [], |
|
|
|
|
|
|
|
@ -573,81 +574,7 @@ export default { |
|
|
|
dddw, |
|
|
|
moment, |
|
|
|
|
|
|
|
// 获取单位数据,并存入缓存 |
|
|
|
getOrgDatas() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
console.log('getOrgDatas', this.orgDatas.length) |
|
|
|
let url = '/api/app/CustomerOrg/GetSimpleByCodeAll' |
|
|
|
if (this.LocalConfig.patientRegister.dispCustomerOrgCode == 'Y') { |
|
|
|
url = "/api/app/customerorg/getbycodeall" |
|
|
|
getapi(url) |
|
|
|
.then((res) => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.orgDatas = res.data |
|
|
|
setDBCom('orgDatas', res.data) //存本地 |
|
|
|
resolve() |
|
|
|
} else { |
|
|
|
reject(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
reject(err) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
postapi(url) |
|
|
|
.then((res) => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.orgDatas = res.data |
|
|
|
setDBCom('orgDatas', res.data) |
|
|
|
resolve() |
|
|
|
} else { |
|
|
|
reject(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
reject(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 先从缓存处拿数据,拿不到再从数据库拉取 |
|
|
|
getCustomerOrgAll() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
getDBCom('orgDatas') |
|
|
|
.then(localData => { |
|
|
|
let now = Date.now() |
|
|
|
// 24小时 = 86400000 毫秒 |
|
|
|
if (localData?.createdat && now - 43200000 < localData.createdat) { |
|
|
|
this.orgDatas = localData.data |
|
|
|
} |
|
|
|
// console.log('this.orgDatas.length',this.orgDatas.length) |
|
|
|
if (this.orgDatas.length > 0) { |
|
|
|
let treeData = reMadeOrgTree(deepCopy(this.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.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) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
reject(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//初始化字典数据 |
|
|
|
dictInit() { |
|
|
|
let today = moment(new Date()).format("YYYY-MM-DD") |
|
|
|
@ -655,10 +582,10 @@ export default { |
|
|
|
this.query.endDate = today |
|
|
|
|
|
|
|
//获取单位列表 |
|
|
|
getapi("/api/app/customer-org/parent-all").then((res) => { |
|
|
|
postapi("/api/app/CustomerOrg/GetSimpleByCodeAll").then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.customerOrgAll = res.data; |
|
|
|
this.customerOrg = deepCopy(this.customerOrgAll); |
|
|
|
this.customerOrgAll = reMadeOrgTree(deepCopy(res.data), 'N') |
|
|
|
//this.customerOrgDisp = deepCopy(this.customerOrgAll).slice(0,10); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
@ -671,24 +598,22 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 单位过滤 |
|
|
|
filterMethod(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); |
|
|
|
} |
|
|
|
}); |
|
|
|
// 单位过滤 () |
|
|
|
filterMethod(node,value) { |
|
|
|
let org = [] |
|
|
|
if (value) { |
|
|
|
console.log('filterMethod.value',node,value) |
|
|
|
// org = this.customerOrgTreeAll.filter(e => { |
|
|
|
// return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1 |
|
|
|
// }) |
|
|
|
org = filterTreeNode(this.customerOrgAll, "treeChildren", ['label', 'simpleCode'], [value, value.toUpperCase()]) |
|
|
|
this.customerOrgDisp = org.slice(0, 10) |
|
|
|
} else { |
|
|
|
this.customerOrg = deepCopy(this.customerOrgAll); |
|
|
|
this.customerOrgDisp = this.customerOrgAll.slice(0, 10) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
btnExport(elId) { |
|
|
|
let tableDatas = deepCopy(this.dataList); |
|
|
|
tableDatas.forEach((e, index) => { |
|
|
|
|