index.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <style>
  2. .table-body {
  3. padding: 20px 20px;
  4. background-color: #fff;
  5. }
  6. .table-body .top-input {
  7. margin-top: 34px;
  8. }
  9. .input-item {
  10. width: 200px;
  11. margin-right: 20px;
  12. }
  13. .input-item .el-input__inner {
  14. border-right: 0;
  15. }
  16. .input-item .el-input__inner:hover {
  17. border: 1px solid #dcdfe6;
  18. border-right: 0;
  19. outline: 0;
  20. }
  21. .input-item .el-input__inner:focus {
  22. border: 1px solid #dcdfe6;
  23. border-right: 0;
  24. outline: 0;
  25. }
  26. .input-item .el-input-group__append {
  27. background-color: #fff;
  28. border-left: 0;
  29. width: 10%;
  30. padding: 0;
  31. }
  32. .input-item .el-input-group__append .el-button {
  33. padding: 0;
  34. }
  35. .input-item .el-input-group__append .el-button {
  36. margin: 0;
  37. }
  38. /* #app .table-body .el-table .el-button {
  39. border-radius: 16px;
  40. } */
  41. .create {
  42. height: 36px;
  43. line-height: 36px;
  44. float: right;
  45. color: #BCBCBC;
  46. margin-left: 20px;
  47. }
  48. .name {
  49. cursor: pointer;
  50. color: #49A9FF;
  51. }
  52. .el-input-group__append {
  53. /* background-color: #fff; */
  54. }
  55. /* 卡片 */
  56. .plugin-list {
  57. margin: 0 0 0 -20px;
  58. /* padding-right: 100px; */
  59. display: flex;
  60. flex-wrap: wrap;
  61. }
  62. .plugin-list .plugin-item {
  63. width: 20%;
  64. min-width: 400px;
  65. }
  66. .plugin-item {
  67. border: 1px solid #ebebeb;
  68. background: #FFFFFF;
  69. box-shadow: 3px 5px 15px rgba(80, 80, 80, 0.16);
  70. opacity: 1;
  71. border-radius: 5px;
  72. padding: 20px;
  73. margin: 0 0 20px 20px;
  74. transition: 250ms;
  75. position: relative;
  76. /* min-width: 300px; */
  77. }
  78. .plugin-item .item-status {
  79. position: absolute;
  80. top: 0;
  81. right: 0;
  82. width: 94px;
  83. height: 30px;
  84. background: #E8EAEC;
  85. opacity: 1;
  86. border-radius: 0px 5px 0px 5px;
  87. font-size: 14px;
  88. font-family: Microsoft YaHei;
  89. font-weight: 400;
  90. line-height: 30px;
  91. color: #9398A4;
  92. text-align: center;
  93. }
  94. .item-status-permanent {
  95. width: 94px;
  96. }
  97. .item-status-effective {
  98. width: 164px;
  99. }
  100. .plugin-item .item-info {
  101. display: flex;
  102. align-items: center;
  103. }
  104. /* .plugin-item .item-info .item-right{
  105. min-width: 500px;
  106. } */
  107. .plugin-item .item-btns {
  108. display: flex;
  109. align-items: center;
  110. justify-content: flex-end;
  111. margin-top: 12px;
  112. }
  113. .plugin-item .mall-logo {
  114. width: 70px;
  115. height: 70px;
  116. margin-right: 12px;
  117. }
  118. .plugin-item .mall-logo img {
  119. width: 100%;
  120. height: 100%;
  121. display: block;
  122. border-radius: 50%;
  123. }
  124. .plugin-item .display-name {
  125. font-size: 18pt;
  126. margin-top: 10px;
  127. margin-bottom: 4px;
  128. font-family: Microsoft YaHei;
  129. font-weight: bold;
  130. line-height: 30px;
  131. color: #3F495D;
  132. opacity: 1;
  133. width: 200px;
  134. white-space: nowrap;
  135. overflow: hidden;
  136. text-overflow: ellipsis;
  137. }
  138. .plugin-item .name {
  139. color: #909399;
  140. }
  141. .plugin-item:hover {
  142. cursor: pointer;
  143. border-color: #bfddff;
  144. }
  145. /* .plugin-item:hover .display-name {
  146. color: #409EFF;
  147. } */
  148. .plugin-item .plugin-option-btn {
  149. height: 25px;
  150. width: 25px;
  151. font-size: 12px;
  152. padding: 0;
  153. }
  154. .plugin-item .detail-option.detail-option {
  155. color: #909399;
  156. background: #F2F6FC;
  157. }
  158. .plugin-item .detail-option:hover {
  159. color: #fff;
  160. background: #909399;
  161. }
  162. .label{
  163. padding-right: 10px;
  164. }
  165. .el-collapse-item__header{
  166. color: #0A54EA;
  167. }
  168. .el-collapse-item__arrow{
  169. margin: 0;
  170. }
  171. .label_conf{
  172. line-height: 35px;
  173. margin-left: 10px;
  174. }
  175. .line_msg{
  176. width: 100%;
  177. height: 1px;
  178. background-color: #d9d6d6;
  179. margin-bottom: 20px;
  180. }
  181. .type_conf{
  182. font-weight: 600;
  183. margin-bottom: 20px;
  184. }
  185. .msg_title{
  186. padding-left: 5%;
  187. width: 12%;
  188. float: left;
  189. text-align: right;
  190. line-height: 35px;
  191. }
  192. .conf_content{
  193. width: 60%;
  194. float: left;
  195. }
  196. </style>
  197. <div id="app" v-cloak>
  198. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  199. <div slot="header">
  200. <div>
  201. <span>标签列表</span>
  202. <div style="float: right; margin: -5px 0">
  203. <el-button type="primary" size="small" @click="handleEdit('')">新增</el-button>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="table-body el-input--small">
  208. <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  209. <div class="item-box" flex="dir:left cross:center">
  210. <div class="label">创建时间 </div>
  211. <el-date-picker
  212. v-model="time"
  213. type="datetimerange"
  214. value-format="yyyy-MM-dd HH:mm:ss"
  215. range-separator="至"
  216. start-placeholder="开始日期"
  217. end-placeholder="结束日期">
  218. </el-date-picker>
  219. </div>
  220. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  221. <div class="label">类型</div>
  222. <el-select size="small" v-model="search.type" class="select">
  223. <el-option key="1" label="手动标签" value="1"></el-option>
  224. <el-option key="2" label="自动标签" value="2"></el-option>
  225. </el-select>
  226. </div>
  227. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  228. <div class="label">名称 </div>
  229. <el-input style="width: 120px" v-model="search.name" placeholder="名称"></el-input>
  230. </div>
  231. <div class="item-box" flex="dir:left cross:center">
  232. <el-button type="primary" style="padding: 8px 20px !important;" @click="searchs">搜索
  233. </el-button>
  234. </div>
  235. </el-form>
  236. <template>
  237. <div>
  238. <el-table :data="list" style="width: 100%;margin-bottom: 20px;" row-key="id" stripe>
  239. <el-table-column prop="name" label="序号">
  240. <template slot-scope="scope">
  241. <span style="margin-left: 10px">{{ scope.row.id }}</span>
  242. </template>
  243. </el-table-column>
  244. <el-table-column prop="name" label="名称">
  245. <template slot-scope="scope">
  246. <span style="margin-left: 10px">{{ scope.row.name }}</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column prop="type" label="会员数量" >
  250. <template slot-scope="scope">
  251. <span style="margin-left: 10px; cursor: pointer;" @click="seeuserdata(scope.row.id)">{{ scope.row.user_num }}</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column prop="type" label="标签类型">
  255. <template slot-scope="scope">
  256. <span style="margin-left: 10px" v-if="scope.row.type == 1">手动标签</span>
  257. <span style="margin-left: 10px" v-if="scope.row.type == 2">自动标签</span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column prop="type" label="满足类型">
  261. <template slot-scope="scope">
  262. <div v-if="scope.row.type == 2 ">
  263. <span style="margin-left: 10px" v-if="scope.row.satisfy_type == 1">满足其一</span>
  264. <span style="margin-left: 10px" v-if="scope.row.satisfy_type == 2">满足所有</span>
  265. </div>
  266. <div v-else>
  267. --
  268. </div>
  269. </template>
  270. </el-table-column>
  271. <el-table-column prop="created_at" label="达标条件" :width="500">
  272. <template slot-scope="scope" >
  273. <div v-if="scope.row.type == 2 && scope.row.cond_data.length>0 && index < 2" v-for="(item,index) in scope.row.cond_data">{{item}}</div>
  274. <div @click="moremsg(scope.row.cond_data,scope.row.satisfy_type)" style="color: #0A54EA; cursor: pointer;" v-if="scope.row.type == 2 && scope.row.cond_data.length > 2" > 查看更多 </div>
  275. <div v-if="scope.row.type == 1 || scope.row.type == 2 && scope.row.cond_data.length == 0">--</div>
  276. </template>
  277. </el-table-column>
  278. <el-table-column prop="content" label="标签颜色" align="center">
  279. <template slot-scope="scope">
  280. <el-color-picker v-model="scope.row.color" disabled></el-color-picker>
  281. </template>
  282. </el-table-column>
  283. <el-table-column prop="created_at" label="时间">
  284. <template slot-scope="scope">
  285. <span style="margin-left: 10px">{{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}</span>
  286. </template>
  287. </el-table-column>
  288. <el-table-column label="操作">
  289. <template slot-scope="scope">
  290. <el-button type="text" size="mini" circle style="margin-left: 10px;margin-top: 10px" @click="handleEdit(scope.row.id)">
  291. 编辑
  292. </el-button>
  293. <el-button style="margin-left: 10px;margin-top: 10px" type="text" class="set-el-button" size="mini" circle @click="handleDelete(scope.$index, scope.row)">
  294. 删除
  295. </el-button>
  296. </template>
  297. </el-table-column>
  298. </el-table>
  299. </div>
  300. </template>
  301. <div style="text-align: right;margin: 20px 0;">
  302. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  303. style="display: inline-block;float: right;" background @current-change="pageChange"
  304. layout="prev, pager, next" :total="pagination.total_count">
  305. </el-pagination>
  306. </div>
  307. </div>
  308. </el-card>
  309. <!-- 弹框添加分类开始-->
  310. <el-dialog :close-on-click-modal="false" title="达标详情" width="50%" :visible.sync="dialogAddgsVisible"
  311. @close="dialogAddgsVisible = false" :modal-append-to-body="false">
  312. <div class="line_msg"></div>
  313. <div class="type_conf" v-if="type_conf == 1">满足其中任意一个条件</div>
  314. <div class="type_conf" v-else>满足以下所有条件</div>
  315. <div class="msg_content">
  316. <div class="msg_title">交易条件:</div>
  317. <div class="conf_content">
  318. <div class="label_conf" v-for="(item,index) in moremsgdata"> {{item}}</div>
  319. </div>
  320. </div>
  321. <div style="width: 100%;clear: both;height: 2px;"></div>
  322. <span slot="footer" class="dialog-footer">
  323. <el-button @click="dialogAddgsVisible = false">取 消</el-button>
  324. </span>
  325. </el-dialog>
  326. <!-- 弹框添加分类结束-->
  327. </div>
  328. <script>
  329. new Vue({
  330. el: '#app',
  331. data() {
  332. return {
  333. type_conf:'',
  334. moremsgdata:[],
  335. dialogAddgsVisible:false,
  336. activeName: "1",
  337. list: [],
  338. pagination:null,
  339. page: 1,
  340. pageCount: 0,
  341. time:[],
  342. search: {
  343. name: '',
  344. date_start: null,
  345. date_end: null,
  346. type:'',
  347. },
  348. }
  349. },
  350. created() {
  351. this.getList({});
  352. },
  353. methods: {
  354. searchs() {
  355. this.page = 1;
  356. this.getList();
  357. },
  358. moremsg(data,type_conf){
  359. this.type_conf = type_conf;
  360. this.dialogAddgsVisible = true;
  361. this.moremsgdata = data;
  362. },
  363. pageChange(currentPage) {
  364. let self = this;
  365. self.page = currentPage;
  366. self.getList();
  367. },
  368. getList() {
  369. let self = this;
  370. self.listLoading = true;
  371. // 检查是否选择了搜索时间
  372. if (!self.time) {
  373. self.search.date_start = '';
  374. self.search.date_end = '';
  375. } else {
  376. self.search.date_start = self.time[0];
  377. self.search.date_end = self.time[1];
  378. }
  379. request({
  380. method: 'post',
  381. params: {
  382. r: 'mall/user-label/index',
  383. },
  384. data: {
  385. page: self.page,
  386. name: self.search.name,
  387. date_start: self.search.date_start,
  388. date_end: self.search.date_end,
  389. type: self.search.type,
  390. },
  391. }).then(e => {
  392. self.listLoading = false;
  393. self.list = e.data.data.list; self.list
  394. this.pagination = e.data.data.pagination;
  395. this.pagination.pageSize = e.data.data.page_size;
  396. this.pagination.total_count = e.data.data.count;
  397. }).catch(e => {
  398. console.log(e);
  399. });
  400. },
  401. handleEdit(id) {
  402. navigateTo({
  403. r: 'mall/user-label/edit',
  404. id: id,
  405. });
  406. },
  407. seeuserdata(label_id){
  408. navigateTo({
  409. r: 'mall/user/index',
  410. label_id: label_id,
  411. });
  412. },
  413. handleDelete(index, row) {
  414. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {
  415. this.$request({
  416. params: {
  417. r: 'mall/user-label/del',
  418. id: row.id,
  419. status: -1,
  420. },
  421. }).then(e => {
  422. if (e.data.code == 0) {
  423. this.$message({
  424. message: e.data.msg,
  425. type: 'success'
  426. });
  427. navigateTo({
  428. r: 'mall/user-label/index'
  429. });
  430. }
  431. }).catch(e => {});
  432. });
  433. },
  434. },
  435. });
  436. </script>