chenhj
2026-04-25 78278ebbdaf110363ecdde4fb25a5bc40e4fe1fd
文件上传修改
已修改14个文件
已删除2个文件
629 ■■■■■ 文件已修改
src/api/procurementManagement/procurementInvoiceLedger.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Dialog/FileListDialog.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ImagePreview/index.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ImageUpload/index.vue 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ProjectManagement/ProgressReportDialog.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/purchaseApproval/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/revenueManagement/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/Management/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/Management/projectDetail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/projectType/components/ProjectTypeDialog.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/dangerInvestigation/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/safeQualifications/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/safeWorkApproval/components/infoFormDia.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/safetyTrainingAssessment/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/deliveryLedger/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/procurementManagement/procurementInvoiceLedger.js
@@ -75,14 +75,6 @@
  });
}
export function productUploadFile(data) {
  return request({
    url: "/file/uploadFile",
    method: "post",
    data: data,
  });
}
// export function getProductRecordById(params) {
//   return request({
//     url: "/purchase/registration/getProductRecordById",
src/components/Dialog/FileListDialog.vue
@@ -77,6 +77,7 @@
                @pagination="paginationSearch"
                @change="handleChange" />
  </el-dialog>
<!-- // todo é™„件预览相关 -->
  <filePreview v-if="showPreview"
               ref="filePreviewRef" />
</template>
src/components/ImagePreview/index.vue
ÎļþÒÑɾ³ý
src/components/ImageUpload/index.vue
ÎļþÒÑɾ³ý
src/components/ProjectManagement/ProgressReportDialog.vue
@@ -116,18 +116,7 @@
      </el-row>
      <el-form-item label="附件" prop="attachmentIds">
        <el-upload
          v-model:file-list="fileList"
          :action="upload.url"
          :headers="upload.headers"
          multiple
          name="files"
          :on-success="handleUploadSuccess"
          :on-error="handleUploadError"
          :on-remove="handleRemove"
        >
          <el-button type="primary">上传文件</el-button>
        </el-upload>
        <FileUpload v-model:file-list="form.storageBlobDTOs" />
      </el-form-item>
    </el-form>
