哥哥玩剑魂呢 3 anni fa
parent
commit
7686857f3f

+ 1 - 20
src/icons/svg/employee_table_icon.svg

@@ -1,20 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#909399;}
-</style>
-<title>编组</title>
-<desc>Created with Sketch.</desc>
-<g>
-	<g id="组织架构" transform="translate(2.000000, 2.000000)">
-		<path id="形状结合" class="st0" d="M626.4,83.3c42.8,0,77.6,34.7,77.6,77.6v155.2c0,42.8-34.7,77.6-77.6,77.6l-77.6,0v77.6
-			l196.5,0c18.6,0,33.9,15,36,34.3l0.2,4.5l0,116.4l77.6,0c42.8,0,77.6,34.7,77.6,77.6v155.2c0,42.8-34.7,77.6-77.6,77.6H626.4
-			c-42.8,0-77.6-34.7-77.6-77.6V703.9c0-42.8,34.7-77.6,77.6-77.6l82.7,0l0-77.6H310.9l0,77.6l82.8,0c42.8,0,77.6,34.7,77.6,77.6
-			v155.2c0,42.8-34.7,77.6-77.6,77.6H160.9c-42.8,0-77.6-34.7-77.6-77.6V703.9c0-42.8,34.7-77.6,77.6-77.6l77.6,0l0-116.4
-			c0-19.9,14-36.3,32-38.5l4.2-0.3l196.5,0v-77.6l-77.5,0c-42.8,0-77.6-34.7-77.6-77.6V160.9c0-42.8,34.7-77.6,77.6-77.6H626.4z
-			 M393.6,703.9H160.9v155.2h232.7V703.9z M859.1,703.9H626.4v155.2h232.7V703.9z M626.4,160.9H393.6v155.2h232.7V160.9z"/>
-	</g>
-</g>
-</svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623986171396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10102" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M628.4 85.3c42.8 0 77.6 34.7 77.6 77.6v155.2c0 42.8-34.7 77.6-77.6 77.6h-77.6v77.6h196.5c18.6 0 33.9 15 36 34.3l0.2 4.5v116.4h77.6c42.8 0 77.6 34.7 77.6 77.6v155.2c0 42.8-34.7 77.6-77.6 77.6H628.4c-42.8 0-77.6-34.7-77.6-77.6V705.9c0-42.8 34.7-77.6 77.6-77.6h82.7v-77.6H312.9v77.6h82.8c42.8 0 77.6 34.7 77.6 77.6v155.2c0 42.8-34.7 77.6-77.6 77.6H162.9c-42.8 0-77.6-34.7-77.6-77.6V705.9c0-42.8 34.7-77.6 77.6-77.6h77.6V511.9c0-19.9 14-36.3 32-38.5l4.2-0.3h196.5v-77.6h-77.5c-42.8 0-77.6-34.7-77.6-77.6v-155c0-42.8 34.7-77.6 77.6-77.6h232.7zM395.6 705.9H162.9v155.2h232.7V705.9z m465.5 0H628.4v155.2h232.7V705.9z m-232.7-543H395.6v155.2h232.7V162.9z" p-id="10103"></path></svg>

+ 1 - 22
src/icons/svg/fixed_integral_icon.svg

@@ -1,22 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#909399;}
-</style>
-<title>编组</title>
-<desc>Created with Sketch.</desc>
-<g id="自动积分" transform="translate(1.000000, 2.000000)">
-	<path id="路径备份" class="st0" d="M379.9,160.2C437.6,60,581.3,57.5,639.4,154.1l4.2,7.4l0.4,0.8l0,0l51.7,103.3
-		c6.2,13.5,20.9,24.4,39.4,28.7l6.3,1.2L855,311.9c117.1,15.8,165.1,153,86.6,239l-5.4,5.7l-82.8,76.7
-		c-12.6,12.2-19.3,28.6-18.8,43.7l0.6,5.6L854,793c19,114.6-98.4,199.8-204.1,153.6l-6.9-3.2l-101.7-50.7c-16.8-8.1-34.8-9-51.4-3
-		l-6.1,2.6l-104.2,52.8c-105,51.8-225-29.8-211.8-143.2l1-7.4l19-111.7c3.2-15.3-1.3-30.5-13.3-43L85.9,556
-		c-85-82.1-40.7-219.3,73.7-242.6l7.7-1.4l114-16.4c18.5-2.7,33.9-12.2,43.1-25.8l3.1-5.3L379.9,160.2z M568.2,201.5
-		c-22.3-42.1-82.9-43.9-109.8-6l-3.3,5.2l-51.3,102.5c-20.3,39.2-57.4,66.4-101.3,75.4l-8.9,1.5L180,396.4
-		c-49,7.6-68.6,59.8-38.9,93.9l3.8,4l81.5,77.2c35.5,29.7,52.9,74.7,46.7,118.8L253,808.6c-7.5,45.5,39.1,80.1,83.3,62.5l5.1-2.3
-		l104.6-53c39.5-19.1,83.7-20.4,124.3-3.6l8.6,3.9l102,50.9c44.4,21.9,92.9-10.2,89.5-54.7l-0.6-5.2L751,696.7
-		c-6.9-42.1,7.1-85.8,37.1-118.5l6.7-6.8l82.3-76.3c33.6-33.4,17.3-87.5-28.3-97.6l-5.6-1L729.1,380c-45.7-6.6-86-32.5-106.5-69.8
-		L568.2,201.5z"/>
-</g>
-</svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623986604334" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10611" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M380.9 162.2C438.6 62 582.3 59.5 640.4 156.1l4.2 7.4 0.4 0.8 51.7 103.3c6.2 13.5 20.9 24.4 39.4 28.7l6.3 1.2L856 313.9c117.1 15.8 165.1 153 86.6 239l-5.4 5.7-82.8 76.7c-12.6 12.2-19.3 28.6-18.8 43.7l0.6 5.6L855 795c19 114.6-98.4 199.8-204.1 153.6l-6.9-3.2-101.7-50.7c-16.8-8.1-34.8-9-51.4-3l-6.1 2.6-104.2 52.8c-105 51.8-225-29.8-211.8-143.2l1-7.4 19-111.7c3.2-15.3-1.3-30.5-13.3-43L86.9 558c-85-82.1-40.7-219.3 73.7-242.6l7.7-1.4 114-16.4c18.5-2.7 33.9-12.2 43.1-25.8l3.1-5.3 52.4-104.3z m188.3 41.3c-22.3-42.1-82.9-43.9-109.8-6l-3.3 5.2-51.3 102.5c-20.3 39.2-57.4 66.4-101.3 75.4l-8.9 1.5L181 398.4c-49 7.6-68.6 59.8-38.9 93.9l3.8 4 81.5 77.2c35.5 29.7 52.9 74.7 46.7 118.8L254 810.6c-7.5 45.5 39.1 80.1 83.3 62.5l5.1-2.3 104.6-53c39.5-19.1 83.7-20.4 124.3-3.6l8.6 3.9 102 50.9c44.4 21.9 92.9-10.2 89.5-54.7l-0.6-5.2L752 698.7c-6.9-42.1 7.1-85.8 37.1-118.5l6.7-6.8 82.3-76.3c33.6-33.4 17.3-87.5-28.3-97.6l-5.6-1L730.1 382c-45.7-6.6-86-32.5-106.5-69.8l-54.4-108.7z" p-id="10612"></path></svg>

+ 1 - 16
src/icons/svg/rule_manage_icon.svg

@@ -1,16 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#909399;}
-</style>
-<title>编组</title>
-<desc>Created with Sketch.</desc>
-<g>
-	<path class="st0" d="M806.2,85.3H626.5H262.7C181.2,85.6,128,132,128,170.7V640v85.3v128c0,38.9,53.2,85.3,134.7,85.3h498.5
-		c81.6,0,134.7-46.4,134.7-85.3V170.7C896,134,847.5,89.3,806.2,85.3z M640,170.7v213.1l-41.9-31.5c-25.2-18.9-60.6-19-85.9-0.1
-		l-42.9,32.1V170.7H640z M806.2,853.3H217.8V170.7H384V427c0,24.4,13.5,46.3,35.3,57.2c9.1,4.6,18.9,6.8,28.7,6.8
-		c13.5,0,26.9-4.3,38.2-12.8l68.9-51.5l67.9,51c19.5,14.6,45.1,17,67,6.1c21.8-10.9,35.4-32.8,35.4-57.2v-256h80.8V853.3z"/>
-</g>
-</svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623986590282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10357" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M806.2 85.3H262.7C181.2 85.6 128 132 128 170.7v682.6c0 38.9 53.2 85.3 134.7 85.3h498.5c81.6 0 134.7-46.4 134.7-85.3V170.7c0.1-36.7-48.4-81.4-89.7-85.4zM640 170.7v213.1l-41.9-31.5c-25.2-18.9-60.6-19-85.9-0.1l-42.9 32.1V170.7H640z m166.2 682.6H217.8V170.7H384V427c0 24.4 13.5 46.3 35.3 57.2 9.1 4.6 18.9 6.8 28.7 6.8 13.5 0 26.9-4.3 38.2-12.8l68.9-51.5 67.9 51c19.5 14.6 45.1 17 67 6.1 21.8-10.9 35.4-32.8 35.4-57.2v-256h80.8v682.7z" p-id="10358"></path></svg>

+ 1 - 19
src/icons/svg/set_basics_icon.svg

@@ -1,19 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#909399;}
-</style>
-<title>编组</title>
-<desc>Created with Sketch.</desc>
-<g id="基础设置" transform="translate(2.000000, 4.000000)">
-	<path id="形状结合" class="st0" d="M339.3,678.7c31.6,0,59.2,17.2,73.9,42.7l480.8,0c23.6,0,42.7,19.1,42.7,42.7
-		s-19.1,42.7-42.7,42.7l-480.8,0c-14.8,25.5-42.3,42.6-73.9,42.6s-59.1-17.1-73.9-42.6l-139.4,0c-23.6,0-42.7-19.1-42.7-42.7
-		s19.1-42.7,42.7-42.7l139.4,0C280.2,695.8,307.7,678.7,339.3,678.7z M680.7,422.7c31.6,0,59.2,17.2,73.9,42.7l139.4,0
-		c23.6,0,42.7,19.1,42.7,42.7s-19.1,42.7-42.7,42.7l-139.4,0c-14.8,25.5-42.3,42.6-73.9,42.6s-59.1-17.1-73.9-42.6l-480.8,0
-		c-23.6,0-42.7-19.1-42.7-42.7s19.1-42.7,42.7-42.7l480.8,0C621.5,439.8,649.1,422.7,680.7,422.7z M339.3,166.7
-		c31.6,0,59.2,17.2,73.9,42.7l480.8,0c23.6,0,42.7,19.1,42.7,42.7s-19.1,42.7-42.7,42.7l-480.8,0c-14.8,25.5-42.3,42.6-73.9,42.6
-		s-59.1-17.1-73.9-42.6l-139.4,0c-23.6,0-42.7-19.1-42.7-42.7s19.1-42.7,42.7-42.7l139.4,0C280.2,183.8,307.7,166.7,339.3,166.7z"/>
-</g>
-</svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623986596579" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10484" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M341.3 682.7c31.6 0 59.2 17.2 73.9 42.7H896c23.6 0 42.7 19.1 42.7 42.7s-19.1 42.7-42.7 42.7H415.2c-14.8 25.5-42.3 42.6-73.9 42.6s-59.1-17.1-73.9-42.6H128c-23.6 0-42.7-19.1-42.7-42.7s19.1-42.7 42.7-42.7h139.4c14.8-25.6 42.3-42.7 73.9-42.7z m341.4-256c31.6 0 59.2 17.2 73.9 42.7H896c23.6 0 42.7 19.1 42.7 42.7s-19.1 42.7-42.7 42.7H756.6c-14.8 25.5-42.3 42.6-73.9 42.6s-59.1-17.1-73.9-42.6H128c-23.6 0-42.7-19.1-42.7-42.7s19.1-42.7 42.7-42.7h480.8c14.7-25.6 42.3-42.7 73.9-42.7z m-341.4-256c31.6 0 59.2 17.2 73.9 42.7H896c23.6 0 42.7 19.1 42.7 42.7s-19.1 42.7-42.7 42.7H415.2c-14.8 25.5-42.3 42.6-73.9 42.6s-59.1-17.1-73.9-42.6H128c-23.6 0-42.7-19.1-42.7-42.7s19.1-42.7 42.7-42.7h139.4c14.8-25.6 42.3-42.7 73.9-42.7z" p-id="10485"></path></svg>

+ 1 - 27
src/icons/svg/set_role_icon.svg

@@ -1,27 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#909399;}
-</style>
-<title>编组</title>
-<desc>Created with Sketch.</desc>
-<g>
-	<g>
-		<path class="st0" d="M338.1,853.3H213.3l-5-0.3c-21.2-2.5-37.7-20.5-37.7-42.4V213.3l0.3-5c2.5-21.2,20.5-37.7,42.4-37.7H768
-			l5,0.3c21.2,2.5,37.7,20.5,37.7,42.4V297l0.3,5c2.5,21.2,20.5,37.7,42.4,37.7c23.6,0,42.7-19.1,42.7-42.7v-83.7l-0.2-7.5
-			C891.9,138.6,836.2,85.3,768,85.3H213.3l-7.5,0.2c-67.2,3.9-120.5,59.6-120.5,127.8v597.3l0.2,7.5
-			c3.9,67.2,59.6,120.5,127.8,120.5h124.8l5-0.3c21.2-2.5,37.7-20.5,37.7-42.4C380.8,872.4,361.7,853.3,338.1,853.3z"/>
-		<path class="st0" d="M822.7,699.5h-64.5c53.5-22.2,91.2-74.9,91.2-136.1V416H701.2C619.5,416,553,482.2,553,563.5
-			c0,61.2,37.7,113.8,91.2,136.1h-64.5c-66.8,0-121.1,54-121.1,120.5v55.9c0,40,32.7,72.6,72.9,72.6h340.3
-			c39.6,0,71.9-32.5,71.9-72.6V820C943.8,753.6,889.5,699.5,822.7,699.5z M767.9,564.4c0,37.1-29.2,66.2-66.6,66.2
-			s-66.7-29.1-66.7-66.2c0-36.5,29.9-66.2,66.7-66.2h66.6V564.4z M540.2,821c0-22,17.4-39.2,39.5-39.2h243
-			c22.2,0,39.5,17.2,39.5,39.2v47.2h-322V821z"/>
-		<path class="st0" d="M725.3,298.7c0-23.6-19.1-42.7-42.7-42.7h-384c-23.6,0-42.7,19.1-42.7,42.7c0,23.6,19.1,42.7,42.7,42.7h384
-			C706.2,341.3,725.3,322.2,725.3,298.7z"/>
-		<path class="st0" d="M298.7,426.7c-23.6,0-42.7,19.1-42.7,42.7s19.1,42.7,42.7,42.7h170.7c23.6,0,42.7-19.1,42.7-42.7
-			s-19.1-42.7-42.7-42.7H298.7z"/>
-	</g>
-</g>
-</svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623986577874" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10229" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M338.1 853.3H213.3l-5-0.3c-21.2-2.5-37.7-20.5-37.7-42.4V213.3l0.3-5c2.5-21.2 20.5-37.7 42.4-37.7H768l5 0.3c21.2 2.5 37.7 20.5 37.7 42.4V297l0.3 5c2.5 21.2 20.5 37.7 42.4 37.7 23.6 0 42.7-19.1 42.7-42.7v-83.7l-0.2-7.5c-4-67.2-59.7-120.5-127.9-120.5H213.3l-7.5 0.2c-67.2 3.9-120.5 59.6-120.5 127.8v597.3l0.2 7.5c3.9 67.2 59.6 120.5 127.8 120.5h124.8l5-0.3c21.2-2.5 37.7-20.5 37.7-42.4 0-23.5-19.1-42.6-42.7-42.6z" p-id="10230"></path><path d="M822.7 699.5h-64.5c53.5-22.2 91.2-74.9 91.2-136.1V416H701.2C619.5 416 553 482.2 553 563.5c0 61.2 37.7 113.8 91.2 136.1h-64.5c-66.8 0-121.1 54-121.1 120.5V876c0 40 32.7 72.6 72.9 72.6h340.3c39.6 0 71.9-32.5 71.9-72.6v-56c0.1-66.4-54.2-120.5-121-120.5z m-54.8-135.1c0 37.1-29.2 66.2-66.6 66.2s-66.7-29.1-66.7-66.2c0-36.5 29.9-66.2 66.7-66.2h66.6v66.2zM540.2 821c0-22 17.4-39.2 39.5-39.2h243c22.2 0 39.5 17.2 39.5 39.2v47.2h-322V821zM725.3 298.7c0-23.6-19.1-42.7-42.7-42.7h-384c-23.6 0-42.7 19.1-42.7 42.7s19.1 42.7 42.7 42.7h384c23.6-0.1 42.7-19.2 42.7-42.7zM298.7 426.7c-23.6 0-42.7 19.1-42.7 42.7s19.1 42.7 42.7 42.7h170.7c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7H298.7z" p-id="10231"></path></svg>

+ 3 - 2
src/main.js

@@ -10,8 +10,8 @@ import axios_user from '@/utils/request-user'
 import App from './App'
 import router from './router'
 import store from './store'
-import {getToken} from '@/utils/auth'
-import {supremeAuthority ,authoritys ,getTypsName} from './api/auth';
+import {getToken, getEmployeeMap} from '@/utils/auth'
+import {supremeAuthority ,authoritys , getTypsName} from './api/auth';
 
 import i18n from './lang' // Internationalization
 import './icons' // icon
@@ -51,6 +51,7 @@ Vue.prototype.serverdomain = process.env.BASE_API
 Vue.prototype.$supremeAuthority = supremeAuthority
 Vue.prototype.$authoritys = authoritys
 Vue.prototype.$getTypsName = getTypsName
+Vue.prototype.$getEmployeeMap = getEmployeeMap
 // Vue.prototype.$wx = wx;
 
 

+ 6 - 4
src/permission.js

@@ -1,3 +1,4 @@
+import Cookies from 'js-cookie'
 import router from './router'
 import store from './store'
 import Vue from 'vue'
@@ -35,12 +36,13 @@ router.beforeEach((to, from, next) => {
     })
   }
   // NProgress.start()
