bug: 盘点功能的条件查询
This commit is contained in:
parent
e390000c9b
commit
9af5995d65
@ -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))
|
||||
}
|
||||
|
@ -169,7 +169,7 @@
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
@media (width <= 576px) {
|
||||
@media (width <=576px) {
|
||||
.content {
|
||||
display: block;
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -6,7 +6,7 @@
|
||||
<a-col :span="18">
|
||||
<a-input-search
|
||||
v-model:value="searchKey"
|
||||
:placeholder="`请输入物料名称`"
|
||||
placeholder="名称/编码/类型"
|
||||
allow-clear
|
||||
enter-button
|
||||
@search="loadData()"
|
||||
|
@ -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
|
||||
|
@ -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)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user