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