| | |
| | | <script setup> |
| | | import { getToken } from "@/utils/auth"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import { onMounted, ref, getCurrentInstance } from "vue"; |
| | | import { onMounted, ref, computed, getCurrentInstance } from "vue"; |
| | | import { addShippingInfo, batchAdd } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import { UploadFilled, Download } from "@element-plus/icons-vue"; |
| | |
| | | import { listCustomerPrivatePool } from "@/api/basicData/customerFile.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const isAdminUser = computed(() => |
| | | ["admin", "普通2", "最高1"].some(r => (userStore.roles || []).includes(r)) |
| | | ); |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableData = ref([]); |
| | | const productData = ref([]); |
| | |
| | | } |
| | | return true; |
| | | }; |
| | | const canEditLedger = row => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = row => isCurrentUserMaintainer(row); |
| | | const canEditLedger = row => isCurrentUserMaintainer(row) || isAdminUser.value; |
| | | const canDeleteLedger = row => isCurrentUserMaintainer(row) || isAdminUser.value; |
| | | const sensitiveAmountFormatter = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | if (!isCurrentUserMaintainer(row) && !isAdminUser.value) { |
| | | return "*****"; |
| | | } |
| | | return formattedNumber(row, column, cellValue); |
| | | }; |
| | | const sensitiveAmountFormatter4 = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | if (!isCurrentUserMaintainer(row) && !isAdminUser.value) { |
| | | return "*****"; |
| | | } |
| | | return formattedAmount4(row, column, cellValue); |
| | |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeChildrenTable = (param, parentRow) => { |
| | | if (!isCurrentUserMaintainer(parentRow)) { |
| | | if (!isCurrentUserMaintainer(parentRow) && !isAdminUser.value) { |
| | | const { columns } = param; |
| | | return columns.map((column, index) => { |
| | | if (index === 0) { |