|
|
@@ -50,92 +50,16 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
-<!-- <el-form-item label="饮食类型" prop="dietaryType">-->
|
|
|
-<!-- <TgRadio-->
|
|
|
-<!-- v-model="dataForm.dietaryType"-->
|
|
|
-<!-- @change="(arg) => handleRadioChange(arg, 'dietaryType')"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.DIETARY_TYPE)"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-radio-->
|
|
|
-<!-- v-for="(item, index) in getStrDictOptions(DICT_TYPE.DIETARY_TYPE)"-->
|
|
|
-<!-- :key="index"-->
|
|
|
-<!-- :label="item.value"-->
|
|
|
-<!-- >{{ item.label }}</el-radio-->
|
|
|
-<!-- >-->
|
|
|
-<!-- </TgRadio>-->
|
|
|
-<!-- <input-->
|
|
|
-<!-- type="text"-->
|
|
|
-<!-- class="sInput"-->
|
|
|
-<!-- v-model="inputs.dietaryTypeInput"-->
|
|
|
-<!-- v-if="!isDetail"-->
|
|
|
-<!-- v-show="dataForm.dietaryType === '0'"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="饮食方式" prop="diet">-->
|
|
|
-<!-- <TgRadio-->
|
|
|
-<!-- v-model="dataForm.diet"-->
|
|
|
-<!-- @change="(arg) => handleRadioChange(arg, 'diet')"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.DIET_TYPE)"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-radio-->
|
|
|
-<!-- v-for="(item, index) in getStrDictOptions(DICT_TYPE.DIET_TYPE)"-->
|
|
|
-<!-- :key="index"-->
|
|
|
-<!-- :label="item.value"-->
|
|
|
-<!-- >{{ item.label }}</el-radio-->
|
|
|
-<!-- >-->
|
|
|
-<!-- </TgRadio>-->
|
|
|
-<!-- <input-->
|
|
|
-<!-- type="text"-->
|
|
|
-<!-- class="sInput"-->
|
|
|
-<!-- v-model="inputs.dietInput"-->
|
|
|
-<!-- v-if="!isDetail"-->
|
|
|
-<!-- v-show="dataForm.diet === '0'"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="饮食禁忌" prop="dietaryTaboo">-->
|
|
|
-<!-- <el-checkbox-group-->
|
|
|
-<!-- v-model="dataForm.dietaryTaboo"-->
|
|
|
-<!-- @change="(arg) => handleChange(arg, 'dietaryTaboo')"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.DIETARY_TABOO_TYPE)"-->
|
|
|
-<!-- v-if="!isDetail"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-checkbox-->
|
|
|
-<!-- v-for="(item, index) in getStrDictOptions(DICT_TYPE.DIETARY_TABOO_TYPE)"-->
|
|
|
-<!-- :label="item.value"-->
|
|
|
-<!-- :key="index"-->
|
|
|
-<!-- >{{ item.label }}</el-checkbox-->
|
|
|
-<!-- >-->
|
|
|
-<!-- </el-checkbox-group>-->
|
|
|
-<!-- <span v-else>{{ formatArr(DICT_TYPE.DIETARY_TABOO_TYPE, dataForm.dietaryTaboo) }}</span>-->
|
|
|
-<!-- <input-->
|
|
|
-<!-- type="text"-->
|
|
|
-<!-- class="sInput"-->
|
|
|
-<!-- v-model="inputs.dietaryTabooInput"-->
|
|
|
-<!-- v-if="!isDetail"-->
|
|
|
-<!-- v-show="dataForm.dietaryTaboo.includes('0')"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="风险防范" prop="riskPrevention">-->
|
|
|
-<!-- <TgTextarea v-model="dataForm.riskPrevention" placeholder="风险防范" :row="1" />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="照护特点" prop="nursingCharacteristics">-->
|
|
|
-<!-- <TgTextarea v-model="dataForm.nursingCharacteristics" placeholder="照护特点" :row="1" />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
<div class="info-title">护理项目</div>
|
|
|
<span v-show="dataForm.elderId">
|
|
|
-<!-- <el-button type="primary" link class="left" @click="openReport"-->
|
|
|
-<!-- >查看能力评估报告</el-button-->
|
|
|
-<!-- >-->
|
|
|
<el-button type="primary" class="left" @click="handleAdd" v-if="!isDetail">
|
|
|
<Icon icon="ep:zoom-in" class="mr-5px" />添加项目
|
|
|
</el-button>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="info-wrap">
|
|
|
-<!-- <span>护理套餐包</span>-->
|
|
|
<el-row>
|
|
|
<el-col
|
|
|
:xs="24"
|
|
|
@@ -146,130 +70,17 @@
|
|
|
v-for="(p, i) in dataForm.items"
|
|
|
:key="i"
|
|
|
>
|
|
|
- <el-row gutter="10">
|
|
|
- <el-col :span="8">
|
|
|
- <div class="border">
|
|
|
- <el-checkbox
|
|
|
- :label="p.nurseItemName"
|
|
|
- v-model="p.checked"
|
|
|
- @change="(arg) => handleChangeCheckBox(arg, p)"
|
|
|
- v-if="!isDetail"
|
|
|
- />
|
|
|
- <div v-else class="itemName">{{ p.nurseItemName }}</div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
-<!-- <el-col :span="4">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- :disabled="isDetail"-->
|
|
|
-<!-- v-model="p.frequency"-->
|
|
|
-<!-- placeholder="请输入频次"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <template #prepend>-->
|
|
|
-<!-- <el-text>频次</el-text>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-input>-->
|
|
|
-
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="6">-->
|
|
|
-<!-- <TgSelect-->
|
|
|
-<!-- placeholder="请选择频次单位"-->
|
|
|
-<!-- v-model="p.frequencyUnit"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.NURSING_FREQUENCY_TYPE)"-->
|
|
|
-<!-- :class="['itemName', { border: isDetail }]"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="(dict, d) in getStrDictOptions(DICT_TYPE.NURSING_FREQUENCY_TYPE)"-->
|
|
|
-<!-- :key="d"-->
|
|
|
-<!-- :label="dict.label"-->
|
|
|
-<!-- :value="dict.value"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </TgSelect>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="6">-->
|
|
|
-<!-- <TgSelect-->
|
|
|
-<!-- placeholder="请选择操作方式"-->
|
|
|
-<!-- v-model="p.operatingMode"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.NURSING_OPERATING)"-->
|
|
|
-<!-- :class="['itemName', { border: isDetail }]"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="(dict, d) in getStrDictOptions(DICT_TYPE.NURSING_OPERATING)"-->
|
|
|
-<!-- :key="d"-->
|
|
|
-<!-- :label="dict.label"-->
|
|
|
-<!-- :value="dict.value"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </TgSelect>-->
|
|
|
-<!-- </el-col>-->
|
|
|
- </el-row>
|
|
|
+ <div class="border">
|
|
|
+ <el-checkbox
|
|
|
+ :label="p.nurseItemName"
|
|
|
+ v-model="p.checked"
|
|
|
+ @change="(arg) => handleChangeCheckBox(arg, p)"
|
|
|
+ v-if="!isDetail"
|
|
|
+ />
|
|
|
+ <div v-else class="itemName">{{ p.nurseItemName }}</div>
|
|
|
+ </div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-<!-- <span>额外项目</span>-->
|
|
|
-<!-- <el-row :gutter="30">-->
|
|
|
-<!-- <el-col-->
|
|
|
-<!-- :xs="24"-->
|
|
|
-<!-- :sm="24"-->
|
|
|
-<!-- :md="24"-->
|
|
|
-<!-- :lg="12"-->
|
|
|
-<!-- class="mb5"-->
|
|
|
-<!-- v-for="(p, i) in dataForm.extraItems"-->
|
|
|
-<!-- :key="i"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-col :span="2" class="flex" v-if="!isDetail">-->
|
|
|
-<!-- <Icon-->
|
|
|
-<!-- class="mt1"-->
|
|
|
-<!-- :size="26"-->
|
|
|
-<!-- color="#f09d31"-->
|
|
|
-<!-- icon="ep:remove"-->
|
|
|
-<!-- @click="handleDelete(p)"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="isDetail ? 8 : 6">-->
|
|
|
-<!-- <div :class="['itemName border warning']">-->
|
|
|
-<!-- <span>{{ p.nurseItemName }}</span>-->
|
|
|
-<!-- <el-tag type="danger">{{ p.price ? formatNum(p.price) : 0 }}元</el-tag>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="4">-->
|
|
|
-<!-- <TgInputNumber-->
|
|
|
-<!-- placeholder="请输入频次"-->
|
|
|
-<!-- v-model="p.frequency"-->
|
|
|
-<!-- :class="['itemName extra', { border: isDetail }, { 'border-warning': isDetail }]"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="6">-->
|
|
|
-<!-- <TgSelect-->
|
|
|
-<!-- placeholder="请选择频次单位"-->
|
|
|
-<!-- v-model="p.frequencyUnit"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.NURSING_FREQUENCY_TYPE)"-->
|
|
|
-<!-- :class="['itemName extra', { border: isDetail }, { warning: isDetail }]"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="(dict, d) in getStrDictOptions(DICT_TYPE.NURSING_FREQUENCY_TYPE)"-->
|
|
|
-<!-- :key="d"-->
|
|
|
-<!-- :label="dict.label"-->
|
|
|
-<!-- :value="dict.value"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </TgSelect>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="6">-->
|
|
|
-<!-- <TgSelect-->
|
|
|
-<!-- placeholder="请选择操作方式"-->
|
|
|
-<!-- v-model="p.operatingMode"-->
|
|
|
-<!-- :list="getDictOptions(DICT_TYPE.NURSING_OPERATING)"-->
|
|
|
-<!-- :class="['itemName extra', { border: isDetail }, { warning: isDetail }]"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="(dict, d) in getStrDictOptions(DICT_TYPE.NURSING_OPERATING)"-->
|
|
|
-<!-- :key="d"-->
|
|
|
-<!-- :label="dict.label"-->
|
|
|
-<!-- :value="dict.value"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </TgSelect>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -280,26 +91,22 @@
|
|
|
</template>
|
|
|
</Dialog>
|
|
|
<lifeItem ref="itemRef" @success="getItemList" />
|
|
|
- <EvaluationDetail ref="reportRef" />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { DICT_TYPE, getDictOptions, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
import {
|
|
|
createNursingPlan,
|
|
|
updateNursingPlan,
|
|
|
- copyNursingPlan,
|
|
|
getNursingPlanById,
|
|
|
- getListByElderId,
|
|
|
findNurseItemListByName
|
|
|
} from '@/api/elderly/nursing'
|
|
|
-import EvaluationDetail from '@/views/elderly/assess/synthetic-ability/Detail.vue'
|
|
|
import lifeItem from './life-item-dialog.vue'
|
|
|
-import { formatNum } from '@/utils/formatter'
|
|
|
import { planType } from '../types'
|
|
|
+
|
|
|
defineOptions({ name: 'LifeCarePlanForm' })
|
|
|
-const message = useMessage() // 消息弹窗
|
|
|
+
|
|
|
const { t } = useI18n() // 国际化
|
|
|
+const message = useMessage() // 消息弹窗
|
|
|
const dialogVisible = ref(false)
|
|
|
const state = reactive<planType>({
|
|
|
dataForm: {
|
|
|
@@ -309,66 +116,44 @@ const state = reactive<planType>({
|
|
|
bedName: '',
|
|
|
nurseLevelName: '',
|
|
|
effectiveDate: '',
|
|
|
- diet: '',
|
|
|
- dietaryType: '',
|
|
|
- riskPrevention: '',
|
|
|
- nursingCharacteristics: '',
|
|
|
- dietaryTaboo: [],
|
|
|
items: [],
|
|
|
- extraItems: []
|
|
|
+ extraItems: [],
|
|
|
},
|
|
|
dataRule: {
|
|
|
elderId: [{ required: true, message: '长者姓名不能为空', trigger: 'blur' }],
|
|
|
effectiveDate: [{ required: true, message: '生效日期不能为空', trigger: 'blur' }]
|
|
|
},
|
|
|
- tempCopyForm: {
|
|
|
- items: [],
|
|
|
- extraItems: []
|
|
|
- }
|
|
|
})
|
|
|
-const { dataForm, dataRule, tempCopyForm } = toRefs(state)
|
|
|
+const { dataForm, dataRule } = toRefs(state)
|
|
|
const resetFormField = reactive({ ...dataForm.value })
|
|
|
const route = useRoute()
|
|
|
const formLoading = ref(false)
|
|
|
const isDetail = ref(false)
|
|
|
+
|
|
|
// 弹窗标题
|
|
|
const itemTitle = computed(() => {
|
|
|
- return isDetail.value ? '详情' : !dataForm.value.id ? (isCopy.value ? '复制' : '新增') : '修改'
|
|
|
+ return isDetail.value ? '详情' : !dataForm.value.id ? '新增' : '修改'
|
|
|
})
|
|
|
|
|
|
-const isCopy = ref(false)
|
|
|
-
|
|
|
/** 打开弹窗 */
|
|
|
-const open = async (id, detail, copy) => {
|
|
|
+const open = async (id, detail) => {
|
|
|
dataForm.value.id=''
|
|
|
dialogVisible.value = true
|
|
|
isDetail.value = detail
|
|
|
- isCopy.value = copy
|
|
|
if (id) {
|
|
|
const res = await getNursingPlanById(id)
|
|
|
- // 转换数据
|
|
|
- res.diet = convert(2, res.diet, 'dietInput')
|
|
|
- res.dietaryType = convert(2, res.dietaryType, 'dietaryTypeInput')
|
|
|
- res.dietaryTaboo = convert(1, res.dietaryTaboo, 'dietaryTabooInput')
|
|
|
- // 如果是复制就清空id和长者
|
|
|
- if (copy) {
|
|
|
- res.id = ''
|
|
|
- res.elderId = ''
|
|
|
- res.elderName = ''
|
|
|
- }
|
|
|
// 默认勾选护理项目
|
|
|
res.items.map((item) => {
|
|
|
item.checked = true
|
|
|
- if(copy){
|
|
|
- // 清空planId
|
|
|
- item.nursingPlanId = ''
|
|
|
- }
|
|
|
+ })
|
|
|
+ res.extraItems.map((item) => {
|
|
|
+ item.checked = true
|
|
|
})
|
|
|
// 匹配额外项目价格
|
|
|
dataForm.value = res
|
|
|
await formatExtraItem()
|
|
|
- tempCopyForm.value = JSON.parse(JSON.stringify(dataForm.value))
|
|
|
- console.log("tempCopyForm.value",tempCopyForm.value)
|
|
|
+ dataForm.value.items = res.items?.length > 0 ? res.items : res.extraItems
|
|
|
+ console.log('dataForm.value', dataForm.value)
|
|
|
}
|
|
|
}
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
@@ -376,16 +161,13 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
const formatExtraItem = async () => {
|
|
|
if (dataForm.value.extraItems.length) {
|
|
|
const res = await findNurseItemListByName({
|
|
|
- categoryTypeName: route.path.indexOf('medical-care-plan') > -1 ? '医疗护理' : '生活护理',
|
|
|
+ categoryTypeName: '生活护理',
|
|
|
nurseItemName: ''
|
|
|
})
|
|
|
dataForm.value.extraItems.map((e) => {
|
|
|
res.map((r) => {
|
|
|
if (e.nurseItemId == r.id) {
|
|
|
e.price = r.price
|
|
|
- if(isCopy.value){
|
|
|
- e.nursingPlanId = ''
|
|
|
- }
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
@@ -397,96 +179,6 @@ const handleClosed = () => {
|
|
|
dialogVisible.value = false
|
|
|
}
|
|
|
|
|
|
-let inputs = reactive({
|
|
|
- dietInput: '', // 饮食方式-其他
|
|
|
- dietaryTypeInput: '', // 饮食类型-其他
|
|
|
- dietaryTabooInput: '' // 饮食禁忌-其他
|
|
|
-})
|
|
|
-const handleChange = (val, type: any) => {
|
|
|
- if (!val.includes('0')) {
|
|
|
- let v = type + 'Input'
|
|
|
- inputs[v] = ''
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 数组转字符串
|
|
|
-const toStr = (type, name, arr) => {
|
|
|
- if (type == 1) {
|
|
|
- if (Array.isArray(arr) && arr.length > 0) {
|
|
|
- // 如果arr是数组且有值,则返回原数组
|
|
|
- if (arr.includes('0') && name) {
|
|
|
- let temp = JSON.parse(JSON.stringify(arr))
|
|
|
- const index = arr.findIndex((item) => item == '0')
|
|
|
- temp[index] = '0-' + name
|
|
|
- return JSON.stringify(temp)
|
|
|
- }
|
|
|
- return JSON.stringify(arr)
|
|
|
- } else {
|
|
|
- // 否则返回空字符串
|
|
|
- return ''
|
|
|
- }
|
|
|
- } else if (type == 2) {
|
|
|
- if (arr === '0') {
|
|
|
- return arr + '-' + name
|
|
|
- } else {
|
|
|
- return arr
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 字符串转数组
|
|
|
-const convert = (type, str, name?) => {
|
|
|
- if (type == 1) {
|
|
|
- let arr: string[] = []
|
|
|
- if (str) {
|
|
|
- arr = JSON.parse(str)
|
|
|
- if (str.includes('0-')) {
|
|
|
- let index = -1
|
|
|
- arr.map((item: string, i) => {
|
|
|
- if (item.indexOf('0-') > -1) index = i
|
|
|
- })
|
|
|
- let temp = arr.splice(index, 1)
|
|
|
- arr.push('0')
|
|
|
- inputs[name] = temp.join().split('-')[1]
|
|
|
- }
|
|
|
- }
|
|
|
- return arr
|
|
|
- } else {
|
|
|
- if (str.includes('0-')) {
|
|
|
- const arr = str.split('-')
|
|
|
- inputs[name] = arr[1]
|
|
|
- return arr[0]
|
|
|
- } else {
|
|
|
- return str
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 格式化
|
|
|
-const formatArr = (dict: string, value) => {
|
|
|
- // let { arr } = convert(1, value, 'dietaryTabooInput')
|
|
|
- let str = ''
|
|
|
- value.map((a) => {
|
|
|
- getDictOptions(dict).map((item) => {
|
|
|
- if (item.value == Number(a)) {
|
|
|
- if (item.value === '0') {
|
|
|
- str += item.label + '-' + inputs.dietaryTabooInput + ','
|
|
|
- } else {
|
|
|
- str += item.label + ','
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- return str.substring(0, str.length - 1)
|
|
|
-}
|
|
|
-
|
|
|
-const handleRadioChange = (val, type: any) => {
|
|
|
- if (val != 0) {
|
|
|
- let v = type + 'Input'
|
|
|
- inputs[v] = ''
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
const itemRef = ref()
|
|
|
const handleAdd = () => {
|
|
|
itemRef.value.open(dataForm.value.items)
|
|
|
@@ -513,59 +205,6 @@ const handleElder = async (item) => {
|
|
|
dataForm.value.elderName = item.elderName
|
|
|
dataForm.value.bedName = item.bedName
|
|
|
dataForm.value.nurseLevelName = item.nurseLevelName
|
|
|
- // 如果是复制,获取当前长者护理项目,与复制者做比较
|
|
|
- // const res = await getListByElderId({
|
|
|
- // elderId: item.id,
|
|
|
- // categoryTypeName: route.path.indexOf('medical-care-plan') > -1 ? '医疗护理' : '生活护理' // 2:医疗护理 1 生活照料
|
|
|
- // })
|
|
|
- // // 设置选中
|
|
|
- // res.map((item) => (item.checked = true))
|
|
|
- // dataForm.value.items = res
|
|
|
- // if (isCopy.value) {
|
|
|
- // dataForm.value.items = JSON.parse(JSON.stringify(tempCopyForm.value.items))
|
|
|
- // dataForm.value.extraItems = JSON.parse(JSON.stringify(tempCopyForm.value.extraItems))
|
|
|
- // formatCopyData(res)
|
|
|
- // }
|
|
|
-}
|
|
|
-
|
|
|
-const reportRef = ref()
|
|
|
-const openReport = (item) => {
|
|
|
- reportRef.value.open(dataForm.value.elderId, 2)
|
|
|
-}
|
|
|
-
|
|
|
-// 格式化复制的数据
|
|
|
-const formatCopyData = (arr) => {
|
|
|
- const tempArr: any = []
|
|
|
- // 当前已有项目跟复制长者项目相同放到额外
|
|
|
- arr.map((a) => {
|
|
|
- dataForm.value.items.map((item) => {
|
|
|
- if (a.nurseItemId == item.nurseItemId) {
|
|
|
- tempArr.push(JSON.parse(JSON.stringify(a)))
|
|
|
- a.flag = true
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- // 如果没有相同就合并
|
|
|
- arr.map((item) => {
|
|
|
- if (!item.flag) {
|
|
|
- item.checked = true
|
|
|
- dataForm.value.items.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- // 判断额外项目是否已存在
|
|
|
- tempArr.map((t) => {
|
|
|
- dataForm.value.extraItems.map((e) => {
|
|
|
- if (t.nurseItemId == e.nurseItemId) {
|
|
|
- t.flag = true
|
|
|
- e.frequency = Number(t.frequency) + Number(e.frequency)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- tempArr.map((item) => {
|
|
|
- if (!item.flag) {
|
|
|
- dataForm.value.extraItems.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
const handleChangeCheckBox = (val, item) => {
|
|
|
@@ -574,10 +213,6 @@ const handleChangeCheckBox = (val, item) => {
|
|
|
dataForm.value.items.splice(index, 1)
|
|
|
}
|
|
|
}
|
|
|
-const handleDelete = (item) => {
|
|
|
- const index = dataForm.value.extraItems.findIndex((p) => item.nurseItemId == p.nurseItemId)
|
|
|
- dataForm.value.extraItems.splice(index, 1)
|
|
|
-}
|
|
|
|
|
|
const formRef = ref()
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
@@ -591,15 +226,10 @@ const submitForm = async () => {
|
|
|
const params = {
|
|
|
type: route.path.indexOf('medical-care-plan') > -1 ? 2 : 1, // 2:医疗护理 1 生活护理,
|
|
|
...dataForm.value,
|
|
|
- dietaryTaboo: toStr(1, inputs.dietaryTabooInput, dataForm.value.dietaryTaboo),
|
|
|
- diet: toStr(2, inputs.dietInput, dataForm.value.diet),
|
|
|
- dietaryType: toStr(2, inputs.dietaryTypeInput, dataForm.value.dietaryType)
|
|
|
}
|
|
|
- const res = !isCopy.value
|
|
|
- ? params.id
|
|
|
- ? await updateNursingPlan(params)
|
|
|
- : await createNursingPlan(params)
|
|
|
- : await copyNursingPlan(params)
|
|
|
+ const res = params.id
|
|
|
+ ? await updateNursingPlan(params)
|
|
|
+ : await createNursingPlan(params)
|
|
|
if (res) {
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
handleClosed()
|