浏览代码

用户标签;商户

LIDEXI 4 年之前
父节点
当前提交
0488bccb52
共有 5 个文件被更改,包括 452 次插入50 次删除
  1. 50 0
      src/api/guosen/bussiness.js
  2. 1 1
      src/api/loginuser/loginuser.js
  3. 279 0
      src/views/guosen/bussiness.vue
  4. 89 45
      src/views/loginuser/loginuser.vue
  5. 33 4
      src/views/wel/index.vue

+ 50 - 0
src/api/guosen/bussiness.js

@@ -0,0 +1,50 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/cyzh-guosen/bussiness/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/api/cyzh-guosen/bussiness/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/cyzh-guosen/bussiness/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/cyzh-guosen/bussiness/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/cyzh-guosen/bussiness/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 1 - 1
src/api/loginuser/loginuser.js

@@ -12,6 +12,7 @@ export const getList = (current, size, params) => {
   })
 }
 
+
 export const getDetail = (id) => {
   return request({
     url: '/api/cyzh-loginUser/loginuser/detail',
@@ -47,4 +48,3 @@ export const update = (row) => {
     data: row
   })
 }
-

+ 279 - 0
src/views/guosen/bussiness.vue

@@ -0,0 +1,279 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               :page.sync="page"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               v-model="form"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button type="danger"
+                   size="small"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.bussiness_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+      </template>
+      <template slot="maxLimitForm" slot-scope="scope">
+         <avue-input-number v-model="scope.row.maxLimit" precision="2" controls-position></avue-input-number>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/guosen/bussiness";
+  import {mapGetters} from "vuex";
+  import md5 from 'js-md5'
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height:'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          dialogWidth: "30%",
+          column: [
+            {
+              label: "商户号名称",
+              labelWidth: 130,
+              prop: "name",
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入商户号名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "每日提现上限",
+              labelWidth: 130,
+              span: 24,
+              prop: "maxLimit",
+              formslot: true,
+              rules: [{
+                required: true,
+                message: "请输入每日提现上限",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "账号",
+              prop: "userName",
+              labelWidth:130,
+              display: true,
+              span:24,
+              rules: [{
+                required: true,
+                message: "请输入关联账号的名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "密码",
+              prop: "userPassword",
+              labelWidth:130,
+              span:24,
+              display: true,
+              hide: true,
+              rules: [{
+                required: true,
+                message: "请输入关联账号的密码",
+                trigger: "blur"
+              }]
+            },
+
+            {
+              label: "回调地址",
+              prop: "recallUrl",
+              labelWidth:130,
+              span:24,
+              hide: true,
+              rules: [{
+                required: true,
+                message: "请输入关联账号的密码",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "关联账号的id",
+              prop: "accountId",
+              hide: true,
+              display: false,
+              rules: [{
+                required: true,
+                message: "请输入关联账号的id",
+                trigger: "blur"
+              }]
+            },
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.bussiness_add, false),
+          viewBtn: this.vaildData(this.permission.bussiness_view, false),
+          delBtn: this.vaildData(this.permission.bussiness_delete, false),
+          editBtn: this.vaildData(this.permission.bussiness_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+         row.userPassword = md5(row.userPassword)
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        row.userPassword = md5(row.userPassword)
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 89 - 45
src/views/loginuser/loginuser.vue

@@ -1,47 +1,64 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
-               :table-loading="loading"
-               :data="data"
-               :page.sync="page"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               v-model="form"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
+
+    <el-dialog :modal-append-to-body="false" :visible.sync="userLabelVisible" title="用户标签" width="50%">
+      <el-form ref="labelForm" :model="labelForm" label-width="80px">
+
+        <el-form-item label="用户标签">
+          <el-select v-model="labelForm.limitTag" placeholder="请选择用户标签" multiple clearable="true">
+            <el-option v-for="item in labelItems" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="primary" @click="bindTag">打标签</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
+      :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
+      @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.loginuser_delete"
-                   @click="handleDelete">删 除
+        <el-button type="danger" size="small" icon="el-icon-s-check" plain v-if="permission.loginuser_delete" @click="handleDelete">删
+          除
+        </el-button>
+      </template>
+
+      <template slot="menu" slot-scope="scope">
+        <el-button type="text" size="small" icon="el-icon-s-check" plain v-if="permission.loginuser_label" @click="handleLabel(scope.row)">标签
         </el-button>
       </template>
       <template slot-scope="scope" slot="avatar">
 
-           <img style="width: 70px; height: 50px; " :src="scope.row.avatar" :fit="fit" @click="openView(scope.row.avatar)">
-         </template>
+        <img style="width: 70px; height: 50px; " :src="scope.row.avatar" :fit="fit" @click="openView(scope.row.avatar)">
+      </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/loginuser/loginuser";
-  import {mapGetters} from "vuex";
+    import request from '@/router/axios';
+  import {
+    getList,
+    getDetail,
+    add,
+    update,
+    remove
+  } from "@/api/loginuser/loginuser";
+  import {
+    mapGetters
+  } from "vuex";
 
   export default {
     data() {
       return {
+        labelItems: [],
+        labelForm: {
+          limitTag: [],
+        },
+        userLabelVisible: false,
         form: {},
         query: {},
         loading: true,
@@ -52,7 +69,7 @@
         },
         selectionList: [],
         option: {
-          height:'auto',
+          height: 'auto',
           calcHeight: 30,
           tip: false,
           searchShow: true,
@@ -62,8 +79,7 @@
           viewBtn: true,
           selection: true,
           dialogClickModal: false,
-          column: [
-            {
+          column: [{
               label: "用户昵称",
               prop: "nickName",
               width: 150,
@@ -101,8 +117,7 @@
               prop: "gender",
               type: "select",
               width: 80,
-              dicData: [
-                {
+              dicData: [{
                   label: "未知",
                   value: 0
                 },
@@ -121,7 +136,7 @@
                 trigger: "blur"
               }]
             },
-           
+
 
 
             {
@@ -194,9 +209,38 @@
           ids.push(ele.id);
         });
         return ids.join(",");
-      }
+      },
+
     },
     methods: {
+      handleLabel(row) {
+        if(row.limitTag != undefined || row.limitTag == ""){
+          this.labelForm.limitTag = row.limitTag.split(",");
+        }else{
+           this.labelForm.limitTag = []
+        }
+        this.labelForm.id = row.id;
+
+        this.userLabelVisible = true;
+        request({
+          url: '/api/blade-system/dict/dictionary?code=login_user_limit_label',
+          method: "get",
+        }).then(res => {
+          this.labelItems = res.data.data;
+
+        })
+
+      },
+      bindTag(){
+        this.labelForm.limitTag = this.labelForm.limitTag.join(",")
+        request({
+          url: '/api/cyzh-loginUser/loginuser/bindTag',
+          method: "post",
+          data: this.labelForm
+        }).then(res => {
+            this.userLabelVisible = false;
+        })
+      },
       openView(url) {
         var data = [{
           thumbUrl: url,
@@ -232,10 +276,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -253,10 +297,10 @@
           return;
         }
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(this.ids);
           })
@@ -294,10 +338,10 @@
         this.selectionList = [];
         this.$refs.crud.toggleSelection();
       },
-      currentChange(currentPage){
+      currentChange(currentPage) {
         this.page.currentPage = currentPage;
       },
-      sizeChange(pageSize){
+      sizeChange(pageSize) {
         this.page.pageSize = pageSize;
       },
       refreshChange() {

+ 33 - 4
src/views/wel/index.vue

@@ -372,10 +372,39 @@ optionHistoryIn: {
           url: '/api/cyzh-static/staticAccountStatic',
           method: "get",
         }).then(res => {
-          this.option.data[0].count = res.data.data.todayOut;
-          this.option.data[1].count = res.data.data.totalOut;
-          this.option.data[2].count = res.data.data.todayIn;
-          this.option.data[3].count = res.data.data.totalIn;
+          //今日提现
+          let todayOut = res.data.data.todayOut;
+          this.optionTodayOut.series[0].data[0].value = todayOut.userOut;
+          this.optionTodayOut.series[0].data[1].value = todayOut.proxyOut;
+          this.optionTodayOut.series[0].data[2].value = todayOut.adsOut;
+          this.optionTodayOut.series[0].data[3].value = todayOut.operationOut;
+          this.optionTodayOut.series[0].data[4].value = todayOut.sponsorOut;
+          this.option.data[0].count = todayOut.total;
+          //历史提现
+          let historyOut = res.data.data.totalOut;
+          this.optionHistoryOut.series[0].data[0].value = historyOut.userOut;
+          this.optionHistoryOut.series[0].data[1].value = historyOut.proxyOut;
+          this.optionHistoryOut.series[0].data[2].value = historyOut.adsOut;
+          this.optionHistoryOut.series[0].data[3].value = historyOut.operationOut;
+          this.optionHistoryOut.series[0].data[4].value = historyOut.sponsorOut;
+          this.option.data[1].count = historyOut.total;
+
+          //今日收入
+          let todayIn = res.data.data.todayIn;
+          this.optionTodayIn.series[0].data[0].value = todayIn.userIn;
+          this.optionTodayIn.series[0].data[1].value = todayIn.proxyIn;
+          this.optionTodayIn.series[0].data[2].value = todayIn.adsIn;
+
+          this.option.data[2].count = todayIn.total;
+          //历史收入
+          let historyIn = res.data.data.totalIn;
+          this.optionHistoryIn.series[0].data[0].value = historyIn.userIn;
+          this.optionHistoryIn.series[0].data[1].value = historyIn.proxyIn;
+          this.optionHistoryIn.series[0].data[2].value = historyIn.adsIn;
+
+          this.option.data[3].count = historyIn.total;
+
+
           this.drawPie();
         })
       },