-  if (getToken()) {
-    if (!store.state.user.token) store.commit("SET_TOKEN", getToken());
-    init(to, next)
-  } else if (cookGetToken()) {
+  if(cookGetToken()){
     localSetToken(cookGetToken())
     store.commit("SET_TOKEN", getToken());
+    Cookies.remove('Admin-Token')
+    init(to, next)
+  }else if (getToken()) {
+    if (!store.state.user.token) store.commit("SET_TOKEN", getToken());
     init(to, next)
   } else {
     if (whiteList.indexOf(to.path) !== -1 || window.location.href.indexOf('loginbytoken/') !== -1) { // 在免登录白名单,直接进入

+ 1 - 1
src/router/index.js

@@ -162,7 +162,7 @@ export const asyncRouterMap = [
         path: '/performance',
         name: 'performance',
         component: () => import('@/views/workbench/workbench'),
-        meta: { title: '绩效分', icon: 'jxf', show: true, noCache: true },
+        meta: { title: '绩效分', icon: 'jxf', show: true, noCache: true , jurisdiction:['creator','point_manager','admin','dept_manager','employee'] },
         alwaysShow: true, // 一直显示根路由
         children: [
           {

+ 5 - 0
src/utils/auth.js

@@ -6,6 +6,11 @@ const ATOKEN = 'atoken'
 const USER = 'user'
 const PASW = 'pasw'
 
+// 获取用户列表
+export function getEmployeeMap() {
+  return JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP'))
+}
+
 export function cookGetToken() {
   return Cookies.get(TokenKey)
 }

+ 2 - 0
src/utils/wx-auth-two.js

@@ -47,6 +47,8 @@ async function wxConfigByCorp(body, pushindex, next) {
   console.log(wxConfigParams)
   console.log(appSignature)
   console.log('wxConfig开始')
+  console.log(Vue.prototype.$wx)
+  console.log(Vue.prototype.$wx.config)
   await Vue.prototype.$wx.config({ // 鉴权(企业的身份与权限)
     beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
     debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。

+ 15 - 14
src/views/common/EmployeeSelector.vue

@@ -81,7 +81,8 @@
                   <div class="employee_cell_a" v-for="(item, index) in list" :key="index" v-show="item.id">
                     <div class="employee_cell" @click.prevent.stop="select_employee(item)">
                       <div class="employee_checkbox"><el-checkbox v-model="item.checked"></el-checkbox></div>
-                      <div class="employee_img_url"><img :src="item.img_url" class="employee_cell_head_img" /></div>
+                      <div class="employee_img_url" v-if="item.img_url && item.img_url != defaultImg()"><img :src="item.img_url" class="employee_cell_head_img" /></div>
+                      <div class="employee_img_url" v-else><img src="static/images/gttx1.jpg" class="employee_cell_head_img" /></div>
                       <div class="employee_name">
                         <WWOpenData type="userName" :openid="item.name"></WWOpenData>
                         <!-- {{ item.name }} -->
@@ -112,7 +113,7 @@
                 <div class="employee_cell_clear"></div>
               </div>
               <div class="employee_cell" v-for="(item, index) in employee_selected_list" :key="index">
-                <div class="employee_img_url" v-if="item.img_url"><img :src="item.img_url" class="employee_cell_head_img" /></div>
+                <div class="employee_img_url" v-if="item.img_url && item.img_url != defaultImg()"><img :src="item.img_url" class="employee_cell_head_img" /></div>
                 <div class="employee_img_url" v-else><img src="static/images/head_default.png" class="employee_cell_head_img" /></div>
                 <div class="employee_name">
                   <WWOpenData type="userName" :openid="item.name"></WWOpenData>
@@ -307,15 +308,19 @@ export default {
     }
   },
   methods: {
+    defaultImg(){
+      return "https://rescdn.qqmail.com/node/wwmng/wwmng/style/images/independent/DefaultAvatar$73ba92b5.png"
+    },
     dept1_null(val){
       this.toPdept1 = val[val.length-1]
-      let valItem = 0
-      for(let i in val){
-        valItem = val[i]
-      }
-      this.get_user_list(valItem);
-      this.checked = false;
+    	if(val.length>1){
+    		this.dept_select_id=val[val.length-1];
+    	}else{
+    		this.dept_select_id=val[0];
+    	}
       this.$nextTick(()=>{
+        this.get_user_list();
+        this.checked = false;
         this.$refs.dept1.dropDownVisible = false;
       })
     },
@@ -623,19 +628,15 @@ export default {
       this.list = data;
     },
     //获取人员
-    get_user_list(valItem) {
+    get_user_list() {
       this.table_loading = true;
       let params = {
+        dept_id: this.dept_select_id,
         keywords: this.keyword,
         page: 0,
         page_size: 2000,
         child:this.child? '1':'0'
       }
-      if(valItem){
-          params.dept_id=valItem
-      }else{
-          params.dept_id=0
-      }
       this.$http('get', '/api/employee/index', params)
         .then(res => {
           let list = this.filtration(res.data.data.list);

+ 0 - 0
src/views/common/EmployeeSelector2.vue → src/views/common/EmployeeSelector1 copy.vue


+ 670 - 829
src/views/common/EmployeeSelector1.vue

@@ -3,108 +3,75 @@
     <div class="employee_selector_box">
       <el-row :gutter="10">
         <el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11" class="scroller-box one">
-
           <div class="search-box">
-            <div class="search">
-              <el-button slot="append" icon="el-icon-search" class="manager_button"></el-button>
-              <el-input v-model="keyword" placeholder="请输入内容"></el-input>
+            <!-- <div class="search flex-box" style="margin-bottom: 7px;"><el-input v-model="keyword" placeholder="请输入内容" clearable></el-input></div> -->
+            <div class="search flex-box" style="margin-top: 7px; width: 80%; position: relative;">
+              <deptData  v-if="toPdept1 && toPdept1!=0" :refsName="$refs.dept1" :toPdept="toPdept1"></deptData>
+              <el-cascader
+                style="width: 100%;"
+                v-model="dept_id"
+                @change="dept1_null"
+                ref="dept1"
+                :options="dept_list"
+                :props="{ checkStrictly: true, value: 'id', label: 'name', children: 'children' }"
+                clearable
+                filterable
+                placeholder="全公司"
+              >
+                <template slot-scope="{ node, data }">
+                  <span>
+                    <WWOpenData type="departmentName" :openid="data.name"></WWOpenData>
+                  </span>
+                </template>
+              </el-cascader>
             </div>
           </div>
-          <div class="dept_path">
-            <a href="javascript:void(0);" @click="back_by_index(0)">全公司</a>
-            <a
-              v-for="(item, index) in pid_list_arr"
-              :key="index"
-              href="javascript:void(0);"
-              @click="back_by_index(index + 1)"
-            >
-              <i class="el-icon-arrow-right"></i>
-              <WWOpenData type="departmentName" :openid="item.name"></WWOpenData>
-            </a>
+          <div class="flex-box-end" v-if="isChecKedAll&&multi" style="padding: 10px;border-bottom: 1px solid #f1f1f1;">
+            <el-checkbox v-model="checked" @change="checkedChange">全选</el-checkbox>
           </div>
-          <el-checkbox v-if="isChecKedAll" v-model="checked" @change="checkedChange" >全选</el-checkbox>
-          <el-scrollbar wrap-class="column-wrapper scrollable-items-container" :native="false" :class="isChecKedAll?'scrollbarHeight1':'scrollbarHeight2'">
+          <el-scrollbar wrap-class="column-wrapper scrollable-items-container" :native="false" :class="isChecKedAll ? 'scrollbarHeight1' : 'scrollbarHeight2'" v-loading="table_loading">
             <div class="choose_left">
-              <a href="javascript:void(0)" v-for="(item,index) in dept_list" :key="index">
-                <div class="employee_cell" @click="select_dept(item)" v-show="item.pid == pid && item.name.indexOf(keyword) >= 0 && dept_not_select.indexOf(item.id) < 0">
-                  <i class="el-icon-caret-right" style=" display: inline-block;"></i>
-                  <div class="employee_checkbox" v-if="can_select_dept">
-                    <el-checkbox v-model="item.checked"></el-checkbox>
-                  </div>
-                  <div class="employee_name">
-                    <WWOpenData type="departmentName" :openid="item.name"></WWOpenData>
-                  </div>
-
-                  <div v-if="can_select_dept" class="dept_child_cell">
-                    <span href="javascript:void(0);" class="child_btn" @click.stop="show_child(item)">
-                      | 下级
-                    </span>
-                  </div>
-
-                  <div class="employee_cell_clear"></div>
-
-                </div>
-              </a>
-              <div class="persons_box" style="padding-top:4px;">
-                <a class="employee_cell_a" href="javascript:void(0)" v-for="(item,index) in list" :key="index" v-show="item.id">
-                  <div class="employee_cell" v-if="can_select_employee" @click.prevent.stop="select_employee(item)" v-show="employee_not_select.indexOf(item.id) < 0">
-                    <div class="employee_checkbox">
-                      <el-checkbox v-model="item.checked" v-if="selectedQuitEmployee" :style="item.status > 1 || employee_not_select.indexOf(item.id) > 0?'opacity: 0':'opacity: 1'" ></el-checkbox>
-                      <el-checkbox v-model="item.checked" v-if="!selectedQuitEmployee" :style="item.status > 1 || employee_not_select.indexOf(item.id) > 0?'opacity: 0':'opacity: 1'" ></el-checkbox>
-                    </div>
-                    
-                    <div class="employee_img_url">
-                      <img :src="item.img_url" class="employee_cell_head_img" />
-                    </div>
+              <div class="persons_box" style="padding-top:4px;" v-if="list.length > 0">
+                <a class="employee_cell_a" href="javascript:void(0)" v-for="(item, index) in list" :key="index" v-show="item.id">
+                  <div class="employee_cell" v-if="can_select_employee" @click.prevent.stop="select_employee(item)">
+                    <div class="employee_checkbox"><el-checkbox v-model="item.checked"></el-checkbox></div>
+                    <div class="employee_img_url"><img :src="item.img_url" class="employee_cell_head_img" /></div>
                     <div class="employee_name">
-                      <!-- {{item.name}} -->
                       <WWOpenData type="userName" :openid="item.name"></WWOpenData>
+                      <!-- {{ item.name }} -->
                     </div>
                     <div class="employee_cell_clear"></div>
-
                   </div>
                 </a>
               </div>
-
+              <div v-else class="fontColorF" style="text-align: center;margin-top: 50px;">暂无可选人员</div>
             </div>
-
-
           </el-scrollbar>
         </el-col>
         <el-col :xs="2" :sm="2" :md="2" :lg="2" :xl="2" class="col-line"><span style="opacity: 0;">空</span></el-col>
         <el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11" class="scroller-box">
           <div class="option-box">
-            <span style="line-height: 40px; padding-left: 10px;" class="fl" v-show="multi">已选择{{employee_selected_list.length}}个员工</span>
+            <span style="line-height: 40px; padding-left: 10px;" class="fl" v-show="multi">已选择{{ employee_selected_list.length }}个员工</span>
             <el-button type="type" @click="clear_data">清空</el-button>
           </div>
           <el-scrollbar wrap-class="column-wrapper scrollable-items-container" :native="false" style="height: 400px;">
             <div class="choose_right">
-              <div class="employee_cell" v-for="(item,index) in dept_selected_list" :key="index">
-
+              <div class="employee_cell" v-for="(item, index) in dept_selected_list" :key="index">
                 <div class="employee_name">
-                  <WWOpenData type="departmentName" :openid="item.dept_name"></WWOpenData>
-                </div>
-                <div class="employee_delete">
-                  <el-button type="default" size="mini" @click="dept_cancel(item)" icon="el-icon-close" circle></el-button>
+                  <WWOpenData type="departmentName" :openid="data.name"></WWOpenData>
+                  <!-- {{ item.dept_name }} -->
                 </div>
+                <div class="employee_delete"><el-button type="default" size="mini" @click="dept_cancel(item)" icon="el-icon-close" circle></el-button></div>
                 <div class="employee_cell_clear"></div>
               </div>
-
-              <div class="employee_cell" v-for="(item,index) in employee_selected_list" :key="index">
-
-                <div class="employee_img_url" v-if="item.img_url">
-                  <img :src="item.img_url" class="employee_cell_head_img" />
-                </div>
-                <div class="employee_img_url" v-else>
-                  <img src="static/images/head_default.png" class="employee_cell_head_img" />
-                </div>
+              <div class="employee_cell" v-for="(item, index) in employee_selected_list" :key="index">
+                <div class="employee_img_url" v-if="item.img_url"><img :src="item.img_url" class="employee_cell_head_img" /></div>
+                <div class="employee_img_url" v-else><img src="static/images/head_default.png" class="employee_cell_head_img" /></div>
                 <div class="employee_name">
-                  <!-- {{item.name}} -->
                   <WWOpenData type="userName" :openid="item.name"></WWOpenData>
+                  <!-- {{ item.name }} -->
                 </div>
-                <div class="employee_delete">
-                  <el-button type="default" size="mini" @click="employee_cancel(item,true)" icon="el-icon-close" circle></el-button>
-                </div>
+                <div class="employee_delete"><el-button type="default" size="mini" @click="employee_cancel(item, true)" icon="el-icon-close" circle></el-button></div>
                 <div class="employee_cell_clear"></div>
               </div>
             </div>
@@ -112,811 +79,685 @@
         </el-col>
       </el-row>
     </div>
-
-    <!--    
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="close">取 消</el-button>
-      <el-button type="primary" @click="confirm">确 定</el-button>
-    </span> 
-    -->
-
   </div>
 </template>
 
 <script>
-  var timers = null
-  export default {
-    props:{
-      Out_of_the_current:{
-        type: Boolean,
-      },
-      two_of_the_current:{
-        type: Boolean,
-      },
-      two_of_the_current_two:{
-        type: Number,
-      },
-      append_body: {
-        type: Boolean,
-        default: false
-      },
-      visible: {
-        type: Boolean,
-        default: false
-      },
-      can_select_dept: {
-        type: Boolean,
-        default: true
-      },
-      can_select_employee: {
-        type: Boolean,
-        default: true
-      },
-      employee_not_select: {
-        type: Array,
-        default: () => {
-          return []
-        }
-      },
-      dept_not_select: {
-        type: Array,
-        default: () => {
-          return []
-        }
-      },
-      selected: {
-        type: Object,
-        default: () => {
-          return {employee: [], dept: []}
-        }
-      },
-      multi: {
-        type: Boolean,
-        default: true
-      },
-      dept_multi: {
-        type: Boolean,
-        default: true
-      },
-      employee_list: {
-        type: Array,
-        default: () => {
-          return []
-        }
-      },
-      selectedQuitEmployee:{
-        type: Boolean,
-        default: true
-      },
-      isChecKedAll: {
-        type: Boolean,
-        default: true
-      },
-      close_clear_data: {
-        type: Boolean,
-        default: true
-      },
-      max: {
-        type: Number,
-        default: 0
+var timers = null;
+export default {
+  props: {
+    can_select_dept: {// 是否能选择部门
+      type: Boolean,
+      default: true
+    },
+    can_select_employee: {// 指定是否能选择员工
+      type: Boolean,
+      default: true
+    },
+    employee_not_select: {// 排除员工的ID,包含ID时不出现在选择列表中
+      type: Array,
+      default: () => {
+        return [];
       }
     },
-    name: "EmployeeSelector",
-    data() {
-      let selected = JSON.parse(JSON.stringify(this.selected))
-      return {
-        searchBox:[],
-        dialogVisible: true,
-        employee_selected_list: selected.employee,
-        dept_selected_list: selected.dept,
-        employee_selected: [],
-        dept_selected: [],
-        com_height: '100%',
-        company_info: {},
-        actions_show: false,
-        dept_name: '',
-        dept_id: 0,
-        list: [],
-        dept_list: [],
-        keyword: '',
-        owner_id: 0,
-        user_info: this.$store.getters.user_info,
-        pid: 0,
-        pid_list: [],
-        selected_box_width: '0',
-        pid_list_arr: [],
-        visible_: false,
-        checked: false
+    dept_not_select: { // 排除部门ID
+      type: Array,
+      default: () => {
+        return [];
       }
     },
-    watch: {
-      max(val) {
-        this.set_button_width()
-      },
-      selected:{
-        deep:true,
-        handler(val){
-          let selected = JSON.parse(JSON.stringify(val))
-          this.employee_selected = []
-          this.dept_selected = []
-          this.employee_selected_list = selected.employee
-          this.dept_selected_list = selected.dept
-          for (let i in selected.employee) {
-            this.employee_selected.push(selected.employee[i].id)
-          }
-          for(let i in selected.dept){
-            this.dept_selected.push(selected.dept[i].dept_id)
-          }
-          this.set_button_width()
-        },
-        immediate: true
-      },
-      // selected(val) {
-      //   let selected = JSON.parse(JSON.stringify(val))
-      //   this.employee_selected = []
-      //   this.dept_selected = []
-      //   this.employee_selected_list = selected.employee
-      //   this.dept_selected_list = selected.dept
-      //   for (let i in selected.employee) {
-      //     this.employee_selected.push(selected.employee[i].id)
-      //   }
-      //   for(let i in selected.dept){
-      //     this.dept_selected.push(selected.dept[i].dept_id)
-      //   }
-      //   this.set_button_width()
-      // },
-      visible(val){
-        this.visible_ = JSON.parse(JSON.stringify(val))
-        if(val){
-          setTimeout(() => {
-            if (this.$route.query.pid) {
-              this.pid = this.$route.query.pid
-            }
-            this.get_user_list(function () {
-
-            })
-            this.get_dept_list()
-          }, 200)
+    selected: {// 已经选择的员工和部门
+      type: Object,
+      default: () => {
+        return { employee: [], dept: [] };
+      }
+    },
+    multi: { // 指定员工是否能多选
+      type: Boolean,
+      default: true
+    },
+    dept_multi: { // 指定部门是否能多选
+      type: Boolean,
+      default: true
+    },
+    employee_list: { // 指定显示的员工列表,注意:传值后组件的员工数据将不是统一向服务器获取的,而是指定的员工列表,格式是:[{id: 1, name: “张三”, img_url: “”}]
+      type: Array,
+      default: () => {
+        return [];
+      }
+    },
+    user_employee_list:{// 为true时,employee_list才生效
+    		 type: Boolean,
+    		 default: false
+    },
+    isChecKedAll: { //是否全选
+      type: Boolean,
+      default: true
+    },
+    close_clear_data: { //关闭时是否清除选择的数据
+      type: Boolean,
+      default: true
+    },
+    max: { //选择的人数限制
+      type: Number,
+      default: 0
+    },
+    is_filtration_creator:{//是否去除创始人
+      type: Boolean,
+      default: false
+    },
+    is_manager_only:{//是否只显示管理者
+      type: Boolean,
+      default: false
+    },
+    include_self:{//是否显示自己
+      type: Boolean,
+      default: true
+    },
+  },
+  name: 'EmployeeSelector',
+  data() {
+    let selected = JSON.parse(JSON.stringify(this.selected));
+    return {
+      table_loading:false,
+      searchBox: [],//用于搜索的全部人员
+      employee_selected_list: selected.employee,
+      dept_selected_list: selected.dept,
+      employee_selected: [],
+      dept_selected: [],
+      dept_name: '',
+      dept_id: 0,
+      list: [],
+      dept_list: [],
+      keyword: '',
+      pid: 0,
+      pid_list: [],
+      selected_box_width: '0',
+      indeterminate: false,
+      pid_list_arr: [],
+      checked: false,
+      toPdept1:0,//选择部门的遮到
+    };
+  },
+  watch: {
+    // dept_id(val){
+    // 	if(val.length>1){
+    // 		this.pid=val[val.length-1];
+    // 	}else{
+    // 		this.pid=val[0];
+    // 	}
+    // 	this.$nextTick(() => {
+    // 		this.$refs.dept.dropDownVisible = false;
+    // 		this.get_user_list();
+    // 		this.checked=false;
+    // 	});
+    // },
+    selected: {
+      deep: true,
+      handler(val) {
+        let selected = JSON.parse(JSON.stringify(val));
+        this.employee_selected = [];
+        this.dept_selected = [];
+        this.employee_selected_list = selected.employee;
+        this.dept_selected_list = selected.dept;
+        for (let i in selected.employee) {
+          this.employee_selected.push(selected.employee[i].id);
+        }
+        for (let i in selected.dept) {
+          this.dept_selected.push(selected.dept[i].dept_id);
         }
-        this.set_button_width()
-      },
-      employee_selected_list() {
-        let l = this.employee_selected_list.length + this.dept_selected_list.length
-        let width = 0.9 * l;
-        this.selected_box_width = width + 'rem'
-        this.set_button_width()
-      },
-      dept_selected_list() {
-        let l = this.employee_selected_list.length + this.dept_selected_list.length
-        let width = 0.9 * l;
-        this.selected_box_width = width + 'rem'
-        this.set_button_width()
       },
-      keyword(val) {
-        // this.options =this.keyword?this.alloptions.filter(item=> item.name.includes (this,keyword)): this. alloptions
-        //this.list
-        this.list = this.searchBox.filter(item=> item.name.includes(this.keyword))
-        // this.list.filter(val)
-        // clearTimeout(timers)
-        // // timers = setTimeout(function () {
-        // //   this.get_user_list(function () {})
-        // // }, 500)
-        // timers = setTimeout(()=>{
-        //   this.get_user_list()
-        // },500)
+      immediate: true
+    },
+    keyword(val) {
+      this.list = this.searchBox.filter(item => item.name.includes(this.keyword));
+      if(!val){
+        this.checked=false;
       }
+    }
+  },
+  methods: {
+    dept1_null(val){
+      this.toPdept1 = val[val.length-1]
+    	if(val.length>1){
+    		this.pid=val[val.length-1];
+    	}else{
+    		this.pid=val[0];
+    	}
+      // let valItem = 0
+      // for(let i in val){
+      //   valItem = val[i]
+      // }
+      this.$nextTick(()=>{
+    		this.get_user_list();
+    		this.checked=false;
+        this.$refs.dept1.dropDownVisible = false;
+      })
     },
-    methods: {
-      defaultImg(){
-        return "https://rescdn.qqmail.com/node/wwmng/wwmng/style/images/independent/DefaultAvatar$73ba92b5.png"
-      },
-      // 全选
-      checkedChange(val){
-        if (val) {
+    // 全选
+    checkedChange(val) {
+      if (val) {
+        this.$nextTick(() => {
+          let employeeSelectedList = JSON.parse(JSON.stringify(this.employee_selected_list));//获取选择的人员
+          let employeeSelectedIds = [],total = 0;
+          employeeSelectedList.forEach(element => {
+            employeeSelectedIds.push(element.id);
+          });
           for (let i in this.list) {
-            if (this.employee_not_select.indexOf(this.list[i].id) < 0) {
-              this.$set(this.list[i], 'checked', true)
-            }
-          }
-          this.$nextTick(() => {
-            let employeeSelectedList = JSON.parse(JSON.stringify(this.employee_selected_list))
-            let employeeSelectedIds = [], total = 0
-            employeeSelectedList.forEach(element => {
-              employeeSelectedIds.push(element.id)
-            });
-            for (const i in this.list) {
-              this.list[i].status !== 2 && this.selectedQuitEmployee?this.$set(this.list[i], 'checked', true):''
-              if (employeeSelectedIds.includes(this.list[i].id)) {
-                total += 1
-              }else{
-                this.list[i].status !== 2 && this.selectedQuitEmployee?this.employee_selected_list.push(this.list[i]):''
-              }
+            this.$set(this.list[i], 'checked', true)
+            if (!employeeSelectedIds.includes(this.list[i].id)) {//去除已经选择的人员
+               this.employee_selected_list.push(this.list[i]);
             }
-            // console.log(this.employee_not_select)
-            // console.log(this.employee_selected_list)
-            // debugger
-          })
-        }else{
-          this.employee_selected_list = []
-          this.employee_selected = []
-          for (let i in this.list) {
-            this.$set(this.list[i], 'checked', false)
           }
-          // this.clear_data() 
-        }
-      },
-      close_before(done) {
-        this.close()
-      },
-      set_button_width() {
-
-      },
-      back() {
-        this.pid = this.pid_list[this.pid_list.length - 1]
-        this.pid_list.splice(this.pid_list.length - 1)
-        this.pid_list_arr.splice(this.pid_list_arr.length - 1)
-        this.get_user_list(function () {
-
-        })
-      },
-      back_by_index(index) {
-
-        if (index == this.pid_list.length) {
-          return false
+        });
+      } else {
+        this.employee_selected_list = [];
+        this.employee_selected = [];
+        for (let i in this.list) {
+          this.$set(this.list[i], 'checked', false);
         }
-        this.pid = this.pid_list[index]
-        this.pid_list.splice(index, 100)
-        this.pid_list_arr.splice(index, 100)
-        this.get_user_list(function () {
-
-        })
-      },
-      show_child(item) {
-        this.pid_list.push(this.pid)
-        this.pid_list_arr.push(item)
-        this.pid = item.id
-        this.get_user_list(function () {
-
-        })
-      },
-      employee_cancel(item) {
-        this.employee_selected.splice(this.employee_selected.indexOf(item.id), 1)
-        let delete_index = -1
-        for (let i in this.employee_selected_list) {
-          if (this.employee_selected.indexOf(this.employee_selected_list[i].id) < 0) {
-            delete_index = i
-          }
+      }
+    },
+    back() {
+      this.pid = this.pid_list[this.pid_list.length - 1];
+      this.pid_list.splice(this.pid_list.length - 1);
+      this.pid_list_arr.splice(this.pid_list_arr.length - 1);
+      this.get_user_list();
+    },
+    back_by_index(index) {
+      if (index == this.pid_list.length) {
+        return false;
+      }
+      this.pid = this.pid_list[index];
+      this.pid_list.splice(index, 100);
+      this.pid_list_arr.splice(index, 100);
+      this.get_user_list();
+    },
+    show_child(item) {
+      this.pid_list.push(this.pid);
+      this.pid_list_arr.push(item);
+      this.pid = item.id;
+      this.get_user_list();
+    },
+    employee_cancel(item) {
+      this.checked=false;
+      this.employee_selected.splice(this.employee_selected.indexOf(item.id), 1);
+      let delete_index = -1;
+      for (let i in this.employee_selected_list) {
+        if (this.employee_selected.indexOf(this.employee_selected_list[i].id) < 0) {
+          delete_index = i;
         }
-        if (delete_index >= 0) {
-          // this.employee_selected_list.splice(delete_index, 1)
-          for (let i in this.list) {
-            if (this.list[i].id == item.id) {
-              this.$set(this.list[i], 'checked', false)
-            }
-          }
-          for(let i in this.employee_selected_list){
-            if(this.employee_selected_list[i].id == item.id){
-              this.employee_selected_list.splice(i, 1)
-            }
+      }
+      if (delete_index >= 0) {
+        for (let i in this.list) {
+          if (this.list[i].id == item.id) {
+            this.$set(this.list[i], 'checked', false);
           }
         }
-      },
-      dept_cancel(item) {
-        this.dept_selected.splice(this.dept_selected.indexOf(item.dept_id), 1)
-        let delete_index = -1
-        for (let i in this.dept_selected_list) {
-          if (this.dept_selected.indexOf(this.dept_selected_list[i].dept_id) < 0) {
-            delete_index = i
+        for (let i in this.employee_selected_list) {
+          if (this.employee_selected_list[i].id == item.id) {
+            this.employee_selected_list.splice(i, 1);
           }
         }
-        if (delete_index >= 0) {
-          this.dept_selected_list.splice(delete_index, 1)
-          for(let i in this.dept_list){
-            if(this.dept_list[i].id == item.dept_id){
-              this.$set(this.dept_list[i], 'checked', false)
-            }
-          }
+      }
+    },
+    dept_cancel(item) {
+      this.checked = false;
+      this.dept_selected.splice(this.dept_selected.indexOf(item.dept_id), 1);
+      let delete_index = -1;
+      for (let i in this.dept_selected_list) {
+        if (this.dept_selected.indexOf(this.dept_selected_list[i].dept_id) < 0) {
+          delete_index = i;
         }
-      },
-      select_employee(item){
-        
-        if (this.selectedQuitEmployee) {
-          if (this.employee_not_select.indexOf(item.id) >= 0 || item.status > 1) {
-            return false
-          }
-        }else{
-          if (this.employee_not_select.indexOf(item.id) >= 0) {
-            return false
+      }
+      if (delete_index >= 0) {
+        this.dept_selected_list.splice(delete_index, 1);
+        for (let i in this.dept_list) {
+          if (this.dept_list[i].id == item.dept_id) {
+            this.$set(this.dept_list[i], 'checked', false);
           }
         }
-
-        if(item.checked){
-          item.checked = false
-          this.employee_cancel(item)
-          this.$emit('confirms', '')
-        } else {
-          if (!this.multi) {
-            this.employee_selected = []
-            this.employee_selected_list = []
-            for (let i in this.list) {
-              this.$set(this.list[i], 'checked', false)
-            }
-          }
-          if (this.max > 0 && this.employee_selected.length == this.max && this.multi) {
-            this.$toast('最多只能选择' + this.max + '人')
-            return false
+      }
+    },
+    select_employee(item) {
+      if (item.checked) {
+        item.checked = false;
+        this.employee_cancel(item);
+        this.$emit('confirms', '');
+      } else {
+        if (!this.multi) {
+          this.employee_selected = [];
+          this.employee_selected_list = [];
+          for (let i in this.list) {
+            this.$set(this.list[i], 'checked', false);
           }
-          this.employee_selected.push(item.id)
-          this.employee_selected_list.push({id: item.id, name: item.name, img_url: item.img_url})
-          item.checked = true
-          this.$emit('confirms', this.employee_selected_list)
         }
-      },
-      select_dept(item) {
-        if (!this.can_select_dept) {
-          this.show_child(item)
-          return false
+        if (this.max > 0 && this.employee_selected.length == this.max && this.multi) {
+          this.$toast('最多只能选择' + this.max + '人');
+          return false;
         }
-        if (item.checked) {
-          item.checked = false
-          this.dept_cancel(item)
-        } else {
-          if (!this.dept_multi) {
-            this.dept_selected = []
-            this.dept_selected_list = []
-            for (let i in this.dept_list) {
-              this.$set(this.dept_list[i], 'checked', false)
-            }
+        this.employee_selected.push(item.id);
+        this.employee_selected_list.push({ id: item.id, name: item.name, img_url: item.img_url });
+        item.checked = true;
+        this.$emit('confirms', this.employee_selected_list);
+      }
+    },
+    select_dept(item) {
+      if (!this.can_select_dept) {
+        this.show_child(item);
+        return false;
+      }
+      if (item.checked) {
+        item.checked = false;
+        this.dept_cancel(item);
+      } else {
+        if (!this.dept_multi) {
+          this.dept_selected = [];
+          this.dept_selected_list = [];
+          for (let i in this.dept_list) {
+            this.$set(this.dept_list[i], 'checked', false);
           }
-          this.dept_selected.push(item.id)
-          this.dept_selected_list.push({dept_id: item.id, dept_name: item.name, avatar: 'static/images/e66f.jpg'})
-          item.checked = true
         }
-
-      },
-      clear_data(){
-        this.employee_selected = []
-        this.employee_selected_list = []
-        this.dept_selected = []
-        this.dept_selected_list = []
+        this.dept_selected.push(item.id);
+        this.dept_selected_list.push({ dept_id: item.id, dept_name: item.name, avatar: 'static/images/e66f.jpg' });
+        item.checked = true;
+      }
+    },
+    clear_data() {
+      this.checked = false;
+      this.employee_selected = [];
+      this.employee_selected_list = [];
+      this.dept_selected = [];
+      this.dept_selected_list = [];
+      for (let i in this.list) {
+        this.$set(this.list[i], 'checked', false);
+      }
+      for (let i in this.dept_list) {
+        this.$set(this.dept_list[i], 'checked', false);
+      }
+    },
+    close() {
+      this.$emit('cancel');
+      if (this.close_clear_data) {
+        this.employee_selected = [];
+        this.employee_selected_list = [];
+        this.dept_selected = [];
+        this.dept_selected_list = [];
         for (let i in this.list) {
-          this.$set(this.list[i], 'checked', false)
+          this.$set(this.list[i], 'checked', false);
         }
         for (let i in this.dept_list) {
-          this.$set(this.dept_list[i], 'checked', false)
-        }
-      },
-      close() {
-        //this.visible = false
-        // this.$emit('update:visible', false)
-        this.$emit('cancel')
-        if (this.close_clear_data) {
-          this.employee_selected = []
-          this.employee_selected_list = []
-          this.dept_selected = []
-          this.dept_selected_list = []
-          for (let i in this.list) {
-            this.$set(this.list[i], 'checked', false)
-          }
-          for (let i in this.dept_list) {
-            this.$set(this.dept_list[i], 'checked', false)
-          }
+          this.$set(this.dept_list[i], 'checked', false);
         }
+      }
+    },
+    confirm() {
+      this.$emit('confirm', {
+        employee: this.employee_selected_list,
+        dept: this.dept_selected_list
+      });
+      this.close();
+    },
+    get_dept_list() {
+      this.$http('get', '/api/department/tree','').then(res => {
+        this.dept_list =this.getTreeData(res.data.data.list);
+      });
+    },
+    getTreeData(data) {
+    		for (var i = 0; i < data.length; i++) {
+    			if (data[i].children.length < 1) {
+    				// children若为空数组,则将children设为undefined
+    				data[i].children = undefined;
+    			} else {
+    				// children若不为空数组,则继续 递归调用 本方法
+    				this.getTreeData(data[i].children);
+    			}
+    		}
+    		return data;
+    },
 
-      },
-      confirm() {
-        this.$emit('confirm', {
-          employee: this.employee_selected_list,
-          dept: this.dept_selected_list
-        })
-        this.close()
-      },
-      get_dept_list(){
-        if(this.employee_list.length > 0){
-          return
-        }
-        this.$http('get','/api/department/index',{pid: this.pid, keyword:this.keyword}).then((res) => {
-          for(let i in res.data.data.list){
-            res.data.data.list[i]['checked'] = false
-            if (this.dept_selected.indexOf(res.data.data.list[i].id) >= 0) {
-              res.data.data.list[i]['checked'] = true
-            }
-          }
-          this.dept_list = res.data.data.list
-          this.owner_id = res.data.data.owner_id
-          this.company_info = res.data.data.company_info
-          if (res.data.data.dept_info == null) {
-            this.dept_name = JSON.parse(JSON.stringify(res.data.data.company_info.name))
-            this.dept_id = 0
-          } else {
-            this.dept_name = JSON.parse(JSON.stringify(res.data.data.dept_info.name))
-            this.dept_id = res.data.data.dept_info.id
+    // 默认选择中的人勾上
+    parse_list (data) {
+      this.list = []
+      let _list = []
+      data.map((item)=>{
+      	 item['checked'] = false;
+      	 for(var i in this.employee_selected_list){//判断传进来的员工是否是员工集合里的,是就设为已点击状态
+      	   if(this.employee_selected_list[i].id==item.id){
+      		 item['checked'] = true;
+      	   }
+      	 }
+         if (item.img_url == '') {
+           item.img_url = 'static/images/head_default.png'
+         }
+      });
+      this.searchBox = data;
+      this.list = data;
+    },
+    get_user_list() {
+      this.table_loading = true;
+      let params = {
+        dept_id: this.pid,
+        keywords: this.keyword,
+        page: 0,
+        page_size: 2000,
+      }
+      this.list = [];
+      this.$http('get', '/api/employee/index', params).then(res => {
+          let list = this.filtration(res.data.data.list);
+          // 当有指定显示列表时
+          if (this.user_employee_list) {
+            var employee_list = this.employee_list
+            var userData = []
+            list.map((item) => { // 列表数据是否是自己的管理范围
+              employee_list.map((item2) => {
+                if (item.id == item2.id) {
+                  userData.push(item)
+                }
+              })
+            })
+            this.parse_list(userData)
+          } else { // 没有指定人员列表
+            this.parse_list(list)
           }
-
-        }).catch((e) => {
-
+        }).finally(()=>{
+          this.table_loading = false;
         })
-      },
-      get_user_list (done) {
-        if(this.employee_list.length > 0){
-          let list = this.employee_list
-          for(let i in list){
-            list[i]['letter_index'] = '#'
-            if(this.$store.getters.employee_map[list[i].id] && this.employee_not_select.indexOf(list[i].id) < 0){
-              list[i]['letter_index'] = this.$store.getters.employee_map[list[i].id].letter_index
-              list[i]['status'] = this.$store.getters.employee_map[list[i].id].status
-              if(this.$store.getters.employee_map[list[i].id].img_url == '' || this.$store.getters.employee_map[list[i].id].img_url == this.defaultImg()){
-                list[i]['img_url'] = 'static/images/head_default.png'
-              }else {
-                list[i]['img_url'] = this.$store.getters.employee_map[list[i].id].img_url
-              }
-            }
-
-            list[i]['checked'] = false
-            if(this.employee_selected.indexOf(list[i].id) >= 0){
-              list[i]['checked'] = true
-            }
-          }
-
-          if (this.keyword) {
-            list = []
-            this.employee_list.forEach(element => {
-              if(element.name.indexOf(this.keyword) != "-1"){
-                list.push(element)
-              }
-            });
-          }
-
-          this.list = list.sort((a,b) => {
-            return a.letter_index.charCodeAt(0) - b.letter_index.charCodeAt(0)
-          })
-          this.searchBox = this.list
-          done()
-          return false
-        }
-        this.list = []
-        this.$http('get','/api/employee/index',{dept_id: this.pid,keywords: this.keyword,page: 0,page_size: 2000}).then((res) => {
-          for (let i in res.data.data.list) {
-            res.data.data.list[i]['checked'] = false
-            if (this.employee_selected.indexOf(res.data.data.list[i].id) >= 0) {
-              res.data.data.list[i]['checked'] = true
-            }
-            if (res.data.data.list[i].img_url == '' || res.data.data.list[i].img_url == this.defaultImg()) {
-              res.data.data.list[i].img_url = 'static/images/head_default.png'
-            }
+    },
+    // 过滤各种条件:如:自己,创始人,只显示管理者等。。。
+    filtration (data) {
+      var list = data
+      // 去除已经离职的人
+      list.forEach((item, index) => {
+          if (item.status == 2) {
+            list.splice(index, 1)
           }
-          let lists = res.data.data.list
-          lists.forEach((element,index) => {
-            let role_list = element.employee_detail.role_list
-              if(this.Out_of_the_current){
-                role_list.forEach((item,key)=>{
-                  if(item.name == "creator"){
-                    lists.splice(index,1)
-                  }
-               })
-              }
-          });
-          lists.forEach((element,index) => {
-            if(this.two_of_the_current){
-              if(element.id == this.two_of_the_current_two){
-                lists.splice(index,1)
-              }
+      })
+      var managerList = []// 管理者列表
+      // 只显示管理者
+      if (this.is_manager_only) {
+        var isManager=false;
+        list.map((item) => {
+          item.employee_detail.role_list.map((item2) => {
+            if (item2.name == 'creator' || item2.name == 'point_manager' || item2.name == 'dept_manager' || item2.name == 'admin') {
+              isManager=true;
             }
           })
-          this.list = lists
-          this.searchBox = this.list
-          // console.log(this.searchBox)
-          done()
-        }).catch((e) => {
-          done()
+          if(isManager){ managerList.push(item)}
         })
+        list = managerList
       }
-    },
-    created() {
-      if (document.documentElement.style.height) {
-        this.com_height = document.documentElement.style.height
+      // 过滤自己
+      if (!this.include_self) {
+        const currUserId = this.$store.getters.user_info.id;
+        for (let i = 0; i < list.length; i++) {
+          if (list[i].id == currUserId) {
+            list.splice(i, 1);
+            i--
+          }
+        }
       }
-      setTimeout(() => {
-        if (this.$route.query.pid) {
-          this.pid = this.$route.query.pid
+      // 过滤创始人
+      list.forEach((item, index) => {
+        if (this.is_filtration_creator) {
+          if (item.is_creator == 1) {
+            list.splice(index, 1)
+          }
         }
-        this.get_user_list(function () {
-
-        })
-        this.get_dept_list()
-      }, 200)
-
+      })
+      //过滤指定人员[]
+      list.forEach((item, index) => {
+        if (this.employee_not_select.length>0) {
+          if (this.employee_not_select.indexOf(item.id) >= 0) {
+            list.splice(index, 1);
+          }
+        }
+      })
+      return list
     }
+  },
+  mounted() {
+  },
+  created() {
+    setTimeout(() => {
+      if (this.$route.query.pid) {
+        this.pid = this.$route.query.pid;
+      }
+      this.get_user_list(function() {});
+      this.get_dept_list();
+    }, 200);
   }
+};
 </script>
 
 <style scoped>
-  .employee_selector_box {
-    width: 600px;
-    padding: 24px;
-  }
-
-  /* 搜索框 */
-  .employee_selector_box .search {
-    position: relative;
-    display: table-cell;
-    left: 10%;
-    padding: 0;
-    border: 1px #C0C4CC solid;
-    border-radius: 16.5px;
-  }
-
-  .employee_selector_box .search-box button {
-    display: inline-block;
-    vertical-align: middle;
-    margin-left: 10px;
-    width: auto;
-    padding: 0;
-    background: none;
-    border-radius: 0px;
-    border: none;
-  }
-
-  .employee_selector_box .search-box /deep/ .el-input {
-    display: inline-block;
-    width: 84%;
-    padding: 0 24px 0 6px;
-    background: none;
-    border-radius: 0px;
-    border: none;
-  }
-
-  .employee_selector_box .search-box /deep/ .el-input input {
-    padding: 0;
-    line-height: 34px;
-    border: none;
-  }
-
-  /* /搜索框 */
-
-  /* 左边框 */
-  .employee_selector_box .choose_left {
-    padding: 0 10px;
-    margin: 8px 0;
-  }
-
-  .employee_selector_box .choose_left .employee_cell {
-    border-bottom: 1px #f8f8f8 solid;
-  }
-
-  .employee_selector_box .choose_left .employee_cell_a .employee_cell {
-    border-bottom: none;
-  }
-
-  .employee_selector_box .choose_left .employee_checkbox {
-    padding-left: 8px;
-  }
-
-  .employee_selector_box .choose_left .employee_img_url {
-    padding-left: 8px;
-  }
-
-  .employee_selector_box .choose_left .employee_name {
-    padding-left: 8px;
-  }
-
-  .employee_selector_box /deep/ .el-scrollbar__thumb {
-    width: 2px;
-    margin: 15px 0 0 6px;
-    background: #409EFF;
-  }
-
-  /* 左边框 */
-
-  /* 右边距 */
-  .employee_selector_box .option-box {
-    padding: 14px 0;
-  }
-
-  .employee_selector_box .option-box button {
-    margin-right: 16px;
-  }
-
-  .employee_selector_box .choose_right {
-    padding: 8px 10px;
-  }
-
-  .employee_selector_box .choose_right .employee_delete .el-button {
-    transform: scale(0.5);
-    background: #C0C4CC;
-  }
-
-  .employee_selector_box .choose_right .employee_delete .el-button /deep/ .el-icon-close {
-    color: #fff;
-  }
-
-  .employee_selector_box .choose_right .employee_delete .el-button:active {
-    background: #409EFF;
-  }
-
-  .employee_selector_box .choose_right .employee_delete .el-button:active /deep/ .el-icon-close {
-    color: #FFF;
-  }
-
-  .employee_selector_box .choose_right .employee_cell .employee_name {
-    padding-left: 8px;
-  }
-
-  .employee_selector_box .choose_right .employee_cell .employee_img_url {
-    padding-left: 8px;
-  }
-
-  /* 右边距 */
-
-  .employee_selector_box /deep/ .employee_cell {
-    padding: 8px 0;
-  }
-
-  .employee_selector_box /deep/ .employee_cell:hover {
-    background: #ecf5ff;
-  }
-
-  .employee_cell {
-    display: -webkit-inline-box;
-    cursor: pointer;
-    width: 100%;
-    color: #606266;
-    padding: 8px 0;
-    background-color: transparent;
-  }
-
-  .employee_cell .employee_cell_clear {
-    clear: both;
-  }
-
-  .employee_cell .employee_img_url {
-    display: table-cell;
-    vertical-align: middle;
-    width: 30px;
-    padding-left: 0px;
-  }
-
-  .employee_cell .employee_img_url img {
-    width: 24px;
-    height: 24px;
-    border-radius: 50%;
-  }
-
-  .employee_cell .employee_checkbox {
-    display: table-cell;
-    vertical-align: middle;
-    width: 30px;
-    text-align: center;
-  }
-
-  .employee_cell .employee_name {
-    display: table-cell;
-    vertical-align: middle;
-    color: #606266;
-  }
-
-  .employee_delete {
-    display: table-cell;
-    text-align: right;
-    padding-right: 0px;
-  }
-
-  .employee_cell_a {
-    display: block;
-  }
-
-  .employee_cell_a:hover {
-    background-color: #ecf5ff;
-    border-radius: 4px;
-  }
-
-  .dept_child_cell {
-    display: table-cell;
-    vertical-align: middle;
-  }
-
-  .dept_child_cell span {
-    float: right;
-    padding-right: 8px;
-  }
-
-  .dept_child_cell span:hover {
-    color: #1c1c1c;
-  }
-
-  .dept_child_cell span:active {
-    color: #1c1c1c;
-  }
-
-  .scroller-box {
-    height: 440px;
-    padding-right: 0px !important;
-    background-color: #fdfdfd;
-    border: 1px solid #eee;
-    border-radius: 4px;
-    overflow: hidden;
-  }
-  /* .scroller-box.one{
+.employee_selector_box {
+  width: 600px;
+  padding: 20px;
+  box-sizing: border-box;
+  margin: 0 auto;
+}
+
+/* 搜索框 */
+.employee_selector_box .search {
+  margin: 0 auto;
+  width: 80%;
+}
+
+.employee_selector_box .search-box button {
+  display: inline-block;
+  vertical-align: middle;
+  margin-left: 10px;
+  width: auto;
+  padding: 0;
+  background: none;
+  border-radius: 0px;
+  border: none;
+}
+/* /搜索框 */
+
+/* 左边框 */
+.employee_selector_box .choose_left {
+  padding: 8px 10px 8px 10px;
+}
+
+.employee_selector_box .choose_left .employee_cell {
+  border-bottom: 1px #f8f8f8 solid;
+}
+
+.employee_selector_box .choose_left .employee_cell_a .employee_cell {
+  border-bottom: none;
+}
+
+.employee_selector_box .choose_left .employee_checkbox {
+  padding-left: 8px;
+}
+
+.employee_selector_box .choose_left .employee_img_url {
+  padding-left: 8px;
+}
+
+.employee_selector_box .choose_left .employee_name {
+  padding-left: 8px;
+}
+
+.employee_selector_box ::v-deep .el-scrollbar__thumb {
+  width: 2px;
+  margin: 15px 0 0 6px;
+  background: #409eff;
+}
+
+/* 左边框 */
+
+/* 右边距 */
+.employee_selector_box .option-box {
+  padding: 14px 0;
+}
+
+.employee_selector_box .option-box button {
+  margin-right: 16px;
+}
+
+.employee_selector_box .choose_right {
+  padding: 8px 10px;
+}
+
+.employee_selector_box .choose_right .employee_delete .el-button {
+  transform: scale(0.5);
+  background: #c0c4cc;
+}
+
+.employee_selector_box .choose_right .employee_delete .el-button /deep/ .el-icon-close {
+  color: #fff;
+}
+
+.employee_selector_box .choose_right .employee_delete .el-button:active {
+  background: #409eff;
+}
+
+.employee_selector_box .choose_right .employee_delete .el-button:active /deep/ .el-icon-close {
+  color: #fff;
+}
+
+.employee_selector_box .choose_right .employee_cell .employee_name {
+  padding-left: 8px;
+}
+
+.employee_selector_box .choose_right .employee_cell .employee_img_url {
+  padding-left: 8px;
+}
+
+/* 右边距 */
+
+.employee_selector_box /deep/ .employee_cell {
+  padding: 8px 0;
+}
+
+.employee_selector_box /deep/ .employee_cell:hover {
+  background: #ecf5ff;
+}
+
+.employee_cell {
+  display: -webkit-inline-box;
+  cursor: pointer;
+  width: 100%;
+  color: #606266;
+  padding: 8px 0;
+  background-color: transparent;
+}
+
+.employee_cell .employee_cell_clear {
+  clear: both;
+}
+
+.employee_cell .employee_img_url {
+  display: table-cell;
+  vertical-align: middle;
+  width: 30px;
+  padding-left: 0px;
+}
+
+.employee_cell .employee_img_url img {
+  width: 24px;
+  height: 24px;
+  border-radius: 50%;
+}
+
+.employee_cell .employee_checkbox {
+  display: table-cell;
+  vertical-align: middle;
+  width: 30px;
+  text-align: center;
+}
+
+.employee_cell .employee_name {
+  display: table-cell;
+  vertical-align: middle;
+  color: #606266;
+}
+
+.employee_delete {
+  display: table-cell;
+  text-align: right;
+  padding-right: 0px;
+}
+
+.employee_cell_a {
+  display: block;
+}
+
+.employee_cell_a:hover {
+  background-color: #ecf5ff;
+  border-radius: 4px;
+}
+
+.dept_child_cell {
+  display: table-cell;
+  vertical-align: middle;
+}
+
+.dept_child_cell span {
+  float: right;
+  padding-right: 8px;
+}
+
+.dept_child_cell span:hover {
+  color: #1c1c1c;
+}
+
+.dept_child_cell span:active {
+  color: #1c1c1c;
+}
+
+.scroller-box {
+  height: 440px;
+  padding-right: 0px !important;
+  background-color: #fdfdfd;
+  border: 1px solid #eee;
+  border-radius: 4px;
+  overflow: hidden;
+}
+/* .scroller-box.one{
     height: 440px;
   } */
 
-  .col-line {
-    position: relative;
-    height: 400px;
-  }
-
-  .col-line:before {
-    content: " ";
-    width: 1px;
-    height: 400px;
-    position: absolute;
-    top: 0;
-    bottom: 0;
-    left: 50%;
-    background-color: #eee;
-  }
-
-  .search-box {
-    background-color: #fff;
-    padding: 14px 5px;
-    border-bottom: 1px solid #eee;
-    margin: 0 -5px;
-  }
-
-  .option-box {
-    padding: 5px;
-    background-color: #fff;
-    border-bottom: 1px solid #eee;
-    margin: 0 -5px;
-    text-align: right;
-  }
-
-  .child_btn {
-    color: #409EFF;
-  }
-  .dept_path{
-    margin: 10px 0;
-    display: block;
-    white-space: nowrap;
-    overflow: auto;
-  }
-
-  /*滚动条的宽度*/
-
-  .dept_path::-webkit-scrollbar {
-    width:5px;
-    height:5px;
-  }
-
-  /*外层轨道。可以用display:none让其不显示,也可以添加背景图片,颜色改变显示效果*/
-
-  .dept_path::-webkit-scrollbar-track {
-    width: 6px;
-    background-color:#fff0;
-    -webkit-border-radius: 2em;
-    -moz-border-radius: 2em;
-    border-radius:2em;
-  }
-
-  /*滚动条的设置*/
-
-  .dept_path::-webkit-scrollbar-thumb {
-    background-color:#fff0;
-    background-clip:padding-box;
-    min-height:28px;
-    -webkit-border-radius: 2em;
-    -moz-border-radius: 2em;
-    border-radius:2em;
-  }
-  /*滚动条移上去的背景*/
-
-  .dept_path:hover::-webkit-scrollbar-thumb{
-    background-color:rgba(144,147,153,.3);
-  }
-  .scrollbarHeight1{
-    height: 320px;
-  }
-  .scrollbarHeight2{
-    height: 340px;
-  }
+.col-line {
+  position: relative;
+  height: 400px;
+}
+
+.col-line:before {
+  content: ' ';
+  width: 1px;
+  height: 400px;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 50%;
+  background-color: #eee;
+}
+
+.search-box {
+  background-color: #fff;
+  padding: 14px 5px;
+  border-bottom: 1px solid #eee;
+  margin: 0 -5px;
+}
+
+.option-box {
+  padding: 5px;
+  background-color: #fff;
+  border-bottom: 1px solid #eee;
+  margin: 0 -5px;
+  text-align: right;
+}
+.child_btn {
+  color: #409eff;
+}
+.scrollbarHeight1 {
+  height: 310px;
+}
+.scrollbarHeight2 {
+  height: 350px;
+}
 </style>

+ 1 - 1
src/views/integral/EmployeeTable.vue

@@ -22,7 +22,7 @@
                 :props="{ children: 'children', label: 'name' , value: 'id'}"
                 @node-click="handleNodeClick"
                 :accordion="true"
-                empty-text="您暂无部门数据,请同步钉钉通讯录"
+                empty-text="您暂无部门数据,请同步微信通讯录"
               >
                 <div
                   content="tree"

+ 77 - 6
src/views/layout/components/Navbar.vue

@@ -72,7 +72,22 @@
         </div>
       </div>
     </el-dialog> -->
-    <el-dialog
+    
+		<el-dialog title="设置向导" :visible.sync="usingTheStrategy" width="600px">
+      <div v-for="(item,index) in routers_one" :key="index">
+				<div class="wn-title fontColorF">{{item.name}}</div>
+				<div class="flex-box flex-v-ce wn-box">
+					<div v-for="(arr,att) in item.item" :key="att" class="flex-1 flex-box-v flex-v-ce"  @click="usingTheStrategy= false;$router.push({ path: arr.push })">
+						<!-- <div><span class="iconfont " :class="arr.icon"></span></div> -->
+						<div><svg-icon slot="reference" :icon-class="arr.icon" /></div>
+						<div>{{arr.name}}</div>
+					</div>
+				</div>
+			</div>
+		</el-dialog>
+
+  <!-- 老-导航 -->
+    <!-- <el-dialog
       title="轻松四步落地积分+绩效管理体系"
       :visible.sync="usingTheStrategy"
       width="680px">
@@ -80,7 +95,6 @@
             <el-col :span="8" style="padding:20px 0 20px 0;">
               <el-menu default-active="0" class="el-menu-vertical-demo" style="border: none">
                 <el-menu-item :index="index.toString()" v-for="(item,index) in activeName" :key="index" @click="open_right(item)" style="margin-bottom:20px;position: relative;height:40px;line-height:40px;">
-                  <!-- <b style="display: inline-block;font-size:16px;border-radius:50%;width:23px;height:23px;line-height:23px;border:1px solid rgb(234 234 234);text-align:center;">{{index+1}}</b> -->
                   <b style="display: inline-block;font-size:16px;text-align:center;">{{index+1}}&nbsp;&nbsp;</b>
                   <span slot="title">{{item.name}}</span>
                   <span v-if="index<activeName.length-1" style="width:1px;height:15px;border:1px solid rgb(224 224 224);position: absolute;bottom:-17px;left:23px;"></span>
@@ -88,13 +102,11 @@
               </el-menu>
             </el-col>
             <el-col :span="1" style="height:370px;border-right:1px solid rgb(234 234 234);">
-               
             </el-col>
             <el-col :span="15" style="padding:20px 0 20px 0;">
               <div>
                 <el-row>
                   <div style="text-align:center;margin-top:25px;color: #35353a;font-size:16px;">{{activeNameRig.name}}</div>
-
                   <div v-if="activeNameRig.code=='0'|| activeNameRig.code=='1'" :style="'display:flex;justify-content: space-around;margin:75px auto 0;width:'+usingwidth+'px;flex-wrap:wrap;'">
                     <div v-for="(item,index) in activeNameRig.item" :key="index" >
                       <div style="text-align:center;display:flex;">
@@ -107,7 +119,6 @@
                       </div>
                     </div>
                   </div>
-
                   <div v-if="activeNameRig.code=='2' || activeNameRig.code=='3'" :style="'display:flex;justify-content: space-around;margin:20px auto 0;width:'+usingwidth+'px;flex-wrap:wrap;'">
                     <el-col :span="activeNameRig.code=='2'?14:24" style="display:flex;flex-wrap:wrap;justify-content: space-around;text-align:center;margin-left:20px;position: relative;">
                       <svg-icon icon-class="add" style="font-size:30px;position: absolute;top:45%;" />
@@ -136,7 +147,7 @@
               </div>
             </el-col>
           </el-row>
-    </el-dialog>
+    </el-dialog> -->
 
     <el-dialog
       title="创建新企业"
@@ -256,6 +267,24 @@
       // let companeyListMap = {}
       // companeyListMap[site_id.toString()] = ''
       return {
+        routers_one: [
+          {
+            name: '三步轻松搭建积分管理体系:定人员、分责权、建制度',
+            item: [
+              {icon: 'employee_table_icon',name: '1、确定组织架构',push: '/employee_table'},
+              {icon: 'set_role_icon',name: '2、分配角色权限',push: '/set_role'},
+              {icon: 'rule_manage_icon',name: '3、建立积分规则',push: '/rule_manage'},
+            ],
+          },
+          {
+            name: '更有效地做好积分激励和认可,你还可以设置以下2项',
+            item: [
+              {icon: 'set_basics_icon',name: '初始分',push: '/set_basics'},
+              // {icon: '',name: '考勤积分',push: ''},
+              {icon: 'fixed_integral_icon',name: '自动积分',push: '/fixed_integral'},
+            ],
+          }
+        ],
         tutorialsvisible:false,
         usingmarginL:'26',
         usingwidth:'220',
@@ -1408,4 +1437,46 @@
     padding-left:8px;
     border-left:2px solid #3caaff;
   }
+  
+  .fontColorF {
+    color: #606266;
+  }
+  
+.wn-box{
+	padding: 20px 0;
+}
+.wn-box .flex-1{
+	cursor: pointer;
+}
+.wn-box .flex-1 div:nth-child(1){
+	width: 55px;
+	height: 55px;
+	border-radius: 50%;
+	text-align: center;
+	line-height: 55px;
+	background-color: #E0F2FF;
+	color: #26A2FF;
+	margin-bottom: 20px;
+}
+.wn-box .flex-1 div:nth-child(2){
+	width: 140px;
+	border-radius: 25px;
+	border: 1px solid #26A2FF;
+	padding:7px 10px;
+	text-align: center;
+	color: #26A2FF;
+}
+.wn-box .flex-1:hover div:nth-child(1){
+	color: #fff;
+	background-color: #26A2FF;
+}
+
+.wn-box .flex-1:hover div:nth-child(2){
+	color: #fff;
+	background-color: #26A2FF;
+}
+.wn-box .svg-icon{
+  font-size: 22px;
+  margin-top: 16px;
+}
 </style>

+ 1 - 1
src/views/setting/fixed_integral.vue

@@ -319,7 +319,7 @@
           ></EmployeeSelector1> -->
           
           <EmployeeSelector1
-            :max="add_employee_max"=
+            :max="add_employee_max"
             :visible.sync="add_employee_visible"
             @confirm="add_employee_confirm"
             ref="Employee"

+ 65 - 22
src/views/setting/set_role.vue

@@ -38,8 +38,8 @@
                   <el-col :span="16" style="width:100%">
                       <el-button type="danger" @click="del_btn" v-show="table_list != null && table_list.length != 0">删除</el-button>
                       <el-button type="primary" @click="add_employee_show = true">添加</el-button>
-                      <!-- <el-button type="primary"  v-if="item_info.code == 'dept_manager'" @click="syncScope"><i class="el-icon-refresh"></i>同步管理范围</el-button>
-                      <el-button  v-if="item_info.code == 'dept_manager'" @click="exportEmploye = true">导出/修改管理列表</el-button> -->
+                      <!-- <el-button type="primary"  v-if="item_info.code == 'dept_manager'" @click="syncScope"><i class="el-icon-refresh"></i>同步管理范围</el-button> -->
+                      <!-- <el-button  v-if="item_info.code == 'dept_manager'" @click="exportEmploye = true">导出/修改管理列表</el-button> -->
                       <div class="gap-right-8 fr" style="display:inline-block; width:180px;" v-if="item_info.code == 'dept_manager'">
                         <el-input
                           placeholder="搜索员工姓名"
@@ -251,7 +251,14 @@
       </el-tabs>
     </el-row>
 
-    <el-dialog
+    <!-- 添加人员 -->
+      <EmployeeSelector
+      title="添加管理人员"
+      :isChecKedAll="true"
+      :visible.sync="add_employee_show"
+      @confirm="add_employee_confirm"
+      />
+    <!-- <el-dialog
       title="添加人员"
       :visible.sync="add_employee_show"
       :before-close="publicClose"
@@ -261,7 +268,7 @@
          <el-button @click="publicClose()">取消</el-button>
          <el-button type="primary" @click="sub_add_employee">完成</el-button>
        </span>
-    </el-dialog>
+    </el-dialog> -->
 
     <el-dialog
       title="数据查看权限"
@@ -284,7 +291,17 @@
       </span>
     </el-dialog>
 
-    <el-dialog
+    <!-- 设置管理范围 -->
+    <EmployeeSelector
+      title="设置管理范围"
+      :isChecKedAll="true"
+      :max='add_employee_max'
+      :selected="management_scope_arr"
+      :visible.sync="management_scope_show"
+      :employee_not_select ="control_limit"
+      @confirm="management_scope_confirm"
+      />
+    <!-- <el-dialog
       title="设置管理范围"
       :visible.sync="management_scope_show"
       :before-close="publicClose"
@@ -294,7 +311,7 @@
         <el-button @click="publicClose()">取消</el-button>
         <el-button type="primary" @click="sub_management_scope">完成</el-button>
       </span>
-    </el-dialog>
+    </el-dialog> -->
 
     <el-dialog
       title="设置积分权限"
@@ -553,6 +570,7 @@
   </div>
 </template>
 <script>
+  import EmployeeSelector from '@/views/common/EmployeeSelector'
   import EmployeeSelector1 from '@/views/common/EmployeeSelector1'
   import {getToken} from '@/utils/auth'
   import ApproverSet from './approver_set'
@@ -579,7 +597,7 @@
 
         activeName: 'first',//选项卡,默认选中
 
-        control_limit:'',
+        control_limit: [],
         role_loading:false,
         table_loading:false,
         permissions_loading:false,
@@ -715,7 +733,7 @@
         ],
       };
     },
-    components: {EmployeeSelector1,ApproverSet},
+    components: {EmployeeSelector1, EmployeeSelector, ApproverSet},
     watch:{
       checked(val){
       },
@@ -1117,7 +1135,7 @@
       add_management_scope(item){
         let self = this
         self.list_info = item;
-        this.control_limit = item.id
+        this.control_limit = [item.id],//设置选人员时排除设置的人
         self.employee_not_select = [item.id]
         let employeeList=JSON.parse(localStorage.getItem("SET_EMPLOYEE_MAP"));//获取员工信息
         self.management_scope_arr.employee=[];
@@ -1138,10 +1156,14 @@
           self.role_loading = false
         })
       },
-      //设置管理范围
-      sub_management_scope(){
-        let self = this;
-        this.$refs.Employee.confirm();//调用组件的confirm();
+      
+      //添加编辑管理范围
+      management_scope_confirm(val){
+        let self = this
+        self.management_arr = []
+        val.employee.forEach(element => {
+          self.management_arr.push(element.id)
+        });
         self.$http('POST','/api/employee/scope',{employee_id: self.list_info.id,id: self.management_arr},).then((res) => {
           if (res.data.code == 1) {
             self.$message.success("设置成功!")
@@ -1151,15 +1173,36 @@
               }
             });
             self.management_scope_show = false
-            window.plus?plus.storage.removeItem('SET_EMPLOYEE_MAP'):localStorage.removeItem('SET_EMPLOYEE_MAP')
             this.$nextTick(() => {
               this.$store.dispatch('get_employee_map').then((res) => {})
             })
           } else{
             self.$message.error(res.data.msg)
           }
-        }).catch((e) => {self.$message.error(e.data.msg)})
+        })
       },
+      //设置管理范围
+      // sub_management_scope(){
+      //   let self = this;
+      //   this.$refs.Employee.confirm();//调用组件的confirm();
+      //   self.$http('POST','/api/employee/scope',{employee_id: self.list_info.id,id: self.management_arr},).then((res) => {
+      //     if (res.data.code == 1) {
+      //       self.$message.success("设置成功!")
+      //       self.table_list.forEach(element => {
+      //         if (element.id == self.list_info.id) {
+      //           element.manage_scope_count = self.management_arr.length
+      //         }
+      //       });
+      //       self.management_scope_show = false
+      //       window.plus?plus.storage.removeItem('SET_EMPLOYEE_MAP'):localStorage.removeItem('SET_EMPLOYEE_MAP')
+      //       this.$nextTick(() => {
+      //         this.$store.dispatch('get_employee_map').then((res) => {})
+      //       })
+      //     } else{
+      //       self.$message.error(res.data.msg)
+      //     }
+      //   }).catch((e) => {self.$message.error(e.data.msg)})
+      // },
       edit_permissions(){
         let self = this
         let data = {role_id: self.item_info.id,permissions: []}
@@ -1308,13 +1351,13 @@
         this.postData()
       },
       //添加编辑管理范围
-      management_scope_confirm(val){
-        let self = this
-        self.management_arr = []
-        val.employee.forEach(element => {
-          self.management_arr.push(element.id)
-        });
-      },
+      // management_scope_confirm(val){
+      //   let self = this
+      //   self.management_arr = []
+      //   val.employee.forEach(element => {
+      //     self.management_arr.push(element.id)
+      //   });
+      // },
        //公共弹窗关闭
       publicClose(){
 

File diff suppressed because it is too large
+ 412 - 253
src/views/statistics_new/dept_rank.vue


+ 80 - 3
src/views/statistics_new/integral_event.vue

@@ -88,9 +88,11 @@
       </el-row>
 
       <el-row :gutter="20" style="margin-bottom: 20px;">
-        <el-col :span="7">
+        <el-col :span="4">
           <!-- <el-button type="primary" @click="excelImportShow = true">导入数据</el-button> -->
-          <el-button type="primary" @click="exportExcel">导出当前数据</el-button>
+          <el-button type="primary" @click="exportExcel" :disabled="deriveDis">导出当前数据</el-button>
+          <!-- <a :href="aherfUrl" ref="aherfClick" v-if="aherfUrl != ''" v-trigger></a> -->
+          <a :href="aherfUrl" ref="aherfClick"></a>
         </el-col>
         <el-col :span="17">
           <!-- <el-button type="primary" plain @click="swiperShowTrue">轮播排名</el-button> -->
@@ -406,6 +408,11 @@ export default {
       selectionID:[],//删除的事件ID
       toPdept:0,
       dropOuOfPers:[],
+
+      deriveJobId: '',
+      deriveJobIf: 0,
+      deriveDis: false,
+      aherfUrl: '',
     };
   },
   components: { noData },
@@ -465,6 +472,14 @@ export default {
       })
     }
   },
+  // directives: {
+  //   aderivecli:{
+  //     inserted(el,binging){
+  //       console.log(el)
+  //       // el.click()
+  //     }
+  //   }
+  // },
   methods: {
     takePartIn(){
       this.$refs['dropOuOfref'].visible = true
@@ -601,7 +616,69 @@ export default {
       }
     },
     onFilePreView() {},
+    downloadResult(){
+      if(this.deriveJobIf < 5){
+        this.$http('get','/api/download/result',{job_id: this.deriveJobId}).then((res)=>{
+          if(res.data.code == 1){
+            // window.open(res.data.data.url)
+            // window.location.href = res.data.data.url
+            this.aherfUrl = res.data.data.url
+            this.deriveJobId = ''
+            this.deriveDis = false
+            this.$nextTick(()=>{
+              this.$refs.aherfClick.click()
+              // this.aderivecli()
+            })
+          }else{
+            setTimeout(()=>{
+              this.deriveJobIf++
+              this.downloadResult()
+            },3000)
+          }
+        })
+      }else{
+        this.deriveJobIf = 0
+        this.deriveJobId = ''
+        this.deriveDis = false
+        this.aherfUrl = ''
+        this.$message.warning('导出超时');
+      }
+    },
     exportExcel() {
+      this.aherfUrl = ''
+      this.$confirm('确认导出积分事件?', '导出', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.deriveDis = true
+        let params = {
+          employee_id: this.$store.getters.user_info.id,
+          page: this.formData.page,
+          page_size: this.formData.page_size,
+        }
+        this.formData.rule_id ? params.rule_id = this.formData.rule_id : ''
+        this.formData.pt_id ? params.pt_id = this.formData.pt_id : ''
+        this.formData.employee_ids ? params.employee_ids = this.formData.employee_ids : ''
+        this.formData.dept_id ? params.dept_ids = this.formData.dept_id : ''
+        this.formData.start_day ? params.start_day = this.formData.start_day : ''
+        this.formData.end_day ? params.end_day = this.formData.end_day : ''
+        this.formData.keyword ? params.keyword = this.formData.keyword : ''
+        this.$http('get','/api/download/integral',params).then((res)=>{
+          if(res.data.code == 1){
+            this.deriveJobId = res.data.data.job_id
+            this.downloadResult()
+          }else{
+            this.deriveDis = false
+          }
+        })
+      }).catch(() => {
+
+      })
+      
+      return
+      window.open('https://open.work.weixin.qq.com/wwopen/openData/getTranslateContactOpenData?dataid=_Q-jZZifks4nhgXAXmSGYJwMC40p3sGyeeKZV2I79e0')
+      return
       let token = this.$getToken?this.$getToken:getToken()
       window.open(
         this.publicBASE_API +'/api/download/integral?employee_id=' +this.$store.getters.user_info.id +'&page=' + this.formData.page +'&page_size=' +this.formData.page_size +
@@ -610,7 +687,7 @@ export default {
           (this.formData.employee_ids ? '&employee_ids=' + this.formData.employee_ids : '') +
           (this.formData.dept_id ? '&dept_ids=' + this.formData.dept_id : '') +
           (this.formData.start_day ? '&start_day=' + this.formData.start_day : '') +
-          (this.formData.end_day ? '&end_day=' + this.formData.end_day : '') +
+          (this.formData.end_day ? '&end_day=' + this.formData.end_day : '') +0
           (this.formData.keyword ? '&keyword=' + this.formData.keyword : '')+
           '&token='+token,
         '_blank'

+ 617 - 438
src/views/statistics_new/integral_statistics.vue

@@ -1,477 +1,656 @@
 <template>
   <div>
-		<div class="integral_statistics_box">
-			<el-row :gutter="10" style="margin-bottom: 20px;margin-right:8px;">
-				<el-col :span="5">
-					<el-date-picker v-model="formData.month" type="month" placeholder="请选择月份" value-format="yyyy-MM"></el-date-picker>
-				</el-col>
-				<el-col :span="5">
-					<deptData  deptStyle="width:150px;left:200px;" v-if="toPdept1 && toPdept1!=0" :refsName="$refs.dept1" :toPdept="toPdept1"></deptData>
-					<el-cascader
-						v-model="dept_name"
-						:options="dept_tree"
-						@change="dept1_null"
-              			:props="{ label: 'name', value: 'id'}"
-						ref="dept1"
-						filterable
-						change-on-select
-						placeholder="请选择部门"
-						clearable
-					>
-						<template slot-scope="{ node, data }">
-							<span>
-							<WWOpenData type="departmentName" :openid="data.name"></WWOpenData>
-							</span>
-							<!-- <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> -->
-						</template>
-					</el-cascader>
-				</el-col>
-				<el-col :span="5" class="search">
-					<el-input v-model="formData.keyword" placeholder="输入同事姓名" @keyup.enter.native="get_all_integral">
-						<el-button slot="append" @click="get_all_integral" icon="el-icon-search"></el-button>
-					</el-input>
-				</el-col>
-				<el-col :offset='6' :span="3">
-					<!-- <el-button class="company_intergral_button" @click="export_all" type="primary">导出报表</el-button> -->
-				</el-col>
-			</el-row>
+    <div class="integral_statistics_box">
+      <el-row :gutter="10" style="margin-bottom: 20px;margin-right:8px;">
+        <el-col :span="5">
+          <el-date-picker
+            v-model="formData.month"
+            type="month"
+            placeholder="请选择月份"
+            value-format="yyyy-MM"
+          ></el-date-picker>
+        </el-col>
+        <el-col :span="5">
+          <deptData
+            deptStyle="width:150px;left:200px;"
+            v-if="toPdept1 && toPdept1 != 0"
+            :refsName="$refs.dept1"
+            :toPdept="toPdept1"
+          ></deptData>
+          <el-cascader
+            v-model="dept_name"
+            :options="dept_tree"
+            @change="dept1_null"
+            :props="{ label: 'name', value: 'id' }"
+            ref="dept1"
+            filterable
+            change-on-select
+            placeholder="请选择部门"
+            clearable
+          >
+            <template slot-scope="{ node, data }">
+              <span>
+                <WWOpenData
+                  type="departmentName"
+                  :openid="data.name"
+                ></WWOpenData>
+              </span>
+              <!-- <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> -->
+            </template>
+          </el-cascader>
+        </el-col>
+        <el-col :span="5" class="search">
+          <el-input
+            v-model="formData.keyword"
+            placeholder="输入同事姓名"
+            @keyup.enter.native="get_all_integral"
+          >
+            <el-button
+              slot="append"
+              @click="get_all_integral"
+              icon="el-icon-search"
+            ></el-button>
+          </el-input>
+        </el-col>
+        <el-col :offset="6" :span="3">
+          <el-button
+            class="company_intergral_button"
+            @click="export_all"
+            type="primary"
+            :disabled="deriveDis"
+            >导出报表</el-button
+          >
+          <a :href="aherfUrl" ref="aherfClick"></a>
+        </el-col>
+      </el-row>
 
-			<el-table :data="all_integral_list" style="width: 100%" v-loading="loading" @row-click="open_all_integral">
-				<el-table-column prop="employee_name" label="姓名" align="left">
-					<template slot-scope="scope">
-						<span class="fl">
-							<userImage :id="scope.row.employee_id" width="50px" height="50px" :user_name="scope.row.employee_name"></userImage>
-						</span>
-						<span style="margin-left: 10px; line-height: 50px; display: inline-block"><WWOpenData type="userName" :openid="scope.row.employee_name"></WWOpenData></span>
-					</template>
-				</el-table-column>
-				<el-table-column prop="performance" label="绩效分" align="center">
-					<template slot-scope="scope">
-						<span :class="scope.row.performance < 0?'color_green':''">{{scope.row.performance}}</span>
-					</template>
-				</el-table-column>
-				<el-table-column prop="a" label="A分" align="center">
-					<template slot-scope="scope">
-						<span :class="scope.row.a < 0?'color_green':''">{{scope.row.a}}</span>
-					</template>
-				</el-table-column>
-				<el-table-column prop="b" label="B分" align="center">
-					<template slot-scope="scope">
-						<span :class="scope.row.b < 0?'color_green':''">{{scope.row.b}}</span>
-					</template>
-				</el-table-column>
-					
-				<template slot="empty">
-					<noData></noData>
-				</template>
+      <el-table
+        :data="all_integral_list"
+        style="width: 100%"
+        v-loading="loading"
+        @row-click="open_all_integral"
+      >
+        <el-table-column prop="employee_name" label="姓名" align="left">
+          <template slot-scope="scope">
+            <span class="fl">
+              <userImage
+                :id="scope.row.employee_id"
+                width="50px"
+                height="50px"
+                :user_name="scope.row.employee_name"
+              ></userImage>
+            </span>
+            <span
+              style="margin-left: 10px; line-height: 50px; display: inline-block"
+              ><WWOpenData
+                type="userName"
+                :openid="scope.row.employee_name"
+              ></WWOpenData
+            ></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="performance" label="绩效分" align="center">
+          <template slot-scope="scope">
+            <span :class="scope.row.performance < 0 ? 'color_green' : ''">{{
+              scope.row.performance
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="a" label="A分" align="center">
+          <template slot-scope="scope">
+            <span :class="scope.row.a < 0 ? 'color_green' : ''">{{
+              scope.row.a
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="b" label="B分" align="center">
+          <template slot-scope="scope">
+            <span :class="scope.row.b < 0 ? 'color_green' : ''">{{
+              scope.row.b
+            }}</span>
+          </template>
+        </el-table-column>
 
-			</el-table>
+        <template slot="empty">
+          <noData></noData>
+        </template>
+      </el-table>
 
-			<center style="padding: 20px 0;">
-				<el-pagination
-					background
-					@size-change="handleSizeChange1"
-					@current-change="handleCurrentChange"
-					:current-page="formData.page"
-      				:page-sizes="[10, 20, 50, 100]"
-					layout="total, sizes, prev, pager, next"
-					:page-size="pageLimit1"
-					:total="total">
-				</el-pagination>
-			</center>
-
-			<el-drawer
-				:visible.sync="all_integral_show"
-				:before-close="drawer_close"
-				:with-header="false">
-				<div class="drawer_title"><WWOpenData type="userName" :openid="all_integral_row.employee_name"></WWOpenData>的积分</div>
-				<div style="padding: 30px">
-					<el-row>
-						<el-col :span="24">
-							<el-radio v-model="radio" label="1">B分</el-radio>
-							<el-radio v-model="radio" label="2">A分</el-radio>
-							<el-radio v-model="radio" label="3">绩效分</el-radio>
-						</el-col>
-					</el-row>
-				</div>
-				<div v-show="noChartData">
-					<div class="nopoint_box">
-						<div class="noimg noperson"></div>
-						<span class="title">没有对应的数据</span>
-					</div>
-				</div>
-				<div id="chartLineBox" v-loading="chartLoading" v-show="!noChartData" style="height: 300px;"></div>
-			</el-drawer>
+      <center style="padding: 20px 0;">
+        <el-pagination
+          background
+          @size-change="handleSizeChange1"
+          @current-change="handleCurrentChange"
+          :current-page="formData.page"
+          :page-sizes="[10, 20, 50, 100]"
+          layout="total, sizes, prev, pager, next"
+          :page-size="pageLimit1"
+          :total="total"
+        >
+        </el-pagination>
+      </center>
 
+      <el-drawer
+        :visible.sync="all_integral_show"
+        :before-close="drawer_close"
+        :with-header="false"
+      >
+        <div class="drawer_title">
+          <WWOpenData
+            type="userName"
+            :openid="all_integral_row.employee_name"
+          ></WWOpenData
+          >的积分
+        </div>
+        <div style="padding: 30px">
+          <el-row>
+            <el-col :span="24">
+              <el-radio v-model="radio" label="1">B分</el-radio>
+              <el-radio v-model="radio" label="2">A分</el-radio>
+              <el-radio v-model="radio" label="3">绩效分</el-radio>
+            </el-col>
+          </el-row>
+        </div>
+        <div v-show="noChartData">
+          <div class="nopoint_box">
+            <div class="noimg noperson"></div>
+            <span class="title">没有对应的数据</span>
+          </div>
+        </div>
+        <div
+          id="chartLineBox"
+          v-loading="chartLoading"
+          v-show="!noChartData"
+          style="height: 300px;"
+        ></div>
+      </el-drawer>
     </div>
   </div>
 </template>
 <script>
-	import { getToken } from '@/utils/auth';
-  	import echarts from 'echarts'
-	import season from '@/components/season'
-	import noData from '@/components/noData'
+import { getToken } from "@/utils/auth";
+import echarts from "echarts";
+import season from "@/components/season";
+import noData from "@/components/noData";
 
-  export default {
-    data() {
-      return {
-        value5: null,
-				checked: true,
-				loading: false,
-				all_integral_list: null,
-				formData:{
-					month: this.$moment().format('YYYY-MM'),
-					keyword: '',
-					dept_id: '',
-					page: 1,
-					page_size: 10
-				},
-				total: 0,
-				dept_tree: [],
-				dept_name:[],
-				sort_checked: false,
-				point_types: JSON.parse(localStorage.getItem('SET_POINT_TYPES')),
-				integral_ranking_list:[],
-				all_integral_show: false,
-				all_integral_row: {},
-				chartLine: null,
-				radio: '1',
-				pageLimit1: 10,
-				noChartData: false,
-				chartLoading: false,
-				toPdept1:0,
-      };
-    },
-    components: {season,noData},
-    methods: {
-			// 
-      handleSizeChange1(val){
-        this.pageLimit1 = val
-        this.formData.page_size = this.pageLimit1
-        this.get_all_integral()
+export default {
+  data() {
+    return {
+      value5: null,
+      checked: true,
+      loading: false,
+      all_integral_list: null,
+      formData: {
+        month: this.$moment().format("YYYY-MM"),
+        keyword: "",
+        dept_id: "",
+        page: 1,
+        page_size: 10
       },
-			open_all_integral(row, column, event){
-				this.all_integral_show = true
-				this.all_integral_row = row
-				this.initEChartOption()
-				this.$nextTick(() => {
-					this.chartLine = echarts.init(document.getElementById('chartLineBox'))
-				})
-				this.get_Bdata()
-			},
-      handleCurrentChange(val){
-				this.formData.page = val
-        this.get_all_integral()
-      },
-			drawer_close(){
-				this.all_integral_show = false
-				this.radio = '1'
-			},
-      get_all_integral() {
-        let self = this
-        self.loading = true
-        self.$http('get','/api/integral/statistics/list',self.formData).then((res) => {
+      total: 0,
+      dept_tree: [],
+      dept_name: [],
+      sort_checked: false,
+      point_types: JSON.parse(localStorage.getItem("SET_POINT_TYPES")),
+      integral_ranking_list: [],
+      all_integral_show: false,
+      all_integral_row: {},
+      chartLine: null,
+      radio: "1",
+      pageLimit1: 10,
+      noChartData: false,
+      chartLoading: false,
+      toPdept1: 0,
+
+      deriveJobId: "",
+      deriveJobIf: 0,
+      deriveDis: false,
+      aherfUrl: ""
+    };
+  },
+  components: { season, noData },
+  methods: {
+    //
+    handleSizeChange1(val) {
+      this.pageLimit1 = val;
+      this.formData.page_size = this.pageLimit1;
+      this.get_all_integral();
+    },
+    open_all_integral(row, column, event) {
+      this.all_integral_show = true;
+      this.all_integral_row = row;
+      this.initEChartOption();
+      this.$nextTick(() => {
+        this.chartLine = echarts.init(document.getElementById("chartLineBox"));
+      });
+      this.get_Bdata();
+    },
+    handleCurrentChange(val) {
+      this.formData.page = val;
+      this.get_all_integral();
+    },
+    drawer_close() {
+      this.all_integral_show = false;
+      this.radio = "1";
+    },
+    get_all_integral() {
+      let self = this;
+      self.loading = true;
+      self
+        .$http("get", "/api/integral/statistics/list", self.formData)
+        .then(res => {
           if (res.data.code == 1) {
-            self.all_integral_list = res.data.data.list
-            self.total = res.data.data.total
+            self.all_integral_list = res.data.data.list;
+            self.total = res.data.data.total;
           } else {
-            self.$message.error(res.data.data.msg)
+            self.$message.error(res.data.data.msg);
           }
-        }).finally(() => {
-          self.loading = false
         })
-      },
-			dept1_null(val){
-      			this.toPdept1 = val[val.length-1]
-				if(val.length == 0){
-					this.formData.dept_id = 0
-				}else{
-					this.formData.dept_id = this.dept_name[this.dept_name.length-1]
-				}
-				this.$nextTick(()=>{
-					this.$refs.dept1.dropDownVisible = false; 
-				})
-			},
-			export_all(){
-        		let token = this.$getToken?this.$getToken:getToken()
-				window.open(process.env.BASE_API+'/api/download/list?month='+this.formData.month+'&keyword='+this.formData.keyword+'&dept_id='+this.formData.dept_id+'&async=0&data_type=2&employee_id='+this.$store.getters.user_info.id+'&token='+token,'_blank')
-			},
-      initEChartOption () {
-        this.option = {
-          tooltip: {show: false},
-          grid: {
-            containLabel: true,
-            top: '4%',
-            right: '4%',
-            bottom: '5%',
-            left: '7%'
-          },
-          xAxis: {
-            type: 'category',
-            boundaryGap: false,
-            axisLine: {lineStyle: {color: '#eee'}},
-            axisLabel: {color: '#333'}
-          },
-          yAxis: {
-            position: 'right',
-            axisLine: {lineStyle: {color: '#eee'}},
-            axisLabel: {color: '#333'},
-            type: 'value',
-            splitLine: {lineStyle: {color: '#eee'}}
-          },
-          series: {
-            type: 'line',
-            lineStyle: {normal: {color: '#26A2FF'}}
+        .finally(() => {
+          self.loading = false;
+        });
+    },
+    dept1_null(val) {
+      this.toPdept1 = val[val.length - 1];
+      if (val.length == 0) {
+        this.formData.dept_id = 0;
+      } else {
+        this.formData.dept_id = this.dept_name[this.dept_name.length - 1];
+      }
+      this.$nextTick(() => {
+        this.$refs.dept1.dropDownVisible = false;
+      });
+    },
+    downloadResult() {
+      if (this.deriveJobIf < 5) {
+        this.$http("get", "/api/download/result", {
+          job_id: this.deriveJobId
+        }).then(res => {
+          if (res.data.code == 1) {
+            // window.open(res.data.data.url)
+            // window.location.href = res.data.data.url
+            this.aherfUrl = res.data.data.url;
+            this.deriveJobId = "";
+            this.deriveDis = false;
+            this.$nextTick(() => {
+              this.$refs.aherfClick.click();
+              // this.aderivecli()
+            });
+          } else {
+            setTimeout(() => {
+              this.deriveJobIf++;
+              this.downloadResult();
+            }, 3000);
           }
-        }
-			},
-			// A分
-      get_Adata () {
-				let self = this
-				let month = self.formData.month
-				if(!month){month = self.$moment().format('YYYY-MM')}
-				self.chartLoading = true
-        self.$http('get','/api/integral/statistics/a',{employee_id: self.all_integral_row.employee_id, month: month}).then(res => {
-					if (res.data.code == 1) {
-						const xAxisData = []
-						const {a, chart, list} = res.data.data
-						if (Object.keys(chart)) {
-							self.noChartData = false
-							const points = chart.reward.map((rewardItem, index) => {
-								xAxisData.push(rewardItem.month)
-								return rewardItem.point + (chart.deduction[index].point || 0)
-							})
-							this.setEChartOption(xAxisData, points)
-						} else {
-							self.noChartData = true
-						}
+        });
+      } else {
+        this.deriveJobIf = 0;
+        this.deriveJobId = "";
+        this.deriveDis = false;
+        this.aherfUrl = "";
+        this.$message.warning("导出超时");
+      }
+    },
+    export_all() {
+      this.aherfUrl = "";
+      this.$confirm("确认导出统计报表?", "导出", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.deriveDis = true;
+          let params = {
+            month: this.formData.month,
+            keyword: this.formData.keyword,
+            dept_id: this.formData.dept_id,
+            async: 0,
+            data_type: 2,
+            employee_id: this.$store.getters.user_info.id
+          };
+          this.$http("get", "/api/download/list", params).then(res => {
+            if (res.data.code == 1) {
+              this.deriveJobId = res.data.data.job_id;
+              this.downloadResult();
+            } else {
+              this.deriveDis = false;
+            }
+          });
+        })
+        .catch(() => {});
 
-					}
-				}).catch(e => {self.$message.error(e.data.msg)}).finally(() => {self.chartLoading = false})
-			},
-			// B分
-      get_Bdata () {
-				let self = this
-				let month = self.formData.month
-				if(!month){month = self.$moment().format('YYYY-MM')}
-				self.chartLoading = true
-        self.$http('get','/api/integral/statistics/b',{employee_id: self.all_integral_row.employee_id, month: month}).then(res => {
-					if (res.data.code == 1) {
-						const xAxisData = []
-						const {b, chart, good, bad} = res.data.data
-						if(Object.keys(chart)){
-							self.noChartData = false
-							const points = chart.reward.map((rewardItem, index) => {
-								xAxisData.push(rewardItem.month)
-								return rewardItem.point + (chart.deduction[index].point|| 0)
-							})
-							this.setEChartOption(xAxisData, points)
-						}else{
-							self.noChartData = true
-						}
-					}
-				}).catch(e => {self.$message.error(e.data.msg)}).finally(() => {self.chartLoading = false})
-			},
-			// 绩效分
-      get_JXdata () {
-				let self = this
-				let month = self.formData.month
-				if(!month){month = self.$moment().format('YYYY-MM')}
-				self.chartLoading = true
-        self.$http('get','/api/integral/statistics/performance',{employee_id: self.all_integral_row.employee_id, month: month}).then(res => {
-					if (res.data.code == 1) {
-						const xAxisData = []
-						const {chart, performance, works} = res.data.data
-						if (chart.length > 0) {
-							self.noChartData = false
-							const completionRateData = chart.map((item, index) => {
-								xAxisData.push(item.month)
-								// // 比例图
-								// return item.scale * 100
-								// 最终得分图 20200825 俊华
-								return item.review_point
-							})
-							this.setEChartOption(xAxisData, completionRateData)
-						}else{
-							self.noChartData = true
-						}
-					}
-				}).catch(e => {self.$message.error(e.data.msg)}).finally(() => {self.chartLoading = false})
-      },
-      setEChartOption (xAxisData, points) {
-				this.option.xAxis.data = xAxisData
-				if(points !== null && points.length !== 0){
-	        this.option.series.data = points
-				}
-        this.chartLine.setOption(this.option)
-			},
-			// 递归判断列表,把最后的children设为undefined
-			getTreeData(data){
-				for(var i=0;i<data.length;i++){
-					if(data[i].children.length<1){
-						// children若为空数组,则将children设为undefined
-						data[i].children=undefined;
-					}else {
-						// children若不为空数组,则继续 递归调用 本方法
-						this.getTreeData(data[i].children);
-					}
-				}
-				return data;
-			},
-		},
-		mounted(){
-			if (localStorage.getItem('dept_tree')) {
-				this.dept_tree = 	this.getTreeData(JSON.parse(localStorage.getItem('dept_tree')))
-			}
-			this.get_all_integral()
-		},
-		watch:{
-			'radio'(val){
-				if(val == 1){
-					// B分
-					this.noChartData = false
-					this.get_Bdata()
-				}else if(val == 2){
-					// A分
-					this.noChartData = false
-					this.get_Adata()
-				}else{
-					// 绩效分
-					this.noChartData = false
-					this.get_JXdata()
-				}
-			},
-			'formData.month'(val,old_val){
-				this.formData.page = 1
-				this.get_all_integral()
-			},
-			'formData.dept_id'(val,old_val){
-				if(!val){
-					this.formData.dept_id = 0
-				}
-				this.formData.page = 1
-				this.get_all_integral()
-			},
-		}
-  };
+      return;
+      let token = this.$getToken ? this.$getToken : getToken();
+      window.open(
+        process.env.BASE_API +
+          "/api/download/list?month=" +
+          this.formData.month +
+          "&keyword=" +
+          this.formData.keyword +
+          "&dept_id=" +
+          this.formData.dept_id +
+          "&async=0&data_type=2&employee_id=" +
+          this.$store.getters.user_info.id +
+          "&token=" +
+          token,
+        "_blank"
+      );
+    },
+    initEChartOption() {
+      this.option = {
+        tooltip: { show: false },
+        grid: {
+          containLabel: true,
+          top: "4%",
+          right: "4%",
+          bottom: "5%",
+          left: "7%"
+        },
+        xAxis: {
+          type: "category",
+          boundaryGap: false,
+          axisLine: { lineStyle: { color: "#eee" } },
+          axisLabel: { color: "#333" }
+        },
+        yAxis: {
+          position: "right",
+          axisLine: { lineStyle: { color: "#eee" } },
+          axisLabel: { color: "#333" },
+          type: "value",
+          splitLine: { lineStyle: { color: "#eee" } }
+        },
+        series: {
+          type: "line",
+          lineStyle: { normal: { color: "#26A2FF" } }
+        }
+      };
+    },
+    // A分
+    get_Adata() {
+      let self = this;
+      let month = self.formData.month;
+      if (!month) {
+        month = self.$moment().format("YYYY-MM");
+      }
+      self.chartLoading = true;
+      self
+        .$http("get", "/api/integral/statistics/a", {
+          employee_id: self.all_integral_row.employee_id,
+          month: month
+        })
+        .then(res => {
+          if (res.data.code == 1) {
+            const xAxisData = [];
+            const { a, chart, list } = res.data.data;
+            if (Object.keys(chart)) {
+              self.noChartData = false;
+              const points = chart.reward.map((rewardItem, index) => {
+                xAxisData.push(rewardItem.month);
+                return rewardItem.point + (chart.deduction[index].point || 0);
+              });
+              this.setEChartOption(xAxisData, points);
+            } else {
+              self.noChartData = true;
+            }
+          }
+        })
+        .catch(e => {
+          self.$message.error(e.data.msg);
+        })
+        .finally(() => {
+          self.chartLoading = false;
+        });
+    },
+    // B分
+    get_Bdata() {
+      let self = this;
+      let month = self.formData.month;
+      if (!month) {
+        month = self.$moment().format("YYYY-MM");
+      }
+      self.chartLoading = true;
+      self
+        .$http("get", "/api/integral/statistics/b", {
+          employee_id: self.all_integral_row.employee_id,
+          month: month
+        })
+        .then(res => {
+          if (res.data.code == 1) {
+            const xAxisData = [];
+            const { b, chart, good, bad } = res.data.data;
+            if (Object.keys(chart)) {
+              self.noChartData = false;
+              const points = chart.reward.map((rewardItem, index) => {
+                xAxisData.push(rewardItem.month);
+                return rewardItem.point + (chart.deduction[index].point || 0);
+              });
+              this.setEChartOption(xAxisData, points);
+            } else {
+              self.noChartData = true;
+            }
+          }
+        })
+        .catch(e => {
+          self.$message.error(e.data.msg);
+        })
+        .finally(() => {
+          self.chartLoading = false;
+        });
+    },
+    // 绩效分
+    get_JXdata() {
+      let self = this;
+      let month = self.formData.month;
+      if (!month) {
+        month = self.$moment().format("YYYY-MM");
+      }
+      self.chartLoading = true;
+      self
+        .$http("get", "/api/integral/statistics/performance", {
+          employee_id: self.all_integral_row.employee_id,
+          month: month
+        })
+        .then(res => {
+          if (res.data.code == 1) {
+            const xAxisData = [];
+            const { chart, performance, works } = res.data.data;
+            if (chart.length > 0) {
+              self.noChartData = false;
+              const completionRateData = chart.map((item, index) => {
+                xAxisData.push(item.month);
+                // // 比例图
+                // return item.scale * 100
+                // 最终得分图 20200825 俊华
+                return item.review_point;
+              });
+              this.setEChartOption(xAxisData, completionRateData);
+            } else {
+              self.noChartData = true;
+            }
+          }
+        })
+        .catch(e => {
+          self.$message.error(e.data.msg);
+        })
+        .finally(() => {
+          self.chartLoading = false;
+        });
+    },
+    setEChartOption(xAxisData, points) {
+      this.option.xAxis.data = xAxisData;
+      if (points !== null && points.length !== 0) {
+        this.option.series.data = points;
+      }
+      this.chartLine.setOption(this.option);
+    },
+    // 递归判断列表,把最后的children设为undefined
+    getTreeData(data) {
+      for (var i = 0; i < data.length; i++) {
+        if (data[i].children.length < 1) {
+          // children若为空数组,则将children设为undefined
+          data[i].children = undefined;
+        } else {
+          // children若不为空数组,则继续 递归调用 本方法
+          this.getTreeData(data[i].children);
+        }
+      }
+      return data;
+    }
+  },
+  mounted() {
+    if (localStorage.getItem("dept_tree")) {
+      this.dept_tree = this.getTreeData(
+        JSON.parse(localStorage.getItem("dept_tree"))
+      );
+    }
+    this.get_all_integral();
+  },
+  watch: {
+    radio(val) {
+      if (val == 1) {
+        // B分
+        this.noChartData = false;
+        this.get_Bdata();
+      } else if (val == 2) {
+        // A分
+        this.noChartData = false;
+        this.get_Adata();
+      } else {
+        // 绩效分
+        this.noChartData = false;
+        this.get_JXdata();
+      }
+    },
+    "formData.month"(val, old_val) {
+      this.formData.page = 1;
+      this.get_all_integral();
+    },
+    "formData.dept_id"(val, old_val) {
+      if (!val) {
+        this.formData.dept_id = 0;
+      }
+      this.formData.page = 1;
+      this.get_all_integral();
+    }
+  }
+};
 </script>
 
 <style scoped>
-  .el-date-editor.el-input {
-    width: auto;
-  }
+.el-date-editor.el-input {
+  width: auto;
+}
 
-  .color_green {
-    color: #67C23A;
-  }
+.color_green {
+  color: #67c23a;
+}
 
-  .date-picker-width {
-    width: 145px !important;
-  }
+.date-picker-width {
+  width: 145px !important;
+}
 
-  .label {
-    padding-right: 10px;
-  }
+.label {
+  padding-right: 10px;
+}
 
-  .time_type_class {
-    width: 80px;
-  }
+.time_type_class {
+  width: 80px;
+}
 
-  .drawer_title {
-    font-size: 18px;
-    padding: 20px;
-  }
-	/* .deptment /deep/ input::-webkit-input-placeholder {
+.drawer_title {
+  font-size: 18px;
+  padding: 20px;
+}
+/* .deptment /deep/ input::-webkit-input-placeholder {
     color: #606266 !important;
 	} */
-	.search /deep/ .el-input-group__append:active{
-		background:#26A2FF;
-	}
-	.search /deep/ .el-input-group__append:active .el-icon-search{
-		color:#fff;
-	}
+.search /deep/ .el-input-group__append:active {
+  background: #26a2ff;
+}
+.search /deep/ .el-input-group__append:active .el-icon-search {
+  color: #fff;
+}
 </style>
 <style lang="scss" scoped>
+.chart_content {
+  .chart-legend__wrap {
+    text-align: right;
+    padding: 20px;
+    padding-right: 50px;
 
-  .chart_content {
-    .chart-legend__wrap {
-      text-align: right;
-      padding: 20px;
-      padding-right: 50px;
-
-      & .chart-legend__pink {
-        position: relative;
-        padding-left: 12px;
-        padding-right: 5px;
+    & .chart-legend__pink {
+      position: relative;
+      padding-left: 12px;
+      padding-right: 5px;
 
-        &:after {
-          content: '';
-          position: absolute;
-          margin-top: -2px;
-          top: 35%;
-          left: 0;
-          width: 8px;
-          height: 8px;
-          background: #F56C6C;
-          border-radius: 100%;
-        }
+      &:after {
+        content: "";
+        position: absolute;
+        margin-top: -2px;
+        top: 35%;
+        left: 0;
+        width: 8px;
+        height: 8px;
+        background: #f56c6c;
+        border-radius: 100%;
       }
+    }
 
-      & .chart-legend__green {
-        position: relative;
-        padding-left: 12px;
+    & .chart-legend__green {
+      position: relative;
+      padding-left: 12px;
 
-        &:after {
-          content: '';
-          position: absolute;
-          margin-top: -2px;
-          top: 35%;
-          left: 0;
-          width: 8px;
-          height: 8px;
-          background: #53B87F;
-          border-radius: 100%;
-        }
+      &:after {
+        content: "";
+        position: absolute;
+        margin-top: -2px;
+        top: 35%;
+        left: 0;
+        width: 8px;
+        height: 8px;
+        background: #53b87f;
+        border-radius: 100%;
       }
     }
   }
-	.integral_statistics_box{
-		background-color: #ffffff; 
-		padding: 20px; 
-		min-height: calc(100vh - 160px);
-	}
-	.nopoint_box{
-		display:inline-block;
-		text-align: center;
-		width:100%;
-		margin-bottom:10px;
-	}
-	.noimg{
-		display:inline-block;
-		width: 110px;
-		height: 110px;
-		margin: 22px auto 16px;
-		/* background:url("/static/images/nodata_default.png") no-repeat center; */
-		background-size:99%;
-	}
-	.noperson{
-		display:inline-block;
-		width: 110px;
-		height: 110px;
-		line-height: none;
-		margin: 22px auto 16px;
-		background:url("/static/images/noperson_default.png") no-repeat center;
-		background-size:99%;
-	}
-	.title{
-		display: block;
-		text-align: center;
-		font-size:12px  !important;
-		line-height:30px;
-		color:#909399 !important;
-		padding:0;
-	}
-	.nopoint_box a{
-		color:#26A2FF;
-	}
+}
+.integral_statistics_box {
+  background-color: #ffffff;
+  padding: 20px;
+  min-height: calc(100vh - 160px);
+}
+.nopoint_box {
+  display: inline-block;
+  text-align: center;
+  width: 100%;
+  margin-bottom: 10px;
+}
+.noimg {
+  display: inline-block;
+  width: 110px;
+  height: 110px;
+  margin: 22px auto 16px;
+  /* background:url("/static/images/nodata_default.png") no-repeat center; */
+  background-size: 99%;
+}
+.noperson {
+  display: inline-block;
+  width: 110px;
+  height: 110px;
+  line-height: none;
+  margin: 22px auto 16px;
+  background: url("/static/images/noperson_default.png") no-repeat center;
+  background-size: 99%;
+}
+.title {
+  display: block;
+  text-align: center;
+  font-size: 12px !important;
+  line-height: 30px;
+  color: #909399 !important;
+  padding: 0;
+}
+.nopoint_box a {
+  color: #26a2ff;
+}
 </style>

+ 346 - 164
src/views/statistics_new/manager_statistics.vue

@@ -1,18 +1,23 @@
 <template>
   <div>
     <div class="manager_statistics_box wlj">
-      <el-tabs v-model="activeName" type="card"><!-- 奖扣完成情况 -->
+      <el-tabs v-model="activeName" type="card"
+        ><!-- 奖扣完成情况 -->
         <el-tab-pane label="奖扣完成情况" name="second">
           <el-form :model="condition" :inline="true" ref="formData">
-
-			    <!-- 部门 -->
+            <!-- 部门 -->
             <el-form-item label="部门">
-              <deptData  deptStyle="height:24px;line-height:24px;margin-top:7px;" v-if="toPdept && toPdept!=0" :refsName="$refs.dept" :toPdept="toPdept"></deptData>
+              <deptData
+                deptStyle="height:24px;line-height:24px;margin-top:7px;"
+                v-if="toPdept && toPdept != 0"
+                :refsName="$refs.dept"
+                :toPdept="toPdept"
+              ></deptData>
               <el-cascader
                 v-model="dept_name_xq_xq"
                 :options="dept_trees"
                 @change="get_last_dept_null"
-                :props="{ label: 'name', value: 'id'}"
+                :props="{ label: 'name', value: 'id' }"
                 ref="dept"
                 filterable
                 change-on-select
@@ -21,14 +26,17 @@
               >
                 <template slot-scope="{ node, data }">
                   <span>
-                    <WWOpenData type="departmentName" :openid="data.name"></WWOpenData>
+                    <WWOpenData
+                      type="departmentName"
+                      :openid="data.name"
+                    ></WWOpenData>
                   </span>
                   <!-- <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> -->
                 </template>
               </el-cascader>
             </el-form-item>
 
-			    <!-- 时间 -->
+            <!-- 时间 -->
             <el-form-item label="时间">
               <el-date-picker
                 class="date-picker-width"
@@ -41,7 +49,7 @@
               ></el-date-picker>
             </el-form-item>
 
-			    <!-- 搜索框 -->
+            <!-- 搜索框 -->
             <el-form-item class="persons_names">
               <el-input
                 v-model="condition.keyword"
@@ -50,24 +58,39 @@
                 @keyup.enter.native="keyWordSelect"
                 class="persons_name"
               >
-                <el-button slot="append" icon="el-icon-search" @click='search_box'></el-button>
+                <el-button
+                  slot="append"
+                  icon="el-icon-search"
+                  @click="search_box"
+                ></el-button>
               </el-input>
             </el-form-item>
 
-			    <!-- 达标选项 -->
-            <br>
+            <!-- 达标选项 -->
+            <br />
             <el-form-item>
-              <el-checkbox v-model="allPass" size="medium" label="只看全部达标的"></el-checkbox>
+              <el-checkbox
+                v-model="allPass"
+                size="medium"
+                label="只看全部达标的"
+              ></el-checkbox>
             </el-form-item>
 
-			    <!-- 导出报表 -->
+            <!-- 导出报表 -->
             <el-form-item>
-              <!-- <el-button type="primary" plain @click="exportExcel" style="margin-left:20px">导出报表</el-button> -->
+              <el-button
+                type="primary"
+                plain
+                @click="exportExcel"
+                style="margin-left:20px"
+                :disabled="deriveDis"
+                >导出报表</el-button
+              >
+              <a :href="aherfUrl" ref="aherfClick"></a>
             </el-form-item>
-
           </el-form>
 
-		      <el-table :data="last" style="width: 100%" v-loading="loading" >
+          <el-table :data="last" style="width: 100%" v-loading="loading">
             <el-table-column label="管理者">
               <template slot-scope="scope">
                 <userImage
@@ -80,40 +103,65 @@
                 ></userImage>
                 <span
                   style=" margin-left: 10px; line-height: 50px; display: inline-block;"
-                ><WWOpenData type="userName" :openid="scope.row.name"></WWOpenData></span>
+                  ><WWOpenData
+                    type="userName"
+                    :openid="scope.row.name"
+                  ></WWOpenData
+                ></span>
               </template>
             </el-table-column>
             <el-table-column label="奖分" prop="scope_count">
-            <template slot-scope="scope">
-              <b>{{scope.row.reward.point}}&nbsp;</b>
-              <span :class="scope.row.reward.status == 1?'color_green':''">{{scope.row.reward.status==1?'达标':''}}</span><br/>
-              <span class="span_h">奖分目标 {{scope.row.reward.target}}</span>
-            </template>
+              <template slot-scope="scope">
+                <b>{{ scope.row.reward.point }}&nbsp;</b>
+                <span
+                  :class="scope.row.reward.status == 1 ? 'color_green' : ''"
+                  >{{ scope.row.reward.status == 1 ? "达标" : "" }}</span
+                ><br />
+                <span class="span_h"
+                  >奖分目标 {{ scope.row.reward.target }}</span
+                >
+              </template>
             </el-table-column>
-                <el-table-column label="扣分" prop="reward_count">
-            <template slot-scope="scope">
-              <b>{{scope.row.deduction.point}}&nbsp;</b>
-              <span :class="scope.row.deduction.status == 1?'color_green':''">{{scope.row.deduction.status==1?'达标':''}}</span><br/>
-              <span class="span_h">扣分目标 {{scope.row.deduction.target}}</span>
-            </template>
-			      </el-table-column>
-              <el-table-column label="奖扣比例" prop="deduct_count">
-				    <template slot-scope="scope">
-              <div v-if="scope.row.ratio.enable == 1">
-                <b>{{scope.row.ratio.reward_ratio}}&nbsp;:1 </b>
-                <span :class="scope.row.ratio.status == 1?'color_green':''">{{scope.row.ratio.status==1?'达标':''}}</span><br/>
-                <span class="span_h">比例目标 小于 {{scope.row.ratio.target}}<b>:</b>&nbsp;1</span>
-              </div>
-              <div v-else style="padding-left:21px"> —</div>
-            </template>
+            <el-table-column label="扣分" prop="reward_count">
+              <template slot-scope="scope">
+                <b>{{ scope.row.deduction.point }}&nbsp;</b>
+                <span
+                  :class="scope.row.deduction.status == 1 ? 'color_green' : ''"
+                  >{{ scope.row.deduction.status == 1 ? "达标" : "" }}</span
+                ><br />
+                <span class="span_h"
+                  >扣分目标 {{ scope.row.deduction.target }}</span
+                >
+              </template>
+            </el-table-column>
+            <el-table-column label="奖扣比例" prop="deduct_count">
+              <template slot-scope="scope">
+                <div v-if="scope.row.ratio.enable == 1">
+                  <b>{{ scope.row.ratio.reward_ratio }}&nbsp;:1 </b>
+                  <span
+                    :class="scope.row.ratio.status == 1 ? 'color_green' : ''"
+                    >{{ scope.row.ratio.status == 1 ? "达标" : "" }}</span
+                  ><br />
+                  <span class="span_h"
+                    >比例目标 小于 {{ scope.row.ratio.target
+                    }}<b>:</b>&nbsp;1</span
+                  >
+                </div>
+                <div v-else style="padding-left:21px">—</div>
+              </template>
             </el-table-column>
             <el-table-column label="人次目标" prop="deduct_count">
               <template slot-scope="scope">
-                <b>{{scope.row.exec.count}}&nbsp;</b>
-                <span :class="scope.row.exec.status == 1?'color_green':''">{{scope.row.exec.status==1?'达标':''}}</span><br/>
-                <span class="span_h">人次目标 {{scope.row.exec.target}}人次</span>
+                <b>{{ scope.row.exec.count }}&nbsp;</b>
+                <span
+                  :class="scope.row.exec.status == 1 ? 'color_green' : ''"
+                  >{{ scope.row.exec.status == 1 ? "达标" : "" }}</span
+                ><br />
+                <span class="span_h"
+                  >人次目标 {{ scope.row.exec.target }}人次</span
+                >
               </template>
-			      </el-table-column>
+            </el-table-column>
             <template slot="empty">
               <div class="nopoint_box">
                 <div class="noimg noperson"></div>
@@ -122,8 +170,6 @@
             </template>
           </el-table>
 
-		  
-
           <center style="padding: 20px 0;">
             <el-pagination
               background
@@ -136,19 +182,22 @@
               :total="totals"
             ></el-pagination>
           </center>
-
         </el-tab-pane>
 
-        
         <el-tab-pane label="奖扣执行对比" name="first">
           <el-form :model="formData" :inline="true" ref="formData">
             <el-form-item label="部门">
-              <deptData deptStyle="height:24px;line-height:24px;margin-top:7px;" v-if="toPdepts && toPdepts!=0" :refsName="$refs.depts" :toPdept="toPdepts"></deptData>
+              <deptData
+                deptStyle="height:24px;line-height:24px;margin-top:7px;"
+                v-if="toPdepts && toPdepts != 0"
+                :refsName="$refs.depts"
+                :toPdept="toPdepts"
+              ></deptData>
               <el-cascader
                 v-model="dept_name_xq"
                 :options="dept_tree"
                 @change="dept_null"
-                :props="{ label: 'name', value: 'id'}"
+                :props="{ label: 'name', value: 'id' }"
                 ref="depts"
                 filterable
                 change-on-select
@@ -157,7 +206,10 @@
               >
                 <template slot-scope="{ node, data }">
                   <span>
-                    <WWOpenData type="departmentName" :openid="data.name"></WWOpenData>
+                    <WWOpenData
+                      type="departmentName"
+                      :openid="data.name"
+                    ></WWOpenData>
                   </span>
                   <!-- <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> -->
                 </template>
@@ -176,7 +228,7 @@
             </el-form-item>
           </el-form>
 
-            <!-- 
+          <!-- 
             <el-row :gutter="20" style="margin-bottom: 20px;">
               <el-col :span="5">
                 <el-date-picker class="date-picker-width" v-model="formData.month" width="100%" type="month" placeholder="请选择月份" value-format="yyyy-MM"></el-date-picker>
@@ -192,7 +244,12 @@
             </el-row> 
                 -->
 
-          <el-table :data="list" style="width: 100%" v-loading="loading" @row-click="open_detail">
+          <el-table
+            :data="list"
+            style="width: 100%"
+            v-loading="loading"
+            @row-click="open_detail"
+          >
             <el-table-column label="管理者">
               <template slot-scope="scope">
                 <userImage
@@ -205,12 +262,25 @@
                 ></userImage>
                 <span
                   style=" margin-left: 10px; line-height: 50px; display: inline-block;"
-                ><WWOpenData type="userName" :openid="scope.row.name"></WWOpenData></span>
+                  ><WWOpenData
+                    type="userName"
+                    :openid="scope.row.name"
+                  ></WWOpenData
+                ></span>
               </template>
             </el-table-column>
-            <el-table-column label="管理范围(人)" prop="scope_count"></el-table-column>
-            <el-table-column label="人均奖分(次)" prop="reward_count"></el-table-column>
-            <el-table-column label="人均扣分(次)" prop="deduct_count"></el-table-column>
+            <el-table-column
+              label="管理范围(人)"
+              prop="scope_count"
+            ></el-table-column>
+            <el-table-column
+              label="人均奖分(次)"
+              prop="reward_count"
+            ></el-table-column>
+            <el-table-column
+              label="人均扣分(次)"
+              prop="deduct_count"
+            ></el-table-column>
             <template slot="empty">
               <div class="nopoint_box">
                 <div class="noimg noperson"></div>
@@ -232,43 +302,65 @@
             ></el-pagination>
           </center>
 
-          <el-drawer size="500px" :visible.sync="detail_show" :with-header="false" direction="rtl">
-            <el-button type="info" style="position: absolute; left: -100px;">test</el-button>
+          <el-drawer
+            size="500px"
+            :visible.sync="detail_show"
+            :with-header="false"
+            direction="rtl"
+          >
+            <el-button type="info" style="position: absolute; left: -100px;"
+              >test</el-button
+            >
             <div class="drawer_title">
-              <WWOpenData type="userName" :openid="item.name"></WWOpenData>的奖扣统计
+              <WWOpenData type="userName" :openid="item.name"></WWOpenData
+              >的奖扣统计
               <el-tooltip placement="top">
-                <div slot="content" style="width: 300px">作为管理者,管理执行力是关键,每月按要求完成奖分和扣分任务。</div>
+                <div slot="content" style="width: 300px">
+                  作为管理者,管理执行力是关键,每月按要求完成奖分和扣分任务。
+                </div>
                 <span class="tips">?</span>
               </el-tooltip>
             </div>
             <div class="chart_content">
-              <el-row :gutter="20" v-if="personalData !== null" v-loading="personalData_loading">
+              <el-row
+                :gutter="20"
+                v-if="personalData !== null"
+                v-loading="personalData_loading"
+              >
                 <el-col :span="4">
                   <div class="dataItem">
-                    <p class="point">{{personalData.task.reward.point}}</p>
+                    <p class="point">{{ personalData.task.reward.point }}</p>
                     <p>奖分</p>
-                    <p class="target">目标{{personalData.task.reward.target_point}}</p>
+                    <p class="target">
+                      目标{{ personalData.task.reward.target_point }}
+                    </p>
                   </div>
                 </el-col>
                 <el-col :span="4">
                   <div class="dataItem">
-                    <p class="point">{{personalData.task.deduction.point}}</p>
+                    <p class="point">{{ personalData.task.deduction.point }}</p>
                     <p>扣分</p>
-                    <p class="target">目标{{personalData.task.deduction.target_point}}</p>
+                    <p class="target">
+                      目标{{ personalData.task.deduction.target_point }}
+                    </p>
                   </div>
                 </el-col>
                 <el-col :span="5">
                   <div class="dataItem">
-                    <p class="point">{{personalData.task.ratio.ratio}}:1</p>
+                    <p class="point">{{ personalData.task.ratio.ratio }}:1</p>
                     <p>奖扣比例</p>
-                    <p class="target">目标>{{personalData.task.ratio.target_ratio}}:1</p>
+                    <p class="target">
+                      目标>{{ personalData.task.ratio.target_ratio }}:1
+                    </p>
                   </div>
                 </el-col>
                 <el-col :span="5">
                   <div class="dataItem">
-                    <p class="point">{{personalData.task.exec.count}}</p>
+                    <p class="point">{{ personalData.task.exec.count }}</p>
                     <p>奖扣人次</p>
-                    <p class="target">目标{{personalData.task.exec.target_count}}</p>
+                    <p class="target">
+                      目标{{ personalData.task.exec.target_count }}
+                    </p>
                   </div>
                 </el-col>
               </el-row>
@@ -278,14 +370,22 @@
                 <span class="chart-legend__pink">奖分</span>
                 <span class="chart-legend__green">扣分</span>
               </div>
-              <div id="situationChart" v-loading="echart_loading" style="height: 300px;"></div>
+              <div
+                id="situationChart"
+                v-loading="echart_loading"
+                style="height: 300px;"
+              ></div>
 
               <div class="chart-legend__wrap">
                 <div class="fl">月奖扣人次</div>
                 <span class="chart-legend__pink">奖分人次</span>
                 <span class="chart-legend__green">扣分人次</span>
               </div>
-              <div id="passengersChart" v-loading="echart_loading" style="height: 300px;"></div>
+              <div
+                id="passengersChart"
+                v-loading="echart_loading"
+                style="height: 300px;"
+              ></div>
             </div>
           </el-drawer>
         </el-tab-pane>
@@ -294,27 +394,27 @@
   </div>
 </template>
 <script>
-import { getToken } from '@/utils/auth';
+import { getToken } from "@/utils/auth";
 import ECharts from "echarts";
 export default {
   data() {
     return {
       last: [],
       dept_trees: [],
-	    //完成情况
-	    condition: {
-        month: this.$moment().format("YYYY-MM"),//时间
-        page: 1,//当前页
-        page_size: 10,//每页数量
-        dept_id: 0,//部门id
-        keyword:'',//关键字
-        complete:'',//是否达标 1是
+      //完成情况
+      condition: {
+        month: this.$moment().format("YYYY-MM"), //时间
+        page: 1, //当前页
+        page_size: 10, //每页数量
+        dept_id: 0, //部门id
+        keyword: "", //关键字
+        complete: "" //是否达标 1是
       },
       activeName: "second",
       totals: null,
       dept_name_xq_xq: "",
 
-	    //对比
+      //对比
       loading: false,
       choose_time: "",
       input: "",
@@ -324,7 +424,7 @@ export default {
         month: this.$moment().format("YYYY-MM"),
         page: 1,
         page_size: 10,
-        dept_id: 0,
+        dept_id: 0
         // complete:'0',
       },
       total: null,
@@ -337,42 +437,51 @@ export default {
       dept_tree: [],
       personalData_loading: false,
       personalData: null,
-      toPdept:0,
-      toPdepts:0,
+      toPdept: 0,
+      toPdepts: 0,
+
+      deriveJobId: "",
+      deriveJobIf: 0,
+      deriveDis: false,
+      aherfUrl: ""
     };
   },
   watch: {
-	//对比
+    //对比
     "formData.month"(val, old_val) {
       this.formData.page = 1;
       this.get_list();
-	},
-	//情况
+    },
+    //情况
     "condition.month"(val, old_val) {
       this.condition.page = 1;
       this.get_last();
-	},
-	//查看全部达标
-    'allPass'(val,old_val){
-    	if(val){
-    		this.condition.complete = '1'
-    	}else{
-    		this.condition.complete = '0'
+    },
+    //查看全部达标
+    allPass(val, old_val) {
+      if (val) {
+        this.condition.complete = "1";
+      } else {
+        this.condition.complete = "0";
       }
-      this.condition.page = 1
-    	this.get_last()
-	},
-	
+      this.condition.page = 1;
+      this.get_last();
+    }
   },
   methods: {
     //情况
-	  get_last() {
+    get_last() {
       let self = this;
       self.loading = true;
-	  // const headers = { Accept: "application/vnd.test.v4+json" };
+      // const headers = { Accept: "application/vnd.test.v4+json" };
       self
-        .$http("get","/api/integral/statistics/prize/list",self.condition,'v4')
-        .then((res) => {
+        .$http(
+          "get",
+          "/api/integral/statistics/prize/list",
+          self.condition,
+          "v4"
+        )
+        .then(res => {
           if (res.data.code == 1) {
             self.last = res.data.data.list;
             self.totals = res.data.data.total;
@@ -383,45 +492,118 @@ export default {
         .finally(() => {
           self.loading = false;
         });
-	},
-	//部门
-	get_last_dept_null(val) {
-      this.toPdept = val[val.length-1]
+    },
+    //部门
+    get_last_dept_null(val) {
+      this.toPdept = val[val.length - 1];
       if (val.length == 0) {
         this.condition.dept_id = 0;
       } else {
-		    this.condition.dept_id = val[0];
+        this.condition.dept_id = val[0];
       }
       this.$nextTick(() => {
         this.condition.page = 1;
         this.$refs.dept.dropDownVisible = false; //监听值发生变化就关闭它
         this.get_last();
       });
-	},
-	//搜索框
-	search_box(){
-		this.get_last();
-  },
-  //导出报表
-  exportExcel() {
+    },
+    //搜索框
+    search_box() {
+      this.get_last();
+    },
+    downloadResult() {
+      if (this.deriveJobIf < 5) {
+        this.$http("get", "/api/download/result", {
+          job_id: this.deriveJobId
+        }).then(res => {
+          if (res.data.code == 1) {
+            this.aherfUrl = res.data.data.url;
+            this.deriveJobId = "";
+            this.deriveDis = false;
+            this.$nextTick(() => {
+              this.$refs.aherfClick.click();
+            });
+          } else {
+            setTimeout(() => {
+              this.deriveJobIf++;
+              this.downloadResult();
+            }, 3000);
+          }
+        });
+      } else {
+        this.deriveJobIf = 0;
+        this.deriveJobId = "";
+        this.deriveDis = false;
+        this.aherfUrl = "";
+        this.$message.warning("导出超时");
+      }
+    },
+    //导出报表
+    exportExcel() {
+      this.aherfUrl = "";
+      this.$confirm("确认导出奖扣报表?", "导出", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.deriveDis = true;
+          let params = {
+            employee_id: this.$store.getters.user_info.id,
+            month: this.condition.month,
+            page: this.condition.page
+          };
+          this.condition.dept_id > 0
+            ? (params.dept_id = this.condition.dept_id)
+            : (params.dept_id = 0);
+          this.condition.keyword == ""
+            ? (params.keyword = 0)
+            : (params.keyword = this.condition.keyword);
+          this.condition.complete != 0
+            ? (params.complete = this.condition.complete)
+            : (params.complete = 0);
+          this.condition.dept_id
+            ? (params.dept_ids = this.condition.dept_id)
+            : "";
+          this.$http("get", "/api/download/prize/list/v4", params).then(res => {
+            if (res.data.code == 1) {
+              this.deriveJobId = res.data.data.job_id;
+              this.downloadResult();
+            } else {
+              this.deriveDis = false;
+            }
+          });
+        })
+        .catch(() => {});
+
+      this.dialogVisible = false;
+      return;
       let data = "";
       //部门
-        this.condition.dept_id>0?data+="&dept_id="+ this.condition.dept_id:data+="&dept_id=0"
+      this.condition.dept_id > 0
+        ? (data += "&dept_id=" + this.condition.dept_id)
+        : (data += "&dept_id=0");
       //时间
-        data+="&month="+this.condition.month
+      data += "&month=" + this.condition.month;
       //搜索框
-        this.condition.keyword==''?data+="&keyword=0":data+="&keyword="+this.condition.keyword
+      this.condition.keyword == ""
+        ? (data += "&keyword=0")
+        : (data += "&keyword=" + this.condition.keyword);
       //是否达标
-        this.condition.complete!=0?data+="&complete="+this.condition.complete:data+="&complete=0"
+      this.condition.complete != 0
+        ? (data += "&complete=" + this.condition.complete)
+        : (data += "&complete=0");
       //当前页数
-        data+="&page="+this.condition.page
-      console.log(data)
-        let token = this.$getToken?this.$getToken:getToken()
+      data += "&page=" + this.condition.page;
+      console.log(data);
+      let token = this.$getToken ? this.$getToken : getToken();
       window.open(
         process.env.BASE_API +
-          "/api/download/prize/list/v4?employee_id="+
+          "/api/download/prize/list/v4?employee_id=" +
           this.$store.getters.user_info.id +
-          data+'&token='+token,
+          data +
+          "&token=" +
+          token,
         "_blank"
       );
       this.dialogVisible = false;
@@ -432,18 +614,14 @@ export default {
       this.get_last();
     },
     //分页
-    handleSizeChange_xq(val){
+    handleSizeChange_xq(val) {
       this.condition.page_size = val;
       this.get_last();
     },
 
-
-
-
-
     //
     handleSizeChange(val) {
-      this.formData.page_size =val;
+      this.formData.page_size = val;
       this.get_list();
     },
     handleCurrentChange(val) {
@@ -454,10 +632,15 @@ export default {
     get_list() {
       let self = this;
       self.loading = true;
-	  // const headers = { Accept: "application/vnd.test.v3+json" };
+      // const headers = { Accept: "application/vnd.test.v3+json" };
       self
-        .$http("get","/api/integral/statistics/prize/list",self.formData,'v3')
-        .then((res) => {
+        .$http(
+          "get",
+          "/api/integral/statistics/prize/list",
+          self.formData,
+          "v3"
+        )
+        .then(res => {
           if (res.data.code == 1) {
             self.list = res.data.data.list;
             self.total = res.data.data.total;
@@ -489,43 +672,43 @@ export default {
     getChartOption(xAxisData, rewardData, deductionData) {
       return {
         tooltip: {
-          trigger: "axis",
+          trigger: "axis"
         },
         grid: {
           containLabel: true,
           top: "4%",
           right: "4%",
           bottom: "5%",
-          left: "7%",
+          left: "7%"
         },
         xAxis: {
           type: "category",
           boundaryGap: false,
           axisLine: { lineStyle: { color: "#eee" } },
           axisLabel: { color: "#333" },
-          data: xAxisData,
+          data: xAxisData
         },
         yAxis: {
           position: "right",
           axisLine: { lineStyle: { color: "#eee" } },
           axisLabel: { color: "#333" },
           type: "value",
-          splitLine: { lineStyle: { color: "#eee" } },
+          splitLine: { lineStyle: { color: "#eee" } }
         },
         series: [
           {
             name: "奖分",
             type: "line",
             data: rewardData,
-            lineStyle: { normal: { color: "#F56C6C" } },
+            lineStyle: { normal: { color: "#F56C6C" } }
           },
           {
             name: "扣分",
             type: "line",
             data: deductionData,
-            lineStyle: { normal: { color: "#53B87F" } },
-          },
-        ],
+            lineStyle: { normal: { color: "#53B87F" } }
+          }
+        ]
       };
     },
     // v2
@@ -533,10 +716,10 @@ export default {
       this.echart_loading = true;
       const data = {
         employee_id: this.item.id || 0,
-        month: this.formData.month,
+        month: this.formData.month
       };
-      this.$http('get',"/api/integral/statistics/prize",data)
-        .then((res) => {
+      this.$http("get", "/api/integral/statistics/prize", data)
+        .then(res => {
           if (res.data.code === 1) {
             const item = res.data.data;
             this.employeeName = item.name;
@@ -583,18 +766,18 @@ export default {
       self.personalData_loading = true;
       const data = {
         employee_id: this.item.id || 0,
-        month: this.formData.month,
+        month: this.formData.month
       };
       self
-        .$http("get","/api/integral/statistics",data,)
-        .then((res) => {
+        .$http("get", "/api/integral/statistics", data)
+        .then(res => {
           if (res.data.code == 1) {
             self.personalData = res.data.data;
           } else {
             self.$message.error(res.data.data.msg);
           }
         })
-        .catch((e) => {
+        .catch(e => {
           self.$message.error(res.data.data.msg);
         })
         .finally(() => {
@@ -602,7 +785,7 @@ export default {
         });
     },
     dept_null(val) {
-      this.toPdepts = val[val.length-1]
+      this.toPdepts = val[val.length - 1];
       if (val.length == 0) {
         this.formData.dept_id = 0;
       } else {
@@ -626,7 +809,7 @@ export default {
         }
       }
       return data;
-    },
+    }
   },
   mounted() {
     if (localStorage.getItem("dept_tree")) {
@@ -638,9 +821,9 @@ export default {
       );
     }
 
-	  this.get_list();
+    this.get_list();
     this.get_last();
-  },
+  }
 };
 </script>
 <style scoped lang="scss">
@@ -790,23 +973,22 @@ export default {
   width: 0px !important;
 }
 
-
 // .persons_names{
 // 	margin-left: 160px;
 // }
-.wlj{
-	& .color_green{
-		color: #49d3a7;
-	}
-	& .color_red{
-		color: #f04b56;
-	}
+.wlj {
+  & .color_green {
+    color: #49d3a7;
+  }
+  & .color_red {
+    color: #f04b56;
+  }
 }
-b{
-	font-size: 14px;
+b {
+  font-size: 14px;
 }
-.span_h{
-	font-size: 13px;
-	color: #898c94;
+.span_h {
+  font-size: 13px;
+  color: #898c94;
 }
-</style>
+</style>

+ 77 - 10
src/views/statistics_new/total_rank.vue

@@ -24,7 +24,8 @@
         <el-form-item><el-checkbox v-model="agePolyethism" size="medium" label="只看工龄分" border></el-checkbox></el-form-item>
         <el-form-item><el-checkbox v-model="sort" size="medium" label="排名由低到高" border></el-checkbox></el-form-item>
         <el-form-item>
-          <!-- <el-button type="primary" plain @click="dialogVisible = true">导出排名</el-button> -->
+          <el-button type="primary" plain @click="dialogVisible = true" :disabled="deriveDis">导出排名</el-button>
+          <a :href="aherfUrl" ref="aherfClick"></a>
           <!-- <el-button type="primary" plain @click="byRanking">轮播排名</el-button> -->
         </el-form-item>
       </el-form>
@@ -249,6 +250,11 @@ export default {
       toPdept:0,
       toPdept1:0,
       toPdept2:0,
+
+      deriveJobId: '',
+      deriveJobIf: 0,
+      deriveDis: false,
+      aherfUrl: '',
     };
   },
   watch: {
@@ -303,17 +309,78 @@ export default {
     }
   },
   methods: {
+    downloadResult(){
+      if(this.deriveJobIf < 5){
+        this.$http('get','/api/download/result',{job_id: this.deriveJobId}).then((res)=>{
+          if(res.data.code == 1){
+            // window.open(res.data.data.url)
+            // window.location.href = res.data.data.url
+            this.aherfUrl = res.data.data.url
+            this.deriveJobId = ''
+            this.deriveDis = false
+            this.$nextTick(()=>{
+              this.$refs.aherfClick.click()
+              // this.aderivecli()
+            })
+          }else{
+            setTimeout(()=>{
+              this.deriveJobIf++
+              this.downloadResult()
+            },3000)
+          }
+        })
+      }else{
+        this.deriveJobIf = 0
+        this.deriveJobId = ''
+        this.deriveDis = false
+        this.aherfUrl = ''
+        this.$message.warning('导出超时');
+      }
+    },
     exportExcel() {
+      this.aherfUrl = ''
+      this.$confirm('确认导出排名?', '导出', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        //人员
+        this.Dc_Data.DC_position =
+          this.Dc_Data.DC_position == 'manager' ? 'manager' : this.Dc_Data.DC_position == 'employee' ? 'employee' : this.Dc_Data.DC_position == '全部' ? 'all' : 'all';
+        //部门
+        let dept_name;
+        for (let i in this.Dc_Data.dept_name) {
+          dept_name = this.Dc_Data.dept_name[i];
+        }
+        this.Dc_Data.dept_name = dept_name;
+
+        this.deriveDis = true
+        let params = {
+          position: this.Dc_Data.DC_position,
+          work_age: this.Dc_Data.work_age,
+          pt_id: 3,
+          type: 'all',
+          employee_id: this.$store.getters.user_info.id,
+        }
+        this.Dc_Data.value1 ? params.start_date = this.Dc_Data.value1[0] : ''
+        this.Dc_Data.value1 ? params.end_date = this.Dc_Data.value1[1] : ''
+        this.Dc_Data.dept_name > 0 ? params.dept_id = this.Dc_Data.dept_name : params.dept_id = 0
+
+        this.$http('get','/api/download/ranking/v2',params).then((res)=>{
+          if(res.data.code == 1){
+            this.deriveJobId = res.data.data.job_id
+            this.downloadResult()
+          }else{
+            this.deriveDis = false
+          }
+        })
+      }).catch(() => {
+
+      })
+      this.dialogVisible = false;
+
+      return
 
-      //人员
-      this.Dc_Data.DC_position =
-        this.Dc_Data.DC_position == 'manager' ? 'manager' : this.Dc_Data.DC_position == 'employee' ? 'employee' : this.Dc_Data.DC_position == '全部' ? 'all' : 'all';
-      //部门
-      let dept_name;
-      for (let i in this.Dc_Data.dept_name) {
-        dept_name = this.Dc_Data.dept_name[i];
-      }
-      this.Dc_Data.dept_name = dept_name;
       let data = '';
       if (this.Dc_Data.value1) {
         data += '&start_date=' + this.Dc_Data.value1[0];

+ 27 - 27
src/views/workbench/performance/add_team_performance.vue

@@ -67,27 +67,24 @@
         </el-form-item>
       </el-form>
     </div>
-    <el-dialog  title="选择执行人" :visible.sync="add_employee_show"  :before-close="publicClose"  width="700px">
-      <!-- <EmployeeSelector1 :isChecKedAll="false" v-if="add_employee_show" :employee_list="employee_list" :dept_multi="false" ref="Employee" :can_select_dept="false" :selected="selectEmployee" :multi="true" :max="0" @confirm="add_employee_confirm"></EmployeeSelector1> -->
-      <!-- 选择执行人 -->
-        <EmployeeSelector
-          title="选择执行人"
-          :visible.sync="add_employee_show"
-          :employee_list="employee_list"
-          :user_employee_list="true"
-          :isChecKedAll="false"
-          :selected="selectEmployee"
-          :multi="true"
-          @confirm="add_employee_confirm"
-        />
-       <span slot="footer">
+    <EmployeeSelector
+      title="选择执行人"
+      :visible.sync="add_employee_show"
+      :employee_list="employee_list"
+      :user_employee_list="true"
+      :isChecKedAll="false"
+      :selected="selectEmployee"
+      :multi="true"
+      @confirm="add_employee_confirm"
+    />
+    <!-- <el-dialog  title="选择执行人" :visible.sync="add_employee_show"  :before-close="publicClose"  width="700px">
+      <EmployeeSelector1 :isChecKedAll="false" v-if="add_employee_show" :employee_list="employee_list" :dept_multi="false" ref="Employee" :can_select_dept="false" :selected="selectEmployee" :multi="true" :max="0" @confirm="add_employee_confirm"></EmployeeSelector1>
+      <span slot="footer">
          <el-button @click="publicClose()">取消</el-button>
          <el-button type="primary" @click="sub_add_employee">完成</el-button>
        </span>
-    </el-dialog>
-    <el-dialog  title="选择终审人" :visible.sync="add_reviewer_show"  :before-close="publicClose"  width="700px">
-      <!-- <EmployeeSelector1 :isChecKedAll="false" v-if="add_reviewer_show" ref="Employee" :employee_list="selectReviewer_list" :can_select_dept="false" :multi="false" :selected="selectReviewer" @confirm="add_employee_confirm"></EmployeeSelector1> -->
-      <!-- 选择终审人 -->
+    </el-dialog> --> 
+    <!-- 选择终审人 -->
         <EmployeeSelector
           title="选择终审人"
           :visible.sync="add_reviewer_show"
@@ -99,14 +96,15 @@
           :multi="false"
           @confirm="add_employee_confirm"
       />
+    <!-- <el-dialog  title="选择终审人" :visible.sync="add_reviewer_show"  :before-close="publicClose"  width="700px">
+      <EmployeeSelector1 :isChecKedAll="false" v-if="add_reviewer_show" ref="Employee" :employee_list="selectReviewer_list" :can_select_dept="false" :multi="false" :selected="selectReviewer" @confirm="add_employee_confirm"></EmployeeSelector1>
        <span slot="footer">
          <el-button @click="publicClose()">取消</el-button>
          <el-button type="primary" @click="sub_add_employee">完成</el-button>
        </span>
-    </el-dialog>
-    <el-dialog  title="选择监察员" :visible.sync="add_notice_show"  :before-close="publicClose"  width="700px">
-      <!-- <EmployeeSelector1 :isChecKedAll="false"  v-if="add_notice_show"  ref="Employee" :selected="selectNotice" :employee_not_select="employee_not_select" :can_select_dept="false" :multi="true"  @confirm="add_employee_confirm"></EmployeeSelector1> -->
-      <!-- 选择终审人 -->
+    </el-dialog> -->
+
+    <!-- 选择终审人 -->
       <EmployeeSelector
         title="选择监察员"
         :visible.sync="add_notice_show"
@@ -116,11 +114,13 @@
         :selected="selectNotice"
         @confirm="add_employee_confirm"
       />
+    <!-- <el-dialog  title="选择监察员" :visible.sync="add_notice_show"  :before-close="publicClose"  width="700px">
+      <EmployeeSelector1 :isChecKedAll="false"  v-if="add_notice_show"  ref="Employee" :selected="selectNotice" :employee_not_select="employee_not_select" :can_select_dept="false" :multi="true"  @confirm="add_employee_confirm"></EmployeeSelector1>
        <span slot="footer">
          <el-button @click="publicClose()">取消</el-button>
          <el-button type="primary" @click="sub_add_employee">完成</el-button>
        </span>
-    </el-dialog>
+    </el-dialog> -->
  
     <el-dialog
       title="提交结果"
@@ -250,9 +250,9 @@
       width="700px">
       <el-table :data="error_list">
         <el-table-column prop="target" label="姓名">
-          <!-- <template slot-scope="scope">
-            <div>第{{scope.row.line}}行</div>
-          </template> -->
+          <template slot-scope="scope">
+            <WWOpenData type="userName" :openid="scope.row.target"></WWOpenData>
+          </template>
         </el-table-column>
         <el-table-column prop="status" label="状态">
           <template slot-scope="scope">
@@ -268,7 +268,7 @@
 
 <script>
 // import EmployeeSelector1 from '@/views/common/EmployeeSelector1'
-import EmployeeSelector from '@/components/EmployeeSelector';
+import EmployeeSelector from '@/views/common/EmployeeSelector';
 export default {
   name: 'add_team_performance',
   components:{EmployeeSelector},

+ 16 - 12
src/views/workbench/performance/team_detail.vue

@@ -448,6 +448,7 @@
 </template>
 
 <script>
+import EmployeeSelector from '@/views/common/EmployeeSelector';
   import EmployeeSelector1 from '@/views/common/EmployeeSelector1'
   import noData from '@/components/noData'
   const validatorNoZero = (rule, value, callback) => {
@@ -464,7 +465,7 @@
 
   export default {
   name: 'team_detail',
-  components: {EmployeeSelector1,noData},
+  components: {EmployeeSelector1, EmployeeSelector, noData},
   data() {
     return {
       amendList:{employee:[], dept: []},
@@ -526,6 +527,7 @@
         cate_id: 0,//共组分类id
       },
       //终审人
+      superior_list:[],
       add_reviewer_show:false,
       selectReviewer:{},
       isSlider2:false,
@@ -919,21 +921,22 @@
       this.getData(true);
     },
     //人员确定
-    sub_add_employee(item){
-      if(this.add_employee_confirmss !== '' ){
-          this.$refs.Employee.confirm();//调用组件的confirm();
-      }
-      this.publicClose();
-      this.add_employee_confirmss = ''
-    },
+    // sub_add_employee(item){
+    //   if(this.add_employee_confirmss !== '' ){
+    //       this.$refs.Employee.confirm();//调用组件的confirm();
+    //   }
+    //   this.publicClose();
+    //   this.add_employee_confirmss = ''
+    // },
     add_employee_confirms(val){
       this.add_employee_confirmss = val
     },
     //执行人选择
-    add_employee_confirm(val){
-        this.selectReviewer=val.employee[0];
-        this.examineItem.reviewer_id=val.employee[0].id;
-        this.drawerAmends.reviewer_id=val.employee[0].id;
+    sub_add_employee(val){
+      this.amendList.employee = val.employee;
+      this.selectReviewer=val.employee[0];
+      this.examineItem.reviewer_id=val.employee[0].id;
+      this.drawerAmends.reviewer_id=val.employee[0].id;
     },
     //公共弹窗关闭
     publicClose(){
@@ -1018,6 +1021,7 @@
             //     this.drawer = true
             //   }
             // }
+            this.superior_list = this.$getEmployeeMap()[res.data.data.employee_id].superior_list
             this.operation_none_fei(res.data.data.publisher_id)//传入发布者ID
 
             this.the_pop_up = res.data.data.work_list

Some files were not shown because too many files changed in this diff