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;
}
......
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