Compare commits
	
		
			100 Commits
		
	
	
		
			be75dd0702
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b31b67d2ed | |||
| fc21359f8f | |||
| be6d84daf5 | |||
| daaec2417c | |||
| dcf4f6c392 | |||
| d27e56cd7f | |||
|  | 445ebe339d | ||
|  | 353e3e0f35 | ||
| ea29a33c2a | |||
|  | d5673f3c9f | ||
|  | 3064722052 | ||
|  | dfe52cbac5 | ||
| 68e386333b | |||
|  | 96d55b5a57 | ||
|  | fb74340f0f | ||
| b1ddfa5c0d | |||
|  | f7b151f9aa | ||
|  | 51938926d3 | ||
| 588037c45c | |||
|  | 354031f119 | ||
|  | 44c5271b5a | ||
| 241810d1c8 | |||
|  | 92a297a5e9 | ||
|  | f67e781146 | ||
| e310c5465e | |||
|  | f2cfe94dfc | ||
|  | 92c0c33fbd | ||
| 0a391a4de5 | |||
|  | 8be57f586e | ||
|  | 4e5a5f9ba2 | ||
| a78c3d79f1 | |||
|  | 3c5163bd66 | ||
|  | 8437d52c1b | ||
| ca0a0142db | |||
| 703334ac3c | |||
| 3897f35d28 | |||
| 3c6e408074 | |||
| a9392c8999 | |||
|  | 196a615f61 | ||
|  | 8395f37371 | ||
|  | 5e703350e1 | ||
| 266604878b | |||
|  | 0c2221b373 | ||
|  | 0992940655 | ||
| 7e1b0f8725 | |||
| 8f8d0396b7 | |||
| 582484f6db | |||
| b259cdb545 | |||
| b6aa6a19f4 | |||
| a9e176be74 | |||
| a237c66901 | |||
|  | c7205e32a3 | ||
|  | b180bac226 | ||
|  | 670d7e5600 | ||
| 69b3e7de2e | |||
|  | 0eb17fa08b | ||
|  | cc800eae5d | ||
|  | 6be1a83dd8 | ||
| 033d61ea96 | |||
| 4fb88a5201 | |||
| 0e60ba7dc8 | |||
| 1969cd3ada | |||
|  | 510f12e40b | ||
|  | 7a67da105f | ||
| 6c145579cb | |||
| e512ad5858 | |||
| a7b13c6a8f | |||
| 0655eafb1d | |||
| ce350c0c7f | |||
| abfd20bac6 | |||
| 7ba831f496 | |||
| 78d387b2c6 | |||
|  | 15d3b3622c | ||
|  | c8bc54e04b | ||
| a5d0970fa0 | |||
|  | 2368916e62 | ||
|  | 2d5bd161f3 | ||
| ff424ca1b6 | |||
| 9de0dfc639 | |||
| fc0a97a9c6 | |||
| 45538e80c4 | |||
| 6233ca4dca | |||
|  | 41d554f897 | ||
|  | d95853dec2 | ||
|  | eacf93e0db | ||
| 1e941180b0 | |||
|  | 7f379f2589 | ||
|  | e990680159 | ||
| d6cb371c68 | |||
|  | 731243636f | ||
|  | 14c782f112 | ||
| 2b3db710c1 | |||
|  | 0ef7c9808c | ||
|  | f241a35252 | ||
| e9d17e0f82 | |||
|  | e1e39681ce | ||
|  | 2d49bfe10e | ||
| 6bd65b19f9 | |||
|  | 03dd862cb4 | ||
|  | f14e9d7408 | 
							
								
								
									
										16
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								.env.dev
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | ||||
| ### | ||||
|  # @Author: zhp | ||||
|  # @Date: 2024-04-28 13:42:51 | ||||
|  # @LastEditTime: 2024-06-11 08:33:19 | ||||
|  # @LastEditors: zhp | ||||
|  # @LastEditTime: 2024-06-24 16:57:53 | ||||
|  # @LastEditors: DY | ||||
|  # @Description: | ||||
| ### | ||||
| # 开发环境配置 | ||||
| @@ -13,13 +13,19 @@ VUE_APP_TITLE = 发电玻璃智能管控平台 | ||||
|  | ||||
| # 芋道管理系统/开发环境 | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.70:30307' | ||||
| # VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' | ||||
| VUE_APP_BASE_API = 'http://192.168.1.56:48080' | ||||
| VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' | ||||
| # 闫阳 | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.81:48080' | ||||
| # 徐 | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.56:48080' | ||||
| # 郭 | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.61:48080' | ||||
| # sara | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.63:48080' | ||||
| # 张一丁 | ||||
| # VUE_APP_BASE_API = 'http://192.168.4.139:48080' | ||||
|  | ||||
| # 蔡 | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.54:48080' | ||||
| # 路由懒加载 | ||||
| VUE_CLI_BABEL_TRANSPILE_MODULES = true | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| /* | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-05-07 08:54:59 | ||||
|  * @LastEditTime: 2024-06-03 08:52:02 | ||||
|  * @LastEditTime: 2024-06-19 15:22:10 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
|  */ | ||||
| @@ -10,23 +10,33 @@ import request from '@/utils/request' | ||||
| // 查询生产数据管理分页 | ||||
| export function getProduceDataPage(data) { | ||||
|   return request({ | ||||
|     url: 'ip/prod-output/prodOutputDataPage', | ||||
|     url: '/ip/proddata/page', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getProduceDataDetail(id){ | ||||
| // 查询图数据 | ||||
| export function getproddata(data) { | ||||
|   return request({ | ||||
|      url: '/ip/prod-output/get?id=' + id, | ||||
|     method: 'get' | ||||
|     url: '/ip/proddata/list', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getProduceDataDetail(data){ | ||||
|   return request({ | ||||
|     url: '/ip/proddata/get', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 导出生产数据 | ||||
| export function exportOutPutExcel(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/output-export-excel', | ||||
|     url: '/ip/proddata/export-excel', | ||||
|     method: 'post', | ||||
|     data: data, | ||||
|     responseType: 'blob' | ||||
|   | ||||
| @@ -1,6 +1,115 @@ | ||||
| // 对标报表的接口 | ||||
| import request from '@/utils/request' | ||||
|  | ||||
| // 产量对标FTO | ||||
| export function fTOReportByDateRangePage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/queryOBFTOReportByDateRange', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 产量对标FTO导出 | ||||
| export function fTOReportByDateRangeExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/queryOBFTOReportByDateRangeExcel', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 芯片产量对标 | ||||
| export function cPReportByDateRangePage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/queryCPReportByDateRange', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 芯片产量对标导出 | ||||
| export function cPReportByDateRangeExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/queryCPReportByDateRangeExport', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 标准组件产量对标 | ||||
| export function sCPReportByDateRangePage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/querySCPReportByDateRange', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 标准组件产量对标导出 | ||||
| export function sCPReportByDateRangeExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/querySCPReportByDateRangeExport', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 转化效率对标 | ||||
| export function componentconvertrateCPage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/componentconvertrate-compare/page', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 转化效率对标导出 | ||||
| export function componentconvertrateCExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/componentconvertrate-compare/export-excel', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 芯片良率对标 | ||||
| export function chipyieldRatePage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/chipyield-rate/page', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 芯片良率对标导出 | ||||
| export function chipyieldRateExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/chipyield-rate/export-excel', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 标准组件良率对标 | ||||
| export function componentyieldRatePage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/componentyield-rate/page', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 标准组件良率对标导出 | ||||
| export function componentyieldRateExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/componentyield-rate/export-excel', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
|  | ||||
| // 稼动率对标 | ||||
| export function utilzationComparePage(data) { | ||||
|   return request({ | ||||
| @@ -35,4 +144,76 @@ export function chipoeeCompareExport(data) { | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 封装OEE对标 | ||||
| export function componentOEEPage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/component-oee/page', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 封装OEE对标导出 | ||||
| export function componentOEEExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/component-oee/export', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 芯片人均产量 | ||||
| export function chipAnnualAverageProductionPage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/chip-annual-average-production/page', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 芯片人均产量导出 | ||||
| export function chipAnnualAverageProductionExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/chip-annual-average-production/export', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 标准组件人均产量对标 | ||||
| export function componentAapPage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/componentAap', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 标准组件人均产量对标导出 | ||||
| export function componentAapExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/componentAap-export', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 指标完成情况对标 | ||||
| export function targetCompletionPage(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/TargetCompletion', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 指标完成情况对标导出 | ||||
| export function targetCompletionExport(data) { | ||||
|   return request({ | ||||
|     url: '/ip/prod-output/TargetCompletion-export', | ||||
|     method: 'post', | ||||
|     responseType: 'blob', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
							
								
								
									
										95
									
								
								src/api/report/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								src/api/report/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,95 @@ | ||||
| /* | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-17 09:41:03 | ||||
|  * @LastEditTime: 2024-06-20 15:39:21 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
| export function getComprehensiveDataPage(data) { | ||||
|   return request({ | ||||
|     url: 'ip/comprehensive/data/get/comprehensive/data', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function exportComprehensiveDataPage(data) { | ||||
|    return request({ | ||||
|     url: 'ip/comprehensive/data/export/comprehensive/data', | ||||
|     method: 'post', | ||||
|     data: data, | ||||
|     responseType: 'blob', | ||||
|   }) | ||||
| } | ||||
|  | ||||
|  | ||||
| export function getProduceTransData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/prod-output/queryYCEReportByDateRange', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function exportProduceTransData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/prod-output/queryYCEReportByDateRangeExcel', | ||||
|     method: 'post', | ||||
|     data: data, | ||||
|     responseType: 'blob', | ||||
|   }) | ||||
| } | ||||
|  | ||||
|  | ||||
| export function getProduceSituationData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/production/situation/get/production/situation', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function exportProduceSituationData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/production/situation/export/production/situation', | ||||
|     method: 'post', | ||||
|      data: data, | ||||
|       responseType: 'blob', | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getProductionSituationMWData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/production/situation/power/get/production/situation', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function exportProductionSituationMWData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/production/situation/power/export/production/situation', | ||||
|     method: 'post', | ||||
|      data: data, | ||||
|       responseType: 'blob', | ||||
|   }) | ||||
| } | ||||
|  | ||||
|  | ||||
| export function getProductionYieldSituationMWData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/product/yield/get/production/situation', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function exportProductionYieldSituationMWData(data) { | ||||
|    return request({ | ||||
|     url: 'ip/product/yield/export/production/situation', | ||||
|     method: 'post', | ||||
|     data: data, | ||||
|     responseType: 'blob', | ||||
|   }) | ||||
| } | ||||
							
								
								
									
										17
									
								
								src/assets/icons/svg/factoryWorkOrder.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/assets/icons/svg/factoryWorkOrder.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||||
|     <title>编组 15</title> | ||||
|     <g id="03设备管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> | ||||
|         <g id="工单管理" transform="translate(-714.000000, -131.000000)"> | ||||
|             <g id="编组-15" transform="translate(714.000000, 131.000000)"> | ||||
|                 <g id="编组-13备份" fill="#0B58FF" opacity="0.227236793"> | ||||
|                     <rect id="矩形备份-2" x="0" y="0" width="26" height="26" rx="6"></rect> | ||||
|                 </g> | ||||
|                 <g id="公司" transform="translate(4.749735, 4.749735)" fill-rule="nonzero"> | ||||
|                     <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16.50053" height="16.50053"></rect> | ||||
|                     <path d="M11.933204,3.46511501 L11.933204,1 C11.933204,0.44771525 11.4854888,-1.01453063e-16 10.933204,0 L7.7088886,0 L7.7088886,0 C3.83109495,0 0.687522083,3.16186639 0.687522083,7.06222625 L0.687522083,15.50053 C0.687522083,16.0528147 1.13523733,16.50053 1.68752208,16.50053 L14.8130079,16.50053 C15.3652927,16.50053 15.8130079,16.0528147 15.8130079,15.50053 L15.8130079,6.45996015 L15.8130079,6.45996015 L11.933204,3.46511501 Z M10.8812851,15.4709239 L1.80917527,15.4709239 L1.80917527,6.9505448 C1.81175925,3.6815283 4.55432163,1.03209261 7.93823277,1.02960612 L10.8812851,1.02960612 L10.8812851,15.4709239 Z M14.8298514,15.4709239 L11.9257773,15.4709239 L11.9257773,5.179727 L14.850314,7.12879718 L14.8298514,15.4709239 Z M3.75976827,9.04329837 L8.75976827,9.04329837 L8.75976827,10.3766317 L3.75976827,10.3766317 L3.75976827,9.04329837 Z M3.75976827,6.3766317 L8.75976827,6.3766317 L8.75976827,7.70996504 L3.75976827,7.70996504 L3.75976827,6.3766317 Z" id="形状" fill="#0B58FF"></path> | ||||
|                 </g> | ||||
|             </g> | ||||
|         </g> | ||||
|     </g> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 1.9 KiB | 
							
								
								
									
										15
									
								
								src/assets/icons/svg/workProcess.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/assets/icons/svg/workProcess.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||||
|     <title>编组 13</title> | ||||
|     <g id="03设备管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> | ||||
|         <g id="工单管理" transform="translate(-474.000000, -131.000000)"> | ||||
|             <g id="编组-13" transform="translate(474.000000, 131.000000)"> | ||||
|                 <rect id="矩形备份-2" fill="#66DD89" opacity="0.227236793" x="0" y="0" width="26" height="26" rx="6"></rect> | ||||
|                 <g id="机床、加工中心" transform="translate(3.000000, 3.000000)" fill-rule="nonzero"> | ||||
|                     <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="20" height="20"></rect> | ||||
|                     <path d="M18.1818304,15.1909171 L18.1818304,2.5 C18.1818304,2.22385763 17.9579728,2 17.6818304,2 L2.7272736,2 C2.45113122,2 2.2272736,2.22385763 2.2272736,2.5 L2.2272736,10.195451 C2.2272736,10.3084167 2.31885035,10.3999934 2.431816,10.3999934 C2.54478165,10.3999934 2.63635841,10.4915702 2.63635841,10.6045358 L2.63635841,10.999993 C2.63635841,11.3313636 2.90498735,11.5999925 3.23635794,11.5999925 L3.24999521,11.5999925 C3.58889745,11.5999925 3.86363201,11.8747271 3.86363201,12.2136293 L3.86363201,12.7909094 C3.86363201,13.016846 4.04678981,13.2000037 4.2727264,13.2000037 C4.498663,13.2000037 4.6818208,13.016846 4.6818208,12.7909094 L4.6818208,12.2136293 C4.6818208,11.8747271 4.95655535,11.5999925 5.2954576,11.5999925 L5.30909486,11.5999925 C5.64046546,11.5999925 5.9090944,11.3313636 5.9090944,10.999993 L5.9090944,10.6045358 C5.9090944,10.4915702 6.00067115,10.3999934 6.1136368,10.3999934 C6.22660245,10.3999934 6.3181792,10.3084167 6.3181792,10.195451 L6.3181792,6.5 C6.3181792,6.22385763 6.54203683,6 6.8181792,6 L12.772736,6 C13.0488784,6 13.272736,6.22385763 13.272736,6.5 L13.272736,15.1000019 C13.272736,15.3761442 13.0488784,15.6000019 12.772736,15.6000019 L11.7272736,15.6000019 C11.4511312,15.6000019 11.2272736,15.3761442 11.2272736,15.1000019 L11.2272736,14.8000009 C11.2272736,14.3581726 10.869101,14 10.4272727,14 L8.75453855,14 C8.31271023,14 7.95453761,14.3581726 7.95453761,14.8000009 L7.95453761,15.1000019 C7.95453761,15.3761442 7.73067998,15.6000019 7.45453761,15.6000019 L6.4090944,15.6000019 C6.13295202,15.6000019 5.9090944,15.3761442 5.9090944,15.1000019 L5.9090944,14.8000009 C5.9090944,14.3581726 5.55092178,14 5.10909346,14 L3.43635934,14 C2.99453103,14 2.63635841,14.3581726 2.63635841,14.8000009 L2.63635841,15.1000019 C2.63635841,15.3761442 2.41250078,15.6000019 2.13635841,15.6000019 L1.8181792,15.6000019 C1.36631131,15.6000019 1,15.9663132 1,16.4181811 L1,17.5 C1,17.7761424 1.22385763,18 1.5,18 L18.5,18 C18.7761424,18 19,17.7761424 19,17.5 L19,16.0090867 C19,15.7831554 18.8168465,15.6000019 18.5909152,15.6000019 C18.3649839,15.6000019 18.1818304,15.4168484 18.1818304,15.1909171 Z M5.0909056,10.8000056 L3.4545472,10.8000056 L3.4545472,10.3999934 L5.0909056,10.3999934 L5.0909056,10.8000056 Z M5.49999041,6.20000375 L5.49999041,9.60000656 L5.49999041,9.60000656 L3.04544321,9.60000656 L3.04544321,2.80000562 L17.3636416,2.80000562 L17.3636416,15.6000019 L14.0909056,15.6000019 L14.0909056,6.20000375 C14.0909056,5.647719 13.6431904,5.20000375 13.0909056,5.20000375 L6.49999041,5.20000375 C5.94770566,5.20000375 5.49999041,5.647719 5.49999041,6.20000375 Z M8.7727264,14.7999963 L10.4090848,14.7999963 L10.4090848,15.6000019 L8.7727264,15.6000019 L8.7727264,14.7999963 Z M3.4545472,14.7999963 L5.0909056,14.7999963 L5.0909056,15.6000019 L3.4545472,15.6000019 L3.4545472,14.7999963 Z M18.1818304,17.1999944 L1.81816962,17.1999944 L1.81816962,16.3999888 L18.1818304,16.3999888 L18.1818304,17.1999944 Z M12.0454528,4.00000469 C12.0440427,4.28673847 12.1996755,4.55228735 12.4534043,4.69605646 C12.707133,4.83982557 13.0201502,4.83982557 13.2738789,4.69605646 C13.5276077,4.55228735 13.6832405,4.28673847 13.6818304,4.00000469 C13.6832405,3.71327091 13.5276077,3.44772202 13.2738789,3.30395291 C13.0201502,3.1601838 12.707133,3.1601838 12.4534043,3.30395291 C12.1996755,3.44772202 12.0440427,3.71327091 12.0454528,4.00000469 L12.0454528,4.00000469 Z M5.49999041,3.60001125 L11.2272736,3.60001125 L11.2272736,4.39999813 L5.49999041,4.39999813 L5.49999041,3.60001125 Z M15.3181792,11.5999925 L16.136368,11.5999925 L16.136368,14.7999963 L15.3181792,14.7999963 L15.3181792,11.5999925 Z M15.3181792,9.19999438 L16.136368,9.19999438 L16.136368,10.8000056 L15.3181792,10.8000056 L15.3181792,9.19999438 Z M15.3181792,6.79999625 L16.136368,6.79999625 L16.136368,8.4000075 L15.3181792,8.4000075 L15.3181792,6.79999625 Z" id="形状" fill="#43B866"></path> | ||||
|                 </g> | ||||
|             </g> | ||||
|         </g> | ||||
|     </g> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 4.7 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/assets/images/map.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/assets/images/map.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 8.5 MiB | 
| @@ -232,6 +232,8 @@ aside { | ||||
|   background-color: #d9d9d9; | ||||
| } | ||||
|  | ||||
| // 大屏滚动表格 | ||||
|  | ||||
| .no-data-bg { | ||||
|   position: absolute; | ||||
|   display: inline-block; | ||||
| @@ -252,3 +254,13 @@ aside { | ||||
|     letter-spacing: 1px; | ||||
|   } | ||||
| } | ||||
|  | ||||
| .dv-scroll-board .rows .ceil, | ||||
| .dv-scroll-board .header .header-item { | ||||
|   border-right: 1px solid rgba(13, 23, 40, 1); | ||||
| } | ||||
|  | ||||
| .dv-scroll-board .rows .ceil:last-child, | ||||
| .dv-scroll-board .header .header-item:last-child { | ||||
|   border-right: none; | ||||
| } | ||||
|   | ||||
| @@ -289,7 +289,7 @@ function splitCurrentAndPreviousB(factoryListResponse) { | ||||
| } | ||||
|  | ||||
| function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodOutputFtoListRes,preData,preFtoData) { | ||||
|   console.log('工厂',targetListResponse); | ||||
|   console.log('工厂',preData); | ||||
|  | ||||
|   // 初始数据 | ||||
|   const { chipOeeRate, transformRate, chipRate, stdRate } = initA(); | ||||
| @@ -343,17 +343,24 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO | ||||
|   //     componentYieldRate: 0.73, | ||||
|   //   }, | ||||
|   // ]; | ||||
|   if (preData && preData[0] != null) { | ||||
|   if (preData) { | ||||
|     for (const factory of preData) { | ||||
|       const fId = getPreFactoryId(factory); | ||||
|       const fId = getPreFactoryId(factory) | ||||
|       console.log('factory',factory.previousYearOee); | ||||
|         //  chipInvest.previous[fId] = factory.previousYearInputNumber; | ||||
|       // chipOeeRate.current[fId] = factory.oee; | ||||
|       chipOeeRate.previous[fId] = factory.previousYearOee; | ||||
|       if (factory.previousGlassType === 0) { | ||||
|          chipOeeRate.previous[fId] = factory.previousYearOee; | ||||
|       } | ||||
|       // chipOeeRate.previous[fId] = factory.previousYearOee; | ||||
|       // 转化效率 | ||||
|       transformRate.previous[fId] =factory.previousYearComponentConversionEfficiency ; | ||||
|         if (factory.previousGlassType === 1) { | ||||
|         transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency; | ||||
|       } | ||||
|       // transformRate.previous[fId] =factory.previousYearComponentConversionEfficiency ; | ||||
|       // 芯片良率 与 标准组件良率 | ||||
|       if (![0, 1].includes(factory.glassType)) continue; | ||||
|       const _t = [chipRate, stdRate][factory.glassType] | ||||
|       if (![0, 1].includes(factory.previousGlassType)) continue; | ||||
|       const _t = [chipRate, stdRate][factory.previousGlassType] | ||||
|       // _t.current[fId] = factory.yieldRate ; | ||||
|       _t.previous[fId] = factory.previousYearYieldRate ; | ||||
|       // } | ||||
| @@ -378,10 +385,14 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO | ||||
|         transformRate.target[fId] = componentConversionEfficiency | ||||
|       } | ||||
|       // 芯片OEE | ||||
|       chipOeeRate.current[fId] = factory.oee; | ||||
|       if (factory.glassType === 0) { | ||||
|          chipOeeRate.current[fId] = factory.oee; | ||||
|       } | ||||
|       // chipOeeRate.previous[fId] = factory.previousYearOee; | ||||
|       // 转化效率 | ||||
|       transformRate.current[fId] = factory.componentConversionEfficiency; | ||||
|       if (factory.glassType === 1) { | ||||
|         transformRate.current[fId] = factory.componentConversionEfficiency; | ||||
|       } | ||||
|       // transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency ; | ||||
|       // 芯片良率 与 标准组件良率 | ||||
|       if (![0, 1].includes(factory.glassType)) continue; | ||||
| @@ -389,6 +400,7 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO | ||||
|       _t.current[fId] = factory.yieldRate ; | ||||
|       // _t.previous[fId] = factory.previousYearYieldRate ; | ||||
|     } | ||||
|     console.log('chipOeeRate',stdRate); | ||||
|     // console.log('chipOeeRate',chipOeeRate); | ||||
|     return { | ||||
|       chipOeeRate, | ||||
| @@ -403,7 +415,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu | ||||
|   console.log('prodOutputFtoListRes',preFtoData); | ||||
|   // 初始数据 | ||||
|   const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init() | ||||
|    if (prodOutputFtoListRes) { | ||||
|    if (prodOutputFtoListRes.length !== 0 ) { | ||||
|     for (const factory of prodOutputFtoListRes) { | ||||
|       console.log(factory); | ||||
|       const fId = getFactoryId(factory); | ||||
| @@ -429,10 +441,13 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu | ||||
|       // } | ||||
|     } | ||||
|    } | ||||
|     if (preData && preData[0] != null) { | ||||
|     if (preData) { | ||||
|     for (const factory of preData) { | ||||
|       const fId = getPreFactoryId(factory); | ||||
|          chipInvest.previous[fId] = factory.previousYearInputNumber; | ||||
|       if (factory.previousGlassType === 0) { | ||||
|       chipInvest.previous[fId] = factory.previousYearInputNumber | ||||
|       } | ||||
|         //  chipInvest.previous[fId] = factory.previousYearInputNumber; | ||||
|       if (![0, 1, 2].includes(factory.previousGlassType)) continue; | ||||
|       const _t = [chipOutput, stdOutput, bipvOutput][factory.previousGlassType]; | ||||
|       // if (fId) { | ||||
| @@ -445,11 +460,14 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu | ||||
|     } | ||||
|   } | ||||
|     // console.log('ftoInvest',ftoInvest) | ||||
|   if (factoryListResponse && factoryListResponse[0] != null) { | ||||
|   if (factoryListResponse) { | ||||
|     for (const factory of factoryListResponse) { | ||||
|       const fId = getFactoryId(factory); | ||||
|       console.log('factory.inputNumber', factory, fId); | ||||
|       if (factory.glassType === 0) { | ||||
|       chipInvest.current[fId] = factory.inputNumber | ||||
|       } | ||||
|       // const preFId = getPreFactoryId(factory); | ||||
|  | ||||
|       // 获取目标值 | ||||
|       if (targetListResponse) { | ||||
|         const { chipYield, componentYield, bipvProductOutput } = | ||||
| @@ -459,7 +477,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu | ||||
|         bipvOutput.target[fId] = bipvProductOutput; | ||||
|       } | ||||
|       // 芯片投入 | ||||
|           chipInvest.current[fId] = factory.inputNumber; | ||||
|  | ||||
|       // 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出 | ||||
|       // 因为后端写的垃圾数据,所以这里要做一下判断 | ||||
| @@ -467,6 +484,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu | ||||
|       const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType]; | ||||
|         _t.current[fId] = factory.outputNumber; | ||||
|     } | ||||
|     console.log('chipInvest',ftoInvest); | ||||
|     return { | ||||
|       chipInvest, | ||||
|       // ftoInvest, | ||||
| @@ -475,15 +493,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu | ||||
|       stdOutput, | ||||
|       bipvOutput, | ||||
|     }; | ||||
|   }else{ | ||||
|       return { | ||||
|       chipInvest, | ||||
|       // ftoInvest, | ||||
|       ftoInvest, | ||||
|       chipOutput, | ||||
|       stdOutput, | ||||
|       bipvOutput, | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -163,4 +163,4 @@ textarea { | ||||
|  | ||||
| .el-upload__tip { | ||||
|   line-height: 1.2; | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -143,6 +143,8 @@ export const tyjxfactoryList =[ | ||||
|  | ||||
| // 暂时只有瑞昌邯郸数据 | ||||
| export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司'] | ||||
|  | ||||
| export const factoryListabbr =['瑞昌', '邯郸'] | ||||
| export const factoryArray =[ | ||||
|   { | ||||
|     name: '瑞昌中建材光电材料有限公司', | ||||
|   | ||||
| @@ -63,14 +63,22 @@ export default { | ||||
|   computed: {}, | ||||
|   methods: { | ||||
|     handleExport() { | ||||
|       exportFactoryDataExcel({ | ||||
|         factoryId: this.companyId, | ||||
|         timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3, | ||||
|         compare: this.than === '同比' ? 1 : 2 | ||||
|       }).then(response => { | ||||
|         this.$download.excel(response, `${this.companyName}生产数据.xls`); | ||||
|       // this.exportLoading = false; | ||||
|     }).catch(() => { }); | ||||
|       if (this.period != 1) { | ||||
|         exportFactoryDataExcel({ | ||||
|           factoryId: this.companyId, | ||||
|           timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3, | ||||
|           compare: this.than === '同比' ? 1 : 2 | ||||
|         }).then(response => { | ||||
|           this.$download.excel(response, `${this.companyName}生产数据.xls`); | ||||
|           // this.exportLoading = false; | ||||
|         }).catch(() => { }); | ||||
|       } else { | ||||
|         this.$message({ | ||||
|           type: 'warning', | ||||
|           message: '为日的情况下没有导出功能', | ||||
|         }) | ||||
|       } | ||||
|  | ||||
|     }, | ||||
|     toggleFullScreen() { | ||||
|       this.isFullscreen = !this.isFullscreen; | ||||
| @@ -107,7 +115,7 @@ export default { | ||||
|   gap: 8px; | ||||
| } | ||||
| .factory-header > .menu2 { | ||||
|   width: 26vw; | ||||
|   width: 20vw; | ||||
|   display: flex; | ||||
|   justify-content: flex-end; | ||||
|   align-items: center; | ||||
|   | ||||
| @@ -47,8 +47,11 @@ export default { | ||||
|     legend() { | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -60,23 +63,28 @@ export default { | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|           { label: `${yesterday}日目标`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${dayBeYes}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|           { label: `${yesterday}日目标`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年本周`, color: "#12f7f1" }, | ||||
|           { label: `本周`, color: "#58adfa" }, | ||||
|           { label: `本周目标`, color: "#58adfa" }, | ||||
|  | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `上周`, color: "#12f7f1" }, | ||||
|           { label: `本周`, color: "#58adfa" }, | ||||
|           { label: `本周目标`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '月' && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -96,7 +104,7 @@ export default { | ||||
|         items = [ | ||||
|           { label: `${year - 1}年`, color: "#12f7f1" }, | ||||
|           { label: `${year}年`, color: "#58adfa" }, | ||||
|           { label:  `${year}年`, color: "#58adfa" }, | ||||
|           { label:  `${year}年目标`, color: "#58adfa" }, | ||||
|  | ||||
|           // { label: `${year}年目标`, value: valueTuple[2] }, | ||||
|         ]; | ||||
| @@ -138,14 +146,6 @@ export default { | ||||
|       // console.log('chipOee', chipOeeRate) | ||||
|       let dataList = null | ||||
|       switch (this.period) { | ||||
|         case "日": | ||||
|           dataList = []; | ||||
|           dataList[0] = chipOeeRate?.previous; | ||||
|           dataList[1] = chipOeeRate?.current; | ||||
|         case "周": | ||||
|           dataList = []; | ||||
|           dataList[0] = chipOeeRate?.previous; | ||||
|           dataList[1] = chipOeeRate?.current; | ||||
|           default: | ||||
|           dataList = []; | ||||
|           dataList[0] = chipOeeRate?.previous; | ||||
| @@ -163,8 +163,11 @@ function getTemplate(period, dataList, than) { | ||||
|   // console.log('dataList',dataList); | ||||
|   let items = []; | ||||
|   var day1 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   var day2 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|   day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|   var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|   //今天的时间 | ||||
|   // var day2 = new Date(); | ||||
|   // day2.setTime(day2.getTime()); | ||||
| @@ -177,26 +180,36 @@ function getTemplate(period, dataList, than) { | ||||
|   if (period === '日' && than === '同比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${year-1}年${month}月${today}日`, | ||||
|         name: `${year - 1}年${yesterday}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `${yesterday}日目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '日' && than === '环比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${yesterday}日`, | ||||
|         name: `${dayBeYes}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `${yesterday}日目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '周' && than === '同比') { | ||||
|     items = [ | ||||
| @@ -209,6 +222,11 @@ function getTemplate(period, dataList, than) { | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `本周目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '周' && than === '环比') { | ||||
|     items = [ | ||||
| @@ -221,6 +239,11 @@ function getTemplate(period, dataList, than) { | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `本周目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '月' && than === '同比') { | ||||
|     items = [ | ||||
|   | ||||
| @@ -47,8 +47,11 @@ export default { | ||||
|     legend() { | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -60,23 +63,28 @@ export default { | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|           { label: `${yesterday}日目标`, color: "#58adfa" }, | ||||
|  | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${dayBeYes}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|           { label: `${yesterday}日目标`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年本周`, color: "#12f7f1" }, | ||||
|           { label: `本周`, color: "#58adfa" }, | ||||
|           { label: `本周目标`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `上周`, color: "#12f7f1" }, | ||||
|           { label: `本周`, color: "#58adfa" }, | ||||
|           { label: `本周目标`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '月' && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -96,7 +104,7 @@ export default { | ||||
|         items = [ | ||||
|           { label: `${year - 1}年`, color: "#12f7f1" }, | ||||
|           { label: `${year}年`, color: "#58adfa" }, | ||||
|           { label: `${year}年`, color: "#58adfa" }, | ||||
|           { label: `${year}年目标`, color: "#58adfa" }, | ||||
|  | ||||
|           // { label: `${year}年目标`, value: valueTuple[2] }, | ||||
|         ]; | ||||
| @@ -109,17 +117,9 @@ export default { | ||||
|     series() { | ||||
|       // console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee); | ||||
|       const transformRate = this.transformRate | ||||
|       // console.log('chipOee', chipOeeRate) | ||||
|       console.log('chipOee', transformRate) | ||||
|       let dataList = null; | ||||
|       switch (this.period) { | ||||
|         case "日": | ||||
|           dataList = []; | ||||
|           dataList[0] = transformRate.previous; | ||||
|           dataList[1] = transformRate.current; | ||||
|         case "周": | ||||
|           dataList = []; | ||||
|           dataList[0] = transformRate.previous; | ||||
|           dataList[1] = transformRate.current; | ||||
|         default: | ||||
|           dataList = []; | ||||
|           dataList[0] = transformRate.previous; | ||||
| @@ -154,8 +154,11 @@ function getTemplate(period, dataList,than) { | ||||
|   // console.log('dataList',dataList); | ||||
|   let items = []; | ||||
|   var day1 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   var day2 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|   day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|   var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|   //今天的时间 | ||||
|   // var day2 = new Date(); | ||||
|   // day2.setTime(day2.getTime()); | ||||
| @@ -168,26 +171,36 @@ function getTemplate(period, dataList,than) { | ||||
|   if (period === '日' && than === '同比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${year-1}年${month}月${today}日`, | ||||
|         name: `${year - 1}年${yesterday}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `${yesterday}日目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '日' && than === '环比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${yesterday}日`, | ||||
|         name: `${dayBeYes}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `${yesterday}日目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '周' && than === '同比') { | ||||
|     items = [ | ||||
| @@ -200,6 +213,11 @@ function getTemplate(period, dataList,than) { | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `本周目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '周' && than === '环比') { | ||||
|     items = [ | ||||
| @@ -212,6 +230,11 @@ function getTemplate(period, dataList,than) { | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|       { | ||||
|         name: `本周目标`, | ||||
|         data: dataList ? dataList[2] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|     ]; | ||||
|   } else if (period === '月' && than === '同比') { | ||||
|     items = [ | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-05-07 13:22:43 | ||||
|  * @LastEditTime: 2024-06-06 15:12:58 | ||||
|  * @LastEditTime: 2024-06-17 09:22:17 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -180,30 +180,30 @@ export default { | ||||
|             itemStyle: { | ||||
|               color: "#f3c000", | ||||
|             }, | ||||
|             areaStyle: { | ||||
|               color: { | ||||
|                 type: "linear", | ||||
|                 x: 0, | ||||
|                 y: 0, | ||||
|                 x2: 0, | ||||
|                 y2: 1, | ||||
|                 colorStops: [ | ||||
|                   { | ||||
|                     offset: 0, | ||||
|                     color: "#f3c000", // 0% 处的颜色 | ||||
|                   }, | ||||
|                   { | ||||
|                     offset: 0.55, | ||||
|                     color: "#f3c00033", | ||||
|                   }, | ||||
|                   { | ||||
|                     offset: 1, | ||||
|                     color: "transparent", // 100% 处的颜色 | ||||
|                   }, | ||||
|                 ], | ||||
|                 global: false, // 缺省为 false | ||||
|               }, | ||||
|             }, | ||||
|             // areaStyle: { | ||||
|             //   color: { | ||||
|             //     type: "linear", | ||||
|             //     x: 0, | ||||
|             //     y: 0, | ||||
|             //     x2: 0, | ||||
|             //     y2: 1, | ||||
|             //     colorStops: [ | ||||
|             //       { | ||||
|             //         offset: 0, | ||||
|             //         color: "#f3c000", // 0% 处的颜色 | ||||
|             //       }, | ||||
|             //       { | ||||
|             //         offset: 0.55, | ||||
|             //         color: "#f3c00033", | ||||
|             //       }, | ||||
|             //       { | ||||
|             //         offset: 1, | ||||
|             //         color: "transparent", // 100% 处的颜色 | ||||
|             //       }, | ||||
|             //     ], | ||||
|             //     global: false, // 缺省为 false | ||||
|             //   }, | ||||
|             // }, | ||||
|             data: [], // this.series[0].data, | ||||
|           }, | ||||
|         ], | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-05-23 15:50:44 | ||||
|  * @LastEditTime: 2024-06-06 15:13:06 | ||||
|  * @LastEditTime: 2024-06-17 09:23:39 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -180,30 +180,30 @@ export default { | ||||
|             itemStyle: { | ||||
|               color: "#f3c000", | ||||
|             }, | ||||
|             areaStyle: { | ||||
|               color: { | ||||
|                 type: "linear", | ||||
|                 x: 0, | ||||
|                 y: 0, | ||||
|                 x2: 0, | ||||
|                 y2: 1, | ||||
|                 colorStops: [ | ||||
|                   { | ||||
|                     offset: 0, | ||||
|                     color: "#f3c000", // 0% 处的颜色 | ||||
|                   }, | ||||
|                   { | ||||
|                     offset: 0.55, | ||||
|                     color: "#f3c00033", | ||||
|                   }, | ||||
|                   { | ||||
|                     offset: 1, | ||||
|                     color: "transparent", // 100% 处的颜色 | ||||
|                   }, | ||||
|                 ], | ||||
|                 global: false, // 缺省为 false | ||||
|               }, | ||||
|             }, | ||||
|             // areaStyle: { | ||||
|             //   color: { | ||||
|             //     type: "linear", | ||||
|             //     x: 0, | ||||
|             //     y: 0, | ||||
|             //     x2: 0, | ||||
|             //     y2: 1, | ||||
|             //     colorStops: [ | ||||
|             //       { | ||||
|             //         offset: 0, | ||||
|             //         color: "#f3c000", // 0% 处的颜色 | ||||
|             //       }, | ||||
|             //       { | ||||
|             //         offset: 0.55, | ||||
|             //         color: "#f3c00033", | ||||
|             //       }, | ||||
|             //       { | ||||
|             //         offset: 1, | ||||
|             //         color: "transparent", // 100% 处的颜色 | ||||
|             //       }, | ||||
|             //     ], | ||||
|             //     global: false, // 缺省为 false | ||||
|             //   }, | ||||
|             // }, | ||||
|             data: [], // this.series[0].data, | ||||
|           }, | ||||
|         ], | ||||
|   | ||||
| @@ -65,13 +65,13 @@ export default { | ||||
|     valueTuple() { | ||||
|       const getter = this.chipRate; | ||||
|       // console.log(getter) | ||||
|       if (this.period === "日" || this.period === "周") { | ||||
|         return [ | ||||
|           getter.previous[this.factoryId], | ||||
|           getter.current[this.factoryId], | ||||
|           0, | ||||
|         ]; | ||||
|       } | ||||
|       // if (this.period === "日" || this.period === "周") { | ||||
|       //   return [ | ||||
|       //     getter.previous[this.factoryId], | ||||
|       //     getter.current[this.factoryId], | ||||
|       //     0, | ||||
|       //   ]; | ||||
|       // } | ||||
|       // [100, 200, 200] | ||||
|       return [ | ||||
|         getter.previous[this.factoryId], | ||||
| @@ -87,8 +87,11 @@ export default { | ||||
|       const vt = this.valueTuple; | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -100,23 +103,27 @@ export default { | ||||
|       // const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${month}月${today}日良率`, }, | ||||
|           { label: `${year-1}年${month}月${today}日良率` }, | ||||
|           { label: `${yesterday}日良率`, }, | ||||
|           { label: `${year - 1}年${yesterday}日良率` }, | ||||
|           { label: `${yesterday}日目标` }, | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${month}月${today}日良率` }, | ||||
|           { label: `${yesterday}日良率` }, | ||||
|           { label: `${dayBeYes}日良率` }, | ||||
|           { label: `${yesterday}日目标` }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `本周良率`, }, | ||||
|           { label: `${year-1}年本周良率` }, | ||||
|           { label: `${year - 1}年本周良率` }, | ||||
|           { label: `本周目标`, }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `本周良率`, }, | ||||
|           { label: `上周良率`, }, | ||||
|           { label: `本周目标`, }, | ||||
|         ]; | ||||
|       } else if (this.period === '月' && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -139,17 +146,18 @@ export default { | ||||
|       } | ||||
|       let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%', | ||||
|         subtitle = { | ||||
|           日: "本日良率", | ||||
|           日: "昨日良率", | ||||
|           周: "本周良率", | ||||
|           月: `${month}月良率`, | ||||
|           年: `${year}良率`, | ||||
|         }[this.period]; | ||||
|       console.log(vt[1]); | ||||
|       console.log(vt[0]); | ||||
|       const t = getOptions({ | ||||
|         // single, | ||||
|         color: this.color == 1 ? "#4CF0E8" : "#1065ff", | ||||
|         titleValue, | ||||
|         subtitle, | ||||
|         yesterday, | ||||
|         currentName: items[0].label, | ||||
|         preName: items[1].label, | ||||
|         previousSum: vt[0], | ||||
| @@ -161,8 +169,11 @@ export default { | ||||
|     legend() { | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -174,24 +185,27 @@ export default { | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年${month}月${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" }, | ||||
|           { label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | ||||
|           { label: `${year - 1}年${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" }, | ||||
|           { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | ||||
|           { label: `${yesterday}日目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | ||||
|           { label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | ||||
|           { label: `${dayBeYes}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | ||||
|           { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | ||||
|           { label: `${yesterday}日目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | ||||
|           { label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | ||||
|  | ||||
|           { label: `本周目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `上周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | ||||
|           { label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | ||||
|           { label: `本周目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | ||||
|         ]; | ||||
|       } else if (this.period === '月' && this.than === '同比') { | ||||
|         items = [ | ||||
|   | ||||
| @@ -47,12 +47,12 @@ export default { | ||||
|   computed: { | ||||
|     dataRate() { | ||||
|       // if (this.current != 0 && this.target != 0) { | ||||
|         console.log( '1111111111', this.current, this.target); | ||||
|         console.log( '1111111111', this.current, this.target,this.previous); | ||||
|       return this.current == 0 && this.target == 0 | ||||
|           ? 0 | ||||
|         : this.current != 0 && this.target != 0 | ||||
|           ? `${((this.current / this.target) * 100).toFixed(2)}%` | ||||
|           : this.current != 0 && this.target == 0 && this.current >= 100 ? 100 + '%' : this.current != 0 && this.target == 0 && this.current < 100 ? this.current + '%' : this.previous >=100 ? 100 + '%' : this.previous + '%'; | ||||
|           : this.current != 0 && this.target == 0 && this.current >= 100 ? 100 + '%' : this.current != 0 && this.target == 0 && this.current < 100 ? this.current + '%' : 0 + '%' | ||||
|       // } else if(this.previous != 0) { | ||||
|       //   return this.previous + '%' | ||||
|       // } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-05-07 10:25:10 | ||||
|  * @LastEditTime: 2024-06-06 15:14:29 | ||||
|  * @LastEditTime: 2024-06-27 09:13:38 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -11,21 +11,21 @@ | ||||
|     <CityName :value="city.name" /> | ||||
|     <div class="std-rate-item__value"> | ||||
|       <ProgressBar :period="period" :title="title" :target="city.target" :current="city.current" /> | ||||
|       <ProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|       <preProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div v-else-if="period == '周'" class="std-rate-item"> | ||||
|     <CityName :value="city.name" /> | ||||
|     <div class="std-rate-item__value"> | ||||
|       <ProgressBar :period="period" :title="title" :target="city.target" :current="city.current" /> | ||||
|       <ProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|       <preProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div v-else-if="period == '月'" class="std-rate-item"> | ||||
|     <CityName :value="city.name" /> | ||||
|     <div class="std-rate-item__value"> | ||||
|       <ProgressBar :period="period" :title="titleTarget" :target="city.target" :current="city.current" /> | ||||
|       <ProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|       <preProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|       <!-- <ProgressBar :period="period" :title="title" :value="city.current" /> --> | ||||
|     </div> | ||||
|   </div> | ||||
| @@ -33,7 +33,7 @@ | ||||
|     <CityName :value="city.name" /> | ||||
|     <div class="std-rate-item__value"> | ||||
|       <ProgressBar :period="period" :title="titleTarget" :target="city.target" :current="city.current" /> | ||||
|       <ProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|       <preProgressBar :period="period" :title="titlePre" :previous="city.previous" /> | ||||
|       <!-- <ProgressBar :period="period" :title="title" :value="city.current" /> --> | ||||
|     </div> | ||||
|   </div> | ||||
| @@ -42,10 +42,12 @@ | ||||
| <script> | ||||
| import CityName from "./CityName.vue"; | ||||
| import ProgressBar from "./ProgressBar.vue"; | ||||
| import preProgressBar from "./preProgressBar.vue"; | ||||
|  | ||||
|  | ||||
| export default { | ||||
|   name: "StdRateItem", | ||||
|   components: { CityName, ProgressBar }, | ||||
|   components: { CityName, ProgressBar, preProgressBar }, | ||||
|   props: { | ||||
|     city: { | ||||
|       type: Object, | ||||
| @@ -69,16 +71,19 @@ export default { | ||||
|     titlePre() { | ||||
|       console.log(this.city); | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       const today = new Date().getDate(); | ||||
|       const month = new Date().getMonth() + 1; | ||||
|       const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         return `${year-1}年${month}月${today}日` | ||||
|         return `${year - 1}年${yesterday}日` | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         return `${yesterday}日` | ||||
|         return `${dayBeYes}日` | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         return `${year-1}年本周` | ||||
|       } else if (this.period === '周' && this.than === '环比') { | ||||
| @@ -93,14 +98,18 @@ export default { | ||||
|     }, | ||||
|     title() { | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       const today = new Date().getDate(); | ||||
|       const month = new Date().getMonth() + 1; | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         return `${month}月${today}日` | ||||
|         return `${yesterday}日` | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         return `${month}月${today}日` | ||||
|         return `${yesterday}日` | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         return `本周` | ||||
|       } else if (this.period === '周' && this.than === '环比') { | ||||
|   | ||||
| @@ -0,0 +1,130 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-27 09:12:54 | ||||
|  * @LastEditTime: 2024-06-27 09:14:21 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
|  | ||||
| <template> | ||||
|   <div class="progress-bar" :data-title="title" :data-rate="previous + '%'"> | ||||
|     <div class="progress-bar__rate" :style="{ width: dataRate == '-' ? 0 : dataRate }"></div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| export default { | ||||
|   name: "ProgressBar", | ||||
|   components: {}, | ||||
|   props: { | ||||
|     value: { | ||||
|       type: Number, | ||||
|       default: 0, | ||||
|     }, | ||||
|     target: { | ||||
|       type: Number, | ||||
|       default: 0, | ||||
|     }, | ||||
|     previous: { | ||||
|       type: Number, | ||||
|       default: 0, | ||||
|     }, | ||||
|     current: { | ||||
|       type: Number, | ||||
|       default: 0, | ||||
|     }, | ||||
|     // total: { | ||||
|     //   type: Number, | ||||
|     //   default: 0, | ||||
|     // }, | ||||
|     title: { | ||||
|       type: String, | ||||
|       default: "", | ||||
|     }, | ||||
|   }, | ||||
|   data() { | ||||
|     return {}; | ||||
|   }, | ||||
|   computed: { | ||||
|     dataRate() { | ||||
|       // if (this.current != 0 && this.target != 0) { | ||||
|         // console.log( '1111111111', this.current, this.target,this.previous); | ||||
|       return this.previous >=100 ? 100 + '%' : this.previous + '%'; | ||||
|       // } else if(this.previous != 0) { | ||||
|       //   return this.previous + '%' | ||||
|       // } | ||||
|     }, | ||||
|   }, | ||||
|   methods: {}, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .progress-bar { | ||||
|   height: 10px; | ||||
|   background-color: #002f6b; | ||||
|   border-radius: 4px; | ||||
|   margin-bottom: 12px; | ||||
|   position: relative; | ||||
|  | ||||
|   &:before { | ||||
|     content: attr(data-title); | ||||
|     display: inline-block; | ||||
|     color: #fff; | ||||
|     position: absolute; | ||||
|     bottom: -200%; | ||||
|     font-size: 12px; | ||||
|   } | ||||
|  | ||||
|   &:after { | ||||
|     content: attr(data-rate); | ||||
|     display: inline-block; | ||||
|     color: #fff; | ||||
|     position: absolute; | ||||
|     bottom: -200%; | ||||
|     right: 0; | ||||
|     font-size: 12px; | ||||
|   } | ||||
|  | ||||
|   &:first-child { | ||||
|     &:after { | ||||
|       color: #11eae3; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   &:nth-child(2) { | ||||
|     &:after { | ||||
|       color: #0e65fd; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .progress-bar__rate { | ||||
|     position: absolute; | ||||
|     display: inline-block; | ||||
|     height: 100%; | ||||
|     width: 0; | ||||
|     border-radius: 4px; | ||||
|      background: linear-gradient(to right, | ||||
|           #004c5e11 10%, | ||||
|           #004c5e, | ||||
|           #0ac0c0, | ||||
|           #11eae3); | ||||
|   } | ||||
|  | ||||
|   &:first-child { | ||||
|     .progress-bar__rate { | ||||
|       background: linear-gradient(to right, | ||||
|           #004c5e11 10%, | ||||
|           #004c5e, | ||||
|           #0ac0c0, | ||||
|           #11eae3); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   &:nth-child(2) { | ||||
|     .progress-bar__rate { | ||||
|       background: linear-gradient(to right, #0048a811, #0048a8, #0e65fd); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -6,9 +6,10 @@ export default ({ | ||||
|   targetSum, | ||||
|   currentName, | ||||
|   preName, | ||||
|   yesterday, | ||||
| }) => ({ | ||||
|   grid: { | ||||
|     left: '0%', | ||||
|     left: 300, | ||||
|     right: 0, | ||||
|     bottom: 0, | ||||
|     top: 0, | ||||
| @@ -17,7 +18,7 @@ export default ({ | ||||
|   tooltip: {}, | ||||
|   title: { | ||||
|     text: titleValue, | ||||
|     left: "44%", | ||||
|     left: "48%", | ||||
|     top: "37%", | ||||
|     textAlign: "center", | ||||
|     textStyle: { | ||||
| @@ -25,7 +26,7 @@ export default ({ | ||||
|       fontSize: 26, | ||||
|       color: "#fffd", | ||||
|     }, | ||||
|     subtext: `\u2002${subtitle}\u2002`, | ||||
|     subtext: `\u2002${yesterday + '日良率'}\u2002`, | ||||
|     subtextStyle: { | ||||
|       fontSize: 14, | ||||
|       fontWeight: 100, | ||||
| @@ -39,7 +40,7 @@ export default ({ | ||||
|       type: "pie", | ||||
|       name: "当前良率", | ||||
|       radius: ["70%", "85%"], | ||||
|       center: ["45%", "52%"], | ||||
|       center: ["50%", "52%"], | ||||
|       emptyCircleStyle: { | ||||
|         color: "#003982", | ||||
|       }, | ||||
| @@ -48,7 +49,7 @@ export default ({ | ||||
|     { | ||||
|       type: "pie", | ||||
|       radius: ["70%", "85%"], | ||||
|       center: ["45%", "52%"], | ||||
|       center: ["50%", "52%"], | ||||
|       avoidLabelOvervlap: false, | ||||
|       label: { | ||||
|         show: false, | ||||
| @@ -97,7 +98,7 @@ export default ({ | ||||
|     { | ||||
|       type: "pie", | ||||
|       radius: ["55%", "70%"], | ||||
|       center: ["45%", "52%"], | ||||
|       center: ["50%", "52%"], | ||||
|       avoidLabelOvervlap: false, | ||||
|       label: { | ||||
|         show: false, | ||||
| @@ -109,6 +110,9 @@ export default ({ | ||||
|         { | ||||
|           value: previousSum, | ||||
|           name: preName, | ||||
|            tooltip: { | ||||
|             formatter: `${preName} : ${previousSum}` | ||||
|           }, | ||||
|           selected: false, | ||||
|           itemStyle: { | ||||
|             borderJoin: "round", | ||||
| @@ -129,10 +133,11 @@ export default ({ | ||||
|           }, | ||||
|         }, | ||||
|         { | ||||
|           value:previousSum == 0 | ||||
|               ? 1 | ||||
|               : 0, | ||||
|           name: "-", | ||||
|           value:previousSum === 0 ? 1 : 0, | ||||
|           name: preName, | ||||
|           tooltip: { | ||||
|             formatter: `${preName} : ${previousSum}` | ||||
|           }, | ||||
|           itemStyle: { color: "transparent" }, | ||||
|           label: { show: false }, | ||||
|         }, | ||||
|   | ||||
| @@ -1,19 +1,24 @@ | ||||
| <template> | ||||
|   <div class="left-chart-base"> | ||||
|     <!-- <div class="legend"> | ||||
|   <chart-container class="bar-chart-base"> | ||||
|     <div class="left-chart-base"> | ||||
|       <!-- <div class="legend"> | ||||
|       <span v-for="item in legend" :key="item.label" class="legend-item" | ||||
|         :style="{ fontSize: isFullscreen ? '0.85vw' : '0.73vw' }">{{ item.label }}</span> | ||||
|     </div> --> | ||||
|  | ||||
|     <div id="factoryEnergyChart" style="width: 100%; height: 100%"></div> | ||||
|   </div> | ||||
|       <div id="factoryEnergyChart" style="width: 100%; height: 100%"></div> | ||||
|     </div> | ||||
|   </chart-container> | ||||
| </template> | ||||
| <script> | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| import * as echarts from "echarts"; | ||||
| import ChartContainer from "../../components/ChartContainer.vue"; | ||||
|  | ||||
| // import CopilotButton from "./chartButton" | ||||
| export default { | ||||
|   components: { | ||||
|     ChartContainer | ||||
|     // CopilotButton, | ||||
|   }, | ||||
|   name: "Energy", | ||||
| @@ -68,12 +73,25 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           axisLabel: { | ||||
|             interval: 0,//设置横坐标为斜 | ||||
|             rotate:45, | ||||
|             color: "rgba(255, 255, 255, 0.7)", | ||||
|             fontSize: 12, | ||||
|             // formatter: function (value) { | ||||
|             //   console.log(value); | ||||
|  | ||||
|             //   return value; | ||||
|             // }, | ||||
|           }, | ||||
|           data: [], | ||||
|         }, | ||||
|         // dataZoom: [ | ||||
|         //   { | ||||
|         //     // show: true, | ||||
|         //     start: 0, | ||||
|         //     end: 50 | ||||
|         //   } | ||||
|         //   ], | ||||
|         yAxis: { | ||||
|             type: "value", | ||||
|             name: "单位/片", | ||||
| @@ -87,7 +105,7 @@ export default { | ||||
|             }, | ||||
|             axisLabel: { | ||||
|               color: "rgba(255, 255, 255, 0.7)", | ||||
|               fontSize: 12, | ||||
|               fontSize: 10, | ||||
|             }, | ||||
|             axisLine: { | ||||
|               show: true, | ||||
| @@ -221,9 +239,9 @@ export default { | ||||
|     //   this.actualOptions = actualOptions; | ||||
|     //   this.initOptions(actualOptions); | ||||
|     // }, | ||||
|     energyCockpits() { | ||||
|       this.initChart(); | ||||
|     }, | ||||
|     // energyCockpits() { | ||||
|     //   this.initChart(); | ||||
|     // }, | ||||
|     isOpen(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
| @@ -258,6 +276,9 @@ export default { | ||||
|         if (this.energyCockpits) { | ||||
|           this.energyCockpits.forEach(ele => { | ||||
|             this.data.push(ele.targetProduction) | ||||
|             if (ele.workOrderNumber.length > 4) { | ||||
|               ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + ".."; | ||||
|             } | ||||
|             this.orderXAxis.push(ele.workOrderNumber) | ||||
|           }); | ||||
|         } | ||||
| @@ -268,6 +289,9 @@ export default { | ||||
|         if (this.energyCockpits) { | ||||
|           this.energyCockpits.forEach(ele => { | ||||
|             this.data.push(ele.plannedInvestment) | ||||
|             if (ele.workOrderNumber.length > 4) { | ||||
|               ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + ".."; | ||||
|             } | ||||
|             this.orderXAxis.push(ele.workOrderNumber) | ||||
|           }); | ||||
|         } | ||||
| @@ -277,6 +301,9 @@ export default { | ||||
|         if (this.energyCockpits) { | ||||
|           this.energyCockpits.forEach(ele => { | ||||
|             this.data.push(ele.actualInvestment) | ||||
|             if (ele.workOrderNumber.length > 4) { | ||||
|               ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + ".."; | ||||
|             } | ||||
|             this.orderXAxis.push(ele.workOrderNumber) | ||||
|           }); | ||||
|         } | ||||
| @@ -286,6 +313,9 @@ export default { | ||||
|         if (this.energyCockpits) { | ||||
|           this.energyCockpits.forEach(ele => { | ||||
|             this.data.push(ele.actualProduction) | ||||
|             if (ele.workOrderNumber.length > 4) { | ||||
|               ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + ".."; | ||||
|             } | ||||
|             this.orderXAxis.push(ele.workOrderNumber) | ||||
|           }); | ||||
|         } | ||||
| @@ -295,6 +325,9 @@ export default { | ||||
|         if (this.energyCockpits) { | ||||
|           this.energyCockpits.forEach(ele => { | ||||
|             this.data.push(ele.wasteNum) | ||||
|             if (ele.workOrderNumber.length > 4) { | ||||
|               ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + ".."; | ||||
|             } | ||||
|             this.orderXAxis.push(ele.workOrderNumber) | ||||
|           }); | ||||
|         } | ||||
| @@ -305,6 +338,9 @@ export default { | ||||
|           this.energyCockpits.forEach(ele => { | ||||
|             console.log(ele.reworkNum); | ||||
|             this.data.push(ele.reworkNum) | ||||
|             if (ele.workOrderNumber.length > 4) { | ||||
|               ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + ".."; | ||||
|             } | ||||
|             this.orderXAxis.push(ele.workOrderNumber) | ||||
|           }); | ||||
|         } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-05-29 14:48:06 | ||||
|  * @LastEditTime: 2024-06-07 14:11:01 | ||||
|  * @LastEditTime: 2024-06-18 14:49:25 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -54,8 +54,20 @@ export default { | ||||
|     legend() { | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
|       // var s2 = (day2.getMonth() + 1) + "月" + day2.getDate() + '日'; | ||||
|       // const today = new Date().getDate(); | ||||
|       // let yesterday = new Date().getDate() -1; | ||||
|       // const month = new Date().getMonth() + 1; | ||||
|       // const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; | ||||
|       // const year = new Date().getFullYear(); | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -65,15 +77,18 @@ export default { | ||||
|       const month = new Date().getMonth() + 1; | ||||
|       const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === 1  && this.than === '同比') { | ||||
|       if (this.period === 1 && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${year - 1}年${yesterday}累计` }, | ||||
|           { label: `${yesterday}日累计`, }, | ||||
|  | ||||
|           // { label: `${month}月${today}日目标`, }, | ||||
|         ]; | ||||
|       } else if (this.period ===1 && this.than === '环比') { | ||||
|       } else if (this.period === 1 && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${dayBeYes}日累计` }, | ||||
|           { label: `${yesterday}日累计` }, | ||||
|           // { label: `${month}月${today}日目标`, }, | ||||
|         ]; | ||||
|       } else if (this.period === 2 && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -158,8 +173,11 @@ function getTemplate(period, dataList, than) { | ||||
|   // console.log('dataList',dataList); | ||||
|   let items = []; | ||||
|   var day1 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   var day2 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|   day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|   var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|   //今天的时间 | ||||
|   // var day2 = new Date(); | ||||
|   // day2.setTime(day2.getTime()); | ||||
| @@ -172,11 +190,11 @@ function getTemplate(period, dataList, than) { | ||||
|   if (period === 1 && than === '同比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${year-1}年${month}月${today}日`, | ||||
|         name: `${year - 1}年${yesterday}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
| @@ -184,11 +202,11 @@ function getTemplate(period, dataList, than) { | ||||
|   } else if (period ===1 && than === '环比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${yesterday}日`, | ||||
|         name: `${dayBeYes}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <template> | ||||
|   <div class="order-container"> | ||||
|     <div class="table"> | ||||
|       <dv-scroll-board v-if="showTable" :config="config" style="width: 100%; height: 100%" ref="orderScrollBoard" /> | ||||
|       <dv-scroll-board v-if="showTable" :config="config" style="width: 100%; height: 100%; color: rgba(255, 255, 255, .6);" ref="orderScrollBoard" /> | ||||
|     </div> | ||||
|     <div class="chart"> | ||||
|       <div class="chart-title"> | ||||
| @@ -41,8 +41,8 @@ export default { | ||||
|         data: [], | ||||
|         rowNum: 12, | ||||
|         waitTime: 3000, | ||||
|         columnWidth: [100], | ||||
|         align: ["center"], | ||||
|         columnWidth: [150], | ||||
|         align: ["left"], | ||||
|         carousel: "page", | ||||
|       }, | ||||
|     }; | ||||
| @@ -101,51 +101,37 @@ export default { | ||||
|           arr.push( | ||||
|             `<span title=${this.prodOrder[i].workOrderNumber || ""}>${ | ||||
|             this.prodOrder[i].workOrderNumber || "" | ||||
|             }</span>` | ||||
|           ); | ||||
|           arr.push( | ||||
|             `<span title=${this.prodOrder[i].inStatus || ""}>${ | ||||
|             this.prodOrder[i].inStatus || "" | ||||
|             }</span>` | ||||
|           ); | ||||
|           arr.push( | ||||
|             `<span title=${this.prodOrder[i].plannedInvestment || ""}>${ | ||||
|             this.prodOrder[i].plannedInvestment || "" | ||||
|             }</span>` | ||||
|           ); | ||||
|           arr.push( | ||||
|             `<span title=${this.prodOrder[i].actualInvestment || ""}>${this.prodOrder[i].actualInvestment || "" | ||||
|             }</span>` | ||||
|           ); | ||||
|           arr.push( | ||||
|             `<span title=${this.prodOrder[i].targetProduction || ""}>${this.prodOrder[i].targetProduction || "" | ||||
|             }</span>` | ||||
|           ); | ||||
|           arr.push( | ||||
|             `<span title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || "" | ||||
|             }</span>` | ||||
|           ); | ||||
|           arr.push(`<span style="display:inline-block;width:45px;">${ | ||||
|             this.prodOrder[i].productionProgress | ||||
|             ? this.prodOrder[i].productionProgress.toFixed(0) + "%" | ||||
|               : "0%" | ||||
|           }</span> | ||||
|             }</span>`, | ||||
|               `<span title=${this.prodOrder[i].orderStatus || ""}>${this.prodOrder[i].orderStatus === 1 ? '未开始' : this.prodOrder[i].orderStatus === 2 ? '进行中' : '已完成' || "" | ||||
|               }</span>`, | ||||
|               `<span title=${this.prodOrder[i].plannedInvestment || ""}>${this.prodOrder[i].plannedInvestment || "" | ||||
|               }</span>`, | ||||
|               `<span title=${this.prodOrder[i].actualInvestment || ""}>${this.prodOrder[i].actualInvestment || "" | ||||
|               }</span>`, | ||||
|               `<span title=${this.prodOrder[i].targetProduction || ""}>${this.prodOrder[i].targetProduction || "" | ||||
|               }</span>`, | ||||
|               `<span title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || "" | ||||
|               }</span>`, | ||||
|               `<span style="display:inline-block;width:45px;">${this.prodOrder[i].productionProgress | ||||
|                 ? this.prodOrder[i].productionProgress.toFixed(0) + "%" | ||||
|                 : "0%" | ||||
|               }</span> | ||||
|             <div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;"> | ||||
|             <svg xmlns="http://www.w3.org/200/svg" height="20" width="20"> | ||||
|               <circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/> | ||||
|               <circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${ | ||||
|             this.prodOrder[i].productionProgress | ||||
|             ? this.prodOrder[i].productionProgress.toFixed(0) * | ||||
|                       37.68 * | ||||
|                       0.01 + | ||||
|                     "," + | ||||
|                     (1 - | ||||
|               this.prodOrder[i].productionProgress.toFixed(0) * 0.01) * | ||||
|                       37.68 | ||||
|                   : 0 + "," + 37.68 | ||||
|               <circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${this.prodOrder[i].productionProgress | ||||
|                 ? this.prodOrder[i].productionProgress.toFixed(0) * | ||||
|                 37.68 * | ||||
|                 0.01 + | ||||
|                 "," + | ||||
|                 (1 - | ||||
|                   this.prodOrder[i].productionProgress.toFixed(0) * 0.01) * | ||||
|                 37.68 | ||||
|                 : 0 + "," + 37.68 | ||||
|               }"/> | ||||
|             </svg> | ||||
|           </div>`); | ||||
|           </div>` | ||||
|           ) | ||||
|           outArr.push(arr); | ||||
|         } | ||||
|         this.config.data = outArr; | ||||
|   | ||||
| @@ -134,11 +134,11 @@ export default { | ||||
|         if (preData && preData[0] != null) { | ||||
|           for (const factory of preData) { | ||||
|             if (factory.previousGlassType === 0) { | ||||
|               preDataDetail[1] = factory.previousYearOutputNumber | ||||
|               preDataDetail[1] = factory.previousOutputNumber | ||||
|             } else if (factory.previousGlassType === 1) { | ||||
|               preDataDetail[2] = factory.previousYearOutputNumber | ||||
|             } else if (factory.previousYearOutputNumber === 2) { | ||||
|               currentDataDetail[3] = factory.outputNumber | ||||
|               preDataDetail[2] = factory.previousOutputNumber | ||||
|             } else if (factory.previousGlassType === 2) { | ||||
|               preDataDetail[3] = factory.previousOutputNumber | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|   | ||||
| @@ -89,7 +89,7 @@ export default { | ||||
|     updateThan(val) { | ||||
|       console.log(val); | ||||
|       this.than = val; | ||||
|       // this.getMes(); | ||||
|       this.getMes() | ||||
|     }, | ||||
|     updatePeriod(val) { | ||||
|       this.period = val; | ||||
| @@ -132,16 +132,17 @@ export default { | ||||
|             // } | ||||
|           } | ||||
|         } | ||||
|         if (preData && preData[0] != null) { | ||||
|         if (preData) { | ||||
|           for (const factory of preData) { | ||||
|             if (factory.previousGlassType === 0) { | ||||
|               preDataDetail[1] = factory.previousYearOutputNumber | ||||
|               console.log('factory', factory) | ||||
|               preDataDetail[1] = factory.previousOutputNumber | ||||
|             } else if (factory.previousGlassType === 1) { | ||||
|               preDataDetail[2] = factory.previousYearOutputNumber | ||||
|               preDataDetail[2] = factory.previousOutputNumber | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|         if (targetListResponse && targetListResponse[0] != null) { | ||||
|         if (targetListResponse) { | ||||
|           for (const factory of targetListResponse) { | ||||
|             targetDataDetail[0] = factory.ftoInput | ||||
|             // if (factory.previousGlassType === 0) { | ||||
| @@ -153,7 +154,7 @@ export default { | ||||
|           } | ||||
|         } | ||||
|         // console.log('ftoInvest',ftoInvest) | ||||
|         if (factoryListResponse && factoryListResponse[0] != null) { | ||||
|         if (factoryListResponse) { | ||||
|           for (const factory of factoryListResponse) { | ||||
|             // targetDataDetail[0] = factory.ftoInput | ||||
|             if (factory.glassType === 0) { | ||||
| @@ -163,6 +164,7 @@ export default { | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|         console.log('  this.factoryData.preDataDetail', preDataDetail); | ||||
|         this.factoryData.preDataDetail = preDataDetail | ||||
|         this.factoryData.currentDataDetail = currentDataDetail | ||||
|         this.factoryData.targetDataDetail = targetDataDetail | ||||
|   | ||||
| @@ -45,8 +45,11 @@ export default { | ||||
|     legend() { | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -58,13 +61,13 @@ export default { | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${dayBeYes}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -149,8 +152,11 @@ export default { | ||||
| function getTemplate(period, dataList,than) { | ||||
|   let items = []; | ||||
|   var day1 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   var day2 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|   day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|   var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|   //今天的时间 | ||||
|   // var day2 = new Date(); | ||||
|   // day2.setTime(day2.getTime()); | ||||
| @@ -163,11 +169,11 @@ function getTemplate(period, dataList,than) { | ||||
|   if (period === '日' && than === '同比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${year-1}年${month}月${today}日`, | ||||
|         name: `${year - 1}年${yesterday}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
| @@ -175,11 +181,11 @@ function getTemplate(period, dataList,than) { | ||||
|   } else if (period === '日' && than === '环比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${yesterday}日`, | ||||
|         name: `${dayBeYes}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|   | ||||
| @@ -45,8 +45,11 @@ export default { | ||||
|     legend() { | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -58,13 +61,13 @@ export default { | ||||
|       const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${yesterday}日`, color: "#12f7f1" }, | ||||
|           { label: `${month}月${today}日`, color: "#58adfa" }, | ||||
|           { label: `${dayBeYes}日`, color: "#12f7f1" }, | ||||
|           { label: `${yesterday}日`, color: "#58adfa" }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -150,9 +153,15 @@ export default { | ||||
|  | ||||
| function getTemplate(period, dataList,than) { | ||||
|   let items = []; | ||||
|   // var day1 = new Date(); | ||||
|   // day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   // var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var day1 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   var day2 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|   day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|   var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|   //今天的时间 | ||||
|   // var day2 = new Date(); | ||||
|   // day2.setTime(day2.getTime()); | ||||
| @@ -165,11 +174,11 @@ function getTemplate(period, dataList,than) { | ||||
|   if (period === '日' && than === '同比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${year-1}年${month}月${today}日`, | ||||
|         name: `${year - 1}年${yesterday}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
| @@ -177,11 +186,11 @@ function getTemplate(period, dataList,than) { | ||||
|   } else if (period === '日' && than === '环比') { | ||||
|     items = [ | ||||
|       { | ||||
|         name: `${yesterday}日`, | ||||
|         name: `${dayBeYes}日`, | ||||
|         data: dataList ? dataList[0] : [], | ||||
|       }, | ||||
|       { | ||||
|         name: `${month}月${today}日`, | ||||
|         name: `${yesterday}日`, | ||||
|         data: dataList ? dataList[1] : [], | ||||
|         // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), | ||||
|       }, | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-05-20 13:32:59 | ||||
|  * @LastEditTime: 2024-06-06 08:42:04 | ||||
|  * @LastEditTime: 2024-06-17 16:42:12 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -78,13 +78,13 @@ export default { | ||||
|     valueTuple() { | ||||
|       // [previousValue, currentValue, sumValue?] | ||||
|       const getter = this.$store.getters.copilot.yield[this.dataSourceField]; | ||||
|       if (this.period === "日" || this.period === "周") { | ||||
|         console.log(this.period) | ||||
|         return [ | ||||
|           getter.previous[this.factoryId], | ||||
|           getter.current[this.factoryId], | ||||
|         ]; | ||||
|       } | ||||
|       // if (this.period === "日" || this.period === "周") { | ||||
|       //   console.log(this.period) | ||||
|       //   return [ | ||||
|       //     getter.previous[this.factoryId], | ||||
|       //     getter.current[this.factoryId], | ||||
|       //   ]; | ||||
|       // } | ||||
|       // [100, 200, 200] | ||||
|       return [ | ||||
|         getter.previous[this.factoryId], | ||||
| @@ -100,8 +100,11 @@ export default { | ||||
|       const vt = this.valueTuple; | ||||
|       let items = []; | ||||
|       var day1 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|       var day2 = new Date(); | ||||
|       day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|       day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|       var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|       var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|       //今天的时间 | ||||
|       // var day2 = new Date(); | ||||
|       // day2.setTime(day2.getTime()); | ||||
| @@ -113,15 +116,15 @@ export default { | ||||
|       // const year = new Date().getFullYear(); | ||||
|       if (this.period === '日' && this.than === '同比') { | ||||
|         items = [ | ||||
|           { label: `${month}月${today}日累计`,}, | ||||
|           { label: `${year-1}年${month}月${today}日累计` }, | ||||
|           { label: `${month}月${today}日目标`, }, | ||||
|           { label: `${yesterday}日累计`,}, | ||||
|           { label: `${year - 1}年${yesterday}累计` }, | ||||
|           { label: `${yesterday}日目标`, }, | ||||
|         ]; | ||||
|       } else if (this.period === '日' && this.than === '环比') { | ||||
|         items = [ | ||||
|           { label: `${month}月${today}日累计`}, | ||||
|           { label: `${yesterday}日累计` }, | ||||
|           { label: `${month}月${today}日目标`, }, | ||||
|           { label: `${yesterday}日累计`}, | ||||
|           { label: `${dayBeYes}日累计` }, | ||||
|           { label: `${yesterday}日目标`, }, | ||||
|         ]; | ||||
|       } else if (this.period === '周' && this.than === '同比') { | ||||
|         items = [ | ||||
| @@ -160,9 +163,9 @@ export default { | ||||
|           : (vt[1] != 0 && vt[1] != null) && vt[2] == 0 | ||||
|             ? "100%" : '0%', | ||||
|         subtitle = | ||||
|           this.period == "日" ? `${month}月${today}日累计完成值` : this.period == "周" ? `本周累计完成值` : this.period == "月" ? `${month}月累计完成值` : `${year}年累计完成值`; | ||||
|       console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],) | ||||
|       console.log(this.valueTuple[2]- this.valueTuple[1]) | ||||
|           this.period == "日" ? `${yesterday}日累计完成值` : this.period == "周" ? `本周累计完成值` : this.period == "月" ? `${month}月累计完成值` : `${year}年累计完成值`; | ||||
|       console.log('titleValue', items) | ||||
|       // console.log(this.valueTuple[2]- this.valueTuple[1]) | ||||
|       return getOptions({ | ||||
|         titleValue, | ||||
|         subtitle, | ||||
| @@ -221,8 +224,12 @@ function calculateItems(period, valueTuple, than) { | ||||
|   console.log('valueTuple', valueTuple); | ||||
|   let items = []; | ||||
|   var day1 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | ||||
|   var day2 = new Date(); | ||||
|   day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) | ||||
|   day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) | ||||
|   var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | ||||
|   var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() | ||||
|  | ||||
|   //今天的时间 | ||||
|   // var day2 = new Date(); | ||||
|   // day2.setTime(day2.getTime()); | ||||
| @@ -234,15 +241,15 @@ function calculateItems(period, valueTuple, than) { | ||||
|   const year = new Date().getFullYear(); | ||||
|   if (period === '日' && than === '同比') { | ||||
|     items = [ | ||||
|       { label: `${year-1}年${month}月${today}日累计`, value: valueTuple[0] }, | ||||
|       { label: `${month}月${today}日累计`, value: valueTuple[1] }, | ||||
|       { label: `${month}月${today}日目标`, value: valueTuple[2] }, | ||||
|       { label: `${year - 1}年${yesterday}累计`, value: valueTuple[0] }, | ||||
|       { label: `${yesterday}累计`, value: valueTuple[1] }, | ||||
|       { label: `${yesterday}日目标`, value: valueTuple[2] }, | ||||
|     ]; | ||||
|   } else if (period === '日' && than === '环比') { | ||||
|     items = [ | ||||
|       { label: `${yesterday}日累计`, value: valueTuple[0] }, | ||||
|       { label: `${month}月${today}日累计`, value: valueTuple[1] }, | ||||
|       { label: `${month}月${today}日目标`, value: valueTuple[2] }, | ||||
|       { label: `${dayBeYes}日累计`, value: valueTuple[0] }, | ||||
|       { label: `${yesterday}日累计`, value: valueTuple[1] }, | ||||
|       { label: `${yesterday}日目标`, value: valueTuple[2] }, | ||||
|     ]; | ||||
|   } else if (period === '周' && than === '同比') { | ||||
|     items = [ | ||||
|   | ||||
| @@ -17,7 +17,7 @@ export default ({ | ||||
|   tooltip: {}, | ||||
|   title: { | ||||
|     text: titleValue, | ||||
|     left: "44%", | ||||
|     left: "48%", | ||||
|     top: "37%", | ||||
|     textAlign: "center", | ||||
|     textStyle: { | ||||
| @@ -39,7 +39,7 @@ export default ({ | ||||
|       type: "pie", | ||||
|       name: "当前目标", | ||||
|      radius: ["80%", "90%"], | ||||
|       center: ["45%", "52%"], | ||||
|       center: ["50%", "52%"], | ||||
|       emptyCircleStyle: { | ||||
|         color: "#042c5f33", | ||||
|       }, | ||||
| @@ -48,7 +48,7 @@ export default ({ | ||||
|     { | ||||
|       type: "pie", | ||||
|       radius: ["80%", "90%"], | ||||
|       center: ["45%", "52%"], | ||||
|       center: ["50%", "52%"], | ||||
|       avoidLabelOvervlap: false, | ||||
|       label: { | ||||
|         show: false, | ||||
| @@ -97,7 +97,7 @@ export default ({ | ||||
|     { | ||||
|       type: "pie", | ||||
|       radius: ["70%", "80%"], | ||||
|       center: ["45%", "52%"], | ||||
|       center: ["50%", "52%"], | ||||
|       avoidLabelOvervlap: false, | ||||
|       label: { | ||||
|         show: false, | ||||
|   | ||||
| @@ -1,8 +1,9 @@ | ||||
| <!-- | ||||
|     filename: chip-invest.vue | ||||
|     author: liubin | ||||
|     date: 2024-04-10 08:59:28 | ||||
|     description: | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-03 15:38:31 | ||||
|  * @LastEditTime: 2024-06-21 15:06:39 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| @@ -34,6 +35,7 @@ export default { | ||||
|       xAxis: cities, | ||||
|     }; | ||||
|   }, | ||||
|  | ||||
|   computed: { | ||||
|     series() { | ||||
|       const chipInvest = this.$store.getters.home.chipInvest; | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-28 13:42:51 | ||||
|  * @LastEditTime: 2024-06-05 14:12:31 | ||||
|  * @LastEditTime: 2024-06-14 09:03:26 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -221,6 +221,7 @@ export default { | ||||
|       }; | ||||
|     }, | ||||
|     actualOptions() { | ||||
|       console.log('this.output.current / this.output.target', this.output.current/this.output.target); | ||||
|       const year = new Date().getFullYear() | ||||
|       const options = JSON.parse(JSON.stringify(this.options)); | ||||
|       // console.log('options', options); | ||||
| @@ -228,7 +229,7 @@ export default { | ||||
|       if (!this.output.target) options.title.text = "0%"; | ||||
|       else | ||||
|         options.title.text = | ||||
|           (this.output.current / this.output.target) * 100 + "%"; | ||||
|           ((this.output.current / this.output.target).toFixed(2)) * 100 + "%"; | ||||
|       // 外环 | ||||
|       if ( | ||||
|         this.output.current == this.output.target && | ||||
|   | ||||
| @@ -59,7 +59,7 @@ export default { | ||||
|       actualOptions: null, | ||||
|       options: { | ||||
|         grid: { | ||||
|           left: "3%", | ||||
|           left: "5%", | ||||
|           right: "4%", | ||||
|           bottom: "0", | ||||
|           top: "15%", | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-28 13:42:51 | ||||
|  * @LastEditTime: 2024-06-04 15:35:54 | ||||
|  * @LastEditTime: 2024-06-21 15:02:27 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -65,7 +65,7 @@ export default { | ||||
|       isFullscreen: false, | ||||
|       options: { | ||||
|         grid: { | ||||
|           left: "3%", | ||||
|           left: "5%", | ||||
|           right: "4%", | ||||
|           bottom: "0", | ||||
|           top: "18%", | ||||
| @@ -123,30 +123,30 @@ export default { | ||||
|             itemStyle: { | ||||
|               color: "#f3c000", | ||||
|             }, | ||||
|             areaStyle: { | ||||
|               color: { | ||||
|                 type: "linear", | ||||
|                 x: 0, | ||||
|                 y: 0, | ||||
|                 x2: 0, | ||||
|                 y2: 1, | ||||
|                 colorStops: [ | ||||
|                   { | ||||
|                     offset: 0, | ||||
|                     color: "#f3c000", // 0% 处的颜色 | ||||
|                   }, | ||||
|                   { | ||||
|                     offset: 0.55, | ||||
|                     color: "#f3c00033", | ||||
|                   }, | ||||
|                   { | ||||
|                     offset: 1, | ||||
|                     color: "transparent", // 100% 处的颜色 | ||||
|                   }, | ||||
|                 ], | ||||
|                 global: false, // 缺省为 false | ||||
|               }, | ||||
|             }, | ||||
|             // areaStyle: { | ||||
|             //   color: { | ||||
|             //     type: "linear", | ||||
|             //     x: 0, | ||||
|             //     y: 0, | ||||
|             //     x2: 0, | ||||
|             //     y2: 1, | ||||
|             //     colorStops: [ | ||||
|             //       { | ||||
|             //         offset: 0, | ||||
|             //         color: "#f3c000", // 0% 处的颜色 | ||||
|             //       }, | ||||
|             //       { | ||||
|             //         offset: 0.55, | ||||
|             //         color: "#f3c00033", | ||||
|             //       }, | ||||
|             //       { | ||||
|             //         offset: 1, | ||||
|             //         color: "transparent", // 100% 处的颜色 | ||||
|             //       }, | ||||
|             //     ], | ||||
|             //     global: false, // 缺省为 false | ||||
|             //   }, | ||||
|             // }, | ||||
|             data: [], // this.series[0].data, | ||||
|           }, | ||||
|           { | ||||
|   | ||||
| @@ -10,7 +10,7 @@ | ||||
|           style=" | ||||
|             position: absolute; | ||||
|             top: 12%; | ||||
|             left: 20%; | ||||
|             left: 15%; | ||||
|             user-select: none; | ||||
|             display: flex; | ||||
|             flex-direction: column; | ||||
| @@ -31,7 +31,7 @@ | ||||
|           <p | ||||
|             style=" | ||||
|               margin: 0; | ||||
|               font-size: 26px; | ||||
|               font-size: 24px; | ||||
|               letter-spacing: 1px; | ||||
|               color: #26b9de; | ||||
|               opacity: 75%; | ||||
| @@ -52,8 +52,8 @@ | ||||
|           </p> | ||||
|         </div> | ||||
|         <img | ||||
|           src="../assets/images/login.png" | ||||
|           style="position: absolute; top: 30%; left: 15%; width: 40vw" | ||||
|           src="../assets/images/map.png" | ||||
|           style="position: absolute; top: 00%; left: 11%; width: 50vw" | ||||
|           alt="" | ||||
|         /> | ||||
|       </div> | ||||
|   | ||||
| @@ -1,12 +1,12 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2023-11-06 15:15:30 | ||||
|  * @LastEditTime: 2024-06-07 10:28:51 | ||||
|  * @LastEditTime: 2024-06-26 13:39:22 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <el-drawer class="drawer" :visible.sync="visible" size="60%" @closed="$emit('destroy')"> | ||||
|   <el-drawer class="drawer" :visible.sync="visible" size="65%" @closed="$emit('destroy')"> | ||||
|     <small-title slot="title" :no-padding="true"> | ||||
|       {{ '碲化镉工厂生产数据详情' }} | ||||
|     </small-title> | ||||
| @@ -14,142 +14,160 @@ | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="8"> | ||||
|           <p class="title">工厂名称</p> | ||||
|           <p class="text">{{ dataForm.factory }}</p> | ||||
|           <p class="text">{{ factoryList[dataForm.factory] }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="8"> | ||||
|           <p class="title">时间维度</p> | ||||
|           <p class="text">{{ date }}</p> | ||||
|           <p class="text">{{ ['日', '周', '月', '年'][date] }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="8"> | ||||
|           <p class="title">时间</p> | ||||
|           <p class="text">{{ dataForm.reportDate?.length > 0 ? dataForm.reportDate[0] + '年' + dataForm.reportDate[1] + '月' + dataForm.reportDate[2] + '日' : '' }}</p> | ||||
|           <p class="text">{{ dataForm.datestr }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-divider></el-divider> | ||||
|       <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|         {{ '芯片' }} | ||||
|       </small-title> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片产量(片)</p> | ||||
|           <p class="text">{{ }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片良率(%)</p> | ||||
|           <p class="text">{{ dataForm.yieldRate }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片BOM</p> | ||||
|           <p class="text">{{ dataForm.bom }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片总功率(MW)</p> | ||||
|           <p class="text">{{ dataForm.totalPower }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">FTO投入量(片)</p> | ||||
|           <p class="text">{{ dataForm.chipInput }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">CSS稼动率(%)</p> | ||||
|           <p class="text">{{ dataForm.marriageRate }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片段OEE</p> | ||||
|           <p class="text">{{ dataForm.oee }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片平均功率(W)</p> | ||||
|           <p class="text">{{ dataForm.averagePower }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片人均产量(片/人)</p> | ||||
|           <p class="text">{{ dataForm.annualAverageProduction }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片产能利用率(%)</p> | ||||
|           <p class="text">{{ dataForm.capacityUtilizationRate }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|         {{ '标准组件' }} | ||||
|       </small-title> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">封装BOM</p> | ||||
|           <!-- 没参数 --> | ||||
|           <!-- <p class="text">{{ dataForm.bom }}</p> --> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">封装线OEE(%)</p> | ||||
|           <!-- <p class="text">{{ dataForm.code }}</p> --> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">标准组件良率(%)</p> | ||||
|           <!-- <p class="text">{{ dataForm.productName }}</p> --> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">标准组件产量(片)</p> | ||||
|           <!-- <p class="text">{{ dataForm.productName }}</p> --> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">标准组件总功率(MW)</p> | ||||
|           <p class="text">{{ }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">封装产能利用率(%)</p> | ||||
|           <!-- <p class="text">{{ dataForm.code }}</p> --> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">标准组件人均产量</p> | ||||
|           <!-- <p class="text">{{ dataForm.productName }}</p> --> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">标准组件平均功率</p> | ||||
|           <!-- <p class="text">{{ dataForm.productName }}</p> --> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|         {{ 'BIPV产品' }} | ||||
|       </small-title> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">产品产量</p> | ||||
|           <p class="text">{{ }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">人均产量</p> | ||||
|           <p class="text">{{ dataForm.code }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片使用量</p> | ||||
|           <p class="text">{{ dataForm.productName }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">芯片使用量</p> | ||||
|           <p class="text">{{ dataForm.productName }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-row :gutter="24"> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">内部材料成本</p> | ||||
|           <p class="text">{{ }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">内部材料成本</p> | ||||
|           <p class="text">{{ dataForm.code }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">内部材料成本</p> | ||||
|           <p class="text">{{ dataForm.productName }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <div v-if="glass === 0"> | ||||
|         <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|           {{ '芯片' }} | ||||
|         </small-title> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片产量(片)</p> | ||||
|             <p class="text">{{ dataForm.chipYieldSum }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片良率(%)</p> | ||||
|             <p class="text">{{ dataForm.chipYieldRate }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片BOM</p> | ||||
|             <p class="text">{{ dataForm.chipBom }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片总功率(MW)</p> | ||||
|             <p class="text">{{ dataForm.chipTotalPower }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">FTO投入量(片)</p> | ||||
|             <p class="text">{{ dataForm.ftoInput }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">CSS稼动率(%)</p> | ||||
|             <p class="text">{{ dataForm.chipCssMarriageRate }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片段OEE(%)</p> | ||||
|             <p class="text">{{ dataForm.chipOee }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片平均功率(W)</p> | ||||
|             <p class="text">{{ dataForm.chipAveragePower }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片人均产量(片/人)</p> | ||||
|             <p class="text">{{ dataForm.chipAnnualAverageProduction }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片产能利用率(%)</p> | ||||
|             <p class="text">{{ dataForm.chipCapacityUtilizationRate }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </div> | ||||
|       <div v-if="glass === 1"> | ||||
|         <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|           {{ '标准组件' }} | ||||
|         </small-title> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">封装BOM</p> | ||||
|             <p class="text">{{ dataForm.componentBom }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">封装线OEE(%)</p> | ||||
|             <p class="text">{{ dataForm.componentOee }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">标准组件良率(%)</p> | ||||
|             <p class="text">{{ dataForm.componentYieldRate }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">标准组件产量(片)</p> | ||||
|             <p class="text">{{ dataForm.componentYield }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">标准组件总功率(MW)</p> | ||||
|             <p class="text">{{ dataForm.componentTotalPower }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">封装产能利用率(%)</p> | ||||
|             <p class="text">{{ dataForm.componentCapacityUtilizationRate }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">标准组件人均产量(片/人)</p> | ||||
|             <p class="text">{{ dataForm.componentAnnualAverageProduction }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">标准组件平均功率(W)</p> | ||||
|             <p class="text">{{ dataForm.componentAveragePower }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">标准组件转化效率</p> | ||||
|             <p class="text">{{ dataForm.componentTransRate }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片投入</p> | ||||
|             <p class="text">{{ dataForm.chipInput }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </div> | ||||
|       <div v-if="glass === 2"> | ||||
|         <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|           {{ 'BIPV产品' }} | ||||
|         </small-title> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">产品产量(㎡)</p> | ||||
|             <p class="text">{{ dataForm.bipvProductOutput }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">人均产量(㎡/人)</p> | ||||
|             <p class="text">{{ dataForm.bipvAnnualAverageProduction }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片使用量(片)</p> | ||||
|             <p class="text">{{ dataForm.bipvChipUsage }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">芯片利用率(%)</p> | ||||
|             <p class="text">{{ dataForm.bipvChipUtilizationRate }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row :gutter="24"> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">内部材料成本(元/㎡)</p> | ||||
|             <p class="text">{{ dataForm.bipvInsideMaterialCost }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">OEM及委外材料成本(元/㎡)</p> | ||||
|             <p class="text">{{ dataForm.code }}</p> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <p class="title">综合材料成本(元/㎡)</p> | ||||
|             <p class="text">{{ dataForm.bipvComprehensiveMaterialCost }}</p> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </div> | ||||
|       <div v-if="glass === 4"> | ||||
|         <!-- 铜铟镓硒待完成 --> | ||||
|       </div> | ||||
|     </div> | ||||
|   </el-drawer> | ||||
|  | ||||
| @@ -157,24 +175,18 @@ | ||||
|  | ||||
| <script> | ||||
| // import basicAdd from './basic-add'; | ||||
| import { | ||||
|   getProduceDataDetail | ||||
| } from "@/api/produceData"; | ||||
| import { getProduceDataDetail } from "@/api/produceData"; | ||||
| // import { getList, } from "@/api/base/qualityScrapType"; | ||||
| import SmallTitle from './SmallTitle'; | ||||
| import { factoryList } from "@/utils/constants"; | ||||
|  | ||||
| export default { | ||||
|   components: { | ||||
|     SmallTitle, | ||||
|   }, | ||||
|   // mixins: [basicAdd], | ||||
|   props: { | ||||
|     date: { | ||||
|       type: Number, | ||||
|       default: 0 | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       factoryList, | ||||
|       urlOptions: { | ||||
|         isGetCode: false, | ||||
|         // codeURL: getCode, | ||||
| @@ -198,6 +210,8 @@ export default { | ||||
|         } | ||||
|       ], | ||||
|       sectionList: [], | ||||
|       glass: 0, | ||||
|       date: 0, | ||||
|       visible: false, | ||||
|       dataForm: { | ||||
|         id: undefined, | ||||
| @@ -229,11 +243,16 @@ export default { | ||||
|     // this.getCurrentTime() | ||||
|   }, | ||||
|   methods: { | ||||
|     init(id) { | ||||
|     init(id, type, glass) { | ||||
|       this.visible = true | ||||
|       console.log('打印', id) | ||||
|       this.glass = glass | ||||
|       this.date = type | ||||
|       console.log('打印', id, glass) | ||||
|       if (id) { | ||||
|         getProduceDataDetail(id).then(res => { | ||||
|         getProduceDataDetail({ | ||||
|           id: id, | ||||
|           type: type | ||||
|         }).then(res => { | ||||
|           this.dataForm = res.data | ||||
|           console.log('你好', res.data) | ||||
|         }) | ||||
|   | ||||
| @@ -1,26 +1,26 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-15 10:49:13 | ||||
|  * @LastEditTime: 2024-06-07 09:41:56 | ||||
|  * @LastEditTime: 2024-06-27 14:56:20 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> | ||||
|     <div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> | ||||
|   <div style="display: flex; flex-direction: column; min-height: calc(100vh - 200px - 31px)"> | ||||
|     <div class="app-container" style="padding: 16px 24px 0; height: auto; flex-grow: 1;"> | ||||
|       <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> | ||||
|         <el-form-item label="时间维度" prop="date"> | ||||
|           <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择"> | ||||
|         <el-form-item label="时间维度" prop="type"> | ||||
|           <el-select v-model="listQuery.type" size="small" clearable placeholder="请选择"> | ||||
|             <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime"> | ||||
|         <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至" | ||||
|             start-placeholder="开始日期" value-format="timestamp" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期"> | ||||
|             start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime"> | ||||
|         <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周" | ||||
|             style="width: 180px" @change="onValueChange"> | ||||
|           </el-date-picker> | ||||
| @@ -28,26 +28,26 @@ | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周" placeholder="选择周" | ||||
|             style="width: 180px" @change="onValueChange"> | ||||
|           </el-date-picker> | ||||
|           <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px"> | ||||
|           <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px"> | ||||
|             {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周 | ||||
|           </span> | ||||
|           </span> --> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="至" | ||||
|         <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-dd" range-separator="至" | ||||
|             start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 3" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year" | ||||
|         <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="开始时间"> | ||||
|           </el-date-picker> | ||||
|           ~ | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" format="yyyy-MM-dd" value-format="timestamp" type="year" placeholder="结束时间" | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" placeholder="结束时间" | ||||
|             @change="getYear"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="工厂名称" prop="factorys"> | ||||
|           <el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple > | ||||
|         <el-form-item label="工厂名称" prop="factory"> | ||||
|           <el-select size="small" clearable v-model="listQuery.factory" placeholder="请选择工厂名称" multiple > | ||||
|             <el-option v-for="item in factoryArray" :key="item.id" :label="item.name" :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
| @@ -58,8 +58,8 @@ | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> --> | ||||
|         <el-form-item label="玻璃类型" prop="type"> | ||||
|           <el-select size="small" clearable v-model="listQuery.type" multiple placeholder="请选择玻璃类型"> | ||||
|         <el-form-item label="玻璃类型" prop="glass"> | ||||
|           <el-select size="small" clearable v-model="listQuery.glass" multiple placeholder="请选择玻璃类型"> | ||||
|             <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
| @@ -74,7 +74,7 @@ | ||||
|       <!-- <el-row :gutter="24"> --> | ||||
|       <!-- <el-col :span="12" v-for="item in  dataList" :key="item.id"> --> | ||||
|       <search-bar :formConfigs="formConfig1" ref="searchBarForm1" style="margin-bottom: 0" /> | ||||
|       <line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> | ||||
|       <line-chart ref="lineChart" class="yearChart" style="height: 45vh;width: 100%"></line-chart> | ||||
|       <!-- </el-col> --> | ||||
|       <!-- <el-col :span="12"> | ||||
|             <line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> | ||||
| @@ -82,19 +82,19 @@ | ||||
|     </div> | ||||
|     <div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;"> | ||||
|       <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" style="margin-bottom: 0" /> | ||||
|       <base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" | ||||
|         :table-data="tableData"> | ||||
|       <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" | ||||
|         :table-data="tableData" :max-height="tableH"> | ||||
|         <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" | ||||
|           :method-list="tableBtn" @clickBtn="handleClick" /> | ||||
|       </base-table> | ||||
|       <pagination | ||||
|         :limit.sync="listQuery.size" | ||||
|         :page.sync="listQuery.current" | ||||
|         :limit.sync="listQuery.pageSize" | ||||
|         :page.sync="listQuery.pageNo" | ||||
|         :total="listQuery.total" | ||||
|         @pagination="getDataList" | ||||
|       /> | ||||
|     </div> | ||||
|     <add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" /> | ||||
|     <add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" /> | ||||
|     <!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" | ||||
|       :type="listQuery.reportType" @refreshDataList="getDataList" /> --> | ||||
|     <!-- <pagination | ||||
| @@ -106,8 +106,9 @@ | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| // import { parseTime } from '../../core/mixins/code-filter'; | ||||
| import { getProduceDataPage, prodOutputDataList, exportOutPutExcel } from '@/api/produceData'; | ||||
| // import { parseTime } from "@/utils/ruoyi"; | ||||
| import tableHeightMixin from "@/mixins/tableHeightMixin"; | ||||
| import { getProduceDataPage, getproddata, exportOutPutExcel } from '@/api/produceData'; | ||||
| // import inputTable from './inputTable.vue'; | ||||
| import lineChart from './lineChart'; | ||||
| import moment from 'moment' | ||||
| @@ -118,25 +119,25 @@ import { factoryList, factoryArray, factoryArray1 } from "@/utils/constants"; | ||||
|  | ||||
| export default { | ||||
|   components: { lineChart, ButtonNav, AddOrUpdate }, | ||||
|   mixins: [basicPage], | ||||
|   mixins: [basicPage, tableHeightMixin], | ||||
| 	data() { | ||||
|     return { | ||||
|       factoryList, | ||||
|       factoryArray, | ||||
|       factoryArray1, | ||||
|       listQuery: { | ||||
|         size: 20, | ||||
|         current: 1, | ||||
|         factorys: undefined, | ||||
|         pageSize: 20, | ||||
|         pageNo: 1, | ||||
|         factory: undefined, | ||||
|         total: 0, | ||||
|         date: 0, | ||||
|         type:undefined, | ||||
|         type: 0, // 时间维度 | ||||
|         glass: undefined, // 玻璃类型 | ||||
|         // reportType: 2, | ||||
|         beginTime: undefined, | ||||
|         endTime:undefined, | ||||
|         reportTime: [], | ||||
|         start: undefined, | ||||
|         end: undefined | ||||
|         startDate: undefined, | ||||
|         endDate:undefined, | ||||
|         reportTime: null, | ||||
|         start: null, | ||||
|         end: null | ||||
|       }, | ||||
|       detailOrUpdateVisible:false, | ||||
|       date1: undefined, | ||||
| @@ -153,7 +154,7 @@ export default { | ||||
|       ].filter((v) => v), | ||||
|       typeList: [ | ||||
|         { | ||||
|           name: '芯片', | ||||
|           name: '玻璃芯片', | ||||
|           id: 0, | ||||
|         }, | ||||
|         { | ||||
| @@ -164,6 +165,10 @@ export default { | ||||
|           name: 'BIPV产品', | ||||
|           id: 2, | ||||
|         }, | ||||
|         // { | ||||
|         //   name: '定制组件', | ||||
|         //   id: 3, | ||||
|         // }, | ||||
|       ], | ||||
|       formConfig: [ | ||||
|         { | ||||
| @@ -197,16 +202,16 @@ export default { | ||||
|       ], | ||||
|       tableProps: [ | ||||
|         { | ||||
|           prop: 'groupTime', | ||||
|           prop: 'datestr', | ||||
|           label: '日期', | ||||
|           minWidth: 100, | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
|           prop: 'factory', | ||||
|           label: '工厂名称', | ||||
|           filter: (val) => factoryList[val], | ||||
|           minWidth: 200, | ||||
|           filter: (val) =>  factoryList[val], | ||||
|           minWidth: 180, | ||||
|           showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
| @@ -215,42 +220,43 @@ export default { | ||||
|           filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val] | ||||
|         }, | ||||
|         { | ||||
|           prop: 'inputNumber', | ||||
|           prop: 'inputNum', | ||||
|           label: '投入数量', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'outputNumber', | ||||
|           prop: 'outputNum', | ||||
|           label: '产出数量', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'goodNumber', | ||||
|           prop: 'goodNum', | ||||
|           label: '良品数量', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'yieldRate', | ||||
|           prop: 'goodRatio', | ||||
|           label: '良品率%', | ||||
|           filter: (val) => (val * 100) + '%' | ||||
|           filter: (val) => val + '%' | ||||
|         }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       lineData: [], | ||||
|       chart: null, | ||||
|       seriesList: [] | ||||
|       seriesList: [], | ||||
|       colorList: ['#7164FF',  '#63BDFF', '#8EF0AB', '#FFCE6A'] | ||||
| 			// proLineList: [], | ||||
| 			// all: {} | ||||
| 		};  | ||||
|   }, | ||||
|   computed: { | ||||
|     weekNum() { | ||||
|       return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1 | ||||
|     }, | ||||
| 		}; | ||||
|   }, | ||||
|   // computed: { | ||||
|   //   weekNum() { | ||||
|   //     return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1 | ||||
|   //   }, | ||||
|   // }, | ||||
|   created() { | ||||
|     const today = new Date() | ||||
|     const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) | ||||
|     this.listQuery.beginTime = sevenDaysAgo.getTime() | ||||
|     this.listQuery.endTime = today.getTime() | ||||
|     this.listQuery.reportTime = [this.listQuery.beginTime, this.listQuery.endTime] | ||||
|     this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD') | ||||
|     this.listQuery.endDate = moment(today).format('yyyy-MM-DD') | ||||
|     this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate] | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 	}, | ||||
| @@ -259,7 +265,7 @@ export default { | ||||
|       this.detailOrUpdateVisible = true; | ||||
|       this.addOrEditTitle = "详情"; | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.detailOrUpdate.init(val.data.id); | ||||
|         this.$refs.detailOrUpdate.init(val.data.id, this.listQuery.type, val.data.glassType); | ||||
|       }); | ||||
|     }, | ||||
|     getYear(e) { | ||||
| @@ -273,13 +279,16 @@ export default { | ||||
|         this.listQuery.end = undefined | ||||
|         // console.log(); | ||||
|       } else { | ||||
|         this.listQuery.beginTime = this.listQuery.start | ||||
|         this.listQuery.endTime = this.listQuery.end | ||||
|         this.listQuery.startDate = this.listQuery.start | ||||
|         this.listQuery.endDate = this.listQuery.end | ||||
|       } | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|       // console.log(e); | ||||
|     }, | ||||
|     onValueChange(picker, k) { // 选中近k周后触发的操作 | ||||
|       // console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1]) | ||||
|       if (this.listQuery.start && this.listQuery.end) { | ||||
|         console.log(this.listQuery.reportTime) | ||||
|         this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
| @@ -292,10 +301,14 @@ export default { | ||||
|             type: 'warning' | ||||
|           }); | ||||
|         } else { | ||||
|           this.listQuery.beginTime = this.listQuery.start.getTime() - 24 * 60 * 60 * 1000 | ||||
|           this.listQuery.endTime = this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000 | ||||
|           this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|           this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|         } | ||||
|       } | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeDayTime() { | ||||
|       if (this.listQuery.reportTime) { | ||||
| @@ -310,10 +323,12 @@ export default { | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.beginTime = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endTime = this.listQuery.reportTime[1] | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeTime(value) { | ||||
| @@ -326,114 +341,142 @@ export default { | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.beginTime = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endTime = this.listQuery.reportTime[1] | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         console.log(this.listQuery.reportTime[0]) | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     async getDataList() { | ||||
|       const res = await getProduceDataPage(this.listQuery) | ||||
|       console.log(res) | ||||
|       if (res.code === 0) { | ||||
|         this.tableData = res.data.records | ||||
|         this.listQuery.total = res.data.total | ||||
|         // if (this.listQuery.total > 0) { | ||||
|         //   this.tableData.forEach(item => { | ||||
|         //     item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--' | ||||
|         //   }) | ||||
|         // } | ||||
|       if (this.listQuery.type === '') { | ||||
|         this.$message.warning('请选择时间维度!') | ||||
|         return | ||||
|       } | ||||
|  | ||||
|       // 图表 | ||||
|       await prodOutputDataList({ | ||||
|         current: 1, | ||||
|         size: 99, | ||||
|         beginTime: this.listQuery.beginTime, | ||||
|         endTime: this.listQuery.endTime, | ||||
|         factorys: this.listQuery.factorys, | ||||
|         date: this.listQuery.date, | ||||
|         type: this.listQuery.type | ||||
|       }).then(resp => { | ||||
|         console.log('Aaa', resp.data) | ||||
|         this.lineData = resp?.data || [] | ||||
|         if (this.lineData.length > 0) { | ||||
|           this.buildChart(this.lineData) | ||||
|         } | ||||
|       }) | ||||
|       // this.buildChart(this.tableData) | ||||
|     }, | ||||
|     buildChart(list) { | ||||
|       let temp = [] | ||||
|       let xAxisData = [] | ||||
|       list.forEach(item => { | ||||
|         temp.push(item.groupTime) | ||||
|       }) | ||||
|       // x轴数据 | ||||
|       xAxisData = Array.from(new Set(temp)) | ||||
|        | ||||
|       // y轴数据 | ||||
|       for (const y of this.factoryArray1) { | ||||
|         for (const type of this.typeList) { | ||||
|           const seriesItem = { | ||||
|             name: y.name, | ||||
|             record: type.name, | ||||
|             type: 'bar', | ||||
|             emphasis: { | ||||
|               focus: 'series' | ||||
|             }, | ||||
|             data: Array(xAxisData.length).fill(0) | ||||
|       if (this.listQuery.startDate === undefined) { | ||||
|         this.$message.warning('请选择时间范围!') | ||||
|       } else { | ||||
|         await getProduceDataPage(this.listQuery).then(res => { | ||||
|           console.log(res) | ||||
|           if (res.code === 0) { | ||||
|             this.tableData = res.data.records | ||||
|             this.listQuery.total = res.data.total | ||||
|           } | ||||
|           list.forEach(data => { | ||||
|             xAxisData.forEach((x, index) => { | ||||
|               if (x === data.groupTime && y.id === data.factory && type.id === data.glassType) { | ||||
|                 seriesItem.data[index] = data.goodNumber | ||||
|               } | ||||
|             }) | ||||
|           }) | ||||
|           this.seriesList.push(seriesItem) | ||||
|         } | ||||
|         }) | ||||
|  | ||||
|         // 图表 | ||||
|         await getproddata(this.listQuery).then(resp => { | ||||
|           if (resp.data?.length > 0) { | ||||
|             const chartData = Object.groupBy(resp.data, (member) => member.datestr) | ||||
|             this.buildChart(chartData, resp.data) | ||||
|           } else { | ||||
|             this.$refs.lineChart.initChart([], []) | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|       console.log('啊啊', this.seriesList) | ||||
|     }, | ||||
|     buildChart(data, dataList) { | ||||
|       let xAxisData = [] | ||||
|       this.seriesList = [] | ||||
|       // x轴数据 | ||||
|       xAxisData = Object.keys(data) | ||||
|  | ||||
|       // y轴数据 | ||||
|       this.factoryArray.forEach(fac => { | ||||
|         let i =  0 | ||||
|         while ( i < 3) { | ||||
|           // 下标 | ||||
|           const index1 = ['chipYield', 'componentYield', 'bipvProductOutput'][i] | ||||
|           // let oneChart = {} | ||||
|           xAxisData.forEach((x, index) => { | ||||
|             if (this.listQuery.glass.length === 0 || this.listQuery.glass.length === 3) { | ||||
|               let series = { | ||||
|                 name: ['玻璃芯片', '标准组件', 'BIPV'][i] + '-' + fac.id, | ||||
|                 type: 'bar', | ||||
|                 stack: String(fac.id), | ||||
|                 data: Array(xAxisData.length).fill(0), | ||||
|                 barWidth: 20, | ||||
|                 itemStyle: { | ||||
|                   color: this.colorList[i] | ||||
|                 }, | ||||
|                 label: { | ||||
|                   show: i === 2 ? true : false, | ||||
|                   position: 'top', | ||||
|                   formatter(params) { | ||||
|                     return fac.name.substring(0, 2) | ||||
|                   } | ||||
|                 } | ||||
|               } | ||||
|               dataList.forEach(item => { | ||||
|                 if (fac.id === item.factory && item.datestr === x) { | ||||
|                   series.data[index] = item[index1] | ||||
|                 } | ||||
|               }) | ||||
|               this.seriesList.push(series) | ||||
|             } else { | ||||
|               this.listQuery.glass.forEach(gl => { | ||||
|                 if (gl === i) { | ||||
|                   let series = { | ||||
|                     name: ['玻璃芯片', '标准组件', 'BIPV'][i] + '-' + fac.id, | ||||
|                     type: 'bar', | ||||
|                     stack: String(fac.id), | ||||
|                     data: Array(xAxisData.length).fill(0), | ||||
|                     barWidth: 20, | ||||
|                     itemStyle: { | ||||
|                       color: this.colorList[i] | ||||
|                     }, | ||||
|                     label: { | ||||
|                       show: true, | ||||
|                       position: 'top', | ||||
|                       formatter(params) { | ||||
|                         if (params.value === 0) { | ||||
|                           return '' | ||||
|                         } else { | ||||
|                           // return ['瑞昌', '邯郸'][params.seriesName.split('-')[1]] | ||||
|                           return fac.name.substring(0, 2) | ||||
|                         } | ||||
|                       } | ||||
|                     } | ||||
|                   } | ||||
|                   dataList.forEach(item => { | ||||
|                     if (fac.id === item.factory && item.datestr === x) { | ||||
|                       series.data[index] = item[index1] | ||||
|                     } | ||||
|                   }) | ||||
|                   this.seriesList.push(series) | ||||
|                 } | ||||
|               }) | ||||
|             } | ||||
|             // let series = { | ||||
|             //   name: ['玻璃芯片', '标准组件', 'BIPV'][i] + '-' + fac.id, | ||||
|             //   type: 'bar', | ||||
|             //   stack: String(fac.id), | ||||
|             //   data: Array(xAxisData.length).fill(0), | ||||
|             //   barWidth: 20, | ||||
|             //   itemStyle: { | ||||
|             //     color: this.colorList[i] | ||||
|             //   } | ||||
|             // } | ||||
|             // dataList.forEach(item => { | ||||
|             //   if (fac.id === item.factory && item.datestr === x) { | ||||
|             //     series.data[index] = item[index1] | ||||
|             //   } | ||||
|             // }) | ||||
|             // this.seriesList.push(series) | ||||
|           }) | ||||
|           i ++ | ||||
|         } | ||||
|       }) | ||||
|       console.log('你好', this.seriesList) | ||||
|       this.$refs.lineChart.initChart(xAxisData, this.seriesList) | ||||
|       // const chartList = Object.groupBy(list, (item) => item.tableTime) | ||||
|       // this.xAxis = [] | ||||
|       // this.seriesList = [] | ||||
|       // for (const keyIndex in chartList) { | ||||
|       //   // X坐标轴数据 | ||||
|       //   this.xAxis.push(keyIndex) | ||||
|       // } | ||||
|       // // y轴数据 | ||||
|       // for (const y of this.factoryArray) { | ||||
|       //   // y: {name: , id: } | ||||
|       //   const seriesItem = { | ||||
|       //     name: y.name, | ||||
|       //       type: 'bar', | ||||
|       //       emphasis: { | ||||
|       //         focus: 'series' | ||||
|       //       }, | ||||
|       //     data: Array(this.xAxis.length).fill(0) | ||||
|       //   } | ||||
|       //   for (const a in chartList) { | ||||
|       //     for (const z of chartList[a]) { | ||||
|       //       this.xAxis.forEach((item, index) => { | ||||
|       //         if (z.factory === y.id && a === item) { | ||||
|       //           seriesItem.data[index] = z.goodNumber | ||||
|       //         } | ||||
|       //       }) | ||||
|       //     } | ||||
|       //   } | ||||
|       //   this.seriesList.push(seriesItem) | ||||
|       // } | ||||
|       // this.$refs.lineChart.initChart(this.xAxis, this.seriesList) | ||||
|     }, | ||||
| 		buttonClick(val) { | ||||
| 			this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined; | ||||
| 			switch (val.btnName) { | ||||
| 				case 'search': | ||||
| 					this.listQuery.current = 1; | ||||
| 					this.listQuery.size = 20; | ||||
| 					this.listQuery.pageNo = 1; | ||||
| 					this.listQuery.pageSize = 20; | ||||
| 					this.getDataList(); | ||||
| 					break; | ||||
| 				case 'export': | ||||
| @@ -448,8 +491,8 @@ export default { | ||||
|       this.$modal.confirm('是否确认导出生产数据?').then(() => { | ||||
|         // 处理查询参数 | ||||
|         let params = {...this.listQuery}; | ||||
|         params.current = 1; | ||||
|         params.size = 999; | ||||
|         params.pageNo = 1; | ||||
|         params.pageSize = 999; | ||||
|         this.exportLoading = true; | ||||
|         return exportOutPutExcel(params); | ||||
|       }).then(response => { | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: zwq | ||||
|  * @Date: 2022-01-21 14:43:06 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2024-05-30 14:52:05 | ||||
|  * @LastEditTime: 2024-06-24 11:13:48 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -16,6 +16,8 @@ | ||||
| import * as echarts from 'echarts' | ||||
| import 'echarts/theme/macarons' // echarts theme | ||||
| import resize from '@/mixins/resize' | ||||
| import { factoryListabbr } from "@/utils/constants"; | ||||
|  | ||||
| export default { | ||||
|   name: 'OverviewBar', | ||||
|   mixins: [resize], | ||||
| @@ -38,7 +40,7 @@ export default { | ||||
|     }, | ||||
|     height: { | ||||
|       type: String, | ||||
|       default: '30vh' | ||||
|       default: '35vh' | ||||
|     }, | ||||
|     legendPosition: { | ||||
|       type: String, | ||||
| @@ -72,63 +74,105 @@ export default { | ||||
|   }, | ||||
|   methods: { | ||||
|     initChart(xAxis, seriesList) { | ||||
|       this.chart = echarts.init(document.getElementById(this.id)) | ||||
|       console.log(this.$parent); | ||||
|       this.chart.setOption({ | ||||
|       console.log('2', xAxis, seriesList) | ||||
|       if (xAxis.length === 0) { | ||||
|         this.chart.clear() | ||||
|       } | ||||
|       else { | ||||
|         this.chart = echarts.init(document.getElementById(this.id)) | ||||
|         console.log(this.$parent); | ||||
|         this.chart.setOption({ | ||||
|         title: { | ||||
|           text: '', | ||||
|           // subtext: 'Fake Data' | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: 'axis' | ||||
|         }, | ||||
|         grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true }, | ||||
|         legend: { | ||||
|           // data: ['工厂1', '工厂2'], | ||||
|           right: '90px', | ||||
|           top: '0%', | ||||
|           icon: 'rect', | ||||
|           itemWidth: 10, | ||||
|           itemHeight: 10, | ||||
|           itemGap: 40, | ||||
|           formatter(name) { | ||||
|             return name.split('-')[0] | ||||
|           }, | ||||
|           data: ['玻璃芯片-0', '标准组件-0', 'BIPV-0'] | ||||
|         }, | ||||
|         // toolbox: { | ||||
|         //   show: true, | ||||
|         //   feature: { | ||||
|         //     dataView: { show: true, readOnly: false }, | ||||
|         //     magicType: { show: true, type: ['line', 'bar'] }, | ||||
|         //     restore: { show: true }, | ||||
|         //     saveAsImage: { show: true } | ||||
|         //   } | ||||
|         // }, | ||||
|         tooltip: { | ||||
|           trigger: 'axis', | ||||
|           formatter: function(params) { | ||||
|             let result = ` | ||||
|             <div style="width: 270px; display: flex"> | ||||
|               <div style="width: 150px">${params[0].name}</div> | ||||
|               <div style="width: 60px">${factoryListabbr[0]}</div> | ||||
|               <div style="width: 60px">${factoryListabbr[1]}</div> | ||||
|             </div>` | ||||
|             const newArray = params.map(p => { | ||||
|               return { | ||||
|                 glass: p.seriesName.split('-')[0], // 玻璃类型 | ||||
|                 factoryName: factoryListabbr[p.seriesName.split('-')[1]], // 工厂名称 | ||||
|                 value: p.value, | ||||
|                 name: p.name, | ||||
|                 marker: p.marker | ||||
|               } | ||||
|             }) | ||||
|             const analyzeList = Object.groupBy(newArray, (member) => member.glass) | ||||
|             for (let g in analyzeList) { | ||||
|               // date => 玻璃类型 | ||||
|               let oneData = `<div style="width: 270px; display: flex"> | ||||
|               <div style="width: 150px">${analyzeList[g][0].marker} ${g}</div>` | ||||
|               for (let fac of factoryListabbr) { | ||||
|                 let goodNum = 0 | ||||
|                 for (let ana of analyzeList[g]) { | ||||
|                   if (ana.factoryName === fac && ana.value !== 0) { | ||||
|                     goodNum = ana.value | ||||
|                   } | ||||
|                 } | ||||
|                 oneData += `<div style="width: 60px">${goodNum}</div>` | ||||
|               } | ||||
|               result = result + oneData + '</div>' | ||||
|             } | ||||
|             return result | ||||
|           } | ||||
|         }, | ||||
|         grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true }, | ||||
|         calculable: true, | ||||
|         xAxis: [ | ||||
|           { | ||||
|             type: 'category', | ||||
|             // prettier-ignore | ||||
|             data: xAxis | ||||
|             name: '日期', | ||||
|             data: xAxis, | ||||
|             axisLabel: { | ||||
|               rotate: 25 | ||||
|             } | ||||
|           } | ||||
|         ], | ||||
|         yAxis: [ | ||||
|           { | ||||
|             type: 'value' | ||||
|             type: 'value', | ||||
|             name: '单位:个' | ||||
|           } | ||||
|         ], | ||||
|         grid: { | ||||
|           top: '20%', | ||||
|           top: '10%', | ||||
|           left: "1%", | ||||
|           right: "3%", | ||||
|           bottom: "1%", | ||||
|           right: "5%", | ||||
|           bottom: "0%", | ||||
|           containLabel: true | ||||
|         }, | ||||
|         series: seriesList | ||||
|       }, true) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
| .chartTooltipSpan { | ||||
|   width: 50px; | ||||
|   background: #787878; | ||||
| } | ||||
| /* .reportChart { | ||||
|   position: absolute; | ||||
|   height: 100%; | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-17 16:31:51 | ||||
|  * @LastEditTime: 2024-06-04 16:45:52 | ||||
|  * @LastEditTime: 2024-06-24 15:43:50 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -11,7 +11,7 @@ | ||||
|       {{ dataForm.id ? '编辑' : '新增' }} | ||||
|     </small-title> | ||||
|     <div class="detailBox"> | ||||
|       <el-form ref="form" :model="dataForm" label-width="80px" label-position="top"> | ||||
|       <el-form ref="form" :model="dataForm" label-width="80px" :rules="dataRule" label-position="top"> | ||||
|         <el-row :gutter="24" style="padding: 0 32px;"> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item v-if="ftype === 0" label="工厂名称" prop="factory"> | ||||
| @@ -29,7 +29,7 @@ | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="时间维度" prop="targetType"> | ||||
|               <el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable> | ||||
|               <el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable @change="clearTime"> | ||||
|                 <!-- <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> --> | ||||
|                 <el-option label="日" :value="0" /> | ||||
|                 <el-option label="周" :value="1" /> | ||||
| @@ -40,19 +40,19 @@ | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item v-show="dataForm.targetType === 0 || dataForm.targetType === ''" label="时间" prop="reportTime"> | ||||
|               <el-date-picker v-model="reportTime" value-format="yyyyMMdd" type="date" placeholder="选择日"> | ||||
|               <el-date-picker v-model="dataForm.reportTime" value-format="yyyyMMdd" type="date" placeholder="选择日"> | ||||
|               </el-date-picker> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-show="dataForm.targetType === 1" label="时间" prop="week"> | ||||
|               <el-date-picker v-model="week" type="week" format="yyyy 第 WW 周" placeholder="选择周"> | ||||
|             <el-form-item v-show="dataForm.targetType === 1" label="时间" prop="reportTime"> | ||||
|               <el-date-picker v-model="week" type="week" format="yyyy 第 WW 周" placeholder="选择周" @change="setReportTime"> | ||||
|               </el-date-picker> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-show="dataForm.targetType === 2" label="时间" prop="reportTime"> | ||||
|               <el-date-picker v-model="reportTime" value-format="yyyyMM" type="month" placeholder="选择月份"> | ||||
|               <el-date-picker v-model="dataForm.reportTime" value-format="yyyyMM" type="month" placeholder="选择月份"> | ||||
|               </el-date-picker> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-show="dataForm.targetType === 3" label="时间" prop="reportTime"> | ||||
|               <el-date-picker clearable v-model="reportTime" value-format="yyyy" type="year" placeholder="开始时间"> | ||||
|               <el-date-picker clearable v-model="dataForm.reportTime" value-format="yyyy" type="year" placeholder="开始时间"> | ||||
|               </el-date-picker> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
| @@ -170,6 +170,11 @@ | ||||
|               <el-input-number v-model="dataForm.componentAveragePower" :precision="2" controls-position="right" placeholder="请输入标准组件平均功率" style="width: 100%" /> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="6"> | ||||
|             <el-form-item label="标准组件转化效率" prop="componentConversionEfficiency"> | ||||
|               <el-input-number v-model="dataForm.componentConversionEfficiency" :precision="2" controls-position="right" placeholder="请输入标准组件转化效率" style="width: 100%" /> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-divider></el-divider> | ||||
|  | ||||
| @@ -260,9 +265,10 @@ export default { | ||||
|       teamList: [], | ||||
|       sectionList: [], | ||||
|       visible: false, | ||||
|       reportTime: undefined, | ||||
|       // reportTime: undefined, | ||||
|       week: undefined, | ||||
|       dataForm: { | ||||
|         reportTime: undefined, | ||||
|         factoryType: 0, | ||||
|         id: undefined, | ||||
|         factory: undefined, | ||||
| @@ -293,13 +299,14 @@ export default { | ||||
|         bipvInsideMaterialCost: undefined, | ||||
|         bipvOeeMaterialCost: undefined, | ||||
|         bipvComprehensiveMaterialCost: undefined, | ||||
|         molybdenumElectrodeInput: undefined | ||||
|         molybdenumElectrodeInput: undefined, | ||||
|         componentConversionEfficiency: undefined | ||||
|       }, | ||||
|       // materialList: [], | ||||
|       dataRule: { | ||||
|         // materialId: [{ required: true, message: "", trigger: "blur" }], | ||||
|         // workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }], | ||||
|         // num: [{ required: true, message: "数量不能为空", trigger: "blur" }], | ||||
|         factory: [{ required: true, message: "工厂名称不能为空", trigger: "chnage" }], | ||||
|         reportTime: [{ required: true, message: "时间不能为空", trigger: "change" }], | ||||
|         targetType: [{ required: true, message: "时间维度不能为空", trigger: "change" }] | ||||
|         // detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }], | ||||
|  | ||||
|         // logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }], | ||||
| @@ -310,6 +317,13 @@ export default { | ||||
|     // this.getCurrentTime() | ||||
|   }, | ||||
|   methods: { | ||||
|     setReportTime() { | ||||
|       this.dataForm.reportTime = this.week | ||||
|     }, | ||||
|     clearTime() { | ||||
|       this.week = undefined | ||||
|       this.dataForm.reportTime = undefined | ||||
|     }, | ||||
|     formClear() { | ||||
|       if (this.$refs.dataForm !== undefined) { | ||||
|         this.$refs.dataForm.resetFields() | ||||
| @@ -319,35 +333,41 @@ export default { | ||||
|     //   this.dataForm.targetTime = undefined | ||||
|     // },  | ||||
|     handleClose() { | ||||
|       // 新增 | ||||
|       if (this.dataForm.targetType === 1) { | ||||
|         this.dataForm.targetTime = this.week ? Number(moment(this.week.getTime()).format('YYYYWW')) : undefined | ||||
|       } else { | ||||
|         this.dataForm.targetTime = this.reportTime ? Number(this.reportTime) : undefined | ||||
|       } | ||||
|       if (this.dataForm.id) { | ||||
|         // 修改 | ||||
|         updateProduceTarget({ | ||||
|           ...this.dataForm | ||||
|         }).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.$message.success('修改成功!') | ||||
|             this.visible = false | ||||
|             this.$emit('refreshDataList') | ||||
|       this.$refs["form"].validate(valid => { | ||||
|         if (valid) { | ||||
|           // 新增 | ||||
|           if (this.dataForm.targetType === 1) { | ||||
|             this.dataForm.targetTime = this.week ? Number(moment(this.week.getTime()).format('YYYYWW')) : '' | ||||
|           } else { | ||||
|             this.dataForm.targetTime = this.dataForm.reportTime ? Number(this.dataForm.reportTime) : '' | ||||
|           } | ||||
|         }) | ||||
|       } else { | ||||
|         // 新增 | ||||
|         createProduce({ | ||||
|           ...this.dataForm | ||||
|         }).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.$message.success('新增成功!') | ||||
|             this.visible = false | ||||
|             this.$emit('refreshDataList') | ||||
|           if (this.dataForm.id) { | ||||
|             // 修改 | ||||
|             updateProduceTarget({ | ||||
|               ...this.dataForm, | ||||
|               reportTime: undefined | ||||
|             }).then(res => { | ||||
|               if (res.code === 0) { | ||||
|                 this.$message.success('修改成功!') | ||||
|                 this.visible = false | ||||
|                 this.$emit('refreshDataList') | ||||
|               } | ||||
|             }) | ||||
|           } else { | ||||
|             // 新增 | ||||
|             createProduce({ | ||||
|               ...this.dataForm, | ||||
|               reportTime: undefined | ||||
|             }).then(res => { | ||||
|               if (res.code === 0) { | ||||
|                 this.$message.success('新增成功!') | ||||
|                 this.visible = false | ||||
|                 this.$emit('refreshDataList') | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     init(id) { | ||||
|       this.dataForm.id = id || undefined | ||||
| @@ -355,9 +375,15 @@ export default { | ||||
|       this.visible = true | ||||
|       if (this.dataForm.id) { | ||||
|         getProduceTargetDetail(this.dataForm.id).then(res => { | ||||
|           this.dataForm = res.data | ||||
|           // this.dataForm = res.data | ||||
|           for (const i in res.data) { | ||||
|             if (res.data[i] !== null) { | ||||
|               this.dataForm[i] = res.data[i] | ||||
|             } | ||||
|           } | ||||
|           if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) { | ||||
|             this.reportTime = String(this.dataForm.targetTime) | ||||
|             // this.dataForm.reportTime = String(this.dataForm.targetTime) | ||||
|             this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetTime)) | ||||
|           } | ||||
|           if (this.dataForm.targetType === 1) { | ||||
|             const date = new Date() | ||||
| @@ -366,6 +392,7 @@ export default { | ||||
|             date.setDate((Number(String(this.dataForm.targetTime).slice(4)) - 1)* 7 + 1) | ||||
|             // console.log('你好', date, moment(date).format('yyyyWW'), String(this.dataForm.targetTime).slice(4)) | ||||
|             this.week = date | ||||
|             this.$set(this.dataForm, 'reportTime', date) | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|   | ||||
| @@ -1,14 +1,15 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2023-11-06 15:15:30 | ||||
|  * @LastEditTime: 2024-06-04 16:54:46 | ||||
|  * @LastEditTime: 2024-06-14 10:41:23 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <el-drawer class="drawer" :visible.sync="visible" size="58%" @closed="$emit('destroy')"> | ||||
|   <el-drawer class="drawer" :visible.sync="visible" size="70%" @closed="$emit('destroy')"> | ||||
|     <small-title slot="title" :no-padding="true"> | ||||
|       {{ ftype === 0 ? '碲化镉工厂生产数据详情' : '铜铟镓硒工厂生产数据详情' }} | ||||
|       <!-- {{ ftype === 0 ? '碲化镉工厂生产数据详情' : '铜铟镓硒工厂生产数据详情' }} --> | ||||
|       生产目标详情 | ||||
|     </small-title> | ||||
|     <div class="detailBox"> | ||||
|       <el-row :gutter="24"> | ||||
| @@ -113,6 +114,10 @@ | ||||
|           <p class="title">标准组件平均功率(W)</p> | ||||
|           <p class="text">{{ dataForm.componentAveragePower }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <p class="title">标准组件转化效率</p> | ||||
|           <p class="text">{{ dataForm.componentConversionEfficiency }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> | ||||
|         {{ 'BIPV产品' }} | ||||
| @@ -197,35 +202,9 @@ export default { | ||||
|       ], | ||||
|       sectionList: [], | ||||
|       visible: false, | ||||
|       dataForm: { | ||||
|         id: undefined, | ||||
|         logTime: undefined, | ||||
|         source: 1, | ||||
|         detId: undefined, | ||||
|         workOrderId: null, | ||||
|         teamId: undefined, | ||||
|         num: undefined, | ||||
|         lineId: undefined, | ||||
|         description: undefined, | ||||
|         // description: undefined, | ||||
|         remark: undefined, | ||||
|       }, | ||||
|       // materialList: [], | ||||
|       dataRule: { | ||||
|         // materialId: [{ required: true, message: "", trigger: "blur" }], | ||||
|         workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }], | ||||
|         num: [{ required: true, message: "数量不能为空", trigger: "blur" }], | ||||
|         detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }], | ||||
|  | ||||
|         logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }], | ||||
|       } | ||||
|       dataForm: {} | ||||
|     }; | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.getDict() | ||||
|     console.log('我看看', this.dataForm) | ||||
|     // this.getCurrentTime() | ||||
|   }, | ||||
|   methods: { | ||||
|     init(id) { | ||||
|       this.visible = true | ||||
| @@ -235,102 +214,7 @@ export default { | ||||
|           this.dataForm = res.data | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     // getCurrentTime() { | ||||
|     //   // new Date().Format("yyyy-MM-dd HH:mm:ss") | ||||
|     //   this.dataForm.logTime = new Date() | ||||
|     //   // this.dataForm.logTime = year + "-" + month + "-" + day; | ||||
|     //   console.log(this.dataForm.logTime); | ||||
|     // }, | ||||
|     async getDict() { | ||||
|     //   // 物料列表 | ||||
|     //   const res = await getList() | ||||
|     //   this.typeList = res.data | ||||
|     //   getWorkOrderList().then((res) => { | ||||
|     //     console.log(res); | ||||
|     //     // console.log(response); | ||||
|     //     this.workOrderList = res.data.map((item) => { | ||||
|     //       return { | ||||
|     //         name: item.name, | ||||
|     //         id: item.id | ||||
|     //       } | ||||
|     //     }) | ||||
|     //     // console.log(this.formConfig[0].selectOptions); | ||||
|     //     // this.listQuery.total = response.data.total; | ||||
|     //   }) | ||||
|     //   getLineList().then((res) => { | ||||
|     //     console.log(res); | ||||
|     //     // console.log(response); | ||||
|     //     this.lineList = res.data.map((item) => { | ||||
|     //       return { | ||||
|     //         name: item.name, | ||||
|     //         id: item.id | ||||
|     //       } | ||||
|     //     }) | ||||
|     //     // console.log(this.formConfig[0].selectOptions); | ||||
|     //     // this.listQuery.total = response.data.total; | ||||
|     //   }) | ||||
|     //   getDetList().then((res) => { | ||||
|     //     console.log(res); | ||||
|     //     // console.log(response); | ||||
|     //     this.detList = res.data.map((item) => { | ||||
|     //       return { | ||||
|     //         name: item.content, | ||||
|     //         id: item.id | ||||
|     //       } | ||||
|     //     }) | ||||
|     //     // console.log(this.formConfig[0].selectOptions); | ||||
|     //     // this.listQuery.total = response.data.total; | ||||
|     //   }) | ||||
|     //   getTeamList().then((res) => { | ||||
|     //     console.log(res); | ||||
|     //     // console.log(response); | ||||
|     //     this.teamList = res.data.map((item) => { | ||||
|     //       return { | ||||
|     //         name: item.name, | ||||
|     //         id: item.id | ||||
|     //       } | ||||
|     //     }) | ||||
|     //     // console.log(this.formConfig[0].selectOptions); | ||||
|     //     // this.listQuery.total = response.data.total; | ||||
|     //   }) | ||||
|     // }, | ||||
|     // async getWorksectionById(lineId) { | ||||
|     //   if (lineId) { | ||||
|     //     const { code, data } = await this.$axios({ | ||||
|     //       url: '/base/core-workshop-section/listByParentId', | ||||
|     //       method: 'get', | ||||
|     //       params: { | ||||
|     //         id: lineId, | ||||
|     //       }, | ||||
|     //     }); | ||||
|     //     if (code == 0) { | ||||
|     //       console.log(data) | ||||
|     //       this.sectionList = data.map((item) => { | ||||
|     //         return { | ||||
|     //           name: item.name, | ||||
|     //           id: item.id, | ||||
|     //         }; | ||||
|     //       }); | ||||
|     //     } | ||||
|     //   } else { | ||||
|     //     this.$axios({ | ||||
|     //       url: '/base/core-workshop-section/listAll', | ||||
|     //       method: 'get', | ||||
|     //       // params: { | ||||
|     //       //   id: lineId, | ||||
|     //       // }, | ||||
|     //     }).then((res) => { | ||||
|     //       // console.log(data) | ||||
|     //       this.sectionList = res.data.map((item) => { | ||||
|     //         return { | ||||
|     //           name: item.name, | ||||
|     //           id: item.id, | ||||
|     //         }; | ||||
|     //       }); | ||||
|     //     }) | ||||
|     //   } | ||||
|     }, | ||||
|     } | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-15 10:49:13 | ||||
|  * @LastEditTime: 2024-06-05 16:19:04 | ||||
|  * @LastEditTime: 2024-06-20 16:41:48 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -24,7 +24,7 @@ | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="时间维度" prop="date"> | ||||
|           <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择"> | ||||
|           <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择" @change="clearTime"> | ||||
|             <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
| @@ -144,7 +144,6 @@ | ||||
| import { parseTime } from '@/utils/ruoyi'; | ||||
| import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData'; | ||||
| // import inputTable from './inputTable.vue'; | ||||
| import lineChart from './lineChart'; | ||||
| import moment from 'moment' | ||||
| import ButtonNav from '@/components/ButtonNav' | ||||
| import basicPage from '@/mixins/basic-page' | ||||
| @@ -157,7 +156,7 @@ import {getBaseHeader} from "@/utils/request"; | ||||
| // import FileSaver from 'file-saver' | ||||
| // import * as XLSX from 'xlsx' | ||||
| export default { | ||||
|   components: { lineChart, ButtonNav, detailOrUpdate, addOrUpdate }, | ||||
|   components: { ButtonNav, detailOrUpdate, addOrUpdate }, | ||||
|   mixins: [basicPage], | ||||
| 	data() { | ||||
|     return { | ||||
| @@ -414,12 +413,12 @@ export default { | ||||
|         }, | ||||
|       ], | ||||
|       // timeSelect:'month', | ||||
|       startTimeStamp:null, //开始时间 | ||||
|       endTimeStamp:null, //结束时间 | ||||
|       // startTimeStamp:null, //开始时间 | ||||
|       // endTimeStamp:null, //结束时间 | ||||
|       // date:'凯盛玻璃控股成员企业2024生产数据', | ||||
| 			// reportTime: '', | ||||
| 			startTimeStamp: '', | ||||
| 			endTimeStamp: '', | ||||
| 			// startTimeStamp: '', | ||||
| 			// endTimeStamp: '', | ||||
|       tableData: [], | ||||
|       facType: 0 | ||||
| 			// proLineList: [], | ||||
| @@ -458,6 +457,13 @@ export default { | ||||
|     this.changeTime() | ||||
| 	}, | ||||
|   methods: { | ||||
|     clearTime() { | ||||
|       this.listQuery.beginTime = undefined | ||||
|       this.listQuery.endTime = undefined | ||||
|       this.listQuery.reportTime = [] | ||||
|       this.start = undefined | ||||
|       this.end = undefined | ||||
|     }, | ||||
|     handleImport() { | ||||
|       this.upload.title = "生产目标导入"; | ||||
|       this.upload.open = true; | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2023-11-06 15:15:30 | ||||
|  * @LastEditTime: 2024-06-07 14:15:00 | ||||
|  * @LastEditTime: 2024-06-27 14:50:21 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| @@ -23,7 +23,7 @@ | ||||
|         </el-col> | ||||
|         <el-col :span="3"> | ||||
|           <p class="title">工单类型</p> | ||||
|           <p class="text">{{ ['', '芯片订单', '组件类型', 'bipv类型'][dataForm.workOrderType] }}</p> | ||||
|           <p class="text">{{ ['', '芯片工单', '组件类型', 'bipv类型'][dataForm.workOrderType] }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="3"> | ||||
|           <p class="title">工单来源</p> | ||||
| @@ -39,7 +39,7 @@ | ||||
|         </el-col> | ||||
|         <el-col :span="3"> | ||||
|           <p class="title">工单状态</p> | ||||
|           <p class="text">{{ ['未开始', '生产中', '已完成'][dataForm.orderStatus] }}</p> | ||||
|           <p class="text">{{ ['', '未开始', '生产中', '已完成'][dataForm.orderStatus] }}</p> | ||||
|         </el-col> | ||||
|         <el-col :span="3"> | ||||
|           <p class="title">投入状态</p> | ||||
| @@ -76,15 +76,44 @@ | ||||
|           <p class="text">{{ dataForm.endDate?.length > 0 ? dataForm.endDate[0] + '-' + dataForm.endDate[1] + '-' + dataForm.endDate[2] : '' }}</p> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-divider></el-divider> | ||||
|       <div class="chartDiv"> | ||||
|         <div ref="bar" :style="{ height: '30vh', width: '40vw' }" /> | ||||
|         <div ref="pie" :style="{ height: '30vh', width: '40vw' }" /> | ||||
|       </div> | ||||
|       <div class="chartDiv"> | ||||
|         <div ref="equipmentLine" :style="{ height: '30vh', width: '40vw' }" /> | ||||
|         <div ref="line" v-show="dataForm.orderStatus === 1" :style="{ height: '30vh', width: '40vw' }" /> | ||||
|       </div> | ||||
|       <div style="width: 100%; padding: 0 32px"><el-divider style="margin: 0"></el-divider></div> | ||||
|       <el-row :gutter="0" style="margin: 20px 32px"> | ||||
|         <el-col :span="8"> | ||||
|           <div> | ||||
|             <small-title slot="title" :no-padding="true"> | ||||
|               产品良率 | ||||
|             </small-title> | ||||
|             <div ref="pie" :style="{ height: '40vh', width: '100%' }" /> | ||||
|           </div> | ||||
|         </el-col> | ||||
|         <el-col :span="16"> | ||||
|           <div style="border-left: 1px solid #d1d3d8; width: 100%; padding-left: 32px"> | ||||
|             <small-title slot="title" :no-padding="true"> | ||||
|               历史趋势 | ||||
|             </small-title> | ||||
|             <div ref="line" v-show="dataForm.orderStatus === 2" :style="{ height: '40vh', width: '50vw' }" /> | ||||
|           </div> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <div style="width: 100%; padding: 0 32px"><el-divider style="margin: 0"></el-divider></div> | ||||
|       <el-row :gutter="0" style="margin: 20px 32px"> | ||||
|         <el-col :span="8"> | ||||
|           <div> | ||||
|             <small-title slot="title" :no-padding="true"> | ||||
|               生产明细 | ||||
|             </small-title> | ||||
|             <div ref="bar" :style="{ height: '40vh', width: '100%' }" /> | ||||
|           </div> | ||||
|         </el-col> | ||||
|         <el-col :span="16"> | ||||
|           <div style="border-left: 1px solid #d1d3d8; width: 100%; padding-left: 32px"> | ||||
|             <small-title slot="title" :no-padding="true"> | ||||
|               待制品分布 | ||||
|             </small-title> | ||||
|             <div ref="equipmentLine" :style="{ height: '40vh', width: '50vw' }" /> | ||||
|           </div> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|     </div> | ||||
|   </el-drawer> | ||||
|  | ||||
| @@ -118,7 +147,8 @@ export default { | ||||
|       barChart: null, | ||||
|       equipmentLineChart: null, | ||||
|       visible: false, | ||||
|       dataForm: {} | ||||
|       dataForm: {}, | ||||
|       colorList: ['#3E8EF7', '#69E6D8', '#F7C739'] // pie颜色 | ||||
|     } | ||||
|   }, | ||||
|   beforeDestroy() { | ||||
| @@ -227,38 +257,47 @@ export default { | ||||
|     initChart(barData) { | ||||
|       this.barChart = echarts.init(this.$refs['bar']) | ||||
|       this.barChart.setOption({ | ||||
|         title: { | ||||
|           text: '生产明细', | ||||
|           left: 'center' | ||||
|           // subtext: 'Fake Data' | ||||
|         }, | ||||
|         // title: { | ||||
|         //   text: '生产明细', | ||||
|         //   left: 'center' | ||||
|         //   // subtext: 'Fake Data' | ||||
|         // }, | ||||
|         color: ['#3E8EF7'], | ||||
|         tooltip: { | ||||
|           trigger: 'axis' | ||||
|         }, | ||||
|         grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true }, | ||||
|         calculable: true, | ||||
|         grid: { | ||||
|           top: '20%', | ||||
|           left: "1%", | ||||
|           right: "3%", | ||||
|           bottom: "1%", | ||||
|           top: '15%', | ||||
|           left: 0, | ||||
|           right: '10%', | ||||
|           bottom: 0, | ||||
|           containLabel: true | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: 'category', | ||||
|           data: ['目标产量', '计划投入量', '实际投入', '实际产出', '废品数量', '待再加工数量'], | ||||
|           axisLabel: { | ||||
|             rotate:45 | ||||
|             rotate: 25 | ||||
|           } | ||||
|         }, | ||||
|         yAxis: { | ||||
|           type: 'value' | ||||
|           type: 'value', | ||||
|           name: '单位/片', | ||||
|           axisLine: { | ||||
|             show: true | ||||
|           } | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             data: barData, | ||||
|             type: 'bar', | ||||
|             barWidth: '40%' | ||||
|             barWidth: '40%', | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: 'top' | ||||
|             } | ||||
|           } | ||||
|         ] | ||||
|       }, true) | ||||
| @@ -266,8 +305,9 @@ export default { | ||||
|     initPieChart(pieData) { | ||||
|       this.pieChart = echarts.init(this.$refs['pie']) | ||||
|       this.pieChart.setOption({ | ||||
|         color: ['#3E8EF7', '#69E6D8', '#F7C739'], | ||||
|         title: { | ||||
|           text: '产品良率 ' + (pieData[0].value / (pieData[0].value + pieData[1].value)).toFixed(4) * 100 + '%', | ||||
|           // text: !isNaN((pieData[0].value / (pieData[0].value + pieData[1].value)).toFixed(4) * 100) ? ( '产品良率 ' + (pieData[0].value / (pieData[0].value + pieData[1].value)).toFixed(4) * 100 + '%') : '产品良率 -', | ||||
|           left: 'center' | ||||
|           // subtext: 'Fake Data' | ||||
|         }, | ||||
| @@ -275,31 +315,31 @@ export default { | ||||
|           trigger: 'item' | ||||
|         }, | ||||
|         legend: { | ||||
|           top: '5%', | ||||
|           left: 'right', | ||||
|           orient: 'vertical' | ||||
|           bottom: 0, | ||||
|           left: 'center' | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             // name: 'Access From', | ||||
|             type: 'pie', | ||||
|             radius: ['40%', '70%'], | ||||
|             radius: ['50%', '70%'], | ||||
|             avoidLabelOverlap: false, | ||||
|             data: pieData, | ||||
|             label: { | ||||
|               show: false, | ||||
|               position: 'center' | ||||
|             }, | ||||
|             emphasis: { | ||||
|               label: { | ||||
|                 show: false, | ||||
|                 fontSize: 40, | ||||
|                 fontWeight: 'bold' | ||||
|               show: true, | ||||
|               position: 'outside', | ||||
|               formatter: '{d|{d}%} \n {b|{b}}', | ||||
|               rich: { | ||||
|                 d: { | ||||
|                   color: 'inherit', // 系列色 | ||||
|                   verticalAlign: 'top' | ||||
|                 }, | ||||
|                 b: { | ||||
|                   color: '#8C8C8C', | ||||
|                   verticalAlign: 'top' | ||||
|                 } | ||||
|               } | ||||
|             }, | ||||
|             labelLine: { | ||||
|               show: false | ||||
|             }, | ||||
|             data: pieData | ||||
|             } | ||||
|           } | ||||
|         ] | ||||
|       }, true) | ||||
| @@ -307,39 +347,48 @@ export default { | ||||
|     initEqLineChart(xAxisList, yAxisList) { | ||||
|       this.equipmentLineChart = echarts.init(this.$refs['equipmentLine']) | ||||
|       this.equipmentLineChart.setOption({ | ||||
|         title: { | ||||
|           text: '在制品分布', | ||||
|           left: 'center' | ||||
|           // subtext: 'Fake Data' | ||||
|         }, | ||||
|         // title: { | ||||
|         //   text: '待制品分布', | ||||
|         //   left: 'center' | ||||
|         //   // subtext: 'Fake Data' | ||||
|         // }, | ||||
|         color: ['#3E8EF7'], | ||||
|         tooltip: { | ||||
|           trigger: 'axis' | ||||
|         }, | ||||
|         grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true }, | ||||
|         calculable: true, | ||||
|         grid: { | ||||
|           top: '20%', | ||||
|           left: "1%", | ||||
|           right: "3%", | ||||
|           bottom: "1%", | ||||
|           top: '15%', | ||||
|           left: 0, | ||||
|           right: 0, | ||||
|           bottom: 0, | ||||
|           containLabel: true | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: 'category', | ||||
|           data: xAxisList, | ||||
|           axisLabel: { | ||||
|             rotate:45, | ||||
|             rotate: 25 | ||||
|             // width: '10%' | ||||
|           } | ||||
|         }, | ||||
|         yAxis: { | ||||
|           type: 'value' | ||||
|           type: 'value', | ||||
|           name: '单位/片', | ||||
|           axisLine: { | ||||
|             show: true | ||||
|           } | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             data: yAxisList, | ||||
|             type: 'bar', | ||||
|             barWidth: '40px' | ||||
|             barWidth: '50%', | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: 'top' | ||||
|             } | ||||
|           } | ||||
|         ] | ||||
|       }, true) | ||||
| @@ -347,24 +396,39 @@ export default { | ||||
|     initLineChart(xAxisList, seriesList) { | ||||
|       this.lineChart = echarts.init(this.$refs['line']) | ||||
|       this.lineChart.setOption({ | ||||
|         title: { | ||||
|           text: '历史趋势', | ||||
|           left: 'center' // 设置标题居中 | ||||
|         color: ['#3E8EF7'], | ||||
|         tooltip: { | ||||
|           trigger: 'item' | ||||
|         }, | ||||
|         grid: { | ||||
|           top: '15%', | ||||
|           left: 0, | ||||
|           right: 0, | ||||
|           bottom: 0, | ||||
|           containLabel: true | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: 'category', | ||||
|           data: xAxisList, | ||||
|           axisLabel: { | ||||
|             rotate:45 | ||||
|             rotate: 25 | ||||
|           } | ||||
|         }, | ||||
|         yAxis: { | ||||
|           type: 'value' | ||||
|           type: 'value', | ||||
|           name: '单位/片', | ||||
|           axisLine: { | ||||
|             show: true | ||||
|           } | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             data: seriesList, | ||||
|             type: 'line' | ||||
|             type: 'line', | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: 'top' | ||||
|             } | ||||
|           } | ||||
|         ] | ||||
|       }, true) | ||||
| @@ -378,14 +442,8 @@ export default { | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
| .chartDiv { | ||||
|   display: flex; | ||||
|   justify-content: space-between; | ||||
|   width: 100%; | ||||
|   padding: 5px; | ||||
|   padding-left: 30px; | ||||
| } | ||||
|   .drawer >>> .el-drawer { | ||||
|   border-radius: 8px 0 0 8px; | ||||
| } | ||||
| @@ -402,7 +460,8 @@ export default { | ||||
| } | ||||
| .detailBox p { | ||||
|   margin: 0; | ||||
|   padding: 0 32px; | ||||
|   padding-left: 32px; | ||||
|   /* padding: 0 32px; */ | ||||
| } | ||||
| .detailBox .title { | ||||
|   /* width: 56px; */ | ||||
| @@ -424,6 +483,8 @@ export default { | ||||
| } | ||||
| .detailBox { | ||||
|   padding-top: 30px; | ||||
|   width: 99%; | ||||
|   overflow-x: hidden; | ||||
|   overflow-y: auto; | ||||
|   /* width: 99%; */ | ||||
| } | ||||
| </style> | ||||
|   | ||||
| @@ -1,28 +1,56 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-15 10:49:13 | ||||
|  * @LastEditTime: 2024-06-07 10:35:48 | ||||
|  * @LastEditTime: 2024-06-24 15:08:34 | ||||
|  * @LastEditors: DY | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 35px)"> | ||||
|     <div class="app-container" style="margin-top: 8px; padding: 0 16px; height: auto; font-size: 20px; text-align: center;"> | ||||
|       <p style="margin-bottom: 0">数据概览</p> | ||||
|       <div class="view"> | ||||
|         <div v-for="(item, index) in data" :key="index"> | ||||
|           <p style="color: rgb(194,128,255)">{{ item }}</p> | ||||
|           <p>{{ index }}</p> | ||||
|     <el-row :gutter="10"> | ||||
|       <el-col :span="4"> | ||||
|         <div class="app-container" style="padding: 16px; height: auto; text-align: left; border-radius: 8px;"> | ||||
|         <!-- <p style="margin-bottom: 0">数据概览</p> --> | ||||
|           <div class="view"> | ||||
|             <div style="padding: 10px 0; width: 100%"> | ||||
|               <div class="topDiv"> | ||||
|                 <div style="width: 4px; height: 52px; background: #71CC8C; border-radius: 2px;"></div> | ||||
|                 <div class="centerDiv"> | ||||
|                   <span style="font-size: 30px; line-height: 30px; color: rgba(0,0,0,0.85);">{{ inputNum }}</span> | ||||
|                   <span style="font-size: 14px; color: rgba(0,0,0,0.85);">在制工单数量</span> | ||||
|                 </div> | ||||
|                 <svg-icon icon-class="workProcess" style="width: 26px; height: 26px" /> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div class="app-container" style="margin-top: 8px; height: auto;"> | ||||
|       </el-col> | ||||
|       <el-col :span="20"> | ||||
|         <div class="app-container" style="padding: 16px; height: auto; text-align: left; border-radius: 8px;"> | ||||
|         <!-- <p style="margin-bottom: 0">数据概览</p> --> | ||||
|           <div class="view"> | ||||
|             <div style="padding: 10px 0; width: 100%" v-for="(item, index) in factorys" :key="index"> | ||||
|               <div class="topDiv"> | ||||
|                 <div style="width: 4px; height: 52px; background: #3A79FF; border-radius: 2px;"></div> | ||||
|                 <div class="centerDiv"> | ||||
|                   <span style="font-size: 30px; line-height: 30px; color: rgba(0,0,0,0.85);">{{ factoryNum[index] }}</span> | ||||
|                   <span style="font-size: 14px; color: rgba(0,0,0,0.85);">{{item}}</span> | ||||
|                 </div> | ||||
|                 <svg-icon icon-class="factoryWorkOrder" style="width: 26px; height: 26px" /> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <!-- <div class="app-container" style="margin-top: 8px; height: auto;"> | ||||
|       <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | ||||
|     </div> --> | ||||
|     <div class="app-container" style="margin-top: 8px;flex-grow: 1;"> | ||||
|       <!-- <search-bar :formConfigs="formConfig2" ref="searchBarForm" style="margin-bottom: 0" /> --> | ||||
|       <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | ||||
|     </div> | ||||
|     <div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto;"> | ||||
|       <search-bar :formConfigs="formConfig2" ref="searchBarForm" style="margin-bottom: 0" /> | ||||
|       <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" | ||||
|         :table-data="tableData"> | ||||
|         :table-data="tableData" :max-height="tableH"> | ||||
|         <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" | ||||
|           :method-list="tableBtn" @clickBtn="handleClick" /> | ||||
|       </base-table> | ||||
| @@ -43,19 +71,25 @@ import { getWorkOrderPage, exportExcel, getOverView } from '@/api/produceData/or | ||||
| // import inputTable from './inputTable.vue'; | ||||
| import lineChart from './lineChart'; | ||||
| import moment from 'moment' | ||||
| import tableHeightMixin from "@/mixins/tableHeightMixin"; | ||||
| // import ButtonNav from '@/components/ButtonNav' | ||||
| import basicPage from '@/mixins/basic-page' | ||||
| import AddOrUpdate from './add-or-updata'; | ||||
| import { factoryList, factoryArray } from "@/utils/constants"; | ||||
| import { publicFormatter } from "@/utils/dict"; | ||||
| // import { publicFormatter } from "@/utils/dict"; | ||||
| import statusChart from "./statusChart.vue"; | ||||
|  | ||||
| // import FileSaver from 'file-saver' | ||||
| // import * as XLSX from 'xlsx' | ||||
| export default { | ||||
|   components: { lineChart, AddOrUpdate }, | ||||
|   mixins: [basicPage], | ||||
|   mixins: [basicPage, tableHeightMixin], | ||||
| 	data() { | ||||
|     return { | ||||
|       factorys: ['瑞昌中建材', '邯郸中建材', '株洲中建材', '佳木斯中建材', '成都中建材', '凯盛光伏', '蚌埠兴科'], | ||||
|       factoryNum: [0, 0, 0, 0, 0, 0, 0], | ||||
|       inputNum: 0, | ||||
|       heightNum: 180, | ||||
|       factoryList, | ||||
|       factoryArray, | ||||
|       listQuery: { | ||||
| @@ -108,15 +142,15 @@ export default { | ||||
|           selectOptions: [ | ||||
|             { | ||||
|               label: '未开始', | ||||
|               value: 0 | ||||
|             }, | ||||
|             { | ||||
|               label: '生产中', | ||||
|               value: 1 | ||||
|             }, | ||||
|             { | ||||
|               label: '已完成', | ||||
|               label: '生产中', | ||||
|               value: 2 | ||||
|             }, | ||||
|             { | ||||
|               label: '已完成', | ||||
|               value: 3 | ||||
|             } | ||||
|           ], | ||||
|           labelField: "label", | ||||
| @@ -173,12 +207,14 @@ export default { | ||||
|           prop: 'factory', | ||||
|           label: '工厂名称', | ||||
|           filter: (val) => factoryList[val], | ||||
|           minWidth: 200, | ||||
|           minWidth: 220, | ||||
|           showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
|           prop: 'workOrderNumber', | ||||
|           label: '工单号', | ||||
|           minWidth: 130, | ||||
|           showOverflowtooltip: true | ||||
|           // filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val] | ||||
|         }, | ||||
|         { | ||||
| @@ -211,8 +247,8 @@ export default { | ||||
|         { | ||||
|           prop: 'orderStatus', | ||||
|           label: '工单状态', | ||||
|           filter: publicFormatter('workorder_status') | ||||
|           // filter: (val) => ['未开始', '生产中', '已完成'][val], | ||||
|           subcomponent: statusChart | ||||
|           // filter: (val) => ['', '未开始', '生产中', '已完成'][val], | ||||
|         }, | ||||
|         { | ||||
|           prop: 'startTime', | ||||
| @@ -229,15 +265,15 @@ export default { | ||||
|       ], | ||||
|       tableData: [], | ||||
|       xAxis: [], | ||||
|       lineData: {}, | ||||
|       data: {} | ||||
|       lineData: {} | ||||
|       // data: {} | ||||
| 			// proLineList: [], | ||||
| 			// all: {} | ||||
| 		}; | ||||
|   }, | ||||
| 	created() { | ||||
|     const today = new Date() | ||||
|     const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) | ||||
|     const sevenDaysAgo = new Date(today.getTime() - (6 * 24 * 60 * 60 * 1000)) | ||||
|     this.listQuery.time = [moment(sevenDaysAgo).format('yyyy-MM-DD'), moment(today).format('yyyy-MM-DD')] | ||||
|     this.formConfig[2].defaultSelect = this.listQuery.time | ||||
| 	}, | ||||
| @@ -247,8 +283,19 @@ export default { | ||||
|   methods: { | ||||
|     getOverView() { | ||||
|       getOverView().then(res => { | ||||
|         this.data = res.data | ||||
|         console.log('aa', res.data) | ||||
|         // this.data = res.data | ||||
|         if (res.code === 0) { | ||||
|           for(const i in res.data) { | ||||
|             if (i === '在制工单数量') { | ||||
|               this.inputNum = res.data[i] | ||||
|             } else { | ||||
|               const index = this.factorys.indexOf(i) | ||||
|               if (index > -1) { | ||||
|                 this.factoryNum[index] = res.data[i] | ||||
|               } | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     otherMethods(val) { | ||||
| @@ -317,10 +364,18 @@ export default { | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
| /* .blueTip { */ | ||||
| 	/* padding-bottom: 10px; */ | ||||
| /* } */ | ||||
| /* .blueTi */ | ||||
| .centerDiv { | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
|   justify-content: flex-start; | ||||
| } | ||||
| .topDiv { | ||||
|   display: flex; | ||||
|   flex-direction: row; | ||||
|   justify-content: space-around; | ||||
|   align-items: flex-start; | ||||
|   flex: 1; | ||||
| } | ||||
| .view { | ||||
|   display: flex; | ||||
|   justify-content: space-around; | ||||
| @@ -342,7 +397,7 @@ export default { | ||||
|   background-color: #fff; | ||||
|   border-radius: 4px; | ||||
|   padding: 16px 16px 0; | ||||
|   height: calc(100vh - 134px); | ||||
|   height: calc(100vh - 40px); | ||||
|   overflow: auto; | ||||
| } | ||||
| </style> | ||||
|   | ||||
							
								
								
									
										51
									
								
								src/views/produce/workOrder/statusChart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								src/views/produce/workOrder/statusChart.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | ||||
| <!-- | ||||
|  * @Author: Do not edit | ||||
|  * @Date: 2024-06-24 15:03:19 | ||||
|  * @LastEditTime: 2024-06-24 15:07:42 | ||||
|  * @LastEditors: DY | ||||
|  * @Description:  | ||||
| --> | ||||
| <template> | ||||
|   <div> | ||||
|     <span class="dot" :class="myClass"></span> | ||||
|     <span>{{ state }}</span> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| export default { | ||||
|   name: "statusChart", | ||||
|   props: { | ||||
|     injectData: { | ||||
|       type: Object, | ||||
|       default: () => ({}), | ||||
|     }, | ||||
|   }, | ||||
|   computed: { | ||||
|     state() { | ||||
|       return ['', '未开始', '生产中', '已完成'][this.injectData.orderStatus] | ||||
|     }, | ||||
|     myClass() { | ||||
|       return ['', 'yellow', 'blue', 'green'][this.injectData.orderStatus] | ||||
|     } | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style scoped> | ||||
| .dot { | ||||
|   display: inline-block; | ||||
|   width: 6px; | ||||
|   height: 6px; | ||||
|   border-radius: 3px; | ||||
|   vertical-align: middle; | ||||
|   margin-right: 8px; | ||||
| } | ||||
| .green { | ||||
|   background: #10DC76; | ||||
| } | ||||
| .yellow { | ||||
|   background: #FFBD02; | ||||
| } | ||||
| .blue { | ||||
|   background: #3B79FF; | ||||
| } | ||||
| </style> | ||||
| @@ -187,16 +187,19 @@ export default { | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月芯片产量</div> | ||||
|       <div class="smallTitle">芯片产量</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,101 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   cPReportByDateRangePage, | ||||
|   cPReportByDateRangeExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "ChipOutputBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             // data: [3000, 2000, 3000], | ||||
|             // data: [6800, 5000, 8900], | ||||
|             // data: [12000, 17000, 19000], | ||||
|             data: [560000, 540000, 600000], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -130,28 +90,22 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             // data: [2100, 800, 1500], | ||||
|             // data: [9500, 7200, 9901], | ||||
|             // data: [14666, 15000, 17888], | ||||
|             data: [550000, 456666, 590000], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               // position: [-10, -16], | ||||
|               position: [-17, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             // data: [2100, 900, 1300], | ||||
|             // data: [9100, 7300, 9700], | ||||
|             // data: [14666, 15300, 18000], | ||||
|             data: [556666, 456666, 650000], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -188,6 +142,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.date = 2; | ||||
|     this.listQuery.queryTime = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factorys = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -206,11 +167,159 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.date = val.type; | ||||
|       this.listQuery.queryTime = val.startDate; | ||||
|       this.listQuery.factorys = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       cPReportByDateRangePage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.length > 0) { | ||||
|           // 设置表头 | ||||
|           let msg = res.data[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "lastone", | ||||
|               label: msg.lastone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "currentone", | ||||
|               label: msg.currentone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "targetone", | ||||
|               label: msg.targetone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           // 整理表格数据 | ||||
|           let tableArr = []; | ||||
|           res.data.forEach((item) => { | ||||
|             let obj = {}; | ||||
|             obj.factory = item.factory; | ||||
|             obj.item = "芯片产量"; | ||||
|             obj.unit = "片"; | ||||
|             obj.lastone = item.lastone.total; | ||||
|             obj.currentone = item.currentone.total; | ||||
|             obj.targetone = item.targetone.total; | ||||
|             tableArr.push(obj); | ||||
|           }); | ||||
|           this.tableData = tableArr; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetone.reportTime; | ||||
|           this.legendList[1].name = msg.lastone.reportTime; | ||||
|           this.legendList[2].name = msg.currentone.reportTime; | ||||
|           this.chartMsg.series[0].name = msg.targetone.reportTime; | ||||
|           this.chartMsg.series[1].name = msg.lastone.reportTime; | ||||
|           this.chartMsg.series[2].name = msg.currentone.reportTime; | ||||
|           // 设置偏移量 | ||||
|           switch (this.listQuery.type) { | ||||
|             case 0: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 1: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 2: | ||||
|               this.chartMsg.series[1].label.position = [-10, -16]; | ||||
|               break; | ||||
|             default: | ||||
|               this.chartMsg.series[1].label.position = [-17, -16]; | ||||
|           } | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push(val[i].targetone.total || 0); | ||||
|         barData1.push(val[i].lastone.total || 0); | ||||
|         barData2.push(val[i].currentone.total || 0); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "芯片产量.xls"; | ||||
|       cPReportByDateRangeExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月芯片人均产量</div> | ||||
|       <div class="smallTitle">芯片人均产量</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,101 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   chipAnnualAverageProductionPage, | ||||
|   chipAnnualAverageProductionExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "ChipPerCapitaBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         yName: "单位/片", | ||||
|         xData: [], | ||||
|         yName: "单位:片/人", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             // data: [3000, 2000, 3000], | ||||
|             // data: [6800, 5000, 8900], | ||||
|             // data: [12000, 17000, 19000], | ||||
|             data: [560000, 540000, 600000], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -130,28 +90,22 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             // data: [2100, 800, 1500], | ||||
|             // data: [9500, 7200, 9901], | ||||
|             // data: [14666, 15000, 17888], | ||||
|             data: [550000, 456666, 590000], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               // position: [-10, -16], | ||||
|               position: [-17, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             // data: [2100, 900, 1300], | ||||
|             // data: [9100, 7300, 9700], | ||||
|             // data: [14666, 15300, 18000], | ||||
|             data: [556666, 456666, 650000], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -188,6 +142,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factory = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -206,11 +167,146 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       chipAnnualAverageProductionPage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetColumn; | ||||
|           this.legendList[1].name = msg.yoyColumn; | ||||
|           this.legendList[2].name = msg.queryColumn; | ||||
|           this.chartMsg.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg.series[1].name = msg.yoyColumn; | ||||
|           this.chartMsg.series[2].name = msg.queryColumn; | ||||
|           // 设置偏移量 | ||||
|           switch (this.listQuery.type) { | ||||
|             case 0: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 1: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 2: | ||||
|               this.chartMsg.series[1].label.position = [-10, -16]; | ||||
|               break; | ||||
|             default: | ||||
|               this.chartMsg.series[1].label.position = [-17, -16]; | ||||
|           } | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push(val[i].target || 0); | ||||
|         barData1.push(val[i].yoy || 0); | ||||
|         barData2.push(val[i].queryValue || 0); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "芯片人均产量对标.xls"; | ||||
|       chipAnnualAverageProductionExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月芯片良率</div> | ||||
|       <div class="smallTitle">芯片良率</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,102 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   chipyieldRatePage, | ||||
|   chipyieldRateExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "ChipYieldBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             data: [ | ||||
|               { name: "%", value: 85 }, | ||||
|               { name: "%", value: 85 }, | ||||
|               { name: "%", value: 85 }, | ||||
|             ], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -134,12 +93,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 57.5 }, | ||||
|               { name: "%", value: 21.66 }, | ||||
|               { name: "%", value: 18.4 }, | ||||
|             ], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -152,12 +107,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 23.33 }, | ||||
|               { name: "%", value: 7.02 }, | ||||
|               { name: "%", value: 80.2 }, | ||||
|             ], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -197,6 +148,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factory = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -215,11 +173,144 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       chipyieldRatePage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetColumn; | ||||
|           this.legendList[1].name = msg.yoyColumn; | ||||
|           this.legendList[2].name = msg.queryColumn; | ||||
|           this.chartMsg.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg.series[1].name = msg.yoyColumn; | ||||
|           this.chartMsg.series[2].name = msg.queryColumn; | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push({ | ||||
|           name: "%", | ||||
|           value: val[i].target || 0, | ||||
|         }); | ||||
|         barData1.push({ name: "%", value: val[i].yoy || 0 }); | ||||
|         barData2.push({ | ||||
|           name: "%", | ||||
|           value: val[i].queryValue || 0, | ||||
|         }); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "芯片良率对标.xls"; | ||||
|       chipyieldRateExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
							
								
								
									
										157
									
								
								src/views/report/completionStatusIntrBM/components/baseChart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								src/views/report/completionStatusIntrBM/components/baseChart.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,157 @@ | ||||
| <template> | ||||
|   <div | ||||
|     :id="chartId" | ||||
|     :style="{ width: '100%', height: chartHeight + 'px' }" | ||||
|   ></div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from "echarts"; | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| export default { | ||||
|   name: "BaseChart", | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: "", | ||||
|       option: { | ||||
|         color: [], | ||||
|         // color: ["#8EF0AB", "#63BDFF", "#288AFF"], | ||||
|         grid: { | ||||
|           left: 70, | ||||
|           right: 0, | ||||
|           bottom: 30, | ||||
|           top: 30, | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: "axis", | ||||
|           axisPointer: { | ||||
|             // type: "cross", | ||||
|             crossStyle: { | ||||
|               color: "rgba(237,237,237,0.5)", | ||||
|             }, | ||||
|           }, | ||||
|           formatter: function (params) { | ||||
|             var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`; | ||||
|             for (var i = 0, l = params.length; i < l; i++) { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `${ | ||||
|                   params[i].seriesType === "line" | ||||
|                     ? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />' | ||||
|                     : `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>` | ||||
|                 }` + | ||||
|                 `<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + | ||||
|                 `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${ | ||||
|                   params[i].name === "%" | ||||
|                     ? (params[i].value ? params[i].value.toFixed(2) : "0.00") + | ||||
|                       params[i].name | ||||
|                     : String(params[i].value).replace( | ||||
|                         /\B(?=(\d{3})+(?!\d))/g, | ||||
|                         "," | ||||
|                       ) | ||||
|                 }</span>`; | ||||
|             } | ||||
|             return res; | ||||
|           }, | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: "category", | ||||
|           data: [], | ||||
|           axisTick: { | ||||
|             show: false, | ||||
|           }, | ||||
|           axisPointer: { | ||||
|             type: "shadow", | ||||
|           }, | ||||
|         }, | ||||
|         yAxis: { | ||||
|           type: "value", | ||||
|           name: "", | ||||
|           nameTextStyle: { | ||||
|             fontSize: 12, | ||||
|             align: "right", | ||||
|           }, | ||||
|           axisLabel: {}, | ||||
|         }, | ||||
|         series: [], | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   props: { | ||||
|     chartHeight: { | ||||
|       type: Number, | ||||
|       default: 300, | ||||
|     }, | ||||
|     legendList: { | ||||
|       type: Array, | ||||
|       default: () => [], | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       type: Object, | ||||
|       default: () => {}, | ||||
|     }, | ||||
|     chartId: { | ||||
|       type: String, | ||||
|       default: "bmChart", | ||||
|     }, | ||||
|     chartNum: { | ||||
|       type: Number, | ||||
|       default: 1, | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     chartHeight: { | ||||
|       handler(newVal) { | ||||
|         this.chartHeight = newVal; | ||||
|       }, | ||||
|     }, | ||||
|     chartNum(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       handler(newVal) { | ||||
|         this.canvasReset(); | ||||
|       }, | ||||
|       deep: true, | ||||
|     }, | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.canvasReset(); | ||||
|   }, | ||||
|   methods: { | ||||
|     canvasReset() { | ||||
|       debounce(() => { | ||||
|         this.getMes(); | ||||
|       }, 500)(); | ||||
|     }, | ||||
|     getMes() { | ||||
|       if (this.myChart) { | ||||
|         this.myChart.dispose(); | ||||
|       } | ||||
|       var chartDom = document.getElementById(this.chartId); | ||||
|       this.myChart = echarts.init(chartDom); | ||||
|       this.option.color = this.chartMsg.color; | ||||
|       this.option.xAxis.data = this.chartMsg.xData; | ||||
|       this.option.yAxis.name = this.chartMsg.yName; | ||||
|       if ( | ||||
|         this.chartMsg.series.length > 0 && | ||||
|         this.chartMsg.series[0].data[0].name === "%" | ||||
|       ) { | ||||
|         this.option.yAxis.axisLabel = { | ||||
|           formatter: function (value) { | ||||
|             return value + ".00%"; | ||||
|           }, | ||||
|         }; | ||||
|       } else { | ||||
|         this.option.yAxis.axisLabel = { | ||||
|           formatter: function (value) { | ||||
|             return value; | ||||
|           }, | ||||
|         }; | ||||
|       } | ||||
|       // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; | ||||
|       this.option.series = this.chartMsg.series; | ||||
|       this.myChart.setOption(this.option); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| @@ -1,115 +1,98 @@ | ||||
| <!-- 只适用于指标完成情况对标 --> | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- 暂无数据 --> | ||||
|     <div | ||||
|       :style="{ height: chartHeight + 'px' }" | ||||
|       v-show="this.chartMsg.series[0].data.length === 0" | ||||
|     > | ||||
|       <div | ||||
|         class="no-data-bg" | ||||
|         style="position: relative; left: 50%; transform: translateX(-50%)" | ||||
|       ></div> | ||||
|     </div> | ||||
|     <!-- 图例 --> | ||||
|     <div v-show="this.chartMsg.series[0].data.length > 0"> | ||||
|       <div class="legend"> | ||||
|         <span class="item" v-for="item in legendList" :key="item.id"> | ||||
|     <div | ||||
|       class="legend" | ||||
|       v-show=" | ||||
|         this.chartMsg1.series[0].data.length > 0 || | ||||
|         this.chartMsg2.series[0].data.length > 0 | ||||
|       " | ||||
|     > | ||||
|       <span class="item" v-for="item in legendList" :key="item.id"> | ||||
|         <span | ||||
|           v-if="item.type === 1" | ||||
|           class="block" | ||||
|           :style="{ backgroundColor: item.color }" | ||||
|         ></span> | ||||
|         <span | ||||
|           v-if="item.type === 2" | ||||
|           class="line" | ||||
|           :style="{ backgroundColor: item.color }" | ||||
|         > | ||||
|           <span | ||||
|             v-if="item.type === 1" | ||||
|             class="block" | ||||
|             class="line-block" | ||||
|             :style="{ backgroundColor: item.color }" | ||||
|           ></span> | ||||
|           <span | ||||
|             v-if="item.type === 2" | ||||
|             class="line" | ||||
|             :style="{ backgroundColor: item.color }" | ||||
|           > | ||||
|             <span | ||||
|               class="line-block" | ||||
|               :style="{ backgroundColor: item.color }" | ||||
|             ></span> | ||||
|           </span> | ||||
|           {{ item.name }}</span | ||||
|         > | ||||
|       </div> | ||||
|         </span> | ||||
|         {{ item.name }}</span | ||||
|       > | ||||
|     </div> | ||||
|     <!-- 图 --> | ||||
|     <div> | ||||
|       <div | ||||
|         :id="chartId" | ||||
|         :style="{ width: '100%', height: chartHeight + 'px' }" | ||||
|       ></div> | ||||
|         style=" | ||||
|           display: inline-block; | ||||
|           width: 79%; | ||||
|           vertical-align: top; | ||||
|           padding-right: 20px; | ||||
|         " | ||||
|       > | ||||
|         <base-chart | ||||
|           v-show="this.chartMsg1.series[0].data.length > 0" | ||||
|           :chartHeight="chartHeight" | ||||
|           :chartWidth="chartWidth1" | ||||
|           :chartMsg="chartMsg1" | ||||
|           chartId="targetChartLeft" | ||||
|           :chartNum="chartNum" | ||||
|         /> | ||||
|         <!-- 暂无数据 --> | ||||
|         <div | ||||
|           :style="{ height: chartHeight + 'px' }" | ||||
|           v-show="this.chartMsg1.series[0].data.length === 0" | ||||
|         > | ||||
|           <div | ||||
|             class="no-data-bg" | ||||
|             style="position: relative; left: 50%; transform: translateX(-50%)" | ||||
|           ></div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div style="display: inline-block; width: 20%; vertical-align: top"> | ||||
|         <base-chart | ||||
|           v-show="this.chartMsg2.series[0].data.length > 0" | ||||
|           :chartHeight="chartHeight" | ||||
|           :chartWidth="chartWidth2" | ||||
|           :chartMsg="chartMsg2" | ||||
|           chartId="targetChartRight" | ||||
|           :chartNum="chartNum" | ||||
|         /> | ||||
|         <!-- 暂无数据 --> | ||||
|         <div | ||||
|           :style="{ height: chartHeight + 'px' }" | ||||
|           v-show="this.chartMsg2.series[0].data.length === 0" | ||||
|         > | ||||
|           <div | ||||
|             class="no-data-bg" | ||||
|             style=" | ||||
|               position: relative; | ||||
|               left: 50%; | ||||
|               transform: translateX(-50%); | ||||
|               width: 80%; | ||||
|             " | ||||
|           ></div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from "echarts"; | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| import baseChart from "./baseChart.vue"; | ||||
| export default { | ||||
|   name: "bmBarComplete", | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: "", | ||||
|       option: { | ||||
|         color: [], | ||||
|         // color: ["#8EF0AB", "#63BDFF", "#288AFF"], | ||||
|         grid: { | ||||
|           left: 70, | ||||
|           right: 10, | ||||
|           bottom: 30, | ||||
|           top: 30, | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: "axis", | ||||
|           axisPointer: { | ||||
|             // type: "cross", | ||||
|             crossStyle: { | ||||
|               color: "rgba(237,237,237,0.5)", | ||||
|             }, | ||||
|           }, | ||||
|           formatter: function (params) { | ||||
|             var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`; | ||||
|             for (var i = 0, l = params.length; i < l; i++) { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `${ | ||||
|                   params[i].seriesType === "line" | ||||
|                     ? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />' | ||||
|                     : `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>` | ||||
|                 }` + | ||||
|                 `<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + | ||||
|                 `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${ | ||||
|                   params[i].name === "%" | ||||
|                     ? (params[i].value ? params[i].value.toFixed(2) : "0.00") + | ||||
|                       params[i].name | ||||
|                     : String(params[i].value).replace( | ||||
|                         /\B(?=(\d{3})+(?!\d))/g, | ||||
|                         "," | ||||
|                       ) | ||||
|                 }</span>`; | ||||
|             } | ||||
|             return res; | ||||
|           }, | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: "category", | ||||
|           data: [], | ||||
|           axisTick: { | ||||
|             show: false, | ||||
|           }, | ||||
|           axisPointer: { | ||||
|             type: "shadow", | ||||
|           }, | ||||
|         }, | ||||
|         yAxis: { | ||||
|           type: "value", | ||||
|           name: "", | ||||
|           nameTextStyle: { | ||||
|             fontSize: 12, | ||||
|             align: "right", | ||||
|           }, | ||||
|           axisLabel: {}, | ||||
|         }, | ||||
|         series: [], | ||||
|       }, | ||||
|       chartWidth1: "60%", | ||||
|       chartWidth2: "20%", | ||||
|     }; | ||||
|   }, | ||||
|   props: { | ||||
| @@ -121,74 +104,20 @@ export default { | ||||
|       type: Array, | ||||
|       default: () => [], | ||||
|     }, | ||||
|     chartMsg: { | ||||
|     chartMsg1: { | ||||
|       type: Object, | ||||
|       default: () => {}, | ||||
|     }, | ||||
|     chartId: { | ||||
|       type: String, | ||||
|       default: "bmChart", | ||||
|     chartMsg2: { | ||||
|       type: Object, | ||||
|       default: () => {}, | ||||
|     }, | ||||
|     chartNum: { | ||||
|       type: Number, | ||||
|       default: 1, | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     chartHeight: { | ||||
|       handler(newVal) { | ||||
|         this.chartHeight = newVal; | ||||
|       }, | ||||
|     }, | ||||
|     chartNum(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       handler(newVal) { | ||||
|         this.canvasReset(); | ||||
|       }, | ||||
|       deep: true, | ||||
|     }, | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.canvasReset(); | ||||
|   }, | ||||
|   methods: { | ||||
|     canvasReset() { | ||||
|       debounce(() => { | ||||
|         this.getMes(); | ||||
|       }, 500)(); | ||||
|     }, | ||||
|     getMes() { | ||||
|       if (this.myChart) { | ||||
|         this.myChart.dispose(); | ||||
|       } | ||||
|       var chartDom = document.getElementById(this.chartId); | ||||
|       this.myChart = echarts.init(chartDom); | ||||
|       this.option.color = this.chartMsg.color; | ||||
|       this.option.xAxis.data = this.chartMsg.xData; | ||||
|       this.option.yAxis.name = this.chartMsg.yName; | ||||
|       if ( | ||||
|         this.chartMsg.series.length > 0 && | ||||
|         this.chartMsg.series[0].data[0].name === "%" | ||||
|       ) { | ||||
|         this.option.yAxis.axisLabel = { | ||||
|           formatter: function (value) { | ||||
|             return value + ".00%"; | ||||
|           }, | ||||
|         }; | ||||
|       } else { | ||||
|         this.option.yAxis.axisLabel = { | ||||
|           formatter: function (value) { | ||||
|             return value; | ||||
|           }, | ||||
|         }; | ||||
|       } | ||||
|       // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; | ||||
|       this.option.series = this.chartMsg.series; | ||||
|       this.myChart.setOption(this.option); | ||||
|     }, | ||||
|   }, | ||||
|   components: { baseChart }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
|   | ||||
| @@ -20,29 +20,33 @@ | ||||
|     <el-form-item v-show="form.type === 0" label="时间" prop="dayTime"> | ||||
|       <el-date-picker | ||||
|         size="small" | ||||
|         clearable | ||||
|         :clearable="false" | ||||
|         v-model="form.dayTime" | ||||
|         type="date" | ||||
|         placeholder="选择日期" | ||||
|         value-format="yyyy-MM-dd" | ||||
|         style="width: 150px" | ||||
|         :picker-options="pickerOptions" | ||||
|       > | ||||
|       </el-date-picker> | ||||
|     </el-form-item> | ||||
|     <el-form-item v-show="form.type === 1" label="时间" prop="weekTime"> | ||||
|       <el-date-picker | ||||
|         v-model="form.weekTime" | ||||
|         :clearable="false" | ||||
|         type="week" | ||||
|         format="yyyy-MM-dd" | ||||
|         placeholder="选择周" | ||||
|         value-format="yyyy-MM-dd" | ||||
|         style="width: 150px" | ||||
|         :picker-options="pickerOptions" | ||||
|       > | ||||
|       </el-date-picker> | ||||
|     </el-form-item> | ||||
|     <el-form-item v-show="form.type === 2" label="时间" prop="monthTime"> | ||||
|       <el-date-picker | ||||
|         v-model="form.monthTime" | ||||
|         :clearable="false" | ||||
|         type="month" | ||||
|         placeholder="选择月份" | ||||
|         value-format="yyyy-MM-dd" | ||||
| @@ -53,6 +57,7 @@ | ||||
|     <el-form-item v-show="form.type === 3" label="时间" prop="yearTime"> | ||||
|       <el-date-picker | ||||
|         v-model="form.yearTime" | ||||
|         :clearable="false" | ||||
|         type="year" | ||||
|         placeholder="选择年份" | ||||
|         value-format="yyyy-MM-dd" | ||||
| @@ -61,11 +66,15 @@ | ||||
|       </el-date-picker> | ||||
|     </el-form-item> | ||||
|     <el-form-item> | ||||
|       <el-button type="primary" size="small" @click="getDataList" | ||||
|       <el-button type="primary" size="small" @click="getDataList('search')" | ||||
|         >查询</el-button | ||||
|       > | ||||
|       <el-divider direction="vertical"></el-divider> | ||||
|       <el-button type="primary" size="small" plain @click="handleExport" | ||||
|       <el-button | ||||
|         type="primary" | ||||
|         size="small" | ||||
|         plain | ||||
|         @click="getDataList('export')" | ||||
|         >导出</el-button | ||||
|       > | ||||
|     </el-form-item> | ||||
| @@ -90,11 +99,13 @@ export default { | ||||
|         { id: 2, name: "月" }, | ||||
|         { id: 3, name: "年" }, | ||||
|       ], | ||||
|       pickerOptions: { | ||||
|         firstDayOfWeek: 1, | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   methods: { | ||||
|     getDataList() { | ||||
|       console.log(this.form); | ||||
|     getDataList(val) { | ||||
|       let params = {}; | ||||
|       switch (this.form.type) { | ||||
|         case 0: | ||||
| @@ -113,10 +124,15 @@ export default { | ||||
|           break; | ||||
|       } | ||||
|       params.type = this.form.type; | ||||
|       this.$emit("getSearch", params); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       this.$emit("handleExport"); | ||||
|       if (!params.startDate) { | ||||
|         this.$message.warning("时间不能为空"); | ||||
|         return; | ||||
|       } | ||||
|       if (val === "search") { | ||||
|         this.$emit("getSearch", params); | ||||
|       } else { | ||||
|         this.$emit("handleExport", params); | ||||
|       } | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -11,8 +11,8 @@ | ||||
|       <bm-bar-complete | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
|         :chartMsg="chartMsg" | ||||
|         :chartId="chartId" | ||||
|         :chartMsg1="chartMsg1" | ||||
|         :chartMsg2="chartMsg2" | ||||
|         :chartNum="chartNum" | ||||
|       /> | ||||
|       <base-table | ||||
| @@ -29,88 +29,80 @@ | ||||
| <script> | ||||
| import BmSearchBarComplete from "./components/bmSearchBarComplete.vue"; | ||||
| import BmBarComplete from "./components/bmBarComplete.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "指标名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   targetCompletionPage, | ||||
|   targetCompletionExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "CompletionStatusIntrBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "指标名称", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2023年4月", type: 1, color: "#288AFF33" }, | ||||
|         { id: 2, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 1, color: "#288AFF33" }, | ||||
|         { id: 2, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|       chartMsg1: { | ||||
|         color: ["#288AFF33", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/MW", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             data: [5505, 6578, 5500], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#2789FF", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             data: [3503, 3456, 4500], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             barGap: "-100%", | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }, | ||||
|       chartMsg2: { | ||||
|         color: ["#288AFF33", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/㎡", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             barGap: "-100%", | ||||
| @@ -122,7 +114,6 @@ export default { | ||||
|           }, | ||||
|         ], | ||||
|       }, | ||||
|       chartId: "completionStatusIntrBMChart", | ||||
|       chartNum: 1, | ||||
|     }; | ||||
|   }, | ||||
| @@ -148,6 +139,12 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -166,11 +163,153 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       targetCompletionPage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetColumn; | ||||
|           this.legendList[1].name = msg.queryColumn; | ||||
|           this.chartMsg1.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg1.series[1].name = msg.queryColumn; | ||||
|           this.chartMsg2.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg2.series[1].name = msg.queryColumn; | ||||
|           // 设置偏移量 | ||||
|           switch (this.listQuery.type) { | ||||
|             case 0: | ||||
|               this.chartMsg1.series[1].label.position = [-5, -16]; | ||||
|               this.chartMsg2.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 1: | ||||
|               this.chartMsg1.series[1].label.position = [-5, -16]; | ||||
|               this.chartMsg2.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 2: | ||||
|               this.chartMsg1.series[1].label.position = [-10, -16]; | ||||
|               this.chartMsg2.series[1].label.position = [-10, -16]; | ||||
|               break; | ||||
|             default: | ||||
|               this.chartMsg1.series[1].label.position = [-17, -16]; | ||||
|               this.chartMsg2.series[1].label.position = [-17, -16]; | ||||
|           } | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData1 = []; | ||||
|       let xData2 = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       let barData3 = []; | ||||
|       let barData4 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         if (val[i].unit !== "㎡") { | ||||
|           xData1.push(val[i].item); | ||||
|           barData1.push(val[i].target || 0); | ||||
|           barData2.push(val[i].queryValue || 0); | ||||
|         } else { | ||||
|           xData2.push(val[i].item); | ||||
|           barData3.push(val[i].target || 0); | ||||
|           barData4.push(val[i].queryValue || 0); | ||||
|         } | ||||
|       } | ||||
|       this.chartMsg1.xData = xData1; | ||||
|       this.chartMsg2.xData = xData2; | ||||
|       this.chartMsg1.series[0].data = barData1; | ||||
|       this.chartMsg1.series[1].data = barData2; | ||||
|       this.chartMsg2.series[0].data = barData3; | ||||
|       this.chartMsg2.series[1].data = barData4; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg1 = { | ||||
|         color: ["#288AFF33", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/MW", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             barGap: "-100%", | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|       this.chartMsg2 = { | ||||
|         color: ["#288AFF33", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/㎡", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             barGap: "-100%", | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       let fileName = "指标完成情况对标.xls"; | ||||
|       targetCompletionExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -71,7 +71,7 @@ export default { | ||||
|                 "<br/>" + | ||||
|                 `${ | ||||
|                   params[i].seriesType === "line" | ||||
|                     ? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />' | ||||
|                     ? '<img width="11" height="11" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />' | ||||
|                     : `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>` | ||||
|                 }` + | ||||
|                 `<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + | ||||
|   | ||||
| @@ -19,29 +19,33 @@ | ||||
|     <el-form-item v-show="form.type === 0" label="时间" prop="dayTime"> | ||||
|       <el-date-picker | ||||
|         size="small" | ||||
|         clearable | ||||
|         :clearable="false" | ||||
|         v-model="form.dayTime" | ||||
|         type="date" | ||||
|         placeholder="选择日期" | ||||
|         value-format="yyyy-MM-dd" | ||||
|         style="width: 150px" | ||||
|         :picker-options="pickerOptions" | ||||
|       > | ||||
|       </el-date-picker> | ||||
|     </el-form-item> | ||||
|     <el-form-item v-show="form.type === 1" label="时间" prop="weekTime"> | ||||
|       <el-date-picker | ||||
|         v-model="form.weekTime" | ||||
|         :clearable="false" | ||||
|         type="week" | ||||
|         format="yyyy-MM-dd" | ||||
|         placeholder="选择周" | ||||
|         value-format="yyyy-MM-dd" | ||||
|         style="width: 150px" | ||||
|         :picker-options="pickerOptions" | ||||
|       > | ||||
|       </el-date-picker> | ||||
|     </el-form-item> | ||||
|     <el-form-item v-show="form.type === 2" label="时间" prop="monthTime"> | ||||
|       <el-date-picker | ||||
|         v-model="form.monthTime" | ||||
|         :clearable="false" | ||||
|         type="month" | ||||
|         placeholder="选择月份" | ||||
|         value-format="yyyy-MM-dd" | ||||
| @@ -52,6 +56,7 @@ | ||||
|     <el-form-item v-show="form.type === 3" label="时间" prop="yearTime"> | ||||
|       <el-date-picker | ||||
|         v-model="form.yearTime" | ||||
|         :clearable="false" | ||||
|         type="year" | ||||
|         placeholder="选择年份" | ||||
|         value-format="yyyy-MM-dd" | ||||
| @@ -115,11 +120,13 @@ export default { | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       pickerOptions: { | ||||
|         firstDayOfWeek: 1, | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   methods: { | ||||
|     getDataList(val) { | ||||
|       console.log(this.form); | ||||
|       let params = {}; | ||||
|       params.factory = this.form.factory; | ||||
|       switch (this.form.type) { | ||||
| @@ -139,6 +146,10 @@ export default { | ||||
|           break; | ||||
|       } | ||||
|       params.type = this.form.type; | ||||
|       if (!params.startDate) { | ||||
|         this.$message.warning("时间不能为空"); | ||||
|         return; | ||||
|       } | ||||
|       if (val === "search") { | ||||
|         this.$emit("getSearch", params); | ||||
|       } else { | ||||
|   | ||||
							
								
								
									
										266
									
								
								src/views/report/components/produceLineBar.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										266
									
								
								src/views/report/components/produceLineBar.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,266 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-19 15:28:34 | ||||
|  * @LastEditTime: 2024-06-27 10:40:57 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- 暂无数据 --> | ||||
|     <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)" | ||||
|       v-show="this.chartMsg.series[0].data.length === 0"></div> | ||||
|     <!-- 图例 --> | ||||
|     <div v-show="this.chartMsg.series[0].data.length > 0 "> | ||||
|       <div class="legendData" v-if="show"> | ||||
|         <span class="itemData" v-for="item in legendList" :key="item.id"> | ||||
|           <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span> | ||||
|           <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }"> | ||||
|             <span class="line-block" :style="{ backgroundColor: item.color }"></span> | ||||
|           </span> | ||||
|           {{ item.name }}</span> | ||||
|       </div> | ||||
|       <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from "echarts"; | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| export default { | ||||
|   name: "bmLineBar", | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: "", | ||||
|       option: { | ||||
|         color: [], | ||||
|         // color: ["#8EF0AB", "#63BDFF", "#288AFF"], | ||||
|         grid: { | ||||
|           left: 30, | ||||
|           right: 0, | ||||
|           bottom: 30, | ||||
|           top: 30, | ||||
|           containLabel:true, | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: "axis", | ||||
|           axisPointer: { | ||||
|             // type: "cross", | ||||
|             crossStyle: { | ||||
|               color: "rgba(237,237,237,0.5)", | ||||
|             }, | ||||
|           }, | ||||
|           formatter: function (params) { | ||||
|             // console.log('params', params); | ||||
|             var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`; | ||||
|             for (var i = 0, l = params.length; i < l; i++) { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` + | ||||
|                 `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + | ||||
|               `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率" | ||||
|                   ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" | ||||
|                 : params[i].seriesName === "转化效率" | ||||
|                     ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" | ||||
|                   : params[i].seriesName.search('总功率') != -1 | ||||
|                       ? (params[i].value ? params[i].value : 0) + "MW" | ||||
|                     : (params[i].value ? params[i].value : 0) + "片" | ||||
|                 }</span>`; | ||||
|             } | ||||
|             return res; | ||||
|           }, | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: "category", | ||||
|           data: [], | ||||
|           axisTick: { | ||||
|             show: false, | ||||
|           }, | ||||
|           axisPointer: { | ||||
|             type: "shadow", | ||||
|           }, | ||||
|         }, | ||||
|         dataZoom: [//滚动条 | ||||
|           { | ||||
|             // 设置滚动条的隐藏与显示 | ||||
|             show: true, | ||||
|             // 设置滚动条类型 | ||||
|             type: "slider", | ||||
|             // 设置背景颜色 | ||||
|             backgroundColor: "#F7F7F7", | ||||
|             // handleStyle: { | ||||
|             //   color: '#D6D6D6' | ||||
|             // }, | ||||
|             handleStyle: { | ||||
|               borderColor: '#EBEBEB', | ||||
|               color: '#EBEBEB' | ||||
|             }, | ||||
|             moveHandleStyle: { | ||||
|               borderColor: '#EBEBEB', | ||||
|               color: '#EBEBEB' | ||||
|             }, | ||||
|             emphasis: { | ||||
|               handleStyle: { | ||||
|                 borderColor: '#D6D6D6', | ||||
|                 color: '#D6D6D6' | ||||
|               }, | ||||
|               moveHandleStyle: { | ||||
|                 borderColor: '#D6D6D6', | ||||
|                 color: '#D6D6D6' | ||||
|               } | ||||
|             }, | ||||
|             // 设置选中范围的填充颜色 | ||||
|             fillerColor: "#F7F7F7", | ||||
|             // 设置边框颜色 | ||||
|             borderColor: "#F7F7F7", | ||||
|             // 是否显示detail,即拖拽时候显示详细数值信息 | ||||
|             showDetail: false, | ||||
|             // 数据窗口范围的起始数值 | ||||
|             startValue: 0, | ||||
|             // 数据窗口范围的结束数值(一页显示多少条数据) | ||||
|             endValue: 5, | ||||
|             // empty:当前数据窗口外的数据,被设置为空。 | ||||
|             // 即不会影响其他轴的数据范围 | ||||
|             filterMode: "empty", | ||||
|             // 设置滚动条宽度,相对于盒子宽度 | ||||
|             width: "100%", | ||||
|             // 设置滚动条高度 | ||||
|             height: 3, | ||||
|             // 设置滚动条显示位置 | ||||
|             left: "center", | ||||
|             // 是否锁定选择区域(或叫做数据窗口)的大小 | ||||
|             zoomLoxk: true, | ||||
|             // 控制手柄的尺寸 | ||||
|             handleSize: 0, | ||||
|             // dataZoom-slider组件离容器下侧的距离 | ||||
|             bottom: 14, | ||||
|           }, | ||||
|           { | ||||
|             // 没有下面这块的话,只能拖动滚动条, | ||||
|             // 鼠标滚轮在区域内不能控制外部滚动条 | ||||
|             type: "inside", | ||||
|             // 滚轮是否触发缩放 | ||||
|             zoomOnMouseWheel: false, | ||||
|             // 鼠标滚轮触发滚动 | ||||
|             moveOnMouseMove: true, | ||||
|             moveOnMouseWheel: true, | ||||
|           }, | ||||
|         ], | ||||
|         yAxis:undefined, | ||||
|         series: [], | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   props: { | ||||
|     chartHeight: { | ||||
|       type: Number, | ||||
|       default: 300, | ||||
|     }, | ||||
|     type: { | ||||
|       type: Number, | ||||
|       default: 2, | ||||
|     }, | ||||
|     show: { | ||||
|       type: Boolean, | ||||
|       default: true, | ||||
|     }, | ||||
|     legendList: { | ||||
|       type: Array, | ||||
|       default: () => [], | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       type: Object, | ||||
|       default: () => {}, | ||||
|     }, | ||||
|     chartId: { | ||||
|       type: String, | ||||
|       default: "bmChart", | ||||
|     }, | ||||
|     chartNum: { | ||||
|       type: Number, | ||||
|       default: 1, | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     chartHeight: { | ||||
|       handler(newVal) { | ||||
|         this.chartHeight = newVal; | ||||
|       }, | ||||
|     }, | ||||
|     type() { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartNum(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       handler(newVal) { | ||||
|         this.canvasReset(); | ||||
|       }, | ||||
|       deep: true, | ||||
|     }, | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.canvasReset(); | ||||
|   }, | ||||
|   methods: { | ||||
|     canvasReset() { | ||||
|       debounce(() => { | ||||
|         this.getMes(); | ||||
|       }, 500)(); | ||||
|     }, | ||||
|     getMes() { | ||||
|       console.log('222222', this.chartMsg.series); | ||||
|       if (this.myChart) { | ||||
|         this.myChart.dispose(); | ||||
|       } | ||||
|       var chartDom = document.getElementById(this.chartId); | ||||
|       this.myChart = echarts.init(chartDom); | ||||
|       this.option.color = this.chartMsg.color; | ||||
|       this.option.xAxis.data = this.chartMsg.xData; | ||||
|       // this.option.yAxis.name = this.chartMsg.yName; | ||||
|  | ||||
|       // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; | ||||
|       this.option.series = this.chartMsg.series; | ||||
|       this.option.yAxis = this.chartMsg.yAxis; | ||||
|  | ||||
|       this.myChart.setOption(this.option); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss"> | ||||
| .legendData { | ||||
|   text-align: right; | ||||
|   position: relative; | ||||
|   // right: 30; | ||||
|   // top: 10px; | ||||
|   .itemData { | ||||
|     display: inline-block; | ||||
|     margin-right: 10px; | ||||
|     font-size: 14px; | ||||
|     color: #8c8c8c; | ||||
|     .block { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|     } | ||||
|     .line { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       border-radius: 5px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|       position: relative; | ||||
|       .line-block { | ||||
|         position: absolute; | ||||
|         width: 20px; | ||||
|         height: 2px; | ||||
|         left: -5px; | ||||
|         top: 4px; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										261
									
								
								src/views/report/components/produceLineBarTarget.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										261
									
								
								src/views/report/components/produceLineBarTarget.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,261 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-20 16:13:36 | ||||
|  * @LastEditTime: 2024-06-27 09:51:43 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- 暂无数据 --> | ||||
|     <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)" | ||||
|       v-show="this.chartMsg.series.length === 0"></div> | ||||
|     <!-- 图例 --> | ||||
|     <div v-show="this.chartMsg.series.length > 0"> | ||||
|       <div class="legendData" v-if="show"> | ||||
|         <span class="itemData" v-for="item in legendList" :key="item.id"> | ||||
|           <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span> | ||||
|           <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }"> | ||||
|             <span class="line-block" :style="{ backgroundColor: item.color }"></span> | ||||
|           </span> | ||||
|           {{ item.name }}</span> | ||||
|       </div> | ||||
|       <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from "echarts"; | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| export default { | ||||
|   name: "bmLineBar", | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: "", | ||||
|       option: { | ||||
|         color: [], | ||||
|         // color: ["#8EF0AB", "#63BDFF", "#288AFF"], | ||||
|         grid: { | ||||
|           left: 20, | ||||
|           right: 0, | ||||
|           bottom: 31, | ||||
|           top: 30, | ||||
|           containLabel:true, | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: "axis", | ||||
|           axisPointer: { | ||||
|             // type: "cross", | ||||
|             crossStyle: { | ||||
|               color: "rgba(237,237,237,0.5)", | ||||
|             }, | ||||
|           }, | ||||
|           formatter: function (params) { | ||||
|             console.log('params', params.data) | ||||
|             var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`; | ||||
|             for (var i = 0, l = params.length; i < l; i++) { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` + | ||||
|                 `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + | ||||
|               `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率" | ||||
|                 ? (params[i].data.titleValue ? params[i].data.titleValue.toFixed(2) : 0.0) + "%" | ||||
|                 : params[i].seriesName === "转化效率" | ||||
|                   ? (params[i].data.titleValue ? params[i].data.titleValue.toFixed(2) : 0.0) + "%" | ||||
|                   : params[i].seriesName.search('总功率') != -1 | ||||
|                     ? (params[i].data.titleValue ? params[i].data.titleValue : 0) + "MW" | ||||
|                     : (params[i].data.titleValue ? params[i].data.titleValue : 0) + "片" | ||||
|                 }</span>`; | ||||
|             } | ||||
|             return res; | ||||
|           }, | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: "category", | ||||
|           data: [], | ||||
|           axisTick: { | ||||
|             show: false, | ||||
|           }, | ||||
|           axisPointer: { | ||||
|             type: "shadow", | ||||
|           }, | ||||
|         }, | ||||
|         // dataZoom: [//滚动条 | ||||
|         //   { | ||||
|         //     // 设置滚动条的隐藏与显示 | ||||
|         //     show: true, | ||||
|         //     // 设置滚动条类型 | ||||
|         //     type: "slider", | ||||
|         //     // 设置背景颜色 | ||||
|         //     backgroundColor: "rgb(19, 63, 100)", | ||||
|         //     // 设置选中范围的填充颜色 | ||||
|         //     fillerColor: "rgb(16, 171, 198)", | ||||
|         //     // 设置边框颜色 | ||||
|         //     borderColor: "rgb(19, 63, 100)", | ||||
|         //     // 是否显示detail,即拖拽时候显示详细数值信息 | ||||
|         //     showDetail: false, | ||||
|         //     // 数据窗口范围的起始数值 | ||||
|         //     startValue: 0, | ||||
|         //     // 数据窗口范围的结束数值(一页显示多少条数据) | ||||
|         //     endValue: 5, | ||||
|         //     // empty:当前数据窗口外的数据,被设置为空。 | ||||
|         //     // 即不会影响其他轴的数据范围 | ||||
|         //     filterMode: "empty", | ||||
|         //     // 设置滚动条宽度,相对于盒子宽度 | ||||
|         //     width: "50%", | ||||
|         //     // 设置滚动条高度 | ||||
|         //     height: 8, | ||||
|         //     // 设置滚动条显示位置 | ||||
|         //     left: "center", | ||||
|         //     // 是否锁定选择区域(或叫做数据窗口)的大小 | ||||
|         //     zoomLoxk: true, | ||||
|         //     // 控制手柄的尺寸 | ||||
|         //     handleSize: 0, | ||||
|         //     // dataZoom-slider组件离容器下侧的距离 | ||||
|         //     bottom: 3, | ||||
|         //   }, | ||||
|         //   { | ||||
|         //     // 没有下面这块的话,只能拖动滚动条, | ||||
|         //     // 鼠标滚轮在区域内不能控制外部滚动条 | ||||
|         //     type: "inside", | ||||
|         //     // 滚轮是否触发缩放 | ||||
|         //     zoomOnMouseWheel: false, | ||||
|         //     // 鼠标滚轮触发滚动 | ||||
|         //     moveOnMouseMove: true, | ||||
|         //     moveOnMouseWheel: true, | ||||
|         //   }, | ||||
|  | ||||
|         // ], | ||||
|         yAxis:undefined, | ||||
|         series: [], | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   props: { | ||||
|     chartHeight: { | ||||
|       type: Number, | ||||
|       default: 300, | ||||
|     }, | ||||
|     gridLeft: { | ||||
|       type: Boolean, | ||||
|       default: true, | ||||
|     }, | ||||
|     type: { | ||||
|       type: Number, | ||||
|       default: 2, | ||||
|     }, | ||||
|     show: { | ||||
|       type: Boolean, | ||||
|       default: true, | ||||
|     }, | ||||
|     legendList: { | ||||
|       type: Array, | ||||
|       default: () => [], | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       type: Object, | ||||
|       default: () => { }, | ||||
|     }, | ||||
|     chartId: { | ||||
|       type: String, | ||||
|       default: "bmChart", | ||||
|     }, | ||||
|     chartNum: { | ||||
|       type: Number, | ||||
|       default: 1, | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     chartHeight: { | ||||
|       handler(newVal) { | ||||
|         this.chartHeight = newVal; | ||||
|       }, | ||||
|  | ||||
|     }, | ||||
|     // gridLeft(val) { | ||||
|     //   console.log(val) | ||||
|  | ||||
|     // }, | ||||
|     type() { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartNum(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       handler(newVal) { | ||||
|         this.canvasReset(); | ||||
|       }, | ||||
|       deep: true, | ||||
|     }, | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.canvasReset(); | ||||
|   }, | ||||
|   methods: { | ||||
|     canvasReset() { | ||||
|       debounce(() => { | ||||
|         this.getMes(); | ||||
|       }, 500)(); | ||||
|     }, | ||||
|     getMes() { | ||||
|       console.log(this.gridLeft) | ||||
|       if (this.gridLeft === false) { | ||||
|         this.option.grid.left = 20 | ||||
|       } else { | ||||
|         this.option.grid.left = -80 | ||||
|       } | ||||
|       // console.log('222222', this.chartMsg); | ||||
|       if (this.myChart) { | ||||
|         this.myChart.dispose(); | ||||
|       } | ||||
|       var chartDom = document.getElementById(this.chartId); | ||||
|       this.myChart = echarts.init(chartDom); | ||||
|       this.option.color = this.chartMsg.color; | ||||
|       this.option.xAxis.data = this.chartMsg.xData | ||||
|       // this.option.yAxis.name = this.chartMsg.yName; | ||||
|  | ||||
|       // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; | ||||
|       this.option.series = this.chartMsg.series; | ||||
|       this.option.yAxis = this.chartMsg.yAxis; | ||||
|  | ||||
|       this.myChart.setOption(this.option); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss"> | ||||
| .legendData { | ||||
|   text-align: right; | ||||
|   position: relative; | ||||
|   // right: 30; | ||||
|   // top: 10px; | ||||
|   .itemData { | ||||
|     display: inline-block; | ||||
|     margin-right: 10px; | ||||
|     font-size: 14px; | ||||
|     color: #8c8c8c; | ||||
|     .block { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|     } | ||||
|     .line { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       border-radius: 5px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|       position: relative; | ||||
|       .line-block { | ||||
|         position: absolute; | ||||
|         width: 20px; | ||||
|         height: 2px; | ||||
|         left: -5px; | ||||
|         top: 4px; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										245
									
								
								src/views/report/components/produceLineBarYearTarget.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										245
									
								
								src/views/report/components/produceLineBarYearTarget.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,245 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-20 16:13:52 | ||||
|  * @LastEditTime: 2024-06-27 09:55:02 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- 暂无数据 --> | ||||
|     <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)" | ||||
|       v-show="this.chartMsg.series[0].data.length === 0"></div> | ||||
|     <!-- 图例 --> | ||||
|     <div v-show="this.chartMsg.series[0].data.length > 0"> | ||||
|       <div class="legendData" v-if="show"> | ||||
|         <span class="itemData" v-for="item in legendList" :key="item.id"> | ||||
|           <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span> | ||||
|           <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }"> | ||||
|             <span class="line-block" :style="{ backgroundColor: item.color }"></span> | ||||
|           </span> | ||||
|           {{ item.name }}</span> | ||||
|       </div> | ||||
|       <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from "echarts"; | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| export default { | ||||
|   name: "bmLineBar", | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: "", | ||||
|       option: { | ||||
|         color: [], | ||||
|         // color: ["#8EF0AB", "#63BDFF", "#288AFF"], | ||||
|         grid: { | ||||
|           left: 60, | ||||
|           right: 0, | ||||
|           bottom: 30, | ||||
|           top: 30, | ||||
|           containLabel:true, | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: "axis", | ||||
|           axisPointer: { | ||||
|             // type: "cross", | ||||
|             crossStyle: { | ||||
|               color: "rgba(237,237,237,0.5)", | ||||
|             }, | ||||
|           }, | ||||
|           formatter: function (params) { | ||||
|             // console.log('params', params); | ||||
|             var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`; | ||||
|             for (var i = 0, l = params.length; i < l; i++) { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` + | ||||
|                 `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + | ||||
|               `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率" | ||||
|                   ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" | ||||
|                 : params[i].seriesName === "转化效率" | ||||
|                     ? params[i].value+ "%" | ||||
|                   : params[i].seriesName.search('总功率') != -1 | ||||
|                     ? (params[i].value ? params[i] : 0) + "MW" | ||||
|                     : (params[i].value ? params[i].value : 0) + "片" | ||||
|                 }</span>`; | ||||
|             } | ||||
|             return res; | ||||
|           }, | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: "category", | ||||
|           data: [], | ||||
|           axisTick: { | ||||
|             show: false, | ||||
|           }, | ||||
|           axisPointer: { | ||||
|             type: "shadow", | ||||
|           }, | ||||
|         }, | ||||
|         // dataZoom: [//滚动条 | ||||
|         //   { | ||||
|         //     // 设置滚动条的隐藏与显示 | ||||
|         //     show: true, | ||||
|         //     // 设置滚动条类型 | ||||
|         //     type: "slider", | ||||
|         //     // 设置背景颜色 | ||||
|         //     backgroundColor: "rgb(19, 63, 100)", | ||||
|         //     // 设置选中范围的填充颜色 | ||||
|         //     fillerColor: "rgb(16, 171, 198)", | ||||
|         //     // 设置边框颜色 | ||||
|         //     borderColor: "rgb(19, 63, 100)", | ||||
|         //     // 是否显示detail,即拖拽时候显示详细数值信息 | ||||
|         //     showDetail: false, | ||||
|         //     // 数据窗口范围的起始数值 | ||||
|         //     startValue: 0, | ||||
|         //     // 数据窗口范围的结束数值(一页显示多少条数据) | ||||
|         //     endValue: 5, | ||||
|         //     // empty:当前数据窗口外的数据,被设置为空。 | ||||
|         //     // 即不会影响其他轴的数据范围 | ||||
|         //     filterMode: "empty", | ||||
|         //     // 设置滚动条宽度,相对于盒子宽度 | ||||
|         //     width: "50%", | ||||
|         //     // 设置滚动条高度 | ||||
|         //     height: 8, | ||||
|         //     // 设置滚动条显示位置 | ||||
|         //     left: "center", | ||||
|         //     // 是否锁定选择区域(或叫做数据窗口)的大小 | ||||
|         //     zoomLoxk: true, | ||||
|         //     // 控制手柄的尺寸 | ||||
|         //     handleSize: 0, | ||||
|         //     // dataZoom-slider组件离容器下侧的距离 | ||||
|         //     bottom: 3, | ||||
|         //   }, | ||||
|         //   { | ||||
|         //     // 没有下面这块的话,只能拖动滚动条, | ||||
|         //     // 鼠标滚轮在区域内不能控制外部滚动条 | ||||
|         //     type: "inside", | ||||
|         //     // 滚轮是否触发缩放 | ||||
|         //     zoomOnMouseWheel: false, | ||||
|         //     // 鼠标滚轮触发滚动 | ||||
|         //     moveOnMouseMove: true, | ||||
|         //     moveOnMouseWheel: true, | ||||
|         //   }, | ||||
|  | ||||
|         // ], | ||||
|         yAxis:undefined, | ||||
|         series: [], | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   props: { | ||||
|     chartHeight: { | ||||
|       type: Number, | ||||
|       default: 300, | ||||
|     }, | ||||
|     type: { | ||||
|       type: Number, | ||||
|       default: 2, | ||||
|     }, | ||||
|     show: { | ||||
|       type: Boolean, | ||||
|       default: true, | ||||
|     }, | ||||
|     legendList: { | ||||
|       type: Array, | ||||
|       default: () => [], | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       type: Object, | ||||
|       default: () => { }, | ||||
|     }, | ||||
|     chartId: { | ||||
|       type: String, | ||||
|       default: "bmChart", | ||||
|     }, | ||||
|     chartNum: { | ||||
|       type: Number, | ||||
|       default: 1, | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     chartHeight: { | ||||
|       handler(newVal) { | ||||
|         this.chartHeight = newVal; | ||||
|       }, | ||||
|     }, | ||||
|     type() { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartNum(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       handler(newVal) { | ||||
|         this.canvasReset(); | ||||
|       }, | ||||
|       deep: true, | ||||
|     }, | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.canvasReset(); | ||||
|   }, | ||||
|   methods: { | ||||
|     canvasReset() { | ||||
|       debounce(() => { | ||||
|         this.getMes(); | ||||
|       }, 500)(); | ||||
|     }, | ||||
|     getMes() { | ||||
|       if (this.myChart) { | ||||
|         this.myChart.dispose(); | ||||
|       } | ||||
|       var chartDom = document.getElementById(this.chartId); | ||||
|       this.myChart = echarts.init(chartDom); | ||||
|       this.option.color = this.chartMsg.color; | ||||
|       this.option.xAxis.data = this.chartMsg.xData; | ||||
|       // this.option.yAxis.name = this.chartMsg.yName; | ||||
|  | ||||
|       // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; | ||||
|       this.option.series = this.chartMsg.series; | ||||
|       this.option.yAxis = this.chartMsg.yAxis; | ||||
|  | ||||
|       this.myChart.setOption(this.option); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss"> | ||||
| .legendData { | ||||
|   text-align: right; | ||||
|   position: relative; | ||||
|   // right: 30; | ||||
|   // top: 10px; | ||||
|   .itemData { | ||||
|     display: inline-block; | ||||
|     margin-right: 10px; | ||||
|     font-size: 14px; | ||||
|     color: #8c8c8c; | ||||
|     .block { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|     } | ||||
|     .line { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       border-radius: 5px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|       position: relative; | ||||
|       .line-block { | ||||
|         position: absolute; | ||||
|         width: 20px; | ||||
|         height: 2px; | ||||
|         left: -5px; | ||||
|         top: 4px; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										262
									
								
								src/views/report/components/produceLineYieldBarTarget.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										262
									
								
								src/views/report/components/produceLineYieldBarTarget.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,262 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-06-21 09:05:14 | ||||
|  * @LastEditTime: 2024-06-27 10:59:40 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- 暂无数据 --> | ||||
|     <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)" | ||||
|       v-show="this.chartMsg.series[0].data.length === 0"></div> | ||||
|     <!-- 图例 --> | ||||
|     <div v-show="this.chartMsg.series[0].data.length > 0"> | ||||
|       <div class="legendData" v-if="show"> | ||||
|         <span class="itemData" v-for="item in legendList" :key="item.id"> | ||||
|           <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span> | ||||
|           <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }"> | ||||
|             <span class="line-block" :style="{ backgroundColor: item.color }"></span> | ||||
|           </span> | ||||
|           {{ item.name }}</span> | ||||
|       </div> | ||||
|       <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from "echarts"; | ||||
| import { debounce } from "@/utils/debounce"; | ||||
| export default { | ||||
|   name: "bmLineBar", | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: "", | ||||
|       option: { | ||||
|         color: [], | ||||
|         // color: ["#8EF0AB", "#63BDFF", "#288AFF"], | ||||
|         grid: { | ||||
|           left: 60, | ||||
|           right: 0, | ||||
|           bottom: 30, | ||||
|           top: 30, | ||||
|           containLabel:true, | ||||
|         }, | ||||
|         tooltip: { | ||||
|           trigger: "axis", | ||||
|           axisPointer: { | ||||
|             // type: "cross", | ||||
|             crossStyle: { | ||||
|               color: "rgba(237,237,237,0.5)", | ||||
|             }, | ||||
|           }, | ||||
|           formatter: function (params) { | ||||
|             // console.log('params', params) | ||||
|             let arr = [] | ||||
|             var res = ``; | ||||
|             // for (var i = 0, l = params.length; i < l; i++) { | ||||
|             console.log() | ||||
|             if (params[0].axisValue === 'FTO投入' || params[0].axisValue === '芯片产量' || params[0].axisValue === '标准组件产量') { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[0].color}'></span>` + | ||||
|               `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[0].axisValueLabel}</span>` + | ||||
|               `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[0].name === "综合良率" | ||||
|                   ? (params[0].value ? params[0].value.toFixed(2) : 0.0) + "%" | ||||
|                 : params[0].name === "转化效率" | ||||
|                     ? (params[0].value ? params[0].value.toFixed(2) : 0.0) + "%" | ||||
|                   : params[i].seriesName.search('总功率') != -1 | ||||
|                     ? (params[i].value ? params[i].value : 0) + "MW" | ||||
|                     : (params[i].value ? params[i].value : 0) + "片" | ||||
|                 }</span>`; | ||||
|               // } | ||||
|             } | ||||
|             if (params[1].axisValue === '综合良率' || params[1].axisValue === '转化效率') { | ||||
|               res += | ||||
|                 "<br/>" + | ||||
|                 `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[1].color}'></span>` + | ||||
|               `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[1].axisValueLabel}</span>` + | ||||
|               `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[1].name === "综合良率" | ||||
|                 ? (params[1].value ? params[1].value.toFixed(2) : 0.0) + "%" | ||||
|                 : params[1].name === "转化效率" | ||||
|                   ? (params[1].value ? params[1].value.toFixed(2) : 0.0) + "%" | ||||
|                   : params[i].seriesName.search('总功率') != -1 | ||||
|                     ? (params[i].value ? params[i].value : 0) + "MW" | ||||
|                     : (params[i].value ? params[i].value : 0) + "片" | ||||
|                 }</span>`; | ||||
|             } | ||||
|             return res; | ||||
|           }, | ||||
|         }, | ||||
|         xAxis: { | ||||
|           type: "category", | ||||
|           data: [], | ||||
|           axisTick: { | ||||
|             show: false, | ||||
|           }, | ||||
|           axisPointer: { | ||||
|             type: "shadow", | ||||
|           }, | ||||
|         }, | ||||
|         // dataZoom: [//滚动条 | ||||
|         //   { | ||||
|         //     // 设置滚动条的隐藏与显示 | ||||
|         //     show: true, | ||||
|         //     // 设置滚动条类型 | ||||
|         //     type: "slider", | ||||
|         //     // 设置背景颜色 | ||||
|         //     backgroundColor: "#F7F7F7", | ||||
|         //     // 设置选中范围的填充颜色 | ||||
|         //     fillerColor: "#EBEBEB", | ||||
|         //     // 设置边框颜色 | ||||
|         //     borderColor: "#F7F7F7", | ||||
|         //     // 是否显示detail,即拖拽时候显示详细数值信息 | ||||
|         //     showDetail: false, | ||||
|         //     // 数据窗口范围的起始数值 | ||||
|         //     startValue: 0, | ||||
|         //     // 数据窗口范围的结束数值(一页显示多少条数据) | ||||
|         //     endValue: 5, | ||||
|         //     // empty:当前数据窗口外的数据,被设置为空。 | ||||
|         //     // 即不会影响其他轴的数据范围 | ||||
|         //     filterMode: "empty", | ||||
|         //     // 设置滚动条宽度,相对于盒子宽度 | ||||
|         //     width: "100%", | ||||
|         //     // 设置滚动条高度 | ||||
|         //     height: 8, | ||||
|         //     // 设置滚动条显示位置 | ||||
|         //     left: "center", | ||||
|         //     // 是否锁定选择区域(或叫做数据窗口)的大小 | ||||
|         //     zoomLoxk: true, | ||||
|         //     // 控制手柄的尺寸 | ||||
|         //     handleSize: 0, | ||||
|         //     // dataZoom-slider组件离容器下侧的距离 | ||||
|         //     bottom: 3, | ||||
|         //   }, | ||||
|         //   { | ||||
|         //     // 没有下面这块的话,只能拖动滚动条, | ||||
|         //     // 鼠标滚轮在区域内不能控制外部滚动条 | ||||
|         //     type: "inside", | ||||
|         //     // 滚轮是否触发缩放 | ||||
|         //     zoomOnMouseWheel: false, | ||||
|         //     // 鼠标滚轮触发滚动 | ||||
|         //     moveOnMouseMove: true, | ||||
|         //     moveOnMouseWheel: true, | ||||
|         //   }, | ||||
|         // ], | ||||
|         yAxis:undefined, | ||||
|         series: [], | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|   props: { | ||||
|     chartHeight: { | ||||
|       type: Number, | ||||
|       default: 300, | ||||
|     }, | ||||
|     type: { | ||||
|       type: Number, | ||||
|       default: 2, | ||||
|     }, | ||||
|     show: { | ||||
|       type: Boolean, | ||||
|       default: true, | ||||
|     }, | ||||
|     legendList: { | ||||
|       type: Array, | ||||
|       default: () => [], | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       type: Object, | ||||
|       default: () => { }, | ||||
|     }, | ||||
|     chartId: { | ||||
|       type: String, | ||||
|       default: "bmChart", | ||||
|     }, | ||||
|     chartNum: { | ||||
|       type: Number, | ||||
|       default: 1, | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     chartHeight: { | ||||
|       handler(newVal) { | ||||
|         this.chartHeight = newVal; | ||||
|       }, | ||||
|     }, | ||||
|     type() { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartNum(val) { | ||||
|       this.canvasReset(); | ||||
|     }, | ||||
|     chartMsg: { | ||||
|       handler(newVal) { | ||||
|         this.canvasReset(); | ||||
|       }, | ||||
|       deep: true, | ||||
|     }, | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.canvasReset(); | ||||
|   }, | ||||
|   methods: { | ||||
|     canvasReset() { | ||||
|       debounce(() => { | ||||
|         this.getMes(); | ||||
|       }, 500)(); | ||||
|     }, | ||||
|     getMes() { | ||||
|       if (this.myChart) { | ||||
|         this.myChart.dispose(); | ||||
|       } | ||||
|       var chartDom = document.getElementById(this.chartId); | ||||
|       this.myChart = echarts.init(chartDom); | ||||
|       this.option.color = this.chartMsg.color; | ||||
|       this.option.xAxis.data = this.chartMsg.xData; | ||||
|       // this.option.yAxis.name = this.chartMsg.yName; | ||||
|  | ||||
|       // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; | ||||
|       this.option.series = this.chartMsg.series; | ||||
|       this.option.yAxis = this.chartMsg.yAxis; | ||||
|  | ||||
|       this.myChart.setOption(this.option); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss"> | ||||
| .legendData { | ||||
|   text-align: right; | ||||
|   position: relative; | ||||
|   // right: 30; | ||||
|   // top: 10px; | ||||
|   .itemData { | ||||
|     display: inline-block; | ||||
|     margin-right: 10px; | ||||
|     font-size: 14px; | ||||
|     color: #8c8c8c; | ||||
|     .block { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|     } | ||||
|     .line { | ||||
|       width: 10px; | ||||
|       height: 10px; | ||||
|       border-radius: 5px; | ||||
|       display: inline-block; | ||||
|       margin-right: 4px; | ||||
|       position: relative; | ||||
|       .line-block { | ||||
|         position: absolute; | ||||
|         width: 20px; | ||||
|         height: 2px; | ||||
|         left: -5px; | ||||
|         top: 4px; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -1,116 +1,78 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-04-15 10:49:13 | ||||
|  * @LastEditTime: 2024-06-07 16:22:57 | ||||
|  * @LastEditTime: 2024-06-25 08:39:48 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 35px)"> | ||||
|     <!-- <div class="app-container" | ||||
|       style="margin-top: 8px; padding: 0 16px; height: auto; font-size: 20px; text-align: center;"> | ||||
|       <p style="margin-bottom: 0">数据概览</p> | ||||
|       <div class="view"> | ||||
|         <div v-for="(item, index) in data" :key="index"> | ||||
|           <p style="color: rgb(194,128,255)">{{ item }}</p> | ||||
|           <p>{{ index }}</p> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> --> | ||||
|     <div class="" style="height: auto;"> | ||||
|       <ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event"> | ||||
|         <!-- <template v-slot:tab1> | ||||
|           <div style="margin: 20px; background: #f001;"> | ||||
|             Page1: 状态时序图 | ||||
|           </div> | ||||
|         </template> | ||||
|         <template v-slot:tab2> | ||||
|           <div style="margin: 20px"> | ||||
|             Page2: 产量时序图 | ||||
|           </div> | ||||
|         </template> --> | ||||
|       </ButtonNav> | ||||
|     </div> | ||||
|     <div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto;"> | ||||
|       <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> | ||||
|         <el-form-item label="时间维度" prop="date"> | ||||
|           <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择"> | ||||
|         <el-form-item label="时间维度" prop="type"> | ||||
|           <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择"> | ||||
|             <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 1 || listQuery.date === ''" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至" | ||||
|             start-placeholder="开始日期" value-format="yyyyMMdd" @change="changeDayTime" end-placeholder="结束日期"> | ||||
|         <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至" | ||||
|             start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime" | ||||
|             end-placeholder="结束日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周" | ||||
|             style="width: 180px" @change="onValueChange"> | ||||
|         <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" | ||||
|             placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> | ||||
|           </el-date-picker> | ||||
|           至 | ||||
|           <el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周" | ||||
|             style="width: 180px" @change="onValueChange"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周" | ||||
|             placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> | ||||
|           </el-date-picker> | ||||
|           <!-- <span v-if="start && end" style="margin-left: 10px"> | ||||
|           <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px"> | ||||
|             {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周 | ||||
|           </span> --> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime"> | ||||
|           <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyyMM" | ||||
|             range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime"> | ||||
|         <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" | ||||
|             value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" | ||||
|             @change="changeTime"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="start" value-format="yyyy" type="year" placeholder="开始时间"> | ||||
|         <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="开始时间"> | ||||
|           </el-date-picker> | ||||
|           ~ | ||||
|           <el-date-picker size="small" clearable v-model="end" value-format="yyyy" type="year" placeholder="结束时间" | ||||
|             @change="getYear"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="结束时间" @change="getYear"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <!-- <el-form-item label="玻璃类型" prop="type"> | ||||
|           <el-select v-model="listQuery.type" placeholder="请选择玻璃类型"> | ||||
|             <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> --> | ||||
|         <!-- <el-form-item label="玻璃类型" prop="type"> | ||||
|           <el-select v-model="listQuery.type" placeholder="请选择玻璃类型"> | ||||
|             <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> --> | ||||
|         <el-form-item> | ||||
|           <el-button type="primary" size="small" @click="getDataList">查询</el-button> | ||||
|           <el-divider direction="vertical"></el-divider> | ||||
|           <!-- <el-button type="primary" size="small" plain @click="handleImport">导入</el-button> --> | ||||
|           <el-button type="primary" size="small" plain @click="handleExport">导出</el-button> | ||||
|           <!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> --> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" | ||||
|         :table-data="tableData"> | ||||
|         <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" | ||||
|           :method-list="tableBtn" @clickBtn="handleClick" /> | ||||
|       <base-table :span-method="objectSpanMethod" :table-props="tableProps" :page="listQuery.pageNo" | ||||
|         :limit="listQuery.pageSize" :table-data="tableData" :max-height="tableH"> | ||||
|       </base-table> | ||||
|       <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" | ||||
|         @pagination="getDataList" /> | ||||
|     </div> | ||||
|     <!-- <add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" | ||||
|       @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" /> --> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| // import { parseTime } from '../../core/mixins/code-filter'; | ||||
| // import { getWorkOrderPage, exportExcel, getOverView } from '@/api/produceData/order'; | ||||
| import { getComprehensiveDataPage, exportComprehensiveDataPage } from '@/api/report'; | ||||
| // import { getWorkOrderPage, exportExcel, getOverView } from '@/components/buttonNav' | ||||
| // import inputTable from './inputTable.vue'; | ||||
| // import lineChart from './lineChart'; | ||||
| import moment from 'moment' | ||||
| import ButtonNav from '@/components/ButtonNav' | ||||
| import basicPage from '@/mixins/basic-page' | ||||
| // import basicPage from '@/mixins/basic-page' | ||||
| // import AddOrUpdate from './add-or-updata'; | ||||
| import { factoryList, factoryArray } from "@/utils/constants"; | ||||
| import { publicFormatter } from "@/utils/dict"; | ||||
| @@ -119,38 +81,42 @@ import { publicFormatter } from "@/utils/dict"; | ||||
| // import * as XLSX from 'xlsx' | ||||
| export default { | ||||
|   components: { ButtonNav }, | ||||
|   mixins: [basicPage], | ||||
|   // mixins: [basicPage], | ||||
|   data() { | ||||
|     return { | ||||
|       factoryList, | ||||
|       factoryArray, | ||||
|       start: undefined, | ||||
|       end: undefined, | ||||
|       currentMenu:'邯郸', | ||||
|       listQuery: { | ||||
|         size: 10, | ||||
|         current: 1, | ||||
|         factorys: null, | ||||
|         total: 0, | ||||
|         date: 3, | ||||
|         beginTime: undefined, | ||||
|         endTime: undefined, | ||||
|         pageNo: 1, | ||||
|         pageSize: 999, | ||||
|         // size: 10, | ||||
|         // current: 1, | ||||
|         factory: undefined, | ||||
|         // total: 0, | ||||
|         type: 2, | ||||
|         startDate: undefined, | ||||
|         endDate: undefined, | ||||
|         start: undefined, | ||||
|         end: undefined, | ||||
|         reportTime: [] | ||||
|       }, | ||||
|       tableH: this.tableHeight(269), | ||||
|       timeList: [ | ||||
|         { | ||||
|           value: 1, | ||||
|           value: 0, | ||||
|           label: '日' | ||||
|         }, | ||||
|         { | ||||
|           value: 2, | ||||
|           value: 1, | ||||
|           label: '周' | ||||
|         }, | ||||
|         { | ||||
|           value: 3, | ||||
|           value: 2, | ||||
|           label: '月' | ||||
|         }, | ||||
|         { | ||||
|           value: 4, | ||||
|           value: 3, | ||||
|           label: '年' | ||||
|         } | ||||
|       ], | ||||
| @@ -179,144 +145,123 @@ export default { | ||||
|           id: 2, | ||||
|         }, | ||||
|       ], | ||||
|       tableProps: [ | ||||
|         { | ||||
|           prop: 'factory', | ||||
|           label: '玻璃类型', | ||||
|           fixed:true, | ||||
|           // filter: (val) => factoryList[val], | ||||
|           // minWidth: 200, | ||||
|           // showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
|           prop: 'workOrderNumber', | ||||
|           label: '科目/日期', | ||||
|           fixed: true, | ||||
|           // filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val] | ||||
|         }, | ||||
|         { | ||||
|           prop: 'workOrderType', | ||||
|           label: '单位', | ||||
|           fixed: true, | ||||
|           // filter: publicFormatter('workorder_status') | ||||
|           // filter: (val) => ['', '芯片工单', '组件类型', 'bipv类型'][val], | ||||
|         }, | ||||
|         { | ||||
|           prop: 'plannedInvestment', | ||||
|           label: '计划投入', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'actualInvestment', | ||||
|           label: '实际投入', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'targetProduction', | ||||
|           label: '目标产量', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'actualProduction', | ||||
|           label: '实际产量', | ||||
|         }, | ||||
|         { | ||||
|           prop: 'productionProgress', | ||||
|           label: '生产进度', | ||||
|           filter: (val) => (val * 100) + '%' | ||||
|         }, | ||||
|         { | ||||
|           prop: 'orderStatus', | ||||
|           label: '工单状态', | ||||
|           filter: publicFormatter('workorder_status') | ||||
|           // filter: (val) => ['未开始', '生产中', '已完成'][val], | ||||
|         }, | ||||
|         { | ||||
|           prop: 'startTime', | ||||
|           label: '开始时间', | ||||
|           minWidth: 100, | ||||
|           showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
|           prop: 'endTime', | ||||
|           label: '完成时间', | ||||
|           minWidth: 100, | ||||
|           showOverflowtooltip: true | ||||
|         } | ||||
|       ], | ||||
|       otherProps:[], | ||||
|       tableData: [], | ||||
|       xAxis: [], | ||||
|       // currentMenu:null, | ||||
|       lineData: {}, | ||||
|       data: {} | ||||
|       // proLineList: [], | ||||
|       // all: {} | ||||
|     }; | ||||
|   }, | ||||
|   watch: { | ||||
|     currentMenu() { | ||||
|       this.getDataList() | ||||
|     }, | ||||
|   }, | ||||
|   computed: { | ||||
|     weekNum() { | ||||
|       return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1 | ||||
|     }, | ||||
|     tableProps() { | ||||
|       return [ | ||||
|         { | ||||
|           prop: 'type', | ||||
|           label: '玻璃类型', | ||||
|           fixed: true, | ||||
|           // filter: (val) => factoryList[val], | ||||
|           // minWidth: 200, | ||||
|           // showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
|           prop: 'item', | ||||
|           label: '科目/日期', | ||||
|           fixed: true, | ||||
|           // filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val] | ||||
|         }, | ||||
|         { | ||||
|           prop: 'unit', | ||||
|           label: '单位', | ||||
|           fixed: true, | ||||
|           // filter: publicFormatter('workorder_status') | ||||
|           // filter: (val) => ['', '芯片工单', '组件类型', 'bipv类型'][val], | ||||
|         }, | ||||
|         ...this.otherProps | ||||
|       ] | ||||
|     }, | ||||
|   }, | ||||
|   created() { | ||||
|     const currentMonth = new Date() | ||||
|     this.listQuery.reportTime = [moment(currentMonth).format('yyyyMM'), moment(currentMonth).format('yyyyMM')] | ||||
|     this.changeTime() | ||||
|   }, | ||||
|   // created() { | ||||
|   //   const currentMonth = new Date() | ||||
|   //   this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-dd HH:mm:ss'), moment(currentMonth).format('yyyy-MM-dd HH:mm:ss')] | ||||
|   //   this.changeTime() | ||||
|   // }, | ||||
|   mounted() { | ||||
|     this.getOverView() | ||||
|     const currentMonth = new Date() | ||||
|     this.listQuery.reportTime = [moment(currentMonth).format('yyyyMM'), moment(currentMonth).format('yyyyMM')] | ||||
|     this.changeTime() | ||||
|     this.tableH = this.tableHeight(269); | ||||
|     // this.getOverView() | ||||
|     const today = new Date() | ||||
|     const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) | ||||
|     this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD') | ||||
|     this.listQuery.endDate = moment(today).format('yyyy-MM-DD') | ||||
|     this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate] | ||||
|     this.getDataList() | ||||
|   }, | ||||
|   methods: { | ||||
|     objectSpanMethod({ row, column, rowIndex, columnIndex }) { | ||||
|       let spanOneArr = [], concatOne = 0; | ||||
|       // let spanTwoArr = [], concatTwo = 0; | ||||
|  | ||||
|       this.tableData.map((item, index) => { | ||||
|         // console.log(inde); | ||||
|         if (index === 0) { | ||||
|           spanOneArr.push(1); | ||||
|         } else { | ||||
|           //第一列需合并相同内容的判断条件 | ||||
|           if (item.type === this.tableData[index - 1].type) { | ||||
|             spanOneArr[concatOne] += 1; | ||||
|             spanOneArr.push(0); | ||||
|           } else { | ||||
|             spanOneArr.push(1); | ||||
|             concatOne = index; | ||||
|           }; | ||||
|         } | ||||
|       }); | ||||
|  | ||||
|       if (columnIndex === 1) { | ||||
|         const _row = spanOneArr[rowIndex]; | ||||
|         const _col = _row > 0 ? 1 : 0; | ||||
|         return { | ||||
|           rowspan: _row, | ||||
|           colspan: _col | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     getYear(e) { | ||||
|       if (this.end && Number(this.end) - Number(this.start) > 10) { | ||||
|       if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) { | ||||
|         this.$message({ | ||||
|           message: '年份起止时间不能超过十年', | ||||
|           type: 'warning' | ||||
|         }); | ||||
|         this.start = undefined | ||||
|         this.end = undefined | ||||
|         this.listQuery.reportTime = [] | ||||
|         this.listQuery.start = undefined | ||||
|         this.listQuery.end = undefined | ||||
|         // console.log(); | ||||
|       } else { | ||||
|         if (Number(this.end) < Number(this.start)) { | ||||
|           this.$message({ | ||||
|             message: '结束年份不能小于开始年份', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.start = undefined | ||||
|           this.end = undefined | ||||
|         } else { | ||||
|           this.listQuery.beginTime = Number(this.start) | ||||
|           this.listQuery.endTime = Number(this.end) | ||||
|         } | ||||
|         this.listQuery.startDate = this.listQuery.start | ||||
|         this.listQuery.endDate = this.listQuery.end | ||||
|       } | ||||
|       if (!this.start && !this.end) { | ||||
|         this.listQuery.beginTime = undefined | ||||
|         this.listQuery.endTime = undefined | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|       // console.log(e); | ||||
|     }, | ||||
|     changeTime() { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         const years = Number(this.listQuery.reportTime[1].slice(0, 4)) - Number(this.listQuery.reportTime[0].slice(0, 4)) | ||||
|         const months = Number(this.listQuery.reportTime[1].slice(4)) - Number(this.listQuery.reportTime[0].slice(4)) | ||||
|         if (years * 12 + months > 24) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过24个月', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.beginTime = Number(this.listQuery.reportTime[0]) | ||||
|           this.listQuery.endTime = Number(this.listQuery.reportTime[1]) | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.beginTime = undefined | ||||
|         this.listQuery.endTime = undefined | ||||
|       } | ||||
|     }, | ||||
|     onValueChange(picker, k) { // 选中近k周后触发的操作 | ||||
|       if (this.start && this.end) { | ||||
|         this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|       // console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1]) | ||||
|       if (this.listQuery.start && this.listQuery.end) { | ||||
|         console.log(this.listQuery.reportTime) | ||||
|         this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000); | ||||
|         if (numDays > 168) { | ||||
|           console.log(numDays) | ||||
| @@ -325,18 +270,21 @@ export default { | ||||
|             type: 'warning' | ||||
|           }); | ||||
|         } else { | ||||
|           this.listQuery.beginTime = Number(moment(this.start.getTime()).format('YYYYWW')) | ||||
|           this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW')) | ||||
|           this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|           this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|         } | ||||
|       } | ||||
|       if (!this.start && !this.end) { | ||||
|         this.listQuery.beginTime = undefined | ||||
|         this.listQuery.endTime = undefined | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeDayTime() { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0]) | ||||
|         // this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss'); | ||||
|         // this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss'); | ||||
|         console.log(this.listQuery.reportTime[1]) | ||||
|         const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000); | ||||
|         if (numDays > 30) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过30天', | ||||
| @@ -344,48 +292,232 @@ export default { | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.beginTime = Number(this.listQuery.reportTime[0]) | ||||
|           this.listQuery.endTime = Number(this.listQuery.reportTime[1]) | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.beginTime = undefined | ||||
|         this.listQuery.endTime = undefined | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     getOverView() { | ||||
|       // getOverView().then(res => { | ||||
|       //   this.data = res.data | ||||
|       //   console.log('aa', res.data) | ||||
|       // }) | ||||
|     }, | ||||
|     otherMethods(val) { | ||||
|       this.detailOrUpdateVisible = true; | ||||
|       // this.addOrEditTitle = "详情"; | ||||
|       this.$nextTick(() => { | ||||
|         // this.$refs.detailOrUpdate.init(val.data.id); | ||||
|       }); | ||||
|     changeTime(value) { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0]; | ||||
|         if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过24个月', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     async getDataList() { | ||||
|       // const res = await getWorkOrderPage(this.listQuery) | ||||
|       if (!this.listQuery.startDate && !this.listQuery.endDate) { | ||||
|         return this.$message('请选择起止时间') | ||||
|       } | ||||
|       this.otherProps = [] | ||||
|       let arr  = [] | ||||
|       this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) | ||||
|       this.listQuery.factory = arr | ||||
|       const res = await getComprehensiveDataPage(this.listQuery) | ||||
|       // this.tableData = res.data.list | ||||
|       // this.listQuery.total = res.data.total | ||||
|       // if (this.listQuery.total > 0) { | ||||
|       //   this.tableData.forEach(item => { | ||||
|       //     item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--' | ||||
|       //     item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--' | ||||
|       //   }) | ||||
|       // } | ||||
|       let dataArr = [{ | ||||
|         type: '芯片', | ||||
|         item: 'FTO投入', | ||||
|         unit: '片' | ||||
|       }, | ||||
|       { | ||||
|         type: '芯片', | ||||
|         item: '芯片产量', | ||||
|         unit: '片' | ||||
|         }, { | ||||
|         type: '芯片', | ||||
|           item: '芯片平均功率', | ||||
|           unit: 'W' | ||||
|         }, | ||||
|         { | ||||
|           type: '芯片', | ||||
|           item: '芯片良率', | ||||
|           unit: '%' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: '芯片产量', | ||||
|           unit: '片' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: '芯片总功率', | ||||
|           unit: 'MW' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: 'CSS稼动率', | ||||
|           unit: '%' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: '芯片段OEE', | ||||
|           unit: '%' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: '芯片产能利用率', | ||||
|           unit: '%' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: '芯片人均产量', | ||||
|           unit: '片/人' | ||||
|         }, { | ||||
|           type: '芯片', | ||||
|           item: '芯片BOM', | ||||
|           unit: '元/片' | ||||
|         }, { | ||||
|           type: '标准组件', | ||||
|           item: '标准组件产量', | ||||
|           unit: '片' | ||||
|         }, { | ||||
|           type: '标准组件', | ||||
|           item: '标准组件平均功率', | ||||
|           unit: 'W' | ||||
|         }, { | ||||
|           type: '标准组件', | ||||
|           item: '标准组件良率', | ||||
|           unit: '%' | ||||
|         }, { | ||||
|           type: '标准组件', | ||||
|           item: '标准组件总功率', | ||||
|           unit: 'MW' | ||||
|         }, { | ||||
|           type: '标准组件', | ||||
|           item: '封装线OEE', | ||||
|           unit: '%' | ||||
|         }, | ||||
|         { | ||||
|           type: '标准组件', | ||||
|           item: '封装线产能利用率', | ||||
|           unit: '%' | ||||
|         }, | ||||
|         { | ||||
|           type: '标准组件', | ||||
|           item: '标准组件人均产量', | ||||
|           unit: '片/人' | ||||
|         }, | ||||
|         { | ||||
|           type: '标准组件', | ||||
|           item: '封装BOM', | ||||
|           unit: '元/片' | ||||
|         }, | ||||
|         { | ||||
|           type: 'BIPV', | ||||
|           item: '芯片使用量', | ||||
|           unit: '%' | ||||
|         }, | ||||
|         { | ||||
|           type: 'BIPV', | ||||
|           item: 'BIPV产量', | ||||
|           unit: 'm2' | ||||
|         }, | ||||
|         { | ||||
|           type: 'BIPV', | ||||
|           item: '芯片使用率', | ||||
|           unit: '%' | ||||
|         }, | ||||
|           { | ||||
|           type: 'BIPV', | ||||
|           item: '人均产量', | ||||
|           unit: 'm2/人' | ||||
|         }, | ||||
|         { | ||||
|           type: 'BIPV', | ||||
|           item: 'OEM及委外材料成本', | ||||
|           unit: '元/片' | ||||
|         }, | ||||
|         { | ||||
|           type: 'BIPV', | ||||
|           item: '内部材料成本', | ||||
|           unit: '元/片' | ||||
|         }, | ||||
|         { | ||||
|           type: 'BIPV', | ||||
|           item: '综合材料成本', | ||||
|           unit: '元/片' | ||||
|         }, | ||||
|       ] | ||||
|       res.data.forEach((ele, index) => { | ||||
|         let i = index + 1 | ||||
|         // this.chartMsg.xData.push(ele.titleValue) | ||||
|         this.otherProps.push({ | ||||
|           label: ele.titleValue, | ||||
|           prop: 'value' + i | ||||
|         }) | ||||
|       }) | ||||
|       console.log(this.otherProps) | ||||
|       res.data.forEach((item, index) => { | ||||
|         let i = index + 1 | ||||
|         let m = 'value' + i | ||||
|         // ele.productYieldDataVOList.forEach((item) => { | ||||
|          dataArr[0]['' + m + ''] = item.ftoInput | ||||
|           // dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌' | ||||
|           // dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌' | ||||
|           // dataArr[2].factory = item.factory === 1 ? '邯郸' : '瑞昌' | ||||
|           // dataArr[3].factory = item.factory === 1 ? '邯郸' : '瑞昌' | ||||
|           dataArr[1]['' + m + ''] = item.chipYield | ||||
|           dataArr[2]['' + m + ''] = item.chipAveragePower | ||||
|           dataArr[4]['' + m + ''] = item.chipTotalPower | ||||
|           dataArr[5]['' + m + ''] = item.chipCssMarriageRate | ||||
|           dataArr[6]['' + m + ''] = item.chipOee | ||||
|           dataArr[7]['' + m + ''] = item.chipCapacityUtilizationRate | ||||
|           dataArr[8]['' + m + ''] = item.chipAnnualAverageProduction | ||||
|           dataArr[9]['' + m + ''] = item.chipBom | ||||
|           dataArr[10]['' + m + ''] = item.componentYield | ||||
|           dataArr[11]['' + m + ''] = item.componentAveragePower | ||||
|           dataArr[12]['' + m + ''] = item.componentYieldRate | ||||
|           dataArr[13]['' + m + ''] = item.componentTotalPower | ||||
|           dataArr[14]['' + m + ''] = item.componentOee | ||||
|           dataArr[15]['' + m + ''] = item.componentCapacityUtilizationRate | ||||
|           dataArr[16]['' + m + ''] = item.componentAnnualAverageProduction | ||||
|           dataArr[17]['' + m + ''] = item.componentBom | ||||
|           dataArr[18]['' + m + ''] = item.bipvChipUsage | ||||
|           dataArr[19]['' + m + ''] = item.bipvProductOutput | ||||
|           dataArr[20]['' + m + ''] = item.bipvChipUtilizationRate | ||||
|           dataArr[21]['' + m + ''] = item.bipvAnnualAverageProduction | ||||
|           dataArr[22]['' + m + ''] = item.bipvOeeMaterialCost | ||||
|           dataArr[23]['' + m + ''] = item.bipvInsideMaterialCost | ||||
|           dataArr[24]['' + m + ''] = item.bipvComprehensiveMaterialCost | ||||
|  | ||||
|         // }) | ||||
|         // ele.titleValue | ||||
|         // .push({ | ||||
|         //   label: ele.titleValue, | ||||
|         //   props: 'value' + index + 1, | ||||
|         // }) | ||||
|       }) | ||||
|       console.log(dataArr); | ||||
|       if (res.data.length === 0) { | ||||
|         this.tableData = [] | ||||
|       } else { | ||||
|         if (this.currentMenu != '瑞昌') { | ||||
|           this.tableData = dataArr | ||||
|         } else { | ||||
|           this.tableData = dataArr.filter(function (item) { | ||||
|             return item.type !== "BIPV" | ||||
|           }); | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     buttonClick(val) { | ||||
|       this.listQuery.factorys = val.factory?.length > 0 ? val.factory : undefined | ||||
|       this.listQuery.orderStatus = val.orderStatus?.length > 0 ? val.orderStatus : undefined | ||||
|       this.listQuery.time = val.timeSlot?.length > 0 ? val.timeSlot : undefined | ||||
|       // this.listQuery.orderStatus = val.orderStatus?.length > 0 ? val.orderStatus : undefined | ||||
|       // this.listQuery.time = val.timeSlot?.length > 0 ? val.timeSlot : undefined | ||||
|       switch (val.btnName) { | ||||
|         case 'search': | ||||
|           this.listQuery.pageNo = 1; | ||||
|           this.listQuery.pageSize = 20; | ||||
|           // this.listQuery.pageNo = 1; | ||||
|           // this.listQuery.pageSize = 20; | ||||
|           if (this.listQuery.time) { | ||||
|             this.getDataList(); | ||||
|             // this.getDataList(); | ||||
|           } else { | ||||
|             this.$message.warning('请选择时间范围!') | ||||
|           } | ||||
| @@ -403,6 +535,14 @@ export default { | ||||
|     }, | ||||
|     /** 导出按钮操作 */ | ||||
|     handleExport() { | ||||
|  | ||||
|       let fileName = "综合数据.xls"; | ||||
|       exportComprehensiveDataPage(this.listQuery) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => { }); | ||||
|       // this.$modal.confirm('是否确认导出工单数据?').then(() => { | ||||
|       //   // 处理查询参数 | ||||
|       //   // let params = {...this.listQuery}; | ||||
|   | ||||
| @@ -187,16 +187,19 @@ export default { | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月FTO/基片投入</div> | ||||
|       <div class="smallTitle">FTO/基片投入</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,101 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   fTOReportByDateRangePage, | ||||
|   fTOReportByDateRangeExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "FtoOutputBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             // data: [3000, 2000, 3000], | ||||
|             // data: [6800, 5000, 8900], | ||||
|             // data: [12000, 17000, 19000], | ||||
|             data: [560000, 540000, 600000], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -130,28 +90,22 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             // data: [2100, 800, 1500], | ||||
|             // data: [9500, 7200, 9901], | ||||
|             // data: [14666, 15000, 17888], | ||||
|             data: [550000, 456666, 590000], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               // position: [-10, -16], | ||||
|               position: [-17, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             // data: [2100, 900, 1300], | ||||
|             // data: [9100, 7300, 9700], | ||||
|             // data: [14666, 15300, 18000], | ||||
|             data: [556666, 456666, 650000], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -188,6 +142,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.date = 2; | ||||
|     this.listQuery.queryTime = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factorys = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -206,59 +167,159 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("==========下面是测试代码,需删除"); | ||||
|       this.chartMsg.series = []; | ||||
|       this.listQuery.date = val.type; | ||||
|       this.listQuery.queryTime = val.startDate; | ||||
|       this.listQuery.factorys = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出=====下面是测试代码,需删除"); | ||||
|       this.chartMsg.series = [ | ||||
|         { | ||||
|           name: "2024年4月目标值1", | ||||
|           // data: [3000, 2000, 3000], | ||||
|           // data: [6800, 5000, 8900], | ||||
|           // data: [12000, 17000, 19000], | ||||
|           data: [560000, 540000, 600000], | ||||
|           type: "line", | ||||
|           symbol: "circle", | ||||
|           symbolSize: 6, | ||||
|           label: { | ||||
|             show: true, | ||||
|             color: "#FFAE17", | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       fTOReportByDateRangePage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.length > 0) { | ||||
|           // 设置表头 | ||||
|           let msg = res.data[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "lastone", | ||||
|               label: msg.lastone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "currentone", | ||||
|               label: msg.currentone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "targetone", | ||||
|               label: msg.targetone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           // 整理表格数据 | ||||
|           let tableArr = []; | ||||
|           res.data.forEach((item) => { | ||||
|             let obj = {}; | ||||
|             obj.factory = item.factory; | ||||
|             obj.item = "FTO投入"; | ||||
|             obj.unit = "片"; | ||||
|             obj.lastone = item.lastone.total; | ||||
|             obj.currentone = item.currentone.total; | ||||
|             obj.targetone = item.targetone.total; | ||||
|             tableArr.push(obj); | ||||
|           }); | ||||
|           this.tableData = tableArr; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetone.reportTime; | ||||
|           this.legendList[1].name = msg.lastone.reportTime; | ||||
|           this.legendList[2].name = msg.currentone.reportTime; | ||||
|           this.chartMsg.series[0].name = msg.targetone.reportTime; | ||||
|           this.chartMsg.series[1].name = msg.lastone.reportTime; | ||||
|           this.chartMsg.series[2].name = msg.currentone.reportTime; | ||||
|           // 设置偏移量 | ||||
|           switch (this.listQuery.type) { | ||||
|             case 0: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 1: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 2: | ||||
|               this.chartMsg.series[1].label.position = [-10, -16]; | ||||
|               break; | ||||
|             default: | ||||
|               this.chartMsg.series[1].label.position = [-17, -16]; | ||||
|           } | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push(val[i].targetone.total || 0); | ||||
|         barData1.push(val[i].lastone.total || 0); | ||||
|         barData2.push(val[i].currentone.total || 0); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|             }, | ||||
|           }, | ||||
|         }, | ||||
|         { | ||||
|           name: "2023年4月", | ||||
|           // data: [2100, 800, 1500], | ||||
|           // data: [9500, 7200, 9901], | ||||
|           // data: [14666, 15000, 17888], | ||||
|           data: [550000, 456666, 590000], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           label: { | ||||
|             show: true, | ||||
|             // position: [-5, -16], | ||||
|             // position: [-5, -16], | ||||
|             // position: [-10, -16], | ||||
|             position: [-17, -16], | ||||
|             color: "#68C483", | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|         }, | ||||
|         { | ||||
|           name: "2024年4月", | ||||
|           // data: [2100, 900, 1300], | ||||
|           // data: [9100, 7300, 9700], | ||||
|           // data: [14666, 15300, 18000], | ||||
|           data: [556666, 456666, 650000], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [0, -16], | ||||
|             color: "#288AFF", | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         }, | ||||
|       ]; | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "产量对标FTO.xls"; | ||||
|       fTOReportByDateRangeExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月封装OEE</div> | ||||
|       <div class="smallTitle">封装OEE</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,102 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   componentOEEPage, | ||||
|   componentOEEExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "PackageOEEBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             data: [ | ||||
|               { name: "%", value: 85 }, | ||||
|               { name: "%", value: 85 }, | ||||
|               { name: "%", value: 85 }, | ||||
|             ], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -134,12 +93,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 57.5 }, | ||||
|               { name: "%", value: 21.66 }, | ||||
|               { name: "%", value: 18.4 }, | ||||
|             ], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -152,12 +107,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 23.33 }, | ||||
|               { name: "%", value: 7.02 }, | ||||
|               { name: "%", value: 80.2 }, | ||||
|             ], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -197,6 +148,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factory = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -215,11 +173,144 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       componentOEEPage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetColumn; | ||||
|           this.legendList[1].name = msg.yoyColumn; | ||||
|           this.legendList[2].name = msg.queryColumn; | ||||
|           this.chartMsg.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg.series[1].name = msg.yoyColumn; | ||||
|           this.chartMsg.series[2].name = msg.queryColumn; | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push({ | ||||
|           name: "%", | ||||
|           value: val[i].target || 0, | ||||
|         }); | ||||
|         barData1.push({ name: "%", value: val[i].yoy || 0 }); | ||||
|         barData2.push({ | ||||
|           name: "%", | ||||
|           value: val[i].queryValue || 0, | ||||
|         }); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "封装OEE对标.xls"; | ||||
|       componentOEEExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										970
									
								
								src/views/report/productionSituationMW.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										970
									
								
								src/views/report/productionSituationMW.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,970 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event"> | ||||
|     </ButtonNav> | ||||
|     <div class="search"> | ||||
|       <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> | ||||
|         <el-form-item label="时间维度" prop="type"> | ||||
|           <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择"> | ||||
|             <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至" | ||||
|             start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime" | ||||
|             end-placeholder="结束日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" | ||||
|             placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> | ||||
|           </el-date-picker> | ||||
|           至 | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周" | ||||
|             placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> | ||||
|           </el-date-picker> | ||||
|           <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px"> | ||||
|             {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周 | ||||
|           </span> --> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" | ||||
|             value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" | ||||
|             @change="changeTime"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="开始时间"> | ||||
|           </el-date-picker> | ||||
|           ~ | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="结束时间" @change="getYear"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item> | ||||
|           <el-button type="primary" size="small" @click="getDataList">查询</el-button> | ||||
|           <el-button type="primary" size="small" plain @click="handleExport">导出</el-button> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|     </div> | ||||
|     <div class="containerTop"> | ||||
|  | ||||
|       <!-- <div class="smallTitle">产量转化效率</div> --> | ||||
|  | ||||
|       <!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> --> | ||||
|       <el-row v-if="this.listQuery.type === 2"> | ||||
|         <el-col :span="12"> | ||||
|           <div class="blueTip"> | ||||
|             生产情况对比 | ||||
|           </div> | ||||
|           <bm-line-bar :type="listQuery.type" style="margin-top: 20px;" :show="false" :chartHeight="chartHeight" | ||||
|             :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId" :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|         <el-col :span="6" style="margin-top: 30px"> | ||||
|           <bm-line-bar-target :type="listQuery.type" :chartHeight="chartHeight" :legendList="legendList" | ||||
|             :chartMsg="chartMsgTarget" :gridLeft="gridLeft" :chartId="'chartTarget'" :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|         <el-col :span="6"> | ||||
|           <div class="blueTip"> | ||||
|             {{ title }} | ||||
|           </div> | ||||
|           <bm-line-bar-year-target :type="listQuery.type" :chartHeight="chartHeight" :legendList="legendList" | ||||
|             :chartMsg="chartMsgYearTarget" :chartId="'chartYearTarget'" :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-row v-else-if="this.listQuery.type === 1 || this.listQuery.type === 0"> | ||||
|         <el-col :span="18"> | ||||
|           <div class="blueTip"> | ||||
|             生产情况对比 | ||||
|           </div> | ||||
|           <bm-line-bar :type="listQuery.type" style="margin-top: 20px;" :show="false" :chartHeight="chartHeight" | ||||
|             :legendList="legendList" :chartMsg="chartMsg" :chartId="'chartDay'" :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|         <el-col :span="6" style="margin-top: 30px"> | ||||
|           <bm-line-bar-target :type="listQuery.type" :chartHeight="chartHeight" :legendList="legendList" | ||||
|             :chartMsg="chartMsgTarget" :gridLeft="gridLeft" :chartId="'chartDayTarget'" :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|         <!-- <el-col :span="6"> | ||||
|           <div class="blueTip"> | ||||
|             {{ title }} | ||||
|           </div> | ||||
|           <bm-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsgYearTarget" | ||||
|             :chartId=" 'chartYearTarget'" :chartNum="chartNum" /> | ||||
|         </el-col> --> | ||||
|       </el-row> | ||||
|       <el-row v-else> | ||||
|         <div class="blueTip"> | ||||
|           生产情况对比 | ||||
|         </div> | ||||
|         <!-- <el-col :span="12"> --> | ||||
|         <bm-line-bar :type="listQuery.type" :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" | ||||
|           :chartId="chartId" :chartNum="chartNum" /> | ||||
|         <!-- </el-col> --> | ||||
|       </el-row> | ||||
|       <base-table :key="showTable" :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" | ||||
|         :table-data="tableData" :max-height="tableH" /> | ||||
|     </div> | ||||
|     <!-- <div class="containerBottom"> | ||||
|  | ||||
|     </div> --> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import { getProductionSituationMWData, exportProductionSituationMWData } from '@/api/report'; | ||||
| import bmSearchBar from "./components/bmSearchBar.vue"; | ||||
| import BmLineBar from "./components/produceLineBar.vue"; | ||||
| import BmLineBarTarget from "./components/produceLineBarTarget.vue"; | ||||
| import BmLineBarYearTarget from "./components/produceLineBarYearTarget.vue"; | ||||
| import ButtonNav from '@/components/ButtonNav' | ||||
| import moment from 'moment' | ||||
| export default { | ||||
|   name: "componentTotalPowerBM", | ||||
|   data() { | ||||
|     return { | ||||
|       otherProps: [], | ||||
|       start: undefined, | ||||
|       showTable:false, | ||||
|       currentMenu: '邯郸', | ||||
|       end: undefined, | ||||
|       title: '', | ||||
|       gridLeft:true, | ||||
|       listQuery: { | ||||
|         pageNo: 1, | ||||
|         pageSize: 999, | ||||
|         // size: 10, | ||||
|         // current: 1, | ||||
|         factory: null, | ||||
|         // total: 0, | ||||
|         type: 2, | ||||
|         startDate: undefined, | ||||
|         endDate: undefined, | ||||
|         start: undefined, | ||||
|         end: undefined, | ||||
|         reportTime:[], | ||||
|       }, | ||||
|       timeList: [ | ||||
|         { | ||||
|           value: 0, | ||||
|           label: '日' | ||||
|         }, | ||||
|         { | ||||
|           value: 1, | ||||
|           label: '周' | ||||
|         }, | ||||
|         { | ||||
|           value: 2, | ||||
|           label: '月' | ||||
|         }, | ||||
|         { | ||||
|           value: 3, | ||||
|           label: '年' | ||||
|         } | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(137) / 2 - 111, | ||||
|       tableH: this.tableHeight(137) / 2 - 70, | ||||
|       legendList: [ | ||||
|         // { id: 1, name: "FTO投入", type: 1, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "芯片总功率", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "标准组件总功率", type: 1, color: "#288AFF" }, | ||||
|           // { id: 4, name: "BIPV产量", type: 1, color: "#64BDFF" }, | ||||
|       ], | ||||
|       chartMsgYearTarget: { | ||||
|         color: ["#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/MW", | ||||
|         yAxis: { | ||||
|           type: "value", | ||||
|           name: "单位/MW", | ||||
|           show: true, | ||||
|           nameTextStyle: { | ||||
|             fontSize: 12, | ||||
|             align: "right", | ||||
|           }, | ||||
|           axisLabel: {}, | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             name: "芯片总功率", | ||||
|             data: [ | ||||
|             ], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "标准组件总功率", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }, | ||||
|       chartMsgTarget: { | ||||
|         color: ["#8EF0AB", 'rgba(104, 196, 131, .3)', "#288AFF", 'rgba(40, 138, 255, .2)',], | ||||
|         xData: [], | ||||
|         yName: "单位/MW", | ||||
|         yAxis: { | ||||
|           show: true, | ||||
|           type: "value", | ||||
|           name: "单位/MW", | ||||
|           // splitNumber: 4, | ||||
|           nameTextStyle: { | ||||
|             fontSize: 12, | ||||
|             align: "right", | ||||
|           }, | ||||
|           axisLabel: {}, | ||||
|         }, | ||||
|         series: [ | ||||
|  | ||||
|         ], | ||||
|       }, | ||||
|       chartMsg: { | ||||
|         color: ["#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/MW", | ||||
|         yAxis:{ | ||||
|           type: "value", | ||||
|           name: "单位/MW", | ||||
|           // splitNumber: 4, | ||||
|           nameTextStyle: { | ||||
|             fontSize: 12, | ||||
|             align: "right", | ||||
|           }, | ||||
|           axisLabel: {}, | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             name: "芯片总功率", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-30, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "标准组件总功率", | ||||
|             data: [ | ||||
|             ], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }, | ||||
|       chartId: "componentTotalPowerBMChart", | ||||
|       chartNum: 1, | ||||
|     }; | ||||
|   }, | ||||
|   components: { | ||||
|     bmSearchBar, | ||||
|     BmLineBar, | ||||
|     BmLineBarTarget, | ||||
|     BmLineBarYearTarget, | ||||
|     ButtonNav | ||||
|   }, | ||||
|   computed: { | ||||
|     dataArr() { | ||||
|       // if (this.currentMenu != '瑞昌') { | ||||
|         return [{ | ||||
|           factory: null, | ||||
|           item: '芯片总功率', | ||||
|           unit: 'MW' | ||||
|         }, | ||||
|         { | ||||
|           factory: null, | ||||
|           item: '	标准组件总功率', | ||||
|           unit: 'MW' | ||||
|         }] | ||||
|       // } | ||||
|     }, | ||||
|     tableProps() { | ||||
|       return [ | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           // filter: (val) => factoryList[val], | ||||
|           minWidth: 200, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         ...this.otherProps | ||||
|       ] | ||||
|     }, | ||||
|     weekNum() { | ||||
|       return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1 | ||||
|     }, | ||||
|     isOpen() { | ||||
|       return this.$store.getters.sidebar.opened; | ||||
|     }, | ||||
|   }, | ||||
|   watch: { | ||||
|     // 监听左侧菜单栏是否展开 | ||||
|     currentMenu() { | ||||
|       this.getDataList() | ||||
|     }, | ||||
|     isOpen(val) { | ||||
|       if (this.$route.name === "productionSituationMW") { | ||||
|         this.chartNum++; | ||||
|       } | ||||
|     }, | ||||
|   }, | ||||
|   created() { | ||||
|     this.tableH = this.tableHeight(137) / 2 - 70; | ||||
|     this.chartHeight = this.tableHeight(137) / 2 - 111; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   activated() { | ||||
|     // 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新 | ||||
|     if (this.$route.name === "productionSituationMW") { | ||||
|       this.chartNum++; | ||||
|     } | ||||
|   }, | ||||
|   mounted() { | ||||
|     // this.getOverView() | ||||
|     const today = new Date() | ||||
|     const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) | ||||
|     this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD') | ||||
|     this.listQuery.endDate = moment(today).format('yyyy-MM-DD') | ||||
|     this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate] | ||||
|     this.getDataList() | ||||
|   }, | ||||
|   methods: { | ||||
|     objectSpanMethod({ row, column, rowIndex, columnIndex }) { | ||||
|       let spanOneArr = [], concatOne = 0; | ||||
|       // let spanTwoArr = [], concatTwo = 0; | ||||
|  | ||||
|       this.tableData.map((item, index) => { | ||||
|         // console.log(inde); | ||||
|         if (index === 0) { | ||||
|           spanOneArr.push(1); | ||||
|         } else { | ||||
|           //第一列需合并相同内容的判断条件 | ||||
|           if (item.factory === this.tableData[index - 1].factory) { | ||||
|             spanOneArr[concatOne] += 1; | ||||
|             spanOneArr.push(0); | ||||
|           } else { | ||||
|             spanOneArr.push(1); | ||||
|             concatOne = index; | ||||
|           }; | ||||
|         } | ||||
|       }); | ||||
|  | ||||
|       if (columnIndex === 0) { | ||||
|         const _row = spanOneArr[rowIndex]; | ||||
|         const _col = _row > 0 ? 1 : 0; | ||||
|         return { | ||||
|           rowspan: _row, | ||||
|           colspan: _col | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     getYear(e) { | ||||
|       if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) { | ||||
|         this.$message({ | ||||
|           message: '年份起止时间不能超过十年', | ||||
|           type: 'warning' | ||||
|         }); | ||||
|         this.listQuery.reportTime = [] | ||||
|         this.listQuery.start = undefined | ||||
|         this.listQuery.end = undefined | ||||
|         // console.log(); | ||||
|       } else { | ||||
|         this.listQuery.startDate = this.listQuery.start | ||||
|         this.listQuery.endDate = this.listQuery.end | ||||
|       } | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|       // console.log(e); | ||||
|     }, | ||||
|     onValueChange(picker, k) { // 选中近k周后触发的操作 | ||||
|       // console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1]) | ||||
|       if (this.listQuery.start && this.listQuery.end) { | ||||
|         console.log(this.listQuery.reportTime) | ||||
|         this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000); | ||||
|         if (numDays > 168) { | ||||
|           console.log(numDays) | ||||
|           this.$message({ | ||||
|             message: '周范围不能超过24周', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|         } else { | ||||
|           this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|           this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|         } | ||||
|       } | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeDayTime() { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         // this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss'); | ||||
|         // this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss'); | ||||
|         console.log(this.listQuery.reportTime[1]) | ||||
|         const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000); | ||||
|         if (numDays > 30) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过30天', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeTime(value) { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0]; | ||||
|         if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过24个月', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     async getDataList() { | ||||
|       this.otherProps = [] | ||||
|       this.chartMsg.xData = [] | ||||
|       this.chartMsgTarget.xData = [] | ||||
|       this.chartMsgYearTarget.xData = [] | ||||
|       this.chartMsg.series[0].data = [] | ||||
|       this.chartMsg.series[1].data = [] | ||||
|       this.chartMsgTarget.series = [] | ||||
|       this.chartMsgYearTarget.series[0].data = [] | ||||
|       this.chartMsgYearTarget.series[1].data = [] | ||||
|       console.log(this.listQuery); | ||||
|       if (!this.listQuery.startDate && !this.listQuery.endDate) { | ||||
|         return this.$message('请选择起止时间') | ||||
|       } | ||||
|       let arr = [] | ||||
|       this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) | ||||
|       this.listQuery.factory = arr | ||||
|       const res = await getProductionSituationMWData(this.listQuery) | ||||
|       let maxData = [] | ||||
|       res.data.list.forEach((ele, index) => { | ||||
|         let i = index + 1 | ||||
|         // this.chartMsg.xData.push(ele.titleValue.replace(/[^\d]/g, " ")) | ||||
|         this.otherProps.push({ | ||||
|           label: ele.titleValue, | ||||
|           prop: 'value' + i | ||||
|         }) | ||||
|       }) | ||||
|       res.data.list.forEach((ele, index) => { | ||||
|         let i = index + 1 | ||||
|         let m = 'value' + i | ||||
|         ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|           maxData.push(item.chipTotalPower, item.componentTotalPower) | ||||
|           this.dataArr[0]['' + m + ''] = item.chipTotalPower | ||||
|           // this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|           this.dataArr[1]['' + m + ''] = item.componentTotalPower | ||||
|           // this.dataArr[3]['' + m + ''] = item.bipvProductOutput | ||||
|         }) | ||||
|         // ele.titleValue | ||||
|         // .push({ | ||||
|         //   label: ele.titleValue, | ||||
|         //   props: 'value' + index + 1, | ||||
|         // }) | ||||
|       }) | ||||
|       this.chartMsg.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100 | ||||
|       this.chartMsgTarget.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100 | ||||
|       this.chartMsg.yAxis.min = Math.ceil(Math.min(...maxData) / 100) * 100 | ||||
|       this.chartMsgTarget.yAxis.min = Math.ceil(Math.min(...maxData) / 100) * 100 | ||||
|       this.chartMsg.yAxis.interval = (this.chartMsg.yAxis.max - this.chartMsg.yAxis.min) / 4 | ||||
|       this.chartMsgTarget.yAxis.interval = (this.chartMsgTarget.yAxis.max - this.chartMsgTarget.yAxis.min) / 4 | ||||
|       if (this.listQuery.type === 2) { | ||||
|         if (res.data.list.length === 3) { | ||||
|           this.gridLeft = false | ||||
|         } else { | ||||
|           this.gridLeft = true | ||||
|         } | ||||
|         // res.data.list.forEach((ele) => { | ||||
|         res.data.list.slice(0, res.data.list.length - 3).forEach((ele, index) => { | ||||
|           // let i = index + 1 | ||||
|           this.chartMsg.xData.push(ele.titleValue.slice(0, ele.titleValue.length - 3)) | ||||
|           ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|             this.chartMsg.series[0].data.push({ | ||||
|               name: ele.titleValue, | ||||
|               value: item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|             }) | ||||
|             this.chartMsg.series[1].data.push({ | ||||
|               name: ele.titleValue, | ||||
|               value: item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             }) | ||||
|           }) | ||||
|         }) | ||||
|         this.chartMsgTarget.xData.push(res.data.list[res.data.list.length - 2].titleValue) | ||||
|         // this.chartMsgTarget.series = [{ | ||||
|         //   name: "FTO投入", | ||||
|         //   data: [ | ||||
|         //     // s | ||||
|         //     { name: "FTO投入目标", value:res,data,list }, | ||||
|         //     { name: "%", value: 85 }, | ||||
|         //     { name: "%", value: 85 }, | ||||
|         //   ], | ||||
|         //   type: "bar", | ||||
|         //   barWidth: 20, | ||||
|         //   barGap: '0', | ||||
|         //   label: { | ||||
|         //     show: true, | ||||
|         //     position: [-18, -16], | ||||
|         //     color: "#FFAE17", | ||||
|         //     formatter: function (params) { | ||||
|         //       return params.value | ||||
|         //     }, | ||||
|         //   }, | ||||
|         // },] | ||||
|         let arr = [] | ||||
|         let chip = [] | ||||
|         let std = [] | ||||
|         let obj = {} | ||||
|         let targetObj = {} | ||||
|         res.data.list.slice(res.data.list.length - 3, res.data.list.length - 1).forEach((ele, index) => { | ||||
|           console.log(ele.titleValue.search('目标')); | ||||
|           // let i = index + 1 | ||||
|           // this.chartMsgTarget.xData.push(ele.titleValue) | ||||
|           ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|             if (ele.titleValue.search('目标') != -1) { | ||||
|               targetObj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|               targetObj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             } else { | ||||
|               obj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|               obj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             } | ||||
|  | ||||
|             // this.chartMsgTarget.series[1].data.push() | ||||
|             // this.chartMsgTarget.series[2].data.push() | ||||
|             // this.chartMsgTarget.series[3].data.push() | ||||
|           }) | ||||
|         }) | ||||
|         chip.push({ | ||||
|           name: "芯片总功率完成值", | ||||
|           // barGap: '-100%', | ||||
|           stack: 'a', | ||||
|           data: [ | ||||
|             { name: "芯片总功率完成值", value: obj.chipTotalPower, titleValue: obj.chipTotalPower }, | ||||
|             // { name: '芯片总功率完成值', value: 55 }, | ||||
|             // { name: "%", value: 21.66 }, | ||||
|             // { name: "%", value: 18.4 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           // barGap: '-100%', | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [-18, -16], | ||||
|             color: "rgba(104,196,131)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }, { | ||||
|           name: "芯片总功率目标值", | ||||
|           // barGap: '-100%', | ||||
|           stack: 'a', | ||||
|           data: [ | ||||
|             { name: "芯片总功率目标值", value: (targetObj.chipTotalPower - obj.chipTotalPower) > 0 ? (targetObj.chipTotalPower - obj.chipTotalPower) : null, titleValue: targetObj.chipTotalPower }, | ||||
|             // { name: '芯片总功率目标值', value: 22 }, | ||||
|             // { name: "%", value: 21.66 }, | ||||
|             // { name: "%", value: 18.4 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           // barGap: '-100%', | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [-18, -16], | ||||
|             color: "rgba(104,196,131,.5)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }) | ||||
|         std.push({ | ||||
|           name: "标准组件总功率完成值", | ||||
|           stack: 'b', | ||||
|           data: [ | ||||
|             { name: "标准组件总功率完成值", value: obj.componentTotalPower,titleValue:obj.componentTotalPower }, | ||||
|             // { name: '标准组件总功率完成值', value: 23 }, | ||||
|             // { name: "%", value: 7.02 }, | ||||
|             // { name: "%", value: 80.2 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [0, -16], | ||||
|             color: "rgba(40,138,255)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }, { | ||||
|           name: "标准组件总功率目标值", | ||||
|           stack: 'b', | ||||
|           data: [ | ||||
|             { name: "标准组件总功率目标值", value: (targetObj.componentTotalPower - obj.componentTotalPower) > 0 ? (targetObj.componentTotalPower - obj.componentTotalPower) : null, titleValue: targetObj.componentTotalPower }, | ||||
|             // { name: '标准组件总功率目标值', value: 23 }, | ||||
|  | ||||
|             // { name: "%", value: 7.02 }, | ||||
|             // { name: "%", value: 80.2 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [0, -16], | ||||
|             color: "rgba(40,138,255,.5)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }) | ||||
|         console.log('arr', chip,std) | ||||
|         this.chartMsgTarget.series = [...chip, ...std] | ||||
|         // arr.forEach((ele) => { | ||||
|  | ||||
|         // }) | ||||
|         res.data.list.slice(res.data.list.length - 1, res.data.list.length).forEach((ele, index) => { | ||||
|           // let i = index + 1 | ||||
|           this.chartMsgYearTarget.xData.push(ele.titleValue) | ||||
|           this.title = ele.titleValue | ||||
|           ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|             this.chartMsgYearTarget.series[0].data.push({ | ||||
|               name: ele.titleValue, | ||||
|               value: item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|             }) | ||||
|             this.chartMsgYearTarget.series[1].data.push({ | ||||
|               name: ele.titleValue, | ||||
|               value: item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             }) | ||||
|           }) | ||||
|         }) | ||||
|         // }) | ||||
|       } else if (this.listQuery.type === 1 || this.listQuery.type === 0) { | ||||
|         if (res.data.list.length === 2) { | ||||
|           this.gridLeft = false | ||||
|         } else { | ||||
|           this.gridLeft = true | ||||
|         } | ||||
|         // res.data.list.forEach((ele) => { | ||||
|         res.data.list.slice(0, res.data.list.length - 2).forEach((ele, index) => { | ||||
|           // let i = index + 1 | ||||
|           this.chartMsg.xData.push(ele.titleValue.slice(0, ele.titleValue.length - 3)) | ||||
|           ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|             this.chartMsg.series[0].data.push({ | ||||
|               name: ele.titleValue, | ||||
|               value: item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|             }) | ||||
|             this.chartMsg.series[1].data.push({ | ||||
|               name: ele.titleValue, | ||||
|               value: item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             }) | ||||
|           }) | ||||
|         }) | ||||
|         this.chartMsgTarget.xData.push(res.data.list[res.data.list.length - 1].titleValue) | ||||
|         // this.chartMsgTarget.series = [{ | ||||
|         //   name: "FTO投入", | ||||
|         //   data: [ | ||||
|         //     // s | ||||
|         //     { name: "FTO投入目标", value:res,data,list }, | ||||
|         //     { name: "%", value: 85 }, | ||||
|         //     { name: "%", value: 85 }, | ||||
|         //   ], | ||||
|         //   type: "bar", | ||||
|         //   barWidth: 20, | ||||
|         //   barGap: '0', | ||||
|         //   label: { | ||||
|         //     show: true, | ||||
|         //     position: [-18, -16], | ||||
|         //     color: "#FFAE17", | ||||
|         //     formatter: function (params) { | ||||
|         //       return params.value | ||||
|         //     }, | ||||
|         //   }, | ||||
|         // },] | ||||
|         let arr = [] | ||||
|         let chip = [] | ||||
|         let std = [] | ||||
|         let obj = {} | ||||
|         let targetObj = {} | ||||
|         res.data.list.slice(res.data.list.length - 2, res.data.list.length).forEach((ele, index) => { | ||||
|           console.log(ele.titleValue.search('目标')); | ||||
|           // let i = index + 1 | ||||
|           // this.chartMsgTarget.xData.push(ele.titleValue) | ||||
|           ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|             if (ele.titleValue.search('目标') != -1) { | ||||
|               targetObj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|               targetObj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             } else { | ||||
|               obj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower | ||||
|               obj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower | ||||
|             } | ||||
|  | ||||
|             // this.chartMsgTarget.series[1].data.push() | ||||
|             // this.chartMsgTarget.series[2].data.push() | ||||
|             // this.chartMsgTarget.series[3].data.push() | ||||
|           }) | ||||
|         }) | ||||
|         chip.push({ | ||||
|           name: "芯片总功率完成值", | ||||
|           // barGap: '-100%', | ||||
|           stack: 'a', | ||||
|           data: [ | ||||
|             { name: "芯片总功率完成值", value: obj.chipTotalPower, titleValue: obj.chipTotalPower }, | ||||
|             // { name: '芯片总功率完成值', value: 55 }, | ||||
|             // { name: "%", value: 21.66 }, | ||||
|             // { name: "%", value: 18.4 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           // barGap: '-100%', | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [-18, -16], | ||||
|             color: "rgba(104,196,131)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }, { | ||||
|           name: "芯片总功率目标值", | ||||
|           // barGap: '-100%', | ||||
|           stack: 'a', | ||||
|           data: [ | ||||
|             { name: "芯片总功率目标值", value: (targetObj.chipTotalPower - obj.chipTotalPower) > 0 ? (targetObj.chipTotalPower - obj.chipTotalPower) : null, titleValue: targetObj.chipTotalPower }, | ||||
|             // { name: '芯片总功率目标值', value: 22 }, | ||||
|             // { name: "%", value: 21.66 }, | ||||
|             // { name: "%", value: 18.4 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           // barGap: '-100%', | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [-18, -16], | ||||
|             color: "rgba(104,196,131,.5)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }) | ||||
|         std.push({ | ||||
|           name: "标准组件总功率完成值", | ||||
|           stack: 'b', | ||||
|           data: [ | ||||
|             { name: "标准组件总功率完成值", value: obj.componentTotalPower, titleValue: obj.componentTotalPower }, | ||||
|             // { name: '标准组件总功率完成值', value: 23 }, | ||||
|             // { name: "%", value: 7.02 }, | ||||
|             // { name: "%", value: 80.2 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [0, -16], | ||||
|             color: "rgba(40,138,255)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }, { | ||||
|           name: "标准组件总功率目标值", | ||||
|           stack: 'b', | ||||
|           data: [ | ||||
|             { name: "标准组件总功率目标值", value: (targetObj.componentTotalPower - obj.componentTotalPower) > 0 ? (targetObj.componentTotalPower - obj.componentTotalPower) : null, titleValue: targetObj.componentTotalPower }, | ||||
|             // { name: '标准组件总功率目标值', value: 23 }, | ||||
|  | ||||
|             // { name: "%", value: 7.02 }, | ||||
|             // { name: "%", value: 80.2 }, | ||||
|           ], | ||||
|           type: "bar", | ||||
|           barWidth: 20, | ||||
|           label: { | ||||
|             show: true, | ||||
|             position: [0, -16], | ||||
|             color: "rgba(40,138,255,.5)", | ||||
|             formatter: function (params) { | ||||
|               return params.value | ||||
|             }, | ||||
|           }, | ||||
|         }) | ||||
|         console.log('arr', chip, std) | ||||
|         this.chartMsgTarget.series = [...chip, ...std] | ||||
|       } else { | ||||
|         res.data.list.forEach((ele, index) => { | ||||
|           this.chartMsg.xData.push(ele.titleValue) | ||||
|         }) | ||||
|         for (let i in this.dataArr[0]) { | ||||
|           console.log(this.dataArr[0]['item']); | ||||
|           this.chartMsg.series[0].name = this.dataArr[0]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[0].data.push({ | ||||
|               name: this.dataArr[0]['item'], | ||||
|               value: this.dataArr[0][i] === 0 ? null : this.dataArr[0][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in this.dataArr[1]) { | ||||
|           this.chartMsg.series[1].name = this.dataArr[1]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[1].data.push({ | ||||
|               name: this.dataArr[1]['item'], | ||||
|               value: this.dataArr[1][i] === 0 ? null : this.dataArr[1][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|       this.tableData = res.data.length != 0 ? this.dataArr : [] | ||||
|       this.showTable = !this.showTable | ||||
|       // this.tableProps = otherProps | ||||
|       // res.data.list.forEach((ele) => { | ||||
|       //   console.log(ele); | ||||
|       //   ele.productionSituationPowerDataVOList.forEach((item) => { | ||||
|       //     let obj = { | ||||
|       //       bipvProductOutput: item.bipvProductOutput, | ||||
|       //       componentTotalPower: item.componentTotalPower, | ||||
|       //       componentYield: item.componentYield, | ||||
|       //       factory: item.factory, | ||||
|       //       chipTotalPower: item.chipTotalPower, | ||||
|       //       titleValue:ele.titleValue | ||||
|       //     } | ||||
|       //     dataArr.push(obj) | ||||
|       //   }) | ||||
|       // }) | ||||
|       // console.log(dataArr) | ||||
|       // this.tableProps.push() | ||||
|       // this.listQuery.total = res.data.total | ||||
|       // if (this.listQuery.total > 0) { | ||||
|       //   this.tableData.forEach(item => { | ||||
|       //     item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--' | ||||
|       //     item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--' | ||||
|       //   }) | ||||
|       // } | ||||
|     }, | ||||
|     _setTableHeight() { | ||||
|       this.tableH = this.tableHeight(137) / 2 - 70; | ||||
|       this.chartHeight = this.tableHeight(137) / 2 - 111; | ||||
|       if (this.$route.name === "componentTotalPowerBM") { | ||||
|         this.chartNum++; | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       let fileName = "生产情况(MW).xls"; | ||||
|       exportProductionSituationMWData(this.listQuery) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => { }); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| .search { | ||||
|   // height: calc((100px)); | ||||
|   background-color: #fff; | ||||
|   border-radius: 8px; | ||||
|   padding: 16px 16px 0 16px; | ||||
|   margin: 8px 0px; | ||||
| } | ||||
|  | ||||
| .containerTop { | ||||
|   height: calc((100vh - 170px)); | ||||
|   background-color: #fff; | ||||
|   border-radius: 8px; | ||||
|   padding: 16px; | ||||
| } | ||||
|  | ||||
| .blueTip::before { | ||||
|   display: inline-block; | ||||
|   content: ''; | ||||
|   width: 4px; | ||||
|   height: 18px; | ||||
|   background: #0B58FF; | ||||
|   border-radius: 1px; | ||||
|   margin-right: 8PX; | ||||
|   margin-top: 8px; | ||||
| } | ||||
|  | ||||
| .containerTop { | ||||
|   margin-top: 8px; | ||||
|  | ||||
|   .smallTitle { | ||||
|     font-size: 16px; | ||||
|     color: #000; | ||||
|     margin-bottom: 15px; | ||||
|   } | ||||
|  | ||||
|   .smallTitle::before { | ||||
|     display: inline-block; | ||||
|     width: 4px; | ||||
|     height: 16px; | ||||
|     background: #0b58ff; | ||||
|     content: ""; | ||||
|     margin-right: 8px; | ||||
|     vertical-align: -3px; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										1351
									
								
								src/views/report/productionSituationTablets.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1351
									
								
								src/views/report/productionSituationTablets.vue
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										837
									
								
								src/views/report/productionYield.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										837
									
								
								src/views/report/productionYield.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,837 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- <div class="search"> --> | ||||
|     <ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event"> | ||||
|     </ButtonNav> | ||||
|     <!-- </div> --> | ||||
|     <div class="search"> | ||||
|       <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> | ||||
|         <el-form-item label="时间维度" prop="type"> | ||||
|           <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择"> | ||||
|             <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至" | ||||
|             start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime" | ||||
|             end-placeholder="结束日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" | ||||
|             placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> | ||||
|           </el-date-picker> | ||||
|           至 | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周" | ||||
|             placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> | ||||
|           </el-date-picker> | ||||
|           <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px"> | ||||
|             {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周 | ||||
|           </span> --> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" | ||||
|             value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" | ||||
|             @change="changeTime"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime"> | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="开始时间"> | ||||
|           </el-date-picker> | ||||
|           ~ | ||||
|           <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" | ||||
|             placeholder="结束时间" @change="getYear"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|         <el-form-item> | ||||
|           <el-button type="primary" size="small" @click="getDataList">查询</el-button> | ||||
|           <el-button type="primary" size="small" plain @click="handleExport">导出</el-button> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|     </div> | ||||
|     <div class="containerTop"> | ||||
|       <el-row v-if="listQuery.type === 2"> | ||||
|         <el-col :span="16"> | ||||
|           <div class="blueTip"> | ||||
|             产量及良率对比 | ||||
|           </div> | ||||
|           <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId" | ||||
|             :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|         <el-col :span="8"> | ||||
|           <div class="blueTip"> | ||||
|             {{ title }} | ||||
|           </div> | ||||
|           <produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendListTarget" | ||||
|             :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" /> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <el-row v-else> | ||||
|         <!-- <el-col :span="24"> --> | ||||
|         <div class="blueTip"> | ||||
|           产量及良率对比 | ||||
|         </div> | ||||
|         <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId" | ||||
|           :chartNum="chartNum" /> | ||||
|         <!-- </el-col> --> | ||||
|         <!-- <el-col :span="8"> | ||||
|           <div class="blueTip"> | ||||
|             {{ title }} | ||||
|           </div> | ||||
|           <produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList" | ||||
|             :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" /> | ||||
|         </el-col> --> | ||||
|       </el-row> | ||||
|       <base-table :key="showTable" :table-props="tableProps" :page="listQuery.current" | ||||
|         :limit="listQuery.size" :table-data="tableData" :max-height="tableH" /> | ||||
|     </div> | ||||
|     <!-- <div class="containerBottom"> | ||||
|  | ||||
|     </div> --> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import { getProductionYieldSituationMWData, exportProductionYieldSituationMWData } from '@/api/report'; | ||||
| import bmSearchBar from "./components/bmSearchBar"; | ||||
| import BmLineBar from "./components/produceLineBar.vue"; | ||||
| import produceLineBarYearTarget from "./components/produceLineYieldBarTarget.vue"; | ||||
| import ButtonNav from '@/components/ButtonNav' | ||||
| import moment from 'moment' | ||||
| export default { | ||||
|   name: "ChipYieldBM", | ||||
|   data() { | ||||
|     return { | ||||
|       otherProps: [], | ||||
|       start: undefined, | ||||
|       end: undefined, | ||||
|       title: '', | ||||
|       showTable:false, | ||||
|       listQuery: { | ||||
|         pageNo: 1, | ||||
|         pageSize: 999, | ||||
|         // size: 10, | ||||
|         // current: 1, | ||||
|         factory: null, | ||||
|         start: undefined, | ||||
|         end: undefined, | ||||
|         // total: 0, | ||||
|         type: 2, | ||||
|         startDate: undefined, | ||||
|         endDate: undefined, | ||||
|         reportTime: [] | ||||
|       }, | ||||
|       timeList: [ | ||||
|         { | ||||
|           value: 0, | ||||
|           label: '日' | ||||
|         }, | ||||
|         { | ||||
|           value: 1, | ||||
|           label: '周' | ||||
|         }, | ||||
|         { | ||||
|           value: 2, | ||||
|           label: '月' | ||||
|         }, | ||||
|         { | ||||
|           value: 3, | ||||
|           label: '年' | ||||
|         } | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(137) / 2 - 111, | ||||
|       tableH: this.tableHeight(137) / 2 - 70, | ||||
|       legendList: [ | ||||
|         { | ||||
|           id: 1, name: "综合良率", type: 2, color: "#FFCE6A" }, | ||||
|         { | ||||
|           id: 2, name: "FTO投入", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "芯片产量", type: 1, color: "#288AFF" }, | ||||
|         { | ||||
|           id: 4, name: "标准组件产量", type: 1, color: "#64BDFF" }, | ||||
|       ], | ||||
|       legendListTarget: [ | ||||
|         { | ||||
|           id: 2, name: "FTO投入", type: 1, color: "#8EF0AB" | ||||
|         }, | ||||
|         { id: 3, name: "芯片产量", type: 1, color: "#288AFF" }, | ||||
|         { | ||||
|           id: 4, name: "标准组件产量", type: 1, color: "#64BDFF" | ||||
|         }, | ||||
|         { | ||||
|           id: 1, name: "综合良率", type: 1, color: "#7164FF" | ||||
|         }, | ||||
|       ], | ||||
|       chartMsgYearTarget: { | ||||
|         color: ["#8EF0AB", "#288AFF", '#64BDFF', "#7164FF",], | ||||
|         xData: [], | ||||
|         // yName: "单位/%", | ||||
|         yAxis: [ | ||||
|           { | ||||
|             type: "value", | ||||
|             name: "单位/片", | ||||
|             splitNumber: 4, | ||||
|             // min: function (value) {//取最小值向下取整为最小刻度 | ||||
|             //   return Math.floor(value.min) | ||||
|             // }, | ||||
|             // max: function (value) {//取最大值向上取整为最大刻度 | ||||
|             //   return Math.ceil(value.max) | ||||
|             // }, | ||||
|             alignTicks: true, | ||||
|             nameTextStyle: { | ||||
|               fontSize: 12, | ||||
|               align: "right", | ||||
|             }, | ||||
|             axisLabel: {}, | ||||
|           }, | ||||
|           { | ||||
|             type: 'value', | ||||
|             // inverse: true, | ||||
|             alignTicks: true, | ||||
|             // min: 0, | ||||
|             // max: 100, | ||||
|             // scale: true, | ||||
|             // interval: 25,//间隔 | ||||
|             splitNumber: 4, | ||||
|             name: "单位/%", | ||||
|             nameTextStyle: { | ||||
|               fontSize: 12, | ||||
|               align: "right", | ||||
|             }, | ||||
|             axisLabel: {}, | ||||
|           } | ||||
|         ], | ||||
|         series: [ | ||||
|           { | ||||
|             name: "", | ||||
|             // yAxisIndex: 0, | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: '', | ||||
|             // type: 'bar', | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|             yAxisIndex: 1 | ||||
|           } | ||||
|         ], | ||||
|       }, | ||||
|       chartMsg: { | ||||
|         color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",], | ||||
|         xData: [], | ||||
|         // yName: "单位/%", | ||||
|         yAxis: [ | ||||
|           { | ||||
|             type: "value", | ||||
|             name: "单位/片", | ||||
|             // min: function (value) {//取最小值向下取整为最小刻度 | ||||
|             //   return Math.floor(value.min) | ||||
|             // }, | ||||
|             // max: function (value) {//取最大值向上取整为最大刻度 | ||||
|             //   return Math.ceil(value.max) | ||||
|             // }, | ||||
|             alignTicks:true, | ||||
|             // splitNumber: 4, | ||||
|             // scale: true, | ||||
|             nameTextStyle: { | ||||
|               fontSize: 12, | ||||
|               align: "right", | ||||
|             }, | ||||
|             axisLabel: {}, | ||||
|           }, | ||||
|           { | ||||
|             type: 'value', | ||||
|             // inverse: true, | ||||
|             name: "单位/%", | ||||
|             alignTicks: true, | ||||
|             // min: 0, | ||||
|             // max:100, | ||||
|             // scale: true, | ||||
|             // interval: 25,//间隔 | ||||
|             splitNumber: 4, | ||||
|             nameTextStyle: { | ||||
|               fontSize: 12, | ||||
|               align: "right", | ||||
|             }, | ||||
|             axisLabel: {}, | ||||
|           } | ||||
|         ], | ||||
|         series: [ | ||||
|           { | ||||
|             name: "", | ||||
|             // yAxisIndex: 0, | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             yAxisIndex: 0, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "", | ||||
|             // yAxisIndex: 0, | ||||
|             data: [], | ||||
|             yAxisIndex: 0, | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|             { | ||||
|               name: "", | ||||
|               // yAxisIndex: 0, | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             yAxisIndex: 0, | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#64BDFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             // barWidth: 20, | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             yAxisIndex: 1, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }, | ||||
|       chartId: "chipYieldBMChart", | ||||
|       chartNum: 1, | ||||
|     }; | ||||
|   }, | ||||
|   components: { | ||||
|     bmSearchBar, | ||||
|     BmLineBar, | ||||
|     produceLineBarYearTarget, | ||||
|     ButtonNav | ||||
|   }, | ||||
|   computed: { | ||||
|     tableProps() { | ||||
|       return [ | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           // filter: (val) => factoryList[val], | ||||
|           minWidth: 200, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         ...this.otherProps | ||||
|       ] | ||||
|     }, | ||||
|     weekNum() { | ||||
|       return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1 | ||||
|     }, | ||||
|     isOpen() { | ||||
|       return this.$store.getters.sidebar.opened; | ||||
|     }, | ||||
|     type() { | ||||
|       return this.listQuery.type | ||||
|     } | ||||
|   }, | ||||
|   watch: { | ||||
|     // 监听左侧菜单栏是否展开 | ||||
|     type(val) { | ||||
|  | ||||
|     }, | ||||
|     currentMenu() { | ||||
|       this.getDataList() | ||||
|     }, | ||||
|     isOpen(val) { | ||||
|       if (this.$route.name === "productionYield") { | ||||
|         this.chartNum++; | ||||
|       } | ||||
|     }, | ||||
|   }, | ||||
|   created() { | ||||
|     this.tableH = this.tableHeight(137) / 2 - 70; | ||||
|     this.chartHeight = this.tableHeight(137) / 2 - 111; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   activated() { | ||||
|     // 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新 | ||||
|     if (this.$route.name === "productionYield") { | ||||
|       this.chartNum++; | ||||
|     } | ||||
|   }, | ||||
|   mounted() { | ||||
|     // this.getOverView() | ||||
|     const today = new Date() | ||||
|     const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) | ||||
|     this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD') | ||||
|     this.listQuery.endDate = moment(today).format('yyyy-MM-DD') | ||||
|     this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate] | ||||
|     this.getDataList() | ||||
|   }, | ||||
|   methods: { | ||||
|     objectSpanMethod({ row, column, rowIndex, columnIndex }) { | ||||
|       let spanOneArr = [], concatOne = 0; | ||||
|       // let spanTwoArr = [], concatTwo = 0; | ||||
|  | ||||
|       this.tableData.map((item, index) => { | ||||
|         // console.log(inde); | ||||
|         if (index === 0) { | ||||
|           spanOneArr.push(1); | ||||
|         } else { | ||||
|           //第一列需合并相同内容的判断条件 | ||||
|           if (item.factory === this.tableData[index - 1].factory) { | ||||
|             spanOneArr[concatOne] += 1; | ||||
|             spanOneArr.push(0); | ||||
|           } else { | ||||
|             spanOneArr.push(1); | ||||
|             concatOne = index; | ||||
|           }; | ||||
|         } | ||||
|       }); | ||||
|  | ||||
|       if (columnIndex === 0) { | ||||
|         const _row = spanOneArr[rowIndex]; | ||||
|         const _col = _row > 0 ? 1 : 0; | ||||
|         return { | ||||
|           rowspan: _row, | ||||
|           colspan: _col | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     getYear(e) { | ||||
|       if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) { | ||||
|         this.$message({ | ||||
|           message: '年份起止时间不能超过十年', | ||||
|           type: 'warning' | ||||
|         }); | ||||
|         this.listQuery.reportTime = [] | ||||
|         this.listQuery.start = undefined | ||||
|         this.listQuery.end = undefined | ||||
|         // console.log(); | ||||
|       } else { | ||||
|         this.listQuery.startDate = this.listQuery.start | ||||
|         this.listQuery.endDate = this.listQuery.end | ||||
|       } | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|       // console.log(e); | ||||
|     }, | ||||
|     onValueChange(picker, k) { // 选中近k周后触发的操作 | ||||
|       // console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1]) | ||||
|       if (this.listQuery.start && this.listQuery.end) { | ||||
|         console.log(this.listQuery.reportTime) | ||||
|         this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') | ||||
|         const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000); | ||||
|         if (numDays > 168) { | ||||
|           console.log(numDays) | ||||
|           this.$message({ | ||||
|             message: '周范围不能超过24周', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|         } else { | ||||
|           this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|           this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') | ||||
|         } | ||||
|       } | ||||
|       if (!this.listQuery.start && !this.listQuery.end) { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeDayTime() { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         // this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss'); | ||||
|         // this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss'); | ||||
|         console.log(this.listQuery.reportTime[1]) | ||||
|         const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000); | ||||
|         if (numDays > 30) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过30天', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     changeTime(value) { | ||||
|       if (this.listQuery.reportTime) { | ||||
|         const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0]; | ||||
|         if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) { | ||||
|           this.$message({ | ||||
|             message: '时间范围不能超过24个月', | ||||
|             type: 'warning' | ||||
|           }); | ||||
|           this.listQuery.reportTime = []; | ||||
|         } else { | ||||
|           this.listQuery.startDate = this.listQuery.reportTime[0] | ||||
|           this.listQuery.endDate = this.listQuery.reportTime[1] | ||||
|         } | ||||
|       } else { | ||||
|         this.listQuery.startDate = undefined | ||||
|         this.listQuery.endDate = undefined | ||||
|       } | ||||
|     }, | ||||
|     async getDataList() { | ||||
|       this.otherProps = [] | ||||
|       this.chartMsg.xData = [] | ||||
|       this.chartMsg.series[0].data = [] | ||||
|       this.chartMsg.series[1].data = [] | ||||
|       this.chartMsg.series[2].data = [] | ||||
|       this.chartMsg.series[3].data = [] | ||||
|       this.chartMsgYearTarget.xData = [] | ||||
|       this.chartMsgYearTarget.series[0].data = [] | ||||
|       this.chartMsgYearTarget.series[1].data = [] | ||||
|       if (!this.listQuery.startDate && !this.listQuery.endDate) { | ||||
|         return this.$message('请选择起止时间') | ||||
|       } | ||||
|       let arr = [] | ||||
|       this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) | ||||
|       this.listQuery.factory = arr | ||||
|       const res = await getProductionYieldSituationMWData(this.listQuery) | ||||
|        let dataArr = [{ | ||||
|           factory: null, | ||||
|           item: 'FTO投入', | ||||
|           unit: '片' | ||||
|         }, | ||||
|         { | ||||
|           factory: null, | ||||
|           item: '芯片产量', | ||||
|           unit: '片' | ||||
|         }, | ||||
|         { | ||||
|           factory: null, | ||||
|           item: '标准组件产量', | ||||
|           unit: '片' | ||||
|         }, | ||||
|         { | ||||
|           factory: null, | ||||
|           item: '综合良率', | ||||
|           unit: '%' | ||||
|         },] | ||||
|       if (this.listQuery.type == 2) { | ||||
|         res.data.list.forEach((ele, index) => { | ||||
|           let i = index + 1 | ||||
|           this.chartMsg.xData.push(ele.titleValue) | ||||
|           this.otherProps.push({ | ||||
|             label: ele.titleValue, | ||||
|             prop: 'value' + i | ||||
|           }) | ||||
|         }) | ||||
|         this.chartMsgYearTarget.xData.push('FTO投入', '芯片产量', '标准组件产量', '综合良率') | ||||
|         res.data.list.slice(res.data.list.length - 1, res.data.list.length).forEach((ele) => { | ||||
|           this.title = ele.titleValue | ||||
|           ele.productYieldDataVOList.forEach((item) => { | ||||
|             // this.chartMsgYearTarget.series[0].name = 'FTO投入目标值', | ||||
|               // this.chartMsgYearTarget.series[1].name = '芯片产量目标值', | ||||
|               // this.chartMsgYearTarget.series[2].name = '标准组件产量目标值', | ||||
|               // this.chartMsgYearTarget.series[3].name = '综合良率目标值', | ||||
|             this.chartMsgYearTarget.series[0].data = [ | ||||
|               { | ||||
|                 value: item.ftoInput, | ||||
|                 itemStyle: { | ||||
|                   color: '#8EF0AB' | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 value: item.chipYield, | ||||
|                 itemStyle: { | ||||
|                   color: '#288AFF' | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 value: item.componentYield, | ||||
|                 itemStyle: { | ||||
|                   color: '#64BDFF' | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 value: null, | ||||
|                 itemStyle: { | ||||
|                   color: '#FFCE6A' | ||||
|                 } | ||||
|               }] | ||||
|             this.chartMsgYearTarget.series[1].data = [ | ||||
|               { | ||||
|                 value: null, | ||||
|                 itemStyle: { | ||||
|                   color: '#8EF0AB' | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 value: null, | ||||
|                 itemStyle: { | ||||
|                   color: '#288AFF' | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 value: null, | ||||
|                 itemStyle: { | ||||
|                   color: '#64BDFF' | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 value: item.ftoInput, | ||||
|                 itemStyle: { | ||||
|                   color: '#FFCE6A' | ||||
|                 } | ||||
|               }] | ||||
|             // dataArr[0]['' + m + ''] = item.ftoInput | ||||
|             // dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             // dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             // dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             // dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             // dataArr[1]['' + m + ''] = item.chipYield | ||||
|             // dataArr[2]['' + m + ''] = item.componentYield | ||||
|             // dataArr[3]['' + m + ''] = item.comprehensiveYieldRate | ||||
|           }) | ||||
|         }) | ||||
|         console.log(this.otherProps) | ||||
|         res.data.list.forEach((ele, index) => { | ||||
|           let i = index + 1 | ||||
|           let m = 'value' + i | ||||
|           ele.productYieldDataVOList.forEach((item) => { | ||||
|             dataArr[0]['' + m + ''] = item.ftoInput | ||||
|             dataArr[1]['' + m + ''] = item.chipYield | ||||
|             dataArr[2]['' + m + ''] = item.componentYield | ||||
|             dataArr[3]['' + m + ''] = item.comprehensiveYieldRate | ||||
|           }) | ||||
|         }) | ||||
|         for (let i in dataArr[0]) { | ||||
|           this.chartMsg.series[0].name = dataArr[0]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[0].data.push({ | ||||
|               name: dataArr[0]['item'], | ||||
|               value: dataArr[0][i] === 0 ? null : dataArr[0][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in dataArr[1]) { | ||||
|           this.chartMsg.series[1].name = dataArr[1]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[1].data.push({ | ||||
|               name: dataArr[1]['item'], | ||||
|               value: dataArr[1][i] === 0 ? null : dataArr[1][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in dataArr[2]) { | ||||
|           this.chartMsg.series[2].name = dataArr[2]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[2].data.push({ | ||||
|               name: dataArr[2]['item'], | ||||
|               value: dataArr[2][i] === 0 ? null : dataArr[2][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in dataArr[3]) { | ||||
|           this.chartMsg.series[3].name = dataArr[3]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[3].data.push({ | ||||
|               name: dataArr[3]['item'], | ||||
|               value: dataArr[3][i] === 0 ? null : dataArr[3][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|       } else { | ||||
|         res.data.list.forEach((ele, index) => { | ||||
|           let i = index + 1 | ||||
|           this.chartMsg.xData.push(ele.titleValue) | ||||
|           this.otherProps.push({ | ||||
|             label: ele.titleValue, | ||||
|             prop: 'value' + i | ||||
|           }) | ||||
|         }) | ||||
|         console.log(this.otherProps) | ||||
|         res.data.list.forEach((ele, index) => { | ||||
|           let i = index + 1 | ||||
|           let m = 'value' + i | ||||
|           ele.productYieldDataVOList.forEach((item) => { | ||||
|             dataArr[0]['' + m + ''] = item.ftoInput | ||||
|             dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌' | ||||
|             dataArr[1]['' + m + ''] = item.chipYield | ||||
|             dataArr[2]['' + m + ''] = item.componentYield | ||||
|             dataArr[3]['' + m + ''] = item.comprehensiveYieldRate | ||||
|           }) | ||||
|         }) | ||||
|         for (let i in dataArr[0]) { | ||||
|           this.chartMsg.series[0].name = dataArr[0]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[0].data.push({ | ||||
|               name: dataArr[0]['item'], | ||||
|               value: dataArr[0][i] === 0 ? null : dataArr[0][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in dataArr[1]) { | ||||
|           this.chartMsg.series[1].name = dataArr[1]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[1].data.push({ | ||||
|               name: dataArr[1]['item'], | ||||
|               value: dataArr[1][i] === 0 ? null : dataArr[1][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in dataArr[2]) { | ||||
|           this.chartMsg.series[2].name = dataArr[2]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[2].data.push({ | ||||
|               name: dataArr[2]['item'], | ||||
|               value: dataArr[2][i] === 0 ? null : dataArr[2][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         for (let i in dataArr[3]) { | ||||
|           this.chartMsg.series[3].name = dataArr[3]['item'] | ||||
|           if (i.search('value') === 0) { | ||||
|             this.chartMsg.series[3].data.push({ | ||||
|               name: dataArr[3]['item'], | ||||
|               value: dataArr[3][i] === 0 ? null : dataArr[3][i] | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       console.log(dataArr) | ||||
|       this.tableData = res.data.length != 0 ? dataArr : [] | ||||
|       this.showTable = !this.showTable | ||||
|       // this.tableProps.push() | ||||
|     }, | ||||
|     _setTableHeight() { | ||||
|       this.tableH = this.tableHeight(137) / 2 - 70; | ||||
|       this.chartHeight = this.tableHeight(137) / 2 - 111; | ||||
|       if (this.$route.name === "productionYield") { | ||||
|         this.chartNum++; | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       // this.listQuery.type = val.type; | ||||
|       // this.listQuery.startDate = val.startDate; | ||||
|       // this.listQuery.factory = val.factory; | ||||
|       let fileName = "产品良率.xls"; | ||||
|       exportProductionYieldSituationMWData(this.listQuery) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => { }); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| .search { | ||||
|   // height: calc((100px)); | ||||
|   background-color: #fff; | ||||
|   border-radius: 8px; | ||||
|   padding: 16px 16px 0 16px; | ||||
|   margin:8px 0 8px 0px; | ||||
| } | ||||
|  | ||||
| .containerTop { | ||||
|   height: calc((100vh - 170px)); | ||||
|   background-color: #fff; | ||||
|   border-radius: 8px; | ||||
|   padding: 16px; | ||||
| } | ||||
|  | ||||
| .blueTip::before { | ||||
|   display: inline-block; | ||||
|   content: ''; | ||||
|   width: 4px; | ||||
|   height: 18px; | ||||
|   background: #0B58FF; | ||||
|   border-radius: 1px; | ||||
|   margin-right: 8PX; | ||||
|   margin-top: 8px; | ||||
| } | ||||
|  | ||||
| .containerTop { | ||||
|   margin-top: 8px; | ||||
|  | ||||
|   .smallTitle { | ||||
|     font-size: 16px; | ||||
|     color: #000; | ||||
|     margin-bottom: 15px; | ||||
|   } | ||||
|  | ||||
|   .smallTitle::before { | ||||
|     display: inline-block; | ||||
|     width: 4px; | ||||
|     height: 16px; | ||||
|     background: #0b58ff; | ||||
|     content: ""; | ||||
|     margin-right: 8px; | ||||
|     vertical-align: -3px; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月标准组件产量</div> | ||||
|       <div class="smallTitle">标准组件产量</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,101 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   sCPReportByDateRangePage, | ||||
|   sCPReportByDateRangeExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "SCOutputBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             // data: [3000, 2000, 3000], | ||||
|             // data: [6800, 5000, 8900], | ||||
|             // data: [12000, 17000, 19000], | ||||
|             data: [560000, 540000, 600000], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -130,28 +90,22 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             // data: [2100, 800, 1500], | ||||
|             // data: [9500, 7200, 9901], | ||||
|             // data: [14666, 15000, 17888], | ||||
|             data: [550000, 456666, 590000], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               // position: [-10, -16], | ||||
|               position: [-17, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             // data: [2100, 900, 1300], | ||||
|             // data: [9100, 7300, 9700], | ||||
|             // data: [14666, 15300, 18000], | ||||
|             data: [556666, 456666, 650000], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -188,6 +142,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.date = 2; | ||||
|     this.listQuery.queryTime = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factorys = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -206,11 +167,159 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.date = val.type; | ||||
|       this.listQuery.queryTime = val.startDate; | ||||
|       this.listQuery.factorys = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       sCPReportByDateRangePage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.length > 0) { | ||||
|           // 设置表头 | ||||
|           let msg = res.data[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "lastone", | ||||
|               label: msg.lastone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "currentone", | ||||
|               label: msg.currentone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "targetone", | ||||
|               label: msg.targetone.reportTime, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           // 整理表格数据 | ||||
|           let tableArr = []; | ||||
|           res.data.forEach((item) => { | ||||
|             let obj = {}; | ||||
|             obj.factory = item.factory; | ||||
|             obj.item = "标准组件产量"; | ||||
|             obj.unit = "片"; | ||||
|             obj.lastone = item.lastone.total; | ||||
|             obj.currentone = item.currentone.total; | ||||
|             obj.targetone = item.targetone.total; | ||||
|             tableArr.push(obj); | ||||
|           }); | ||||
|           this.tableData = tableArr; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetone.reportTime; | ||||
|           this.legendList[1].name = msg.lastone.reportTime; | ||||
|           this.legendList[2].name = msg.currentone.reportTime; | ||||
|           this.chartMsg.series[0].name = msg.targetone.reportTime; | ||||
|           this.chartMsg.series[1].name = msg.lastone.reportTime; | ||||
|           this.chartMsg.series[2].name = msg.currentone.reportTime; | ||||
|           // 设置偏移量 | ||||
|           switch (this.listQuery.type) { | ||||
|             case 0: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 1: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 2: | ||||
|               this.chartMsg.series[1].label.position = [-10, -16]; | ||||
|               break; | ||||
|             default: | ||||
|               this.chartMsg.series[1].label.position = [-17, -16]; | ||||
|           } | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push(val[i].targetone.total || 0); | ||||
|         barData1.push(val[i].lastone.total || 0); | ||||
|         barData2.push(val[i].currentone.total || 0); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "标准组件产量.xls"; | ||||
|       sCPReportByDateRangeExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月组件人均产量</div> | ||||
|       <div class="smallTitle">组件人均产量</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,101 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   componentAapPage, | ||||
|   componentAapExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "SCPerCapitaBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         yName: "单位/片", | ||||
|         xData: [], | ||||
|         yName: "单位:片/人", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             // data: [3000, 2000, 3000], | ||||
|             // data: [6800, 5000, 8900], | ||||
|             // data: [12000, 17000, 19000], | ||||
|             data: [560000, 540000, 600000], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -130,28 +90,22 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             // data: [2100, 800, 1500], | ||||
|             // data: [9500, 7200, 9901], | ||||
|             // data: [14666, 15000, 17888], | ||||
|             data: [550000, 456666, 590000], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               // position: [-10, -16], | ||||
|               position: [-17, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             // data: [2100, 900, 1300], | ||||
|             // data: [9100, 7300, 9700], | ||||
|             // data: [14666, 15300, 18000], | ||||
|             data: [556666, 456666, 650000], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -188,6 +142,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factory = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -206,11 +167,146 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       componentAapPage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetColumn; | ||||
|           this.legendList[1].name = msg.yoyColumn; | ||||
|           this.legendList[2].name = msg.queryColumn; | ||||
|           this.chartMsg.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg.series[1].name = msg.yoyColumn; | ||||
|           this.chartMsg.series[2].name = msg.queryColumn; | ||||
|           // 设置偏移量 | ||||
|           switch (this.listQuery.type) { | ||||
|             case 0: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 1: | ||||
|               this.chartMsg.series[1].label.position = [-5, -16]; | ||||
|               break; | ||||
|             case 2: | ||||
|               this.chartMsg.series[1].label.position = [-10, -16]; | ||||
|               break; | ||||
|             default: | ||||
|               this.chartMsg.series[1].label.position = [-17, -16]; | ||||
|           } | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push(val[i].target || 0); | ||||
|         barData1.push(val[i].yoy || 0); | ||||
|         barData2.push(val[i].queryValue || 0); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/片", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               // position: [-5, -16], | ||||
|               // position: [-5, -16], | ||||
|               position: [-10, -16], | ||||
|               // position: [-17, -16], | ||||
|               color: "#68C483", | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "组件人均产量对标.xls"; | ||||
|       componentAapExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月标准组件良率</div> | ||||
|       <div class="smallTitle">标准组件良率</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,102 +26,61 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   componentyieldRatePage, | ||||
|   componentyieldRateExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "SCYieldBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, | ||||
|         { id: 1, name: "", type: 2, color: "#FFCE6A" }, | ||||
|         { id: 2, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             data: [ | ||||
|               { name: "%", value: 85 }, | ||||
|               { name: "%", value: 85 }, | ||||
|               { name: "%", value: 85 }, | ||||
|             ], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
| @@ -134,12 +93,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 57.5 }, | ||||
|               { name: "%", value: 21.66 }, | ||||
|               { name: "%", value: 18.4 }, | ||||
|             ], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -152,12 +107,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 23.33 }, | ||||
|               { name: "%", value: 7.02 }, | ||||
|               { name: "%", value: 80.2 }, | ||||
|             ], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -197,6 +148,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factory = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -215,11 +173,144 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       componentyieldRatePage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr = [ | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           this.tableProps = this.tableProps1.concat(arr); | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.targetColumn; | ||||
|           this.legendList[1].name = msg.yoyColumn; | ||||
|           this.legendList[2].name = msg.queryColumn; | ||||
|           this.chartMsg.series[0].name = msg.targetColumn; | ||||
|           this.chartMsg.series[1].name = msg.yoyColumn; | ||||
|           this.chartMsg.series[2].name = msg.queryColumn; | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let lineData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         lineData.push({ | ||||
|           name: "%", | ||||
|           value: val[i].target || 0, | ||||
|         }); | ||||
|         barData1.push({ name: "%", value: val[i].yoy || 0 }); | ||||
|         barData2.push({ | ||||
|           name: "%", | ||||
|           value: val[i].queryValue || 0, | ||||
|         }); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = lineData; | ||||
|       this.chartMsg.series[1].data = barData1; | ||||
|       this.chartMsg.series[2].data = barData2; | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#FFCE6A", "#8EF0AB", "#288AFF"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "line", | ||||
|             symbol: "circle", | ||||
|             symbolSize: 6, | ||||
|             label: { | ||||
|               show: true, | ||||
|               color: "#FFAE17", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [-18, -16], | ||||
|               color: "#68C483", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: [0, -16], | ||||
|               color: "#288AFF", | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "标准组件良率对标.xls"; | ||||
|       componentyieldRateExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|       <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> | ||||
|     </div> | ||||
|     <div class="containerBottom"> | ||||
|       <div class="smallTitle">4月标准组件转化效率</div> | ||||
|       <div class="smallTitle">标准组件转化效率</div> | ||||
|       <bm-line-bar | ||||
|         :chartHeight="chartHeight" | ||||
|         :legendList="legendList" | ||||
| @@ -26,109 +26,62 @@ | ||||
| <script> | ||||
| import bmSearchBar from "../components/bmSearchBar.vue"; | ||||
| import BmLineBar from "../components/bmLineBar.vue"; | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: "factory", | ||||
|     label: "工厂名称", | ||||
|     // filter: (val) => factoryList[val], | ||||
|     minWidth: 200, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "name", | ||||
|     label: "科目", | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "unit", | ||||
|     label: "单位", | ||||
|     minWidth: 80, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time1", | ||||
|     label: "时间1", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "time2", | ||||
|     label: "时间2", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao", | ||||
|     label: "月目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
|   { | ||||
|     prop: "mubiao2", | ||||
|     label: "年目标值", | ||||
|     minWidth: 150, | ||||
|     showOverflowtooltip: true, | ||||
|   }, | ||||
| ]; | ||||
| import { | ||||
|   componentconvertrateCPage, | ||||
|   componentconvertrateCExport, | ||||
| } from "@/api/report/benchmarking.js"; | ||||
| import moment from "moment"; | ||||
| export default { | ||||
|   name: "TurnoverRateBM", | ||||
|   data() { | ||||
|     return { | ||||
|       tableProps, | ||||
|       factoryList: [ | ||||
|         { id: 0, name: "瑞昌" }, | ||||
|         { id: 1, name: "邯郸" }, | ||||
|       ], | ||||
|       tableProps: [], | ||||
|       tableProps1: [ | ||||
|         { | ||||
|           prop: "factory", | ||||
|           label: "工厂名称", | ||||
|           filter: (val) => this.factoryList[val].name, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "item", | ||||
|           label: "科目", | ||||
|           minWidth: 120, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|         { | ||||
|           prop: "unit", | ||||
|           label: "单位", | ||||
|           minWidth: 80, | ||||
|           showOverflowtooltip: true, | ||||
|         }, | ||||
|       ], | ||||
|       listQuery: { | ||||
|         current: 1, | ||||
|         size: 1000, | ||||
|         size: 100, | ||||
|       }, | ||||
|       tableData: [ | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|         { factory: "工厂1" }, | ||||
|       ], | ||||
|       tableData: [], | ||||
|       chartHeight: this.tableHeight(269) / 2, | ||||
|       tableH: this.tableHeight(269) / 2, | ||||
|       legendList: [ | ||||
|         { id: 1, name: "2024年4月", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 2, name: "2023年4月", type: 1, color: "#63BDFF" }, | ||||
|         { id: 3, name: "2024年4月目标值", type: 1, color: "#288AFF" }, | ||||
|         { id: 4, name: "2024年目标值", type: 1, color: "#7164FF" }, | ||||
|         { id: 1, name: "", type: 1, color: "#8EF0AB" }, | ||||
|         { id: 2, name: "", type: 1, color: "#63BDFF" }, | ||||
|         { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|         { id: 4, name: "", type: 1, color: "#7164FF" }, | ||||
|       ], | ||||
|       chartMsg: { | ||||
|         color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"], | ||||
|         xData: ["成都", "邯郸", "瑞昌"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "2023年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 12.64444444 }, | ||||
|               { name: "%", value: 12.29 }, | ||||
|               { name: "%", value: 12.33 }, | ||||
|             ], | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             barGap: 0.5, | ||||
| @@ -143,12 +96,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月", | ||||
|             data: [ | ||||
|               { name: "%", value: 14.92 }, | ||||
|               { name: "%", value: 15.31 }, | ||||
|               { name: "%", value: 15.36 }, | ||||
|             ], | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -162,12 +111,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年4月目标值", | ||||
|             data: [ | ||||
|               { name: "%", value: 15.36 }, | ||||
|               { name: "%", value: 15.52 }, | ||||
|               { name: "%", value: 15.63 }, | ||||
|             ], | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -181,12 +126,8 @@ export default { | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2024年目标值", | ||||
|             data: [ | ||||
|               { name: "%", value: 15.63 }, | ||||
|               { name: "%", value: 15.69 }, | ||||
|               { name: "%", value: 15.78 }, | ||||
|             ], | ||||
|             name: "4", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
| @@ -227,6 +168,13 @@ export default { | ||||
|     this.chartHeight = this.tableHeight(269) / 2; | ||||
|     window.addEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.tableProp = this.tableProp1; | ||||
|     this.listQuery.type = 2; | ||||
|     this.listQuery.startDate = moment().format("yyyy-MM-DD"); | ||||
|     this.listQuery.factory = []; | ||||
|     this.getList(); | ||||
|   }, | ||||
|   destroyed() { | ||||
|     window.removeEventListener("resize", this._setTableHeight); | ||||
|   }, | ||||
| @@ -245,11 +193,260 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     getSearch(val) { | ||||
|       console.log(val); | ||||
|       console.log("========================="); | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       this.getList(); | ||||
|     }, | ||||
|     handleExport() { | ||||
|       console.log("导出"); | ||||
|     getList() { | ||||
|       this.tableProps = []; | ||||
|       componentconvertrateCPage({ ...this.listQuery }).then((res) => { | ||||
|         if (res.data && res.data.records.length > 0) { | ||||
|           let msg = res.data.records[0]; | ||||
|           let arr1 = [ | ||||
|             { | ||||
|               prop: "yoy", | ||||
|               label: msg.yoyColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "queryValue", | ||||
|               label: msg.queryColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|             { | ||||
|               prop: "target", | ||||
|               label: msg.targetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           let arr2 = [ | ||||
|             { | ||||
|               prop: "yearTarget", | ||||
|               label: msg.yearTargetColumn, | ||||
|               filter: (val) => (val || val === 0 ? val : "-"), | ||||
|               minWidth: 150, | ||||
|             }, | ||||
|           ]; | ||||
|           // 重置chart的series | ||||
|           this.chartMsg.series = [ | ||||
|             { | ||||
|               name: "1", | ||||
|               data: [], | ||||
|               type: "bar", | ||||
|               barWidth: 20, | ||||
|               barGap: 0.5, | ||||
|               label: { | ||||
|                 show: true, | ||||
|                 position: "top", | ||||
|                 color: "#68C483", | ||||
|                 fontSize: 9, | ||||
|                 formatter: function (params) { | ||||
|                   return params.value.toFixed(2) + "%"; | ||||
|                 }, | ||||
|               }, | ||||
|             }, | ||||
|             { | ||||
|               name: "2", | ||||
|               data: [], | ||||
|               type: "bar", | ||||
|               barWidth: 20, | ||||
|               barGap: "100%", | ||||
|               label: { | ||||
|                 show: true, | ||||
|                 position: "top", | ||||
|                 color: "#63BDFF", | ||||
|                 fontSize: 9, | ||||
|                 formatter: function (params) { | ||||
|                   return params.value.toFixed(2) + "%"; | ||||
|                 }, | ||||
|               }, | ||||
|             }, | ||||
|             { | ||||
|               name: "3", | ||||
|               data: [], | ||||
|               type: "bar", | ||||
|               barWidth: 20, | ||||
|               label: { | ||||
|                 show: true, | ||||
|                 position: "top", | ||||
|                 color: "#288AFF", | ||||
|                 fontSize: 9, | ||||
|                 formatter: function (params) { | ||||
|                   return params.value.toFixed(2) + "%"; | ||||
|                 }, | ||||
|               }, | ||||
|             }, | ||||
|             { | ||||
|               name: "4", | ||||
|               data: [], | ||||
|               type: "bar", | ||||
|               barWidth: 20, | ||||
|               label: { | ||||
|                 show: true, | ||||
|                 position: "top", | ||||
|                 color: "#7164FF", | ||||
|                 fontSize: 9, | ||||
|                 formatter: function (params) { | ||||
|                   return params.value.toFixed(2) + "%"; | ||||
|                 }, | ||||
|               }, | ||||
|             }, | ||||
|           ]; | ||||
|           // 维度为月时加年目标 | ||||
|           if (this.listQuery.type === 2) { | ||||
|             this.tableProps = this.tableProps1.concat(arr1, arr2); | ||||
|             this.legendList = [ | ||||
|               { id: 1, name: "", type: 1, color: "#8EF0AB" }, | ||||
|               { id: 2, name: "", type: 1, color: "#63BDFF" }, | ||||
|               { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|               { id: 4, name: "", type: 1, color: "#7164FF" }, | ||||
|             ]; | ||||
|             this.legendList[3].name = msg.yearTargetColumn; | ||||
|             this.chartMsg.series[3].name = msg.yearTargetColumn; | ||||
|           } else { | ||||
|             this.tableProps = this.tableProps1.concat(arr1); | ||||
|             this.legendList = [ | ||||
|               { id: 1, name: "", type: 1, color: "#8EF0AB" }, | ||||
|               { id: 2, name: "", type: 1, color: "#63BDFF" }, | ||||
|               { id: 3, name: "", type: 1, color: "#288AFF" }, | ||||
|             ]; | ||||
|           } | ||||
|           this.tableData = res.data.records; | ||||
|           // 设置图例 | ||||
|           this.legendList[0].name = msg.yoyColumn; | ||||
|           this.legendList[1].name = msg.queryColumn; | ||||
|           this.legendList[2].name = msg.targetColumn; | ||||
|           this.chartMsg.series[0].name = msg.yoyColumn; | ||||
|           this.chartMsg.series[1].name = msg.queryColumn; | ||||
|           this.chartMsg.series[2].name = msg.targetColumn; | ||||
|           // 设置chartMsg的series的数据 | ||||
|           this.setChartMsg(res.data.records); | ||||
|         } else { | ||||
|           // 重置 | ||||
|           this.resetMsg(); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     setChartMsg(val) { | ||||
|       let xData = []; | ||||
|       let barData1 = []; | ||||
|       let barData2 = []; | ||||
|       let barData3 = []; | ||||
|       let barData4 = []; | ||||
|       for (let i = 0; i < val.length; i++) { | ||||
|         this.factoryList.map((item) => { | ||||
|           if (item.id === val[i].factory) { | ||||
|             xData.push(item.name); | ||||
|           } | ||||
|         }); | ||||
|         barData1.push({ name: "%", value: val[i].yoy || 0 }); | ||||
|         barData2.push({ | ||||
|           name: "%", | ||||
|           value: val[i].queryValue || 0, | ||||
|         }); | ||||
|         barData3.push({ name: "%", value: val[i].target || 0 }); | ||||
|         barData4.push({ | ||||
|           name: "%", | ||||
|           value: val[i].yearTarget || 0, | ||||
|         }); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|       this.chartMsg.series[0].data = barData1; | ||||
|       this.chartMsg.series[1].data = barData2; | ||||
|       this.chartMsg.series[2].data = barData3; | ||||
|       this.chartMsg.series[3].data = barData4; | ||||
|       if (this.listQuery.type !== 2) { | ||||
|         this.chartMsg.series.pop(); | ||||
|       } | ||||
|       this.chartMsg.xData = xData; | ||||
|     }, | ||||
|     resetMsg() { | ||||
|       this.tableProps = this.tableProps1; | ||||
|       this.tableData = []; | ||||
|       this.chartMsg = { | ||||
|         color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"], | ||||
|         xData: [], | ||||
|         yName: "单位/%", | ||||
|         series: [ | ||||
|           { | ||||
|             name: "1", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             barGap: 0.5, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#68C483", | ||||
|               fontSize: 9, | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "2", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#63BDFF", | ||||
|               fontSize: 9, | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "3", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#288AFF", | ||||
|               fontSize: 9, | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
|             name: "4", | ||||
|             data: [], | ||||
|             type: "bar", | ||||
|             barWidth: 20, | ||||
|             label: { | ||||
|               show: true, | ||||
|               position: "top", | ||||
|               color: "#7164FF", | ||||
|               fontSize: 9, | ||||
|               formatter: function (params) { | ||||
|                 return params.value.toFixed(2) + "%"; | ||||
|               }, | ||||
|             }, | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|     handleExport(val) { | ||||
|       this.listQuery.type = val.type; | ||||
|       this.listQuery.startDate = val.startDate; | ||||
|       this.listQuery.factory = val.factory; | ||||
|       let fileName = "转化效率对标.xls"; | ||||
|       componentconvertrateCExport({ ...this.listQuery }) | ||||
|         .then((response) => { | ||||
|           this.$download.excel(response, fileName); | ||||
|           this.$message.success("导出成功"); | ||||
|         }) | ||||
|         .catch(() => {}); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -137,7 +137,7 @@ | ||||
|  | ||||
|     <!-- 添加或修改菜单对话框 --> | ||||
|     <base-dialog :dialogTitle="title" :dialogVisible="open" width="50%"> | ||||
|       <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | ||||
|       <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | ||||
|         <el-row> | ||||
|           <el-col :span="24"> | ||||
|             <el-form-item label="上级菜单"> | ||||
| @@ -205,6 +205,7 @@ | ||||
|                 v-model="form.sort" | ||||
|                 controls-position="right" | ||||
|                 :min="0" | ||||
|                 style="width: 100%" | ||||
|               /> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
| @@ -331,8 +332,8 @@ | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|       <div slot="footer" class="dialog-footer"> | ||||
|         <el-button type="primary" @click="submitForm">确 定</el-button> | ||||
|         <el-button @click="cancel">取 消</el-button> | ||||
|         <el-button type="primary" @click="submitForm">确 定</el-button> | ||||
|       </div> | ||||
|     </base-dialog> | ||||
|   </div> | ||||
| @@ -437,6 +438,12 @@ export default { | ||||
|         }, | ||||
|       ], | ||||
|       tableBtn: [ | ||||
|         this.$auth.hasPermi("system:menu:create") | ||||
|           ? { | ||||
|               type: "add", | ||||
|               btnName: "新增", | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi("system:menu:update") | ||||
|           ? { | ||||
|               type: "edit", | ||||
| @@ -449,12 +456,6 @@ export default { | ||||
|               btnName: "删除", | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi("system:menu:create") | ||||
|           ? { | ||||
|               type: "add", | ||||
|               btnName: "新增", | ||||
|             } | ||||
|           : undefined, | ||||
|       ].filter((v) => v), | ||||
|       tableProps, | ||||
|       heightNum: 210, | ||||
|   | ||||
| @@ -83,7 +83,7 @@ | ||||
|               {{ parseTime(form.startTime) }} | {{ form.duration }} ms | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="12"> | ||||
|           <el-col :span="24"> | ||||
|             <el-form-item label="操作结果:"> | ||||
|               <div v-if="form.resultCode === 0"> | ||||
|                 正常 | {{ form.resultData }} | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <template> | ||||
|   <div class="app-container"> | ||||
|   <div class="user-container"> | ||||
|     <!-- <doc-alert title="用户体系" url="https://doc.iocoder.cn/user-center/" /> | ||||
|     <doc-alert title="三方登陆" url="https://doc.iocoder.cn/social-user/" /> | ||||
|     <doc-alert | ||||
| @@ -8,40 +8,43 @@ | ||||
|     /> --> | ||||
|     <!-- 搜索工作栏 --> | ||||
|  | ||||
|     <el-row :gutter="20"> | ||||
|     <el-row :gutter="8" class="user-box"> | ||||
|       <!--部门数据--> | ||||
|       <el-col :span="4" :xs="24"> | ||||
|         <div class="head-container"> | ||||
|           <el-input | ||||
|             v-model="deptName" | ||||
|             placeholder="请输入部门名称" | ||||
|             clearable | ||||
|             size="small" | ||||
|             prefix-icon="el-icon-search" | ||||
|             style="margin-bottom: 20px" | ||||
|           /> | ||||
|         </div> | ||||
|         <div class="head-container"> | ||||
|           <el-tree | ||||
|             :data="deptOptions" | ||||
|             :props="defaultProps" | ||||
|             :expand-on-click-node="false" | ||||
|             :filter-node-method="filterNode" | ||||
|             ref="tree" | ||||
|             default-expand-all | ||||
|             highlight-current | ||||
|             @node-click="handleNodeClick" | ||||
|           /> | ||||
|         <div class="user-box-left"> | ||||
|           <div class="head-container"> | ||||
|             <el-input | ||||
|               v-model="deptName" | ||||
|               placeholder="请输入部门名称" | ||||
|               clearable | ||||
|               size="small" | ||||
|               prefix-icon="el-icon-search" | ||||
|               style="margin-bottom: 20px" | ||||
|             /> | ||||
|           </div> | ||||
|           <div class="head-container"> | ||||
|             <el-tree | ||||
|               :data="deptOptions" | ||||
|               :props="defaultProps" | ||||
|               :expand-on-click-node="false" | ||||
|               :filter-node-method="filterNode" | ||||
|               ref="tree" | ||||
|               default-expand-all | ||||
|               highlight-current | ||||
|               @node-click="handleNodeClick" | ||||
|             /> | ||||
|           </div> | ||||
|         </div> | ||||
|       </el-col> | ||||
|       <!--用户数据--> | ||||
|       <el-col :span="20" :xs="24"> | ||||
|         <search-bar | ||||
|           :formConfigs="formConfig" | ||||
|           ref="searchBarForm" | ||||
|           @headBtnClick="buttonClick" | ||||
|         /> | ||||
|         <!-- <el-form | ||||
|         <div class="user-box-right"> | ||||
|           <search-bar | ||||
|             :formConfigs="formConfig" | ||||
|             ref="userSearchBarForm" | ||||
|             @headBtnClick="buttonClick" | ||||
|           /> | ||||
|           <!-- <el-form | ||||
|           :model="queryParams" | ||||
|           ref="queryForm" | ||||
|           size="small" | ||||
| @@ -104,7 +107,7 @@ | ||||
|           </el-form-item> | ||||
|         </el-form> --> | ||||
|  | ||||
|         <!-- <el-row :gutter="10" class="mb8"> | ||||
|           <!-- <el-row :gutter="10" class="mb8"> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button | ||||
|               type="primary" | ||||
| @@ -144,25 +147,25 @@ | ||||
|           ></right-toolbar> | ||||
|         </el-row> --> | ||||
|  | ||||
|         <!-- 列表 --> | ||||
|         <base-table | ||||
|           :page="queryParams.pageNo" | ||||
|           :limit="queryParams.pageSize" | ||||
|           :table-props="tableProps" | ||||
|           :table-data="userList" | ||||
|           :max-height="tableH" | ||||
|           @emitFun="handleStatusChange" | ||||
|         > | ||||
|           <method-btn | ||||
|             v-if="tableBtn.length" | ||||
|             slot="handleBtn" | ||||
|             :width="220" | ||||
|             label="操作" | ||||
|             :method-list="tableBtn" | ||||
|             @clickBtn="handleClick" | ||||
|           /> | ||||
|         </base-table> | ||||
|         <!-- <el-table v-loading="loading" :data="userList"> | ||||
|           <!-- 列表 --> | ||||
|           <base-table | ||||
|             :page="queryParams.pageNo" | ||||
|             :limit="queryParams.pageSize" | ||||
|             :table-props="tableProps" | ||||
|             :table-data="userList" | ||||
|             :max-height="tableH" | ||||
|             @emitFun="handleStatusChange" | ||||
|           > | ||||
|             <method-btn | ||||
|               v-if="tableBtn.length" | ||||
|               slot="handleBtn" | ||||
|               :width="220" | ||||
|               label="操作" | ||||
|               :method-list="tableBtn" | ||||
|               @clickBtn="handleClick" | ||||
|             /> | ||||
|           </base-table> | ||||
|           <!-- <el-table v-loading="loading" :data="userList"> | ||||
|           <el-table-column | ||||
|             label="用户编号" | ||||
|             align="center" | ||||
| @@ -288,18 +291,19 @@ | ||||
|           </el-table-column> | ||||
|         </el-table> --> | ||||
|  | ||||
|         <pagination | ||||
|           :page.sync="queryParams.pageNo" | ||||
|           :limit.sync="queryParams.pageSize" | ||||
|           :total="total" | ||||
|           @pagination="getList" | ||||
|         /> | ||||
|           <pagination | ||||
|             :page.sync="queryParams.pageNo" | ||||
|             :limit.sync="queryParams.pageSize" | ||||
|             :total="total" | ||||
|             @pagination="getList" | ||||
|           /> | ||||
|         </div> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|  | ||||
|     <!-- 添加或修改参数配置对话框 --> | ||||
|     <base-dialog :dialogTitle="title" :dialogVisible="open" width="50%"> | ||||
|       <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||
|       <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | ||||
|         <el-row> | ||||
|           <el-col :span="12"> | ||||
|             <el-form-item label="用户昵称" prop="nickname"> | ||||
| @@ -412,8 +416,8 @@ | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|       <div slot="footer" class="dialog-footer"> | ||||
|         <el-button type="primary" @click="submitForm">确 定</el-button> | ||||
|         <el-button @click="cancel">取 消</el-button> | ||||
|         <el-button type="primary" @click="submitForm">确 定</el-button> | ||||
|       </div> | ||||
|     </base-dialog> | ||||
|  | ||||
| @@ -448,7 +452,7 @@ | ||||
|             :underline="false" | ||||
|             style="font-size: 12px; vertical-align: baseline" | ||||
|             @click="importTemplate" | ||||
|             >下载模板</el-link | ||||
|             >导出模板</el-link | ||||
|           > | ||||
|         </div> | ||||
|       </el-upload> | ||||
| @@ -606,6 +610,11 @@ export default { | ||||
|           name: "search", | ||||
|           color: "primary", | ||||
|         }, | ||||
|         { | ||||
|           type: "button", | ||||
|           btnName: "重置", | ||||
|           name: "cancel", | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermiOr([ | ||||
|             "system:user:create", | ||||
| @@ -615,18 +624,11 @@ export default { | ||||
|             ? "separate" | ||||
|             : "", | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermi("system:user:create") ? "button" : "", | ||||
|           btnName: "新增", | ||||
|           name: "addNew", | ||||
|           color: "success", | ||||
|           plain: true, | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermi("system:user:import") ? "button" : "", | ||||
|           btnName: "导入", | ||||
|           name: "import", | ||||
|           color: "warning", | ||||
|           color: "primary", | ||||
|           plain: true, | ||||
|         }, | ||||
|         { | ||||
| @@ -636,20 +638,15 @@ export default { | ||||
|           color: "primary", | ||||
|           plain: true, | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermi("system:user:create") ? "button" : "", | ||||
|           btnName: "新增", | ||||
|           name: "addNew", | ||||
|           color: "success", | ||||
|           plain: true, | ||||
|         }, | ||||
|       ], | ||||
|       tableBtn: [ | ||||
|         this.$auth.hasPermi("system:user:update") | ||||
|           ? { | ||||
|               type: "edit", | ||||
|               btnName: "修改", | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi("system:user:delete") | ||||
|           ? { | ||||
|               type: "delete", | ||||
|               btnName: "删除", | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi("system:user:update-password") | ||||
|           ? { | ||||
|               type: "reset", | ||||
| @@ -662,6 +659,18 @@ export default { | ||||
|               btnName: "分配角色", | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi("system:user:update") | ||||
|           ? { | ||||
|               type: "edit", | ||||
|               btnName: "修改", | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi("system:user:delete") | ||||
|           ? { | ||||
|               type: "delete", | ||||
|               btnName: "删除", | ||||
|             } | ||||
|           : undefined, | ||||
|       ].filter((v) => v), | ||||
|       tableProps, | ||||
|       // 遮罩层 | ||||
| @@ -803,6 +812,15 @@ export default { | ||||
|         case "search": | ||||
|           this.handleQuery(val); | ||||
|           break; | ||||
|         case "cancel": | ||||
|           this.$refs["userSearchBarForm"].resetForm(); | ||||
|           this.queryParams.pageNo = 1; | ||||
|           this.queryParams.username = ""; | ||||
|           this.queryParams.mobile = ""; | ||||
|           this.queryParams.status = ""; | ||||
|           this.queryParams.createTime = []; | ||||
|           this.getList(); | ||||
|           break; | ||||
|         case "addNew": | ||||
|           this.handleAdd(); | ||||
|           break; | ||||
| @@ -1033,7 +1051,7 @@ export default { | ||||
|       this.upload.title = "用户导入"; | ||||
|       this.upload.open = true; | ||||
|     }, | ||||
|     /** 下载模板操作 */ | ||||
|     /** 导出模板操作 */ | ||||
|     importTemplate() { | ||||
|       importTemplate().then((response) => { | ||||
|         this.$download.excel(response, "用户导入模板.xls"); | ||||
| @@ -1090,11 +1108,19 @@ export default { | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| .app-container { | ||||
| .user-container { | ||||
|   width: 100%; | ||||
|   height: calc(100vh - 120px - 8px); | ||||
|   background-color: #fff; | ||||
|   border-radius: 8px; | ||||
|   padding: 8px; | ||||
|   background-color: #f2f4f9; | ||||
|  | ||||
|   .user-box { | ||||
|     .user-box-left, | ||||
|     .user-box-right { | ||||
|       background-color: #fff; | ||||
|       padding: 8px; | ||||
|       border-radius: 8px; | ||||
|       height: calc(100vh - 128px); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user