{"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\\dailyMaintenance\\DailyMaintenance.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\dailyMaintenance\\DailyMaintenance.vue","mtime":1718388789165},{"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 _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.array.sort\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 moment from 'moment';\nexport default {\n name: 'DailyMaintenance',\n data: function data() {\n return {\n tableData: [],\n data: [],\n startTime: moment().startOf('year').format('YYYY-MM-DD'),\n endTime: moment().endOf('year').format('YYYY-MM-DD'),\n loading: false,\n cstatus: '',\n date: '',\n total: {},\n utils: utils,\n formInline: {\n companyIds: ['1419863231459102720', '1430734631036129280'],\n companyName: '',\n roadSegmentName: ''\n },\n path: '1419863231459102720,'\n };\n },\n mounted: function mounted() {\n this.companyChange(['1419863231459102720', '1430734631036129280']);\n },\n created: function created() {\n var moment = require('moment');\n var endDate = moment().endOf('year').format('YYYY-MM-DD');\n // 获取当前时间6个月前的时间\n var startDate = moment().startOf('year').format('YYYY-MM-DD');\n this.date = [startDate, endDate];\n this.loadData();\n },\n watch: {\n tableData: function tableData(newVal) {\n this.total.finishCount = this.calculation('finishCount', newVal);\n this.total.distributionCount = this.calculation('distributionCount', newVal);\n this.total.constructionCount = this.calculation('constructionCount', newVal);\n this.total.checkCount = this.calculation('checkCount', newVal);\n this.total.examineCount = this.calculation('examineCount', newVal);\n this.total.overdueCount = this.calculation('overdueCount', newVal);\n this.total.allCount = this.calculation('allCount', newVal);\n // this.total.finishMoney = this.calculation('finishMoney', newVal)\n this.total.finishMoney = this.calculationWY('finishMoney', newVal);\n this.pieCharts(this.total, newVal);\n this.cloumnCharts(newVal);\n }\n },\n methods: {\n reset: function reset() {\n var moment = require('moment');\n var endDate = moment().endOf('year').format('YYYY-MM-DD');\n // 获取当前时间6个月前的时间\n var startDate = moment().startOf('year').format('YYYY-MM-DD');\n this.date = [startDate, endDate];\n this.startTime = startDate;\n this.endTime = endDate;\n this.loadData();\n },\n companyChange: function companyChange(val) {\n var _this = this;\n this.formInline.companyIds = val;\n var id = val && val[val.length - 1] || '';\n if (!id) return;\n this.$http.get('${yhxt}/statisticalStatement/v1/findAllRoadIds?id=' + id).then(function (res) {\n var ids = res.data.value.join(',') || id || '';\n if (!ids) {\n _this.getAmountStatisticsChart([]);\n } else {\n _this.getCountMaintenanceData(ids);\n }\n });\n },\n getCountMaintenanceData: function getCountMaintenanceData(roadSegmentId) {\n var _this2 = this;\n this.$http.post('${yhxt}/statisticalStatement/v1/countMaintenance/new', {\n roadSegmentId: roadSegmentId\n }).then(function (res) {\n _this2.data = res.data.maintenanceNewVos;\n _this2.format(_this2.data);\n _this2.getAmountStatisticsChart(res.data.maintenanceNewVos);\n });\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: function calculation(key, arr) {\n var total = 0;\n if (!key || arr.length === 0) return total;\n arr.forEach(function (item) {\n total += parseInt(item[key]);\n });\n if (total === 0) return 0;\n return utils.thousandBit(total);\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(2)) * 10000;\n });\n if (total === 0) return 0;\n return utils.thousandBit(parseFloat((total / 10000).toFixed(2)));\n },\n changeYear: function changeYear(val) {\n var _this3 = this;\n if (!val) {\n return this.loadData();\n }\n this.loading = true;\n this.$http.post('${yhxt}/workOrderInformation/v1/getWorkCountVo' + \"?startDate=\".concat(this.startTime, \"&endDate=\").concat(this.endTime)).then(function (res) {\n _this3.tableData = res && res.status == 200 && res.data || [];\n _this3.data = [];\n _this3.data.push(_this3.tableData);\n _this3.loading = false;\n });\n },\n findinfo: function findinfo() {\n var _this4 = this;\n var val = this.date;\n this.loading = true;\n this.$http.post('${yhxt}/workOrderInformation/v1/getWorkCountVo' + \"?startDate=\".concat(this.startTime, \"&endDate=\").concat(this.endTime)).then(function (res) {\n _this4.tableData = res && res.status == 200 && res.data || [];\n _this4.data = [];\n _this4.data.push(_this4.tableData);\n _this4.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.data.splice(length, 1);\n },\n hanldeRowClick: function hanldeRowClick(row) {\n if (row.chirldren.length == 0 && row.roadId) {\n this.path += row.roadId;\n return this.$router.push({\n name: 'workOrderInfo',\n params: {\n value: row,\n path: this.path,\n cstatus: this.cstatus\n }\n });\n } else {\n this.path += row.id + ',';\n }\n this.tableData = row.chirldren;\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 _this5 = this;\n this.loading = true;\n var str = '';\n if (this.date) {\n str = \"?startDate=\".concat(this.startTime, \"&endDate=\").concat(this.endTime);\n }\n this.$http.post('${yhxt}/workOrderInformation/v1/getWorkCountVo' + str).then(function (res) {\n _this5.tableData = res && res.status == 200 && res.data || [];\n _this5.data = [];\n _this5.data.push(_this5.tableData);\n _this5.loading = false;\n }).catch(function () {\n _this5.loading = false;\n });\n },\n pieCharts: function pieCharts(obj, rows) {\n var chartDom = document.getElementById('pie');\n var myChart = echarts.init(chartDom);\n var data = [{\n name: '已完成',\n value: obj.finishCount || 0\n }, {\n name: '派单',\n value: obj.distributionCount || 0\n }, {\n name: '施工',\n value: obj.constructionCount || 0\n }, {\n name: '验收',\n value: obj.checkCount || 0\n }, {\n name: '审核',\n value: obj.examineCount || 0\n }\n // {\n // name: '已逾期',\n // value: obj.overdueCount || 0\n // }\n ];\n\n var innerData = [{\n name: '审核',\n value: this.calculation('examineOverdue', rows)\n }, {\n name: '验收',\n value: this.calculation('checkOverdue', rows)\n }, {\n name: '施工',\n value: this.calculation('constructionOverdue', rows)\n }, {\n name: '派单',\n value: this.calculation('distributionOverdue', rows)\n }];\n innerData = innerData.sort(function (a, b) {\n return b.value - a.value;\n });\n innerData[0].selected = true;\n var option;\n var total = new BigNumber(0);\n data.forEach(function (item) {\n total = total.plus(item.value);\n });\n var formatNumber = function formatNumber(num) {\n return num.toString().replace(/(?=(\\B)(\\d{3})+$)/g, ',');\n };\n option = {\n // title: [\n // {\n // text: `{name|总数/个}\\n{val|${formatNumber(total)}}`,\n // top: 'center',\n // left: 'center',\n // textStyle: {\n // rich: {\n // name: {\n // fontSize: 14,\n // color: '#fff',\n // padding: [10, 0]\n // },\n // val: {\n // fontSize: 32,\n // fontWeight: 'bold',\n // color: '#fff'\n // }\n // }\n // }\n // }\n // ],\n tooltip: {\n trigger: 'item',\n formatter: function formatter(a) {\n return \"\".concat(a.marker, \" \").concat(a.data.name, \" \").concat(a.data.value, \"\\u4E2A \").concat(a.percent, \"%\");\n }\n },\n color: ['#5b8ff9', '#5ad8a6', '#5d7092', '#f6bd16', '#6f5ef9', '#6dc8ec', '#945fb9', '#ff9845', '#1e9493'],\n legend: {\n icon: 'circle',\n orient: 'vertical',\n right: 25,\n top: 'center',\n bottom: 20,\n textStyle: {\n color: '#ccc'\n }\n },\n series: [{\n type: 'pie',\n selectedMode: 'single',\n radius: [0, '50%'],\n label: {\n // show: false,\n formatter: function formatter(a) {\n if (a.value > 0) {\n return \"{name|\".concat(a.name, \"\\u903E\\u671F}\");\n } else {\n return '';\n }\n },\n minMargin: 5,\n edgeDistance: 80,\n rich: {\n name: {\n fontSize: 12,\n color: '#fff'\n }\n },\n position: 'inner'\n },\n tooltip: {\n trigger: 'item',\n formatter: function formatter(a) {\n return \"\".concat(a.marker, \" \").concat(a.data.name, \"\\u903E\\u671F \").concat(a.data.value, \"\\u4E2A \").concat(a.percent, \"%\");\n }\n },\n labelLine: {\n show: false\n },\n data: innerData\n }, {\n type: 'pie',\n radius: ['40%', '60%'],\n // center: ['45%', '50%'],\n data: data,\n label: {\n alignTo: 'edge',\n minMargin: 5,\n edgeDistance: '15%',\n formatter: function formatter(a) {\n return \"{percent|\".concat(a.percent, \"%}\");\n },\n rich: {\n percent: {\n fontSize: 15,\n color: '#fff'\n }\n }\n }\n }]\n };\n option && myChart.setOption(option);\n },\n cloumnCharts: function cloumnCharts(data) {\n var _legend;\n var chartDom = document.getElementById('column');\n var myChart = echarts.init(chartDom);\n var option;\n var xData = [];\n var finishData = [];\n var distributionData = [];\n var constructionData = [];\n var checkData = [];\n var examineData = [];\n var overdueData = [];\n var allData = [];\n data.forEach(function (item) {\n xData.push(item.name);\n finishData.push(item.finishCount);\n distributionData.push(item.distributionCount);\n constructionData.push(item.constructionCount);\n checkData.push(item.checkCount);\n examineData.push(item.examineCount);\n overdueData.push(item.overdueCount);\n allData.push(item.allCount);\n });\n option = {\n title: {\n textStyle: {\n color: '#fff'\n }\n },\n grid: {\n top: '20%',\n left: '10%',\n right: '10%',\n bottom: '20%'\n },\n legend: (_legend = {\n itemHeight: 10,\n itemWidth: 10,\n bottom: 'bottom'\n }, _defineProperty(_legend, \"bottom\", '8%'), _defineProperty(_legend, \"textStyle\", {\n color: '#fff'\n }), _legend),\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'none'\n }\n },\n color: ['#5b8ff9', '#5ad8a6', '#5d7092', '#f6bd16', '#6f5ef9', '#6dc8ec', '#945fb9', '#ff9845', '#1e9493'],\n xAxis: {\n type: 'category',\n data: xData,\n axisLabel: {\n fontSize: 14,\n color: '#B8C2CC'\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n },\n yAxis: {\n name: '单位:个',\n nameTextStyle: {\n color: '#B8C2CC',\n nameLocation: 'start',\n fontSize: 18,\n fontWeight: 700\n },\n type: 'value',\n splitLine: {\n show: false\n },\n //去除网格线\n axisLabel: {\n textStyle: {\n color: '#B8C2CC'\n }\n },\n axisTick: {\n //y轴刻度线\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n //y轴\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n },\n series: [{\n name: '已完成',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: finishData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n name: '派单中',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: distributionData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n name: '施工中',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: constructionData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n name: '施工单位验收',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: checkData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n name: '审核中',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: examineData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n name: '已逾期',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: overdueData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n name: '总数',\n type: 'bar',\n stack: 'Ad',\n barWidth: '15%',\n data: allData,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }]\n };\n option && myChart.setOption(option);\n },\n getAmountStatisticsChart: function getAmountStatisticsChart(data) {\n var chartDom = document.getElementById('pie2');\n var myChart = echarts.init(chartDom);\n var data_ = [];\n data.forEach(function (item) {\n data_.push({\n value: item.percent,\n name: item.pname,\n money: item.money,\n count: item.pnameCount\n });\n });\n var option = {\n title: {\n textStyle: {\n color: '#fff'\n }\n },\n legend: {\n orient: 'vertical',\n right: 30,\n top: 'center',\n bottom: 20,\n show: false,\n textStyle: {\n color: '#fff'\n }\n },\n tooltip: {\n trigger: 'item',\n formatter: function formatter(a) {\n return \"\".concat(a.marker, \" \").concat(a.data.name, \" \\u603B\\u989D:\").concat(a.data.money, \"\\u4E07\\u5143 \\u5360\\u6BD4:\").concat(a.data.value, \"%\");\n }\n },\n color: ['#16ffae', '#00e6f6', '#6255f8', '#0282b9'],\n series: [{\n type: 'pie',\n radius: ['40%', '60%'],\n data: data_,\n // width: '75%',\n center: ['50%', '50%'],\n minAngle: 10,\n // 设置每块扇形的最小占比\n label: {\n alignTo: 'edge',\n // show: false,\n // formatter: '{name|{b}}{money|{}}\\n\\n{percent|{c} %}',\n formatter: function formatter(a) {\n console.log(a, '333');\n return \"{name|\".concat(a.data.name, \"} {count|\").concat(a.data.count, \" \\u4E2A} {money|\").concat(a.data.money, \" \\u4E07\\u5143} {percent|\").concat(a.data.value, \" %}\");\n },\n minMargin: 5,\n edgeDistance: 80,\n // lineHeight: 18,\n rich: {\n name: {\n fontSize: 18,\n color: '#fff'\n },\n money: {\n fontSize: 14,\n color: '#fff'\n },\n count: {\n fontSize: 14,\n color: '#fff'\n },\n percent: {\n fontSize: 14,\n color: '#fff'\n }\n }\n }\n }]\n };\n option && myChart.setOption(option);\n }\n }\n};",null]}