Commit 95ef29f9 by 张珈源

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

parents a6e09732 ef0a7c28
......@@ -157,8 +157,10 @@
"rollup": "^3.22.1",
"rollup-plugin-visualizer": "^5.9.0",
"stylelint": "^16.26.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-order": "^7.0.1",
"terser": "^5.17.4",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
......
......@@ -8,9 +8,7 @@ enum Api {
List = '/scgl/scjh/list',
Info = '/scgl/scjh/info',
MesProductionPlan = '/scgl/scjh',
Issue = '/scgl/scjh/issue',
}
/**
......@@ -88,6 +86,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,
},
);
}
......@@ -8,6 +8,8 @@ export interface MesProductionPlanPageParams extends BasicPageParams {
ddbh: string;
ssgs: string;
zt: string;
}
......@@ -17,13 +19,13 @@ export interface MesProductionPlanPageParams extends BasicPageParams {
export interface MesProductionPlanPageModel {
id: string;
jhbh: string;
ddbh: string;
jhbh: string;
kh: string;
jhjhrq: string;
ssgs: string;
zt: string;
}
......@@ -84,6 +86,10 @@ export interface MesProductionPlanModel {
modifyUserId: string;
lph: string;
ywzz: string;
mesProductionPlanProductList?: MesProductionPlanProductModel;
}
......
......@@ -3,12 +3,12 @@ import { BasicColumn } from '/@/components/Table';
import { uploadApi } from '/@/api/sys/upload';
export const searchFormSchema: FormSchema[] = [
{
field: 'jhbh',
label: '计划编号',
defaultValue: undefined,
component: 'Input',
},
// {
// field: 'jhbh',
// label: '计划编号',
// defaultValue: undefined,
// component: 'Input',
// },
{
field: 'ddbh',
label: '订单编号',
......@@ -16,13 +16,13 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'zt',
label: '状态',
field: 'ssgs',
label: '业务组织',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2004464883576217601' },
params: { itemId: '2015724355955159041' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
......@@ -31,13 +31,13 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'ywzz',
label: '业务组织',
field: 'zt',
label: '状态',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2015724355955159041' },
params: { itemId: '2004464883576217601' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
......@@ -50,8 +50,8 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'jhbh',
title: '计划编号',
dataIndex: 'ddbh',
title: '订单编号',
componentType: 'input',
fixed: false,
......@@ -63,35 +63,35 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'ddbh',
title: '订单编号',
componentType: 'input',
dataIndex: 'jhbh',
title: '计划编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'kh',
title: '客户',
componentType: 'input',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'jhjhrq',
title: '计划交付日期',
componentType: 'date',
dataIndex: 'ssgs',
title: '业务组织',
componentType: 'select',
fixed: false,
sorter: true,
......@@ -112,18 +112,6 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'ywzz',
title: '业务组织',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
......@@ -214,34 +202,24 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: 'bb401260571f476c9816266b858aa2fa',
key: '192945cba90645f593eb7e21a4776c97',
field: 'jhbh',
label: '计划编号',
type: 'input',
component: 'Input',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入计划编号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
autoCodeRule: 'scjh',
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......@@ -409,49 +387,16 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '105fe8a606b74e0ca90ea9ff1d20b648',
key: 'dbb3bfcc0aa54e84b31adc2ba45dd48b',
field: 'kh',
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',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择',
placeholder: '请选择下拉选择客户',
showLabel: true,
showSearch: false,
isMultiple: false,
......@@ -462,20 +407,21 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '',
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/bmxx/getCompanyList',
path: '/jcxx/getKhList',
method: 'GET',
apiId: 'copy1765431632890d13798',
apiId: '7bc8db3faba24b19a997856f6ef0b27e',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
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: [],
required: false,
......@@ -486,14 +432,9 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'lkajsldjaljdla',
field: 'ywzz',
key: '6833bea0c42c432b83e6946695f2d723',
field: 'ssgs',
label: '业务组织',
type: 'select',
component: 'XjrSelect',
......@@ -512,7 +453,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: null,
datasourceType: 'dic',
labelField: 'name',
valueField: 'value',
......@@ -567,16 +507,17 @@ export const formProps: FormProps = {
mainKey: 'mesProductionPlanProductList',
columns: [
{
key: '0b5e3de2d92f4a1cba6a650cff672653',
title: 'id',
dataIndex: 'id',
key: 'd762849da7e741a7b004c1c81b91593a',
title: '产品ID',
dataIndex: 'cpid',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入id',
placeholder: '请输入产品ID产品ID',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
......@@ -594,91 +535,7 @@ export const formProps: FormProps = {
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: '提示文本' },
prestrainField: 'id',
},
},
{
......@@ -709,6 +566,7 @@ export const formProps: FormProps = {
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpbh',
},
},
{
......@@ -739,6 +597,7 @@ export const formProps: FormProps = {
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'nbdm',
},
},
{
......@@ -769,6 +628,7 @@ export const formProps: FormProps = {
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'xh',
},
},
{
......@@ -799,6 +659,7 @@ export const formProps: FormProps = {
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'hjzt',
},
},
{
......@@ -829,6 +690,7 @@ export const formProps: FormProps = {
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'gg',
},
},
{
......@@ -842,7 +704,7 @@ export const formProps: FormProps = {
span: '',
defaultValue: 0,
min: 0,
step: 0.1,
step: 1,
disabled: false,
showLabel: true,
controls: true,
......@@ -852,6 +714,7 @@ export const formProps: FormProps = {
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
listStyle: "return 'width:100%'",
},
},
......@@ -866,7 +729,7 @@ export const formProps: FormProps = {
span: '',
defaultValue: 0,
min: 0,
step: 1,
step: 0.1,
disabled: false,
showLabel: true,
controls: true,
......@@ -883,11 +746,29 @@ export const formProps: FormProps = {
],
span: '24',
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: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
useSelectButton: true,
buttonName: '选择产品',
showLabel: true,
showComponentBorder: true,
showBorder: false,
......@@ -904,7 +785,7 @@ export const formProps: FormProps = {
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: true,
isShowAdd: false,
isShowDelete: true,
hasCheckedCol: false,
events: {},
......@@ -921,7 +802,7 @@ export const formProps: FormProps = {
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
placeholder: '请选择下拉选择状态',
showLabel: true,
showSearch: false,
isMultiple: false,
......@@ -932,7 +813,7 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '1',
defaultSelect: '草稿',
datasourceType: 'dic',
params: { itemId: '2004464883576217601' },
labelField: 'name',
......
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '业务组织',
fieldId: 'ywzz',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'lkajsldjaljdla',
children: [],
options: {},
},
{
required: true,
required: false,
view: true,
edit: true,
disabled: false,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '计划编号',
fieldId: 'jhbh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'bb401260571f476c9816266b858aa2fa',
type: 'auto-code',
key: '192945cba90645f593eb7e21a4776c97',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -128,20 +111,19 @@ export const permissionList = [
fieldId: 'kh',
isSubTable: false,
showChildren: true,
type: 'input',
key: '105fe8a606b74e0ca90ea9ff1d20b648',
type: 'select',
key: 'dbb3bfcc0aa54e84b31adc2ba45dd48b',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '所属公司',
fieldName: '业务组织',
fieldId: 'ssgs',
isSubTable: false,
showChildren: true,
......@@ -158,7 +140,7 @@ export const permissionList = [
isSubTable: true,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '表格组件',
fieldName: '',
fieldId: 'mesProductionPlanProductList',
type: 'form',
key: '24ea4c6631d047a1a8e7c3fe86ab080c',
......@@ -172,25 +154,10 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
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: '产品选择',
fieldName: '产品ID',
fieldId: 'cpid',
type: 'MultiplePopup',
key: '416cd1b15c314d0dafaf6fc91e3f4653',
type: 'Input',
key: 'd762849da7e741a7b004c1c81b91593a',
children: [],
},
{
......@@ -315,6 +282,6 @@ export const permissionList = [
key: 'f7ae7fe08ec74cf6b91cd3cd35cfeaaf',
children: [],
options: {},
defaultValue: '1',
defaultValue: '草稿',
},
];
......@@ -17,7 +17,8 @@
<a-button
v-else
: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>
{{ button.name }}
......@@ -50,7 +51,11 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
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 { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
......@@ -70,8 +75,6 @@
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import axios from 'axios';
import { useUserStore } from '/@/store/modules/user';
const pageParamsInfo = ref<any>({});
const {
......@@ -149,7 +152,13 @@
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();
......@@ -204,40 +213,6 @@
});
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]();
}
......@@ -338,6 +313,33 @@
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) {
let list = getActions(record);
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