2020-09-21 12:10:15 +00:00
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
2019-11-07 10:19:05 +00:00
|
|
|
url="Companies"
|
|
|
|
data="companiesData"
|
|
|
|
order="code">
|
|
|
|
</vn-crud-model>
|
2020-09-17 18:12:52 +00:00
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="Samples/visible"
|
2022-09-26 06:07:45 +00:00
|
|
|
fields="[
|
2023-09-21 11:15:00 +00:00
|
|
|
'id',
|
2022-09-26 06:07:45 +00:00
|
|
|
'code',
|
2023-09-21 11:15:00 +00:00
|
|
|
'description',
|
2022-09-26 06:07:45 +00:00
|
|
|
'model',
|
|
|
|
'hasCompany',
|
2023-10-03 08:15:16 +00:00
|
|
|
'hasAddress',
|
2022-09-26 06:07:45 +00:00
|
|
|
'hasPreview',
|
|
|
|
'datepickerEnabled'
|
|
|
|
]"
|
2020-09-17 18:12:52 +00:00
|
|
|
data="samplesVisible"
|
|
|
|
order="description">
|
|
|
|
</vn-crud-model>
|
2018-07-31 09:08:22 +00:00
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
2020-03-09 08:00:03 +00:00
|
|
|
url="ClientSamples"
|
2018-07-31 09:08:22 +00:00
|
|
|
data="$ctrl.clientSample"
|
2020-03-09 08:00:03 +00:00
|
|
|
insert-mode="true"
|
|
|
|
form="form">
|
2018-07-31 09:08:22 +00:00
|
|
|
</vn-watcher>
|
2020-03-09 08:00:03 +00:00
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="Companies"
|
|
|
|
data="companiesData"
|
|
|
|
order="code">
|
|
|
|
</vn-crud-model>
|
2019-11-10 10:08:44 +00:00
|
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-card class="vn-pa-lg">
|
2021-07-20 07:09:46 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-autocomplete
|
|
|
|
vn-id="sampleType"
|
|
|
|
ng-model="$ctrl.clientSample.typeFk"
|
|
|
|
model="ClientSample.typeFk"
|
|
|
|
data="samplesVisible"
|
|
|
|
show-field="description"
|
2022-10-04 07:39:42 +00:00
|
|
|
label="Sample"
|
|
|
|
required="true">
|
2021-07-20 07:09:46 +00:00
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
2018-07-31 09:08:22 +00:00
|
|
|
<vn-horizontal>
|
2020-03-09 08:00:03 +00:00
|
|
|
<vn-textfield
|
2019-11-04 12:55:20 +00:00
|
|
|
label="Recipient"
|
2020-02-18 10:14:02 +00:00
|
|
|
ng-model="$ctrl.clientSample.recipient"
|
2021-07-20 07:09:46 +00:00
|
|
|
info="Its only used when sample is sent"
|
|
|
|
required="true">
|
2019-11-04 12:55:20 +00:00
|
|
|
</vn-textfield>
|
2021-04-07 11:09:53 +00:00
|
|
|
<vn-textfield
|
|
|
|
label="Reply to"
|
|
|
|
ng-model="$ctrl.clientSample.replyTo"
|
2021-07-20 07:09:46 +00:00
|
|
|
info="To who should the recipient reply?"
|
|
|
|
required="true">
|
2021-04-07 11:09:53 +00:00
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
2021-07-20 07:09:46 +00:00
|
|
|
<vn-horizontal ng-if="sampleType.selection.hasCompany || sampleType.selection.datepickerEnabled">
|
2020-03-09 08:00:03 +00:00
|
|
|
<vn-autocomplete
|
2019-11-07 10:19:05 +00:00
|
|
|
ng-model="$ctrl.companyId"
|
2020-02-26 13:30:30 +00:00
|
|
|
model="ClientSample.companyFk"
|
2019-11-07 10:19:05 +00:00
|
|
|
data="companiesData"
|
2018-07-31 09:08:22 +00:00
|
|
|
show-field="code"
|
2023-09-21 11:15:00 +00:00
|
|
|
label="Company"
|
|
|
|
ng-if="sampleType.selection.hasCompany"
|
|
|
|
required="true">
|
|
|
|
</vn-autocomplete>
|
2023-10-03 08:15:16 +00:00
|
|
|
<vn-autocomplete
|
2023-10-05 12:01:07 +00:00
|
|
|
ng-if="sampleType.selection.id == 20"
|
2023-10-03 08:15:16 +00:00
|
|
|
vn-one
|
|
|
|
required="true"
|
2023-09-22 04:08:07 +00:00
|
|
|
data="$ctrl.addresses"
|
2023-10-03 08:15:16 +00:00
|
|
|
label="Address"
|
2023-09-22 04:08:07 +00:00
|
|
|
show-field="nickname"
|
|
|
|
value-field="id"
|
2023-10-03 08:15:16 +00:00
|
|
|
ng-model="$ctrl.addressId"
|
|
|
|
model="ClientSample.addressFk"
|
|
|
|
order="isActive DESC">
|
|
|
|
<tpl-item class="address" ng-class="::{inactive: !isActive}">
|
|
|
|
<span class="inactive" translate>{{::!isActive ? '(Inactive)' : ''}}</span>
|
|
|
|
{{::nickname}}
|
|
|
|
<span ng-show="city || province || street">
|
|
|
|
, {{::street}}, {{::city}}, {{::province.name}} - {{::agencyMode.name}}
|
|
|
|
</span>
|
|
|
|
</tpl-item>
|
|
|
|
<append>
|
|
|
|
<vn-icon-button
|
|
|
|
ui-sref="client.card.address.edit({id: $ctrl.clientId, addressId: $ctrl.addressId})"
|
|
|
|
icon="edit"
|
|
|
|
vn-tooltip="Edit address">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
|
|
|
</vn-autocomplete>
|
2021-07-20 07:09:46 +00:00
|
|
|
<vn-date-picker
|
|
|
|
vn-one
|
|
|
|
label="From"
|
|
|
|
ng-model="$ctrl.clientSample.from"
|
2021-07-20 09:07:04 +00:00
|
|
|
ng-if="sampleType.selection.datepickerEnabled"
|
|
|
|
required="true">
|
2021-07-20 07:09:46 +00:00
|
|
|
</vn-date-picker>
|
2018-07-31 09:08:22 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
2020-12-13 13:57:42 +00:00
|
|
|
<vn-submit
|
2022-10-04 07:39:42 +00:00
|
|
|
disabled="!sampleType.selection"
|
2020-12-13 13:57:42 +00:00
|
|
|
label="Send">
|
|
|
|
</vn-submit>
|
|
|
|
<vn-button
|
2022-10-04 07:39:42 +00:00
|
|
|
disabled="!sampleType.selection.hasPreview"
|
2023-09-21 11:15:00 +00:00
|
|
|
label="Preview"
|
2022-09-22 13:44:35 +00:00
|
|
|
ng-click="$ctrl.preview()">
|
2020-02-26 13:30:30 +00:00
|
|
|
</vn-button>
|
2020-12-13 13:57:42 +00:00
|
|
|
<vn-button
|
2020-12-15 15:51:36 +00:00
|
|
|
class="cancel"
|
|
|
|
label="Cancel"
|
|
|
|
ui-sref="client.card.sample.index">
|
2020-12-13 13:57:42 +00:00
|
|
|
</vn-button>
|
2018-07-31 09:08:22 +00:00
|
|
|
</vn-button-bar>
|
|
|
|
</form>
|
|
|
|
<vn-dialog
|
|
|
|
vn-id="show-preview"
|
|
|
|
on-open="$ctrl.onPreviewOpen()">
|
2019-11-11 11:26:22 +00:00
|
|
|
<tpl-body class="client-sample-dialog">
|
2019-11-06 07:20:45 +00:00
|
|
|
<div class="loading">
|
|
|
|
<vn-spinner enable="true"></vn-spinner>
|
|
|
|
</div>
|
|
|
|
</tpl-body>
|
2018-07-31 09:08:22 +00:00
|
|
|
</vn-dialog>
|