{"remainingRequest":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\DataManagement\\subPages\\editCharge.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\DataManagement\\subPages\\editCharge.vue","mtime":1704711122360},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport chargeData from '@/api/DataManagement/chargeData.js';\nimport routerManagement from '@/api/BasicDataManagement/tollStationManagement.js';\nimport companyInfoSelector from \"../../components/companyInfoSelector.vue\";\nexport default {\n name: 'editCharge',\n components: {\n companyInfoSelector: companyInfoSelector\n },\n data: function data() {\n return {\n id: '',\n loading: false,\n dialogForm: {\n payableMoney: 0,\n actualityMoney: 0,\n reductionMoney: 0,\n hh: 0,\n mm: 0,\n ss: 0,\n isEtc: 1,\n isCash: 0,\n carType: 1\n },\n roadOptions: [],\n // 路段数据\n tollStationOptions: [],\n // 收费站数据\n rules: {}\n };\n },\n mounted: function mounted() {\n this.loadRoad();\n this.loadTollStation();\n this.id = this.$route.query.id;\n\n if (this.id) {\n this.getDataById();\n }\n },\n methods: {\n changeDateTime: function changeDateTime(data) {\n if (data) {\n this.dialogForm.startTime = data[0];\n this.dialogForm.endTime = data[1];\n } else {\n this.dialogForm.startTime = '';\n this.dialogForm.endTime = '';\n }\n\n var a = new Date(this.dialogForm.startTime).getTime();\n var b = new Date(this.dialogForm.endTime).getTime();\n this.dialogForm.passTime = (b - a) / 1000;\n this.formatPassTime();\n console.log(a, b, (b - a) / 1000, 'this.dialogForm.startTime');\n },\n getDataById: function getDataById() {\n var _this = this;\n\n chargeData.getDataById(this.id).then(function (res) {\n _this.dialogForm = res;\n\n _this.formatPassTime();\n\n _this.formatTimeRange();\n });\n },\n formatTimeRange: function formatTimeRange() {\n var rang = [];\n\n if (this.dialogForm.startTime && this.dialogForm.endTime) {\n rang = [this.dialogForm.startTime, this.dialogForm.endTime];\n }\n\n this.$set(this.dialogForm, 'range', rang);\n },\n formatPassTime: function formatPassTime() {\n var totalseconds = this.dialogForm.passTime; // 时长 以秒为单位\n\n this.dialogForm.ss = totalseconds % 60; // 取余得秒\n\n var hh = 0; //小时 默认0\n\n var mm = Math.floor(totalseconds / 60); //除以60取整数,得到整数分钟\n // 如果分钟大于60,将分钟转换成小时\n\n if (mm > 60) {\n // 获取小时整数\n hh = Math.floor(mm / 60); // 取余的分钟数\n\n mm = mm % 60;\n }\n\n this.dialogForm.mm = mm;\n this.dialogForm.hh = hh;\n this.$forceUpdate();\n },\n // 路段数据\n loadRoad: function loadRoad() {\n var _this2 = this;\n\n var params = {\n pageBean: {\n page: 1,\n pageSize: -1\n }\n };\n routerManagement.queryRoad(params).then(function (res) {\n _this2.roadOptions = res.rows || [];\n\n if (_this2.roadOptions.length) {\n _this2.dialogForm.roadName = _this2.roadOptions[0].name;\n _this2.dialogForm.roadId = _this2.roadOptions[0].id;\n }\n });\n },\n // 收费站\n loadTollStation: function loadTollStation() {\n var _this3 = this;\n\n var params = {\n pageBean: {\n page: 1,\n pageSize: -1\n }\n };\n routerManagement.queryTollStation(params).then(function (res) {\n var data = res.data;\n _this3.tollStationOptions = data.rows || [];\n\n if (_this3.tollStationOptions.length) {\n _this3.dialogForm.tollStationId = _this3.tollStationOptions[0].id;\n _this3.dialogForm.tollStationName = _this3.tollStationOptions[0].name;\n }\n });\n },\n handleChangeRoad: function handleChangeRoad(data) {\n var target = this.roadOptions.filter(function (item) {\n return item.id == data;\n })[0];\n this.dialogForm.roadName = target.name;\n },\n handleChangeTollStation: function handleChangeTollStation(data) {\n var target = this.tollStationOptions.filter(function (item) {\n return item.id == data;\n })[0];\n this.dialogForm.tollStationName = target.name;\n },\n submit: function submit() {\n var _this4 = this;\n\n this.$refs.form.validate(function (valid) {\n if (valid) {\n _this4.loading = true;\n _this4.dialogForm.passTime = _this4.dialogForm.ss + _this4.dialogForm.mm * 60 + _this4.dialogForm.hh * 60 * 60;\n chargeData.saveChargeData(_this4.dialogForm).then(function (res) {\n console.log('res', res);\n\n if (res.data.state) {\n _this4.$router.go(-1);\n }\n\n if (res.data.state) {\n _this4.$message({\n message: !_this4.id ? '添加成功' : '修改成功',\n type: 'success'\n });\n }\n\n _this4.loading = false;\n }).catch(function () {\n _this4.loading = false;\n });\n } else {\n return false;\n }\n });\n }\n }\n};",null]}