mobileList.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <div class="container">
  3. <fullscreen :fullscreen.sync="fullscreen" class="container-box">
  4. <div class="titbox">
  5. <h2 class="font-ui">手机客户满意度列表</h2>
  6. <div>
  7. <i class="el-icon-refresh" @click="iconCli(1)"></i>
  8. <i class="el-icon-full-screen" @click="iconCli(2)"></i>
  9. <!-- <i class="el-icon-folder-opened"></i>-->
  10. <!-- <i class="el-icon-view"></i>-->
  11. <!-- <i class="el-icon-more"></i>-->
  12. </div>
  13. </div>
  14. <div class="search">
  15. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  16. <div>
  17. <el-button size="medium" type="primary" @click="userImport"
  18. >满意度导入</el-button
  19. >
  20. <el-button size="medium" type="primary" @click="exportsExcel"
  21. >导出</el-button
  22. >
  23. <el-button
  24. size="medium"
  25. v-if="deleteList.length > 0"
  26. type="primary"
  27. @click="deleteOther"
  28. >删除</el-button
  29. >
  30. </div>
  31. </div>
  32. <div class="tabbox">
  33. <el-table
  34. height="calc(100% - 40px)"
  35. v-loading="loading"
  36. class="com-table"
  37. ref="multipleTable"
  38. :data="tableData"
  39. tooltip-effect="dark"
  40. size="small"
  41. border
  42. style="width: 100%"
  43. @selection-change="handleSelectionChange"
  44. >
  45. <el-table-column type="selection" width="55"> </el-table-column>
  46. <el-table-column
  47. align="center"
  48. prop="area"
  49. label="区域"
  50. show-overflow-tooltip
  51. >
  52. </el-table-column>
  53. <el-table-column
  54. align="center"
  55. prop="time"
  56. show-overflow-tooltip
  57. label="期数"
  58. >
  59. </el-table-column>
  60. <el-table-column
  61. align="center"
  62. prop="operator"
  63. show-overflow-tooltip
  64. label="运营商"
  65. width="70"
  66. >
  67. </el-table-column>
  68. <el-table-column
  69. align="center"
  70. prop="allnum"
  71. show-overflow-tooltip
  72. label="总计"
  73. >
  74. </el-table-column>
  75. <el-table-column
  76. align="center"
  77. prop="total"
  78. show-overflow-tooltip
  79. label="整体"
  80. >
  81. </el-table-column>
  82. <el-table-column
  83. align="center"
  84. prop="voice"
  85. show-overflow-tooltip
  86. label="语音通话"
  87. >
  88. </el-table-column>
  89. <el-table-column
  90. align="center"
  91. prop="internet"
  92. show-overflow-tooltip
  93. label="手机上网"
  94. >
  95. </el-table-column>
  96. <el-table-column
  97. align="center"
  98. prop="rule"
  99. show-overflow-tooltip
  100. width="100"
  101. label="资费规则清晰"
  102. >
  103. </el-table-column>
  104. <el-table-column
  105. align="center"
  106. prop="speedy"
  107. show-overflow-tooltip
  108. label="套餐办理便捷"
  109. width="100"
  110. >
  111. </el-table-column>
  112. <el-table-column
  113. align="center"
  114. prop="adapter"
  115. show-overflow-tooltip
  116. label="套餐适配"
  117. >
  118. </el-table-column>
  119. <el-table-column
  120. align="center"
  121. prop="bill"
  122. show-overflow-tooltip
  123. label="账单服务"
  124. >
  125. </el-table-column>
  126. <el-table-column
  127. align="center"
  128. prop="publicity"
  129. show-overflow-tooltip
  130. label="业务宣传"
  131. >
  132. </el-table-column>
  133. <el-table-column
  134. align="center"
  135. prop="remind"
  136. show-overflow-tooltip
  137. label="提醒服务"
  138. >
  139. </el-table-column>
  140. <el-table-column
  141. align="center"
  142. prop="hotline"
  143. show-overflow-tooltip
  144. label="热线服务"
  145. >
  146. </el-table-column>
  147. </el-table>
  148. <el-pagination
  149. class="pageBox"
  150. @current-change="currchange"
  151. layout="prev, pager, next"
  152. background
  153. :total="total"
  154. >
  155. </el-pagination>
  156. </div>
  157. </fullscreen>
  158. </div>
  159. </template>
  160. <script>
  161. import mySearch from "../../../components/search";
  162. import $ from "jquery";
  163. export default {
  164. components: {
  165. mySearch,
  166. },
  167. data() {
  168. return {
  169. fullscreen: false,
  170. total: 0,
  171. pageSize: 1,
  172. tableData: [],
  173. searchList: [
  174. {
  175. type: "input",
  176. tit: "运营商",
  177. value: "",
  178. width: "32%",
  179. options: [],
  180. },
  181. {
  182. type: "input",
  183. tit: "区域",
  184. value: "",
  185. width: "32%",
  186. options: [],
  187. },
  188. {
  189. type: "input",
  190. tit: "期数",
  191. value: "",
  192. width: "32%",
  193. options: [],
  194. },
  195. ],
  196. params: {
  197. area: "",
  198. operator: "",
  199. time: "",
  200. },
  201. loading: false,
  202. deleteList: [],
  203. };
  204. },
  205. methods: {
  206. deleteOther() {
  207. let arr = [];
  208. if (this.deleteList.length > 0) {
  209. this.deleteList.map((item) => {
  210. arr.push(item.id);
  211. });
  212. }
  213. console.log(arr.join(','));
  214. },
  215. exportsExcel() {
  216. // 获取table的html内容了,里面包括标签的class或id等。
  217. let htmlStr = "";
  218. const innerDow = $(".el-table__body-wrapper tbody").html();
  219. const tableHeader = `<table><tr><td></td>
  220. <td>区域</td><td>期数</td><td>运营商</td><td>总计</td>
  221. <td>整体</td><td>语音通话</td><td>手机上网</td><td>资费规则清晰</td>
  222. <td>套餐办理便捷</td><td>套餐适配</td><td>账单服务</td><td>业务宣传</td>
  223. <td>提醒服务</td><td>热线服务</td>
  224. </tr>`;
  225. htmlStr = tableHeader + innerDow + "</table>";
  226. // 生成Excel
  227. const excelBlob = new Blob([htmlStr], {
  228. type: "application/vnd.ms-excel",
  229. });
  230. // 通过a标签下载到本地了,下载前可以利用a标签的download属性命名
  231. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  232. let blob = new Blob([htmlStr], {
  233. type: "application/vnd.ms-excel",
  234. });
  235. window.navigator.msSaveOrOpenBlob(blob, "满意度内容.xlsx");
  236. } else {
  237. /* 火狐谷歌的文件下载方式 */
  238. var blob = new Blob([htmlStr]);
  239. var downloadElement = document.createElement("a");
  240. var href = window.URL.createObjectURL(blob);
  241. downloadElement.href = href;
  242. downloadElement.download = "满意度内容.xlsx";
  243. document.body.appendChild(downloadElement);
  244. downloadElement.click();
  245. document.body.removeChild(downloadElement);
  246. window.URL.revokeObjectURL(href);
  247. }
  248. },
  249. handleSelectionChange(val) {
  250. this.deleteList = val;
  251. },
  252. defaultMenu(path, name) {
  253. let defaults = this.$store.state.tabList.filter((item) => {
  254. if (item.rountPath == path) {
  255. return item;
  256. }
  257. });
  258. if (defaults.length == 1) {
  259. return;
  260. }
  261. let params = {
  262. children: "",
  263. name: name,
  264. rountPath: path,
  265. target: "_self",
  266. };
  267. let set = new Set([...this.$store.state.tabList, params]);
  268. this.$store.commit("setDefaultActive", path);
  269. this.$store.commit("setTabList", Array.from(set));
  270. },
  271. userImport() {
  272. this.$router.push("/importSat");
  273. this.defaultMenu("/importSat", "客户满意度导入");
  274. },
  275. //搜索数据
  276. searchInfo(v) {
  277. this.params = {};
  278. v[0] ? (this.params.operator = v[0]) : "";
  279. v[1] ? (this.params.area = v[1]) : "";
  280. v[2] ? (this.params.time = v[2]) : "";
  281. this.getList(this.params, this.pageSize);
  282. },
  283. //获取列表
  284. getList(v, n) {
  285. this.loading = true;
  286. this.pageSize = n;
  287. this.$http({
  288. url: "/satisfy/sati/getMobileSatisfy",
  289. method: "post",
  290. headers: {
  291. "Content-Type": "application/json",
  292. page: '{"pageNo":"' + n + '","pageSize":"10"}',
  293. },
  294. data: v,
  295. }).then((res) => {
  296. this.loading = false;
  297. this.tableData = res.data.data;
  298. this.total = res.data.totalRecord;
  299. });
  300. },
  301. //功能栏
  302. iconCli(v) {
  303. if (v === 1) {
  304. this.getList(this.params, this.pageSize);
  305. }
  306. if (v === 2) {
  307. this.fullscreen = !this.fullscreen;
  308. }
  309. },
  310. // 分页
  311. currchange(v) {
  312. this.pageSize = v;
  313. this.getList(this.params, this.pageSize);
  314. },
  315. },
  316. mounted() {
  317. this.getList(this.params, this.pageSize);
  318. },
  319. };
  320. </script>
  321. <style>
  322. .el-input__suffix {
  323. cursor: pointer;
  324. }
  325. </style>
  326. <style scoped lang="scss">
  327. .titbox {
  328. div {
  329. float: right;
  330. i {
  331. font-size: 22px;
  332. margin-left: 20px;
  333. cursor: pointer;
  334. }
  335. }
  336. }
  337. .tabbox {
  338. margin-top: 15px;
  339. }
  340. .pageBox {
  341. text-align: right;
  342. margin-top: 10px;
  343. }
  344. </style>