|
|
@@ -55,7 +55,6 @@ const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data })
|
|
|
: [];
|
|
|
};
|
|
|
branch.value = to(data);
|
|
|
- console.log(branch.value, '获取所有的机构');
|
|
|
});
|
|
|
const form = reactive<SystemItemModel>({
|
|
|
institutionName: '',
|
|
|
@@ -108,11 +107,7 @@ const deliverArr = ref<string[]>([]);
|
|
|
const rules = {
|
|
|
name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
|
|
conditioningProgramType: [{ required: true, message: '请选择方案类型', trigger: 'change' }],
|
|
|
- // 移除 pricingType 验证,使用动态验证
|
|
|
- // 移除 conditioningProgramSupplierId 验证,使用动态验证
|
|
|
institutionId: [{ required: true, message: '请选择机构名称', trigger: 'change' }],
|
|
|
- // 移除 isOffline 验证,使用动态验证
|
|
|
- // 移除 projectType 验证,使用自定义验证
|
|
|
};
|
|
|
const isShowOnline = ref<boolean>(false);
|
|
|
const isShowDelivery = ref<boolean>(false);
|
|
|
@@ -235,7 +230,7 @@ function doSubmit() {
|
|
|
form.isForWrap = checkedList.value.includes('1') ? 'Y' : null;
|
|
|
form.isForInfer = checkedList.value.includes('2') ? 'Y' : null;
|
|
|
// 服务包项目相关必填
|
|
|
- if (form.addType === 'itemsList' && checkedList.value.includes('1') || form.addType === 'system') {
|
|
|
+ if ((form.addType === 'itemsList' && checkedList.value.includes('1')) || form.addType === 'system') {
|
|
|
// 计价规则
|
|
|
if (!form.pricingType) {
|
|
|
message.error('请选择计价规则');
|
|
|
@@ -260,14 +255,14 @@ function doSubmit() {
|
|
|
}
|
|
|
}
|
|
|
// 供应商
|
|
|
- if(form.addType === 'itemsList' && checkedList.value.includes('1')){
|
|
|
+ if (form.addType === 'itemsList' && checkedList.value.includes('1')) {
|
|
|
if (!form.conditioningProgramSupplierId) {
|
|
|
message.error('请选择供应商');
|
|
|
return;
|
|
|
}
|
|
|
- }else if(form.addType === 'system'){
|
|
|
- form.isOffline = 'N';
|
|
|
- form.isDelivery = 'N';
|
|
|
+ } else if (form.addType === 'system') {
|
|
|
+ form.isOffline = 'N';
|
|
|
+ form.isDelivery = 'N';
|
|
|
}
|
|
|
// 线下项目
|
|
|
if (isShowOnline.value && !form.isOffline) {
|
|
|
@@ -315,16 +310,14 @@ function doSubmit() {
|
|
|
.then(() => {
|
|
|
form.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
|
|
|
form.itemImgFirst = optionsList.value[0]?.response?.url || optionsList.value[0]?.url || '';
|
|
|
- // form.itemVideoFirst = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
|
|
|
// 合并推导逻辑数据到表单数据中
|
|
|
if (hasDerivationLogic.value && derivationData.value.cpPatientMatchRule) {
|
|
|
form.cpPatientMatchRule = { ...derivationData.value.cpPatientMatchRule };
|
|
|
}
|
|
|
- // console.log('提交的最后数据', form);
|
|
|
submit(form);
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
- // console.error('Validation Error:', error);
|
|
|
+ console.error('Validation Error:', error);
|
|
|
message.error('请完善必填项');
|
|
|
});
|
|
|
}
|
|
|
@@ -344,7 +337,6 @@ async function getConditioningProgramType() {
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- // console.log(props.data, '获取传来的数据');
|
|
|
// getHerb('');
|
|
|
const deptId = localStorage.getItem('deptId');
|
|
|
if (props.data.addType === 'system' && deptId) {
|
|
|
@@ -356,7 +348,6 @@ onMounted(async () => {
|
|
|
form.addType = props.data.addType;
|
|
|
if (props.data.id || props.data.sourceId) {
|
|
|
const res: any = await getConditioningSchemeDetailMethod(props.data);
|
|
|
- // console.log(res, 'res==>');
|
|
|
const checked: string[] = [];
|
|
|
if (res.isForWrap === 'Y') checked.push('1');
|
|
|
if (res.isForInfer === 'Y') checked.push('2');
|
|
|
@@ -410,18 +401,14 @@ onMounted(async () => {
|
|
|
];
|
|
|
}
|
|
|
|
|
|
- // console.log(props.data, 'form==>');
|
|
|
if (props.data.addType === 'itemsList' && props.data.sourceId) {
|
|
|
form.sourceId = form.id;
|
|
|
form.institutionId = '';
|
|
|
delete form.id;
|
|
|
}
|
|
|
}
|
|
|
- // 获取供应商
|
|
|
- // getSupplier({});
|
|
|
// 获取方案类型
|
|
|
getConditioningProgramType();
|
|
|
- // console.log(form, 'form==>');
|
|
|
});
|
|
|
const emits = defineEmits<{
|
|
|
submit: [data?: SystemItemModel];
|
|
|
@@ -450,7 +437,6 @@ const handlePreview = async (file: UploadFile) => {
|
|
|
};
|
|
|
|
|
|
function customUpload(e: any) {
|
|
|
- // uploadApi 你的二次封装上传接口
|
|
|
UploadIFile(e.file)
|
|
|
.then((res) => {
|
|
|
// 调用实例的成功方法通知组件该文件上传成功
|
|
|
@@ -491,7 +477,6 @@ function beforeVideoUpload(file: File) {
|
|
|
function handleVideoPreview(file: UploadFile) {
|
|
|
const videoUrl = file.response?.url || file.url || form.itemVideoFirst;
|
|
|
if (videoUrl) {
|
|
|
- // 创建一个模态框来预览视频
|
|
|
VxeUI.modal.open({
|
|
|
title: '视频预览',
|
|
|
width: 800,
|
|
|
@@ -580,8 +565,6 @@ function customVideoRequest(e: any) {
|
|
|
onSuccess(res, e);
|
|
|
uploading.value = false;
|
|
|
message.success('视频上传成功');
|
|
|
-
|
|
|
- console.log('上传视频成功', form.itemVideoFirst);
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
clearInterval(progressInterval);
|
|
|
@@ -589,7 +572,6 @@ function customVideoRequest(e: any) {
|
|
|
progress.value = 0;
|
|
|
onError(err);
|
|
|
message.error('视频上传失败,请重试');
|
|
|
- console.error('视频上传失败:', err);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -642,7 +624,6 @@ function getConditioningProgramSupplier(value: any) {
|
|
|
form.isDelivery = null;
|
|
|
isShowDelivery.value = false;
|
|
|
}
|
|
|
-// 修正参数以适配 a-tree-select 的 @select 事件
|
|
|
function handleSelect(value: any, node: any) {
|
|
|
form.institutionId = value;
|
|
|
if (node && node.label) {
|
|
|
@@ -661,7 +642,7 @@ const plainOptions = [
|
|
|
// 推导逻辑
|
|
|
const hasDerivationLogic = ref(false); // 添加推导逻辑状态跟踪
|
|
|
const derivationData = ref<any>({});
|
|
|
-// 新增:判断推导逻辑内容是否为空
|
|
|
+// 判断推导逻辑内容是否为空
|
|
|
const isDerivationEmpty = computed(() => {
|
|
|
const rule = derivationData.value.cpPatientMatchRule;
|
|
|
if (!rule) return true;
|
|
|
@@ -693,7 +674,6 @@ function handleDerivation() {
|
|
|
checkedList: checkedList.value,
|
|
|
},
|
|
|
onSubmit: (data: any) => {
|
|
|
- console.log('推导逻辑传来的数据', data);
|
|
|
derivationData.value = data;
|
|
|
hasDerivationLogic.value = true; // 设置推导逻辑已编辑
|
|
|
},
|
|
|
@@ -1055,7 +1035,6 @@ function handleDerivation() {
|
|
|
}
|
|
|
.herb-dosage {
|
|
|
width: 70px;
|
|
|
- /* padding: 2px 6px; */
|
|
|
font-size: 14px;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
@@ -1080,7 +1059,6 @@ function handleDerivation() {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
gap: 16px;
|
|
|
- /* margin-top: 32px; */
|
|
|
}
|
|
|
.slider-section {
|
|
|
margin-bottom: 16px;
|
|
|
@@ -1139,19 +1117,15 @@ function handleDerivation() {
|
|
|
}
|
|
|
.video-preview {
|
|
|
border-radius: 6px;
|
|
|
- /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
|
|
|
background: #000;
|
|
|
width: 120px !important;
|
|
|
height: 100px !important;
|
|
|
- /* outline: none; */
|
|
|
}
|
|
|
.video-preview video {
|
|
|
border-radius: 6px;
|
|
|
- /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
|
|
|
background: #000;
|
|
|
width: 120px;
|
|
|
height: 100px;
|
|
|
- /* outline: none; */
|
|
|
}
|
|
|
.video-preview .ant-btn-link {
|
|
|
padding: 0;
|