| | |
| | | // 未盘点 |
| | | const noCheck = ref<string>('未盘'); |
| | | // 查询添加盘点标记过滤 |
| | | const checkFilter = ref<string>(); |
| | | const checkFilter = ref<string>(''); |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | handleReset: async () => { |
| | | selectTypeId.value = []; |
| | | checkFilter.value = undefined; |
| | | checkFilter.value = ''; |
| | | // eslint-disable-next-line no-use-before-define |
| | | const { formApi, reload } = tableApi; |
| | | await formApi.resetForm(); |
| | |
| | | const data0 = data.filter((item) => { |
| | | return item.status === '' || item.status === null || item.status === '0'; |
| | | }); |
| | | if (data0 !== null && data0.length > 0) { |
| | | noCheck.value = `未盘(${data0.length})`; |
| | | // 不点击已盘和未盘时才更新已盘和未盘的统计数据 |
| | | if (checkFilter.value === '') { |
| | | noCheck.value = data0 !== null && data0.length > 0 ? `未盘(${data0.length})` : `未盘(0)`; |
| | | const data1 = data.filter((item) => { |
| | | return item.status !== '' && item.status !== null && item.status === '1'; |
| | | }); |
| | | check.value = data1 !== null && data1.length > 0 ? `已盘(${data1.length})` : `已盘(0)`; |
| | | } |
| | | const data1 = data.filter((item) => { |
| | | return item.status !== '' && item.status !== null && item.status === '1'; |
| | | }); |
| | | if (data1 !== null && data1.length > 0) { |
| | | check.value = `已盘(${data1.length})`; |
| | | } |
| | | |
| | | }); |
| | | } |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(inventoryDetailExport, '盘点明细', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | function getImportStatus(row: any) { |
| | | const importStatus = row.importStatus === null || row.importStatus; |
| | | return importStatus ? '未导入' : '已导入'; |
| | | } |
| | | |
| | | function getInventoryFlag(row: any) { |
| | | const inventoryFlag = row.inventoryFlag === null || row.inventoryFlag; |
| | | return inventoryFlag ? '未盘点' : '已盘点'; |
| | | } |
| | | function handleQuery(isChecked: string) { |
| | | checkFilter.value = isChecked; |
| | | tableApi.query(); |
| | | } |
| | | |
| | | const { hasAccessByRoles } = useAccess(); |
| | | const isSuperAdmin = computed(() => hasAccessByRoles(['superadmin'])); |
| | | </script> |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <EquTypeTree v-model:select-dept-id="selectTypeId" class="w-[260px]" @reload="() => tableApi.reload()" @select="() => tableApi.reload()" /> |
| | | <EquTypeTree v-model:select-dept-id="selectTypeId" class="w-[260px]" @reload="() => tableApi.reload()" |
| | | @select="() => tableApi.reload()" /> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="盘点明细列表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button :disabled="!isSuperAdmin" v-access:code="['eims:inventory:edit']" @click.stop="handleEdit(row)"> |
| | | <ghost-button :disabled="!isSuperAdmin" v-access:code="['eims:inventory:edit']" |
| | | @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?" @confirm="handleDelete(row)"> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?" |
| | | @confirm="handleDelete(row)"> |
| | | <ghost-button :disabled="!isSuperAdmin" danger v-access:code="['eims:inventory:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #importStatus="{ row }"> |
| | | <span>{{ getImportStatus(row) }}</span> |
| | | </template> |
| | | |
| | | <template #inventoryFlag="{ row }"> |
| | | <span>{{ getInventoryFlag(row) }}</span> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |