index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <div class="app-container">
  3. <!-- 门店列表 -->
  4. <el-card class="box-card">
  5. <div class="pd-30">
  6. <!-- <el-input
  7. clearable
  8. prefix-icon="el-icon-search"
  9. v-model="listQuery.name"
  10. placeholder="请输入门店名称"
  11. style="width: 300px;"
  12. class="filter-item"
  13. @keyup.enter.native="handleFilter"
  14. /> -->
  15. <el-cascader
  16. size="large"
  17. :options="options3"
  18. v-model="listQuery.selectedOptions"
  19. @change="handleChange"
  20. >
  21. </el-cascader>
  22. <el-select
  23. style="margin-left: 10px;"
  24. v-model="listQuery.type"
  25. placeholder="请选择"
  26. >
  27. <el-option
  28. v-for="item in options1"
  29. :key="item.value"
  30. :label="item.label"
  31. :value="item.value"
  32. clearable
  33. :disabled="item.disabled"
  34. >
  35. </el-option>
  36. </el-select>
  37. <el-select
  38. style="margin-left: 10px;"
  39. v-model="listQuery.name"
  40. placeholder="请选择"
  41. >
  42. <el-option
  43. v-for="item in options2"
  44. :key="item.value"
  45. :label="item.label"
  46. :value="item.value"
  47. clearable
  48. :disabled="item.disabled"
  49. >
  50. </el-option>
  51. </el-select>
  52. <el-button
  53. style="margin-left: 10px;"
  54. :loading="searchLoading"
  55. type="primary"
  56. icon="el-icon-search"
  57. @click="handleFilter"
  58. disabled
  59. >
  60. 搜索
  61. </el-button>
  62. </div>
  63. <el-table
  64. :data="tableData"
  65. style="width: 100%;fontSize:12px;"
  66. v-loading="listLoading"
  67. :cell-style="{ padding: '6px 0' }"
  68. >
  69. <el-table-column prop="_id" label="ID" width="90px"></el-table-column>
  70. <el-table-column
  71. prop="storeName"
  72. label="storeName"
  73. width="210"
  74. show-overflow-tooltip
  75. ></el-table-column>
  76. <el-table-column
  77. prop="shipping_time"
  78. label="shipping_time"
  79. ></el-table-column>
  80. <el-table-column
  81. prop="shipping_fee"
  82. width="100"
  83. label="shipping_fee"
  84. ></el-table-column>
  85. <el-table-column
  86. prop="score"
  87. width="100"
  88. label="score"
  89. ></el-table-column>
  90. <el-table-column prop="sales" label="sales"></el-table-column>
  91. <el-table-column
  92. prop="phone_list"
  93. show-overflow-tooltip
  94. label="phone_list"
  95. ></el-table-column>
  96. <el-table-column
  97. prop="min_price"
  98. width="100"
  99. label="min_price"
  100. ></el-table-column>
  101. <el-table-column
  102. prop="comment_num"
  103. width="120"
  104. show-overflow-tooltip
  105. label="comment_num"
  106. ></el-table-column>
  107. <el-table-column
  108. prop="call_center"
  109. show-overflow-tooltip
  110. label="call_center"
  111. ></el-table-column>
  112. <el-table-column
  113. prop="address"
  114. show-overflow-tooltip
  115. label="address"
  116. ></el-table-column>
  117. <!-- <el-table-column
  118. label="操作"
  119. align="center"
  120. width="230"
  121. class-name="small-padding fixed-width"
  122. >
  123. <template slot-scope="{row}">
  124. <el-button type="primary" size="mini" @click="handleUpdate(row)">编辑</el-button>
  125. <el-button type="primary" size="mini" @click="handleUpdate(row)">商品管理</el-button>
  126. </template>
  127. </el-table-column>-->
  128. </el-table>
  129. </el-card>
  130. </div>
  131. </template>
  132. <script>
  133. import { getCoffeeStore } from "@/api/store";
  134. import {
  135. provinceAndCityData,
  136. CodeToText,
  137. TextToCode
  138. } from "element-china-area-data";
  139. const options1 = [
  140. {
  141. value: "饿了么",
  142. label: "饿了么",
  143. disabled: true
  144. },
  145. {
  146. value: "美团",
  147. label: "美团"
  148. },
  149. {
  150. value: "高德地图",
  151. label: "高德地图",
  152. disabled: true
  153. },
  154. {
  155. value: "大众点评",
  156. label: "大众点评",
  157. disabled: true
  158. }
  159. ];
  160. const options2 = [
  161. {
  162. value: "烘焙",
  163. label: "烘焙",
  164. disabled: true
  165. },
  166. {
  167. value: "咖啡馆",
  168. label: "咖啡馆"
  169. },
  170. {
  171. value: "甜点",
  172. label: "甜点",
  173. disabled: true
  174. },
  175. {
  176. value: "饮品",
  177. label: "饮品",
  178. disabled: true
  179. },
  180. {
  181. value: "网咖",
  182. label: "网咖",
  183. disabled: true
  184. },
  185. {
  186. value: "西餐厅",
  187. label: "西餐厅",
  188. disabled: true
  189. },
  190. {
  191. value: "便利店",
  192. label: "便利店",
  193. disabled: true
  194. },
  195. {
  196. value: "美食城",
  197. label: "美食城",
  198. disabled: true
  199. },
  200. {
  201. value: "酒店",
  202. label: "酒店",
  203. disabled: true
  204. },
  205. {
  206. value: "猫咖",
  207. label: "猫咖",
  208. disabled: true
  209. },
  210. {
  211. value: "书吧",
  212. label: "书吧",
  213. disabled: true
  214. }
  215. ];
  216. export default {
  217. data() {
  218. return {
  219. tableData: [],
  220. listQuery: {
  221. type: "美团",
  222. name: "咖啡馆",
  223. selectedOptions: [
  224. TextToCode["上海市"].code,
  225. TextToCode["上海市"]["市辖区"].code
  226. ]
  227. },
  228. listLoading: true,
  229. searchLoading: false,
  230. options1,
  231. options2,
  232. options3: provinceAndCityData
  233. };
  234. },
  235. created() {
  236. this.getList();
  237. },
  238. methods: {
  239. getList() {
  240. this.listLoading = true;
  241. getCoffeeStore().then(res => {
  242. console.log(res);
  243. this.listLoading = false;
  244. this.tableData = res;
  245. });
  246. },
  247. handleFilter() {},
  248. selectChange() {},
  249. handleChange(value) {
  250. console.log(CodeToText[value[0]], CodeToText[value[1]]);
  251. console.log(value);
  252. }
  253. }
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. .pd-30 {
  258. padding: 10px 0 30px;
  259. }
  260. .shop-message {
  261. display: flex;
  262. align-items: center;
  263. justify-content: space-between;
  264. .shop-message-l {
  265. display: flex;
  266. align-items: center;
  267. }
  268. .shop-message-l > div {
  269. margin: 0 30px;
  270. text-align: center;
  271. }
  272. .line {
  273. width: 1px;
  274. height: 70px;
  275. background: #dddddd;
  276. }
  277. }
  278. .black-20 {
  279. height: 20px;
  280. overflow: hidden;
  281. clear: both;
  282. }
  283. </style>