Commit f6b76856 by 宋春膨

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

parents 33196f48 713a778a
...@@ -8,9 +8,7 @@ enum Api { ...@@ -8,9 +8,7 @@ enum Api {
List = '/jcsj/ckwz/list', List = '/jcsj/ckwz/list',
Info = '/jcsj/ckwz/info', Info = '/jcsj/ckwz/info',
RokeStockLocation = '/jcsj/ckwz', RokeStockLocation = '/jcsj/ckwz',
Tree = '/jcsj/ckwz/tree',
} }
/** /**
...@@ -88,6 +86,20 @@ export async function deleteRokeStockLocation(ids: string[], mode: ErrorMessageM ...@@ -88,6 +86,20 @@ export async function deleteRokeStockLocation(ids: string[], mode: ErrorMessageM
); );
} }
/**
* @description: 获取位置树数据
*/
export async function getRokeStockLocationTree(mode: ErrorMessageMode = 'modal') {
return defHttp.get<any>(
{
url: Api.Tree,
},
{
errorMessageMode: mode,
},
);
}
...@@ -4,15 +4,13 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; ...@@ -4,15 +4,13 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: RokeProcess分页参数 模型 * @description: RokeProcess分页参数 模型
*/ */
export interface RokeProcessPageParams extends BasicPageParams { export interface RokeProcessPageParams extends BasicPageParams {
name: string; code: string;
defaultReporter: string; name: string;
categoryId: string; categoryId: string;
collectionSchemeId: string; collectionSchemeId: string;
note: string;
} }
/** /**
...@@ -21,18 +19,243 @@ export interface RokeProcessPageParams extends BasicPageParams { ...@@ -21,18 +19,243 @@ export interface RokeProcessPageParams extends BasicPageParams {
export interface RokeProcessPageModel { export interface RokeProcessPageModel {
id: string; id: string;
code: string;
name: string; name: string;
categoryId: string; categoryId: string;
collectionSchemeId: string; collectionSchemeId: string;
}
/**
* @description: RokeProcess表类型
*/
export interface RokeProcessModel {
id: string;
deleteMark: string;
messageMainAttachmentId: string;
name: string;
code: string;
categoryId: string;
processType: string;
internalCode: string;
active: string;
withoutWoProduce: string;
note: string;
ratedWorkingHours: string; ratedWorkingHours: string;
companyId: string;
isPress: string;
prepareWorkHours: string;
collectionSchemeId: string;
qualityMode: string;
qcSchemeId: string;
isQuality: string;
salaryType: string;
baseQty: string;
salaryUnit: string;
salary: string;
salaryCode: string;
qcSalaryBasis: string;
qcSalaryType: string;
qcBaseQty: string;
qcSalaryUnit: string;
qcSalary: string;
qcSalaryCode: string;
defaultReporter: string;
collectionItem: string;
inspectionCollectionItem: string;
inspectionScheme: string;
inspectionDepartment: string;
inspectionStaff: string;
defectProcessing: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
zyzdFile: string;
zyzdtpFile: string;
mesProcessItemList?: MesProcessItemModel;
mesProcessProductList?: MesProcessProductModel;
}
/**
* @description: MesProcessItem表类型
*/
export interface MesProcessItemModel {
id: string;
processId: string;
code: string;
name: string;
required: string;
categoryId: string;
contentType: string;
dataType: string;
dictId: string;
relatedModelId: string;
relatedModelName: string;
relatedModelDomain: string;
standardValue: string;
upperValue: string;
lowerValue: string;
note: string; note: string;
companyId: string;
qualityCategoryId: string;
analysisMethod: string;
qualityMethodId: string;
destructive: string;
keyItem: string;
deleteMark: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
} }
0; /**
* @description: MesProcessProduct表类型
*/
export interface MesProcessProductModel {
id: string;
deleteMark: string;
cpbh: string;
cpmc: string;
nbdm: string;
hjzt: string;
cptp: string;
kxs: string;
kcg: string;
wllx: string;
cplx: string;
gg: string;
xh: string;
fpl: string;
bzzl: string;
erpid: string;
zygf: 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;
processId: string;
isFeeding: string;
number: string;
}
/** /**
* @description: RokeProcess分页返回值结构 * @description: RokeProcess分页返回值结构
......
...@@ -8,7 +8,7 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -8,7 +8,7 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'Input',
}, },
{ /* {
field: 'parentId', field: 'parentId',
label: '上级位置', label: '上级位置',
defaultValue: undefined, defaultValue: undefined,
...@@ -33,7 +33,7 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -33,7 +33,7 @@ export const searchFormSchema: FormSchema[] = [
showSearch: true, showSearch: true,
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
}, },
}, },*/
{ {
field: 'locationType', field: 'locationType',
label: '位置类型', label: '位置类型',
......
<template> <template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<div class="w-1/5 xl:w-1/5 mr-2">
<ResizePageWrapper :hasLeft="false"> <BasicTree
title="上级位置"
toolbar
<template #resizeRight> search
<BasicTable @register="registerTable" isMenuTable ref="tableRef" :defaultExpandAll="true"
:clickRowToExpand="true"
> :treeData="treeData"
:fieldNames="{ key: 'id', title: 'name' }"
@select="handleSelect"
>
<template #title="item"> &nbsp;&nbsp;{{ item.name }} </template>
</BasicTree>
</div>
<div class="w-4/5 xl:w-4/5">
<BasicTable @register="registerTable" isMenuTable ref="tableRef">
<template #toolbar> <template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code"> <template v-for="button in tableButtonConfig" :key="button.code">
...@@ -45,29 +53,22 @@ ...@@ -45,29 +53,22 @@
</BasicTable> </BasicTable>
</template> </div>
<CkwzModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel" />
</PageWrapper>
<CkwzModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode, import { ref, computed, provide, Ref, createVNode, onMounted
} from 'vue'; } from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getRokeStockLocationPage, deleteRokeStockLocation} from '/@/api/jcsj/ckwz'; import { getRokeStockLocationPage, deleteRokeStockLocation, getRokeStockLocationTree} from '/@/api/jcsj/ckwz';
import { ResizePageWrapper } from '/@/components/Page'; import { PageWrapper } from '/@/components/Page';
import { BasicTree, TreeItem } from '/@/components/Tree';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
...@@ -117,6 +118,10 @@ ...@@ -117,6 +118,10 @@
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } = const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
useConcurrentLock(); useConcurrentLock();
// 树相关
const treeData = ref<TreeItem[]>([]);
const selectedParentId = ref<string>('');
const { notification } = useMessage(); const { notification } = useMessage();
const { t } = useI18n(); const { t } = useI18n();
defineEmits(['register']); defineEmits(['register']);
...@@ -181,7 +186,12 @@ ...@@ -181,7 +186,12 @@
}, },
bordered:false, bordered:false,
beforeFetch: (params) => { beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' } pageParamsInfo.value = {
...params,
FormId: formIdComputedRef.value,
PK: 'id',
parentId: selectedParentId.value || undefined,
};
return pageParamsInfo.value; return pageParamsInfo.value;
}, },
afterFetch: (res) => { afterFetch: (res) => {
...@@ -298,11 +308,38 @@ ...@@ -298,11 +308,38 @@
} }
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
// 树选择处理
function handleSelect(selectIds: string[]) {
selectedParentId.value = selectIds[0] || '';
reload();
}
// 加载树数据
async function loadTreeData() {
try {
const result = await getRokeStockLocationTree();
// 处理接口返回的数据格式:{code: 0, data: [...], success: true}
// defHttp 可能会自动提取 data,但也可能需要手动处理
let data = result;
if (result && typeof result === 'object' && 'data' in result && Array.isArray(result.data)) {
data = result.data;
} else if (result && typeof result === 'object' && 'success' in result && result.data) {
data = result.data;
}
if (Array.isArray(data)) {
treeData.value = data as TreeItem[];
}
} catch (error) {
console.error('加载位置树失败:', error);
}
}
onMounted(() => {
loadTreeData();
});
function handleFormSuccess() { function handleFormSuccess() {
......
export const permissionList = [ export const permissionList = [
{ {
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '编码',
fieldId: 'code',
isSubTable: false,
showChildren: true,
type: 'auto-code',
key: 'e0f5ab09b1e541d3bff26b82ad0ccf53',
children: [],
options: {},
},
{
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
...@@ -23,17 +39,18 @@ export const permissionList = [ ...@@ -23,17 +39,18 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '默认报工人员', fieldName: '作业指导',
fieldId: 'defaultReporter', fieldId: 'zyzdFile',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'upload',
key: 'aa72d19636d540078e40a0dae8b90e3c', key: 'f7c26bba94034dcdbc816e49607d64e9',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: false,
...@@ -55,12 +72,12 @@ export const permissionList = [ ...@@ -55,12 +72,12 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '是否委外', fieldName: '额定工时',
fieldId: 'prepareWorkHours', fieldId: 'ratedWorkingHours',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'switch', type: 'number',
key: 'aabb539eede446daa35c754416cc50ae', key: 'ca8257a46070472e9639110b11f7f3bd',
children: [], children: [],
options: {}, options: {},
defaultValue: 0, defaultValue: 0,
...@@ -76,11 +93,11 @@ export const permissionList = [ ...@@ -76,11 +93,11 @@ export const permissionList = [
fieldId: 'collectionSchemeId', fieldId: 'collectionSchemeId',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'associate-select',
key: '55d03e0607bc4ea281a248fdcfc571bb', key: '6a8f658eb0e046e48c3dac472c0e51ae',
children: [], children: [],
options: {}, options: {},
defaultValue: '', defaultValue: '2005534898818441218',
}, },
{ {
required: false, required: false,
...@@ -89,29 +106,12 @@ export const permissionList = [ ...@@ -89,29 +106,12 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '额定工时', fieldName: '有效',
fieldId: 'ratedWorkingHours',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'ca8257a46070472e9639110b11f7f3bd',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '有效的',
fieldId: 'active', fieldId: 'active',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'switch', type: 'switch',
key: 'e2c431530e954e53852f9a6026987e0d', key: 'c0730ef93c40445195dac1ed93677144',
children: [], children: [],
options: {}, options: {},
defaultValue: 1, defaultValue: 1,
...@@ -123,48 +123,194 @@ export const permissionList = [ ...@@ -123,48 +123,194 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '作业指导', fieldName: '备注',
fieldId: 'zyzdFile', fieldId: 'note',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'upload', type: 'textarea',
key: 'f7c26bba94034dcdbc816e49607d64e9', key: '037bf18717bf496f8a1fc0e8605a8a7d',
children: [], children: [],
options: {}, options: {},
defaultValue: '', defaultValue: '',
}, },
{ {
required: false, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: false,
isSaveTable: false, isSubTable: true,
tableName: '', showChildren: false,
fieldName: '作业指导', tableName: 'mesProcessProductList',
fieldId: 'zyzdtpFile', fieldName: '',
isSubTable: false, fieldId: 'mesProcessProductList',
showChildren: true, type: 'form',
type: 'upload', key: '7cb7c6cdf3ec417280dc49e19dd39ffa',
key: 'f40c42bc3b174f7589179a6b8976eb65', children: [
children: [], {
options: {}, required: true,
defaultValue: '', view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '编号',
fieldId: 'cpbh',
type: 'Input',
key: '00c0e93b675841f48265b896515a5241',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '名称',
fieldId: 'cpmc',
type: 'Input',
key: '91863c5a0ec24d76ade8735cd401059b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '数量',
fieldId: 'number',
type: 'InputNumber',
key: '6c749d8f7bde474da082c659146f473c',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '是否投料',
fieldId: 'isFeeding',
type: 'Switch',
key: 'cb38672445b24eedb2b10addf520de2e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '备注',
fieldId: 'bz',
type: 'InputTextArea',
key: '1084a7c39baf47ba9a0251cb4e2f8c14',
children: [],
},
],
}, },
{ {
required: false, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: false,
isSaveTable: false, isSubTable: true,
tableName: '', showChildren: false,
fieldName: '备注', tableName: 'mesProcessItemList',
fieldId: 'note', fieldName: '',
isSubTable: false, fieldId: 'mesProcessItemList',
showChildren: true, type: 'form',
type: 'textarea', key: '3fd474ce5f8c4bf78bd86dc701cbdc4f',
key: '04ae7a540acd4c46949c6fd53e652a45', children: [
children: [], {
options: {}, required: true,
defaultValue: '', view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
fieldName: '编码',
fieldId: 'code',
type: 'Input',
key: '3999831fde0a4e879f64f33eb2a1edd1',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
fieldName: '名称',
fieldId: 'name',
type: 'Input',
key: 'ab6576e960ee44b4af09975e64088f05',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
fieldName: '数据类型',
fieldId: 'dataType',
type: 'XjrSelect',
key: '745cb3bb014d4dd9ba38139d17b2f305',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
fieldName: '是否必填',
fieldId: 'required',
type: 'Switch',
key: '36a40652260d491e8a088ff843aab982',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
fieldName: '备注',
fieldId: 'note',
type: 'InputTextArea',
key: 'f3ba1f809888475d925665668e2a1851',
children: [],
},
],
}, },
]; ];
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]); const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{ 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":"2005548723533832192","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2005548723533832193","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2005548723533832194","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2005548723533832195","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list); return filterButtonAuth(list);
}) })
......
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