1. CalcType по умолчанию указывать при фильтрации списка
2. Почему сбрасывается Продукт после создания КП?
This commit is contained in:
parent
6d95498924
commit
d9eb74ff17
@ -178,8 +178,11 @@ export default function ($calculation: ICalculationStore) {
|
||||
* в поле "Доступные Методы расчета в калькуляторе" evo_calculation_method в selectProduct
|
||||
*/
|
||||
reaction(
|
||||
() => $calculation.getOption('selectProduct'),
|
||||
product => {
|
||||
() => $calculation.values.product,
|
||||
productId => {
|
||||
const product = $calculation.getOption('selectProduct', {
|
||||
evo_id: productId,
|
||||
});
|
||||
if (product?.evo_calculation_method) {
|
||||
$calculation.setFilter('radioCalcType', calcType =>
|
||||
calcType.filter(x =>
|
||||
@ -187,7 +190,14 @@ export default function ($calculation: ICalculationStore) {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
$calculation.setFilter('radioCalcType', () => []);
|
||||
/**
|
||||
* Это фильтр по-умолчанию
|
||||
* TODO: Добавить его в дефолтные фильтры
|
||||
*/
|
||||
$calculation.setFilter('radioCalcType', calcType =>
|
||||
calcType.filter(x => [100_000_000, 100_000_001].includes(x.value)),
|
||||
);
|
||||
$calculation.setValue('calcType', 100_000_000);
|
||||
}
|
||||
},
|
||||
{ fireImmediately: true },
|
||||
@ -201,9 +211,10 @@ export default function ($calculation: ICalculationStore) {
|
||||
* связанный с оquote.evo_baseproductid из поля Предложение selectQuote по связи evo_evo_baseproduct_evo_baseproduct
|
||||
*/
|
||||
reaction(
|
||||
() => $calculation.getOption('selectQuote'),
|
||||
quote => {
|
||||
() => $calculation.values.quote,
|
||||
quoteid => {
|
||||
if ($calculation.getValue('recalcWithRevision')) {
|
||||
const quote = $calculation.getOption('selectQuote', { quoteid });
|
||||
const quote_product = $calculation.getOption('selectProduct', {
|
||||
evo_baseproductid: quote?.evo_baseproductid,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user