Project

General

Profile

Support #1714 » PHRPA0048 - QualificationWeight.js

Tri Rizqiaty, 02/02/2023 05:35 PM

 
1
var me = this; var form = Ext.ComponentQuery.query('[name=mainformPerformance]')[0]; var form_ = form.getForm(); var data = form_.getValues(); var Sum = Ext.StoreMgr.lookup("storePHRPA0048"); var DataSum = Ext.encode(Ext.pluck(Sum.data.items, 'data')); var SumQualWeight = 0; var idx = Sum.getCount(); var data = ''; var QualificationWeight = Ext.ComponentQuery.query('[fieldGrid=QualificationWeight]')[0].getValue(); if (idx == 1) { if (QualificationWeight >= 100) { MinovaMessage('', 'PMSE006', '', 'E'); Ext.ComponentQuery.query('[fieldGrid=QualificationWeight]')[0].setValue(100); Sum.remove(idx, data); } } else { Ext.Array.each(Ext.decode(DataSum), function (rec) { if (parseFloat(rec.QualificationWeight) > 0) { SumQualWeight = parseFloat(SumQualWeight) + parseFloat(rec.QualificationWeight); } }); SumQualWeight = parseFloat(SumQualWeight) + parseFloat(val.value); if (SumQualWeight > 100) { MinovaMessage('', 'PMSE006', '', 'E'); Ext.ComponentQuery.query('[fieldGrid=QualificationWeight]')[0].setValue(0); Sum.remove(idx, data); } }
(10-10/10)