AccountIndex.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <!-- 厂商账号管理 -->
  3. <div class="accounts_manage">
  4. <div class="search">
  5. <div class="input">
  6. <img src="../../img/search.png" />
  7. <input type="text" @focus="focusInput" v-model="inputValue" />
  8. </div>
  9. <div class="current_button" @click="search">搜索</div>
  10. </div>
  11. <div class="option">
  12. <div class="selectArea">
  13. <p>选择区域</p>
  14. <select v-model="areaValue" @change="areaOption">
  15. <option value="">请选择</option>
  16. <option v-for="(item, index) in areaList" :key="index">
  17. {{ item.area }}
  18. </option>
  19. </select>
  20. </div>
  21. <div class="selectPlate">
  22. <p>媒体平台</p>
  23. <select v-model="plateValue" @change="plateOption">
  24. <option v-for="(item, index) in platesList" :key="index">
  25. {{ item }}
  26. </option>
  27. </select>
  28. </div>
  29. <div class="current_button" @click="submit">确定</div>
  30. </div>
  31. <Table
  32. :tableData='getDateList'
  33. @edit_data='editData'
  34. > </Table>
  35. </div>
  36. </template>
  37. <script>
  38. import Table from "./components/AccountTable";
  39. export default {
  40. components: {
  41. Table,
  42. },
  43. data() {
  44. return {
  45. inputValue: "请输入要搜索的经销商或DLR Code",
  46. areaList: [
  47. {
  48. sign: "all",
  49. area: "全区",
  50. checked: false,
  51. },
  52. {
  53. sign: "n",
  54. area: "北区",
  55. checked: false,
  56. },
  57. {
  58. sign: "s",
  59. area: "南区",
  60. checked: false,
  61. },
  62. {
  63. sign: "e",
  64. area: "东区",
  65. checked: false,
  66. },
  67. {
  68. sign: "self",
  69. area: "自定义分组",
  70. checked: false,
  71. },
  72. ],
  73. platesList: ["全部", "微信订阅号", "微信服务号", "抖音", "今日头条", "微信视频号"],
  74. areaValue: "",
  75. plateValue: "",
  76. tableData: [],
  77. getDateList: [
  78. { num: "1", id: "123", dlr: 'L0201', area: '北区', distributor: '北京博瑞',plate:'微信公众号', account: '雷克萨斯北京博瑞4S店', isAttest: 0, fans: 118529},
  79. { num: "1", id: "123", dlr: 'L0201', area: '北区', distributor: '北京博瑞',plate:'微信公众号', account: '雷克萨斯北京博瑞4S店', isAttest: 0, fans: 118529},
  80. { num: "1", id: "123", dlr: 'L0201', area: '北区', distributor: '北京博瑞',plate:'微信公众号', account: '雷克萨斯北京博瑞4S店', isAttest: 0, fans: 118529},
  81. { num: "1", id: "123", dlr: 'L0201', area: '北区', distributor: '北京博瑞',plate:'微信公众号', account: '雷克萨斯北京博瑞4S店', isAttest: 1, fans: 118529}
  82. ],
  83. functionData: [],
  84. };
  85. },
  86. methods: {
  87. focusInput: function () {
  88. this.inputValue = "";
  89. },
  90. search: function () { //通过经销商或DLR CODE查询
  91. console.log(this.inputValue);
  92. this.$http({
  93. method: 'post',
  94. url: '/sys/agent/selectAgentInfoPage',
  95. data: {
  96. queryParams:this.inputValue
  97. },
  98. }).then((res) => {
  99. if(res.data.code === 200) {
  100. this.getDateList = res.data.data;
  101. }else {
  102. console.log('message', res.data.message);
  103. }
  104. }).catch((err) => {
  105. console.log(err);
  106. })
  107. },
  108. areaOption: function () {
  109. console.log(this.areaValue);
  110. },
  111. plateOption: function () {
  112. console.log(this.plateValue);
  113. },
  114. submit: function () {
  115. console.log(this.plateValue);
  116. console.log(this.areaValue);
  117. },
  118. getData: function () {
  119. this.tableData = [];
  120. this.functionData = [];
  121. this.getDateList.forEach((element) => {
  122. this.tableData.push({
  123. num: element.num,
  124. dlr: element.dlr,
  125. area: element.area,
  126. distributor: element.distributor,
  127. plate: element.plate,
  128. account: element.account,
  129. isAttest: element.isAttest,
  130. fans: element.fans
  131. });
  132. this.functionData.push({
  133. id: element.id,
  134. });
  135. });
  136. },
  137. editData: function (i, isAttesta, fansNum) {
  138. console.log('完成编辑', i, isAttesta, fansNum);
  139. },
  140. getDealerListRequest(){//获取经销商列表
  141. this.$http({
  142. method: 'post',
  143. url: '/sys/agent/selectAgentInfoPage',
  144. data: {
  145. },
  146. }).then((res) => {
  147. if(res.data.code === 200) {
  148. this.getDateList = res.data.data;
  149. }else {
  150. console.log('message', res.data.message);
  151. }
  152. }).catch((err) => {
  153. console.log(err);
  154. })
  155. }
  156. // testSyncInterFace(){//测试同步接口
  157. // this.$http({
  158. // method: 'post',
  159. // url: '/interface/loadBaseData',
  160. // data: {
  161. // user: '111'
  162. // },
  163. // }).then((res) => {
  164. // console.log(res);
  165. // if(res.status === 200){
  166. // if(res.data.code === 200) {
  167. // console.log(res.data, '200');
  168. // }else {
  169. // let message = res.data.message;
  170. // console.log('message', message);
  171. // }
  172. // }
  173. // }).catch((err) => {
  174. // console.log(err);
  175. // })
  176. // }
  177. },
  178. mounted() {
  179. this.plateValue = this.platesList[0];
  180. this.getData();
  181. this.getDealerListRequest();
  182. },
  183. };
  184. </script>
  185. <style scoped lang="less">
  186. .accounts_manage {
  187. .search {
  188. border: 1px solid #ccc;
  189. padding: 10px;
  190. display: flex;
  191. align-items: center;
  192. .input {
  193. background-color: #fff;
  194. border: 1px solid #ccc;
  195. padding: 2px;
  196. display: flex;
  197. img {
  198. width: 28px;
  199. height: 28px;
  200. border: 1px solid #ccc;
  201. }
  202. input {
  203. background-color: #fff;
  204. border: 1px solid #ccc;
  205. width: 220px;
  206. margin-left: 3px;
  207. color: #555;
  208. font-size: 12px;
  209. }
  210. }
  211. }
  212. .option {
  213. display: flex;
  214. margin-top: 10px;
  215. .selectArea {
  216. display: flex;
  217. height: 28px;
  218. p {
  219. height: 28px;
  220. line-height: 28px;
  221. margin-right: 20px;
  222. }
  223. select {
  224. width: 144px;
  225. height: 28px;
  226. margin-right: 35px;
  227. border: 1px solid #ccc;
  228. }
  229. }
  230. .selectPlate {
  231. display: flex;
  232. height: 28px;
  233. p {
  234. height: 28px;
  235. line-height: 28px;
  236. margin-right: 20px;
  237. }
  238. select {
  239. width: 144px;
  240. height: 28px;
  241. margin-right: 20px;
  242. border: 1px solid #ccc;
  243. }
  244. }
  245. }
  246. }
  247. </style>