/* eslint-disable array-callback-return,no-undef */ import React, { Component } from 'react'; import { Form } from '@ant-design/compatible'; import '@ant-design/compatible/assets/index.css'; import { Layout, Tabs, Spin, Avatar } from 'antd'; import styles from '../../index.less'; import Toolbar from '../Common/ToolBar/ToolBarNew'; import * as commonFunc from '../Common/commonFunc'; import CommonBase from '../Common/CommonBase'; import CommonElementEvent from '../Common/CommonElementEvent'; import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */ import CommonView from '../Common/CommonView'; import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */ import * as commonUtils from '../../utils/utils';/* 通用方法 */ const { Header, Content } = Layout; const { TabPane } = Tabs; class ProcessInfoComponent extends Component { constructor(props) { super(props); this.state = { }; this.form = {}; /* 表单对象 */ } onTabChange = (key) => { this.props.onSaveState({ activeKey: key }); }; handleAddRow = (name, sType) => { const tableData = JSON.parse(JSON.stringify(this.props[`${name}Data`] || [])); const tableDataRow = { ...this.props.onDataRowAdd(name, true), sType }; tableData.push(tableDataRow); this.props.onSaveState({ [`${name}Data`]: tableData, }); } render() { const { pageLoading } = this.props; return (
); } } const ProcessComponent = Form.create({ mapPropsToFields(props) { const { masterData, masterConfig } = props; const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig); return obj; }, })((props) => { const { form, onReturnForm, masterData, AutoTableHeight, app, assortConfig, outsideConfig, processstyleConfig, } = props; /* 回带表单 */ onReturnForm(form); if (commonUtils.isNotEmptyObject(masterData)) { masterData.bCheck = true; } // let tabMachine = commonFunc.showMessage(app.commonConst, 'tabMachine');/* 对应机台 */ let tabAssort = commonFunc.showMessage(app.commonConst, 'tabAssort');/* 配套工序 */ let tabOutside = commonFunc.showMessage(app.commonConst, 'tabOutside');/* 發外公式 */ let tabProcessstyle = commonFunc.showMessage(app.commonConst, 'tabProcesstyle');/* 工序规格 */ // let tabProcessApsRule = commonFunc.showMessage(app.commonConst, 'tabProcessApsRule');/* APS规则定义 */ // const tabDynamicParam = commonFunc.showMessage(app.commonConst, 'tabDynamicParam'); /* 动态参数 */ let tabOrderParam = commonFunc.showMessage(app.commonConst, 'tabOrderParam'); /* 工单参数 */ let tabOfferParam = commonFunc.showMessage(app.commonConst, 'tabOfferParam'); /* 报价参数 */ let tabReportParam = commonFunc.showMessage(app.commonConst, 'tabReportParam'); /* 上报参数 */ const bMachine = false; /* 对应机台 */ // if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { // const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabMachine'); /* 对应机台 */ // if (iIndexProcess > -1) { // bMachine = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; // tabMachine = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; // } // } let bAssort = commonUtils.isNotEmptyObject(assortConfig); /* 配套工序 */ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabAssort'); /* 配套工序 */ if (iIndexProcess > -1) { bAssort = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; tabAssort = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; } } let bOutside = commonUtils.isNotEmptyObject(outsideConfig); /* 發外公式 */ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabOutSide'); /* 發外公式 */ if (iIndexProcess > -1) { bOutside = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; tabOutside = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; } } let bProcessstyle = commonUtils.isNotEmptyObject(processstyleConfig); /* 工序规格 */ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabProcessStyle'); /* 工序规格 */ if (iIndexProcess > -1) { bProcessstyle = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; tabProcessstyle = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; } } const bProcesssApsRule = false; /* APS规则定义 */ // if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { // const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabAPS'); /* APS规则定义 */ // if (iIndexProcess > -1) { // bProcesssApsRule = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; // tabProcessApsRule = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; // } // } let bOrderParam = true; /* 工单参数 */ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabProcessParam'); /* 工单参数 */ if (iIndexProcess > -1) { bOrderParam = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; tabOrderParam = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; } } let bOfferParam = true; /* 报价参数 */ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabQuoParam'); /* 报价参数 */ if (iIndexProcess > -1) { bOfferParam = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; tabOfferParam = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; } } let bReportParam = true; /* 上报参数 */ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabReportParam'); if (iIndexProcess > -1) { bReportParam = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible; tabReportParam = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese; } } let bNormParam = true; /* 标准书参数 */ let tabNormParam = '标准书参数'; if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndex = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabNormParam'); if (iIndex > -1) { bNormParam = props.masterConfig.gdsconfigformslave[iIndex].bVisible; tabNormParam = props.masterConfig.gdsconfigformslave[iIndex].sChinese; } } let bTestParam = false; /* 测试参数 */ let tabTestParam = '测试参数'; if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) { const iIndex = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabTestParam'); if (iIndex > -1) { bTestParam = props.masterConfig.gdsconfigformslave[iIndex].bVisible; tabTestParam = props.masterConfig.gdsconfigformslave[iIndex].sChinese; } } let defalutKey = '3'; if (bMachine) { defalutKey = '2'; } else if (bAssort) { defalutKey = '3'; } else if (bAssort) { defalutKey = '3'; } else if (bOutside) { defalutKey = '4'; } else if (bProcessstyle) { defalutKey = '5'; } else if (bProcesssApsRule) { defalutKey = '6'; } else if (bReportParam) { defalutKey = '7'; } else if (bOfferParam) { defalutKey = '8'; } return (
{ bMachine ?
: '' } { bAssort ?
: '' } { bOutside ?
: '' } { bProcessstyle ?
: '' } { bProcesssApsRule ?
: '' } { bReportParam ?
o.sType === '1') : [] } onAddRow={e => props.handleAddRow(e, '1')} setOpterationColumn="Y" footer="hidden" />
: '' } { bOfferParam ?
o.sType === '2') : [] } onAddRow={e => props.handleAddRow(e, '2')} setOpterationColumn="Y" footer="hidden" />
: '' } { bOrderParam ?
o.sType === '3') : [] } onAddRow={e => props.handleAddRow(e, '3')} setOpterationColumn="Y" footer="hidden" />
: '' } { bNormParam ?
o.sType === '4') : [] } onAddRow={e => props.handleAddRow(e, '4')} setOpterationColumn="Y" footer="hidden" />
: '' } { bTestParam ?
o.sType === '5') : [] } onAddRow={e => props.handleAddRow(e, '5')} setOpterationColumn="Y" footer="hidden" />
: '' }
); }); export default CommonBase(CommonElementEvent(ProcessInfoComponent));