Commit 865ef76fa45e853461b69380dfe8f1740e76cc1c

Authored by chenxt
1 parent 2678cd30

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

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