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("æäº¤æå");