-
常见原因
+
+
常见原因
+ :data="scope.row.commonReasons" border @row-click="rowClickSug1" :show-header="false">
{{ scope2.$index + 1 }}).
@@ -103,21 +117,21 @@
-
+
-
-
-
健康指导
+
+
健康指导
+ :data="scope.row.healthGuidances" border @row-click="rowClickSug2" :show-header="false">
{{ scope2.$index + 1 }}).
@@ -131,20 +145,17 @@
-
+
-
-
-
@@ -167,7 +178,8 @@ export default {
privs: [] // 页面权限
},
sumDetails: [],
- sugDetails: [],
+ suggestionCurRow:0, //当前操作建议的行
+ diagnosises:[], // 诊断
};
},
@@ -231,39 +243,34 @@ export default {
this.sumDoctorCheck.summaryList = [];
return
}
- // [
- // {
- // "id": "3a0c5bbb-dfea-eec1-ed37-78203086987c",
- // "patientRegisterId": "3a0c5b73-0b3a-fe97-88b7-b47b18424136",
- // "summaryTitle": "血常规",
- // "summaryFlag": null,
- // "displayOrder": 0,
- // "details": [
- // {
- // "sumSummaryHeaderId": "3a0c6589-9b6f-bbb1-bb8b-d6876ea5e4e6",
- // "summaryContent": "重度肥胖",
- // "displayOrder": 1
- // }
- // ]
- // },
- // ]
- console.log(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`)
- getapi(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`)
+
+ // 旧接口: console.log(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`)
+ let body = {
+ patientRegisterId: RegisterId,
+ isGetExistData: 'Y',
+ }
+ postapi('/api/app/sumsummaryheader/getsumsummarylist', body)
.then((res) => {
console.log("summaryList", res.data);
if (res.code > -1) {
let summaryList = []
- res.data.forEach(e => {
+ res.data.forEach((e, i) => {
let details = []
- e.details.forEach(e2 => {
- details.push({ summaryContent: ' ' })
+ e.details.forEach((e2, i2) => {
+ details.push({ id: `summaryDetails_${i2}`, summaryContent: ' ' })
});
- summaryList.push({ id: e.id, summaryTitle: ' ', details })
+ summaryList.push({ id: `summary_${i}`, summaryTitle: ' ', details })
});
this.sumDoctorCheck.summaryList = deepCopy(summaryList)
// 自动高度有问题,需要这样处理一下
setTimeout(() => {
this.sumDoctorCheck.summaryList = deepCopy(res.data);
+ this.sumDoctorCheck.summaryList.forEach((e, i) => {
+ e.id = `summary_${i}`
+ e.details.forEach((e2, i2) => {
+ e2.id = `summaryDetails_${i2}`
+ });
+ });
}, 10);
// this.sumDoctorCheck.summaryList = res.data;
// this.textareaResize()
@@ -280,28 +287,43 @@ export default {
this.sumDoctorCheck.suggestionList = [];
return;
};
- // [
- // {
- // "id": "3a0c6589-9b6f-bbb1-bb8b-d6876ea5e4e6",
- // "patientRegisterId": "3a0c6589-99bb-5518-a196-4cf094b44e9a",
- // "suggestionTitle": "身高体重",
- // "suggestionFlag": null,
- // "displayOrder": 0,
- // "details": [
- // {
- // "sumSuggestionHeaderId": "3a0c6589-9b6f-bbb1-bb8b-d6876ea5e4e6",
- // "suggestionContent": "控制饮食,少盐少油少糖少脂;\n加强锻炼。",
- // "displayOrder": 1
- // }
- // ]
- // },
- // ]
- console.log(`/api/app/sumsuggestionheader/getsumsuggestionlist?PatientRegisterId=${RegisterId}`)
- getapi(`/api/app/sumsuggestionheader/getsumsuggestionlist?PatientRegisterId=${RegisterId}`)
+
+ // {
+ // "patientRegisterId": "3a11ee70-02cb-c5e6-a087-79ecdd0356b6",
+ // "isGetExistData": "Y"
+ // }
+ let body = {
+ patientRegisterId: RegisterId,
+ isGetExistData: 'Y',
+ }
+ // 旧接口: console.log(`/api/app/sumsuggestionheader/getsumsuggestionlist?PatientRegisterId=${RegisterId}`)
+ postapi('/api/app/sumsuggestionheader/getsumsuggestionlist', body)
.then((res) => {
console.log("suggestionList", res.data);
- if (res.code != -1) {
+ if (res.code > -1) {
this.sumDoctorCheck.suggestionList = res.data;
+ // 处理拖动排序使用
+ this.sumDoctorCheck.suggestionList.forEach((e, i) => {
+ e.id = `suggestion_${i}`
+ if (e.medicalInterpretations) {
+ e.medicalInterpretations.forEach((e0, i0) => {
+ e0.sumSuggestionHeaderId = `suggestion_${i}`
+ e0.id = `medicalInterpretations_${i0}`
+ });
+ }
+ if (e.commonReasons) {
+ e.commonReasons.forEach((e0, i0) => {
+ e0.sumSuggestionHeaderId = `suggestion_${i}`
+ e0.id = `commonReasons_${i0}`
+ });
+ }
+ if (e.healthGuidances) {
+ e.healthGuidances.forEach((e0, i0) => {
+ e0.sumSuggestionHeaderId = `suggestion_${i}`
+ e0.id = `healthGuidances_${i0}`
+ });
+ }
+ });
}
})
.catch((err) => {
@@ -309,13 +331,102 @@ export default {
});
},
+ // 诊断选择
+ changeDiagnosis(v){
+ console.log('changeDiagnosis',v)
+ let suggestionTitle = []
+ if(v.length == 0){
+ this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['suggestionTitle'] = ''
+ return
+ }
+ //先找到是操作的建议行
+ let lv = `${v}`
+ let suggestionList = deepCopy(this.sumDoctorCheck.suggestionList)
+ suggestionList.forEach(e => {
+ e.diagnosisIds = `${e.diagnosisIds}`
+ });
+ let lfind = arrayExistObj(suggestionList,'diagnosisIds',lv)
+ if(lfind == -1) return
+ this.suggestionCurRow = lfind
+ let sumSuggestionHeaderId = this.sumDoctorCheck.suggestionList[lfind].id
+ v.forEach(e => {
+ let ld = arrayExistObj(this.diagnosises,'id',e)
+ if(ld > -1){
+ suggestionTitle.push(this.diagnosises[ld]["displayName"])
+ //添加医学解释
+ let medicalInterpretations = this.diagnosises[ld]['medicalInterpretations']
+ if(medicalInterpretations){
+ if(!this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations']) this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations'] = []
+ medicalInterpretations.forEach(e2 => {
+ let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations'],"suggestionContent",e2.suggestionContent)
+ if(lf == -1){
+ this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations'].push({
+ sumSuggestionHeaderId,
+ suggestionContent:e2.suggestionContent,
+ displayOrder: Math.random(),
+ })
+ }
+ });
+ }
+
+ //添加常见原因
+ let commonReasons = this.diagnosises[ld]['commonReasons']
+ if(commonReasons){
+ if(!this.sumDoctorCheck.suggestionList[lfind]['commonReasons']) this.sumDoctorCheck.suggestionList[lfind]['commonReasons'] = []
+ commonReasons.forEach(e2 => {
+ let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[lfind]['commonReasons'],"suggestionContent",e2.suggestionContent)
+ if(lf == -1){
+ this.sumDoctorCheck.suggestionList[lfind]['commonReasons'].push({
+ sumSuggestionHeaderId,
+ suggestionContent:e2.suggestionContent,
+ displayOrder: Math.random(),
+ })
+ }
+ });
+ }
+
+ //添加常见原因
+ let healthGuidances = this.diagnosises[ld]['healthGuidances']
+ if(healthGuidances){
+ if(!this.sumDoctorCheck.suggestionList[lfind]['healthGuidances']) this.sumDoctorCheck.suggestionList[lfind]['healthGuidances'] = []
+ healthGuidances.forEach(e2 => {
+ let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[lfind]['healthGuidances'],"suggestionContent",e2.suggestionContent)
+ if(lf == -1){
+ this.sumDoctorCheck.suggestionList[lfind]['healthGuidances'].push({
+ sumSuggestionHeaderId,
+ suggestionContent:e2.suggestionContent,
+ displayOrder: Math.random(),
+ })
+ }
+ });
+ }
+ }
+ });
+ this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['suggestionTitle'] = `${suggestionTitle}`
+ },
+
//增加建议明细
- addSug(index) {
- this.sumDoctorCheck.suggestionList[index].details.push({
- sumSuggestionHeaderId: this.sumDoctorCheck.suggestionList[index].id,
+ addSug(index, contentType) {
+ this.suggestionCurRow = index
+
+ let lcontentType = 'healthGuidances'
+ switch (contentType) {
+ case 0:
+ lcontentType = 'medicalInterpretations'
+ break;
+ case 1:
+ lcontentType = 'commonReasons'
+ break;
+ default:
+ break;
+ }
+ if (!this.sumDoctorCheck.suggestionList[index][lcontentType]) this.sumDoctorCheck.suggestionList[index][lcontentType] = []
+ this.sumDoctorCheck.suggestionList[index][lcontentType].push({
+ sumSuggestionHeaderId: this.sumDoctorCheck.suggestionList[index].id, // 拖拽用到
suggestionContent: '',
displayOrder: Math.random(),
})
+ console.log('this.sumDoctorCheck.suggestionList', index, this.sumDoctorCheck.suggestionList)
},
//删除建议头及明细
@@ -400,25 +511,47 @@ export default {
return el
},
- rowClickSug(row,contentType) {
- console.log('rowClick row', row,contentType)
+ rowClickSug0(row) {
+ this.rowClickSug(row, 0)
+ },
+ rowClickSug1(row) {
+ this.rowClickSug(row, 1)
+ },
+ rowClickSug2(row) {
+ this.rowClickSug(row, 2)
+ },
+
+ rowClickSug(row, contentType) {
+ console.log('rowClick row', row, contentType)
+ let lcontentType = 'healthGuidances'
+ switch (contentType) {
+ case 0:
+ lcontentType = 'medicalInterpretations'
+ break;
+ case 1:
+ lcontentType = 'commonReasons'
+ break;
+ default:
+ break;
+ }
let lfind = arrayExistObj(this.sumDoctorCheck.suggestionList, 'id', row.sumSuggestionHeaderId)
if (lfind > -1) {
- this.sugDetails = this.sumDoctorCheck.suggestionList[lfind].details
- this.rowDropSugDetail(contentType,row.sumSuggestionHeaderId)
+ this.sugDetails = this.sumDoctorCheck.suggestionList[lfind][lcontentType]
+ this.rowDropSugDetail(contentType, row.sumSuggestionHeaderId)
}
- console.log('this.sumDetails', this.sugDetails)
+ console.log('this.sumDetails', lfind, this.sugDetails)
},
//建议明细拖拽
- rowDropSugDetail(contentType,id) {
+ rowDropSugDetail(contentType, id) {
this.$nextTick(() => {
const fEl = document.getElementById(`${contentType}_sug${id}`) // document.querySelector(`#${id} tbody`) querySelector为静态方法不支持动态传参;
console.log('rowDropSumDetail tbody', fEl, fEl.children) //el.childNodes,el.children
const el = this.findEl(fEl, 'TBODY')
console.log('rowDropSumDetail tbody', el) //el.childNodes,el.children
const that = this;
- Sortable.create(el, {
+ if (this.detailsDrag) this.detailsDrag.destroy()
+ this.detailsDrag = Sortable.create(el, {
animation: 150, // ms, number 单位:ms,定义排序动画的时间
//拖拽结束
onEnd({ newIndex, oldIndex }) {
diff --git a/src/store/index.js b/src/store/index.js
index 7f62684..91b52dc 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -235,7 +235,7 @@ export default new Vuex.Store({
//支付方式,比如是0自费、2免费、1单位支付
{ id: "0", displayName: "个人支付" },
{ id: "1", displayName: "单位支付" },
- { id: "2", displayName: "赠送" },
+ { id: "2", displayName: "免费" },
],
cardMode: [
{ id: "0", displayName: "充值卡" },