From 4695a0f2db93f3de67e0d4582bb4aaadd6de7780 Mon Sep 17 00:00:00 2001 From: shidongli Date: Thu, 23 May 2024 15:48:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/manage/Datadetails/index.vue | 289 ++++++++++++++++++------- 1 file changed, 212 insertions(+), 77 deletions(-) diff --git a/src/views/manage/Datadetails/index.vue b/src/views/manage/Datadetails/index.vue index 7d097f9..a86fef6 100644 --- a/src/views/manage/Datadetails/index.vue +++ b/src/views/manage/Datadetails/index.vue @@ -13,7 +13,7 @@ >
- + @@ -25,6 +25,7 @@
-

{{ uitem.taskTypeName }}

+

{{ ulitem.taskTypeName }}

已审核 不同意未审核 -

{{ uitem.taskPartitionDictName }}

+

{{ ulitem.taskPartitionDictName }}

@@ -73,6 +76,7 @@ label-width="100px" v-for="(ite, ind) in item" :key="ind" + :rules="rules" > - - - - - - - - + + + + + + + + - - - - - + + + + + import { - selectTaskTypeList, taskPartitionList, taskStatusDictList, specialDiseaseNode, + selectTaskTypeList, taskPartitionList, taskStatusDictList, } from '@/api/system/specialDiseaseNode' -import { getAllNodeByPatient, getParams,inserList } from '@/api/manage/Datadetails' +import { getAllNodeByPatient, getParams, inserList } from '@/api/manage/Datadetails' import { listBaseDrug } from "@/api/system/baseDrug"; import { listBaseSport } from "@/api/system/baseSport"; import { listBaseDiet } from "@/api/system/baseDiet"; @@ -563,7 +627,6 @@ export default { pageSize: 10, drugName: null, }, - //运动 baseSportList: [], Sporttotal: 0, @@ -594,6 +657,7 @@ export default { pageSize: 10, nursingName: null, }, + itemdata: {}, // infolist: [], taskPartitionCode: "", @@ -633,7 +697,7 @@ export default { taskStatusDictList: [], //任务细分 taskPartitionList: [], - moban:[], + moban: [], }; }, created() { @@ -647,7 +711,6 @@ export default { mounted() { }, methods: { - // 左侧 getAllNodeBy() { const loading = this.$loading({ @@ -656,27 +719,88 @@ export default { spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); - setInterval(() => { + this.getAllNodeByPatientlist = [] + if (this.$route.query) { + getAllNodeByPatient(this.qurelist).then(res => { + // this.getAllNodeByPatientlist = res.data + loading.close(); + this.getAllNodeByPatientlist = this.handleData(res.data, 'routeNodeDay', 'routeNodeName') + console.log(this.getAllNodeByPatientlist, 'this.getAllNodeByPatientlist') + + + }) + } else { loading.close(); - }, 1500); - getAllNodeByPatient(this.qurelist).then(res => { - this.getAllNodeByPatientlist = res.data - }) + this.getAllNodeByPatientlist.push({ + routeNodeName: "", + routeNodeDay: "", + list: [ + { + routeCheckStatus: "AGREE", + routeId: '', + routeName: "", + routeNodeDay: "", + routeNodeId: "", + routeNodeName: "", + taskPartitionCode: "", + taskPartitionDictId: "", + taskPartitionDictName: "", + taskTypeCode: "", + taskTypeId: "", + taskTypeName: "", + }, + ], + }); + } + }, + handleData(list, key, keytwo) { + console.log(list, key, keytwo) + //得到数据的主键列表 + let keysArr = list.map((item) => { + return { + routeNodeDay: item[key], + routeNodeName: item[keytwo], + }; + }); + let array = keysArr.filter( + (item, index, arr) => + index === + arr.findIndex( + (ite) => + ite.routeNodeDay == item.routeNodeDay && + ite.routeNodeName == item.routeNodeName + ) + ); + let keys = [...new Set(array)]; + let newList = keys.map((item) => { + return { + //这里写新的 数据结构 如下是整体复制 + routeNodeDay: item[key], //1tian + routeNodeName: item[keytwo], + list: list.filter( + (i) => i[key] == item[key] && i[keytwo] == item[keytwo] + ), + }; + }); + return newList; }, getParams() { getParams(this.querytParams).then(res => { res.data.forEach(e => { e.forEach(el => { - el.patientId=this.$route.query.patientId - el.patientName=this.$route.query.patientName + el.patientId = this.$route.query.patientId + el.patientName = this.$route.query.patientName el.sn = Number(el.sn) }) }) - // this.moban= JSON.parse(JSON.stringify(res.data)) + this.moban = JSON.parse(JSON.stringify(res.data)) this.getParamslistData = res.data + }) + }, + // 药品列表 informationInfoinfo() { // this.informationqueryParams.pageNum = 1; @@ -735,17 +859,13 @@ export default { }, this.DiegetList() } else if (this.taskPartitionCode == 'TPC202405200006') {//居家护理 - this.NursingParams = { pageNum: 1, pageSize: 10, nursingName: null, } this.NursinggetList() - } - - }, // 药品名称关闭 innerVisiblecancel() { @@ -756,55 +876,65 @@ export default { }, // 圆点按钮 nurseclick(row) { - console.log(row) - console.log(this.getParamslistData,'.---666666') - // const newdata=JSON.parse(JSON.stringify(this.getParamslistData)) - this.getParamslistData[this.indexdata].forEach(el => { - console.log(row[el.paramKey], 'row[el.paramKey]----------') - el.paramValue = row[el.paramKey] - }) + this.getParamslistData[this.indexdata].forEach(el => { + console.log(row[el.paramKey], 'row[el.paramKey]----------') + el.paramValue = row[el.paramKey] + }) this.Drugshow = false this.Sportshow = false this.Dieshow = false this.Nursingshow = false - }, //保存 TemporaryStorage() { - console.log(this.getParamslistData, 'getParamslistData') - // return - this.$confirm('是否确认提交?', '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - }).then(() => { - const loading = this.$loading({ - lock: true, - text: '提交中', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); - - inserList(this.getParamslistData).then(res => { - this.getAllNodeBy(); - loading.close(); - this.$modal.msgSuccess("提交成功!"); + var emptyItems = [] + emptyItems = this.getParamslistData.flat().filter(f => f.paramValue == "") + this.getParamslistData.forEach(e => { + e.forEach(el => { + el.routeId = this.itemdata.routeId + el.routeName = this.itemdata.routeName + el.routeNodeId = this.querytParams.id + el.routeNodeName = this.itemdata.routeNodeName + el.taskPartitionCode = this.itemdata.taskPartitionCode + el.taskPartitionDictId = this.itemdata.taskPartitionDictId + el.taskPartitionDictName = this.itemdata.taskPartitionDictName + el.taskTypeCode = this.itemdata.taskTypeCode + el.taskTypeId = this.itemdata.taskTypeId + el.taskTypeName = this.itemdata.taskTypeName }) - setTimeout(() => { - loading.close(); - }, 3000); }) + // return + if (emptyItems && emptyItems.length > 0) { + this.$modal.msgError("请填写完整,再进行提交"); + } else { + this.$confirm('是否确认提交?', '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + }).then(() => { + const loading = this.$loading({ + lock: true, + text: '提交中', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + inserList(this.getParamslistData).then(res => { + this.getAllNodeBy(); + this.$modal.msgSuccess("提交成功!"); + loading.close(); + }) + }) + } }, - bottomclickevent(uitem, uindex) { - console.log(uitem, 'uitem') - this.taskPartitionCode = uitem.taskPartitionCode - // this.$refs.wangeditor.emit() - // this.form = uitem + bottomclickevent(ulitem,uindex,ulindex) { + console.log(ulitem,uindex,ulindex) + this.itemdata = ulitem this.taskPartitionList = [] - this.querytParams.id = uitem.routeNodeId - + this.querytParams.id = ulitem.routeNodeId this.getParamslistData = [] this.getParams() this.listindex = uindex + this.itemindex = ulindex; + this.taskPartitionCode = ulitem.taskPartitionCode }, //任务类型 任务状态 taskinfo() { @@ -865,20 +995,25 @@ export default { this.Nursingshow = true this.NursinggetList() } - this.indexdata=index + this.indexdata = index console.log(item, index) }, additem(index) { - // console.log(this.moban,'打印模版') - // const newVal = JSON.parse(JSON.stringify(this.moban[0])) - const newVal = JSON.parse(JSON.stringify(this.getParamslistData[0])) + console.log(this.moban[0],'打印模版') + this.moban[0].forEach(e=>{ + console.log(e,'099999999999') + e.paramValue="" + + }) + const newVal = JSON.parse(JSON.stringify(this.moban[0])) + + // const newVal = JSON.parse(JSON.stringify(this.getParamslistData[0])) newVal.forEach(i => { // i.sn = this.getParamslistData.length +1 i.sn = this.getParamslistData[this.getParamslistData.length - 1][0].sn + 1 }) this.getParamslistData.push(newVal) - // this.getParamslistData.push(this.getParamslistData[0]) console.log(this.getParamslistData, '00000000000') }, delitem(index, item) {