Commit 5c689b0c by 金民

feat(scjh): 生产计划模块功能优化

- 重构搜索表单字段配置,调整订单编号、状态、业务组织等字段位置
- 修改表格列配置,将计划编号与订单编号字段进行交换
- 优化客户选择组件,从输入框改为下拉选择并更新API接口
- 调整生产计划子表产品选择组件配置
- 添加下发任务功能及相应API接口
- 更新工作流权限配置文件
- 添加stylelint相关依赖包
parent 57894a4e
...@@ -157,8 +157,10 @@ ...@@ -157,8 +157,10 @@
"rollup": "^3.22.1", "rollup": "^3.22.1",
"rollup-plugin-visualizer": "^5.9.0", "rollup-plugin-visualizer": "^5.9.0",
"stylelint": "^16.26.1", "stylelint": "^16.26.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^33.0.0", "stylelint-config-standard": "^33.0.0",
"stylelint-order": "^7.0.1",
"terser": "^5.17.4", "terser": "^5.17.4",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.0.4", "typescript": "^5.0.4",
......
import {
import { MesProductionPlanPageModel, MesProductionPlanPageParams, MesProductionPlanPageResult } from './model/ScjhModel'; MesProductionPlanPageModel,
MesProductionPlanPageParams,
MesProductionPlanPageResult,
} from './model/ScjhModel';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
...@@ -8,15 +11,16 @@ enum Api { ...@@ -8,15 +11,16 @@ enum Api {
List = '/scgl/scjh/list', List = '/scgl/scjh/list',
Info = '/scgl/scjh/info', Info = '/scgl/scjh/info',
MesProductionPlan = '/scgl/scjh', MesProductionPlan = '/scgl/scjh',
Issue = '/scgl/scjh/issue',
} }
/** /**
* @description: 查询MesProductionPlan分页列表 * @description: 查询MesProductionPlan分页列表
*/ */
export async function getMesProductionPlanPage(params: MesProductionPlanPageParams, mode: ErrorMessageMode = 'modal') { export async function getMesProductionPlanPage(
params: MesProductionPlanPageParams,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.get<MesProductionPlanPageResult>( return defHttp.get<MesProductionPlanPageResult>(
{ {
url: Api.Page, url: Api.Page,
...@@ -46,7 +50,10 @@ export async function getMesProductionPlan(id: String, mode: ErrorMessageMode = ...@@ -46,7 +50,10 @@ export async function getMesProductionPlan(id: String, mode: ErrorMessageMode =
/** /**
* @description: 新增MesProductionPlan * @description: 新增MesProductionPlan
*/ */
export async function addMesProductionPlan(mesProductionPlan: Recordable, mode: ErrorMessageMode = 'modal') { export async function addMesProductionPlan(
mesProductionPlan: Recordable,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.MesProductionPlan, url: Api.MesProductionPlan,
...@@ -61,7 +68,10 @@ export async function addMesProductionPlan(mesProductionPlan: Recordable, mode: ...@@ -61,7 +68,10 @@ export async function addMesProductionPlan(mesProductionPlan: Recordable, mode:
/** /**
* @description: 更新MesProductionPlan * @description: 更新MesProductionPlan
*/ */
export async function updateMesProductionPlan(mesProductionPlan: Recordable, mode: ErrorMessageMode = 'modal') { export async function updateMesProductionPlan(
mesProductionPlan: Recordable,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.put<boolean>( return defHttp.put<boolean>(
{ {
url: Api.MesProductionPlan, url: Api.MesProductionPlan,
...@@ -88,6 +98,17 @@ export async function deleteMesProductionPlan(ids: string[], mode: ErrorMessageM ...@@ -88,6 +98,17 @@ export async function deleteMesProductionPlan(ids: string[], mode: ErrorMessageM
); );
} }
/**
* @description: 下发任务
*/
export async function issueMesProductionPlan(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Issue,
data: { ids },
},
{
errorMessageMode: mode,
},
);
}
...@@ -6,9 +6,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; ...@@ -6,9 +6,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesProductionPlanPageParams extends BasicPageParams { export interface MesProductionPlanPageParams extends BasicPageParams {
jhbh: string; jhbh: string;
ddbh: string; ssgs: string;
zt: string; zt: string;
ddbh: string;
} }
/** /**
...@@ -17,15 +19,17 @@ export interface MesProductionPlanPageParams extends BasicPageParams { ...@@ -17,15 +19,17 @@ export interface MesProductionPlanPageParams extends BasicPageParams {
export interface MesProductionPlanPageModel { export interface MesProductionPlanPageModel {
id: string; id: string;
ddbh: string;
jhbh: string; jhbh: string;
ddbh: string; khxmh: string;
kh: string; kh: string;
jhjhrq: string;
zt: string; zt: string;
ssgs: string;
} }
/** /**
...@@ -84,6 +88,10 @@ export interface MesProductionPlanModel { ...@@ -84,6 +88,10 @@ export interface MesProductionPlanModel {
modifyUserId: string; modifyUserId: string;
lph: string;
ywzz: string;
mesProductionPlanProductList?: MesProductionPlanProductModel; mesProductionPlanProductList?: MesProductionPlanProductModel;
} }
......
...@@ -222,3 +222,4 @@ ...@@ -222,3 +222,4 @@
}); });
</script> </script>
\ No newline at end of file
export const permissionList = [ export const permissionList = [
{ {
required: true, required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'lkajsldjaljdla',
children: [],
options: {},
},
{
required: true,
view: true, view: true,
edit: true, edit: false,
disabled: false, disabled: true,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '计划编号', fieldName: '计划编号',
fieldId: 'jhbh', fieldId: 'jhbh',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'auto-code',
key: 'bb401260571f476c9816266b858aa2fa', key: '192945cba90645f593eb7e21a4776c97',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, required: false,
...@@ -128,20 +111,19 @@ export const permissionList = [ ...@@ -128,20 +111,19 @@ export const permissionList = [
fieldId: 'kh', fieldId: 'kh',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'select',
key: '105fe8a606b74e0ca90ea9ff1d20b648', key: 'dbb3bfcc0aa54e84b31adc2ba45dd48b',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, required: true,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '所属公司', fieldName: '业务组织',
fieldId: 'ssgs', fieldId: 'ssgs',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
...@@ -158,7 +140,7 @@ export const permissionList = [ ...@@ -158,7 +140,7 @@ export const permissionList = [
isSubTable: true, isSubTable: true,
showChildren: false, showChildren: false,
tableName: 'mesProductionPlanProductList', tableName: 'mesProductionPlanProductList',
fieldName: '表格组件', fieldName: '',
fieldId: 'mesProductionPlanProductList', fieldId: 'mesProductionPlanProductList',
type: 'form', type: 'form',
key: '24ea4c6631d047a1a8e7c3fe86ab080c', key: '24ea4c6631d047a1a8e7c3fe86ab080c',
...@@ -172,36 +154,6 @@ export const permissionList = [ ...@@ -172,36 +154,6 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProductionPlanProductList', tableName: 'mesProductionPlanProductList',
fieldName: 'id',
fieldId: 'id',
type: 'Input',
key: '0b5e3de2d92f4a1cba6a650cff672653',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '产品选择',
fieldId: 'cpid',
type: 'MultiplePopup',
key: '416cd1b15c314d0dafaf6fc91e3f4653',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '物料编号', fieldName: '物料编号',
fieldId: 'cpbh', fieldId: 'cpbh',
type: 'Input', type: 'Input',
...@@ -315,6 +267,6 @@ export const permissionList = [ ...@@ -315,6 +267,6 @@ export const permissionList = [
key: 'f7ae7fe08ec74cf6b91cd3cd35cfeaaf', key: 'f7ae7fe08ec74cf6b91cd3cd35cfeaaf',
children: [], children: [],
options: {}, options: {},
defaultValue: '1', defaultValue: '草稿',
}, },
]; ];
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
<a-button <a-button
v-else v-else
:type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'" :type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
:danger="button.buttonType === 'danger'" @click="buttonClick(button.code)" :danger="button.buttonType === 'danger'"
@click="buttonClick(button.code)"
> >
<template #icon><Icon :icon="button.icon" /></template> <template #icon><Icon :icon="button.icon" /></template>
{{ button.name }} {{ button.name }}
...@@ -50,7 +51,11 @@ ...@@ -50,7 +51,11 @@
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 { getMesProductionPlanPage, deleteMesProductionPlan } from '/@/api/scgl/scjh'; import {
getMesProductionPlanPage,
deleteMesProductionPlan,
issueMesProductionPlan,
} from '/@/api/scgl/scjh';
import { ResizePageWrapper } from '/@/components/Page'; import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
...@@ -70,8 +75,6 @@ ...@@ -70,8 +75,6 @@
const listSpliceNum = ref(3); //操作列最先展示几个 const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock'; import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import axios from 'axios';
import { useUserStore } from '/@/store/modules/user';
const pageParamsInfo = ref<any>({}); const pageParamsInfo = ref<any>({});
const { const {
...@@ -149,7 +152,13 @@ ...@@ -149,7 +152,13 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); 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,
delete: handleDelete,
xiafa: handleXiafa,
};
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
...@@ -204,40 +213,6 @@ ...@@ -204,40 +213,6 @@
}); });
function buttonClick(code) { function buttonClick(code) {
const store = useUserStore()
const ids = selectedRowsData.value.map((x) => x.id)
if (code === 'xiafa') {
//如果状态是已下发就直接禁止提交 提示警告
if (selectedRowsData.value.some((x) => x.status === '已下发')) {
notification.warning({
message: '提示信息',
description: '请勿重复下发任务!',
});
return;
}else{
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认下发任务?',
okText: '确认',
cancelText: '取消',
onOk() {
axios
.post(import.meta.env.VITE_GLOB_API_URL + '/scgl/scjh/issue', { ids } , {headers: { Authorization: 'Bearer '+store.getToken } })
.then((res) => {
if (res.data === '下发成功') {
notification.success({
message: '提示信息',
description: res.data,
});
}
});
},
});
}
}
btnEvent[code](); btnEvent[code]();
} }
...@@ -338,6 +313,33 @@ ...@@ -338,6 +313,33 @@
openModal(true, info); openModal(true, info);
} }
function handleXiafa(record: Recordable) {
if (selectedKeys.value.length === 0) {
Modal.warning({
title: '提示',
content: '请选择计划',
});
return;
}
const hasNonDraft = selectedRowsData.value.some((item) => item.zt !== '草稿');
if (hasNonDraft) {
Modal.warning({
title: '提示',
content: '非草稿计划无法下发任务任务',
});
return;
}
const ids = selectedRowsData.value.map((x) => x.id);
issueMesProductionPlan(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: '下发成功!',
});
});
}
function getLessActions(record: Recordable) { function getLessActions(record: Recordable) {
let list = getActions(record); let list = getActions(record);
return list.slice(0, listSpliceNum.value); return list.slice(0, listSpliceNum.value);
......
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