Commit 6870f8fe by 金民

Merge remote-tracking branch 'origin/weiqiao-vue3' into hongshun

parents 258b8f99 9d5a680d
...@@ -15,6 +15,8 @@ export interface MesWarehouseArrivedPageParams extends BasicPageParams { ...@@ -15,6 +15,8 @@ export interface MesWarehouseArrivedPageParams extends BasicPageParams {
ywzz: string; ywzz: string;
cspc: string; cspc: string;
pch: string;
} }
/** /**
...@@ -35,13 +37,15 @@ export interface MesWarehouseArrivedPageModel { ...@@ -35,13 +37,15 @@ export interface MesWarehouseArrivedPageModel {
ck: string; ck: string;
zdr: string;
ywzz: string; ywzz: string;
bz: string; bz: string;
cspc: string; cspc: string;
pch: string;
zdr: string;
} }
/** /**
...@@ -70,6 +74,8 @@ export interface MesWarehouseArrivedModel { ...@@ -70,6 +74,8 @@ export interface MesWarehouseArrivedModel {
cspc: string; cspc: string;
pch: string;
fj: string; fj: string;
bz: string; bz: string;
...@@ -131,6 +137,8 @@ export interface MesWarehouseArrivedInfoModel { ...@@ -131,6 +137,8 @@ export interface MesWarehouseArrivedInfoModel {
cspc: string; cspc: string;
pch: string;
sfzp: string; sfzp: string;
sfzj: string; sfzj: string;
......
import {
import { MesWarehouseInventoryPageModel, MesWarehouseInventoryPageParams, MesWarehouseInventoryPageResult } from './model/KcpdModel'; InventoryFilterParams,
InventoryItem,
MesWarehouseInventoryPageModel,
MesWarehouseInventoryPageParams,
MesWarehouseInventoryPageResult,
} from './model/KcpdModel';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
...@@ -8,16 +13,15 @@ enum Api { ...@@ -8,16 +13,15 @@ enum Api {
List = '/ckgl/kcpd/list', List = '/ckgl/kcpd/list',
Info = '/ckgl/kcpd/info', Info = '/ckgl/kcpd/info',
MesWarehouseInventory = '/ckgl/kcpd', MesWarehouseInventory = '/ckgl/kcpd',
Inventory = '/ckgl/kczb/Inventory',
Export = '/ckgl/kcpd/export', Export = '/ckgl/kcpd/export',
} }
/** export async function getMesWarehouseInventoryPage(
* @description: 查询MesWarehouseInventory分页列表 params: MesWarehouseInventoryPageParams,
*/ mode: ErrorMessageMode = 'modal',
export async function getMesWarehouseInventoryPage(params: MesWarehouseInventoryPageParams, mode: ErrorMessageMode = 'modal') { ) {
return defHttp.get<MesWarehouseInventoryPageResult>( return defHttp.get<MesWarehouseInventoryPageResult>(
{ {
url: Api.Page, url: Api.Page,
...@@ -44,10 +48,10 @@ export async function getMesWarehouseInventory(id: String, mode: ErrorMessageMod ...@@ -44,10 +48,10 @@ export async function getMesWarehouseInventory(id: String, mode: ErrorMessageMod
); );
} }
/** export async function addMesWarehouseInventory(
* @description: 新增MesWarehouseInventory mesWarehouseInventory: Recordable,
*/ mode: ErrorMessageMode = 'modal',
export async function addMesWarehouseInventory(mesWarehouseInventory: Recordable, mode: ErrorMessageMode = 'modal') { ) {
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.MesWarehouseInventory, url: Api.MesWarehouseInventory,
...@@ -59,10 +63,10 @@ export async function addMesWarehouseInventory(mesWarehouseInventory: Recordable ...@@ -59,10 +63,10 @@ export async function addMesWarehouseInventory(mesWarehouseInventory: Recordable
); );
} }
/** export async function updateMesWarehouseInventory(
* @description: 更新MesWarehouseInventory mesWarehouseInventory: Recordable,
*/ mode: ErrorMessageMode = 'modal',
export async function updateMesWarehouseInventory(mesWarehouseInventory: Recordable, mode: ErrorMessageMode = 'modal') { ) {
return defHttp.put<boolean>( return defHttp.put<boolean>(
{ {
url: Api.MesWarehouseInventory, url: Api.MesWarehouseInventory,
...@@ -89,11 +93,6 @@ export async function deleteMesWarehouseInventory(ids: string[], mode: ErrorMess ...@@ -89,11 +93,6 @@ export async function deleteMesWarehouseInventory(ids: string[], mode: ErrorMess
); );
} }
/**
* @description: 导出MesWarehouseInventory
*/
export async function exportMesWarehouseInventory( export async function exportMesWarehouseInventory(
params?: object, params?: object,
mode: ErrorMessageMode = 'modal' mode: ErrorMessageMode = 'modal'
...@@ -112,3 +111,17 @@ export async function exportMesWarehouseInventory( ...@@ -112,3 +111,17 @@ export async function exportMesWarehouseInventory(
} }
export async function getInventoryByFilter(
params: InventoryFilterParams,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.post<{ data: InventoryItem[]; success: boolean; msg?: string; code?: number }>(
{
url: Api.Inventory,
data: params,
},
{
errorMessageMode: mode,
},
);
}
...@@ -4,11 +4,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; ...@@ -4,11 +4,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: MesWarehouseInventory分页参数 模型 * @description: MesWarehouseInventory分页参数 模型
*/ */
export interface MesWarehouseInventoryPageParams extends BasicPageParams { export interface MesWarehouseInventoryPageParams extends BasicPageParams {
ckwz: string; pdrq: string;
cplx: string; pdbh: string;
cp: string; zt: string;
} }
/** /**
...@@ -17,13 +17,11 @@ export interface MesWarehouseInventoryPageParams extends BasicPageParams { ...@@ -17,13 +17,11 @@ export interface MesWarehouseInventoryPageParams extends BasicPageParams {
export interface MesWarehouseInventoryPageModel { export interface MesWarehouseInventoryPageModel {
id: string; id: string;
ckwz: string; pdbh: string;
cplx: string;
cp: string; pdrq: string;
createDate: string; zt: string;
bz: string; bz: string;
} }
...@@ -42,6 +40,12 @@ export interface MesWarehouseInventoryModel { ...@@ -42,6 +40,12 @@ export interface MesWarehouseInventoryModel {
cp: string; cp: string;
pdrq: string;
pdbh: string;
zt: string;
bz: string; bz: string;
p1: string; p1: string;
...@@ -125,6 +129,8 @@ export interface MesWarehouseInventoryRelaModel { ...@@ -125,6 +129,8 @@ export interface MesWarehouseInventoryRelaModel {
pdid: string; pdid: string;
cpbh: string;
cp: string; cp: string;
cplx: string; cplx: string;
...@@ -135,6 +141,8 @@ export interface MesWarehouseInventoryRelaModel { ...@@ -135,6 +141,8 @@ export interface MesWarehouseInventoryRelaModel {
pdsl: string; pdsl: string;
ywzz: string;
p1: string; p1: string;
p2: string; p2: string;
...@@ -208,3 +216,22 @@ export interface MesWarehouseInventoryRelaModel { ...@@ -208,3 +216,22 @@ export interface MesWarehouseInventoryRelaModel {
* @description: MesWarehouseInventory分页返回值结构 * @description: MesWarehouseInventory分页返回值结构
*/ */
export type MesWarehouseInventoryPageResult = BasicFetchResult<MesWarehouseInventoryPageModel>; export type MesWarehouseInventoryPageResult = BasicFetchResult<MesWarehouseInventoryPageModel>;
export interface InventoryFilterParams {
ckwz: string[];
cplx: string[];
cp: string[];
}
export interface InventoryItem {
ywzz: string;
id: string;
cpbh: string;
cpmc: string;
cplx: string;
ck: string;
hw: string;
pch: string;
pdsl: number | null;
zbid: string;
}
...@@ -12,11 +12,11 @@ export interface MesWarehouseProductNumberPageParams extends BasicPageParams { ...@@ -12,11 +12,11 @@ export interface MesWarehouseProductNumberPageParams extends BasicPageParams {
ywzz: string; ywzz: string;
pch: string; kcg: string;
ck: string; kxs: string;
hw: string; erpid: string;
} }
/** /**
...@@ -25,6 +25,8 @@ export interface MesWarehouseProductNumberPageParams extends BasicPageParams { ...@@ -25,6 +25,8 @@ export interface MesWarehouseProductNumberPageParams extends BasicPageParams {
export interface MesWarehouseProductNumberPageModel { export interface MesWarehouseProductNumberPageModel {
id: string; id: string;
ywzz: string;
cpbh: string; cpbh: string;
cpmc: string; cpmc: string;
...@@ -37,14 +39,6 @@ export interface MesWarehouseProductNumberPageModel { ...@@ -37,14 +39,6 @@ export interface MesWarehouseProductNumberPageModel {
sl: string; sl: string;
ywzz: string;
pch: string;
ck: string;
hw: string;
kcg: string; kcg: string;
kxs: string; kxs: string;
...@@ -82,8 +76,6 @@ export interface MesWarehouseProductNumberModel { ...@@ -82,8 +76,6 @@ export interface MesWarehouseProductNumberModel {
ywzz: string; ywzz: string;
pch: string;
ck: string; ck: string;
hw: string; hw: string;
...@@ -137,6 +129,12 @@ export interface MesWarehouseProductNumInfoModel { ...@@ -137,6 +129,12 @@ export interface MesWarehouseProductNumInfoModel {
bgrq: string; bgrq: string;
pch: string;
ck: string;
hw: string;
bz: string; bz: string;
p1: string; p1: string;
......
import { MesWarehouseProductNumLogPageModel, MesWarehouseProductNumLogPageParams, MesWarehouseProductNumLogPageResult } from './model/ZbrzModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/ckgl/zbrz/page',
List = '/ckgl/zbrz/list',
Info = '/ckgl/zbrz/info',
MesWarehouseProductNumLog = '/ckgl/zbrz',
}
/**
* @description: 查询MesWarehouseProductNumLog分页列表
*/
export async function getMesWarehouseProductNumLogPage(params: MesWarehouseProductNumLogPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesWarehouseProductNumLogPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取MesWarehouseProductNumLog信息
*/
export async function getMesWarehouseProductNumLog(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesWarehouseProductNumLogPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增MesWarehouseProductNumLog
*/
export async function addMesWarehouseProductNumLog(mesWarehouseProductNumLog: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.MesWarehouseProductNumLog,
params: mesWarehouseProductNumLog,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新MesWarehouseProductNumLog
*/
export async function updateMesWarehouseProductNumLog(mesWarehouseProductNumLog: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.MesWarehouseProductNumLog,
params: mesWarehouseProductNumLog,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除MesWarehouseProductNumLog(批量删除)
*/
export async function deleteMesWarehouseProductNumLog(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.MesWarehouseProductNumLog,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: MesWarehouseProductNumLog分页参数 模型
*/
export interface MesWarehouseProductNumLogPageParams extends BasicPageParams {
cpbh: string;
cplx: string;
ywzz: string;
pch: string;
ck: string;
hw: string;
type: string;
}
/**
* @description: MesWarehouseProductNumLog分页返回值模型
*/
export interface MesWarehouseProductNumLogPageModel {
id: string;
ywzz: string;
cpbh: string;
cpmc: string;
cplx: string;
gg: string;
xh: string;
bgsl: string;
pch: string;
ck: string;
hw: string;
erpid: string;
type: string;
bz: string;
}
/**
* @description: MesWarehouseProductNumLog表类型
*/
export interface MesWarehouseProductNumLogModel {
id: string;
deleteMark: string;
cpbh: string;
cpmc: string;
cptp: string;
cplx: string;
gg: string;
xh: string;
erpid: string;
bgsl: string;
bgrq: string;
ywzz: string;
pch: string;
ck: string;
hw: string;
type: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
* @description: MesWarehouseProductNumLog分页返回值结构
*/
export type MesWarehouseProductNumLogPageResult =
BasicFetchResult<MesWarehouseProductNumLogPageModel>;
...@@ -199,8 +199,8 @@ ...@@ -199,8 +199,8 @@
> >
</template> </template>
<template v-else-if="column.key !== 'index'"> <template v-else-if="column.key !== 'index'">
<!-- :key="subRefreshFieldObj[index][column.dataIndex]" -->
<component <component
:key="subRefreshFieldObj[index][column.dataIndex]"
:is="componentMap.get(column.componentType)" :is="componentMap.get(column.componentType)"
:bordered="showComponentBorder" :bordered="showComponentBorder"
v-bind="getComponentsProps(column, record, index)" v-bind="getComponentsProps(column, record, index)"
......
...@@ -62,6 +62,12 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -62,6 +62,12 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'Input',
}, },
{
field: 'pch',
label: '批次号',
defaultValue: undefined,
component: 'Input',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
...@@ -145,19 +151,6 @@ export const columns: BasicColumn[] = [ ...@@ -145,19 +151,6 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'zdr',
title: '制单人',
componentType: 'user',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'ywzz', dataIndex: 'ywzz',
title: '业务组织', title: '业务组织',
componentType: 'select', componentType: 'select',
...@@ -194,6 +187,32 @@ export const columns: BasicColumn[] = [ ...@@ -194,6 +187,32 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: '',
}, },
{
resizable: true,
dataIndex: 'pch',
title: '批次号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'zdr',
title: '制单人',
componentType: 'user',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
]; ];
//表头合并配置 //表头合并配置
export const headerMergingData = []; export const headerMergingData = [];
...@@ -362,7 +381,7 @@ export const formProps: FormProps = { ...@@ -362,7 +381,7 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
isMultiple: false, isMultiple: false,
clearable: false, clearable: false,
disabled: false, disabled: true,
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
...@@ -384,6 +403,7 @@ export const formProps: FormProps = { ...@@ -384,6 +403,7 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2010533622867509249', itemId: '2010533622867509249',
defaultSelect: '入库',
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
...@@ -476,7 +496,7 @@ export const formProps: FormProps = { ...@@ -476,7 +496,7 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: 'abf781fca11e4df9aea8ccab752fa7ce', key: 'c8bee15be90449d58c6bb61b45013906',
field: 'zdr', field: 'zdr',
label: '制单人', label: '制单人',
type: 'user', type: 'user',
...@@ -487,10 +507,10 @@ export const formProps: FormProps = { ...@@ -487,10 +507,10 @@ export const formProps: FormProps = {
span: 7, span: 7,
width: '100%', width: '100%',
defaultValue: '', defaultValue: '',
placeholder: '请选择制单人', placeholder: '请选择人员',
userType: 0, userType: 0,
prefix: '', prefix: '',
suffix: '', suffix: 'ant-design:setting-outlined',
showLabel: true, showLabel: true,
disabled: false, disabled: false,
required: false, required: false,
...@@ -537,7 +557,7 @@ export const formProps: FormProps = { ...@@ -537,7 +557,7 @@ export const formProps: FormProps = {
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7',
}, },
dicOptions: [], dicOptions: [],
required: false, required: true,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
...@@ -625,6 +645,34 @@ export const formProps: FormProps = { ...@@ -625,6 +645,34 @@ export const formProps: FormProps = {
], ],
}, },
{ {
span: 8,
list: [
{
key: '7bfde045cd3e4401b4283ac394218c5d',
field: 'pch',
label: '批次号',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请输入批次号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
showLabel: true,
autoCodeRule: 'pcbm',
required: false,
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 24, span: 24,
list: [ list: [
{ {
...@@ -1016,9 +1064,7 @@ export const formProps: FormProps = { ...@@ -1016,9 +1064,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
min: 0, min: 0,
max: null,
step: 1, step: 1,
maxlength: null,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -1094,6 +1140,36 @@ export const formProps: FormProps = { ...@@ -1094,6 +1140,36 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '3582e53475224ea18082fbddb678e7ec',
title: '批次号',
dataIndex: 'pch',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入批次号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'd2d0c0c885684a99a792beb3dc3415ba', key: 'd2d0c0c885684a99a792beb3dc3415ba',
title: '是否赠品', title: '是否赠品',
dataIndex: 'sfzp', dataIndex: 'sfzp',
...@@ -1265,7 +1341,16 @@ export const formProps: FormProps = { ...@@ -1265,7 +1341,16 @@ export const formProps: FormProps = {
label: '批量报检', label: '批量报检',
icon: 'ant-design:alert-outlined', icon: 'ant-design:alert-outlined',
style: 'primary', style: 'primary',
event: [], event: [
{
key: '1',
type: 2,
operateType: 2,
operateConfig: {
js: "if (formActionType.selectedRowsData && formActionType.selectedRowsData.length === 0) { formActionType.showMessage('请先勾选物料明细数据'); } else { const ids = formActionType.selectedRowsData.map(item => item.id); console.log('Extracted ids:', ids); formActionType.httpRequest({ requestUrl: '/ckgl/cgdh/quailty', requestType: 'put', params: ids, errorMessageMode: 'message' }).then(response => { console.log('Quality check response:', response); if (formActionType.showSuccessMessage) { formActionType.showSuccessMessage('报检处理成功!'); } else if (formActionType.message) { formActionType.message.success('报检处理成功!'); } else { formActionType.showMessage('报检处理成功!'); } if (formActionType.clearSelection) { formActionType.clearSelection(); } }).catch(error => { console.error('Quality check error:', error); formActionType.showMessage('批量报检失败,请重试!'); }); }"
}
}
],
type: 1, type: 1,
}, },
], ],
...@@ -1274,7 +1359,7 @@ export const formProps: FormProps = { ...@@ -1274,7 +1359,7 @@ export const formProps: FormProps = {
isDeleteSelected: false, isDeleteSelected: false,
isListView: false, isListView: false,
viewList: [], viewList: [],
isShowAdd: false, isShowAdd: true,
isShowDelete: false, isShowDelete: false,
hasCheckedCol: true, hasCheckedCol: true,
events: {}, events: {},
......
...@@ -36,7 +36,7 @@ export const permissionList = [ ...@@ -36,7 +36,7 @@ export const permissionList = [
{ {
required: false, required: false,
view: true, view: true,
edit: true, edit: false,
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
...@@ -48,6 +48,7 @@ export const permissionList = [ ...@@ -48,6 +48,7 @@ export const permissionList = [
key: 'cf825b8df185417fa8fa904fa8313dba', key: 'cf825b8df185417fa8fa904fa8313dba',
children: [], children: [],
options: {}, options: {},
defaultValue: '入库',
}, },
{ {
required: false, required: false,
...@@ -94,13 +95,13 @@ export const permissionList = [ ...@@ -94,13 +95,13 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'user', type: 'user',
key: 'abf781fca11e4df9aea8ccab752fa7ce', key: 'c8bee15be90449d58c6bb61b45013906',
children: [], children: [],
options: {}, options: {},
defaultValue: '', defaultValue: '',
}, },
{ {
required: false, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: false,
...@@ -152,6 +153,22 @@ export const permissionList = [ ...@@ -152,6 +153,22 @@ export const permissionList = [
{ {
required: false, required: false,
view: true, view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '批次号',
fieldId: 'pch',
isSubTable: false,
showChildren: true,
type: 'auto-code',
key: '7bfde045cd3e4401b4283ac394218c5d',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true, edit: true,
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
...@@ -402,6 +419,21 @@ export const permissionList = [ ...@@ -402,6 +419,21 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesWarehouseArrivedInfoList', tableName: 'mesWarehouseArrivedInfoList',
fieldName: '批次号',
fieldId: 'pch',
type: 'Input',
key: '3582e53475224ea18082fbddb678e7ec',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseArrivedInfoList',
fieldName: '是否赠品', fieldName: '是否赠品',
fieldId: 'sfzp', fieldId: 'sfzp',
type: 'Input', type: 'Input',
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
function customClick(item) { function customClick(item) {
if (item.key == 'confirm') { if (item.key == 'confirm') {
handleSubmit(); handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') { } else if (item.key == 'cancel') {
handleClose(); handleClose();
closeModal(); closeModal();
} else if (item.key == 'reset') { } else if (item.key == 'reset') {
...@@ -163,4 +163,3 @@ ...@@ -163,4 +163,3 @@
</script> </script>
\ No newline at end of file
...@@ -45,6 +45,21 @@ export const permissionList = [ ...@@ -45,6 +45,21 @@ export const permissionList = [
options: {}, options: {},
}, },
{ {
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '处理盈亏',
isSubTable: false,
showChildren: true,
type: 'button',
key: 'f0dcaa5c8080475f94114c779b55bd7f',
children: [],
options: {},
},
{
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
...@@ -100,7 +115,7 @@ export const permissionList = [ ...@@ -100,7 +115,7 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '盘点日期', fieldName: '盘点日期',
fieldId: 'createDate', fieldId: 'pdrq',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'date', type: 'date',
...@@ -127,6 +142,38 @@ export const permissionList = [ ...@@ -127,6 +142,38 @@ export const permissionList = [
defaultValue: '', defaultValue: '',
}, },
{ {
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '盘点编码',
fieldId: 'pdbh',
isSubTable: false,
showChildren: true,
type: 'auto-code',
key: '8a6000a1cd5d485787f7dc14308dd70f',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '盘点状态',
fieldId: 'zt',
isSubTable: false,
showChildren: true,
type: 'select',
key: '7feeb7d43eda46a3919bcf32e64948b6',
children: [],
options: {},
},
{
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
...@@ -148,6 +195,21 @@ export const permissionList = [ ...@@ -148,6 +195,21 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesWarehouseInventoryRelaList', tableName: 'mesWarehouseInventoryRelaList',
fieldName: '业务组织',
fieldId: 'ywzz',
type: 'Input',
key: 'a64dec69ac534215b055bd63e16d0f77',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '产品', fieldName: '产品',
fieldId: 'cp', fieldId: 'cp',
type: 'XjrSelect', type: 'XjrSelect',
......
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
formConfig: { formConfig: {
labelWidth: 100, labelWidth: 100,
schemas: searchFormSchema, schemas: searchFormSchema,
fieldMapToTime: [], fieldMapToTime: [['pdrq', ['pdrqStart', 'pdrqEnd'], 'YYYY-MM-DD HH:mm:ss ', true],],
showResetButton: false, showResetButton: false,
}, },
bordered:false, bordered:false,
......
...@@ -123,55 +123,6 @@ export const permissionList = [ ...@@ -123,55 +123,6 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '批次号',
fieldId: 'pch',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'd3e96c4ef414491c9082a0cabec7b9f7',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '仓库',
fieldId: 'ck',
isSubTable: false,
showChildren: true,
type: 'select',
key: '3ff42968656549af99ff32d0a420b9ff',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '货位',
fieldId: 'hw',
isSubTable: false,
showChildren: true,
type: 'select',
key: '24975956e188454fa0db49650cbb5500',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '可采购', fieldName: '可采购',
fieldId: 'kcg', fieldId: 'kcg',
isSubTable: false, isSubTable: false,
...@@ -293,6 +244,51 @@ export const permissionList = [ ...@@ -293,6 +244,51 @@ export const permissionList = [
key: '797ceeda94264e81b0e955852ddd70ac', key: '797ceeda94264e81b0e955852ddd70ac',
children: [], children: [],
}, },
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseProductNumInfoList',
fieldName: '批次号',
fieldId: 'pch',
type: 'Input',
key: 'b53d662674c5424b8a3280fb2c6aaa6e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseProductNumInfoList',
fieldName: '仓库',
fieldId: 'ck',
type: 'Input',
key: 'f84cf4f2535e429ea2e3ac6d2850859d',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseProductNumInfoList',
fieldName: '货位',
fieldId: 'hw',
type: 'Input',
key: 'de367affec9a4b2a9d7c3c44b0f7740e',
children: [],
},
], ],
}, },
]; ];
<template>
<div class="pt-4">
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
:isCamelCase="true"
@model-change="handleChange"
/>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesWarehouseProductNumLog, getMesWarehouseProductNumLog, updateMesWarehouseProductNumLog } from '/@/api/ckgl/zbrz';
import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps),
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
});
const { currentRoute } = useRouter();
watch(
() => state.formModel,
(val) => {
emits('update:value', val);
},
{
deep: true,
},
);
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
if(currentRoute.value.meta){
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:'';
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:'';
}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await nextTick();
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
} else if (props.fromPage == FromPageType.PREVIEW) {
// 预览 无需权限,表单事件也无需执行
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
} catch (error) {}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
}
// 校验form 通过返回表单数据
async function validate() {
let values = [];
try {
values = await systemFormRef.value?.validate();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
try {
const record = await getMesWarehouseProductNumLog(rowId);
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
} catch (error) {
}
}
// 辅助返回表单数据
async function getFieldsValue() {
let values = [];
try {
values = await systemFormRef.value?.getFieldsValue();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
}
// 获取行键值
function getRowKey() {
return RowKey;
}
// 更新api表单数据
async function update({ values, rowId }) {
try {
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateMesWarehouseProductNumLog(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addMesWarehouseProductNumLog(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
try {
if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName;
let flowData = await changeWorkFlowForm(cloneDeep(formProps), obj);
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
data.formDataProps = buildOptionJson;
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
if (isViewProcess) {
setDisabledForm(); //查看
}
state.formModel = formModels;
setFieldsValue(formModels);
} catch (error) {}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
function handleChange(val) {
emits('update:value', val);
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe();
}
} catch (error) {}
}
defineExpose({
setFieldsValue,
resetFields,
validate,
add,
update,
setFormDataFromId,
setDisabledForm,
setMenuPermission,
setWorkFlowForm,
getRowKey,
getFieldsValue,
sendMessageForAllIframe
});
</script>
\ No newline at end of file
<template>
<BasicModal
:height="1080"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const state = reactive({
formModel: {},
isUpdate: true,
isView: false,
rowId: '',
});
provide<Ref<boolean>>('isCopy', isCopy);
const { t } = useI18n();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await handleInner(data);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
async function handleInner(data){
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy;
setModalProps({
destroyOnClose: true,
maskClosable: false,
showCancelBtn: !state.isView,
showOkBtn: !state.isView,
canFullscreen: true,
width: 1980,
footer: state.isView ? null : undefined,defaultFullscreen:true,
});
if (state.isUpdate || state.isView || isCopy.value) {
state.rowId = data.id;
if (state.isView) {
await formRef.value.setDisabledForm();
}
await formRef.value.setFormDataFromId(state.rowId);
} else {
formRef.value.resetFields();
}
}
async function saveModal() {
let saveSuccess = false;
try {
const values = await formRef.value?.validate();
//添加隐藏组件
if (formProps.hiddenComponent?.length) {
formProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
if (values !== false) {
try {
if (!state.isUpdate || isCopy.value) {
saveSuccess = await formRef.value.add(values);
} else {
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
}
return saveSuccess;
} catch (error) {}
}
} catch (error) {
return saveSuccess;
}
}
async function handleSubmit() {
try {
const saveSuccess = await saveModal();
setModalProps({ confirmLoading: true });
if (saveSuccess) {
if (!state.isUpdate || isCopy.value) {
//false 新增
notification.success({
message: 'Tip',
description: isCopy.value ? '复制成功' : t('新增成功!'),
}); //提示消息
} else {
notification.success({
message: 'Tip',
description: t('修改成功!'),
}); //提示消息
}
closeModal();
formRef.value.resetFields();
emit('success');
}
} finally {
setModalProps({ confirmLoading: false });
}
}
function handleClose() {
formRef.value.resetFields();
}
</script>
\ No newline at end of file
export const permissionList = [
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品编号',
fieldId: 'cpbh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'd300752b01f8426d978092edbcaa2cfd',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品名称',
fieldId: 'cpmc',
isSubTable: false,
showChildren: true,
type: 'input',
key: '6b8f19a3656f46399ff9fbb3a69fc105',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品类型',
fieldId: 'cplx',
isSubTable: false,
showChildren: true,
type: 'select',
key: '667082816f9047ae808d31859effaf1c',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '规格',
fieldId: 'gg',
isSubTable: false,
showChildren: true,
type: 'input',
key: '4bbfb63fe1374e38bc0374033c8d9003',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '型号',
fieldId: 'xh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'c6d61084f23143fb9432f8e25d1cb4d6',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'ErpId',
fieldId: 'erpid',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'e34847e8d927465dbc171b76c062cc12',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '变更数量',
fieldId: 'bgsl',
isSubTable: false,
showChildren: true,
type: 'number',
key: '6cceb0bd12bf4f34bc101b2e2540d7d9',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'db3a1561afb14535b8266bcc05e14ffd',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '批次号',
fieldId: 'pch',
isSubTable: false,
showChildren: true,
type: 'input',
key: '7d47bc4a75954ad898081e6e7d3d6c4a',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '仓库',
fieldId: 'ck',
isSubTable: false,
showChildren: true,
type: 'input',
key: '98a80d9d4f984edcbbc8af4151cb4720',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '货位',
fieldId: 'hw',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'a77d476c3e2d45bcbc282d76804cd839',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '出入库类型',
fieldId: 'type',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'cadefcd39b5b462189595c4f60ae60a2',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'bz',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: 'df5e050f647a4aa096bc2a790f98b540',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品图片',
fieldId: 'cptp',
isSubTable: false,
showChildren: true,
type: 'upload',
key: '318c120f6f48408a969f4e294b4a00fc',
children: [],
options: {},
defaultValue: '',
},
];
<template>
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef"
>
<template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" type="primary" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
<a-button v-else :type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'" :danger="button.buttonType === 'danger'" >
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<TableAction
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
/>
</template>
<template v-else-if="column.dataIndex && column?.listStyle">
<span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{
getValue(record, column, 'value')
}}</span>
</template>
</template>
</BasicTable>
</template>
<ZbrzModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed,provide,Ref,
} from 'vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesWarehouseProductNumLogPage, deleteMesWarehouseProductNumLog} from '/@/api/ckgl/zbrz';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
import ZbrzModal from './components/ZbrzModal.vue';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
const pageParamsInfo = ref<any>({});
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
useConcurrentLock();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth, hasPermission } = usePermission();
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2018249609562296320","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2018249609562296321","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,add : handleAdd,}
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, }] = useTable({
title: 'Zbrz列表',
api: getMesWarehouseProductNumLogPage,
rowKey: 'id',
columns: filterColumns,
pagination: {
pageSize: 10,
},
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
fieldMapToTime: [],
showResetButton: false,
},
bordered:false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value;
},
afterFetch: (res) => {
},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 65,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
},
customRow,
isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
});
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
openModal(true, { isUpdate: false, });
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("zbrz:edit")) {
handleEdit(record);
}
},
};
}
function handleSuccess() {
reload();
}
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleView(record: Recordable) {
let info={
isView: true,
id: record.id,
}
openModal(true, info);
}
function getLessActions(record: Recordable) {
let list = getActions(record);
return list.slice(0, listSpliceNum.value);
}
function getMoreActions(record: Recordable) {
let list = getActions(record);
return list.slice(listSpliceNum.value);
}
function getActions(record: Recordable):ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({
...button,
auth: `zbrz:${button.code}`,
label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code]?.bind(null, record),
});
} else {
if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({
auth: `zbrz:${button.code}`,
label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record),
});
}
}
});
return actionsList;
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
.show{
display: flex;
}
.hide{
display: none !important;
}
</style>
\ No newline at end of file
...@@ -341,8 +341,8 @@ export const formProps: FormProps = { ...@@ -341,8 +341,8 @@ export const formProps: FormProps = {
columns: [ columns: [
{ {
key: 'bffa8112410f4112b3e5fcd32ac28f0e', key: 'bffa8112410f4112b3e5fcd32ac28f0e',
title: '名称', title: '工序名称',
dataIndex: 'processName', dataIndex: 'name',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
......
...@@ -88,8 +88,8 @@ export const permissionList = [ ...@@ -88,8 +88,8 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeRoutingProcessList', tableName: 'rokeRoutingProcessList',
fieldName: '名称', fieldName: '工序名称',
fieldId: 'processName', fieldId: 'name',
type: 'Input', type: 'Input',
key: 'bffa8112410f4112b3e5fcd32ac28f0e', key: 'bffa8112410f4112b3e5fcd32ac28f0e',
children: [], children: [],
......
...@@ -72,8 +72,8 @@ export const permissionList = [ ...@@ -72,8 +72,8 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '数量', fieldName: '可报工数量',
fieldId: 'sl', fieldId: 'kbgsl',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'number', type: 'number',
...@@ -285,8 +285,8 @@ export const permissionList = [ ...@@ -285,8 +285,8 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '状态', fieldName: '开工状态',
fieldId: 'zt', fieldId: 'kgzt',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'select',
...@@ -414,7 +414,7 @@ export const permissionList = [ ...@@ -414,7 +414,7 @@ export const permissionList = [
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: true,
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
...@@ -425,32 +425,32 @@ export const permissionList = [ ...@@ -425,32 +425,32 @@ export const permissionList = [
key: '52c0cefc838d49559f893c5f0df5c415', key: '52c0cefc838d49559f893c5f0df5c415',
children: [], children: [],
}, },
// {
// required: true,
// view: true,
// edit: true,
// disabled: false,
// isSubTable: false,
// isSaveTable: false,
// showChildren: false,
// tableName: 'mesGongdanReportList',
// fieldName: '合金',
// fieldId: 'hj',
// type: 'Input',
// key: '8b197117182e456184210b4de17e6c55',
// children: [],
// },
{ {
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: true,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanReportList',
fieldName: '合金',
fieldId: 'hj',
type: 'Input',
key: '8b197117182e456184210b4de17e6c55',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesGongdanReportList', tableName: 'mesGongdanReportList',
fieldName: '完工数', fieldName: '报工数量',
fieldId: 'wgs', fieldId: 'bgsl',
type: 'InputNumber', type: 'InputNumber',
key: 'ecc71641608a45338b75896b3d74d281', key: 'ecc71641608a45338b75896b3d74d281',
children: [], children: [],
...@@ -689,7 +689,7 @@ export const permissionList = [ ...@@ -689,7 +689,7 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesGongdanQualityInspectionList', tableName: 'mesGongdanQualityInspectionList',
fieldName: '质检信息', fieldName: '质检时间',
fieldId: 'zjsj', fieldId: 'zjsj',
type: 'DatePicker', type: 'DatePicker',
key: 'c6d641ee7dfc4336ae157553c1a4e4e9', key: 'c6d641ee7dfc4336ae157553c1a4e4e9',
...@@ -704,6 +704,21 @@ export const permissionList = [ ...@@ -704,6 +704,21 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesGongdanQualityInspectionList', tableName: 'mesGongdanQualityInspectionList',
fieldName: '质检状态',
fieldId: 'zt',
type: 'Input',
key: 'sfsefew342342',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '备注', fieldName: '备注',
fieldId: 'bz', fieldId: 'bz',
type: 'Input', type: 'Input',
......
...@@ -241,7 +241,16 @@ ...@@ -241,7 +241,16 @@
if (res !== null) { if (res !== null) {
return; return;
} }
} }
// const hasNonDraft = selectedRowsData.value.some((item) => item.zt !== '草稿');
// if (hasNonDraft) {
// Modal.warning({
// title: '提示',
// content: '当前任务无法编辑',
// });
// return;
// }
let info = { let info = {
id: record[field], id: record[field],
...@@ -382,4 +391,4 @@ ...@@ -382,4 +391,4 @@
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -16,7 +16,7 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input', component: 'Input',
}, },
{ {
field: 'ssgs', field: 'ywzz',
label: '业务组织', label: '业务组织',
defaultValue: undefined, defaultValue: undefined,
component: 'XjrSelect', component: 'XjrSelect',
...@@ -89,7 +89,7 @@ export const columns: BasicColumn[] = [ ...@@ -89,7 +89,7 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'ssgs', dataIndex: 'ywzz',
title: '业务组织', title: '业务组织',
componentType: 'select', componentType: 'select',
...@@ -434,7 +434,7 @@ export const formProps: FormProps = { ...@@ -434,7 +434,7 @@ export const formProps: FormProps = {
}, },
{ {
key: '6833bea0c42c432b83e6946695f2d723', key: '6833bea0c42c432b83e6946695f2d723',
field: 'ssgs', field: 'ywzz',
label: '业务组织', label: '业务组织',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
......
...@@ -124,7 +124,7 @@ export const permissionList = [ ...@@ -124,7 +124,7 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '业务组织', fieldName: '业务组织',
fieldId: 'ssgs', fieldId: 'ywzz',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'select',
......
...@@ -110,6 +110,18 @@ export const columns: BasicColumn[] = [ ...@@ -110,6 +110,18 @@ export const columns: BasicColumn[] = [
listStyle: undefined, listStyle: undefined,
}, },
{
resizable: true,
dataIndex: 'zt',
title: '状态',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{ {
resizable: true, resizable: true,
...@@ -515,6 +527,39 @@ export const formProps: FormProps = { ...@@ -515,6 +527,39 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '312djfjdjd',
field: 'zt',
label: '状态',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: { change: '' },
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '427fc55accd744d0a6359faf80e45a1b', key: '427fc55accd744d0a6359faf80e45a1b',
field: 'sccx', field: 'sccx',
label: '产线', label: '产线',
......
...@@ -237,6 +237,23 @@ export const permissionList = [ ...@@ -237,6 +237,23 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '状态',
fieldId: 'zt',
isSubTable: false,
showChildren: true,
type: 'input',
key: '312djfjdjd',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '优先级', fieldName: '优先级',
fieldId: 'yxj', fieldId: 'yxj',
isSubTable: false, isSubTable: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment