Commit 9ad58bbe by 宋春膨

refactor(wlqd): 物料清单功能重构

- 将BOM相关字段名称改为物料相关名称,包括BOM名称改为物料名称、BOM数量改为物料数量、BOM版本改为物料版本
- 移除产品编号、产品名称、产品规格、产品型号、备注等字段配置
- 添加导出功能,新增export API接口和导出按钮
- 添加导入功能,集成ImportModal组件
- 修改表格列配置,移除开关组件的自定义渲染
- 调整工作流权限配置中的字段名称和必填项设置
- 修改子表单中物料选择的相关字段配置
parent 5f8a1a8a
......@@ -10,6 +10,7 @@ enum Api {
MesBaseBom = '/jcsj/wlqd',
Export = '/jcsj/wlqd/export',
}
......@@ -90,4 +91,24 @@ export async function deleteMesBaseBom(ids: string[], mode: ErrorMessageMode = '
/**
* @description: 导出MesBaseBom
*/
export async function exportMesBaseBom(
params?: object,
mode: ErrorMessageMode = 'modal'
) {
return defHttp.download(
{
url: Api.Export,
method: 'GET',
params,
responseType: 'blob',
},
{
errorMessageMode: mode,
},
);
}
......@@ -6,23 +6,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesBaseBomPageParams extends BasicPageParams {
bommc: string;
bomsl: string;
bombb: string;
cpid: string;
cpbh: string;
cpmc: string;
cpgg: string;
cpxh: string;
sfyy: string;
bz: string;
}
/**
......@@ -37,19 +23,11 @@ export interface MesBaseBomPageModel {
bombb: string;
cpid: string;
sfyy: string;
cpbh: string;
cpmc: string;
cpgg: string;
cpxh: string;
bz: string;
}
/**
......
......@@ -4,22 +4,7 @@ import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'bommc',
label: 'BOM名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'bomsl',
label: 'BOM数量',
defaultValue: undefined,
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'bombb',
label: 'BOM版本',
label: '物料名称',
defaultValue: undefined,
component: 'Input',
},
......@@ -84,30 +69,6 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'cpbh',
label: '产品编号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpmc',
label: '产品名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpgg',
label: '产品规格',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpxh',
label: '产品型号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'sfyy',
label: '是否有效',
defaultValue: 1,
......@@ -126,20 +87,13 @@ export const searchFormSchema: FormSchema[] = [
],
},
},
{
field: 'bz',
label: '备注',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bommc',
title: 'BOM名称',
title: '物料名称',
componentType: 'input',
fixed: false,
......@@ -152,7 +106,7 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bomsl',
title: 'BOM数量',
title: '物料数量',
componentType: 'number',
fixed: false,
......@@ -165,46 +119,7 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bombb',
title: 'BOM版本',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpid',
title: '选择产品',
componentType: 'associate-popup',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'sfyy',
title: '是否有效',
componentType: 'switch',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'cpbh',
title: '产品编号',
title: '物料版本',
componentType: 'input',
fixed: false,
......@@ -252,19 +167,6 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'bz',
title: '备注',
componentType: 'textarea',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
......@@ -351,7 +253,7 @@ export const formProps: FormProps = {
{
key: '0bb6edfef8ac486482e02a6e650306e6',
field: 'bommc',
label: 'BOM名称',
label: '物料名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -360,7 +262,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入BOM名称',
placeholder: '请输入物料名称',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -389,7 +291,7 @@ export const formProps: FormProps = {
{
key: '4bc74304a0144e879b2fc45ae28ab1c5',
field: 'bomsl',
label: 'BOM数量',
label: '物料数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
......@@ -402,7 +304,7 @@ export const formProps: FormProps = {
disabled: false,
showLabel: true,
controls: true,
required: false,
required: true,
subTotal: false,
isShow: true,
rules: [],
......@@ -420,7 +322,7 @@ export const formProps: FormProps = {
{
key: '50bff2d4c82d40a98ace5fd2b1d3b41e',
field: 'bombb',
label: 'BOM版本',
label: '物料版本',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -429,7 +331,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入BOM版本',
placeholder: '请输入物料版本',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -521,7 +423,7 @@ export const formProps: FormProps = {
],
},
dicOptions: [],
required: false,
required: true,
rules: [],
events: {},
isShow: true,
......@@ -551,7 +453,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -589,7 +491,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -627,7 +529,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -665,7 +567,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -762,7 +664,7 @@ export const formProps: FormProps = {
},
{
key: 'c87fc2d18e24429a819521f35f19137b',
label: 'BOM清单',
label: '物料项',
field: 'mesBaseBomItemList',
type: 'form',
component: 'SubForm',
......@@ -774,12 +676,11 @@ export const formProps: FormProps = {
{
key: '709b38c05d11468db0db4e6e9168e4f9',
title: '选择物料',
dataIndex: 'bomid',
dataIndex: 'wlmc',
componentType: 'MultiplePopup',
componentProps: {
popupType: 'associate',
width: '100%',
span: 3,
placeholder: '请选择物料选择',
showLabel: true,
disabled: false,
......@@ -821,12 +722,12 @@ export const formProps: FormProps = {
],
},
dicOptions: [],
required: false,
required: true,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
prestrainField: 'name',
},
},
{
......@@ -837,7 +738,6 @@ export const formProps: FormProps = {
defaultValue: '',
componentProps: {
width: '100%',
span: 3,
defaultValue: '',
placeholder: '请输入物料编号',
prefix: '',
......@@ -863,27 +763,26 @@ export const formProps: FormProps = {
{
key: '112f6292bd884006ad872f06aeef4e6f',
title: '物料名称',
dataIndex: 'wlmc',
dataIndex: 'wuLiaoMingChen9398',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: 3,
defaultValue: '',
placeholder: '请输入物料名称',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
isSave: true,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
......@@ -899,7 +798,6 @@ export const formProps: FormProps = {
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
step: 1,
disabled: false,
......@@ -924,7 +822,6 @@ export const formProps: FormProps = {
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
step: 1,
disabled: false,
......@@ -949,7 +846,6 @@ export const formProps: FormProps = {
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
max: 100,
step: 1,
......@@ -975,7 +871,6 @@ export const formProps: FormProps = {
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
max: 100,
step: 1,
......@@ -1064,10 +959,10 @@ export const formProps: FormProps = {
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
buttonName: '选择物料',
showLabel: true,
showComponentBorder: true,
showBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
......
......@@ -6,7 +6,7 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'BOM名称',
fieldName: '物料名称',
fieldId: 'bommc',
isSubTable: false,
showChildren: true,
......@@ -17,13 +17,13 @@ export const permissionList = [
defaultValue: '',
},
{
required: false,
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'BOM数量',
fieldName: '物料数量',
fieldId: 'bomsl',
isSubTable: false,
showChildren: true,
......@@ -40,7 +40,7 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'BOM版本',
fieldName: '物料版本',
fieldId: 'bombb',
isSubTable: false,
showChildren: true,
......@@ -51,7 +51,7 @@ export const permissionList = [
defaultValue: '',
},
{
required: false,
required: true,
view: true,
edit: true,
disabled: false,
......@@ -69,7 +69,7 @@ export const permissionList = [
{
required: false,
view: true,
edit: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
......@@ -86,7 +86,7 @@ export const permissionList = [
{
required: false,
view: true,
edit: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
......@@ -103,7 +103,7 @@ export const permissionList = [
{
required: false,
view: true,
edit: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
......@@ -120,7 +120,7 @@ export const permissionList = [
{
required: false,
view: true,
edit: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
......@@ -176,7 +176,7 @@ export const permissionList = [
isSubTable: true,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: 'BOM清单',
fieldName: '物料项',
fieldId: 'mesBaseBomItemList',
type: 'form',
key: 'c87fc2d18e24429a819521f35f19137b',
......@@ -191,7 +191,7 @@ export const permissionList = [
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '选择物料',
fieldId: 'bomid',
fieldId: 'wlmc',
type: 'MultiplePopup',
key: '709b38c05d11468db0db4e6e9168e4f9',
children: [],
......@@ -221,7 +221,7 @@ export const permissionList = [
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '物料名称',
fieldId: 'wlmc',
fieldId: 'wuLiaoMingChen9398',
type: 'Input',
key: '112f6292bd884006ad872f06aeef4e6f',
children: [],
......
......@@ -24,14 +24,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'">
......@@ -58,8 +51,13 @@
<WlqdModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
<ImportModal @register="registerImportModal" importUrl="/jcsj/wlqd/import" @success="handleImportSuccess"/>
<ExportModal
v-if="visibleExport"
@close="visibleExport = false"
:columns="columns"
@success="handleExportSuccess"
/>
</ResizePageWrapper>
......@@ -73,7 +71,7 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesBaseBomPage, deleteMesBaseBom} from '/@/api/jcsj/wlqd';
import { getMesBaseBomPage, deleteMesBaseBom, exportMesBaseBom} from '/@/api/jcsj/wlqd';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
......@@ -94,8 +92,11 @@
import { ImportModal } from '/@/components/Import';
import { downloadByData } from '/@/utils/file/download';
import ExportModal from '/@/views/form/template/components/ExportModal.vue';
import { searchFormSchema, columns } from './components/config';
......@@ -134,13 +135,13 @@
const visibleExport = ref(false);
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2006204718531538944","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538945","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538946","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2006204718531538947","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
const list = [{"buttonId":"2006204718531538944","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538945","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538946","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2009068658047422464","name":"快速导入","code":"import","icon":"ant-design:import-outlined","isDefault":true,"isUse":true},{"buttonId":"2009068658047422465","name":"快速导出","code":"export","icon":"ant-design:export-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538947","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
......@@ -152,7 +153,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,add : handleAdd,edit : handleEdit,delete : handleDelete,}
const btnEvent = {view : handleView,add : handleAdd,edit : handleEdit,import : handleImport,export : handleExport,delete : handleDelete,}
const { currentRoute } = useRouter();
......@@ -169,7 +170,7 @@
const [registerModal, { openModal }] = useModal();
const [registerImportModal, { openModal: openImportModal }] = useModal();
const [registerTable, { reload, }] = useTable({
......@@ -330,7 +331,30 @@
openModal(true, info);
}
async function handleExport() {
visibleExport.value = true;
}
async function handleExportSuccess(cols) {
const res = await exportMesBaseBom({ isTemplate: false, columns: cols.toString(), ...pageParamsInfo.value});
visibleExport.value = false;
downloadByData(
res.data,
'Wlqd.xlsx',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
);
reload();
}
function handleImport() {
openImportModal(true, {
title: '快速导入',
downLoadUrl:'/jcsj/wlqd/export',
});
}
function handleImportSuccess(){
reload()
}
function getLessActions(record: Recordable) {
......
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