UploadLinks.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <div class="upload_links">
  3. <div class="header">
  4. <div class="search">
  5. <div class="input">
  6. <img src="../../img/search.png" />
  7. <input
  8. type="text"
  9. @focus="focusInput"
  10. v-model="inputValue"
  11. class="inputFocus"
  12. placeholder="DLR Code / 经销商"
  13. />
  14. </div>
  15. <div class="area">
  16. <p>所属区域</p>
  17. <select v-model="areaValue">
  18. <option value="">全区</option>
  19. <option v-for="(item, index) in areaList" :key="index">
  20. {{ item }}
  21. </option>
  22. </select>
  23. </div>
  24. <div class="time">
  25. <p>请选择时间段</p>
  26. <input type="date" v-model="startTime" />
  27. <span>至</span>
  28. <input type="date" v-model="endTime" />
  29. </div>
  30. <div class="current_button" @click="search">搜索</div>
  31. </div>
  32. </div>
  33. <div class="count">
  34. <p>针对论坛及其它平台链接上传</p>
  35. <div style="display: flex">
  36. <div><Count :sum="sum" /></div>
  37. <div class="current_button" @click="exportData">导出</div>
  38. </div>
  39. </div>
  40. <div class="tableBox">
  41. <Table :tableData="tableData" @go_detail="ulrJump"></Table>
  42. </div>
  43. <TablePage
  44. :currentPage="currentPage"
  45. :totalPage="totalPage"
  46. @change_page="changePage"
  47. @jump_page="jumpPage"
  48. ></TablePage>
  49. </div>
  50. </template>
  51. <script>
  52. import TablePage from "../../components/TablePage";
  53. import Count from "../../components/Count";
  54. import Table from "./components/UploadLinksTable";
  55. import { env_url , php_url} from "../../config/env"
  56. import axiosTest from 'axios';
  57. export default {
  58. components: {
  59. TablePage,
  60. Count,
  61. Table,
  62. },
  63. data() {
  64. return {
  65. inputValue: "",
  66. sum: 0,
  67. currentPage: 1,
  68. pageSize: 20,
  69. tableData: [],
  70. areaList: [],
  71. areaValue: "",
  72. startTime: "",
  73. endTime: "",
  74. onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试,
  75. otherUrl:php_url,
  76. };
  77. },
  78. computed: {
  79. // 表格总页数
  80. totalPage() {
  81. return Math.ceil(this.sum / this.pageSize);
  82. },
  83. },
  84. methods: {
  85. // 当焦点在选择框时,清空选择框
  86. focusInput: function () {
  87. this.inputValue = "";
  88. },
  89. search: function () {
  90. let data = {
  91. queryParams: this.inputValue,
  92. localArea: this.areaValue,
  93. startTime: this.startTime,
  94. endTime: this.endTime,
  95. Page: this.currentPage,
  96. Rows: this.pageSize,
  97. };
  98. // this.firmsLinkUpload(data);
  99. this.getPageTableDate(data);
  100. },
  101. changePage: function (page) {
  102. this.currentPage = page;
  103. let req = {
  104. queryParams: this.inputValue,
  105. localArea: this.areaValue,
  106. startTime: this.startTime,
  107. endTime: this.endTime,
  108. Page: this.currentPage,
  109. Rows: this.pageSize,
  110. };
  111. // this.firmsLinkUpload(req);
  112. this.getPageTableDate(req)
  113. },
  114. // 点击上一页,下一页,首页,尾页
  115. jumpPage: function (item) {
  116. switch (item) {
  117. case 1:
  118. this.currentPage = 1;
  119. break;
  120. case 2:
  121. this.currentPage = this.currentPage - 1;
  122. break;
  123. case 3:
  124. this.currentPage = this.currentPage + 1;
  125. break;
  126. case 4:
  127. this.currentPage = this.totalPage;
  128. break;
  129. }
  130. let req = {
  131. queryParams: this.inputValue,
  132. localArea: this.areaValue,
  133. startTime: this.startTime,
  134. endTime: this.endTime,
  135. Page: this.currentPage,
  136. Rows: this.pageSize,
  137. };
  138. // this.firmsLinkUpload(req);
  139. this.getPageTableDate(req)
  140. },
  141. ulrJump: function (url) {
  142. window.open(url);
  143. },
  144. exportData: function () {
  145. this.exportTem();
  146. },
  147. // 获取表格数据
  148. firmsLinkUpload: function (data = {}) {
  149. this.$http({
  150. method: "post",
  151. url: "/firmsLinkUpload",
  152. data: data,
  153. })
  154. .then((res) => {
  155. console.log(res.data, 111111);
  156. this.tableData = res.data.data;
  157. this.sum = res.data.count;
  158. })
  159. .catch((err) => {
  160. console.log(err);
  161. });
  162. },
  163. //php获取表格数据
  164. // 获取表格数据
  165. getPageTableDate: function (data = {}) {
  166. axiosTest({
  167. method: "post",
  168. url: this.otherUrl + '/lexus_php/api/report_list.php',
  169. data: data,
  170. })
  171. .then((res) => {
  172. console.log(res.data, 111111);
  173. this.tableData = res.data.data;
  174. this.sum = res.data.count;
  175. })
  176. .catch((err) => {
  177. console.log(err);
  178. });
  179. },
  180. // 获取 所有区域 接口
  181. getAreaList: function () {
  182. this.$http({
  183. method: "post",
  184. url: "/sys/agent/selectAgentAreaInfoList",
  185. })
  186. .then((res) => {
  187. if (res.data && res.data.code === 200) {
  188. this.areaList = res.data.data;
  189. } else {
  190. console.log(res);
  191. }
  192. })
  193. .catch((err) => {
  194. console.log(err);
  195. });
  196. },
  197. // 导出 接口
  198. exportTem: function () {
  199. // queryParams: this.inputValue,
  200. // localArea: this.areaValue,
  201. // startTime: this.startTime,
  202. // endTime: this.endTime,
  203. // let url = this.onlineUrl + "/exportFactory";
  204. let url = this.otherUrl + '/lexus_php/web/report_export.php?queryParams='+ this.inputValue + '&localArea=' + this.areaValue + '&startTime=' + this.startTime + '&endTime=' + this.endTime;
  205. window.open(url);
  206. },
  207. },
  208. created() {
  209. let req = {
  210. Page: this.currentPage,
  211. Rows: this.pageSize,
  212. };
  213. //this.firmsLinkUpload(req);
  214. this.getPageTableDate(req);
  215. this.getAreaList();
  216. }
  217. };
  218. </script>
  219. <style scoped lang="less">
  220. .upload_links {
  221. .header {
  222. padding: 10px;
  223. border: 1px solid #ccc;
  224. .search {
  225. display: flex;
  226. align-items: center;
  227. .input {
  228. background-color: #fff;
  229. border: 1px solid #ccc;
  230. padding: 2px;
  231. display: flex;
  232. img {
  233. width: 22px;
  234. height: 22px;
  235. border: 1px solid #ccc;
  236. }
  237. input {
  238. background-color: #fff;
  239. border: 1px solid #ccc;
  240. margin-left: 3px;
  241. color: #555;
  242. font-size: 12px;
  243. height: 18px;
  244. }
  245. }
  246. }
  247. .area {
  248. margin-left: 20px;
  249. display: flex;
  250. height: 28px;
  251. line-height: 28px;
  252. select {
  253. margin-left: 10px;
  254. height: 28px;
  255. width: 120px;
  256. font-size: 12px;
  257. color: #555;
  258. border: 1px solid #ccc;
  259. option {
  260. font-size: 12px;
  261. border: 1px solid #ccc;
  262. }
  263. }
  264. }
  265. .time {
  266. display: flex;
  267. margin-left: 20px;
  268. p {
  269. height: 28px;
  270. line-height: 28px;
  271. margin-right: 10px;
  272. }
  273. input {
  274. height: 26px;
  275. padding: 0;
  276. outline: none;
  277. border: 1px solid #ccc;
  278. margin-right: 10px;
  279. }
  280. span {
  281. height: 28px;
  282. line-height: 28px;
  283. margin-right: 10px;
  284. }
  285. }
  286. }
  287. .count {
  288. display: flex;
  289. justify-content: space-between;
  290. margin-top: 5px;
  291. p {
  292. margin-top: 10px;
  293. font-weight: 600;
  294. }
  295. }
  296. .tableBox {
  297. width: 1030px;
  298. overflow: auto;
  299. text-align: center;
  300. }
  301. }
  302. .inputFocus {
  303. outline: none;
  304. border: 1px solid #ccc;
  305. }
  306. .inputFocus:focus {
  307. animation: shadowAni 200ms linear forwards;
  308. }
  309. @keyframes shadowAni {
  310. 0% {
  311. border-color: #cccccc;
  312. box-shadow: inset 0px 0px 0 #ccc;
  313. }
  314. 100% {
  315. border-color: #75b9f0;
  316. box-shadow: 0px 0px 5px #75b9f0;
  317. }
  318. }
  319. </style>