Compare commits
2 Commits
5ce7b64172
...
ebdfeb7a33
Author | SHA1 | Date |
---|---|---|
|
ebdfeb7a33 | |
|
2333e9555c |
|
@ -10,7 +10,7 @@ const AREA = {
|
|||
cardHeadBtnArea: 'card_head', //卡片表头按钮区域
|
||||
cardBodyBtnArea: 'card_body', //卡片表体按钮区域
|
||||
cardBodyInnerBtnArea: 'card_body_inner', //卡片表体操作按钮区域
|
||||
borrowMaterialDialog: 'NCTable_83c3abf9', //借料弹窗
|
||||
// borrowMaterialDialog: 'NCTable_83c3abf9', //借料弹窗
|
||||
borrowList: 'borrow_list', //借料弹窗页面编码
|
||||
BORROW_DLG: 'BorrowDlg' //借料入库
|
||||
};
|
||||
|
@ -259,6 +259,7 @@ const FIELD = {
|
|||
cbastunitid: 'cbastunitid',
|
||||
vbatchcode: 'vbatchcode',
|
||||
vsrcid: 'vsrcid', //来源单据id
|
||||
pk_group: 'pk_group', //集团
|
||||
};
|
||||
//表头不可修改字段
|
||||
const headDisableFields = [
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
import {AREA} from "../../../constance";
|
||||
import {AREA, FIELD} from "../../../constance";
|
||||
|
||||
export default async function headAfterEvent(props, moduleId, key, value, changedrows, i) {
|
||||
// let headData = props.editTable.getAllData(AREA.borrowList, true);
|
||||
// this.props.setHeadDatas(headData);
|
||||
// console.log('value = ', value);
|
||||
if (key == FIELD.vbatchcode) {
|
||||
if (value.length > 0) {
|
||||
let firstElement = value[0];
|
||||
let vbatchcode = firstElement.values.vbatchcode.value;
|
||||
let pk_batchcode = firstElement.values.pk_batchcode.value;
|
||||
props.editTable.setValByKeyAndIndex(moduleId, i, key, {value: vbatchcode, display: vbatchcode});
|
||||
props.editTable.setValByKeyAndIndex(moduleId, i, 'pk_batchcode', {value: pk_batchcode, display: null});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
import {FIELD} from "../../../constance";
|
||||
import {processBatchCodeItem} from "../../../../wr/card/util/batchCodeUtil";
|
||||
|
||||
export default function headBeforeEvent(props, moduleId, item, index, value, record) {
|
||||
let key = item.attrcode;
|
||||
let editFields = ['freplacetype'];
|
||||
let editFields = ['vbatchcode'];
|
||||
if (!editFields.includes(key)) {
|
||||
return false;
|
||||
} else if (key == 'freplacetype') {
|
||||
//以替代的备料计划表体不能修改替代类型
|
||||
let replaceInfo = props.editTable.getValByKeyAndIndex(moduleId, index, 'freplaceinfo').value;
|
||||
if (replaceInfo == 2) {
|
||||
} else if (key == FIELD.vbatchcode) {
|
||||
let cmaterialvid = props.editTable.getValByKeyAndIndex(moduleId, index, FIELD.cmaterialvid).value;
|
||||
//物料为空直接返回false 不可编辑
|
||||
if (!cmaterialvid) {
|
||||
toast({content: '缺少物料编码', color: 'warning'});
|
||||
return false;
|
||||
}
|
||||
processBatchCodeItem.call(this, props, moduleId, key, record, '4A', false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, {Component} from 'react';
|
|||
import {base, createPage, high} from 'nc-lightapp-front';
|
||||
import {initTemplate} from './init';
|
||||
import {initLang} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
|
||||
import {headAfterEvent} from './events';
|
||||
import {headAfterEvent, headBeforeEvent} from './events';
|
||||
import {DIALOGCODE, AREA} from "../../constance";
|
||||
|
||||
const {Refer} = high;
|
||||
|
@ -39,7 +39,7 @@ class PickmBorrowDlg extends Component {
|
|||
// height: 100,
|
||||
// onRowClick: this.onRowClick.bind(this),
|
||||
// onRowDoubleClick: this.onRowDoubleClick.bind(this),
|
||||
// onBeforeEvent: headBeforeEvent.bind(this),
|
||||
onBeforeEvent: headBeforeEvent.bind(this),
|
||||
onAfterEvent: headAfterEvent.bind(this),
|
||||
isAddRow: false,
|
||||
showCheck: true
|
||||
|
|
Loading…
Reference in New Issue