/* eslint-disable function-paren-newline */ import React, { Component } from 'react'; import '@ant-design/compatible/assets/index.css'; import { Row, Col, List, Card, Checkbox, Select, Form } from 'antd'; import ShowType from '@/components/Common/CommonComponent'; import splitstyles from '@/components/Manufacture/SplitPaste.less'; import * as commonUtils from '@/utils/utils'; const FormItem = Form.Item; class SplitPasteQuotation extends Component { constructor(props) { super(props); this.state = { // expand: false, }; } handleToggle = () => { this.props.onToggle(); }; handleViewClick = (name, sName, record) => { this.props.onViewClick(name, sName, record); this.props.onSaveState({ fastOrderModalVisible: false }); }; render() { const { masterConfig, enabled, sBackProcessClassifyData, checkProcessClassifyData, sModelsId, } = this.props; let { masterData } = this.props; masterData = masterData === undefined ? {} : masterData; const expand = true; const { getFieldDecorator } = this.props.form; const { sAllPartsName } = masterData; let allPartsName = []; if (sAllPartsName !== undefined) { allPartsName = sAllPartsName.split(','); } const newConfig = {}; if (commonUtils.isNotEmptyObject(masterConfig) && masterConfig.gdsconfigformslave.length > 0) { const filterConfig = masterConfig.gdsconfigformslave.filter(item => (item.sName.indexOf('dSumPQty') > -1 || item.sName.indexOf('sMaterialsName') > -1 || item.sName.indexOf('iPrintModePo') > -1 || item.sName.indexOf('iPositiveColor') > -1 || item.sName.indexOf('dPartsLength') > -1 || item.sName.indexOf('dPartsWidth') > -1)); filterConfig.forEach((childNew) => { const child = { ...childNew }; child.bVisible = true; if (child.sName.indexOf('dSumPQty') > -1) { child.placeholder = 'P数'; } else if (child.sName.indexOf('sMaterialsName') > -1) { child.placeholder = '选择材料'; } else if (child.sName.indexOf('iPrintModePo') > -1) { child.placeholder = '选择单双面'; } else if (child.sName.indexOf('iPositiveColor') > -1) { child.placeholder = '印刷颜色'; } else if (child.sName.indexOf('dPartsLength') > -1) { child.placeholder = '部件长'; } else if (child.sName.indexOf('dPartsWidth') > -1) { child.placeholder = '部件宽'; } let enabledNew = (enabled && !child.bReadonly && !child.specialControl); if (child.iTag === 1) { enabledNew = false; } else if (child.iTag === 3) { enabledNew = true; } const sMemo = child.sName.toLowerCase().endsWith('memo'); const formItemLayout = { labelCol: { span: 2 }, wrapperCol: { span: 18 } }; const showTypeProps = { form: this.props.form, getSqlDropDownData: this.props.getSqlDropDownData, getSqlCondition: this.props.getSqlCondition, handleSqlDropDownNewRecord: this.props.handleSqlDropDownNewRecord, getFloatNum: this.props.getFloatNum, onChange: this.props.onMasterChange, showConfig: child, formItemLayout: sMemo ? formItemLayout : {}, textArea: sMemo, enabled: enabledNew, dataValue: masterData[child.sName], bTable: false, }; newConfig[child.sName] = showTypeProps; }); } const modalFilterConfig = masterConfig.gdsconfigformslave.filter(item => (item.sName.indexOf('dProductQty') > -1 || item.sName.indexOf('sProductName') > -1 || item.sName.indexOf('sCustomerName') > -1 || item.sName.indexOf('sProductClassifyName') > -1 || item.sName.indexOf('sProductStyle') > -1)); const formItemLayout = { labelCol: { span: 2 }, wrapperCol: { span: 18 } }; const fullFormItemLayout = { labelCol: { span: 0 }, wrapperCol: { span: 24, offset: 0 } }; const halfFormItemLayout = { labelCol: { span: 0 }, wrapperCol: { span: 24, offset: 0 } }; return ( { modalFilterConfig.map((child, index) => { const sMemo = child.sName.toLowerCase().endsWith('memo'); // const iColValue = sMemo ? 21 : child.iColValue * 6; /* 跨度 */ const iOrder = sMemo ? 100 : child.iOrder > 100 ? 100 : child.iOrder; /* 排序 */ let enabledNew = (enabled && !child.bReadonly && !child.specialControl); if (child.iTag === 1) { enabledNew = false; } else if (child.iTag === 3) { enabledNew = true; } const showTypeProps = { name: 'master', form: this.props.form, formId: sModelsId, record: masterData, getSqlDropDownData: this.props.getSqlDropDownData, getSqlCondition: this.props.getSqlCondition, handleSqlDropDownNewRecord: this.props.handleSqlDropDownNewRecord, getFloatNum: this.props.getFloatNum, getDateFormat: this.props.getDateFormat, onChange: this.props.onMasterChange, onViewClick: this.handleViewClick, showConfig: child, formItemLayout: sMemo ? formItemLayout : {}, textArea: sMemo, enabled: enabledNew, dataValue: masterData[child.sName], bTable: false, itemLabel: child.sName === 'sType' ? 'hide' : null, onFilterDropDownData: this.props.onFilterDropDownData, }; return ( ); }) } {allPartsName.length > 0 && Object.keys(newConfig).length > 4 ? ( !(newConfig[`dSumPQty${sPartsName}`]) ? '' : { i === 0 ?
部件信息
: null }
{sPartsName} { !(newConfig[`dPartsLength${sPartsName}`]) ? '' : } { !(newConfig[`dPartsWidth${sPartsName}`]) ? '' : }
{ i === 0 ?
印刷颜色
: null }
{ i === 0 ?
工序
: null } {sBackProcessClassifyData !== undefined && sBackProcessClassifyData !== '' ? (item.sType !== '3' && (item.sPartsName === sPartsName || item.sPartsName === '')))} size="small" renderItem={item => ( (card.sId === item.sId && card.sPartsName === sPartsName)).length > 0} onChange={(e) => { this.props.handleProcessChange(e, item, sPartsName); }} title={item} > {item.sName} {getFieldDecorator(`${item.sId + sPartsName}`, { })( )} )} /> : ''}
)} /> : ''} {sBackProcessClassifyData !== undefined && sBackProcessClassifyData !== '' ? 成品工序 : null } {sBackProcessClassifyData !== undefined && sBackProcessClassifyData !== '' ? (item.sType === '3'))} size="small" renderItem={item => ( (card.sId === item.sId)).length > 0} onChange={(e) => { this.props.handleProcessChange(e, item, ''); }} title={item} > {item.sName} {getFieldDecorator(`${item.sId}`, { })( )} )} /> : ''} ); } } export default SplitPasteQuotation;