Commit f5d106174bd5264f09788a3784fa535e0a5a2e8d

Authored by Min
1 parent edd93ea6

1.处理MES 中文模块与英文模块 展示数量,顺序不一致问题

src/components/Common/CommonHooks/useCommonBase.js
@@ -2393,6 +2393,8 @@ const useCommonBase = props => { @@ -2393,6 +2393,8 @@ const useCommonBase = props => {
2393 } 2393 }
2394 } 2394 }
2395 2395
  2396 + console.log('3333', result);
  2397 +
2396 return result; 2398 return result;
2397 }; 2399 };
2398 2400
src/mes/common/buttonComponent/index.js
@@ -104,14 +104,14 @@ const ButtonComponent = props => { @@ -104,14 +104,14 @@ const ButtonComponent = props => {
104 const newList = btnList 104 const newList = btnList
105 .filter( 105 .filter(
106 item => 106 item =>
107 - item.sName && 107 + item.sName?.trim() &&
108 !item.sName.includes("Modal") && 108 !item.sName.includes("Modal") &&
109 - item.sMenuName !== "工单物料信息" 109 + ( item.sMenuName !== "工单物料信息" || item.sMenuName !== "Work Order Material Information")
110 ) 110 )
111 .map(item => { 111 .map(item => {
112 const { sId, sMenuName, sName } = item; 112 const { sId, sMenuName, sName } = item;
113 return { 113 return {
114 - name: sMenuName, 114 + name: sMenuName?.trim(),
115 id: sId, 115 id: sId,
116 sName, 116 sName,
117 badeg: 0, 117 badeg: 0,
@@ -134,6 +134,27 @@ const ButtonComponent = props => { @@ -134,6 +134,27 @@ const ButtonComponent = props => {
134 }, 134 },
135 [JSON.stringify(managementData)] 135 [JSON.stringify(managementData)]
136 ); 136 );
  137 + const language = props.app.userinfo?.sLanguage;
  138 +
  139 + const menuOrderListEnglish1 = [
  140 + ["Machine Task", 1],
  141 + null,
  142 + ["Label Reprint", 2],
  143 + null,
  144 + ["Work Order Information", 2, 'Label Reprint'],
  145 + ["Product Quality Record", 3, 'Label Reprint'],
  146 + ["Process Work Instructions", 4, 'Label Reprint'],
  147 + ["Related Documents", 5, 'Label Reprint'],
  148 + ["Historical Tasks", 6, 'Label Reprint'],
  149 + ["Production Rework", 2, 'Label Reprint'],
  150 + null,
  151 + null,
  152 + // ["工单物料信息", 7],
  153 + ["Pre-production Reminder Information", 7, 'Label Reprint'],
  154 + ["Work Order WIP List", 8, 'Label Reprint'],
  155 + null,
  156 + null
  157 + ];
137 158
138 const menuOrderList1 = [ 159 const menuOrderList1 = [
139 ["机台任务", 1], 160 ["机台任务", 1],
@@ -174,6 +195,25 @@ const ButtonComponent = props => { @@ -174,6 +195,25 @@ const ButtonComponent = props => {
174 ["工艺巡检", 20] 195 ["工艺巡检", 20]
175 ]; 196 ];
176 197
  198 + const menuOrderListEnglish2 = [
  199 + ["Production Execution", 10],
  200 + ["First Approval Sample Notice", 11],
  201 + ["Exception/Assistance Reporting", 12],
  202 + ["Completion & Clearance", 13],
  203 + ["Plate Splitting/Combining", 14],
  204 + null,
  205 + null,
  206 + ["Quality Patrol Inspection List", 15],
  207 + ["Team Production Reporting", 16],
  208 + ["Sign-off/Completion", 17],
  209 + ["Team Handover", 18],
  210 + ["Work Order Change Information", 19],
  211 + ["Other Machine Daily Report", 16],
  212 + null,
  213 + null,
  214 + ["Process Inspection", 20]
  215 + ];
  216 +
177 const menuOrderList3 = [ 217 const menuOrderList3 = [
178 ["设备保养", 21], 218 ["设备保养", 21],
179 ["设备点检", 22], 219 ["设备点检", 22],
@@ -181,17 +221,30 @@ const ButtonComponent = props => { @@ -181,17 +221,30 @@ const ButtonComponent = props => {
181 ["设备资料", 24] 221 ["设备资料", 24]
182 ]; 222 ];
183 223
  224 + const menuOrderListEnglish3 = [
  225 + ["Equipment Maintenance", 21],
  226 + ["Equipment Check", 22],
  227 + ["Equipment Repair", 23],
  228 + ["Equipment Documentation", 24]
  229 + ];
  230 +
  231 + const menuOrderListLocal1 = language === 'sEnglish' ? menuOrderListEnglish1 : menuOrderList1;
  232 +
  233 + const menuOrderListLocal2 = language === 'sEnglish' ? menuOrderListEnglish2 : menuOrderList2;
  234 +
  235 + const menuOrderListLocal3 = language === 'sEnglish' ? menuOrderListEnglish3 : menuOrderList3;
  236 +
184 const menuList = []; 237 const menuList = [];
185 new Array(16).fill("").forEach((_, index) => { 238 new Array(16).fill("").forEach((_, index) => {
186 const itemName = [ 239 const itemName = [
187 - menuOrderList1[index]?.[0],  
188 - menuOrderList2[index]?.[0],  
189 - menuOrderList3[index]?.[0] 240 + menuOrderListLocal1[index]?.[0],
  241 + menuOrderListLocal2[index]?.[0],
  242 + menuOrderListLocal3[index]?.[0]
190 ]; 243 ];
191 const icon = [ 244 const icon = [
192 - menuOrderList1[index]?.[1],  
193 - menuOrderList2[index]?.[1],  
194 - menuOrderList3[index]?.[1] 245 + menuOrderListLocal1[index]?.[1],
  246 + menuOrderListLocal2[index]?.[1],
  247 + menuOrderListLocal3[index]?.[1]
195 ]; 248 ];
196 const item = dataList.find(item => itemName.includes(item.name)); 249 const item = dataList.find(item => itemName.includes(item.name));
197 let result = ""; 250 let result = "";
@@ -217,7 +270,7 @@ const ButtonComponent = props => { @@ -217,7 +270,7 @@ const ButtonComponent = props => {
217 const { id, disabled, sName } = e; 270 const { id, disabled, sName } = e;
218 if (id == sModelsId || disabled) return; 271 if (id == sModelsId || disabled) return;
219 272
220 - if (e.name !== "首签样通知") { 273 + if (e.name !== "首签样通知" || e.name !== "First Approval Sample Notice") {
221 props.onChangeRouter({ 274 props.onChangeRouter({
222 routerPath: [currentContent], 275 routerPath: [currentContent],
223 sModelsId: id, 276 sModelsId: id,
@@ -243,7 +296,9 @@ const ButtonComponent = props => { @@ -243,7 +296,9 @@ const ButtonComponent = props => {
243 296
244 let bHideTab = false; 297 let bHideTab = false;
245 // 【踢废,拼接,倒卷,读码】完工清场记录不可点击 298 // 【踢废,拼接,倒卷,读码】完工清场记录不可点击
246 - if ([5, 6, 7, 8].includes(iInterface) && e.name === "完工清场/确认") { 299 + if ([5, 6, 7, 8].includes(iInterface) && (
  300 + e.name === "完工清场/确认" || e.name ==='Post-Completion Clearance/Confirmation'
  301 + )) {
247 bHideTab = true; 302 bHideTab = true;
248 } 303 }
249 304
@@ -253,7 +308,8 @@ const ButtonComponent = props => { @@ -253,7 +308,8 @@ const ButtonComponent = props => {
253 if ( 308 if (
254 props.currentContent === "productionExec" && 309 props.currentContent === "productionExec" &&
255 !bStartWork && 310 !bStartWork &&
256 - !["生产执行", "班组报工", "其它机台日报"].includes(e.name) 311 + ( !["生产执行", "班组报工", "其它机台日报"].includes(e.name) ||
  312 + !["Production Execution", "Team Production Reporting ", "Other Machine Daily Report"].includes(e.name) )
257 ) { 313 ) {
258 bStartWorkLimit = true; 314 bStartWorkLimit = true;
259 } 315 }
@@ -265,13 +321,13 @@ const ButtonComponent = props => { @@ -265,13 +321,13 @@ const ButtonComponent = props => {
265 } 321 }
266 322
267 let count = e.disabled ? 0 : e.badeg; 323 let count = e.disabled ? 0 : e.badeg;
268 - if (e.name === "机台任务") { 324 + if (e.name === "机台任务" || e.name ==='Machine Task') {
269 count = table0; 325 count = table0;
270 - } else if (e.name === "历史任务") { 326 + } else if (e.name === "历史任务" || e.name ==='Historical Tasks') {
271 count = table1; 327 count = table1;
272 - } else if (e.name === "工序任务") { 328 + } else if (e.name === "工序任务" || e.name ==='Process Task') {
273 count = table2; 329 count = table2;
274 - } else if (e.name === "其它机台日报") { 330 + } else if (e.name === "其它机台日报" || e.name === "Other Machine Daily Report") {
275 count = table3; 331 count = table3;
276 } 332 }
277 const workFirst = commonFunc.showLocalMessage(props, 'workFirst', '请先上班后再操作'); 333 const workFirst = commonFunc.showLocalMessage(props, 'workFirst', '请先上班后再操作');
@@ -327,7 +383,7 @@ const ButtonComponent = props => { @@ -327,7 +383,7 @@ const ButtonComponent = props => {
327 </div> 383 </div>
328 ); 384 );
329 }; 385 };
330 - console.log(menuList, '1menuList '); 386 + console.log(menuList, '1menuLis111t ');
331 return ( 387 return (
332 <div 388 <div
333 className={`${styles.buttonComponent} ${ 389 className={`${styles.buttonComponent} ${
src/mes/common/buttonComponent/index.less
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 @total-height: 130px; 3 @total-height: 130px;
4 @btns-height: 130px; 4 @btns-height: 130px;
5 -@specialBtns-height: 65px; 5 +@specialBtns-height: 128px;
6 @btns-item-bgColor: #d2e5ff; 6 @btns-item-bgColor: #d2e5ff;
7 7
8 .buttonComponent { 8 .buttonComponent {
@@ -170,4 +170,4 @@ @@ -170,4 +170,4 @@
170 .flex(center, center); 170 .flex(center, center);
171 } 171 }
172 } 172 }
173 -}  
174 \ No newline at end of file 173 \ No newline at end of file
  174 +}
src/mes/common/commonModelComponent/index.js
@@ -1215,6 +1215,7 @@ const CommonModelComponent = props =&gt; { @@ -1215,6 +1215,7 @@ const CommonModelComponent = props =&gt; {
1215 const { tabConfig = [], level, modelStyle, app } = props; 1215 const { tabConfig = [], level, modelStyle, app } = props;
1216 const { userinfo } = app; 1216 const { userinfo } = app;
1217 const sLanguage = userinfo.sLanguage; 1217 const sLanguage = userinfo.sLanguage;
  1218 + console.log('vvv', sLanguage);
1218 const getComponent = (config, index = 0) => { 1219 const getComponent = (config, index = 0) => {
1219 const { 1220 const {
1220 sName, 1221 sName,
@@ -1280,11 +1281,13 @@ const CommonModelComponent = props =&gt; { @@ -1280,11 +1281,13 @@ const CommonModelComponent = props =&gt; {
1280 sEntireTabName, 1281 sEntireTabName,
1281 sEnglishEntireTabName, 1282 sEnglishEntireTabName,
1282 sBig5EntireTabName, 1283 sBig5EntireTabName,
  1284 + sEnglishTabName,
1283 mode, 1285 mode,
1284 width = "100%", 1286 width = "100%",
1285 height = "100%" 1287 height = "100%"
1286 } = item; 1288 } = item;
1287 - const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName : 1289 + console.log('ssconfigLists', configList);
  1290 + const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName + '1111' :
1288 sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName; 1291 sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName;
1289 const advancedStyle = 1292 const advancedStyle =
1290 mode === "advanced" 1293 mode === "advanced"
@@ -1381,10 +1384,13 @@ const CommonModelComponent = props =&gt; { @@ -1381,10 +1384,13 @@ const CommonModelComponent = props =&gt; {
1381 ) 1384 )
1382 .map((config, index) => { 1385 .map((config, index) => {
1383 const { sName, sEnglishTabName, sBig5TabName, sTabName } = config; 1386 const { sName, sEnglishTabName, sBig5TabName, sTabName } = config;
1384 - const sTabNewName = sLanguage ==='sEnglish' ? sEnglishTabName : sLanguage ==='sBig5' ? 1387 + console.log('32323', config, sLanguage);
  1388 + const sTabNewName = sLanguage === 'sEnglish' ? sEnglishTabName : sLanguage ==='sBig5' ?
1385 sBig5TabName : sTabName; 1389 sBig5TabName : sTabName;
1386 let disabled = false; 1390 let disabled = false;
1387 1391
  1392 + console.log('32323', sTabNewName);
  1393 +
1388 if (sTabName === "拼接列表" && sName === "slaveWypj3") { 1394 if (sTabName === "拼接列表" && sName === "slaveWypj3") {
1389 // 特殊处理:拼接详情可保存时,拼接列表tab不可点击 1395 // 特殊处理:拼接详情可保存时,拼接列表tab不可点击
1390 disabled = 1396 disabled =
@@ -1476,7 +1482,7 @@ const TabTitleComponent = props =&gt; { @@ -1476,7 +1482,7 @@ const TabTitleComponent = props =&gt; {
1476 1482
1477 // 表单组件 1483 // 表单组件
1478 const CommonViewTableComponent = props => { 1484 const CommonViewTableComponent = props => {
1479 - const { sTabName, showType, sName } = props; 1485 + const { sTabName, showType, sName, sEnglishTabName, } = props;
1480 if (showType !== "form") return ""; 1486 if (showType !== "form") return "";
1481 1487
1482 const { 1488 const {
@@ -1551,7 +1557,11 @@ const CommonViewTableComponent = props =&gt; { @@ -1551,7 +1557,11 @@ const CommonViewTableComponent = props =&gt; {
1551 } 1557 }
1552 } 1558 }
1553 1559
1554 - const groupList = sTabName.split(","); 1560 + const sLanguage = props.app.userinfo?.sLanguage;
  1561 +
  1562 + const sTabLocalName = sLanguage === 'sEnglish' ? sEnglishTabName : sTabName;
  1563 +
  1564 + const groupList = sTabLocalName?.split(",") || [];
1555 const viewConfigsList = groupList.map((tabName, index) => { 1565 const viewConfigsList = groupList.map((tabName, index) => {
1556 if (tabName === "隐藏") { 1566 if (tabName === "隐藏") {
1557 return []; 1567 return [];
src/mes/scheduledTasks/machineTasks/index.js
@@ -340,17 +340,24 @@ @@ -340,17 +340,24 @@
340 }; 340 };
341 341
342 const itemClickRef = useRef(); 342 const itemClickRef = useRef();
  343 + const finishConstruction = commonFunc.showLocalMessage(props, 'finishConstruction', '完工');
343 344
  345 + const confirmCompletion = commonFunc.showLocalMessage(props, 'confirmCompletion', '确认完工');
  346 + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示');
  347 + const btnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认');
  348 + const btnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
  349 + const pause = commonFunc.showLocalMessage(props, 'pause', '暂停');
  350 + const pausingReason = commonFunc.showLocalMessage(props, 'pausingReason', '请选择暂停原因');
344 // 开工、暂停事件 351 // 开工、暂停事件
345 const handleTableBtnClick = async item => { 352 const handleTableBtnClick = async item => {
346 const { tableName, index, record, tableData, config, iFlag } = item; 353 const { tableName, index, record, tableData, config, iFlag } = item;
347 - const { showName } = config;  
348 - if (showName === "完工") { 354 + const { showName, sChinese } = config;
  355 + if (sChinese === "完工") {
349 Modal.confirm({ 356 Modal.confirm({
350 - title: "温馨提示:",  
351 - content: <div>确认完工?</div>,  
352 - okText: "确认",  
353 - cancelText: "取消", 357 + title: FriendlyReminder,
  358 + content: <div>{confirmCompletion}?</div>,
  359 + okText: btnSure,
  360 + cancelText: btnCancel,
354 onOk() { 361 onOk() {
355 handleUpdateProductionplan({ item, iFlag: 4 }); 362 handleUpdateProductionplan({ item, iFlag: 4 });
356 } 363 }
@@ -365,10 +372,10 @@ @@ -365,10 +372,10 @@
365 if (tableData.length === 1) { 372 if (tableData.length === 1) {
366 const result = await new Promise(resolve => { 373 const result = await new Promise(resolve => {
367 Modal.confirm({ 374 Modal.confirm({
368 - title: "温馨提示:", 375 + title: FriendlyReminder,
369 content: <div>请选择要变更的状态</div>, 376 content: <div>请选择要变更的状态</div>,
370 - okText: "完工",  
371 - cancelText: "暂停", 377 + okText: finishConstruction,
  378 + cancelText: pause,
372 onOk() { 379 onOk() {
373 resolve(true); 380 resolve(true);
374 }, 381 },
@@ -387,7 +394,7 @@ @@ -387,7 +394,7 @@
387 // 开工中,走暂停接口 394 // 开工中,走暂停接口
388 props.onSaveState({ 395 props.onSaveState({
389 taskConfirmModalVisible: true, 396 taskConfirmModalVisible: true,
390 - taskConfirmModalMsg: "请选择暂停原因", 397 + taskConfirmModalMsg: pausingReason,
391 tempTaskId: record.sId, 398 tempTaskId: record.sId,
392 bPauseOnly: true, 399 bPauseOnly: true,
393 pauseCallback: pauseValue => { 400 pauseCallback: pauseValue => {