去除变片编号生成器,修改地区选择器,修改报告卡的样式。
This commit is contained in:
@@ -127,12 +127,4 @@ public interface IDoctorStationDiagnosisAppService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<?> saveInfectiousDiseaseReport(InfectiousDiseaseReportDto infectiousDiseaseReportDto);
|
R<?> saveInfectiousDiseaseReport(InfectiousDiseaseReportDto infectiousDiseaseReportDto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取下一个传染病报告卡编号
|
|
||||||
*
|
|
||||||
* @param orgCode 医疗机构编码
|
|
||||||
* @return 卡片编号
|
|
||||||
*/
|
|
||||||
R<?> getNextCardNo(String orgCode);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -621,27 +621,4 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"传染病报告卡"}));
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"传染病报告卡"}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取下一个传染病报告卡编号
|
|
||||||
* 编号规则:医疗机构编码 + 年月日 + 4位流水号
|
|
||||||
* 示例:123456202603060001
|
|
||||||
*
|
|
||||||
* @param orgCode 医疗机构编码
|
|
||||||
* @return 卡片编号
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public R<?> getNextCardNo(String orgCode) {
|
|
||||||
// 参数校验
|
|
||||||
if (orgCode == null || orgCode.trim().isEmpty()) {
|
|
||||||
orgCode = "0000";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用 AssignSeqUtil 生成每日递增的流水号
|
|
||||||
// 前缀为医疗机构编码,每天从0001开始
|
|
||||||
String cardNo = assignSeqUtil.getSeqByDay(orgCode, 4);
|
|
||||||
|
|
||||||
log.debug("生成传染病报告卡编号: {}", cardNo);
|
|
||||||
return R.ok(cardNo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -217,15 +217,4 @@ public class DoctorStationDiagnosisController {
|
|||||||
return iDoctorStationDiagnosisAppService.saveInfectiousDiseaseReport(infectiousDiseaseReportDto);
|
return iDoctorStationDiagnosisAppService.saveInfectiousDiseaseReport(infectiousDiseaseReportDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取下一个传染病报告卡编号
|
|
||||||
*
|
|
||||||
* @param orgCode 医疗机构编码
|
|
||||||
* @return 卡片编号
|
|
||||||
*/
|
|
||||||
@GetMapping("/next-card-no")
|
|
||||||
public R<?> getNextCardNo(@RequestParam(value = "orgCode", required = false) String orgCode) {
|
|
||||||
return iDoctorStationDiagnosisAppService.getNextCardNo(orgCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1089,17 +1089,6 @@ export function checkInfectiousDisease(params) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取下一个传染病报告卡编号
|
|
||||||
*/
|
|
||||||
export function getNextCardNo(orgCode) {
|
|
||||||
return request({
|
|
||||||
url: '/doctor-station/diagnosis/next-card-no',
|
|
||||||
method: 'get',
|
|
||||||
params: { orgCode },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存传染病报告卡
|
* 保存传染病报告卡
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="form.cardNo"
|
v-model="form.cardNo"
|
||||||
class="card-number-input"
|
class="card-number-input"
|
||||||
placeholder="系统自动生成"
|
placeholder="单位自编,与网络直报一致"
|
||||||
disabled
|
maxlength="12"
|
||||||
/>
|
/>
|
||||||
</el-space>
|
</el-space>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" class="form-item">
|
<el-col :span="8" class="form-item">
|
||||||
<span :class="['form-label', isChildPatient ? 'required' : '']">家长姓名</span>
|
<span :class="['form-label', isChildPatient ? 'required' : '']">家长姓名</span>
|
||||||
<el-input v-model="form.parentName" class="underline-input" :placeholder="isChildPatient ? '14岁以下必填' : ''" />
|
<el-input v-model="form.parentName" class="underline-input" :placeholder="isChildPatient ? '≤14岁必填' : ''" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" class="form-item">
|
<el-col :span="8" class="form-item">
|
||||||
<span class="form-label required">身份证号</span>
|
<span class="form-label required">身份证号</span>
|
||||||
@@ -98,23 +98,29 @@
|
|||||||
<el-row :gutter="16" class="form-row">
|
<el-row :gutter="16" class="form-row">
|
||||||
<el-col :span="24" class="form-item full-width">
|
<el-col :span="24" class="form-item full-width">
|
||||||
<span class="form-label required">现住地址</span>
|
<span class="form-label required">现住地址</span>
|
||||||
<div class="address-inputs region-selects-wrapper">
|
<div class="address-selects">
|
||||||
<el-cascader
|
<el-select v-model="provinceCode" placeholder="省" clearable @change="handleProvinceChange">
|
||||||
v-model="addressCodes"
|
<el-option v-for="item in provinceOptions" :key="item.code" :label="item.name" :value="item.code" />
|
||||||
:options="addressOptions"
|
</el-select>
|
||||||
:props="addressCascaderProps"
|
<el-select v-model="cityCode" placeholder="市" clearable @change="handleCityChange">
|
||||||
placeholder="请选择省/市/区县/街道"
|
<el-option v-for="item in cityOptions" :key="item.code" :label="item.name" :value="item.code" />
|
||||||
clearable
|
</el-select>
|
||||||
@change="handleAddressChange"
|
<el-select v-model="countyCode" placeholder="区县" clearable @change="handleCountyChange">
|
||||||
/>
|
<el-option v-for="item in countyOptions" :key="item.code" :label="item.name" :value="item.code" />
|
||||||
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16" class="form-row">
|
<el-row :gutter="16" class="form-row">
|
||||||
<el-col :span="12" class="form-item">
|
<el-col :span="8" class="form-item">
|
||||||
|
<el-select v-model="townCode" placeholder="街道" clearable @change="handleTownChange" class="underline-select">
|
||||||
|
<el-option v-for="item in townOptions" :key="item.code" :label="item.name" :value="item.code" />
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" class="form-item">
|
||||||
<el-input v-model="form.addressVillage" class="underline-input" placeholder="村(居)" />
|
<el-input v-model="form.addressVillage" class="underline-input" placeholder="村(居)" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" class="form-item">
|
<el-col :span="8" class="form-item">
|
||||||
<el-input v-model="form.addressHouse" class="underline-input" placeholder="门牌号" />
|
<el-input v-model="form.addressHouse" class="underline-input" placeholder="门牌号" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -135,26 +141,27 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 职业 -->
|
<!-- 职业 -->
|
||||||
|
<!-- 职业、病例分类 -->
|
||||||
<el-row :gutter="16" class="form-row">
|
<el-row :gutter="16" class="form-row">
|
||||||
<el-col :span="24" class="form-item">
|
<el-col :span="8" class="form-item">
|
||||||
<span class="form-label required">职业</span>
|
<span class="form-label required">职业</span>
|
||||||
<el-select v-model="form.occupation" placeholder="请选择职业" class="full-select">
|
<el-select v-model="form.occupation" placeholder="请选择职业" class="full-select">
|
||||||
<el-option v-for="item in occupationList" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in occupationList" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="16" class="form-item">
|
||||||
|
|
||||||
<!-- 病例分类 -->
|
|
||||||
<el-row :gutter="16" class="form-row">
|
|
||||||
<el-col :span="24" class="form-item full-width">
|
|
||||||
<span class="form-label required">病例分类</span>
|
<span class="form-label required">病例分类</span>
|
||||||
<el-radio-group v-model="form.caseClass">
|
<div class="case-class-group">
|
||||||
<el-radio label="1">疑似病例</el-radio>
|
<div class="case-class-row">
|
||||||
<el-radio label="2">临床诊断病例</el-radio>
|
<el-radio v-model="form.caseClass" label="1">疑似病例</el-radio>
|
||||||
<el-radio label="3">确诊病例</el-radio>
|
<el-radio v-model="form.caseClass" label="2">临床诊断病例</el-radio>
|
||||||
<el-radio label="4">病原携带者</el-radio>
|
<el-radio v-model="form.caseClass" label="3">确诊病例</el-radio>
|
||||||
<el-radio label="5">阳性检测结果</el-radio>
|
</div>
|
||||||
</el-radio-group>
|
<div class="case-class-row">
|
||||||
|
<el-radio v-model="form.caseClass" label="4">病原携带者</el-radio>
|
||||||
|
<el-radio v-model="form.caseClass" label="5">阳性检测结果(采供血机构填写)</el-radio>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -327,7 +334,7 @@
|
|||||||
:model-value="form.selectedClassB === '0221'"
|
:model-value="form.selectedClassB === '0221'"
|
||||||
@update:model-value="(checked) => handleClassBCheckbox('0221', checked)"
|
@update:model-value="(checked) => handleClassBCheckbox('0221', checked)"
|
||||||
label="0221"
|
label="0221"
|
||||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD>病</el-checkbox>
|
>淋病</el-checkbox>
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:model-value="form.selectedClassB === '0222'"
|
:model-value="form.selectedClassB === '0222'"
|
||||||
@update:model-value="(checked) => handleClassBCheckbox('0222', checked)"
|
@update:model-value="(checked) => handleClassBCheckbox('0222', checked)"
|
||||||
@@ -348,6 +355,21 @@
|
|||||||
@update:model-value="(checked) => handleClassBCheckbox('0225', checked)"
|
@update:model-value="(checked) => handleClassBCheckbox('0225', checked)"
|
||||||
label="0225"
|
label="0225"
|
||||||
>疟疾</el-checkbox>
|
>疟疾</el-checkbox>
|
||||||
|
<el-checkbox
|
||||||
|
:model-value="form.selectedClassB === '0226'"
|
||||||
|
@update:model-value="(checked) => handleClassBCheckbox('0226', checked)"
|
||||||
|
label="0226"
|
||||||
|
>新型冠状病毒肺炎</el-checkbox>
|
||||||
|
<el-checkbox
|
||||||
|
:model-value="form.selectedClassB === '0227'"
|
||||||
|
@update:model-value="(checked) => handleClassBCheckbox('0227', checked)"
|
||||||
|
label="0227"
|
||||||
|
>甲型H1N1流感</el-checkbox>
|
||||||
|
<el-checkbox
|
||||||
|
:model-value="form.selectedClassB === '0228'"
|
||||||
|
@update:model-value="(checked) => handleClassBCheckbox('0228', checked)"
|
||||||
|
label="0228"
|
||||||
|
>人感染H7N9禽流感</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@@ -404,7 +426,8 @@
|
|||||||
:model-value="form.selectedClassC === '0310'"
|
:model-value="form.selectedClassC === '0310'"
|
||||||
@update:model-value="(checked) => handleClassCCheckbox('0310', checked)"
|
@update:model-value="(checked) => handleClassCCheckbox('0310', checked)"
|
||||||
label="0310"
|
label="0310"
|
||||||
>其它感染性腹泻病</el-checkbox>
|
class="wide-checkbox"
|
||||||
|
>除霍乱/菌痢/伤寒副伤寒以外的感染性腹泻病</el-checkbox>
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:model-value="form.selectedClassC === '0311'"
|
:model-value="form.selectedClassC === '0311'"
|
||||||
@update:model-value="(checked) => handleClassCCheckbox('0311', checked)"
|
@update:model-value="(checked) => handleClassCCheckbox('0311', checked)"
|
||||||
@@ -495,7 +518,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, getCurrentInstance, watch } from 'vue';
|
import { ref, computed, getCurrentInstance, watch } from 'vue';
|
||||||
import pcas from 'china-division/dist/pcas-code.json';
|
import pcas from 'china-division/dist/pcas-code.json';
|
||||||
import { saveInfectiousDiseaseReport, getNextCardNo } from '../api';
|
import { saveInfectiousDiseaseReport } from '../api';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { useDict } from '@/utils/dict';
|
import { useDict } from '@/utils/dict';
|
||||||
|
|
||||||
@@ -543,17 +566,151 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(['close', 'success']);
|
const emit = defineEmits(['close', 'success']);
|
||||||
|
|
||||||
|
|
||||||
// 地址级联选择器配置
|
// 地址选择器数据
|
||||||
const addressOptions = ref(pcas);
|
const addressData = ref(pcas);
|
||||||
const addressCodes = ref([]);
|
const provinceCode = ref('');
|
||||||
|
const cityCode = ref('');
|
||||||
|
const countyCode = ref('');
|
||||||
|
const townCode = ref('');
|
||||||
|
const provinceOptions = ref([]);
|
||||||
|
const cityOptions = ref([]);
|
||||||
|
const countyOptions = ref([]);
|
||||||
|
const townOptions = ref([]);
|
||||||
|
|
||||||
// 直辖市列表(这些城市的省级和市级相同)
|
// 直辖市列表(这些城市的省级和市级相同)
|
||||||
const municipalities = ['北京市', '天津市', '上海市', '重庆市'];
|
const municipalities = ['北京市', '天津市', '上海市', '重庆市'];
|
||||||
const addressCascaderProps = {
|
|
||||||
checkStrictly: true,
|
// 初始化省级选项
|
||||||
value: 'code',
|
function initProvinceOptions() {
|
||||||
label: 'name',
|
provinceOptions.value = addressData.value.map(item => ({
|
||||||
children: 'children'
|
code: item.code,
|
||||||
};
|
name: item.name
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 省级变化处理
|
||||||
|
function handleProvinceChange(code) {
|
||||||
|
cityCode.value = '';
|
||||||
|
countyCode.value = '';
|
||||||
|
townCode.value = '';
|
||||||
|
cityOptions.value = [];
|
||||||
|
countyOptions.value = [];
|
||||||
|
townOptions.value = [];
|
||||||
|
form.value.addressProv = '';
|
||||||
|
form.value.addressCity = '';
|
||||||
|
form.value.addressCounty = '';
|
||||||
|
form.value.addressTown = '';
|
||||||
|
|
||||||
|
if (code) {
|
||||||
|
const province = addressData.value.find(item => item.code === code);
|
||||||
|
if (province) {
|
||||||
|
form.value.addressProv = province.name;
|
||||||
|
// 直辖市特殊处理:市级选项与省级相同
|
||||||
|
if (municipalities.includes(province.name)) {
|
||||||
|
cityOptions.value = [{ code: province.code, name: province.name }];
|
||||||
|
cityCode.value = province.code;
|
||||||
|
form.value.addressCity = province.name;
|
||||||
|
// 直辖市的区县是省级的children
|
||||||
|
if (province.children && province.children.length > 0) {
|
||||||
|
countyOptions.value = province.children[0].children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cityOptions.value = province.children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 市级变化处理
|
||||||
|
function handleCityChange(code) {
|
||||||
|
countyCode.value = '';
|
||||||
|
townCode.value = '';
|
||||||
|
countyOptions.value = [];
|
||||||
|
townOptions.value = [];
|
||||||
|
form.value.addressCity = '';
|
||||||
|
form.value.addressCounty = '';
|
||||||
|
form.value.addressTown = '';
|
||||||
|
|
||||||
|
if (code) {
|
||||||
|
const province = addressData.value.find(item => item.code === provinceCode.value);
|
||||||
|
if (province) {
|
||||||
|
// 直辖市处理
|
||||||
|
if (municipalities.includes(province.name)) {
|
||||||
|
const county = province.children?.[0]?.children?.find(item => item.code === code);
|
||||||
|
if (county) {
|
||||||
|
form.value.addressCounty = county.name;
|
||||||
|
townOptions.value = county.children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const city = province.children?.find(item => item.code === code);
|
||||||
|
if (city) {
|
||||||
|
form.value.addressCity = city.name;
|
||||||
|
countyOptions.value = city.children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 区县变化处理
|
||||||
|
function handleCountyChange(code) {
|
||||||
|
townCode.value = '';
|
||||||
|
townOptions.value = [];
|
||||||
|
form.value.addressCounty = '';
|
||||||
|
form.value.addressTown = '';
|
||||||
|
|
||||||
|
if (code) {
|
||||||
|
const province = addressData.value.find(item => item.code === provinceCode.value);
|
||||||
|
if (province) {
|
||||||
|
if (municipalities.includes(province.name)) {
|
||||||
|
// 直辖市
|
||||||
|
const county = province.children?.[0]?.children?.find(item => item.code === code);
|
||||||
|
if (county) {
|
||||||
|
form.value.addressCounty = county.name;
|
||||||
|
townOptions.value = county.children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const city = province.children?.find(item => item.code === cityCode.value);
|
||||||
|
if (city) {
|
||||||
|
const county = city.children?.find(item => item.code === code);
|
||||||
|
if (county) {
|
||||||
|
form.value.addressCounty = county.name;
|
||||||
|
townOptions.value = county.children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 街道变化处理
|
||||||
|
function handleTownChange(code) {
|
||||||
|
form.value.addressTown = '';
|
||||||
|
if (code) {
|
||||||
|
const town = townOptions.value.find(item => item.code === code);
|
||||||
|
if (town) {
|
||||||
|
form.value.addressTown = town.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
cardNo: '',
|
cardNo: '',
|
||||||
@@ -601,65 +758,104 @@ const form = ref({
|
|||||||
diagnosisId: '',
|
diagnosisId: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 根据地址名称数组查找对应的代码数组(用于初始化地址选择器的回显)
|
// 根据地址名称初始化下拉选择器(用于回显)
|
||||||
function findCodesByNames(names) {
|
function initAddressByName(provName, cityName, countyName, townName) {
|
||||||
const codes = [];
|
if (!provName) return;
|
||||||
let currentNodes = addressOptions.value;
|
|
||||||
|
|
||||||
for (const name of names) {
|
// 初始化省级选项
|
||||||
if (!name) break;
|
initProvinceOptions();
|
||||||
const node = currentNodes?.find(n => n.name === name);
|
|
||||||
if (node) {
|
|
||||||
codes.push(node.code);
|
|
||||||
currentNodes = node.children;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return codes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 地址级联选择器变化处理
|
// 查找省份
|
||||||
function handleAddressChange(values) {
|
const province = addressData.value.find(item => item.name === provName);
|
||||||
if (!values || values.length === 0) {
|
if (!province) return;
|
||||||
form.value.addressProv = '';
|
|
||||||
form.value.addressCity = '';
|
|
||||||
form.value.addressCounty = '';
|
|
||||||
form.value.addressTown = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据选中的代码获取对应的名称
|
provinceCode.value = province.code;
|
||||||
const names = [];
|
form.value.addressProv = province.name;
|
||||||
let currentNodes = addressOptions.value;
|
|
||||||
|
|
||||||
for (const code of values) {
|
// 直辖市处理
|
||||||
const node = currentNodes?.find(n => n.code === code);
|
|
||||||
if (node) {
|
|
||||||
names.push(node.name);
|
|
||||||
currentNodes = node.children;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理直辖市情况:如果是直辖市,市级和省级相同
|
|
||||||
const provName = names[0] || '';
|
|
||||||
let cityName = names[1] || '';
|
|
||||||
const countyName = names[2] || '';
|
|
||||||
const townName = names[3] || '';
|
|
||||||
|
|
||||||
// 如果是直辖市,市级应该与省级相同
|
|
||||||
if (municipalities.includes(provName)) {
|
if (municipalities.includes(provName)) {
|
||||||
// 直辖市:省级=市级
|
cityOptions.value = [{ code: province.code, name: province.name }];
|
||||||
form.value.addressProv = provName;
|
cityCode.value = province.code;
|
||||||
form.value.addressCity = provName; // 直辖市的市级与省级相同
|
form.value.addressCity = province.name;
|
||||||
form.value.addressCounty = cityName; // 原来的市级变成区县
|
|
||||||
form.value.addressTown = countyName; // 原来的区县变成街道
|
// 直辖市的区县
|
||||||
|
if (province.children && province.children.length > 0) {
|
||||||
|
countyOptions.value = province.children[0].children?.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
})) || [];
|
||||||
|
|
||||||
|
if (countyName) {
|
||||||
|
const county = countyOptions.value.find(item => item.name === countyName);
|
||||||
|
if (county) {
|
||||||
|
countyCode.value = county.code;
|
||||||
|
form.value.addressCounty = county.name;
|
||||||
|
|
||||||
|
// 获取原始区县数据以查找街道
|
||||||
|
const countyData = province.children[0].children?.find(item => item.code === county.code);
|
||||||
|
if (countyData && countyData.children) {
|
||||||
|
townOptions.value = countyData.children.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (townName) {
|
||||||
|
const town = townOptions.value.find(item => item.name === townName);
|
||||||
|
if (town) {
|
||||||
|
townCode.value = town.code;
|
||||||
|
form.value.addressTown = town.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 非直辖市:正常处理
|
// 非直辖市处理
|
||||||
form.value.addressProv = provName;
|
cityOptions.value = province.children?.map(item => ({
|
||||||
form.value.addressCity = cityName;
|
code: item.code,
|
||||||
form.value.addressCounty = countyName;
|
name: item.name
|
||||||
form.value.addressTown = townName;
|
})) || [];
|
||||||
|
|
||||||
|
if (cityName) {
|
||||||
|
const city = cityOptions.value.find(item => item.name === cityName);
|
||||||
|
if (city) {
|
||||||
|
cityCode.value = city.code;
|
||||||
|
form.value.addressCity = city.name;
|
||||||
|
|
||||||
|
const cityData = province.children?.find(item => item.code === city.code);
|
||||||
|
if (cityData && cityData.children) {
|
||||||
|
countyOptions.value = cityData.children.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (countyName) {
|
||||||
|
const county = countyOptions.value.find(item => item.name === countyName);
|
||||||
|
if (county) {
|
||||||
|
countyCode.value = county.code;
|
||||||
|
form.value.addressCounty = county.name;
|
||||||
|
|
||||||
|
const countyData = cityData.children.find(item => item.code === county.code);
|
||||||
|
if (countyData && countyData.children) {
|
||||||
|
townOptions.value = countyData.children.map(item => ({
|
||||||
|
code: item.code,
|
||||||
|
name: item.name
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (townName) {
|
||||||
|
const town = townOptions.value.find(item => item.name === townName);
|
||||||
|
if (town) {
|
||||||
|
townCode.value = town.code;
|
||||||
|
form.value.addressTown = town.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -920,6 +1116,19 @@ function calculateAge() {
|
|||||||
*/
|
*/
|
||||||
function show(diagnosisData) {
|
function show(diagnosisData) {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
|
|
||||||
|
// 重置地址选择器状态
|
||||||
|
provinceCode.value = '';
|
||||||
|
cityCode.value = '';
|
||||||
|
countyCode.value = '';
|
||||||
|
townCode.value = '';
|
||||||
|
cityOptions.value = [];
|
||||||
|
countyOptions.value = [];
|
||||||
|
townOptions.value = [];
|
||||||
|
|
||||||
|
// 初始化省级地址选项
|
||||||
|
initProvinceOptions();
|
||||||
|
|
||||||
const patientInfo = props.patientInfo || {};
|
const patientInfo = props.patientInfo || {};
|
||||||
const birthInfo = parseBirthDate(patientInfo.birthDate || patientInfo.birthday);
|
const birthInfo = parseBirthDate(patientInfo.birthDate || patientInfo.birthday);
|
||||||
|
|
||||||
@@ -1019,37 +1228,16 @@ function show(diagnosisData) {
|
|||||||
updateSelectedDiseases();
|
updateSelectedDiseases();
|
||||||
|
|
||||||
// 设置地址选择组件初始值
|
// 设置地址选择组件初始值
|
||||||
// 根据地址名称查找对应的代码数组
|
|
||||||
const provName = diagnosisData?.addressProv || '';
|
const provName = diagnosisData?.addressProv || '';
|
||||||
let cityName = diagnosisData?.addressCity || '';
|
const cityName = diagnosisData?.addressCity || '';
|
||||||
const countyName = diagnosisData?.addressCounty || '';
|
const countyName = diagnosisData?.addressCounty || '';
|
||||||
const townName = diagnosisData?.addressTown || '';
|
const townName = diagnosisData?.addressTown || '';
|
||||||
|
|
||||||
// 处理直辖市情况:如果是直辖市,需要调整地址层级
|
initAddressByName(provName, cityName, countyName, townName);
|
||||||
let names = [];
|
|
||||||
if (municipalities.includes(provName)) {
|
|
||||||
// 直辖市:省级=市级,所以传给级联选择器的应该是 [省, 区县, 街道]
|
|
||||||
names = [provName, countyName, townName].filter(n => n);
|
|
||||||
} else {
|
|
||||||
// 非直辖市:正常处理 [省, 市, 区县, 街道]
|
|
||||||
names = [provName, cityName, countyName, townName].filter(n => n);
|
|
||||||
}
|
|
||||||
addressCodes.value = findCodesByNames(names);
|
|
||||||
|
|
||||||
if (birthInfo.year) {
|
if (birthInfo.year) {
|
||||||
calculateAge();
|
calculateAge();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从后端获取下一个卡片编号(含流水号)
|
|
||||||
getNextCardNo(orgCode).then(res => {
|
|
||||||
if (res.code === 200 && res.data) {
|
|
||||||
form.value.cardNo = res.data;
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
// 后端不可用时提示用户,不生成可能重复的编号
|
|
||||||
proxy.$modal.msgError('获取卡片编号失败,请稍后重试');
|
|
||||||
console.error('获取卡片编号失败:', err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1141,6 +1329,11 @@ async function buildSubmitData() {
|
|||||||
function validateFormManually() {
|
function validateFormManually() {
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|
||||||
|
// 卡片编号验证(可选,但如果填写了必须是12位)
|
||||||
|
if (form.value.cardNo && form.value.cardNo.length !== 12) {
|
||||||
|
errors.push('卡片编号必须为12位');
|
||||||
|
}
|
||||||
|
|
||||||
// 身份证号验证
|
// 身份证号验证
|
||||||
if (!form.value.idNo) {
|
if (!form.value.idNo) {
|
||||||
errors.push('请输入身份证号');
|
errors.push('请输入身份证号');
|
||||||
@@ -1356,6 +1549,26 @@ defineExpose({ show });
|
|||||||
|
|
||||||
.card-number-input {
|
.card-number-input {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
|
|
||||||
|
:deep(.el-input__wrapper) {
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
border-radius: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-input__inner) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-input__inner::placeholder) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 表单区域样式 */
|
/* 表单区域样式 */
|
||||||
@@ -1414,36 +1627,90 @@ defineExpose({ show });
|
|||||||
gap: 4px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 地址选择样式 */
|
/* 地址选择样式 - 四个下拉框并排 */
|
||||||
.address-inputs {
|
.address-selects {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 地址级联选择器样式 */
|
|
||||||
.region-selects-wrapper {
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.region-selects-wrapper :deep(.el-cascader) {
|
.address-selects .el-select {
|
||||||
width: 100%;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.region-selects-wrapper :deep(.el-cascader .el-input__wrapper) {
|
.address-selects :deep(.el-input__wrapper) {
|
||||||
|
border: none;
|
||||||
border-bottom: 1px solid #dcdfe6;
|
border-bottom: 1px solid #dcdfe6;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.region-selects-wrapper :deep(.el-cascader .el-input__wrapper:hover) {
|
.address-selects :deep(.el-input__wrapper:hover) {
|
||||||
border-bottom-color: #c0c4cc;
|
border-bottom-color: #c0c4cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.region-selects-wrapper :deep(.el-cascader .el-input__wrapper.is-focus) {
|
.address-selects :deep(.el-input__wrapper.is-focus) {
|
||||||
border-bottom-color: #409eff;
|
border-bottom-color: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.address-selects :deep(.el-input__inner) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address-selects :deep(.el-input__inner::placeholder) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 街道下拉框下划线样式 */
|
||||||
|
.underline-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-select :deep(.el-input__wrapper) {
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
border-radius: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-select :deep(.el-input__wrapper:hover) {
|
||||||
|
border-bottom-color: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-select :deep(.el-input__wrapper.is-focus) {
|
||||||
|
border-bottom-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-select :deep(.el-input__inner) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-select :deep(.el-input__inner::placeholder) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 病例分类两行排布 */
|
||||||
|
.case-class-group {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.case-class-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.case-class-row:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.full-select {
|
.full-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -1502,6 +1769,10 @@ defineExpose({ show });
|
|||||||
width: calc(25% - 8px);
|
width: calc(25% - 8px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disease-list.four-columns .el-checkbox.wide-checkbox {
|
||||||
|
width: calc(50% - 8px);
|
||||||
|
}
|
||||||
|
|
||||||
.disease-with-subtype {
|
.disease-with-subtype {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1533,6 +1804,9 @@ defineExpose({ show });
|
|||||||
.disease-with-subtype {
|
.disease-with-subtype {
|
||||||
width: calc(50% - 8px);
|
width: calc(50% - 8px);
|
||||||
}
|
}
|
||||||
|
.disease-list.four-columns .el-checkbox.wide-checkbox {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
|
|||||||
Reference in New Issue
Block a user