sparkles: ✨ 报废出库 查询和审核
This commit is contained in:
parent
8e3c2ec88f
commit
df572949f3
@ -3941,6 +3941,79 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "提交报废出库审核",
|
||||
"name": "submitScrapOutReview",
|
||||
"method": "post",
|
||||
"path": "/scrap-out-review",
|
||||
"response": {
|
||||
"typeArgs": [],
|
||||
"typeName": "",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"required": true,
|
||||
"in": "body",
|
||||
"name": "requestBody",
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "ReviewDTO",
|
||||
"isDefsType": true,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "获取报废出库申请单",
|
||||
"name": "getScrapOutById",
|
||||
"method": "get",
|
||||
"path": "/scrap-out/{applyId}",
|
||||
"response": {
|
||||
"typeArgs": [
|
||||
{
|
||||
"typeArgs": [],
|
||||
"typeName": "ScrapOutApplyDTO",
|
||||
"isDefsType": true,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
}
|
||||
],
|
||||
"typeName": "Array",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"description": "申请单ID",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"name": "applyId",
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "number",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "提交审核",
|
||||
"name": "submitReview",
|
||||
@ -4506,6 +4579,20 @@
|
||||
"description": "申请日期",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "number",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "applyId",
|
||||
"description": "申请id",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
@ -4561,6 +4648,20 @@
|
||||
"description": "物料编码",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "boolean",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "confirm",
|
||||
"description": "是否确认",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
@ -4603,6 +4704,34 @@
|
||||
"description": "备注",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": ["'WAIT_SCAN'", "'WAIT_SUBMIT'", "'WAIT_REVIEW'", "'PASS'", "'REJECT'"],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "reviewResult",
|
||||
"description": "审核状态",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "reviewer",
|
||||
"description": "审核人",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
@ -6143,7 +6272,7 @@
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": ["'IN'", "'OUT'", "'OFF'", "'LOST'"],
|
||||
"enum": ["'IN'", "'OUT'", "'OFF'", "'LOST'", "'SCRAP_OUT'"],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "status",
|
||||
@ -6214,6 +6343,138 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ScrapOutApplyDTO",
|
||||
"templateArgs": [],
|
||||
"properties": [
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "applicant",
|
||||
"description": "申请人",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "barcodeList",
|
||||
"description": "条码集合",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "number",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "confirmQuantity",
|
||||
"description": "确认数量",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "name",
|
||||
"description": "物料名称",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "price",
|
||||
"description": "单价",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "remark",
|
||||
"description": "报废原因",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "spec",
|
||||
"description": "物料规格",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "type",
|
||||
"description": "类型",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"dataType": {
|
||||
"typeArgs": [],
|
||||
"typeName": "string",
|
||||
"isDefsType": false,
|
||||
"templateIndex": -1,
|
||||
"compileTemplateKeyword": "#/definitions/",
|
||||
"enum": [],
|
||||
"typeProperties": []
|
||||
},
|
||||
"name": "typeName",
|
||||
"description": "类型名称",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "库存明细",
|
||||
"name": "StockDetailInfo",
|
||||
|
46
src/api/material/api.d.ts
vendored
46
src/api/material/api.d.ts
vendored
@ -9,6 +9,9 @@ declare namespace material {
|
||||
/** 申请日期 */
|
||||
applyDate?: string
|
||||
|
||||
/** 申请id */
|
||||
applyId?: number
|
||||
|
||||
/** 申请数量 */
|
||||
applyNum?: string
|
||||
|
||||
@ -21,6 +24,9 @@ declare namespace material {
|
||||
/** 物料编码 */
|
||||
code?: string
|
||||
|
||||
/** 是否确认 */
|
||||
confirm?: boolean
|
||||
|
||||
/** 确认数量 */
|
||||
confirmNum?: string
|
||||
|
||||
@ -30,6 +36,12 @@ declare namespace material {
|
||||
/** 备注 */
|
||||
remark?: string
|
||||
|
||||
/** 审核状态 */
|
||||
reviewResult?: 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
||||
|
||||
/** 审核人 */
|
||||
reviewer?: string
|
||||
|
||||
/** 物料规格 */
|
||||
spec?: string
|
||||
|
||||
@ -313,7 +325,7 @@ declare namespace material {
|
||||
materialId?: number
|
||||
|
||||
/** 状态 */
|
||||
status?: 'IN' | 'OUT' | 'OFF' | 'LOST'
|
||||
status?: 'IN' | 'OUT' | 'OFF' | 'LOST' | 'SCRAP_OUT'
|
||||
|
||||
/** updatedTime */
|
||||
updatedTime?: string
|
||||
@ -333,6 +345,38 @@ declare namespace material {
|
||||
reviewResult?: 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
||||
}
|
||||
|
||||
/**
|
||||
* ScrapOutApplyDTO
|
||||
*/
|
||||
export interface ScrapOutApplyDTO {
|
||||
/** 申请人 */
|
||||
applicant?: string
|
||||
|
||||
/** 条码集合 */
|
||||
barcodeList?: string
|
||||
|
||||
/** 确认数量 */
|
||||
confirmQuantity?: number
|
||||
|
||||
/** 物料名称 */
|
||||
name?: string
|
||||
|
||||
/** 单价 */
|
||||
price?: string
|
||||
|
||||
/** 报废原因 */
|
||||
remark?: string
|
||||
|
||||
/** 物料规格 */
|
||||
spec?: string
|
||||
|
||||
/** 类型 */
|
||||
type?: string
|
||||
|
||||
/** 类型名称 */
|
||||
typeName?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存明细
|
||||
*/
|
||||
|
21
src/api/material/mods/apply/getScrapOutById.ts
Normal file
21
src/api/material/mods/apply/getScrapOutById.ts
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @desc 获取报废出库申请单
|
||||
*/
|
||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
||||
import type { AxiosResponse } from 'axios'
|
||||
export default async function (
|
||||
/** 申请单ID */
|
||||
applyId: number,
|
||||
|
||||
success: (data: Array<material.ScrapOutApplyDTO>) => void = defaultSuccess,
|
||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
||||
): Promise<void> {
|
||||
return http({
|
||||
method: 'get',
|
||||
url: `/scrap-out/${applyId}`,
|
||||
})
|
||||
.then((data: AxiosResponse<Array<material.ScrapOutApplyDTO>, unknown>) => {
|
||||
success(data.data)
|
||||
})
|
||||
.catch((error: { code: string; error?: string }) => fail(error))
|
||||
}
|
@ -12,6 +12,8 @@ import updateReviewResult from './updateReviewResult'
|
||||
import submitManualStock from './submitManualStock'
|
||||
import getManualStock from './getManualStock'
|
||||
import saveScanData from './saveScanData'
|
||||
import submitScrapOutReview from './submitScrapOutReview'
|
||||
import getScrapOutById from './getScrapOutById'
|
||||
import submitReview from './submitReview'
|
||||
import getWaitScanData from './getWaitScanData'
|
||||
|
||||
@ -26,6 +28,8 @@ export default {
|
||||
submitManualStock,
|
||||
getManualStock,
|
||||
saveScanData,
|
||||
submitScrapOutReview,
|
||||
getScrapOutById,
|
||||
submitReview,
|
||||
getWaitScanData,
|
||||
}
|
||||
|
22
src/api/material/mods/apply/submitScrapOutReview.ts
Normal file
22
src/api/material/mods/apply/submitScrapOutReview.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @desc 提交报废出库审核
|
||||
*/
|
||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
||||
import type { AxiosResponse } from 'axios'
|
||||
export default async function (
|
||||
/** 请求体 */
|
||||
requestBody: material.ReviewDTO,
|
||||
|
||||
success: (data: void) => void = defaultSuccess,
|
||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
||||
): Promise<void> {
|
||||
return http({
|
||||
method: 'post',
|
||||
url: `/scrap-out-review`,
|
||||
data: requestBody,
|
||||
})
|
||||
.then((data: AxiosResponse<void, unknown>) => {
|
||||
success(data.data)
|
||||
})
|
||||
.catch((error: { code: string; error?: string }) => fail(error))
|
||||
}
|
@ -29,23 +29,61 @@
|
||||
<template v-if="column.dataIndex === 'applyTypeInfo'">
|
||||
{{ record.applyTypeInfo.description }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'reviewResult'">
|
||||
<template v-if="record.reviewResult === 'PASS'"><span style="color: #52c41a">审核通过</span></template>
|
||||
<template v-if="record.reviewResult === 'REJECT'"><span style="color: #f5222d">审核不通过</span></template>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a-button v-if="record.applyType === 'SCRAP_OUT'" type="link" style="margin-left: 10px">审核</a-button>
|
||||
<a-button
|
||||
v-if="record.applyType === 'SCRAP_OUT' && !record.confirm && record.reviewer === userStore.userName"
|
||||
type="link"
|
||||
style="margin-left: 10px"
|
||||
@click="showResultModal(record.applyId)"
|
||||
>
|
||||
审核
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</page-container>
|
||||
<!-- 审核弹窗 -->
|
||||
<a-modal v-model:open="openResult" title="报废出库数据:" width="80%" :confirm-loading="confirmLoading" @ok="submit">
|
||||
<vxe-table border show-overflow max-height="500" size="medium" :data="reviewData">
|
||||
<vxe-column type="seq" width="70" />
|
||||
<vxe-column field="name" title="物料名称" />
|
||||
<vxe-column field="typeName" title="类型" />
|
||||
<vxe-column field="spec" title="规格" />
|
||||
<vxe-column field="price" title="价格" />
|
||||
<vxe-column field="applicant" title="申请人" />
|
||||
<vxe-column field="confirmQuantity" title="报废数量" />
|
||||
<vxe-column field="remark" title="报废原因" />
|
||||
</vxe-table>
|
||||
<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>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import api from '@/api'
|
||||
import { IPage } from '@/api/api'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const searchKey = ref('')
|
||||
const pagedata = ref<IPage<material.ApplyDTO>>()
|
||||
const loading = ref(false)
|
||||
|
||||
const userStore = useUserStore()
|
||||
// 加载数据的方法
|
||||
const loadData = async (page = 1, size = 10) => {
|
||||
loading.value = true
|
||||
@ -103,6 +141,14 @@
|
||||
title: '申请人',
|
||||
dataIndex: 'applicant',
|
||||
},
|
||||
{
|
||||
title: '审核人',
|
||||
dataIndex: 'reviewer',
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
dataIndex: 'reviewResult',
|
||||
},
|
||||
{
|
||||
title: '申请日期',
|
||||
dataIndex: 'applyDate',
|
||||
@ -128,4 +174,37 @@
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
// 审核
|
||||
const openResult = ref<boolean>(false)
|
||||
const confirmLoading = ref(false)
|
||||
const reviewResult = ref<'PASS' | 'REJECT'>('PASS')
|
||||
const remark = ref('')
|
||||
const reviewData = ref<Array<material.ScrapOutApplyDTO>>([])
|
||||
const applyIdRef = ref(0)
|
||||
//点击审核
|
||||
const showResultModal = (applyId: number) => {
|
||||
openResult.value = true
|
||||
applyIdRef.value = applyId
|
||||
api.materialApi.apply.getScrapOutById(applyId, (data) => {
|
||||
reviewData.value = data
|
||||
})
|
||||
}
|
||||
|
||||
// 审核提交
|
||||
const submit = () => {
|
||||
confirmLoading.value = true
|
||||
api.materialApi.apply.submitScrapOutReview(
|
||||
{
|
||||
applyId: applyIdRef.value.toString(),
|
||||
reviewResult: reviewResult.value,
|
||||
remark: remark.value,
|
||||
},
|
||||
() => {
|
||||
confirmLoading.value = false
|
||||
openResult.value = false
|
||||
loadData()
|
||||
},
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user