Просмотр исходного кода

机构服务包。形象照显示问题

张田田 10 месяцев назад
Родитель
Сommit
2049bdd1e1
1 измененных файлов с 10 добавлено и 5 удалено
  1. 10 5
      src/service/EditSystemService.vue

+ 10 - 5
src/service/EditSystemService.vue

@@ -388,11 +388,11 @@ function calculateCount(row: any) {
     if (acCount > maxCount) {
     if (acCount > maxCount) {
       if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 0) {
       if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 0) {
         // 单价
         // 单价
-        if(acCount > 0){
+        if (acCount > 0) {
           let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price * acCount;
           let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price * acCount;
           row.unitPrice = unitPrice;
           row.unitPrice = unitPrice;
           row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
           row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
-        }else{
+        } else {
           row.unitPrice = '-';
           row.unitPrice = '-';
           row.totalPrice = 0;
           row.totalPrice = 0;
         }
         }
@@ -405,11 +405,11 @@ function calculateCount(row: any) {
       if (row.conditioningProgramDetail.cpDynamicPricingRule?.length > 0) {
       if (row.conditioningProgramDetail.cpDynamicPricingRule?.length > 0) {
         if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 0) {
         if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 0) {
           // 单价
           // 单价
-          if(acCount > 0){
+          if (acCount > 0) {
             let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price * acCount;
             let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price * acCount;
             row.unitPrice = unitPrice;
             row.unitPrice = unitPrice;
             row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
             row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
-          }else{
+          } else {
             row.unitPrice = '-';
             row.unitPrice = '-';
             row.totalPrice = 0;
             row.totalPrice = 0;
           }
           }
@@ -474,8 +474,10 @@ function confirm() {
         VxeUI.modal.close(`edit-system-service-modal`);
         VxeUI.modal.close(`edit-system-service-modal`);
       });
       });
     } else if (props.data.types === 'institution') {
     } else if (props.data.types === 'institution') {
+      console.log(fileList.value, '机构服务包的形象照');
       if (fileList.value.length > 0) {
       if (fileList.value.length > 0) {
-        const upImg = fileList.value[0].response?.url;
+        console.log(fileList.value, 'fileList.value');
+        const upImg = fileList.value[0]?.response?.url || fileList.value[0]?.thumbUrl;
         formData.photo = upImg;
         formData.photo = upImg;
         fileList.value = upImg
         fileList.value = upImg
           ? [
           ? [
@@ -551,6 +553,7 @@ onMounted(async () => {
     props.data.types = 'institution'; // Modify the local copy instead
     props.data.types = 'institution'; // Modify the local copy instead
     // 调编辑接口获取数据
     // 调编辑接口获取数据
     const res: any = await getConditioningRecordDetailMethod(props.data);
     const res: any = await getConditioningRecordDetailMethod(props.data);
+    console.log(res, '获取详情');
     Object.assign(formData, res); // Use the response to update formData
     Object.assign(formData, res); // Use the response to update formData
     await nextTick(); // 确保视图更新
     await nextTick(); // 确保视图更新
 
 
@@ -563,6 +566,7 @@ onMounted(async () => {
       willillStateNames: [],
       willillStateNames: [],
     };
     };
     formData.items = res?.items ?? [];
     formData.items = res?.items ?? [];
+    console.log(res?.photo, 'res?.photo');
     fileList.value = res?.photo
     fileList.value = res?.photo
       ? [
       ? [
           {
           {
@@ -632,6 +636,7 @@ const setVisible = (value: boolean): void => {
 const previewImg = ref<string>('');
 const previewImg = ref<string>('');
 // 预览图片
 // 预览图片
 const handlePreview = async (file: UploadFile) => {
 const handlePreview = async (file: UploadFile) => {
+  console.log(file, '预览图片');
   previewImg.value = file.response?.url ?? file.thumbUrl;
   previewImg.value = file.response?.url ?? file.thumbUrl;
   visible.value = true;
   visible.value = true;
 };
 };