Commit db161dad by 金民

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

parents 0d76f2a6 644a6545
......@@ -93,6 +93,11 @@ export async function deleteMesWarehouseInventory(ids: string[], mode: ErrorMess
);
}
/**
* @description: 导出MesWarehouseInventory
*/
export async function exportMesWarehouseInventory(
params?: object,
mode: ErrorMessageMode = 'modal'
......
......@@ -135,6 +135,8 @@ export interface MesWarehouseInventoryRelaModel {
cplx: string;
ck: string;
wz: string;
pch: string;
......
......@@ -10,13 +10,13 @@ export interface MesWarehouseProfitandlossPageParams extends BasicPageParams {
ck: string;
hw: string;
pch: string;
ykzt: string;
ywzz: string;
pddid: string;
}
/**
......@@ -25,12 +25,16 @@ export interface MesWarehouseProfitandlossPageParams extends BasicPageParams {
export interface MesWarehouseProfitandlossPageModel {
id: string;
ywzz: string;
cpbm: string;
cpmc: string;
ck: string;
hw: string;
pch: string;
xtsl: string;
......@@ -42,10 +46,6 @@ export interface MesWarehouseProfitandlossPageModel {
ce: string;
ykzt: string;
ywzz: string;
pddid: string;
}
/**
......@@ -66,6 +66,8 @@ export interface MesWarehouseProfitandlossModel {
ck: string;
hw: string;
xtsl: string;
pdsl: string;
......
......@@ -4,10 +4,14 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: MesWarehouseOtherout分页参数 模型
*/
export interface MesWarehouseOtheroutPageParams extends BasicPageParams {
ywhb: string;
ywzz: string;
ywlx: string;
dbrq: string;
lydj: string;
ck: string;
}
......@@ -17,7 +21,7 @@ export interface MesWarehouseOtheroutPageParams extends BasicPageParams {
export interface MesWarehouseOtheroutPageModel {
id: string;
ywhb: string;
ywzz: string;
ywlx: string;
......@@ -38,7 +42,7 @@ export interface MesWarehouseOtheroutModel {
deleteMark: string;
ywhb: string;
ywzz: string;
ywlx: string;
......
......@@ -4,7 +4,7 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: MesWarehouseOther分页参数 模型
*/
export interface MesWarehouseOtherPageParams extends BasicPageParams {
ywhb: string;
ywzz: string;
ywlx: string;
......@@ -13,8 +13,6 @@ export interface MesWarehouseOtherPageParams extends BasicPageParams {
lydj: string;
ck: string;
cgy: string;
}
/**
......@@ -23,7 +21,7 @@ export interface MesWarehouseOtherPageParams extends BasicPageParams {
export interface MesWarehouseOtherPageModel {
id: string;
ywhb: string;
ywzz: string;
ywlx: string;
......@@ -42,7 +40,9 @@ export interface MesWarehouseOtherPageModel {
export interface MesWarehouseOtherModel {
id: string;
ywhb: string;
deleteMark: string;
ywzz: string;
ywlx: string;
......@@ -54,6 +54,74 @@ export interface MesWarehouseOtherModel {
cgy: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
p21: string;
p22: string;
p23: string;
p24: string;
p25: string;
p26: string;
p27: string;
p28: string;
p29: string;
p30: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
mesWarehouseOtherInfoList?: MesWarehouseOtherInfoModel;
}
......@@ -63,6 +131,8 @@ export interface MesWarehouseOtherModel {
export interface MesWarehouseOtherInfoModel {
id: string;
deleteMark: string;
qtid: string;
cp: string;
......@@ -80,6 +150,74 @@ export interface MesWarehouseOtherInfoModel {
hw: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
p21: string;
p22: string;
p23: string;
p24: string;
p25: string;
p26: string;
p27: string;
p28: string;
p29: string;
p30: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
......
import { MesBaseCplxPageModel, MesBaseCplxPageParams, MesBaseCplxPageResult } from './model/CplxModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/jcsj/cplx/page',
List = '/jcsj/cplx/list',
Info = '/jcsj/cplx/info',
MesBaseCplx = '/jcsj/cplx',
}
/**
* @description: 查询MesBaseCplx分页列表
*/
export async function getMesBaseCplxPage(params: MesBaseCplxPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesBaseCplxPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取MesBaseCplx信息
*/
export async function getMesBaseCplx(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesBaseCplxPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增MesBaseCplx
*/
export async function addMesBaseCplx(mesBaseCplx: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.MesBaseCplx,
params: mesBaseCplx,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新MesBaseCplx
*/
export async function updateMesBaseCplx(mesBaseCplx: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.MesBaseCplx,
params: mesBaseCplx,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除MesBaseCplx(批量删除)
*/
export async function deleteMesBaseCplx(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.MesBaseCplx,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: MesBaseCplx分页参数 模型
*/
export interface MesBaseCplxPageParams extends BasicPageParams {
cm: string;
pid: string;
}
/**
* @description: MesBaseCplx分页返回值模型
*/
export interface MesBaseCplxPageModel {
id: string;
cm: string;
pid: string;
bh: string;
paixu: string;
bz: string;
}
/**
* @description: MesBaseCplx表类型
*/
export interface MesBaseCplxModel {
id: string;
deleteMark: string;
pid: string;
cm: string;
bh: string;
paixu: 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: MesBaseCplx分页返回值结构
*/
export type MesBaseCplxPageResult = BasicFetchResult<MesBaseCplxPageModel>;
......@@ -9,14 +9,6 @@ export interface MesBaseProductInfoPageParams extends BasicPageParams {
cpbh: string;
cplx: string;
xh: string;
hjzt: string;
nbdm: string;
sfyx: string;
}
/**
......@@ -29,19 +21,13 @@ export interface MesBaseProductInfoPageModel {
cpbh: string;
cplx: string;
gg: string;
xh: string;
hjzt: string;
nbdm: string;
erpid: string;
cplx: string;
sfyx: string;
bzzl: string;
}
/**
......@@ -86,7 +72,7 @@ export interface MesBaseProductInfoModel {
bz: string;
p1: string;
dw: string;
p2: string;
......@@ -113,6 +99,8 @@ export interface MesBaseProductInfoModel {
modifyDate: string;
modifyUserId: string;
p1: string;
}
/**
......
......@@ -35,6 +35,10 @@
type: Number,
default: FromPageType.MENU,
},
isView: {
type: Boolean,
default: false,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
......@@ -49,12 +53,109 @@
() => state.formModel,
(val) => {
emits('update:value', val);
// Update button and field states based on form state
updateButtonVisibility();
updateHeaderFieldDisabledState();
updateDetailFieldDisabledState();
},
{
deep: true,
},
);
// Update button disabled state based on form state
function updateButtonVisibility() {
const hasId = !!state.formModel.id;
const isCompleted = state.formModel.zt === '已完成';
const isCancelled = state.formModel.zt === '取消';
// Find the grid component that contains the buttons
const gridComponent = data.formDataProps.schemas.find(schema => schema.component === 'Grid' && schema.children);
if (gridComponent && gridComponent.children) {
// Update each button's disabled state
gridComponent.children.forEach(child => {
if (child.list && child.list.length > 0) {
child.list.forEach(button => {
if (props.isView || isCancelled) {
// Disable all buttons in view mode or if status is cancelled
button.componentProps.disabled = true;
button.componentProps.isShow = true;
} else if (button.label === '开始盘点') {
// Disable start inventory button in edit mode
button.componentProps.disabled = hasId;
// Always show the button
button.componentProps.isShow = true;
} else if (['确认盘点', '取消盘点'].includes(button.label)) {
// Disable these buttons in add mode or if status is completed
button.componentProps.disabled = !hasId || isCompleted;
// Always show the buttons
button.componentProps.isShow = true;
} else if (button.label === '处理盈亏') {
// Disable in add mode or when status is not completed
button.componentProps.disabled = !hasId || !isCompleted;
// Always show the button
button.componentProps.isShow = true;
}
});
}
});
}
}
// Update header field disabled state based on form state
function updateHeaderFieldDisabledState() {
const hasId = !!state.formModel.id;
const isCompletedOrCancelled = state.formModel.zt === '已完成' || state.formModel.zt === '取消';
// Find the grid component that contains the header fields
const headerGridComponent = data.formDataProps.schemas.find(schema =>
schema.component === 'Grid' &&
schema.children &&
schema.children.some(child =>
child.list &&
child.list.some(field => field.field === 'ckwz' || field.field === 'cplx' || field.field === 'cp' || field.field === 'pdrq' || field.field === 'bz')
)
);
if (headerGridComponent && headerGridComponent.children) {
// Update each header field's disabled state
headerGridComponent.children.forEach(child => {
if (child.list && child.list.length > 0) {
child.list.forEach(field => {
if (field.componentProps) {
// Disable header fields in edit mode, view mode, or if status is completed or cancelled
field.componentProps.disabled = props.isView || hasId || isCompletedOrCancelled;
}
});
}
});
}
}
// Update inventory detail fields disabled state based on form state
function updateDetailFieldDisabledState() {
const isCompletedOrCancelled = state.formModel.zt === '已完成' || state.formModel.zt === '取消';
// Find the tab component that contains the inventory detail subform
const tabComponent = data.formDataProps.schemas.find(schema => schema.component === 'Tab' && schema.children);
if (tabComponent && tabComponent.children) {
// Find the inventory detail subform
tabComponent.children.forEach(tab => {
if (tab.list && tab.list.length > 0) {
tab.list.forEach(item => {
if (item.component === 'SubForm' && item.componentProps && item.componentProps.columns) {
// Update each detail field's disabled state
item.componentProps.columns.forEach(column => {
if (column.componentProps) {
// For pdsl field, disable in view mode or if status is completed or cancelled
if (column.dataIndex === 'pdsl') {
column.componentProps.disabled = props.isView || isCompletedOrCancelled;
}
}
});
}
});
}
});
}
}
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
......@@ -70,6 +171,10 @@
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
// Update button and field states after form initialization
updateButtonVisibility();
updateHeaderFieldDisabledState();
updateDetailFieldDisabledState();
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
......@@ -84,6 +189,10 @@
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
// Update button and field states after form initialization
updateButtonVisibility();
updateHeaderFieldDisabledState();
updateDetailFieldDisabledState();
}
} catch (error) {}
});
......@@ -116,6 +225,10 @@
await getFormDataEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
// Update button and field states after setting form data
updateButtonVisibility();
updateHeaderFieldDisabledState();
updateDetailFieldDisabledState();
} catch (error) {
}
......@@ -222,4 +335,3 @@
});
</script>
\ No newline at end of file
......@@ -6,7 +6,7 @@
:height="1080"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" :isView="state.isView" />
<template #footer v-if=" !state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow">
......@@ -26,7 +26,7 @@
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { ref, computed, reactive, provide, Ref, onMounted, onBeforeUnmount } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum';
......@@ -58,6 +58,24 @@
await handleInner(data);
});
// Handle postMessage event to close modal or trigger confirm button
function handlePostMessage(event) {
if (event.data && event.data.type === 'CLOSE_MODAL') {
closeModal();
} else if (event.data && event.data.type === 'TRIGGER_CONFIRM_BUTTON') {
// Trigger confirm button click event
handleSubmit();
}
}
onMounted(() => {
window.addEventListener('message', handlePostMessage);
});
onBeforeUnmount(() => {
window.removeEventListener('message', handlePostMessage);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
......
......@@ -2,6 +2,7 @@ import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import { getInventoryByFilter } from '/@/api/ckgl/kcpd';
import type { InventoryFilterParams, InventoryItem } from '/@/api/ckgl/kcpd/model/KcpdModel';
import { log } from 'console';
const parseSelectValueToArray = (value: unknown): string[] => {
if (Array.isArray(value)) return value.filter(Boolean) as string[];
......@@ -45,6 +46,7 @@ async function handleStartInventory(_schema, formModel, formActionType) {
const list =
(inventoryList || []).map((item: InventoryItem) => ({
id: item.id,
cpbh: item.cpbh,
cp: item.cpmc,
cplx: item.cplx,
wz: item.hw,
......@@ -52,6 +54,7 @@ async function handleStartInventory(_schema, formModel, formActionType) {
pdsl: item.pdsl ?? 0,
zbid: item.zbid,
ywzz: item.ywzz,
ck: item.ck,
})) || [];
await formActionType?.setFieldsValue?.({ mesWarehouseInventoryRelaList: list });
formActionType?.showMessage?.(list.length ? '开始盘点成功' : '未查询到匹配数据');
......@@ -61,6 +64,48 @@ async function handleStartInventory(_schema, formModel, formActionType) {
}
}
async function handleProfitLoss(_schema, formModel, formActionType) {
try {
const inventoryDetails = formModel.mesWarehouseInventoryRelaList || [];
if (inventoryDetails.length === 0) {
formActionType?.showMessage?.('没有盘点明细数据可处理', { type: 'warning' });
return;
}
await formActionType?.httpRequest({
requestUrl: '/ckgl/kczb/handleyk',
requestType: 'post',
data: inventoryDetails,
headers: { Authorization: localStorage.getItem('token') }
});
console.log(formActionType);
formActionType?.showMessage?.('盈亏处理成功!', { type: 'success' });
if (window.parent && window.parent.postMessage) {
window.parent.postMessage({ type: 'CLOSE_MODAL' }, '*');
}
} catch (error) {
console.error('盈亏处理失败', error);
formActionType?.showMessage?.('盈亏处理失败,请重试!');
}
}
async function handleCancelInventory(_schema, formModel, formActionType) {
try {
// Update inventory status to "取消"
formModel.zt = '取消';
formActionType?.showMessage?.('盘点已取消', { type: 'success' });
// Trigger the confirm button click event to close the modal and save changes
if (window.parent && window.parent.postMessage) {
window.parent.postMessage({ type: 'TRIGGER_CONFIRM_BUTTON' }, '*');
}
} catch (error) {
console.error('取消盘点失败', error);
formActionType?.showMessage?.('取消盘点失败,请重试!');
}
}
export const searchFormSchema: FormSchema[] = [
{
field: 'pdrq',
......@@ -259,7 +304,7 @@ export const formProps: FormProps = {
],
},
dicOptions: [],
disabled: false,
disabled: true,
isShow: true,
margin: '10px',
events: { click: handleStartInventory },
......@@ -302,10 +347,10 @@ export const formProps: FormProps = {
],
},
dicOptions: [],
disabled: false,
disabled: true,
isShow: true,
margin: '10px',
events: { click: "formActionType.showMessage('确认盘点')" },
events: { click: "formModel.zt = '已完成'; formActionType.showMessage('盘点已确认,状态已更新为已完成', { type: 'success' });" },
type: 1,
event: [],
tooltipConfig: { visible: false, title: '提示文本' },
......@@ -348,7 +393,7 @@ export const formProps: FormProps = {
disabled: false,
isShow: true,
margin: '10px',
events: { click: "formActionType.showMessage('取消盘点')" },
events: { click: handleCancelInventory },
type: 1,
event: [],
tooltipConfig: { visible: false, title: '提示文本' },
......@@ -391,7 +436,7 @@ export const formProps: FormProps = {
disabled: false,
isShow: true,
margin: '10px',
events: {},
events: { click: handleProfitLoss },
modal: null,
type: 1,
event: [],
......@@ -443,7 +488,7 @@ export const formProps: FormProps = {
showSearch: true,
isMultiple: true,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -495,7 +540,7 @@ export const formProps: FormProps = {
showSearch: true,
isMultiple: true,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -540,7 +585,7 @@ export const formProps: FormProps = {
showSearch: true,
isMultiple: true,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -593,7 +638,7 @@ export const formProps: FormProps = {
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
disabled: true,
required: false,
isShow: true,
rules: [],
......@@ -626,7 +671,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -778,7 +823,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -794,6 +839,37 @@ export const formProps: FormProps = {
},
},
{
key: '6baef041c82842dc9adb2d4cfb7b5ad3',
title: '产品编号',
dataIndex: 'cpbh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入产品编号',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '63c46f68444c4092aff3d711a0e4f1c4',
title: '产品',
dataIndex: 'cp',
......@@ -806,7 +882,7 @@ export const formProps: FormProps = {
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -849,7 +925,7 @@ export const formProps: FormProps = {
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -875,6 +951,37 @@ export const formProps: FormProps = {
},
},
{
key: '14b12cc2cf3a40bdae1fa6869902252a',
title: '仓库',
dataIndex: 'ck',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入仓库',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '4e325b4ad3cf470d92af7e0d090e0a6d',
title: '位置',
dataIndex: 'wz',
......@@ -887,7 +994,7 @@ export const formProps: FormProps = {
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -933,7 +1040,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......
......@@ -210,6 +210,21 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '产品编号',
fieldId: 'cpbh',
type: 'Input',
key: '6baef041c82842dc9adb2d4cfb7b5ad3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '产品',
fieldId: 'cp',
type: 'XjrSelect',
......@@ -240,6 +255,21 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '仓库',
fieldId: 'ck',
type: 'Input',
key: '14b12cc2cf3a40bdae1fa6869902252a',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '位置',
fieldId: 'wz',
type: 'XjrSelect',
......
......@@ -21,6 +21,12 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'hw',
label: '货位',
defaultValue: undefined,
component: 'Input',
},
{
field: 'pch',
label: '批次号',
defaultValue: undefined,
......@@ -38,19 +44,13 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined,
component: 'Input',
},
{
field: 'pddid',
label: '盘点单ID',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'cpbm',
title: '产品编码',
dataIndex: 'ywzz',
title: '业务组织',
componentType: 'input',
fixed: false,
......@@ -62,8 +62,8 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'cpmc',
title: '产品名称',
dataIndex: 'cpbm',
title: '产品编码',
componentType: 'input',
fixed: false,
......@@ -75,8 +75,8 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'ck',
title: '仓库',
dataIndex: 'cpmc',
title: '产品名称',
componentType: 'input',
fixed: false,
......@@ -88,8 +88,8 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'pch',
title: '批次号',
dataIndex: 'ck',
title: '仓库',
componentType: 'input',
fixed: false,
......@@ -101,8 +101,8 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'xtsl',
title: '系统数量',
dataIndex: 'hw',
title: '货位',
componentType: 'input',
fixed: false,
......@@ -114,8 +114,8 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'pdsl',
title: '盘点数量',
dataIndex: 'pch',
title: '批次号',
componentType: 'input',
fixed: false,
......@@ -127,34 +127,34 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'dw',
title: '单位',
componentType: 'input',
dataIndex: 'xtsl',
title: '系统数量',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'ce',
title: '差额',
componentType: 'input',
dataIndex: 'pdsl',
title: '盘点数量',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'ykzt',
title: '盈亏状态',
dataIndex: 'dw',
title: '单位',
componentType: 'input',
fixed: false,
......@@ -166,21 +166,21 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'ywzz',
title: '业务组织',
componentType: 'input',
dataIndex: 'ce',
title: '差额',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'pddid',
title: '盘点单ID',
dataIndex: 'ykzt',
title: '盈亏状态',
componentType: 'input',
fixed: false,
......@@ -285,7 +285,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入产品编码',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -324,7 +323,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入产品名称',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -363,7 +361,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入仓库',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -390,9 +387,9 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '2b50d71167144489b6c05ee94996f53a',
field: 'pch',
label: '批次号',
key: '54500356c99e4d06a53a79a442d348e0',
field: 'hw',
label: '货位',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -401,7 +398,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入批次号',
placeholder: '请输入货位',
maxlength: null,
prefix: '',
suffix: '',
......@@ -429,9 +426,9 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: 'c29582cdbd274b0cbd798fe5a4642cc9',
field: 'xtsl',
label: '系统数量',
key: '2b50d71167144489b6c05ee94996f53a',
field: 'pch',
label: '批次号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -440,8 +437,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入系统数量',
maxlength: null,
placeholder: '请输入批次号',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -468,35 +464,64 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: 'c04bb88244fe43349bebf968fdce3ce9',
key: 'c2620adb8c7e41578bfb7b20e9355d5c',
field: 'xtsl',
label: '系统数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
min: 0,
max: null,
step: 1,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
placeholder: '请输入系统数量',
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'dd2024cad3a14e06b5e961826ec9a1e4',
field: 'pdsl',
label: '盘点数量',
type: 'input',
component: 'Input',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入盘点数量',
min: 0,
max: null,
step: 1,
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
placeholder: '请输入盘点数量',
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......@@ -519,7 +544,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入单位',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -546,35 +570,30 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '10186fcaa02b4481be4c236037f0783a',
key: '3668d0679a244117acf2ce4bbc5e14dd',
field: 'ce',
label: '差额',
type: 'input',
component: 'Input',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入差额',
min: null,
max: null,
step: 1,
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
placeholder: '请输入差额',
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......@@ -597,7 +616,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入盈亏状态',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -636,7 +654,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入业务组织',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -675,7 +692,6 @@ export const formProps: FormProps = {
span: 7,
defaultValue: '',
placeholder: '请输入盘点单ID',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......
......@@ -57,6 +57,23 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '货位',
fieldId: 'hw',
isSubTable: false,
showChildren: true,
type: 'input',
key: '54500356c99e4d06a53a79a442d348e0',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '批次号',
fieldId: 'pch',
isSubTable: false,
......@@ -78,8 +95,8 @@ export const permissionList = [
fieldId: 'xtsl',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'c29582cdbd274b0cbd798fe5a4642cc9',
type: 'number',
key: 'c2620adb8c7e41578bfb7b20e9355d5c',
children: [],
options: {},
defaultValue: '',
......@@ -95,8 +112,8 @@ export const permissionList = [
fieldId: 'pdsl',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'c04bb88244fe43349bebf968fdce3ce9',
type: 'number',
key: 'dd2024cad3a14e06b5e961826ec9a1e4',
children: [],
options: {},
defaultValue: '',
......@@ -129,8 +146,8 @@ export const permissionList = [
fieldId: 'ce',
isSubTable: false,
showChildren: true,
type: 'input',
key: '10186fcaa02b4481be4c236037f0783a',
type: 'number',
key: '3668d0679a244117acf2ce4bbc5e14dd',
children: [],
options: {},
defaultValue: '',
......
<template>
<ResizePageWrapper :hasLeft="false">
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
>
<BasicTable @register="registerTable" isMenuTable ref="tableRef"
:row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }">
<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>
<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>
<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>
......@@ -29,10 +32,7 @@
<template v-if="column.dataIndex === 'action'">
<TableAction
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
/>
<TableAction :actions="getLessActions(record)" :dropDownActions="getMoreActions(record)" />
</template>
<template v-else-if="column.dataIndex && column?.listStyle">
......@@ -49,39 +49,41 @@
<KcykModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
<KcykModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel" />
</ResizePageWrapper>
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed,provide,Ref,
import {
ref, computed, provide, Ref,
} from 'vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesWarehouseProfitandlossPage, deleteMesWarehouseProfitandloss} from '/@/api/ckgl/kcyk';
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 { getAppEnvConfig } from '/@/utils/env';
import { getToken } from '/@/utils/auth';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesWarehouseProfitandlossPage, deleteMesWarehouseProfitandloss } from '/@/api/ckgl/kcyk';
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 { useModal } from '/@/components/Modal';
import KcykModal from './components/KcykModal.vue';
import KcykModal from './components/KcykModal.vue';
......@@ -89,9 +91,9 @@
import { searchFormSchema, columns } from './components/config';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
import Icon from '/@/components/Icon/index';
......@@ -102,70 +104,104 @@
const listSpliceNum = ref(3); //操作列最先展示几个
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import { log } from 'console';
const pageParamsInfo = ref<any>({});
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
const pageParamsInfo = ref<any>({});
const { enableLockeData, handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
useConcurrentLock();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth, hasPermission } = usePermission();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth, hasPermission } = usePermission();
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(["create"]);
const buttonConfigs = computed(()=>{
const list = [{"isUse":true,"name":"生成单据","code":"create","icon":"ant-design:download-outlined","isDefault":false,"setting":[],"showType":"inline","buttonType":"primary"}]
//展示在列表内的按钮
const actionButtons = ref<string[]>(["create"]);
const buttonConfigs = computed(() => {
const list = [{ "buttonId": "2016441785685393408", "name": "生成单据", "code": "create", "icon": "ant-design:download-outlined", "isDefault": false, "isUse": true, "setting": [], "showType": "inline", "buttonType": "primary" }]
return filterButtonAuth(list);
})
})
const tableButtonConfig = computed(() => {
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
});
const actionButtonConfig = computed(() => {
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
// 调用生成单据接口
const btnEvent = {
create: async (record) => {
try {
const response = await fetch(getAppEnvConfig().VITE_GLOB_API_URL + '/ckgl/kcyk/addslip', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${getToken()}`
},
body: JSON.stringify(record)
});
const btnEvent = {}
if (response.ok) {
notification.success({
message: '成功',
description: '生成单据成功'
});
// 刷新列表
reload();
} else {
const error = await response.json();
notification.error({
message: '失败',
description: error.message || '生成单据失败'
});
}
} catch (error) {
notification.error({
message: '错误',
description: '生成单据时发生错误'
});
console.error('生成单据失败:', error);
}
}
}
const { currentRoute } = useRouter();
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
const [registerModal, { openModal }] = useModal();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, }] = useTable({
const [registerTable, { reload, }] = useTable({
title: 'Kcyk列表',
api: getMesWarehouseProfitandlossPage,
rowKey: 'id',
......@@ -179,9 +215,9 @@
fieldMapToTime: [],
showResetButton: false,
},
bordered:false,
bordered: false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
pageParamsInfo.value = { ...params, FormId: formIdComputedRef.value, PK: 'id' }
return pageParamsInfo.value;
},
afterFetch: (res) => {
......@@ -212,15 +248,15 @@
isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
});
});
function buttonClick(code) {
function buttonClick(code) {
btnEvent[code]();
}
}
......@@ -232,14 +268,28 @@
function onSelectChange(selectedRowKeys: [], selectedRows) {
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) {
console.log(record);
// 强制根据盈亏状态设置行背景色
let rowStyle = {};
if (record.ykzt == '亏') {
// 亏损状态 - 红色背景
rowStyle = {
'color': 'red'
};
} else if (record.ykzt == '盈') {
// 盈利状态 - 绿色背景
rowStyle = {
'color': 'green'
};
}
function customRow(record: Recordable) {
return {
style: rowStyle,
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
......@@ -256,40 +306,40 @@
}
},
};
}
}
function handleSuccess() {
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
}
}
function handleFormSuccess() {
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleFormCancel() {
}
function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
}
function getLessActions(record: Recordable) {
function getLessActions(record: Recordable) {
let list = getActions(record);
return list.slice(0, listSpliceNum.value);
}
function getMoreActions(record: Recordable) {
}
function getMoreActions(record: Recordable) {
let list = getActions(record);
return list.slice(listSpliceNum.value);
}
function getActions(record: Recordable):ActionItem[] {
}
function getActions(record: Recordable): ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
......@@ -316,25 +366,20 @@
}
});
return actionsList;
}
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
:deep(.ant-table-selection-col) {
width: 50px;
}
}
.show{
.show {
display: flex;
}
}
.hide{
.hide {
display: none !important;
}
}
</style>
......@@ -3,8 +3,8 @@ import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'ywhb',
label: '业务伙伴',
field: 'ywzz',
label: '业务组织',
defaultValue: undefined,
component: 'Input',
},
......@@ -15,6 +15,24 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'dbrq',
label: '调拨日期',
defaultValue: undefined,
component: 'RangePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm:ss',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
{
field: 'lydj',
label: '来源单据',
defaultValue: undefined,
component: 'Input',
},
{
field: 'ck',
label: '仓库',
defaultValue: undefined,
......@@ -34,8 +52,8 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'ywhb',
title: '业务伙伴',
dataIndex: 'ywzz',
title: '业务组织',
componentType: 'input',
fixed: false,
......@@ -194,8 +212,8 @@ export const formProps: FormProps = {
list: [
{
key: '47ec86ca7bf342d798e4ef44e302f987',
field: 'ywhb',
label: '业务伙伴',
field: 'ywzz',
label: '业务组织',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -204,7 +222,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入业务伙伴',
placeholder: '请输入业务组织',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -584,14 +602,21 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'dic',
params: { itemId: '2010541442849521665' },
labelField: 'name',
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
path: '/getStoreLocation',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
apiId: 'd55f1866db284ecd8b038a3956b9c5b7',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select name as value,name as label from mes_storage_location where delete_mark = 0 ";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
......@@ -600,6 +625,7 @@ export const formProps: FormProps = {
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2010541442849521665',
defaultSelect: null,
listStyle: "return 'border: 0'",
},
},
......
......@@ -6,8 +6,8 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务伙伴',
fieldId: 'ywhb',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'input',
......
......@@ -133,7 +133,7 @@
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isEnableLock":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]
const list = [{"buttonId":"2010602997717409792","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2010602997717409793","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2010602997717409794","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2010602997717409795","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
......@@ -176,7 +176,7 @@
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
fieldMapToTime: [],
fieldMapToTime: [['dbrq', ['dbrqStart', 'dbrqEnd'], 'YYYY-MM-DD HH:mm:ss ', true],],
showResetButton: false,
},
bordered:false,
......
......@@ -3,8 +3,8 @@ import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'ywhb',
label: '业务伙伴',
field: 'ywzz',
label: '业务组织',
defaultValue: undefined,
component: 'Input',
},
......@@ -47,19 +47,13 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'cgy',
label: '仓管员',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'ywhb',
title: '业务伙伴',
dataIndex: 'ywzz',
title: '业务组织',
componentType: 'input',
fixed: false,
......@@ -218,8 +212,8 @@ export const formProps: FormProps = {
list: [
{
key: '47ec86ca7bf342d798e4ef44e302f987',
field: 'ywhb',
label: '业务伙伴',
field: 'ywzz',
label: '业务组织',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -228,7 +222,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入业务伙伴',
placeholder: '请输入业务组织',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -657,14 +651,21 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'dic',
params: { itemId: '2010541442849521665' },
labelField: 'name',
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
path: '/getStoreLocation',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
apiId: 'd55f1866db284ecd8b038a3956b9c5b7',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select name as value,name as label from mes_storage_location where delete_mark = 0 ";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
......@@ -673,6 +674,7 @@ export const formProps: FormProps = {
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2010541442849521665',
defaultSelect: null,
listStyle: "return 'border: 0'",
},
},
......
......@@ -6,8 +6,8 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务伙伴',
fieldId: 'ywhb',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'input',
......
......@@ -51,19 +51,19 @@
// 常驻输入框
customRender: ({ record }) =>
h(InputNumber, {
value: 0,
//value: 0,
min: 0,
max: 999999,
size: 'small',
style: { width: '100%' },
// onChange: (val) => (record.sl = val),
onChange: (val) => (record.sl = val),
}),
},
];
/* 打开弹窗 - 父组件调用 */
function open(rows: any[]) {
tableData.value = rows.map((r) => ({ ...r, blsl: r.blsl || 0 }));
tableData.value = rows.map((r) => ({ ...r,sl: 0}));
openModal(true);
}
......@@ -73,7 +73,7 @@
if (loading.value) return;
// 简单校验:数量不能全 0
const allZero = tableData.value.every((r) => r.blsl === 0);
const allZero = tableData.value.every((r) => r.sl === null || r.sl === 0);
if (allZero) {
createMessage.warning('请至少输入一行领料数量'); // ✅ 用 createMessage
return;
......
<template>
<BasicModal
:height="500"
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: 900,
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>
<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 { addMesBaseCplx, getMesBaseCplx, updateMesBaseCplx } from '/@/api/jcsj/cplx';
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 getMesBaseCplx(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 updateMesBaseCplx(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 addMesBaseCplx(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>
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'cm',
label: '类型名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'pid',
label: '父类别',
defaultValue: undefined,
component: 'ApiCascader',
componentProps: {
apiConfig: {
path: '/jcxx/cplx/getAllCPLXTree_zujian',
method: 'GET',
apiId: 'copy1770283483454d34933',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'code',
value: null,
description: null,
required: false,
dataType: 'String',
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql = ""\r\n + "select id,"\r\n + " pid as \'parentId\', "\r\n + " id as \'value\', "\r\n + " cm as \'label\' "\r\n + "from mes_base_cplx "\r\n + "where delete_mark = 0 "\r\n + "order by pid, id";\r\nvar list = db.select(sql);\r\n\r\nif (list == null || list.size() == 0) {\r\n return [];\r\n}\r\nvar map = new HashMap();\r\nvar idx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n itemNode.children = [];\r\n map.put(itemNode.id, itemNode);\r\n idx = idx + 1;\r\n}\r\nvar dataList = [];\r\nidx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n if (itemNode.parentId == null || itemNode.parentId == \'0\' || itemNode.parentId == \'\') {\r\n dataList.add(itemNode);\r\n } else {\r\n var parentNode = map.get(itemNode.parentId);\r\n if (parentNode != null) {\r\n parentNode.children.add(itemNode);\r\n } else {\r\n dataList.add(itemNode);\r\n }\r\n }\r\n idx = idx + 1;\r\n}\r\nreturn dataList\r\n',
},
showFormat: 'all',
separator: '/',
selectedConfig: 'any',
},
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'cm',
title: '类型名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'pid',
title: '父类别',
componentType: 'cascader',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'bh',
title: '类型编码',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'paixu',
title: '排序',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'bz',
title: '备注',
componentType: 'textarea',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
//表单事件
export const formEventConfigs = {
0: [
{
type: 'circle',
color: '#2774ff',
text: '开始节点',
icon: '#icon-kaishi',
bgcColor: '#D8E5FF',
isUserDefined: false,
},
{
color: '#F6AB01',
icon: '#icon-chushihua',
text: '初始化表单',
bgcColor: '#f9f5ea',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
1: [
{
color: '#B36EDB',
icon: '#icon-shujufenxi',
text: '获取表单数据',
detail: '(新增无此操作)',
bgcColor: '#F8F2FC',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
2: [
{
color: '#F8625C',
icon: '#icon-jiazai',
text: '加载表单',
bgcColor: '#FFF1F1',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
3: [
{
color: '#6C6AE0',
icon: '#icon-jsontijiao',
text: '提交表单',
bgcColor: '#F5F4FF',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
4: [
{
type: 'circle',
color: '#F8625C',
text: '结束节点',
icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6',
isLast: true,
isUserDefined: false,
},
],
};
export const formProps: FormProps = {
labelCol: { span: 3, offset: 0 },
labelAlign: 'right',
layout: 'horizontal',
size: 'default',
schemas: [
{
key: 'd8a01b822ee141d6913c8db73c37d07a',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: 'db121a41243b404a90482cb07852313a',
field: 'cm',
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: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '8eaade4e896f41d1a0d1c0374a7268c7',
field: 'pid',
label: '父类别',
type: 'cascader',
component: 'ApiCascader',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择父类别',
showFormat: 'all',
separator: '/',
selectedConfig: 'any',
disabled: false,
allowClear: false,
showLabel: true,
apiConfig: {
path: '/jcxx/cplx/getAllCPLXTree_zujian',
method: 'GET',
apiId: 'copy1770283483454d34933',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'code',
value: null,
description: null,
required: false,
dataType: 'String',
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql = ""\r\n + "select id,"\r\n + " pid as \'parentId\', "\r\n + " id as \'value\', "\r\n + " cm as \'label\' "\r\n + "from mes_base_cplx "\r\n + "where delete_mark = 0 "\r\n + "order by pid, id";\r\nvar list = db.select(sql);\r\n\r\nif (list == null || list.size() == 0) {\r\n return [];\r\n}\r\nvar map = new HashMap();\r\nvar idx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n itemNode.children = [];\r\n map.put(itemNode.id, itemNode);\r\n idx = idx + 1;\r\n}\r\nvar dataList = [];\r\nidx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n if (itemNode.parentId == null || itemNode.parentId == \'0\' || itemNode.parentId == \'\') {\r\n dataList.add(itemNode);\r\n } else {\r\n var parentNode = map.get(itemNode.parentId);\r\n if (parentNode != null) {\r\n parentNode.children.add(itemNode);\r\n } else {\r\n dataList.add(itemNode);\r\n }\r\n }\r\n idx = idx + 1;\r\n}\r\nreturn dataList\r\n',
},
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'e0ca71c675704d2db7029f845aba3f86',
field: 'bh',
label: '类型编码',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请输入类型编码',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
showLabel: true,
autoCodeRule: 'cplx',
required: true,
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'ec842ddda4a14613b585f6e9904257ec',
field: 'paixu',
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: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 0,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
{
key: '9501144a835544dab10f5dd0b1fbf0ca',
field: 'bz',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入备注',
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
isShowAi: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
actionColOptions: { span: 24 },
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
};
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '类型名称',
fieldId: 'cm',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'db121a41243b404a90482cb07852313a',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '父类别',
fieldId: 'pid',
isSubTable: false,
showChildren: true,
type: 'cascader',
key: '8eaade4e896f41d1a0d1c0374a7268c7',
children: [],
options: {},
},
{
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '类型编码',
fieldId: 'bh',
isSubTable: false,
showChildren: true,
type: 'auto-code',
key: 'e0ca71c675704d2db7029f845aba3f86',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '排序',
fieldId: 'paixu',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'ec842ddda4a14613b585f6e9904257ec',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'bz',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: '9501144a835544dab10f5dd0b1fbf0ca',
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>
<CplxModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesBaseCplxPage, deleteMesBaseCplx} from '/@/api/jcsj/cplx';
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 CplxModal from './components/CplxModal.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","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2019334653844258816","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2019334653844258817","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2019334653844258818","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2019334653844258819","name":"删除","code":"delete","icon":"ant-design:delete-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,edit : handleEdit,delete : handleDelete,}
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: 'Cplx列表',
api: getMesBaseCplxPage,
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: 195,
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, });
}
async function handleEdit(record: Recordable) {
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
if (hasIn) {
let res = await handleOpenFormEnableLockeData(
record[field],
formIdComputedRef.value,
);
if (res !== null) {
return;
}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteMesBaseCplx(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("cplx: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: `cplx:${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: `cplx:${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>
......@@ -19,52 +19,42 @@ export const searchFormSchema: FormSchema[] = [
field: 'cplx',
label: '产品类别',
defaultValue: undefined,
component: 'XjrSelect',
component: 'ApiCascader',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2003761375221407745' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'xh',
label: '型号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'hjzt',
label: '合金状态',
defaultValue: undefined,
component: 'Input',
},
{
field: 'nbdm',
label: '内部代码',
defaultValue: undefined,
component: 'Input',
},
apiConfig: {
path: '/jcxx/cplx/getAllCPLXTree_zujian',
method: 'GET',
apiId: 'copy1770283483454d34933',
apiParams: [
{
field: 'sfyx',
label: '有效的',
defaultValue: 1,
component: 'Select',
componentProps: {
getPopupContainer: () => document.body,
options: [
key: '1',
title: 'Query Params',
tableInfo: [
{
label: '开',
value: 1,
name: 'code',
value: null,
description: null,
required: false,
dataType: 'String',
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
{
label: '关',
value: 0,
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql = ""\r\n + "select id,"\r\n + " pid as \'parentId\', "\r\n + " id as \'value\', "\r\n + " cm as \'label\' "\r\n + "from mes_base_cplx "\r\n + "where delete_mark = 0 "\r\n + "order by pid, id";\r\nvar list = db.select(sql);\r\n\r\nif (list == null || list.size() == 0) {\r\n return [];\r\n}\r\nvar map = new HashMap();\r\nvar idx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n itemNode.children = [];\r\n map.put(itemNode.id, itemNode);\r\n idx = idx + 1;\r\n}\r\nvar dataList = [];\r\nidx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n if (itemNode.parentId == null || itemNode.parentId == \'0\' || itemNode.parentId == \'\') {\r\n dataList.add(itemNode);\r\n } else {\r\n var pid = null;\r\n if (itemNode.parentId.contains(",")){\r\n var arr = itemNode.parentId.split(",");\r\n pid=arr[arr.length-1]\r\n }else{\r\n pid=itemNode.parentId;\r\n }\r\n var parentNode = map.get(pid);\r\n if (parentNode != null) {\r\n parentNode.children.add(itemNode);\r\n } else {\r\n dataList.add(itemNode);\r\n }\r\n }\r\n idx = idx + 1;\r\n}\r\nreturn dataList\r\n',
},
showFormat: 'all',
separator: '/',
selectedConfig: 'any',
},
},
];
......@@ -98,19 +88,6 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'cplx',
title: '产品类别',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'gg',
title: '规格',
componentType: 'input',
......@@ -137,48 +114,22 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'hjzt',
title: '合金状态',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'nbdm',
title: '内部代码',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'erpid',
title: 'ERP ID',
componentType: 'input',
dataIndex: 'cplx',
title: '产品类别',
componentType: 'cascader',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'sfyx',
title: '有效的',
componentType: 'switch',
dataIndex: 'bzzl',
title: '标准重量',
componentType: 'number',
fixed: false,
sorter: true,
......@@ -566,42 +517,58 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: '61a60627cf7b44b5a3131074bebc5a64',
key: '2c05765e50b44fa8be4aec443066f781',
field: 'cplx',
label: '产品类别',
type: 'select',
component: 'XjrSelect',
type: 'cascader',
component: 'ApiCascader',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择产品类别',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
placeholder: '请选择产品类别',
showFormat: 'all',
separator: '/',
selectedConfig: 'any',
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'dic',
labelField: 'name',
valueField: 'value',
allowClear: false,
showLabel: true,
apiConfig: {
path: 'CodeGeneration/selection',
path: '/jcxx/cplx/getAllCPLXTree_zujian',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
apiId: 'copy1770283483454d34933',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'code',
value: null,
description: null,
required: false,
dataType: 'String',
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql = ""\r\n + "select id,"\r\n + " pid as \'parentId\', "\r\n + " id as \'value\', "\r\n + " cm as \'label\' "\r\n + "from mes_base_cplx "\r\n + "where delete_mark = 0 "\r\n + "order by pid, id";\r\nvar list = db.select(sql);\r\n\r\nif (list == null || list.size() == 0) {\r\n return [];\r\n}\r\nvar map = new HashMap();\r\nvar idx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n itemNode.children = [];\r\n map.put(itemNode.id, itemNode);\r\n idx = idx + 1;\r\n}\r\nvar dataList = [];\r\nidx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n if (itemNode.parentId == null || itemNode.parentId == \'0\' || itemNode.parentId == \'\') {\r\n dataList.add(itemNode);\r\n } else {\r\n var pid = null;\r\n if (itemNode.parentId.contains(",")){\r\n var arr = itemNode.parentId.split(",");\r\n pid=arr[arr.length-1]\r\n }else{\r\n pid=itemNode.parentId;\r\n }\r\n var parentNode = map.get(pid);\r\n if (parentNode != null) {\r\n parentNode.children.add(itemNode);\r\n } else {\r\n dataList.add(itemNode);\r\n }\r\n }\r\n idx = idx + 1;\r\n}\r\nreturn dataList\r\n',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
params: { itemId: '2003761375221407745' },
itemId: '2003761375221407745',
style: { width: '100%' },
},
},
......@@ -930,14 +897,10 @@ export const formProps: FormProps = {
};
export const treeConfig = {
id: '1768452851557543938',
isMultiple: false,
name: 'api树',
id: '2019350969972043778',
isMultiple: true,
name: '产品类型',
type: 2,
configTip: '',
config: [
{ bindFiled: '', name: 'label-0', value: 'a' },
{ bindFiled: '', name: '测试', value: 'b' },
{ bindFiled: '', name: '开发', value: 'c' },
],
configTip: '已配置',
config: [{ bindFiled: 'cplx', name: '类型名称', value: 'value' }],
};
......@@ -127,8 +127,8 @@ export const permissionList = [
fieldId: 'cplx',
isSubTable: false,
showChildren: true,
type: 'select',
key: '61a60627cf7b44b5a3131074bebc5a64',
type: 'cascader',
key: '2c05765e50b44fa8be4aec443066f781',
children: [],
options: {},
},
......
......@@ -5,24 +5,7 @@
<ResizePageWrapper :hasLeft="true" :formLeftWidth="300">
<template #resizeLeft>
<BasicTree
title="产品类别"
toolbar
search
switcher
:clickRowToExpand="true"
:treeData="treeData"
:fieldNames="{ key: 'value', title: 'name' }"
@select="handleSelect"
>
<template #title="item">
<template v-if="item.renderIcon === 'childIcon'">
<Icon icon="ant-design:appstore-outlined" />
</template>
&nbsp;&nbsp;{{ item.name }}
</template>
</BasicTree>
<TreeStructure :treeConfig="treeConfig" @select="handleSelectTree"/>
</template>
......@@ -45,14 +28,7 @@
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.componentType === 'switch'">
<a-switch
v-model:checked="record[column.dataIndex]"
:unCheckedValue="0"
:checkedValue="1"
:disabled="true"
/>
</template>
<template v-if="column.dataIndex === 'action'">
......@@ -125,7 +101,7 @@
import Icon from '/@/components/Icon/index';
import { BasicTree, TreeItem } from '/@/components/Tree';
import { getDicDetailList } from '/@/api/system/dic';
......@@ -376,9 +352,6 @@
}
async function fetch() {
treeData.value = (await getDicDetailList({
itemId: '2003761375221407745',
})) as unknown as TreeItem[];
......
......@@ -102,12 +102,11 @@ export const columns: BasicColumn[] = [
dataIndex: 'lch',
title: '炉次号',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
listStyle: '',
},
{
......@@ -120,7 +119,7 @@ export const columns: BasicColumn[] = [
sorter: true,
styleConfig: undefined,
listStyle: undefined,
listStyle: '',
},
{
......@@ -131,7 +130,6 @@ export const columns: BasicColumn[] = [
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
......@@ -150,6 +148,18 @@ export const columns: BasicColumn[] = [
},
{
resizable: true,
dataIndex: 'yxj',
title: '优先级',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'ywzz',
title: '业务组织',
componentType: 'select',
......@@ -159,7 +169,7 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: undefined,
},
}
];
//表头合并配置
export const headerMergingData = [];
......@@ -273,7 +283,7 @@ export const formProps: FormProps = {
},
},
{
key: 'lkajsldjaljdla',
key: 'm7r1m6f9e6z4l0l7d4c7q8a2f3o2m7c4',
field: 'ywzz',
label: '业务组织',
type: 'select',
......@@ -320,43 +330,6 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
/* {
key: 'b22f0a133613428f84ee08c70c61311b',
field: 'zch',
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: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},*/
{
key: '25e30bcce47a437fb5674d9dbce3523a',
field: 'zl',
......@@ -527,7 +500,7 @@ export const formProps: FormProps = {
},
},
{
key: '312djfjdjd',
key: 'i3r5y5h5u6w6v0m9i5v0z5w0i4f8b8m6',
field: 'zt',
label: '状态',
type: 'input',
......@@ -771,7 +744,7 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: 'fsdfsdf',
key: 'u2r5o6w9o9l2w3k4z4g5f7x9w4b5b1a0',
field: 'lch',
label: '炉次号',
type: 'input',
......@@ -1225,7 +1198,7 @@ export const formProps: FormProps = {
{ span: 6,
list: [
{
key: 'fsfsdfsdfsfa',
key: 'v2n5h0j9v1k1b5n6n7i2a1d8t8y4x8s7',
field: 'yxj',
label: '优先级',
type: 'select',
......@@ -1319,282 +1292,6 @@ export const formProps: FormProps = {
componentProps: {
mainKey: 'mesProductionGongdanList',
columns: [
// {
// key: '2745856f030c4f4b8488732136060d78',
// title: '任务编号',
// dataIndex: 'rwbh',
// 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: 'e2a2a9437363423b93f280617e27d8d2',
// title: '计划编号',
// dataIndex: 'jhbh',
// 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: '589c359e5a7e498695fcf5c224a5e557',
// title: '熔次号',
// dataIndex: 'rch',
// 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: '2957c762b0a3437f872fdab6f46544c2',
// title: '铸次号',
// dataIndex: 'zch',
// 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: 'c1ed5718a38d45d298352ea8b22eb2b8',
// title: '合金标准',
// dataIndex: 'hjzt',
// componentType: 'XjrSelect',
// componentProps: {
// width: '100%',
// span: '',
// placeholder: '请选择下拉选择',
// showLabel: true,
// showSearch: false,
// isMultiple: false,
// clearable: false,
// disabled: false,
// staticOptions: [
// { key: 1, label: 'Option 1', value: 'Option 1' },
// { key: 2, label: 'Option 2', value: 'Option 2' },
// { key: 3, label: 'Option 3', value: 'Option 3' },
// ],
// defaultSelect: '',
// datasourceType: 'api',
// labelField: 'label',
// valueField: 'value',
// apiConfig: {
// path: '/zlgl//zjjcsj/getHjbz',
// method: 'GET',
// apiId: '36768924878d48e5ac3b3b24fc25765e',
// apiParams: [
// { key: '1', title: 'Query Params', tableInfo: [] },
// { key: '2', title: 'Header', tableInfo: [] },
// { key: '3', title: 'Body' },
// ],
// script:
// 'var sql="select id as value,name as label from mes_alloy_standard where delete_mark = 0";\r\nreturn db.select(sql);',
// },
// dicOptions: [],
// required: false,
// rules: [],
// events: {},
// isShow: true,
// tooltipConfig: { visible: false, title: '提示文本' },
// listStyle: "return 'border: 0'",
// },
// },
// {
// key: '69da890610284539b4ad26bed8e9c566',
// title: '产品ID',
// dataIndex: 'cpid',
// componentType: 'Input',
// defaultValue: '',
// componentProps: {
// width: '100%',
// span: '',
// defaultValue: '',
// placeholder: '请输入产品ID',
// prefix: '',
// suffix: '',
// addonBefore: '',
// addonAfter: '',
// disabled: false,
// allowClear: false,
// showLabel: true,
// required: false,
// rules: [],
// events: {},
// listStyle: '',
// isSave: false,
// isShow: false,
// scan: false,
// bordered: true,
// isShowAi: false,
// tooltipConfig: { visible: false, title: '提示文本' },
// },
// },
// {
// key: 'dc242ae845f1489a8cc2f47c98b565b8',
// title: '产品类型',
// dataIndex: 'cplx',
// componentType: 'XjrSelect',
// componentProps: {
// width: '100%',
// span: '',
// placeholder: '请选择下拉选择',
// showLabel: true,
// showSearch: false,
// isMultiple: false,
// clearable: false,
// disabled: false,
// staticOptions: [
// { key: 1, label: 'Option 1', value: 'Option 1' },
// { key: 2, label: 'Option 2', value: 'Option 2' },
// { key: 3, label: 'Option 3', value: 'Option 3' },
// ],
// datasourceType: 'dic',
// params: { itemId: '2003761375221407745' },
// labelField: 'name',
// valueField: 'value',
// apiConfig: {
// path: 'CodeGeneration/selection',
// method: 'GET',
// apiId: '93d735dcb7364a0f8102188ec4d77ac7',
// },
// dicOptions: [],
// required: false,
// rules: [],
// events: {},
// isShow: true,
// tooltipConfig: { visible: false, title: '提示文本' },
// itemId: '2003761375221407745',
// defaultSelect: '',
// listStyle: "return 'border: 0'",
// },
// },
// {
// key: '7e31a788100b4eefba52c3a36443ba87',
// title: '客户',
// dataIndex: 'kh',
// componentType: 'XjrSelect',
// componentProps: {
// width: '100%',
// placeholder: '请选择客户',
// showLabel: true,
// showSearch: false,
// isMultiple: false,
// clearable: false,
// disabled: false,
// staticOptions: [
// { key: 1, label: 'Option 1', value: 'Option 1' },
// { key: 2, label: 'Option 2', value: 'Option 2' },
// { key: 3, label: 'Option 3', value: 'Option 3' },
// ],
// defaultSelect: '',
// datasourceType: 'api',
// labelField: 'label',
// valueField: 'value',
// apiConfig: {
// path: '/jcxx/getKhList',
// method: 'GET',
// apiId: '7bc8db3faba24b19a997856f6ef0b27e',
// apiParams: [
// { key: '1', title: 'Query Params', tableInfo: [] },
// { key: '2', title: 'Header', tableInfo: [] },
// { key: '3', title: 'Body' },
// ],
// script:
// 'var sql="select id as value,name as label from roke_partner where delete_mark = 0 and customer = \'1\'";\r\nreturn db.select(sql);',
// },
// dicOptions: [],
// required: false,
// rules: [],
// events: {},
// isShow: true,
// tooltipConfig: { visible: false, title: '提示文本' },
// listStyle: "return 'border: 0'",
// },
// },
{
key: '16fd1699db7744379edd01b6eb5653f9',
title: '工序编号',
......
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'lkajsldjaljdla',
children: [],
options: {},
},
{
required: false,
view: true,
......@@ -38,23 +23,6 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '铸次号',
fieldId: 'zch',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'b22f0a133613428f84ee08c70c61311b',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '重量/KG',
fieldId: 'zl',
isSubTable: false,
......@@ -182,6 +150,22 @@ export const permissionList = [
options: {},
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'm7r1m6f9e6z4l0l7d4c7q8a2f3o2m7c4',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
......@@ -225,7 +209,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: 'fsdfsdf',
key: 'u2r5o6w9o9l2w3k4z4g5f7x9w4b5b1a0',
children: [],
options: {},
defaultValue: '',
......@@ -242,7 +226,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: '312djfjdjd',
key: 'i3r5y5h5u6w6v0m9i5v0z5w0i4f8b8m6',
children: [],
options: {},
defaultValue: '',
......@@ -259,7 +243,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: 'fsfsdfsdfsfa',
key: 'v2n5h0j9v1k1b5n6n7i2a1d8t8y4x8s7',
children: [],
options: {},
defaultValue: '',
......
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