itemClickEvent(e)}
- className="cellBox hasShow"
+
diff --git a/src/mes/operationGuide/index.js b/src/mes/operationGuide/index.js
index d76d5a1..f7aaec0 100644
--- a/src/mes/operationGuide/index.js
+++ b/src/mes/operationGuide/index.js
@@ -6,7 +6,7 @@ import BroadsideCard from "./component/BroadsideCard";
const OperationGuide = props => {
return (
);
diff --git a/src/mes/productionExec/productionExecMain/index.js b/src/mes/productionExec/productionExecMain/index.js
index 614bcec..bd5c893 100644
--- a/src/mes/productionExec/productionExecMain/index.js
+++ b/src/mes/productionExec/productionExecMain/index.js
@@ -36,6 +36,12 @@ const list = [
const useProductionExecMainEvent = props => {
const { formData = [] } = props;
+ const noProduction= commonFunc.showLocalMessage(props, 'noProduction', '暂无生产执行数据,请先开工一条任务!');
+
+ const waitWorkLoading = commonFunc.showLocalMessage(props, 'waitWorkLoading', '等待工单数据加载中...');
+
+ const productionLoading = commonFunc.showLocalMessage(props, 'productionLoading', '生产执行数据加载中...');
+
const [refreshCount, setRefreshCount] = useState(0);
const [pageloading, setPagesLoading] = useState(true);
@@ -44,10 +50,10 @@ const useProductionExecMainEvent = props => {
const { sSrcSlaveId, iInterface: iInterfaceOld } = workOrderInfoRowData;
const bNoWorkOrderInfo = props.bFinish1 && !sSrcSlaveId;
const pageloadingMsg = sSrcSlaveId
- ? "生产执行数据加载中..."
+ ? productionLoading
: props.bFinish1
- ? "暂无生产执行数据,请先开工一条任务!"
- : "等待工单数据加载中...";
+ ? noProduction
+ : waitWorkLoading;
const { app } = props;
const { userinfo = {} } = app;
@@ -395,8 +401,9 @@ const useProductionExecMainEvent = props => {
const ProductionExecMain = baseProps => {
const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
+ const workFirst = commonFunc.showLocalMessage(baseProps, 'workFirst', '请先上班后再操作');
if (!bStartWork) {
- return
;
}
const props = useProductionExecMainEvent(useCommonBase(baseProps));
@@ -939,6 +946,9 @@ const ProductionExecContent0 = props => {
config.gdsconfigformslave.find(
item => item.sControlName === sControlName
) || {};
+ if (!btnConfig.bVisible) {
+ btnConfig.style = { display: "none" };
+ }
return {
...btnConfig,
disabled: props.onGetBtnStatus(tableName, btnConfig),
diff --git a/src/mes/productionExec/quickSwitchTabComponent/index.js b/src/mes/productionExec/quickSwitchTabComponent/index.js
index 94f6abf..b3020ad 100644
--- a/src/mes/productionExec/quickSwitchTabComponent/index.js
+++ b/src/mes/productionExec/quickSwitchTabComponent/index.js
@@ -63,7 +63,7 @@ const QuickSwitchTabComponent = baseProps => {
}
}, []);
- const list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"];
+ let list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"];
const listId = [
"12710101117087374661080",
"12710101117089395856660",
@@ -71,6 +71,37 @@ const QuickSwitchTabComponent = baseProps => {
"",
"12710101117087404588200"
];
+ function translateList(language) {
+ // 原始中文列表
+ const list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"];
+
+ // 定义多语言映射
+ const translations = {
+ sEnglish: {
+ "生产执行": "Production Execution",
+ "质量巡检": "Quality Inspection",
+ "拼版图": "Assembly Drawing",
+ "产品图": "Product Drawing",
+ "报工任务": "Work Reporting Task"
+ },
+ sBig5: {
+ "生产执行": "生產執行",
+ "质量巡检": "質量巡檢",
+ "拼版图": "拼版圖",
+ "产品图": "產品圖",
+ "报工任务": "報工任務"
+ }
+ };
+
+ // 根据语言设置进行转换
+ if (translations[language]) {
+ return list.map(item => translations[language][item] || item);
+ }
+ // 默认返回原始列表
+ return list;
+ }
+ const sLanguage = props.app.userinfo.sLanguage || 'sChinese';
+ list = translateList(sLanguage);
return (
diff --git a/src/mes/queryTracking/index.js b/src/mes/queryTracking/index.js
index a0f7d16..d8ece9d 100644
--- a/src/mes/queryTracking/index.js
+++ b/src/mes/queryTracking/index.js
@@ -2,7 +2,7 @@
* @Author: varcms
* @LastEditors: varcms
* @Date: 2025-06-04 11:06:14
- * @Description:
+ * @Description:
*/
import React from "react";
import styles from "./index.less";
diff --git a/src/mes/scheduledTasks/machineTasks/index.js b/src/mes/scheduledTasks/machineTasks/index.js
index d2b67bd..9aca10d 100644
--- a/src/mes/scheduledTasks/machineTasks/index.js
+++ b/src/mes/scheduledTasks/machineTasks/index.js
@@ -4,1161 +4,1115 @@
* @Date: 2024-02-28 9:55:04
* @Description: 计划任务 ---- 机台任务
*/
- import React, { useEffect, useRef, useState } from "react";
- import moment from "moment";
- import {
- Carousel,
- Col,
- Row,
- Button,
- Input,
- Modal,
- Space,
- Dropdown,
- message,
- Tooltip
- } from "antd";
- import { SettingTwoTone } from "@ant-design/icons";
- import * as commonFunc from "@/components/Common/commonFunc";
- import * as commonUtils from "@/utils/utils";
- import * as commonConfig from "@/utils/config";
- import * as commonBusiness from "@/components/Common/commonBusiness";
- import * as commonServices from "@/services/services";
- import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
- import StaticEditTable from "@/components/Common/CommonTable";
- import CommonViewTable from "@/components/Common/CommonViewTable";
- import styles from "./index.less";
- import taskInfoIcon from "../assets/taskInfo2.png";
- import statusIcon from "../assets/status.png";
- import taskIcon from "../assets/task.png";
- import timeIcon from "../assets/time.png";
- import { handleOeeBtnEent } from "./common/handlePause";
- import { operationFetch } from "../../productionExec/productionExecMain/operationFetch";
-
- // 业务层
- const useInfoEvent = props => {
- const { formData } = props;
- const [refreshCount, setRefreshCount] = useState(0);
-
- useEffect(
- async () => {
- if (commonUtils.isNotEmptyArr(formData)) {
- const colunmData = handleGetColumnData(formData, true);
- const result = await handleGetData(formData, true);
- const addState = {
- ...colunmData,
- ...result
- };
- props.onSaveState(addState);
- }
- },
- [formData, refreshCount]
- );
-
- // 获取表头数据
- const handleGetColumnData = (formData = [], isWait) => {
- let addState = {};
- for (let i = 0; i < formData.length; i++) {
- const config = formData[i];
- const column = commonFunc.getHeaderConfig(config);
- addState = {
- ...addState,
- [`slave${i}Column`]: column,
- [`slave${i}Config`]: config
- };
- }
- if (isWait) {
- return addState;
- } else {
- props.onSaveState(addState);
- }
- };
-
- // 获取数据集
- const handleGetData = async (formData = [], isWait, filter) => {
- let addState = {};
- for (let i = 0; i < formData.length; i++) {
- const config = formData[i];
- if (!config) continue;
-
- const conditonValues = props.onGetSqlConditionValues(config);
-
- if (config.sSqlStr === "Sp_OEE_ProductionReport") {
- conditonValues.sMachineId_s_pro = props.app.sMachineNameSId;
- }
-
- // 前期生产或反馈问题表必须有非空过滤条件
- if (
- (i === 1 && Object.values(conditonValues).includes("")) ||
- Object.values(conditonValues).includes(undefined)
- ) {
- continue;
- }
-
- const bFilter = [];
- if (filter) {
- Object.keys(filter).forEach(key => {
- bFilter.push({
- bFilterName: key,
- bFilterCondition: "like",
- bFilterValue: filter[key]
- });
- });
- }
-
- const result =
- (await props.onGetDataSet({
- name: `slave${i}`,
- configData: config,
- condition: {
- bFilter,
- sSqlCondition: { ...conditonValues }
- },
- isWait: true
- })) || {};
- props.setTempRef(result);
- addState = { ...addState, ...result };
- }
- props.setTempRef({}, true);
- if (isWait) {
- return addState;
- } else {
- props.onSaveState(addState);
- }
+import React, { useEffect, useRef, useState } from "react";
+import moment from "moment";
+import {
+ Carousel,
+ Col,
+ Row,
+ Button,
+ Input,
+ Modal,
+ Space,
+ Dropdown,
+ message,
+ Tooltip
+} from "antd";
+import { SettingTwoTone } from "@ant-design/icons";
+import * as commonFunc from "@/components/Common/commonFunc";
+import * as commonUtils from "@/utils/utils";
+import * as commonConfig from "@/utils/config";
+import * as commonBusiness from "@/components/Common/commonBusiness";
+import * as commonServices from "@/services/services";
+import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
+import StaticEditTable from "@/components/Common/CommonTable";
+import styles from "./index.less";
+import taskInfoIcon from "../assets/taskInfo2.png";
+import statusIcon from "../assets/status.png";
+import taskIcon from "../assets/task.png";
+import timeIcon from "../assets/time.png";
+import { handleOeeBtnEent } from "./common/handlePause";
+import { operationFetch } from "../../productionExec/productionExecMain/operationFetch";
+
+// 业务层
+const useInfoEvent = props => {
+ const { formData } = props;
+ const [refreshCount, setRefreshCount] = useState(0);
+
+ useEffect(
+ async () => {
+ if (commonUtils.isNotEmptyArr(formData)) {
+ const colunmData = handleGetColumnData(formData, true);
+ const result = await handleGetData(formData, true);
+ const addState = {
+ ...colunmData,
+ ...result
+ };
+ props.onSaveState(addState);
+ }
+ },
+ [formData, refreshCount]
+ );
+
+ // 获取表头数据
+ const handleGetColumnData = (formData = [], isWait) => {
+ let addState = {};
+ for (let i = 0; i < formData.length; i++) {
+ const config = formData[i];
+ const column = commonFunc.getHeaderConfig(config);
+ addState = {
+ ...addState,
+ [`slave${i}Column`]: column,
+ [`slave${i}Config`]: config
};
-
- // 查询
- const handleSearch = sWorkOrderNo => {
- handleGetData([formData[0]], false, {
- sWorkOrderNo
+ }
+ if (isWait) {
+ return addState;
+ } else {
+ props.onSaveState(addState);
+ }
+ };
+
+ // 获取数据集
+ const handleGetData = async (formData = [], isWait, filter) => {
+ let addState = {};
+ for (let i = 0; i < formData.length; i++) {
+ const config = formData[i];
+ if (!config) continue;
+
+ const conditonValues = props.onGetSqlConditionValues(config);
+
+ if (config.sSqlStr === "Sp_OEE_ProductionReport") {
+ conditonValues.sMachineId_s_pro = props.app.sMachineNameSId;
+ }
+
+ // 前期生产或反馈问题表必须有非空过滤条件
+ if (
+ (i === 1 && Object.values(conditonValues).includes("")) ||
+ Object.values(conditonValues).includes(undefined)
+ ) {
+ continue;
+ }
+
+ const bFilter = [];
+ if (filter) {
+ Object.keys(filter).forEach(key => {
+ bFilter.push({
+ bFilterName: key,
+ bFilterCondition: "like",
+ bFilterValue: filter[key]
+ });
});
- };
-
- // 开工事件
- const handleStartWork = async params => {
- const { sModelsId, token, app } = props;
- const { name, record, config, tableData, iFlag, pauseValue } = params;
- const { sMachineId, sId, sSlaveId } = record;
-
- // /* 若设置了禁止跳单 选择数据不是第一条时进行提示 */
- // const iIndex = app.systemData.findIndex(item => item.sName === "CkxNoSkip");
- // if (iIndex > -1) {
- // const sValue = app.systemData[iIndex].sValue;
- // if (sValue === "1") {
- // /* 如果设置了进制跳单 */
- // const indexFirst = tableData.findIndex(
- // item => sId === item.sId || sSlaveId === item.sSlaveId
- // );
- // if (indexFirst > 0) {
- // message.warn("禁止跳单!");
- // return;
- // }
- // }
- // }
- // // 验证是否单据是否被使用
- // const dataUrl = `${
- // commonConfig.server_host
- // }bill/billCopyToCheckWork?sModelsId=${sModelsId}`;
- // const values = { sMachineId };
- // const dataReturn = (await commonServices.postValueService(
- // token,
- // values,
- // dataUrl
- // )).data;
- // if (dataReturn.code !== 1) {
- // props.getServiceError(dataReturn);
- // return;
- // }
-
- // 单据可以使用
- const { startWorkConfig = {} } = config;
- const { sAssignField } = startWorkConfig;
- const allTableData = {
- [name]: record
- };
- let rowData = commonFunc.getDefaultData(config, allTableData); // 取默认值
- rowData = {
- ...rowData,
- ...commonFunc.getAssignFieldValue(sAssignField, record, allTableData),
- handleType: "add",
- sId: commonUtils.createSid(),
- sTeamId: app.sTeamNameSId,
- sMachineId: app.sMachineNameSId,
- sParentId: record.sId,
- tCreateDate: new Date()
- };
-
- const valuesNew = {};
- valuesNew.data = [];
- valuesNew.data.push(
- commonBusiness.mergeData(name, "plc_machinedata", [rowData], [])
- );
-
- if ((iFlag || Object.is(iFlag, 0)) && valuesNew.data[0]) {
- valuesNew.data[0].iFlag = iFlag;
+ }
+
+ const result =
+ (await props.onGetDataSet({
+ name: `slave${i}`,
+ configData: config,
+ condition: {
+ bFilter,
+ sSqlCondition: { ...conditonValues }
+ },
+ isWait: true
+ })) || {};
+ props.setTempRef(result);
+ addState = { ...addState, ...result };
+ }
+ props.setTempRef({}, true);
+ if (isWait) {
+ return addState;
+ } else {
+ props.onSaveState(addState);
+ }
+ };
+
+ // 查询
+ const handleSearch = sWorkOrderNo => {
+ handleGetData([formData[0]], false, {
+ sWorkOrderNo
+ });
+ };
+
+ // 开工事件
+ const handleStartWork = async params => {
+ const { sModelsId, token, app } = props;
+ const { name, record, config, tableData, iFlag, pauseValue } = params;
+ const { sMachineId, sId, sSlaveId } = record;
+
+ // /* 若设置了禁止跳单 选择数据不是第一条时进行提示 */
+ // const iIndex = app.systemData.findIndex(item => item.sName === "CkxNoSkip");
+ // if (iIndex > -1) {
+ // const sValue = app.systemData[iIndex].sValue;
+ // if (sValue === "1") {
+ // /* 如果设置了进制跳单 */
+ // const indexFirst = tableData.findIndex(
+ // item => sId === item.sId || sSlaveId === item.sSlaveId
+ // );
+ // if (indexFirst > 0) {
+ // message.warn("禁止跳单!");
+ // return;
+ // }
+ // }
+ // }
+ // // 验证是否单据是否被使用
+ // const dataUrl = `${
+ // commonConfig.server_host
+ // }bill/billCopyToCheckWork?sModelsId=${sModelsId}`;
+ // const values = { sMachineId };
+ // const dataReturn = (await commonServices.postValueService(
+ // token,
+ // values,
+ // dataUrl
+ // )).data;
+ // if (dataReturn.code !== 1) {
+ // props.getServiceError(dataReturn);
+ // return;
+ // }
+
+ // 单据可以使用
+ const { startWorkConfig = {} } = config;
+ const { sAssignField } = startWorkConfig;
+ const allTableData = {
+ [name]: record
+ };
+ let rowData = commonFunc.getDefaultData(config, allTableData); // 取默认值
+ rowData = {
+ ...rowData,
+ ...commonFunc.getAssignFieldValue(sAssignField, record, allTableData),
+ handleType: "add",
+ sId: commonUtils.createSid(),
+ sTeamId: app.sTeamNameSId,
+ sMachineId: app.sMachineNameSId,
+ sParentId: record.sId,
+ tCreateDate: new Date()
+ };
+
+ const valuesNew = {};
+ valuesNew.data = [];
+ valuesNew.data.push(
+ commonBusiness.mergeData(name, "plc_machinedata", [rowData], [])
+ );
+
+ if ((iFlag || Object.is(iFlag, 0)) && valuesNew.data[0]) {
+ valuesNew.data[0].iFlag = iFlag;
+ }
+
+ if (pauseValue) {
+ valuesNew.data[0].sWorkOrderChangeMemo = pauseValue;
+ }
+
+ const BtnSave = commonFunc.showMessage(
+ app.commonConst,
+ "BtnSave"
+ ); /* 保存 */
+ params.optName = BtnSave;
+ params.sClientType = "1";
+ const returnData = await commonBusiness.saveData({
+ token,
+ value: valuesNew,
+ sModelsId,
+ bMachineTask: true
+ });
+
+ return returnData;
+ // if (commonUtils.isEmptyObject(returnData)) return;
+
+ // props.onSaveState(
+ // {
+ // [`${name}SelectedRowKeys`]: [record.sId]
+ // },
+ // () => {
+ // props.dispatch({
+ // type: "app/saveGlobalData",
+ // payload: {
+ // currentStartWorkMachineTaskDataRow: rowData
+ // }
+ // });
+ // handleRefresh();
+ // setTimeout(() => {
+ // props.onChangeRouter({
+ // type: "name",
+ // path: ["生产执行", "生产执行"]
+ // });
+ // }, 500);
+ // }
+ // );
+ // this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1);
+ };
+
+ // 更新工单状态
+ const handleUpdateStatus = async params => {
+ const { doWorkState, record } = params;
+
+ const { sModelsId, app } = props;
+
+ const value = {
+ plcMachinedata: record
+ };
+
+ const url = `${
+ commonConfig.server_host
+ }oee/doUpdateStatus/${doWorkState}?sModelsId=${sModelsId}&sMachineId=${
+ record.sMachineId
+ }`;
+ const returnData = (await commonServices.postValueService(
+ app.token,
+ value,
+ url
+ )).data;
+
+ if (returnData.code !== 1) {
+ props.getServiceError(returnData);
+ return false;
+ }
+
+ return true;
+ };
+
+ // 监听机台任务选中行变化
+ const { slave0SelectedRowKeys = [], slave0Data = [], sModelsId } = props;
+ useEffect(
+ () => {
+ if (!slave0Data.length) return;
+
+ const globalData = commonUtils.convertStrToObj(
+ localStorage.xlybusinessglobalData
+ );
+ const { currentSelectedMachineTaskDataRow = {} } = globalData;
+
+ // 当前选中行sId,默认取缓存数据
+ let currentSelectedRowKey = slave0SelectedRowKeys[0];
+ if (
+ !currentSelectedRowKey &&
+ sModelsId === currentSelectedMachineTaskDataRow?.sModelsId
+ ) {
+ currentSelectedRowKey = currentSelectedMachineTaskDataRow.sId;
+ }
+ if (!currentSelectedRowKey) {
+ currentSelectedRowKey = slave0Data[0].sId;
+ }
+
+ // 默认选中第一行
+ if (!slave0SelectedRowKeys.length) {
+ props.onSaveState({
+ slave0SelectedRowKeys: [currentSelectedRowKey]
+ });
+ }
+
+ // 将当前选中行保存到全局
+ props.dispatch({
+ type: "app/saveGlobalData",
+ payload: {
+ currentSelectedMachineTaskDataRow: {
+ ...(slave0Data.find(item => item.sId === currentSelectedRowKey) ||
+ {}),
+ sModelsId
+ }
}
-
- if (pauseValue) {
- valuesNew.data[0].sWorkOrderChangeMemo = pauseValue;
+ });
+
+ // 前期生产或反馈问题数据根据机台任务选中行变化
+ handleGetData(["", formData[1]], false);
+ },
+ [slave0SelectedRowKeys[0], slave0Data.length]
+ );
+
+ // 监听开工任务变化
+ useEffect(
+ () => {
+ if (commonUtils.isEmptyObject(props.slave0Data)) return;
+ const startRowData = props.slave0Data.find(item => item.iStar === 1);
+ if (!startRowData) return;
+ props.dispatch({
+ type: "app/saveGlobalData",
+ payload: {
+ currentStartWorkMachineTaskDataRow: startRowData
}
-
- const BtnSave = commonFunc.showMessage(
- app.commonConst,
- "BtnSave"
- ); /* 保存 */
- params.optName = BtnSave;
- params.sClientType = "1";
- const returnData = await commonBusiness.saveData({
- token,
- value: valuesNew,
- sModelsId,
- bMachineTask: true
- });
-
- return returnData;
- // if (commonUtils.isEmptyObject(returnData)) return;
-
- // props.onSaveState(
- // {
- // [`${name}SelectedRowKeys`]: [record.sId]
- // },
- // () => {
- // props.dispatch({
- // type: "app/saveGlobalData",
- // payload: {
- // currentStartWorkMachineTaskDataRow: rowData
- // }
- // });
- // handleRefresh();
- // setTimeout(() => {
- // props.onChangeRouter({
- // type: "name",
- // path: ["生产执行", "生产执行"]
- // });
- // }, 500);
- // }
- // );
- // this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1);
- };
-
- // 更新工单状态
- const handleUpdateStatus = async params => {
- const { doWorkState, record } = params;
-
- const { sModelsId, app } = props;
-
- const value = {
- plcMachinedata: record
- };
-
- const url = `${
- commonConfig.server_host
- }oee/doUpdateStatus/${doWorkState}?sModelsId=${sModelsId}&sMachineId=${
- record.sMachineId
- }`;
- const returnData = (await commonServices.postValueService(
- app.token,
- value,
- url
- )).data;
-
- if (returnData.code !== 1) {
- props.getServiceError(returnData);
- return false;
+ });
+ },
+ [JSON.stringify(props.slave0Data)]
+ );
+
+ // 刷新页面
+ const handleRefresh = () => {
+ setRefreshCount(refreshCount + 1);
+ };
+
+ const itemClickRef = useRef();
+
+ // 开工、暂停事件
+ const handleTableBtnClick = async item => {
+ const { tableName, index, record, tableData, config, iFlag } = item;
+ const { showName } = config;
+ if (showName === "完工") {
+ Modal.confirm({
+ title: "温馨提示:",
+ content:
确认完工?
,
+ okText: "确认",
+ cancelText: "取消",
+ onOk() {
+ handleUpdateProductionplan({ item, iFlag: 4 });
}
-
- return true;
- };
-
- // 监听机台任务选中行变化
- const { slave0SelectedRowKeys = [], slave0Data = [], sModelsId } = props;
- useEffect(
- () => {
- if (!slave0Data.length) return;
-
- const globalData = commonUtils.convertStrToObj(
- localStorage.xlybusinessglobalData
- );
- const { currentSelectedMachineTaskDataRow = {} } = globalData;
-
- // 当前选中行sId,默认取缓存数据
- let currentSelectedRowKey = slave0SelectedRowKeys[0];
- if (
- !currentSelectedRowKey &&
- sModelsId === currentSelectedMachineTaskDataRow?.sModelsId
- ) {
- currentSelectedRowKey = currentSelectedMachineTaskDataRow.sId;
- }
- if (!currentSelectedRowKey) {
- currentSelectedRowKey = slave0Data[0].sId;
- }
-
- // 默认选中第一行
- if (!slave0SelectedRowKeys.length) {
- props.onSaveState({
- slave0SelectedRowKeys: [currentSelectedRowKey]
- });
- }
-
- // 将当前选中行保存到全局
- props.dispatch({
- type: "app/saveGlobalData",
- payload: {
- currentSelectedMachineTaskDataRow: {
- ...(slave0Data.find(item => item.sId === currentSelectedRowKey) ||
- {}),
- sModelsId
- }
- }
- });
-
- // 前期生产或反馈问题数据根据机台任务选中行变化
- handleGetData(["", formData[1]], false);
- },
- [slave0SelectedRowKeys[0], slave0Data.length]
- );
-
- // 监听开工任务变化
- useEffect(
- () => {
- if (commonUtils.isEmptyObject(props.slave0Data)) return;
- const startRowData = props.slave0Data.find(item => item.iStar === 1);
- if (!startRowData) return;
- props.dispatch({
- type: "app/saveGlobalData",
- payload: {
- currentStartWorkMachineTaskDataRow: startRowData
- }
- });
- },
- [JSON.stringify(props.slave0Data)]
- );
-
- // 刷新页面
- const handleRefresh = () => {
- setRefreshCount(pre => pre + 1);
- };
-
- const itemClickRef = useRef();
-
- // 开工、暂停事件
- const handleTableBtnClick = async item => {
- const { tableName, index, record, tableData, config, iFlag } = item;
- const { showName } = config;
- if (showName === "完工") {
+ });
+ return;
+ }
+ // const iStar = index === 0 ? 1 : 2;
+ const { iStar } = record;
+
+ if (iStar === 1) {
+ // 如果只剩一条数据,询问是暂停还是完工
+ if (tableData.length === 1) {
+ const result = await new Promise(resolve => {
Modal.confirm({
title: "温馨提示:",
- content:
确认完工?
,
- okText: "确认",
- cancelText: "取消",
+ content:
请选择要变更的状态
,
+ okText: "完工",
+ cancelText: "暂停",
onOk() {
- handleUpdateProductionplan({ item, iFlag: 4 });
+ resolve(true);
+ },
+ onCancel() {
+ resolve(false);
}
});
+ });
+ if (result) {
+ // 走完工接口
+ handleUpdateProductionplan({ item, iFlag: 4 });
return;
}
- // const iStar = index === 0 ? 1 : 2;
- const { iStar } = record;
-
- if (iStar === 1) {
- // 如果只剩一条数据,询问是暂停还是完工
- if (tableData.length === 1) {
- const result = await new Promise(resolve => {
- Modal.confirm({
- title: "温馨提示:",
- content:
请选择要变更的状态
,
- okText: "完工",
- cancelText: "暂停",
- onOk() {
- resolve(true);
- },
- onCancel() {
- resolve(false);
- }
- });
- });
- if (result) {
- // 走完工接口
- handleUpdateProductionplan({ item, iFlag: 4 });
- return;
- }
- }
-
- // 开工中,走暂停接口
+ }
+
+ // 开工中,走暂停接口
+ props.onSaveState({
+ taskConfirmModalVisible: true,
+ taskConfirmModalMsg: "请填写暂停原因",
+ tempTaskId: record.sId,
+ bPauseOnly: true,
+ pauseCallback: pauseValue => {
props.onSaveState({
- taskConfirmModalVisible: true,
- taskConfirmModalMsg: "请选择暂停原因",
- tempTaskId: record.sId,
- bPauseOnly: true,
- pauseCallback: pauseValue => {
- props.onSaveState({
- taskConfirmModalVisible: false,
- taskConfirmModalMsg: "",
- tempTaskId: "",
- bPauseOnly: false,
- pauseCallback: null
- });
- handleUpdateProductionplan({ item, iFlag: 3, pauseValue });
- }
+ taskConfirmModalVisible: false,
+ taskConfirmModalMsg: "",
+ tempTaskId: "",
+ bPauseOnly: false,
+ pauseCallback: null
});
- } else if (iStar === 2 || iStar === 3) {
- // 暂停中,走开工接口
- const dataReturn = await handleStartWork(item);
- const { code, msg } = dataReturn;
- if (code === 1) {
- // 成功开工
- itemClickRef.current = null;
- message.success(dataReturn.msg);
- if (props.taskConfirmModalVisible) {
- props.onSaveState({
- taskConfirmModalVisible: false,
- taskConfirmModalMsg: "",
- tempTaskId: ""
- });
- }
- props.onChangeRouter({
- type: "name",
- path: ["生产执行", "生产执行"]
- });
- } else if (code === -7) {
- // 如果有开工中的任务,即接口返回-7,弹出确认窗体
- itemClickRef.current = { data: item };
- props.onSaveState({
- taskConfirmModalVisible: true,
- taskConfirmModalMsg: msg,
- tempTaskId: record.sId
- });
- } else {
- // 报错
- message.error(msg);
- }
- }
- };
-
- // 更新机台状态
- const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => {
- const { app } = props;
- const { sId } = item.record;
- const { token } = app;
- const url = `${
- commonConfig.server_host
- }oee/updateProductionplan/${sId}/${iFlag}${
- pauseValue
- ? `?sWorkOrderChangeMemo=${encodeURIComponent(pauseValue)}`
- : ""
- }`;
- const dataReturn = (await commonServices.getService(token, url)).data;
- if (dataReturn.code === 1) {
- dataReturn.msg && message.success(dataReturn.msg, 3);
- handleRefresh();
- } else {
- message.error(dataReturn.msg, 3);
+ handleUpdateProductionplan({ item, iFlag: 3, pauseValue });
}
- };
-
- return {
- ...props,
- // 其他对象
- itemClickRef,
- onSearch: handleSearch,
- onStartWork: handleStartWork, // 开工事件
- onRefresh: handleRefresh, // 刷新页面
- onTableBtnClick: handleTableBtnClick, // 开工、暂停事件
- onUpdateProductionplan: handleUpdateProductionplan // 更新机台状态
- };
- };
-
- /**
- * 暂停按钮
- * @param {*} params
- */
- const handlePause = async params => {
- const { item, props } = params;
- const { record, config } = item;
- await operationFetch(
- { ...props, workOrderInfoData: [record] },
- config,
- config.sName || "fileError"
- );
- await handleOeeBtnEent({ props, item });
- };
-
- const MachineTasks = baseProps => {
- const props = useInfoEvent(useCommonBase({ ...baseProps }));
- const {
- app,
- slave0Config,
- slave1Column,
- slave1Data = [],
- slave2Column,
- slave2Data = []
- } = props;
-
- const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
-
- const [isTableLoading, setTableLoading] = useState(false);
-
- // const BtnTableCopyTo.startWork
- // 开工按钮配置
- const startWorkConfig =
- slave0Config?.gdsconfigformslave?.find(
- item => item.sControlName === "BtnTableCopyTo.startWork"
- ) || {};
- const pauseWorkConfig =
- slave0Config?.gdsconfigformslave?.find(
- item => item.sControlName === "BtnTableCopyTo.pauseWork"
- ) || {};
-
- // 表格业务
- const [sSrcNo, setSSrcNo] = useState("");
- // 顶部表格配置
- const tableProps = {
- ...commonBusiness.getTableTypes("slave0", props),
- tableProps: {
- onChange: () => {},
- loading: isTableLoading
- },
- tableBtnsConfig: params => {
- const { record, index } = params;
- const { iStar } = record;
- // const iStar = index === 0 ? 1 : 2;
-
- // const bStart = iStar === 1;
- // const bPause = iStar === 2;
-
- // 1 :开工状态(显示暂停) 2: 暂停状态(显示开工) 3: 完工状态(显示完工,灰色)
- // 开工:开工接口(现在)1:正常, -7:有开工,要有提示, -1: 错误提示
- // -7 :完工: iFlag:3 (完工上一条) 暂停:iFlag:2 (暂停上一条)
- // 暂停:新接口
-
- let showName, btnBgColor, sDefault;
- if (iStar === 1) {
- showName = "暂停";
- btnBgColor = "#FAAD14";
- } else if (iStar === 2 || iStar === 3) {
- showName = "开工";
- btnBgColor = "#1890FF";
- } else {
- showName = "完工";
- btnBgColor = "#AAA";
- sDefault = "${false}";
- }
-
- if (!bStartWork) {
- sDefault = "${false}";
- }
-
- return [
- { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig },
- { showName: "完工", btnBgColor: "#1890FF", sDefault }
- ];
-
- // return [
- // {
- // ...startWorkConfig,
- // showName: "开工",
- // btnBgColor: bStart ? "#1890FF" : "#AAA"
- // },
- // {
- // ...pauseWorkConfig,
- // showName: "暂停",
- // btnBgColor: bPause ? "#FAAD14" : "#AAA"
- // }
- // ];
- },
- onTableBtnClick: item => {
- props.onTableBtnClick(item);
- return;
- // 通用按钮操作
- // props.onTableBtnClick(item);
- const { tableName, index, record, tableData, config } = item;
- const { iStar } = record;
- const { showName } = config;
- if (iStar === 1 && showName === "开工") {
- setTableLoading(true);
- props.onStartWork(item).finally(() => {
- setTableLoading(false);
- });
- } else if (iStar === 2 && showName === "暂停") {
- setTableLoading(true);
- handlePause({ item, props }).finally(() => {
- setTableLoading(false);
- props.onRefresh();
- });
- }
- },
- tableBtnsWidth: "190px",
- fixedHeight: "335px"
- };
- // 全部按钮事件
- const tableAll = () => {
- setSSrcNo("");
- props.onSearch();
- };
- // 查询按钮事件
- const tableQuery = () => {
- props.onSearch(sSrcNo);
- };
-
- // 前期生产或反馈问题业务
- const [issueType, setIssueType] = useState(4);
- const issueObj = slave1Column?.reduce((acc, item) => {
- const chineseKey = item.title.replace(/[0-9]/g, "");
- if (acc[chineseKey]) {
- acc[chineseKey].push(item);
- } else {
- acc[chineseKey] = [item];
+ });
+ } else if (iStar === 2 || iStar === 3) {
+ // 暂停中,走开工接口
+ const dataReturn = await handleStartWork(item);
+ const { code, msg } = dataReturn;
+ if (code === 1) {
+ // 成功开工
+ itemClickRef.current = null;
+ message.success(dataReturn.msg);
+ if (props.taskConfirmModalVisible) {
+ props.onSaveState({
+ taskConfirmModalVisible: false,
+ taskConfirmModalMsg: "",
+ tempTaskId: ""
+ });
}
- return acc;
- }, {});
-
- let issue = [];
-
- if (issueObj) {
- issue = Object.keys(issueObj)?.map((key, i) => {
- return { name: key, items: issueObj[key], id: i };
+ props.onChangeRouter({
+ type: "name",
+ path: ["生产执行", "生产执行"]
+ });
+ } else if (code === -7) {
+ // 如果有开工中的任务,即接口返回-7,弹出确认窗体
+ itemClickRef.current = { data: item };
+ props.onSaveState({
+ taskConfirmModalVisible: true,
+ taskConfirmModalMsg: msg,
+ tempTaskId: record.sId
});
+ } else {
+ // 报错
+ message.error(msg);
}
-
- const component = id => {
- if (issue?.length > 0) {
- return (
-
- {issue[id].items.map(item => (
-
- {item.title}:
- {slave1Data[0] ? (
-
- {slave1Data[0][item.dataIndex]}
-
- }
- >
- {slave1Data[0][item.dataIndex]}
-
- ) : (
- ""
- )}
-
- ))}
-
- );
- }
- };
-
- const [carouselData, setCarouselData] = useState([
- {
- title: "暂无通告",
- content: "暂无通告",
- id: 999
- }
- ]);
-
- const { slave3Data = [] } = props;
-
- useEffect(
- () => {
- if (!slave3Data.length) return;
-
- const tempData = slave3Data.map((item, index) => ({
- title: `车间通告${index + 1}`,
- content: item.sNoticeMemo,
- id: index
- }));
-
- setCarouselData(tempData);
- },
- [slave3Data.length]
- );
-
- // 设备信息业务
- const slave2OneData = slave2Data[0] || {};
- const { countMapJsON } = slave2OneData;
- const countMap = commonUtils.convertStrToObj(countMapJsON);
-
- const taskInfoData = {};
- slave2Column?.forEach(obj => {
- taskInfoData[`${obj.dataIndex}Title`] = obj.title;
- taskInfoData[`${obj.dataIndex}Conent`] = countMap[obj.dataIndex];
- });
-
+ }
+ };
+
+ // 更新机台状态
+ const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => {
+ const { app } = props;
+ const { sId } = item.record;
+ const { token } = app;
+ const url = `${
+ commonConfig.server_host
+ }oee/updateProductionplan/${sId}/${iFlag}${
+ pauseValue
+ ? `?sWorkOrderChangeMemo=${encodeURIComponent(pauseValue)}`
+ : ""
+ }`;
+ const dataReturn = (await commonServices.getService(token, url)).data;
+ if (dataReturn.code === 1) {
+ handleRefresh();
+ } else {
+ message.error(dataReturn.msg);
+ }
+ };
+
+ return {
+ ...props,
+ // 其他对象
+ itemClickRef,
+ onSearch: handleSearch,
+ onStartWork: handleStartWork, // 开工事件
+ onRefresh: handleRefresh, // 刷新页面
+ onTableBtnClick: handleTableBtnClick, // 开工、暂停事件
+ onUpdateProductionplan: handleUpdateProductionplan // 更新机台状态
+ };
+};
+
+/**
+ * 暂停按钮
+ * @param {*} params
+ */
+const handlePause = async params => {
+ const { item, props } = params;
+ const { record, config } = item;
+ await operationFetch(
+ { ...props, workOrderInfoData: [record] },
+ config,
+ config.sName || "fileError"
+ );
+ await handleOeeBtnEent({ props, item });
+};
+
+const MachineTasks = baseProps => {
+ const props = useInfoEvent(useCommonBase({ ...baseProps }));
+ const {
+ app,
+ slave0Config,
+ slave1Column,
+ slave1Data = [],
+ slave2Column,
+ slave2Data = []
+ } = props;
+
+ const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
+
+ const [isTableLoading, setTableLoading] = useState(false);
+
+ // const BtnTableCopyTo.startWork
+ // 开工按钮配置
+ const startWorkConfig =
+ slave0Config?.gdsconfigformslave?.find(
+ item => item.sControlName === "BtnTableCopyTo.startWork"
+ ) || {};
+ const pauseWorkConfig =
+ slave0Config?.gdsconfigformslave?.find(
+ item => item.sControlName === "BtnTableCopyTo.pauseWork"
+ ) || {};
+
+ // 表格业务
+ const [sSrcNo, setSSrcNo] = useState("");
+ // 顶部表格配置
+ const tableProps = {
+ ...commonBusiness.getTableTypes("slave0", props),
+ tableProps: {
+ onChange: () => {},
+ loading: isTableLoading
+ },
+ tableBtnsConfig: params => {
+ const { record, index } = params;
+ const { iStar } = record;
+ // const iStar = index === 0 ? 1 : 2;
+
+ // const bStart = iStar === 1;
+ // const bPause = iStar === 2;
+
+ // 1 :开工状态(显示暂停) 2: 暂停状态(显示开工) 3: 完工状态(显示完工,灰色)
+ // 开工:开工接口(现在)1:正常, -7:有开工,要有提示, -1: 错误提示
+ // -7 :完工: iFlag:3 (完工上一条) 暂停:iFlag:2 (暂停上一条)
+ // 暂停:新接口
+
+ let showName, btnBgColor, sDefault;
+ if (iStar === 1) {
+ showName = "暂1停";
+ btnBgColor = "#FAAD14";
+ } else if (iStar === 2 || iStar === 3) {
+ showName = "开1工";
+ btnBgColor = "#1890FF";
+ } else {
+ showName = "完1工";
+ btnBgColor = "#AAA";
+ sDefault = "${false}";
+ }
+
+ if (!bStartWork) {
+ sDefault = "${false}";
+ }
+
+ return [
+ { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig },
+ { showName: "完工", btnBgColor: "#1890FF", sDefault }
+ ];
+
+ // return [
+ // {
+ // ...startWorkConfig,
+ // showName: "开工",
+ // btnBgColor: bStart ? "#1890FF" : "#AAA"
+ // },
+ // {
+ // ...pauseWorkConfig,
+ // showName: "暂停",
+ // btnBgColor: bPause ? "#FAAD14" : "#AAA"
+ // }
+ // ];
+ },
+ onTableBtnClick: item => {
+ props.onTableBtnClick(item);
+ return;
+ // 通用按钮操作
+ // props.onTableBtnClick(item);
+ const { tableName, index, record, tableData, config } = item;
+ const { iStar } = record;
+ const { showName } = config;
+ if (iStar === 1 && showName === "开工") {
+ setTableLoading(true);
+ props.onStartWork(item).finally(() => {
+ setTableLoading(false);
+ });
+ } else if (iStar === 2 && showName === "暂停") {
+ setTableLoading(true);
+ handlePause({ item, props }).finally(() => {
+ setTableLoading(false);
+ props.onRefresh();
+ });
+ }
+ },
+ tableBtnsWidth: "190px",
+ fixedHeight: "335px"
+ };
+ // 全部按钮事件
+ const tableAll = () => {
+ setSSrcNo("");
+ props.onSearch();
+ };
+ // 查询按钮事件
+ const tableQuery = () => {
+ props.onSearch(sSrcNo);
+ };
+
+ // 前期生产或反馈问题业务
+ const [issueType, setIssueType] = useState(4);
+ const issueObj = slave1Column?.reduce((acc, item) => {
+ const chineseKey = item.title.replace(/[0-9]/g, "");
+ if (acc[chineseKey]) {
+ acc[chineseKey].push(item);
+ } else {
+ acc[chineseKey] = [item];
+ }
+ return acc;
+ }, {});
+
+ let issue = [];
+
+ if (issueObj) {
+ issue = Object.keys(issueObj)?.map((key, i) => {
+ return { name: key, items: issueObj[key], id: i };
+ });
+ }
+
+ const component = id => {
+ if (issue?.length > 0) {
return (
-
-
-
-
-
-
-
-
- setSSrcNo(e.target.value)}
- />
-
-
-
-
-
-
-
-
前期生产或反馈问题
- {issue?.map(item => (
-
- ))}
- {component(issueType)}
-
-
-
-
-
- {carouselData.map(item => (
-
-
{item.title}
-
{item.content}
-
- ))}
-
-
-
-
-
- 设备信息
-
-
-

-
-
{taskInfoData.sMachineNameTitle}:
-
{taskInfoData.sMachineNameConent}
+
+ {issue[id].items.map(item => (
+
+ {item.title}:
+ {slave1Data[0] ? (
+
+ {slave1Data[0][item.dataIndex]}
+
+ }
+ >
+ {slave1Data[0][item.dataIndex]}
+
+ ) : (
+ ""
+ )}
+
+ ))}
+
+ );
+ }
+ };
+ const NoAnnouncements = commonFunc.showLocalMessage(props, 'NoAnnouncements', '暂无通告');
+
+ const [carouselData, setCarouselData] = useState([
+ {
+ title: NoAnnouncements,
+ content: NoAnnouncements,
+ id: 999
+ }
+ ]);
+
+ const { slave3Data = [] } = props;
+
+ useEffect(
+ () => {
+ if (!slave3Data.length) return;
+
+ const tempData = slave3Data.map((item, index) => ({
+ title: `车间通告${index + 1}`,
+ content: item.sNoticeMemo,
+ id: index
+ }));
+
+ setCarouselData(tempData);
+ },
+ [slave3Data.length]
+ );
+
+ // 设备信息业务
+ const slave2OneData = slave2Data[0] || {};
+ const { countMapJsON } = slave2OneData;
+ const countMap = commonUtils.convertStrToObj(countMapJsON);
+
+ const taskInfoData = {};
+ slave2Column?.forEach(obj => {
+ taskInfoData[`${obj.dataIndex}Title`] = obj.title;
+ taskInfoData[`${obj.dataIndex}Conent`] = countMap[obj.dataIndex];
+ });
+ const feedbackIssues = commonFunc.showLocalMessage(props, 'feedbackIssues', '前期生产或反馈问题');
+ const btnsearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询111');
+ console.log('3333', btnsearch);
+ const btnAll = commonFunc.showLocalMessage(props, 'btnAll', '全部');
+ const sWorkOrderNo = commonFunc.showLocalMessage(props, 'sWorkOrderNo', '工单编号');
+
+
+ return (
+
+
+
+
+
+
+
+
+ setSSrcNo(e.target.value)}
+ />
+
+
+
+
+
+
+
+
{feedbackIssues}
+ {issue?.map(item => (
+
+ ))}
+ {component(issueType)}
+
+
+
+
+
+ {carouselData.map(item => (
+
+
{item.title}
+
{item.content}
+ ))}
+
+
+
+
+
+ 设备信息
+
+
+

+
+
{taskInfoData.sMachineNameTitle}:
+
{taskInfoData.sMachineNameConent}
+
+
+
+
+
+

+
+
{taskInfoData.sStatusNameTitle}:
+
{taskInfoData.sStatusNameConent}
+
+
+
+
+
+
+

+
+
{taskInfoData.tStartingUpTimeTitle}:
+
{taskInfoData.tStartingUpTimeConent}
+
+
+
+
{taskInfoData.tNorRunTimeTitle}:
+
{taskInfoData.tNorRunTimeConent}
-
-
-
-

-
-
{taskInfoData.sStatusNameTitle}:
-
{taskInfoData.sStatusNameConent}
-
-
+
+
{taskInfoData.tExeWaitTimeTitle}:
+
{taskInfoData.tExeWaitTimeConent}
-
-
-
-

-
-
{taskInfoData.tStartingUpTimeTitle}:
-
{taskInfoData.tStartingUpTimeConent}
-
-
-
-
{taskInfoData.tNorRunTimeTitle}:
-
{taskInfoData.tNorRunTimeConent}
-
-
-
{taskInfoData.tExeWaitTimeTitle}:
-
{taskInfoData.tExeWaitTimeConent}
-
-
-
-
-
{taskInfoData.tNorWaitTimeTitle}:
-
{taskInfoData.tNorWaitTimeConent}
-
-
-
{taskInfoData.tMaintenceTimeTitle}:
-
{taskInfoData.tMaintenceTimeConent}
-
-
+
+
+
+
{taskInfoData.tNorWaitTimeTitle}:
+
{taskInfoData.tNorWaitTimeConent}
-
-
-
-

-
-
今日完成任务批次/产量(个):
-
- {taskInfoData.iFinishTaskBatchConent} /{" "}
- {taskInfoData.iFinishProductionNumConent}
-
-
+
+
{taskInfoData.tMaintenceTimeTitle}:
+
{taskInfoData.tMaintenceTimeConent}
-
-
-
-
- );
- };
-
- const TaskConfirmModal = props => {
- const {
- taskConfirmModalVisible,
- taskConfirmModalMsg,
- bPauseOnly,
- slave0Config
- } = props;
- if (!taskConfirmModalVisible) return "";
-
- const handleClose = () => {
- props.itemClickRef.current = null;
- props.onSaveState({
- taskConfirmModalVisible: false,
- bPauseOnly: false,
- pauseCallback: null
- });
- };
-
- const [pauseValue, setPauseValue] = useState("");
-
- const viewConfigs = slave0Config?.gdsconfigformslave.filter(
- item => item.sName === "sPausereason"
- );
+
+
+
+
+
+

+
+
今日完成任务批次/产量(个):
+
+ {taskInfoData.iFinishTaskBatchConent} /{" "}
+ {taskInfoData.iFinishProductionNumConent}
+
+
+
+
+
+
+
+ );
+};
- const sIdRef = useRef(commonUtils.createSid());
-
- const viewProps = {
- ...props,
- viewConfigs,
- tableConfig: { ...slave0Config, gdsconfigformslave: viewConfigs },
- iColValueView: 24,
- viewRow: { sId: sIdRef.current, sPausereason: pauseValue },
- tableName: "slave0",
- enabled: true,
- onDataChange: (...args) => {
- setPauseValue(args[2].sPausereason);
- }
- };
-
- return (
-
提示!}
- open={taskConfirmModalVisible}
- width={500}
- height={320}
- className="mesCommonModal"
- footer={
+const TaskConfirmModal = props => {
+ const { taskConfirmModalVisible, taskConfirmModalMsg, bPauseOnly } = props;
+ if (!taskConfirmModalVisible) return "";
+
+ const handleClose = () => {
+ props.itemClickRef.current = null;
+ props.onSaveState({
+ taskConfirmModalVisible: false,
+ bPauseOnly: false,
+ pauseCallback: null
+ });
+ };
+
+ const [pauseValue, setPauseValue] = useState("");
+
+ return (
+ 提示!}
+ open={taskConfirmModalVisible}
+ width={500}
+ height={370}
+ className="mesCommonModal"
+ footer={
+
+ {bPauseOnly ? (
+
+ ) : (
<>
- {bPauseOnly ? (
-
-
-
- ) : (
-
-
-
-
- )}
+
+
>
+ )}
+
+ }
+ onCancel={handleClose}
+ >
+ {taskConfirmModalMsg}
+
+
暂停原因
+
setPauseValue(e.target.value)}
+ />
+
+
+ );
+};
+
+// 全屏状态
+const StatusBtnComponent = () => {
+ const items = [
+ {
+ key: "4",
+ label: 转产,
+ value: {
+ conent2: "转产",
+ backgroundColor: "#752AFE"
+ }
+ },
+ {
+ key: "1",
+ label: 测试,
+ value: {
+ conent2: "转产",
+ backgroundColor: "#21C9FE"
+ },
+ children: [
+ {
+ key: "1-1",
+ label: 产品打样,
+ value: {
+ conent2: "产品打样",
+ backgroundColor: "#21C9FE"
}
- onCancel={handleClose}
- >
- {taskConfirmModalMsg}
-
- {/*
暂停原因
*/}
-
- {/*
setPauseValue(e.target.value)}
- /> */}
-
-
+ },
+ {
+ key: "1-2",
+ label:
工艺测试,
+ value: {
+ conent2: "工艺测试",
+ backgroundColor: "#21C9FE"
+ }
+ }
+ ]
+ },
+ {
+ key: "2",
+ label:
保养,
+ value: {
+ conent2: "保养",
+ backgroundColor: "#FF6600"
+ },
+ children: [
+ {
+ key: "2-1",
+ label:
日常保养,
+ value: {
+ conent2: "日常保养",
+ backgroundColor: "#FF6600"
+ }
+ },
+ {
+ key: "2-2",
+ label:
一级保养,
+ value: {
+ conent2: "一级保养",
+ backgroundColor: "#FF6600"
+ }
+ },
+ {
+ key: "2-3",
+ label:
二级保养,
+ value: {
+ conent2: "二级保养",
+ backgroundColor: "#FF6600"
+ }
+ },
+ {
+ key: "2-4",
+ label:
一级+二级保养,
+ value: {
+ conent2: "一级+二级保养",
+ backgroundColor: "#FF6600",
+ fontSize: 130
+ }
+ },
+ {
+ key: "2-5",
+ label:
年度保养,
+ value: {
+ conent2: "年度保养",
+ backgroundColor: "#FF6600"
+ }
+ }
+ ]
+ }
+ ];
+
+ const handleMenuClick = e => {
+ message.success({
+ top: 0,
+ duration: 0,
+ className: styles.machineStatus,
+ content:
+ });
+ };
+
+ return (
+
+
+
+
+
+ );
+};
+
+const MachineMessageComponent = ({ e }) => {
+ const value = e.item?.props?.value || {};
+ const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss"));
+ const { backgroundColor, conent2, fontSize } = value;
+
+ const [currentTime, setCurrentTime] = useState("");
+ const [diffHours, setDiffHours] = useState(0);
+ const [diffMins, setDiffMins] = useState(0);
+ const [diffSecs, setDiffSecs] = useState(0);
+ const flagRef = useRef(0);
+ useEffect(() => {
+ const getTime = () => {
+ const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss");
+ setCurrentTime(currentTimeNew);
+
+ const duration = moment.duration(
+ moment(currentTimeNew).diff(moment(startTime))
);
+ const hours = duration
+ .asHours()
+ .toString()
+ .split(".")[0];
+ const minutes = (duration.asMinutes() % 60).toString().split(".")[0];
+ const seconds = duration.asSeconds() % 60;
+
+ setDiffHours(hours);
+ setDiffMins(minutes);
+ setDiffSecs(seconds);
};
-
- // 全屏状态
- const StatusBtnComponent = () => {
-
- const items = [
- {
- key: "4",
- label:
转产,
- value: {
- conent2: "转产",
- backgroundColor: "#752AFE"
- }
- },
- {
- key: "1",
- label:
测试,
- value: {
- conent2: "转产",
- backgroundColor: "#21C9FE"
- },
- children: [
- {
- key: "1-1",
- label:
产品打样,
- value: {
- conent2: "产品打样",
- backgroundColor: "#21C9FE"
- }
- },
- {
- key: "1-2",
- label:
工艺测试,
- value: {
- conent2: "工艺测试",
- backgroundColor: "#21C9FE"
- }
- }
- ]
- },
- {
- key: "2",
- label:
保养,
- value: {
- conent2: "保养",
- backgroundColor: "#FF6600"
- },
- children: [
- {
- key: "2-1",
- label:
日常保养,
- value: {
- conent2: "日常保养",
- backgroundColor: "#FF6600"
- }
- },
- {
- key: "2-2",
- label:
一级保养,
- value: {
- conent2: "一级保养",
- backgroundColor: "#FF6600"
- }
- },
- {
- key: "2-3",
- label:
二级保养,
- value: {
- conent2: "二级保养",
- backgroundColor: "#FF6600"
- }
- },
- {
- key: "2-4",
- label:
一级+二级保养,
- value: {
- conent2: "一级+二级保养",
- backgroundColor: "#FF6600",
- fontSize: 130
- }
- },
- {
- key: "2-5",
- label:
年度保养,
- value: {
- conent2: "年度保养",
- backgroundColor: "#FF6600"
- }
- }
- ]
- }
- ];
-
- // 全屏
- const handleMenuClick = item2 => {
- const newObj = {
- ...item2,
- item: item2.item
- };
- window.$wkcFullStatus(newObj , true)
- };
-
-
- return (
- <>
-
-
-
-
-
- >
- );
+
+ getTime();
+ const timer = setInterval(() => {
+ getTime();
+ }, 1000);
+
+ const handleMenuClose = () => {
+ if (flagRef.current) return;
+ flagRef.current++;
+ Modal.confirm({
+ title: "温馨提示:",
+ content:
确认退出该页面?
,
+ okText: "确认",
+ cancelText: "取消",
+ zIndex: 2000,
+ onOk() {
+ message.destroy();
+ },
+ onCancel() {
+ setTimeout(() => {
+ flagRef.current = 0;
+ }, 500);
+ }
+ });
};
-
- // const MachineMessageComponent = ({ e , shutDown , minimize}) => {
- // const value = e.item?.props?.value || {};
- // const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss"));
- // const { backgroundColor, conent2, fontSize } = value;
- // const [currentTime, setCurrentTime] = useState("");
- // const [diffHours, setDiffHours] = useState(0);
- // const [diffMins, setDiffMins] = useState(0);
- // const [diffSecs, setDiffSecs] = useState(0);
- // const flagRef = useRef(0);
- // useEffect(() => {
- // const getTime = () => {
- // const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss");
- // setCurrentTime(currentTimeNew);
-
- // const duration = moment.duration(
- // moment(currentTimeNew).diff(moment(startTime))
- // );
- // const hours = duration
- // .asHours()
- // .toString()
- // .split(".")[0];
- // const minutes = (duration.asMinutes() % 60).toString().split(".")[0];
- // const seconds = duration.asSeconds() % 60;
-
- // setDiffHours(hours);
- // setDiffMins(minutes);
- // setDiffSecs(seconds);
- // };
-
- // getTime();
- // const timer = setInterval(() => {
- // getTime();
- // }, 1000);
-
- // // const handleMenuClose = () => {
- // // if (flagRef.current) return;
- // // flagRef.current++;
- // // Modal.confirm({
- // // title: "温馨提示:",
- // // content:
确认退出该页面?
,
- // // okText: "确认",
- // // cancelText: "取消",
- // // zIndex: 2000,
- // // onOk() {
- // // message.destroy();
- // // },
- // // onCancel() {
- // // setTimeout(() => {
- // // flagRef.current = 0;
- // // }, 500);
- // // }
- // // });
- // // };
-
- // // setInterval(() => {
- // // document.addEventListener("click", handleMenuClose);
- // // }, 1000);
-
- // return () => {
- // clearInterval(timer);
- // // document.removeEventListener("click", handleMenuClose);
- // };
- // }, []);
-
- // const handleMenuClose = () => {
- // if (flagRef.current) return;
- // flagRef.current++;
- // Modal.confirm({
- // title: "温馨提示:",
- // content:
确认退出该页面?
,
- // okText: "确认",
- // cancelText: "取消",
- // zIndex: 2000,
- // onOk() {
- // // message.destroy();
- // shutDown()
- // },
- // onCancel() {
- // setTimeout(() => {
- // flagRef.current = 0;
- // }, 500);
- // }
- // });
- // };
-
- // return (
- //
- //
设备停机状态告知
- //
- // {conent2}
- //
- //
- // 停机开始时间:
- // {startTime}
- //
- //
- // 系统当前时间:
- // {currentTime}
- //
- //
- // 此次停机耗时:
- //
- // 约:
- // {diffHours}时 {diffMins}分 {diffSecs}秒
- //
- //
- //
- //
- //
- //
- //
- // );
- // };
-
- export default MachineTasks;
-
\ No newline at end of file
+
+ setInterval(() => {
+ document.addEventListener("click", handleMenuClose);
+ }, 1000);
+
+ return () => {
+ clearInterval(timer);
+ document.removeEventListener("click", handleMenuClose);
+ };
+ }, []);
+
+ return (
+
+
设备停机状态告知
+
+ {conent2}
+
+
+ 停机开始时间:
+ {startTime}
+
+
+ 系统当前时间:
+ {currentTime}
+
+
+ 此次停机耗时:
+
+ 约:
+ {diffHours}时 {diffMins}分 {diffSecs}秒
+
+
+
+ );
+};
+
+export default MachineTasks;
diff --git a/src/mes/teamInfo/index.js b/src/mes/teamInfo/index.js
index f16275e..b2ba4f7 100644
--- a/src/mes/teamInfo/index.js
+++ b/src/mes/teamInfo/index.js
@@ -500,8 +500,8 @@ const TeamInfo = baseProps => {
tableName: "slave",
viewRow: props.slaveData && props.slaveData.length !== 0 ? props.slaveData[0] : {},
onDataChange: (tableName, sName, returnValue , sId , dropDownData , isWait ) => {
- props.onSaveState({
- [`slaveData`]: [ {...props.slaveData[0] , ...returnValue} ]
+ props.onSaveState({
+ [`slaveData`]: [ {...props.slaveData[0] , ...returnValue} ]
});
setTimeout(()=>{
// 调用指令集保存
@@ -522,8 +522,8 @@ const TeamInfo = baseProps => {
};
// 清空临时IPQC
const clearTempIpqc = () => {
- props.onSaveState({
- [`slaveData`]: [ {...props.slaveData[0] , sIpqcId2:'' , sIpqcName2: '' } ]
+ props.onSaveState({
+ [`slaveData`]: [ {...props.slaveData[0] , sIpqcId2:'' , sIpqcName2: '' } ]
});
props.onExecInstructSet({
nextProps: { ...props , slaveData : [ {...props.slaveData[0] , sIpqcId2:'',sIpqcName2:''} ] },
@@ -533,6 +533,16 @@ const TeamInfo = baseProps => {
}
})
}
+ const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息');
+
+ const captain = commonFunc.showLocalMessage(props, 'captain', '机长');
+
+ const shift = commonFunc.showLocalMessage(props, 'shift', '班次');
+
+ const classGroup = commonFunc.showLocalMessage(props, 'classGroup', '班组');
+
+ const foreman = commonFunc.showLocalMessage(props, 'foreman', '领班');
+ console.log('2222', teamInformation);
return (
@@ -541,7 +551,7 @@ const TeamInfo = baseProps => {
- 班组信息
+ {teamInformation}
@@ -564,15 +574,15 @@ const TeamInfo = baseProps => {
)}
-
-
+
{ sActualEmployeeName || sEmployeeName}
-
-
+
{props.app.userinfo?.sTeamNo}
-
-
+
{props.app.userinfo?.sShift == "1"
? "白班"
@@ -585,7 +595,7 @@ const TeamInfo = baseProps => {
-
-
+
{sForemanName}
-
@@ -601,7 +611,7 @@ const TeamInfo = baseProps => {
-
+
@@ -710,13 +720,13 @@ const TeamJoinInfo = props => {
});
props.onChangeRouter({ type: "name", path: ["计划任务", "机台任务"] });
};
-
+ const workHandoverInformation= commonFunc.showLocalMessage(props, 'workHandoverInformation', '上班交接信息');
return (
- 上班交接信息
+ {workHandoverInformation}
--
libgit2 0.22.2