{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\budgetSum.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\budgetSum.vue","mtime":1717524831402},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.to-string\";\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//\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 utils from '@/utils'; // thousandBit格式化千分位\nvar BigNumber = require('bignumber.js');\nimport * as echarts from 'echarts';\nimport basicData from '@/api/basicData.js';\nexport default {\n name: 'budgetSum',\n data: function data() {\n return {\n tableData: [],\n data: [],\n loading: false,\n cstatus: '',\n date: '',\n budgetType: '',\n budgetOp: [],\n total: {},\n utils: utils,\n formInline: {\n companyIds: ['1419863231459102720', '1430734631036129280'],\n companyName: '',\n roadSegmentName: ''\n },\n budgetItem: '',\n budgetItemOp: [],\n path: '1419863231459102720,'\n };\n },\n created: function created() {\n var _this = this;\n this.$nextTick(function () {\n var date = new Date();\n _this.date = date.getFullYear().toString();\n });\n this.loadData();\n this.budgetOp = this.getByKeyData('FXCBXZC');\n },\n // watch: {\n // tableData(newVal) {\n // this.total.budgetSum = this.calculation('budgetSum', newVal)\n // this.total.alreadyCount = this.calculation('alreadyCount', newVal)\n // this.total.totalRateMoney = this.calculation('totalRateMoney', newVal)\n // this.total.conserveMoneyBudget = this.calculation('conserveMoneyBudget', newVal)\n // this.total.conserveMoney = this.calculation('conserveMoney', newVal)\n // this.total.conserveIMMoney = this.calculation('conserveIMMoney', newVal)\n // this.total.conserveSpeMoneyBudget = this.calculation('conserveSpeMoneyBudget', newVal)\n // this.total.conserveSpeMoney = this.calculation('conserveSpeMoney', newVal)\n // this.total.conserveSpeIMMoney = this.calculation('conserveSpeIMMoney', newVal)\n // this.total.specialMoneyBudget = this.calculation('specialMoneyBudget', newVal)\n // this.total.specialMoney = this.calculation('specialMoney', newVal)\n // this.total.specialIMMoney = this.calculation('specialIMMoney', newVal)\n // this.total.noSpecialMoneyBudget = this.calculation('noSpecialMoneyBudget', newVal)\n // this.total.noSpecialMoney = this.calculation('noSpecialMoney', newVal)\n // this.total.noSpecialIMMoney = this.calculation('noSpecialIMMoney', newVal)\n // },\n // },\n methods: {\n updata: function updata(newVal) {\n this.total.name = '总数';\n this.total.budgetSum = this.calculation('budgetSum', newVal);\n this.total.alreadyCount = this.calculation('alreadyCount', newVal);\n this.total.totalRateMoney = this.calculation('totalRateMoney', newVal);\n this.total.conserveMoneyBudget = this.calculation('conserveMoneyBudget', newVal);\n this.total.conserveMoney = this.calculation('conserveMoney', newVal);\n this.total.conserveIMMoney = this.calculation('conserveIMMoney', newVal);\n this.total.conserveSpeMoneyBudget = this.calculation('conserveSpeMoneyBudget', newVal);\n this.total.conserveSpeMoney = this.calculation('conserveSpeMoney', newVal);\n this.total.conserveSpeIMMoney = this.calculation('conserveSpeIMMoney', newVal);\n this.total.specialMoneyBudget = this.calculation('specialMoneyBudget', newVal);\n this.total.specialMoney = this.calculation('specialMoney', newVal);\n this.total.specialIMMoney = this.calculation('specialIMMoney', newVal);\n this.total.noSpecialMoneyBudget = this.calculation('noSpecialMoneyBudget', newVal);\n this.total.noSpecialMoney = this.calculation('noSpecialMoney', newVal);\n this.total.noSpecialIMMoney = this.calculation('noSpecialIMMoney', newVal);\n },\n reset: function reset() {\n var date = new Date();\n this.date = date.getFullYear().toString();\n this.loadData();\n },\n getByKeyData: function getByKeyData(key) {\n var data = [];\n basicData.getCostAccountManagement(key).then(function (res) {\n res.data.forEach(function (item) {\n data.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n });\n });\n return data;\n },\n format: function format(data) {\n var total = 0;\n var money = 0;\n data.forEach(function (item) {\n total += Number(item.pnameCount);\n money += Number(item.everyMoney);\n });\n console.log(total);\n data.forEach(function (item) {\n item.percentage = item.pnameCount / total * 100;\n item.percent = Number((item.everyMoney / money * 100).toFixed(2));\n item.money = (Number(item.everyMoney) / 10000).toFixed(2);\n });\n },\n /**\r\n * @description: 获取当前日期n个月前的日期\r\n * @param {String} n 几个月(为负数则表示前面的日期)\r\n * @return: 日期\r\n */\n diffMonth: function diffMonth(n) {\n var dt = new Date();\n dt.setMonth(dt.getMonth() - Number(n));\n return dt.toLocaleString().replace(/\\//g, '-');\n },\n // calculation(key, arr) {\n // let total = 0\n // if (!key || arr.length === 0) return total\n // arr.forEach((item) => {\n // total += parseInt(item[key])\n // })\n // if (total === 0) return 0\n // return utils.thousandBit(total)\n // },\n calculation: function calculation(key, arr) {\n if (!key || arr.length === 0) return 0;\n var total = new BigNumber(0);\n arr.forEach(function (item) {\n if (!item[key]) {\n item[key] = 0;\n }\n console.log(key + '=', item[key]);\n total = total.plus(item[key]);\n });\n if (typeof total == 'undefined') return 0;\n return total.toNumber();\n },\n calculationWY: function calculationWY(key, arr) {\n var total = 0;\n if (!key || arr.length === 0) return total;\n arr.forEach(function (item) {\n total += parseFloat((item[key] / 10000).toFixed(4)) * 10000;\n });\n if (total === 0) return 0;\n return utils.thousandBit(parseFloat((total / 10000).toFixed(4)));\n },\n handleChange: function handleChange() {\n var _this2 = this;\n var date = this.date,\n budgetType = this.budgetType,\n budgetItem = this.budgetItem;\n this.budgetItemOp = this.getByKeyData(budgetType);\n if (date || budgetType || budgetItem) {\n var query = '';\n if (date && !budgetType) {\n query = 'year=' + date;\n } else if (budgetType && !date) {\n if (budgetType && !budgetItem) {\n query = 'budgetType=' + budgetType;\n } else if (budgetType && budgetItem) {\n query = 'budgetType=' + budgetType + '&budgetItem=' + budgetItem;\n }\n } else if (date && budgetType) {\n query = 'year=' + date + '&' + 'budgetType=' + budgetType + '&budgetItem=' + budgetItem;\n }\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetDetailCountVo?' + query).then(function (res) {\n _this2.tableData = res && res.status == 200 && res.data || [];\n _this2.updata(_this2.tableData);\n _this2.tableData.push(_this2.total);\n _this2.data = [];\n _this2.data.push(_this2.tableData);\n _this2.loading = false;\n });\n } else {\n this.loadData();\n }\n },\n findinfo: function findinfo() {\n var _this3 = this;\n var val = this.date;\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetDetailCountVo?year=' + val).then(function (res) {\n _this3.tableData = res && res.status == 200 && res.data || [];\n _this3.updata(_this3.tableData);\n _this3.tableData.push(_this3.total);\n _this3.data = [];\n _this3.data.push(_this3.tableData);\n _this3.loading = false;\n });\n },\n handleReset: function handleReset() {\n var length = this.data.length - 1;\n if (length === 0) return;\n this.tableData = this.data[this.data.length - 2];\n this.tableData = this.tableData.slice(0, this.tableData.length - 1);\n this.updata(this.tableData);\n this.tableData.push(this.total);\n this.data.splice(length, 1);\n },\n hanldeRowClick: function hanldeRowClick(row) {\n if (row.chirldren.length == 0) {\n this.path += row.roadSegmentId;\n return this.$router.push({\n name: 'budgetSumChildren',\n params: {\n value: row,\n path: this.path,\n cstatus: this.cstatus\n }\n });\n } else {\n this.path += row.id + ',';\n }\n var len = row.chirldren.length;\n if (row.chirldren[len - 1].name == '总数') {\n row.chirldren.splice(len - 1, 1);\n }\n this.tableData = row.chirldren;\n this.updata(this.tableData);\n this.tableData.push(this.total);\n this.data.push(row.chirldren);\n },\n handleCellClick: function handleCellClick(row, column) {\n this.cstatus = column.columnKey;\n },\n loadData: function loadData() {\n var _this4 = this;\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetDetailCountVo?year=' + new Date().getFullYear()).then(function (res) {\n _this4.tableData = res && res.status == 200 && res.data || [];\n _this4.updata(_this4.tableData);\n _this4.tableData.push(_this4.total);\n _this4.data = [];\n _this4.data.push(_this4.tableData);\n _this4.loading = false;\n console.log(_this4.data);\n }).catch(function () {\n _this4.loading = false;\n });\n }\n }\n};",null]}