add:开发
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BtcutpointivtBtIvtCutpointivtApi {
|
||||
/** 分切区缓存点位库存信息 */
|
||||
export interface BtIvtCutpointivt {
|
||||
pointCode?: string; // AGV点位编码
|
||||
pointName: string; // AGV点位名称
|
||||
trussPointCode1?: string; // 桁架点位编码1
|
||||
trussPointCode2?: string; // 桁架点位编码2
|
||||
qzzNo1: string; // 气胀轴编码1
|
||||
qzzNo2: string; // 气胀轴编码2
|
||||
upGx: string; // 上轴管芯
|
||||
downGx: string; // 下轴管芯
|
||||
pointType: string; // 点位类型,1-分切缓存位,2-分切对接位,3-套轴对接位,4-套轴缓存位
|
||||
productArea: string; // 生产区域
|
||||
sortSeq?: number; // 顺序号
|
||||
isUsed?: string; // 是否启用
|
||||
remark: string; // 备注
|
||||
pointStatus: string; // 点位状态
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询分切区缓存点位库存分页 */
|
||||
export function getBtIvtCutpointivtPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt>>(
|
||||
'/btcutpointivt/bt-ivt-cutpointivt/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询分切区缓存点位库存详情 */
|
||||
export function getBtIvtCutpointivt(id: number) {
|
||||
return requestClient.get<BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt>(
|
||||
`/btcutpointivt/bt-ivt-cutpointivt/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增分切区缓存点位库存 */
|
||||
export function createBtIvtCutpointivt(data: BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt) {
|
||||
return requestClient.post('/btcutpointivt/bt-ivt-cutpointivt/create', data);
|
||||
}
|
||||
|
||||
/** 修改分切区缓存点位库存 */
|
||||
export function updateBtIvtCutpointivt(data: BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt) {
|
||||
return requestClient.put('/btcutpointivt/bt-ivt-cutpointivt/update', data);
|
||||
}
|
||||
|
||||
/** 删除分切区缓存点位库存 */
|
||||
export function deleteBtIvtCutpointivt(id: number) {
|
||||
return requestClient.delete(`/btcutpointivt/bt-ivt-cutpointivt/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除分切区缓存点位库存 */
|
||||
export function deleteBtIvtCutpointivtList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/btcutpointivt/bt-ivt-cutpointivt/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出分切区缓存点位库存 */
|
||||
export function exportBtIvtCutpointivt(params: any) {
|
||||
return requestClient.download('/btcutpointivt/bt-ivt-cutpointivt/export-excel', { params });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CutpointivtIvtCutpointivtApi {
|
||||
/** 分切区点位库存信息 */
|
||||
export interface IvtCutpointivt {
|
||||
pointCode?: string; // 点位编码
|
||||
fullPointCode: string; // 满轴位编码
|
||||
fullPointStatus?: string; // 满轴位状态
|
||||
containerName: string; // 母卷号
|
||||
fullVehicleCode: string; // 母卷轴编码
|
||||
emptyPointCode: string; // 空轴位编码
|
||||
emptyPointStatus?: string; // 空轴位状态
|
||||
emptyVehicleCode: string; // 空轴编码
|
||||
productArea: string; // 生产区域
|
||||
pointLocation: string; // 位置
|
||||
upPointCode: string; // 分切下料位上轴点位
|
||||
downPointCode: string; // 分切下料位下轴点位
|
||||
sortSeq: number; // 顺序号
|
||||
isUsed: string; // 是否启用
|
||||
remark: string; // 备注
|
||||
createId: number; // 创建人
|
||||
createName: string; // 创建人姓名
|
||||
updateOptid: number; // 修改人
|
||||
updateOptname: string; // 修改人姓名
|
||||
plan: string; // 规划
|
||||
extCode: string; // 对应MES系统设备编码
|
||||
upQzzno: string; // 分切下料位上轴
|
||||
downQzzno: string; // 分切下料位下轴
|
||||
qzzGeneration: string; // 气胀轴代数
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询分切区点位库存分页 */
|
||||
export function getIvtCutpointivtPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CutpointivtIvtCutpointivtApi.IvtCutpointivt>>(
|
||||
'/cutpointivt/ivt-cutpointivt/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询分切区点位库存详情 */
|
||||
export function getIvtCutpointivt(id: number) {
|
||||
return requestClient.get<CutpointivtIvtCutpointivtApi.IvtCutpointivt>(
|
||||
`/cutpointivt/ivt-cutpointivt/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增分切区点位库存 */
|
||||
export function createIvtCutpointivt(data: CutpointivtIvtCutpointivtApi.IvtCutpointivt) {
|
||||
return requestClient.post('/cutpointivt/ivt-cutpointivt/create', data);
|
||||
}
|
||||
|
||||
/** 修改分切区点位库存 */
|
||||
export function updateIvtCutpointivt(data: CutpointivtIvtCutpointivtApi.IvtCutpointivt) {
|
||||
return requestClient.put('/cutpointivt/ivt-cutpointivt/update', data);
|
||||
}
|
||||
|
||||
/** 删除分切区点位库存 */
|
||||
export function deleteIvtCutpointivt(id: number) {
|
||||
return requestClient.delete(`/cutpointivt/ivt-cutpointivt/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除分切区点位库存 */
|
||||
export function deleteIvtCutpointivtList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/cutpointivt/ivt-cutpointivt/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出分切区点位库存 */
|
||||
export function exportIvtCutpointivt(params: any) {
|
||||
return requestClient.download('/cutpointivt/ivt-cutpointivt/export-excel', { params });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace IvtshafttubeivtIvtApi {
|
||||
/** 穿拔轴区点位库存信息 */
|
||||
export interface IvtShafttubeivt {
|
||||
pointCode?: string; // 点位编码
|
||||
pointName: string; // 点位名称
|
||||
qzzSize: string; // 气涨轴尺寸
|
||||
qzzGeneration: string; // 气涨轴代数
|
||||
tubeCode: string; // 纸管编码
|
||||
tubeName: string; // 纸管描述
|
||||
containerName: string; // 子卷号
|
||||
pointType: string; // 点位类型
|
||||
pointLocation: string; // 位置
|
||||
haveQzz: string; // 是否有轴
|
||||
isUsed: string; // 是否启用
|
||||
sortSeq: number; // 顺序号
|
||||
plan: string; // 规划
|
||||
parentCode: string; // 关联点位
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询穿拔轴区点位库存分页 */
|
||||
export function getIvtShafttubeivtPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<IvtshafttubeivtIvtApi.IvtShafttubeivt>>(
|
||||
'/ivtshafttubeivt/ivt-shafttubeivt/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询穿拔轴区点位库存详情 */
|
||||
export function getIvtShafttubeivt(id: number) {
|
||||
return requestClient.get<IvtshafttubeivtIvtApi.IvtShafttubeivt>(
|
||||
`/ivtshafttubeivt/ivt-shafttubeivt/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增穿拔轴区点位库存 */
|
||||
export function createIvtShafttubeivt(data: IvtshafttubeivtIvtApi.IvtShafttubeivt) {
|
||||
return requestClient.post('/ivtshafttubeivt/ivt-shafttubeivt/create', data);
|
||||
}
|
||||
|
||||
/** 修改穿拔轴区点位库存 */
|
||||
export function updateIvtShafttubeivt(data: IvtshafttubeivtIvtApi.IvtShafttubeivt) {
|
||||
return requestClient.put('/ivtshafttubeivt/ivt-shafttubeivt/update', data);
|
||||
}
|
||||
|
||||
/** 删除穿拔轴区点位库存 */
|
||||
export function deleteIvtShafttubeivt(id: number) {
|
||||
return requestClient.delete(`/ivtshafttubeivt/ivt-shafttubeivt/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除穿拔轴区点位库存 */
|
||||
export function deleteIvtShafttubeivtList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/ivtshafttubeivt/ivt-shafttubeivt/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出穿拔轴区点位库存 */
|
||||
export function exportIvtShafttubeivt(params: any) {
|
||||
return requestClient.download('/ivtshafttubeivt/ivt-shafttubeivt/export-excel', { params });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { BtcutpointivtBtIvtCutpointivtApi } from '#/api/lms/btivtcutpointivt';
|
||||
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: 'AGV点位编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入AGV点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointName',
|
||||
label: 'AGV点位名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入AGV点位名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'trussPointCode1',
|
||||
label: '桁架点位编码1 ',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入桁架点位编码1 ',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'trussPointCode2',
|
||||
label: '桁架点位编码2',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入桁架点位编码2',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'qzzNo1',
|
||||
label: '气胀轴编码1',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入气胀轴编码1',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'qzzNo2',
|
||||
label: '气胀轴编码2',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入气胀轴编码2',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'upGx',
|
||||
label: '上轴管芯',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入上轴管芯',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'downGx',
|
||||
label: '下轴管芯',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入下轴管芯',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointType',
|
||||
label: '点位类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [],
|
||||
placeholder: '请选择点位类型',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productArea',
|
||||
label: '生产区域',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入生产区域',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'sortSeq',
|
||||
label: '顺序号',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入顺序号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入是否启用',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入备注',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointStatus',
|
||||
label: '点位状态',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [],
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: 'AGV点位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入AGV点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointType',
|
||||
label: '点位类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择点位类型',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productArea',
|
||||
label: '生产区域',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入生产区域',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入是否启用',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createTime',
|
||||
label: '创建时间',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
...getRangePickerDefaultProps(),
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointStatus',
|
||||
label: '点位状态',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择点位状态',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions<BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt>['columns'] {
|
||||
return [
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'ivtId',
|
||||
title: '库存记录标识',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointCode',
|
||||
title: 'AGV点位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointName',
|
||||
title: 'AGV点位名称',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'trussPointCode1',
|
||||
title: '桁架点位编码1 ',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'trussPointCode2',
|
||||
title: '桁架点位编码2',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'qzzNo1',
|
||||
title: '气胀轴编码1',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'qzzNo2',
|
||||
title: '气胀轴编码2',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'upGx',
|
||||
title: '上轴管芯',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'downGx',
|
||||
title: '下轴管芯',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointType',
|
||||
title: '点位类型,1-分切缓存位,2-分切对接位,3-套轴对接位,4-套轴缓存位',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'productArea',
|
||||
title: '生产区域',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'sortSeq',
|
||||
title: '顺序号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'isUsed',
|
||||
title: '是否启用',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createId',
|
||||
title: '创建人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createName',
|
||||
title: '创建人姓名',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateOptid',
|
||||
title: '修改人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateOptname',
|
||||
title: '修改人姓名',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointStatus',
|
||||
title: '点位状态',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { BtcutpointivtBtIvtCutpointivtApi } from '#/api/lms/btivtcutpointivt';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteBtIvtCutpointivt,
|
||||
deleteBtIvtCutpointivtList,
|
||||
exportBtIvtCutpointivt,
|
||||
getBtIvtCutpointivtPage,
|
||||
} from '#/api/lms/btivtcutpointivt';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建分切区缓存点位库存 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑分切区缓存点位库存 */
|
||||
function handleEdit(row: BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除分切区缓存点位库存 */
|
||||
async function handleDelete(row: BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.id]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteBtIvtCutpointivt(row.id!);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 批量删除分切区缓存点位库存 */
|
||||
async function handleDeleteBatch() {
|
||||
await confirm($t('ui.actionMessage.deleteBatchConfirm'));
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deletingBatch'),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteBtIvtCutpointivtList(checkedIds.value);
|
||||
checkedIds.value = [];
|
||||
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
async function handleExport() {
|
||||
const data = await exportBtIvtCutpointivt(await gridApi.formApi.getValues());
|
||||
downloadFileFromBlobPart({ fileName: '分切区缓存点位库存.xls', source: data });
|
||||
}
|
||||
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getBtIvtCutpointivtPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt>,
|
||||
gridEvents: {
|
||||
checkboxAll: handleRowCheckboxChange,
|
||||
checkboxChange: handleRowCheckboxChange,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="handleRefresh" />
|
||||
<Grid table-title="分切区缓存点位库存列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['分切区缓存点位库存']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['btcutpointivt:bt-ivt-cutpointivt:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.export'),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.DOWNLOAD,
|
||||
auth: ['btcutpointivt:bt-ivt-cutpointivt:export'],
|
||||
onClick: handleExport,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.deleteBatch'),
|
||||
type: 'primary',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['btcutpointivt:bt-ivt-cutpointivt:delete'],
|
||||
disabled: isEmpty(checkedIds),
|
||||
onClick: handleDeleteBatch,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['btcutpointivt:bt-ivt-cutpointivt:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['btcutpointivt:bt-ivt-cutpointivt:delete'],
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.id]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -0,0 +1,82 @@
|
||||
<script lang="ts" setup>
|
||||
import type { BtcutpointivtBtIvtCutpointivtApi } from '#/api/lms/btivtcutpointivt';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createBtIvtCutpointivt, getBtIvtCutpointivt, updateBtIvtCutpointivt } from '#/api/lms/btivtcutpointivt';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['分切区缓存点位库存'])
|
||||
: $t('ui.actionTitle.create', ['分切区缓存点位库存']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 80,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt;
|
||||
try {
|
||||
await (formData.value?.id ? updateBtIvtCutpointivt(data) : createBtIvtCutpointivt(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<BtcutpointivtBtIvtCutpointivtApi.BtIvtCutpointivt>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getBtIvtCutpointivt(data.id);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
@@ -0,0 +1,421 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { CutpointivtIvtCutpointivtApi } from '#/api/lms/cutpointivt/ivtcutpointivt';
|
||||
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'ivtId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'fullPointCode',
|
||||
label: '满轴位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入满轴位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'fullPointStatus',
|
||||
label: '满轴位状态',
|
||||
rules: 'required',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [],
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'containerName',
|
||||
label: '母卷号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入母卷号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'fullVehicleCode',
|
||||
label: '母卷轴编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入母卷轴编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'emptyPointCode',
|
||||
label: '空轴位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入空轴位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'emptyPointStatus',
|
||||
label: '空轴位状态',
|
||||
rules: 'required',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [],
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'emptyVehicleCode',
|
||||
label: '空轴编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入空轴编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productArea',
|
||||
label: '生产区域',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入生产区域',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointLocation',
|
||||
label: '位置',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入位置',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'upPointCode',
|
||||
label: '分切下料位上轴点位',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入分切下料位上轴点位',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'downPointCode',
|
||||
label: '分切下料位下轴点位',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入分切下料位下轴点位',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'sortSeq',
|
||||
label: '顺序号',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入顺序号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入是否启用',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入备注',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createId',
|
||||
label: '创建人',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入创建人',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createName',
|
||||
label: '创建人姓名',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入创建人姓名',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'updateOptid',
|
||||
label: '修改人',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入修改人',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'updateOptname',
|
||||
label: '修改人姓名',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入修改人姓名',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'plan',
|
||||
label: '规划',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入规划',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'extCode',
|
||||
label: '对应MES系统设备编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入对应MES系统设备编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'upQzzno',
|
||||
label: '分切下料位上轴',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入分切下料位上轴',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'downQzzno',
|
||||
label: '分切下料位下轴',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入分切下料位下轴',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'qzzGeneration',
|
||||
label: '气胀轴代数',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入气胀轴代数',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'fullPointStatus',
|
||||
label: '满轴位状态',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择满轴位状态',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'emptyPointStatus',
|
||||
label: '空轴位状态',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择空轴位状态',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productArea',
|
||||
label: '生产区域',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入生产区域',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入是否启用',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions<CutpointivtIvtCutpointivtApi.IvtCutpointivt>['columns'] {
|
||||
return [
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'ivtId',
|
||||
title: '库存记录标识',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointCode',
|
||||
title: '点位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'fullPointCode',
|
||||
title: '满轴位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'fullPointStatus',
|
||||
title: '满轴位状态',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'containerName',
|
||||
title: '母卷号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'fullVehicleCode',
|
||||
title: '母卷轴编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'emptyPointCode',
|
||||
title: '空轴位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'emptyPointStatus',
|
||||
title: '空轴位状态',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'emptyVehicleCode',
|
||||
title: '空轴编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'productArea',
|
||||
title: '生产区域',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointLocation',
|
||||
title: '位置',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'upPointCode',
|
||||
title: '分切下料位上轴点位',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'downPointCode',
|
||||
title: '分切下料位下轴点位',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'sortSeq',
|
||||
title: '顺序号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'isUsed',
|
||||
title: '是否启用',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createId',
|
||||
title: '创建人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createName',
|
||||
title: '创建人姓名',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateOptid',
|
||||
title: '修改人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateOptname',
|
||||
title: '修改人姓名',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'plan',
|
||||
title: '规划',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'extCode',
|
||||
title: '对应MES系统设备编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'upQzzno',
|
||||
title: '分切下料位上轴',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'downQzzno',
|
||||
title: '分切下料位下轴',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'qzzGeneration',
|
||||
title: '气胀轴代数',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { CutpointivtIvtCutpointivtApi } from '../../../../api/lms/cutpointivt';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteIvtCutpointivt,
|
||||
deleteIvtCutpointivtList,
|
||||
exportIvtCutpointivt,
|
||||
getIvtCutpointivtPage,
|
||||
} from '../../../../api/lms/cutpointivt';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建分切区点位库存 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑分切区点位库存 */
|
||||
function handleEdit(row: CutpointivtIvtCutpointivtApi.IvtCutpointivt) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除分切区点位库存 */
|
||||
async function handleDelete(row: CutpointivtIvtCutpointivtApi.IvtCutpointivt) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.id]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteIvtCutpointivt(row.id!);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 批量删除分切区点位库存 */
|
||||
async function handleDeleteBatch() {
|
||||
await confirm($t('ui.actionMessage.deleteBatchConfirm'));
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deletingBatch'),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteIvtCutpointivtList(checkedIds.value);
|
||||
checkedIds.value = [];
|
||||
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: CutpointivtIvtCutpointivtApi.IvtCutpointivt[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
async function handleExport() {
|
||||
const data = await exportIvtCutpointivt(await gridApi.formApi.getValues());
|
||||
downloadFileFromBlobPart({ fileName: '分切区点位库存.xls', source: data });
|
||||
}
|
||||
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getIvtCutpointivtPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<CutpointivtIvtCutpointivtApi.IvtCutpointivt>,
|
||||
gridEvents: {
|
||||
checkboxAll: handleRowCheckboxChange,
|
||||
checkboxChange: handleRowCheckboxChange,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="handleRefresh" />
|
||||
<Grid table-title="分切区点位库存列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['分切区点位库存']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['cutpointivt:ivt-cutpointivt:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.export'),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.DOWNLOAD,
|
||||
auth: ['cutpointivt:ivt-cutpointivt:export'],
|
||||
onClick: handleExport,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.deleteBatch'),
|
||||
type: 'primary',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['cutpointivt:ivt-cutpointivt:delete'],
|
||||
disabled: isEmpty(checkedIds),
|
||||
onClick: handleDeleteBatch,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['cutpointivt:ivt-cutpointivt:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['cutpointivt:ivt-cutpointivt:delete'],
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.id]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -0,0 +1,82 @@
|
||||
<script lang="ts" setup>
|
||||
import type { CutpointivtIvtCutpointivtApi } from '../../../../../api/lms/cutpointivt';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createIvtCutpointivt, getIvtCutpointivt, updateIvtCutpointivt } from '../../../../../api/lms/cutpointivt';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<CutpointivtIvtCutpointivtApi.IvtCutpointivt>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['分切区点位库存'])
|
||||
: $t('ui.actionTitle.create', ['分切区点位库存']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 80,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as CutpointivtIvtCutpointivtApi.IvtCutpointivt;
|
||||
try {
|
||||
await (formData.value?.id ? updateIvtCutpointivt(data) : createIvtCutpointivt(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<CutpointivtIvtCutpointivtApi.IvtCutpointivt>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getIvtCutpointivt(data.id);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
@@ -0,0 +1,275 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { IvtshafttubeivtIvtApi } from '#/api/lms/ivtshafttubeivt';
|
||||
|
||||
import {DICT_TYPE} from "@vben/constants";
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import {z} from "#/adapter/form";
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointName',
|
||||
label: '点位名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入点位名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'qzzSize',
|
||||
label: '气涨轴尺寸',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入气涨轴尺寸',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'qzzGeneration',
|
||||
label: '气涨轴代数',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入气涨轴代数',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'tubeCode',
|
||||
label: '纸管编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入纸管编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'tubeName',
|
||||
label: '纸管描述',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入纸管描述',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'containerName',
|
||||
label: '子卷号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入子卷号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointType',
|
||||
label: '点位类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [],
|
||||
placeholder: '请选择点位类型',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointLocation',
|
||||
label: '位置',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入位置',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'haveQzz',
|
||||
label: '是否有轴',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入是否有轴',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'isUsed',
|
||||
label: '是否启用',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入是否启用',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'sortSeq',
|
||||
label: '顺序号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入顺序号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'plan',
|
||||
label: '规划',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入规划',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'parentCode',
|
||||
label: '关联点位',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入关联点位',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointType',
|
||||
label: '点位类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: [],
|
||||
placeholder: '请选择点位类型',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions<IvtshafttubeivtIvtShafttubeivtApi.IvtShafttubeivt>['columns'] {
|
||||
return [
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'ivtId',
|
||||
title: '库存记录标识',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointCode',
|
||||
title: '点位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointName',
|
||||
title: '点位名称',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'qzzSize',
|
||||
title: '气涨轴尺寸',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'qzzGeneration',
|
||||
title: '气涨轴代数',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'tubeCode',
|
||||
title: '纸管编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'tubeName',
|
||||
title: '纸管描述',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'containerName',
|
||||
title: '子卷号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointType',
|
||||
title: '点位类型',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointLocation',
|
||||
title: '位置',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'haveQzz',
|
||||
title: '是否有轴',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'isUsed',
|
||||
title: '是否启用',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'sortSeq',
|
||||
title: '顺序号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createId',
|
||||
title: '创建人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createName',
|
||||
title: '创建人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateOptid',
|
||||
title: '修改人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateOptname',
|
||||
title: '修改人',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'plan',
|
||||
title: '规划',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'parentCode',
|
||||
title: '关联点位',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { IvtshafttubeivtIvtApi } from '#/api/lms/ivtshafttubeivt';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteIvtShafttubeivt,
|
||||
deleteIvtShafttubeivtList,
|
||||
exportIvtShafttubeivt,
|
||||
getIvtShafttubeivtPage,
|
||||
}
|
||||
from '#/api/lms/ivtshafttubeivt';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建穿拔轴区点位库存 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑穿拔轴区点位库存 */
|
||||
function handleEdit(row: IvtshafttubeivtIvtApi.IvtShafttubeivt) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除穿拔轴区点位库存 */
|
||||
async function handleDelete(row: IvtshafttubeivtIvtApi.IvtShafttubeivt) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.id]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteIvtShafttubeivt(row.id!);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 批量删除穿拔轴区点位库存 */
|
||||
async function handleDeleteBatch() {
|
||||
await confirm($t('ui.actionMessage.deleteBatchConfirm'));
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deletingBatch'),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteIvtShafttubeivtList(checkedIds.value);
|
||||
checkedIds.value = [];
|
||||
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: IvtshafttubeivtIvtApi.IvtShafttubeivt[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
async function handleExport() {
|
||||
const data = await exportIvtShafttubeivt(await gridApi.formApi.getValues());
|
||||
downloadFileFromBlobPart({ fileName: '穿拔轴区点位库存.xls', source: data });
|
||||
}
|
||||
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getIvtShafttubeivtPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<IvtshafttubeivtIvtApi.IvtShafttubeivt>,
|
||||
gridEvents: {
|
||||
checkboxAll: handleRowCheckboxChange,
|
||||
checkboxChange: handleRowCheckboxChange,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="handleRefresh" />
|
||||
<Grid table-title="穿拔轴区点位库存列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['穿拔轴区点位库存']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['ivtshafttubeivt:ivt-shafttubeivt:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.export'),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.DOWNLOAD,
|
||||
auth: ['ivtshafttubeivt:ivt-shafttubeivt:export'],
|
||||
onClick: handleExport,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.deleteBatch'),
|
||||
type: 'primary',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['ivtshafttubeivt:ivt-shafttubeivt:delete'],
|
||||
disabled: isEmpty(checkedIds),
|
||||
onClick: handleDeleteBatch,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['ivtshafttubeivt:ivt-shafttubeivt:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['ivtshafttubeivt:ivt-shafttubeivt:delete'],
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.id]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -0,0 +1,82 @@
|
||||
<script lang="ts" setup>
|
||||
import type { IvtshafttubeivtIvtApi } from '#/api/lms/ivtshafttubeivt';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createIvtShafttubeivt, getIvtShafttubeivt, updateIvtShafttubeivt } from '#/api/lms/ivtshafttubeivt';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<IvtshafttubeivtIvtApi.IvtShafttubeivt>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.ivtId
|
||||
? $t('ui.actionTitle.edit', ['穿拔轴区点位库存'])
|
||||
: $t('ui.actionTitle.create', ['穿拔轴区点位库存']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 80,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as IvtshafttubeivtIvtApi.IvtShafttubeivt;
|
||||
try {
|
||||
await (formData.value?.id ? updateIvtShafttubeivt(data) : createIvtShafttubeivt(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<IvtshafttubeivtIvtApi.IvtShafttubeivt>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getIvtShafttubeivt(data.id);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
Reference in New Issue
Block a user