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
...@@ -10,19 +10,13 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -10,19 +10,13 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input', component: 'Input',
}, },
{ {
field: 'ddbh', field: 'ssgs',
label: '订单编号', label: '业务组织',
defaultValue: undefined,
component: 'Input',
},
{
field: 'zt',
label: '状态',
defaultValue: undefined, defaultValue: undefined,
component: 'XjrSelect', component: 'XjrSelect',
componentProps: { componentProps: {
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2004464883576217601' }, params: { itemId: '2015724355955159041' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
mode: 'multiple', mode: 'multiple',
...@@ -31,13 +25,13 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -31,13 +25,13 @@ export const searchFormSchema: FormSchema[] = [
}, },
}, },
{ {
field: 'ywzz', field: 'zt',
label: '业务组织', label: '状态',
defaultValue: undefined, defaultValue: undefined,
component: 'XjrSelect', component: 'XjrSelect',
componentProps: { componentProps: {
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2015724355955159041' }, params: { itemId: '2004464883576217601' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
mode: 'multiple', mode: 'multiple',
...@@ -45,13 +39,19 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -45,13 +39,19 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
}, },
}, },
{
field: 'ddbh',
label: '订单编号',
defaultValue: '',
component: 'Input',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'jhbh', dataIndex: 'ddbh',
title: '计划编号', title: '订单编号',
componentType: 'input', componentType: 'input',
fixed: false, fixed: false,
...@@ -63,21 +63,21 @@ export const columns: BasicColumn[] = [ ...@@ -63,21 +63,21 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'ddbh', dataIndex: 'jhbh',
title: '订单编号', title: '计划编号',
componentType: 'input', componentType: 'auto-code',
fixed: false, fixed: false,
sorter: true, sorter: true,
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: undefined,
}, },
{ {
resizable: true, resizable: true,
dataIndex: 'kh', dataIndex: 'khxmh',
title: '客户', title: '客户项目号',
componentType: 'input', componentType: 'input',
fixed: false, fixed: false,
...@@ -89,9 +89,9 @@ export const columns: BasicColumn[] = [ ...@@ -89,9 +89,9 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'jhjhrq', dataIndex: 'kh',
title: '计划交付日期', title: '客户',
componentType: 'date', componentType: 'select',
fixed: false, fixed: false,
sorter: true, sorter: true,
...@@ -112,9 +112,10 @@ export const columns: BasicColumn[] = [ ...@@ -112,9 +112,10 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
}, },
{ {
resizable: true, resizable: true,
dataIndex: 'ywzz', dataIndex: 'ssgs',
title: '业务组织', title: '业务组织',
componentType: 'select', componentType: 'select',
...@@ -214,34 +215,24 @@ export const formProps: FormProps = { ...@@ -214,34 +215,24 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: 'bb401260571f476c9816266b858aa2fa', key: '192945cba90645f593eb7e21a4776c97',
field: 'jhbh', field: 'jhbh',
label: '计划编号', label: '计划编号',
type: 'input', type: 'auto-code',
component: 'Input', component: 'AutoCodeRule',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
span: 7, span: 7,
defaultValue: '',
placeholder: '请输入计划编号', placeholder: '请输入计划编号',
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
autoCodeRule: 'scjh',
required: true, required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
...@@ -409,49 +400,16 @@ export const formProps: FormProps = { ...@@ -409,49 +400,16 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '105fe8a606b74e0ca90ea9ff1d20b648', key: 'dbb3bfcc0aa54e84b31adc2ba45dd48b',
field: 'kh', field: 'kh',
label: '客户', 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%' },
},
},
{
key: '6833bea0c42c432b83e6946695f2d723',
field: 'ssgs',
label: '所属公司',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
width: '100%', width: '100%',
span: 7, span: 7,
placeholder: '请选择下拉选择', placeholder: '请选择下拉选择客户',
showLabel: true, showLabel: true,
showSearch: false, showSearch: false,
isMultiple: false, isMultiple: false,
...@@ -462,20 +420,22 @@ export const formProps: FormProps = { ...@@ -462,20 +420,22 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: '',
datasourceType: 'api', datasourceType: 'api',
params: null,
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: '/bmxx/getCompanyList', path: '/jcxx/getKhList',
method: 'GET', method: 'GET',
apiId: 'copy1765431632890d13798', apiId: '7bc8db3faba24b19a997856f6ef0b27e',
apiParams: [ apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] }, { key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] }, { key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
'var sql="select id as value,name as label from res_company";\r\nreturn db.select(sql);', '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: [], dicOptions: [],
required: false, required: false,
...@@ -486,14 +446,9 @@ export const formProps: FormProps = { ...@@ -486,14 +446,9 @@ export const formProps: FormProps = {
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
],
},
{
span: 8,
list: [
{ {
key: 'lkajsldjaljdla', key: '6833bea0c42c432b83e6946695f2d723',
field: 'ywzz', field: 'ssgs',
label: '业务组织', label: '业务组织',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
...@@ -512,7 +467,6 @@ export const formProps: FormProps = { ...@@ -512,7 +467,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
...@@ -535,6 +489,7 @@ export const formProps: FormProps = { ...@@ -535,6 +489,7 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
params: { itemId: '2015724355955159041' }, params: { itemId: '2015724355955159041' },
defaultSelect: null,
itemId: '2015724355955159041', itemId: '2015724355955159041',
style: { width: '100%' }, style: { width: '100%' },
}, },
...@@ -567,121 +522,6 @@ export const formProps: FormProps = { ...@@ -567,121 +522,6 @@ export const formProps: FormProps = {
mainKey: 'mesProductionPlanProductList', mainKey: 'mesProductionPlanProductList',
columns: [ columns: [
{ {
key: '0b5e3de2d92f4a1cba6a650cff672653',
title: 'id',
dataIndex: 'id',
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: '416cd1b15c314d0dafaf6fc91e3f4653',
title: '产品选择',
dataIndex: 'cpid',
componentType: 'MultiplePopup',
componentProps: {
popupType: 'associate',
width: '100%',
span: '',
placeholder: '请选择产品选择',
showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '选择产品',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{ name: 'cpmc', tableTitle: '产品名称', show: true, width: 150 },
{
name: 'cpbh',
tableTitle: '物料编号',
bindField: 'cpbh',
show: true,
width: 150,
component: 'cd0038f42bc64c189b3821f0e2061321',
bindTable: 'mes_production_plan_product',
},
{
name: 'nbdm',
tableTitle: '内部代码',
bindField: 'nbdm',
show: true,
width: 150,
component: '6ce71ecb0b6e4d14ae65be4029b179fd',
bindTable: 'mes_production_plan_product',
},
{
name: 'xh',
tableTitle: '型号',
bindField: 'xh',
show: true,
width: 150,
component: '0c075736898c431ea3f5bca58ec65af6',
bindTable: 'mes_production_plan_product',
},
{
name: 'gg',
tableTitle: '规格',
bindField: 'gg',
show: true,
width: 150,
component: '2f56d9297a9c49d59d3b43f62e2946f2',
bindTable: 'mes_production_plan_product',
},
{
name: 'hjzt',
tableTitle: '合金状态',
bindField: 'hjzt',
show: true,
width: 150,
component: '697829b6aed54b8cbaa853c62619831a',
bindTable: 'mes_production_plan_product',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'cd0038f42bc64c189b3821f0e2061321', key: 'cd0038f42bc64c189b3821f0e2061321',
title: '物料编号', title: '物料编号',
dataIndex: 'cpbh', dataIndex: 'cpbh',
...@@ -709,6 +549,7 @@ export const formProps: FormProps = { ...@@ -709,6 +549,7 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpbh',
}, },
}, },
{ {
...@@ -739,6 +580,7 @@ export const formProps: FormProps = { ...@@ -739,6 +580,7 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'nbdm',
}, },
}, },
{ {
...@@ -769,6 +611,7 @@ export const formProps: FormProps = { ...@@ -769,6 +611,7 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'xh',
}, },
}, },
{ {
...@@ -799,6 +642,7 @@ export const formProps: FormProps = { ...@@ -799,6 +642,7 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'hjzt',
}, },
}, },
{ {
...@@ -829,6 +673,7 @@ export const formProps: FormProps = { ...@@ -829,6 +673,7 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'gg',
}, },
}, },
{ {
...@@ -842,7 +687,7 @@ export const formProps: FormProps = { ...@@ -842,7 +687,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: 0, defaultValue: 0,
min: 0, min: 0,
step: 0.1, step: 1,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -852,6 +697,7 @@ export const formProps: FormProps = { ...@@ -852,6 +697,7 @@ export const formProps: FormProps = {
rules: [], rules: [],
events: {}, events: {},
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
listStyle: "return 'width:100%'", listStyle: "return 'width:100%'",
}, },
}, },
...@@ -866,7 +712,7 @@ export const formProps: FormProps = { ...@@ -866,7 +712,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: 0, defaultValue: 0,
min: 0, min: 0,
step: 1, step: 0.1,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -883,11 +729,29 @@ export const formProps: FormProps = { ...@@ -883,11 +729,29 @@ export const formProps: FormProps = {
], ],
span: '24', span: '24',
preloadType: 'api', preloadType: 'api',
apiConfig: {}, apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{ tableTitle: '产品编号', name: 'cpbh' },
{ tableTitle: '产品名称', name: 'cpmc' },
{ name: 'nbdm', tableTitle: '内部代码' },
{ name: 'gg', tableTitle: '规格' },
{ tableTitle: '型号', name: 'xh' },
],
},
itemId: '', itemId: '',
dicOptions: [], dicOptions: [],
useSelectButton: false, useSelectButton: true,
buttonName: '选择数据', buttonName: '选择产品',
showLabel: true, showLabel: true,
showComponentBorder: true, showComponentBorder: true,
showBorder: false, showBorder: false,
...@@ -904,7 +768,7 @@ export const formProps: FormProps = { ...@@ -904,7 +768,7 @@ export const formProps: FormProps = {
isDeleteSelected: false, isDeleteSelected: false,
isListView: false, isListView: false,
viewList: [], viewList: [],
isShowAdd: true, isShowAdd: false,
isShowDelete: true, isShowDelete: true,
hasCheckedCol: false, hasCheckedCol: false,
events: {}, events: {},
...@@ -921,7 +785,7 @@ export const formProps: FormProps = { ...@@ -921,7 +785,7 @@ export const formProps: FormProps = {
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
placeholder: '请选择下拉选择', placeholder: '请选择下拉选择状态',
showLabel: true, showLabel: true,
showSearch: false, showSearch: false,
isMultiple: false, isMultiple: false,
...@@ -932,7 +796,7 @@ export const formProps: FormProps = { ...@@ -932,7 +796,7 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: '1', defaultSelect: '草稿',
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2004464883576217601' }, params: { itemId: '2004464883576217601' },
labelField: 'name', labelField: 'name',
......
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