dataStatistics.vue 11 KB

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