refactor(basicdata): order basicdata requires address and landed to show agencies
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
0de3755d09
commit
74a3b5cf89
|
@ -23,7 +23,6 @@
|
|||
show-field="name"
|
||||
value-field="id"
|
||||
ng-model="$ctrl.order.clientFk"
|
||||
on-change="$ctrl.getAvailableAgencies()"
|
||||
selection="$ctrl.selection"
|
||||
fields="['defaultAddressFk']">
|
||||
<tpl-item>{{::id}}: {{::name}}</tpl-item>
|
||||
|
@ -36,7 +35,8 @@
|
|||
search-function="$search"
|
||||
show-field="nickname"
|
||||
value-field="id"
|
||||
ng-model="$ctrl.order.addressFk">
|
||||
ng-model="$ctrl.order.addressFk"
|
||||
on-change="$ctrl.getAvailableAgencies()">
|
||||
<tpl-item>{{::nickname}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
|
@ -48,7 +48,7 @@
|
|||
on-change="$ctrl.getAvailableAgencies()">
|
||||
</vn-date-picker>
|
||||
<vn-autocomplete
|
||||
disabled="!$ctrl.order.clientFk || !$ctrl.order.landed"
|
||||
disabled="!$ctrl.order.addressFk || !$ctrl.order.landed"
|
||||
data="$ctrl._availableAgencies"
|
||||
label="Agency"
|
||||
show-field="agencyMode"
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('Order', () => {
|
|||
describe('getAvailableAgencies()', () => {
|
||||
it('should set agencyModeFk to null and get the available agencies if the order has landed and client', async() => {
|
||||
controller.order.agencyModeFk = 999;
|
||||
controller.order.clientFk = 999;
|
||||
controller.order.addressFk = 999;
|
||||
controller.order.landed = new Date();
|
||||
|
||||
const expectedAgencies = [{id: 1}, {id: 2}];
|
||||
|
|
Loading…
Reference in New Issue