diff --git a/front/core/components/multi-check/multi-check.js b/front/core/components/multi-check/multi-check.js index 077c93360..041603f13 100644 --- a/front/core/components/multi-check/multi-check.js +++ b/front/core/components/multi-check/multi-check.js @@ -146,16 +146,17 @@ export default class MultiCheck extends FormInput { if (!this.model || !this.model.data) return; const data = this.model.data; - const modelParams = this.model.userParams; const params = { filter: { - modelParams: modelParams, limit: null } }; + if (this.model.userFilter) + Object.assign(params.filter, this.model.userFilter); + if (this.model.userParams) + Object.assign(params, this.model.userParams); this.rows = data.length; - this.$http.get(this.model.url, {params}) .then(res => { this.allRowsCount = res.data.length; diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index 9693670c8..6399faa52 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -98,9 +98,6 @@ module.exports = Self => { Self.latestBuysFilter = async(ctx, filter, options) => { const myOptions = {}; - if (filter && filter.modelParams) - ctx.args = filter.modelParams; - if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html index a4d6f7e83..adeda5e56 100644 --- a/modules/entry/front/latest-buys/index.html +++ b/modules/entry/front/latest-buys/index.html @@ -148,12 +148,12 @@ - {{::buy.packing | dashIfEmpty}} + {{::buy.packing | dashIfEmpty}} - {{::buy.grouping | dashIfEmpty}} + {{::buy.grouping | dashIfEmpty}} {{::buy.quantity}} diff --git a/modules/entry/front/latest-buys/index.js b/modules/entry/front/latest-buys/index.js index 44c29cb11..ec1109b81 100644 --- a/modules/entry/front/latest-buys/index.js +++ b/modules/entry/front/latest-buys/index.js @@ -159,8 +159,22 @@ export default class Controller extends Section { lines: rowsToEdit }; - if (this.checkedDummyCount && this.checkedDummyCount > 0) - data.filter = this.$.model.userParams; + if (this.checkedDummyCount && this.checkedDummyCount > 0) { + const params = {}; + if (this.$.model.userParams) { + const userParams = this.$.model.userParams; + for (let param in userParams) { + let newParam = this.exprBuilder(param, userParams[param]); + if (!newParam) + newParam = {[param]: userParams[param]}; + Object.assign(params, newParam); + } + } + if (this.$.model.userFilter) + Object.assign(params, this.$.model.userFilter.where); + + data.filter = params; + } return this.$http.post('Buys/editLatestBuys', data) .then(() => {