{"version":3,"sources":["webpack:///./src/views/LocalRegistration/Setup/RateCalculationRuleSet/Editor.vue?4812","webpack:///./src/views/LocalRegistration/Setup/RateCalculationRuleSet/Editor.vue?b5a5","webpack:///./src/views/LocalRegistration/Setup/RateCalculationRuleSet/Editor.vue","webpack:///./src/views/LocalRegistration/Setup/RateCalculationRuleSet/Editor.vue?cef3","webpack:///./src/views/LocalRegistration/Setup/RateCalculationRuleSet/Editor.vue?1f5d"],"names":["_withScopeId","n","_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","render","_ctx","_cache","$props","$setup","$data","$options","_component_Breadcrumb","_component_a_button","_component_a_input","_component_a_select_option","_component_a_select","_component_a_textarea","_component_upload","paddingBottom","dataSource","breadcrumb","type","onClick","handleToEdit","default","_","mode","Mode","ADD","placeholder","value","ruleCode","$event","disabled","VIEW","ruleName","ruleNameList","item","key","registrationDateSource","registrationDateSourceList","title","minRows","maxRows","rows","description","handleToUploadVinList","handleCancel","save","visible","visibleUploadDrawer","onUpload","uploadVin","components","Upload","setup","router","route","params","id","query","bu","undefined","exemptionCase","newRuleName","oldRuleName","maps","三方版","行驶证版","三方为主行驶证为辅版","行驶证为主三方为辅版","immediate","setRuleCode","then","res","code","name","exemptionCode","EDIT","console","log","go","specialDeduction","usage","length","message","success","file","resolve","formData","FormData","append","url","method","data","__exports__"],"mappings":"oKAAA,W,2DCEMA,EAAe,SAAAC,GAAK,OAAC,yBAAa,mBAAmBA,EAAEA,IAAI,0BAAcA,GACzEC,EAAa,CAAEC,MAAO,gCACtBC,EAAa,CAAED,MAAO,OACtBE,EAAa,CAAEF,MAAO,qBACtBG,EAAa,CAAEH,MAAO,oBACtBI,EAA0B,6BAAi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IAAgB,EAAQ,CAAC,CAAC,SAAS3F,GAAQ,CAAC,YAAY,qBAE1E,gB,kCCVf","file":"js/chunk-bc4820d0.48b0c954.js","sourcesContent":["export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Editor.vue?vue&type=style&index=0&id=cbac9d76&lang=scss&scoped=true\"","import { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, vShow as _vShow, withDirectives as _withDirectives, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-cbac9d76\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"local-registration-container\" }\nconst _hoisted_2 = { class: \"nav\" }\nconst _hoisted_3 = { class: \"content-container\" }\nconst _hoisted_4 = { class: \"edit-btn-wrapper\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"Edit\")\nconst _hoisted_6 = { class: \"content\" }\nconst _hoisted_7 = { class: \"search-panel\" }\nconst _hoisted_8 = { class: \"condition-item\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", null, \" Rule Code \", -1))\nconst _hoisted_10 = { class: \"condition-item\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", null, \" Rule Name \", -1))\nconst _hoisted_12 = { class: \"condition-item\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", null, \" Registration Data Source \", -1))\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"condition-item\" }, null, -1))\nconst _hoisted_15 = { class: \"condition-item description-condition-item\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", null, \" Description \", -1))\nconst _hoisted_17 = { class: \"upload-btn-wrapper\" }\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", null, \"Special deduction\", -1))\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", { class: \"font_family icon-shangchuan\" }, null, -1))\nconst _hoisted_20 = /*#__PURE__*/_createTextVNode(\"Upload VIN List\")\nconst _hoisted_21 = { class: \"footer\" }\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"Cancel\")\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"Save\")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_Breadcrumb = _resolveComponent(\"Breadcrumb\")!\n const _component_a_button = _resolveComponent(\"a-button\")!\n const _component_a_input = _resolveComponent(\"a-input\")!\n const _component_a_select_option = _resolveComponent(\"a-select-option\")!\n const _component_a_select = _resolveComponent(\"a-select\")!\n const _component_a_textarea = _resolveComponent(\"a-textarea\")!\n const _component_upload = _resolveComponent(\"upload\")!\n\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Breadcrumb, {\n paddingBottom: \"28\",\n dataSource: _ctx.breadcrumb\n }, null, 8, [\"dataSource\"])\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _withDirectives(_createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_a_button, {\n type: \"primary\",\n onClick: _ctx.handleToEdit\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ], 512), [\n [_vShow, _ctx.mode !== _ctx.Mode.ADD]\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_a_input, {\n placeholder: \"Please input\",\n value: _ctx.ruleCode,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((_ctx.ruleCode) = $event)),\n disabled: \"\"\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_a_select, {\n placeholder: \"Please select\",\n disabled: _ctx.mode === _ctx.Mode.VIEW,\n value: _ctx.ruleName,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((_ctx.ruleName) = $event))\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.ruleNameList, (item) => {\n return (_openBlock(), _createBlock(_component_a_select_option, { key: item }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item), 1)\n ]),\n _: 2\n }, 1024))\n }), 128))\n ]),\n _: 1\n }, 8, [\"disabled\", \"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_a_select, {\n placeholder: \"Please select\",\n disabled: _ctx.mode === _ctx.Mode.VIEW,\n value: _ctx.registrationDateSource,\n \"onUpdate:value\": _cache[2] || (_cache[2] = ($event: any) => ((_ctx.registrationDateSource) = $event))\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.registrationDateSourceList, (item) => {\n return (_openBlock(), _createBlock(_component_a_select_option, {\n value: item.value,\n key: item.value\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item.title), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }, 8, [\"disabled\", \"value\"])\n ]),\n _hoisted_14,\n _createElementVNode(\"div\", _hoisted_15, [\n _hoisted_16,\n _createVNode(_component_a_textarea, {\n placeholder: \"Please input\",\n \"auto-size\": { minRows: 4, maxRows: 4 },\n rows: 4,\n disabled: _ctx.mode === _ctx.Mode.VIEW,\n value: _ctx.description,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((_ctx.description) = $event))\n }, null, 8, [\"disabled\", \"value\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n _createVNode(_component_a_button, { onClick: _ctx.handleToUploadVinList }, {\n default: _withCtx(() => [\n _hoisted_19,\n _hoisted_20\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_21, [\n _createVNode(_component_a_button, {\n class: \"m-r-16\",\n onClick: _ctx.handleCancel\n }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n }, 8, [\"onClick\"]),\n _createVNode(_component_a_button, {\n type: \"primary\",\n onClick: _ctx.save\n }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ])\n ])\n ]),\n _createVNode(_component_upload, {\n title: \"Upload VIN List\",\n visible: _ctx.visibleUploadDrawer,\n \"onUpdate:visible\": _cache[4] || (_cache[4] = ($event: any) => ((_ctx.visibleUploadDrawer) = $event)),\n onUpload: _ctx.uploadVin\n }, null, 8, [\"visible\", \"onUpload\"])\n ], 64))\n}","\nimport axios from 'axios';\nimport { defineComponent, ref, computed, watch } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { message } from 'ant-design-vue';\nimport Upload from '@/views/LocalRegistration/components/Upload.vue';\n// import ApplicableExemptionCaseSelector from '@/views/LocalRegistration/components/ApplicableExemptionCaseSelector.vue';\nimport {\n createNewRuleCode,\n saveCalculationRule,\n updateCalculationRule,\n} from '@/API/localRegistration';\n\nenum Mode {\n VIEW,\n ADD,\n EDIT,\n}\n\ntype UndefinedString = undefined | string;\n\nexport default defineComponent({\n components: {\n Upload,\n // ApplicableExemptionCaseSelector,\n },\n setup() {\n const router = useRouter();\n const route = useRoute();\n const ruleCode = ref('');\n const mode = ref(Mode.ADD);\n mode.value = route.params.mode === 'add' ? Mode.ADD : Mode.VIEW;\n const id = route.query.id as string;\n const bu = route.query.bu as string;\n\n const ruleName = ref(undefined);\n const ruleNameList = [\n '三方版',\n '行驶证版',\n '三方为主行驶证为辅版',\n '行驶证为主三方为辅版',\n ];\n\n const exemptionCase = ref(undefined);\n\n const registrationDateSource = ref(undefined);\n // const registrationDateSourceList = computed(() => {\n // console.log('object', ruleName.value);\n // if (!ruleName.value) return [];\n // const maps = {\n // 三方版: [{ title: '三方', value: '1' }],\n // 行驶证版: [{ title: '行驶证', value: '2' }],\n // 三方为主行驶证为辅版: [{ title: '三方,行驶证', value: '3' }],\n // 行驶证为主三方为辅版: [{ title: '行驶证,三方', value: '4' }],\n // };\n // return maps[ruleName.value];\n // });\n const registrationDateSourceList = ref([]);\n watch(\n ruleName,\n (newRuleName: any, oldRuleName: any) => {\n if (newRuleName !== oldRuleName) {\n registrationDateSource.value = undefined;\n }\n if (!newRuleName) registrationDateSourceList.value = [];\n const maps = {\n 三方版: [{ title: '三方', value: '1' }],\n 行驶证版: [{ title: '行驶证', value: '2' }],\n 三方为主行驶证为辅版: [\n { title: '三方,行驶证', value: '3' },\n ],\n 行驶证为主三方为辅版: [\n { title: '行驶证,三方', value: '4' },\n ],\n };\n registrationDateSourceList.value = maps[newRuleName];\n },\n {\n immediate: true,\n }\n );\n\n const description = ref('');\n\n const setRuleCode = () => {\n if (mode.value === Mode.ADD) {\n createNewRuleCode().then((res: any) => {\n ruleCode.value = res;\n });\n } else {\n ruleCode.value = route.query.code as string;\n ruleName.value = route.query.name as string;\n exemptionCase.value = route.query.exemptionCode as string;\n registrationDateSource.value = route.query.dataSource as string;\n description.value = route.query.description as string;\n }\n };\n setRuleCode();\n\n const breadcrumb = computed(() => {\n return mode.value === Mode.ADD ? ['Add'] : ['View'];\n });\n\n const handleToEdit = () => {\n mode.value = Mode.EDIT;\n console.log(\n 'registrationDateSourceList',\n registrationDateSourceList.value\n );\n };\n\n const visibleUploadDrawer = ref(false);\n\n const handleToUploadVinList = () => {\n visibleUploadDrawer.value = true;\n };\n\n const handleCancel = () => {\n router.go(-1);\n };\n\n const save = () => {\n if (mode.value === Mode.ADD) {\n const params = [\n {\n bu,\n ruleCode: ruleCode.value,\n ruleName: ruleName.value,\n dataSource: registrationDateSource.value,\n description: description.value,\n exemptionCode: exemptionCase.value,\n specialDeduction: 'N',\n usage: 'Y',\n },\n ];\n saveCalculationRule(params).then((res: any) => {\n if (res.length > 0) {\n message.success('Save Successfully!');\n router.go(-1);\n }\n });\n } else {\n const params = {\n bu,\n id,\n ruleCode: ruleCode.value,\n ruleName: ruleName.value,\n dataSource: registrationDateSource.value,\n };\n updateCalculationRule(params).then((res: any) => {\n if (res === '') {\n message.success('Save Successfully!');\n router.go(-1);\n }\n });\n }\n };\n\n const uploadVin = (file: any, resolve: any) => {\n const formData = new FormData();\n formData.append('file', file);\n const url = `/rvapi/lr/regCalRuleDeduction/import/uploadCalVinlist`;\n axios({\n method: 'post',\n data: formData,\n // import excel for exemption rule\n url,\n }).then((res: any) => {\n resolve();\n });\n };\n\n return {\n Mode,\n ruleCode,\n description,\n exemptionCase,\n mode,\n breadcrumb,\n handleToEdit,\n visibleUploadDrawer,\n handleToUploadVinList,\n handleCancel,\n ruleName,\n ruleNameList,\n registrationDateSource,\n registrationDateSourceList,\n save,\n uploadVin,\n };\n },\n});\n","import { render } from \"./Editor.vue?vue&type=template&id=cbac9d76&scoped=true&ts=true\"\nimport script from \"./Editor.vue?vue&type=script&lang=ts\"\nexport * from \"./Editor.vue?vue&type=script&lang=ts\"\n\nimport \"./Editor.vue?vue&type=style&index=0&id=cbac9d76&lang=scss&scoped=true\"\nimport \"./Editor.vue?vue&type=style&index=1&id=cbac9d76&lang=scss\"\n\nimport exportComponent from \"/app/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-cbac9d76\"]])\n\nexport default __exports__","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Editor.vue?vue&type=style&index=1&id=cbac9d76&lang=scss\""],"sourceRoot":""}