{"version":3,"sources":["webpack:///./src/pages/presupuestos/plantillaArticuloAdd/components/PlantillaArticuloAddForm.vue?1333","webpack:///./src/pages/presupuestos/plantillaArticuloAdd/components/PlantillaArticuloAddFormData.js","webpack:///src/pages/presupuestos/plantillaArticuloAdd/components/PlantillaArticuloAddForm.vue","webpack:///./src/pages/presupuestos/plantillaArticuloAdd/components/PlantillaArticuloAddForm.vue?e9ea","webpack:///./src/pages/presupuestos/plantillaArticuloAdd/components/PlantillaArticuloAddForm.vue","webpack:///./src/mixins/formMixin.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","formRules","plantilla_articulo","scopedSlots","_u","key","fn","ref","errors","plantillasArticulos","on","changePlantillaArticulo","slotProps","_v","_s","$online","plantillaArticulo","title","item","subtitle","model","value","form","callback","$$v","$set","expression","_l","tipoPlantilla","index","directives","name","rawName","label","icon","field","idlplantilla","obligatorio","fieldName","group","staticClass","idgrupo","groupName","staticRenderFns","selectLookups","Vue","apiFilterPlantillaArticulo","APIFilter","addGT","apiFilterInicio","setOperator","API_FILTER_OPERATORS","OR","addLTE","currentDate","addIsNull","apiFilterFin","addGTE","addNestedFilter","apiCalls","push","method","params","filter","$api","batchCall","mixins","data","required","formGroupsLineasPlantilla","created","Data","resp","methods","loadFormData","borrarFormFields","linea","borrarPlantillaFormFields","lineasPlantillaArticulos","lineasPlantillaCuotas","lineasPlantillaMant","lastGrupo","lineasPlantillaArticulo","groups","lineaPlantillaArticulo","formFields","fieldnameLplantillaArticulo","incluir","lineaPlantillaCuota","fieldnameLplantillaCuota","lineaPlantillaMant","fieldnameLplantillaMant","component","VCheckbox","VListItemContent","VList","VListItemSubtitle","VListItemTitle","props","id","type","Number","String","computed","isInsert","isEdit","watch","newValue","setFormRule","fieldname","rule","createMaxOracleNumberFormRules","precision","createMaxFormRules","size","createRequiredFormRules","emitChangeValues","$emit","loadForm","$watch","deep","addFormRulesAPI","columns","column","API_RESULT_DATATYPES","string","v","length","addFormRulesVeeValidateAPI","max"],"m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AAO5F,QAAQ,EAAKT,OAC/DqG,EAAO5F,QAAQ,EAAK9B,WACxB,EAAKwB,KAAK,EAAKxB,UAAW0H,EAAO5F,KAAM,IAEzC,EAAK9B,UAAU0H,EAAO5F,MAAM6B,MAC1B,SAAAkE,GAAC,OAAKA,GAAK,IAAIC,QAAUJ,EAAOT,MAA3B,mCAA+DS,EAAOT,KAAtE,oBAPX,IAAK,EAAL,qBAA8B,IADN,gCAapBc,2BAzCC,SAyC2BN,GAAS,mLAEpBA,GAFoB,IAEzC,IAAK,EAAL,qBAAWC,EAAmB,QAExBA,EAAOvB,OAASwB,OAAqBC,QAAUF,EAAO5F,QAAQ,EAAKT,OAC/DqG,EAAO5F,QAAQ,EAAK9B,UAGxB,EAAKwB,KAAK,EAAKxB,UAAU0H,EAAO5F,MAAO,MAAQ4F,EAAOT,MAFtD,EAAKzF,KAAK,EAAKxB,UAAW0H,EAAO5F,KAAM,CAAEkG,IAAKN,EAAOT,QANlB","file":"js/chunk-0f890f8c.67020ec7.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b10-base',[_c('ValidationProvider',{attrs:{\"name\":\"plantilla_articulo\",\"rules\":_vm.formRules.plantilla_articulo},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nreturn [_c('b10-autocomplete',{attrs:{\"items\":_vm.plantillasArticulos,\"item-text\":\"descripcion\",\"label\":\"Plantilla de artículos, cuotas y revisiones\",\"clearable\":\"\",\"error-messages\":errors,\"return-object\":\"\",\"no-filter\":\"\"},on:{\"change\":_vm.changePlantillaArticulo},scopedSlots:_vm._u([{key:\"item\",fn:function(slotProps){return [_c('v-list-item-content',[_c('v-list-item-title',[_vm._v(_vm._s(_vm.$online.plantillaArticulo.title(slotProps.item)))]),_c('v-list-item-subtitle',[_vm._v(_vm._s(_vm.$online.plantillaArticulo.subtitle(slotProps.item)))])],1)]}}],null,true),model:{value:(_vm.form.plantilla_articulo),callback:function ($$v) {_vm.$set(_vm.form, \"plantilla_articulo\", $$v)},expression:\"form.plantilla_articulo\"}})]}}])}),_vm._l((_vm.formGroupsLineasPlantilla),function(tipoPlantilla,index){return _c('div',{key:index},[_c('b10-subheader',{directives:[{name:\"show\",rawName:\"v-show\",value:(tipoPlantilla.label),expression:\"tipoPlantilla.label\"}],attrs:{\"label\":tipoPlantilla.label,\"icon\":tipoPlantilla.icon}}),(tipoPlantilla.formFields)?_c('div',_vm._l((tipoPlantilla.formFields),function(field,index){return _c('div',{key:index},[_c('v-checkbox',{key:field.idlplantilla,attrs:{\"disabled\":field.obligatorio,\"label\":field.title,\"persistent-hint\":field.obligatorio,\"hint\":field.obligatorio ? 'Obligatorio' : ''},model:{value:(_vm.form[field.fieldName]),callback:function ($$v) {_vm.$set(_vm.form, field.fieldName, $$v)},expression:\"form[field.fieldName]\"}})],1)}),0):_c('div',_vm._l((tipoPlantilla.groups),function(group,index){return _c('div',{key:index,staticClass:\"pa-2\"},[_c('b10-subheader',{key:group.idgrupo,attrs:{\"label\":group.groupName,\"icon\":group.icon}}),_vm._l((group.formFields),function(field,index){return _c('div',{key:index},[_c('v-checkbox',{key:field.idlplantilla,attrs:{\"disabled\":field.obligatorio,\"label\":field.title,\"persistent-hint\":field.obligatorio,\"hint\":field.obligatorio ? 'Obligatorio' : ''},model:{value:(_vm.form[field.fieldName]),callback:function ($$v) {_vm.$set(_vm.form, field.fieldName, $$v)},expression:\"form[field.fieldName]\"}})],1)})],2)}),0)],1)})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { APIFilter, API_FILTER_OPERATORS } from '@/utils/api'\r\nimport { currentDate } from '@/utils/date'\r\n\r\nexport default {\r\n async selectLookups (Vue) {\r\n const apiFilterPlantillaArticulo = new APIFilter()\r\n .addGT('estado', 0)\r\n const apiFilterInicio = new APIFilter()\r\n .setOperator(API_FILTER_OPERATORS.OR)\r\n .addLTE('finicio', currentDate())\r\n .addIsNull('finicio')\r\n const apiFilterFin = new APIFilter()\r\n .setOperator(API_FILTER_OPERATORS.OR)\r\n .addGTE('ffin', currentDate())\r\n .addIsNull('ffin')\r\n apiFilterPlantillaArticulo\r\n .addNestedFilter(apiFilterInicio)\r\n .addNestedFilter(apiFilterFin)\r\n let apiCalls = []\r\n apiCalls.push({\r\n name: 'selectPlantillaArticulo',\r\n method: 'plantillaArticulo.select',\r\n params: { filter: apiFilterPlantillaArticulo }\r\n })\r\n return await Vue.$api.batchCall(apiCalls)\r\n },\r\n}\r\n","\r\n\r\n\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/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PlantillaArticuloAddForm.vue?vue&type=script&lang=js&\"; 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/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PlantillaArticuloAddForm.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PlantillaArticuloAddForm.vue?vue&type=template&id=5950e774&\"\nimport script from \"./PlantillaArticuloAddForm.vue?vue&type=script&lang=js&\"\nexport * from \"./PlantillaArticuloAddForm.vue?vue&type=script&lang=js&\"\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 null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VCheckbox } from 'vuetify/lib/components/VCheckbox';\nimport { VListItemContent } from 'vuetify/lib/components/VList';\nimport { VListItemSubtitle } from 'vuetify/lib/components/VList';\nimport { VListItemTitle } from 'vuetify/lib/components/VList';\ninstallComponents(component, {VCheckbox,VListItemContent,VListItemSubtitle,VListItemTitle})\n","import { API_RESULT_DATATYPES } from '@/utils/api'\r\n\r\nexport default {\r\n props: {\r\n id: {\r\n type: [Number, String],\r\n required: false\r\n },\r\n },\r\n computed: {\r\n isInsert () {\r\n if (this.id) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n },\r\n isEdit () {\r\n if (this.id) {\r\n return true\r\n } else {\r\n return false\r\n }\r\n }\r\n },\r\n watch: {\r\n async id (newValue) {\r\n // loadFormData del form donde se aplica el mixin\r\n // cambia el ID del objeto que se esta editando\r\n await this.loadFormData(newValue)\r\n }\r\n },\r\n methods: {\r\n setFormRule(fieldname, rule, value) {\r\n if (!(fieldname in this.formRules)) {\r\n this.$set(this.formRules, fieldname, { [rule]: value });\r\n } else {\r\n this.$set(this.formRules[fieldname], rule, value);\r\n }\r\n },\r\n createMaxOracleNumberFormRules(fieldname, precision) {\r\n this.setFormRule(fieldname, 'oracleNumber', precision)\r\n },\r\n createMaxFormRules(fieldname, size) {\r\n this.setFormRule(fieldname, 'max', size);\r\n },\r\n createRequiredFormRules(fieldname) {\r\n this.setFormRule(fieldname, 'required', true)\r\n },\r\n emitChangeValues () {\r\n this.$emit('change-values', this.form)\r\n },\r\n async loadForm () {\r\n if (!this.isInsert) {\r\n // loadFormData del form donde se aplica el mixin\r\n await this.loadFormData(this.id)\r\n }\r\n this.emitChangeValues()\r\n this.$watch('form', this.emitChangeValues, { deep: true })\r\n },\r\n addFormRulesAPI (columns) {\r\n for (const column of columns) {\r\n // controlar longitud máxima para campos string\r\n if (column.type === API_RESULT_DATATYPES.string && column.name in this.form) {\r\n if (!(column.name in this.formRules)) {\r\n this.$set(this.formRules, column.name, [])\r\n }\r\n this.formRules[column.name].push(\r\n v => (v || '').length <= column.size || `La longitud máxima es de ${column.size} caracteres`,\r\n )\r\n }\r\n }\r\n },\r\n async addFormRulesVeeValidateAPI (columns) {\r\n // La variable columns es lo que devuelve la api como metadatos result.metadata.columns\r\n for (const column of columns) {\r\n // controlar longitud máxima para campos string\r\n if (column.type === API_RESULT_DATATYPES.string && column.name in this.form) {\r\n if (!(column.name in this.formRules)) {\r\n this.$set(this.formRules, column.name, { max: column.size})\r\n } else {\r\n this.$set(this.formRules[column.name], \"max\" , column.size)\r\n }\r\n }\r\n }\r\n },\r\n },\r\n}\r\n"],"sourceRoot":""}