| | |
| | | addOrUpdateDeliveryLedger, |
| | | delDeliveryLedger, |
| | | } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import { delLedgerFile } from "@/api/salesManagement/salesLedger.js"; |
| | | |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | }); |
| | | const total = ref(0); |
| | | const deliveryFileList = ref([]); |
| | | const javaApi = proxy.javaApi; |
| | | |
| | | // 上传配置 |
| | | const upload = reactive({ |
| | |
| | | fileUrl = '/' + fileUrl; |
| | | } |
| | | // 拼接 baseUrl |
| | | const baseUrl = import.meta.env.VITE_APP_BASE_API; |
| | | console.log('baseUrl:', baseUrl); |
| | | fileUrl = baseUrl + fileUrl; |
| | | fileUrl = javaApi + fileUrl; |
| | | console.log('最终拼接的 URL:', fileUrl); |
| | | } |
| | | |
| | |
| | | } |
| | | // 移除发货图片 |
| | | function handleDeliveryRemove(file) { |
| | | // 从文件列表中移除 |
| | | const index = deliveryFileList.value.findIndex(item => item.uid === file.uid); |
| | | if (index > -1) { |
| | | deliveryFileList.value.splice(index, 1); |
| | | console.log('file--', file) |
| | | // 如果是编辑模式且文件有 id,需要调用接口删除 |
| | | if (operationType.value === "edit") { |
| | | let ids = []; |
| | | ids.push(file.uid); |
| | | delLedgerFile(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | // 从文件列表中移除 |
| | | const index = deliveryFileList.value.findIndex(item => item.uid === file.uid); |
| | | if (index > -1) { |
| | | deliveryFileList.value.splice(index, 1); |
| | | } |
| | | }).catch(() => { |
| | | proxy.$modal.msgError("删除失败"); |
| | | }); |
| | | } else { |
| | | // 新增模式或没有 id 的文件,直接从列表中移除 |
| | | const index = deliveryFileList.value.findIndex(item => item.uid === file.uid); |
| | | if (index > -1) { |
| | | deliveryFileList.value.splice(index, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | // 隐藏图片上传组件的预览按钮(放大镜) |
| | | :deep(.el-upload-list--picture-card .el-upload-list__item-actions) { |
| | | .el-upload-list__item-preview { |
| | | display: none; |
| | | } |
| | | } |
| | | </style> |
| | | |