精密物料标志增加控制

This commit is contained in:
mzr 2025-10-25 11:43:51 +08:00
parent 45c1edf410
commit 0eca1cdd0f
1 changed files with 243 additions and 206 deletions

View File

@ -5,9 +5,11 @@
*/
const formid = 'materialstock';
const tableid = 'materialwarh';
import { output,ajax, base,toast,cardCache,promptBox,print } from 'nc-lightapp-front';
let {setDefData, getDefData } = cardCache;
import {ajax, cardCache, output, print, promptBox, toast} from 'nc-lightapp-front';
import updateModalButton from './updateModalButton'
let {setDefData, getDefData} = cardCache;
export function createStockCard(props, values, ensureCall) {
let {button, form} = props;
@ -30,7 +32,12 @@ export function createStockCard(props,values, ensureCall){
index = rows.length;
}
if (pk_org != pk_group) {
props.cardTable.addRow(tableid,index,{pk_org:{value:pk_org,display:org_name}});
props.cardTable.addRow(tableid, index, {
pk_org: {
value: pk_org,
display: org_name
}
});
props.cardTable.setEditableByIndex(tableid, index, 'pk_org', false);
}
if (pk_org == pk_group) {
@ -150,6 +157,18 @@ function onAfterEvent4STOCK(props, moduleId, key, value,oldValue){
props.form.setFormItemsDisabled(formid, {sernumunit: true});
props.form.setFormItemsValue(formid, {sernumunit: {value: null, display: null}});
}
} else if (key === 'def3') {
// 精密自定义字段控制 物料标志是def3,精密产品分类是def4
// console.log('def3', value.values)
let codeVal = value.values.code.value;
if (codeVal != '1') {
// 精密物料标志”如果不是“产品”,请将字段“产品分类”设置为空值
props.form.setFormItemsDisabled(formid, {def4: true});
props.form.setFormItemsValue(formid, {def4: {value: null, display: null}});
} else {
// “精密产品分类”这个控件默认为不可操作,只有控件“精密物料标志”为“产品”时,才允许修改
props.form.setFormItemsDisabled(formid, {def4: false})
}
}
}
@ -160,7 +179,10 @@ function onButtonClick4STOCK(ensureCall, props,id) {
let pk_orgp = props.form.getFormItemsValue(formid, 'pk_org').value
let pk_groupp = props.form.getFormItemsValue(formid, 'pk_group').value;
if (node_typep == 'ORG_NODE' && pk_orgp == pk_groupp) {
toast({content:props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-000013'),color:'warning'});/* 国际化处理: 组织节点只能维护当前节点有权限组织的数据!*/
toast({
content: props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-000013'),
color: 'warning'
});/* 国际化处理: 组织节点只能维护当前节点有权限组织的数据!*/
return;
}
@ -204,7 +226,7 @@ function onButtonClick4STOCK(ensureCall, props,id) {
meta['materialwarh'].items.forEach(item => {
if (item.attrcode === 'pk_org') {
item.queryCondition = {
GridRefActionExt: 'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType',
GridRefActionExt: 'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType',
orgType: 'orgtype9'
}
}
@ -278,12 +300,18 @@ function onButtonClick4STOCK(ensureCall, props,id) {
this.querychildclick('stock', true);
props.modal.close('stockmodal');
ensureCall && ensureCall("success");
toast({title:props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-000089'),color:'success'});/* 国际化处理: 保存成功*/
toast({
title: props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-000089'),
color: 'success'
});/* 国际化处理: 保存成功*/
}
}
});
}
props.validateToSave(reqData,saveFunction,{'materialstock':'form',"materialwarh":'cardTable'},'extcard');
props.validateToSave(reqData, saveFunction, {
'materialstock': 'form',
"materialwarh": 'cardTable'
}, 'extcard');
break;
case 'stock_delete':
promptBox({
@ -303,7 +331,10 @@ function onButtonClick4STOCK(ensureCall, props,id) {
},
success: (res) => {
if (res.success) {
toast({title:props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-000029')/* 国际化处理: 删除成功*/,color:'success'});
toast({
title: props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-000029')/* 国际化处理: 删除成功*/,
color: 'success'
});
this.querychildclick('stock', true);
props.cardTable.delRowByRowId('stock', getDefData('cacheRowid', props.config.datasource).stock);
props.modal.close('stockmodal');
@ -355,7 +386,10 @@ function onButtonClick4STOCK(ensureCall, props,id) {
} else {
props.cardTable.setTableData('materialwarh', {rows: []});
}
toast({title:props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-0000147'),color:'success'});/* 国际化处理: 刷新成功*/
toast({
title: props.MutiInit.getIntl("10140MATERIAL") && props.MutiInit.getIntl("10140MATERIAL").get('10140MATERIAL-0000147'),
color: 'success'
});/* 国际化处理: 刷新成功*/
}
}
});
@ -382,17 +416,20 @@ function onButtonClick4STOCK(ensureCall, props,id) {
this.state.printConfig.funcode = this.config.printcard.stock.funcode;
this.state.printConfig.nodekey = this.config.printcard.stock.nodekey;
this.state.oids = [_output_pk.value];
output({data:
output({
data:
Object.assign({
funcode: this.config.printcard.stock.funcode,
nodekey: this.config.printcard.stock.nodekey,
oids: [_output_pk.value],
outputType: "output"
},{}), url: props.config.printUrls['stock']});
}, {}), url: props.config.printUrls['stock']
});
// this.setState(this.state,
// this.refs.childPrintOutput.open());
break;
}
}
/*IxBctcow1BIGrqKmGp+9GGJGCX49SVZe5YUdOj8ujRA=*/