art: 盘点结果审核
This commit is contained in:
parent
eb11fbf48f
commit
85d999056f
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@ -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']
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user