ebu_ecology_dev1/javascript/xuanran.wang/bme/js/DiaoBo.js

26 lines
957 B
JavaScript
Raw Permalink Normal View History

const zrckField = WfForm.convertFieldNameToId('zrck');
const zcckField = WfForm.convertFieldNameToId('zcck');
// 主表存货编码
const mainStockSetField = WfForm.convertFieldNameToId('chbmjh');
// 明细1存货编码字段
const deail1StockSetField = WfForm.convertFieldNameToId('chbm','detail_1');
jQuery(document).ready(function(){
WfForm.triggerFieldAllLinkage(zrckField);
WfForm.triggerFieldAllLinkage(zcckField);
initStockNo();
});
function initStockNo(){
var rowArr = WfForm.getDetailAllRowIndexStr("detail_1").split(",");
let arr = [];
for(var i=0; i<rowArr.length; i++){
var rowIndex = rowArr[i];
if(rowIndex !== ""){
let val = WfForm.getFieldValue(`${deail1StockSetField}_${rowIndex}`);
arr.push(val);
}
}
WfForm.changeFieldValue(mainStockSetField, {value:arr.join(',')});
setTimeout(()=>{
WfForm.triggerFieldAllLinkage(mainStockSetField);
},500);
}