🎨 修改页面逻辑

This commit is contained in:
my_ong 2024-12-06 18:06:59 +08:00
parent b2efb54608
commit deb566c209
19 changed files with 346 additions and 534 deletions

View File

@ -3437,8 +3437,8 @@
]
},
{
"description": "增加/编辑申请单",
"name": "saveOrUpdateApply",
"description": "提交申请单",
"name": "saveApply",
"method": "put",
"path": "/apply",
"response": {
@ -3704,120 +3704,6 @@
]
}
]
},
{
"description": "盘点管理",
"name": "stocktaking",
"interfaces": [
{
"description": "增加/编辑盘点",
"name": "saveOrUpdateStocktaking",
"method": "put",
"path": "/stocktaking",
"response": {
"typeArgs": [],
"typeName": "Stocktaking",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"required": true,
"in": "body",
"name": "requestBody",
"dataType": {
"typeArgs": [],
"typeName": "Stocktaking",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "分页查询盘点列表",
"name": "stocktakingList",
"method": "get",
"path": "/stocktaking-list",
"response": {
"typeArgs": [],
"typeName": "IPageStocktaking",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"description": "页码",
"required": false,
"in": "query",
"name": "page",
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "页面大小",
"required": false,
"in": "query",
"name": "size",
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "类型",
"required": false,
"in": "query",
"name": "type",
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "搜索关键词",
"required": false,
"in": "query",
"name": "key",
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
}
]
}
],
"name": "material",
@ -3939,7 +3825,7 @@
]
},
{
"description": "入库/出库 申请单",
"description": "入库/出库/盘点 申请单",
"name": "ApplyForm",
"templateArgs": [],
"properties": [
@ -3971,6 +3857,36 @@
"description": "申请日期",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ALL'",
"'PARTIAL'"
],
"typeProperties": []
},
"name": "auditType",
"description": "盘点类型1: 全盘 2: 部分盘点)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "Codebook",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "auditTypeInfo",
"required": false
},
{
"dataType": {
"typeArgs": [],
@ -3994,8 +3910,40 @@
"enum": [],
"typeProperties": []
},
"name": "exceptionExplain",
"description": "异常说明",
"name": "exception",
"description": "异常原因",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'NO_ACTION'",
"'IGNORE_AND_SAVE'",
"'REPLENISH'",
"'OTHER'"
],
"typeProperties": []
},
"name": "handle",
"description": "处理方式(0-无需处理 1-忽略并修改库存 2-补充库存 3-其他)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "Codebook",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "handleInfo",
"required": false
},
{
@ -4022,21 +3970,53 @@
"typeProperties": []
},
"name": "isConfirm",
"description": "是否确认",
"description": "是否确认0: 未确认 1: 已确认)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "result",
"description": "结果(系统自动生成)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'PURCHASE_RECEIPT'",
"'RETURN_RECEIPT'",
"'LOAN_OUT'",
"'AUDIT'"
],
"typeProperties": []
},
"name": "type",
"description": "类型",
"description": "类型1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "Codebook",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "typeInfo",
"required": false
},
{
@ -4080,6 +4060,7 @@
"typeProperties": []
},
"name": "applyDetails",
"description": "申请单明细",
"required": false
},
{
@ -4094,6 +4075,79 @@
},
"name": "applyForm",
"required": false
},
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "MaterialStockDetail",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "detailList",
"description": "扫码的条码集合",
"required": false
}
]
},
{
"description": "枚举码本",
"name": "Codebook",
"templateArgs": [],
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "code",
"description": "码本编码",
"required": true
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "description",
"description": "码本名称",
"required": true
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "name",
"description": "码本值",
"required": true
}
]
},
@ -4294,87 +4348,6 @@
}
]
},
{
"name": "IPageStocktaking",
"templateArgs": [],
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "current",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "pages",
"required": false
},
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "Stocktaking",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "records",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "size",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "total",
"required": false
}
]
},
{
"description": "物料信息",
"name": "Material",
@ -4383,15 +4356,31 @@
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'LOW_VALUE'",
"'HIGH_VALUE'"
],
"typeProperties": []
},
"name": "assignRule",
"description": "赋码规则(0-低值易耗品(不参与赋码) 1-高价值工具类(参与唯一赋码)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "Codebook",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "assignRule",
"description": "赋码规则",
"name": "assignRuleInfo",
"required": false
},
{
@ -4520,10 +4509,38 @@
]
},
{
"description": "盘点信息",
"name": "Stocktaking",
"description": "物料明细数据表",
"name": "MaterialStockDetail",
"templateArgs": [],
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "applyId",
"description": "入库申请单",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "barcode",
"description": "条码",
"required": false
},
{
"dataType": {
"typeArgs": [],
@ -4537,48 +4554,6 @@
"name": "createdTime",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "date",
"description": "盘点日期",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "exception",
"description": "异常原因",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "exceptionHandle",
"description": "异常情况处理方式",
"required": false
},
{
"dataType": {
"typeArgs": [],
@ -4592,62 +4567,6 @@
"name": "id",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "operator",
"description": "盘点人",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "result",
"description": "盘点结果(系统自动生成)",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"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": [],
@ -4658,22 +4577,39 @@
"enum": [],
"typeProperties": []
},
"name": "materialId",
"description": "物料ID",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'IN'",
"'OUT'",
"'OFF'"
],
"typeProperties": []
},
"name": "status",
"description": "盘点任务状态",
"description": "状态",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"typeName": "Codebook",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "type",
"description": "盘点类型",
"name": "statusInfo",
"required": false
},
{

View File

@ -29,7 +29,7 @@ declare namespace material {
}
/**
* /
* //
*/
export interface ApplyForm {
/** 申请人 */
@ -38,20 +38,38 @@ declare namespace material {
/** 申请日期 */
applyDate?: string;
/** 盘点类型1: 全盘 2: 部分盘点) */
auditType?: 'ALL' | 'PARTIAL';
/** auditTypeInfo */
auditTypeInfo?: material.Codebook;
/** createdTime */
createdTime?: string;
/** 异常说明 */
exceptionExplain?: string;
/** 异常原因 */
exception?: string;
/** 处理方式(0-无需处理 1-忽略并修改库存 2-补充库存 3-其他) */
handle?: 'NO_ACTION' | 'IGNORE_AND_SAVE' | 'REPLENISH' | 'OTHER';
/** handleInfo */
handleInfo?: material.Codebook;
/** id */
id?: number;
/** 是否确认 */
/** 是否确认0: 未确认 1: 已确认) */
isConfirm?: boolean;
/** 类型 */
type?: number;
/** 结果(系统自动生成) */
result?: string;
/** 类型1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请) */
type?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT';
/** typeInfo */
typeInfo?: material.Codebook;
/** updatedTime */
updatedTime?: string;
@ -61,19 +79,25 @@ declare namespace material {
*
*/
export interface ApplyInfo {
/** applyDetails */
/** 申请单明细 */
applyDetails?: Array<material.ApplyDetail>;
/** applyForm */
applyForm?: material.ApplyForm;
/** 扫码的条码集合 */
detailList?: Array<material.MaterialStockDetail>;
}
/**
*
*/
export interface Material {
/** 赋码规则 */
assignRule?: number;
/** 赋码规则(0-低值易耗品(不参与赋码) 1-高价值工具类(参与唯一赋码) */
assignRule?: 'LOW_VALUE' | 'HIGH_VALUE';
/** assignRuleInfo */
assignRuleInfo?: material.Codebook;
/** 编码 */
code?: string;
@ -104,41 +128,29 @@ declare namespace material {
}
/**
*
*
*/
export interface Stocktaking {
export interface MaterialStockDetail {
/** 入库申请单 */
applyId?: number;
/** 条码 */
barcode?: string;
/** createdTime */
createdTime?: string;
/** 盘点日期 */
date?: string;
/** 异常原因 */
exception?: string;
/** 异常情况处理方式 */
exceptionHandle?: string;
/** id */
id?: number;
/** 盘点人 */
operator?: string;
/** 物料ID */
materialId?: number;
/** 盘点结果(系统自动生成) */
result?: string;
/** 状态 */
status?: 'IN' | 'OUT' | 'OFF';
/** 盘点审核结果 */
reviewResult?: string;
/** 盘点审核人 */
reviewer?: string;
/** 盘点任务状态 */
status?: number;
/** 盘点类型 */
type?: number;
/** statusInfo */
statusInfo?: material.Codebook;
/** updatedTime */
updatedTime?: string;

View File

@ -3,11 +3,11 @@
*
*/
import applies from './applies';
import saveOrUpdateApply from './saveOrUpdateApply';
import saveApply from './saveApply';
import detail from './detail';
export default {
applies,
saveOrUpdateApply,
saveApply,
detail,
};

View File

@ -1,34 +0,0 @@
/**
* @desc
*/
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;
/** 搜索关键词 */
key?: string;
}
export default async function (
/** 类型 */
type: number,
params: Params,
success: (data: IPage<material.ApplyForm>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/apply/${type}`,
params,
})
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
}

View File

@ -1,5 +1,5 @@
/**
* @desc /
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
import type { AxiosResponse } from 'axios';

View File

@ -2,10 +2,7 @@ import apply from './apply';
import material from './material';
import stocktaking from './stocktaking';
export default {
apply,
material,
stocktaking,
};

View File

@ -1,21 +0,0 @@
/**
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
import type { AxiosResponse } from 'axios';
export default async function (
/** 物料id */
id: number,
success: (data: void) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'delete',
url: `/material/${id}`,
})
.then((data: AxiosResponse<void, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
}

View File

@ -1,11 +0,0 @@
/**
* @description
*
*/
import saveOrUpdateStocktaking from './saveOrUpdateStocktaking';
import stocktakingList from './stocktakingList';
export default {
saveOrUpdateStocktaking,
stocktakingList,
};

View File

@ -1,33 +0,0 @@
/**
* @desc
*/
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;
/** 类型 */
type?: number;
/** 搜索关键词 */
key?: string;
}
export default async function (
params: Params,
success: (data: IPage<material.Stocktaking>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/stocktaking-list`,
params,
})
.then((data: AxiosResponse<IPage<material.Stocktaking>, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
}

View File

@ -1,22 +0,0 @@
/**
* @desc /
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
import type { AxiosResponse } from 'axios';
export default async function (
/** 请求体 */
requestBody: material.Stocktaking,
success: (data: material.Stocktaking) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'put',
url: `/stocktaking`,
data: requestBody,
})
.then((data: AxiosResponse<material.Stocktaking, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
}

View File

@ -1,33 +0,0 @@
/**
* @desc
*/
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;
/** 类型 */
type?: number;
/** 搜索关键词 */
key?: string;
}
export default async function (
params: Params,
success: (data: IPage<material.Stocktaking>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/stocktaking-list`,
params,
})
.then((data: AxiosResponse<IPage<material.Stocktaking>, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
}

View File

@ -12,9 +12,17 @@
<vxe-column type="seq" width="70" />
<vxe-column field="id" title="物料id" :visible="false" />
<vxe-column field="name" title="物料名称" />
<vxe-column field="scan" title="是否扫码" />
<vxe-column field="assignRule" title="是否扫码">
<template #default="{ row }">
{{ row.assignRule === 'HIGH_VALUE' ? '是' : '否' }}
</template>
</vxe-column>
<vxe-column field="applyNum" title="申请数量" :edit-render="{ name: 'VxeInput', props: { type: 'integer' } }" />
<vxe-column field="scanNum" title="扫码数量" :edit-render="{ name: 'VxeInput', props: { type: 'integer' } }" />
<vxe-column field="scanNum" title="扫码数量" :edit-render="{ name: 'VxeInput', props: { type: 'integer' } }" >
<template #default="{ row }">
{{ row.assignRule === 'LOW_VALUE' ? '~' : row.scanNum }}
</template>
</vxe-column>
<vxe-column field="remark" title="备注" :edit-render="{ name: 'VxeInput' }" />
<vxe-column title="操作">
@ -63,7 +71,7 @@
interface RowVO {
id: number
name: string
scan: string
assignRule: string
applyNum: number
scanNum: number
remark: string

View File

@ -8,9 +8,9 @@
<a-form-item label="申请类型" name="applyType">
<a-radio-group v-model:value="formData.applyType" button-style="solid" style="width: 40%;">
<a-radio-button value='1' v-if="applyType === '1'">采购入库</a-radio-button>
<a-radio-button value='2' v-if="applyType === '1'">归还入库</a-radio-button>
<a-radio-button value='3' v-if="applyType === '3'">出库外借</a-radio-button>
<a-radio-button value='1' v-if="applyType === 'PURCHASE_RECEIPT'">采购入库</a-radio-button>
<a-radio-button value='2' v-if="applyType === 'RETURN_RECEIPT'">归还入库</a-radio-button>
<a-radio-button value='3' v-if="applyType === 'LOAN_OUT'">出库外借</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item label="申请日期" name="applyDate" style="width: 40%;">
@ -18,8 +18,7 @@
</a-form-item>
<a-form-item label="选择物料" name="selected">
<a-select v-model:value="formData.slectedList" mode="multiple" bordered placeholder="请选择物料" style="width: 40%;"
show-search :options="options" @deselect="removeEvent"
@select="insertEvent"></a-select>
show-search :options="options" @deselect="removeEvent" @select="insertEvent"></a-select>
</a-form-item>
</a-form>
</div>
@ -34,7 +33,11 @@
<vxe-column field="code" title="编码" />
<vxe-column field="spec" title="规格" />
<vxe-column field="type" title="类型" />
<vxe-column field="assignRule" title="赋码规则" />
<vxe-column field="assignRule" title="是否赋码">
<template #default="{ row }">
{{ row.assignRule === 'HIGH_VALUE' ? '是' : '否' }}
</template>
</vxe-column>
<vxe-column field="quantity" title="申请数量(点击修改)" :edit-render="{ name: 'input', autoSelect: true }"
keyboard-config="{edit: true, del: true}" cell-type="number">
<template #edit="{ row }">
@ -77,7 +80,7 @@ const getApplyForm = () => {
applicant: formData.value.applicant,
applyDate: formData.value.applyDate.format('YYYY-MM-DD HH:mm:ss'),
isConfirm: true,
exceptionExplain: ''
result: ''
}
}
defineExpose({ getTableData, getApplyForm })
@ -93,7 +96,7 @@ const userStore = useUserStore()
const formData = ref<FormData>({
applicant: userStore.userName,
applyDate: dayjs(),
applyType: props.applyType, // 1: 2: 3:
applyType: props.applyType,
slectedList: []
});
@ -155,7 +158,7 @@ const insertEvent = (value: any) => {
}
// table
const removeEvent = (value : any) => {
const removeEvent = (value: any) => {
const $table = tableRef.value
// value
if ($table) {

View File

@ -43,7 +43,7 @@
type: String,
default: '',
},
}, // applyType使121: 2:
}, // PURCHASE_RECEIPT , RETURN_RECEIPT , LOAN_OUT , AUDIT
)
// steps
const current = ref<number>(0) //
@ -52,7 +52,6 @@
const applyConfirmRef = ref() // step3
const selectData = ref() // step1,
const scanData = ref() // step2
const totalValue = ref(0) //
const conformData = ref<Array<object>>([]) // step3
const loading = ref(false) // loading
@ -64,10 +63,11 @@
*/
const nextStep = () => {
if (applyFormRef.value && current.value === 0) {
totalValue.value = 0
// step1step1
selectData.value = applyFormRef.value.getTableData()
selectData.value.forEach((item) => {
if (item.assignRule === 1) {
if (item.assignRule === 'HIGH_VALUE') {
totalValue.value += item.quantity
}
})
@ -82,7 +82,6 @@
acc[item.code]++
return acc
}, {})
scanData.value = items
//
conformData.value = selectData.value.map((item) => {
return {
@ -90,12 +89,13 @@
name: item.name,
code: item.code,
applyNum: item.quantity,
scan: item.assignRule,
assignRule: item.assignRule,
scanNum: groupedSums[item.code] || 0,
remark: item.quantity != groupedSums[item.code] ? `实际扫码数量与申请数量不一致` : '',
remark: (item.quantity != groupedSums[item.code] && item.assignRule === 'HIGH_VALUE') ? `数量不一致` : '',
}
})
}
//
current.value++
}
@ -110,7 +110,9 @@
//
const applyDetails = applyConfirmRef.value.getTableData() //
const applyForm = applyFormRef.value.getApplyForm() //
api.materialApi.apply.saveOrUpdateApply({ applyForm: applyForm, applyDetails: applyDetails }, () => {
const detailList = scanFormRef.value.getTableData() //
api.materialApi.apply.saveApply({ applyForm: applyForm, applyDetails: applyDetails, detailList: detailList }, () => {
console.log('申请成功')
//
loading.value = false

View File

@ -53,7 +53,9 @@ const getTableData = () => {
const $table = applyDetailTableRef.value
if ($table) {
return $table.getTableData().fullData.map(item => ({
sn: item.barcode,
assignRule: item.assignRule,
materialId: item.id,
barcode: item.barcode,
code: item.code,
date: item.times
}))
@ -92,6 +94,7 @@ getCache();
interface TableRowVO {
id: number
barcode: string
assignRule: string
name: string
code: string
spec: string
@ -107,6 +110,11 @@ const removeStep2Row = async (row: TableRowVO) => {
const $table = applyDetailTableRef.value
if ($table) {
$table.remove(row)
//sn
snListCache.value = snListCache.value.filter(item => item!== row.barcode)
// -1
remainderValue.value = remainderValue.value - 1
}
}
@ -150,6 +158,7 @@ const autoInsertOneRow = async () => {
const row: TableRowVO = {
id: materialInfo?.id ?? 0,
barcode: sn,
assignRule: materialInfo?.assignRule ?? '',
name: materialInfo?.name ?? '',
code: materialInfo?.code ?? '',
spec: materialInfo?.spec ?? '',

View File

@ -1,5 +1,5 @@
<template>
<apply-modal apply-type='1'></apply-modal>
<apply-modal apply-type='PURCHASE_RECEIPT'></apply-modal>
</template>
<script setup lang="ts">

View File

@ -85,7 +85,7 @@ export const formItems: FormItem[] = [
size: 'default',
controls: true,
placeholder: '请填写赋码规则',
options: [{ label: '低值易耗品', value: 2 }, { label: '高价值工具类', value: 1 }]
options: [{ label: '低值易耗品', value: 'LOW_VALUE' }, { label: '高价值工具类', value: 'HIGH_VALUE' }]
},
rules: [],

View File

@ -35,8 +35,8 @@
>
<!-- 操作按钮列 -->
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'assignRule'">
{{ record.assignRule === 1 ? '高价值工具类' : '低值易耗品' }} <!-- 这里定义为0和10再回显的时候不展示-->
<template v-if="column.dataIndex === 'assignRule'">
{{ record.assignRule === 'HIGH_VALUE' ? '高价值工具类' : '低值易耗品' }}
</template>
<template v-if="column.dataIndex === 'operation'">
<a-button type="link" :style="{ color: token.colorPrimary }" @click="addOrEdit(record)">
@ -60,7 +60,7 @@
</template>
删除
</a-button>
</a-popconfirm>
</a-popconfirm>
</template>
</template>
</a-table>
@ -190,7 +190,6 @@
//
const doSave = (_data: FormDataType) => {
window.console.log(_data)
api.materialApi.material.saveOrUpdateMaterial(_data as unknown as material.Material, () => {
formDrawer.value?.close()
notification.success({
@ -201,7 +200,7 @@
},
})
});
}
//

View File

@ -1,5 +1,5 @@
<template>
<apply-modal apply-type='3'></apply-modal>
<apply-modal apply-type='LOAN_OUT'></apply-modal>
</template>
<script setup lang="ts">