版本更新

This commit is contained in:
Zhang.WH
2025-10-16 17:38:08 +08:00
parent f515bb8fbb
commit e4c5f36f2e
488 changed files with 41436 additions and 2901 deletions

24
openhis-ui-vue3/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
vite.config.js

View File

@@ -0,0 +1,116 @@
// 表单数据
const formData = reactive({
admission: {
confirmDate: '2023年10月28日',
dischargeTime: '2023年11月13日 08时14分',
hospitalDays: '17'
},
diagnosis: {
mainDiagnosis: '腰椎间盘突出症(L4-5)',
otherDiagnosis: ''
}
});
// 打印表单
const printForm = () => {
// 创建一个新的打印窗口
const printWindow = window.open('', '_blank');
// 构建打印内容
const printContent = `
<!DOCTYPE html>
<html>
<head>
<title>住院病案首页</title>
<style>
/* ... existing code ... */
.form-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 15px;
justify-content: space-between;
}
.form-item {
flex: 1;
min-width: 200px;
margin-right: 15px;
margin-bottom: 10px;
}
.form-item.full-width {
flex: 0 0 100%;
min-width: 100%;
}
.barcode {
width: 240px;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="form-header">
<div class="form-title">吉林大学第一医院</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<div style="font-size: 12px;text-align: left;">
<div>组织机构代码:(${formData.hospital.orgCode || ''}</div>
<div>医疗付费方式:(${formData.hospital.paymentMethod || ''}</div>
</div>
<div style="font-size: 20px;font-weight: 700;">
住院病案首页
</div>
<div class="barcode" id="barcode"></div>
</div>
</div>
<!-- 医院信息、患者基本信息、住院信息、诊断信息等部分保持不变 -->
<!-- 住院信息 -->
<div class="section">
<div class="section-title">住院信息</div>
<div class="form-row">
<div class="form-item">
<label>入院时间:</label>
<div class="form-value">${formData.admission.admitTime || ''}</div>
</div>
<div class="form-item">
<label>入科时间:</label>
<div class="form-value">${formData.admission.departmentAdmitTime || ''}</div>
</div>
<div class="form-item">
<label>出院时间:</label>
<div class="form-value">${formData.admission.dischargeTime || ''}</div>
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>实际住院天数:</label>
<div class="form-value">${formData.admission.hospitalDays || ''}</div>
</div>
</div>
</div>
<!-- 其他部分保持不变 -->
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js"></script>
<script>
window.onload = function() {
JsBarcode("#barcode").init();
JsBarcode("#barcode").encode("12979667");
window.print();
window.onafterprint = function() {
window.close();
}
}
</script>
</body>
</html>
`;
// 将内容写入打印窗口并打印
printWindow.document.write(printContent);
printWindow.document.close();
};

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -0,0 +1,392 @@
<!--
* @Author: sjjh
* @Date: 2025-10-08 23:33:29
* @Description: 护理记录单
-->
<template>
<div class="container">
<div class="header">
<h2 class="title">乾安县人民医院</h2>
<h3 class="subtitle">患者护理记录单</h3>
</div>
<el-form :model="state.formData" label-position="top" class="nursing-form">
<!-- 患者基本信息 -->
<div class="patient-info">
<el-row :gutter="20">
<el-col :span="2">
<el-form-item label="姓名">
<el-input v-model="state.formData.name" placeholder="请输入姓名"></el-input>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="年龄">
<el-input v-model="state.formData.age" placeholder="请输入年龄"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">
<el-select v-model="state.formData.gender" placeholder="请选择性别">
<el-option label="男" value="male"></el-option>
<el-option label="女" value="female"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="病区">
<el-input v-model="state.formData.ward" placeholder="请输入病区"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="床号">
<el-input v-model="state.formData.bedNumber" placeholder="请输入床号"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="住院号">
<el-input
v-model="state.formData.hospitalNumber"
placeholder="请输入住院号"
></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="入院诊断">
<el-input v-model="state.formData.diagnosis" placeholder="请输入入院诊断"></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
<!-- 基本信息记录表格 -->
<div class="vital-signs-table">
<el-table :data="state.vitalSigns" border style="width: 100%">
<el-table-column label="日期" width="100">
<template #default="scope">
<el-date-picker
v-model="scope.row.date"
type="date"
placeholder="选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 100%"
></el-date-picker>
</template>
</el-table-column>
<el-table-column label="时间" width="100">
<template #default="scope">
<el-time-picker
v-model="scope.row.time"
placeholder="选择时间"
format="HH:mm"
value-format="HH:mm"
style="width: 100%"
></el-time-picker>
</template>
</el-table-column>
<el-table-column label="基本信息">
<el-table-column label="意识" width="80">
<template #default="scope">
<el-select v-model="scope.row.consciousness" placeholder="选择">
<el-option label="清醒" value="清醒"></el-option>
<el-option label="嗜睡" value="嗜睡"></el-option>
<el-option label="昏迷" value="昏迷"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="体温℃" width="80">
<template #default="scope">
<el-input v-model="scope.row.temperature" placeholder="体温"></el-input>
</template>
</el-table-column>
<el-table-column label="心率次/分" width="100">
<template #default="scope">
<el-input v-model="scope.row.heartRate" placeholder="心率"></el-input>
</template>
</el-table-column>
<el-table-column label="脉搏次/分" width="100">
<template #default="scope">
<el-input v-model="scope.row.heartRate" placeholder="心率"></el-input>
</template>
</el-table-column>
<el-table-column label="呼吸次/分" width="100">
<template #default="scope">
<el-input v-model="scope.row.respiratoryRate" placeholder="呼吸"></el-input>
</template>
</el-table-column>
<el-table-column label="血压mmHg" width="120">
<template #default="scope">
<el-input v-model="scope.row.bloodPressure" placeholder="血压"></el-input>
</template>
</el-table-column>
<el-table-column label="血氧饱和度" width="120">
<template #default="scope">
<el-input v-model="scope.row.bloodPressure" placeholder="血压"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="氧疗L/min" width="200">
<el-table-column label="方式" >
<template #default="scope">
<el-select v-model="scope.row.oxygenMethod" placeholder="选择">
<el-option label="鼻导管" value="鼻导管"></el-option>
<el-option label="面罩" value="面罩"></el-option>
<el-option label="无" value="无"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="流量" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="入量" width="200">
<el-table-column label="名称" >
<template #default="scope">
<el-select v-model="scope.row.oxygenMethod" placeholder="选择">
<el-option label="鼻导管" value="鼻导管"></el-option>
<el-option label="面罩" value="面罩"></el-option>
<el-option label="无" value="无"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="ml" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
<el-table-column label="途径" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="出量" width="200">
<el-table-column label="名称" >
<template #default="scope">
<el-select v-model="scope.row.oxygenMethod" placeholder="选择">
<el-option label="鼻导管" value="鼻导管"></el-option>
<el-option label="面罩" value="面罩"></el-option>
<el-option label="无" value="无"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="ml" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="皮肤情况" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
<el-table-column label="管路护理" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
<el-table-column label="病情与措施" width="80">
<template #default="scope">
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
</template>
</el-table-column>
<el-table-column label="护士签名" width="100">
<template #default="scope">
<el-input v-model="scope.row.nurseSignature" placeholder="签名"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template #default="scope">
<el-button type="danger" size="small" @click="removeVitalSign(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="add-row">
<el-button type="primary" @click="addVitalSign">添加记录</el-button>
</div>
</div>
<!-- 表单底部按钮 -->
<div class="form-actions">
<div>
意识:①清醒②嗜睡③意识模糊④昏睡⑤谗妄⑥浅昏迷⑦中度昏迷⑧深昏迷⑨全麻未醒⑩镇静
</div>
<div>
氧疗方式:①鼻导管②面罩③HFNC④HIPPV⑤IMV
</div>
<div>
皮肤情况:①完好②压疮③出血点④破损⑤水肿⑥瘀斑⑦过敏⑧其他
</div>
<div>
管路护理:①胃管②尿导管③静脉置管④吸氧管T⑥胸腔引流管⑦腹腔引流管⑧伤口引流管⑨脑室引流管⑩其他
</div>
</div>
</el-form>
</div>
</template>
<script setup>
defineOptions({
name: 'NursingRecordSheet',
});
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
const { proxy } = getCurrentInstance();
const emits = defineEmits([]);
const props = defineProps({
patientId: {
type: String,
default: '',
},
});
// 表单数据
const state = reactive({
formData: {
name: '',
age: '',
gender: '',
ward: '',
bedNumber: '',
hospitalNumber: '',
diagnosis: '',
},
vitalSigns: [
{
date: new Date().toISOString().split('T')[0],
time: new Date().toTimeString().slice(0, 5),
consciousness: '清醒',
temperature: '',
heartRate: '',
respiratoryRate: '',
bloodPressure: '',
oxygenMethod: '无',
flowRate: '',
nurseSignature: '',
},
],
});
// 添加生命体征记录
const addVitalSign = () => {
state.vitalSigns.push({
date: new Date().toISOString().split('T')[0],
time: new Date().toTimeString().slice(0, 5),
consciousness: '清醒',
temperature: '',
heartRate: '',
respiratoryRate: '',
bloodPressure: '',
oxygenMethod: '无',
flowRate: '',
nurseSignature: '',
});
};
// 删除生命体征记录
const removeVitalSign = (index) => {
state.vitalSigns.splice(index, 1);
if (state.vitalSigns.length === 0) {
addVitalSign();
}
};
// 重置表单
const resetForm = () => {
state.formData = {
name: '',
age: '',
gender: '',
ward: '',
bedNumber: '',
hospitalNumber: '',
diagnosis: '',
};
state.vitalSigns = [
{
date: new Date().toISOString().split('T')[0],
time: new Date().toTimeString().slice(0, 5),
consciousness: '清醒',
temperature: '',
heartRate: '',
respiratoryRate: '',
bloodPressure: '',
oxygenMethod: '无',
flowRate: '',
nurseSignature: '',
},
];
};
onBeforeMount(() => {
// 如果有patientId可以在这里加载患者数据
if (props.patientId) {
// 加载患者数据的逻辑
}
});
onMounted(() => {
// 组件挂载后的逻辑
});
defineExpose({ state });
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
background-color: #fff;
}
.header {
text-align: center;
margin-bottom: 20px;
.title {
font-size: 24px;
font-weight: bold;
margin-bottom: 5px;
}
.subtitle {
font-size: 20px;
font-weight: bold;
}
}
.nursing-form {
.patient-info {
padding: 15px;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.vital-signs-table
{
margin-bottom: 20px;
h4 {
margin-bottom: 10px;
font-size: 16px;
font-weight: bold;
}
.add-row {
margin-top: 10px;
text-align: center;
}
}
.form-actions {
margin-top: 30px;
text-align: left;
}
}
</style>

View File

@@ -20,7 +20,7 @@
<div class="info-item">姓名{{ state.formData.patientName }}</div>
</el-col>
<el-col :span="6">
<div class="info-item">性别{{ state.formData.gender }}</div>
<div class="info-item">性别{{ state.formData.sex }}</div>
</el-col>
<el-col :span="6">
<div class="info-item">年龄{{ state.formData.age }}</div>
@@ -89,13 +89,35 @@
<div class="form-item">
<span class="item-label">手术标识</span>
<el-radio-group v-model="state.formData.surgeryMark">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
<el-radio
v-for="item in getStatisticsOptionList('surgeryMark')"
:key="item.dictValue"
:label="item.dictValue"
>{{ item.dictLabel }}</el-radio
>
</el-radio-group>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<div class="form-item">
<span class="item-label">药物使用方法</span>
<el-select
v-model="state.formData.drugMethod"
placeholder="Select"
style="width: 240px"
>
<el-option
v-for="item in getStatisticsOptionList('drugMethod')"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<div class="form-item">
@@ -166,7 +188,11 @@
<div class="form-item">
<span class="item-label">皮肤情况</span>
<span>部位</span>
<el-input v-model="state.formData.skinPosition1" class="inline-input" style="width: 50px" />
<el-input
v-model="state.formData.skinPosition1"
class="inline-input"
style="width: 50px"
/>
<span>面积</span>
<el-input
v-model="state.formData.skinArea1"
@@ -184,7 +210,11 @@
<el-col :span="12">
<div class="form-item">
<span>部位</span>
<el-input v-model="state.formData.skinPosition2" class="inline-input" style="width: 50px" />
<el-input
v-model="state.formData.skinPosition2"
class="inline-input"
style="width: 50px"
/>
<span>面积</span>
<el-input
v-model="state.formData.skinArea3"
@@ -192,7 +222,7 @@
style="width: 50px"
/>
<span>×</span>
<el-input
<el-input
v-model="state.formData.skinArea4"
class="inline-input"
style="width: 50px"
@@ -360,7 +390,11 @@
<div class="form-item">
<span class="item-label">皮肤情况</span>
<span>部位</span>
<el-input v-model="state.formData.postSkinPosition1" class="inline-input" style="width: 50px" />
<el-input
v-model="state.formData.postSkinPosition1"
class="inline-input"
style="width: 50px"
/>
<span>面积</span>
<el-input
v-model="state.formData.postSkinArea1"
@@ -378,7 +412,11 @@
<el-col :span="12">
<div class="form-item">
<span>部位</span>
<el-input v-model="state.formData.postSkinPosition2" class="inline-input" style="width: 50px" />
<el-input
v-model="state.formData.postSkinPosition2"
class="inline-input"
style="width: 50px"
/>
<span>面积</span>
<el-input
v-model="state.formData.postSkinArea3"
@@ -386,7 +424,7 @@
style="width: 50px"
/>
<span>×</span>
<el-input
<el-input
v-model="state.formData.postSkinArea4"
class="inline-input"
style="width: 50px"
@@ -462,7 +500,7 @@
<el-row :gutter="20">
<el-col :span="12">
<div class="form-item">
<span class="item-label" style="width: 220px;">手术室/麻醉复苏室护士签名</span>
<span class="item-label" style="width: 220px">手术室/麻醉复苏室护士签名</span>
<el-input v-model="state.formData.surgeryRecoveryNurseName" class="inline-input" />
</div>
</el-col>
@@ -491,14 +529,13 @@
<span>mmHg</span>
</div>
</el-col>
<el-col :span="12">
<el-col :span="12">
<div class="form-item">
<span class="item-label">交接时间</span>
<el-input v-model="state.formData.postHandoverTime" class="inline-input" />
</div>
</el-col>
</el-row>
</div>
<!-- 其他 -->
@@ -525,6 +562,9 @@ defineOptions({
});
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
import { ElMessageBox, ElMessage, ElLoading, ElTree } from 'element-plus';
import useOptionsList from './useOptionsList';
// import { A } from '../../dist/assets/api-DmiMW8YF';
const { statisticsOptionList, getStatisticsOptionList } = useOptionsList();
const { proxy } = getCurrentInstance();
const emits = defineEmits(['submitOk']);
const props = defineProps({});
@@ -533,7 +573,7 @@ const state = reactive({
// 患者基本信息
date: '2025/8/13 13:36:41',
patientName: '于学斌',
gender: '男',
sex: '男',
age: '46',
department: '普外科门诊区',
bedNumber: '035',
@@ -591,20 +631,22 @@ const state = reactive({
},
});
const submit = ()=> {
const submit = () => {
// ElMessage.success('提交成功');
emits('submitOk',state.formData)
}
emits('submitOk', state.formData);
};
const setFormData = (data) => {
if (data) {
state.formData = data;
}
}
};
onBeforeMount(() => {});
onMounted(() => {});
defineExpose({ state, submit,setFormData });
onMounted(() => {
// { statisticsOptionList,getStatisticsOptionList } =await useOptionsList();
});
defineExpose({ state, submit, setFormData });
</script>
<style lang="scss" scoped>
.surgicalPatientHandover-container {
@@ -684,10 +726,10 @@ defineExpose({ state, submit,setFormData });
}
}
}
:deep(.el-input-group__prepend){
:deep(.el-input-group__prepend) {
padding: 0 8px;
}
:deep(.el-input-group__append){
:deep(.el-input-group__append) {
padding: 0 8px;
}
}

View File

@@ -0,0 +1,21 @@
import { getListWithOptionList } from '@/views/basicmanage/caseTemplatesStatistics/api';
import { onMounted, ref } from 'vue';
const statisticsOptionList = ref([]);
const initStatic = async () => {
try {
const res = await getListWithOptionList();
statisticsOptionList.value = res.data;
} catch (error) {
console.log(error);
}
};
export default function useOptionsList() {
initStatic();
const getStatisticsOptionList = (code) => {
return statisticsOptionList.value.find((item) => item.code === code)?.optionList || [];
};
return {
statisticsOptionList,
getStatisticsOptionList,
};
}

View File

@@ -1,24 +1,27 @@
import { useDict } from './dict'
import { useDict } from './dict';
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
return null;
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}';
let date;
if (typeof time === 'object') {
date = time
date = time;
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time);
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
time = time
.replace(new RegExp(/-/gm), '/')
.replace('T', ' ')
.replace(new RegExp(/\.[\d]{3}/gm), '');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000;
}
date = new Date(time)
date = new Date(time);
}
const formatObj = {
y: date.getFullYear(),
@@ -27,18 +30,20 @@ export function parseTime(time, pattern) {
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
a: date.getDay(),
};
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
let value = formatObj[key];
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value];
}
return value || 0
})
return time_str
if (result.length > 0 && value < 10) {
value = '0' + value;
}
return value || 0;
});
return time_str;
}
// 表单重置
@@ -51,9 +56,12 @@ export function resetForm(refName) {
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
let search = params;
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
search.params =
typeof search.params === 'object' && search.params !== null && !Array.isArray(search.params)
? search.params
: {};
dateRange = Array.isArray(dateRange) ? dateRange : [];
if (typeof (propName) === 'undefined') {
if (typeof propName === 'undefined') {
search.params['beginTime'] = dateRange[0];
search.params['endTime'] = dateRange[1];
} else {
@@ -64,10 +72,13 @@ export function addDateRange(params, dateRange, propName) {
}
export function addDateRanges(params, dateRange1, dateRange2, propName) {
let search = params;
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
search.params =
typeof search.params === 'object' && search.params !== null && !Array.isArray(search.params)
? search.params
: {};
dateRange1 = Array.isArray(dateRange1) ? dateRange1 : [];
dateRange2 = Array.isArray(dateRange2) ? dateRange2 : [];
if (typeof (propName) === 'undefined') {
if (typeof propName === 'undefined') {
search.params['beginTime'] = dateRange1[0];
search.params['endTime'] = dateRange1[1];
search.params['timeFrom'] = dateRange2[0];
@@ -84,15 +95,15 @@ export function addDateRanges(params, dateRange1, dateRange2, propName) {
// 回显数据字典
export function selectDictLabel(datas, value) {
if (value === undefined) {
return "";
return '';
}
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + value)) {
if (datas[key].value == '' + value) {
actions.push(datas[key].label);
return true;
}
})
});
if (actions.length === 0) {
actions.push(value);
}
@@ -101,33 +112,35 @@ export function selectDictLabel(datas, value) {
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
if (value === undefined || value.length ===0) {
return "";
if (value === undefined || value.length === 0) {
return '';
}
if (Array.isArray(value)) {
value = value.join(",");
value = value.join(',');
}
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var currentSeparator = undefined === separator ? ',' : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
var match = false;
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + temp[val])) {
if (datas[key].value == '' + temp[val]) {
actions.push(datas[key].label + currentSeparator);
match = true;
}
})
});
if (!match) {
actions.push(temp[val] + currentSeparator);
}
})
});
return actions.join('').substring(0, actions.join('').length - 1);
}
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
var args = arguments,
flag = true,
i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
@@ -141,16 +154,16 @@ export function sprintf(str) {
// 转换字符串undefined,null等转化为""
export function parseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
if (!str || str == 'undefined' || str == 'null') {
return '';
}
return str;
}
// 千位分隔
export function thousandNumber (num) {
export function thousandNumber(num) {
return String(num).replace(/\B(?=(\d{3})+(?!\d))/g, ','); // 3是千分位4是万分位
};
}
// 数据合并
export function mergeRecursive(source, target) {
@@ -166,7 +179,7 @@ export function mergeRecursive(source, target) {
}
}
return source;
};
}
/**
* 构造树型结构数据
@@ -179,7 +192,7 @@ export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
childrenList: children || 'children'
childrenList: children || 'children',
};
var childrenListMap = {};
@@ -220,51 +233,50 @@ export function handleTree(data, id, parentId, children) {
}
/**
* 参数处理
* @param {*} params 参数
*/
* 参数处理
* @param {*} params 参数
*/
export function tansParams(params) {
let result = ''
let result = '';
for (const propName of Object.keys(params)) {
const value = params[propName];
var part = encodeURIComponent(propName) + "=";
if (value !== null && value !== "" && typeof (value) !== "undefined") {
var part = encodeURIComponent(propName) + '=';
if (value !== null && value !== '' && typeof value !== 'undefined') {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
if (value[key] !== null && value[key] !== '' && typeof value[key] !== 'undefined') {
let params = propName + '[' + key + ']';
var subPart = encodeURIComponent(params) + "=";
result += subPart + encodeURIComponent(value[key]) + "&";
var subPart = encodeURIComponent(params) + '=';
result += subPart + encodeURIComponent(value[key]) + '&';
}
}
} else {
result += part + encodeURIComponent(value) + "&";
result += part + encodeURIComponent(value) + '&';
}
}
}
return result
return result;
}
// 返回项目路径
export function getNormalPath(p) {
if (p.length === 0 || !p || p == 'undefined') {
return p
};
let res = p.replace('//', '/')
return p;
}
let res = p.replace('//', '/');
if (res[res.length - 1] === '/') {
return res.slice(0, res.length - 1)
return res.slice(0, res.length - 1);
}
return res;
}
// 验证是否为blob格式
export function blobValidate(data) {
return data.type !== 'application/json'
return data.type !== 'application/json';
}
// 按照频次天数计算总数量
export function calculateQuantityByDays(frequency, days){
export function calculateQuantityByDays(frequency, days) {
// const dict = useDict('rate_code').rate_code.value
// const rate = dict.find(item => item.value === frequency).remark
// if(rate){
@@ -273,20 +285,20 @@ export function calculateQuantityByDays(frequency, days){
// return undefined
// }
const frequencyMap = {
ST: undefined,
QD: 1, // 每日一次
ST: 1,
QD: 1, // 每日一次
BID: 2, // 每日两次
TID: 3, // 每日三次
QID: 4, // 每日四次
QN: 1, // 每晚一次
QOD: 1 / 2, // 每隔一日一次
QW: 1 / 7, // 每周一次
QW: 1 / 7, // 每周一次
BIW: 2 / 7, // 每周两次
TIW: 3 / 7, // 每周三次
QOW: 1 / 14, // 隔周一次
}
if(!frequencyMap[frequency]){
return
};
if (!frequencyMap[frequency]) {
return;
}
const quantity = frequencyMap[frequency] * days;
return quantity < 1 ? 1 : Math.ceil(quantity);
@@ -316,4 +328,134 @@ export function handleColor(a, b, status) {
}
}
return 'default';
}
}
/**
* 获取系统可用打印机列表
* @returns {Array} 打印机列表
*/
export function getPrinterList() {
try {
const printerList =
window.hiprint && window.hiprint.hiwebSocket
? window.hiprint.hiwebSocket.getPrinterList()
: [];
return printerList || [];
} catch (error) {
console.error('获取打印机列表失败:', error);
return [];
}
}
/**
* 从缓存获取上次选择的打印机
* @returns {string} 打印机名称
*/
export function getCachedPrinter() {
return localStorage.getItem('selectedPrinter') || '';
}
/**
* 保存打印机选择到缓存
* @param {string} printerName 打印机名称
*/
export function savePrinterToCache(printerName) {
if (printerName) {
localStorage.setItem('selectedPrinter', printerName);
}
}
/**
* 执行打印操作
* @param {Array} data 打印数据
* @param {Object} template 打印模板
* @param {string} printerName 打印机名称(可选)
* @param {Object} options 打印选项(可选)
* @returns {Promise} 打印结果Promise
*/
export function executePrint(data, template, printerName, options = {}) {
return new Promise((resolve, reject) => {
try {
if (!window.hiprint) {
throw new Error('打印插件未加载');
}
const hiprintTemplate = new window.hiprint.PrintTemplate({ template });
const printOptions = {
title: '打印标题',
height: 210,
width: 148,
...options,
};
// 如果指定了打印机,添加到打印选项中
if (printerName) {
printOptions.printer = printerName;
// 保存到缓存
savePrinterToCache(printerName);
}
// 打印成功回调
hiprintTemplate.on('printSuccess', function (e) {
resolve({ success: true, event: e });
});
// 打印失败回调
hiprintTemplate.on('printError', function (e) {
reject({ success: false, event: e, message: '打印失败' });
});
// 执行打印
hiprintTemplate.print2(data, printOptions);
} catch (error) {
reject({ success: false, error: error, message: error.message || '打印过程中发生错误' });
}
});
}
/**
* 选择打印机并执行打印
* @param {Array} data 打印数据
* @param {Object} template 打印模板
* @param {Function} showPrinterDialog 显示打印机选择对话框的函数
* @param {Object} modal 消息提示对象
* @param {Function} callback 打印完成后的回调函数
*/
export async function selectPrinterAndPrint(data, template, showPrinterDialog, modal, callback) {
try {
// 获取打印机列表
const printerList = getPrinterList();
if (printerList.length === 0) {
modal.msgWarning('未检测到可用打印机');
return;
}
// 获取缓存的打印机
const cachedPrinter = getCachedPrinter();
let selectedPrinter = '';
// 判断打印机选择逻辑
if (printerList.length === 1) {
selectedPrinter = printerList[0].name;
await executePrint(data, template, selectedPrinter);
if (callback) callback();
} else if (cachedPrinter && printerList.some((printer) => printer.name === cachedPrinter)) {
selectedPrinter = cachedPrinter;
await executePrint(data, template, selectedPrinter);
if (callback) callback();
} else {
// 调用显示打印机选择对话框的函数
showPrinterDialog(printerList, async (chosenPrinter) => {
try {
await executePrint(data, template, chosenPrinter);
if (callback) callback();
} catch (error) {
modal.msgError(error.message || '打印失败');
}
});
}
} catch (error) {
modal.msgError(error.message || '获取打印机列表失败');
}
}

View File

@@ -0,0 +1,80 @@
import request from '@/utils/request'
const baseUrl='/document/statistics/definition'
// 初始化
export function init() {
return request({
url: `${baseUrl}/init`,
method: 'get'
})
}
// 新增
export function add(data) {
return request({
url: `${baseUrl}/add`,
method: 'post',
data
})
}
// 修改
export function update(data) {
return request({
url: `${baseUrl}/update`,
method: 'post',
data
})
}
// 删除
export function deleteStatistics(id) {
return request({
url: `${baseUrl}/deleteDocStatisticsDefinition`,
method: 'delete',
params: {
id
}
})
}
// 页查询列表-不包含options
export function getPageList(query) {
return request({
url: `${baseUrl}/getPageList`,
method: 'get',
params: query
})
}
// 根据id获取统计定义详情
export function getDocStatisticsDefinitionById(id) {
return request({
url: `${baseUrl}/getDocStatisticsDefinitionById`,
method: 'get',
params: {id}
})
}
// 根据code获取统计定义详情
export function getDocStatisticsDefinitionByCode(code) {
return request({
url: `${baseUrl}/getDocStatisticsDefinitionByCode`,
method: 'get',
params: {code}
})
}
// 获取文档统计定义选项列表并按指定格式返回
export function getOptionList() {
return request({
url: `${baseUrl}/getOptionList`,
method: 'get',
params: {}
})
}
// 获取文档统计定义列表(包含options即字典数据)
// isStatistics
// integer
// (query)
// 文档统计定义是否启用 0不统计 1统计 可不传
export function getListWithOptionList(isStatistics=undefined) {
return request({
url: `${baseUrl}/getListWithOptionList`,
method: 'get',
params: {isStatistics}
})
}

View File

