dataStatistics.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <fullscreen :fullscreen.sync="fullscreen" class="container">
  3. <div class="container-box">
  4. <div class="dc">
  5. <el-button type="primary" style="margin-right: 20px;" @click="outexl">导出</el-button>
  6. <span style="margin-right: 20px;">共 {{fillCnt}} 条数据</span>
  7. <span>更新日期:{{lastUpdateTime}}</span>
  8. </div>
  9. <div class="tabbox">
  10. <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
  11. tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
  12. <!-- @selection-change="handleSelectionChange"> -->
  13. <!-- <el-table-column type="selection" width="55">
  14. </el-table-column> -->
  15. <el-table-column prop="regionName" label="区域名称">
  16. <template slot-scope="scope">
  17. {{scope.row.regionName}}{{scope.row.areaName}}
  18. </template>
  19. </el-table-column>
  20. <el-table-column prop="regionDutyName" label="负责人">
  21. <template slot-scope="scope">
  22. {{scope.row.regionDutyName}}{{scope.row.areaDutyName}}
  23. </template>
  24. </el-table-column>
  25. <el-table-column prop="cnt" label="员工总数">
  26. </el-table-column>
  27. <el-table-column label="操作" width="160px" align="center">
  28. <template slot-scope="scope">
  29. <el-button size="mini" type="primary" @click="choseperson(scope.row)">查看</el-button>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. </div>
  34. </div>
  35. </fullscreen>
  36. </template>
  37. <script>
  38. import mySearch from "../../../components/search.vue";
  39. import myMessage from "../../../components/myMessage.vue"
  40. import toolList from '../../../components/toolList'
  41. export default {
  42. components: {
  43. mySearch,
  44. myMessage,
  45. toolList
  46. },
  47. data() {
  48. return {
  49. searchList: [{
  50. type: 'input',
  51. tit: '供应商名称',
  52. value: '',
  53. width: '98%',
  54. }],
  55. tooltit: '人员进度跟踪',
  56. fullscreen: false,
  57. total: 0,
  58. pageSize: 1,
  59. tableData: [{}],
  60. dialogStatus: false,
  61. disableStatus: false,
  62. titname: '',
  63. infolist: {},
  64. userInfo: {},
  65. params: {},
  66. centerDialogVisible: false,
  67. messTit: '',
  68. delid: '',
  69. loading: false,
  70. loadinged: false,
  71. time: '',
  72. num: '',
  73. fillCnt: '',
  74. lastUpdateTime: '',
  75. sts:1,
  76. companyFlag:'',
  77. }
  78. },
  79. methods: {
  80. outexl(){
  81. let url = '';
  82. let paramsf = {};
  83. if(this.sts == 1){
  84. url = '/market/cMemberWo/excelExportSummaryByProv';
  85. }else{
  86. url = '/market/cMemberWo/excelExportSummaryByArea';
  87. // paramsf.regionName =
  88. }
  89. this.$http({
  90. url: url,
  91. method: "post",
  92. responseType: 'blob',
  93. headers: {
  94. "Content-Type": "application/json",
  95. },
  96. data: paramsf,
  97. }).then((response) => {
  98. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  99. let blob = new Blob([response.data], {
  100. type: response.data.type
  101. });
  102. window.navigator.msSaveOrOpenBlob(blob, 'adv.xlsx');
  103. } else {
  104. /* 火狐谷歌的文件下载方式 */
  105. console.log(response.data.type)
  106. var blob = new Blob([response.data])
  107. var downloadElement = document.createElement('a')
  108. var href = window.URL.createObjectURL(blob);
  109. downloadElement.href = href;
  110. downloadElement.download = 'adv.xlsx';
  111. document.body.appendChild(downloadElement);
  112. downloadElement.click();
  113. document.body.removeChild(downloadElement);
  114. window.URL.revokeObjectURL(href);
  115. }
  116. });
  117. },
  118. choseperson(v){
  119. console.log(v)
  120. if(this.companyFlag == 0){
  121. if(this.sts == 2){
  122. this.$router.push({
  123. path: "/employeeInfo",
  124. query:{
  125. regionName:v.areaName
  126. }
  127. });
  128. this.setabList("员工信息", "/employeeInfo?regionName="+v.areaName);
  129. return
  130. }
  131. this.$http({
  132. url: "/market/cMemberWo/querySummaryByAreaPage",
  133. method: "post",
  134. headers: {
  135. "Content-Type": "application/json",
  136. "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
  137. },
  138. data: {regionName:v.regionName},
  139. }).then((res) => {
  140. this.tableData = res.data.data;
  141. this.total = res.data.totalRecord;
  142. this.loading = false;
  143. this.sts = 2;
  144. });
  145. }else{
  146. this.$router.push({
  147. path: "/employeeInfo?regionName="+v.regionName,
  148. query:{
  149. regionName:v.regionName
  150. }
  151. });
  152. this.setabList("员工信息", "/employeeInfo?regionName="+v.regionName);
  153. }
  154. },
  155. setabList(n, p) {
  156. let params = {
  157. children: "",
  158. name: n,
  159. rountPath: p,
  160. target: "_self",
  161. };
  162. for (let i = 0; i < this.$store.state.tabList.length; i++) {
  163. if (this.$store.state.tabList[i].name === params.name) {
  164. this.$store.state.tabList[i] = params;
  165. }
  166. }
  167. let set = new Set([...this.$store.state.tabList, params]);
  168. set.add(params);
  169. this.$store.commit("setDefaultActive", params.rountPath);
  170. this.$store.commit("setTabList", Array.from(set));
  171. },
  172. handleSelectionChange(val) {
  173. console.log(val)
  174. },
  175. //搜索数据
  176. searchInfo(v) {
  177. this.params = {};
  178. v[0] ? this.params.supplierName = v[0] : '';
  179. this.getList(this.params, this.pageSize);
  180. },
  181. //获取列表
  182. getList(v, n) {
  183. this.pageSize = n;
  184. let _this = this;
  185. this.loading = true;
  186. this.tableData = [];
  187. let url = '';
  188. if(this.companyFlag == 0){
  189. url="/market/cMemberWo/querySummaryByProvPage"
  190. }else if(this.companyFlag == 1){
  191. url="/market/cMemberWo/querySummaryByAreaPage"
  192. v.regionName = this.userInfo.cityName
  193. }
  194. this.$http({
  195. url: url,
  196. method: "post",
  197. headers: {
  198. "Content-Type": "application/json",
  199. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  200. },
  201. data: v,
  202. }).then((res) => {
  203. this.tableData = res.data.data;
  204. this.total = res.data.totalRecord;
  205. this.loading = false;
  206. });
  207. },
  208. // 分页
  209. currchange(v) {
  210. this.pageSize = v;
  211. this.getList(this.params, this.pageSize);
  212. },
  213. //申请
  214. dialogCheck(v, n) {
  215. this.dialogStatus = true;
  216. this.infolist = Object.assign({}, n);
  217. if (v === 1) {
  218. this.titname = '查看';
  219. this.disableStatus = true;
  220. return
  221. } else if (v === 2) {
  222. this.titname = '修改';
  223. this.disableStatus = false;
  224. } else if (v === 3) {
  225. this.titname = '添加';
  226. this.disableStatus = false;
  227. }
  228. this.infolist.opNo = this.userInfo.loginNo;
  229. this.infolist.opName = this.userInfo.loginName;
  230. },
  231. //功能栏
  232. iconCli(v) {
  233. if (v === 1) {
  234. this.getList(this.params, this.pageSize);
  235. }
  236. if (v === 2) {
  237. this.fullscreen = !this.fullscreen
  238. }
  239. },
  240. getUser() {
  241. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  242. this.$http({
  243. url: "/market/cMemberFillDetail/querySummaryInfo",
  244. method: "post",
  245. headers: {
  246. "Content-Type": "application/json",
  247. },
  248. data: {},
  249. }).then((res) => {
  250. this.fillCnt = res.data.fillCnt;
  251. this.lastUpdateTime = res.data.lastUpdateTime;
  252. });
  253. this.$http({
  254. url: "/sysmgr/csysuserinfo/queryUserInfoByLoginNo",
  255. method: "post",
  256. headers: {
  257. "Content-Type": "application/json",
  258. },
  259. data: {},
  260. }).then((res) => {
  261. this.companyFlag = res.data.companyFlag;
  262. this.getList({}, 1);
  263. });
  264. }
  265. },
  266. mounted() {
  267. this.getUser();
  268. },
  269. created() {
  270. }
  271. }
  272. </script>
  273. <style scoped lang="scss">
  274. .onetab {
  275. margin-bottom: 20px;
  276. padding: 0 20px;
  277. }
  278. .titbox {
  279. div {
  280. float: right;
  281. i {
  282. font-size: 22px;
  283. margin-left: 20px;
  284. cursor: pointer;
  285. }
  286. }
  287. }
  288. .tabbox {
  289. margin-top: 15px;
  290. }
  291. .pageBox {
  292. text-align: right;
  293. margin-top: 10px;
  294. }
  295. .info-line {
  296. width: 100%;
  297. display: block;
  298. padding-left: 20px;
  299. div {
  300. width: 50%;
  301. display: inline-block;
  302. }
  303. span {
  304. width: 80px;
  305. display: inline-block;
  306. text-align: left;
  307. i {
  308. color: red;
  309. display: inline-block;
  310. padding-right: 5px;
  311. }
  312. }
  313. .el-select,
  314. .el-input {
  315. width: calc(100% - 100px);
  316. }
  317. }
  318. .online {
  319. width: 100%;
  320. .el-select {
  321. width: calc(100% - 100px);
  322. }
  323. span {
  324. vertical-align: top;
  325. }
  326. .el-textarea {
  327. width: calc(100% - 100px);
  328. }
  329. }
  330. </style>