bug: 盘点功能的条件查询
This commit is contained in:
parent
e390000c9b
commit
9af5995d65
@ -1,39 +1,37 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 分页查询盘点列表
|
* @desc 分页查询盘点列表
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
||||||
import type { AxiosResponse } from 'axios';
|
import type { AxiosResponse } from 'axios'
|
||||||
import type { IPage } from '@/api/api';
|
import type { IPage } from '@/api/api'
|
||||||
export interface Params {
|
export interface Params {
|
||||||
/** 页码 */
|
/** 页码 */
|
||||||
page?: number;
|
page?: number
|
||||||
/** 页面大小 */
|
/** 页面大小 */
|
||||||
size?: number;
|
size?: number
|
||||||
/** 盘点类型 */
|
/** 盘点类型 */
|
||||||
auditType?: 'ALL' | 'PARTIAL';
|
auditType?: 'ALL' | 'PARTIAL'
|
||||||
/** 盘点人 */
|
/** 盘点人 */
|
||||||
taker?: string;
|
taker?: string
|
||||||
/** 创建日期 */
|
/** 创建日期 */
|
||||||
createDate?: string;
|
createDate?: string
|
||||||
/** 审核状态 */
|
/** 审核状态 */
|
||||||
reviewResults?: Array<
|
reviewResults?: Array<'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'>
|
||||||
'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
|
||||||
>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function (
|
export default async function (
|
||||||
params: Params,
|
params: Params,
|
||||||
success: (data: IPage<material.ApplyForm>) => void = defaultSuccess,
|
success: (data: IPage<material.ApplyForm>) => void = defaultSuccess,
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
fail: (error: { code: string; error?: string }) => void = defaultError,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
return http({
|
return http({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/audit-applies`,
|
url: `/audit-applies`,
|
||||||
|
|
||||||
params,
|
params,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
|
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
|
||||||
success(data.data);
|
success(data.data)
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error));
|
.catch((error: { code: string; error?: string }) => fail(error))
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (width <= 576px) {
|
@media (width <=576px) {
|
||||||
.content {
|
.content {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<a-col :span="18">
|
<a-col :span="18">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
:placeholder="`请输入`"
|
:placeholder="`名称/编码/类型`"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
@search="loadData()"
|
@search="loadData()"
|
||||||
@ -68,6 +68,10 @@
|
|||||||
title: '物料编码',
|
title: '物料编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '物料类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '申请人',
|
title: '申请人',
|
||||||
dataIndex: 'applicant',
|
dataIndex: 'applicant',
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<a-col :span="18">
|
<a-col :span="18">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
:placeholder="`请输入物料名称`"
|
placeholder="名称/编码/类型"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
@search="loadData()"
|
@search="loadData()"
|
||||||
|
@ -3,14 +3,38 @@
|
|||||||
<!-- 页面操作栏 -->
|
<!-- 页面操作栏 -->
|
||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="18">
|
<a-col :span="6" style="width: 180px">
|
||||||
<a-input-search
|
<a-date-picker
|
||||||
v-model:value="searchKey"
|
v-model:value="startDate"
|
||||||
:placeholder="`请输入`"
|
:format="'YYYY-MM-DD HH:mm:ss'"
|
||||||
allow-clear
|
placeholder="开始日期大于"
|
||||||
enter-button
|
style="width: 100%"
|
||||||
@search="loadData()"
|
/>
|
||||||
></a-input-search>
|
</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-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
@ -77,14 +101,19 @@
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { IPage } from '@/api/api'
|
import { IPage } from '@/api/api'
|
||||||
import resultForm from '../stocktaking/result-form.vue'
|
import resultForm from '../stocktaking/result-form.vue'
|
||||||
|
import { Dayjs } from 'dayjs'
|
||||||
|
|
||||||
const applyIdRef = ref()
|
const applyIdRef = ref()
|
||||||
const searchKey = ref('')
|
|
||||||
const auditPage = ref<IPage<material.ApplyForm>>()
|
const auditPage = ref<IPage<material.ApplyForm>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const confirmLoading = ref(false)
|
const confirmLoading = ref(false)
|
||||||
const reviewResult = ref<'PASS' | 'REJECT'>('PASS')
|
const reviewResult = ref<'PASS' | 'REJECT'>('PASS')
|
||||||
const remark = ref('')
|
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) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
@ -93,7 +122,13 @@
|
|||||||
{
|
{
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
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) => {
|
(data) => {
|
||||||
auditPage.value = data
|
auditPage.value = data
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
开始扫码
|
开始扫码
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
v-if="record.reviewResult === 'WAIT_SUBMIT' || record.reviewResult === 'WAIT_SCAN'"
|
v-if="record.reviewResult === 'WAIT_SUBMIT'"
|
||||||
type="link"
|
type="link"
|
||||||
style="margin-left: 10px"
|
style="margin-left: 10px"
|
||||||
@click="showResultModal(record.id)"
|
@click="showResultModal(record.id)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user