@@ -0,0 +1,132 @@
<template>
<!-- 病历文件基本信息弹窗 -->
<el-dialog
:title="formData.id ? '编辑模板' : '新增模板'"
v-model="dialogVisible"
width="900px"
destroy-on-close
@open="handleOpen"
>
<!-- 使用el-form包裹表单 -->
<el-form :model="formData" ref="formRef" :rules="rules" label-width="120px">
<el-row :gutter="24" class="mb8">
<el-col :span="24">
<el-form-item label="模板名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入模板名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="使用范围" prop="useRange">
<el-radio-group v-model="formData.useRange">
<el-radio :value="0" size="large">全院</el-radio>
<el-radio :value="1" size="large">指定机构</el-radio>
<el-radio :value="2" size="large">指定用户</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入版本"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer"></div>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</template>
</el-dialog>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import useUserStore from '@/store/modules/user';
import { ElMessage } from 'element-plus';
import { components } from '@/template';
const emits = defineEmits(['submitOk']);
const props = defineProps({
formData: {
type: Object,
default: () => ({}),
},
});
const formRef = ref(null);
const dialogVisible = defineModel('dialogVisible', {
type: Boolean,
default: false,
});
// 表单数据
const formData = ref({
id: 0,
name: '',
displayOrder: 0,
contextJson: '',
definitionId: 0,
useRange: 2,
organizationId: 0,
userId: 0,
remark: '',
});
// 表单验证规则(响应式,支持动态验证)
const rules = reactive({
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
});
const handleOpen = () => {
if (props.formData) {
formData.value = props.formData;
} else {
resetForm();
}
};
// 提交表单
const submitForm = () => {
formRef.value.validate((valid) => {
if (valid) {
// 表单验证通过,执行保存操作
saveForm();
} else {
// 表单验证失败
ElMessage.error('请填写必填项');
return false;
}
});
};
// 保存表单
const saveForm = async () => {
// try {
// // 如果有当前节点数据,表示是编辑操作
// if (formData.value.id && formData.value.id !== '') {
// const res = await updateTemplate(formData.value);
// if (res.code == 200) {
// ElMessage.success('更新成功');
// emits('submitOk');
// } else {
// ElMessage.error('更新失败', error);
// }
// } else {
// // 新建操作
// const res = await addTemplate(formData.value);
// if (res.code == 200) {
// ElMessage.success('保存成功');
// emits('submitOk');
// } else {
// ElMessage.error('保存失败', error);
// }
// }
// } catch (error) {
// console.log(error);
// // ElMessage.error('保存失败',error);
// }
};
// 重置表单
const resetForm = () => {
formRef.value?.resetFields();
};
onMounted(() => {});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,298 @@
<template>
<div class="app-container case-templates-statistics-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
<el-form-item label="名称" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="请输入名称搜索"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="statisticsList">
<el-table-column label="属性名称" align="center" prop="name" />
<el-table-column label="属性代码" align="center" prop="code" />
<el-table-column label="属性类型" align="center" prop="typeEnum">
<template #default="scope">
{{ typeEnums(scope.row.typeEnum) }}
</template>
</el-table-column>
<el-table-column label="统计值单位" align="center" prop="unit" />
<el-table-column label="是否必填" align="center" prop="required">
<template #default="scope">
{{ scope.row.required === 1 ? '必填' : '不必填' }}
</template>
</el-table-column>
<el-table-column label="是否统计" align="center" prop="isStatistics">
<template #default="scope">
{{ scope.row.isStatistics === 1 ? '统计' : '不统计' }}
</template>
</el-table-column>
<el-table-column label="字典名称" align="center" prop="dictName"> </el-table-column>
<el-table-column label="字典类型" align="center" prop="dictType"> </el-table-column>
<el-table-column label="备注" align="center" prop="remark"> </el-table-column>
<el-table-column
label="操作"
width="180"
align="center"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="statisticsRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="属性名称" prop="name">
<el-input v-model="form.name" placeholder="请输入属性名称" />
</el-form-item>
<el-form-item label="属性代码" prop="code">
<el-input v-model="form.code" placeholder="请输入属性代码" />
</el-form-item>
<el-form-item label="岗位顺序" prop="displayOrder">
<el-input-number v-model="form.displayOrder" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="属性类型" prop="typeEnum">
<el-radio-group v-model="form.typeEnum">
<el-radio v-for="dict in typeEnumsOptions" :key="dict.value" :label="dict.value">{{
dict.info
}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否必填" prop="required">
<el-switch
v-model="form.required"
:active-value="1"
:inactive-value="0"
active-text=""
inactive-text=""
inline-prompt
/>
</el-form-item>
<el-form-item label="是否统计" prop="isStatistics">
<el-switch
v-model="form.isStatistics"
:active-value="1"
:inactive-value="0"
active-text=""
inactive-text=""
inline-prompt
/>
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入统计值单位" />
</el-form-item>
<el-form-item label="字典名称" prop="dictType">
<el-select v-model="form.dictType" style="width: 100%" filterable>
<el-option
v-for="item in typeOptions"
:key="item.dictId"
:label="item.dictName"
:value="item.dictType"
>
<span style="float: left">{{ item.dictName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.dictType }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Post">
import { init, add, update, getPageList, deleteStatistics } from './api';
import { optionselect as getDictOptionselect, getType } from '@/api/system/dict/type';
const { proxy } = getCurrentInstance();
const { sys_normal_disable } = proxy.useDict('sys_normal_disable');
const statisticsList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const total = ref(0);
const title = ref('');
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
},
rules: {
name: [{ required: true, message: '请输入属性名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入属性代码', trigger: 'blur' }],
},
});
const { queryParams, form, rules } = toRefs(data);
/** 查询岗位列表 */
function getList() {
loading.value = true;
getPageList(queryParams.value).then((response) => {
statisticsList.value = response.data.records;
total.value = response.data.total;
loading.value = false;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
form.value = {
id: undefined, // ID
name: '', // 名称
typeEnum: 1, // 类型枚举
code: '', // 编码
required: 0, // 是否必填(0-否 1-是)
remark: '', // 备注
unit: '', // 单位
isStatistics: 1, // 是否统计(0-否 1-是)
displayOrder: 0, // 显示顺序
dictName: '', //字典名称
dictType: '', //字典类型
};
proxy.resetForm('statisticsRef');
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNo = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef');
handleQuery();
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = '添加统计';
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
form.value = row;
open.value = true;
title.value = '修改统计';
}
/** 提交按钮 */
function submitForm() {
proxy.$refs['statisticsRef'].validate((valid) => {
if (form.value.dictType ) {
form.value.dictName=typeOptions.value.find((item) => item.dictType == form.value.dictType)?.dictName || form.value.dictName;
}
if (valid) {
if (form.value.id != undefined) {
update(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功');
open.value = false;
getList();
});
} else {
add(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功');
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
proxy.$modal
.confirm('是否确认删除编号为"' + row.id + '"的数据项?')
.then(function () {
return deleteStatistics(row.id);
})
.then(() => {
getList();
proxy.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
const typeEnumsOptions = ref([]);
const typeEnums = (value) => {
if (typeEnumsOptions.value.length) {
return typeEnumsOptions.value.find((item) => item.value == value)?.info || '未知';
}
};
const initPage = async () => {
try {
const response = await init();
typeEnumsOptions.value = response.data.doc_statistics_definition_type_enums || {};
} catch (error) {}
};
const typeOptions = ref([]);
/** 查询字典类型列表 */
function getTypeList() {
getDictOptionselect().then((response) => {
typeOptions.value = response.data;
});
}
initPage();
getTypeList();
getList();
</script>
<style scoped lang="scss">
.case-templates-statistics-container {
// height: calc(100vh - 84px);
.toolbar {
height: 48px;
display: flex;
padding: 0 8px;
align-items: center;
}
.statistics-data-container {
height: calc(100% - 48px);
}
}
</style>

View File

@@ -0,0 +1,144 @@
<template>
<div class="case-templates-statistics-container">
<div class="toolbar">
<el-space>
<el-input v-model="queryParams.searchKey" placeholder="请输入名称搜索" clearable />
<el-button @click="refresh">查询</el-button>
<el-button type="primary" @click="newTemplate">新建</el-button>
</el-space>
</div>
<div class="statistics-data-container">
<el-table
:data="statisticsData"
node-key="id"
>
<el-table-column prop="name" label="名称" />
<el-table-column prop="count" label="数量" />
<el-table-column label="操作" >
<template #default="scope">
<el-button type="primary" @click="editStatistics(scope.row)">编辑</el-button>
<el-button type="danger" @click="deleteStatistics(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<EditStatistics
v-model:dialogVisible="dialogVisible"
:title="currentNodeData ? '编辑病历文件信息' : '病历文件基本信息'"
:formData="formData"
:currentNodeData="currentNodeData"
@submitOk="handleSubmitOk"
/>
</template>
<script setup>
// 从Vue导入所需的API
import { ref, reactive, onMounted, defineAsyncComponent, nextTick, watch } from 'vue';
import { ElMessageBox, ElMessage, } from 'element-plus';
import { getPageList, init, } from './api';
import EditStatistics from './components/editStatistics.vue';
const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: ''
});
const currentNodeData = ref(null); // 存储当前选中的节点数据
// 弹窗可见性
const dialogVisible = ref(false);
// 表单数据
const formData = reactive({
id:''
});
const initFormData = () => {
formData.id = '';
};
const handleSubmitOk = () => {
dialogVisible.value = false;
refresh();
};
// 组件初始化时加载基础数据
onMounted(() => {
getInit(); // 加载模板初始化数据(一级菜单、使用范围等)
handleOrgClear(); // 初始化模板树(加载所有科室模板)
});
// 统计数据
const statisticsData = ref([]);
/** 过滤节点科室TreeSelect搜索 */
const filterNode = (value, data) => {
if (!value) return true;
return data?.name.toLowerCase().includes(value.toLowerCase()); // 不区分大小写搜索
};
/** 加载模板初始化数据(一级菜单、使用范围枚举) */
const getInit = async () => {
try {
const response = await init();
templateDataInit.value = response.data || {};
console.log('模板初始化数据:', templateDataInit.value);
} catch (error) {
handleApiError('初始化', '初始化接口异常')(error);
}
};
/** 编辑模板(打开弹窗并回显数据) */
const editStatistics = async () => {
};
/** 打开编辑弹窗,回显选中的模板数据并正确初始化科室选择 */
const openEditDialog = async (nodeData) => {
};
const getList = async () => {
try {
const response = await getTreeList();
statisticsData.value = response?.data || [];
} catch (error) {
}
};
const refresh = () => {
getList();
};
// 新建模版统计
const newTemplate = () => {
dialogVisible.value = true;
};
// 删除统计
const deleteStatistics = async () => {
};
</script>
<style scoped lang="scss">
.case-templates-statistics-container {
display: flex;
flex-direction: column;
height: 91vh;
.toolbar {
height: 48px;
display: flex;
padding: 0 8px;
align-items: center;
}
.statistics-data-container{
height: calc(100% - 48px);
}
}
</style>

View File

@@ -136,7 +136,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="拆零比" prop="partPercent">
<el-input v-model="form.partPercent" placeholder="" />
<el-input-number v-model="form.partPercent" controls-position="right" placeholder="" :min="1"/>
</el-form-item>
</el-col>
<el-col :span="8">

View File

@@ -115,6 +115,11 @@
>启用</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="Upload" @click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="Search" @click="getList">查询</el-button>
</el-col>
@@ -337,10 +342,34 @@
}
"
/>
<!-- 诊疗目录导入对话框 -->
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
</div>
</template>
</el-upload>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DiagnosisTreatment">
import { getToken } from "@/utils/auth";
import {
getDiagnosisTreatmentList,
stopDiseaseTreatment,
@@ -373,6 +402,23 @@ const currentData = ref({});
const viewData = ref({});
const currentCategoryEnum = ref('');
/*** 诊疗目录导入参数 */
const upload = reactive({
// 是否显示弹出层
open: false,
// 弹出层标题
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: import.meta.env.VITE_APP_BASE_API + "/data-dictionary/diagnosis-treatment/import-data"
});
const data = reactive({
form: {},
queryParams: {
@@ -475,6 +521,38 @@ function handleExport() {
);
}
/** 导入按钮操作 */
function handleImport() {
upload.title = '诊疗目录导入';
upload.open = true;
}
/** 下载模板操作 */
function importTemplate() {
proxy.download('/data-dictionary/diagnosis-treatment/import-template', {}, `diagnosis_treatment_template_${new Date().getTime()}.xlsx`);
}
/**文件上传中处理 */
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true;
};
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
proxy.$refs['uploadRef'].handleRemove(file);
proxy.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
'</div>',
'导入结果',
{ dangerouslyUseHTMLString: true }
);
getList();
};
/** 提交上传文件 */
function submitFileForm() {
proxy.$refs['uploadRef'].submit();
}
/** 选择条数 */
function handleSelectionChange(selection) {
console.log(selection, 'selection');

View File

@@ -287,7 +287,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="拆零比" prop="partPercent">
<el-input v-model="form.partPercent" placeholder="" />
<el-input-number v-model="form.partPercent" controls-position="right" placeholder="" :min="1"/>
</el-form-item>
</el-col>

View File

@@ -70,6 +70,7 @@
<script setup>
import { getYbMedicationList, queryYbCatalogue } from './medicine';
import { formatDateStr } from '@/utils/index';
const emit = defineEmits(['selectMedicine']);
const visible = ref(false);
@@ -107,28 +108,33 @@ function cancel() {
}
function handlewAddMedicine(row) {
queryYbCatalogue({ hilistCode: row.medicalCatalogCode, dateStr: '2020-01-01' }).then((res) => {
if (res.data.length > 0) {
let resultList = res.data.filter((item) => {
return (
item.memo != null &&
item.memo != '' &&
item.memo != 'null' &&
item.memo != '目录变更' &&
item.memo != '历史数据迁移' &&
item.memo != '0' &&
item.memo != ' '
);
});
if (resultList.length > 0) {
row.restrictedFlag = 1;
row.restrictedScope = resultList[0].memo;
queryYbCatalogue({
hilistCode: row.medicalCatalogCode,
dateStr: formatDateStr(new Date(), 'YYYY') + '-01-01',
})
.then((res) => {
if (res.data.length > 0) {
let resultList = res.data.filter((item) => {
return (
item.memo != null &&
item.memo != '' &&
item.memo != 'null' &&
item.memo != '目录变更' &&
item.memo != '历史数据迁移' &&
item.memo != '0' &&
item.memo != ' '
);
});
if (resultList.length > 0) {
row.restrictedFlag = 1;
row.restrictedScope = resultList[0].memo;
}
}
}
emit('selectMedicine', row);
}).catch(() => {
emit('selectMedicine', row);
});
emit('selectMedicine', row);
})
.catch(() => {
emit('selectMedicine', row);
});
cancel();
}

View File

@@ -298,7 +298,6 @@ async function printReceipt(param) {
const printerList = hiprintTemplate.getPrinterList();
console.log(hiprintTemplate, '打印机列表');
hiprintTemplate.print2(result.data[0], {
printer: 'xp',
title: '门诊收费结算单',
});
// // 将对象转换为 JSON 字符串
@@ -361,22 +360,14 @@ async function submit() {
})
.then((res) => {
if (res.code == 200) {
printReceipt(res.data);
(formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }]),
emit('close', 'success', res.msg);
emit('refresh'); // 发送刷新事件给父组件
// 长春大学自动发耗材
if (userStore.fixmedinsCode == 'H22010200672' && props.consumablesIdList.length > 0) {
dispenseMedicalConsumables(props.consumablesIdList);
}
// // 添加确认窗口
// proxy.$modal
// .confirm('是否打印收费结算单?')
// .then(() => {
// printReceipt(res.data);
// })
// .catch(() => {
// // 用户取消打印
// console.log('用户取消打印');
// });
}
})
.finally(() => {

View File

@@ -4,8 +4,9 @@
"index": 0,
"name": 1,
"paperType": "自定义",
"height": 200,
"height": 160,
"width": 80,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"overPrintOptions": {
"content": "",
@@ -32,10 +33,10 @@
"printElements": [
{
"options": {
"left": 55.5,
"top": 24,
"left": 45,
"top": 15,
"height": 16.5,
"width": 120,
"width": 142.5,
"title": "长大医院门诊收费结算单",
"coordinateSync": false,
"widthHeightSync": false,
@@ -43,35 +44,17 @@
"letterSpacing": 0.75,
"textAlign": "center",
"qrCodeLevel": 0,
"fontSize": 10
"fontSize": 12
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 142.5,
"top": 45,
"height": 80,
"width": 70,
"textAlign": "center",
"title": "院内门诊号",
"qrCodeLevel": 0,
"coordinateSync": false,
"widthHeightSync": false,
"field": "encounterBusNo"
},
"printElementType": {
"title": "二维码",
"type": "qrcode"
}
},
{
"options": {
"left": 15,
"top": 55.5,
"top": 39,
"height": 14,
"width": 80,
"title": "姓名",
@@ -87,8 +70,8 @@
},
{
"options": {
"left": 15,
"top": 78,
"left": 99,
"top": 39,
"height": 14,
"width": 60,
"title": "性别",
@@ -104,8 +87,8 @@
},
{
"options": {
"left": 75,
"top": 78,
"left": 163.5,
"top": 39,
"height": 14,
"width": 60,
"title": "年龄",
@@ -122,7 +105,7 @@
{
"options": {
"left": 15,
"top": 105,
"top": 60,
"height": 14,
"width": 120,
"title": "病人类型",
@@ -138,8 +121,8 @@
},
{
"options": {
"left": 15,
"top": 127.5,
"left": 13.5,
"top": 82.5,
"height": 14,
"width": 120,
"title": "病历号",
@@ -155,10 +138,10 @@
},
{
"options": {
"left": 15,
"top": 157,
"left": 13.5,
"top": 102,
"height": 37.5,
"width": 200,
"width": 208.5,
"title": "undefined+beforeDragIn",
"field": "chargedItems",
"coordinateSync": false,
@@ -169,12 +152,12 @@
"columns": [
[
{
"title": "收费名称",
"title": "项目名称",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 70.07165247626199,
"width": 61.93559159547676,
"field": "itemName",
"checked": true,
"columnId": "itemName",
@@ -182,13 +165,27 @@
"rowspan": 1,
"colspan": 1
},
{
"title": "单价",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 37.1097311853845,
"field": "unitPrice",
"checked": true,
"columnId": "unitPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "数量",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 38.66458945433993,
"width": 37.12571954521698,
"field": "quantityValue",
"checked": true,
"columnId": "quantityValue",
@@ -197,12 +194,12 @@
"colspan": 1
},
{
"title": "金额",
"title": "总价",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 50.90935931687881,
"width": 35.15170328143829,
"field": "totalPrice",
"checked": true,
"columnId": "totalPrice",
@@ -216,7 +213,7 @@
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 40.354398752519245,
"width": 37.17725439248345,
"field": "contractName",
"checked": true,
"columnId": "contractName",
@@ -261,15 +258,15 @@
},
{
"options": {
"left": 15,
"top": 225,
"height": 14,
"width": 180,
"title": "个人现金支付金额",
"left": 138,
"top": 147,
"height": 9.75,
"width": 84,
"title": "合计金额",
"field": "itemTotalAmount",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_CASH_PAY"
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
@@ -278,95 +275,10 @@
},
{
"options": {
"left": 15,
"top": 250,
"left": 6,
"top": 171,
"height": 14,
"width": 180,
"title": "个人负担总金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 275,
"height": 14,
"width": 180,
"title": "基金支付总额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_FUND_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 13.5,
"top": 300,
"height": 14,
"width": 180,
"title": "基本医保统筹基金支出",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_TC_FUND_AMOUNT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 325,
"height": 14,
"width": 180,
"title": "个人医保账户支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_YB_ZH_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 349.5,
"height": 14,
"width": 180,
"title": "全自费金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "FULAMT_OWNPAY_AMT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 375,
"height": 14,
"width": 180,
"width": 88.5,
"title": "应收金额",
"coordinateSync": false,
"widthHeightSync": false,
@@ -380,10 +292,10 @@
},
{
"options": {
"left": 15,
"top": 400,
"left": 132,
"top": 171,
"height": 14,
"width": 180,
"width": 88.5,
"title": "实收金额",
"coordinateSync": false,
"widthHeightSync": false,
@@ -397,10 +309,78 @@
},
{
"options": {
"left": 15,
"top": 425,
"left": 6,
"top": 190.5,
"height": 14,
"width": 180,
"width": 117,
"title": "基金支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_FUND_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 132,
"top": 190.5,
"height": 13.5,
"width": 88.5,
"title": "统筹支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_TC_FUND_AMOUNT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 211.5,
"height": 14,
"width": 117,
"title": "个人医保账户支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_YB_ZH_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 235.5,
"height": 14,
"width": 115.5,
"title": "全自费金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "FULAMT_OWNPAY_AMT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 133.5,
"top": 235.5,
"height": 14,
"width": 87,
"title": "应找零",
"coordinateSync": false,
"widthHeightSync": false,
@@ -414,14 +394,15 @@
},
{
"options": {
"left": 15,
"top": 450,
"left": 6,
"top": 256.5,
"height": 14,
"width": 100,
"title": "收费员",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"field": "userName"
},
"printElementType": {
"title": "文本",
@@ -430,8 +411,8 @@
},
{
"options": {
"left": 15,
"top": 475,
"left": 6,
"top": 277.5,
"height": 14,
"width": 170,
"title": "收费时间",

View File

@@ -1,31 +1,63 @@
<template>
<div style="display: flex; justify-content: space-between" class="app-container" v-loading="readCardLoading"
:element-loading-text="loadingText">
<div
style="display: flex; justify-content: space-between"
class="app-container"
v-loading="readCardLoading"
:element-loading-text="loadingText"
>
<el-card style="width: 30%">
<template #header>
<span style="vertical-align: middle">患者列表</span>
</template>
<div style="width: 100%">
<el-input v-model="queryParams.searchKey" placeholder="请输入患者名/病历号" clearable
style="width: 48%; margin-bottom: 10px; margin-right: 10px" @keyup.enter="getPatientList">
<el-input
v-model="queryParams.searchKey"
placeholder="请输入患者名/病历号"
clearable
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
@keyup.enter="getPatientList"
>
<template #append>
<el-button icon="Search" @click="getPatientList" />
</template>
</el-input>
<el-select v-model="queryParams.statusEnum" style="width: 48%; margin-bottom: 10px; margin-right: 10px"
placeholder="收费状态" @change="getPatientList">
<el-option v-for="item in chargeStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
<el-select
v-model="queryParams.statusEnum"
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
placeholder="收费状态"
@change="getPatientList"
>
<el-option
v-for="item in chargeStatusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<div style="width: 100%">
<el-date-picker v-model="receptionTime" type="daterange" range-separator="~" start-placeholder="开始时间"
end-placeholder="结束时间" placement="bottom" value-format="YYYY-MM-DD"
style="width: 84%; margin-bottom: 10px; margin-right: 10px" @change="getPatientList"/>
<el-date-picker
v-model="receptionTime"
type="daterange"
range-separator="~"
start-placeholder="开始时间"
end-placeholder="结束时间"
placement="bottom"
value-format="YYYY-MM-DD"
style="width: 84%; margin-bottom: 10px; margin-right: 10px"
@change="getPatientList"
/>
<el-button type="primary" style="margin-bottom: 10px" @click="getPatientList">
搜索
</el-button>
</div>
<el-table ref="patientListRef" height="620" :data="patientList" row-key="encounterId" @cell-click="clickRow"
highlight-current-row>
<el-table
ref="patientListRef"
height="620"
:data="patientList"
row-key="encounterId"
@cell-click="clickRow"
highlight-current-row
>
<el-table-column label="病历号" align="center" prop="encounterBusNo" />
<el-table-column label="姓名" align="center" prop="patientName" />
<!-- <el-table-column label="时间" align="center" prop="receptionTime" width="160">
@@ -48,9 +80,12 @@
{{ patientInfo.genderEnum_enumText }}
</el-descriptions-item>
<el-descriptions-item label="年龄:">{{ patientInfo.age }}</el-descriptions-item>
<el-descriptions-item label="科室:">{{ patientInfo.organizationName }}</el-descriptions-item>
<el-descriptions-item label="就诊时间:">{{ formatDateStr(patientInfo.receptionTime, "YYYY-MM-DD HH:mm:ss")
}}</el-descriptions-item>
<el-descriptions-item label="科室:">{{
patientInfo.organizationName
}}</el-descriptions-item>
<el-descriptions-item label="就诊时间:">{{
formatDateStr(patientInfo.receptionTime, 'YYYY-MM-DD HH:mm:ss')
}}</el-descriptions-item>
<!-- <el-descriptions-item label="身份证号:">{{ patientInfo.idCard }}</el-descriptions-item> -->
<!-- <el-descriptions-item label="手机号">{{ patientInfo.name }}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{ patientInfo.name }}</el-descriptions-item> -->
@@ -67,23 +102,47 @@
<el-button type="primary" plain @click="handleReadCard('01')" style="width: 65px">
电子凭证
</el-button>
<el-button type="primary" plain @click="handleReadCard('02')" style="width: 65px" :disabled="true">
<el-button
type="primary"
plain
@click="handleReadCard('02')"
style="width: 65px"
:disabled="true"
>
身份证
</el-button>
<el-button type="primary" plain @click="handleReadCard('03')" style="width: 65px">
医保卡
</el-button>
<el-button type="primary" @click="payToSelt()" style="margin-left: 20px" :disabled="buttonDisabled">
<el-button
type="primary"
@click="payToSelt()"
style="margin-left: 20px"
:disabled="buttonDisabled"
>
医保转自费
</el-button>
<el-button type="primary" @click="patToMedicalInsurance()" style="margin-left: 20px"
:disabled="buttonDisabled">
<el-button
type="primary"
@click="patToMedicalInsurance()"
style="margin-left: 20px"
:disabled="buttonDisabled"
>
自费转医保
</el-button>
<span style="float: right">合计金额{{ totalAmounts ? totalAmounts.toFixed(2) : 0 }}</span>
<span style="float: right"
>合计金额{{ totalAmounts ? totalAmounts.toFixed(2) : 0 }}</span
>
</div>
<el-table ref="chargeListRef" height="530" :data="chargeList" row-key="id"
@selection-change="handleSelectionChange" v-loading="chargeLoading" border>
<el-table
ref="chargeListRef"
height="530"
:data="chargeList"
row-key="id"
@selection-change="handleSelectionChange"
v-loading="chargeLoading"
border
>
<el-table-column type="selection" :selectable="checkSelectable" width="55" />
<el-table-column label="单据号" align="center" prop="busNo" width="180" />
<el-table-column label="收费项目" align="center" prop="itemName" width="200" />
@@ -93,7 +152,10 @@
<el-table-column label="费用性质" align="center" prop="contractName" />
<el-table-column label="收费状态" align="center" prop="statusEnum_enumText" width="150">
<template #default="scope">
<el-tag :type="scope.row.statusEnum === 1 ? 'default' : 'success'" disable-transitions>
<el-tag
:type="scope.row.statusEnum === 1 ? 'default' : 'success'"
disable-transitions
>
{{ scope.row.statusEnum_enumText }}
</el-tag>
</template>
@@ -120,6 +182,7 @@
:paymentId="paymentId"
:details="details"
:chargedItems="chargedItems"
@refresh="getPatientList"
/>
</div>
</template>
@@ -249,7 +312,7 @@ const consumablesIdList = ref([]);
// 确认收费
function confirmCharge() {
let selectRows = chargeListRef.value.getSelectionRows();
console.log('selectRows:',selectRows);
console.log('selectRows:', selectRows);
if (selectRows.length == 0) {
proxy.$modal.msgWarning('请选择一条收费项目');
return;
@@ -477,4 +540,4 @@ function patToMedicalInsurance() {
});
}
</script>
<style scoped></style>
<style scoped></style>

View File

@@ -355,7 +355,7 @@ function getPatientInfo(idCard) {
};
getOutpatientRegistrationList(param).then((res) => {
console.log(param, 'param');
if (res.data.records.length > 0) {
if (res.data.records.length == 1) {
patientInfo.value = res.data.records[0];
console.log(patientInfo.value, 'patientInfo.value');
// 将表单数据发送给父组件

View File

@@ -6,6 +6,28 @@
"paperType": "A4",
"height": 297,
"width": 210,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "14px",
"rotate": 25,
"width": 175,
"height": 200,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {
"layoutType": "column",
"layoutRowGap": 0,
"layoutColumnGap": 0
},
"paperHeader": 0,
"paperFooter": 841.8897637795277,
"printElements": [
@@ -714,6 +736,46 @@
"type": "text"
}
},
{
"options": {
"left": 416.5,
"top": 191.5,
"height": 13.5,
"width": 45,
"title": "体检费",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "1"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 465,
"top": 192,
"height": 13.5,
"width": 84,
"title": "体检费",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "9999",
"textAlign": "right",
"testData": "20000.00",
"hideTitle": true,
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value ? value.toFixed(2) + ' 元' : '0.00' + ' 元'\n}"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 16.5,
@@ -1372,8 +1434,8 @@
},
{
"options": {
"left": 19,
"top": 368.5,
"left": 16.5,
"top": 363,
"height": 13.5,
"width": 76.5,
"title": "省医保总额",
@@ -1388,50 +1450,10 @@
"type": "text"
}
},
{
"options": {
"left": 81.5,
"top": 369.5,
"height": 13.5,
"width": 75,
"title": "文本",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "provinceYbTotal",
"textAlign": "right",
"testData": "20000.00",
"hideTitle": true,
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value ? value.toFixed(2) + ' 元' : '0.00' + ' 元'\n}"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 164,
"top": 369.5,
"height": 13.5,
"width": 64.5,
"title": "市医保总额",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "1"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 220.5,
"top": 370.5,
"top": 363,
"height": 13.5,
"width": 75,
"title": "文本",
@@ -1450,10 +1472,129 @@
"type": "text"
}
},
{
"options": {
"left": 81.5,
"top": 363.5,
"height": 13.5,
"width": 75,
"title": "文本",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "provinceYbTotal",
"textAlign": "right",
"testData": "20000.00",
"hideTitle": true,
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value ? value.toFixed(2) + ' 元' : '0.00' + ' 元'\n}"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 162.5,
"top": 363.5,
"height": 13.5,
"width": 64.5,
"title": "市医保总额",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "1"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 17,
"top": 389,
"height": 13.5,
"width": 76.5,
"title": "现金收入总额",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "1"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 79.5,
"top": 390,
"height": 13.5,
"width": 75,
"title": "文本",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "totalCash",
"textAlign": "right",
"testData": "20000.00",
"hideTitle": true,
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value ? value.toFixed(2) + ' 元' : '0.00' + ' 元'\n}"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 163.5,
"top": 390,
"height": 13.5,
"width": 64.5,
"title": "体检人次",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "1"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 218.5,
"top": 391,
"height": 13.5,
"width": 75,
"title": "体检人次",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 9,
"qrCodeLevel": 0,
"field": "physicalExaminationCount",
"textAlign": "right",
"testData": "20000.00",
"hideTitle": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 397.5,
"top": 426,
"height": 9,
"width": 567,
"borderWidth": "1.5",
@@ -1468,7 +1609,7 @@
{
"options": {
"left": 162,
"top": 411,
"top": 439.5,
"height": 13.5,
"width": 76.5,
"title": "制表人",
@@ -1486,7 +1627,7 @@
{
"options": {
"left": 216,
"top": 411,
"top": 439.5,
"height": 13.5,
"width": 75,
"title": "文本",
@@ -1507,7 +1648,7 @@
{
"options": {
"left": 333,
"top": 411,
"top": 439.5,
"height": 13.5,
"width": 76.5,
"title": "制表时间",
@@ -1525,7 +1666,7 @@
{
"options": {
"left": 390,
"top": 411,
"top": 439.5,
"height": 13.5,
"width": 129,
"title": "文本",
@@ -1545,29 +1686,7 @@
}
],
"paperNumberLeft": 389,
"paperNumberTop": 573,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "14px",
"rotate": 25,
"width": 175,
"height": 200,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {
"layoutType": "column",
"layoutRowGap": 0,
"layoutColumnGap": 0
}
"paperNumberTop": 573
}
]
}

View File

@@ -155,15 +155,15 @@
</el-col> -->
<el-col :span="5">
<span class="label">微信</span>
<span class="value">{{ formatValue(reportValue['0000cash']) }}</span>
<span class="value">{{ formatValue(reportValue.vxCashSum) }}</span>
</el-col>
<el-col :span="5">
<span class="label">支付宝</span>
<span class="value">{{ '0.00 元' }}</span>
<span class="value">{{ formatValue(reportValue.aliCashSum) }}</span>
</el-col>
<el-col :span="5">
<span class="label">网银</span>
<span class="value">{{ '0.00 元' }}</span>
<span class="value">{{ formatValue(reportValue.peisCnt) }}</span>
</el-col>
</el-row>
<!-- <el-row
@@ -312,6 +312,36 @@
}}</span>
</el-col>
</el-row>
<el-row
:gutter="10"
outpatientNo="mb8"
style="
margin: 20px 0;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 0 20px;
"
>
<el-col :span="5">
<span class="label">现金收入总额</span>
<span class="value">
{{
formatValue(
(reportValue['220100cash'] || 0) +
(reportValue['229900cash'] || 0) +
(reportValue['0000cash'] || 0)
)
}}
</span>
</el-col>
<el-col :span="5">
<span class="label">体检人次</span>
<span class="value">
{{ getPhysicalExaminationCount() }}
</span>
</el-col>
</el-row>
</div>
</div>
</template>
@@ -389,6 +419,14 @@ function getContract() {
});
}
function getPhysicalExaminationCount() {
if (reportValue.value['9999']) {
return reportValue.value['9999'] / 105 + ' 人';
} else {
return '0 人';
}
}
function processObjectWithFinType(obj) {
return Object.keys(obj).map((key) => {
const matchedItem = fin_type_code.value.find((item) => item.value === key);
@@ -431,6 +469,11 @@ async function print() {
(reportValue.value['229900zhSum'] || 0) + (reportValue.value['229900fundSum'] || 0),
municipalYbTotal:
(reportValue.value['220100zhSum'] || 0) + (reportValue.value['220100fundSum'] || 0),
totalCash:
(reportValue.value['220100cash'] || 0) +
(reportValue.value['229900cash'] || 0) +
(reportValue.value['0000cash'] || 0),
physicalExaminationCount: getPhysicalExaminationCount(),
},
],
};

View File

@@ -585,7 +585,6 @@ function printBottleLabel() {
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
console.log(result, '打印机列表');
hiprintTemplate.print2(result, {
printer: 'Xprinter XP-365B',
height: 210,
width: 148,
});

View File

@@ -16,12 +16,24 @@
<el-table-column label="单次剂量" align="center">
<template #default="scope">
<span>
{{ parseFloat(scope.row.dose).toFixed(2) + scope.row.doseUnitCode_dictText }}
{{
parseFloat(scope.row.dose).toFixed(2) === '0.00'
? '-'
: parseFloat(scope.row.dose).toFixed(2) + scope.row.doseUnitCode_dictText
}}
</span>
</template>
</el-table-column>
<el-table-column label="规格" align="center" prop="volume" />
<el-table-column label="用法" align="center" prop="methodCode_dictText" />
<!-- 修改价格列从inventoryList中获取价格 -->
<!-- <el-table-column label="价格" align="center">
<template #default="scope">
<span>
{{ getPriceFromInventory(scope.row) }}
</span>
</template>
</el-table-column> -->
<el-table-column label="库存数量" align="center">
<template #default="scope">{{ handleQuantity(scope.row) }}</template>
</el-table-column>
@@ -101,6 +113,7 @@ getList();
function getList() {
queryParams.value.organizationId = props.patientInfo.orgId;
getAdviceBaseInfo(queryParams.value).then((res) => {
console.log('ssssssssss', res.data.records);
if (res.data.records.length > 0) {
adviceBaseList.value = res.data.records.filter((item) => {
if (item.adviceType == 1 || item.adviceType == 2) {
@@ -117,7 +130,14 @@ function getList() {
}
});
}
// 从priceList列表中获取价格
function getPriceFromInventory(row) {
if (row.priceList && row.priceList.length > 0) {
const price = row.priceList[0].price || 0;
return Number(price).toFixed(2) + ' 元';
}
return '-';
}
// 处理键盘事件
const handleKeyDown = (event) => {
const key = event.key;
@@ -182,9 +202,9 @@ defineExpose({
handleKeyDown,
});
</script>
<style scoped>
.popover-table-wrapper:focus {
outline: 2px solid #409eff; /* 聚焦时的高亮效果 */
}
</style>
</style>

View File

@@ -179,6 +179,17 @@ export function getEncounterDiagnosis(encounterId) {
})
}
/**
*
* 获取诊断集合数据
*/
export function getDiagnosisList(searchKey) {
return request({
url: '/doctor-station/diagnosis/get-diagnosis-list?searchKey=' + searchKey,
method: 'get',
})
}
/**
*
* 删除就诊诊断
@@ -671,3 +682,25 @@ export function getOrderGroup(data) {
params: data
})
}
/**
* 查询诊疗项目耗材绑定信息
*/
export function getActivityBindDevice(data) {
return request({
url: '/doctor-station/advice/activity-bind-device-info',
method: 'get',
params: data
})
}
/**
* 是否是食源性诊断
*/
export function isFoodDiseasesNew(params) {
return request({
url: '/external-integration/foodborne-acquisition/is-food-diseases-new',
method: 'get',
params: params
})
}

View File

@@ -85,7 +85,7 @@
</template>
</el-dialog>
</template>
<script setup>
import {
getTcmCondition,
@@ -418,4 +418,4 @@ function close() {
padding: 20px 0;
text-align: center;
}
</style>
</style>

View File

@@ -202,6 +202,7 @@ import {
getChronicDisease,
getTcmDiagnosis,
delEncounterDiagnosis,
isFoodDiseasesNew,
} from '../api';
import diagnosisdialog from '../diagnosis/diagnosisdialog.vue';
import AddDiagnosisDialog from './addDiagnosisDialog.vue';
@@ -455,6 +456,18 @@ function handleSaveDiagnosis() {
getList();
emits('diagnosisSave', false);
proxy.$modal.msgSuccess('诊断已保存');
//食源性疾病病例数据智能采集 ---START---
isFoodDiseasesNew({
encounterId: props.patientInfo.encounterId,
}).then((res) => {
if (res.code == 200) {
let jumpUrl = res.data;
if (jumpUrl) {
window.open(jumpUrl, '_blank');
}
}
});
//食源性疾病病例数据智能采集 ---END---
}
});
}
@@ -548,4 +561,4 @@ defineExpose({ getList, getDetail, handleSaveDiagnosis });
display: flex;
align-items: center;
}
</style>
</style>

View File

@@ -31,17 +31,20 @@
</el-col> -->
</el-row>
<el-table
ref="diagnosisDefinitionRef"
:data="diagnosisDefinitionList"
row-key="patientId"
@cell-click="clickRow"
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column label="诊断名称" align="center" prop="name" />
<el-table-column label="医保编码" align="center" prop="ybNo" />
</el-table>
<el-scrollbar height="400px">
<el-table
ref="diagnosisDefinitionRef"
:data="diagnosisDefinitionList"
row-key="patientId"
@cell-click="clickRow"
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column label="诊断名称" align="center" prop="name" />
<el-table-column label="医保编码" align="center" prop="ybNo" />
</el-table>
</el-scrollbar>
<pagination
v-show="total > 0"
:total="total"
@@ -58,10 +61,10 @@
</template>
</el-dialog>
</template>
<script setup>
import { computed } from "vue";
import { getDiagnosisDefinitionList, saveDiagnosisBind } from "../api";
import { computed } from 'vue';
import { getDiagnosisDefinitionList, saveDiagnosisBind } from '../api';
const radio = ref(1);
const props = defineProps({
@@ -74,7 +77,7 @@ const props = defineProps({
default: '',
},
});
const emit = defineEmits(["close"]);
const emit = defineEmits(['close']);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
@@ -83,7 +86,7 @@ const queryParams = ref({
const diagnosisDefinitionList = ref([]);
const selectRow = ref({});
const title = computed(() => {
return props.radio == "个人" ? "个人常用诊断" : "科室常用诊断";
return props.radio == '个人' ? '个人常用诊断' : '科室常用诊断';
});
getList();
@@ -98,10 +101,10 @@ function submit() {
saveDiagnosisBind({
definitionId: selectRow.value.id,
definitionName: selectRow.value.name,
bindingEnum: props.radio == "个人" ? 1 : 2,
bindingEnum: props.radio == '个人' ? 1 : 2,
}).then((res) => {
if (res.code == 200) {
emit("close", "success");
emit('close', 'success');
}
});
}
@@ -111,7 +114,7 @@ function queryDiagnosisUse() {
}
function close() {
emit("close");
emit('close');
}
function clickRow(row) {
@@ -120,7 +123,11 @@ function clickRow(row) {
</script>
<style scoped>
:deep( .pagination-container .el-pagination) {
:deep(.pagination-container .el-pagination) {
right: 20px !important;
}
</style>
:deep(.el-dialog__body) {
max-height: 10vh; /* 设置最大高度为视口高度的 60% */
overflow-y: auto; /* 超出时显示纵向滚动条 */
}
</style>

View File

@@ -1,22 +1,23 @@
<template>
<div>
<el-table
ref="emrTemplateRef"
:data="emrTemplate"
row-key="id"
highlight-current-row
@cell-click="clickRow"
>
<el-table-column label="模板名称" align="center" prop="templateName" />
<el-table-column label="使用范围" align="center" prop="useScopeCode" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button link type="primary" @click.stop="handelDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<el-scrollbar height="200px">
<el-table
ref="emrTemplateRef"
:data="emrTemplate"
row-key="id"
highlight-current-row
@cell-click="clickRow"
>
<el-table-column label="模板名称" align="center" prop="templateName" />
<el-table-column label="使用范围" align="center" prop="useScopeCode" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button link type="primary" @click.stop="handelDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-scrollbar>
<pagination
v-show="total > 0"
:total="total"
@@ -26,14 +27,14 @@
/>
</div>
</template>
<script setup>
import { getEmrTemplateList, deleteEmrTemplate } from "../api";
import { getEmrTemplateList, deleteEmrTemplate } from '../api';
const queryParams = ref({});
const emrTemplate = ref([]);
const emrTemplateRef = ref();
const emits = defineEmits(["selectRow"]);
const emits = defineEmits(['selectRow']);
const { proxy } = getCurrentInstance();
const selectRow = ref({});
const props = defineProps({
@@ -42,12 +43,12 @@ const props = defineProps({
required: true,
},
});
getList();
// getList();
function getList() {
queryParams.value.useScopeCode = 1;
getEmrTemplateList(queryParams.value).then((res) => {
emrTemplate.value = res.data.records;
console.log(emrTemplate.value,"emrTemplate.value")
console.log(emrTemplate.value, 'emrTemplate.value');
});
}
@@ -55,15 +56,15 @@ function clickRow(row) {
console.log(2123);
selectRow.value = JSON.parse(row.contextJson);
emits("selectRow", selectRow.value);
emits('selectRow', selectRow.value);
}
function handelDelete(row) {
deleteEmrTemplate(row.id.toString()).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("删除成功");
proxy.$modal.msgSuccess('删除成功');
getList();
}
});
}
</script>
</script>

View File

@@ -88,18 +88,22 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="诊断:" prop="conditionId" label-width="100px">
<el-form-item label="诊断:" prop="conditionDefId" label-width="100px">
<el-select
v-model="conditionId"
v-model="conditionDefId"
placeholder="诊断"
style="width: 180px"
style="width: 220px"
filterable
remote-show-suffix
remote
:remote-method="getInit"
:disabled="title == '查看处方'"
>
<el-option
v-for="item in diagnosisList"
:key="item.conditionId"
v-for="item in diagnosisListOption"
:key="item.id"
:label="item.name"
:value="item.conditionId"
:value="item.id"
/>
</el-select>
</el-form-item>
@@ -115,6 +119,36 @@
</el-form-item>
</el-col> -->
</el-row>
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="慢病诊断:" prop="speConditionId" label-width="100px">
<el-select
v-model="speConditionId"
placeholder="慢病时必填,非慢病不填"
style="width: 220px"
:disabled="title == '查看处方'"
>
<el-option
v-for="item in speDiagnosisList"
:key="item.ybNo"
:label="item.name"
:value="item.ybNo"
/>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="就诊ID" prop="encounterId" label-width="100px">
<el-input
v-model="infoForm.encounterId"
placeholder="就诊ID"
clearable
style="width: 260px"
disabled
/>
</el-form-item>
</el-col> -->
</el-row>
</el-form>
<el-form :model="form" ref="formRef" :rules="rowRules">
<div style="margin-bottom: 5px" v-if="title != '查看处方'">
@@ -393,12 +427,12 @@
</template>
<script setup>
import { computed } from 'vue';
import { computed, onMounted, ref } from 'vue';
// import { calculateQuantityByDays, formatNumber } from '@/utils/his';
import { reactive } from 'vue';
// import { useModal, useDict } from '@/hooks';
import { parseTime, formatNumber } from '@/utils/his';
import { queryYbCatalogue } from './api';
import { queryYbCatalogue, getDiagnosisList } from './api';
import { debounce } from 'lodash-es';
import {
@@ -409,6 +443,7 @@ import {
getEncounterDiagnosis,
deletePrescriptionInfo,
getMedicationInfo,
getChronicDisease,
} from './api';
import prescriptionMedicineList from './prescription/prescriptionMedicineList';
const { proxy } = getCurrentInstance();
@@ -462,10 +497,14 @@ const medicineSearchKey = ref('');
const conditionId = ref(undefined);
const selectRow = ref({});
const diagnosisList = ref([]);
const speDiagnosisList = ref([]);
const prescriptionTypeList = ref([]);
const form = reactive({
medicationInfoList: [],
});
const diagnosisListOption = ref([])
const conditionDefId = ref('')
const speConditionId = ref('')
const infoForm = reactive({
patientId: '', // 患者
@@ -524,6 +563,14 @@ const unitMap = ref({
unit: 'unit',
});
function getInit(searchKey) {
if(searchKey) {
getDiagnosisList(searchKey).then(res => {
diagnosisListOption.value = res.data
})
}
}
function open() {
conditionId.value = props.prescriptionData.conditionId;
getDiagnosisInfo();
@@ -566,9 +613,13 @@ function getDiagnosisInfo() {
});
diagnosisInfo.value = diagnosisInfo[0];
if (title.value === '新增处方') {
conditionId.value = diagnosisInfo[0].conditionId;
conditionId.value = diagnosisInfo[0].id;
}
});
getChronicDisease({ encounterId: props.patient.encounterId }).then((res) => {
speDiagnosisList.value = res.data;
});
}
/**
@@ -735,6 +786,8 @@ function submit() {
encounterId: infoForm.encounterId,
prescriptionNo: infoForm.prescriptionNo,
conditionId: conditionId.value,
conditionDefId: conditionDefId.value,
opspDiseCode: speConditionId.value,
// rxTypeCode: infoForm.rxTypeCode,
validityDays: infoForm.validityDays,
extensionReason: infoForm.extensionReason,

View File

@@ -108,7 +108,10 @@ function handleUseOrderGroup(row) {
}
function getList() {
getAdviceHistoryInfo({ patientId: props.patientInfo.patientId, encounterId: props.patientInfo.encounterId }).then((res) => {
getAdviceHistoryInfo({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
}).then((res) => {
orderList.value = res.data;
});
}
@@ -116,4 +119,4 @@ function getList() {
defineExpose({
handleOpen,
});
</script>
</script>

View File

@@ -350,6 +350,11 @@
:label="item.label"
@click="
() => {
if (item.type == unitMap['minUnit']) {
scope.row.unitPrice = scope.row.minUnitPrice;
} else {
scope.row.unitPrice = scope.row.unitTempPrice;
}
scope.row.unitCode_dictText = item.label;
}
"
@@ -728,6 +733,7 @@ import {
updateGroupId,
getContract,
getAdviceBaseInfo,
getActivityBindDevice,
} from '../api';
import adviceBaseList from '../advicebaselist';
import { computed, getCurrentInstance, nextTick, watch } from 'vue';
@@ -736,6 +742,7 @@ import OrderGroupDrawer from './orderGroupDrawer';
import PrescriptionHistory from './prescriptionHistory';
import Decimal from 'decimal.js';
import useUserStore from '@/store/modules/user';
import { ElMessageBox } from 'element-plus';
const emit = defineEmits(['selectDiagnosis']);
const total = ref(0);
@@ -986,6 +993,21 @@ function handleChange(value) {
* 选择药品回调
*/
function selectAdviceBase(key, row) {
if (row.adviceType == 3) {
getActivityBindDevice({ activityId: row.adviceDefinitionId }).then((res) => {
if (res.data.activityBindDeviceInfos?.length > 0) {
ElMessageBox.confirm('该诊疗项目已绑定所需耗材,点击确定将自动添加到医嘱列表', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
closeOnPressEscape: false,
}).then(() => {
handleSaveGroup(res.data.activityBindDeviceInfos);
});
}
});
}
getOrgList();
unitCodeList.value = [];
unitCodeList.value.push({ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' });
@@ -1064,6 +1086,7 @@ function selectAdviceBase(key, row) {
prescriptionList.value[rowIndex.value].inventoryId = stock.inventoryId;
prescriptionList.value[rowIndex.value].locationId = stock.locationId;
prescriptionList.value[rowIndex.value].unitPrice = stock.price;
prescriptionList.value[rowIndex.value].unitTempPrice = stock.price;
prescriptionList.value[rowIndex.value].minUnitPrice = new Decimal(stock.price)
.div(row.partPercent)
.toFixed(2);
@@ -1310,14 +1333,17 @@ function handleSaveSign(row, index) {
row.minUnitQuantity = row.quantity;
}
row.conditionId = conditionId.value;
// if (row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit') {
// row.unitPrice = row.unitPrice;
// } else {
// row.unitCode_dictText = row.unitCodeList.find(
// (item) => item.value == row.minUnitCode
// ).label;
// row.unitPrice = row.minUnitPrice;
// }
// 处理总量为小单位情况,需要把单价也保存成小单位的
if (row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit') {
if (row.adviceType != 3) {
row.unitPrice = row.unitTempPrice;
}
} else {
row.unitCode_dictText = row.unitCodeList.find(
(item) => item.value == row.minUnitCode
).label;
row.unitPrice = row.minUnitPrice;
}
row.conditionDefinitionId = conditionDefinitionId.value;
row.encounterDiagnosisId = encounterDiagnosisId.value;
row.diagnosisName = diagnosisName.value;
@@ -1429,7 +1455,7 @@ function setValue(row) {
// 库存列表 + 价格列表拼成批次号的下拉框
if (row.adviceType != 3) {
if (row.inventoryList && row.inventoryList.length == 0) {
expandOrder.value = [];
// expandOrder.value = [];
proxy.$modal.msgWarning('该项目无库存');
return;
}
@@ -1457,6 +1483,9 @@ function setValue(row) {
prescriptionList.value[rowIndex.value].locationId = stock.locationId;
prescriptionList.value[rowIndex.value].unitPrice = stock.price;
prescriptionList.value[rowIndex.value].positionName = stock.locationName;
prescriptionList.value[rowIndex.value].minUnitPrice = new Decimal(stock.price)
.div(row.partPercent)
.toFixed(2);
}
} else {
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId;
@@ -1496,6 +1525,7 @@ function handleSaveGroup(orderGroupList) {
prescriptionList.value[rowIndex.value] = {
...prescriptionList.value[rowIndex.value],
// ...orderGroupValue,
uniqueKey: nextId.value++,
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
accountId: accountId.value,
@@ -1802,10 +1832,14 @@ const groupMarkers = ref([]);
// 计算总价
function calculateTotalPrice(row, index) {
nextTick(() => {
if (row.unitCode == row.minUnitCode) {
row.totalPrice = new Decimal(row.unitPrice).div(row.partPercent) * row.quantity;
} else {
if (row.adviceType == 3) {
row.totalPrice = (row.unitPrice * row.quantity * 100) / 100;
} else {
if (row.unitCode == row.minUnitCode) {
row.totalPrice = row.minUnitPrice * row.quantity;
} else {
row.totalPrice = (row.unitPrice * row.quantity * 100) / 100;
}
}
});
}

View File

@@ -0,0 +1,269 @@
<template>
<div class="hospital-record-form">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="病案首页(一)" name="first">
<medicalRecordFirst :formData="formData"></medicalRecordFirst>
</el-tab-pane>
<el-tab-pane label="病案首页(二)" name="second">
<medicalRecordSecond :formData="formData"></medicalRecordSecond>
</el-tab-pane>
<el-tab-pane label="病案附页(一)" name="third"></el-tab-pane>
</el-tabs>
<div class="form-footer">
<button @click="printForm" class="print-btn">打印表单</button>
<button @click="resetForm" class="reset-btn">重置表单</button>
</div>
</div>
</template>
<script setup>
import { ref, reactive } from 'vue';
import medicalRecordFirst from './components/medicalRecordFirst.vue';
import medicalRecordSecond from './components/medicalRecordSecond.vue';
import medicalRecordFirstPrint from './components/medicalRecordFirstPrint.json';
// 表单数据
const formData = reactive({
hospital: {
orgCode: '41275054-7',
paymentMethod: '城乡居民基本医疗保险'
},
patient: {
healthCardNo: '',
name: '',
gender: '',
birthDate: '',
age: '',
nationality: '中国',
nativePlace: '',
ethnicity: '汉族',
idCardNo: '',
householdAddress: '',
workUnit: '',
contactName: '',
contactRelation: '',
contactAddress: '',
contactPhone: ''
},
admission: {
times: 1,
hospitalNo: '',
recordNo: '',
channel: '',
admitTime: '',
department: '',
ward: '',
confirmDate: '',
dischargeTime: '',
dischargeDepartment: '',
dischargeWard: '',
hospitalDays: ''
},
diagnosis: {
mainDiagnosis: '',
otherDiagnosis: ''
},
medicalInfo: {
bloodTransfusion: '2',
bloodType: '',
rhType: '',
drugAllergy: '1'
},
doctorInfo: {
departmentDirector: '',
chiefPhysician: '',
attendingPhysician: '',
residentPhysician: '',
chargeNurse: '',
chiefResident: '',
intern: '',
recordQuality: '1',
coder: '',
qualityControlDate: ''
}
});
const activeName = ref('first');
// 打印表单
const printForm = () => {
// 创建一个新的打印窗口
const printWindow = window.open('', '_blank');
let printContent
// 获取模板字符串并替换转义的插值标记
if(activeName.value == 'first') {
printContent = medicalRecordFirstPrint.printContent;
}else if(activeName.value == 'second') {
}else {
}
// 这里可以进行实际的数据替换操作
printContent = printContent.replace(/\$\{([^}]+)\}/g, (match, expr) => {
// 简单示例实际应根据expr内容进行数据提取
return eval(expr); // 注意实际使用中应避免eval这里仅为示例
});
// 将内容写入打印窗口并打印
printWindow.document.write(printContent);
printWindow.document.close();
}
function handleClick() {
}
// 重置表单
const resetForm = () => {
Object.keys(formData).forEach(key => {
if (typeof formData[key] === 'object') {
Object.keys(formData[key]).forEach(subKey => {
formData[key][subKey] = '';
});
} else {
formData[key] = '';
}
});
// 重置默认值
formData.hospital.orgCode = '41275054-7';
formData.hospital.paymentMethod = '城乡居民基本医疗保险';
formData.patient.nationality = '中国';
formData.patient.ethnicity = '汉族';
formData.admission.times = 1;
formData.medicalInfo.bloodTransfusion = '2';
formData.medicalInfo.drugAllergy = '1';
formData.doctorInfo.recordQuality = '1';
};
</script>
<style scoped>
.hospital-record-form {
font-family: 'SimSun', serif;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: white;
}
.form-header {
text-align: center;
margin-bottom: 30px;
}
.hospital-name {
font-size: 24px;
margin-bottom: 10px;
}
.form-title {
font-size: 20px;
padding-bottom: 10px;
margin-bottom: 20px;
display: inline-block;
}
.section {
margin-bottom: 30px;
border: 1px solid #ccc;
padding: 15px;
border-radius: 5px;
}
.section-title {
font-weight: bold;
margin-bottom: 15px;
padding-bottom: 5px;
border-bottom: 1px solid #ccc;
}
.form-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 15px;
}
.form-item {
flex: 1;
min-width: 200px;
margin-right: 15px;
margin-bottom: 8px;
}
.form-item.full-width {
flex: 0 0 100%;
min-width: 100%;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
font-size: 14px;
}
input, select, textarea {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-family: inherit;
font-size: 14px;
}
textarea {
min-height: 80px;
resize: vertical;
}
.form-footer {
display: flex;
justify-content: center;
margin-top: 30px;
}
.print-btn, .reset-btn {
padding: 10px 20px;
margin: 0 10px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
.print-btn {
background-color: #4CAF50;
color: white;
}
.reset-btn {
background-color: #f44336;
color: white;
}
/* 打印样式 */
@media print {
body {
margin: 0;
padding: 0;
background-color: white;
}
.hospital-record-form {
box-shadow: none;
padding: 0;
}
.form-footer {
display: none;
}
@page {
size: A4;
margin: 2cm;
}
}
</style>

View File

@@ -0,0 +1,472 @@
<template>
<div class="form-header">
<h2 class="form-title">住院病案首页</h2>
</div>
<div class="form-content">
<!-- 医院信息 -->
<div class="section">
<div class="section-title">医院信息</div>
<div class="form-row">
<div class="form-item">
<label>组织机构代码:</label>
<el-input type="text" v-model="formData.hospital.orgCode" placeholder="41275054-7" />
</div>
<div class="form-item">
<label>医疗付费方式:</label>
<el-select v-model="formData.hospital.paymentMethod">
<el-option value="">请选择</el-option>
<el-option value="城镇职工基本医疗保险">城镇职工基本医疗保险</el-option>
<el-option value="城乡居民基本医疗保险">城乡居民基本医疗保险</el-option>
<el-option value="自费">自费</el-option>
<el-option value="其他">其他</el-option>
</el-select>
</div>
</div>
</div>
<!-- 患者基本信息 -->
<div class="section">
<div class="section-title">患者基本信息</div>
<div class="form-row">
<div class="form-item">
<label>健康卡号:</label>
<el-input type="text" v-model="formData.patient.healthCardNo" />
</div>
<div class="form-item">
<label>姓名:</label>
<el-input type="text" v-model="formData.patient.name" />
</div>
<div class="form-item">
<label>性别:</label>
<el-select v-model="formData.patient.gender">
<el-option value="" label="请选择"></el-option>
<el-option value="1" label="男"></el-option>
<el-option value="2" label="女"></el-option>
</el-select>
</div>
<div class="form-item">
<label>出生日期:</label>
<el-date-picker v-model="formData.patient.birthDate" type="date" size="default"></el-date-picker>
</div>
<div class="form-item">
<label>年龄:</label>
<el-input type="number" max="120" min="0" v-model="formData.patient.age" />
</div>
<div class="form-item">
<label>国籍:</label>
<el-input type="text" v-model="formData.patient.nationality" placeholder="中国" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>籍贯:</label>
<el-input type="text" v-model="formData.patient.nativePlace" />
</div>
<div class="form-item">
<label>民族:</label>
<el-input type="text" v-model="formData.patient.ethnicity" placeholder="汉族" />
</div>
<div class="form-item">
<label>身份证号:</label>
<el-input type="text" v-model="formData.patient.idCardNo" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>户口地址:</label>
<el-input type="text" v-model="formData.patient.householdAddress" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>工作单位及地址:</label>
<el-input type="text" v-model="formData.patient.workUnit" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>联系人姓名:</label>
<el-input type="text" v-model="formData.patient.contactName" />
</div>
<div class="form-item">
<label>关系:</label>
<el-input type="text" v-model="formData.patient.contactRelation" />
</div>
<div class="form-item">
<label>地址:</label>
<el-input type="text" v-model="formData.patient.contactAddress" />
</div>
<div class="form-item">
<label>电话:</label>
<el-input type="text" v-model="formData.patient.contactPhone" />
</div>
</div>
</div>
<!-- 住院信息 -->
<div class="section">
<div class="section-title">住院信息</div>
<div class="form-row">
<div class="form-item">
<label>第几次住院:</label>
<el-input type="number" v-model="formData.admission.times" min="1" />
</div>
<div class="form-item">
<label>住院号:</label>
<el-input type="text" v-model="formData.admission.hospitalNo" />
</div>
<div class="form-item">
<label>病案号:</label>
<el-input type="text" v-model="formData.admission.recordNo" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>入院途径:</label>
<el-select v-model="formData.admission.channel">
<el-option value="">请选择</el-option>
<el-option value="1">急诊</el-option>
<el-option value="2">门诊</el-option>
<el-option value="3">其他医疗机构转入</el-option>
</el-select>
</div>
<div class="form-item">
<label>入院时间:</label>
<el-input type="date" v-model="formData.admission.admitTime" />
</div>
<div class="form-item">
<label>入院科室:</label>
<el-input type="text" v-model="formData.admission.department" />
</div>
<div class="form-item">
<label>病房:</label>
<el-input type="text" v-model="formData.admission.ward" />
</div>
<div class="form-item">
<label>确诊日期:</label>
<el-input type="date" v-model="formData.admission.confirmDate" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>出院时间:</label>
<el-input type="datetime-local" v-model="formData.admission.dischargeTime" />
</div>
<div class="form-item">
<label>出院科室:</label>
<el-input type="text" v-model="formData.admission.dischargeDepartment" />
</div>
<div class="form-item">
<label>病房:</label>
<el-input type="text" v-model="formData.admission.dischargeWard" />
</div>
<div class="form-item">
<label>实际住院天数:</label>
<el-input type="number" v-model="formData.admission.hospitalDays" />
</div>
</div>
</div>
<!-- 诊断信息 -->
<div class="section">
<div class="section-title">诊断信息</div>
<div class="form-row">
<div class="form-item full-width">
<label>主要诊断:</label>
<el-input type="text" v-model="formData.diagnosis.mainDiagnosis" placeholder="腰椎间盘突出症(L4-5)" />
</div>
</div>
<div class="form-row">
<div class="form-item full-width">
<label>其他诊断:</label>
<el-input type="textarea" v-model="formData.diagnosis.otherDiagnosis" placeholder="腰椎管狭窄(L4-5)\n右下肢不全瘫"></el-input>
</div>
</div>
</div>
<!-- 医疗信息 -->
<div class="section">
<div class="section-title">医疗信息</div>
<div class="form-row">
<div class="form-item">
<label>是否输血:</label>
<el-select v-model="formData.medicalInfo.bloodTransfusion">
<el-option value="">请选择</el-option>
<el-option value="1"></el-option>
<el-option value="2"></el-option>
</el-select>
</div>
<div class="form-item">
<label>血型:</label>
<el-select v-model="formData.medicalInfo.bloodType">
<el-option value="">请选择</el-option>
<el-option value="A">A</el-option>
<el-option value="B">B</el-option>
<el-option value="AB">AB</el-option>
<el-option value="O">O</el-option>
<el-option value="不详">不详</el-option>
</el-select>
</div>
<div class="form-item">
<label>Rh:</label>
<el-select v-model="formData.medicalInfo.rhType">
<el-option value="">请选择</el-option>
<el-option value="1"></el-option>
<el-option value="2"></el-option>
<el-option value="3">不详</el-option>
</el-select>
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>药物过敏史:</label>
<el-select v-model="formData.medicalInfo.drugAllergy">
<el-option value="">请选择</el-option>
<el-option value="1" label="无"></el-option>
<el-option value="2" label="有过敏药物"></el-option>
</el-select>
</div>
</div>
</div>
<!-- 医师信息 -->
<div class="section">
<div class="section-title">医师信息</div>
<div class="form-row">
<div class="form-item">
<label>科主任:</label>
<el-input type="text" v-model="formData.doctorInfo.departmentDirector" />
</div>
<div class="form-item">
<label>主任(副主任)医师:</label>
<el-input type="text" v-model="formData.doctorInfo.chiefPhysician" />
</div>
<div class="form-item">
<label>主治医师:</label>
<el-input type="text" v-model="formData.doctorInfo.attendingPhysician" />
</div>
<div class="form-item">
<label>住院医师:</label>
<el-input type="text" v-model="formData.doctorInfo.residentPhysician" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>责任护士:</label>
<el-input type="text" v-model="formData.doctorInfo.chargeNurse" />
</div>
<div class="form-item">
<label>住院总医师:</label>
<el-input type="text" v-model="formData.doctorInfo.chiefResident" />
</div>
<div class="form-item">
<label>实习医师:</label>
<el-input type="text" v-model="formData.doctorInfo.intern" />
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>病案质量:</label>
<el-select v-model="formData.doctorInfo.recordQuality">
<el-option value="">请选择</el-option>
<el-option value="1" label="甲"></el-option>
<el-option value="2" label="乙"></el-option>
<el-option value="3" label="丙"></el-option>
</el-select>
</div>
<div class="form-item">
<label>编码员:</label>
<el-input type="text" v-model="formData.doctorInfo.coder" />
</div>
<div class="form-item">
<label>质控日期:</label>
<el-input type="date" v-model="formData.doctorInfo.qualityControlDate" />
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, reactive } from 'vue';
// 表单数据
const formData = reactive({
hospital: {
orgCode: '41275054-7',
paymentMethod: '城乡居民基本医疗保险'
},
patient: {
healthCardNo: '',
name: '',
gender: '',
birthDate: '',
age: '',
nationality: '中国',
nativePlace: '',
ethnicity: '汉族',
idCardNo: '',
householdAddress: '',
workUnit: '',
contactName: '',
contactRelation: '',
contactAddress: '',
contactPhone: ''
},
admission: {
times: 1,
hospitalNo: '',
recordNo: '',
channel: '',
admitTime: '',
department: '',
ward: '',
confirmDate: '',
dischargeTime: '',
dischargeDepartment: '',
dischargeWard: '',
hospitalDays: ''
},
diagnosis: {
mainDiagnosis: '',
otherDiagnosis: ''
},
medicalInfo: {
bloodTransfusion: '2',
bloodType: '',
rhType: '',
drugAllergy: '1'
},
doctorInfo: {
departmentDirector: '',
chiefPhysician: '',
attendingPhysician: '',
residentPhysician: '',
chargeNurse: '',
chiefResident: '',
intern: '',
recordQuality: '1',
coder: '',
qualityControlDate: ''
}
});
</script>
<style scoped>
.hospital-record-form {
font-family: 'SimSun', serif;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: white;
}
.form-header {
text-align: center;
margin-bottom: 30px;
}
.hospital-name {
font-size: 24px;
margin-bottom: 10px;
}
.form-title {
font-size: 20px;
padding-bottom: 10px;
margin-bottom: 20px;
display: inline-block;
}
.section {
margin-bottom: 30px;
border: 1px solid #ccc;
padding: 15px;
border-radius: 5px;
}
.section-title {
font-weight: bold;
margin-bottom: 15px;
padding-bottom: 5px;
border-bottom: 1px solid #ccc;
}
.form-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 15px;
}
.form-item {
flex: 1;
min-width: 200px;
margin-right: 15px;
margin-bottom: 8px;
}
.form-item.full-width {
flex: 0 0 100%;
min-width: 100%;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
font-size: 14px;
}
input, select, textarea {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-family: inherit;
font-size: 14px;
}
textarea {
min-height: 80px;
resize: vertical;
}
.form-footer {
display: flex;
justify-content: center;
margin-top: 30px;
}
.print-btn, .reset-btn {
padding: 10px 20px;
margin: 0 10px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
.print-btn {
background-color: #4CAF50;
color: white;
}
.reset-btn {
background-color: #f44336;
color: white;
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,345 @@
<template>
<div style="width: 100%">
<div style="margin-bottom: 5px">
<el-button type="primary" @click="handleAddPrescription()" :disabled="false">
新增
</el-button>
<el-button type="danger" plain @click="handleDelete()" :disabled="false"> 删除 </el-button>
</div>
<el-table
max-height="650"
ref="prescriptionRef"
:data="prescriptionList"
row-key="uniqueKey"
border
@row-dblclick="clickRowDb"
:expand-row-keys="expandOrder"
>
<el-table-column label="手术操作日期" align="center" prop="productName" width="400">
<template #default="scope">
<el-date-picker
v-model="scope.row.occurrenceTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="手术操作日期"
:default-time="defaultTime"
/>
</template>
</el-table-column>
<el-table-column label="手术级别" align="center" prop="" width="90">
<template #default="scope">
<el-select v-model="scope.row.operationLevel" placeholder="请选择手术级别">
<el-option
v-for="item in operationLevelList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="手术及操作名称" align="center" prop="">
<template #default="scope">
<el-select
v-model="scope.row.operationName"
placeholder="请选择手术及操作名称"
clearable
style="width: 100%"
>
<el-option
v-for="item in operationNameList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="手术及操作医师">
<el-table-column
prop="name"
label="术者">
<template #default="scope">
<el-select
v-model="scope.row.operationDoctor"
clearable
style="width: 100%"
>
<el-option
v-for="item in operationDoctorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="nameFirst"
label="Ⅰ助">
<template v-slot="scope">
<el-select
v-model="scope.row.nameFirst"
style="width: 100%"
>
<el-option
v-for="item in operationDoctorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="nameFirst"
label="Ⅱ助">
<template v-slot="scope">
<el-select
v-model="scope.row.nameSecond"
style="width: 100%"
>
<el-option
v-for="item in operationDoctorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</template>
</el-table-column>
</el-table-column>
</el-table>
<div class="form-row">
<div class="form-item">
<label>手术方式:</label>
<el-select v-model="formData.surgeryType">
<el-option value="" label="请选择"></el-option>
<el-option value="1" label="择期手术"></el-option>
<el-option value="2" label="限期手术"></el-option>
<el-option value="3" label="急诊手术"></el-option>
</el-select>
</div>
<div class="form-item">
<label>离院方式:</label>
<el-select v-model="formData.surgeryType">
<el-option value="" label="请选择"></el-option>
<el-option value="1" label="医嘱离院"></el-option>
<el-option value="2" label="医嘱转院"></el-option>
<el-option value="3" label="医嘱转社区卫生服务机构"></el-option>
<el-option value="4" label="非医嘱离院"></el-option>
<el-option value="5" label="死亡"></el-option>
<el-option value="9" label="其他"></el-option>
</el-select>
</div>
</div>
<div class="form-row">
<div class="form-item">
<label>是否有出院31天内再住院计划:</label>
<el-select v-model="formData.hospitalizationPlan">
<el-option value="" label="请选择"></el-option>
<el-option value="1" label="无"></el-option>
<el-option value="2" label="有"></el-option>
</el-select>
</div>
<div class="form-item">
<label>目的:</label>
<el-input v-model="formData.purpose"></el-input>
</div>
</div>
</div>
</template>
<script setup>
import { getCurrentInstance, nextTick, ref, watch } from 'vue';
const emit = defineEmits(['selectDiagnosis']);
const prescriptionList = ref([]);
const form = ref({
prescriptionList: prescriptionList.value,
});
const adviceQueryParams = ref({});
const rowIndex = ref(-1);
const nextId = ref(1);
const operationLevelList = [
{ name: '一级', id: 1 },
{ name: '二级', id: 2 },
{ name: '三级', id: 3 },
];
const operationDoctorList = ref([]);
const formData = ref({});
const props = defineProps({
});
const isAdding = ref(false);
const prescriptionRef = ref();
const expandOrder = ref([]); //目前的展开行
const { proxy } = getCurrentInstance();
const requiredProps = ref([]); // 存储必填项 prop 顺序
const handleSaveDisabled = ref(false) //签发状态
watch(
() => expandOrder.value,
(newValue) => {
console.log(newValue,"监听·")
if (newValue.length > 0) {
nextTick(() => {
const index = prescriptionList.value.findIndex((row) => row.uniqueKey === newValue[0]);
const items = proxy.$refs['formRef' + index]?.$el?.querySelectorAll('[data-prop]');
requiredProps.value = Array.from(items).map((item) => item.dataset.prop);
});
} else {
requiredProps.value = {};
}
}
);
watch(
() => prescriptionList.value,
(newValue) => {
console.log(prescriptionList.value,"prescriptionList.value")
if(newValue&&newValue.length>0){
let saveList = prescriptionList.value.filter((item) => {
return item.statusEnum == 1&&(Number(item.bizRequestFlag)==1||!item.bizRequestFlag)
})
prescriptionList.value.map(k=>{
k.check = false
})
console.log(saveList,"prescriptionList.value")
if (saveList.length == 0) {
handleSaveDisabled.value = true
}else{
handleSaveDisabled.value = false
}
}
},
{ immediate: true }
);
// 新增
function handleAddPrescription() {
if (isAdding.value) {
proxy.$modal.msgWarning('请先保存');
return;
}
isAdding.value = true;
// 在数组最前方添加一行,让新增行显示在最上边
prescriptionList.value.unshift({
uniqueKey: nextId.value++,
showPopover: false,
check: false,
isEdit: true,
statusEnum: 1,
});
nextTick(() => {
proxy.$refs['adviceRef0'].focus();
});
}
// 行双击打开编辑块,仅待发送的可编辑
function clickRowDb(row) {
if (row.statusEnum == 1) {
row = { ...row, ...JSON.parse(row.contentJson) };
row.isEdit = true;
const index = prescriptionList.value.findIndex((item) => item.uniqueKey === row.uniqueKey);
prescriptionList.value[index] = row;
console.log(prescriptionList.value,"prescriptionList.value")
expandOrder.value = [row.uniqueKey];
}
}
function handleDelete() {
let deleteList = prescriptionList.value
.filter((item) => {
return item.check && item.statusEnum == 1;
})
.map((item) => {
return {
requestId: item.requestId,
dbOpType: '3',
adviceType: item.adviceType,
};
});
if (deleteList.length == 0) {
proxy.$modal.msgWarning('请选择要删除的项目');
return;
}
expandOrder.value = [];
isAdding.value = false;
adviceQueryParams.value.adviceType = undefined;
}
</script>
<style lang="scss" scoped>
:deep(.el-table__expand-icon) {
display: none !important;
}
.medicine-title {
font-size: 16px;
font-weight: 600;
min-width: 280px;
display: inline-block;
}
.total-amount {
font-size: 16px;
font-weight: 600;
color: #409eff;
white-space: nowrap;
}
.medicine-info {
font-size: 15px;
font-weight: 600;
color: #606266;
white-space: nowrap;
}
.form-group {
display: flex;
align-items: center;
gap: 8px;
background: #fff;
padding: 6px 10px;
border-radius: 4px;
border: 1px solid #ebeef5;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
/* 调整element组件默认间距 */
// .el-select,
// .el-input-number {
// margin-right: 0 !important;
// }
.el-input-number .el-input__inner {
text-align: center;
}
.el-table__cell .el-form-item--default {
margin-bottom: 0px;
}
.form-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 15px;
}
.form-item {
flex: 1;
min-width: 200px;
margin-right: 15px;
margin-bottom: 8px;
}
.form-item.full-width {
flex: 0 0 100%;
min-width: 100%;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
font-size: 14px;
}
</style>

View File

@@ -0,0 +1,10 @@
<!--
* @Author: X_bo v-hss@tbpartners.local
* @Date: 2025-10-11 16:47:22
* @LastEditTime: 2025-10-11 16:47:28
* @LastEditors: X_bo v-hss@tbpartners.local
* @Description:
* @FilePath: \openhis-ui-vue3\src\views\hospitalRecord\components\medicalRecordThird.vue
-->
<template></template>
<script></script>

View File

@@ -3,9 +3,9 @@
<div class="awaitingBtn">
<el-button @click="awaitingMedicineBtn">效期预警 <span>{{total}}</span></el-button>
</div>
<!-- <div class="logo">
<img src="/src/assets/images/jlau.jpg" />
</div> -->
<!-- <div class="logo"> -->
<!-- <img src="/src/assets/images/jlau.jpg" /> -->
<!-- </div> -->
</div>
</template>

View File

@@ -5,6 +5,7 @@
*/
import request from '@/utils/request'
// ====== 文书记录
// 新增记录
export function addRecord(data) {
return request({
@@ -22,3 +23,38 @@ export function getRecordByEncounterIdList(params) {
params
})
}
// 初始化文书定义
export function init() {
return request({
url: '/document/record/init',
method: 'get',
})
}
// ====== 文书模板
// 新增模板
export function addTemplate(data) {
return request({
url: '/document/template/add',
method: 'post',
data
})
}
//
export function getListByDefinitionId(definitionId) {
return request({
url: '/document/template/getListByDefinitionId',
method: 'get',
params: {definitionId}
})
}
// 更新模板
export function updateTemplate(data) {
return request({
url: '/document/template/update',
method: 'put',
data
})
}

View File

@@ -11,7 +11,7 @@
<div v-for="item in historyData" :key="item.id" class="scrollbar-item">
<el-tooltip
effect="dark"
:content="`${item.definitionId}(${item.recordTime})`"
:content="`${item.name}(${item.recordTime})`"
placement="bottom"
>
<el-text class="w-150px mb-2" truncated @click="handleNodeClick(item)">

View File

@@ -0,0 +1,112 @@
<template>
<div class="emr-template-container">
<!-- <div class="search-box">
<el-input placeholder="病历名称搜索..." v-model="queryParams.searchKey">
<template #append>
<el-button @click="queryList">查询</el-button>
</template>
</el-input>
</div> -->
<el-scrollbar class="emr-template-scrollbar-container" style="width: 100%">
<div v-for="item in templateData" :key="item.id" class="scrollbar-item">
<el-tooltip
effect="dark"
:content="`${item.name}`"
placement="bottom"
>
<el-text class="2" truncated @click="handleNodeClick(item)">
<div class="template-item">{{ item.name }}
<el-space>
<el-icon><Edit @click="handleEdit(item)" /></el-icon>
</el-space></div>
</el-text>
</el-tooltip>
</div>
</el-scrollbar>
</div>
</template>
<script setup>
import { ref, reactive, defineEmits, unref } from 'vue';
import { getListByDefinitionId } from '../api';
import { ElTree } from 'element-plus';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { patientInfo } from '../../store/patient.js';
const emits = defineEmits(['templateClick','edit']);
const props = defineProps({
definitionId: {
type: String,
default: '',
},
});
const definitionId = defineModel('definitionId', {
type: String,
default: '',
});
const defaultProps = {
children: 'children',
label: 'name',
};
const queryParams = ref({
searchKey: '',
isPage: 0,
});
const templateData = ref([]);
const queryList = async () => {
try {
if ( unref(definitionId)&&unref(definitionId) !== '') {
const res = await getListByDefinitionId(unref(definitionId));
templateData.value = res.data || [];
}else{
templateData.value = [];
}
} catch (error) {
ElMessage.error('获取模板失败');
templateData.value = [];
}
};
const handleNodeClick = (data) => {
emits('templateClick', data);
};
const handleEdit = (data) => {
emits('edit', data);
};
const currentSelectTemplate = ref({});
defineExpose({ queryList });
</script>
<style lang="scss" scoped>
.emr-template-container {
height: 100%;
// padding: 8px;
.emr-template-scrollbar-container{
padding: 8px;
height: 100%;
.scrollbar-item {
height: 40px;
line-height: 40px;
border-radius: 4px;
cursor: pointer;
background: var(--el-color-primary-light-9);
& + .scrollbar-item {
margin-top: 8px;
}
.el-text{
width: calc(100% - 0px);
display: flex;
justify-content: space-between;
padding: 0 8px;
}
.template-item{
width: 100%;
display: flex;
justify-content: space-between;
}
}
}
}
</style>

View File

@@ -0,0 +1,133 @@
<template>
<!-- 病历文件基本信息弹窗 -->
<el-dialog
:title="formData.id ? '编辑模板' : '新增模板'"
v-model="dialogVisible"
width="900px"
destroy-on-close
@open="handleOpen"
>
<!-- 使用el-form包裹表单 -->
<el-form :model="formData" ref="formRef" :rules="rules" label-width="120px">
<el-row :gutter="24" class="mb8">
<el-col :span="24">
<el-form-item label="模板名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入模板名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="使用范围" prop="useRange">
<el-radio-group v-model="formData.useRange">
<el-radio :value="0" size="large">全院</el-radio>
<el-radio :value="1" size="large">指定机构</el-radio>
<el-radio :value="2" size="large">指定用户</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入版本"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer"></div>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</template>
</el-dialog>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import useUserStore from '@/store/modules/user';
import { addTemplate, updateTemplate } from '../api';
import { ElMessage } from 'element-plus';
import { components } from '@/template';
const emits = defineEmits(['submitOk']);
const props = defineProps({
formData: {
type: Object,
default: () => ({}),
},
});
const formRef = ref(null);
const dialogVisible = defineModel('dialogVisible', {
type: Boolean,
default: false,
});
// 表单数据
const formData = ref({
id: 0,
name: '',
displayOrder: 0,
contextJson: '',
definitionId: 0,
useRange: 2,
organizationId: 0,
userId: 0,
remark: '',
});
// 表单验证规则(响应式,支持动态验证)
const rules = reactive({
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
});
const handleOpen = () => {
if (props.formData) {
formData.value = props.formData;
} else {
resetForm();
}
};
// 提交表单
const submitForm = () => {
formRef.value.validate((valid) => {
if (valid) {
// 表单验证通过,执行保存操作
saveForm();
} else {
// 表单验证失败
ElMessage.error('请填写必填项');
return false;
}
});
};
// 保存表单
const saveForm = async () => {
try {
// 如果有当前节点数据,表示是编辑操作
if (formData.value.id && formData.value.id !== '') {
const res = await updateTemplate(formData.value);
if (res.code == 200) {
ElMessage.success('更新成功');
emits('submitOk');
} else {
ElMessage.error('更新失败', error);
}
} else {
// 新建操作
const res = await addTemplate(formData.value);
if (res.code == 200) {
ElMessage.success('保存成功');
emits('submitOk');
} else {
ElMessage.error('保存失败', error);
}
}
} catch (error) {
console.log(error);
// ElMessage.error('保存失败',error);
}
};
// 重置表单
const resetForm = () => {
formRef.value?.resetFields();
};
onMounted(() => {});
</script>
<style lang="scss" scoped></style>

View File

@@ -28,10 +28,9 @@
<div class="operate-container">
<div class="operate-btns">
<el-space>
<el-button type="primary" @click="newEmr">新建</el-button>
<!-- <el-button type="primary" @click="newEmr">新建</el-button> -->
<el-button type="primary" @click="saveAsModel">存为模版</el-button>
<el-button @click="refresh">刷新</el-button>
<el-button type="danger" @click="deleteEmr">删除</el-button>
<el-button type="primary" @click="save">保存</el-button>
</el-space>
</div>
@@ -44,18 +43,35 @@
<div class="quickly-container">
<el-tabs v-model="quicklyactiveName" type="card">
<el-tab-pane label="历史" name="history">
<History @historyClick="handleHistoryClick" ref="historyRef" v-model:definitionId="currentSelectTemplate.id" />
<History
@historyClick="handleHistoryClick"
ref="historyRef"
v-model:definitionId="currentSelectTemplate.id"
/>
</el-tab-pane>
<el-tab-pane label="模版" name="model">
<Template
@templateClick="handleTemplateClick"
ref="templateRef"
v-model:definitionId="currentSelectTemplate.id"
@edit="templateEdit"
/>
</el-tab-pane>
<el-tab-pane label="模版" name="model">模版</el-tab-pane>
</el-tabs>
</div>
<TemplateEdit
ref="templateEditRef"
:formData="editTemplateForm"
v-model:dialogVisible="templateEditVisible"
@submitOk="templateEditSubmitOk"
/>
</div>
</template>
<script setup>
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { getTreeList } from '@/views/basicmanage/caseTemplates/api';
import { addRecord } from './api';
import { addRecord, addTemplate } from './api';
import { patientInfo } from '../store/patient.js';
import dayjs from 'dayjs';
// 移除未使用的变量
@@ -64,13 +80,15 @@ const emits = defineEmits([]);
const props = defineProps({});
const state = reactive({});
import History from './components/history';
import Template from './components/template';
import TemplateEdit from './components/templateEdit.vue';
// 定义响应式变量
const templateData = ref([]);
const queryParams = ref({
name: '',
});
const currentSelectTemplate = ref({
id:''
id: '',
});
const currentComponent = ref('');
const emrComponentRef = ref(null);
@@ -99,14 +117,16 @@ const handleNodeClick = (data, node) => {
if (node.isLeaf) {
// 存储当前节点数据
currentSelectTemplate.value = data.document;
currentComponent.value = currentSelectTemplate.value.vueRouter || '';
// currentComponent.value = data.document.vueRouter || '';
} else {
currentSelectTemplate.value = {
id:''
id: '',
};
// currentComponent.value = null;
}
historyRef.value?.queryList();
historyRef.value?.queryList();
templateRef.value?.queryList();
};
const newEmr = () => {
@@ -119,52 +139,76 @@ const newEmr = () => {
const saveAsModel = async () => {
try {
currentOperate.value = 'addTemplate';
await emrComponentRef.value?.submit();
ElMessage.success('成功!');
} catch (error) {
ElMessage.error('存为模版失败');
}
};
const editForm = ref({
id: '',
definitionId: '',
definitionBusNo: '',
contentJson: '',
statusEnum: 1, // 0草稿/暂存 1提交 2归档 3修改
organizationId: 0,
encounterId: '',
patientId:'',
recordTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy: '',
source: '',
id: '',
definitionId: '',
definitionBusNo: '',
contentJson: '',
statusEnum: 1, // 0草稿/暂存 1提交 2归档 3修改
organizationId: 0,
encounterId: '',
patientId: '',
recordTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy: '',
source: '',
});
const editTemplateForm = ref({
id: '',
name: '',
displayOrder: 0,
contextJson: '',
definitionId: '',
useRange: 2,
organizationId: '',
userId: '',
remark: '',
});
const handleSubmitOk = async (data) => {
try {
// debugger;
if (!patientInfo.value?.encounterId || !patientInfo.value?.patientId) {
ElMessage.error('请先选择患者!');
return;
const currentOperate = ref('add');
const handleSubmitOk = async (data) => {
if (currentOperate.value === 'add') {
//
try {
// debugger;
if (!patientInfo.value?.encounterId || !patientInfo.value?.patientId) {
ElMessage.error('请先选择患者!');
return;
}
editForm.value.definitionId = currentSelectTemplate.value.id;
editForm.value.definitionBusNo = currentSelectTemplate.value.busNo;
editForm.value.contentJson = JSON.stringify(data);
editForm.value.encounterId = patientInfo.value.encounterId;
editForm.value.patientId = patientInfo.value.patientId;
editForm.value.recordTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
await addRecord(editForm.value);
ElMessage.success('病历保存成功');
historyRef.value?.queryList();
templateRef.value?.queryList();
} catch (error) {
ElMessage.error('提交失败');
console.log(error);
}
editForm.value.definitionId = currentSelectTemplate.value.id;
editForm.value.definitionBusNo = currentSelectTemplate.value.busNo;
editForm.value.contentJson = JSON.stringify(data);
editForm.value.encounterId = patientInfo.value.encounterId;
editForm.value.patientId = patientInfo.value.patientId;
editForm.value.recordTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
await addRecord(editForm.value);
ElMessage.success('提交成功');
historyRef.value?.queryList();
} catch (error) {
ElMessage.error('提交失败');
console.log(error);
} else if (currentOperate.value === 'addTemplate') {
// 新增或者编辑模板
// editTemplateForm.value.id=
editTemplateForm.value.name =
currentSelectTemplate.value.name + dayjs().format('YYYY/MM/DD HH:mm');
editTemplateForm.value.contextJson = JSON.stringify(data);
editTemplateForm.value.definitionId = currentSelectTemplate.value.id;
templateEditVisible.value = true;
}
};
const refresh = () => {
queryTemplateTree();
historyRef.value?.queryList();
historyRef.value?.queryList();
templateRef.value?.queryList();
};
const deleteEmr = async () => {
@@ -177,25 +221,42 @@ const deleteEmr = async () => {
};
const save = async () => {
// try {
await emrComponentRef.value?.submit();
// } catch (error) {
// ElMessage.error('保存失败');
// }
try {
currentOperate.value = 'add';
await emrComponentRef.value?.submit();
} catch (error) {
ElMessage.error('保存失败');
}
};
const historyRef = ref(null);
const handleHistoryClick= (data) => {
console.log(data);
const handleHistoryClick = (data) => {
newEmr();
editForm.value= data;
editForm.value = data;
nextTick(() => {
emrComponentRef.value?.setFormData(JSON.parse(editForm.value.contentJson));
})
emrComponentRef.value?.setFormData(JSON.parse(editForm.value.contentJson));
});
};
const templateRef = ref(null);
}
// 移除空的生命周期钩子
const handleTemplateClick = (data) => {
newEmr();
editForm.value = data;
nextTick(() => {
emrComponentRef.value?.setFormData(JSON.parse(editForm.value.contextJson));
});
};
const templateEdit = (data) => {
editTemplateForm.value = data;
templateEditVisible.value = true;
};
// ====dialog
const templateEditVisible = ref(false);
const templateEditSubmitOk = () => {
templateEditVisible.value = false;
historyRef.value?.queryList();
templateRef.value?.queryList();
};
// onBeforeMount(() => {});
onMounted(() => {
queryTemplateTree();
@@ -257,7 +318,7 @@ defineExpose({ state });
width: 300px;
padding: 0 8px 8px 8px;
flex: none;
.el-tabs{
.el-tabs {
height: 100%;
}
}

View File

@@ -31,4 +31,26 @@ export function getPrescriptionList(queryParams) {
method: 'get',
params: queryParams
})
}
/**
* 执行医嘱
*/
export function adviceExecute(data) {
return request({
url: '/nurse-station/advice-process/advice-execute',
method: 'post',
data: data
})
}
/**
* 取消执行医嘱
*/
export function adviceCancel(data) {
return request({
url: '/nurse-station/advice-process/advice-cancel',
method: 'post',
data: data
})
}

View File

@@ -29,9 +29,25 @@
</el-button>
</div>
<div>
<el-button class="ml20" type="danger" plain> 不执行 </el-button>
<el-button class="ml20" type="primary"> 皮试结果 </el-button>
<el-button class="ml20 mr20" type="primary"> 执行选中 </el-button>
<span class="descriptions-item-label">全选</span>
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
<el-button
class="ml20"
type="primary"
@click="handleExecute"
:disabled="props.exeStatus == 6"
>
执行选中
</el-button>
<el-button
class="ml20 mr20"
type="danger"
:disabled="props.exeStatus != 6"
plain
@click="handleCancel"
>
取消执行
</el-button>
</div>
</div>
<div
@@ -64,11 +80,16 @@
<template #title>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<span class="item-value">{{ item[0].badName }}</span>
<span class="item-value">{{ '【' + item[0].busNo + '】' }}</span>
<span class="item-value">{{ item[0].patientName + item[0].age }}</span>
<span>{{ item[0].contractName }}</span>
<span>{{ item[0].conditionNames }}</span>
<span>{{ item[0].bedName + '【' + item[0].busNo + '】' }}</span>
<span>
{{
item[0].patientName + ' / ' + item[0].genderEnum_enumText + ' / ' + item[0].age
}}
</span>
<el-tag style="margin-left: 10px">{{ item[0].contractName }}</el-tag>
<span style="margin-left: 30px; font-weight: 600">
{{ item[0].conditionNames }}
</span>
</div>
<div
style="
@@ -105,7 +126,12 @@
</div>
</div>
</template>
<el-table :data="item" border :header-cell-style="{ background: '#eef9fd !important' }">
<el-table
:data="item"
border
:ref="'tableRef' + index"
:header-cell-style="{ background: '#eef9fd !important' }"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="类型" align="center" prop="therapyEnum_enumText" width="80">
<template #default="scope">
@@ -114,8 +140,31 @@
</span>
</template>
</el-table-column>
<el-table-column label="医嘱内容" prop="adviceName" />
<el-table-column label="开始/终止" prop="requestTime" width="230" />
<el-table-column label="医嘱内容" prop="adviceName">
<template #default="scope">
<span>
{{ scope.row.adviceName }}
</span>
<template v-if="scope.row.adviceTable == 'med_medication_request'">
<span>
{{ ' 【' + scope.row.volume + '】' }}
</span>
<span style="color: #447c95 !important">
{{
'(' +
scope.row.methodCode_dictText +
' ' +
scope.row.dose +
scope.row.doseUnitCode_dictText +
' ' +
scope.row.rateCode_dictText +
')'
}}
</span>
</template>
</template>
</el-table-column>
<el-table-column label="开始/终止" prop="requestTime" width="200" />
<el-table-column label="预计执行" prop="times">
<template #default="scope">
<div
@@ -129,14 +178,26 @@
style="display: inline-block; margin-left: 15px"
>
<el-checkbox
v-for="(rateItem, rateIndex) in scope.row.rate"
v-for="(rateItem, rateIndex) in scope.row.rate[item]"
:key="rateIndex"
:value="rateItem"
:value="rateItem.rate"
@change="
(value) =>
handleRateChange(
value,
item,
scope.row.checkedRates[timeIndex],
scope.row
)
"
border
size="small"
style="margin-right: 15px"
>
{{ rateItem }}
{{ rateItem.rate }}
<template v-if="rateItem.practitionerName">
{{ rateItem.practitionerName }}
</template>
</el-checkbox>
</el-checkbox-group>
</div>
@@ -151,7 +212,7 @@
</template>
<script setup>
import { getPrescriptionList } from './api';
import { getPrescriptionList, adviceExecute, adviceCancel } from './api';
import { patientInfoList } from '../store/patient.js';
import { formatDate, formatDateStr } from '@/utils/index';
import { ref, getCurrentInstance } from 'vue';
@@ -162,11 +223,16 @@ const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
const therapyEnum = ref(undefined);
const { proxy } = getCurrentInstance();
const loading = ref(false);
const chooseAll = ref(false);
const props = defineProps({
exeStatus: {
type: Number,
default: 1,
},
requestStatus: {
type: Number,
default: 1,
},
});
function handleRadioChange() {
@@ -183,6 +249,7 @@ function handleGetPrescription() {
pageNo: 1,
therapyEnum: therapyEnum.value,
exeStatus: props.exeStatus,
requestStatus: props.requestStatus,
}).then((res) => {
// try {
// 根据encounterId分组
@@ -191,22 +258,106 @@ function handleGetPrescription() {
let rate;
let times;
if (prescription.therapyEnum == 1) {
// 长期医嘱 后台返回执行时间点字符串,直接拆分取时间点
rate = prescription.dayTimes?.split(',');
// 用截止时间和医嘱签发时间算出全部执行日期
times = getDateRange(prescription.requestTime, deadline.value);
} else {
// 临时医嘱 直接取医嘱签发时间截取执行时间和执行日期
rate = [formatDateStr(prescription.requestTime, 'HH:mm')];
times = [formatDateStr(prescription.requestTime, 'MM-DD')];
}
prescription.times = times;
prescription.rate = rate;
prescription.year = formatDateStr(prescription.requestTime, 'YYYY');
// 初始化执行时间列表
prescription.executeTimes = [];
// 初始化取消执行Id列表
prescription.procedureIds = [];
// 添加复选框状态管理
prescription.checkedRates = {};
let exeTimeList = prescription.exePerformRecordList.map((item) => {
return formatDateStr(item.occurrenceTime, 'YYYY-MM-DD HH:mm:ss');
});
let stopTimeList = prescription.stopPerformRecordList.map((item) => {
return formatDateStr(item.occurrenceTime, 'YYYY-MM-DD HH:mm:ss');
});
let cancelTimeList = prescription.cancelPerformRecordList.map((item) => {
return formatDateStr(item.occurrenceTime, 'YYYY-MM-DD HH:mm:ss');
});
if (rate) {
times.forEach((time, index) => {
// 默认选中所有执行频次
prescription.checkedRates[index] = [...rate];
// 拼成日期加全部时间点的形式显示示例03-01 [09:00, 10:00, 11:00]
// 重构后的逻辑
let validTimes = [];
let validRates = {};
let newCheckedRates = {};
times.forEach((time, timeIndex) => {
let checkedRatesForTime = [];
let rateItems = [];
rate.forEach((rateItem) => {
let dateStr = prescription.year + '-' + time + ' ' + rateItem + ':00';
prescription.executeTimes.push(dateStr);
switch (props.exeStatus) {
case 1:
// 如果该时间点未执行,则加入待选中列表
if (!exeTimeList.includes(dateStr)) {
rateItems.push({
rate: rateItem,
});
checkedRatesForTime.push(rateItem);
}
break;
case 6:
let index = exeTimeList.findIndex((item) => {
return item == dateStr;
});
if (index != -1) {
rateItems.push({
procedureId: prescription.exePerformRecordList[index].procedureId,
practitionerName: prescription.exePerformRecordList[index].practitionerName,
rate: rateItem,
});
checkedRatesForTime.push(rateItem);
}
break;
case 5:
if (stopTimeList.includes(dateStr)) {
rateItems.push({
rate: rateItem,
});
checkedRatesForTime.push(rateItem);
}
break;
case 9:
if (cancelTimeList.includes(dateStr)) {
rateItems.push({
rate: rateItem,
});
checkedRatesForTime.push(rateItem);
}
break;
}
});
validRates[time] = rateItems;
// 只有当该时间点有待执行的项目时,才保留该时间点
if (checkedRatesForTime.length > 0) {
let newIndex = validTimes.length;
validTimes.push(time);
newCheckedRates[newIndex] = checkedRatesForTime;
}
});
console.log(validRates, '111');
// 更新处方对象
prescription.times = validTimes;
prescription.rate = validRates;
prescription.checkedRates = newCheckedRates;
// 处理已执行记录
prescription.exePerformRecordList.forEach((item) => {
if (prescription.executeTimes.includes(item.occurrenceTime)) {
prescription.procedureIds.push(item.procedureId);
}
});
}
// 把相同encounterId的医嘱放在同一个数组中
@@ -223,18 +374,61 @@ function handleGetPrescription() {
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
console.log(prescriptionList.value, '1111');
loading.value = false;
// } catch {
// loading.value = false;
// }
});
chooseAll.value = false;
} else {
prescriptionList.value = [];
// proxy.$message.warning('请选择患者');
}
}
function handleExecute() {
let list = getSelectRows();
list = list.map((item) => {
return {
requestId: item.requestId,
accountId: item.accountId,
adviceTable: item.adviceTable,
executeTimes: item.executeTimes,
};
});
console.log(list, 'list');
adviceExecute({ adviceExecuteDetailList: list }).then((res) => {
if (res.code == 200) {
handleGetPrescription();
}
});
}
function handleCancel() {
let list = getSelectRows();
console.log(list, 'list');
list = list.map((item) => {
return {
procedureId: item.procedureId,
executeTimes: item.cancelTimes,
};
});
adviceCancel({ adviceExecuteParam: list }).then((res) => {
if (res.code == 200) {
handleGetPrescription();
}
});
}
function getSelectRows() {
// 获取选中的医嘱信息
let list = [];
prescriptionList.value.forEach((item, index) => {
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
});
return list;
}
/**
* 计算两个日期之间的所有日期(包含起始和结束日期)
* @param {string|Date} startDate - 开始日期
@@ -265,6 +459,23 @@ function getDateRange(startDate, endDate) {
return dates;
}
function handleRateChange(value, date, time, row) {
// 拼接当前选中时间
let tiemStr = row.year + '-' + date + ' ' + time + ':00';
if (value) {
row.executeTimes.push(tiemStr);
} else {
row.executeTimes.splice(row.executeTimes.indexOf(tiemStr), 1);
}
console.log(row.executeTimes, 'row.executeTimes');
}
function handelSwicthChange(value) {
prescriptionList.value.forEach((item, index) => {
proxy.$refs['tableRef' + index][0].toggleAllSelection();
});
}
// 处理后端返回的时间集合
function handleTime() {}

View File

@@ -28,22 +28,19 @@
</el-tabs>
</div>
<div style="width: 100%">
<el-tabs
v-model="activeName"
class="demo-tabs centered-tabs"
@tab-change="handleClick"
>
<el-tab-pane
v-for="tab in prescriptionTabs"
<el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
<el-tab-pane
v-for="tab in prescriptionTabs"
:key="tab.name"
:lazy="true"
:label="tab.label"
:lazy="true"
:label="tab.label"
:name="tab.name"
>
<!-- 使用模板引用 -->
<PrescriptionList
:exeStatus="exeStatus"
:ref="(el) => setPrescriptionRef(el, tab.name)"
<PrescriptionList
:exeStatus="exeStatus"
:requestStatus="requestStatus"
:ref="(el) => setPrescriptionRef(el, tab.name)"
/>
</el-tab-pane>
</el-tabs>
@@ -59,6 +56,7 @@ import PrescriptionList from './components/prescriptionList.vue';
const activeName = ref('preparation');
const active = ref('first');
const exeStatus = ref(1);
const requestStatus = ref(3);
const { proxy } = getCurrentInstance();
// 存储子组件引用的对象
@@ -69,7 +67,7 @@ const prescriptionTabs = [
{ label: '待执行', name: 'preparation' },
{ label: '已执行', name: 'completed' },
{ label: '不执行', name: 'stopped' },
{ label: '取消执行', name: 'cancel' }
{ label: '取消执行', name: 'cancel' },
];
// 设置处方组件引用
@@ -82,10 +80,13 @@ function setPrescriptionRef(el, name) {
function handleClick(tabName) {
// tabName是tab的name属性值
const activeTabName = tabName || activeName.value;
switch(activeTabName){
switch (activeTabName) {
case 'preparation':
// 执行状态待执行
exeStatus.value = 1;
// 请求状态已校对
requestStatus.value = 3;
break;
case 'completed':
exeStatus.value = 6;
@@ -97,11 +98,13 @@ function handleClick(tabName) {
exeStatus.value = 9;
break;
}
// 调用子组件方法
nextTick(() => {
if (prescriptionRefs.value[activeTabName] &&
typeof prescriptionRefs.value[activeTabName].handleGetPrescription === 'function') {
if (
prescriptionRefs.value[activeTabName] &&
typeof prescriptionRefs.value[activeTabName].handleGetPrescription === 'function'
) {
prescriptionRefs.value[activeTabName].handleGetPrescription();
}
});

View File

@@ -31,4 +31,26 @@ export function getPrescriptionList(queryParams) {
method: 'get',
params: queryParams
})
}
/**
* 医嘱校对通过
*/
export function adviceVerify(data) {
return request({
url: '/nurse-station/advice-process/advice-verify',
method: 'put',
data: data
})
}
/**
* 医嘱退回
*/
export function cancel(data) {
return request({
url: '/nurse-station/advice-process/advice-reject',
method: 'put',
data: data
})
}

View File

@@ -46,7 +46,6 @@ function onTreeLoaded() {
// 获取所有节点并设置为选中状态
const allNodes = getAllNodes(treeRef.value.store.root.childNodes);
const allKeys = allNodes.map((node) => node.key);
treeRef.value.setCheckedKeys(allKeys, true); // 第二个参数设为true表示级联选中
allNodesLoaded.value = true;
});
@@ -122,7 +121,10 @@ function handleCheckChange(data, checked) {
console.log(list, '2345678');
updatePatientInfoList(list);
handleGetPrescription();
}
const handleGetPrescription = inject('handleGetPrescription');
</script>
<style scoped lang="scss">

View File

@@ -21,9 +21,9 @@
</div>
<div>
<span class="descriptions-item-label">全选</span>
<el-switch/>
<el-button class="ml20" type="primary"> 核对通过 </el-button>
<el-button class="ml20 mr20" type="danger"> 退回 </el-button>
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
<el-button class="ml20" type="primary" @click="handleCheck"> 核对通过 </el-button>
<el-button class="ml20 mr20" type="danger" @click="handleCancel"> 退回 </el-button>
</div>
</div>
<div
@@ -54,11 +54,60 @@
"
>
<template #title>
<span>11202501010101</span>
<span>张先生//20</span>
<span>自费</span>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<span>{{ item[0].bedName + '【' + item[0].busNo + '】' }}</span>
<span>
{{
item[0].patientName + ' / ' + item[0].genderEnum_enumText + ' / ' + item[0].age
}}
</span>
<el-tag style="margin-left: 10px">{{ item[0].contractName }}</el-tag>
<span style="margin-left: 30px; font-weight: 600">
{{ item[0].conditionNames }}
</span>
</div>
<div
style="
display: flex;
justify-content: space-between;
gap: 20px;
align-items: center;
margin-right: 20px;
"
>
<div style="display: inline-block; margin-right: 10px">
<span class="descriptions-item-label">住院医生</span>
<span>{{ item[0].requesterId_dictText }}</span>
</div>
<div style="display: inline-block; margin-right: 10px">
<div
class="descriptions-item-label"
style="height: 20px; line-height: 20px; text-align: center; margin: 0"
>
预交金额
</div>
<div
style="
height: 20px;
line-height: 20px;
text-align: center;
font-size: 15px;
color: #ec8c43;
"
>
{{ item[0].balanceAmount?.toFixed(2) }}
</div>
</div>
</div>
</div>
</template>
<el-table :data="item" border :header-cell-style="{ background: '#eef9fd !important' }">
<el-table
:data="item"
border
:ref="'tableRef' + index"
:header-cell-style="{ background: '#eef9fd !important' }"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="类型" align="center" prop="therapyEnum_enumText" width="80">
<template #default="scope">
@@ -67,34 +116,32 @@
</span>
</template>
</el-table-column>
<el-table-column label="医嘱内容" prop="adviceName" />
<el-table-column label="开始/终止" prop="requestTime" width="230" />
<el-table-column label="预计执行" prop="times">
<el-table-column label="医嘱内容" prop="adviceName">
<template #default="scope">
<div
v-for="(item, timeIndex) in scope.row.times"
:key="timeIndex"
style="padding-bottom: 5px"
>
<span>{{ item }}</span>
<el-checkbox-group
v-model="scope.row.checkedRates[timeIndex]"
style="display: inline-block; margin-left: 15px"
>
<el-checkbox
v-for="(rateItem, rateIndex) in scope.row.rate"
:key="rateIndex"
:value="rateItem"
border
size="small"
style="margin-right: 15px"
>
{{ rateItem }}
</el-checkbox>
</el-checkbox-group>
</div>
<span>
{{ scope.row.adviceName }}
</span>
<template v-if="scope.row.adviceTable == 'med_medication_request'">
<span>
{{ ' 【' + scope.row.volume + '】' }}
</span>
<span style="color: #447c95 !important">
{{
'(' +
scope.row.methodCode_dictText +
' ' +
scope.row.dose +
scope.row.doseUnitCode_dictText +
' ' +
scope.row.rateCode_dictText +
')'
}}
</span>
</template>
</template>
</el-table-column>
<el-table-column label="执行科室" prop="positionName" width="230" />
<el-table-column label="签发时间" prop="requestTime" width="230" />
</el-table>
</el-collapse-item>
</el-collapse>
@@ -102,11 +149,10 @@
</div>
</div>
</template>
<script setup>
import { getPrescriptionList } from './api';
import { getPrescriptionList, adviceVerify, cancel } from './api';
import { patientInfoList } from '../store/patient.js';
import { formatDate, formatDateStr } from '@/utils/index';
import { formatDateStr } from '@/utils/index';
const activeNames = ref([]);
const prescriptionList = ref([]);
@@ -114,54 +160,109 @@ const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
const type = ref(1);
const { proxy } = getCurrentInstance();
const loading = ref(false);
const chooseAll = ref(false);
const props = defineProps({
requestStatus: {
type: Number,
default: 2,
},
});
function handleRadioChange() {
handleGetPrescription();
}
function handleGetPrescription() {
if (patientInfoList.value.length > 0) {
loading.value = true;
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
getPrescriptionList({ encounterIds: encounterIds, pageSize: 10000, pageNo: 1 }).then((res) => {
getPrescriptionList({
encounterIds: encounterIds,
requestStatus: props.requestStatus,
pageSize: 10000,
pageNo: 1,
}).then((res) => {
// try {
// 根据encounterId分组
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
// 获取当前医嘱全部执行频次
let rate = prescription.dayTimes?.split(',');
let times = getDateRange(prescription.requestTime, deadline.value);
prescription.times = times;
prescription.rate = rate;
// 根据encounterId分组
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
const encounterId = prescription.encounterId;
if (!groups[encounterId]) {
groups[encounterId] = [];
}
if (!activeNames.value.includes(encounterId)) {
activeNames.value.push(encounterId);
}
groups[encounterId].push(prescription);
return groups;
}, {});
// 添加复选框状态管理
prescription.checkedRates = {};
if (rate) {
times.forEach((time, index) => {
// 默认选中所有执行频次
prescription.checkedRates[index] = [...rate];
});
}
const encounterId = prescription.encounterId;
if (!groups[encounterId]) {
groups[encounterId] = [];
}
if (!activeNames.value.includes(encounterId)) {
activeNames.value.push(encounterId);
}
groups[encounterId].push(prescription);
return groups;
}, {});
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
console.log(prescriptionList.value, '1111');
loading.value = false;
// } catch {
// loading.value = false;
// }
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
console.log(prescriptionList.value, '1111');
loading.value = false;
});
chooseAll.value = false;
} else {
proxy.$message.warning('请选择患者');
}
}
/**
* 核对通过
*/
function handleCheck() {
let list = getSelectRows();
if (list.length > 0) {
adviceVerify(list).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg);
handleGetPrescription();
}
});
console.log(list, 'list');
} else {
proxy.$message.warning('请先选择医嘱信息');
}
}
/**
* 退回
*/
function handleCancel() {
let list = getSelectRows();
if (list.length > 0) {
cancel(list).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg);
handleGetPrescription();
}
});
console.log(list, 'list');
} else {
proxy.$message.warning('请先选择医嘱信息');
}
}
function getSelectRows() {
// 获取选中的医嘱信息
let list = [];
prescriptionList.value.forEach((item, index) => {
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
});
return list.map((item) => {
return {
requestId: item.requestId,
requestTable: item.adviceTable,
};
});
}
function handelSwicthChange(value) {
prescriptionList.value.forEach((item, index) => {
proxy.$refs['tableRef' + index][0].toggleAllSelection();
});
}
/**
* 计算两个日期之间的所有日期(包含起始和结束日期)
* @param {string|Date} startDate - 开始日期
@@ -194,6 +295,10 @@ function getDateRange(startDate, endDate) {
// 处理后端返回的时间集合
function handleTime() {}
defineExpose({
handleGetPrescription,
});
</script>
<style scoped>
@@ -211,6 +316,6 @@ function handleTime() {}
}
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
background-color: #eef9fd !important;
}
</style>

View File

@@ -28,13 +28,20 @@
</el-tabs>
</div>
<div style="width: 100%">
<el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-click="handleClick">
<el-tab-pane label="未校对" name="first">
<PrescriptionList />
<el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleTabClick">
<el-tab-pane
v-for="tab in prescriptionTabs"
:key="tab.name"
:lazy="true"
:label="tab.label"
:name="tab.name"
>
<!-- 使用模板引用 -->
<PrescriptionList
:requestStatus="requestStatus"
:ref="(el) => setPrescriptionRef(el, tab.name)"
/>
</el-tab-pane>
<el-tab-pane label="已校对" name="second">Config</el-tab-pane>
<el-tab-pane label="已停止" name="third">Role</el-tab-pane>
<el-tab-pane label="已作废" name="fourth">Task</el-tab-pane>
</el-tabs>
</div>
</div>
@@ -44,8 +51,63 @@
import PatientList from './components/patientList.vue';
import PrescriptionList from './components/prescriptionList.vue';
const activeName = ref('first');
const activeName = ref('unverified');
const active = ref('first');
const requestStatus = ref(2);
// 存储子组件引用的对象
const prescriptionRefs = ref({});
// 定义处方列表tabs配置
const prescriptionTabs = [
{ label: '未校对', name: 'unverified' },
{ label: '已校对', name: 'verified' },
{ label: '已停止', name: 'stopped' },
{ label: '已退回', name: 'cancelled' },
];
// 设置处方组件引用
function setPrescriptionRef(el, name) {
if (el) {
prescriptionRefs.value[name] = el;
}
}
function handleTabClick(tabName) {
// tabName是tab的name属性值
const activeTabName = tabName || activeName.value;
switch (activeTabName) {
case 'unverified':
requestStatus.value = 2;
break;
case 'verified':
requestStatus.value = 3;
break;
case 'stopped':
requestStatus.value = 6;
break;
case 'cancelled':
requestStatus.value = 1;
break;
}
// 调用子组件方法
nextTick(() => {
debugger;
console.log(prescriptionRefs.value[activeTabName], '1');
if (
prescriptionRefs.value[activeTabName] &&
typeof prescriptionRefs.value[activeTabName].handleGetPrescription === 'function'
) {
prescriptionRefs.value[activeTabName].handleGetPrescription();
}
});
}
provide('handleGetPrescription', (value) => {
prescriptionRefs.value[activeName.value].handleGetPrescription();
});
</script>
<style scoped>
@@ -59,16 +121,15 @@ const active = ref('first');
justify-content: center;
}
.tab-header :deep(.el-tabs__item){
height: 50px !important
.tab-header :deep(.el-tabs__item) {
height: 50px !important;
}
.centered-tabs :deep(.el-tabs__nav) {
display: flex;
justify-content: center;
}
:deep(.el-tabs__header){
:deep(.el-tabs__header) {
margin: 0;
}
</style>

View File

@@ -51,10 +51,10 @@
/>
</el-select>
</el-form-item>
<el-form-item prop="tenantId">
<span class="descriptions-item-label" style="margin: 0 10px 0 0">连接医保</span>
<el-switch v-model="loginForm.invokeYb" @change="topNavChange" size="large"/>
</el-form-item>
<!-- <el-form-item prop="tenantId"> -->
<!-- <span class="descriptions-item-label" style="margin: 0 10px 0 0">连接医保</span> -->
<!-- <el-switch v-model="loginForm.invokeYb" @change="topNavChange" size="large"/> -->
<!-- </el-form-item> -->
<!--<el-form-item prop="code" v-if="captchaEnabled">
<el-input
v-model="loginForm.code"
@@ -162,7 +162,7 @@ onMounted(() => {
loginForm.value.invokeYb = storedInvokeYb === 'true';
} else {
// 如果 localStorage 中没有值,则设置默认值并保存
localStorage.setItem('invokeYb', 'false');
localStorage.setItem('invokeYb', 'true');
}
});
@@ -194,7 +194,7 @@ function handleLogin() {
}
return acc;
}, {});
if (env === 'development' || !loginForm.value.invokeYb) {
if (true) {
router.push({ path: redirect.value || '/', query: otherQueryParams });
} else {
signIng.value = true;

View File

@@ -0,0 +1,165 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="100px"
v-show="showSearch"
>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
v-model="queryParams.startTime"
type="date"
placeholder="请选择"
value-format="yyyy-MM-dd"
clearable
/>
</el-form-item>
<el-form-item label="结束时间" prop="startTime">
<el-date-picker
v-model="queryParams.endTime"
type="date"
placeholder="请选择"
value-format="yyyy-MM-dd"
clearable
/>
</el-form-item>
<el-form-item label="药房名称" prop="pharmacyId" label-width="100px">
<el-select
v-model="queryParams.pharmacyId"
placeholder="请输入"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item in [
{ id: '1', name: '药房1' },
{ id: '2', name: '药房2' },
]"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="药品名称" prop="medicineName" label-width="100px">
<el-input v-model="queryParams.medicineName" placeholder="请输入" clearable />
</el-form-item>
<el-form-item label="药品类型" prop="medicineType">
<el-select
v-model="queryParams.medicineType"
placeholder="请选择"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item in [
{ id: '1', name: '药品1' },
{ id: '2', name: '药品2' },
{ id: '3', name: '药品3' },
{ id: '4', name: '药品4' },
{ id: '5', name: '药品5' },
{ id: '6', name: '药品6' },
{ id: '7', name: '药品7' },
{ id: '8', name: '药品8' },
]"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
min-height="200"
max-height="500"
:data="tableData"
style="width: 100%"
lab
>
<el-table-column prop="name" label="库房名称" align="center" />
<el-table-column prop="age" label="药品名称" align="center" />
<el-table-column prop="address" label="包装规格" align="center" />
<el-table-column prop="address" label="包装单位" align="center" />
<el-table-column prop="address" label="最小包装单位" align="center" width="150px" />
<el-table-column prop="address" label="厂家" align="center" />
<el-table-column prop="address" label="类型" align="center" />
<el-table-column prop="address" label="单位数量" align="center" />
<el-table-column prop="address" label="最小单位数量" align="center" width="150px" />
<el-table-column prop="address" label="原批发价" align="center" />
<el-table-column prop="address" label="现批发价" align="center" />
<el-table-column prop="address" label="原批发拆分价" align="center" width="150px" />
<el-table-column prop="address" label="现批发拆分价" align="center" width="150px" />
<el-table-column prop="address" label="批价盈亏" align="center" />
<el-table-column prop="address" label="原售价" align="center" />
<el-table-column prop="address" label="现售价" align="center" />
<el-table-column prop="address" label="原零售价" align="center" />
<el-table-column prop="address" label="现零售价" align="center" />
<el-table-column prop="address" label="零价盈亏" align="center" />
<el-table-column prop="address" label="执行时间" align="center" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup>
import { ref, toRefs } from 'vue';
const { proxy } = getCurrentInstance();
const queryParams = ref({
pageNo: 1,
pageSize: 10,
startTime: undefined,
endTime: undefined,
});
const refreshTable = ref(true);
const loading = ref(false);
const tableData = ref([]);
const getList = () => {
console.log(queryParams.value);
};
const showSearch = ref(true);
const reset = () => {
queryParams.value = {
pageNo: 1,
pageSize: 10,
};
};
const handleQuery = () => {
queryParams.value.pageNo = 1;
console.log(queryParams.value, 'queryParams');
getList();
};
const resetQuery = () => {
reset();
handleQuery();
};
onMounted(() => {
getList();
});
</script>
<style>
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" :element-loading-text="'审批中...'">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button
@@ -784,6 +784,7 @@ const rowList = ref([])
const openTraceNoDialog = ref(false)
const ypName = ref("");
const currentIndex = ref("");
const pageLoading = ref(false)
const props = defineProps({
// 仓库
purposeTypeListOptions: {
@@ -1934,14 +1935,18 @@ function handleReject() {
});
}
function handelApply() {
pageLoading.value = true
productStocktakingApproved(route.query.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
pageLoading.loading = false
store.clearCurrentDataPLPD();
store.clearCurrentDataPLPDALL();
// 跳转到审核页面
router.replace({ path: '/aaaa/medicationmanagement/billapproval',query:{type:'chkstockBatch'}});
}
}).catch(() =>{
pageLoading.loading = false
})
}
/** 提交审核 */

View File

@@ -214,9 +214,10 @@
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
:disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9' && scope.row.statusEnum != '4'"
disabled
>编辑</el-button
>
<!-- :disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9' && scope.row.statusEnum != '4'" -->
<!-- v-hasPermi="['system:user:edit']" -->
<el-button
link

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" loading-text="审批中。。。">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button v-if="viewStatus != 'view'" plain type="primary" icon="Edit" @click="handelApply"
@@ -578,6 +578,7 @@ const visible = ref(false);
const row = ref({});
const rowIndex = ref(-1);
const totalAmount = ref(0);
const pageLoading = ref(false)
const props = defineProps({
sourceTypeListOptions: {
type: Object,
@@ -1029,8 +1030,10 @@ function handleReject() {
});
}
function handelApply() {
pageLoading.value = true
lossReportApproved(route.query.supplyBusNo).then((res) => {
if (res.code == 200) {
pageLoading.value = false
proxy.$modal.msgSuccess('操作成功');
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentDataBS();
@@ -1040,6 +1043,8 @@ function handelApply() {
query: { type: 'lossReporting' },
});
}
}).catch(() => {
pageLoading.value = false
});
}
/** 提交审核按钮 */

View File

@@ -0,0 +1,58 @@
import request from '@/utils/request';
// 查询费用定价信息列表
export function listDefinition (query) {
return request ({
url: '/dict-dictionary/definition/charge-item-info',
method: 'get',
params: query,
});
}
// 初始化下拉选
export function initOption (query) {
return request ({
url: '/dict-dictionary/definition/init',
method: 'get',
params: query,
});
}
// 获取药品列表
export function getMedicineList (query) {
return request ({
url: '/doctor-station/advice/advice-base-info',
method: 'get',
params: query,
});
}
// 修改费用定价信息
export function updateDefinition (data) {
return request ({
url: `/dict-dictionary/definition/update-charge-item?id=${data.id}&price=${data.price}`,
method: 'put',
});
}
// 修改费用定价信息
export function getOptions () {
return request ({
url: '/dict-dictionary/definition/status-enum-option',
method: 'get',
});
}
// 修改费用定价信息
export function getDetail (id) {
return request ({
url: '/dict-dictionary/definition/charge-item-info-detail?id=' + id,
method: 'get',
});
}
// 供应商查询
export function getSupplierList (query) {
return request ({
url: '/change/price/searchAllSupply',
method: 'get',
params: query,
});
}

View File

@@ -0,0 +1,74 @@
<template>
<div>
<el-table ref="medicineRef" height="400" :data="medicineList" @cell-click="clickRow">
<el-table-column label="项目编码" align="center" prop="adviceDefinitionId" />
<el-table-column label="项目名称" align="center" prop="adviceName" />
<el-table-column label="当前价格" align="center" prop="retailPrice" />
<el-table-column label="规格" align="center" prop="volume" />
</el-table>
</div>
</template>
<script setup>
import { getMedicineList } from './api';
import { watch } from 'vue';
import { throttle } from 'lodash-es';
const props = defineProps({
searchKey: {
type: String,
default: '',
},
supplierId: {
type: String,
default: '',
},
});
// 选择药品
const emit = defineEmits(['selectRow']);
// 查询参数
const queryParams = ref({
searchKey: props.searchKey,
// supplierId: props.supplierId,
});
// 药品列表
const medicineList = ref([]);
// 节流函数
const throttledGetList = throttle(
() => {
getList();
},
300,
{ leading: true, trailing: true }
);
// 获取药品列表
const getList = (query) => {
getMedicineList(query || queryParams.value).then((res) => {
medicineList.value = res.data.records;
});
};
// 点击行
const clickRow = (row) => {
console.log(row, 'row');
emit('selectRow', row);
};
// 监听搜索关键字
watch(
() => props,
(newValue) => {
queryParams.value.searchKey = newValue.searchKey;
throttledGetList();
},
{ immediate: true, deep: true }
);
// 获取药品列表
getList();
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,636 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="药品调价" name="1">
<!-- <el-form-item label="供应商" prop="supplierId">
<el-select v-model="queryParams.supplierId" placeholder="请选择" clearable filterable>
<el-option
v-for="item in supplierIDList"
:key="item.supplyId"
:label="item.supplyName"
:value="item.supplyId"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="申请人" prop="applicationName" label-width="100px">
<el-input v-model="applicationName" placeholder="" disabled />
</el-form-item>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
@click="handleDelete"
v-if="selectedRows.length > 0"
>
删除选中行
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Check"
@click="handleSave"
v-if="definitionList.length > 0"
>保存</el-button
>
</el-col>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="definitionList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
ref="tableRef"
@selection-change="handleSelectionChange"
style="width: 100% !important"
>
<el-table-column type="selection" width="40" align="center" fixed="left" />
<el-table-column label="名称" prop="itemName" align="center">
<template #default="scope">
<PopoverList @search="handleSearch" :width="1000" :modelValue="scope.row.itemName">
<template #popover-content>
<medicineList
ref="medicineListRef"
@selectRow="(row) => selectRow(row, scope.$index)"
:searchKey="medicineSearchKey"
:supplierId="queryParams.supplierId"
/>
</template>
</PopoverList>
</template>
</el-table-column>
<el-table-column label="编码" prop="busNo" align="center">
<template #default="scope">
{{ scope.row.busNo ? scope.row.busNo : '-' }}
</template>
</el-table-column>
<el-table-column label="规格" prop="totalVolume" align="center">
<template #default="scope">
{{ scope.row.totalVolume ? scope.row.totalVolume : '-' }}
</template>
</el-table-column>
<el-table-column label="当前价格" prop="retailPrice" align="center">
<template #default="scope">
{{ scope.row.retailPrice ? scope.row.retailPrice : '-' }}
</template>
</el-table-column>
<el-table-column label="调后价格" prop="afterPrice" align="center">
<template #default="scope">
<el-input v-model="scope.row.afterPrice" type="number" step="0.01" />
</template>
</el-table-column>
<el-table-column label="调价理由" prop="price" align="center">
<template #default="scope">
<el-input
type="textarea"
v-model="scope.row.adjustReason"
rows="1"
maxlength="255"
autosize
/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="耗材调价" name="2">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="definitionList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
ref="tableRef"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" align="center" fixed="left" />
<el-table-column label="编码" width="200" prop="chargeName" align="center">
<template #default="scope">
{{ scope.row.chargeName ? scope.row.chargeName : '-' }}
</template>
</el-table-column>
<el-table-column label="名称" width="200" prop="orgId_dictText" align="center">
<template #default="scope">
<PopoverList @search="handleSearch" :width="1000" :modelValue="scope.row.itemName">
<template #popover-content>
<medicineList
ref="medicineListRef"
@selectRow="(row) => selectRow(row, scope.$index)"
:searchKey="medicineSearchKey"
:supplierId="queryParams.supplierId"
/>
</template>
</PopoverList>
</template>
</el-table-column>
<el-table-column label="规格" width="200" prop="typeCode_dictText" align="center">
<template #default="scope">
{{ scope.row.typeCode_dictText ? scope.row.typeCode_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="当前价格" width="200" prop="ybType_dictText" align="center">
<template #default="scope">
{{ scope.row.ybType_dictText ? scope.row.ybType_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="调后价格" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column label="调价理由" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column label="调整时间" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column
min-width="290"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="诊疗调价" name="3">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="definitionList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
ref="tableRef"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" align="center" fixed="left" />
<el-table-column label="编码" width="200" prop="chargeName" align="center">
<template #default="scope">
{{ scope.row.chargeName ? scope.row.chargeName : '-' }}
</template>
</el-table-column>
<el-table-column label="名称" width="200" prop="orgId_dictText" align="center">
<template #default="scope">
{{ scope.row.orgId_dictText ? scope.row.orgId_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="规格" width="200" prop="typeCode_dictText" align="center">
<template #default="scope">
{{ scope.row.typeCode_dictText ? scope.row.typeCode_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="当前价格" width="200" prop="ybType_dictText" align="center">
<template #default="scope">
{{ scope.row.ybType_dictText ? scope.row.ybType_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="调后价格" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column label="调价理由" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column label="调整时间" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column
min-width="290"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="挂号调价" name="4">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="definitionList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
ref="tableRef"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" align="center" fixed="left" />
<el-table-column label="编码" width="200" prop="chargeName" align="center">
<template #default="scope">
{{ scope.row.chargeName ? scope.row.chargeName : '-' }}
</template>
</el-table-column>
<el-table-column label="名称" width="200" prop="orgId_dictText" align="center">
<template #default="scope">
{{ scope.row.orgId_dictText ? scope.row.orgId_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="规格" width="200" prop="typeCode_dictText" align="center">
<template #default="scope">
{{ scope.row.typeCode_dictText ? scope.row.typeCode_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="当前价格" width="200" prop="ybType_dictText" align="center">
<template #default="scope">
{{ scope.row.ybType_dictText ? scope.row.ybType_dictText : '-' }}
</template>
</el-table-column>
<el-table-column label="调后价格" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column label="调价理由" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column label="调整时间" width="200" prop="price" align="center">
<template #default="scope">
{{ scope.row.price ? thousandNumber(scope.row.price) : '-' }}
</template>
</el-table-column>
<el-table-column
min-width="290"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
</el-form>
<el-dialog :title="title" v-model="openDetails" width="600px" append-to-body>
<el-table
v-loading="detailLoading"
:data="definitionDetailList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
>
<el-table-column label="条件" prop="conditionCode_enumText" align="center">
<template #default="scope">
{{ scope.row.conditionCode_enumText ? scope.row.conditionCode_enumText : '-' }}
</template>
</el-table-column>
<el-table-column label="价格" width="200" prop="amount" align="center">
<template #default="scope">
{{ scope.row.amount ? scope.row.amount : '-' }}
</template>
</el-table-column>
</el-table>
</el-dialog>
<edit
:title="title"
:open="open"
:formData="form"
@submit="submitForm"
@update:open="handleOpenChange"
@update:form="handleFormChange"
/>
</div>
</template>
<script setup>
import { listDefinition, initOption, updateDefinition, getSupplierList } from './components/api';
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
import medicineList from './components/medicineList.vue';
import { thousandNumber } from '@/utils/his.js';
import useUserStore from '@/store/modules/user';
const activeName = ref('1');
const showSearch = ref(true);
const loading = ref(true);
const detailLoading = ref(true);
const refreshTable = ref(true);
const definitionList = ref([]);
const definitionDetailList = ref([]);
const total = ref(0);
const tableRef = ref(null);
const selectedRows = ref([]);
// 获取 pinia 中用户信息
const userInfo = useUserStore();
// 申请人
const applicationName = ref(userInfo.nickName);
const { proxy } = getCurrentInstance();
const options = ref([]);
const title = ref('');
const open = ref(false);
const openDetails = ref(false);
const data = reactive({
form: {},
queryParams: {
search: '',
definitionType: '',
chargeItem: '',
searchKey: '',
pageNo: 1,
pageSize: 10,
},
});
const { queryParams, form } = toRefs(data);
// 切换tab
const handleClick = (tab, event) => {
console.log(tab, event);
activeName.value = tab.props.name;
queryParams.value.pageNo = 1;
handleInit();
// getList();
};
/** 查询委托单信息列表 */
function getList() {
loading.value = true;
queryParams.value.chargeItemContext = activeName.value;
listDefinition(queryParams.value).then((response) => {
definitionList.value = response.data.records;
total.value = response.data.total;
loading.value = false;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNo = 1;
getList();
}
// 表单重置
function reset() {
form.value = {
id: null,
itemNo: null,
chargeName: null,
totalVolume: null,
unitCode: null,
partPercent: null,
conditionYbCode: null,
price: null,
amount: null,
partMinUnitCode: null,
partConditionPrice: null,
partPrice: null,
description: null,
statusEnum: null,
itemId: null,
};
proxy.resetForm('einfoRef');
}
// 品名搜索
const medicineSearchKey = ref('');
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
form.value = row;
open.value = true;
title.value = '修改项目定价';
}
/** 搜索按钮操作 */
function handleInit() {
queryParams.value.definitionType = activeName.value;
loading.value = true;
initOption(queryParams.value).then((response) => {
options.value = response.data.publicationStatusOptions;
loading.value = false;
});
}
const handleOpenChange = (value) => {
open.value = value;
};
const handleFormChange = (newForm) => {
form.value = { ...newForm };
};
// 表格多选与删除
function handleSelectionChange(selection) {
selectedRows.value = selection || [];
}
// 删除选中行
function handleDelete() {
if (!selectedRows.value.length) {
proxy.$message.warning('请选择要删除的行');
return;
}
definitionList.value = definitionList.value.filter((row) => !selectedRows.value.includes(row));
selectedRows.value = [];
nextTick(() => {
tableRef.value && tableRef.value.clearSelection && tableRef.value.clearSelection();
});
}
// 弹出选择器引用与交互
const medicineListRef = ref(null);
function handleSearch(keyword) {
medicineSearchKey.value = keyword || '';
}
function selectRow(row, index) {
console.log('选中行数据:', row);
if (!definitionList.value[index]) return;
// 根据业务字段同步选中行信息
definitionList.value[index] = {
...definitionList.value[index],
itemId: row.id,
itemName: row.itemName || row.name || '',
...row,
};
}
// 新增按钮操作
function handleAdd() {
// if (!queryParams.value.supplierId) {
// proxy.$message.error('请选择供应商!');
// return;
// }
reset();
// 新增一行
definitionList.value.push({
id: null,
itemNo: null,
chargeName: null,
totalVolume: null,
unitCode: null,
partPercent: null,
conditionYbCode: null,
price: null,
amount: null,
partMinUnitCode: null,
partConditionPrice: null,
partPrice: null,
description: null,
statusEnum: null,
itemId: null,
});
}
/** 提交按钮 */
function submitForm(form) {
updateDefinition(form).then((response) => {
proxy.$modal.msgSuccess('操作成功');
open.value = false;
getList();
});
}
// 保存前校验与保存
function handleSave() {
console.log(queryParams.value.supplierId, 'queryParams.value.supplierId');
// 供应商必选
if (!queryParams.value.supplierId) {
proxy.$message.error('请选择供应商');
return;
}
// 至少一行
if (!definitionList.value || !definitionList.value.length) {
proxy.$message.warning('请先新增行再保存');
return;
}
// 按行校验
for (let i = 0; i < definitionList.value.length; i++) {
const row = definitionList.value[i] || {};
const rowIndex = i + 1;
// 名称/项目必填
if (!row.itemId && !row.itemName) {
proxy.$message.error(`${rowIndex}行:请选择名称`);
return;
}
// 调后价格校验(数字且>=0
const priceNum = Number(row.afterPrice);
if (!Number.isFinite(priceNum) || priceNum < 0) {
proxy.$message.error(`${rowIndex}行:请输入有效的调后价格(>=0`);
return;
}
// 与当前价格相同给出提示(但不强制)
if (Number(row.retailPrice) === priceNum) {
proxy.$message.warning(`${rowIndex}行:调后价格与当前价格相同`);
}
// 调价理由必填
if (!row.adjustReason || String(row.adjustReason).trim() === '') {
proxy.$message.error(`${rowIndex}行:请输入调价理由`);
return;
}
// 调整时间必选
if (!row.adjustTime) {
proxy.$message.error(`${rowIndex}行:请选择调整时间`);
return;
}
// 价格规范化为两位小数(不改变展示,仅在保存前处理)
row.afterPrice = Number(priceNum.toFixed(2));
}
// 所有校验通过
proxy.$message.success('校验通过');
// TODO: 在此调用保存接口(当前仅打印)
console.log('保存数据:', definitionList.value);
}
// 供应商列表
const supplierIDList = ref([]);
// 获取供应商列表
function getSupplierIDList() {
loading.value = true;
getSupplierList().then((res) => {
supplierIDList.value = res.data;
loading.value = false;
});
}
handleInit();
// 获取供应商列表
getSupplierIDList();
//getList();
</script>
<style lang="scss" scoped>
:deep(.demo-tabs > .el-tabs__content) {
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
:deep(.el-input__wrapper) {
height: 32px;
}
:deep(.el-input__inner) {
height: 30px;
}
:deep(.el-tabs__content) {
height: 80vh;
}
.el-select {
width: 150px !important;
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" loading-text="审批中。。。">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button v-if="viewStatus != 'view'" plain type="primary" icon="Edit" @click="handelApply"
@@ -150,437 +150,439 @@
<el-form :model="form" :rules="tableRules" ref="formRef" :disabled="viewStatus == 'apply'">
<!-- @cell-mouse-enter="handleMouseEnter" -->
<!-- v-click-outside-row="handleClickOutside" @row-click="handleRowClick" 点击行以外的部分自动保存 -->
<el-table
row-key="rowKey"
v-loading="loading"
:data="form.purchaseinventoryList"
@selection-change="handleSelectionChange"
ref="tableRef"
@cell-mouse-leave="handleMouseLeave"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="项目" align="center" key="name" prop="name" width="200" fixed>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.name`"
:rules="tableRules.name"
>
<el-input
v-if="viewStatus == 'view'"
v-model="scope.row.name"
placeholder=""
disabled
/>
<PopoverList
v-else
@search="handleSearch"
:width="1000"
:modelValue="scope.row.name"
>
<template #popover-content="{}">
<MedicineList
@selectRow="(row) => selectRow(row, scope.$index)"
:searchKey="medicineSearchKey"
:itemType="itemType"
/>
</template>
</PopoverList>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="规格"
align="center"
key="statusEnum_enumText"
prop="statusEnum_enumText"
width="150"
<el-scrollbar height="calc(100vh - 500px)">
<el-table
row-key="rowKey"
v-loading="loading"
:data="form.purchaseinventoryList"
@selection-change="handleSelectionChange"
ref="tableRef"
@cell-mouse-leave="handleMouseLeave"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.volume`"
:rules="tableRules.volume"
>
<el-input v-model="scope.row.volume" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="厂家/产地"
align="center"
key="manufacturer"
prop="manufacturer"
:show-overflow-tooltip="true"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.manufacturer`"
:rules="tableRules.manufacturer"
>
<el-input v-model="scope.row.manufacturer" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="仓库"
align="center"
key="purposeLocationId"
prop="purposeLocationId"
:show-overflow-tooltip="true"
width="180"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.purposeLocationId`"
:rules="tableRules.purposeLocationId"
>
<div class="select_wrapper_div">
<el-select
v-model="scope.row.purposeLocationId"
placeholder="请选择仓库"
:class="{ 'error-border': scope.row.error }"
clearable
:disabled="viewStatus == 'view'"
>
<el-option
v-for="(item, index) in locationList"
:key="index"
:label="item.name"
:value="item.id"
@click="handleLocationClick(item, scope.row, scope.$index)"
/>
</el-select>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="采购数量"
align="center"
key="itemQuantity"
prop="itemQuantity"
width="120"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.itemQuantity`"
:rules="tableRules.itemQuantity"
>
<div class="select_wrapper_div">
<el-input
:disabled="viewStatus == 'view'"
v-model="scope.row.itemQuantity"
placeholder=""
@blur="handleTotalPrice(scope.$index)"
:class="{ 'error-border': scope.row.error }"
/>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="计量单位"
align="center"
key="unitCode"
prop="unitCode"
:show-overflow-tooltip="true"
width="90"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.unitCode`"
:rules="tableRules.unitCode"
>
<!-- :disabled="data.isEdit" -->
<div class="select_wrapper_div">
<el-select
v-model="scope.row.unitCode"
placeholder=" "
:class="{ 'error-border': scope.row.error }"
:clearable="false"
:disabled="viewStatus == 'view'"
@change="(value) => handleUnitCodeChange(scope.row, scope.$index, value)"
>
<template v-if="scope.row.unitList && scope.row.partPercent > 1">
<el-option
:label="scope.row.unitList.unitCode_dictText"
:value="scope.row.unitList.unitCode"
/>
<el-option
:label="scope.row.unitList.minUnitCode_dictText"
:value="scope.row.unitList.minUnitCode"
/>
</template>
<template v-if="scope.row.unitList && scope.row.partPercent == 1">
<el-option
:label="scope.row.unitList.unitCode_dictText"
:value="scope.row.unitList.unitCode"
/>
</template>
<template v-if="!scope.row.unitList">
<el-option
:label="scope.row.unitCode_dictText"
:value="scope.row.unitCode"
/>
</template>
</el-select>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="药品追溯码"
align="center"
key="traceNo"
prop="traceNo"
width="130"
>
<template #default="scope">
<el-tooltip
:content="formatContent(scope.row.traceNo)"
placement="top"
popper-class="custom-tooltip"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="项目" align="center" key="name" prop="name" width="200" fixed>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.traceNo`"
:rules="tableRules.traceNo"
:prop="`purchaseinventoryList.${scope.$index}.name`"
:rules="tableRules.name"
>
<el-input
:disabled="viewStatus == 'view'"
v-model="scope.row.traceNo"
@change="(value) => handleTraceNoInput(value, scope.row)"
v-if="viewStatus == 'view'"
v-model="scope.row.name"
placeholder=""
:id="'traceNo' + `${scope.$index}`"
disabled
/>
<PopoverList
v-else
@search="handleSearch"
:width="1000"
:modelValue="scope.row.name"
>
<template #popover-content="{}">
<MedicineList
@selectRow="(row) => selectRow(row, scope.$index)"
:searchKey="medicineSearchKey"
:itemType="itemType"
/>
</template>
</PopoverList>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="规格"
align="center"
key="statusEnum_enumText"
prop="statusEnum_enumText"
width="150"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.volume`"
:rules="tableRules.volume"
>
<el-input v-model="scope.row.volume" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="厂家/产地"
align="center"
key="manufacturer"
prop="manufacturer"
:show-overflow-tooltip="true"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.manufacturer`"
:rules="tableRules.manufacturer"
>
<el-input v-model="scope.row.manufacturer" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="仓库"
align="center"
key="purposeLocationId"
prop="purposeLocationId"
:show-overflow-tooltip="true"
width="180"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.purposeLocationId`"
:rules="tableRules.purposeLocationId"
>
<div class="select_wrapper_div">
<el-select
v-model="scope.row.purposeLocationId"
placeholder="请选择仓库"
:class="{ 'error-border': scope.row.error }"
clearable
:disabled="viewStatus == 'view'"
>
<el-option
v-for="(item, index) in locationList"
:key="index"
:label="item.name"
:value="item.id"
@click="handleLocationClick(item, scope.row, scope.$index)"
/>
</el-select>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="采购数量"
align="center"
key="itemQuantity"
prop="itemQuantity"
width="120"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.itemQuantity`"
:rules="tableRules.itemQuantity"
>
<div class="select_wrapper_div">
<el-input
:disabled="viewStatus == 'view'"
v-model="scope.row.itemQuantity"
placeholder=""
@blur="handleTotalPrice(scope.$index)"
:class="{ 'error-border': scope.row.error }"
/>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="计量单位"
align="center"
key="unitCode"
prop="unitCode"
:show-overflow-tooltip="true"
width="90"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.unitCode`"
:rules="tableRules.unitCode"
>
<!-- :disabled="data.isEdit" -->
<div class="select_wrapper_div">
<el-select
v-model="scope.row.unitCode"
placeholder=" "
:class="{ 'error-border': scope.row.error }"
:clearable="false"
:disabled="viewStatus == 'view'"
@change="(value) => handleUnitCodeChange(scope.row, scope.$index, value)"
>
<template v-if="scope.row.unitList && scope.row.partPercent > 1">
<el-option
:label="scope.row.unitList.unitCode_dictText"
:value="scope.row.unitList.unitCode"
/>
<el-option
:label="scope.row.unitList.minUnitCode_dictText"
:value="scope.row.unitList.minUnitCode"
/>
</template>
<template v-if="scope.row.unitList && scope.row.partPercent == 1">
<el-option
:label="scope.row.unitList.unitCode_dictText"
:value="scope.row.unitList.unitCode"
/>
</template>
<template v-if="!scope.row.unitList">
<el-option
:label="scope.row.unitCode_dictText"
:value="scope.row.unitCode"
/>
</template>
</el-select>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="药品追溯码"
align="center"
key="traceNo"
prop="traceNo"
width="130"
>
<template #default="scope">
<el-tooltip
:content="formatContent(scope.row.traceNo)"
placement="top"
popper-class="custom-tooltip"
>
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.traceNo`"
:rules="tableRules.traceNo"
>
<el-input
:disabled="viewStatus == 'view'"
v-model="scope.row.traceNo"
@change="(value) => handleTraceNoInput(value, scope.row)"
placeholder=""
:id="'traceNo' + `${scope.$index}`"
/>
</el-form-item>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
label="追溯码包装"
align="center"
key="packagingLevels"
prop="packagingLevels"
width="130"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.packagingLevels`"
:rules="tableRules.packagingLevels"
>
<el-input
v-model="scope.row.packagingLevels"
placeholder=""
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
label="追溯码包装"
align="center"
key="packagingLevels"
prop="packagingLevels"
width="130"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.packagingLevels`"
:rules="tableRules.packagingLevels"
>
<el-input
v-model="scope.row.packagingLevels"
placeholder=""
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="采购单价(包装单位) "
align="center"
key="price"
prop="price"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.price`"
:rules="tableRules.price"
>
<div class="select_wrapper_div">
<el-input
v-model="scope.row.price"
placeholder=""
@blur="handleTotalPrice(scope.$index)"
:class="{ 'error-border': scope.row.error }"
:disabled="viewStatus == 'view'"
>
</template>
</el-table-column>
<el-table-column
label="采购单价(包装单位) "
align="center"
key="price"
prop="price"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.price`"
:rules="tableRules.price"
>
<div class="select_wrapper_div">
<el-input
v-model="scope.row.price"
placeholder=""
@blur="handleTotalPrice(scope.$index)"
:class="{ 'error-border': scope.row.error }"
:disabled="viewStatus == 'view'"
>
<template #suffix></template>
</el-input>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="合计金额 "
align="center"
key="totalPrice"
prop="totalPrice"
width="130"
>
<template #default="scope">
<el-form-item :prop="`purchaseinventoryList.${scope.$index}.totalPrice`">
<el-input disabled v-model="scope.row.totalPrice" placeholder="">
<template #suffix></template>
</el-input>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="合计金额 "
align="center"
key="totalPrice"
prop="totalPrice"
width="130"
>
<template #default="scope">
<el-form-item :prop="`purchaseinventoryList.${scope.$index}.totalPrice`">
<el-input disabled v-model="scope.row.totalPrice" placeholder="">
<template #suffix></template>
</el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="产品批号"
align="center"
key="lotNumber"
prop="lotNumber"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.lotNumber`"
:rules="tableRules.lotNumber"
>
<el-input
v-model="scope.row.lotNumber"
placeholder=""
maxlength="100"
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="生产日期"
align="center"
key="startTime"
prop="startTime"
width="150"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.startTime`"
:rules="tableRules.startTime"
>
<el-date-picker
v-model="scope.row.startTime"
type="date"
placeholder="选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:disabled="viewStatus == 'view'"
@change="changeValStart($event, scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="有效期至"
align="center"
key="endTime"
prop="endTime"
width="150"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.endTime`"
:rules="tableRules.endTime"
>
<el-date-picker
:disabled="viewStatus == 'view'"
v-model="scope.row.endTime"
type="date"
placeholder="选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="changeValEnd($event, scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="发票号 "
align="center"
key="invoiceNo"
prop="invoiceNo"
width="130"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.invoiceNo`"
:rules="tableRules.invoiceNo"
>
<el-input
v-model="scope.row.invoiceNo"
placeholder=""
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="备注" align="center" key="remake" prop="remake" width="130">
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.remake`"
:rules="tableRules.remake"
>
<el-input
v-model="scope.row.remake"
placeholder=""
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="货位"
align="center"
key="locationStoreName"
prop="locationStoreName"
width="180"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.locationStoreName`"
:rules="tableRules.locationStoreName"
>
<div class="select_wrapper_div">
<el-select
v-model="scope.row.locationStoreName"
placeholder="请选择货位"
:class="{ 'error-border': scope.row.error }"
clearable
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="产品批号"
align="center"
key="lotNumber"
prop="lotNumber"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.lotNumber`"
:rules="tableRules.lotNumber"
>
<el-input
v-model="scope.row.lotNumber"
placeholder=""
maxlength="100"
:disabled="viewStatus == 'view'"
>
</el-select>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="总库存数量"
align="center"
key="quantity"
prop="quantity"
width="120"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.quantity`"
:rules="tableRules.quantity"
>
<el-input v-model="scope.row.quantity" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column
v-if="!viewStatus"
label="操作"
align="center"
width="80"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handleScan(scope.row, scope.$index)"
>扫码</el-button
>
</template>
</el-table-column>
</el-table>
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="生产日期"
align="center"
key="startTime"
prop="startTime"
width="150"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.startTime`"
:rules="tableRules.startTime"
>
<el-date-picker
v-model="scope.row.startTime"
type="date"
placeholder="选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:disabled="viewStatus == 'view'"
@change="changeValStart($event, scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="有效期至"
align="center"
key="endTime"
prop="endTime"
width="150"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.endTime`"
:rules="tableRules.endTime"
>
<el-date-picker
:disabled="viewStatus == 'view'"
v-model="scope.row.endTime"
type="date"
placeholder="选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="changeValEnd($event, scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="发票号 "
align="center"
key="invoiceNo"
prop="invoiceNo"
width="130"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.invoiceNo`"
:rules="tableRules.invoiceNo"
>
<el-input
v-model="scope.row.invoiceNo"
placeholder=""
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="备注" align="center" key="remake" prop="remake" width="130">
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.remake`"
:rules="tableRules.remake"
>
<el-input
v-model="scope.row.remake"
placeholder=""
:disabled="viewStatus == 'view'"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="货位"
align="center"
key="locationStoreName"
prop="locationStoreName"
width="180"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.locationStoreName`"
:rules="tableRules.locationStoreName"
>
<div class="select_wrapper_div">
<el-select
v-model="scope.row.locationStoreName"
placeholder="请选择货位"
:class="{ 'error-border': scope.row.error }"
clearable
:disabled="viewStatus == 'view'"
>
</el-select>
</div>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="总库存数量"
align="center"
key="quantity"
prop="quantity"
width="120"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.quantity`"
:rules="tableRules.quantity"
>
<el-input v-model="scope.row.quantity" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column
v-if="!viewStatus"
label="操作"
align="center"
width="80"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handleScan(scope.row, scope.$index)"
>扫码</el-button
>
</template>
</el-table-column>
</el-table>
</el-scrollbar>
</el-form>
</el-tab-pane>
</el-tabs>
@@ -682,6 +684,7 @@ const ypName = ref('');
const rowIndex = ref(-1);
const totalAmount = ref(0);
const editData = ref({});
const pageLoading = ref(false);
const form = reactive({
purchaseinventoryList: [],
});
@@ -1310,7 +1313,7 @@ function handlePrint() {
}, 0);
result.push({
supplierName: supplierName,
totalAmount: totalAmount,
totalAmount: totalAmount.toFixed(2),
...receiptHeaderForm,
purchaseinventoryList: form.purchaseinventoryList,
});
@@ -1498,18 +1501,24 @@ function handleReject() {
});
}
function handelApply() {
purchaseInventoryApproved(route.query.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentData();
// 跳转到审核页面
router.replace({
path: '/aaaa/medicationmanagement/billapproval',
query: { type: 'purchaseDocument' },
});
}
});
pageLoading.value = true;
purchaseInventoryApproved(route.query.supplyBusNo)
.then((res) => {
if (res.code == 200) {
pageLoading.value = false;
proxy.$modal.msgSuccess('操作成功');
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentData();
// 跳转到审核页面
router.replace({
path: '/aaaa/medicationmanagement/billapproval',
query: { type: 'purchaseDocument' },
});
}
})
.catch(() => {
pageLoading.value = false;
});
}
function toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0];
@@ -1602,4 +1611,4 @@ getPurchaseinventoryTypeList();
.error-border {
border: 1px solid red;
}
</style>
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button v-if="viewStatus != 'view'" plain type="primary" icon="Edit" @click="handelApply"
@@ -545,6 +545,7 @@ const row = ref({});
const rowIndex = ref(-1);
const totalAmount = ref(0);
const purposeTypeListOptions = ref(undefined);
const pageLoading = ref(false)
const props = defineProps({
sourceTypeListOptions: {
type: Object,
@@ -916,8 +917,10 @@ function handleReject() {
});
}
function handelApply() {
pageLoading.value = true
requisitionIssueApproved(route.query.supplyBusNo).then((res) => {
if (res.code == 200) {
pageLoading.value = false
proxy.$modal.msgSuccess('操作成功');
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentDataLYCK();
@@ -927,6 +930,8 @@ function handelApply() {
query: { type: 'requisitionManagement' },
});
}
}).catch(() => {
pageLoading.value = false
});
}
/** 提交审核按钮 */

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" loading-text="审批中。。。">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button v-if="viewStatus != 'view'" plain type="primary" icon="Edit" @click="handelApply"
@@ -573,6 +573,7 @@ const visible = ref(false);
const row = ref({});
const rowIndex = ref(-1);
const totalAmount = ref(0);
const pageLoading = ref(false)
const props = defineProps({
sourceTypeListOptions: {
type: Object,
@@ -987,8 +988,10 @@ function handleReject() {
});
}
function handelApply() {
pageLoading.value = true
returnIssueApproved(route.query.supplyBusNo).then((res) => {
if (res.code == 200) {
pageLoading.value = false
proxy.$modal.msgSuccess('操作成功');
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentDataLYTK();
@@ -998,6 +1001,8 @@ function handelApply() {
query: { type: 'returningInventory' },
});
}
}).catch(() => {
pageLoading.value = false
});
}
/** 提交审核按钮 */

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" loading-text="审批中...">
<!-- <el-dialog title="调拨单据" v-model="visible" width="1500" append-to-body> -->
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
@@ -1354,14 +1354,18 @@ function handleReject() {
});
}
function handelApply() {
pageLoading.value = true
purchaseInventoryApproved(route.query.originalSupplyBusNo).then((res) => {
if (res.code == 200) {
pageLoading.value = false
proxy.$modal.msgSuccess("操作成功");
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentReturnData();
// 跳转到审核页面
router.replace({ path: '/aaaa/medicationmanagement/billapproval',query:{type:'returnedPurchase'}});
}
}).catch(() => {
pageLoading.value = false
})
}
function toLastView(visitedViews, view) {

View File

@@ -3,77 +3,196 @@
<el-tabs v-model="activeTabName" type="card" class="inOut-tabs" @tab-click="hendleTabChange">
<el-tab-pane label="对账" name="first">
<el-row :guutter="15">
<el-form :model="totalPrice" ref="priceRef" :inline="true">
<el-row :guutter="15">
<el-form-item label="结算经办机构:" prop="setlOptins" label-width="160px">
<el-input v-model="totalPrice.setlOptins" placeholder="请输入结算经办机构" clearable style="width: 150px"
@keyup.enter="handleQuery" />
<el-input
v-model="totalPrice.setlOptins"
placeholder="请输入结算经办机构"
clearable
style="width: 150px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="结算日期:" label-width="130px">
<el-date-picker v-model="occurrenceTime" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 300px"></el-date-picker>
<el-date-picker
v-model="occurrenceTime"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 300px"
></el-date-picker>
</el-form-item>
<el-form-item label="清算类型:" prop="clrType" label-width="160px">
<el-select v-model="queryParams.clrType" placeholder="请选择清算类型" clearable style="width: 150px">
<el-option v-for="categoryCode in clrTypeOptions" :key="categoryCode.value" :label="categoryCode.label"
:value="categoryCode.value" />
<el-select
v-model="queryParams.clrType"
placeholder="请选择清算类型"
clearable
style="width: 150px"
>
<el-option
v-for="categoryCode in clrTypeOptions"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
/>
</el-select>
</el-form-item>
<el-form-item label="险种类型:" prop="insutype" label-width="160px">
<el-select v-model="queryParams.insutype" placeholder="请选择险种类型" clearable style="width: 150px">
<el-option v-for="categoryCode in insutypeOptions" :key="categoryCode.value" :label="categoryCode.label"
:value="categoryCode.value" />
<el-select
v-model="queryParams.insutype"
placeholder="请选择险种类型"
clearable
style="width: 150px"
>
<el-option
v-for="categoryCode in insutypeOptions"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
/>
</el-select>
</el-form-item>
</el-row>
<el-row :guutter="15">
<el-form-item label="医疗费总额:" prop="medfeeSumamt" label-width="160px">
<el-input v-model="totalPrice.medfeeSumamt" placeholder="请输入医疗费总额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.medfeeSumamt"
placeholder="请输入医疗费总额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="基金支付总额:" prop="fundAppySum" label-width="160px">
<el-input v-model="totalPrice.fundAppySum" placeholder="请输入基金支付总额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.fundAppySum"
placeholder="请输入基金支付总额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="个人账户支付金额:" prop="acctPay" label-width="160px">
<el-input v-model="totalPrice.acctPay" placeholder="请输入个人账户支付金额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.acctPay"
placeholder="请输入个人账户支付金额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="现金支付金额:" prop="cashPayamt" label-width="160px">
<el-input v-model="totalPrice.cashPayamt" placeholder="请输入现金支付金额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.cashPayamt"
placeholder="请输入现金支付金额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="结算笔数:" prop="setlCnt" label-width="160px">
<el-input v-model="totalPrice.setlCnt" placeholder="请输入结算笔数" clearable style="width: 150px" />
<el-input
v-model="totalPrice.setlCnt"
placeholder="请输入结算笔数"
clearable
style="width: 150px"
/>
</el-form-item>
<!-- <el-button type="primary" plain icon="Edit" @click="handOperatedApply">手动清算</el-button> -->
<el-button type="primary" plain icon="Edit" @click="handOperatedReconcileAccounts">手动对账</el-button>
<el-button type="primary" plain icon="Edit" @click="handOperatedReconcileAccounts"
>手动对账</el-button
>
</el-row>
</el-form>
</el-row>
<!-- </div> -->
<el-table v-loading="loading" :data="purchaseinventoryList" @selection-change="handleSelectionChange"
@row-click="handleRowClick">
<el-table
v-loading="loading"
:data="purchaseinventoryList"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="申请清算ID" align="center" key="outResult" prop="outResult" width="270"
:show-overflow-tooltip="true" />
<el-table-column label="开始时间" align="center" key="begndate" prop="begndate" width="150"
:show-overflow-tooltip="true" />
<el-table-column label="结束时间" align="center" key="enddate" prop="enddate" width="150"
:show-overflow-tooltip="true" />
<el-table-column label="清算类别" align="center" key="clrType" prop="clrType" width="100"
:show-overflow-tooltip="true" />
<el-table-column label="总费用" align="center" key="medfeeSumamt" prop="medfeeSumamt" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="医保认可总费用" align="center" key="medSumfee" prop="medSumfee" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="基金申报金额" align="center" key="fundAppySum" prop="fundAppySum" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="现金支付总额" align="center" key="cashPayamt" prop="cashPayamt" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="个人账户金额" align="center" key="acctPay" prop="acctPay" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" key="status" prop="status" width="170" :show-overflow-tooltip="true">
<el-table-column
label="申请清算ID"
align="center"
key="outResult"
prop="outResult"
width="270"
:show-overflow-tooltip="true"
/>
<el-table-column
label="开始时间"
align="center"
key="begndate"
prop="begndate"
width="150"
:show-overflow-tooltip="true"
/>
<el-table-column
label="结束时间"
align="center"
key="enddate"
prop="enddate"
width="150"
:show-overflow-tooltip="true"
/>
<el-table-column
label="清算类别"
align="center"
key="clrType"
prop="clrType"
width="100"
:show-overflow-tooltip="true"
/>
<el-table-column
label="总费用"
align="center"
key="medfeeSumamt"
prop="medfeeSumamt"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医保认可总费用"
align="center"
key="medSumfee"
prop="medSumfee"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="基金申报金额"
align="center"
key="fundAppySum"
prop="fundAppySum"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="现金支付总额"
align="center"
key="cashPayamt"
prop="cashPayamt"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="个人账户金额"
align="center"
key="acctPay"
prop="acctPay"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="状态"
align="center"
key="status"
prop="status"
width="170"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.setlTime) }}</span>
</template>
@@ -89,33 +208,77 @@
<span>{{ scope.row.refdSetlFlag==1?'退费':'' }}</span>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
<el-table-column
label="操作"
align="center"
width="300"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button type="danger" link icon="revoked-filled" :disabled="scope.row.id == ''"
@click="revokedSelectedRows(scope.row)">
<el-button
type="danger"
link
icon="revoked-filled"
:disabled="scope.row.id == ''"
@click="revokedSelectedRows(scope.row)"
>
撤销
</el-button>
</template>
</el-table-column>
</el-table>
<span class="descriptions-item-label">对账结果</span>
<div
style="
background: #f5f7fa;
border: solid 1px;
border-color: #e4e7ed;
width: 50%;
height: 100px;
margin-top: 20px;
"
>
<span>{{ reconciliation }}</span>
</div>
</el-tab-pane>
<el-tab-pane label="清算" name="second">
<el-row :guutter="15">
<el-form :model="totalPrice" ref="priceRef" :inline="true">
<el-row :guutter="15">
<el-form-item label="结算经办机构:" prop="setlOptins" label-width="160px">
<el-input v-model="totalPrice.setlOptins" placeholder="请输入结算经办机构" clearable style="width: 150px"
@keyup.enter="handleQuery" />
<el-input
v-model="totalPrice.setlOptins"
placeholder="请输入结算经办机构"
clearable
style="width: 150px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="结算日期:" label-width="130px">
<el-date-picker v-model="occurrenceTime" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 300px"></el-date-picker>
<el-date-picker
v-model="occurrenceTime"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 300px"
></el-date-picker>
</el-form-item>
<el-form-item label="清算类型:" prop="clrType" label-width="160px">
<el-select v-model="queryParams.clrType" placeholder="请选择清算类型" clearable style="width: 150px">
<el-option v-for="categoryCode in clrTypeOptions" :key="categoryCode.value" :label="categoryCode.label"
:value="categoryCode.value" />
<el-select
v-model="queryParams.clrType"
placeholder="请选择清算类型"
clearable
style="width: 150px"
>
<el-option
v-for="categoryCode in clrTypeOptions"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="险种类型:" prop="insutype" label-width="160px">
@@ -127,51 +290,136 @@
</el-row>
<el-row :guutter="15">
<el-form-item label="医疗费总额:" prop="medfeeSumamt" label-width="160px">
<el-input v-model="totalPrice.medfeeSumamt" placeholder="请输入医疗费总额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.medfeeSumamt"
placeholder="请输入医疗费总额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="基金支付总额:" prop="fundAppySum" label-width="160px">
<el-input v-model="totalPrice.fundAppySum" placeholder="请输入基金支付总额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.fundAppySum"
placeholder="请输入基金支付总额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="个人账户支付金额:" prop="acctPay" label-width="160px">
<el-input v-model="totalPrice.acctPay" placeholder="请输入个人账户支付金额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.acctPay"
placeholder="请输入个人账户支付金额"
clearable
style="width: 150px"
/>
</el-form-item>
<el-form-item label="现金支付金额:" prop="cashPayamt" label-width="160px">
<el-input v-model="totalPrice.cashPayamt" placeholder="请输入现金支付金额" clearable style="width: 150px" />
<el-input
v-model="totalPrice.cashPayamt"
placeholder="请输入现金支付金额"
clearable
style="width: 150px"
/>
</el-form-item>
<!-- <el-form-item label="结算笔数:" prop="setlCnt" label-width="160px">
<el-input v-model="totalPrice.setlCnt" placeholder="请输入结算笔数" clearable style="width: 150px" />
</el-form-item> -->
<el-button type="primary" plain icon="Edit" @click="handOperatedApply">手动清算</el-button>
<el-button type="primary" plain icon="Edit" @click="handOperatedApply"
>手动清算</el-button
>
<!-- <el-button type="primary" plain icon="Edit" @click="handOperatedReconcileAccounts">手动对账</el-button> -->
</el-row>
</el-form>
</el-row>
<!-- </div> -->
<el-table v-loading="loading" :data="purchaseinventoryList" @selection-change="handleSelectionChange"
@row-click="handleRowClick">
<el-table
v-loading="loading"
:data="purchaseinventoryList"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="申请清算ID" align="center" key="outResult" prop="outResult" width="270"
:show-overflow-tooltip="true" />
<el-table-column label="开始时间" align="center" key="begndate" prop="begndate" width="150"
:show-overflow-tooltip="true" />
<el-table-column label="结束时间" align="center" key="enddate" prop="enddate" width="150"
:show-overflow-tooltip="true" />
<el-table-column label="清算类别" align="center" key="clrType" prop="clrType" width="100"
:show-overflow-tooltip="true" />
<el-table-column label="总费用" align="center" key="medfeeSumamt" prop="medfeeSumamt" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="医保认可总费用" align="center" key="medSumfee" prop="medSumfee" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="基金申报金额" align="center" key="fundAppySum" prop="fundAppySum" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="现金支付总额" align="center" key="cashPayamt" prop="cashPayamt" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="个人账户金额" align="center" key="acctPay" prop="acctPay" width="170"
:show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" key="status" prop="status" width="170" :show-overflow-tooltip="true">
<el-table-column
label="申请清算ID"
align="center"
key="outResult"
prop="outResult"
width="270"
:show-overflow-tooltip="true"
/>
<el-table-column
label="开始时间"
align="center"
key="begndate"
prop="begndate"
width="150"
:show-overflow-tooltip="true"
/>
<el-table-column
label="结束时间"
align="center"
key="enddate"
prop="enddate"
width="150"
:show-overflow-tooltip="true"
/>
<el-table-column
label="清算类别"
align="center"
key="clrType"
prop="clrType"
width="100"
:show-overflow-tooltip="true"
/>
<el-table-column
label="总费用"
align="center"
key="medfeeSumamt"
prop="medfeeSumamt"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医保认可总费用"
align="center"
key="medSumfee"
prop="medSumfee"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="基金申报金额"
align="center"
key="fundAppySum"
prop="fundAppySum"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="现金支付总额"
align="center"
key="cashPayamt"
prop="cashPayamt"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="个人账户金额"
align="center"
key="acctPay"
prop="acctPay"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="状态"
align="center"
key="status"
prop="status"
width="170"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.setlTime) }}</span>
</template>
@@ -187,32 +435,56 @@ prop="refdSetlFlag"
<span>{{ scope.row.refdSetlFlag==1?'退费':'' }}</span>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
<el-table-column
label="操作"
align="center"
width="300"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button type="danger" link icon="revoked-filled" :disabled="scope.row.id == ''"
@click="revokedSelectedRows(scope.row)">
<el-button
type="danger"
link
icon="revoked-filled"
:disabled="scope.row.id == ''"
@click="revokedSelectedRows(scope.row)"
>
撤销
</el-button>
</template>
</el-table-column>
</el-table>
<span class="descriptions-item-label">清算结果</span>
<div
style="
background: #f5f7fa;
border: solid 1px;
border-color: #e4e7ed;
width: 50%;
height: 100px;
margin-top: 20px;
"
>
<span>{{ reconciliation }}</span>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup name="reconciliationDetails">
<script setup name="LiquidationRecords">
import {
applyFinancialClearingList,
applyUnClearing,
autoApplyFinancialClearing,
reconcileDetailList,
handOperatedApplyFinancialClearing,
handOperatedApplyReconcileAccounts
} from "./statisticalManagent";
import { getToken } from "@/utils/auth";
handOperatedApplyReconcileAccounts,
} from './statisticalManagent';
import { getToken } from '@/utils/auth';
import { formatDateStr } from '@/utils/index';
import { ref } from "vue";
import { ref } from 'vue';
const { proxy } = getCurrentInstance();
const purchaseinventoryList = ref([]);
const loading = ref(false);
@@ -222,20 +494,21 @@ const multiple = ref(true);
const total = ref(0);
const occurrenceTime = ref([
formatDateStr(getFirstDayOfMonth(new Date()), 'YYYY-MM-DD'), // 当前月份的第一天
formatDateStr(new Date(), 'YYYY-MM-DD') // 当天
])
const activeTabName = ref("first");
formatDateStr(new Date(), 'YYYY-MM-DD'), // 当天
]);
const activeTabName = ref('first');
const clrTypeOptions = ref([]);
const insutypeOptions = ref([]);
const filePath = ref("")
const purchaseinventoryReturnList = ref([])
const loadingReturn = ref(false)
const selectedRow = ref([])
const filePath = ref('');
const purchaseinventoryReturnList = ref([]);
const loadingReturn = ref(false);
const selectedRow = ref([]);
const fileSize = ref(10)
const fileSize = ref(10);
const uploadList = ref([]);
const reconciliation = ref('');
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const fileType = ref(["zip", "txt"]);
const fileType = ref(['zip', 'txt']);
const data = reactive({
form: {},
queryParams: {
@@ -244,7 +517,7 @@ const data = reactive({
setlOptins: '229900',
filePath: undefined,
orgId: undefined,
clrType: undefined,
clrType: 11,
fileQuryNo: undefined,
stmtBegnDate: undefined,
stmtEndDate: undefined,
@@ -259,31 +532,67 @@ const totalPrice = reactive({
cashPayamt: 0,
counts: 0,
setlCnt: 0,
medSumfee: 0.00
medSumfee: 0.0,
});
const { queryParams, form, rules } = toRefs(data);
// 接收路由参数
const route = useRoute();
// 监听路由变化
watch(
() => route.query,
(newQuery) => {
// 当路由 query 参数变化时执行
if (newQuery.currentRow) {
try {
const currentRow = JSON.parse(newQuery.currentRow);
console.log('接收到的currentRow参数:', currentRow);
// 处理接收到的参数
if (currentRow) {
totalPrice.medfeeSumamt = currentRow.medFeeSumAmt || 0;
totalPrice.fundAppySum = currentRow.fundPaySumAmt || 0;
totalPrice.acctPay = currentRow.acctPay || 0;
totalPrice.cashPayamt = currentRow.acctGjPay || 0;
totalPrice.counts = currentRow.fixMedInsSetlCnt || 0;
queryParams.insutype = currentRow.insutype;
// 如果有传递时间参数也一并处理
if (newQuery.occurrenceTime) {
occurrenceTime.value = newQuery.occurrenceTime;
}
console.log('已更新参数:', currentRow);
}
} catch (error) {
console.error('解析currentRow参数失败:', error);
}
}
},
{ immediate: true } // 立即执行一次,处理首次加载的情况
);
watch(
() => purchaseinventoryList.value,
(newVlaue) => {
if (newVlaue && newVlaue.length > 0) {
handleTotalAmount()
handleTotalAmount();
}
},
{ immediate: true }
)
);
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.stmtBegnDate =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[0] + " 00:00:00"
: "";
? occurrenceTime.value[0] + ' 00:00:00'
: '';
queryParams.value.stmtEndDate =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[1] + " 23:59:59"
: "";
? occurrenceTime.value[1] + ' 23:59:59'
: '';
// queryParams.value.pageNo = 1;
getList();
}
@@ -294,8 +603,8 @@ function getFirstDayOfMonth(date) {
// 对象转成指定字符串分隔
function listToString(list, separator) {
let strs = "";
separator = separator || ",";
let strs = '';
separator = separator || ',';
for (let i in list) {
if (list[i].url) {
strs += list[i].url + separator;
@@ -305,31 +614,16 @@ function listToString(list, separator) {
}
/**计算合计金额 */
function handleTotalAmount() {
totalPrice.counts = purchaseinventoryList.value.length
totalPrice.medfeeSumamt = purchaseinventoryList.value.reduce(
(accumulator, currentRow) => {
return Number(
(accumulator + Number(currentRow.medfeeSumamt || 0)).toFixed(2)
);
},
0
);
totalPrice.fundAppySum = purchaseinventoryList.value.reduce(
(accumulator, currentRow) => {
return Number(
(accumulator + Number(currentRow.fundPaySumamt || 0)).toFixed(2)
);
},
0
);
totalPrice.acctPay = purchaseinventoryList.value.reduce(
(accumulator, currentRow) => {
return Number(
(accumulator + Number(currentRow.acctPay || 0)).toFixed(2)
);
},
0
);
totalPrice.counts = purchaseinventoryList.value.length;
totalPrice.medfeeSumamt = purchaseinventoryList.value.reduce((accumulator, currentRow) => {
return Number((accumulator + Number(currentRow.medfeeSumamt || 0)).toFixed(2));
}, 0);
totalPrice.fundAppySum = purchaseinventoryList.value.reduce((accumulator, currentRow) => {
return Number((accumulator + Number(currentRow.fundPaySumamt || 0)).toFixed(2));
}, 0);
totalPrice.acctPay = purchaseinventoryList.value.reduce((accumulator, currentRow) => {
return Number((accumulator + Number(currentRow.acctPay || 0)).toFixed(2));
}, 0);
// 现金支付金额
// cashPayamt.value = purchaseinventoryList.value.reduce(
// (accumulator, currentRow) => {
@@ -355,7 +649,6 @@ function getPharmacyCabinetLists() {
{ value: 380, label: '新型农村合作医疗' },
{ value: 391, label: '城镇居民基本医疗保险' },
{ value: 392, label: '城乡居民大病医疗保险' },
];
}
@@ -369,18 +662,17 @@ function getList() {
applyFinancialClearingList(queryParams.value).then((res) => {
// console.log(res,"res----------------")
// loading.value = false;
// purchaseinventoryList.value = [{psnNo:"123",mdtrtId:"121",setlId:"1213",medfeeSumamt:"122",fundPaySumamt:"12",acctPay:"4.72",insutype:"410",clrType: 11,contractNo:"229900"},{psnNo:"123",mdtrtId:"121",setlId:"1213",medfeeSumamt:"122",fundPaySumamt:"12",acctPay:"7.43",insutype:"410",clrType: 11,contractNo:"229900"},{psnNo:"123",mdtrtId:"121",setlId:"1213",medfeeSumamt:"122",fundPaySumamt:"12",acctPay:"1",insutype:"410",clrType: 11,contractNo:"229900"},{psnNo:"123",mdtrtId:"121",setlId:"1213",medfeeSumamt:"122",fundPaySumamt:"12",acctPay:"-1",insutype:"410",clrType: 11,contractNo:"229900"}]
purchaseinventoryList.value = res.data.records ? res.data.records : res.data;
total.value = res.data.total;
});
}
function handleApplyForLiquidation() {
let params = {}
params.clrType = queryParams.value.clrType ? queryParams.value.clrType : ""
params.setlOptins = queryParams.value.setlOptins ? queryParams.value.setlOptins : ""
params.stmtBegnDate = queryParams.value.stmtBegnDate ? queryParams.value.stmtBegnDate : ""
params.stmtEndDate = queryParams.value.stmtEndDate ? queryParams.value.stmtEndDate : ""
let params = {};
params.clrType = queryParams.value.clrType ? queryParams.value.clrType : '';
params.setlOptins = queryParams.value.setlOptins ? queryParams.value.setlOptins : '';
params.stmtBegnDate = queryParams.value.stmtBegnDate ? queryParams.value.stmtBegnDate : '';
params.stmtEndDate = queryParams.value.stmtEndDate ? queryParams.value.stmtEndDate : '';
autoApplyFinancialClearing(params).then((res) => {
console.log(res.data, 'res----------------');
loading.value = false;
@@ -393,34 +685,39 @@ function isAllSelected() {
function revokedSelectedRows(row) {
let queryParamsss = {
clrAppyEvtId: row.outResult,
clroptins: queryParams.value.setlOptins ? queryParams.value.setlOptins : "",
}
applyUnClearing(queryParamsss).then(res => {
proxy.$message.success('撤销成功')
getList()
}).catch(err => {
proxy.$message.error('撤销失败')
})
clroptins: queryParams.value.setlOptins ? queryParams.value.setlOptins : '',
};
applyUnClearing(queryParamsss)
.then((res) => {
proxy.$message.success('撤销成功');
getList();
})
.catch((err) => {
proxy.$message.error('撤销失败');
});
}
/** 选择条数 */
function handleSelectionChange(selection) {
selectedRow.value = selection
console.log(selectedRow.value, "selectedRow.value")
selectedRow.value = selection;
console.log(selectedRow.value, 'selectedRow.value');
ids.value = selection.map((item) => item.setlId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
function handOperatedApply() {
const params = { ...totalPrice }
params.clrOptins = queryParams.value.setlOptins ? queryParams.value.setlOptins : ""
params.begndate = occurrenceTime.value[0] ? occurrenceTime.value[0] + ' 00:00:00' : ""
params.enddate = occurrenceTime.value[1] ? occurrenceTime.value[1] + ' 23:59:59' : ""
params.clrType = queryParams.value.clrType ? queryParams.value.clrType : ""
handOperatedApplyFinancialClearing(params).then(res => {
}).catch(err => {
proxy.$message.error('申请失败')
})
const params = { ...totalPrice };
params.clrOptins = totalPrice.setlOptins ? totalPrice.setlOptins : '';
params.begndate = occurrenceTime.value[0] ? occurrenceTime.value[0] + ' 00:00:00' : '';
params.enddate = occurrenceTime.value[1] ? occurrenceTime.value[1] + ' 23:59:59' : '';
params.clrType = queryParams.value.clrType ? queryParams.value.clrType : '';
handOperatedApplyFinancialClearing(params)
.then((res) => {
reconciliation.value = res.data;
})
.catch((err) => {
proxy.$message.error('申请失败');
});
}
function hendleTabChange() {
@@ -430,39 +727,43 @@ function hendleTabChange() {
totalPrice.cashPayamt = 0;
totalPrice.counts = 0;
totalPrice.setlCnt = 0;
totalPrice.medSumfee = 0.00;
totalPrice.medSumfee = 0.0;
occurrenceTime.value = [
formatDateStr(getFirstDayOfMonth(new Date()), 'YYYY-MM-DD'), // 当前月份的第一天
formatDateStr(new Date(), 'YYYY-MM-DD') // 当天
]
purchaseinventoryList.value = []
formatDateStr(new Date(), 'YYYY-MM-DD'), // 当天
];
purchaseinventoryList.value = [];
queryParams.value = {
setlOptins: '229900',
setlOptins: undefined,
filePath: undefined,
orgId: undefined,
clrType: undefined,
fileQuryNo: undefined,
stmtBegnDate: undefined,
stmtEndDate: undefined,
}
};
reconciliation.value = '';
}
function handOperatedReconcileAccounts() {
const params = { ...totalPrice }
params.clrOptins = queryParams.value.setlOptins ? queryParams.value.setlOptins : ""
params.begndate = occurrenceTime.value[0] ? occurrenceTime.value[0] + ' 00:00:00' : ""
params.enddate = occurrenceTime.value[1] ? occurrenceTime.value[1] + ' 23:59:59' : ""
params.clrType = queryParams.value.clrType ? queryParams.value.clrType : ""
params.insutype = queryParams.value.insutype ? queryParams.value.insutype : ""
handOperatedApplyReconcileAccounts(params).then(res => {
}).catch(err => {
proxy.$message.error('对账失败')
})
const params = { ...totalPrice };
params.clrOptins = totalPrice.setlOptins ? totalPrice.setlOptins : '';
params.begndate = occurrenceTime.value[0] ? occurrenceTime.value[0] + ' 00:00:00' : '';
params.enddate = occurrenceTime.value[1] ? occurrenceTime.value[1] + ' 23:59:59' : '';
params.clrType = queryParams.value.clrType ? queryParams.value.clrType : '';
params.insutype = queryParams.value.insutype ? queryParams.value.insutype : '';
handOperatedApplyReconcileAccounts(params)
.then((res) => {
reconciliation.value = res.data;
})
.catch((err) => {
proxy.$message.error('对账失败');
});
}
//点击列表当前行
function handleRowClick(row) {
// editRowTK.value = row
console.log(row, "row")
console.log(row, 'row');
// if(row.returnStatus==1){
// loadingReturn.value = true
// generatedReturnDetail(row.supplyBusNo).then((response) => {
@@ -470,16 +771,15 @@ function handleRowClick(row) {
// purchaseinventoryReturnList.value.map(k=>{
// // k.returnStatus_text = k.returnStatus==1?'已退库':''
// k.originalSupplyBusNo = k.originalSupplyBusNo?k.originalSupplyBusNo:row.supplyBusNo
// })
// })
// })
// loadingReturn.value = false
// }
}
getList();
getPharmacyCabinetLists()
getPharmacyCabinetLists();
</script>
<style scoped>
.custom-tree-node {

View File

@@ -1,21 +1,16 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="100px"
>
<el-form-item label="药品名称:" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="编码/单据号/药品名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="单据号:" prop="busNo">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
<el-form-item label="药品名称:" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="编码/单据号/药品名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="单据号:" prop="busNo">
<el-input
v-model="queryParams.busNo"
placeholder="单据号:"
@@ -67,7 +62,7 @@
/>
</el-select>
</el-form-item> -->
<el-form-item label="存放仓库:" prop="purposeLocationId" >
<el-form-item label="存放仓库:" prop="purposeLocationId">
<el-select
v-model="queryParams.purposeLocationId"
placeholder=""
@@ -75,14 +70,14 @@
style="width: 150px"
>
<el-option
v-for="supplyStatus in locationIdList"
v-for="supplyStatus in locationIdList"
:key="supplyStatus.value"
:label="supplyStatus.name"
:value="supplyStatus.id"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="项目类型:" prop="categoryType">
<el-select
v-model="queryParams.categoryType"
@@ -99,12 +94,7 @@
</el-select>
</el-form-item> -->
<el-form-item label="供应商:" prop="supplierId">
<el-select
v-model="queryParams.supplierId"
placeholder=""
clearable
style="width: 150px"
>
<el-select v-model="queryParams.supplierId" placeholder="" clearable style="width: 150px">
<el-option
v-for="supplierList in supplierListOptions"
:key="supplierList.value"
@@ -118,33 +108,14 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- v-hasPermi="['system:user:import']" -->
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
>查询</el-button
>
<el-button type="primary" plain icon="Search" @click="handleQuery">查询</el-button>
</el-col>
<el-col :span="1.5">
<!-- v-hasPermi="['system:user:export']" -->
<el-button
type="warning"
plain
icon="CircleClose"
@click="handleClear"
>重置</el-button
>
<el-button type="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
>导出</el-button>
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
</el-row>
@@ -152,9 +123,10 @@
v-loading="loading"
:data="purchaseinventoryList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<!-- <el-table-column
<!-- <el-table-column
label="药品名称"
align="center"
key="name"
@@ -167,7 +139,7 @@
align="center"
key="supplyBusno"
prop="supplyBusno"
width="200"
width="200"
:show-overflow-tooltip="true"
/>
<!-- itemTable -->
@@ -176,7 +148,7 @@
align="center"
key="name"
prop="name"
width="140"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
@@ -208,7 +180,7 @@
align="center"
key="locationName"
prop="locationName"
width="140"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
@@ -267,7 +239,7 @@
prop="department"
:show-overflow-tooltip="true"
/> -->
<el-table-column
<el-table-column
label="供应商"
align="center"
key="supplier"
@@ -320,8 +292,8 @@
import {
getReportInboundPCage,
getPharmacyCabinetList,
getInboundInit
} from "./statisticalManagent";
getInboundInit,
} from './statisticalManagent';
const { proxy } = getCurrentInstance();
const route = useRoute();
@@ -347,17 +319,17 @@ const data = reactive({
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
busNo: undefined,
name:undefined,
searchKey: undefined,
busNo: undefined,
name: undefined,
medicationDefId: undefined,
// approvalTime:undefined,
department:undefined,
department: undefined,
purposeLocationId: undefined,
categoryType: undefined,
supplierId: undefined,
occurrenceTimeSTime:undefined,
occurrenceTimeETime:undefined,
categoryType: undefined,
supplierId: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
},
rules: {},
});
@@ -366,24 +338,28 @@ const { queryParams, form, rules } = toRefs(data);
function getPharmacyCabinetLists() {
getPharmacyCabinetList().then((response) => {
locationIdList.value = response.data
locationIdList.value = response.data;
});
getInboundInit().then((response) => {
supplierListOptions.value = response.data.supplierListOptions
})
supplierListOptions.value = response.data.supplierListOptions;
});
}
/** 导出按钮操作 */
function handleExport() {
proxy.$download.downloadGet("report-manage/inbound/excel-out", {
...queryParams.value
}, `dict_${new Date().getTime()}.xlsx`);
proxy.$download.downloadGet(
'report-manage/inbound/excel-out',
{
...queryParams.value,
},
`dict_${new Date().getTime()}.xlsx`
);
}
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getReportInboundPCage(queryParams.value).then((res) => {
loading.value = false;
purchaseinventoryList.value = res.data.records
purchaseinventoryList.value = res.data.records;
total.value = res.data.total;
});
}
@@ -393,7 +369,11 @@ watch(
() => route.query,
(newQuery) => {
// 如果路由中包含指定参数,则使用这些参数进行查询
if (newQuery.purposeLocationId || newQuery.occurrenceTimeSTime || newQuery.occurrenceTimeETime) {
if (
newQuery.purposeLocationId ||
newQuery.occurrenceTimeSTime ||
newQuery.occurrenceTimeETime
) {
// 设置查询参数
if (newQuery.purposeLocationId) {
queryParams.value.purposeLocationId = newQuery.purposeLocationId;
@@ -404,7 +384,7 @@ watch(
if (newQuery.occurrenceTimeETime) {
queryParams.value.occurrenceTimeETime = newQuery.occurrenceTimeETime + ' 23:59:59';
}
// 执行查询
getList();
}
@@ -415,13 +395,9 @@ watch(
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.occurrenceTimeSTime =
approvalTime.value && approvalTime.value.length == 2
? approvalTime.value[0] + " 00:00:00"
: "";
approvalTime.value && approvalTime.value.length == 2 ? approvalTime.value[0] + ' 00:00:00' : '';
queryParams.value.occurrenceTimeETime =
approvalTime.value && approvalTime.value.length == 2
? approvalTime.value[1] + " 23:59:59"
: "";
approvalTime.value && approvalTime.value.length == 2 ? approvalTime.value[1] + ' 23:59:59' : '';
queryParams.value.pageNo = 1;
getList();
}
@@ -429,10 +405,10 @@ function handleQuery() {
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.occurrenceTimeSTime = ""
queryParams.value.occurrenceTimeETime = ""
approvalTime.value = ""
proxy.resetForm("queryRef");
queryParams.value.occurrenceTimeSTime = '';
queryParams.value.occurrenceTimeETime = '';
approvalTime.value = '';
proxy.resetForm('queryRef');
getList();
}
@@ -444,7 +420,7 @@ function handleSelectionChange(selection) {
}
getList();
getPharmacyCabinetLists()
getPharmacyCabinetLists();
</script>
<style scoped>
.custom-tree-node {
@@ -457,4 +433,4 @@ getPharmacyCabinetLists()
font-size: large;
margin-bottom: 10px;
}
</style>
</style>

View File

@@ -11,6 +11,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 300px"
@change="handleQuery"
></el-date-picker>
</el-form-item>
<el-form-item label="清算类型:" prop="clrType">
@@ -33,7 +34,7 @@
v-model="queryParams.insuType"
placeholder="请选择险种类型"
clearable
style="width: 150px"
style="width: 200px"
>
<el-option
v-for="insuType in insutype"
@@ -58,24 +59,9 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="医院" prop="orgId">
<el-input
v-model="queryParams.orgId"
placeholder="请输入医院id"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item> -->
</el-form>
<!-- <el-col :span="1.5"> -->
<!-- v-hasPermi="['system:user:import']" -->
<!-- <el-button type="primary" plain icon="Edit" @click="getList">查询</el-button> -->
<el-button type="primary" plain icon="Edit" @click="handleQuery">结算</el-button>
<!-- </el-col> -->
<!-- <el-col :span="1.5"> -->
<!-- v-hasPermi="['system:user:export']" -->
<el-button
<el-button type="primary" plain icon="Edit" @click="handleQuery">获取医保交易数据</el-button>
<!-- <el-button
type="primary"
plain
icon="Edit"
@@ -83,34 +69,20 @@
:disabled="ids.length == 0"
>
医保对总账
</el-button>
<el-button
type="primary"
plain
icon="Edit"
@click="handleGetClroptins"
>
</el-button> -->
<!-- <el-button type="primary" plain icon="Edit" @click="handleGetClroptins">
清算机构查询
</el-button>
</el-button> -->
<!-- </el-col> -->
</el-row>
<!-- <div style="margin-bottom: 5px">
定点医药机构结算笔数{{ counts }}其中 医疗费总额{{ totalPrice1 }}基金支付总额{{
totalPrice2
}}个人账户支付金额{{ totalPrice3 }}现金支付金额{{ totalPrice4 }}认可费用总额{{
totalPrice5
}}
</div> -->
<el-table
v-loading="loading"
:data="purchaseinventoryList"
border
@select="clickRow"
ref="refTables"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column label="清算类别" align="center" prop="contractNo_dictText" />
<el-table-column label="险种" align="center" prop="insutype_dictText" />
<el-table-column label="是否异地" align="center" key="locationName" prop="locationName" />
@@ -144,6 +116,11 @@
{{ scope.row.fixMedInsSetlCnt + ' 笔' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button type="primary" link @click="handleReconciliation(scope.row)">对账</el-button>
</template>
</el-table-column>
</el-table>
<!-- <pagination
v-show="total > 0"
@@ -154,26 +131,38 @@
/> -->
<el-form :inline="true" label-width="90px" style="width: 100%; margin-top: 30px">
<el-form-item label="对账结果:" style="width: 100%">
<el-input
v-model="reconciliation"
:autosize="{ minRows: 4, maxRows: 10 }"
type="textarea"
disabled
placeholder=""
/>
<div
style="
background: #f5f7fa;
border: solid 1px;
border-color: #e4e7ed;
width: 50%;
height: 100px;
"
>
<span>{{ reconciliation }}</span>
<el-button
v-if="reconciliation && reconciliation != 'OK'"
type="primary"
link
@click="toReconcileRecord"
>
手动对账
</el-button>
</div>
</el-form-item>
</el-form>
</div>
</template>
<script setup name="reconciliation">
<script setup name="Reconciliation">
import {
ybRequestReconcile, // 医保对账
getReconcileList, // 对账列表 结算
getContractList, // 合同
getClroptins,
} from './statisticalManagent';
import { formatDate } from '@/utils/index';
import { formatDate, formatDateStr } from '@/utils/index';
const { proxy } = getCurrentInstance();
const { insutype } = proxy.useDict('insutype');
// 险种类型
@@ -183,10 +172,15 @@ const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const occurrenceTime = ref([formatDate(new Date()), formatDate(new Date())]);
const occurrenceTime = ref([
formatDateStr(new Date(), 'YYYY-MM-DD'),
formatDateStr(new Date(), 'YYYY-MM-DD'),
]);
const contractNoOptions = ref([]);
const clrTypeOptions = ref([]);
('');
const selectedRow = ref(null);
const currentRow = ref({});
const reconciliation = ref('');
const counts = ref(0);
const totalPrice1 = ref(0);
@@ -202,7 +196,7 @@ const data = reactive({
// pageSize: 10,
// searchKey: undefined,
insuType: undefined, // 险种
clrType: undefined, //住院或门诊
clrType: 11, //住院或门诊
contractNo: undefined,
orgId: undefined,
stmtBegnDate: undefined,
@@ -267,18 +261,20 @@ function handleQuery() {
? occurrenceTime.value[1] + ' 23:59:59'
: '';
// queryParams.value.pageNo = 1;
reconciliation.value = '';
getList();
}
/** 按钮操作 */
function handleReconciliation() {
function handleReconciliation(row) {
// 调用接口返回值
// loading.value = true;
currentRow.value = row;
reconciliation.value = '';
let queryParams = {
insuType: selectedRow.value.insutype.toString(),
clrType: selectedRow.value.clrType,
contractNo: selectedRow.value.contractNo.toString(),
insuType: row.insutype.toString(),
clrType: row.clrType,
contractNo: row.contractNo.toString(),
stmtBegnDate:
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[0] + ' 00:00:00'
@@ -302,6 +298,17 @@ function handleSelectionChange(selection) {
multiple.value = !selection.length;
}
function toReconcileRecord() {
// 跳转到清算记录页面,并携带当前选中行的数据
proxy.$router.push({
name: 'LiquidationRecords',
query: {
currentRow: JSON.stringify(currentRow.value),
occurrenceTime: occurrenceTime.value,
},
});
}
function handleGetClroptins() {
getClroptins({ pageNum: 1, pageSize: 100, fixmedinsCode: 'H22010200672' }).then((res) => {});
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" loading-text="审批中...">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button
@@ -819,6 +819,7 @@ const visible = ref(false);
const row = ref({});
const rowIndex = ref(-1);
const totalAmount = ref(0);
const pageLoading = ref(false)
const form = reactive({
purchaseinventoryList: [],
@@ -1070,7 +1071,9 @@ function handleClickOutside(event) {
}
function handelApply() {
pageLoading.value = true;
productTransferApproved(route.query.supplyBusNo).then((res) => {
pageLoading.value = false
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
store.clearCurrentDataPLDB();
@@ -1078,6 +1081,8 @@ function handelApply() {
// 跳转到审核页面
router.replace({ path: '/aaaa/medicationmanagement/billapproval',query:{type:'batchTransfer'}});
}
}).catch(() => {
pageLoading.value = false
})
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageLoading" loading-text="审批中...">
<el-row :gutter="10" class="mb8" v-if="viewStatus">
<el-col :span="1.5">
<el-button
@@ -817,6 +817,7 @@ const tableRef = ref(undefined); // 表格引用
const currentRow = ref(undefined); // 当前操作的行
const medicineSearchKey = ref("");
const itemType = ref("");
const pageLoading = ref(false)
const forms = reactive({
purchaseinventoryList: [],
})
@@ -1211,8 +1212,10 @@ function handleClickOutside(event) {
}
function handelApply() {
pageLoading.value = true
productTransferApproved(route.query.supplyBusNo).then((res) => {
if (res.code == 200) {
pageLoading.value = false
proxy.$modal.msgSuccess("操作成功");
tagsViewStore.delView(router.currentRoute.value);
store.clearCurrentDataDB();
@@ -1222,7 +1225,9 @@ function handelApply() {
// toLastView(visitedViews, route)
// })
}
})
}).catch(() => {
pageLoading.value = false
});
}
// 驳回
@@ -1314,6 +1319,8 @@ function handleLocationClick(id,purposeLocationId,itemId, index) {
form.purchaseinventoryList[index].itemTable = res.data[0].itemTable || ""
form.purchaseinventoryList[index].totalPurposeQuantity = res.data[0].objQuantity || 0;
form.purchaseinventoryList[index].totalSourceQuantity = res.data[0].orgQuantity || 0;
// 临时存一下价格 处理切换单位时候丢精度的问题
form.purchaseinventoryList[index].tempPrice = res.data[0].price;
form.purchaseinventoryList[index].traceNo = res.data[0].traceNo || "";
form.purchaseinventoryList[index].supplierId = res.data[0].supplierId || "";
@@ -1505,8 +1512,7 @@ function getMaxCounts(row,index,counts){
(decimalPart*row.partPercent).toFixed(0) + form.purchaseinventoryList[index].minUnitCode_dictText
}
}else{
form.purchaseinventoryList[index].price =
form.purchaseinventoryList[index].price * row.partPercent;
form.purchaseinventoryList[index].price = row.tempPrice
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
}
}

View File

@@ -6,6 +6,8 @@
"paperType": "A5",
"height": 210,
"width": 148,
"paperHeader": 6,
"paperFooter": 592.4409448818898,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"overPrintOptions": {
@@ -28,8 +30,6 @@
"layoutRowGap": 0,
"layoutColumnGap": 0
},
"paperHeader": 6,
"paperFooter": 595.2755905511812,
"printElements": [
{
"options": {
@@ -519,24 +519,6 @@
"type": "text"
}
},
{
"options": {
"left": 126,
"top": 520.5,
"height": 12,
"width": 79.5,
"title": "发药",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"fontSize": 9,
"field": "dispenseDoctorName"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 228,
@@ -560,12 +542,28 @@
"top": 520.5,
"height": 12,
"width": 79.5,
"title": "调配",
"title": "调配:高艳敏",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"fontSize": 9,
"field": "preparerDoctorName"
"fontSize": 9
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 124.5,
"top": 522,
"height": 12,
"width": 79.5,
"title": "发药:宋丹丹",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"fontSize": 9
},
"printElementType": {
"title": "文本",

View File

@@ -231,7 +231,7 @@
<!-- <el-table-column prop="quantity" label="发药数量" width="100" align="center" /> -->
<el-table-column prop="totalVolume" label="规格" width="100" align="center" />
<!-- <el-table-column prop="unitCode_dictText" label="单位" width="100" align="center" /> -->
<el-table-column
<!-- <el-table-column
prop="doseUnitCode_dictText"
label="单次剂量"
width="80"
@@ -241,7 +241,7 @@
<template #default="scope">
{{ scope.row.dose }}{{ scope.row.doseUnitCode_dictText }}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column
prop="traceNo"
label="追溯码"
@@ -274,6 +274,7 @@
header-align="center"
/>
<el-table-column prop="locationName" label="发药药房" width="90" align="center" />
<el-table-column prop="manufacturerText" label="生产厂家" width="200" align="center" />
<el-table-column prop="doctorName" label="开单医生" width="100" align="center" />
<el-table-column prop="conditionName" label="诊断" width="120" align="center" />
<!-- <el-table-column prop="dose" label="剂量" width="100" align="center" /> -->
@@ -354,6 +355,28 @@
@cancel="openTraceNoDialog = false"
/>
</div>
<el-dialog title="选择打印机" v-model="showPrinterDialog" width="400px" append-to-body>
<el-form>
<el-form-item label="请选择打印机:">
<el-select v-model="selectedPrinter" placeholder="请选择打印机" style="width: 100%">
<el-option
v-for="printer in printerList"
:key="printer.name"
:label="printer.name"
:value="printer.name"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancelPrinter"> </el-button>
<el-button type="primary" @click="confirmPrinter"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script setup name="westernmedicine">
@@ -377,6 +400,14 @@ import { debounce } from 'lodash-es';
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
import { hiprint } from 'vue-plugin-hiprint';
import templateJson from './components/templateJson.json';
// import disposalTemplate from './components/disposalTemplate.json';
import {
getPrinterList,
getCachedPrinter,
savePrinterToCache,
selectPrinterAndPrint,
executePrint,
} from '@/utils/his';
const showSearch = ref(true);
const total = ref(0);
@@ -408,7 +439,7 @@ const groups = ref({});
const openTraceNoDialog = ref(false);
const ypName = ref('');
const medicineTotalPrice = ref(0);
const projectTypeCode = ref('1');
const projectTypeCode = ref('2');
const selectedRow = ref(null);
const { proxy } = getCurrentInstance();
@@ -500,127 +531,215 @@ function getList() {
});
}
//打印中西药处方
// async function printPrescription() {
// const selectedRows = tableRef.value.getSelectionRows();
// if (selectedRows.length === 0) {
// proxy.$modal.msgWarning('未选择要打印的项目,请重新选择,打印失败');
// return;
// }
// let requestIds = selectedRows.map((item) => item.requestId).join(',');
// const result = [];
// advicePrint({ requestIds: requestIds, isPrescription: '1' }).then((res) => {
// const groupedRows = {};
// res.data.adviceItemList.forEach((row) => {
// const prescriptionNo = row.prescriptionNo;
// if (!groupedRows[prescriptionNo]) {
// groupedRows[prescriptionNo] = [];
// }
// row.contractName = res.data.contractName;
// groupedRows[prescriptionNo].push(row);
// });
// console.log('按处方号分组的结果:', groupedRows);
// // 如果您需要将分组后的数据转换为数组形式
// const groupedArray = Object.values(groupedRows);
// console.log('分组后的数组形式:', groupedArray);
// groupedArray.forEach((item, index) => {
// const total = item.reduce((sum, item) => {
// return sum + (item.totalPrice || 0);
// }, 0);
// result.push({
// ...res.data,
// medTotalAmount: total,
// prescriptionList: item,
// });
// });
// console.log(result, 'result');
// const printElements = templateJson;
// var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
// hiprintTemplate.print2(result, {
// title: '打印标题',
// height: 210,
// width: 148,
// }); //开始打印
// // 直接打印回调
// // 发送任务到打印机成功
// hiprintTemplate.on('printSuccess', function (e) {
// console.log('打印成功');
// });
// // 发送任务到打印机失败
// hiprintTemplate.on('printError', function (e) {
// console.log('打印失败');
// });
// });
// // 计算总价
// // const result = {
// // data: selectedRows.map((item) => ({
// // ...item,
// // patientName: personInfo.value.patientName,
// // genderEnum_enumText: personInfo.value.genderEnum_enumText,
// // age: personInfo.value.age,
// // phone: personInfo.value.phone,
// // hospitalName: personInfo.value.hospitalName,
// // patientBusNo: personInfo.value.patientBusNo,
// // quantity: item.quantity,
// // unitCode_dictText: item.unitCode_dictText,
// // organizationName: personInfo.value.organizationName,
// // })),
// // };
// // 按 prescriptionNo 分组
// // const groupedRows = {};
// // selectedRows.forEach(row => {
// // const prescriptionNo = row.prescriptionNo;
// // if (!groupedRows[prescriptionNo]) {
// // groupedRows[prescriptionNo] = [];
// // }
// // row.contractName = personInfo.value.contractName;
// // groupedRows[prescriptionNo].push(row);
// // });
// // console.log('按处方号分组的结果:', groupedRows);
// // // 如果您需要将分组后的数据转换为数组形式
// // const groupedArray = Object.values(groupedRows);
// // console.log('分组后的数组形式:', groupedArray);
// // const result = [];
// // groupedArray.forEach((item, index) => {
// // const total = item.reduce((sum, item) => {
// // return sum + (item.totalPrice || 0);
// // }, 0);
// // result.push({
// // ...personInfo.value,
// // medTotalAmount: total,
// // doctor: item[0].doctorName,
// // prescriptionNo: item[0].prescriptionNo,
// // reqAuthoredTime: item[0].reqAuthoredTime,
// // prescriptionList: item,
// // })
// // })
// // 将对象转换为 JSON 字符串
// // let jsonString = JSON.stringify(result, null, 2);
// // 模板对象获取
// // await CefSharp.BindObjectAsync('boundAsync');
// // await boundAsync
// // .printReport('西药(中成药)处方笺.grf', jsonString)
// // .then((response) => {
// // //返回结果是jsonString可判断其调用是否成功
// // console.log(response, 'response');
// // var res = JSON.parse(response);
// // if (!res.IsSuccess) {
// // proxy.$modal.msgError('调用打印插件失败:' + res.ErrorMessage);
// // }
// // })
// // .catch((error) => {
// // proxy.$modal.msgError('调用打印插件失败:' + error);
// // });
// }
// 新增打印机相关变量
const printerList = ref([]); // 打印机列表
const selectedPrinter = ref(''); // 选中的打印机
const showPrinterDialog = ref(false); // 显示打印机选择对话框
// 修改printPrescription方法强制显示打印机选择弹窗
async function printPrescription() {
const selectedRows = tableRef.value.getSelectionRows();
if (selectedRows.length === 0) {
proxy.$modal.msgWarning('未选择要打印的项目,请重新选择,打印失败');
return;
}
let requestIds = selectedRows.map((item) => item.requestId).join(',');
const result = [];
advicePrint({ requestIds: requestIds, isPrescription: '1' }).then((res) => {
const groupedRows = {};
res.data.adviceItemList.forEach((row) => {
const prescriptionNo = row.prescriptionNo;
if (!groupedRows[prescriptionNo]) {
groupedRows[prescriptionNo] = [];
}
row.contractName = res.data.contractName;
groupedRows[prescriptionNo].push(row);
});
console.log('按处方号分组的结果:', groupedRows);
try {
// 获取打印数据
let requestIds = selectedRows.map((item) => item.requestId).join(',');
// 如果您需要将分组后的数据转换为数组形式
const groupedArray = Object.values(groupedRows);
console.log('分组后的数组形式:', groupedArray);
groupedArray.forEach((item, index) => {
const total = item.reduce((sum, item) => {
return sum + (item.totalPrice || 0);
}, 0);
result.push({
...res.data,
medTotalAmount: total,
prescriptionList: item,
advicePrint({ requestIds: requestIds, isPrescription: '1' }).then((res) => {
const groupedRows = {};
res.data.adviceItemList.forEach((row) => {
const prescriptionNo = row.prescriptionNo;
if (!groupedRows[prescriptionNo]) {
groupedRows[prescriptionNo] = [];
}
row.contractName = res.data.contractName;
groupedRows[prescriptionNo].push(row);
});
const groupedArray = Object.values(groupedRows);
const result = [];
groupedArray.forEach((item) => {
const total = item.reduce((sum, item) => {
return sum + (item.totalPrice || 0);
}, 0);
result.push({
...res.data,
medTotalAmount: total,
prescriptionList: item,
});
});
// 获取打印机列表
const printers = getPrinterList();
if (printers.length === 0) {
proxy.$modal.msgWarning('未检测到可用打印机');
return;
}
// 强制显示打印机选择对话框,无论是否有缓存
// 设置打印机列表
printerList.value = printers;
// 显示对话框
showPrinterDialog.value = true;
// 保存当前打印数据到临时变量
window.currentPrintData = result;
});
console.log(result, 'result');
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result, {
title: '打印标题',
height: 210,
width: 148,
}); //开始打印
// 直接打印回调
// 发送任务到打印机成功
hiprintTemplate.on('printSuccess', function (e) {
console.log('打印成功');
});
// 发送任务到打印机失败
hiprintTemplate.on('printError', function (e) {
console.log('打印失败');
});
});
// 计算总价
// const result = {
// data: selectedRows.map((item) => ({
// ...item,
// patientName: personInfo.value.patientName,
// genderEnum_enumText: personInfo.value.genderEnum_enumText,
// age: personInfo.value.age,
// phone: personInfo.value.phone,
// hospitalName: personInfo.value.hospitalName,
// patientBusNo: personInfo.value.patientBusNo,
// quantity: item.quantity,
// unitCode_dictText: item.unitCode_dictText,
// organizationName: personInfo.value.organizationName,
// })),
// };
// 按 prescriptionNo 分组
// const groupedRows = {};
// selectedRows.forEach(row => {
// const prescriptionNo = row.prescriptionNo;
// if (!groupedRows[prescriptionNo]) {
// groupedRows[prescriptionNo] = [];
// }
// row.contractName = personInfo.value.contractName;
// groupedRows[prescriptionNo].push(row);
// });
// console.log('按处方号分组的结果:', groupedRows);
// // 如果您需要将分组后的数据转换为数组形式
// const groupedArray = Object.values(groupedRows);
// console.log('分组后的数组形式:', groupedArray);
// const result = [];
// groupedArray.forEach((item, index) => {
// const total = item.reduce((sum, item) => {
// return sum + (item.totalPrice || 0);
// }, 0);
// result.push({
// ...personInfo.value,
// medTotalAmount: total,
// doctor: item[0].doctorName,
// prescriptionNo: item[0].prescriptionNo,
// reqAuthoredTime: item[0].reqAuthoredTime,
// prescriptionList: item,
// })
// })
// 将对象转换为 JSON 字符串
// let jsonString = JSON.stringify(result, null, 2);
// 模板对象获取
// await CefSharp.BindObjectAsync('boundAsync');
// await boundAsync
// .printReport('西药(中成药)处方笺.grf', jsonString)
// .then((response) => {
// //返回结果是jsonString可判断其调用是否成功
// console.log(response, 'response');
// var res = JSON.parse(response);
// if (!res.IsSuccess) {
// proxy.$modal.msgError('调用打印插件失败:' + res.ErrorMessage);
// }
// })
// .catch((error) => {
// proxy.$modal.msgError('调用打印插件失败:' + error);
// });
} catch (error) {
console.error('打印过程出错:', error);
proxy.$modal.msgError('打印失败: ' + error.message);
}
}
// 使用保存的打印数据执行打印
function confirmPrinter() {
if (!selectedPrinter.value) {
proxy.$modal.msgWarning('请选择打印机');
return;
}
// 使用his.js中的savePrinterToCache保存选择
savePrinterToCache(selectedPrinter.value);
// 使用his.js中的executePrint方法执行打印
if (window.currentPrintData) {
executePrint(window.currentPrintData, templateJson, selectedPrinter.value)
.then(() => {
showPrinterDialog.value = false;
// 清除临时数据
window.currentPrintData = null;
})
.catch((error) => {
proxy.$modal.msgError(error.message || '打印失败');
showPrinterDialog.value = false;
window.currentPrintData = null;
});
}
}
/** 重置按钮操作 */
function resetQuery() {
setDefaultDateRange();
@@ -791,7 +910,7 @@ function getMedicineList(encounterId) {
proxy.$modal.msgError('获取数据失败');
});
} else if (projectTypeCode.value == 2) {
// 只调用listWesternmedicine接口
// 只调用listWesternmedicine接口
listWesternmedicine({
pageNo: 1,
pageSize: 100,

View File

@@ -1,182 +1,225 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="字典名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入字典名称"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input
v-model="queryParams.dictType"
placeholder="请输入字典类型"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="字典状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" style="width: 308px">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="字典名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入字典名称"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input
v-model="queryParams.dictType"
placeholder="请输入字典类型"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="字典状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" style="width: 308px">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Refresh"
@click="handleRefreshCache"
v-hasPermi="['system:dict:remove']"
>刷新缓存</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="dictId" />
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/>
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
<template #default="scope">
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<span>{{ scope.row.dictType }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Refresh"
@click="handleRefreshCache"
v-hasPermi="['system:dict:remove']"
>刷新缓存</el-button
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="typeList"
height="calc(100vh - 300px)"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="dictId" />
<el-table-column
label="字典名称"
align="center"
prop="dictName"
:show-overflow-tooltip="true"
/>
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
<template #default="scope">
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<span>{{ scope.row.dictType }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="160"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button
>
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{
dict.label
}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Dict">
import useDictStore from '@/store/modules/dict'
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import useDictStore from '@/store/modules/dict';
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type';
const { proxy } = getCurrentInstance();
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
const { sys_normal_disable } = proxy.useDict('sys_normal_disable');
const typeList = ref([]);
const open = ref(false);
@@ -186,7 +229,7 @@ const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const title = ref('');
const dateRange = ref([]);
const data = reactive({
@@ -196,11 +239,11 @@ const data = reactive({
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
status: undefined,
},
rules: {
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }],
},
});
@@ -209,7 +252,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询字典类型列表 */
function getList() {
loading.value = true;
listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
listType(proxy.addDateRange(queryParams.value, dateRange.value)).then((response) => {
typeList.value = response.rows;
total.value = response.total;
loading.value = false;
@@ -226,10 +269,10 @@ function reset() {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
status: '0',
remark: undefined,
};
proxy.resetForm("dictRef");
proxy.resetForm('dictRef');
}
/** 搜索按钮操作 */
function handleQuery() {
@@ -239,18 +282,18 @@ function handleQuery() {
/** 重置按钮操作 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
proxy.resetForm('queryRef');
handleQuery();
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加字典类型";
title.value = '添加字典类型';
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.dictId);
ids.value = selection.map((item) => item.dictId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
@@ -258,25 +301,25 @@ function handleSelectionChange(selection) {
function handleUpdate(row) {
reset();
const dictId = row.dictId || ids.value;
getType(dictId).then(response => {
getType(dictId).then((response) => {
form.value = response.data;
open.value = true;
title.value = "修改字典类型";
title.value = '修改字典类型';
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["dictRef"].validate(valid => {
proxy.$refs['dictRef'].validate((valid) => {
if (valid) {
if (form.value.dictId != undefined) {
updateType(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
updateType(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功');
open.value = false;
getList();
});
} else {
addType(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
addType(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功');
open.value = false;
getList();
});
@@ -287,23 +330,31 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
const dictIds = row.dictId || ids.value;
proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
proxy.$modal
.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
.then(function () {
return delType(dictIds);
})
.then(() => {
getList();
proxy.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/dict/type/export", {
...queryParams.value
}, `dict_${new Date().getTime()}.xlsx`);
proxy.download(
'system/dict/type/export',
{
...queryParams.value,
},
`dict_${new Date().getTime()}.xlsx`
);
}
/** 刷新缓存按钮操作 */
function handleRefreshCache() {
refreshCache().then(() => {
proxy.$modal.msgSuccess("刷新成功");
proxy.$modal.msgSuccess('刷新成功');
useDictStore().cleanDict();
});
}

View File

@@ -40,7 +40,7 @@ export default defineConfig (({mode, command}) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
target: 'http://localhost:18080/openhis',
target: 'http://localhost:18080/openhis',
// target: 'http://192.168.31.30:18080/openhis', // zwh
// target: 'http://192.168.31.50:18080/openhis', // wh
// target: 'http://192.168.31.190:18080/openhis', // yangmo