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;
}
/**
......
......@@ -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