@@ -144,6 +133,7 @@
import { computed, reactive, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { getToken } from '@/utils/auth'
import FileUpload from "@/components/AttachmentUpload/file/index.vue";
const props = defineProps({
  modelValue: { type: Boolean, default: false },
@@ -161,11 +151,6 @@
})
const formRef = ref()
const fileList = ref([])
const upload = reactive({
  url: import.meta.env.VITE_APP_BASE_API + '/basic/customer-follow/upload',
  headers: { Authorization: 'Bearer ' + getToken() }
})
const form = ref({
  planNodeId: undefined,
@@ -180,7 +165,7 @@
  managerName: '',
  departmentName: '',
  remark: '',
  attachmentIds: []
  storageBlobDTOs: []
})
const rules = {
@@ -217,9 +202,8 @@
    managerName: info.managerName || '',
    departmentName: info.departmentName || '',
    remark: '',
    attachmentIds: []
    storageBlobDTOs: []
  }
  fileList.value = []
}
watch(
@@ -237,30 +221,6 @@
  form.value.completionProgress = 100
  form.value.totalProgress = 100
  if (!form.value.actualEndTime) form.value.actualEndTime = form.value.reportDate || ''
}
function handleUploadError() {
  ElMessage.error('上传文件失败')
}
function handleUploadSuccess(res, file) {
  if (res?.code !== 200) {
    ElMessage.error(res?.msg || '上传失败')
    return
  }
  const attachmentId = res?.data?.id ?? res?.data?.tempId ?? ''
  if (!attachmentId) return
  form.value.attachmentIds.push(attachmentId)
  try {
    file.attachmentId = attachmentId
  } catch (e) {}
  ElMessage.success('上传成功')
}
function handleRemove(file) {
  const attachmentId = file?.attachmentId
  if (!attachmentId) return
  form.value.attachmentIds = (form.value.attachmentIds || []).filter(id => id !== attachmentId)
}
async function submit() {
src/views/collaborativeApproval/purchaseApproval/index.vue
@@ -329,12 +329,12 @@
    },
  });
  const { productForm, productRules } = toRefs(productFormData);
  const upload = reactive({
    // ä¸Šä¼ çš„地址
    url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
    // è®¾ç½®ä¸Šä¼ çš„请求头部
    headers: { Authorization: "Bearer " + getToken() },
  });
  // const upload = reactive({
  //   // ä¸Šä¼ çš„地址
  //   url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
  //   // è®¾ç½®ä¸Šä¼ çš„请求头部
  //   headers: { Authorization: "Bearer " + getToken() },
  // });
  const changeDaterange = value => {
    if (value) {
src/views/financialManagement/revenueManagement/index.vue
@@ -76,6 +76,7 @@
      </PIMTable>
    </div>
    <Modal ref="modalRef" @success="getTableData"></Modal>
    <!--  todo é™„件预览相关 -->
    <FileListDialog 
      ref="fileListRef" 
      v-model="fileListDialogVisible"
src/views/projectManagement/Management/index.vue
@@ -384,7 +384,7 @@
      actualStartTime: payload.actualStartTime || null,
      actualEndTime: payload.actualEndTime || null,
      progress: Number(payload.totalProgress ?? payload.completionProgress ?? 0) || 0,
      attachmentIds: Array.isArray(payload.attachmentIds) ? payload.attachmentIds : []
      storageBlobDTOs: Array.isArray(payload.storageBlobDTOs) ? payload.storageBlobDTOs : []
    }
    const res = await saveStage(req)
    if (res?.code === 200) {
src/views/projectManagement/Management/projectDetail.vue
@@ -319,7 +319,7 @@
      actualStartTime: payload.actualStartTime || null,
      actualEndTime: payload.actualEndTime || null,
      progress: Number(payload.totalProgress ?? payload.completionProgress ?? 0) || 0,
      attachmentIds: Array.isArray(payload.attachmentIds) ? payload.attachmentIds : []
      storageBlobDTOs: Array.isArray(payload.storageBlobDTOs) ? payload.storageBlobDTOs : []
    }
    const res = await saveStage(req)
    if (res?.code === 200) {
src/views/projectManagement/projectType/components/ProjectTypeDialog.vue
@@ -29,24 +29,15 @@
            style="width: 220px"
          />
        </div>
      </div>
      <div class="base-info-row">
        <div class="info-item">
          <span class="item-label">附件</span>
          <el-upload
            v-if="isEdit"
            :action="uploadUrl"
            :headers="uploadHeaders"
            :on-success="handleUploadSuccess"
            :on-remove="handleRemove"
            v-model:file-list="uploadFileList"
            :limit="3"
            name="files"
            multiple
          >
            <el-button type="primary">上传附件</el-button>
          </el-upload>
          <FileUpload v-if="isEdit" v-model:file-list="uploadFileList" />
          <span v-else class="text-gray-400 text-sm">请先保存后再上传附件</span>
        </div>
      </div>
      <!-- æ­¥éª¤é…ç½®è¡¨æ ¼ -->
       <p class="top-tip">请按照顺序配置项目阶段,拖拽<b>步骤</b>排序即可</p>
@@ -162,6 +153,7 @@
import { ElMessage, ElMessageBox } from 'element-plus';
import { getToken } from '@/utils/auth';
import Sortable from 'sortablejs';
import FileUpload from "@/components/AttachmentUpload/file/index.vue";
const props = defineProps({
  modelValue: Boolean,
@@ -175,16 +167,12 @@
const formRef = ref(null);
const userOptions = ref([]);
const isEdit = ref(false);
const uploadHeaders = { Authorization: "Bearer " + getToken() };
// ä¸Šä¼ åœ°å€
const uploadUrl = import.meta.env.VITE_APP_BASE_API + "/basic/customer-follow/upload";
let sortable = null;
const form = ref({
  id: undefined,
  name: '',
  description: '',
  attachmentIds: [],
  savePlanNodeList: []
});
const uploadFileList = ref([]);
@@ -204,11 +192,9 @@
        id: props.data.id,
        name: props.data.name,
        description: props.data.description,
        attachmentIds: Array.isArray(props.data.attachmentIds)
          ? props.data.attachmentIds
          : (props.data.attachmentList || []).map(f => f.id).filter(Boolean),
        savePlanNodeList: []
      };
      uploadFileList.value = props.data.storageBlobDTOs || [];
      
      // å›žæ˜¾æ­¥éª¤èŠ‚ç‚¹
      if (props.data.planNodeList && props.data.planNodeList.length > 0) {
@@ -279,7 +265,6 @@
    id: undefined,
    name: '',
    description: '',
    attachmentIds: [],
    savePlanNodeList: [createDefaultNode()]
  };
  uploadFileList.value = [];
@@ -306,29 +291,6 @@
  if (user) {
    row.leaderName = user.nickName;
  }
}
/** å¤„理文件上传成功 */
function handleUploadSuccess(response, file, fileList) {
  if (response.code === 200) {
    const newFile = response.data;
    const list = Array.isArray(newFile) ? newFile : [newFile];
    list.forEach(element => {
      const id = element?.id;
      if (id && !form.value.attachmentIds.includes(id)) {
        form.value.attachmentIds.push(id);
      }
    });
  } else {
    ElMessage.error(response.msg || '上传失败');
  }
}
/** å¤„理文件移除 */
function handleRemove(file) {
  const removedId = file?.id || file?.response?.data?.id;
  if (!removedId) return;
  form.value.attachmentIds = form.value.attachmentIds.filter(id => id !== removedId);
}
/** æ·»åŠ æ­¥éª¤ */
@@ -374,6 +336,7 @@
      form.value.savePlanNodeList.forEach((node, index) => {
        node.sort = index;
      });
      form.value.storageBlobDTOs = uploadFileList.value;
      emit('submit', form.value);
    }
  } catch (error) {
src/views/safeProduction/dangerInvestigation/index.vue
@@ -415,7 +415,7 @@
        </el-row>
      </el-form>
    </FormDialog>
    <!-- é™„件列表弹窗 -->
  <!--  todo é™„件预览相关 -->
    <FileListDialog ref="fileListRef"
                    v-model="fileListDialogVisible"
                    :show-upload-button="true"
src/views/safeProduction/safeQualifications/index.vue
@@ -202,7 +202,7 @@
        </el-row>
      </el-form>
    </FormDialog>
    <!-- é™„件列表弹窗 -->
<!-- todo é™„件预览相关 -->
    <FileListDialog ref="fileListRef"
                    v-model="fileListDialogVisible"
                    :show-upload-button="true"
src/views/safeProduction/safeWorkApproval/components/infoFormDia.vue
@@ -171,26 +171,7 @@
          <el-col :span="24">
            <el-form-item label="附件材料:"
                          prop="remark">
              <el-upload v-model:file-list="fileList"
                         :action="upload.url"
                         multiple
                         ref="fileUpload"
                         auto-upload
                         :headers="upload.headers"
                         :before-upload="handleBeforeUpload"
                         :on-error="handleUploadError"
                         :on-success="handleUploadSuccess"
                         :on-remove="handleRemove">
                <el-button type="primary"
                           v-if="operationType !== 'view'">上传</el-button>
                <template #tip
                          v-if="operationType !== 'view'">
                  <div class="el-upload__tip">
                    æ–‡ä»¶æ ¼å¼æ”¯æŒ
                    doc,docx,xls,xlsx,ppt,pptx,pdf,txt,xml,jpg,jpeg,png,gif,bmp,rar,zip,7z
                  </div>
                </template>
              </el-upload>
              <FileUpload v-model:file-list="fileList" />
            </el-form-item>
          </el-col>
        </el-row>
@@ -222,17 +203,12 @@
  import useUserStore from "@/store/modules/user";
  import { getCurrentDate } from "@/utils/index.js";
  import log from "@/views/monitor/job/log.vue";
  import FileUpload from "@/components/AttachmentUpload/file/index.vue";
  const userStore = useUserStore();
  const dialogFormVisible = ref(false);
  const operationType = ref("");
  const fileList = ref([]);
  const upload = reactive({
    // ä¸Šä¼ çš„地址
    url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
    // è®¾ç½®ä¸Šä¼ çš„请求头部
    headers: { Authorization: "Bearer " + getToken() },
  });
  const data = reactive({
    form: {
      approveTime: "",
@@ -242,7 +218,7 @@
      approveDeptName: "",
      approveReason: "",
      checkResult: "",
      tempFileIds: [],
      storageBlobDTOs: [],
      approverList: [], // æ–°å¢žå­—段,存储所有节点的审批人id
      startDate: "", // è¯·å‡å¼€å§‹æ—¶é—´
      endDate: "", // è¯·å‡ç»“束时间
@@ -317,8 +293,7 @@
    // åŠ è½½éƒ¨é—¨é€‰é¡¹ï¼Œå¹¶åœ¨åŠ è½½å®ŒæˆåŽè®¾ç½®éƒ¨é—¨åç§°
    getProductOptions();
    if (operationType.value === "edit") {
      fileList.value = row.commonFileList;
      form.value.tempFileIds = fileList.value.map(file => file.id);
      fileList.value = row.storageBlobVOs;
      currentApproveStatus.value = row.approveStatus;
      approveProcessGetInfo({ id: row.approveId, approveReason: "1" }).then(
        res => {
@@ -412,6 +387,7 @@
        return;
      }
    }
    form.value.storageBlobDTOs = fileList.value;
    proxy.$refs.formRef.validate(valid => {
      if (valid) {
        if (operationType.value === "add" || currentApproveStatus.value == 3) {
@@ -435,47 +411,6 @@
    dialogFormVisible.value = false;
    emit("close");
  };
  // ä¸Šä¼ å‰æ ¡æ£€
  function handleBeforeUpload(file) {
    // æ ¡æ£€æ–‡ä»¶å¤§å°
    // if (file.size > 1024 * 1024 * 10) {
    //   proxy.$modal.msgError("上传文件大小不能超过10MB!");
    //   return false;
    // }
    proxy.$modal.loading("正在上传文件,请稍候...");
    return true;
  }
  // ä¸Šä¼ å¤±è´¥
  function handleUploadError(err) {
    proxy.$modal.msgError("上传文件失败");
    proxy.$modal.closeLoading();
  }
  // ä¸Šä¼ æˆåŠŸå›žè°ƒ
  function handleUploadSuccess(res, file, uploadFiles) {
    proxy.$modal.closeLoading();
    if (res.code === 200) {
      // ç¡®ä¿ tempFileIds å­˜åœ¨ä¸”为数组
      if (!form.value.tempFileIds) {
        form.value.tempFileIds = [];
      }
      form.value.tempFileIds.push(res.data.tempId);
      proxy.$modal.msgSuccess("上传成功");
    } else {
      proxy.$modal.msgError(res.msg);
      proxy.$refs.fileUpload.handleRemove(file);
    }
  }
  // ç§»é™¤æ–‡ä»¶
  function handleRemove(file) {
    if (operationType.value === "edit") {
      let ids = [];
      ids.push(file.id);
      delLedgerFile(ids).then(res => {
        proxy.$modal.msgSuccess("删除成功");
      });
    }
  }
  defineExpose({
    openDialog,
src/views/safeProduction/safetyTrainingAssessment/index.vue
@@ -358,7 +358,7 @@
        </span>
      </template>
    </el-dialog>
    <!-- é™„件列表弹窗 -->
    <!--  todo é™„件预览相关 -->
    <FileListDialog ref="fileListRef"
                    v-model="fileListDialogVisible"
                    :show-upload-button="true"
src/views/salesManagement/deliveryLedger/index.vue
@@ -313,7 +313,7 @@
      expressCompany: row.expressCompany ?? "",
      expressNumber: row.expressNumber ?? "",
    };
    deliveryFileList.value = row.storageBlobVOS || [];
    deliveryFileList.value = row.storageBlobVOs || [];
  }
  dialogFormVisible.value = true;
src/views/salesManagement/salesLedger/index.vue
@@ -475,26 +475,7 @@
          <el-col :span="24">
            <el-form-item label="附件材料:"
                          prop="salesLedgerFiles">
              <el-upload v-model:file-list="fileList"
                         :action="upload.url"
                         multiple
                         ref="fileUpload"
                         auto-upload
                         :headers="upload.headers"
                         :before-upload="handleBeforeUpload"
                         :on-error="handleUploadError"
                         :on-success="handleUploadSuccess"
                         :on-remove="handleRemove">
                <el-button type="primary"
                           v-if="operationType !== 'view'">上传</el-button>
                <template #tip
                          v-if="operationType !== 'view'">
                  <div class="el-upload__tip">
                    æ–‡ä»¶æ ¼å¼æ”¯æŒ
                    doc,docx,xls,xlsx,ppt,pptx,pdf,txt,xml,jpg,jpeg,png,gif,bmp,rar,zip,7z
                  </div>
                </template>
              </el-upload>
              <FileUpload v-model:file-list="fileList" />
            </el-form-item>
          </el-col>
        </el-row>
@@ -757,6 +738,7 @@
        </template>
      </el-upload>
    </FormDialog>
<!-- // todo é™„件预览相关 -->
    <!-- é™„件列表弹窗 -->
    <FileListDialog ref="fileListRef"
                    v-model="fileListDialogVisible"
@@ -946,6 +928,7 @@
  import { getCurrentDate } from "@/utils/index.js";
  import { useRouter, useRoute } from "vue-router";
  import { listCustomerPrivatePool } from "@/api/basicData/customerFile.js";
  import FileUpload from "@/components/AttachmentUpload/file/index.vue";
  const router = useRouter();
  const route = useRoute();
  const userStore = useUserStore();
@@ -1042,12 +1025,6 @@
  const { productForm, productRules } = toRefs(productFormData);
  // é˜²æ­¢å¾ªçŽ¯è®¡ç®—çš„æ ‡å¿—
  const isCalculating = ref(false);
  const upload = reactive({
    // ä¸Šä¼ çš„地址
    url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
    // è®¾ç½®ä¸Šä¼ çš„请求头部
    headers: { Authorization: "Bearer " + getToken() },
  });
  // æ‰“印相关
  const printPreviewVisible = ref(false);
  const printData = ref([]);
@@ -1409,7 +1386,7 @@
        form.value = { ...res };
        form.value.entryPerson = Number(res.entryPerson);
        productData.value = form.value.productData;
        fileList.value = form.value.salesLedgerFiles;
        fileList.value = form.value.storageBlobVOs;
      });
    }
    // let userAll = await userStore.getInfo()
@@ -1529,42 +1506,6 @@
  function changs(val) {
    console.log(val);
  }
  // ä¸Šä¼ å‰æ ¡æ£€
  function handleBeforeUpload(file) {
    // æ ¡æ£€æ–‡ä»¶å¤§å°
    // if (file.size > 1024 * 1024 * 10) {
    //   proxy.$modal.msgError("上传文件大小不能超过10MB!");
    //   return false;
    // }
    proxy.$modal.loading("正在上传文件,请稍候...");
    return true;
  }
  // ä¸Šä¼ å¤±è´¥
  function handleUploadError(err) {
    proxy.$modal.msgError("上传文件失败");
    proxy.$modal.closeLoading();
  }
  // ä¸Šä¼ æˆåŠŸå›žè°ƒ
  function handleUploadSuccess(res, file, uploadFiles) {
    proxy.$modal.closeLoading();
    if (res.code === 200) {
      file.tempId = res.data.tempId;
      proxy.$modal.msgSuccess("上传成功");
    } else {
      proxy.$modal.msgError(res.msg);
      proxy.$refs.fileUpload.handleRemove(file);
    }
  }
  // ç§»é™¤æ–‡ä»¶
  function handleRemove(file) {
    if (operationType.value === "edit") {
      let ids = [];
      ids.push(file.id);
      delLedgerFile(ids).then(res => {
        proxy.$modal.msgSuccess("删除成功");
      });
    }
  }
  // æäº¤è¡¨å•
  const submitForm = () => {
    proxy.$refs["formRef"].validate(valid => {
@@ -1576,11 +1517,7 @@
          proxy.$modal.msgWarning("请添加产品信息");
          return;
        }
        let tempFileIds = [];
        if (fileList.value !== null && fileList.value.length > 0) {
          tempFileIds = fileList.value.map(item => item.tempId);
        }
        form.value.tempFileIds = tempFileIds;
        form.value.storageBlobDTOs = fileList;
        form.value.type = 1;
        addOrUpdateSalesLedger(form.value).then(res => {
          proxy.$modal.msgSuccess("提交成功");