|
|
|
|
@ -88,7 +88,18 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<el-table :data="formData.items || []" border size="small" class="mt-12px">
|
|
|
|
|
<el-tabs v-if="isDetail" v-model="detailActiveTab" class="stock-check-detail-tabs">
|
|
|
|
|
<el-tab-pane :label="t('ErpStock.Check.list')" name="items" />
|
|
|
|
|
<el-tab-pane label="审核记录" name="approveRecords" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
|
v-if="!isDetail || detailActiveTab === 'items'"
|
|
|
|
|
:data="formData.items || []"
|
|
|
|
|
border
|
|
|
|
|
size="small"
|
|
|
|
|
class="mt-12px"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column :label="t('ErpStock.Item.warehouse')" prop="warehouseName" min-width="120" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.Item.area')" prop="areaName" min-width="100" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.Item.barcode')" prop="productBarCode" min-width="150" />
|
|
|
|
|
@ -109,6 +120,32 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-table v-else :data="formData.approveRecords || []" border size="small" class="mt-12px">
|
|
|
|
|
<el-table-column label="变更前状态" prop="fromStatus" align="center" min-width="110">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.fromStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="变更后状态" prop="toStatus" align="center" min-width="110">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.toStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="目标审核人" prop="targetUserName" min-width="120" />
|
|
|
|
|
<el-table-column label="操作人" prop="creatorName" min-width="120" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作时间"
|
|
|
|
|
prop="createTime"
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
min-width="170"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:label="t('ErpStock.Check.remark')"
|
|
|
|
|
prop="remark"
|
|
|
|
|
min-width="160"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<el-form :model="formData" label-width="auto" :disabled="formDisabled" class="stock-check-bottom-form">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
@ -122,18 +159,22 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button>
|
|
|
|
|
<template v-if="isInventoryCheck">
|
|
|
|
|
<el-button type="primary" :disabled="formLoading" @click="submitForm(0)">
|
|
|
|
|
{{ t('ErpStock.Check.saveDraft') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="warning" :disabled="formLoading || hasIncompleteActualCount" @click="submitForm(1)">
|
|
|
|
|
{{ t('ErpStock.Check.inventoryCheck') }}
|
|
|
|
|
<el-button @click="dialogVisible = false">
|
|
|
|
|
{{ isDetail ? t('common.close') : t('common.cancel') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<template v-if="!isDetail">
|
|
|
|
|
<template v-if="isInventoryCheck">
|
|
|
|
|
<el-button type="primary" :disabled="formLoading" @click="submitForm(0)">
|
|
|
|
|
{{ t('ErpStock.Check.saveDraft') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="warning" :disabled="formLoading || hasIncompleteActualCount" @click="submitForm(1)">
|
|
|
|
|
{{ t('ErpStock.Check.inventoryCheck') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<el-button v-else type="primary" :disabled="formLoading" @click="submitForm()">
|
|
|
|
|
{{ t('common.save') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<el-button v-else type="primary" :disabled="formLoading" @click="submitForm()">
|
|
|
|
|
{{ t('common.save') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
@ -328,10 +369,12 @@ const dialogTitle = ref('')
|
|
|
|
|
const formLoading = ref(false)
|
|
|
|
|
const formType = ref('')
|
|
|
|
|
const formRef = ref()
|
|
|
|
|
const detailActiveTab = ref('items')
|
|
|
|
|
|
|
|
|
|
const isDetail = computed(() => formType.value === 'detail')
|
|
|
|
|
const isInventoryCheck = computed(() => formType.value === 'check')
|
|
|
|
|
const formDisabled = computed(() => formType.value === 'detail' || isInventoryCheck.value)
|
|
|
|
|
const selectionDisabled = computed(() => formType.value === 'detail')
|
|
|
|
|
const formDisabled = computed(() => isDetail.value || isInventoryCheck.value)
|
|
|
|
|
const selectionDisabled = computed(() => isDetail.value)
|
|
|
|
|
|
|
|
|
|
const formData = ref<FormData>({
|
|
|
|
|
id: undefined,
|
|
|
|
|
@ -442,7 +485,8 @@ const open = async (type: string, id?: number) => {
|
|
|
|
|
sourceType: Number(data?.sourceType ?? 1),
|
|
|
|
|
categoryType: data?.categoryType ?? getDefaultCategoryType(),
|
|
|
|
|
checkTime: data?.checkTime ? formatDate(data.checkTime as Date) : undefined,
|
|
|
|
|
items: data?.items || []
|
|
|
|
|
items: data?.items || [],
|
|
|
|
|
approveRecords: data?.approveRecords || []
|
|
|
|
|
}
|
|
|
|
|
if (type === 'detail') {
|
|
|
|
|
await enrichItemsForDisplay()
|
|
|
|
|
@ -858,8 +902,10 @@ const resetForm = () => {
|
|
|
|
|
sourceType: 1,
|
|
|
|
|
categoryType: getDefaultCategoryType(),
|
|
|
|
|
remark: undefined,
|
|
|
|
|
items: []
|
|
|
|
|
items: [],
|
|
|
|
|
approveRecords: []
|
|
|
|
|
}
|
|
|
|
|
detailActiveTab.value = 'items'
|
|
|
|
|
clearSelections()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
@ -889,6 +935,10 @@ const resetForm = () => {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stock-check-detail-tabs {
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stock-check-dialog-pagination {
|
|
|
|
|
padding-top: 12px;
|
|
|
|
|
padding-bottom: 56px;
|
|
|
|
|
|