From d6ecf4d6027f1c49aff6abf4e5388c72c97e4792 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Tue, 7 May 2024 21:26:26 +0800 Subject: [PATCH] doctor --- src/components/doctorCheck/CheckItemList.vue | 32 ++-- .../doctorCheck/RegisterCheckList.vue | 140 +++++++++++++----- src/utlis/proFunc.js | 75 +++++----- src/views/doctorCheck/doctorCheck.vue | 2 +- 4 files changed, 155 insertions(+), 94 deletions(-) diff --git a/src/components/doctorCheck/CheckItemList.vue b/src/components/doctorCheck/CheckItemList.vue index 36ec4d1..accba78 100644 --- a/src/components/doctorCheck/CheckItemList.vue +++ b/src/components/doctorCheck/CheckItemList.vue @@ -1,5 +1,6 @@ - +
@@ -34,21 +35,24 @@
- {{ item.result }} + {{ + item.result }}
特殊符号:
- + {{ item.displayName }}
录入结果:
- +
确 定 @@ -71,7 +75,7 @@ export default { return { resultStatus: [], //结果状态提示数据 tipsNormal: { - id:'01', + id: '01', displayName: "正常", dataInputPrompt: "正常", reportPrompt: "正常", @@ -108,12 +112,12 @@ export default { }; }, - created() { + created() { this.dictInit() }, //挂载完成 - mounted() { + mounted() { this.checkItemList(this.dataTransOpts.tableS.register_check.id); }, @@ -430,12 +434,12 @@ export default { // console.log("checkItemList", res.data); if (res && res.code > -1) { this.doctorCheck.checkItemList = res.data; - this.doctorCheck.checkItemList.forEach((e, i) => { - if(this.doctorCheck.RegisterCheckEdit.completeFlag == '0'){ + this.doctorCheck.checkItemList.forEach((e, i) => { + if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') { this.madeTooltips(i) - }else{ - let lfind = arrayExistObj(this.resultStatus,'id',e.resultStatusId) - if(lfind > -1){ + } else { + let lfind = arrayExistObj(this.resultStatus, 'id', e.resultStatusId) + if (lfind > -1) { e.class = this.resultStatus[lfind].tooltips } } @@ -662,7 +666,7 @@ export default { font-family: "Microsoft YaHei"; } -::v-deep .commonFont .el-textarea__inner{ +::v-deep .commonFont .el-textarea__inner { font-family: "Microsoft YaHei"; } diff --git a/src/components/doctorCheck/RegisterCheckList.vue b/src/components/doctorCheck/RegisterCheckList.vue index c38e1a2..1a1fea0 100644 --- a/src/components/doctorCheck/RegisterCheckList.vue +++ b/src/components/doctorCheck/RegisterCheckList.vue @@ -1,28 +1,61 @@ - + \ No newline at end of file diff --git a/src/utlis/proFunc.js b/src/utlis/proFunc.js index 5b016db..b7b4601 100644 --- a/src/utlis/proFunc.js +++ b/src/utlis/proFunc.js @@ -329,52 +329,51 @@ exports.getColorStr = getColorStr; //对象数组排序 keyObjs示例:[{ colName: 'id', sortType: 'A' },] sortType: A/D(ASC/DESC) //简单数组排序 arr.sort(a-b) 升序,arr.sort(b-a) function listOrderBy(arr, keyObjs) { - if (!arr || arr.length < 2) return arr + if (!arr || (Array.isArray(arr) && arr.length < 2)) return arr let arrCount = arr.length - let lkeyObjs = keyObjs + let lKeyObjs = keyObjs + let sortType = 'A' //默认升序排序 if (typeof keyObjs !== 'object') { - lkeyObjs = keyObjs.split(',') + lKeyObjs = [] + let colNames = keyObjs.split(',') + colNames.forEach(colName => { + lKeyObjs.push({colName,sortType}) + }); } - if (!lkeyObjs || lkeyObjs.length < 1) return arr - let temp = null - let sortType = 'A' //默认升序排序 + + if (!(Array.isArray(lKeyObjs) && lKeyObjs.length > 0)) return arr + + let temp = null try { for (let i = 0; i < arrCount; i++) { for (let j = 0; j < arrCount - 1; j++) { - for (let k = 0; k < lkeyObjs.length; k++) { - sortType = lkeyObjs[k][1] || 'A' - if (k == 0) { - if (sortType == 'A') { - if (arr[j][lkeyObjs[k][0]] > arr[j + 1][lkeyObjs[k][0]]) { - temp = deepCopy(arr[j]) - arr[j] = deepCopy(arr[j + 1]) - arr[j + 1] = deepCopy(temp) - } - } else { - if (arr[j][lkeyObjs[k][0]] < arr[j + 1][lkeyObjs[k][0]]) { - temp = deepCopy(arr[j]) - arr[j] = deepCopy(arr[j + 1]) - arr[j + 1] = deepCopy(temp) - } - } - } else { - if (arr[j][lkeyObjs[k - 1][0]] != arr[j + 1][lkeyObjs[k - 1][0]]) break; - if (sortType == 'A') { - if (arr[j][lkeyObjs[k][0]] > arr[j + 1][lkeyObjs[k][0]]) { - temp = deepCopy(arr[j]) - arr[j] = deepCopy(arr[j + 1]) - arr[j + 1] = deepCopy(temp) - } - } else { - if (arr[j][lkeyObjs[k][0]] < arr[j + 1][lkeyObjs[k][0]]) { - temp = deepCopy(arr[j]) - arr[j] = deepCopy(arr[j + 1]) - arr[j + 1] = deepCopy(temp) - } - } - } + for (let k = 0; k < lKeyObjs.length; k++) { + sortType = lKeyObjs[k]['sortType'] || 'A' + if (sortType == 'A'){ + if (arr[j][lKeyObjs[k]['colName']] > arr[j + 1][lKeyObjs[k]['colName']]) { + temp = deepCopy(arr[j]) + arr[j] = deepCopy(arr[j + 1]) + arr[j + 1] = deepCopy(temp) + break; + }else if(arr[j][lKeyObjs[k]['colName']] < arr[j + 1][lKeyObjs[k]['colName']]){ + break; + }else{ + continue + } + }else{ + if (arr[j][lKeyObjs[k]['colName']] < arr[j + 1][lKeyObjs[k]['colName']]) { + temp = deepCopy(arr[j]) + arr[j] = deepCopy(arr[j + 1]) + arr[j + 1] = deepCopy(temp) + break; + }else if(arr[j][lKeyObjs[k]['colName']] > arr[j + 1][lKeyObjs[k]['colName']]){ + break; + }else{ + continue + } + } } } } diff --git a/src/views/doctorCheck/doctorCheck.vue b/src/views/doctorCheck/doctorCheck.vue index c080e55..5046819 100644 --- a/src/views/doctorCheck/doctorCheck.vue +++ b/src/views/doctorCheck/doctorCheck.vue @@ -514,7 +514,7 @@ export default { // } let checkDate = this.doctorCheck.RegisterCheckEdit.checkDate || new Date(); checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD HH:mm:ss'); //yyyy-MM-DD HH:mm:ss - let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || window.sessionStorage.getItem("user"); + let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || null; let registerCheckId = this.doctorCheck.RegisterCheckEdit.id // 明细 let registerCheckItems = []