借料入库
This commit is contained in:
		
							parent
							
								
									1f3291fd42
								
							
						
					
					
						commit
						6eea784f7a
					
				|  | @ -284,7 +284,7 @@ class PickmCard extends Component { | |||
|                         let rowids = []; | ||||
|                         let hids = []; | ||||
|                         let hid; | ||||
| 						let rows = this.props.cardTable.getCheckedRows(AREA.bodyTable); | ||||
| 						let rows = this.props.cardTable.getCheckedRows(AREA.borrowMaterialDialog); | ||||
|                         hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value; | ||||
|                         hids.push(hid); | ||||
|                         // 如果没有选中行,则提示并返回,不进行任何操作
 | ||||
|  | @ -292,10 +292,9 @@ class PickmCard extends Component { | |||
|                             showWarningInfo('请选择行'); | ||||
|                             return; | ||||
|                         } | ||||
|                         rows.map((item) => { | ||||
|                             let cpickm_bid = this.props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, FIELD.bid).value; | ||||
|                             rowids.push(cpickm_bid); | ||||
|                         }); | ||||
|                         for (let i = 0; i < rows.length; i++){ | ||||
|                             rowids.push(rows[0].data.values.cpickm_bid.value); | ||||
|                         } | ||||
|                         let data = { | ||||
|                             cpickmids: hids, | ||||
|                             cpickmbids: rowids | ||||
|  |  | |||
|  | @ -823,23 +823,23 @@ export default async function clickBtn(props, id, text, record, index) { | |||
|             // 判断选中行的借料数量是否>0,如果存在<=0的行,则提示并返回
 | ||||
|             let hasInvalidRow = false; | ||||
|             let warningMessage = getLangByResId(this, '5008Pickm-000106'); /* 国际化处理: 借料数量必须大于0!*/ | ||||
|             for (const item of selectRows) { | ||||
|                 let values = item.data.values; | ||||
|                 // 借料数量 = 计划出库数量-累计出库数量-累计发货数量-累计委外数量
 | ||||
|                 let borrowedQty = getNumber(values.nplanoutastnum) - getNumber(values.naccoutastnum) - | ||||
|                     getNumber(values.nshouldastnum) - getNumber(values.npscastnum); | ||||
|                 if (borrowedQty <= 0) { | ||||
|                     hasInvalidRow = true; | ||||
|                     // 获取行号用于提示信息
 | ||||
|                     let vrowno = props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, 'vrowno'); | ||||
|                     warningMessage = warningMessage + ' 行号:' + `[${vrowno.value}]`; | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|             if (hasInvalidRow) { | ||||
|                 showErrorInfo('错误', warningMessage); | ||||
|                 return; | ||||
|             } | ||||
|             // for (const item of selectRows) {
 | ||||
|                 // let values = item.data.values;
 | ||||
|                 // // 借料数量 = 计划出库数量-累计出库数量-累计发货数量-累计委外数量
 | ||||
|                 // let borrowedQty = getNumber(values.nplanoutastnum) - getNumber(values.naccoutastnum) -
 | ||||
|                 //     getNumber(values.nshouldastnum) - getNumber(values.npscastnum);
 | ||||
|                 // if (borrowedQty <= 0) {
 | ||||
|                 //     hasInvalidRow = true;
 | ||||
|                 //     // 获取行号用于提示信息
 | ||||
|                 //     let vrowno = props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, 'vrowno');
 | ||||
|                 //     warningMessage = warningMessage + ' 行号:' + `[${vrowno.value}]`;
 | ||||
|                 //     break;
 | ||||
|                 // }
 | ||||
|             // }
 | ||||
|             // if (hasInvalidRow) {
 | ||||
|             //     showErrorInfo('错误', warningMessage);
 | ||||
|             //     return;
 | ||||
|             // }
 | ||||
| 
 | ||||
|             billstatus = props.form.getFormItemsValue(AREA.formArea, 'fbillstatus'); | ||||
|             //审批态
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import React, { Component } from 'react'; | ||||
| import ReactDOM from 'react-dom'; | ||||
| import { createPage, base, high, createPageIcon } from 'nc-lightapp-front'; | ||||
| import { createPage, base,ajax, high, createPageIcon, toast } from 'nc-lightapp-front'; | ||||
| const { NCTabs, NCTabsControl } = base; | ||||
| import initTemplate from './init/initTemplate'; | ||||
| import searchBtnClick from './btnClicks/searchBtnClick'; | ||||
|  | @ -18,6 +18,7 @@ import { transtypeUtils } from '../../../../mmpub/mmpub/pub/tool'; | |||
| import { initLang, getLangByResId } from '../../../../mmpub/mmpub/pub/tool/multiLangUtil'; | ||||
| import { buttonController, buttonClickController } from './viewController/index'; | ||||
| 
 | ||||
| import {showWarningInfo} from "../../../../mmpub/mmpub/pub/tool/messageUtil"; | ||||
| class PickmList extends Component { | ||||
| 	constructor(props) { | ||||
| 		super(props); | ||||
|  | @ -348,17 +349,25 @@ class PickmList extends Component { | |||
|                         let hids = []; | ||||
|                         let hid; | ||||
| 						let rows =this.props.table.getCheckedRows('NCTable_3c81fe87'); | ||||
|                         hid = this.props.cardTable.getCheckedRows(AREA.bodyTable)[0].billId; | ||||
|                         hids.push(hid); | ||||
| 						// for (let i = 0; i < rows.length; i++){
 | ||||
| 						// 	hid = rows[i].billId;
 | ||||
| 						// 	hids.push(hid);
 | ||||
| 						// }
 | ||||
|                         // hid = this.props.cardTable.getCheckedRows(AREA.bodyTable)[0].billId;
 | ||||
|                         // hids.push(hid);
 | ||||
|                         // 如果没有选中行,则提示并返回,不进行任何操作
 | ||||
|                         if (!rows || rows.length <= 0) { | ||||
|                             showWarningInfo('请选择行'); | ||||
|                             return; | ||||
|                         } | ||||
|                         rows.map((item) => { | ||||
|                             let cpickm_bid = this.props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, FIELD.bid).value; | ||||
|                             rowids.push(cpickm_bid); | ||||
|                         }); | ||||
| 						for (let i = 0; i < rows.length; i++){ | ||||
| 							rowids.push(rows[0].data.values.cpickm_bid.value); | ||||
| 
 | ||||
| 						} | ||||
|                         // rows.map((item) => {
 | ||||
|                         //     let cpickm_bid = this.props.cardTable.getValByKeyAndIndex('NCTable_3c81fe87', item.index, FIELD.bid).value;
 | ||||
|                         //     rowids.push(cpickm_bid);
 | ||||
|                         // });
 | ||||
|                         let data = { | ||||
|                             cpickmids: hids, | ||||
|                             cpickmbids: rowids | ||||
|  | @ -370,14 +379,14 @@ class PickmList extends Component { | |||
|                             success: (res) => { | ||||
|                                 if (res.success) { | ||||
|                                     toast({color: 'success', title: "推送成功"}); | ||||
|                                     this.props.modal.close(AREA.borrowMaterialDialog); | ||||
|                                     this.props.modal.close('NCTable_3c81fe87'); | ||||
|                                 } | ||||
|                             } | ||||
|                         }); | ||||
| 
 | ||||
|                     }, | ||||
|                     cancelBtnClick: () => { | ||||
|                         this.props.modal.close(AREA.borrowMaterialDialog) | ||||
|                         this.props.modal.close('NCTable_3c81fe87') | ||||
|                     }, | ||||
|                     userControl: true | ||||
|                 })}        | ||||
|  |  | |||
|  | @ -488,7 +488,7 @@ export default function (props, key, text, record, index) { | |||
|                 data: data, | ||||
|                 success: (res) => { | ||||
|                     if(res.success){ | ||||
|                         props.table.setAllTableData("NCTable_3c81fe87", res.data);//[0].card_body.rows
 | ||||
|                         props.table.setAllTableData("NCTable_3c81fe87", res.data.data);//[0].card_body.rows
 | ||||
|                         props.modal.show("NCTable_3c81fe87"); | ||||
|                         toast({ content: "查询成功", color: 'success' }); | ||||
|                     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue