Commit 57135eb88fb213f1b6567f0e9993dc4908150a09

Authored by Min
1 parent 732ceda8

1.CommobilePadBill 处理删除单据后报错问题

src/components/Common/CommonNewBillEvent.js
... ... @@ -1667,7 +1667,7 @@ export default ChildComponent => {
1667 1667 // item.column?.forEach(col=>{
1668 1668 // if(col.isSettingFunctions) {
1669 1669 // if(col.iOrder > 10 ) {
1670   - // const i = Math.floor(col.iOrder / 10)
  1670 + // const i = Math.floor(col.iOrder / 10)
1671 1671 // col.iOrder = this.props.slaveData[i - 1].iOrder
1672 1672 // } else {
1673 1673 // col.iOrder = 1;
... ... @@ -1702,7 +1702,7 @@ export default ChildComponent => {
1702 1702 }
1703 1703 }
1704 1704 })
1705   -
  1705 +
1706 1706 const returnData = await commonBusiness.saveData({ token, value: params, sModelsId });
1707 1707 if (commonUtils.isNotEmptyObject(returnData)) {
1708 1708 if (commonUtils.isNotEmptyObject(copyTo)) {
... ... @@ -2489,7 +2489,11 @@ export default ChildComponent => {
2489 2489 if (this.props.app.currentPane.refresh !== undefined) {
2490 2490 this.props.app.currentPane.refresh();
2491 2491 }
2492   - this.handleDelDataSuccess(props);
  2492 + if(location.pathname.includes(('commobilePadBill'))){
  2493 + this.handleDelDataSuccessPad(props);
  2494 + } else {
  2495 + this.handleDelDataSuccess(props);
  2496 + }
2493 2497 } else {
2494 2498 /* 失败 */
2495 2499 this.props.getServiceError(data);
... ... @@ -2498,6 +2502,13 @@ export default ChildComponent => {
2498 2502  
2499 2503 /* 数据删除成功跳转到新路由即pane */
2500 2504 handleDelDataSuccess = props => {
  2505 + if(location.pathname.includes(('commobilePadBill'))){
  2506 + window.history.back(-1);
  2507 + setTimeout(() => {
  2508 + this.props.dispatch({ type: "app/refreshPage" });
  2509 + }, 100);
  2510 + return;
  2511 + }
2501 2512 const { app } = props;
2502 2513 let { panes, currentPane } = app;
2503 2514 /* 删除单据后退出当前路由后,标签panes变化后的集合 */
... ... @@ -2507,6 +2518,14 @@ export default ChildComponent => {
2507 2518 this.props.onRemovePane(panes, currentPane);
2508 2519 };
2509 2520  
  2521 + handleDelDataSuccessPad = props => {
  2522 + window.history.back(-1);
  2523 + setTimeout(() => {
  2524 + this.props.dispatch({ type: "app/refreshPage" });
  2525 + // history.push(location.pathname);
  2526 + }, 100);
  2527 + };
  2528 +
2510 2529 /** 添加表格空行 */
2511 2530 handleTableAdd = (name, isWait) => {
2512 2531 /* 从CommonBase获取默认参数 */
... ...