回退借料入库前端
This commit is contained in:
parent
3342729948
commit
d07df4570f
|
@ -0,0 +1,100 @@
|
||||||
|
import {ajax, toast} from 'nc-lightapp-front';
|
||||||
|
import {AREA, URL, DIALOGCODE, FIELD} from '../../constance';
|
||||||
|
import {initLang, getLangByResId} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
|
||||||
|
import PickmCLQueryDlg from '../../pickmclquery/list';
|
||||||
|
import {showErrorInfo} from '../../../../../mmpub/mmpub/pub/tool/messageUtil';
|
||||||
|
|
||||||
|
export default function detailqueryBtnClick(props, record) {
|
||||||
|
let _this = this;
|
||||||
|
let bids = [];
|
||||||
|
let hid;
|
||||||
|
let rows = this.props.cardTable.getCheckedRows(AREA.bodyTable);
|
||||||
|
// 如果没有选中行,则提示并返回,不进行任何操作
|
||||||
|
if (!rows) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (rows.length <= 0) {
|
||||||
|
hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
|
||||||
|
} else {
|
||||||
|
rows.map((item) => {
|
||||||
|
let cpickm_bid = props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, 'cpickm_bid').value;
|
||||||
|
bids.push(cpickm_bid);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
doQuery.call(this, props, hid, bids, rows);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function doQuery(props, hid, bids, rows) {
|
||||||
|
let appcode = props.getAppCode();
|
||||||
|
|
||||||
|
ajax({
|
||||||
|
url: '/nccloud/mmpac/pickm/pickmItemsQuery.do',
|
||||||
|
data: {
|
||||||
|
cpickmid: hid,
|
||||||
|
cpickmbids: bids,
|
||||||
|
pageid: DIALOGCODE.CLQUERYDLG,
|
||||||
|
appcode: appcode
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
let bids = res.data.data;
|
||||||
|
// console.log('bids = ', bids);
|
||||||
|
let rows1 = [];
|
||||||
|
rows.map((item) => {
|
||||||
|
let values = item.data.values;
|
||||||
|
// 借料数量 = 计划出库数量-累计出库数量-累计发货数量-累计委外数量,所有数值用getNumber处理null转0
|
||||||
|
values.borrowedQty = {
|
||||||
|
value: getNumber(values.nplanoutastnum) - getNumber(values.naccoutastnum) -
|
||||||
|
getNumber(values.nshouldastnum) - getNumber(values.npscastnum)
|
||||||
|
};
|
||||||
|
let def26 = this.props.form.getFormItemsValue(AREA.formArea,"cmaterialvid").value;
|
||||||
|
// let def27 = this.props.form.getFormItemsValue(AREA.formArea,"cmaterialvid.name").value;
|
||||||
|
let form = this.props.form.getAllFormValue(AREA.formArea);
|
||||||
|
// values.cmaterialvid = {
|
||||||
|
// value: def26
|
||||||
|
// };
|
||||||
|
values.cmaterialvid = form.rows[0].values["cmaterialvid"];
|
||||||
|
values.cmaterialvidName = {
|
||||||
|
value: form.rows[0].values["cmaterialvid.name"].value
|
||||||
|
};
|
||||||
|
if(undefined !=form.rows[0].values["cmaterialvid.def26"]){
|
||||||
|
values.cmaterialvidDef26 = {
|
||||||
|
value: form.rows[0].values["cmaterialvid.def26"].value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
let rowItem = {
|
||||||
|
isOptimized: false,
|
||||||
|
status: '0',
|
||||||
|
values: values
|
||||||
|
};
|
||||||
|
// 确保 bids 是数组类型
|
||||||
|
if (!Array.isArray(bids)) {
|
||||||
|
bids = [bids];
|
||||||
|
}
|
||||||
|
// 筛选出未生成的行
|
||||||
|
// console.log('values.cpickm_bid = ', values.cpickm_bid.value);
|
||||||
|
// console.log('values.indexOf = ', bids.indexOf(values.cpickm_bid.value));
|
||||||
|
if (values.cpickm_bid && values.cpickm_bid.value && (bids.indexOf(values.cpickm_bid.value) > -1) && values.borrowedQty.value>0) {
|
||||||
|
rows1.push(rowItem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let data = {
|
||||||
|
areacode: 'clquery',
|
||||||
|
rows: rows1
|
||||||
|
};
|
||||||
|
// console.log('rows = ', rows);
|
||||||
|
// console.log('data = ', data);
|
||||||
|
props.table.setAllTableData(AREA.borrowMaterialDialog, data);
|
||||||
|
props.modal.show(AREA.borrowMaterialDialog);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本地安全数值转换方法,null/undefined/空对象转0
|
||||||
|
function getNumber(data) {
|
||||||
|
if (data && data.value != null) {
|
||||||
|
return +data.value;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ import clqueryBtnClick from './clqueryBtnClick';//存量查询
|
||||||
import replaceBtnClick from './replaceBtnClick';
|
import replaceBtnClick from './replaceBtnClick';
|
||||||
import reserveBtnClick from './reserveBtnClick';
|
import reserveBtnClick from './reserveBtnClick';
|
||||||
import reserveQueryBtnClick from './reserveQueryBtnClick';
|
import reserveQueryBtnClick from './reserveQueryBtnClick';
|
||||||
|
import detailqueryBtnClick from './detailqueryBtnClick';
|
||||||
import pushrzmsBtnClick from './pushrzmsBtnClick.js'; //推送锐制
|
import pushrzmsBtnClick from './pushrzmsBtnClick.js'; //推送锐制
|
||||||
import borrowBtnClick from './borrowBtnClick.js';
|
import borrowBtnClick from './borrowBtnClick.js';
|
||||||
import borrowOkBtnClick from "./borrowOkBtnClick.js";
|
import borrowOkBtnClick from "./borrowOkBtnClick.js";
|
||||||
|
@ -29,6 +30,6 @@ export {
|
||||||
pageInfoClick, getParentURlParme, setBtnShow, backBtnClick, addBtnClick, delBtnClick,
|
pageInfoClick, getParentURlParme, setBtnShow, backBtnClick, addBtnClick, delBtnClick,
|
||||||
editBtnClick, cancelBtnClick, saveBtnClick, saveCommitBtnClick, copyBtnClick,
|
editBtnClick, cancelBtnClick, saveBtnClick, saveCommitBtnClick, copyBtnClick,
|
||||||
commitBtnClick, unCommitBtnClick, printBtnClick, outputBtnClick, subItemsBtnClick,
|
commitBtnClick, unCommitBtnClick, printBtnClick, outputBtnClick, subItemsBtnClick,
|
||||||
finishBtnClick, unfinishBtnClick, clqueryBtnClick, replaceBtnClick,reserveBtnClick,reserveQueryBtnClick,
|
finishBtnClick, unfinishBtnClick, clqueryBtnClick, replaceBtnClick,reserveBtnClick,reserveQueryBtnClick,detailqueryBtnClick,
|
||||||
pageInfoClickPage,pushrzmsBtnClick, borrowBtnClick, borrowOkBtnClick
|
pageInfoClickPage,pushrzmsBtnClick, borrowBtnClick, borrowOkBtnClick
|
||||||
};
|
};
|
||||||
|
|
|
@ -272,9 +272,9 @@ class PickmCard extends Component {
|
||||||
{createModal('TakeOverDlg', {zIndex: "300"})}
|
{createModal('TakeOverDlg', {zIndex: "300"})}
|
||||||
{createModal('SetBackDeliverDlg', {zIndex: "280"})}
|
{createModal('SetBackDeliverDlg', {zIndex: "280"})}
|
||||||
{createModal('ReplaceDlg', {zIndex: "300"})}
|
{createModal('ReplaceDlg', {zIndex: "300"})}
|
||||||
{createModal('BorrowDlg', {zIndex: "300"})}
|
{/*{createModal('BorrowDlg', {zIndex: "300"})}*/}
|
||||||
|
|
||||||
{/*{createModal(AREA.borrowMaterialDialog, {
|
{createModal(AREA.borrowMaterialDialog, {
|
||||||
title: '借料入库明细',
|
title: '借料入库明细',
|
||||||
content: (
|
content: (
|
||||||
<div class="flex-container" style={{height: '100%'}}>
|
<div class="flex-container" style={{height: '100%'}}>
|
||||||
|
@ -317,7 +317,7 @@ class PickmCard extends Component {
|
||||||
this.props.modal.close(AREA.borrowMaterialDialog)
|
this.props.modal.close(AREA.borrowMaterialDialog)
|
||||||
},
|
},
|
||||||
userControl: true
|
userControl: true
|
||||||
})}*/}
|
})}
|
||||||
<div>
|
<div>
|
||||||
<ReserveQuery
|
<ReserveQuery
|
||||||
show={this.state.showReserveQuery}
|
show={this.state.showReserveQuery}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
clqueryBtnClick,
|
clqueryBtnClick,
|
||||||
commitBtnClick,
|
commitBtnClick,
|
||||||
copyBtnClick,
|
copyBtnClick,
|
||||||
delBtnClick,
|
delBtnClick, detailqueryBtnClick,
|
||||||
editBtnClick,
|
editBtnClick,
|
||||||
finishBtnClick,
|
finishBtnClick,
|
||||||
outputBtnClick,
|
outputBtnClick,
|
||||||
|
@ -815,11 +815,33 @@ export default async function clickBtn(props, id, text, record, index) {
|
||||||
showWarningInfo(getLangByResId(this, '5008Pickm-000061'));
|
showWarningInfo(getLangByResId(this, '5008Pickm-000061'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.log('selectRows = ', selectRows);
|
||||||
|
// 判断选中行的借料数量是否>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;
|
||||||
|
// }
|
||||||
|
|
||||||
billstatus = props.form.getFormItemsValue(AREA.formArea, 'fbillstatus');
|
billstatus = props.form.getFormItemsValue(AREA.formArea, 'fbillstatus');
|
||||||
//审批态
|
//审批态
|
||||||
if (billstatus && billstatus.value && billstatus.value == 1) {
|
if (billstatus && billstatus.value && billstatus.value == 1) {
|
||||||
// detailqueryBtnClick.call(this, this.props, record);
|
detailqueryBtnClick.call(this, this.props, record);
|
||||||
borrowBtnClick.call(this, this.props, record);
|
|
||||||
} else {
|
} else {
|
||||||
toast({color: 'warning', title: "只有审批后单据才能生产其他入库单"});
|
toast({color: 'warning', title: "只有审批后单据才能生产其他入库单"});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ const AREA = {
|
||||||
cardHeadBtnArea: 'card_head', //卡片表头按钮区域
|
cardHeadBtnArea: 'card_head', //卡片表头按钮区域
|
||||||
cardBodyBtnArea: 'card_body', //卡片表体按钮区域
|
cardBodyBtnArea: 'card_body', //卡片表体按钮区域
|
||||||
cardBodyInnerBtnArea: 'card_body_inner', //卡片表体操作按钮区域
|
cardBodyInnerBtnArea: 'card_body_inner', //卡片表体操作按钮区域
|
||||||
// borrowMaterialDialog: 'NCTable_83c3abf9', //借料弹窗
|
borrowMaterialDialog: 'NCTable_83c3abf9', //借料弹窗
|
||||||
borrowList: 'borrow_list', //借料弹窗页面编码
|
borrowList: 'borrow_list', //借料弹窗页面编码
|
||||||
BORROW_DLG: 'BorrowDlg' //借料入库
|
BORROW_DLG: 'BorrowDlg' //借料入库
|
||||||
};
|
};
|
||||||
|
|
|
@ -337,8 +337,8 @@ class PickmList extends Component {
|
||||||
{createModal('BackDeliverDlg')}
|
{createModal('BackDeliverDlg')}
|
||||||
{createModal('BackSerialnoDlg')}
|
{createModal('BackSerialnoDlg')}
|
||||||
{createModal('SetBackDeliverDlg')}
|
{createModal('SetBackDeliverDlg')}
|
||||||
{createModal('BorrowDlg')}
|
{/*{createModal('BorrowDlg')}*/}
|
||||||
{/*{createModal('NCTable_3c81fe87', {
|
{createModal('NCTable_3c81fe87', {
|
||||||
title: '借料入库明细',
|
title: '借料入库明细',
|
||||||
content: (
|
content: (
|
||||||
<div class="flex-container" style={{height: '100%'}}>
|
<div class="flex-container" style={{height: '100%'}}>
|
||||||
|
@ -390,7 +390,7 @@ class PickmList extends Component {
|
||||||
this.props.modal.close('NCTable_3c81fe87')
|
this.props.modal.close('NCTable_3c81fe87')
|
||||||
},
|
},
|
||||||
userControl: true
|
userControl: true
|
||||||
})}*/}
|
})}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -512,7 +512,7 @@ export default function (props, key, text, record, index) {
|
||||||
data = {
|
data = {
|
||||||
pks: cpickmids
|
pks: cpickmids
|
||||||
}
|
}
|
||||||
let setProps = (val) => {
|
/*let setProps = (val) => {
|
||||||
this.props = val;
|
this.props = val;
|
||||||
}
|
}
|
||||||
ajax({
|
ajax({
|
||||||
|
@ -528,7 +528,7 @@ export default function (props, key, text, record, index) {
|
||||||
setProps={setProps}/>,
|
setProps={setProps}/>,
|
||||||
userControl: true,
|
userControl: true,
|
||||||
// leftBtnName: '',
|
// leftBtnName: '',
|
||||||
// rightBtnName: getLangByResId(this, '5008Pickm-000013'),/* 国际化处理: 取消*/
|
// rightBtnName: getLangByResId(this, '5008Pickm-000013'),/!* 国际化处理: 取消*!/
|
||||||
beSureBtnClick: borrowOkBtnClick.bind(this, props, true),
|
beSureBtnClick: borrowOkBtnClick.bind(this, props, true),
|
||||||
cancelBtnClick: () => {
|
cancelBtnClick: () => {
|
||||||
props.modal.close(AREA.BORROW_DLG);
|
props.modal.close(AREA.BORROW_DLG);
|
||||||
|
@ -536,6 +536,17 @@ export default function (props, key, text, record, index) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});*/
|
||||||
|
ajax({
|
||||||
|
url: '/nccloud/mmpac/pickm/pickmByIdsQuery.do',
|
||||||
|
data: data,
|
||||||
|
success: (res) => {
|
||||||
|
if(res.success){
|
||||||
|
props.table.setAllTableData("NCTable_3c81fe87", res.data.data);//[0].card_body.rows
|
||||||
|
props.modal.show("NCTable_3c81fe87");
|
||||||
|
toast({ content: "查询成功", color: 'success' });
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "to_pmo"://流程生产订单
|
case "to_pmo"://流程生产订单
|
||||||
|
|
Loading…
Reference in New Issue