借料入库前端调整
This commit is contained in:
parent
498fa57aff
commit
dc4af22787
|
@ -1,36 +1,33 @@
|
|||
import { ajax, toast } from 'nc-lightapp-front';
|
||||
import { AREA, URL, DIALOGCODE, FIELD } from '../../constance';
|
||||
import { initLang, getLangByResId } from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
|
||||
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';
|
||||
import {showErrorInfo} from '../../../../../mmpub/mmpub/pub/tool/messageUtil';
|
||||
|
||||
export default function detailqueryBtnClick(props, record) {
|
||||
let _this = this;
|
||||
let bids = [];
|
||||
let hid;
|
||||
if (record && record.values.cpickm_bid && record.values.cpickm_bid.value) {
|
||||
bids.push(record.values.cpickm_bid.value);
|
||||
} else {
|
||||
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);
|
||||
});
|
||||
|
||||
}
|
||||
let rows = this.props.cardTable.getCheckedRows(AREA.bodyTable);
|
||||
// 如果没有选中行,则提示并返回,不进行任何操作
|
||||
if (!rows) {
|
||||
return;
|
||||
}
|
||||
doQuery.call(this, props, hid, bids);
|
||||
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) {
|
||||
|
||||
function doQuery(props, hid, bids, rows) {
|
||||
let appcode = props.getAppCode();
|
||||
|
||||
|
||||
ajax({
|
||||
url: '/nccloud/mmpac/pickm/pickmItemsQuery.do',
|
||||
data: {
|
||||
|
@ -40,9 +37,49 @@ function doQuery(props, hid, bids) {
|
|||
appcode: appcode
|
||||
},
|
||||
success: res => {
|
||||
props.table.setAllTableData('NCTable_83c3abf9', res.data.clquery);
|
||||
// props.table.setAllTableData('NCTable_83c3abf9', res.data.clquery,true, true, false);
|
||||
props.modal.show('NCTable_83c3abf9');
|
||||
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 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)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,359 +1,364 @@
|
|||
import React, { Component } from 'react';
|
||||
import { createPage, ajax, base, high, toast } from 'nc-lightapp-front';
|
||||
import React, {Component} from 'react';
|
||||
import {createPage, ajax, base, high, toast} from 'nc-lightapp-front';
|
||||
import ApproveDetail from 'uap/common/components/ApproveDetail';
|
||||
import NCUploader from 'uap/common/components/NCUploader';
|
||||
import ApprovalTrans from 'uap/common/components/approvalTrans';
|
||||
const { BillTrack } = high;
|
||||
import { initTemplate } from './init';
|
||||
import { pageInfoClick, pageInfoClickPage, getParentURlParme } from './btnClicks';
|
||||
|
||||
const {BillTrack} = high;
|
||||
import {initTemplate} from './init';
|
||||
import {pageInfoClick, pageInfoClickPage, getParentURlParme} from './btnClicks';
|
||||
import newLineDefaultUtil from './utils/newLineDefaultUtil';
|
||||
import { checkDeleteRows } from './utils/rowDeleteUtil';
|
||||
import { btnClickController, buttonController } from './viewController/index';
|
||||
import { FIELD, BTNID, URL, PAGECARDCODE, UISTATE, AREA, CARD_BTN, PickmCache, FbillStatus } from '../constance';
|
||||
import { headAfterEvent, bodyAfterEvent } from './afterEvents';
|
||||
import { batchEvent } from './batchEvents';
|
||||
import { headBeforeEvent, bodyBeforeEvent } from './beforeEvents';
|
||||
import {checkDeleteRows} from './utils/rowDeleteUtil';
|
||||
import {btnClickController, buttonController} from './viewController/index';
|
||||
import {FIELD, BTNID, URL, PAGECARDCODE, UISTATE, AREA, CARD_BTN, PickmCache, FbillStatus} from '../constance';
|
||||
import {headAfterEvent, bodyAfterEvent} from './afterEvents';
|
||||
import {batchEvent} from './batchEvents';
|
||||
import {headBeforeEvent, bodyBeforeEvent} from './beforeEvents';
|
||||
import saveCommitBtnClick from './btnClicks/saveCommitBtnClick';
|
||||
import commitBtnClick from './btnClicks/commitBtnClick'; //提交
|
||||
const { NCFormControl, NCAffix, NCDiv, NCIcon, NCUpload, NCBackBtn } = base;
|
||||
import { RownoUtils } from '../../../../mmpub/mmpub/pub/tool/cardTableTools';
|
||||
import { initLang, getLangByResId } from '../../../../mmpub/mmpub/pub/tool/multiLangUtil';
|
||||
import { BillReserve } from 'ic/ic/components/billReserve'; //预留
|
||||
const {NCFormControl, NCAffix, NCDiv, NCIcon, NCUpload, NCBackBtn} = base;
|
||||
import {RownoUtils} from '../../../../mmpub/mmpub/pub/tool/cardTableTools';
|
||||
import {initLang, getLangByResId} from '../../../../mmpub/mmpub/pub/tool/multiLangUtil';
|
||||
import {BillReserve} from 'ic/ic/components/billReserve'; //预留
|
||||
import ReserveQuery from 'ic/ic/components/reserveQuery'; //预留查询
|
||||
import inputChange from '../../../../mmpub/mmpub/pub/tool/rownoInputUtil';
|
||||
import {showWarningInfo} from "../../../../mmpub/mmpub/pub/tool/messageUtil";
|
||||
|
||||
let param = getParentURlParme('pageMsgType');
|
||||
|
||||
class PickmCard extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
props.use.form(AREA.formArea);
|
||||
props.use.cardTable(AREA.bodyTable);
|
||||
//this.meta;
|
||||
this.billcode = '';
|
||||
this.MM_PICKM_TYPE = 'N'; //判断是否是从新增小应用过来的
|
||||
this.state = {
|
||||
copy_billId: '',
|
||||
hideAdd: false,
|
||||
hideDel: false,
|
||||
copyRowDatas: null, //复制行数据
|
||||
showTrack: false, //单据追溯
|
||||
show: false, //审批详情
|
||||
vtrantypecode: null,
|
||||
cpickmid: '',
|
||||
lineShowType: [], //通过数组的方式控制 列按钮显示 1-收起 0-展开
|
||||
target: null, //附件管理弹出框目标位置
|
||||
showUploader: false, //是否显示附件管理弹出框
|
||||
tableData: { rows: [] },
|
||||
refreshFlag: 0,
|
||||
editable: false, //页面是否可以编辑
|
||||
status: UISTATE.browse, // 页面标志,默认浏览态
|
||||
compositedisplay: false,
|
||||
compositedata: null,
|
||||
saveAndCommit: false, //是否保存提交
|
||||
isUpdateForYL: null,
|
||||
skipCodes: null,
|
||||
isWW: false,
|
||||
showReserve: false, //是否显示预留弹框
|
||||
showReserveQuery: false, //是否显示预留查询
|
||||
};
|
||||
this.reserveData = {}; //预留需要的数据
|
||||
this.reserveQueryPks = {}; //预留查询需要的数据
|
||||
//initTemplate.call(this, this.props);
|
||||
initLang(this, ['5008Pickm', '5008Pub'], 'mmpac', initTemplate.bind(this, this.props));
|
||||
}
|
||||
// 渲染页面前,执行
|
||||
componentWillMount() {
|
||||
// 关闭浏览器
|
||||
window.onbeforeunload = () => {
|
||||
let status = this.props.cardTable.getStatus(AREA.bodyTable);
|
||||
//if (!status) status == 'browse';
|
||||
status = status == 'browse' ? 'browse' : 'edit';
|
||||
if (status == 'edit') {
|
||||
return getLangByResId(this, '5008Pickm-000052');/* 国际化处理: 当前单据未保存,您确认离开此页面?*//*getLangByResId(this, '4008GENERALIN-000006'); 国际化处理: 当前单据未保存,您确认离开此页面?*/
|
||||
}
|
||||
};
|
||||
}
|
||||
componentDidMount() {
|
||||
//设置状态
|
||||
this.props.BillHeadInfo.setBillHeadInfoVisible({
|
||||
showBackBtn: false, //控制显示返回按钮: true为显示,false为隐藏 ---非必传
|
||||
showBillCode: false, //控制显示单据号:true为显示,false为隐藏 ---非必传
|
||||
billCode: this.state.vbillcode //修改单据号---非必传
|
||||
});
|
||||
//pageInfoClick.bind(this)();
|
||||
}
|
||||
closeApprove = () => {
|
||||
this.setState({
|
||||
show: false
|
||||
});
|
||||
};
|
||||
// 附件管理关闭
|
||||
onHideUploader = () => {
|
||||
this.setState({
|
||||
showUploader: false
|
||||
});
|
||||
};
|
||||
//切换页面状态
|
||||
toggleShow = () => {
|
||||
let status = this.props.getUrlParam('status');
|
||||
if (!status) {
|
||||
status = 'add';
|
||||
}
|
||||
buttonController.setUIState.call(this, this.props, status);
|
||||
buttonController.setBackButtonVisiable.call(this, this.props, param);
|
||||
buttonController.setCardButtonVisiable.call(this, this.props, status, param);
|
||||
};
|
||||
//获取列表肩部信息
|
||||
getTableHead = (buttons) => {
|
||||
return (
|
||||
<div className='definition-icons'>
|
||||
{this.props.button.createButtonApp({
|
||||
area: AREA.cardBodyBtnArea,
|
||||
//ignoreHotkeyCode: this.getCardDisableHotKeyBtn,
|
||||
onButtonClick: btnClickController.bind(this)
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
getCardDisableHotKeyBtn = () => {
|
||||
return ['DeleteLine']; /** 目前是仅有删除行 */
|
||||
};
|
||||
getAssginUsedr = (value) => {
|
||||
//重新执行提交操作重新执行提交操作
|
||||
if (this.state.saveAndCommit == true) {
|
||||
saveCommitBtnClick.call(this, this.props, this.state.skipCodes, this.state.isUpdateForYL, value);
|
||||
} else {
|
||||
commitBtnClick.call(this, this.props, value);
|
||||
}
|
||||
this.setState({ compositedisplay: false, saveAndCommit: false });
|
||||
};
|
||||
constructor(props) {
|
||||
super(props);
|
||||
props.use.form(AREA.formArea);
|
||||
props.use.cardTable(AREA.bodyTable);
|
||||
//this.meta;
|
||||
this.billcode = '';
|
||||
this.MM_PICKM_TYPE = 'N'; //判断是否是从新增小应用过来的
|
||||
this.state = {
|
||||
copy_billId: '',
|
||||
hideAdd: false,
|
||||
hideDel: false,
|
||||
copyRowDatas: null, //复制行数据
|
||||
showTrack: false, //单据追溯
|
||||
show: false, //审批详情
|
||||
vtrantypecode: null,
|
||||
cpickmid: '',
|
||||
lineShowType: [], //通过数组的方式控制 列按钮显示 1-收起 0-展开
|
||||
target: null, //附件管理弹出框目标位置
|
||||
showUploader: false, //是否显示附件管理弹出框
|
||||
tableData: {rows: []},
|
||||
refreshFlag: 0,
|
||||
editable: false, //页面是否可以编辑
|
||||
status: UISTATE.browse, // 页面标志,默认浏览态
|
||||
compositedisplay: false,
|
||||
compositedata: null,
|
||||
saveAndCommit: false, //是否保存提交
|
||||
isUpdateForYL: null,
|
||||
skipCodes: null,
|
||||
isWW: false,
|
||||
showReserve: false, //是否显示预留弹框
|
||||
showReserveQuery: false, //是否显示预留查询
|
||||
};
|
||||
this.reserveData = {}; //预留需要的数据
|
||||
this.reserveQueryPks = {}; //预留查询需要的数据
|
||||
//initTemplate.call(this, this.props);
|
||||
initLang(this, ['5008Pickm', '5008Pub'], 'mmpac', initTemplate.bind(this, this.props));
|
||||
}
|
||||
|
||||
change = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
// 渲染页面前,执行
|
||||
componentWillMount() {
|
||||
// 关闭浏览器
|
||||
window.onbeforeunload = () => {
|
||||
let status = this.props.cardTable.getStatus(AREA.bodyTable);
|
||||
//if (!status) status == 'browse';
|
||||
status = status == 'browse' ? 'browse' : 'edit';
|
||||
if (status == 'edit') {
|
||||
return getLangByResId(this, '5008Pickm-000052');/* 国际化处理: 当前单据未保存,您确认离开此页面?*//*getLangByResId(this, '4008GENERALIN-000006'); 国际化处理: 当前单据未保存,您确认离开此页面?*/
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { createBillHeadInfo } = this.props.BillHeadInfo;
|
||||
let { table, cardTable, form, button, modal, cardPagination, socket } = this.props;
|
||||
let buttons = this.props.button.getButtons();
|
||||
let multiLang = this.props.MutiInit.getIntl(this.moduleId);
|
||||
let { createForm } = form;
|
||||
let { createCardTable } = cardTable;
|
||||
let { createModal } = modal;
|
||||
let { createSimpleTable } = table;
|
||||
const { createCardPagination } = cardPagination;
|
||||
let { showUploader, target } = this.state;
|
||||
componentDidMount() {
|
||||
//设置状态
|
||||
this.props.BillHeadInfo.setBillHeadInfoVisible({
|
||||
showBackBtn: false, //控制显示返回按钮: true为显示,false为隐藏 ---非必传
|
||||
showBillCode: false, //控制显示单据号:true为显示,false为隐藏 ---非必传
|
||||
billCode: this.state.vbillcode //修改单据号---非必传
|
||||
});
|
||||
//pageInfoClick.bind(this)();
|
||||
}
|
||||
|
||||
// this.props.use.form('NCTable_83c3abf9')
|
||||
// this.props.form.setFormStatus('NCTable_83c3abf9', 'edit')
|
||||
return (
|
||||
<div className='nc-bill-card' id='mm-mmpac-pickm-card' >
|
||||
{socket.connectMesg({
|
||||
headBtnAreaCode: AREA.cardHeadBtnArea, // 表头按钮区域ID
|
||||
formAreaCode: AREA.formArea, // 表头Form区域ID
|
||||
billtype: FIELD.billtype,
|
||||
billpkname: FIELD.hid,
|
||||
dataSource: PickmCache.PickmCacheKey
|
||||
})}
|
||||
<div className='nc-bill-top-area'>
|
||||
<NCAffix>
|
||||
<NCDiv areaCode={NCDiv.config.HEADER} className='nc-bill-header-area'>
|
||||
<div className='header-title-search-area'>
|
||||
closeApprove = () => {
|
||||
this.setState({
|
||||
show: false
|
||||
});
|
||||
};
|
||||
// 附件管理关闭
|
||||
onHideUploader = () => {
|
||||
this.setState({
|
||||
showUploader: false
|
||||
});
|
||||
};
|
||||
//切换页面状态
|
||||
toggleShow = () => {
|
||||
let status = this.props.getUrlParam('status');
|
||||
if (!status) {
|
||||
status = 'add';
|
||||
}
|
||||
buttonController.setUIState.call(this, this.props, status);
|
||||
buttonController.setBackButtonVisiable.call(this, this.props, param);
|
||||
buttonController.setCardButtonVisiable.call(this, this.props, status, param);
|
||||
};
|
||||
//获取列表肩部信息
|
||||
getTableHead = (buttons) => {
|
||||
return (
|
||||
<div className='definition-icons'>
|
||||
{this.props.button.createButtonApp({
|
||||
area: AREA.cardBodyBtnArea,
|
||||
//ignoreHotkeyCode: this.getCardDisableHotKeyBtn,
|
||||
onButtonClick: btnClickController.bind(this)
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
getCardDisableHotKeyBtn = () => {
|
||||
return ['DeleteLine']; /** 目前是仅有删除行 */
|
||||
};
|
||||
getAssginUsedr = (value) => {
|
||||
//重新执行提交操作重新执行提交操作
|
||||
if (this.state.saveAndCommit == true) {
|
||||
saveCommitBtnClick.call(this, this.props, this.state.skipCodes, this.state.isUpdateForYL, value);
|
||||
} else {
|
||||
commitBtnClick.call(this, this.props, value);
|
||||
}
|
||||
this.setState({compositedisplay: false, saveAndCommit: false});
|
||||
};
|
||||
|
||||
change = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {createBillHeadInfo} = this.props.BillHeadInfo;
|
||||
let {table, cardTable, form, button, modal, cardPagination, socket} = this.props;
|
||||
let buttons = this.props.button.getButtons();
|
||||
let multiLang = this.props.MutiInit.getIntl(this.moduleId);
|
||||
let {createForm} = form;
|
||||
let {createCardTable} = cardTable;
|
||||
let {createModal} = modal;
|
||||
let {createSimpleTable} = table;
|
||||
const {createCardPagination} = cardPagination;
|
||||
let {showUploader, target} = this.state;
|
||||
|
||||
return (
|
||||
<div className='nc-bill-card' id='mm-mmpac-pickm-card'>
|
||||
{socket.connectMesg({
|
||||
headBtnAreaCode: AREA.cardHeadBtnArea, // 表头按钮区域ID
|
||||
formAreaCode: AREA.formArea, // 表头Form区域ID
|
||||
billtype: FIELD.billtype,
|
||||
billpkname: FIELD.hid,
|
||||
dataSource: PickmCache.PickmCacheKey
|
||||
})}
|
||||
<div className='nc-bill-top-area'>
|
||||
<NCAffix>
|
||||
<NCDiv areaCode={NCDiv.config.HEADER} className='nc-bill-header-area'>
|
||||
<div className='header-title-search-area'>
|
||||
<span>
|
||||
{createBillHeadInfo({
|
||||
title: this.props.getSearchParam('n'),//getLangByResId(this, '5008Pickm-000053'),/* 国际化处理: 备料计划*/
|
||||
backBtnClick: () => {
|
||||
//返回按钮的点击事件
|
||||
btnClickController.bind(this, this.props, CARD_BTN.Back)();
|
||||
}
|
||||
})}
|
||||
title: this.props.getSearchParam('n'),//getLangByResId(this, '5008Pickm-000053'),/* 国际化处理: 备料计划*/
|
||||
backBtnClick: () => {
|
||||
//返回按钮的点击事件
|
||||
btnClickController.bind(this, this.props, CARD_BTN.Back)();
|
||||
}
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
<div className='header-button-area'>
|
||||
{/*sagas*/}
|
||||
{this.props.button.createErrorFlag({
|
||||
headBtnAreaCode: AREA.cardHeadBtnArea
|
||||
})}
|
||||
{this.props.button.createButtonApp({
|
||||
area: AREA.cardHeadBtnArea,
|
||||
onButtonClick: btnClickController.bind(this)
|
||||
})}
|
||||
<BillTrack
|
||||
show={this.state.showTrack}
|
||||
close={() => {
|
||||
this.setState({ showTrack: false });
|
||||
}}
|
||||
pk={this.state.cpickmid}
|
||||
type={FIELD.billtype}
|
||||
/>
|
||||
</div>
|
||||
{this.state.status == UISTATE.browse ? (
|
||||
<div className='header-cardPagination-area'>
|
||||
{createCardPagination({
|
||||
handlePageInfoChange: pageInfoClickPage.bind(this),
|
||||
dataSource: PickmCache.PickmCacheKey
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</NCDiv>
|
||||
</NCAffix>
|
||||
<div className='nc-bill-form-area'>
|
||||
{createForm(AREA.formArea, {
|
||||
onBeforeEvent: headBeforeEvent.bind(this),
|
||||
onAfterEvent: headAfterEvent.bind(this)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className='nc-bill-bottom-area'>
|
||||
<div className='nc-bill-table-area'>
|
||||
{createCardTable(AREA.bodyTable, {
|
||||
showCheck: true,
|
||||
showIndex: true,
|
||||
onBeforeEvent: bodyBeforeEvent.bind(this),
|
||||
onAfterEvent: bodyAfterEvent.bind(this),
|
||||
onBatchChange: batchEvent.bind(this),
|
||||
onSelected: buttonController.lineSelected.bind(this),
|
||||
hideModelSave: true,
|
||||
onSelectedAll: buttonController.lineSelected.bind(this),
|
||||
onBatchSelected: buttonController.lineSelected.bind(this),
|
||||
tableHead: this.getTableHead.bind(this, buttons),
|
||||
adaptionHeight: true,
|
||||
inputChange: inputChange.bind(this, FIELD.vrowno),
|
||||
modelAddRow: () => {
|
||||
//this.props.cardTable.addRow(AREA.bodyTable);
|
||||
let rowcount = this.props.cardTable.getNumberOfRows(AREA.bodyTable);
|
||||
RownoUtils.setRowNo(this.props, AREA.bodyTable, FIELD.vrowno);
|
||||
newLineDefaultUtil.setDefault.call(this, this.props, AREA.bodyTable, rowcount - 1);
|
||||
}
|
||||
,
|
||||
modelDelRowBefore: (props, moduleId, modelIndex, record) => {
|
||||
return checkDeleteRows.call(this, [record]);
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
{/* 展示审批详情 */}
|
||||
<div>
|
||||
<ApproveDetail
|
||||
show={this.state.show}
|
||||
close={this.closeApprove}
|
||||
billtype={this.state.vtrantypecode}
|
||||
billid={this.state.cpickmid}
|
||||
/>
|
||||
</div>
|
||||
<div>{/* 指派 */}
|
||||
{this.state.compositedisplay && <ApprovalTrans
|
||||
title={getLangByResId(this, '5008Pickm-000090')}
|
||||
data={this.state.compositedata}
|
||||
display={this.state.compositedisplay}
|
||||
getResult={this.getAssginUsedr.bind(this)}
|
||||
cancel={() => {
|
||||
this.setState({ compositedisplay: false });
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
<div>{showUploader && <NCUploader billId={this.state.cpickmid} onHide={this.onHideUploader} />}</div>
|
||||
{createModal('orgChange')}
|
||||
{createModal('ResumeMessageDlg', {
|
||||
className: 'iframe-modal',
|
||||
size: 'xlg'
|
||||
})}
|
||||
{createModal('delModal')}
|
||||
{createModal('MessageDlg', { zIndex: "280" })}
|
||||
{createModal('SetDeliverDlg')}
|
||||
{createModal('BackDeliverDlg', { zIndex: "280" })}
|
||||
{createModal('BackSerialnoDlg', { zIndex: "300" })}
|
||||
{createModal('TakeOverDlg', { zIndex: "300" })}
|
||||
{createModal('SetBackDeliverDlg', { zIndex: "280" })}
|
||||
{createModal('ReplaceDlg', { zIndex: "300" })}
|
||||
</div>
|
||||
<div className='header-button-area'>
|
||||
{/*sagas*/}
|
||||
{this.props.button.createErrorFlag({
|
||||
headBtnAreaCode: AREA.cardHeadBtnArea
|
||||
})}
|
||||
{this.props.button.createButtonApp({
|
||||
area: AREA.cardHeadBtnArea,
|
||||
onButtonClick: btnClickController.bind(this)
|
||||
})}
|
||||
<BillTrack
|
||||
show={this.state.showTrack}
|
||||
close={() => {
|
||||
this.setState({showTrack: false});
|
||||
}}
|
||||
pk={this.state.cpickmid}
|
||||
type={FIELD.billtype}
|
||||
/>
|
||||
</div>
|
||||
{this.state.status == UISTATE.browse ? (
|
||||
<div className='header-cardPagination-area'>
|
||||
{createCardPagination({
|
||||
handlePageInfoChange: pageInfoClickPage.bind(this),
|
||||
dataSource: PickmCache.PickmCacheKey
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</NCDiv>
|
||||
</NCAffix>
|
||||
<div className='nc-bill-form-area'>
|
||||
{createForm(AREA.formArea, {
|
||||
onBeforeEvent: headBeforeEvent.bind(this),
|
||||
onAfterEvent: headAfterEvent.bind(this)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className='nc-bill-bottom-area'>
|
||||
<div className='nc-bill-table-area'>
|
||||
{createCardTable(AREA.bodyTable, {
|
||||
showCheck: true,
|
||||
showIndex: true,
|
||||
onBeforeEvent: bodyBeforeEvent.bind(this),
|
||||
onAfterEvent: bodyAfterEvent.bind(this),
|
||||
onBatchChange: batchEvent.bind(this),
|
||||
onSelected: buttonController.lineSelected.bind(this),
|
||||
hideModelSave: true,
|
||||
onSelectedAll: buttonController.lineSelected.bind(this),
|
||||
onBatchSelected: buttonController.lineSelected.bind(this),
|
||||
tableHead: this.getTableHead.bind(this, buttons),
|
||||
adaptionHeight: true,
|
||||
inputChange: inputChange.bind(this, FIELD.vrowno),
|
||||
modelAddRow: () => {
|
||||
//this.props.cardTable.addRow(AREA.bodyTable);
|
||||
let rowcount = this.props.cardTable.getNumberOfRows(AREA.bodyTable);
|
||||
RownoUtils.setRowNo(this.props, AREA.bodyTable, FIELD.vrowno);
|
||||
newLineDefaultUtil.setDefault.call(this, this.props, AREA.bodyTable, rowcount - 1);
|
||||
}
|
||||
,
|
||||
modelDelRowBefore: (props, moduleId, modelIndex, record) => {
|
||||
return checkDeleteRows.call(this, [record]);
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
{/* 展示审批详情 */}
|
||||
<div>
|
||||
<ApproveDetail
|
||||
show={this.state.show}
|
||||
close={this.closeApprove}
|
||||
billtype={this.state.vtrantypecode}
|
||||
billid={this.state.cpickmid}
|
||||
/>
|
||||
</div>
|
||||
<div>{/* 指派 */}
|
||||
{this.state.compositedisplay && <ApprovalTrans
|
||||
title={getLangByResId(this, '5008Pickm-000090')}
|
||||
data={this.state.compositedata}
|
||||
display={this.state.compositedisplay}
|
||||
getResult={this.getAssginUsedr.bind(this)}
|
||||
cancel={() => {
|
||||
this.setState({compositedisplay: false});
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
<div>{showUploader && <NCUploader billId={this.state.cpickmid} onHide={this.onHideUploader}/>}</div>
|
||||
{createModal('orgChange')}
|
||||
{createModal('ResumeMessageDlg', {
|
||||
className: 'iframe-modal',
|
||||
size: 'xlg'
|
||||
})}
|
||||
{createModal('delModal')}
|
||||
{createModal('MessageDlg', {zIndex: "280"})}
|
||||
{createModal('SetDeliverDlg')}
|
||||
{createModal('BackDeliverDlg', {zIndex: "280"})}
|
||||
{createModal('BackSerialnoDlg', {zIndex: "300"})}
|
||||
{createModal('TakeOverDlg', {zIndex: "300"})}
|
||||
{createModal('SetBackDeliverDlg', {zIndex: "280"})}
|
||||
{createModal('ReplaceDlg', {zIndex: "300"})}
|
||||
|
||||
{createModal('NCTable_83c3abf9', {
|
||||
title: '备料明细',
|
||||
content: (
|
||||
<div class="flex-container" style={{ height: '100%' }}>
|
||||
{createSimpleTable("NCTable_83c3abf9", { showIndex: true })}</div>
|
||||
),
|
||||
size: '500',
|
||||
beSureBtnClick: () => {
|
||||
let rowids = [];
|
||||
let hids = [];
|
||||
let hid;
|
||||
{createModal(AREA.borrowMaterialDialog, {
|
||||
title: '借料入库明细',
|
||||
content: (
|
||||
<div class="flex-container" style={{height: '100%'}}>
|
||||
{createSimpleTable(AREA.borrowMaterialDialog, {showIndex: true})}</div>
|
||||
),
|
||||
size: 'xlg',
|
||||
beSureBtnClick: () => {
|
||||
let rowids = [];
|
||||
let hids = [];
|
||||
let hid;
|
||||
let rows = this.props.cardTable.getCheckedRows(AREA.bodyTable);
|
||||
hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
|
||||
hids.push(hid);
|
||||
// 如果没有选中行,则提示并返回,不进行任何操作
|
||||
if (!rows || rows.length <= 0) {
|
||||
hids.push(this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value);
|
||||
}
|
||||
else {
|
||||
rows.map((item) => {
|
||||
let cpickm_bid = this.props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, 'cpickm_bid').value;
|
||||
rowids.push(cpickm_bid);
|
||||
});
|
||||
}
|
||||
let data = {
|
||||
cpickmids: hids,
|
||||
cpickmbids: rowids
|
||||
}
|
||||
ajax({
|
||||
url: URL.convertOtherIn,
|
||||
data: data,
|
||||
success: (res) => {
|
||||
if (res.success) {
|
||||
toast({ color: 'success', title: "推送成功" });
|
||||
this.props.modal.close('NCTable_83c3abf9');
|
||||
}
|
||||
}
|
||||
});
|
||||
hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
|
||||
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);
|
||||
});
|
||||
let data = {
|
||||
cpickmids: hids,
|
||||
cpickmbids: rowids
|
||||
}
|
||||
console.log('data = ', data);
|
||||
ajax({
|
||||
url: URL.convertOtherIn,
|
||||
data: data,
|
||||
success: (res) => {
|
||||
if (res.success) {
|
||||
toast({color: 'success', title: "推送成功"});
|
||||
this.props.modal.close(AREA.borrowMaterialDialog);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
cancelBtnClick: () => {
|
||||
this.props.modal.close('NCTable_83c3abf9')
|
||||
},
|
||||
userControl: true
|
||||
})}
|
||||
<div>
|
||||
<ReserveQuery
|
||||
show={this.state.showReserveQuery}
|
||||
pks={this.reserveQueryPks}
|
||||
onClose={() => {
|
||||
this.setState({
|
||||
showReserveQuery: false
|
||||
});
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<BillReserve
|
||||
show={this.state.showReserve}
|
||||
data={this.reserveData}
|
||||
billType={'55A3'}
|
||||
onClose={() => {
|
||||
this.setState({ showReserve: false });
|
||||
}}
|
||||
onSave={() => {
|
||||
this.setState(
|
||||
{ showReserve: false },
|
||||
//调用刷新
|
||||
btnClickController.bind(this, this.props, 'Refresh')
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
cancelBtnClick: () => {
|
||||
this.props.modal.close(AREA.borrowMaterialDialog)
|
||||
},
|
||||
userControl: true
|
||||
})}
|
||||
<div>
|
||||
<ReserveQuery
|
||||
show={this.state.showReserveQuery}
|
||||
pks={this.reserveQueryPks}
|
||||
onClose={() => {
|
||||
this.setState({
|
||||
showReserveQuery: false
|
||||
});
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<BillReserve
|
||||
show={this.state.showReserve}
|
||||
data={this.reserveData}
|
||||
billType={'55A3'}
|
||||
onClose={() => {
|
||||
this.setState({showReserve: false});
|
||||
}}
|
||||
onSave={() => {
|
||||
this.setState(
|
||||
{showReserve: false},
|
||||
//调用刷新
|
||||
btnClickController.bind(this, this.props, 'Refresh')
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
PickmCard = createPage({
|
||||
billinfo: {
|
||||
billtype: 'card',
|
||||
pagecode: PAGECARDCODE,
|
||||
headcode: AREA.formArea,
|
||||
bodycode: AREA.bodyTable
|
||||
},
|
||||
orderOfHotKey: [AREA.formArea, AREA.bodyTable]
|
||||
billinfo: {
|
||||
billtype: 'card',
|
||||
pagecode: PAGECARDCODE,
|
||||
headcode: AREA.formArea,
|
||||
bodycode: AREA.bodyTable
|
||||
},
|
||||
orderOfHotKey: [AREA.formArea, AREA.bodyTable]
|
||||
})(PickmCard);
|
||||
export default PickmCard;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,7 +9,8 @@ const AREA = {
|
|||
listInnerBtnArea: 'list_inner', //列表操作列按钮区域
|
||||
cardHeadBtnArea: 'card_head', //卡片表头按钮区域
|
||||
cardBodyBtnArea: 'card_body', //卡片表体按钮区域
|
||||
cardBodyInnerBtnArea: 'card_body_inner' //卡片表体操作按钮区域
|
||||
cardBodyInnerBtnArea: 'card_body_inner', //卡片表体操作按钮区域
|
||||
borrowMaterialDialog: 'NCTable_83c3abf9' //借料弹窗
|
||||
};
|
||||
const MANUFACTURE = 'fa';//製造場景
|
||||
|
||||
|
|
|
@ -104,5 +104,6 @@
|
|||
"5008Pickm-000102": "确定",
|
||||
"5008Pickm-000103": "自动匹配",
|
||||
"5008Pickm-000104": "自动匹配成功",
|
||||
"5008Pickm-000105": "是替代料的非关键料行,不可删除"
|
||||
"5008Pickm-000105": "是替代料的非关键料行,不可删除",
|
||||
"5008Pickm-000106": "借料数量必须大于0,请检查对应行数据"
|
||||
}
|
Loading…
Reference in New Issue