AccountIndex.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. this.$http({
  118. method: 'post',
  119. url: '/sys/agent/selectAgentInfoPage',
  120. data: {
  121. queryParams:this.areaValue
  122. },
  123. }).then((res) => {
  124. if(res.data.code === 200) {
  125. this.getDateList = res.data.data;
  126. }else {
  127. console.log('message', res.data.message);
  128. }
  129. }).catch((err) => {
  130. console.log(err);
  131. })
  132. },
  133. getData: function () {
  134. this.tableData = [];
  135. this.functionData = [];
  136. this.getDateList.forEach((element) => {
  137. this.tableData.push({
  138. num: element.num,
  139. dlr: element.dlr,
  140. area: element.area,
  141. distributor: element.distributor,
  142. plate: element.plate,
  143. account: element.account,
  144. isAttest: element.isAttest,
  145. fans: element.fans
  146. });
  147. this.functionData.push({
  148. id: element.id,
  149. });
  150. });
  151. },
  152. editData: function (i, isAttesta, fansNum) {
  153. console.log('完成编辑', i, isAttesta, fansNum);
  154. },
  155. getDealerListRequest(){//获取经销商列表
  156. this.$http({
  157. method: 'post',
  158. url: '/sys/mediaAccount/selectMediaAccountPage',
  159. data: {
  160. },
  161. }).then((res) => {
  162. if(res.data.code === 200) {
  163. this.getDateList = res.data.data;
  164. // alert('success!')
  165. }else {
  166. console.log('message', res.data.message);
  167. }
  168. }).catch((err) => {
  169. console.log(err);
  170. })
  171. }
  172. // testSyncInterFace(){//测试同步接口
  173. // this.$http({
  174. // method: 'post',
  175. // url: '/interface/loadBaseData',
  176. // data: {
  177. // user: '111'
  178. // },
  179. // }).then((res) => {
  180. // console.log(res);
  181. // if(res.status === 200){
  182. // if(res.data.code === 200) {
  183. // console.log(res.data, '200');
  184. // }else {
  185. // let message = res.data.message;
  186. // console.log('message', message);
  187. // }
  188. // }
  189. // }).catch((err) => {
  190. // console.log(err);
  191. // })
  192. // }
  193. },
  194. mounted() {
  195. this.plateValue = this.platesList[0];
  196. this.getData();
  197. this.getDealerListRequest();
  198. },
  199. };
  200. </script>
  201. <style scoped lang="less">
  202. .accounts_manage {
  203. .search {
  204. border: 1px solid #ccc;
  205. padding: 10px;
  206. display: flex;
  207. align-items: center;
  208. .input {
  209. background-color: #fff;
  210. border: 1px solid #ccc;
  211. padding: 2px;
  212. display: flex;
  213. img {
  214. width: 28px;
  215. height: 28px;
  216. border: 1px solid #ccc;
  217. }
  218. input {
  219. background-color: #fff;
  220. border: 1px solid #ccc;
  221. width: 220px;
  222. margin-left: 3px;
  223. color: #555;
  224. font-size: 12px;
  225. }
  226. }
  227. }
  228. .option {
  229. display: flex;
  230. margin-top: 10px;
  231. .selectArea {
  232. display: flex;
  233. height: 28px;
  234. p {
  235. height: 28px;
  236. line-height: 28px;
  237. margin-right: 20px;
  238. }
  239. select {
  240. width: 144px;
  241. height: 28px;
  242. margin-right: 35px;
  243. border: 1px solid #ccc;
  244. }
  245. }
  246. .selectPlate {
  247. display: flex;
  248. height: 28px;
  249. p {
  250. height: 28px;
  251. line-height: 28px;
  252. margin-right: 20px;
  253. }
  254. select {
  255. width: 144px;
  256. height: 28px;
  257. margin-right: 20px;
  258. border: 1px solid #ccc;
  259. }
  260. }
  261. }
  262. }
  263. </style>