Commit e0020a25 authored by 小费同学阿's avatar 小费同学阿 💬

Merge remote-tracking branch 'origin/master'

parents 94456b54 bcc13ba0
import request from '@/utils/request'
// 查询病例详情
export function getRecord(id) {
return request({
url: '/business/record/' + id,
method: 'get'
})
}
// 根据检查类型查询检查项目
export function listByType(params) {
return request({
url: '/business/item/listByType',
method: 'get',
params
})
}
// 根据宠物id查询检查信息列表
export function checkList(params) {
return request({
url: '/business/check/list',
method: 'get',
params
})
}
// 查询治疗项目
export function getTreatOptions(params) {
return request({
url: '/business/item/list',
method: 'get',
params
})
}
export function deleteCheck(id) {
return request({
url: '/business/check/' + id,
method: 'delete'
})
}
// 新增检查
export function addCheck(data) {
return request({
url: '/business/check',
method: 'post',
data
})
}
// 编辑检查
export function updateCheck(data) {
return request({
url: '/business/check',
method: 'put',
data
})
}
// 新增治疗
export function addTreat(data) {
return request({
url: '/business/treat',
method: 'post',
data
})
}
// 编辑治疗
export function updateTreat(data) {
return request({
url: '/business/treat',
method: 'put',
data
})
}
export function deleteTreat(id) {
return request({
url: '/business/treat/' + id,
method: 'delete'
})
}
......@@ -90,8 +90,9 @@ function render(props = {}) {
store.commit('SET_TOKEN', temp.token)
store.commit('SET_ROLES', temp.roles)
store.commit('SET_PERMISSIONS', temp.permissions)
store.commit('SET_NAME', temp.userName)
store.commit('SET_NAME', temp.name)
store.commit('SET_AVATAR', temp.avatar)
store.commit('SET_DEPTID', temp.deptId)
}
instance = new Vue({
......
......@@ -8,6 +8,7 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
deptId: state => state.user.deptId,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
......
......@@ -7,7 +7,8 @@ const user = {
name: '',
avatar: '',
roles: [],
permissions: []
permissions: [],
deptId: ''
},
mutations: {
......@@ -25,6 +26,9 @@ const user = {
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_DEPTID: (state, deptId) => {
state.deptId = deptId
}
},
......@@ -59,6 +63,7 @@ const user = {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
commit('SET_NAME', user.userName)
commit('SET_DEPTID', user.deptId)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
......
......@@ -41,7 +41,7 @@ color: #333333;"
</div>
</div>
<!-- 内部信息 -->
<el-form ref="from" :model="form" :rules="rules" class="registration-add-form" label-width="110px" size="small">
<el-form ref="from" :model="form" :rules="drugRules" class="registration-add-form" label-width="110px" size="small">
<!-- 宠物基本信息-->
<el-row :gutter="41">
<el-col :span="8">
......@@ -180,7 +180,7 @@ color: #333333;"
</div>
</div>
<!-- 内部信息 -->
<el-form ref="from" :model="form" :rules="rules" class="registration-add-form" label-width="110px" size="small">
<el-form ref="from" :model="form" :rules="drugRules" class="registration-add-form" label-width="110px" size="small">
<!-- 宠主基本信息-->
<el-row :gutter="41">
<el-col :span="8">
......@@ -267,7 +267,7 @@ color: #333333;"
</div>
</div>
<!-- 内部信息 -->
<el-form ref="from" :model="form" :rules="rules" class="registration-add-form" label-width="110px" size="small">
<el-form ref="from" :model="form" :rules="drugRules" class="registration-add-form" label-width="110px" size="small">
<!-- 宠主基本信息-->
<el-row :gutter="41">
<el-col :span="8">
......@@ -348,7 +348,7 @@ color: #333333;"
</div>
</div>
<!-- 内部信息 -->
<el-form ref="from" :model="form" :rules="rules" class="registration-add-form" label-width="110px" size="small">
<el-form ref="from" :model="form" :rules="drugRules" class="registration-add-form" label-width="110px" size="small">
<!-- 宠主基本信息-->
<el-row :gutter="41">
<el-col :span="8">
......@@ -514,109 +514,259 @@ color: #333333;"
</el-form>
</div>
<!--8--检查信息-->
<div style="display: flex">
<div class="tip-green" />
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;"
>检查信息
<div class="title-content">
<div class="title-left">
<div class="tip-green" />
<div
class="tip-text"
>检查信息
</div>
</div>
<el-button
class="fourWordsBtn"
icon="el-icon-circle-plus-outline"
size="mini"
@click="handleAdd('checkManageBos')"
>新增检查
</el-button>
</div>
<!-- 内部信息 -->
<div class="table-content">
<el-table :data="petProtect" :header-cell-style="{ background:'#E8E9E8'}" border>
<el-table-column align="center" label="检查类型" prop="protectName" />
<el-table-column align="center" label="检查项目" prop="type" />
<el-table-column align="center" label="检查状态" prop="date" />
<el-table-column align="center" label="检查日期" prop="date" />
<el-table-column align="center" label="检查报告" prop="date" />
<el-table-column align="center" show-overflow-tooltip class-name="small-padding fixed-width" label="操作" min-width="180">
<template slot-scope="scope">
<el-button
v-hasPermi="['business:case:edit']"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success"
@click="handleDetail(scope.row)"
>查看
</el-button>
<el-button
v-hasPermi="['business:case:edit']"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleUpdate(scope.row)"
>编辑
</el-button>
<el-button
v-hasPermi="['business:case:edit']"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(155,0,65);"
type="danger"
@click="handleDetail(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-form ref="checkForm" :model="checkForm" label-width="0" :rules="checkRules" class="demo-ruleForm">
<el-table :data="checkManageBos" :header-cell-style="{ background:'#E8E9E8'}" border>
<el-table-column align="center" label="检查类型" prop="checkType">
<template slot-scope="scope">
<el-form-item v-if="scope.row.inputShow" :prop="'checkManageBos.'+scope.$index+'.checkType'" :rules="checkRules.checkType">
<el-select v-model="scope.row.checkType" placeholder="请选择" clearable @change="getCheckItemOptions">
<el-option
v-for="(item, index) in dict.type.check_type"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- <span v-else>{{ scope.row.checkType === '' || scope.row.checkType === null ? '-' : scope.row.checkType }}</span>-->
<dict-tag
v-else
:options="dict.type.check_type"
:value="scope.row.checkType"
class="content-style"
/>
</template>
</el-table-column>
<el-table-column align="center" label="检查项目" prop="checkItemsName">
<template slot-scope="scope">
<el-form-item v-if="scope.row.inputShow" :prop="'checkManageBos.'+scope.$index+'.checkItemsId'" :rules="drugRules.checkItemsName">
<el-select v-model="scope.row.checkItemsId" placeholder="请选择" clearable @change="setCheckItemsName(scope.row,checkItemOptions)">
<el-option
v-for="(item, index) in checkItemOptions"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<span v-else>{{ scope.row.checkItemsName === '' || scope.row.checkItemsName === null ? '-' : scope.row.checkItemsName }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="缴费状态" prop="payType">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<dict-tag
v-else
:options="dict.type.payment_status"
:value="scope.row.payType"
class="content-style"
/>
</template>
</el-table-column>
<el-table-column align="center" label="检查状态" prop="checkSchedule">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<span v-else>
{{ scope.row.checkSchedule? (scope.row.checkSchedule === 3 ? '已检查' : '未检查') : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="检查日期" prop="reportTime">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<span v-else>
{{ scope.row.reportTime? scope.row.reportTime : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="检查报告" prop="shadowReport">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<span v-else>
{{ scope.row.shadowReport? scope.row.shadowReport : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" show-overflow-tooltip class-name="small-padding fixed-width" label="操作" min-width="180">
<template slot-scope="scope">
<el-button
v-if="scope.row.payType !== '0' && !scope.row.isAdd"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success"
@click="handleDetail(scope.row)"
>查看
</el-button>
<el-button
v-if="scope.row.payType === '0' && !scope.row.inputShow"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleUpdate(scope.$index,'checkManageBos')"
>编辑
</el-button>
<el-button
v-if="(scope.row.payType === '0'|| scope.row.isAdd ) && scope.row.inputShow"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleSave('checkForm','checkManageBos', scope.$index)"
>保存
</el-button>
<el-button
v-if="scope.row.payType === '0' && !scope.row.inputShow"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(155,0,65);"
type="danger"
@click="handleDelRow(scope.row, 'checkManageBos')"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<!--9--治疗信息-->
<div style="display: flex">
<div class="tip-green" />
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;"
>治疗信息
<div class="title-content">
<div class="title-left">
<div class="tip-green" />
<div
class="tip-text"
>治疗信息
</div>
</div>
<el-button
class="fourWordsBtn"
icon="el-icon-circle-plus-outline"
size="mini"
@click="handleAdd('treatManageBo')"
>新增治疗
</el-button>
</div>
<!-- 内部信息 -->
<div class="table-content">
<el-table :data="petProtect" :header-cell-style="{ background:'#E8E9E8'}" border>
<el-table-column align="center" label="治疗项目" prop="protectName" />
<el-table-column align="center" label="治疗类型" prop="type" />
<el-table-column align="center" label="负责人" prop="date" />
<el-table-column align="center" label="治疗诊室" prop="date" />
<el-table-column align="center" label="治疗状态" prop="date" />
<el-table-column align="center" label="治疗日期" prop="date" />
<el-table-column align="center" show-overflow-tooltip class-name="small-padding fixed-width" label="操作" min-width="180">
<template slot-scope="scope">
<el-button
v-hasPermi="['business:case:edit']"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success"
@click="handleDetail(scope.row)"
>查看
</el-button>
<el-button
v-hasPermi="['business:case:edit']"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleUpdate(scope.row)"
>编辑
</el-button>
<el-button
v-hasPermi="['business:case:edit']"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(155,0,65);"
type="danger"
@click="handleDetail(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-form ref="treatForm" :model="treatForm" label-width="0" :rules="treatRules" class="demo-ruleForm">
<el-table :data="treatManageBo" :header-cell-style="{ background:'#E8E9E8'}" border>
<el-table-column align="center" label="治疗项目" prop="treatItemsName">
<template slot-scope="scope">
<el-form-item v-if="scope.row.inputShow" :prop="'treatManageBo.'+scope.$index+'.treatItemsId'" :rules="treatRules.treatItemsId">
<el-select v-model="scope.row.id" placeholder="请选择" clearable @change="setTreatItemsName(scope.row,treatItemOptions)">
<el-option
v-for="(item, index) in treatItemOptions"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<span v-else>{{ scope.row.treatItemsName === '' || scope.row.treatItemsName === null ? '-' : scope.row.treatItemsName }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="治疗负责人" prop="doctorName" />
<el-table-column align="center" label="治疗诊室" prop="consultRoomName">
<template slot-scope="scope">
<span>{{ scope.row.consultRoomName === '' || scope.row.consultRoomName === null ? '-' : scope.row.consultRoomName }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="缴费状态" prop="payType">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<dict-tag
v-else
:options="dict.type.payment_status"
:value="scope.row.payType"
class="content-style"
/>
</template>
</el-table-column>
<el-table-column align="center" label="治疗状态" prop="treatStatus">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<span v-else>
{{ scope.row.treatStatus? (scope.row.treatStatus === 3 ? '已检查' : '未检查') : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="治疗日期" prop="treatStartTime">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<span v-else>
{{ scope.row.treatStartTime? scope.row.treatStartTime : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" show-overflow-tooltip class-name="small-padding fixed-width" label="操作" min-width="180">
<template slot-scope="scope">
<el-button
v-if="scope.row.payType !== '0' && !scope.row.isAdd"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success"
@click="handleDetail(scope.row)"
>查看
</el-button>
<el-button
v-if="scope.row.payType === '0' && !scope.row.inputShow"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleUpdate(scope.$index,'treatManageBo')"
>编辑
</el-button>
<el-button
v-if="(scope.row.payType === '0'|| scope.row.isAdd ) && scope.row.inputShow"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleSave('treatForm','treatManageBo', scope.$index)"
>保存
</el-button>
<el-button
v-if="scope.row.payType === '0' && !scope.row.inputShow"
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(155,0,65);"
type="danger"
@click="handleDelRow(scope.row, 'treatManageBo')"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<!--10--住院信息-->
<div style="display: flex">
......@@ -701,25 +851,47 @@ color: #333333;"
import { parseTime, selectDictLabel } from '@/utils/ruoyi'
// 引入进度信息模组件
import scheduleInfo from '@/views/service-management/registration-queue/components/schedule-info'
import {
addCheck,
addTreat,
updateTreat,
checkList,
deleteCheck,
deleteTreat,
getRecord,
getTreatOptions,
listByType,
updateCheck
} from '@/api/business/mdeicalRecord'
import { mapGetters } from 'vuex'
export default {
name: 'MedicalEdit',
// 数据字典
dicts: ['pet_sex', 'vaccine_situation', 'exist_state', 'sterilization_status', 'cat_breed', 'dog_breed', 'other_breed'],
dicts: ['pet_sex', 'vaccine_situation', 'exist_state', 'sterilization_status', 'cat_breed', 'dog_breed', 'other_breed', 'check_type', 'payment_status'],
components: {
// 引入进度信息模组件
scheduleInfo
},
data() {
return {
checkItemOptions: [], // 项目选项列表 根据检查类型变化
treatItemOptions: [], // 治疗项目选项列表
checkManageBos: [], // 检查列表数据
treatManageBo: [], // 治疗列表数据
editCunt: {
petProtect: 0
petProtect: 0,
checkManageBos: 0,
treatManageBo: 0
},
drugList: [], // 药品列表
map: {
},
drugForm: {}, // 用药管理table编辑
drugRules: {},
checkForm: {}, // 检查table编辑
checkRules: {},
treatForm: {}, // 治疗table编辑
treatRules: {},
form: {},
// 排序下拉框
insureList: [
......@@ -817,42 +989,412 @@ export default {
}]
}
},
created() {
computed: {
...mapGetters(['deptId', 'name'])
},
mounted() {
this.getDetail()
this.getTreatItemOptions()
},
methods: {
// 设置当前行检查名称
setCheckItemsName(rowData, options) {
console.log('setCheckItemsName', rowData, options)
options.forEach(item => {
if (item.value === rowData.checkItemsId) {
rowData.checkItemsName = item.label
}
})
},
// 设置当前行治疗名称
setTreatItemsName(rowData, options) {
console.log('setTreatItemsName', rowData, options)
options.forEach(item => {
if (item.value === rowData.treatItemsId) {
rowData.treatItemsName = item.label
rowData.treatItemsType = item.type
}
})
},
/** 根据检查类型获取检查项目列表*/
getCheckItemOptions(checkType) {
listByType({ deptId: this.deptId, itemType: checkType }).then(res => {
this.checkItemOptions = res.rows.map(item => {
return {
label: item.name,
value: item.id
}
})
console.log('checkItemOptions!!!!!!!!!!!!!', this.checkItemOptions)
})
},
/** 获取治疗项目列表*/
getTreatItemOptions(checkType) {
getTreatOptions({ itemType: '1', status: '1' }).then(res => {
this.treatItemOptions = res.rows.map(item => {
return {
label: item.name,
value: item.id,
type: item.type
}
})
console.log('treatItemOptions!!!!!!!!!!!!!', this.treatItemOptions)
})
},
/** 获取页面详情*/
getDetail() {
getRecord(this.$route.params.id).then(response => {
console.log('KKKKKKKKKKKKKKKKKKKK', response)
})
const temp = {
'msg': '操作成功',
'code': 200,
'data': {
'createBy': null,
'createTime': '2023-04-21 16:34:56',
'updateBy': null,
'updateTime': null,
'remark': null,
'id': 6,
'medicalRecordNo': '【兽2023】6410Jun1410006',
'petsId': 15341523102,
'petOwnersId': 7,
'ownersId': null,
'petOwnerPhone': null,
'petNickname': '包子',
'petPicture': '/profile/upload/2023/05/10/dog1_20230510063813A013.png',
'petBreed': '金毛猎犬',
'petSex': '1',
'petAge': '3',
'petWeight': 18.57,
'petColor': '黑花',
'sterilizationStatus': '0',
'vaccineSituation': '0',
'insure': '0',
'registId': null,
'doctorId': 'LON362023JunDOC50001',
'doctorName': '高宇',
'hospitalName': '医院',
'hospitalId': 200,
'hospitalDepartmentId': null,
'hospitalDepartmentName': '科室1',
'doctorTitleLabel': '职位',
'doctorPhone': '13820629672',
'doctorSignatureUrl': null,
'checkSchedule': '2',
'visitDate': null,
'visitLocation': null,
'positionId': null,
'mainSuit': '主诉',
'doctorAdvice': '医嘱',
'diagnosisResult': '诊断结果',
'registTime': '2023/06/13 14:29',
'diagnosisTime': '2023/06/13 17:19',
'recipelTime': null,
'reportTime': '2023/06/14 11:16',
'delFlag': '0',
'petOwnerBo': {
'id': 6,
'ownersId': null,
'nickName': '过的咖啡馆',
'phoneNumber': '15123',
'createTime': '2023/04/21',
'status': '0',
'customers': '2',
'membershipLevel': '5',
'cardBalance': '15.60',
'petCount': 0,
'petList': [
{
'id': 1,
'petNickname': '包子',
'petAge': '3',
'petSex': '1',
'petBreed': '金毛猎犬',
'sterilizationStatus': '0',
'vaccineSituation': '0',
'petPicture': '/profile/upload/2023/05/10/dog1_20230510063813A013.png',
'petColor': '黑花',
'petWeight': 18.57,
'existState': null,
'petOwnersId': 7,
'delFlag': '0',
'petsId': '15341523102',
'insure': '0',
'createBy': null,
'createTime': null,
'updateBy': null,
'updateTime': null,
'remark': null
},
{
'id': 9,
'petNickname': '包子',
'petAge': '3',
'petSex': '1',
'petBreed': '金毛猎犬',
'sterilizationStatus': '0',
'vaccineSituation': '0',
'petPicture': '/profile/upload/2023/05/10/dog1_20230510063813A013.png',
'petColor': '黑花',
'petWeight': 18.57,
'existState': null,
'petOwnersId': 7,
'delFlag': '0',
'petsId': '15341523102',
'insure': '0',
'createBy': null,
'createTime': null,
'updateBy': null,
'updateTime': null,
'remark': null
}
]
},
'treatManageBo': [
{
'id': 2,
'registId': null,
'medicalRecordId': null,
'treatItemsName': null,
'doctorName': '高宇',
'consultRoomName': null,
'payType': null,
'treatStatus': '0',
'treatStartTime': null
},
{
'id': 3,
'registId': null,
'medicalRecordId': null,
'treatItemsName': null,
'doctorName': '高宇',
'consultRoomName': null,
'payType': null,
'treatStatus': '0',
'treatStartTime': null
}
],
'inHospitalBo': [
{
'id': 1,
'registId': null,
'medicalRecordId': null,
'hospitalDays': null,
'diseaseLevel': '',
'bathe': '',
'wardRuleId': '',
'admissionDate': null
},
{
'id': 5,
'registId': null,
'medicalRecordId': null,
'hospitalDays': null,
'diseaseLevel': '',
'bathe': '',
'wardRuleId': '',
'admissionDate': null
}
],
'checkManageBos': [
{
'id': 7,
'registId': null,
'medicalRecordId': null,
'checkSchedule': null,
'payAmount': null,
'payType': '0',
'checkType': '0',
'checkItemsId': null,
'checkItemsName': null,
'checkStartTime': null,
'shadowReport': null,
'checkStatus': null,
'inputShow': false
}
],
'followContent': null,
'followTime': null,
'followStatus': null
}
}
this.checkManageBos.push(...temp.data.checkManageBos)
this.treatManageBo.push(...temp.data.treatManageBo)
this.petInfo = { ...temp.data }
console.log(this.checkManageBos, 'kkkkkkkkkkkkkkkkkkkkkkk')
},
/** 编辑行*/
handleUpdate(index, tableData) {
// 每个表格只有一行可编辑
if (this.editCunt[tableData] === 0) {
this[tableData][index]['inputShow'] = true
console.log('UUUUUUUUUUUUUU', tableData, index, this[tableData][index])
this.editCunt[tableData] += 1
// 如果是检查表格需要根据检查类型查询检查项目
if (tableData === 'checkManageBos') {
this.getCheckItemOptions(this.checkManageBos[index].checkType)
}
} else {
this.$message({
message: '只可同时编辑一行',
info: 'success'
info: 'info'
})
}
},
/** 删除行*/
handleDelRow(rowData, tableName) {
// 删除信息行
this.$confirm('此操作将永久删除该信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (tableName === 'checkManageBos') {
deleteCheck(rowData.id).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
})
} else if (tableName === 'treatManageBo') {
deleteTreat(rowData.id).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
})
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
/** 新增行*/
handleAdd(tableName) {
this[tableName].unshift({
protectName: '',
type: '',
date: '',
inputShow: false
})
if (this.editCunt[tableName] === 0) {
if (tableName === 'checkManageBos') {
// 新增检查信息初始值
this[tableName].unshift({
checkType: '',
checkItemsId: '',
checkItemsName: '',
payType: '',
checkSchedule: '',
reportTime: '',
shadowReport: '',
inputShow: true,
isAdd: true
})
} else if (tableName === 'treatManageBo') {
// 新增z治疗信息初始值
this[tableName].unshift({
id: '',
treatItemsName: '',
doctorName: this.petInfo.doctorName,
consultRoomName: '',
payType: '',
treatStatus: '',
treatStartTime: '',
inputShow: true,
isAdd: true
})
}
this.editCunt[tableName] += 1
} else {
this.$message({
message: '请先保存待编辑行',
info: 'info'
})
}
},
/** 保存行*/
handleSave(formName, listName, index) {
this.$refs[formName].validate((valid) => {
console.log('22222222222', valid, this[formName], this[listName])
console.log('this.petInfo.petsId', this.petInfo.petsId)
if (valid) {
const rowData = this[listName][index] // 行信息
// 检查信息保存-- 新增保存 编辑保存
if (listName === 'checkManageBos') {
if (this[listName][index].isAdd) { // 新增保存
const temp = {
petsId: this.petInfo.petsId,
medicalRecordId: this.petInfo.id,
checkSchedule: '0',
payType: '0',
checkType: rowData.checkType,
originChannel: '0',
checkItemsId: rowData.checkItemsId,
checkItemsName: rowData.checkItemsName
}
addCheck([temp]).then(() => {
this.$message.success('保存成功')
// 刷新检查信息列表
this.getCheckList()
})
} else {
const temp = {
checkType: rowData.checkType,
checkItemsId: rowData.checkItemsId,
checkItemsName: rowData.checkItemsName
}
// 编辑保存
updateCheck([temp]).then(() => {
this.$message.success('保存成功')
// 刷新检查信息列表
this.getCheckList()
})
}
} else if (listName === 'treatManageBo') {
// 治疗信息保存-- 新增保存 编辑保存
if (this[listName][index].isAdd) { // 新增保存
const temp = {
registId: this.petInfo.registId,
medicalRecordId: this.petInfo.id,
originChannel: '0',
treatItemsId: rowData.treatItemsId,
treatItemsName: rowData.treatItemsName,
treatItemsType: rowData.treatItemsType
}
addTreat([temp]).then(() => {
this.$message.success('保存成功')
// 刷新治疗信息列表
this.getTreatList()
})
} else {
const temp = {
treatItemsId: rowData.treatItemsId,
treatItemsName: rowData.treatItemsName,
treatItemsType: rowData.treatItemsType
}
// 编辑保存
updateTreat([temp]).then(() => {
this.$message.success('保存成功')
// 刷新治疗信息列表
this.getTreatList()
})
}
}
this[listName][index].inputShow = false
this.editCunt[listName] -= 1
}
})
},
/** 根据宠物id查询检查列表*/
getCheckList() {
checkList({ petsId: this.petInfo.petsId }).then(res => {
console.log('checkList', res)
})
},
/** 根据宠物id查询检查列表*/
getTreatList() {
checkList({ petsId: this.petInfo.petsId }).then(res => {
console.log('checkList', res)
})
},
parseTime,
selectDictLabel,
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment