art: 盘点结果审核
All checks were successful
Release / lint (push) Successful in 28s
Release / Release (push) Successful in 1m19s

This commit is contained in:
my_ong 2024-12-10 15:23:34 +08:00
parent eb11fbf48f
commit 85d999056f
4 changed files with 237 additions and 185 deletions

1
src/components.d.ts vendored
View File

@ -50,6 +50,7 @@ declare module 'vue' {
ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs']
ATag: typeof import('ant-design-vue/es')['Tag']
ATextarea: typeof import('ant-design-vue/es')['Textarea']
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
ATransfer: typeof import('ant-design-vue/es')['Transfer']
ATree: typeof import('ant-design-vue/es')['Tree']

View File

@ -1,120 +1,174 @@
<template>
<page-container>
<!-- 页面操作栏 -->
<template #ops>
<a-row>
<a-col :span="18">
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button
@search="loadData()"></a-input-search>
</a-col>
</a-row>
</template>
<!-- 页面表格内容 -->
<div style="min-height: calc(100vh - 305px)">
<!-- 表格行 -->
<a-table :columns="columns" :data-source="auditPage?.records" bordered :pagination="pagination" :loading="loading"
row-key="key">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'auditType'">
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
</template>
<template v-if="column.dataIndex === 'reviewResult'">
<template v-if="record.reviewResult === 'WAIT_CHECK'"> 待盘点</template>
<template v-if="record.reviewResult === 'PASS'"> 通过</template>
<template v-if="record.reviewResult === 'REJECT'"> 拒绝 </template>
<template v-if="record.reviewResult === 'UN_PASS'"> 未通过</template>
<template v-if="record.reviewResult === 'WAIT_AUDIT'"> 待审核</template>
</template>
</template>
</a-table>
</div>
</page-container>
<page-container>
<!-- 页面操作栏 -->
<template #ops>
<a-row>
<a-col :span="18">
<a-input-search
v-model:value="searchKey"
:placeholder="`请输入`"
allow-clear
enter-button
@search="loadData()"
></a-input-search>
</a-col>
</a-row>
</template>
<!-- 页面表格内容 -->
<div style="min-height: calc(100vh - 305px)">
<!-- 表格行 -->
<a-table
:columns="columns"
:data-source="auditPage?.records"
bordered
:pagination="pagination"
:loading="loading"
row-key="key"
>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'auditType'">
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
</template>
<template v-if="column.dataIndex === 'reviewResult'">
<template v-if="record.reviewResult === 'WAIT_SCAN'">待扫码</template>
<template v-if="record.reviewResult === 'WAIT_SUBMIT'">待提交</template>
<template v-if="record.reviewResult === 'WAIT_REVIEW'">待审核</template>
<template v-if="record.reviewResult === 'PASS'">审核通过</template>
<template v-if="record.reviewResult === 'REJECT'">退回</template>
</template>
<template v-if="column.dataIndex === 'operation'">
<a-button
v-if="record.reviewResult === 'WAIT_REVIEW'"
type="link"
style="margin-left: 10px"
@click="showResultModal(record.id)"
>
<template #icon>
<icon-font type="icon-plus" />
</template>
审核
</a-button>
</template>
</template>
</a-table>
</div>
</page-container>
<!-- 审核弹窗 -->
<a-modal v-model:open="openResult" title="盘点异常数据:" width="80%" :confirm-loading="confirmLoading" @ok="submit">
<result-form ref="reviewResultRef" :apply-id="applyIdRef">
<a-form layout="vertical" style="margin-top: 20px">
<a-form-item label="审核意见">
<a-textarea v-model:value="remark" placeholder="请输入审核意见" :row="3" :maxlength="1000" />
</a-form-item>
<a-form-item label="审核结果">
<a-radio-group v-model:value="reviewResult" button-style="solid">
<a-radio-button value="PASS">审核通过</a-radio-button>
<a-radio-button value="REJECT" style="margin-left: 20px">退回重盘</a-radio-button>
</a-radio-group>
</a-form-item>
</a-form>
</result-form>
</a-modal>
</template>
<script setup lang="ts">
import api from '@/api';
import { IPage } from '@/api/api'
import { useUserStore } from '@/stores/user'
import api from '@/api'
import { IPage } from '@/api/api'
import resultForm from '../stocktaking/result-form.vue'
const applyIdRef = ref()
const searchKey = ref('')
const auditPage = ref<IPage<material.ApplyForm>>()
const loading = ref(false)
const confirmLoading = ref(false)
const reviewResult = ref('PASS')
const remark = ref('')
const reviewResultRef = ref()
const searchKey = ref('')
const auditPage = ref<IPage<material.ApplyForm>>()
const loading = ref(false)
//
const loadData = async (page = 1, size = 10) => {
loading.value = true
api.materialApi.apply.searchAuditPage(
{
page: page,
size: size,
reviewResults: ['WAIT_SUBMIT', 'WAIT_SCAN', 'WAIT_REVIEW', 'PASS', 'REJECT'],
},
(data) => {
auditPage.value = data
loading.value = false
},
)
}
//
loadData()
//
const columns = [
{
title: '申请id',
dataIndex: 'applyId',
},
{
title: '盘点类型',
dataIndex: 'auditType',
},
{
title: '申请人',
dataIndex: 'applicant',
},
{
title: '盘点人',
dataIndex: 'taker',
},
{
title: '盘点审核人',
dataIndex: 'reviewer',
},
{
title: '申请日期',
dataIndex: 'applyDate',
},
{
title: '审核意见',
dataIndex: 'reviewRemark',
},
{
title: '审核结果',
dataIndex: 'reviewResult',
},
{
title: '操作',
dataIndex: 'operation',
},
]
const userStore = useUserStore()
//
const loadData = async (page = 1, size = 10) => {
loading.value = true
api.materialApi.apply.searchAuditPage(
{
page: page,
size: size,
taker: userStore.userName
}, (data) => {
auditPage.value = data
loading.value = false
});
}
//
loadData()
//
const columns = [
{
title: '盘点类型',
dataIndex: 'auditType',
},
{
title: '申请人',
dataIndex: 'applicant',
},
{
title: '盘点人',
dataIndex: 'taker',
},
{
title: '任务状态',
dataIndex: 'reviewResult',
},
{
title: '盘点审核人',
dataIndex: 'reviewer',
},
{
title: '创建时间',
dataIndex: 'createdTime',
},
{
title: '盘点结果(系统生成)',
dataIndex: 'result',
},
{
title: '异常原因',
dataIndex: 'exception',
},
{
title: '处理方式',
dataIndex: 'handle',
},
]
//
const pagination = computed(() => {
return {
current: auditPage.value?.current,
pageSize: auditPage.value?.size,
total: auditPage.value?.total,
onChange: (page: number, pageSize: number) => {
loadData(page, pageSize)
},
}
})
//
const pagination = computed(() => {
return {
current: auditPage.value?.current,
pageSize: auditPage.value?.size,
total: auditPage.value?.total,
onChange: (page: number, pageSize: number) => {
loadData(page, pageSize)
},
}
})
const openResult = ref<boolean>(false)
const showResultModal = (applyId: number) => {
openResult.value = true
applyIdRef.value = applyId
}
//
const submit = () => {
confirmLoading.value = true
const data = reviewResultRef.value.getTableData()
window.console.log(data)
confirmLoading.value = false
openResult.value = false
}
</script>

View File

@ -1,79 +1,82 @@
<template>
<vxe-table border stripe show-overflow ref="resulRef" max-height="500" :column-config="{ resizable: true }"
:data="tableData" :keyboard-config="{ isEsc: true }" size="medium" empty-text="盘点数据和库存数据一致,可以直接提交审核"
:edit-config="{ trigger: 'click', mode: 'cell' }">
<vxe-column type="seq" title="序号" width="60"></vxe-column>
<vxe-column field="id" title="ID" :visible="false" />
<vxe-column field="materialName" title="物料名称" />
<vxe-column field="barcode" title="物料条码" />
<vxe-column field="exceptionReason" title="异常原因">
<template #default="{ row }">
<template v-if="row.exceptionReason === 'SOCK_IN_BUT_SCAN_NOT_EXIST'"> 库房在库状态但是扫码不存在</template>
<template v-if="row.exceptionReason === 'SOCK_OUT_BUT_SCAN_EXIST'"> 库房不是在库状态但是扫码存在</template>
<template v-if="row.exceptionReason === 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'"> 库房不存在该条码但是扫码存在</template>
</template>
</vxe-column>
<vxe-column field="exceptionHandle" title="异常处理(手动选择)" :edit-render="handelEditRender"></vxe-column>
<vxe-column field="remark" title="备注说明" width="25%" :edit-render="{ name: 'textarea' }"></vxe-column>
</vxe-table>
<vxe-table
ref="resulRef"
border
stripe
show-overflow
max-height="500"
:column-config="{ resizable: true }"
:data="tableData"
:keyboard-config="{ isEsc: true }"
size="medium"
empty-text="盘点数据和库存数据一致,可以直接提交审核"
:edit-config="{ trigger: 'click', mode: 'cell' }"
>
<vxe-column type="seq" title="序号" width="60"></vxe-column>
<vxe-column field="id" title="ID" :visible="false" />
<vxe-column field="materialName" title="物料名称" />
<vxe-column field="barcode" title="物料条码" />
<vxe-column field="exceptionReason" title="异常原因">
<template #default="{ row }">
<template v-if="row.exceptionReason === 'SOCK_IN_BUT_SCAN_NOT_EXIST'">库房在库状态但是扫码不存在</template>
<template v-if="row.exceptionReason === 'SOCK_OUT_BUT_SCAN_EXIST'">库房不是在库状态但是扫码存在</template>
<template v-if="row.exceptionReason === 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'">库房不存在该条码但是扫码存在</template>
</template>
</vxe-column>
<vxe-column field="exceptionHandle" title="异常处理(手动选择)" :edit-render="handelEditRender"></vxe-column>
<vxe-column field="remark" title="备注说明" width="25%" :edit-render="{ name: 'textarea' }"></vxe-column>
</vxe-table>
<slot></slot>
</template>
<script setup lang="ts">
import api from '@/api'
import { toRefs } from 'vue'
import type { VxeColumnPropTypes, VxeTableInstance } from 'vxe-table'
import type { VxeSelectProps } from 'vxe-pc-ui'
import api from '@/api'
import { toRefs } from 'vue';
import type { VxeColumnPropTypes,VxeTableInstance } from 'vxe-table'
import type { VxeSelectProps } from 'vxe-pc-ui'
//
const props = defineProps(
{
applyId: {
type: Number,
required: false,
default: 0
}
}
)
const resulRef = ref<VxeTableInstance<material.StocktakingScanExceptionalData>>()
const getTableData = () => {
const $table = resulRef.value
if ($table) {
return $table.getTableData().fullData.map(item => ({
id: item.id,
exceptionHandle: item.exceptionHandle,
remark: item.remark
}))
}}
defineExpose({getTableData});
const { applyId } = toRefs(props)
const tableData = ref<Array<material.StocktakingScanExceptionalData>>()
const result = ref()
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
result.value = data
tableData.value = data.exceptionalData
})
//id
watch(applyId, () => {
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
result.value = data
tableData.value = data.exceptionalData
})
})
//
const handelEditRender = ref<VxeColumnPropTypes.EditRender<undefined, VxeSelectProps>>({
name: 'VxeSelect',
options: [
{ label: '入库+1', value: 'INBOUND' },
{ label: '不入库-1', value: 'OUTBOUND' },
{ label: '丢弃-1', value: 'DISCARD' },
]
})
//
const props = defineProps({
applyId: {
type: Number,
required: false,
default: 0,
},
})
const resulRef = ref<VxeTableInstance<material.StocktakingScanExceptionalData>>()
const getTableData = () => {
const $table = resulRef.value
if ($table) {
return $table.getTableData().fullData.map((item) => ({
id: item.id,
exceptionHandle: item.exceptionHandle,
remark: item.remark,
}))
}
}
defineExpose({ getTableData })
const { applyId } = toRefs(props)
const tableData = ref<Array<material.StocktakingScanExceptionalData>>()
const result = ref()
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
result.value = data
tableData.value = data.exceptionalData
})
//id
watch(applyId, () => {
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
result.value = data
tableData.value = data.exceptionalData
})
})
//
const handelEditRender = ref<VxeColumnPropTypes.EditRender<undefined, VxeSelectProps>>({
name: 'VxeSelect',
options: [
{ label: '入库+1', value: 'INBOUND' },
{ label: '不入库-1', value: 'OUTBOUND' },
{ label: '丢弃-1', value: 'DISCARD' },
],
})
</script>

View File

@ -66,12 +66,6 @@
</template>
生成结果
</a-button>
<a-button v-if="record.reviewResult === 'WAIT_REVIEW'" type="link" style="margin-left: 10px">
<template #icon>
<icon-font type="icon-plus" />
</template>
审核
</a-button>
</template>
</template>
</a-table>