{"version":3,"sources":["webpack:///./src/models/ListRequest.ts","webpack:///./src/views/User/CreateRecipeCost.vue?e379","webpack:///./src/views/User/CreateRecipeCost.vue","webpack:///./src/views/User/CreateRecipeCost.vue?4cd4","webpack:///./src/views/User/CreateRecipeCost.vue?747a","webpack:///./src/views/User/CreateRecipeCost.vue?7c27","webpack:///./src/utils/API/RecipesRepository.ts","webpack:///./src/views/User/CreateRecipeCost.vue?76fc"],"names":["OrderType","ListRequest","_createClass","listRequestOptions","restaurantId","_classCallCheck","this","queryOptions","render","_vm","_c","_self","_setupProxy","staticClass","attrs","$store","getters","getUserDetails","staticStyle","require","_v","_s","translations","get","recipe","name","Math","round","servings","toFixed","on","$event","preventDefault","openAddIngredientCostModal","apply","arguments","_l","recipeIngredientCosts","recipeIngredientCost","key","ingredient","id","quantity","measurement","directives","rawName","value","ingredientCostVendorId","expression","$$selectedVal","Array","prototype","filter","call","target","options","o","selected","map","val","_value","$set","multiple","vendors","vendor","domProps","ingredientCostId","getIngredientCostsForVendor","itemSelected","formatNumber","calculateCostForRecipeIngredientCost","weightInGrams","costPerGram","subRecipeCosts","subRecipeCost","recipeName","totalCost","totalRecipeCost","costPerYield","$router","push","params","concat","$route","saveRecipeCost","addingIngredientCostModal","isOpen","class","errors","has","ingredientCost","composing","first","_e","vendorId","openAddVendorModal","chosenMeasurementName","ingredientCostMeasurements","openAddMeasurementModal","cost","saveIngredientCost","addingVendorModal","addingVendorName","saveIngredientCostVendor","addingMeasurementModal","newMeasurements","index","weight","removeMeasurementRow","length","addNewMeasurementRow","addNewMeasurement","staticRenderFns","vSelect2","RecipeCostComponent","_Vue","_this","getEmptyRecipe","ingredientCosts","allIngredientCosts","massMeasurements","ingrCostIndex","_inherits","find","x","ingredientCostName","measurementWeightInGram","ingrCostPerGram","recIngrCost","number","_this2","$validator","validateAll","then","result","$snotify","async","Promise","success","reject","IngredientCostRepository","createIngredientCosts","response","loadAllIngredientCosts","body","catch","error","getErrorMessage","closeOnClick","timeout","_this3","splice","setTimeout","getEmptyIngredientCost","_this4","reqData","page","pageSize","filters","orders","listIngredientCost","res","data","_this5","loadMeasurementsForIngredientCost","measurements","shift","getEmptyMeasurment","_this6","ingrCost","measurementNames","includes","_this7","createIngredientCostVendor","loadIngredientCostVendors","_this8","listIngredientCostVendors","valid","i","_this9","allIngredinsValid","recipeIngrCosts","recipeIngredientId","RecipeCostRepository","createRecipeCost","recipeId","date","notification","description","instructions","recipeCategory","nutritionAnalysis","addedSugarPerServing","unadjustedAddedSugarPerServing","sugarAlcohols","alcoholSugarDv","ironDv","iron","calciumDv","calcium","potassiumDv","potassium","vitaminDDv","vitaminD","vitaminC","sodiumDv","sodium","cholesterol","cholesterolDv","protein","sugarsDv","sugars","fibreDv","fibre","carbohydrate","carbohydrateDv","transFatDv","transFat","saturatedFatDv","saturatedFat","fatDv","fat","calories","erythritol","isomalt","mannitol","xylitol","lactitol","sorbitol","maltitol","unspecified","servingWeight","saturatedAndTransDv","servingQuantityInUnitOfMeasurement","servingUnitOfMeasurement","ingredients","childRecipes","servingCount","servingWeightMeasurement","recipeServingType","weightPerServing","addedSugars","exactAddedSugars","adjustedAddedSugarsValue","_toConsumableArray","_this10","RecipesRepository","getRecipeDetails","parseInt","mapNutritions","listRecipeCostsForSubrecipes","_this11","subrecipeId","recipeCostServings","searchable","searchString","sortable","total","parseFloat","totalPerYield","localizationState","_this12","dispatch","TRANSLATIONS_FETCH","category","collections","document","title","errorMessages","userVisibleMessage","MeasurementRepository","listMeasurementsForCategory","MeasurementCategory","Mass","conversionCoeficient","Vue","__decorate","Component","components","vBreadcrumbs","vModal","vAutocomplete","computed","_objectSpread","mapState","state","LocalizationModule","component","resource","createRecipeCategory","Repository","post","withCredentials","listRecipeCategories","deleteRecipeCategory","listRecipes","listRequest","createRecipe","deleteRecipe","udateRecipe","updateRecipe","searchSubRecipes","searchRecipes","renameCategory","updateCategory","moveRecipesToCategory","filterRecipesNames","recipesSearchTerm","recipeSearchTerm","calculate","recCalc","copyRecipe","saveRecipeLabel","getRecipeLabel","deleteRecipes","listRestaurantRecipesAsLookups","listCookingMethods","listFoodGroupClasses","listFoodGroupSubClasses","updateRecipeFoodClassifications","updateRecipeServingSize","updateCaloriesCalculationMethod","hasRecipeWithIngredientsFromSpecificDatabase","nutrientSource","listRecipesThatUseIngredient","ingredientId"],"mappings":"0hCACO,IAAKA,E,oEAAZ,SAAYA,GACRA,IAAA,gBAAKA,IAAA,kBADT,CAAYA,MAAS,KAEpB,IAqBoBC,EAAWC,GAI5B,SAAAD,EAAYE,EAAwCC,GAAqBC,EAAA,KAAAJ,GACrEK,KAAKC,aAAeJ,EACpBG,KAAKF,aAAeA,M,kCC9B5B,W,kECAA,IAAII,EAAS,WAAkB,IAAIC,EAAIH,KAAKI,EAAGD,EAAIE,MAAMD,GAAUD,EAAIE,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACG,YAAY,wBAAwB,CAACH,EAAG,MAAM,CAACG,YAAY,WAAW,CAACH,EAAG,eAAe,CAACI,MAAM,CAAC,YAAcL,EAAIM,OAAOC,QAAQC,kBAAkBP,EAAG,MAAM,CAACG,YAAY,sCAAsC,CAACH,EAAG,MAAM,CAACG,YAAY,OAAO,CAACH,EAAG,MAAM,CAACG,YAAY,aAAa,CAACH,EAAG,KAAK,CAACA,EAAG,MAAM,CAACG,YAAY,2BAA2BK,YAAY,CAAC,MAAQ,QAAQJ,MAAM,CAAC,IAAMK,EAAQ,QAAiD,IAAM,MAAMV,EAAIW,GAAG,iBAAiBX,EAAIY,GAAGZ,EAAIa,aAAaC,IAAI,8BAA8B,mBAAmBb,EAAG,QAAQ,CAACD,EAAIW,GAAGX,EAAIY,GAAGZ,EAAIa,aAAaC,IAAI,+CAA+Cb,EAAG,MAAM,CAACG,YAAY,sCAAsC,CAACH,EAAG,MAAM,CAACG,YAAY,qCAAqC,CAACH,EAAG,MAAM,CAACG,YAAY,eAAe,CAACH,EAAG,IAAI,CAACG,YAAY,aAAaK,YAAY,CAAC,YAAY,OAAO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OAAI8M,EAAQ,uBAAuB,CAAEI,iBAAiB,KAE/EyB,qBAAoB,WAChB,OAAO3B,OAAW3Q,IAAI,GAAD2D,OAAI8M,EAAQ,yBAAyB,CAAEI,iBAAiB,KAEjF0B,wBAAuB,SAAC5J,GACpB,OAAOgI,OAAWC,KAAK,GAADjN,OAAI8M,EAAQ,4BAA4B9H,EAAM,CAAEkI,iBAAiB,KAE3F2B,gCAA+B,SAAC7J,GAC5B,OAAOgI,OAAWC,KAAK,GAADjN,OAAI8M,EAAQ,oCAAoC9H,EAAM,CAAEkI,iBAAiB,KAEnG4B,wBAAuB,SAAC9J,GACpB,OAAOgI,OAAWC,KAAK,GAADjN,OAAI8M,EAAQ,4BAA4B9H,EAAM,CAAEkI,iBAAiB,KAE3F6B,gCAA+B,SAAC/J,GAC5B,OAAOgI,OAAWC,KAAK,GAADjN,OAAI8M,EAAQ,6BAA6B9H,EAAM,CAAEkI,iBAAiB,KAE5F8B,6CAA4C,SAACC,GACzC,OAAOjC,OAAWC,KAAK,GAADjN,OAAI8M,EAAQ,iDAAiD,CAAEmC,eAAgBA,GAAkB,CAAE/B,iBAAiB,KAE9IgC,6BAA4B,SAACC,GACzB,OAAOnC,OAAW3Q,IAAI,GAAD2D,OAAI8M,EAAQ,+CAAA9M,OAA8CmP,GAAgB,CAAEjC,iBAAiB,O,kCCjG1H","file":"js/chunk-6b1b98c6.0747cb41.js","sourcesContent":["\r\nexport enum OrderType {\r\n Asc, Desc,\r\n}\r\n\r\nexport interface Ordering {\r\n field: string;\r\n orderType: OrderType;\r\n}\r\n\r\nexport interface Filter {\r\n name: string;\r\n value: string;\r\n}\r\n\r\nexport interface ListRequestOptions {\r\n page?: number;\r\n pageSize?: number;\r\n filters?: Filter[];\r\n orders?: Ordering[];\r\n searchTerm?: string;\r\n\r\n}\r\n\r\nexport default class ListRequest {\r\n public queryOptions: ListRequestOptions;\r\n public restaurantId?: number;\r\n\r\n constructor(listRequestOptions: ListRequestOptions, restaurantId?: number) {\r\n this.queryOptions = listRequestOptions;\r\n this.restaurantId = restaurantId;\r\n }\r\n}\r\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CreateRecipeCost.vue?vue&type=style&index=0&id=5bcda7d8&prod&scoped=true&lang=css\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"page-content-wrapper\"},[_c('div',{staticClass:\"content\"},[_c('vBreadcrumbs',{attrs:{\"userDetails\":_vm.$store.getters.getUserDetails}}),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-md-12\"},[_c('h2',[_c('img',{staticClass:\"img-thumbnail img-circle\",staticStyle:{\"width\":\"75px\"},attrs:{\"src\":require(\"../../assets/Customer/assets/img/rec-cost.png\"),\"alt\":\"\"}}),_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-calculate-header\"))+\":\\n \"),_c('small',[_vm._v(_vm._s(_vm.translations.get(\"rec-cost-create-recipe-subtitle\")))])])])])]),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"card card-default brown lighten-5\"},[_c('div',{staticClass:\"card-header\"},[_c('p',{staticClass:\"card-title\",staticStyle:{\"font-size\":\"12px\",\"margin-bottom\":\"8px\"}},[_c('span',{staticStyle:{\"font-weight\":\"bold\"}},[_vm._v(_vm._s(_vm.translations.get(\"rec-cost-table-name\"))+\":\")]),_c('span',{staticStyle:{\"margin-left\":\"10px\"}},[_vm._v(_vm._s(_vm.recipe.name))])]),_c('p',{staticClass:\"card-title\",staticStyle:{\"margin-left\":\"150px\",\"font-size\":\"12px\",\"margin-bottom\":\"8px\"}},[_c('span',{staticStyle:{\"font-weight\":\"bold\"}},[_vm._v(_vm._s(_vm.translations.get(\"rec-cost-serving-size\"))+\":\")]),_c('span',{staticStyle:{\"margin-left\":\"10px\"}},[_vm._v(_vm._s((Math.round(_vm.recipe.servings * 100) / 100).toFixed(2)))])])])])]),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"card card-default brown lighten-5\"},[_c('div',{staticClass:\"card-header\"},[_c('h4',{staticClass:\"card-title\"},[_vm._v(_vm._s(_vm.translations.get(\"recipe-costing\")))]),_c('a',{staticClass:\"pull-right\",staticStyle:{\"margin-right\":\"21px\",\"cursor\":\"pointer\",\"margin-top\":\"-12px\",\"margin-bottom\":\"-10px\",\"color\":\"#0288d1 !important\",\"opacity\":\"1\"},on:{\"click\":function($event){$event.preventDefault();return _vm.openAddIngredientCostModal.apply(null, arguments)}}},[_vm._v(\"+ \"+_vm._s(_vm.translations.get(\"rec-cost-add-ingr-btn\")))])]),_c('div',{staticClass:\"card-body no-pad-top\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-md-12\"},[_c('table',{staticClass:\"table\"},[_c('thead',{staticStyle:{\"background-color\":\"#0288d1\"}},[_c('tr',[_c('th',[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr-cost-table-quantity\"))+\"\\n \")]),_c('th',[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr-cost-table-measurement\"))+\"\\n \")]),_c('th',[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-table-ingredient\"))+\"\\n \")]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-vendor\")))]),_c('th',[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-table-search-ingr\"))+\"\\n \")]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-cost\")))])])]),_c('tbody',[_vm._l((_vm.recipeIngredientCosts),function(recipeIngredientCost){return _c('tr',{key:'ingredient' + recipeIngredientCost.ingredient.id},[_c('td',[_vm._v(_vm._s(recipeIngredientCost.quantity))]),_c('td',[_vm._v(_vm._s(recipeIngredientCost.measurement.name))]),_c('td',[_vm._v(_vm._s(recipeIngredientCost.ingredient.name))]),_c('td',[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(recipeIngredientCost.ingredientCostVendorId),expression:\"recipeIngredientCost.ingredientCostVendorId\"}],staticClass:\"form-control\",staticStyle:{\"width\":\"70%\",\"display\":\"inline-block\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(recipeIngredientCost, \"ingredientCostVendorId\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.vendors),function(vendor){return _c('option',{key:'vendor' + vendor.id,domProps:{\"value\":vendor.id}},[_vm._v(\"\\n \"+_vm._s(vendor.name)+\"\\n \")])}),0)]),_c('td',[_c('vAutocomplete',{attrs:{\"value\":recipeIngredientCost.ingredientCostId,\"placeholder\":'Enter ingredient search term...',\"displayProp\":'name',\"valueProp\":'id',\"bag\":recipeIngredientCost,\"items\":_vm.getIngredientCostsForVendor(\n recipeIngredientCost.ingredientCostVendorId\n )},on:{\"update:value\":function($event){return _vm.$set(recipeIngredientCost, \"ingredientCostId\", $event)},\"itemSelected\":_vm.itemSelected}})],1),_c('td',[_c('span',[_vm._v(_vm._s(_vm.formatNumber(\n _vm.calculateCostForRecipeIngredientCost(\n recipeIngredientCost.quantity,\n recipeIngredientCost.measurement.weightInGrams,\n recipeIngredientCost.costPerGram\n )\n )))])])])}),_vm._l((_vm.subRecipeCosts),function(subRecipeCost){return _c('tr',{key:'sub-recipe' + subRecipeCost.id},[_c('td',[_vm._v(_vm._s(subRecipeCost.servings))]),_c('td',{staticStyle:{\"text-transform\":\"lowercase\"}},[_vm._v(\"\\n \"+_vm._s(subRecipeCost.servings > 1\n ? _vm.translations.get(\"rec_servings\")\n : _vm.translations.get(\"rec_serving\"))+\"\\n \")]),_c('td',[_vm._v(_vm._s(subRecipeCost.recipeName))]),_c('td',[_c('div',{staticClass:\"recipe-db-title\"},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec_title\"))+\"\\n \")])]),_c('td'),_c('td',[_c('span',[_vm._v(_vm._s(subRecipeCost.totalCost.toFixed(2)))])])])})],2)])])])]),_c('div',{staticClass:\"row\",staticStyle:{\"margin-right\":\"20px\",\"margin-left\":\"20px\",\"margin-top\":\"-20px\",\"background\":\"#f5f5f5\"}},[_c('div',{staticClass:\"col\",staticStyle:{\"text-align\":\"right\",\"margin-right\":\"24px\"}},[_c('p',{staticStyle:{\"font-size\":\"16px\",\"margin-right\":\"24px\",\"margin-top\":\"12px\"}},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-total-cost\"))+\":\\n \"),_c('span',{staticStyle:{\"font-weight\":\"bold\"},domProps:{\"innerHTML\":_vm._s(_vm.totalRecipeCost())}})]),_c('p',{staticStyle:{\"font-size\":\"16px\",\"margin-right\":\"24px\"}},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-total-yield\"))+\":\\n \"),_c('span',{staticStyle:{\"font-weight\":\"bold\"},domProps:{\"innerHTML\":_vm._s(_vm.costPerYield)}})])])]),_c('br'),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-12 col-md-4\"},[_c('a',{staticStyle:{\"text-align\":\"left\",\"color\":\"#0288d1\",\"cursor\":\"pointer\",\"margin-left\":\"25px\"},on:{\"click\":function($event){$event.preventDefault();return _vm.$router.push({\n name: 'recipesEdit',\n params: { id: `${_vm.$route.params.id}` },\n })}}},[_c('i',{staticClass:\"fa fa-arrow-left\"}),_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-back-page\"))+\"\\n \")])]),_c('div',{staticClass:\"col-md-8 col-12\"},[_c('form',{staticClass:\"form-inline pull-right export\",staticStyle:{\"margin-bottom\":\"10px\"}},[_c('button',{staticClass:\"btn btn-primary\",staticStyle:{\"margin-right\":\"20px\"},on:{\"click\":function($event){$event.preventDefault();return _vm.saveRecipeCost.apply(null, arguments)}}},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"rec-cost-calc-save-btn\"))+\"\\n \")])])])])])]),_c('vModal',{attrs:{\"show\":_vm.addingIngredientCostModal.isOpen,\"modalTitle\":_vm.translations.get('ingr-cost-add-modal-title'),\"size\":'l'},on:{\"cancelModal\":function($event){_vm.addingIngredientCostModal.isOpen = false}}},[_c('form',{attrs:{\"data-vv-scope\":\"ingredientCost\"}},[_c('table',{staticClass:\"table\"},[_c('thead',{staticStyle:{\"background-color\":\"#0288d1\",\"text-align\":\"left\"}},[_c('tr',[_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-name\")))]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-vendor\")))]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-quantity\")))]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-measurement\")))]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-cost\")))])])]),_c('tbody',{staticStyle:{\"text-align\":\"left\"}},[_c('tr',[_c('td',[_c('div',{staticClass:\"form-group form-group-default required\",class:{\n 'has-error': _vm.errors.has(\n 'ingredientCost.ingredientCostName'\n ),\n }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.ingredientCost.name),expression:\"ingredientCost.name\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",attrs:{\"placeholder\":_vm.translations.get('ingr-cost-table-name'),\"name\":'ingredientCostName',\"data-vv-as\":_vm.translations.get('ingr-cost-table-name')},domProps:{\"value\":(_vm.ingredientCost.name)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.ingredientCost, \"name\", $event.target.value)}}}),(_vm.errors.has('ingredientCost.ingredientCostName'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first(\"ingredientCost.ingredientCostName\")))]):_vm._e()])]),_c('td',[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.ingredientCost.vendorId),expression:\"ingredientCost.vendorId\"}],staticClass:\"form-control\",staticStyle:{\"display\":\"inline-block\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(_vm.ingredientCost, \"vendorId\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.vendors),function(vendor){return _c('option',{key:'vendor' + vendor.id,domProps:{\"value\":vendor.id}},[_vm._v(\"\\n \"+_vm._s(vendor.name)+\"\\n \")])}),0),_c('a',{staticStyle:{\"position\":\"absolute\",\"margin-top\":\"11px\",\"margin-left\":\"4px\"},attrs:{\"title\":\"Add Supplier\"},on:{\"click\":function($event){$event.preventDefault();return _vm.openAddVendorModal.apply(null, arguments)}}},[_c('i',{staticClass:\"fa fa-plus\",staticStyle:{\"color\":\"#0288d1\",\"font-size\":\"18px\"}})])]),_c('td',[_c('div',{staticClass:\"form-group form-group-default required\",class:{\n 'has-error': _vm.errors.has(\n 'ingredientCost.ingredientCostQuantity'\n ),\n }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.ingredientCost.quantity),expression:\"ingredientCost.quantity\"},{name:\"validate\",rawName:\"v-validate\",value:('required|decimal'),expression:\"'required|decimal'\"}],staticClass:\"form-control\",attrs:{\"placeholder\":_vm.translations.get('ingr-cost-table-quantity'),\"name\":'ingredientCostQuantity',\"data-vv-as\":_vm.translations.get('ingr-cost-table-quantity')},domProps:{\"value\":(_vm.ingredientCost.quantity)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.ingredientCost, \"quantity\", $event.target.value)}}}),(_vm.errors.has('ingredientCost.ingredientCostQuantity'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first(\"ingredientCost.ingredientCostQuantity\")))]):_vm._e()])]),_c('td',[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.ingredientCost.chosenMeasurementName),expression:\"ingredientCost.chosenMeasurementName\"}],staticClass:\"form-control\",staticStyle:{\"width\":\"50%\",\"display\":\"inline-block\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(_vm.ingredientCost, \"chosenMeasurementName\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.ingredientCost.ingredientCostMeasurements),function(measurement){return _c('option',{key:'measurement' + measurement.id,domProps:{\"value\":measurement.name}},[_vm._v(\"\\n \"+_vm._s(measurement.name)+\"\\n \")])}),0),_c('a',{staticStyle:{\"position\":\"absolute\",\"margin-top\":\"11px\",\"margin-left\":\"4px\"},attrs:{\"title\":\"Add Measurement\"},on:{\"click\":function($event){$event.preventDefault();return _vm.openAddMeasurementModal.apply(null, arguments)}}},[_c('i',{staticClass:\"fa fa-plus\",staticStyle:{\"color\":\"#0288d1\",\"font-size\":\"18px\"}})])]),_c('td',[_c('div',{staticClass:\"form-group form-group-default required\",class:{\n 'has-error': _vm.errors.has(\n 'ingredientCost.ingredientCostCost'\n ),\n }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.ingredientCost.cost),expression:\"ingredientCost.cost\"},{name:\"validate\",rawName:\"v-validate\",value:('required|decimal'),expression:\"'required|decimal'\"}],staticClass:\"form-control\",attrs:{\"placeholder\":_vm.translations.get('ingr-cost-table-cost'),\"name\":'ingredientCostCost',\"data-vv-as\":_vm.translations.get('ingr-cost-table-cost')},domProps:{\"value\":(_vm.ingredientCost.cost)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.ingredientCost, \"cost\", $event.target.value)}}}),(_vm.errors.has('ingredientCost.ingredientCostCost'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first(\"ingredientCost.ingredientCostCost\")))]):_vm._e()])])])])])]),_c('button',{staticClass:\"btn btn-primary pull-right\",staticStyle:{\"margin-top\":\"30px\"},on:{\"click\":function($event){$event.preventDefault();return _vm.saveIngredientCost.apply(null, arguments)}}},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr-cost-save-modal-btn\"))+\"\\n \")])]),_c('vModal',{attrs:{\"show\":_vm.addingVendorModal.isOpen,\"modalTitle\":_vm.translations.get('ingr-cost-add-vendor-modal-title'),\"size\":'s'},on:{\"cancelModal\":function($event){_vm.addingVendorModal.isOpen = false}}},[_c('form',{attrs:{\"data-vv-scope\":\"vendor\"}},[_c('div',{staticClass:\"form-group form-group-default required\",class:{ 'has-error': _vm.errors.has('vendor.vendorName') }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.addingVendorName),expression:\"addingVendorName\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",attrs:{\"name\":\"vendorName\",\"placeholder\":_vm.translations.get('ingr-cost-table-vendor'),\"data-vv-as\":_vm.translations.get('ingr-cost-table-vendor')},domProps:{\"value\":(_vm.addingVendorName)},on:{\"input\":function($event){if($event.target.composing)return;_vm.addingVendorName=$event.target.value}}}),(_vm.errors.has('vendor.vendorName'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first(\"vendor.vendorName\")))]):_vm._e()])]),_c('button',{staticClass:\"btn btn-primary pull-right\",staticStyle:{\"margin-top\":\"30px\"},on:{\"click\":function($event){$event.preventDefault();return _vm.saveIngredientCostVendor.apply(null, arguments)}}},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr-cost-save-vendor-modal-btn\"))+\"\\n \")])]),_c('vModal',{attrs:{\"show\":_vm.addingMeasurementModal.isOpen,\"modalTitle\":_vm.translations.get('ingr-cost-measurement-modal-title'),\"size\":'m'},on:{\"cancelModal\":function($event){_vm.addingMeasurementModal.isOpen = false}}},[_c('form',{staticStyle:{\"max-height\":\"400px\",\"overflow\":\"auto\"},attrs:{\"data-vv-scope\":\"measurement\"}},[_c('table',{staticClass:\"table\"},[_c('thead',{staticStyle:{\"background-color\":\"#0288d1\",\"text-align\":\"left\"}},[_c('tr',[_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-table-measurement\")))]),_c('th',[_vm._v(_vm._s(_vm.translations.get(\"ingr-cost-weight-grams\")))]),_c('th'),_c('th')])]),_c('tbody',{staticStyle:{\"text-align\":\"center\"}},_vm._l((_vm.addingMeasurementModal.newMeasurements),function(measurement,index){return _c('tr',{key:'new-measurement-' + index},[_c('td',[_c('div',{staticClass:\"form-group form-group-default required\",class:{\n 'has-error': _vm.errors.has(\n 'measurement.measurementName' + index\n ),\n }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(measurement.name),expression:\"measurement.name\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",attrs:{\"placeholder\":_vm.translations.get('ingr-cost-table-measurement'),\"name\":'measurementName' + index,\"data-vv-as\":_vm.translations.get('ingr-cost-table-measurement')},domProps:{\"value\":(measurement.name)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(measurement, \"name\", $event.target.value)}}}),(_vm.errors.has('measurement.measurementName' + index))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first(\"measurement.measurementName\" + index)))]):_vm._e()])]),_c('td',[_c('div',{staticClass:\"form-group form-group-default required\",class:{\n 'has-error': _vm.errors.has(\n 'measurement.measurementWeight' + index\n ),\n }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(measurement.weight),expression:\"measurement.weight\"},{name:\"validate\",rawName:\"v-validate\",value:('required|decimal'),expression:\"'required|decimal'\"}],staticClass:\"form-control\",attrs:{\"name\":'measurementWeight' + index,\"data-vv-as\":_vm.translations.get('ingr-cost-weight-grams')},domProps:{\"value\":(measurement.weight)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(measurement, \"weight\", $event.target.value)}}}),(_vm.errors.has('measurement.measurementWeight' + index))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first(\"measurement.measurementWeight\" + index)))]):_vm._e()])]),_c('td',[_c('a',{attrs:{\"href\":\"#\",\"title\":\"Delete Measurement\"},on:{\"click\":function($event){$event.preventDefault();return _vm.removeMeasurementRow(index)}}},[_c('i',{staticClass:\"fa fa-trash\",staticStyle:{\"color\":\"#0288d1\",\"font-size\":\"20px\",\"margin-top\":\"6px\"}})])]),(\n index === _vm.addingMeasurementModal.newMeasurements.length - 1\n )?_c('td',[_c('a',{attrs:{\"href\":\"#\",\"title\":\"Add New Row\"},on:{\"click\":function($event){$event.preventDefault();return _vm.addNewMeasurementRow.apply(null, arguments)}}},[_c('i',{staticClass:\"fa fa-plus-circle\",staticStyle:{\"color\":\"#0288d1\",\"font-size\":\"20px\",\"margin-top\":\"6px\"}})])]):_vm._e()])}),0)])]),_c('button',{staticClass:\"btn btn-primary pull-right\",staticStyle:{\"margin-top\":\"30px\"},on:{\"click\":function($event){$event.preventDefault();return _vm.addNewMeasurement.apply(null, arguments)}}},[_vm._v(\"\\n \"+_vm._s(_vm.translations.get(\"ingr-cost-add-measurement-save\"))+\"\\n \")])])],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { Component, Vue, Prop } from \"vue-property-decorator\";\r\nimport vBreadcrumbs from \"@/components/vBreadcrumbs.vue\";\r\nimport vTable from \"@/components/vTable.vue\";\r\nimport vModal from \"@/components/vModal.vue\";\r\nimport { Snotify } from \"vue-snotify\";\r\nimport { mapState } from \"vuex\";\r\nimport { TRANSLATIONS_FETCH } from \"@/store/ActionTypes\";\r\nimport ListRequest, { Ordering, Filter, OrderType } from \"@/models/ListRequest\";\r\nimport SystemConfigurationRepository from \"../../utils/API/SystemConfigurationRepository\";\r\nimport {\r\n shorten,\r\n round,\r\n toCamelCase,\r\n getErrorMessage,\r\n mapNutritions,\r\n} from \"@/utils/Helpers\";\r\nimport { IngredientCost } from \"@/models/IngredientCost/IngredientCost\";\r\nimport { IngredientCostMeasurement } from \"@/models/IngredientCost/IngredientCostMeasurement\";\r\nimport { RecipeCost } from \"@/models/RecipeCost/RecipeCost\";\r\nimport { Recipe } from \"@/models/Recipes/Recipe\";\r\nimport { RecipeIngredientCost } from \"@/models/RecipeCost/RecipeIngredientCost\";\r\nimport RecipeCostRepository from \"@/utils/API/RecipeCostRepository\";\r\nimport { Vendor } from \"@/models/IngredientCost/Vendor\";\r\nimport { ServingSizeMeasurement } from \"@/models/Measurement/ServingSizeMeasurement\";\r\nimport { MeasurementCategory } from \"@/models/Measurement/MeasurementCategory\";\r\nimport IngredientCostRepository from \"@/utils/API/IngredientCostRepository\";\r\nimport { dateDisplayFormat, dateTimeDisplayFormat } from \"@/utils/Defaults\";\r\nimport MeasurementRepository from \"../../utils/API/MeasurementRepository\";\r\nimport RecipesRepository from \"@/utils/API/RecipesRepository\";\r\nimport vAutocomplete from \"@/components/vAutocomplete.vue\";\r\n\r\nconst vSelect2 = () => import(\"@/components/vSelect2.vue\");\r\n\r\n@Component({\r\n components: {\r\n vBreadcrumbs,\r\n vModal,\r\n vSelect2,\r\n vAutocomplete,\r\n },\r\n computed: {\r\n ...mapState({\r\n localizationState: (state: any) => state.LocalizationModule,\r\n }),\r\n },\r\n})\r\nclass RecipeCostComponent extends Vue {\r\n localizationState: any;\r\n\r\n recipe: Recipe = this.getEmptyRecipe();\r\n recipeIngredientCosts: any[] = [];\r\n subRecipeCosts: any[] = [];\r\n\r\n ingredientCosts: IngredientCost[] = [];\r\n ingredientCost: any = {};\r\n allIngredientCosts: any[] = [];\r\n newIngredientCost: any;\r\n massMeasurements: any[] = [];\r\n vendors: any[] = [];\r\n addingVendorName: string = \"\";\r\n\r\n addingIngredientCostModal = {\r\n isOpen: false,\r\n };\r\n\r\n addingVendorModal = {\r\n isOpen: false,\r\n };\r\n\r\n addingMeasurementModal = {\r\n ingredientCostId: null,\r\n isOpen: false,\r\n newMeasurements: [],\r\n ingrCostIndex: -1,\r\n };\r\n\r\n itemSelected(ingredientCost: any, recipeIngredientCost: any) {\r\n if (recipeIngredientCost.ingredientCostId) {\r\n ingredientCost = this.allIngredientCosts.find(\r\n (x) => x.id == recipeIngredientCost.ingredientCostId\r\n );\r\n if (ingredientCost) {\r\n recipeIngredientCost.ingredientCostName = ingredientCost.name;\r\n recipeIngredientCost.costPerGram = ingredientCost.costPerGram;\r\n } else {\r\n recipeIngredientCost.ingredientCostName = \"\";\r\n recipeIngredientCost.costPerGram = 0;\r\n }\r\n }\r\n }\r\n\r\n // Calculate cost for recipe ingredient cost\r\n calculateCostForRecipeIngredientCost(\r\n quantity: number,\r\n measurementWeightInGram: number,\r\n ingrCostPerGram: number\r\n ) {\r\n return quantity * measurementWeightInGram * ingrCostPerGram;\r\n }\r\n\r\n vendorForRecipeIngredientCostChanged(recIngrCost: any) {\r\n var ingredientCostsForVendor = this.getIngredientCostsForVendor(\r\n recIngrCost.ingredientCostVendorId\r\n );\r\n recIngrCost.ingredientCostId = null;\r\n recIngrCost.costPerGram = 0;\r\n }\r\n\r\n formatNumber(number: number) {\r\n return (Math.round(number * 100) / 100).toFixed(2);\r\n }\r\n\r\n // Save ingredient cost button modal\r\n saveIngredientCost() {\r\n this.$validator.validateAll(\"ingredientCost\").then((result) => {\r\n if (result) {\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\"ingr-cost-loading\"),\r\n () =>\r\n new Promise((success, reject) => {\r\n IngredientCostRepository.createIngredientCosts([\r\n this.ingredientCost,\r\n ])\r\n .then((response) => {\r\n this.addingIngredientCostModal.isOpen = false;\r\n this.loadAllIngredientCosts();\r\n success({\r\n body: this.translations.get(\"ingr-cost-save-success\"),\r\n });\r\n })\r\n .catch((error) => {\r\n reject({\r\n body: getErrorMessage(error, this.translations),\r\n });\r\n });\r\n }),\r\n { closeOnClick: true, timeout: 3500 }\r\n );\r\n }\r\n });\r\n }\r\n\r\n // Remove measurement row\r\n removeMeasurementRow(index: any) {\r\n this.addingMeasurementModal.newMeasurements.splice(index, 1);\r\n setTimeout(() => {\r\n this.$validator.validateAll(\"measurement\");\r\n }, 300);\r\n }\r\n\r\n // Open Add ingredient cost modal\r\n openAddIngredientCostModal() {\r\n this.ingredientCost = this.getEmptyIngredientCost();\r\n this.addingIngredientCostModal.isOpen = true;\r\n }\r\n\r\n loadAllIngredientCosts() {\r\n var reqData = new ListRequest({\r\n page: 1,\r\n pageSize: 9999,\r\n filters: [],\r\n orders: [],\r\n });\r\n IngredientCostRepository.listIngredientCost(reqData).then(\r\n (res) => {\r\n this.allIngredientCosts = res.data.result;\r\n },\r\n (error) => {}\r\n );\r\n }\r\n\r\n // Open Add measurement modal\r\n openAddMeasurementModal() {\r\n this.addingMeasurementModal.newMeasurements.length = 0;\r\n this.addingMeasurementModal.isOpen = true;\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\"ingr-cost-loading\"),\r\n () =>\r\n new Promise((success, reject) => {\r\n IngredientCostRepository.loadMeasurementsForIngredientCost({\r\n id: null,\r\n name: this.ingredientCost.name,\r\n measurements: this.ingredientCost.ingredientCostMeasurements,\r\n })\r\n .then((response) => {\r\n if (response.data.result && response.data.result.length > 0) {\r\n this.addingMeasurementModal.newMeasurements.shift();\r\n }\r\n // @ts-ignore\r\n response.data.result.map((x) => {\r\n this.addingMeasurementModal.newMeasurements.push({\r\n // @ts-ignore\r\n name: x.name,\r\n // @ts-ignore\r\n weight: (Math.round(x.weightInGrams * 100) / 100).toFixed(2),\r\n });\r\n });\r\n success({\r\n body: this.translations.get(\"ingr-cost-save-success\"),\r\n });\r\n })\r\n .catch((error) => {\r\n reject({\r\n body: getErrorMessage(error, this.translations),\r\n });\r\n });\r\n }),\r\n {\r\n timeout: 1000,\r\n closeOnClick: true,\r\n }\r\n );\r\n\r\n // @ts-ignore\r\n this.addingMeasurementModal.newMeasurements.push(this.getEmptyMeasurment());\r\n }\r\n\r\n // Open Add vendor modal\r\n openAddVendorModal() {\r\n this.addingVendorModal.isOpen = true;\r\n }\r\n\r\n // Add new measurement\r\n addNewMeasurement() {\r\n this.$validator.validateAll(\"measurement\").then((result) => {\r\n if (result) {\r\n // @ts-ignore\r\n var ingrCost = this.ingredientCost;\r\n // @ts-ignore\r\n var measurementNames = ingrCost.ingredientCostMeasurements.map(\r\n // @ts-ignore\r\n (x) => x.name\r\n );\r\n this.addingMeasurementModal.newMeasurements.map((x) => {\r\n // @ts-ignore\r\n if (!measurementNames.includes(x.name)) {\r\n ingrCost.ingredientCostMeasurements.push({\r\n // @ts-ignore\r\n name: x.name,\r\n // @ts-ignore\r\n weightInGrams: x.weight,\r\n });\r\n }\r\n return x;\r\n });\r\n this.addingMeasurementModal.isOpen = false;\r\n }\r\n });\r\n }\r\n\r\n // Add new vendor\r\n saveIngredientCostVendor() {\r\n this.$validator.validateAll(\"vendor\").then((result) => {\r\n if (result) {\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\"ingr-cost-loading\"),\r\n () =>\r\n new Promise((success, reject) => {\r\n IngredientCostRepository.createIngredientCostVendor(\r\n this.addingVendorName\r\n )\r\n .then((response) => {\r\n this.addingVendorModal.isOpen = false;\r\n this.loadIngredientCostVendors();\r\n this.addingVendorName = \"\";\r\n success({\r\n body: this.translations.get(\"ingr-cost-vendor-success\"),\r\n });\r\n })\r\n .catch((error) => {\r\n reject({\r\n body: getErrorMessage(error, this.translations),\r\n });\r\n });\r\n }),\r\n {\r\n timeout: 3500,\r\n closeOnClick: true,\r\n }\r\n );\r\n }\r\n });\r\n }\r\n\r\n // Add new row in new ingredien costs modal\r\n addNewMeasurementRow() {\r\n // @ts-ignore\r\n this.addingMeasurementModal.newMeasurements.push(this.getEmptyMeasurment());\r\n }\r\n\r\n // Load list of ingredient cost Vendors\r\n loadIngredientCostVendors() {\r\n IngredientCostRepository.listIngredientCostVendors()\r\n .then((response) => {\r\n var vendors = response.data.result.map((x: any) => {\r\n return {\r\n id: x.id,\r\n name: x.name,\r\n };\r\n });\r\n this.vendors = vendors;\r\n })\r\n .catch((error) => {\r\n this.$snotify.error(getErrorMessage(error, this.translations));\r\n });\r\n }\r\n\r\n allIngredinsValid() {\r\n var valid = true;\r\n for (var i = 0; i < this.recipeIngredientCosts.length; i++) {\r\n if (this.recipeIngredientCosts[i].ingredientCostId == null) {\r\n valid = false;\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n // Save recipe cost button\r\n saveRecipeCost() {\r\n if (!this.allIngredinsValid()) {\r\n this.$snotify.error(\r\n this.translations.get(\"rec-cost-valid-recipe-ingr-costs\")\r\n );\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\"ingr-cost-loading\"),\r\n () =>\r\n new Promise((success, reject) => {\r\n var recipeIngrCosts = this.recipeIngredientCosts.map((x) => {\r\n return {\r\n ingredientCostId: x.ingredientCostId,\r\n recipeIngredientId: x.recipeIngredientId,\r\n };\r\n });\r\n RecipeCostRepository.createRecipeCost({\r\n // @ts-ignore\r\n recipeId: this.recipe.id,\r\n recipeIngredientCosts: recipeIngrCosts,\r\n })\r\n // @ts-ignore\r\n .then((response) => {\r\n this.$router.push({\r\n name: \"updateRecipeCost\",\r\n params: { id: response.data.result },\r\n });\r\n success({\r\n body: this.translations.get(\"rec-cost-save-success\"),\r\n });\r\n })\r\n // @ts-ignore\r\n .catch((error) => {\r\n reject({\r\n body: getErrorMessage(error, this.translations),\r\n });\r\n });\r\n }),\r\n { closeOnClick: true, timeout: 3500 }\r\n );\r\n }\r\n\r\n // Empty ingredient cost json\r\n getEmptyRecipeCost() {\r\n return {\r\n name: \"\",\r\n cost: 0,\r\n date: \"\",\r\n notification: \"\",\r\n };\r\n }\r\n\r\n // Empty measurement json\r\n getEmptyMeasurment() {\r\n return {\r\n name: \"\",\r\n weight: null,\r\n };\r\n }\r\n\r\n // Empty recipe\r\n getEmptyRecipe() {\r\n return {\r\n id: 0,\r\n name: \"\",\r\n description: \"\",\r\n instructions: \"\",\r\n recipeCategory: { id: -1, name: \"\" },\r\n nutritionAnalysis: {\r\n addedSugarPerServing: 0,\r\n unadjustedAddedSugarPerServing: 0,\r\n sugarAlcohols: 0,\r\n alcoholSugarDv: 0,\r\n ironDv: 0,\r\n iron: 0,\r\n calciumDv: 0,\r\n calcium: 0,\r\n potassiumDv: 0,\r\n potassium: 0,\r\n vitaminDDv: 0,\r\n vitaminD: 0,\r\n vitaminC: 0,\r\n sodiumDv: 0,\r\n sodium: 0,\r\n cholesterol: 0,\r\n cholesterolDv: 0,\r\n protein: 0,\r\n sugarsDv: 0,\r\n sugars: 0,\r\n fibreDv: 0,\r\n fibre: 0,\r\n carbohydrate: 0,\r\n carbohydrateDv: 0,\r\n transFatDv: 0,\r\n transFat: 0,\r\n saturatedFatDv: 0,\r\n saturatedFat: 0,\r\n fatDv: 0,\r\n fat: 0,\r\n calories: 0,\r\n erythritol: 0,\r\n isomalt: 0,\r\n mannitol: 0,\r\n xylitol: 0,\r\n lactitol: 0,\r\n sorbitol: 0,\r\n maltitol: 0,\r\n unspecified: 0,\r\n servingWeight: 0,\r\n saturatedAndTransDv: 0,\r\n servingQuantityInUnitOfMeasurement: 1,\r\n servingUnitOfMeasurement: \"g\",\r\n },\r\n ingredients: [],\r\n childRecipes: [],\r\n servings: 1,\r\n servingCount: 1,\r\n servingWeight: 1,\r\n servingWeightMeasurement: \"g\",\r\n recipeServingType: 0,\r\n weightInGrams: 0,\r\n weightPerServing: 0,\r\n addedSugars: 0,\r\n exactAddedSugars: 0,\r\n adjustedAddedSugarsValue: 0,\r\n };\r\n }\r\n\r\n // Empty ingredient cost json\r\n getEmptyIngredientCost() {\r\n return {\r\n name: \"\",\r\n vendorId: this.vendors.length > 0 ? this.vendors[0].id : null,\r\n quantity: 0,\r\n chosenMeasurementName:\r\n this.massMeasurements.length > 0 ? this.massMeasurements[0].name : null,\r\n ingredientCostMeasurements: [...this.massMeasurements],\r\n cost: 0,\r\n };\r\n }\r\n\r\n // Get Recipe details\r\n getRecipeDetails() {\r\n RecipesRepository.getRecipeDetails(parseInt(this.$route.params.id))\r\n .then((response) => {\r\n this.recipe = response.data.result;\r\n this.recipe.nutritionAnalysis = mapNutritions(\r\n this.recipe.nutritionAnalysis\r\n );\r\n this.recipeIngredientCosts = this.recipe.ingredients.map((x) => {\r\n // Select the vendor for the recipe ingredient cost\r\n var ingredientCostVendorId =\r\n this.vendors.length > 0 ? this.vendors[0].id : null;\r\n return {\r\n recipeIngredientId: x.id,\r\n ingredientCostId: null,\r\n ingredientCostName: \"\",\r\n ingredientCostVendorId: ingredientCostVendorId,\r\n costPerGram: 0,\r\n ingredient: x.ingredient,\r\n measurement: x.measurement,\r\n quantity: x.quantity,\r\n };\r\n });\r\n\r\n this.listRecipeCostsForSubrecipes();\r\n })\r\n .catch((error) => {\r\n this.$snotify.error(getErrorMessage(error, this.translations));\r\n });\r\n }\r\n\r\n // Get Recipe costs for subrecipes\r\n listRecipeCostsForSubrecipes() {\r\n RecipeCostRepository.listRecipeCostsForSubrecipes(\r\n parseInt(this.$route.params.id)\r\n )\r\n .then((response) => {\r\n if (response.data.result.length > 0) {\r\n this.subRecipeCosts = response.data.result.map((x) => {\r\n return {\r\n id: x.subrecipeId,\r\n recipeName: x.recipeName,\r\n servings: x.recipeCostServings,\r\n totalCost: x.totalCost,\r\n };\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n this.$snotify.error(getErrorMessage(error, this.translations));\r\n });\r\n }\r\n\r\n getIngredientCostsForVendor(vendorId: number) {\r\n return this.allIngredientCosts.filter((x) => x.vendorId == vendorId);\r\n }\r\n\r\n // Table headers\r\n get tableHeaders() {\r\n return [\r\n {\r\n name: this.translations.get(\"ingr-cost-table-quantity\"),\r\n key: \"Quantity\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n {\r\n name: this.translations.get(\"ingr-cost-table-measurement\"),\r\n key: \"Measurement\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n {\r\n name: this.translations.get(\"rec-cost-table-ingr\"),\r\n key: \"Ingredient\",\r\n searchable: true,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n {\r\n name: this.translations.get(\"ingr-cost-table-vendor\"),\r\n key: \"Vendor\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n {\r\n name: this.translations.get(\"rec-cost-table-search-ingr\"),\r\n key: \"SearchIngredient\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n {\r\n name: this.translations.get(\"ingr-cost-table-cost\"),\r\n key: \"Cost\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true,\r\n },\r\n ];\r\n }\r\n\r\n totalRecipeCost() {\r\n var total = 0;\r\n for (var i = 0; i < this.recipeIngredientCosts.length; i++) {\r\n total += this.calculateCostForRecipeIngredientCost(\r\n this.recipeIngredientCosts[i].quantity,\r\n this.recipeIngredientCosts[i].measurement.weightInGrams,\r\n this.recipeIngredientCosts[i].costPerGram\r\n );\r\n }\r\n for (var i = 0; i < this.subRecipeCosts.length; i++) {\r\n total += this.subRecipeCosts[i].totalCost;\r\n }\r\n return (Math.round(total * 100) / 100).toFixed(2);\r\n }\r\n\r\n get costPerYield() {\r\n var total = parseFloat(this.totalRecipeCost());\r\n var totalPerYield = total / this.recipe.servings;\r\n return totalPerYield.toFixed(2);\r\n }\r\n\r\n get translations() {\r\n return this.localizationState.translations;\r\n }\r\n\r\n created() {\r\n this.$store\r\n .dispatch(TRANSLATIONS_FETCH, {\r\n category: \"pages\",\r\n collections: [\r\n \"common\",\r\n \"ingredients\",\r\n \"ingredient cost\",\r\n \"recipe costing\",\r\n ],\r\n })\r\n .then(() => {\r\n document.title =\r\n this.translations.get(\"ingr-cost-title\") +\r\n \" \" +\r\n this.translations.get(\"meta_title_postfix\");\r\n })\r\n .catch((error) => {\r\n if (error.response) {\r\n this.$snotify.error(\r\n error.response.data.errorMessages[0].userVisibleMessage\r\n );\r\n } else\r\n this.$snotify.error(this.translations.get(\"toastr_network_error\"));\r\n });\r\n\r\n this.loadAllIngredientCosts();\r\n this.loadIngredientCostVendors();\r\n this.getRecipeDetails();\r\n\r\n MeasurementRepository.listMeasurementsForCategory(MeasurementCategory.Mass)\r\n .then((response) => {\r\n var measurements = response.data.result.map((x: any) => {\r\n return {\r\n id: x.id,\r\n name: x.name,\r\n weightInGrams: x.conversionCoeficient,\r\n };\r\n });\r\n this.massMeasurements = measurements;\r\n })\r\n .catch((error) => {\r\n this.$snotify.error(getErrorMessage(error, this.translations));\r\n });\r\n }\r\n}\r\nexport default RecipeCostComponent;\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CreateRecipeCost.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CreateRecipeCost.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./CreateRecipeCost.vue?vue&type=template&id=5bcda7d8&scoped=true\"\nimport script from \"./CreateRecipeCost.vue?vue&type=script&lang=ts\"\nexport * from \"./CreateRecipeCost.vue?vue&type=script&lang=ts\"\nimport style0 from \"./CreateRecipeCost.vue?vue&type=style&index=0&id=5bcda7d8&prod&scoped=true&lang=css\"\nimport style1 from \"./CreateRecipeCost.vue?vue&type=style&index=1&id=5bcda7d8&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5bcda7d8\",\n null\n \n)\n\nexport default component.exports","import Repository from './Repository';\r\nimport { CreateRecipeCategory } from '@/models/Recipes/CreateRecipeCategory';\r\nimport { DeleteRecipeCategory } from '@/models/Recipes/DeleteRecipeCategory';\r\nimport ListRequest from '@/models/ListRequest';\r\nimport { CreateRecipe } from '@/models/Recipes/CreateRecipe';\r\nimport { UpdateRecipe } from '@/models/Recipes/UpdateRecipe';\r\nimport { SearchSubRecipes } from '@/models/Recipes/SearchSubRecipes';\r\nimport { SearchRecipes } from '@/models/Recipes/SearchRecipes';\r\nimport { UpdateRecipeCategory } from '@/models/Recipes/UpdateRecipeCategory';\r\nimport { RecipeCalculate } from '@/models/Recipes/RecipeCalculate';\r\n\r\n\r\nconst resource = '/recipes';\r\n\r\nexport default {\r\n createRecipeCategory(createRecipeCategory: CreateRecipeCategory) {\r\n return Repository.post(`${resource}/CreateRecipeCategory`, createRecipeCategory, { withCredentials: true });\r\n },\r\n listRecipeCategories() {\r\n return Repository.get(`${resource}/ListRecipeCategories`, { withCredentials: true });\r\n },\r\n deleteRecipeCategory(deleteRecipeCategory: DeleteRecipeCategory) {\r\n return Repository.post(`${resource}/DeleteRecipeCategory`, deleteRecipeCategory, { withCredentials: true });\r\n },\r\n listRecipes(listRequest: ListRequest) {\r\n return Repository.post(`${resource}/ListRecipes`, listRequest, { withCredentials: true });\r\n },\r\n getRecipeDetails(id: number) {\r\n return Repository.post(`${resource}/GetRecipeDetails`, { recipeId: id }, { withCredentials: true });\r\n },\r\n createRecipe(createRecipe: CreateRecipe) {\r\n return Repository.post(`${resource}/CreateRecipe`, createRecipe, { withCredentials: true });\r\n },\r\n deleteRecipe(id: number) {\r\n return Repository.post(`${resource}/DeleteRecipe`, { recipeId: id }, { withCredentials: true });\r\n },\r\n udateRecipe(updateRecipe: UpdateRecipe) {\r\n return Repository.post(`${resource}/UpdateRecipe`, updateRecipe, { withCredentials: true });\r\n },\r\n searchSubRecipes(searchSubRecipes: SearchSubRecipes) {\r\n return Repository.post(`${resource}/SearchSubRecipes`, searchSubRecipes, { withCredentials: true });\r\n },\r\n searchRecipes(searchRecipes: SearchRecipes) {\r\n return Repository.post(`${resource}/SearchRecipes`, searchRecipes, { withCredentials: true });\r\n },\r\n // deleteRecipes(recipeIds: number[]) {\r\n // return Repository.post(`${resource}/DeleteRecipes`, { recipeIds }, { withCredentials: true });\r\n // },\r\n renameCategory(updateCategory: any) {\r\n return Repository.post(`${resource}/RenameRecipeCategory`, updateCategory, { withCredentials: true });\r\n },\r\n moveRecipesToCategory(moveRecipesToCategory: any) {\r\n return Repository.post(`${resource}/MoveRecipesToRecipeCategory`, moveRecipesToCategory, { withCredentials: true });\r\n },\r\n filterRecipesNames(recipesSearchTerm: any) {\r\n return Repository.post(`${resource}/filterRecipesNames`, { recipeSearchTerm: recipesSearchTerm }, { withCredentials: true });\r\n },\r\n calculate(recCalc: RecipeCalculate) {\r\n return Repository.post(`${resource}/CalculateRecipeNutritions`, recCalc, { withCredentials: true });\r\n },\r\n copyRecipe(data: any) {\r\n return Repository.post(`${resource}/CopyRecipe`, data, { withCredentials: true });\r\n },\r\n saveRecipeLabel(data: any) {\r\n return Repository.post(`${resource}/SaveRecipeLabel`, data, { withCredentials: true });\r\n },\r\n getRecipeLabel(data: any) {\r\n return Repository.post(`${resource}/GetRecipeLabel`, data, { withCredentials: true });\r\n },\r\n deleteRecipes(data: any) {\r\n return Repository.post(`${resource}/DeleteRecipes`, data, { withCredentials: true });\r\n },\r\n listRestaurantRecipesAsLookups(restaurantId: number) {\r\n return Repository.get(`${resource}/ListRestaurantRecipesAsLookups?restaurantId=${restaurantId}`, { withCredentials: true });\r\n },\r\n listCookingMethods() {\r\n return Repository.get(`${resource}/ListCookingMethods`, { withCredentials: true });\r\n },\r\n listFoodGroupClasses() {\r\n return Repository.get(`${resource}/ListFoodGroupClasses`, { withCredentials: true });\r\n },\r\n listFoodGroupSubClasses(data: any) {\r\n return Repository.post(`${resource}/ListFoodGroupSubClasses`, data, { withCredentials: true });\r\n },\r\n updateRecipeFoodClassifications(data: any) {\r\n return Repository.post(`${resource}/UpdateRecipeFoodClassifications`, data, { withCredentials: true });\r\n },\r\n updateRecipeServingSize(data: any) {\r\n return Repository.post(`${resource}/UpdateRecipeServingSize`, data, { withCredentials: true });\r\n },\r\n updateCaloriesCalculationMethod(data: any) {\r\n return Repository.post(`${resource}/UpdateCalculationMethods`, data, { withCredentials: true });\r\n },\r\n hasRecipeWithIngredientsFromSpecificDatabase(nutrientSource: any) {\r\n return Repository.post(`${resource}/HasRecipeWithIngredientsFromSpecificDatabase`, { nutrientSource: nutrientSource }, { withCredentials: true })\r\n },\r\n listRecipesThatUseIngredient(ingredientId: number) {\r\n return Repository.get(`${resource}/ListRecipesThatUseIngredient?IngredientId=${ingredientId}`, { withCredentials: true });\r\n },\r\n};\r\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CreateRecipeCost.vue?vue&type=style&index=1&id=5bcda7d8&prod&lang=css\""],"sourceRoot":""}