refs #5275 fix: si tenia valor el minPrice el checkbox siempre se marcaba. El checkbox no funcionaba cuando le pulsabas
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-03-28 09:41:39 +02:00
parent ec4b76a0f8
commit 06ac8f9910
3 changed files with 3 additions and 4 deletions

View File

@ -87,7 +87,7 @@ module.exports = Self => {
await targetItem.updateAttributes({ await targetItem.updateAttributes({
minPrice: args.minPrice, minPrice: args.minPrice,
hasMinPrice: args.minPrice ? true : false hasMinPrice: args.hasMinPrice
}, myOptions); }, myOptions);
const itemFields = [ const itemFields = [

View File

@ -140,7 +140,8 @@
<td shrink-field-expand class="minPrice"> <td shrink-field-expand class="minPrice">
<vn-check <vn-check
vn-one vn-one
ng-model="price.hasMinPrice"> ng-model="price.hasMinPrice"
on-change="$ctrl.upsertPrice(price)">
</vn-check> </vn-check>
<vn-input-number <vn-input-number
disabled="!price.hasMinPrice" disabled="!price.hasMinPrice"

View File

@ -66,8 +66,6 @@ export default class Controller extends Section {
if (resetMinPrice) if (resetMinPrice)
delete price['minPrice']; delete price['minPrice'];
price.hasMinPrice = price.minPrice ? true : false;
let requiredFields = ['itemFk', 'started', 'ended', 'rate2', 'rate3']; let requiredFields = ['itemFk', 'started', 'ended', 'rate2', 'rate3'];
for (let field of requiredFields) for (let field of requiredFields)
if (price[field] == undefined) return; if (price[field] == undefined) return;