index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <div>
  3. <div class="filterPop">
  4. <el-dialog
  5. top="130px"
  6. :visible.sync="visible"
  7. width="52.5%"
  8. :close-on-click-modal="false"
  9. >
  10. <span slot="title" class="slot-title">
  11. <i @click="closeFilterPop" class="el-icon-arrow-left"></i>
  12. 筛选条件
  13. </span>
  14. <div class="customer-source">
  15. <div class="center">
  16. <div class="item-title">{{ customerSource.name }}</div>
  17. <div class="content">
  18. <div
  19. class="content-item"
  20. :class="{
  21. activeFilter: index == customerSelect,
  22. }"
  23. v-for="(item, index) in customerSource.title"
  24. :key="index"
  25. @click="customerFilter(item, index)"
  26. >
  27. {{ item }}
  28. </div>
  29. </div>
  30. </div>
  31. <div class="center">
  32. <div class="item-title">{{ couponSource.name }}</div>
  33. <div class="content">
  34. <div
  35. class="content-item"
  36. :class="{
  37. activeFilter: index == couponSelect,
  38. }"
  39. v-for="(item, index) in couponSource.title"
  40. :key="index"
  41. @click="couponFilter(item, index)"
  42. >
  43. {{ item }}
  44. </div>
  45. </div>
  46. </div>
  47. <div class="center">
  48. <div class="item-title">{{ cardSource.name }}</div>
  49. <div class="content">
  50. <div
  51. class="content-item"
  52. :class="{
  53. activeFilter: index == cardSelect,
  54. }"
  55. v-for="(item, index) in cardSource.title"
  56. :key="index"
  57. @click="cardFilter(item, index)"
  58. >
  59. {{ item }}
  60. </div>
  61. </div>
  62. </div>
  63. <div class="center">
  64. <div class="item-title">{{ latelySource.name }}</div>
  65. <div class="content">
  66. <div
  67. class="content-item"
  68. :class="{
  69. activeFilter: index == latelySelect,
  70. }"
  71. v-for="(item, index) in latelySource.title"
  72. :key="index"
  73. @click="latelyFilter(item, index)"
  74. >
  75. {{ item }}
  76. </div>
  77. </div>
  78. </div>
  79. <div class="superposition">
  80. <div class="superposition-title">项目叠加次数</div>
  81. <el-input-number
  82. v-model="superpositionNum"
  83. :min="0"
  84. size="mini"
  85. ></el-input-number>
  86. </div>
  87. <div class="transition">
  88. <div class="transition-title">转换次数</div>
  89. <el-input-number
  90. v-model="transitionNum"
  91. :min="0"
  92. size="mini"
  93. ></el-input-number>
  94. </div>
  95. <div class="consumePrice">
  96. <div class="consumePrice-title">总消费金额</div>
  97. <div class="consumePrice-content">
  98. <el-input v-model="minConsumePrice"></el-input>
  99. <div>-</div>
  100. <el-input v-model="maxConsumePrice"></el-input>
  101. </div>
  102. </div>
  103. <div class="StoredPrice">
  104. <div class="StoredPrice-title">总储值金额</div>
  105. <div class="StoredPrice-content">
  106. <el-input v-model="minStoredPricePrice"></el-input>
  107. <div>-</div>
  108. <el-input v-model="maxStoredPricePrice"></el-input>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="slot-footer" slot="footer">
  113. <div class="item-title">共有<i>50</i>位用户</div>
  114. <div>
  115. <button @click="reset">重置</button>
  116. <button @click="save">保存</button>
  117. </div>
  118. </div>
  119. </el-dialog>
  120. </div>
  121. </div>
  122. </template>
  123. <script>
  124. export default {
  125. props: ["visible"],
  126. data() {
  127. return {
  128. customerSource: {
  129. name: "客户来源",
  130. title: [
  131. "线下进店",
  132. "种子用户",
  133. "美团/大众",
  134. "抖音",
  135. "达人探店",
  136. "霸王餐",
  137. "老带新/转介绍",
  138. ],
  139. },
  140. couponSource: {
  141. name: "优惠券快过期付费用户",
  142. title: ["3天", "5天", "7天", "15天"],
  143. },
  144. cardSource: {
  145. name: "次卡快过期付费用户",
  146. title: ["3天", "5天", "7天", "15天", "30天"],
  147. },
  148. latelySource: {
  149. name: "距离最近消费时间",
  150. title: ["3天", "5天", "7天", "15天", "15天以上"],
  151. },
  152. customerSelect: 99,
  153. couponSelect: 99,
  154. cardSelect: 99,
  155. latelySelect: 99,
  156. superpositionNum: 0, //项目叠加次数
  157. transitionNum: 0, //转换次数
  158. minConsumePrice: "", //消费最小金额
  159. maxConsumePrice: "", //消费最大金额
  160. minStoredPricePrice: "", //储值最小金额
  161. maxStoredPricePrice: "", //储值最大金额
  162. conditionList: {
  163. customerKey: "",
  164. couponKey: "",
  165. cardKey: "",
  166. latelyKey: "",
  167. },
  168. };
  169. },
  170. methods: {
  171. // 重置筛选条件
  172. reset() {
  173. // 重置data里的值
  174. Object.assign(this.$data, this.$options.data.call(this))
  175. },
  176. // 保存筛选条件
  177. save() {
  178. let selectList = []
  179. selectList.push(this.conditionList.customerKey)
  180. selectList.push(this.conditionList.couponKey)
  181. selectList.push(this.conditionList.cardKey)
  182. selectList.push(this.conditionList.latelyKey)
  183. console.log(selectList);
  184. this.$emit("update:visible", false);
  185. },
  186. // 关闭弹窗
  187. closeFilterPop() {
  188. this.$emit("update:visible", false);
  189. },
  190. // 选择
  191. customerFilter(item, index) {
  192. this.customerSelect = index;
  193. this.$set(this.conditionList, "customerKey", item);
  194. },
  195. couponFilter(item, index) {
  196. this.couponSelect = index;
  197. this.$set(this.conditionList, "couponKey", item);
  198. },
  199. cardFilter(item, index) {
  200. this.cardSelect = index;
  201. this.$set(this.conditionList, "cardKey", item);
  202. },
  203. latelyFilter(item, index) {
  204. this.latelySelect = index;
  205. this.$set(this.conditionList, "latelyKey", item);
  206. },
  207. },
  208. watch:{
  209. visible(newValue,oldValue){
  210. // 关闭打开弹框重置数据
  211. this.reset()
  212. }
  213. }
  214. };
  215. </script>
  216. <style lang='less' scoped>
  217. // 筛选弹窗
  218. .filterPop {
  219. .slot-title {
  220. display: inline-block;
  221. font-size: 14px;
  222. margin-top: 24px;
  223. font-weight: 600;
  224. i {
  225. font-size: 24px;
  226. color: #666666;
  227. margin-left: 22px;
  228. margin-right: 175px;
  229. }
  230. }
  231. // 筛选条件
  232. .customer-source {
  233. .item-title {
  234. font-size: 14px;
  235. color: #333;
  236. margin-top: 10px;
  237. font-weight: 600;
  238. }
  239. .content {
  240. margin-top: 10px;
  241. display: flex;
  242. width: 442px;
  243. flex-wrap: wrap;
  244. box-sizing: border-box;
  245. }
  246. .content-item {
  247. font-size: 12px;
  248. height: 24px;
  249. padding: 3px 12px;
  250. background-color: #f5f5f5;
  251. line-height: 18px;
  252. border-radius: 2px;
  253. margin-left: 20px;
  254. box-sizing: border-box;
  255. }
  256. .activeFilter {
  257. border: 1px solid #fa7d22;
  258. color: #fa7d22;
  259. }
  260. .content-item:first-child,
  261. .content-item:nth-child(6) {
  262. margin-left: 0;
  263. }
  264. .content-item:nth-child(n + 6) {
  265. margin-top: 10px;
  266. }
  267. .superposition {
  268. display: flex;
  269. .superposition-title {
  270. font-size: 14px;
  271. color: #333;
  272. margin-top: 14px;
  273. font-weight: 600;
  274. margin-right: 20px;
  275. }
  276. /deep/.el-input-number {
  277. margin-top: 10px;
  278. }
  279. /deep/input.el-input__inner,
  280. /deep/span.el-input-number__decrease.is-disabled,
  281. /deep/span.el-input-number__increase,
  282. /deep/span.el-input-number__decrease {
  283. border: none;
  284. }
  285. }
  286. .transition {
  287. display: flex;
  288. .transition-title {
  289. font-size: 14px;
  290. color: #333;
  291. margin-top: 14px;
  292. font-weight: 600;
  293. margin-right: 20px;
  294. }
  295. /deep/.el-input-number {
  296. margin-top: 10px;
  297. }
  298. /deep/input.el-input__inner,
  299. /deep/span.el-input-number__decrease.is-disabled,
  300. /deep/span.el-input-number__increase,
  301. /deep/span.el-input-number__decrease {
  302. border: none;
  303. }
  304. }
  305. .consumePrice {
  306. display: flex;
  307. .consumePrice-title {
  308. font-size: 14px;
  309. color: #333;
  310. margin-top: 14px;
  311. font-weight: 600;
  312. margin-right: 20px;
  313. }
  314. .consumePrice-content {
  315. width: 134px;
  316. height: 24px;
  317. border: 1px solid #f5f5f5;
  318. border-radius: 2px;
  319. margin-top: 10px;
  320. display: flex;
  321. align-items: center;
  322. div {
  323. color: #999999;
  324. }
  325. /deep/input.el-input__inner {
  326. height: 21px;
  327. width: 60px;
  328. border: none;
  329. text-align: center;
  330. font-size: 12px;
  331. padding: 0;
  332. }
  333. }
  334. }
  335. .StoredPrice {
  336. display: flex;
  337. .StoredPrice-title {
  338. font-size: 14px;
  339. color: #333;
  340. margin-top: 14px;
  341. font-weight: 600;
  342. margin-right: 20px;
  343. }
  344. .StoredPrice-content {
  345. width: 134px;
  346. height: 24px;
  347. border: 1px solid #f5f5f5;
  348. border-radius: 2px;
  349. margin-top: 10px;
  350. display: flex;
  351. align-items: center;
  352. div {
  353. color: #999999;
  354. }
  355. /deep/input.el-input__inner {
  356. height: 21px;
  357. width: 60px;
  358. border: none;
  359. text-align: center;
  360. font-size: 12px;
  361. padding: 0;
  362. }
  363. }
  364. }
  365. }
  366. /deep/.el-dialog {
  367. border-radius: 8px;
  368. height: 500px;
  369. margin-left: 300px;
  370. position: relative;
  371. }
  372. /deep/.el-dialog__header {
  373. padding: 0;
  374. padding-bottom: 30px;
  375. }
  376. /deep/button.el-dialog__headerbtn {
  377. display: none;
  378. }
  379. /deep/.el-dialog__body {
  380. overflow: hidden;
  381. height: 350px;
  382. padding-left: 38px;
  383. padding-top: 0;
  384. color: #333;
  385. overflow-y: auto; // 设置滚动条
  386. padding-bottom: 60px;
  387. }
  388. .slot-footer {
  389. padding: 0;
  390. border-radius: 0 0 8px 8px;
  391. border-top: solid 1px #f5f5f5;
  392. position: absolute;
  393. bottom: 0;
  394. width: 100%;
  395. height: 80px;
  396. background-color: #ffffff;
  397. text-align: center;
  398. z-index: 999;
  399. .item-title {
  400. margin-top: 10px;
  401. font-size: 14px;
  402. color: #333;
  403. i {
  404. color: #ff3007;
  405. }
  406. }
  407. button {
  408. margin-top: 10px;
  409. width: 176px;
  410. height: 28px;
  411. border: 1px solid #fa7d22;
  412. border-radius: 14px;
  413. color: #fa7d22;
  414. background-color: #fff;
  415. }
  416. button:last-child {
  417. background-color: #fa7d22;
  418. margin-left: 14px;
  419. color: #fff;
  420. }
  421. }
  422. /deep/.el-dialog__footer {
  423. padding: 0;
  424. }
  425. }
  426. </style>