nursing_unit_vue/src/views/serviceDirective/directivePackage/components/DirectivePackageModal.vue

188 lines
6.2 KiB
Vue
Raw Normal View History

2025-03-24 14:59:31 +08:00
<template>
<!-- <j-modal :title="title" :width="width" :maskClosable="false" :fullscreen="true" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
2025-03-24 14:59:31 +08:00
<DirectivePackageForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DirectivePackageForm>
</j-modal> -->
<a-drawer v-model:open="visible" v-if="visible" :title="title" width="85vw" :closable="false"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<div style="display:flex;justify-content:space-between">
<div>
<a-card title="服务指令包详情" style="width: 27vw">
<DirectivePackageForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</DirectivePackageForm>
</a-card>
</div>
<div>
<a-card title="服务指令" style="width: 27vw">
<template #extra><a href="#" @click="showChildrenDrawer">新增</a></template>
<div style="padding:10px;margin-top:10px;border:1px solid red;" v-for="directive of directives"
:class="{ 'selected': selectedDirective === directive.id }" @click="directiveInfo(directive)">
{{ directive.directiveName }}
<div style="float:right;">
<a href="#" @click="deleteDirective(directive.id)">移除</a>
</div>
</div>
</a-card>
</div>
<div>
<a-card title="服务指令详情" style="width: 27vw">
<div class="">分类标签{{ derectiveInfo.instructionTagId_dictText }}</div>
<div class="directiveInfoClass">服务类别{{ derectiveInfo.categoryId_dictText }}</div>
<div class="directiveInfoClass">服务类型{{ derectiveInfo.typeId_dictText }}</div>
<div class="directiveInfoClass">服务指令名称{{ derectiveInfo.directiveName }}</div>
<!-- <div class="directiveInfoClass">收费价格(){{ derectiveInfo.tollPrice }}</div>
<div class="directiveInfoClass">提成价格(){{ derectiveInfo.comPrice }}</div>
<div class="directiveInfoClass">医保报销{{ derectiveInfo.izReimbursement }}</div>
<div class="directiveInfoClass">机构优惠{{ derectiveInfo.izPreferential }}</div> -->
<div class="directiveInfoClass">周期类型{{ derectiveInfo.cycleType }}</div>
<div class="directiveInfoClass">服务时长(分钟){{ derectiveInfo.serviceDuration }}</div>
<div class="directiveInfoClass">服务说明{{ derectiveInfo.serviceContent }}</div>
<div class="directiveInfoClass">指令标签{{ derectiveInfo.tags }}</div>
<div class="directiveInfoClass">语音文件
<span v-if="!derectiveInfo.mp3File">暂无文件</span>
<audio controls disabled="false" v-else>
<source :src="getFileAccessHttpUrl(derectiveInfo.mp3File)">
</audio>
</div>
<div class="directiveInfoClass">视频文件
<span v-if="!derectiveInfo.mp4File">暂无文件</span>
<video controls v-else>
<source :src="getFileAccessHttpUrl(derectiveInfo.mp4File)">
</video>
</div>
</a-card>
</div>
</div>
<a-drawer v-model:open="childrenDrawer" title="选择服务指令" width="80vw" :closable="false"
:footer-style="{ textAlign: 'right' }">
<ConfigServiceDirectiveList ref="configServiceDirectiveListRef"></ConfigServiceDirectiveList>
<template #footer>
<a-button style="margin-right: 8px" @click="handleDirectiveCancel">关闭</a-button>
<a-button type="primary" @click="handleDirectiveOk">确定</a-button>
</template>
</a-drawer>
<template #footer>
<a-button style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
</a-drawer>
2025-03-24 14:59:31 +08:00
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose, computed } from 'vue';
import DirectivePackageForm from './DirectivePackageForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import ConfigServiceDirectiveList from './ConfigServiceDirectiveList.vue'
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
2025-03-24 14:59:31 +08:00
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['directiveOk', 'register', 'success']);
const childrenDrawer = ref<boolean>(false);
const configServiceDirectiveListRef = ref()
const derectiveInfo = ref({})
const directives = computed(() => {
if (configServiceDirectiveListRef.value) {
return configServiceDirectiveListRef.value.selected
} else {
return []
2025-03-24 14:59:31 +08:00
}
})
const selectedDirective = ref()
/**
* 新增
*/
function add() {
title.value = '新增服务指令包';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
2025-03-24 14:59:31 +08:00
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
2025-03-24 14:59:31 +08:00
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm(directives);
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
const showChildrenDrawer = () => {
childrenDrawer.value = true;
};
function handleDirectiveCancel() {
childrenDrawer.value = false;
}
function handleDirectiveOk() {
childrenDrawer.value = false;
}
function directiveInfo(directive) {
selectedDirective.value = directive.id
derectiveInfo.value = directive
}
function deleteDirective(directiveId) {
setTimeout(() => {
derectiveInfo.value = {}
}, 200)
configServiceDirectiveListRef.value.deleteDirective(directiveId)
}
defineExpose({
add,
edit,
disableSubmit,
});
2025-03-24 14:59:31 +08:00
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped>
.selected {
background-color: lightgreen;
}
.directiveInfoClass {
margin-top: 10px;
}
2025-03-24 14:59:31 +08:00
</style>