pengjun 10 hours ago
parent
commit
95986d4724
  1. 71
      src/components/doctorCheck/CheckItemList.vue

71
src/components/doctorCheck/CheckItemList.vue

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<div @contextmenu.prevent="onContextmenu"> <div @contextmenu.prevent="onContextmenu">
<el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="itemTableHeight" border highlight-current-row
@row-click="itemRowClick" @row-dblclick="itemDblClick" size="small">
<el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="itemTableHeight" border
highlight-current-row @row-click="itemRowClick" @row-dblclick="itemDblClick" size="small">
<el-table-column prop="itemName" label="项目" min-width="160" /> <el-table-column prop="itemName" label="项目" min-width="160" />
<el-table-column prop="result" label="结果" min-width="420"> <el-table-column prop="result" label="结果" min-width="420">
<template slot-scope="scope"> <template slot-scope="scope">
@ -22,7 +22,7 @@
@click="btnPacsResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)" @click="btnPacsResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
size="small">P</el-button> size="small">P</el-button>
<el-button style="min-width: 23px; padding: 5.8px; margin-left: 2px" <el-button style="min-width: 23px; padding: 5.8px; margin-left: 2px"
:disabled="rowResultDisabled(scope.row)" @click="btnPacsRessulst(scope.row)" size="small">S</el-button>
:disabled="rowResultDisabled(scope.row)" @click="btnPacsRessulst(scope.row)" size="small">S</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -90,7 +90,7 @@
overflow-y: auto; overflow-y: auto;
height: 300px; height: 300px;
width: 100%; width: 100%;
display: ${LocalConfig.doctorCheck.resultModeDisp||'flex'};
display: ${LocalConfig.doctorCheck.resultModeDisp || 'flex'};
flex-wrap: wrap; flex-wrap: wrap;
align-content: flex-start;` align-content: flex-start;`
"> ">
@ -193,7 +193,7 @@ export default {
components: { components: {
PacsTemplate, PacsTemplate,
}, },
props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge","refParams"],
props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge", "refParams"],
data() { data() {
return { return {
pagePriv: { pagePriv: {
@ -228,7 +228,7 @@ export default {
currentRow: -1, // currentRow: -1, //
dialogWinMoreResult: false, dialogWinMoreResult: false,
dialogWinMoreResultTimes:0, //
dialogWinMoreResultTimes: 0, //
dialogWinPacsTemplate: false, dialogWinPacsTemplate: false,
moreResult: { moreResult: {
data: [], data: [],
@ -266,8 +266,8 @@ export default {
isSelectAll: 'N', // isSelectAll: 'N', //
pacsDescFontSize: "14px", // pacsDescFontSize: "14px", //
isSplitChooseResult: "Y", // isSplitChooseResult: "Y", //
hisItemRight:0, //
resultModeDisp:'flex', // flex block
hisItemRight: 0, //
resultModeDisp: 'flex', // flex block
} }
}, },
@ -330,11 +330,11 @@ export default {
this.userInfo.userId = window.sessionStorage.getItem("userId") || null; this.userInfo.userId = window.sessionStorage.getItem("userId") || null;
this.userInfo.user = window.sessionStorage.getItem("user") || null; this.userInfo.user = window.sessionStorage.getItem("user") || null;
}, },
// //
beforeDestroy(){
beforeDestroy() {
if (this.$peisAPI) { if (this.$peisAPI) {
try { try {
// //
@ -757,14 +757,14 @@ export default {
this.moreResult.result = row.result; this.moreResult.result = row.result;
this.moreResult.defaultResult = row.defaultResult; this.moreResult.defaultResult = row.defaultResult;
this.moreResult.index = index; this.moreResult.index = index;
if(!row?.result){
if (!row?.result) {
this.selection.start = 0 this.selection.start = 0
this.selection.end = 0 this.selection.end = 0
}else{
} else {
this.selection.start = row.result.length this.selection.start = row.result.length
this.selection.end = row.result.length this.selection.end = row.result.length
} }
console.log('显示模板初始光标',this.selection)
console.log('显示模板初始光标', this.selection)
// "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580", // "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580",
// "result": "00000", // "result": "00000",
// "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921", // "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921",
@ -776,11 +776,11 @@ export default {
this.dialogWinMoreResult = true; this.dialogWinMoreResult = true;
// //
if(this.dialogWinMoreResultTimes == 0){
if (this.dialogWinMoreResultTimes == 0) {
this.watchSelection(); this.watchSelection();
this.dialogWinMoreResultTimes++ // this.dialogWinMoreResultTimes++ //
} }
}, },
@ -829,22 +829,22 @@ export default {
// //
clickResult(item) { clickResult(item) {
let moreResult = this.moreResult.result || ''
let resultIsNum = /^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/.test(item.result);
let moreResult = this.moreResult.result || ''
let resultIsNum = /^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/.test(item.result);
// console.log('this.moreResult',JSON.stringify(this.moreResult)) // console.log('this.moreResult',JSON.stringify(this.moreResult))
// console.log('item',item) // console.log('item',item)
// == // ==
if (!moreResult || moreResult == this.moreResult.defaultResult ) {
if (!moreResult || moreResult == this.moreResult.defaultResult) {
this.moreResult.result = item.result this.moreResult.result = item.result
this.selection.start = item?.result.length||0
this.selection.start = item?.result.length || 0
this.selection.end = this.selection.start this.selection.end = this.selection.start
console.log('=默认结果光标',this.selection)
}else if(moreResult.includes(item.result) && !resultIsNum){
console.log('=默认结果光标', this.selection)
} else if (moreResult.includes(item.result) && !resultIsNum) {
// //
}else {
} else {
let choosedResult = item.result let choosedResult = item.result
if(this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult
if (this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult
this.insertSymbols(choosedResult) this.insertSymbols(choosedResult)
} }
@ -976,7 +976,7 @@ export default {
}); });
//console.log('this.doctorCheck.checkItemList',res.data) //console.log('this.doctorCheck.checkItemList',res.data)
this.doctorCheck.checkItemList = res.data; this.doctorCheck.checkItemList = res.data;
this.doctorCheck.checkItemList.forEach((e, i) => { this.doctorCheck.checkItemList.forEach((e, i) => {
if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") { if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") {
@ -993,7 +993,7 @@ export default {
} }
// //
if(i == 0){
if (i == 0) {
this.itemRowClick(e) this.itemRowClick(e)
} }
}); });
@ -1099,7 +1099,9 @@ export default {
// //
input.addEventListener("click", (event) => { input.addEventListener("click", (event) => {
if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') { if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') {
input.select();
//
//input.select();
if(input.getAttribute('placeholder') == "请输入结果值") input.select();
} }
}); });
}); });
@ -1122,27 +1124,34 @@ export default {
this.selection.end = this.selection.start; this.selection.end = this.selection.start;
//console.log('',this.selection) //console.log('',this.selection)
}, },
// //
getCaretPosition() { getCaretPosition() {
let input = document.getElementById("resultBox");
let input = document.getElementById("resultBox");
this.selection.start = input.selectionStart; this.selection.start = input.selectionStart;
this.selection.end = input.selectionEnd; this.selection.end = input.selectionEnd;
console.log('点击后光标',this.selection)
console.log('点击后光标', this.selection)
}, },
watchSelection() { watchSelection() {
this.$nextTick(() => { this.$nextTick(() => {
let that = this; let that = this;
let resultBox = document.getElementById("resultBox"); // //.inline-input let resultBox = document.getElementById("resultBox"); // //.inline-input
// //
resultBox.addEventListener("click", function (event) { resultBox.addEventListener("click", function (event) {
event.preventDefault(); event.preventDefault();
//
event.target.focus()
// //
that.getCaretPosition(); that.getCaretPosition();
}); });
resultBox.addEventListener("input", function (event) { resultBox.addEventListener("input", function (event) {
event.preventDefault(); event.preventDefault();
//
event.target.focus()
// //
that.getCaretPosition(); that.getCaretPosition();
}); });
@ -1228,7 +1237,7 @@ export default {
// //
onContextmenuTemplate(event) { onContextmenuTemplate(event) {
if (!this.$peisAPI) return if (!this.$peisAPI) return
let menus = [
let menus = [
// { label: '', itemId: '', enabled: true }, // { label: '', itemId: '', enabled: true },
// { // {
// label: '', // label: '',
@ -1357,7 +1366,7 @@ export default {
console.log( console.log(
`watch 检查明细 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.refParams.registerCheckId}` `watch 检查明细 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.refParams.registerCheckId}`
); );
this.getCheckItemList(this.refParams.registerCheckId);
this.getCheckItemList(this.refParams.registerCheckId);
}, },
}, },
}, },

Loading…
Cancel
Save