Compare commits

...

2 Commits

Author SHA1 Message Date
叶锦涛
f7ad010b2a 修复bug 2025-11-20 09:05:06 +08:00
叶锦涛
1a7ff0a686 修复bug 2025-11-20 08:58:26 +08:00
2 changed files with 3 additions and 25 deletions

View File

@@ -497,7 +497,7 @@ function getDeptTree() {
/** 查询地点下拉树结构 */
function getLocationTree() {
locationTreeSelect({ formList: '11,16' }).then((response) => {
locationTreeSelect({ formList: '11,16,17' }).then((response) => {
console.log(response, 'response查询部门下拉树结构');
locationOptions.value = response.data.records;
});

View File

@@ -582,7 +582,6 @@ const {
antibiotic_type_code,
ddd_code,
dose_from_code,
rx_flag,
chrgitm_lv,
} = proxy.useDict(
'med_category_code',
@@ -597,7 +596,6 @@ const {
'antibiotic_type_code',
'ddd_code',
'dose_from_code',
'rx_flag',
'chrgitm_lv'
);
@@ -924,7 +922,6 @@ function reset() {
tradeName: '',
spec: '',
manufacturer: '',
rxFlag: '0', // 默认设置为非处方
dose: undefined,
rateCode: undefined,
approvalNumber: undefined,
@@ -1005,20 +1002,7 @@ function submitForm() {
form.value.selfFlag == true ? (form.value.selfFlag = 1) : (form.value.selfFlag = 0); //自制标志
form.value.status == true ? (form.value.status = 1) : (form.value.status = 0); //启用状态
// 强化处方标志rxFlag处理,确保其为字符串类型并支持"是"和"双跨"值
console.log('rxFlag before processing:', form.value.rxFlag);
// 确保rxFlag始终是字符串类型支持"0"(非处方)、"1"(处方)、"2"(双跨)
if (form.value.rxFlag === undefined || form.value.rxFlag === null || form.value.rxFlag === '') {
form.value.rxFlag = '0'; // 默认设置为非处方药品
} else {
// 确保rxFlag始终是字符串类型
form.value.rxFlag = String(form.value.rxFlag);
// 验证rxFlag值是否有效确保只接受'0'、'1'或'2'
if (!['0', '1', '2'].includes(form.value.rxFlag)) {
form.value.rxFlag = '0'; // 如果值无效,设置为默认值
}
}
console.log('rxFlag after processing:', form.value.rxFlag);
// rxFlag处理已在setFlag函数中完成
proxy.$refs['medicationRef'].validate((valid) => {
if (valid) {
@@ -1032,13 +1016,7 @@ function submitForm() {
form.value.dddCode = antibioticForm.value.dddCode;
}
// 最终确认rxFlag值确保提交时绝对不为空且为字符串类型
if (!form.value.rxFlag) {
form.value.rxFlag = '0';
} else {
form.value.rxFlag = String(form.value.rxFlag);
}
console.log('Final rxFlag before submit:', form.value.rxFlag, 'Type:', typeof form.value.rxFlag);
// 将表单数据发送给父组件
emits('submit', form.value);