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'] ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs'] ATabs: typeof import('ant-design-vue/es')['Tabs']
ATag: typeof import('ant-design-vue/es')['Tag'] ATag: typeof import('ant-design-vue/es')['Tag']
ATextarea: typeof import('ant-design-vue/es')['Textarea']
ATooltip: typeof import('ant-design-vue/es')['Tooltip'] ATooltip: typeof import('ant-design-vue/es')['Tooltip']
ATransfer: typeof import('ant-design-vue/es')['Transfer'] ATransfer: typeof import('ant-design-vue/es')['Transfer']
ATree: typeof import('ant-design-vue/es')['Tree'] ATree: typeof import('ant-design-vue/es')['Tree']

View File

@ -1,120 +1,174 @@
<template> <template>
<page-container> <page-container>
<!-- 页面操作栏 --> <!-- 页面操作栏 -->
<template #ops> <template #ops>
<a-row> <a-row>
<a-col :span="18"> <a-col :span="18">
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button <a-input-search
@search="loadData()"></a-input-search> v-model:value="searchKey"
</a-col> :placeholder="`请输入`"
</a-row> allow-clear
</template> enter-button
<!-- 页面表格内容 --> @search="loadData()"
<div style="min-height: calc(100vh - 305px)"> ></a-input-search>
<!-- 表格行 --> </a-col>
<a-table :columns="columns" :data-source="auditPage?.records" bordered :pagination="pagination" :loading="loading" </a-row>
row-key="key"> </template>
<template #bodyCell="{ column, record }"> <!-- 页面表格内容 -->
<template v-if="column.dataIndex === 'auditType'"> <div style="min-height: calc(100vh - 305px)">
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }} <!-- 表格行 -->
</template> <a-table
<template v-if="column.dataIndex === 'reviewResult'"> :columns="columns"
<template v-if="record.reviewResult === 'WAIT_CHECK'"> 待盘点</template> :data-source="auditPage?.records"
<template v-if="record.reviewResult === 'PASS'"> 通过</template> bordered
<template v-if="record.reviewResult === 'REJECT'"> 拒绝 </template> :pagination="pagination"
<template v-if="record.reviewResult === 'UN_PASS'"> 未通过</template> :loading="loading"
<template v-if="record.reviewResult === 'WAIT_AUDIT'"> 待审核</template> row-key="key"
</template> >
</template> <template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'auditType'">
</a-table> {{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
</div> </template>
</page-container> <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> </template>
<script setup lang="ts"> <script setup lang="ts">
import api from '@/api'; import api from '@/api'
import { IPage } from '@/api/api' import { IPage } from '@/api/api'
import { useUserStore } from '@/stores/user' 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 loadData = async (page = 1, size = 10) => {
const loading = ref(false) 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 pagination = computed(() => {
const loadData = async (page = 1, size = 10) => { return {
loading.value = true current: auditPage.value?.current,
api.materialApi.apply.searchAuditPage( pageSize: auditPage.value?.size,
{ total: auditPage.value?.total,
page: page, onChange: (page: number, pageSize: number) => {
size: size, loadData(page, pageSize)
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 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> </script>

View File

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

View File

@ -66,12 +66,6 @@
</template> </template>
生成结果 生成结果
</a-button> </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>
</template> </template>
</a-table> </a-table>