com-search.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <style>
  2. .com-search .tabs {
  3. margin-top: 20px;
  4. }
  5. .com-search .label {
  6. margin-right: 10px;
  7. }
  8. .com-search .item-box {
  9. margin-bottom: 10px;
  10. margin-right: 15px;
  11. }
  12. .com-search .clear-where {
  13. color: #419EFB;
  14. cursor: pointer;
  15. }
  16. </style>
  17. <template id="com-search">
  18. <div class="com-search">
  19. <div flex="wrap:wrap cross:center">
  20. <div class="item-box" flex="dir:left cross:center">
  21. <div class="label">短视频ID</div>
  22. <el-input v-model="input" placeholder="请输入内容"></el-input>
  23. </div>
  24. <div class="item-box" flex="dir:left cross:center">
  25. <div class="label">会员ID</div>
  26. <el-input v-model="input" placeholder="请输入内容"></el-input>
  27. </div>
  28. <div class="item-box" flex="dir:left cross:center">
  29. <div class="label">呢称</div>
  30. <el-input v-model="input" placeholder="请输入内容"></el-input>
  31. </div>
  32. <div class="item-box" flex="dir:left cross:center">
  33. <div class="label">标题</div>
  34. <el-input v-model="input" placeholder="请输入内容"></el-input>
  35. </div>
  36. </div>
  37. <div flex="wrap:wrap cross:center">
  38. <div style="height: 32px;">{{dateLabel}}:</div>
  39. <el-date-picker
  40. class="item-box"
  41. size="small"
  42. @change="changeTime"
  43. v-model="search.time"
  44. type="datetimerange"
  45. value-format="yyyy-MM-dd HH:mm:ss"
  46. range-separator="至"
  47. start-placeholder="开始日期"
  48. end-placeholder="结束日期">
  49. </el-date-picker>
  50. <div class="item-box" flex="dir:left cross:center">
  51. <div class="label">关联类型</div>
  52. <el-select style="width: 120px;" size="small" v-model="search.platform" @change='toSearch'>
  53. <el-option key="all" label="全部平台" value=""></el-option>
  54. <el-option key="wxapp" label="微信" value="wxapp"></el-option>
  55. <!-- <el-option key="aliapp" label="支付宝" value="aliapp"></el-option>-->
  56. <!-- <el-option key="ttapp" label="抖音/头条" value="ttapp"></el-option>-->
  57. <!-- <el-option key="bdapp" label="百度" value="bdapp"></el-option>-->
  58. </el-select>
  59. </div>
  60. <div class="item-box" flex="cross:center">
  61. <div v-if="isShowClear" @click="clearWhere" class="div-box clear-where">清空筛选条件</div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. Vue.component('com-search', {
  68. template: '#com-search',
  69. props: {
  70. selectList: {
  71. type: Array,
  72. default: function () {
  73. return [
  74. {value: '1', name: '订单号'},
  75. {value: '9', name: '商户单号'},
  76. {value: '2', name: '用户名'},
  77. {value: '4', name: '用户ID'},
  78. {value: '5', name: '商品名称'},
  79. {value: '3', name: '收件人'},
  80. {value: '6', name: '收件人电话'},
  81. {value: '7', name: '门店名称'}
  82. ]
  83. }
  84. },
  85. activeName: {
  86. type: String,
  87. default: '-1',
  88. },
  89. plugins: {
  90. type: Array,
  91. default: function () {
  92. return [
  93. {
  94. name: '全部订单',
  95. sign: 'all',
  96. }
  97. ];
  98. }
  99. },
  100. isShowOrderType: {
  101. type: Boolean,
  102. default: true
  103. },
  104. isShowOrderPlugin: {
  105. type: Boolean,
  106. default: false
  107. },
  108. newSearch: {
  109. type: Object,
  110. default: function () {
  111. return {
  112. time: null,
  113. keyword: '',
  114. keyword_1: '1',
  115. date_start: '',
  116. date_end: '',
  117. platform: '',
  118. status: '',
  119. plugin: 'all',
  120. send_type: -1,
  121. }
  122. }
  123. },
  124. dateLabel: {
  125. type: String,
  126. default: '时间范围'
  127. }
  128. },
  129. data() {
  130. return {
  131. search: {},
  132. newActiveName: null,
  133. isShowClear: false,
  134. }
  135. },
  136. methods: {
  137. // 日期搜索
  138. changeTime() {
  139. if (this.search.time) {
  140. this.search.date_start = this.search.time[0];
  141. this.search.date_end = this.search.time[1];
  142. } else {
  143. this.search.date_start = null;
  144. this.search.date_end = null;
  145. }
  146. this.toSearch();
  147. },
  148. toSearch() {
  149. this.search.page = 1;
  150. this.$emit('search', this.search);
  151. this.checkSearch();
  152. },
  153. handleClick(res) {
  154. if(this.newActiveName==8){
  155. this.search.status = '1';
  156. this.search.active_status = 1;
  157. this.$set(this.search, `status`, '1')
  158. this.$set(this.search, `active_status`, 1)
  159. }else if(this.newActiveName==1){
  160. this.search.status = '1';
  161. this.search.active_status = 2;
  162. this.$set(this.search, `status`, '1')
  163. this.$set(this.search, `active_status`, 2)
  164. }else{
  165. this.search.status = this.newActiveName;
  166. this.$set(this.search, `status`, this.newActiveName)
  167. this.search.active_status?delete this.search.active_status:'';
  168. }
  169. this.toSearch();
  170. },
  171. clearWhere() {
  172. this.search.keyword = '';
  173. this.search.date_start = null;
  174. this.search.date_end = null;
  175. this.search.time = null;
  176. this.search.platform = '';
  177. this.search.send_type = -1;
  178. this.search.plugin = 'all';
  179. this.toSearch();
  180. },
  181. checkSearch() {
  182. if (this.search.keyword || (this.search.date_start && this.search.date_end)
  183. || this.search.plugin != 'all' || this.search.send_type != -1
  184. || this.search.platform) {
  185. this.isShowClear = true;
  186. } else {
  187. this.isShowClear = false;
  188. }
  189. }
  190. },
  191. created() {
  192. this.search = this.newSearch;
  193. this.newActiveName = this.activeName;
  194. this.checkSearch();
  195. }
  196. })
  197. </script>