Commit 4e456e192ae9b027dae3d892fa10cf42af4b3ff5

Authored by chenxt
1 parent 429024d4

左边扫码事件

src/components/Common/CommonComponent/index.js
@@ -300,7 +300,7 @@ export default class CommonComponent extends Component { @@ -300,7 +300,7 @@ export default class CommonComponent extends Component {
300 } 300 }
301 /* 若下拉配置了movesql 则离开时 调用下拉sql数据 */ 301 /* 若下拉配置了movesql 则离开时 调用下拉sql数据 */
302 if (this.props.showConfig && (this.props.showConfig.sDropDownType === 'movesql' || commonUtils.isNotEmptyObject(this.props.showConfig.sButtonParam))) { 302 if (this.props.showConfig && (this.props.showConfig.sDropDownType === 'movesql' || commonUtils.isNotEmptyObject(this.props.showConfig.sButtonParam))) {
303 - this.props.onDropDownBlur(this.props.name, this.props.showConfig.sName, this.props.record, this.props.showConfig); 303 + this.props.onDropDownBlur(this.props.name, this.props.showConfig.sName, this.props.record, this.props.showConfig);
304 } 304 }
305 305
306 this.onCheckFields(500); 306 this.onCheckFields(500);
src/components/Common/CommonHooks/useCommonBase.js
@@ -2503,11 +2503,12 @@ const useCommonBase = props => { @@ -2503,11 +2503,12 @@ const useCommonBase = props => {
2503 const handleTableBlur = async (name, sFileName, record, tableConfig, other) => { 2503 const handleTableBlur = async (name, sFileName, record, tableConfig, other) => {
2504 const { sModelsId, app } = props; 2504 const { sModelsId, app } = props;
2505 const { controlData, slaveConfig, [`${name}Data`]: tableData, [`${name}Config`]: tempConfig } = state; 2505 const { controlData, slaveConfig, [`${name}Data`]: tableData, [`${name}Config`]: tempConfig } = state;
2506 - let { slaveData: slaveDataOld, masterData, slaveDelData, } = state; 2506 + let { slaveData: slaveDataOld, masterData, slaveDelData,slaveSelectedData = []} = state;
2507 const addState = {}; 2507 const addState = {};
2508 if (commonUtils.isEmptyArr(slaveDelData)) { 2508 if (commonUtils.isEmptyArr(slaveDelData)) {
2509 slaveDelData = []; 2509 slaveDelData = [];
2510 } 2510 }
  2511 +
2511 if (sFileName === 'sPartsNameNew') { 2512 if (sFileName === 'sPartsNameNew') {
2512 if (commonUtils.isNotEmptyArr(controlData)) { 2513 if (commonUtils.isNotEmptyArr(controlData)) {
2513 /* 离开时 把sPartsNameNewId数据挂载到sControlParentId */ 2514 /* 离开时 把sPartsNameNewId数据挂载到sControlParentId */
@@ -2569,7 +2570,7 @@ const useCommonBase = props => { @@ -2569,7 +2570,7 @@ const useCommonBase = props => {
2569 newCopyTo.master = masterData; 2570 newCopyTo.master = masterData;
2570 // newCopyTo.slave = commonUtils.isEmpty(slaveData) ? [] : slaveData[0]; 2571 // newCopyTo.slave = commonUtils.isEmpty(slaveData) ? [] : slaveData[0];
2571 // const sRowData = copyTo.slaveData; 2572 // const sRowData = copyTo.slaveData;
2572 - const sRowData = masterData; 2573 + const sRowData = masterData ? masterData : slaveDataOld[0];
2573 const value = { sProName, sProInParam: JSON.stringify({ params: sRowData }) }; 2574 const value = { sProName, sProInParam: JSON.stringify({ params: sRowData }) };
2574 if (other?.iFlag === 1) { 2575 if (other?.iFlag === 1) {
2575 value.iFlag = 1; 2576 value.iFlag = 1;
src/mes/common/commonOperationBarComponent/index.js
@@ -936,7 +936,8 @@ const CommonOperationBarComponent = basProps => { @@ -936,7 +936,8 @@ const CommonOperationBarComponent = basProps => {
936 searchField = { 936 searchField = {
937 sId: commonUtils.createSid(), 937 sId: commonUtils.createSid(),
938 showName: searchFieldList.map(item => item.showName).join("/"), 938 showName: searchFieldList.map(item => item.showName).join("/"),
939 - sName: searchFieldList[0].sName 939 + sName: searchFieldList[0].sName,
  940 + sRelation: searchFieldList[0].sRelation
940 }; 941 };
941 } 942 }
942 943
@@ -1176,7 +1177,6 @@ const CommonOperationBarComponent = basProps => { @@ -1176,7 +1177,6 @@ const CommonOperationBarComponent = basProps => {
1176 ] 1177 ]
1177 : undefined; 1178 : undefined;
1178 } 1179 }
1179 -  
1180 props.onSaveState({ 1180 props.onSaveState({
1181 [`${sName}SelectedBtn`]: undefined, 1181 [`${sName}SelectedBtn`]: undefined,
1182 [`${sName}Filter`]: bFilter, 1182 [`${sName}Filter`]: bFilter,
@@ -1194,6 +1194,35 @@ const CommonOperationBarComponent = basProps => { @@ -1194,6 +1194,35 @@ const CommonOperationBarComponent = basProps => {
1194 } 1194 }
1195 1195
1196 const btnSearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); 1196 const btnSearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询');
  1197 + const letfSearchField = btnLeftConfig.find(x => x.sControlName.includes('ScanLoadMaterial') && x.sButtonParam)
  1198 + let leftShowTypeProps = {
  1199 + app,
  1200 + record: {},
  1201 + sId: letfSearchField.sId /* 修改当前编号(数据格式:字符串) */,
  1202 + name: "slave",
  1203 + form,
  1204 + formId: sModelsId,
  1205 + getFloatNum: props.getFloatNum,
  1206 + onChange: props.onSearchValueChange,
  1207 + showConfig: {
  1208 + ...letfSearchField,
  1209 + placeholder: '请输入'
  1210 + },
  1211 + formItemLayout: {},
  1212 + textArea: false,
  1213 + enabled: true,
  1214 + dataValue: searchValue,
  1215 + bTable: true,
  1216 + getSqlDropDownData: props.getSqlDropDownData,
  1217 + getSqlCondition: props.getSqlCondition,
  1218 + handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord,
  1219 + // getFloatNum: props.getFloatNum,
  1220 + formRoute: props.formRoute,
  1221 + getDateFormat: props.getDateFormat,
  1222 + bNoMesBlue: true,
  1223 + record: props.slaveData[0],
  1224 + onDropDownBlur: props.onDropDownBlur
  1225 + }
1197 return ( 1226 return (
1198 <div className={styles.commonOperationBar}> 1227 <div className={styles.commonOperationBar}>
1199 <div className="leftBar"> 1228 <div className="leftBar">
@@ -1236,6 +1265,13 @@ const CommonOperationBarComponent = basProps =&gt; { @@ -1236,6 +1265,13 @@ const CommonOperationBarComponent = basProps =&gt; {
1236 <div className={styles.reissue}>···</div> 1265 <div className={styles.reissue}>···</div>
1237 </Dropdown> 1266 </Dropdown>
1238 ); 1267 );
  1268 + } else if (item.sButtonParam) {
  1269 + return <div className="changeClassName">
  1270 + <ShowType {...leftShowTypeProps} />
  1271 + {/* <Button type="primary" size="large" onClick={handleBtnSearch}>
  1272 + {btnSearch}
  1273 + </Button> */}
  1274 + </div>
1239 } 1275 }
1240 return ( 1276 return (
1241 <Button {...props.onGetBtnPropps(item, searchField)}> 1277 <Button {...props.onGetBtnPropps(item, searchField)}>
src/mes/common/commonOperationBarComponent/index.less
@@ -9,8 +9,41 @@ @@ -9,8 +9,41 @@
9 .size(auto, 100%); 9 .size(auto, 100%);
10 .flex(center); 10 .flex(center);
11 float: left; 11 float: left;
12 - } 12 + .ant-form-item {
  13 + background-color: rgba(24, 144, 255, 0.05);
  14 + border: 1px solid #AAA;
  15 + border-radius: 5px;
  16 +
  17 + .ant-form-item-control-input-content {
  18 + .size(200px, 40px);
  19 + }
  20 +
  21 + input {
  22 + background: transparent;
  23 +
  24 + &:focus {
  25 + box-shadow: none;
  26 + }
  27 + }
  28 +
  29 + .ant-select-selector {
  30 + background: transparent;
  31 + .size(300px, 40px);
  32 +
  33 + .ant-select-selection-search,
  34 + .ant-select-selection-placeholder,
  35 + .ant-select-selection-item {
  36 + line-height: 40px;
  37 + }
  38 + }
  39 +
  40 + .ant-picker {
  41 + border-radius: 5px;
  42 + }
13 43
  44 + }
  45 + }
  46 +
14 .rightBar { 47 .rightBar {
15 .size(auto, 100%); 48 .size(auto, 100%);
16 .flex(center); 49 .flex(center);