feat: item.descriptor en summary coge el warehouse por defecto
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
508bce73bc
commit
ba5616055b
|
@ -18,9 +18,6 @@
|
||||||
},
|
},
|
||||||
"expired": {
|
"expired": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
},
|
|
||||||
"warehouseFk": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scope": {
|
"scope": {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
ALTER TABLE `vn`.`itemConfig` ADD warehouseFk smallint(6) unsigned NULL;
|
||||||
|
UPDATE `vn`.`itemConfig`
|
||||||
|
SET warehouseFk=60
|
||||||
|
WHERE id=0;
|
|
@ -98,11 +98,9 @@ module.exports = Self => {
|
||||||
summary.tags = res[1];
|
summary.tags = res[1];
|
||||||
[summary.botanical] = res[2];
|
[summary.botanical] = res[2];
|
||||||
|
|
||||||
const userConfig = await models.UserConfig.getUserConfig(ctx, myOptions);
|
const itemConfig = await models.ItemConfig.findOne({where: {code: 'VNL'}}, myOptions);
|
||||||
console.log(userConfig.warehouseFk);
|
|
||||||
const company = await models.Company.findOne({where: {code: 'VNL'}}, myOptions);
|
res = await models.Item.getVisibleAvailable(summary.item.id, itemConfig.warehouseFk, undefined, myOptions);
|
||||||
console.log(company.warehouseFk);
|
|
||||||
res = await models.Item.getVisibleAvailable(summary.item.id, 1, undefined, myOptions);
|
|
||||||
|
|
||||||
summary.available = res.available;
|
summary.available = res.available;
|
||||||
summary.visible = res.visible;
|
summary.visible = res.visible;
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
},
|
},
|
||||||
"defaultTag": {
|
"defaultTag": {
|
||||||
"type": "int"
|
"type": "int"
|
||||||
|
},
|
||||||
|
"warehouseFk": {
|
||||||
|
"type": "int"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<vn-portal slot="menu">
|
<vn-portal slot="menu">
|
||||||
<vn-item-descriptor
|
<vn-item-descriptor
|
||||||
warehouse-fk="$ctrl.getWarehouseFk()"
|
warehouse-fk="$ctrl.warehouseFk"
|
||||||
item="$ctrl.item"
|
item="$ctrl.item"
|
||||||
card-reload="$ctrl.reload()"></vn-item-descriptor>
|
card-reload="$ctrl.reload()"></vn-item-descriptor>
|
||||||
<vn-left-menu source="card"></vn-left-menu>
|
<vn-left-menu source="card"></vn-left-menu>
|
||||||
|
|
|
@ -3,14 +3,21 @@ import ModuleCard from 'salix/components/module-card';
|
||||||
|
|
||||||
class Controller extends ModuleCard {
|
class Controller extends ModuleCard {
|
||||||
getWarehouseFk() {
|
getWarehouseFk() {
|
||||||
if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary')
|
if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary') {
|
||||||
return this.$params.warehouseFk;
|
this.warehouseFk = this.$params.warehouseFk;
|
||||||
return this.vnConfig.warehouseFk;
|
return;
|
||||||
|
}
|
||||||
|
this.$http.get('ItemConfigs/findOne')
|
||||||
|
.then(res => {
|
||||||
|
this.warehouseFk = res.data.warehouseFk;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
this.$http.get(`Items/${this.$params.id}/getCard`)
|
this.$http.get(`Items/${this.$params.id}/getCard`)
|
||||||
.then(res => this.item = res.data);
|
.then(res => this.item = res.data);
|
||||||
|
|
||||||
|
this.getWarehouseFk();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue