| | |
| | | <el-button link :icon="Files" type="danger"> 附件 </el-button> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item |
| | | v-if="row.commonFiles.length !== 0" |
| | | :icon="Download" |
| | | command="download" |
| | | > |
| | | 下载 |
| | | </el-dropdown-item> |
| | | <el-dropdown-item :icon="Upload" command="upload"> |
| | | 上传 |
| | | </el-dropdown-item> |
| | |
| | | <template #operation="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | link |
| | | @click="openEdit(row)" |
| | | :disabled="row.issUerId !== userStore.id" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="primary" size="small" @click="downLoadFile(row)">附件</el-button> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | :disabled="row.issUerId !== userStore.id" |
| | | link |
| | | @click="handleDelete(row)" |
| | | > |
| | | 删除 |
| | |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <FileList ref="fileListRef" /> |
| | | <UploadModal ref="modalRef" @uploadSuccess="uploadSuccess"></UploadModal> |
| | | <EditModal ref="editmodalRef" @success="getTableData"></EditModal> |
| | | </div> |
| | |
| | | Search, |
| | | Upload, |
| | | EditPen, |
| | | Delete, |
| | | } from "@element-plus/icons-vue"; |
| | | import { |
| | | delRegistration, |
| | | productRecordPage, |
| | | productUploadFile, |
| | | } from "@/api/procurementManagement/procurementInvoiceLedger.js"; |
| | | import { delCommonFile } from "@/api/publicApi/commonFile.js"; |
| | | import { onMounted } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import UploadModal from "./Modal/UploadModal.vue"; |
| | | import EditModal from "./Modal/EditModal.vue"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import {delInvoiceLedgerByRegProductId} from "@/api/salesManagement/invoiceLedger.js"; |
| | | const userStore = useUserStore(); |
| | | import dayjs from "dayjs"; |
| | | import FileList from "./fileList.vue"; |
| | | |
| | | defineOptions({ |
| | | name: "来票台账", |
| | |
| | | { |
| | | purchaseContractNumber: undefined, // 采购合同号 |
| | | supplierName: undefined, // 供应商 |
| | | createdAt: [], // 来票日期 |
| | | // 设置来票日期范围为当天 |
| | | createdAt: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')], // 来票日期 |
| | | }, |
| | | [ |
| | | { |
| | |
| | | label: "销售合同号", |
| | | prop: "salesContractNo", |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "客户名称", |
| | | prop: "customerName", |
| | | width: 240, |
| | | }, |
| | | { |
| | | label: "供应商名称", |
| | |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | width: 150, |
| | | width: 190, |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | |
| | | const handleSelectionChange = (val) => { |
| | | multipleVal.value = val; |
| | | }; |
| | | |
| | | //附件相关 |
| | | const fileListRef = ref(null) |
| | | //查看附件 |
| | | const downLoadFile = (row) => { |
| | | fileListRef.value.open(row.commonFiles, row.id) |
| | | } |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | |
| | | console.log(row.commonFiles); |
| | | openUoload(row.ticketRegistrationId); |
| | | break; |
| | | case "delete": |
| | | // 删除所有附件 |
| | | if (row.commonFiles.length > 0) { |
| | | ElMessageBox.confirm(`确认删除该记录的所有附件吗?`, '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | // 获取所有附件的ID |
| | | const fileIds = row.commonFiles.map(file => file.id); |
| | | |
| | | delCommonFile(fileIds).then(() => { |
| | | ElMessage.success('删除成功') |
| | | // 刷新数据 |
| | | getTableData(); |
| | | }).catch(() => { |
| | | ElMessage.error('删除失败') |
| | | }) |
| | | }).catch(() => { |
| | | ElMessage.info('已取消删除') |
| | | }) |
| | | } |
| | | break; |
| | | } |
| | | }; |
| | | |