Commit 7eec33a887ebc11a51a3ccd3c5f7a4c9ab20e917

Authored by chenxt
1 parent 45d17a73

commonbill查询条件

src/components/Common/CommonHooks/useCommonBase.js
... ... @@ -245,7 +245,7 @@ const useCommonBase = props => {
245 245 flag,
246 246 isWait,
247 247 configData,
248   - clearSelectData
  248 + clearSelectData,
249 249 } = params;
250 250 const {
251 251 token,
... ... @@ -326,23 +326,29 @@ const useCommonBase = props => {
326 326 ...sParentConditions
327 327 };
328 328 }
329   -
  329 +
330 330 const configDataId = configData?.sId;
331 331 const sId = JSON.parse(JSON.stringify(condition?.sId || ''))
332   - console.log(configData, 'configData');
333   -
334   - if (name === 'master') {
  332 + let pageRoute = props.sModelType;
  333 + // 如果是弹窗且没有pageLayout,则认为是commonBill
  334 + if (commonUtils.isNotEmptyObject(props.parentProps)) {
  335 + pageRoute = '/indexPage/commonBill';
  336 + }
  337 + if (name === 'master' && pageRoute.includes('indexPage/commonBill')) {
335 338 // condition.sId = configDataId
336 339 condition.pageNum = ''
337 340 condition.pageSize = ''
338 341 delete condition.sSqlCondition
339 342 }
340   - if (name.includes('slave')) {
341   - delete condition.sSqlCondition
342   - delete condition.sId
343   - condition.sSqlCondition = {
344   - sParentId: sId
345   - }
  343 + if (name.includes('slave') && pageRoute.includes('indexPage/commonBill')) {
  344 + delete condition.sSqlCondition
  345 + delete condition.sId
  346 + condition.sSqlCondition = {
  347 + sParentId: sId
  348 + }
  349 + }
  350 + if (name === 'master' && sId === '') {
  351 + return
346 352 }
347 353 const dataUrl = `${commonConfig.server_host
348 354 }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
... ... @@ -548,7 +554,7 @@ const useCommonBase = props => {
548 554 const conditonValues = {};
549 555 if (commonUtils.isNotEmptyStr(showConfig.sSqlCondition)) {
550 556 const conditon = showConfig.sSqlCondition.split(",");
551   -
  557 +
552 558 conditon.forEach(item => {
553 559 // 特殊处理
554 560 if (item === "sBoardNo.sBoardNo") {
... ... @@ -2337,6 +2343,7 @@ const useCommonBase = props => {
2337 2343 sActiveId,
2338 2344 title: sActiveName,
2339 2345 sParentConditions,
  2346 + sModelType: '/indexPage/commonBill',
2340 2347 parentProps: {
2341 2348 ...returnProps,
2342 2349 record
... ...
src/components/Common/CommonTable/index.js
... ... @@ -8234,6 +8234,8 @@ class CommonTableRc extends React.Component {
8234 8234 controlConfig[0].sDropDownType === "popup"
8235 8235 ) {
8236 8236 btnPupopConfig = controlConfig[0];
  8237 + console.log(btnPupopConfig, 'btnPupopConfig');
  8238 +
8237 8239 this.setState({
8238 8240 commonPopupVisible: true,
8239 8241 commonPopupTbName: name,
... ...
src/index.less
... ... @@ -4094,7 +4094,10 @@ ton:focus {
4094 4094 }
4095 4095 }
4096 4096 }
4097   -
  4097 +:global .ant-select.ant-select-in-form-item{
  4098 + border: 1px solid #d9d9d9;
  4099 + border-radius: 4px;
  4100 +}
4098 4101 :global {
4099 4102 #root {
4100 4103  
... ...
src/mes/common/commonModelComponent/index.js
... ... @@ -399,8 +399,8 @@ const useCommonModelEvent = props => {
399 399 if (!props.bFinish) return;
400 400 if (commonUtils.isEmptyObject(copyTo)) return;
401 401  
402   - const { masterConfig, sModelsId } = props;
403   -
  402 + const { masterConfig, sModelsId, masterData } = props;
  403 + if (masterData && masterData.sBillNo) return
404 404 let masterDataCopyTo = {};
405 405 for (const key in copyTo) {
406 406 const tableData = copyTo[key];
... ... @@ -408,14 +408,15 @@ const useCommonModelEvent = props => {
408 408 masterDataCopyTo = tableData;
409 409 }
410 410 }
411   - // const masterDataNew = {
412   - // ...commonFunc.getDefaultData(masterConfig),
413   - // handleType: "add",
414   - // sId: commonUtils.createSid(),
415   - // sFormId: sModelsId,
416   - // ...masterDataCopyTo
417   - // };
418   - // props.onSaveState({ masterData: masterDataNew, enabled: true });
  411 +
  412 + const masterDataNew = {
  413 + ...commonFunc.getDefaultData(masterConfig),
  414 + handleType: "add",
  415 + sId: commonUtils.createSid(),
  416 + sFormId: sModelsId,
  417 + ...masterDataCopyTo
  418 + };
  419 + props.onSaveState({ masterData: masterDataNew, enabled: true });
419 420 },
420 421 [props.bFinish]
421 422 );
... ... @@ -595,6 +596,7 @@ const useCommonModelEvent = props => {
595 596 sSqlCondition: { ...conditonValues, ...sFilterConditions, },
596 597 bFilter
597 598 },
  599 + sModelTypes: props.parentProps,
598 600 isWait: true
599 601 })) || {};
600 602 props.setTempRef(result);
... ...
src/mes/common/commonOperationBarComponent/MesToolbar.js
... ... @@ -12,6 +12,7 @@ const ToolbarFun = (props) => {
12 12  
13 13 const { sControlName } = btnConfig;
14 14 const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase();
  15 +
15 16 if (btnName === 'btnadd') {
16 17 handleAdd(props);
17 18 } else if (btnName === 'btnsave') {
... ... @@ -20,6 +21,8 @@ const ToolbarFun = (props) => {
20 21 props.onSaveState({ enabled: true });
21 22 } else if (btnName === 'btnscanface') {
22 23 handleScanFace(props);
  24 + } else if (btnName === 'btncancel') {
  25 +
23 26 }
24 27  
25 28  
... ... @@ -43,7 +46,8 @@ const handleAdd = (props) => {
43 46 const { app } = props;
44 47 const { managementData } = app;
45 48 const menuList = managementData.reduce((result, item) => {
46   - result = [...result, ...item.children];
  49 + // ✅ 安全展开:确保children是数组,否则使用空数组
  50 + result = [...result, ...(Array.isArray(item?.children) ? item.children : [])];
47 51 return result;
48 52 }, []);
49 53  
... ...
src/mes/common/commonOperationBarComponent/index.js
... ... @@ -424,6 +424,7 @@ const useCommonOperationBarComponentEvent = props => {
424 424 sActiveId,
425 425 title: sActiveName,
426 426 copyTo,
  427 + sModelType:'/indexPage/commonBill',
427 428 sParentConditions,
428 429 parentProps: props,
429 430 onOk: data => {
... ... @@ -781,7 +782,8 @@ const CommonOperationBarComponent = basProps => {
781 782 const btnLeftConfig = gdsconfigformslave.filter(
782 783 item => item.bVisible && item.sControlName.includes("BtnLeft.")
783 784 );
784   -
  785 + console.log(btnLeftConfig,gdsconfigformslave, 'btnLeftConfig');
  786 +
785 787 // 将扫码上料放到最后
786 788 const scanCodeToLoadMaterialsIndex = btnLeftConfig.findIndex(
787 789 item => item.showName === "扫码上料"
... ...
src/mes/indexMes/index.less
... ... @@ -3,12 +3,15 @@
3 3 @header-height: 60px;
4 4 @sider-width: 110px;
5 5 @base-color: #FFF;
6   -
  6 + :global .ant-select-in-form-item {
  7 + border-radius: 4px;
  8 + border: 1px solid #d9d9d9;
  9 + }
7 10 .indexMes {
8 11 .size();
9 12 background: #DCE2E8;
10 13 overflow: hidden;
11   -
  14 +
12 15 :global {
13 16 .header {
14 17 .flex();
... ...