[javascript] fasd
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- var submitterCheck = procVSync('_submitterCheck');
- //console.log('submitterChcek');
- //console.log(submitterCheck);
- varReadOn('company', function() {
- //console.log('_submitterCheck');
- //console.log(procVSync('_submitterCheck'));
- if (procVSync('_submitterCheck') == 'no') {
- //console.log('jsem true');
- return true;
- } else {
- return false;
- }
- //return procVSync('_submitterCheck') == 'yes'
- });
- /*
- varReadOn('company', function() {
- return procVSync('_submitterCheck') == 'no'
- });
- */
- /*
- if (submitterCheck === "yes") {
- varMustOn('company', function() {
- return procVSync('_submitterCheck') === "yes"
- });
- } else if (submitterCheck === "no"){
- varReadOn('company', function() {
- return procVSync('_submitterCheck') == 'no'
- });
- }
- */
- ///Zde je potřeba nejdříve dostat dyntable do té stránky pomocí getDyntable///
- this.getDynTable(vSync('_dtEntities'));
- var self = this;
- var _nazevDynTable1 = vSync('_dtEntities');
- changeVarVal(['companyAddress', 'headOffice', 'generalCostCentre', /*'identificationNumber'*/ ], true, function() {
- var company = vSync('company');
- if (company == undefined) {
- company = procVSync('company');
- }
- // pokud promenna company = readOnly tak TAS nevraci index, ale title, proto bereme ze self
- if (submitterCheck == "no") {
- var companyRow = _.find(self.props.processVars, 'ivar_name', 'company') || {};
- company = companyRow.ivar_dt_index;
- }
- if (company) {
- //console.log('jsem v company');
- //console.log(company);
- var addressCompanyRow = _.find(self.dynTable[_nazevDynTable1], 'dlv_index', company) || {};
- //var actualRow = _.find(self.dynTable[_nazevDynTable1], 'dlv_index', vSync('company'));
- //console.log(addressCompanyRow);
- return [addressCompanyRow.col_5, addressCompanyRow.col_14, addressCompanyRow.col_4, /* addressCompanyRow.col_11 */ ]
- }
- })
- ////rizeni dynamickych radku
- var compAbbr = vSync('_dtCompanyAbbrCopy');
- if (compAbbr == 'MIR-BASE') {
- hideVarOn(['reqItemsLabels', 'requestItemsClothes'], function() {
- return compAbbr == 'MIR-BASE'
- });
- } else if (compAbbr == 'MIR-LABEL') {
- hideVarOn(['requestItems', 'requestItemsClothes'], function() {
- return compAbbr == 'MIR-LABEL'
- });
- } else if (compAbbr == 'MIR-CLOTHES') {
- hideVarOn(['reqItemsLabels', 'requestItems'], function() {
- return compAbbr == 'MIR-CLOTHES'
- });
- }
- //////zobrazení obrázku pro marketing
- if (compAbbr == 'MIR-BASE') {
- this.getDynTable(vSync('_dtRequestsItems'));
- var dtRequestsItems = vSync('_dtRequestsItems');
- var self = this;
- //console.log("DT " + dtRequestsItems);
- changeVarVal('_picture', true, function() {
- var requestItems = vSync('requestItems');
- var lastItemName = requestItems.itemName[requestItems.itemName.length - 1];
- if (lastItemName) {
- lastItemName = lastItemName.value;
- if (lastItemName) {
- var lastItemIndex = lastItemName.value || lastItemName;
- if (lastItemIndex) {
- var actualRow = _.find(self.dynTable[dtRequestsItems], 'dlv_index', lastItemIndex);
- return actualRow.col_15;
- }
- }
- }
- })
- } else if (compAbbr == 'MIR-CLOTHES') {
- //dotazeni obrazku pro obleceni
- this.getDynTable(vSync('_dtRequestsItems'));
- var dtRequestsItems = vSync('_dtRequestsItems');
- var self = this;
- //console.log("DT " + dtRequestsItems);
- changeVarVal('_picture', true, function() {
- var requestItemsCloth = vSync('requestItemsClothes');
- var lastItemName = requestItemsCloth.itemName[requestItemsCloth.itemName.length - 1];
- if (lastItemName) {
- lastItemName = lastItemName.value;
- if (lastItemName) {
- var lastItemIndex = lastItemName.value || lastItemName;
- if (lastItemIndex) {
- var actualRow = _.find(self.dynTable[dtRequestsItems], 'dlv_index', lastItemIndex);
- return actualRow.col_15;
- }
- }
- }
- })
- } else if (compAbbr == 'MIR-LABEL') {
- this.getDynTable(vSync('_dtRequestsItems'));
- var dtRequestsItems = vSync('_dtRequestsItems');
- var self = this;
- //console.log("DT " + dtRequestsItems);
- changeVarVal('_picture', true, function() {
- var requestItemsLabel = vSync('reqItemsLabels');
- var lastItemName = requestItemsLabel.tpyLable[requestItemsLabel.tpyLable.length - 1];
- if (lastItemName) {
- lastItemName = lastItemName.value;
- if (lastItemName) {
- var lastItemIndex = lastItemName.value || lastItemName;
- if (lastItemIndex) {
- var actualRow = _.find(self.dynTable[dtRequestsItems], 'dlv_index', lastItemIndex);
- return actualRow.col_15;
- }
- }
- }
- })
- }
- /*
- //////////optimizace s lodash
- changeVarVal('_picture', true, function() {
- const requestItems = vSync('requestItems');
- const lastItem = _.last(requestItems.itemName);
- const lastItemIndex = _.get(lastItem, 'value') || _.get(lastItem, 'value.value');
- if (lastItemIndex) {
- const actualRow = _.find(self.dynTable[dtRequestsItems], 'dlv_index', lastItemIndex);
- return actualRow.col_15;
- }
- });
- */
Editor
You can edit this paste and save as new: