pengjun 2 years ago
parent
commit
6601130f62
  1. 119
      src/components/sumDoctorCheck/SumSug.vue

119
src/components/sumDoctorCheck/SumSug.vue

@ -1,9 +1,9 @@
<template> <template>
<div style="display: flex;"> <div style="display: flex;">
<div style="width:50%;"> <div style="width:50%;">
<el-table id="tableSummary" row-key="id" :data="sumDoctorCheck.summaryList" width="100%"
:height="sumHeight" border size="small">
<el-table-column type="index" width="20" align="center"/>
<el-table id="tableSummary" row-key="id" :data="sumDoctorCheck.summaryList" width="100%" :height="sumHeight" border
size="small">
<el-table-column type="index" width="20" align="center" />
<el-table-column prop="summaryTitle" label="综述"> <el-table-column prop="summaryTitle" label="综述">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
@ -12,13 +12,14 @@
:data="scope.row.details" border @row-click="rowClick" :show-header="false"> :data="scope.row.details" border @row-click="rowClick" :show-header="false">
<el-table-column width="30"> <el-table-column width="30">
<template slot-scope="scope2"> <template slot-scope="scope2">
<div>{{ scope2.$index + 1 }}).</div>
<div>{{ scope2.$index + 1 }})</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="summaryContent" label="综述" min-width="200"> <el-table-column prop="summaryContent" label="综述" min-width="200">
<template slot-scope="scope2"> <template slot-scope="scope2">
<el-input type="textarea" v-model="scope2.row.summaryContent" placeholder="请输入综述"
disabled :autosize="{ minRows: 1, maxRows: 100 }">
<!--:autosize="{ minRows: 1, maxRows: 20 } "-->
<el-input type="textarea" v-model="scope2.row.summaryContent" placeholder="请输入综述" disabled
:autosize="{ minRows: 1, maxRows: 20 }">
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -30,8 +31,8 @@
</el-table> </el-table>
</div> </div>
<div style="width:50%;"> <div style="width:50%;">
<el-table id="tableSuggestion" row-key="id" :data="sumDoctorCheck.suggestionList" width="100%"
:height="sumHeight" border size="small">
<el-table id="tableSuggestion" row-key="id" :data="sumDoctorCheck.suggestionList" width="100%" :height="sumHeight"
border size="small">
<el-table-column type="index" width="20" align="center"> <el-table-column type="index" width="20" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="suggestionTitle" label="建议"> <el-table-column prop="suggestionTitle" label="建议">
@ -42,15 +43,16 @@
:disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"> :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'">
</el-input> </el-input>
<el-button v-show="checkPagePriv(pagePriv.privs,'新增建议明细')" type="success" icon="el-icon-plus" style="min-width:23px;height:23px;padding:2px;" @click="addSug(scope.$index)"
<el-button v-show="checkPagePriv(pagePriv.privs, '新增建议明细')" type="success" icon="el-icon-plus"
style="min-width:23px;height:23px;padding:2px;" @click="addSug(scope.$index)"
:disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"></el-button> :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"></el-button>
<el-button v-show="checkPagePriv(pagePriv.privs,'删除建议')" type="danger" icon="el-icon-delete" style="margin-left: 2px;min-width:23px;height:23px;padding:2px;" @click="delSugHead(scope.$index)"
<el-button v-show="checkPagePriv(pagePriv.privs, '删除建议')" type="danger" icon="el-icon-delete"
style="margin-left: 2px;min-width:23px;height:23px;padding:2px;" @click="delSugHead(scope.$index)"
:disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"></el-button> :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"></el-button>
</div> </div>
<el-table :id="'sug' + scope.row.id" row-key="displayOrder" style="margin-left: 10px;" <el-table :id="'sug' + scope.row.id" row-key="displayOrder" style="margin-left: 10px;"
:data="scope.row.details" border @row-click="rowClickSug" :show-header="false"
>
:data="scope.row.details" border @row-click="rowClickSug" :show-header="false">
<el-table-column width="30"> <el-table-column width="30">
<template slot-scope="scope2"> <template slot-scope="scope2">
<div>{{ scope2.$index + 1 }}).</div> <div>{{ scope2.$index + 1 }}).</div>
@ -60,13 +62,15 @@
<template slot-scope="scope2"> <template slot-scope="scope2">
<el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入建议内容" <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入建议内容"
:disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'" :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
:autosize="{ minRows: 1, maxRows: 100 }" >
:autosize="{ minRows: 1, maxRows: 10 }">
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="suggestionContent" label="操作" width="35"> <el-table-column prop="suggestionContent" label="操作" width="35">
<template slot-scope="scope2"> <template slot-scope="scope2">
<el-button v-show="checkPagePriv(pagePriv.privs,'删除建议明细')" type="danger" style="min-width:23px;height:23px;padding:2px;" icon="el-icon-delete" @click="delSug(scope.row.details, scope2.$index)"
<el-button v-show="checkPagePriv(pagePriv.privs, '删除建议明细')" type="danger"
style="min-width:23px;height:23px;padding:2px;" icon="el-icon-delete"
@click="delSug(scope.row.details, scope2.$index)"
:disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'" :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
size="small"></el-button> size="small"></el-button>
</template> </template>
@ -83,15 +87,15 @@
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import Sortable from "sortablejs"; import Sortable from "sortablejs";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { getPagePriv,checkPagePriv,deepCopy,arrayExistObj } from '../../utlis/proFunc';
import { getPagePriv, checkPagePriv, deepCopy, arrayExistObj } from '../../utlis/proFunc';
export default { export default {
components: {}, components: {},
props:["patientRegisterId","curGetFocusSuggestionId"],
props: ["patientRegisterId", "curGetFocusSuggestionId"],
data() { data() {
return { return {
pagePriv:{
routeUrlorPageName:'sumDoctorCheck', //
privs:[] //
pagePriv: {
routeUrlorPageName: 'sumDoctorCheck', //
privs: [] //
}, },
sumDetails: [], sumDetails: [],
sugDetails: [], sugDetails: [],
@ -101,7 +105,7 @@ export default {
created() { created() {
// //
let userPriv = window.sessionStorage.getItem('userPriv') let userPriv = window.sessionStorage.getItem('userPriv')
if(userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
}, },
// //
@ -109,24 +113,44 @@ export default {
this.rowDrop(); this.rowDrop();
this.rowDropSuggestion(); this.rowDropSuggestion();
// document.addEventListener('DOMContentLoaded', function () {
// const textarea = document.querySelector('textarea');
// textarea.addEventListener('input', function () {
// //
// console.log('textarea.addEventListener',textarea.style.height)
// textarea.style.height = 'auto'; //
// // textarea.style.height = textarea.scrollHeight + 'px'; //
// });
// });
this.summaryList(this.dataTransOpts.tableS.patient_register.id) this.summaryList(this.dataTransOpts.tableS.patient_register.id)
this.suggestionList(this.dataTransOpts.tableS.patient_register.id) this.suggestionList(this.dataTransOpts.tableS.patient_register.id)
}, },
computed: { computed: {
...mapState(['window', 'dict','dataTransOpts', 'doctorCheck', 'sumDoctorCheck']),
...mapState(['window', 'dict', 'dataTransOpts', 'doctorCheck', 'sumDoctorCheck']),
sumHeight(){
let tempHeight = this.window.pageHeight < 600 ? 600:this.window.pageHeight
sumHeight() {
let tempHeight = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
return tempHeight - 335 return tempHeight - 335
}, },
}, },
methods: { methods: {
checkPagePriv, checkPagePriv,
// textareaResize() {
// const textarea = document.querySelectorAll('textarea');
// textarea.forEach(e => {
// e.style.height = 'auto'; //
// });
// },
// //
summaryList(RegisterId) { summaryList(RegisterId) {
if(!RegisterId){
if (!RegisterId) {
this.sumDoctorCheck.summaryList = []; this.sumDoctorCheck.summaryList = [];
return return
} }
@ -150,8 +174,22 @@ export default {
getapi(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`) getapi(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`)
.then((res) => { .then((res) => {
console.log("summaryList", res.data); console.log("summaryList", res.data);
if (res.code != -1) {
this.sumDoctorCheck.summaryList = res.data;
if (res.code > -1) {
let summaryList = []
res.data.forEach(e => {
let details = []
e.details.forEach(e2 => {
details.push({ summaryContent: ' ' })
});
summaryList.push({ id: e.id, summaryTitle: ' ', details })
});
this.sumDoctorCheck.summaryList = deepCopy(summaryList)
//
setTimeout(() => {
this.sumDoctorCheck.summaryList = deepCopy(res.data);
}, 10);
// this.sumDoctorCheck.summaryList = res.data;
// this.textareaResize()
} }
}) })
.catch((err) => { .catch((err) => {
@ -161,7 +199,7 @@ export default {
// //
suggestionList(RegisterId) { suggestionList(RegisterId) {
if(!RegisterId){
if (!RegisterId) {
this.sumDoctorCheck.suggestionList = []; this.sumDoctorCheck.suggestionList = [];
return; return;
}; };
@ -211,11 +249,11 @@ export default {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
// //
this.sumDoctorCheck.suggestionList.splice(index,1)
this.sumDoctorCheck.suggestionList.splice(index, 1)
}).catch((err) => { }).catch((err) => {
if(err == 'cancel'){
if (err == 'cancel') {
console.log(`已取消 ${err}`) console.log(`已取消 ${err}`)
}else{
} else {
this.$message.error(`操作失败 ${err}`) this.$message.error(`操作失败 ${err}`)
} }
}); });
@ -231,9 +269,9 @@ export default {
// //
details.splice(indexD, 1); details.splice(indexD, 1);
}).catch((err) => { }).catch((err) => {
if(err == 'cancel'){
if (err == 'cancel') {
console.log(`已取消 ${err}`) console.log(`已取消 ${err}`)
}else{
} else {
this.$message.error(`操作失败 ${err}`) this.$message.error(`操作失败 ${err}`)
} }
}); });
@ -356,7 +394,7 @@ export default {
// //
watch: { watch: {
// sumDoctor.M // sumDoctor.M
"dataTransOpts.refresh.sumDoctor.M":{
"dataTransOpts.refresh.sumDoctor.M": {
// immediate:true, // immediate:true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(`watch 总检--综述建议 newVal: ${newVal}, oldVal: ${oldVal} patientRegisterId: ${this.dataTransOpts.tableS.patient_register.id}`); console.log(`watch 总检--综述建议 newVal: ${newVal}, oldVal: ${oldVal} patientRegisterId: ${this.dataTransOpts.tableS.patient_register.id}`);
@ -366,11 +404,11 @@ export default {
}, },
// //
"curGetFocusSuggestionId":{
immediate:true,
"curGetFocusSuggestionId": {
immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(`watch curGetFocusSuggestionId newVal: ${newVal}, oldVal: ${oldVal}`); console.log(`watch curGetFocusSuggestionId newVal: ${newVal}, oldVal: ${oldVal}`);
if(newVal){
if (newVal) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[newVal].focus(); this.$refs[newVal].focus();
}); });
@ -385,20 +423,23 @@ export default {
/* 设置单元格内内容顶对齐 */ /* 设置单元格内内容顶对齐 */
::v-deep .el-table__cell { ::v-deep .el-table__cell {
display: table-cell; /* 使单元格表现为表格单元 */
vertical-align: top; /* 顶对齐 el-table_2_column_2 el-table__cell */
display: table-cell;
/* 使单元格表现为表格单元 */
vertical-align: top;
/* 顶对齐 el-table_2_column_2 el-table__cell */
} }
::v-deep .el-textarea__inner { ::v-deep .el-textarea__inner {
min-height: 23px; min-height: 23px;
height: 23px; height: 23px;
line-height: 1.25; line-height: 1.25;
padding: 1px 15px 1px 2px; padding: 1px 15px 1px 2px;
} }
::v-deep .el-input__inner { ::v-deep .el-input__inner {
min-height: 23px; min-height: 23px;
height: 23px; height: 23px;
padding: 1px 15px 1px 2px; padding: 1px 15px 1px 2px;
} }
</style> </style>
Loading…
Cancel
Save