QA refactor
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d551389d3a
commit
f1c481de64
|
@ -84,20 +84,20 @@ module.exports = Self => {
|
||||||
: {or: [{'i.name': {like: `%${value}%`}}, codeWhere]};
|
: {or: [{'i.name': {like: `%${value}%`}}, codeWhere]};
|
||||||
case 'id':
|
case 'id':
|
||||||
return {'i.id': value};
|
return {'i.id': value};
|
||||||
case 'category':
|
|
||||||
return {'ic.name': value};
|
|
||||||
case 'salesPersonFk':
|
|
||||||
return {'t.workerFk': value};
|
|
||||||
case 'type':
|
|
||||||
return {'i.typeFk': value};
|
|
||||||
case 'isActive':
|
case 'isActive':
|
||||||
return {'i.isActive': value};
|
return {'i.isActive': value};
|
||||||
case 'multiplier':
|
case 'multiplier':
|
||||||
return {'i.stemMultiplier': value};
|
return {'i.stemMultiplier': value};
|
||||||
|
case 'typeFk':
|
||||||
|
return {'i.typeFk': value};
|
||||||
|
case 'category':
|
||||||
|
return {'ic.name': value};
|
||||||
|
case 'salesPersonFk':
|
||||||
|
return {'it.workerFk': value};
|
||||||
case 'origin':
|
case 'origin':
|
||||||
return {'ori.code': value};
|
return {'ori.code': value};
|
||||||
case 'niche':
|
case 'niche':
|
||||||
return {'itn.code': value};
|
return {'ip.code': value};
|
||||||
case 'intrastat':
|
case 'intrastat':
|
||||||
return {'intr.description': value};
|
return {'intr.description': value};
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,8 @@ module.exports = Self => {
|
||||||
let stmt;
|
let stmt;
|
||||||
|
|
||||||
stmt = new ParameterizedSQL(
|
stmt = new ParameterizedSQL(
|
||||||
`SELECT i.id,
|
`SELECT
|
||||||
|
i.id,
|
||||||
i.image,
|
i.image,
|
||||||
i.name,
|
i.name,
|
||||||
i.description,
|
i.description,
|
||||||
|
@ -121,30 +122,30 @@ module.exports = Self => {
|
||||||
i.tag10, i.value10,
|
i.tag10, i.value10,
|
||||||
i.subName,
|
i.subName,
|
||||||
i.isActive,
|
i.isActive,
|
||||||
t.name type,
|
|
||||||
i.typeFk as type,
|
|
||||||
t.workerFk buyerFk,
|
|
||||||
u.name userName,
|
|
||||||
intr.description AS intrastat,
|
|
||||||
i.stems,
|
i.stems,
|
||||||
ori.code AS origin,
|
|
||||||
ic.name AS category,
|
|
||||||
i.density,
|
i.density,
|
||||||
i.stemMultiplier,
|
i.stemMultiplier,
|
||||||
|
i.typeFk,
|
||||||
|
it.name AS typeName,
|
||||||
|
it.workerFk AS buyerFk,
|
||||||
|
u.name AS userName,
|
||||||
|
ori.code AS origin,
|
||||||
|
ic.name AS category,
|
||||||
|
intr.description AS intrastat,
|
||||||
b.grouping,
|
b.grouping,
|
||||||
b.packing,
|
b.packing,
|
||||||
itn.code AS niche, @visibleCalc
|
ip.code AS niche, @visibleCalc
|
||||||
FROM item i
|
FROM item i
|
||||||
LEFT JOIN itemType t ON t.id = i.typeFk
|
LEFT JOIN itemType it ON it.id = i.typeFk
|
||||||
LEFT JOIN itemCategory ic ON ic.id = t.categoryFk
|
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
|
||||||
LEFT JOIN worker w ON w.id = t.workerFk
|
LEFT JOIN worker w ON w.id = it.workerFk
|
||||||
LEFT JOIN account.user u ON u.id = w.userFk
|
LEFT JOIN account.user u ON u.id = w.userFk
|
||||||
LEFT JOIN intrastat intr ON intr.id = i.intrastatFk
|
LEFT JOIN intrastat intr ON intr.id = i.intrastatFk
|
||||||
LEFT JOIN producer pr ON pr.id = i.producerFk
|
LEFT JOIN producer pr ON pr.id = i.producerFk
|
||||||
LEFT JOIN origin ori ON ori.id = i.originFk
|
LEFT JOIN origin ori ON ori.id = i.originFk
|
||||||
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk
|
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = it.warehouseFk
|
||||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
LEFT JOIN itemPlacement itn ON itn.itemFk = i.id AND itn.warehouseFk = t.warehouseFk`
|
LEFT JOIN itemPlacement ip ON ip.itemFk = i.id AND ip.warehouseFk = it.warehouseFk`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ctx.args.tags) {
|
if (ctx.args.tags) {
|
||||||
|
|
|
@ -117,8 +117,7 @@
|
||||||
vn-one
|
vn-one
|
||||||
min="0"
|
min="0"
|
||||||
label="Multiplier"
|
label="Multiplier"
|
||||||
ng-model="$ctrl.item.stemMultiplier"
|
ng-model="$ctrl.item.stemMultiplier">
|
||||||
rule>
|
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
|
|
|
@ -5,107 +5,107 @@
|
||||||
model="model"
|
model="model"
|
||||||
class="vn-w-xl vn-mb-xl">
|
class="vn-w-xl vn-mb-xl">
|
||||||
<vn-card>
|
<vn-card>
|
||||||
<vn-table
|
<vn-table
|
||||||
model="model"
|
model="model"
|
||||||
show-fields="$ctrl.showFields"
|
show-fields="$ctrl.showFields"
|
||||||
vn-smart-table="itemIndex">
|
vn-smart-table="itemIndex">
|
||||||
<vn-thead>
|
<vn-thead>
|
||||||
<vn-tr>
|
<vn-tr>
|
||||||
<vn-th shrink></vn-th>
|
<vn-th shrink></vn-th>
|
||||||
<vn-th field="id" shrink>Id</vn-th>
|
<vn-th field="id" shrink>Id</vn-th>
|
||||||
<vn-th field="grouping" shrink>Grouping</vn-th>
|
<vn-th field="grouping" shrink>Grouping</vn-th>
|
||||||
<vn-th field="packing" shrink>Packing</vn-th>
|
<vn-th field="packing" shrink>Packing</vn-th>
|
||||||
<vn-th field="name">Description</vn-th>
|
<vn-th field="name">Description</vn-th>
|
||||||
<vn-th field="stems" shrink>Stems</vn-th>
|
<vn-th field="stems" shrink>Stems</vn-th>
|
||||||
<vn-th field="size" shrink>Size</vn-th>
|
<vn-th field="size" shrink>Size</vn-th>
|
||||||
<vn-th field="niche" shrink>Niche</vn-th>
|
<vn-th field="niche" shrink>Niche</vn-th>
|
||||||
<vn-th field="type" shrink>Type</vn-th>
|
<vn-th field="typeFk" shrink>Type</vn-th>
|
||||||
<vn-th field="category" shrink>Category</vn-th>
|
<vn-th field="category" shrink>Category</vn-th>
|
||||||
<vn-th field="intrastat" shrink>Intrastat</vn-th>
|
<vn-th field="intrastat" shrink>Intrastat</vn-th>
|
||||||
<vn-th field="origin" shrink>Origin</vn-th>
|
<vn-th field="origin" shrink>Origin</vn-th>
|
||||||
<vn-th field="salesperson" shrink>Buyer</vn-th>
|
<vn-th field="salesperson" shrink>Buyer</vn-th>
|
||||||
<vn-th field="density" shrink>Density</vn-th>
|
<vn-th field="density" shrink>Density</vn-th>
|
||||||
<vn-th field="stemMultiplier" shrink>Multiplier</vn-th>
|
<vn-th field="stemMultiplier" shrink>Multiplier</vn-th>
|
||||||
<vn-th field="active" shrink>Active</vn-th>
|
<vn-th field="active" shrink>Active</vn-th>
|
||||||
<vn-th></vn-th>
|
<vn-th></vn-th>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
<vn-tbody>
|
<vn-tbody>
|
||||||
<a ng-repeat="item in model.data"
|
<a ng-repeat="item in model.data"
|
||||||
class="clickable vn-tr search-result"
|
class="clickable vn-tr search-result"
|
||||||
ui-sref="item.card.summary({id: item.id})">
|
ui-sref="item.card.summary({id: item.id})">
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<img
|
<img
|
||||||
ng-src="{{::$root.imagePath('catalog', '50x50', item.id)}}"
|
ng-src="{{::$root.imagePath('catalog', '50x50', item.id)}}"
|
||||||
zoom-image="{{::$root.imagePath('catalog', '1600x900', item.id)}}"
|
zoom-image="{{::$root.imagePath('catalog', '1600x900', item.id)}}"
|
||||||
vn-click-stop
|
vn-click-stop
|
||||||
on-error-src/>
|
on-error-src/>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<span
|
<span
|
||||||
vn-click-stop="itemDescriptor.show($event, item.id)"
|
vn-click-stop="itemDescriptor.show($event, item.id)"
|
||||||
class="link">
|
class="link">
|
||||||
{{::item.id}}
|
{{::item.id}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>{{::item.grouping | dashIfEmpty}}</vn-td>
|
<vn-td shrink>{{::item.grouping | dashIfEmpty}}</vn-td>
|
||||||
<vn-td shrink>{{::item.packing | dashIfEmpty}}</vn-td>
|
<vn-td shrink>{{::item.packing | dashIfEmpty}}</vn-td>
|
||||||
<vn-td vn-fetched-tags>
|
<vn-td vn-fetched-tags>
|
||||||
<vn-one title="{{::item.name}}">{{::item.name}}</vn-one>
|
<vn-one title="{{::item.name}}">{{::item.name}}</vn-one>
|
||||||
<vn-one ng-if="::item.subName">
|
<vn-one ng-if="::item.subName">
|
||||||
<h3 title="{{::item.subName}}">{{::item.subName}}</h3>
|
<h3 title="{{::item.subName}}">{{::item.subName}}</h3>
|
||||||
</vn-one>
|
</vn-one>
|
||||||
<vn-fetched-tags
|
<vn-fetched-tags
|
||||||
max-length="6"
|
max-length="6"
|
||||||
item="item"
|
item="item"
|
||||||
tabindex="-1">
|
tabindex="-1">
|
||||||
</vn-fetched-tags>
|
</vn-fetched-tags>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>{{::item.stems}}</vn-td>
|
<vn-td shrink>{{::item.stems}}</vn-td>
|
||||||
<vn-td shrink>{{::item.size}}</vn-td>
|
<vn-td shrink>{{::item.size}}</vn-td>
|
||||||
<vn-td shrink>{{::item.niche}}</vn-td>
|
<vn-td shrink>{{::item.niche}}</vn-td>
|
||||||
<vn-td shrink title="{{::item.type}}">
|
<vn-td shrink title="{{::item.typeName}}">
|
||||||
{{::item.type}}
|
{{::item.typeName}}
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink title="{{::item.category}}">
|
<vn-td shrink title="{{::item.category}}">
|
||||||
{{::item.category}}
|
{{::item.category}}
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink title="{{::item.intrastat}}">
|
<vn-td shrink title="{{::item.intrastat}}">
|
||||||
{{::item.intrastat}}
|
{{::item.intrastat}}
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>{{::item.origin}}</vn-td>
|
<vn-td shrink>{{::item.origin}}</vn-td>
|
||||||
<vn-td shrink title="{{::item.userName}}">
|
<vn-td shrink title="{{::item.userName}}">
|
||||||
<span
|
<span
|
||||||
class="link"
|
class="link"
|
||||||
vn-click-stop="workerDescriptor.show($event, item.buyerFk)">
|
vn-click-stop="workerDescriptor.show($event, item.buyerFk)">
|
||||||
{{::item.userName}}
|
{{::item.userName}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>{{::item.density}}</vn-td>
|
<vn-td shrink>{{::item.density}}</vn-td>
|
||||||
<vn-td shrink >{{::item.stemMultiplier}}</vn-td>
|
<vn-td shrink >{{::item.stemMultiplier}}</vn-td>
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<vn-check
|
<vn-check
|
||||||
disabled="true"
|
disabled="true"
|
||||||
ng-model="::item.isActive">
|
ng-model="::item.isActive">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<vn-horizontal class="buttons">
|
<vn-horizontal class="buttons">
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
vn-click-stop="clone.show(item.id)"
|
vn-click-stop="clone.show(item.id)"
|
||||||
vn-tooltip="Clone"
|
vn-tooltip="Clone"
|
||||||
icon="icon-clone">
|
icon="icon-clone">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
vn-click-stop="$ctrl.preview(item)"
|
vn-click-stop="$ctrl.preview(item)"
|
||||||
vn-tooltip="Preview"
|
vn-tooltip="Preview"
|
||||||
icon="preview">
|
icon="preview">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
</a>
|
</a>
|
||||||
</vn-tbody>
|
</vn-tbody>
|
||||||
</vn-table>
|
</vn-table>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
</vn-data-viewer>
|
</vn-data-viewer>
|
||||||
<a ui-sref="item.create" vn-tooltip="New item" vn-bind="+" fixed-bottom-right>
|
<a ui-sref="item.create" vn-tooltip="New item" vn-bind="+" fixed-bottom-right>
|
||||||
|
@ -128,27 +128,30 @@
|
||||||
item="$ctrl.itemSelected">
|
item="$ctrl.itemSelected">
|
||||||
</vn-item-summary>
|
</vn-item-summary>
|
||||||
</vn-popup>
|
</vn-popup>
|
||||||
<vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model"
|
<vn-contextmenu
|
||||||
|
vn-id="contextmenu"
|
||||||
|
targets="['vn-data-viewer']"
|
||||||
|
model="model"
|
||||||
expr-builder="$ctrl.exprBuilder(param, value)">
|
expr-builder="$ctrl.exprBuilder(param, value)">
|
||||||
<slot-menu>
|
<slot-menu>
|
||||||
<vn-item translate
|
<vn-item translate
|
||||||
ng-if="contextmenu.isFilterAllowed()"
|
ng-if="contextmenu.isFilterAllowed()"
|
||||||
ng-click="contextmenu.filterBySelection()">
|
ng-click="contextmenu.filterBySelection()">
|
||||||
Filter by selection
|
Filter by selection
|
||||||
</vn-item>
|
</vn-item>
|
||||||
<vn-item translate
|
<vn-item translate
|
||||||
ng-if="contextmenu.isFilterAllowed()"
|
ng-if="contextmenu.isFilterAllowed()"
|
||||||
ng-click="contextmenu.excludeSelection()">
|
ng-click="contextmenu.excludeSelection()">
|
||||||
Exclude selection
|
Exclude selection
|
||||||
</vn-item>
|
</vn-item>
|
||||||
<vn-item translate
|
<vn-item translate
|
||||||
ng-if="contextmenu.isFilterAllowed()"
|
ng-if="contextmenu.isFilterAllowed()"
|
||||||
ng-click="contextmenu.removeFilter()" >
|
ng-click="contextmenu.removeFilter()">
|
||||||
Remove filter
|
Remove filter
|
||||||
</vn-item>
|
</vn-item>
|
||||||
<vn-item translate
|
<vn-item translate
|
||||||
ng-click="contextmenu.removeAllFilters()" >
|
ng-click="contextmenu.removeAllFilters()">
|
||||||
Remove all filters
|
Remove all filters
|
||||||
</vn-item>
|
</vn-item>
|
||||||
</slot-menu>
|
</slot-menu>
|
||||||
</vn-contextmenu>
|
</vn-contextmenu>
|
|
@ -16,7 +16,7 @@ class Controller extends Section {
|
||||||
case 'category':
|
case 'category':
|
||||||
return {'ic.name': value};
|
return {'ic.name': value};
|
||||||
case 'salesPersonFk':
|
case 'salesPersonFk':
|
||||||
return {'t.workerFk': value};
|
return {'it.workerFk': value};
|
||||||
case 'grouping':
|
case 'grouping':
|
||||||
return {'b.grouping': value};
|
return {'b.grouping': value};
|
||||||
case 'packing':
|
case 'packing':
|
||||||
|
@ -24,8 +24,8 @@ class Controller extends Section {
|
||||||
case 'origin':
|
case 'origin':
|
||||||
return {'ori.code': value};
|
return {'ori.code': value};
|
||||||
case 'niche':
|
case 'niche':
|
||||||
return {'itn.code': value};
|
return {'ip.code': value};
|
||||||
case 'type':
|
case 'typeFk':
|
||||||
return {'i.typeFk': value};
|
return {'i.typeFk': value};
|
||||||
case 'intrastat':
|
case 'intrastat':
|
||||||
return {'intr.description': value};
|
return {'intr.description': value};
|
||||||
|
|
Loading…
Reference in New Issue