bug: 盘点功能的条件查询
All checks were successful
Release / lint (push) Successful in 28s
Release / Release (push) Successful in 1m18s

This commit is contained in:
my_ong 2024-12-19 11:04:59 +08:00
parent e390000c9b
commit 9af5995d65
6 changed files with 80 additions and 43 deletions

View File

@ -1,39 +1,37 @@
/**
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
import type { AxiosResponse } from 'axios';
import type { IPage } from '@/api/api';
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
import type { IPage } from '@/api/api'
export interface Params {
/** 页码 */
page?: number;
/** 页面大小 */
size?: number;
/** 盘点类型 */
auditType?: 'ALL' | 'PARTIAL';
/** 盘点人 */
taker?: string;
/** 创建日期 */
createDate?: string;
/** 审核状态 */
reviewResults?: Array<
'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
>;
/** 页码 */
page?: number
/** 页面大小 */
size?: number
/** 盘点类型 */
auditType?: 'ALL' | 'PARTIAL'
/** 盘点人 */
taker?: string
/** 创建日期 */
createDate?: string
/** 审核状态 */
reviewResults?: Array<'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'>
}
export default async function (
params: Params,
success: (data: IPage<material.ApplyForm>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
params: Params,
success: (data: IPage<material.ApplyForm>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/audit-applies`,
return http({
method: 'get',
url: `/audit-applies`,
params,
})
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
params,
})
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}

View File

@ -169,7 +169,7 @@
line-height: 28px;
}
@media (width <= 576px) {
@media (width <=576px) {
.content {
display: block;
}

View File

@ -6,7 +6,7 @@
<a-col :span="18">
<a-input-search
v-model:value="searchKey"
:placeholder="`请输入`"
:placeholder="`名称/编码/类型`"
allow-clear
enter-button
@search="loadData()"
@ -68,6 +68,10 @@
title: '物料编码',
dataIndex: 'code',
},
{
title: '物料类型',
dataIndex: 'type',
},
{
title: '申请人',
dataIndex: 'applicant',

View File

@ -6,7 +6,7 @@
<a-col :span="18">
<a-input-search
v-model:value="searchKey"
:placeholder="`请输入物料名称`"
placeholder="名称/编码/类型"
allow-clear
enter-button
@search="loadData()"

View File

@ -3,14 +3,38 @@
<!-- 页面操作栏 -->
<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 :span="6" style="width: 180px">
<a-date-picker
v-model:value="startDate"
:format="'YYYY-MM-DD HH:mm:ss'"
placeholder="开始日期大于"
style="width: 100%"
/>
</a-col>
<a-col :span="6" style="width: 180px">
<a-select
v-model:value="status"
placeholder="盘点状态"
:max-tag-count="1"
mode="multiple"
style="width: 100%"
>
<a-select-option value="WAIT_SCAN">待扫码</a-select-option>
<a-select-option value="WAIT_SUBMIT">待提交</a-select-option>
<a-select-option value="WAIT_REVIEW">待审核</a-select-option>
<a-select-option value="PASS">审核通过</a-select-option>
<a-select-option value="REJECT">退回</a-select-option>
</a-select>
</a-col>
<a-col :span="6" style="width: 180px">
<a-select v-model:value="auditType" :allow-clear="true" placeholder="盘点类型" style="width: 100%">
<a-select-option value="ALL">全部盘点</a-select-option>
<a-select-option value="PARTIAL">部分盘点</a-select-option>
</a-select>
</a-col>
<a-col :span="6">
<a-input-search v-model:value="taker" :placeholder="`盘点人`" allow-clear enter-button @search="loadData()" />
</a-col>
</a-row>
</template>
@ -77,14 +101,19 @@
import api from '@/api'
import { IPage } from '@/api/api'
import resultForm from '../stocktaking/result-form.vue'
import { Dayjs } from 'dayjs'
const applyIdRef = ref()
const searchKey = ref('')
const auditPage = ref<IPage<material.ApplyForm>>()
const loading = ref(false)
const confirmLoading = ref(false)
const reviewResult = ref<'PASS' | 'REJECT'>('PASS')
const remark = ref('')
//
const startDate = ref<Dayjs>()
const taker = ref('')
const status = ref<Array<'PASS' | 'REJECT' | 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW'>>()
const auditType = ref<'ALL' | 'PARTIAL'>()
//
const loadData = async (page = 1, size = 10) => {
@ -93,7 +122,13 @@
{
page: page,
size: size,
reviewResults: ['WAIT_SUBMIT', 'WAIT_SCAN', 'WAIT_REVIEW', 'PASS', 'REJECT'],
auditType: auditType.value,
//ISO 8601 YYYY-MM-DDTHH:mm:ss T
// LocalDateTime Z +/-HH:mm LocalDateTime
// ISO 8601 'Z'
createDate: startDate.value?.toISOString().replace('Z', '').slice(0, -1),
taker: taker.value,
reviewResults: status.value,
},
(data) => {
auditPage.value = data

View File

@ -56,7 +56,7 @@
开始扫码
</a-button>
<a-button
v-if="record.reviewResult === 'WAIT_SUBMIT' || record.reviewResult === 'WAIT_SCAN'"
v-if="record.reviewResult === 'WAIT_SUBMIT'"
type="link"
style="margin-left: 10px"
@click="showResultModal(record.id)"