2127 - Disable preview on sepa core sample
gitea/salix/2127-sample_disable_preview There was a failure building this commit
Details
gitea/salix/2127-sample_disable_preview There was a failure building this commit
Details
This commit is contained in:
parent
37773982dc
commit
d66c53dbf2
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE `vn`.`sample`
|
||||
ADD COLUMN `hasPreview` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' AFTER `hasCompany`,
|
||||
CHANGE COLUMN `isVisible` `isVisible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' ,
|
||||
CHANGE COLUMN `hasCompany` `hasCompany` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' ;
|
||||
|
||||
UPDATE `vn`.`sample` SET `hasPreview` = '0' WHERE (`id` = '14');
|
|
@ -22,7 +22,10 @@
|
|||
"type": "Boolean"
|
||||
},
|
||||
"hasCompany": {
|
||||
"type": "Number"
|
||||
"type": "Boolean"
|
||||
},
|
||||
"hasPreview": {
|
||||
"type": "Boolean"
|
||||
}
|
||||
},
|
||||
"scopes": {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<vn-autocomplete vn-one vn-id="sampleType"
|
||||
ng-model="$ctrl.clientSample.typeFk"
|
||||
model="ClientSample.typeFk"
|
||||
fields="['code','hasCompany']"
|
||||
fields="['code','hasCompany', 'hasPreview']"
|
||||
url="Samples/visible"
|
||||
show-field="description"
|
||||
value-field="id"
|
||||
|
@ -31,7 +31,7 @@
|
|||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
ng-model="$ctrl.companyId"
|
||||
model="ClientSample.companyId"
|
||||
model="ClientSample.companyFk"
|
||||
data="companiesData"
|
||||
show-field="code"
|
||||
value-field="id"
|
||||
|
@ -42,7 +42,10 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Send"></vn-submit>
|
||||
<vn-button label="Preview" ng-click="$ctrl.showPreview()"></vn-button>
|
||||
<vn-button ng-if="sampleType.selection.hasPreview"
|
||||
label="Preview"
|
||||
ng-click="$ctrl.showPreview()">
|
||||
</vn-button>
|
||||
<vn-button ui-sref="client.card.sample.index" label="Cancel"></vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
|
|
|
@ -26,13 +26,13 @@ class Controller extends Component {
|
|||
}
|
||||
|
||||
get companyId() {
|
||||
if (!this.clientSample.companyId)
|
||||
this.clientSample.companyId = this.vnConfig.companyFk;
|
||||
return this.clientSample.companyId;
|
||||
if (!this.clientSample.companyFk)
|
||||
this.clientSample.companyFk = this.vnConfig.companyFk;
|
||||
return this.clientSample.companyFk;
|
||||
}
|
||||
|
||||
set companyId(value) {
|
||||
this.clientSample.companyId = value;
|
||||
this.clientSample.companyFk = value;
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
|
@ -74,11 +74,11 @@ class Controller extends Component {
|
|||
if (!sampleType)
|
||||
return this.vnApp.showError(this.$translate.instant('Choose a sample'));
|
||||
|
||||
if (sampleType.hasCompany && !this.clientSample.companyId)
|
||||
if (sampleType.hasCompany && !this.clientSample.companyFk)
|
||||
return this.vnApp.showError(this.$translate.instant('Choose a company'));
|
||||
|
||||
if (sampleType.hasCompany)
|
||||
params.companyId = this.clientSample.companyId;
|
||||
params.companyId = this.clientSample.companyFk;
|
||||
|
||||
if (isPreview) params.isPreview = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue