Commit 865ef76fa45e853461b69380dfe8f1740e76cc1c

Authored by chenxt
1 parent 2678cd30

登录界面bug修复 2.完工时选择是否完工清场

src/components/Common/CommonBase.js
@@ -780,7 +780,6 @@ export default (ChildComponent) => { @@ -780,7 +780,6 @@ export default (ChildComponent) => {
780 addState[`${name}DelData`] = []; 780 addState[`${name}DelData`] = [];
781 } 781 }
782 if (isWait) { 782 if (isWait) {
783 - console.log(addState)  
784 return addState; 783 return addState;
785 } else if (this.mounted) { 784 } else if (this.mounted) {
786 this.setState(addState); 785 this.setState(addState);
@@ -1025,12 +1024,10 @@ export default (ChildComponent) => { @@ -1025,12 +1024,10 @@ export default (ChildComponent) => {
1025 if (commonUtils.isNotEmptyObject(sRulesJson) && commonUtils.isJSON(sRulesJson)) { 1024 if (commonUtils.isNotEmptyObject(sRulesJson) && commonUtils.isJSON(sRulesJson)) {
1026 const sRulesObjArr = JSON.parse(sRulesJson); 1025 const sRulesObjArr = JSON.parse(sRulesJson);
1027 if (commonUtils.isNotEmptyArr(sRulesObjArr)) { 1026 if (commonUtils.isNotEmptyArr(sRulesObjArr)) {
1028 - console.log('sRulesObjArr:', sRulesObjArr);  
1029 sRulesObjArr.forEach((sRulesObj) => { 1027 sRulesObjArr.forEach((sRulesObj) => {
1030 const { 1028 const {
1031 showColumn, hideColumn, condition, tbName, sConfigName, 1029 showColumn, hideColumn, condition, tbName, sConfigName,
1032 } = sRulesObj; 1030 } = sRulesObj;
1033 - console.log('tbName:', tbName);  
1034 /* 主表单表字段根据条件控制 其他字段的显示与隐藏 */ 1031 /* 主表单表字段根据条件控制 其他字段的显示与隐藏 */
1035 if (commonUtils.isEmptyObject(tbName)) { 1032 if (commonUtils.isEmptyObject(tbName)) {
1036 if (commonUtils.isNotEmptyArr(condition)) { 1033 if (commonUtils.isNotEmptyArr(condition)) {
@@ -2015,7 +2012,6 @@ export default (ChildComponent) => { @@ -2015,7 +2012,6 @@ export default (ChildComponent) => {
2015 if (commonUtils.isNotEmptyObject(sRulesJson) && commonUtils.isJSON(sRulesJson)) { 2012 if (commonUtils.isNotEmptyObject(sRulesJson) && commonUtils.isJSON(sRulesJson)) {
2016 const sRulesObjArr = JSON.parse(sRulesJson); 2013 const sRulesObjArr = JSON.parse(sRulesJson);
2017 if (Array.isArray(sRulesObjArr) && commonUtils.isNotEmptyArr(sRulesObjArr)) { 2014 if (Array.isArray(sRulesObjArr) && commonUtils.isNotEmptyArr(sRulesObjArr)) {
2018 - console.log('sRulesObjArr:', sRulesObjArr);  
2019 sRulesObjArr.forEach((sRulesObj) => { 2015 sRulesObjArr.forEach((sRulesObj) => {
2020 const { 2016 const {
2021 showColumn, hideColumn, condition, tbName, sConfigName, 2017 showColumn, hideColumn, condition, tbName, sConfigName,
@@ -2195,7 +2191,6 @@ export default (ChildComponent) => { @@ -2195,7 +2191,6 @@ export default (ChildComponent) => {
2195 const value = { sProName, sProInParam: JSON.stringify({ params: sRowData }) }; 2191 const value = { sProName, sProInParam: JSON.stringify({ params: sRowData }) };
2196 const url = `${commonConfig.server_host}procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; 2192 const url = `${commonConfig.server_host}procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`;
2197 const dataReturn = (await commonServices.postValueService(app.token, value, url)).data; 2193 const dataReturn = (await commonServices.postValueService(app.token, value, url)).data;
2198 - console.log('dataReturn', dataReturn);  
2199 if (dataReturn.code === 1) { 2194 if (dataReturn.code === 1) {
2200 if (commonUtils.isNotEmptyArr(slaveDataOld)) { 2195 if (commonUtils.isNotEmptyArr(slaveDataOld)) {
2201 slaveDataOld.forEach((item) => { 2196 slaveDataOld.forEach((item) => {
src/components/Common/commonFunc.js
@@ -274,7 +274,6 @@ export function getAssignFieldValue(sAssignField, srcData, allTableData, bMultiT @@ -274,7 +274,6 @@ export function getAssignFieldValue(sAssignField, srcData, allTableData, bMultiT
274 if (commonUtils.isNotEmptyObject(srcData)) { 274 if (commonUtils.isNotEmptyObject(srcData)) {
275 let strVar = ''; 275 let strVar = '';
276 if (sAssignField && sAssignField.includes('var') && bCommon) { 276 if (sAssignField && sAssignField.includes('var') && bCommon) {
277 - console.log('sAssignFiel:d', sAssignField);  
278 if (sAssignField.includes('slave.') || sAssignField.includes('slave.') || sAssignField.includes('control.') 277 if (sAssignField.includes('slave.') || sAssignField.includes('slave.') || sAssignField.includes('control.')
279 || sAssignField.includes('materials.') || sAssignField.includes('process.') || sAssignField.includes('master.')) { /* var表格对象 */ 278 || sAssignField.includes('materials.') || sAssignField.includes('process.') || sAssignField.includes('master.')) { /* var表格对象 */
280 for (const row of Object.keys(allTableData)) { 279 for (const row of Object.keys(allTableData)) {
src/mes/login/index.js
@@ -132,7 +132,7 @@ const useLoginEvent = props => { @@ -132,7 +132,7 @@ const useLoginEvent = props => {
132 }; 132 };
133 133
134 // 登录事件 134 // 登录事件
135 - const handleSubmit = async ({ faceLoginValue = {}, sEmployeeNo } = {}, configsData) => { 135 + const handleSubmit = async ({ faceLoginValue = {}, sEmployeeName, sEmployeeNo, sUserId } = {}, configsData) => {
136 const bFaceLogin = commonUtils.isNotEmptyObject(faceLoginValue); 136 const bFaceLogin = commonUtils.isNotEmptyObject(faceLoginValue);
137 let masterNewData = {} 137 let masterNewData = {}
138 let dataReturn = {}; 138 let dataReturn = {};
@@ -142,12 +142,21 @@ const useLoginEvent = props => { @@ -142,12 +142,21 @@ const useLoginEvent = props => {
142 const masterLocal = commonUtils.convertStrToObj( 142 const masterLocal = commonUtils.convertStrToObj(
143 localStorage.getItem(`${commonConfig.prefix}masterData`) 143 localStorage.getItem(`${commonConfig.prefix}masterData`)
144 ) 144 )
  145 +
145 if (masterLocal) { 146 if (masterLocal) {
146 masterNewData = { 147 masterNewData = {
147 ...masterLocal, 148 ...masterLocal,
148 ...masterData, 149 ...masterData,
149 } 150 }
150 - }else { 151 + if (sEmployeeNo) {
  152 + masterNewData = {
  153 + ...masterNewData,
  154 + sEmployeeNo,
  155 + sUserName:sEmployeeName,
  156 + sUserId
  157 + }
  158 + }
  159 + } else {
151 masterNewData = { 160 masterNewData = {
152 ...masterData 161 ...masterData
153 } 162 }
@@ -160,7 +169,7 @@ const useLoginEvent = props => { @@ -160,7 +169,7 @@ const useLoginEvent = props => {
160 return showName; 169 return showName;
161 }; 170 };
162 const sLanguage = companys ? commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'sEnglish' : 'sChinese'; 171 const sLanguage = companys ? commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'sEnglish' : 'sChinese';
163 - 172 +
164 const pleaseSelectUser = getConfigByName('pleaseSelectUser', configsData, sLanguage); 173 const pleaseSelectUser = getConfigByName('pleaseSelectUser', configsData, sLanguage);
165 174
166 const pleaseInputPassword = getConfigByName('pleaseInputPassword', configsData, sLanguage); 175 const pleaseInputPassword = getConfigByName('pleaseInputPassword', configsData, sLanguage);
@@ -187,7 +196,7 @@ const useLoginEvent = props => { @@ -187,7 +196,7 @@ const useLoginEvent = props => {
187 sShift 196 sShift
188 } = masterNewData; 197 } = masterNewData;
189 198
190 - const value = { 199 + let value = {
191 userId, 200 userId,
192 // username, 201 // username,
193 userShowName, 202 userShowName,
@@ -202,7 +211,7 @@ const useLoginEvent = props => { @@ -202,7 +211,7 @@ const useLoginEvent = props => {
202 sShift, 211 sShift,
203 sEmployeeNo 212 sEmployeeNo
204 }; 213 };
205 - 214 +
206 if (!sEmployeeNo) { 215 if (!sEmployeeNo) {
207 value.username = username; 216 value.username = username;
208 } 217 }
@@ -376,11 +385,19 @@ const useLoginEvent = props => { @@ -376,11 +385,19 @@ const useLoginEvent = props => {
376 const handleGetFormItem = (props, item) => { 385 const handleGetFormItem = (props, item) => {
377 386
378 const { sModelsId } = initValue; 387 const { sModelsId } = initValue;
379 - const { masterData = {}, companys } = props; 388 + const { masterData = {}, companys, faceLoginValue } = props;
380 389
381 - const userInfo = commonUtils.convertStrToObj( 390 + let userInfo = commonUtils.convertStrToObj(
382 localStorage.getItem(`${commonConfig.prefix}masterData`) 391 localStorage.getItem(`${commonConfig.prefix}masterData`)
383 ); 392 );
  393 + if (faceLoginValue) {
  394 + userInfo = {
  395 + ...userInfo,
  396 + sUserName: faceLoginValue.sEmployeeName,
  397 + sUserNo: faceLoginValue.sEmployeeNo,
  398 + sUserId: faceLoginValue.sUserId
  399 + }
  400 + }
384 let masterNewData = masterData 401 let masterNewData = masterData
385 if (userInfo) { 402 if (userInfo) {
386 masterNewData = { 403 masterNewData = {
@@ -437,7 +454,6 @@ const handleGetFormItem = (props, item) => { @@ -437,7 +454,6 @@ const handleGetFormItem = (props, item) => {
437 bPassWord: item.sName === "sPassWord", 454 bPassWord: item.sName === "sPassWord",
438 style: { backgroundColor: "#eaeaea" } 455 style: { backgroundColor: "#eaeaea" }
439 }; 456 };
440 - console.log(showTypeProps, 'showTypeProps');  
441 457
442 const showName = sLanguage === 'sChinese' ? item.sChinese : sLanguage === 'sEnglish' ? item.sEnglish 458 const showName = sLanguage === 'sChinese' ? item.sChinese : sLanguage === 'sEnglish' ? item.sEnglish
443 : item.sBig5; 459 : item.sBig5;
@@ -526,21 +542,21 @@ const login = baseProps => { @@ -526,21 +542,21 @@ const login = baseProps => {
526 </div> 542 </div>
527 <div className="loginBox"> 543 <div className="loginBox">
528 <div className="logo">{oeeTitle}</div> 544 <div className="logo">{oeeTitle}</div>
529 - <Form form={form} layout="vertical" size="large"> 545 + <Form form={form} layout="horizontal" size="large" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
530 {configs.map(item => handleGetFormItem(props, item))} 546 {configs.map(item => handleGetFormItem(props, item))}
531 - <Form.Item>  
532 - <Button  
533 - className="submitBtn"  
534 - type="primary"  
535 - block  
536 - onClick={() => {  
537 - props.onSubmit({}, configs);  
538 - }}  
539 - >  
540 - {btnLogin}  
541 - </Button>  
542 - </Form.Item>  
543 </Form> 547 </Form>
  548 + <div style={{ padding: '0 11.76% 0 11.76%' }}>
  549 + <Button
  550 + className="submitBtn"
  551 + type="primary"
  552 + block
  553 + onClick={() => {
  554 + props.onSubmit({}, configs);
  555 + }}
  556 + >
  557 + {btnLogin}
  558 + </Button>
  559 + </div>
544 <div className="faceLogin"> 560 <div className="faceLogin">
545 <div 561 <div
546 className="faceImg" 562 className="faceImg"
@@ -619,7 +635,7 @@ const FaceLoginAfterModal = props =&gt; { @@ -619,7 +635,7 @@ const FaceLoginAfterModal = props =&gt; {
619 faceLoginValue = {} 635 faceLoginValue = {}
620 } = props; 636 } = props;
621 const { sModelsId } = initValue; 637 const { sModelsId } = initValue;
622 - const { name, sParentId, sEmployeeNo } = faceLoginValue; 638 + const { name, sParentId, sEmployeeNo, sEmployeeName, sUserId } = faceLoginValue;
623 639
624 const configs = cloneDeep(configOld); 640 const configs = cloneDeep(configOld);
625 const showConfig = configs.find(item => item.sName === "sUserName"); 641 const showConfig = configs.find(item => item.sName === "sUserName");
@@ -663,6 +679,7 @@ const FaceLoginAfterModal = props =&gt; { @@ -663,6 +679,7 @@ const FaceLoginAfterModal = props =&gt; {
663 }, []); 679 }, []);
664 680
665 const [form] = Form.useForm(); 681 const [form] = Form.useForm();
  682 +
666 return ( 683 return (
667 <Modal 684 <Modal
668 title={sLoginConfirm} 685 title={sLoginConfirm}
@@ -682,7 +699,7 @@ const FaceLoginAfterModal = props =&gt; { @@ -682,7 +699,7 @@ const FaceLoginAfterModal = props =&gt; {
682 type="primary" 699 type="primary"
683 size="large" 700 size="large"
684 onClick={() => { 701 onClick={() => {
685 - props.onSubmit({ sEmployeeNo }); 702 + props.onSubmit({ sEmployeeName, sEmployeeNo, sUserId });
686 }} 703 }}
687 > 704 >
688 {btnConfirm} 705 {btnConfirm}
src/mes/productionExec/noticeModal/index.js
@@ -266,7 +266,6 @@ const firstNoticeModal = _props =&gt; { @@ -266,7 +266,6 @@ const firstNoticeModal = _props =&gt; {
266 viewRow, 266 viewRow,
267 tableName: viewName 267 tableName: viewName
268 }; 268 };
269 - console.log("🚀 ~ firstNoticeModal ~ viewProps:", viewProps)  
270 269
271 return ( 270 return (
272 <Modal 271 <Modal
src/mes/productionExec/productionExecMain/index.js
@@ -568,7 +568,7 @@ const ProductionExecContentByType = props =&gt; { @@ -568,7 +568,7 @@ const ProductionExecContentByType = props =&gt; {
568 568
569 const showValue = { 569 const showValue = {
570 stop: { 570 stop: {
571 - showName: "调机结束", 571 + showName: "调机 / 生产",
572 onClick: config => 572 onClick: config =>
573 operationFetch(props, config, undefined, () => { 573 operationFetch(props, config, undefined, () => {
574 props.onSaveState({ 574 props.onSaveState({
@@ -578,7 +578,7 @@ const ProductionExecContentByType = props =&gt; { @@ -578,7 +578,7 @@ const ProductionExecContentByType = props =&gt; {
578 }) 578 })
579 }, 579 },
580 again: { 580 again: {
581 - showName: "调机开始", 581 + showName: "调机 / 生产",
582 onClick: config => 582 onClick: config =>
583 operationFetch(props, config, "again", () => { 583 operationFetch(props, config, "again", () => {
584 props.onSaveState({ 584 props.onSaveState({
src/mes/scheduledTasks/machineTasks/index.js
@@ -17,8 +17,11 @@ import { @@ -17,8 +17,11 @@ import {
17 Space, 17 Space,
18 Dropdown, 18 Dropdown,
19 message, 19 message,
20 - Tooltip 20 + Tooltip,
  21 + Form,
  22 + Select
21 } from "antd"; 23 } from "antd";
  24 +import { DownOutlined } from '@ant-design/icons';
22 import { SettingTwoTone } from "@ant-design/icons"; 25 import { SettingTwoTone } from "@ant-design/icons";
23 import * as commonFunc from "@/components/Common/commonFunc"; 26 import * as commonFunc from "@/components/Common/commonFunc";
24 import * as commonUtils from "@/utils/utils"; 27 import * as commonUtils from "@/utils/utils";
@@ -348,14 +351,38 @@ const useInfoEvent = props =&gt; { @@ -348,14 +351,38 @@ const useInfoEvent = props =&gt; {
348 props.onTableBtnClick(item); 351 props.onTableBtnClick(item);
349 return; 352 return;
350 } 353 }
  354 + let value = true
  355 + const handleChange = val => {
  356 + value = val
  357 + }
351 if (showName === "完工") { 358 if (showName === "完工") {
  359 +
352 Modal.confirm({ 360 Modal.confirm({
353 title: "温馨提示:", 361 title: "温馨提示:",
354 - content: <div>确认完工?</div>, 362 + content: <div>
  363 + {/* <div>确认完工?</div> */}
  364 + <div>
  365 + <div style={{ padding: '8px 0' }}>是否确认完工清场?</div>
  366 + <Select
  367 + suffixIcon={<DownOutlined style={{ fontSize: '16px' }} />}
  368 + onChange={handleChange}
  369 + style={{ width: '100%', fontSize: '18px' }}
  370 + defaultValue={true}
  371 + options={[
  372 + { label: '是', value: true },
  373 + { label: '否', value: false },
  374 + ]}
  375 + />
  376 + </div>
  377 + </div>,
355 okText: "确认", 378 okText: "确认",
356 cancelText: "取消", 379 cancelText: "取消",
357 onOk() { 380 onOk() {
358 - handleUpdateProductionplan({ item, iFlag: 4 }); 381 + const newItem = {
  382 + ...item,
  383 + bComplete: value
  384 + }
  385 + handleUpdateProductionplan({ item:newItem, iFlag: 4,});
359 } 386 }
360 }); 387 });
361 return; 388 return;
@@ -442,13 +469,17 @@ const useInfoEvent = props =&gt; { @@ -442,13 +469,17 @@ const useInfoEvent = props =&gt; {
442 // 更新机台状态 469 // 更新机台状态
443 const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => { 470 const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => {
444 const { app } = props; 471 const { app } = props;
445 - const { sId } = item.record; 472 + const { sId } = item?.record;
446 const { token } = app; 473 const { token } = app;
447 - const url = `${commonConfig.server_host 474 + let url = `${commonConfig.server_host
448 }oee/updateProductionplan/${sId}/${iFlag}${pauseValue 475 }oee/updateProductionplan/${sId}/${iFlag}${pauseValue
449 ? `?sWorkOrderChangeMemo=${encodeURIComponent(pauseValue)}` 476 ? `?sWorkOrderChangeMemo=${encodeURIComponent(pauseValue)}`
450 : "" 477 : ""
451 }`; 478 }`;
  479 + if (typeof item.bComplete === 'boolean') {
  480 + url = url + `?bComplete=${item.bComplete}`
  481 + }
  482 +
452 const dataReturn = (await commonServices.getService(token, url)).data; 483 const dataReturn = (await commonServices.getService(token, url)).data;
453 if (dataReturn.code === 1) { 484 if (dataReturn.code === 1) {
454 handleRefresh(); 485 handleRefresh();
@@ -806,7 +837,7 @@ const MachineTasks = baseProps =&gt; { @@ -806,7 +837,7 @@ const MachineTasks = baseProps =&gt; {
806 }; 837 };
807 838
808 const TaskConfirmModal = props => { 839 const TaskConfirmModal = props => {
809 - const { taskConfirmModalVisible, taskConfirmModalMsg, bPauseOnly } = props; 840 + const { taskConfirmModalVisible, taskConfirmModalMsg, bPauseOnly = true } = props;
810 if (!taskConfirmModalVisible) return ""; 841 if (!taskConfirmModalVisible) return "";
811 842
812 const handleClose = () => { 843 const handleClose = () => {
src/oee/common/oeeCurrentState.js
@@ -262,7 +262,6 @@ class OeeCurrentState extends Component { @@ -262,7 +262,6 @@ class OeeCurrentState extends Component {
262 } 262 }
263 const { slaveData, onSaveCurrentState } = this.props; 263 const { slaveData, onSaveCurrentState } = this.props;
264 /* 打印标签跳转的界面模块ID */ 264 /* 打印标签跳转的界面模块ID */
265 - console.log('2222', btnConfig);  
266 onSaveCurrentState(slaveData, undefined, undefined, btnConfig); 265 onSaveCurrentState(slaveData, undefined, undefined, btnConfig);
267 this.props.onOeeLabelCopyTo(btnConfig.sControlName, btnConfig.sActiveId); 266 this.props.onOeeLabelCopyTo(btnConfig.sControlName, btnConfig.sActiveId);
268 this.props.dispatch(routerRedux.push('/indexOee/labelPrint')); 267 this.props.dispatch(routerRedux.push('/indexOee/labelPrint'));