fix(entry_latest-buys): fix multi_check
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
576cad16ad
commit
4a9c5742c0
|
@ -146,16 +146,17 @@ export default class MultiCheck extends FormInput {
|
||||||
if (!this.model || !this.model.data) return;
|
if (!this.model || !this.model.data) return;
|
||||||
|
|
||||||
const data = this.model.data;
|
const data = this.model.data;
|
||||||
const modelParams = this.model.userParams;
|
|
||||||
const params = {
|
const params = {
|
||||||
filter: {
|
filter: {
|
||||||
modelParams: modelParams,
|
|
||||||
limit: null
|
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.rows = data.length;
|
||||||
|
|
||||||
this.$http.get(this.model.url, {params})
|
this.$http.get(this.model.url, {params})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.allRowsCount = res.data.length;
|
this.allRowsCount = res.data.length;
|
||||||
|
|
|
@ -98,9 +98,6 @@ module.exports = Self => {
|
||||||
Self.latestBuysFilter = async(ctx, filter, options) => {
|
Self.latestBuysFilter = async(ctx, filter, options) => {
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
|
|
||||||
if (filter && filter.modelParams)
|
|
||||||
ctx.args = filter.modelParams;
|
|
||||||
|
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
|
|
@ -148,12 +148,12 @@
|
||||||
</td>
|
</td>
|
||||||
<td number>
|
<td number>
|
||||||
<vn-chip class="transparent" translate-attr="buy.groupingMode == 2 ? {title: 'Minimun amount'} : {title: 'Packing'}" ng-class="{'message': buy.groupingMode == 2}">
|
<vn-chip class="transparent" translate-attr="buy.groupingMode == 2 ? {title: 'Minimun amount'} : {title: 'Packing'}" ng-class="{'message': buy.groupingMode == 2}">
|
||||||
<span translate>{{::buy.packing | dashIfEmpty}}</span>
|
<span>{{::buy.packing | dashIfEmpty}}</span>
|
||||||
</vn-chip>
|
</vn-chip>
|
||||||
</td>
|
</td>
|
||||||
<td number>
|
<td number>
|
||||||
<vn-chip class="transparent" translate-attr="buy.groupingMode == 1 ? {title: 'Minimun amount'} : {title: 'Grouping'}" ng-class="{'message': buy.groupingMode == 1}">
|
<vn-chip class="transparent" translate-attr="buy.groupingMode == 1 ? {title: 'Minimun amount'} : {title: 'Grouping'}" ng-class="{'message': buy.groupingMode == 1}">
|
||||||
<span translate>{{::buy.grouping | dashIfEmpty}}</span>
|
<span>{{::buy.grouping | dashIfEmpty}}</span>
|
||||||
</vn-chip>
|
</vn-chip>
|
||||||
</td>
|
</td>
|
||||||
<td number>{{::buy.quantity}}</td>
|
<td number>{{::buy.quantity}}</td>
|
||||||
|
|
|
@ -159,8 +159,22 @@ export default class Controller extends Section {
|
||||||
lines: rowsToEdit
|
lines: rowsToEdit
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.checkedDummyCount && this.checkedDummyCount > 0)
|
if (this.checkedDummyCount && this.checkedDummyCount > 0) {
|
||||||
data.filter = this.$.model.userParams;
|
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)
|
return this.$http.post('Buys/editLatestBuys', data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
Loading…
Reference in New Issue