export default {
    onBeforeEdit:({isNew,getFieldValue,setFieldValueByBatch,setFieldEditable})=>{
        if(!isNew){
            let qty = getFieldValue('QTY');
            let current = getFieldValue('CURRENT_QTY');
            let value = (qty?qty:0) + (current?current:0);

            const temps = [];
            temps.push({ field: 'TOTAL_QTY', value: value })
            setFieldValueByBatch(temps);
        }
      },
    onChange: ({ colInfo, getFieldValue, setFieldValueByBatch, dispatch }) => {
        if (colInfo.FIELD_NAME == 'QTY' || colInfo.INPUT_ID_FIELD == 'ENGERY_ID') {
            let qty = getFieldValue('QTY');
            let current = getFieldValue('CURRENT_QTY');
            let value = (qty?qty:0) + (current?current:0);

            const temps = [];
            temps.push({ field: 'TOTAL_QTY', value: value })
            setFieldValueByBatch(temps);
        }
    }
}