Tang 2 years ago
parent
commit
0a4019f1ce

+ 1 - 0
package.json

@@ -66,6 +66,7 @@
     "vue-cropper": "0.5.5",
     "vue-draggable-resizable": "^2.3.0",
     "vue-meta": "^2.4.0",
+    "vue-qr": "^4.0.9",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",
     "vuex": "3.6.0"

+ 33 - 0
src/api/salesman/act.js

@@ -0,0 +1,33 @@
+import request from '@/utils/request'
+//登录短信
+export function getActList(query) {
+  return request({
+    url: "/distribution/activity/list",
+    method: "get",
+    params: query
+  });
+}
+// 下载海报
+export function makePoster(query) {
+  return request({
+    url: "/distribution/poster/makePoster",
+    method: "get",
+    params: query
+  });
+}
+// 活动详情
+export function getActDetail(id) {
+  return request({
+    url: "/distribution/activity/" + id,
+    method: "get",
+  });
+}
+
+// 获得链条吗
+export function getLinkCode(query) {
+  return request({
+    url: "/distribution/poster/linkCode",
+    method: "get",
+    params: query
+  });
+}

+ 16 - 0
src/api/salesman/commission.js

@@ -0,0 +1,16 @@
+import request from "@/utils/request";
+//登录短信
+export function getCashList() {
+  return request({
+    url: "/distribution/cash/log/fromOrderCashList",
+    method: "get",
+  });
+}
+
+export function cancelApply(data) {
+  return request({
+    url: "/distribution/withdrawal/cancelApply",
+    method: "post",
+    data,
+  });
+}

+ 84 - 0
src/api/salesman/user.js

@@ -0,0 +1,84 @@
+import request from "@/utils/request";
+//修改信息
+export function sellerEdit(data) {
+  return request({
+    url: "/distribution/seller/edit",
+    method: "post",
+    data,
+  });
+}
+export function getInfoByShareCode(data) {
+  return request({
+    url: "/app/common/distribution/getInfoByShareCode",
+    method: "get",
+    data: data,
+    noToken: true,
+  });
+}
+
+// 查询用户是否绑定公众号
+export function checkBindGzh(query) {
+  return request({
+    url: "/distribution/seller/checkBindGzh",
+    method: "get",
+    params: query,
+  });
+}
+
+// 获取appid
+export function getWxConfig(data) {
+  return request({
+    url: "/app/common/wx/config",
+    method: "get",
+    data: data,
+    noToken: true,
+  });
+}
+
+//绑定公众号
+export function OfficialLogin(data) {
+  return request({
+    url: "/distribution/seller/gzh_bind",
+    method: "post",
+    data: data,
+  });
+}
+
+// 提现
+export function withdrawal(data) {
+  return request({
+    url: "/distribution/withdrawal",
+    method: "post",
+    data: data,
+  });
+}
+
+// 提现记录
+export function getWithdrawalList(query) {
+  return request({
+    url: "/distribution/withdrawal/list",
+    method: "get",
+    params: query,
+  });
+}
+
+//登录业务员用户信息
+export function getSellerInfo(data) {
+  return request({
+    url: "/distribution/seller/getInfo",
+    method: "get",
+    data: data,
+  });
+}
+
+// 获取分享页面参数
+export function getSharePoster(query) {
+  return request({
+    url: "/app/common/distribution/sharePoster",
+    method: "get",
+    params: query,
+    headers: {
+      isToken: false,
+    },
+  });
+}

BIN
src/assets/images/defhead.png


+ 4 - 6
src/components/tableList.vue

@@ -178,8 +178,7 @@
           </div>
           <template
             v-else-if="
-              item.scope === 'copyTime' &&
-              scope.row[item.prop] != null
+              item.scope === 'copyTime' && scope.row[item.prop] != null
             "
           >
             <div v-for="(item, index) in scope.row['copyTime']" :key="index">
@@ -1752,7 +1751,7 @@
       </div>
       <div style="max-height: 600px; overflow: auto">
         <el-tree
-        v-if="diaviosOpen"
+          v-if="diaviosOpen"
           default-expand-all
           :key="Math.random()"
           :props="props1"
@@ -1857,7 +1856,7 @@
       </div>
       <div style="max-height: 600px; overflow: auto">
         <el-tree
-        v-if="diaviosTKOpen"
+          v-if="diaviosTKOpen"
           default-expand-all
           :key="Math.random()"
           :props="props2"
@@ -2442,7 +2441,7 @@ export default {
       }
     },
     diavios(ids) {
-      console.log(ids,"触发")
+      console.log(ids, "触发");
       this.$api.obtainCourseSgoodsId(ids).then((res) => {
         res.rows.forEach((item) => {
           item.TypeId = "0-" + item.courseId;
@@ -3091,4 +3090,3 @@ export default {
   overflow-y: auto;
 }
 </style>
-

+ 2 - 2
src/utils/request.js

@@ -7,8 +7,8 @@ import methods from '@/utils/methodsTool';
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
-export const baseURL = process.env.VUE_APP_BASE_API
-// export const baseURL = 'http://192.168.1.7:5030/'
+// export const baseURL = process.env.VUE_APP_BASE_API
+export const baseURL = 'http://192.168.1.7:5030/'
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分

+ 36 - 5
src/views/Marketing/activitySystem/activityList/activityInfo/first.vue

@@ -27,16 +27,23 @@
           >
           </el-date-picker>
         </el-form-item>
-        </el-col
-      >
+      </el-col>
       <el-col :span="6" :offset="4" v-show="ruleForm.posterId">
         <div style="text-align: center">
           <el-image
+            v-if="!isSales"
             style="width: 187.5px; height: 333.5px"
             :src="ModelUrl(ruleForm.posterId)"
             :preview-src-list="[ModelUrl(ruleForm.posterId)]"
           >
           </el-image>
+          <!-- 业务员 -->
+          <preview-bill
+            v-else
+            :posterUrl="ModelUrl(ruleForm.posterId)"
+            :scale="0.5"
+            :modelData="modelData"
+          ></preview-bill>
           <h2>模板预览</h2>
         </div>
       </el-col>
@@ -45,6 +52,9 @@
 </template>
 
 <script>
+import previewBill from "@/views/salesman/act/previewBill.vue";
+import { getSharePoster } from "@/api/salesman/user";
+import { getLinkCode } from "@/api/salesman/act";
 export default {
   props: {
     ruleForm: {
@@ -88,10 +98,12 @@ export default {
           },
         ],
       },
+      modelData: {},
     };
   },
   created() {
     this.getModelList();
+    this.isSales && this.getSharePoster();
   },
   computed: {
     ModelUrl: function () {
@@ -99,9 +111,7 @@ export default {
         if (k) {
           for (let i = 0; i < this.modelList.length; i++) {
             if (this.modelList[i].posterId === k) {
-              return this.$methodsTools.splitImgHost(
-                this.modelList[i].url
-              );
+              return this.$methodsTools.splitImgHost(this.modelList[i].url);
             }
           }
         } else {
@@ -109,6 +119,9 @@ export default {
         }
       };
     },
+    isSales() {
+      return this.$route.query.isSales;
+    },
   },
   methods: {
     //获取模板列表
@@ -117,6 +130,24 @@ export default {
         this.modelList = res.rows;
       });
     },
+    getSharePoster() {
+      let distributionId = this.$route.query.id;
+      getLinkCode({ distributionId }).then((res) => {
+        getSharePoster({
+          distributionId,
+          shareCode: res.data.shareCode,
+          linkCode: res.data.linkCode,
+        }).then(({ data: { posterConfig, urlCard, urlActivity } }) => {
+          this.modelData = JSON.parse(posterConfig);
+          this.modelData.distribution.name = urlCard;
+          this.modelData.cardCode.name = urlActivity;
+          this.isShow = true;
+        });
+      });
+    },
+  },
+  components: {
+    previewBill,
   },
 };
 </script>

+ 6 - 0
src/views/Marketing/activitySystem/activityList/activityInfo/index.vue

@@ -68,9 +68,15 @@ export default {
   methods: {
     close() {
       this.$store.dispatch("tagsView/exitView", this.$route).then((res) => {
+        if( this.$route.query.isSales){
+        this.$router.push({
+          name: "ActList",
+        });
+        }else{
         this.$router.push({
           path: "activityList",
         });
+        }
       });
     },
     getInit() {

+ 316 - 0
src/views/salesman/act/index.vue

@@ -0,0 +1,316 @@
+<template>
+  <div id="registeredUser">
+    <search-box-new
+      ref="searchBox"
+      :formData="formData"
+      :formList="formList"
+      @search="search"
+      @init="init"
+    />
+    <table-list
+      :tableSets="tableSet"
+      :tableData="tableData"
+      :navText="navText"
+      :loading="loading"
+      @openDialog="openDialog"
+    >
+      <template slot="btn" slot-scope="props">
+        <el-button type="text" @click="editClick(props.scope.row)"
+          >详情</el-button
+        >
+      </template>
+    </table-list>
+    <pagination
+      :total="total"
+      :pageSize="formData.pageSize"
+      :currentPage="formData.pageNum"
+      @handleSizeChange="handleSizeChange"
+      @handleCurrentChange="handleCurrentChange"
+    />
+    <BaseDialog
+      width="500px"
+      :isShow.sync="isShow"
+      title="海报"
+      :isShowFooter="false"
+    >
+      <preview-bill
+        :posterUrl="modelData.bgUrl"
+        :modelData="modelData"
+      ></preview-bill>
+    </BaseDialog>
+  </div>
+</template>
+
+<script>
+import searchBoxNew from "@/components/searchBoxNew";
+import tableList from "@/components/tableList";
+import pagination from "@/components/pagination";
+import previewBill from "./previewBill.vue";
+import { getActList } from "@/api/salesman/act";
+import { getSharePoster } from "@/api/salesman/user";
+import { getLinkCode } from "@/api/salesman/act";
+export default {
+  name: "RegisteredUser",
+  components: { searchBoxNew, tableList, pagination, previewBill },
+  data() {
+    return {
+      loading: false, //当前表单加载是否加载动画
+      navText: {
+        title: "活动列表",
+        index: 0,
+        ch: "条",
+        num: false,
+        choice: false,
+        addHide: true,
+        backFatherBtn: {
+          status: false,
+          title: "未定义",
+        },
+      },
+      //搜索
+      formList: [
+        {
+          prop: "name",
+          placeholder: "请输入活动名称",
+        },
+      ],
+      formData: {
+        name: "",
+        pageSize: 10,
+        pageNum: 1,
+      },
+      // 表单
+      tableSet: [
+        {
+          label: "活动名称",
+          prop: "name",
+          hidden: true,
+        },
+        // {
+        //   label: "活动类型",
+        //   prop: "nickname",
+        //   hidden: true,
+        // },
+        {
+          label: "模板",
+          prop: "posterTempName",
+          hidden: true,
+        },
+        {
+          label: "活动开始时间",
+          prop: "startTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "活动结束时间",
+          prop: "endTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "创建人",
+          prop: "createBy",
+          hidden: true,
+        },
+        {
+          label: "创建时间",
+          prop: "startTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "状态",
+          prop: "status",
+          hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "启用",
+              value: 1,
+            },
+            {
+              label: "禁用",
+              value: 0,
+            },
+          ],
+        },
+        {
+          label: "海报",
+          name: "预览",
+          prop: "posterUrl",
+          hidden: true,
+          scope: "openDialog",
+        },
+        {
+          label: "备注",
+          prop: "remark",
+          hidden: true,
+        },
+      ],
+      tableData: [], //表单数据
+      total: 0, //一共多少条
+      pageSize: 10, //每页多少条数据
+      currentPage: 1, //当前页码
+      modelData: {},
+      isShow: false,
+    };
+  },
+  mounted() {
+    this.search();
+  },
+  methods: {
+    search(int) {
+      this.loading = true;
+      if (int === 1) {
+        this.formData.pageNum = 1;
+      }
+      if (int === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          name: "",
+        };
+      }
+      getActList(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    init() {
+      this.search(2);
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.search();
+    },
+    editClick(e, status) {
+      this.$router.push({
+        name: "ActDetail",
+        query: {
+          id: e.distributionId,
+          status: status ? "edit" : "info",
+          isSales: true,
+        },
+      });
+    },
+    openDialog({ distributionId, posterUrl }) {
+      getLinkCode({ distributionId }).then((res) => {
+        getSharePoster({
+          distributionId,
+          shareCode: res.data.shareCode,
+          linkCode: res.data.linkCode,
+        }).then(({ data: { posterConfig, urlCard, urlActivity } }) => {
+          this.modelData = JSON.parse(posterConfig);
+          this.modelData.distribution.name = urlCard;
+          this.modelData.cardCode.name = urlActivity;
+          this.modelData.bgUrl = posterUrl;
+          this.isShow = true;
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.el-button {
+  border-radius: 8px;
+}
+/deep/.el-dialog {
+  border-radius: 8px;
+  .el-dialog__header {
+    padding: 0;
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .el-dialog__footer {
+    padding: 0;
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+  p {
+    margin: 5px 0px;
+  }
+}
+</style>

+ 85 - 0
src/views/salesman/act/previewBill.vue

@@ -0,0 +1,85 @@
+<template>
+  <div class="posterUrl_style" :style="backStyle()">
+    <img :src="$methodsTools.splitImgHost(posterUrl)" alt="" />
+    <div
+      class="code_style"
+      v-if="modelData.distribution && modelData.distribution.checked"
+      :style="backPosition(modelData.distribution)"
+    >
+      <vue-qr
+        :text="modelData.distribution.name"
+        :size="modelData.distribution.height * 2"
+      ></vue-qr>
+    </div>
+
+    <div
+      class="code_style"
+      v-if="modelData.cardCode && modelData.cardCode.checked"
+      :style="backPosition(modelData.cardCode)"
+    >
+      <vue-qr
+        :text="modelData.cardCode.name"
+        :size="modelData.cardCode.height * 2"
+      ></vue-qr>
+    </div>
+  </div>
+</template>
+
+<script>
+import vueQr from "vue-qr";
+export default {
+  props: {
+    posterUrl: {
+      type: String,
+    },
+    modelData: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    scale: {
+      type: Number,
+      default: 1,
+    },
+  },
+  data() {
+    return {};
+  },
+  methods: {
+    backPosition(data) {
+      return {
+        top: data.top * this.scale + "px",
+        left: data.left * this.scale + "px",
+        width: data.width * this.scale + "px",
+        height: data.height * this.scale + "px",
+      };
+    },
+    backStyle() {
+      return {
+        width: 375 * this.scale + "px",
+        height: 667 * this.scale + "px",
+      };
+    },
+  },
+  components: {
+    vueQr,
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+img {
+  width: 100%;
+  height: 100%;
+}
+.posterUrl_style {
+  margin: 0 auto;
+  width: 375px;
+  height: 667px;
+  position: relative;
+  & > .code_style {
+    position: absolute;
+  }
+}
+</style>

+ 303 - 0
src/views/salesman/commission/index.vue

@@ -0,0 +1,303 @@
+<template>
+  <div id="registeredUser">
+    <!-- <search-box-new
+      ref="searchBox"
+      :formData="formData"
+      :formList="formList"
+      @search="search"
+      @init="init"
+    /> -->
+    <div class="withd-box">
+      <div>
+        总佣金:{{
+          (userInfo.cash + userInfo.usedCash + userInfo.freezeCash).toFixed(2)
+        }}元
+      </div>
+      <div>可提现:{{ userInfo.cash }}元</div>
+      <div>已提现:{{ userInfo.usedCash }}元</div>
+    </div>
+    <table-list
+      :tableSets="tableSet"
+      :tableData="tableData"
+      :navText="navText"
+      :loading="loading"
+    >
+      <template slot="customize">
+        <el-button size="medium" @click="dialogVisible = true" type="primary"
+          >申请提现</el-button
+        >
+        <el-button size="medium" @click="toRecord" type="primary"
+          >提现记录</el-button
+        >
+      </template>
+      <template slot="btn" slot-scope="props">
+        <el-button type="text">详情</el-button>
+      </template>
+    </table-list>
+    <pagination
+      :total="total"
+      :pageSize="formData.pageSize"
+      :currentPage="formData.pageNum"
+      @handleSizeChange="handleSizeChange"
+      @handleCurrentChange="handleCurrentChange"
+    />
+    <withd-dialog
+      :dialogVisible.sync="dialogVisible"
+      @getSellerInfo="getSellerInfo"
+      :cash="userInfo.cash || 0"
+    ></withd-dialog>
+  </div>
+</template>
+
+<script>
+import searchBoxNew from "@/components/searchBoxNew";
+import tableList from "@/components/tableList";
+import pagination from "@/components/pagination";
+import withdDialog from "./withdDialog.vue";
+import { getCashList } from "@/api/salesman/commission";
+import { getSellerInfo } from "@/api/salesman/user";
+export default {
+  name: "RegisteredUser",
+  components: { searchBoxNew, tableList, pagination, withdDialog },
+  data() {
+    return {
+      loading: false, //当前表单加载是否加载动画
+      navText: {
+        title: "活动列表",
+        index: 0,
+        ch: "条",
+        num: false,
+        choice: false,
+        addHide: true,
+        backFatherBtn: {
+          status: false,
+          title: "未定义",
+        },
+      },
+      //搜索
+      formList: [
+        {
+          prop: "nickname",
+          placeholder: "请输入活动名称",
+        },
+      ],
+      formData: {
+        status: "0,1",
+        pageSize: 10,
+        pageNum: 1,
+      },
+      // 表单
+      tableSet: [
+        {
+          label: "佣金ID",
+          prop: "studentCode",
+          hidden: true,
+        },
+        {
+          label: "所属订单",
+          prop: "relatedSn",
+          hidden: true,
+        },
+        {
+          label: "所属活动",
+          prop: "sex",
+          hidden: true,
+          scope: "sex",
+        },
+        {
+          label: "下单人",
+          prop: "nickname",
+          hidden: true,
+        },
+        {
+          label: "订单时间",
+          prop: "payWay",
+          hidden: true,
+        },
+        {
+          label: "订单金额",
+          prop: "payWay",
+          hidden: true,
+        },
+        {
+          label: "佣金分成方式",
+          prop: "profitType",
+          hidden: true,
+        },
+        {
+          label: "佣金等级",
+          prop: "payWay",
+          hidden: true,
+        },
+        {
+          label: "佣金金额",
+          prop: "payWay",
+          hidden: true,
+        },
+        {
+          label: "佣金结算时间",
+          prop: "freezingPeriod",
+          hidden: true,
+        },
+      ],
+      tableData: [], //表单数据
+      total: 0, //一共多少条
+      pageSize: 10, //每页多少条数据
+      currentPage: 1, //当前页码
+      dialogVisible: false,
+      userInfo: {},
+    };
+  },
+  mounted() {
+    this.search();
+    this.getSellerInfo();
+  },
+  methods: {
+    search(int) {
+      this.loading = true;
+      if (int === 1) {
+        this.formData.pageNum = 1;
+      }
+      if (int === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+        };
+      }
+      getCashList(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    init() {
+      this.search(2);
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.search();
+    },
+    toRecord() {
+      this.$router.push({
+        path: "record",
+      });
+    },
+    getSellerInfo() {
+      getSellerInfo().then((res) => {
+        this.userInfo = res.data;
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.el-button {
+  border-radius: 8px;
+}
+/deep/.el-dialog {
+  border-radius: 8px;
+  .el-dialog__header {
+    padding: 0;
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .el-dialog__footer {
+    padding: 0;
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+  p {
+    margin: 5px 0px;
+  }
+}
+.withd-box{
+  display: flex;
+  position: absolute;
+  top: 122px;
+  left: 200px;
+  z-index: 10;
+  div{
+    margin-right: 20px;
+  }
+}
+</style>

+ 190 - 0
src/views/salesman/commission/withdDialog.vue

@@ -0,0 +1,190 @@
+<template>
+  <Base-dialog
+    title="申请提现"
+    :disabledBtn="disabledBtn"
+    :isShow.sync="isShow"
+    @submit="submitForm"
+    @close="close"
+  >
+    <el-form :inline="true" :model="form" :rules="rules" ref="form">
+      <el-form-item label="提现金额:" prop="cash">
+        <el-input
+          @input="formatNum(form.cash, 'cash')"
+          v-model.Number="form.cash"
+          placeholder="请输入提现金额"
+        >
+        </el-input>
+      </el-form-item>
+    </el-form>
+    <div class="step-box">
+      <el-steps :active="active" align-center>
+        <el-step title="微信账号授权"></el-step>
+        <el-step title="提现申请"></el-step>
+        <el-step title="提现审核"></el-step>
+        <el-step title="提现申请成功"></el-step>
+      </el-steps>
+      <div class="step-code-box" v-if="active == 1">
+        <vue-qr text="modelData.cardCode.name" :size="200"></vue-qr>
+      </div>
+    </div>
+
+    <div class="withd-tips">
+      提现注意事项:
+      <p>1.当佣金被结算时有一定的冻结期,被解冻的佣金方可提现</p>
+      <p>2.微信打款当日单笔金额最多500元,当日最多20000元</p>
+      <p>3.通常在1-3个工作日内可到账</p>
+    </div>
+  </Base-dialog>
+</template>
+
+<script>
+import vueQr from "vue-qr";
+import { checkBindGzh, withdrawal } from "@/api/salesman/user";
+export default {
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    disabledBtn: {
+      type: Boolean,
+      default: false,
+    },
+    cash: {
+      type: Number,
+      default: 0,
+    },
+  },
+  data() {
+    return {
+      msgTitle: [
+        { label: "学习拍照异常", value: 1 },
+        {
+          label: "学习拍照太黑无法识别人像,请确保拍照光线充足并拍到全脸",
+          value: 2,
+        },
+        {
+          label: "学习拍照太模糊无法识别人像,请确保拍照光线充足并拍到全脸",
+          value: 3,
+        },
+        {
+          label: "学习拍照人像不全无法识别,请确保拍照光线充足并拍到全脸",
+          value: 4,
+        },
+      ],
+      form: {
+        cash: 0,
+      },
+      rules: {
+        cash: [{ required: true, message: "请输入提现金额", trigger: "blur" }],
+      },
+      reverse: true,
+      activities: [
+        {
+          content: "活动按期开始",
+        },
+        {
+          content: "通过审核",
+        },
+        {
+          content: "创建成功",
+        },
+      ],
+      active: 2,
+    };
+  },
+  methods: {
+    submitForm() {
+      this.$refs.form.validate(async (valid) => {
+        if (valid) {
+          if (this.active == 1) {
+            await this.checkBindGzh();
+            if (this.active == 1) {
+              this.$message.warning("请先微信授权");
+              return;
+            }
+          }
+          withdrawal(this.form).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("提现申请成功");
+              this.isShow = false;
+              this.$emit("getSellerInfo");
+            }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    uploadText(msg) {
+      this.formData.cheating_reason = msg;
+    },
+    close() {
+      this.isShow = false;
+      this.$refs.form.clearValidate();
+    },
+    checkBindGzh() {
+      return checkBindGzh().then((res) => {
+        this.active = res.data ? 2 : 1;
+        return Promise.resolve();
+      });
+    },
+    formatNum(val, key) {
+      if (val > this.cash) {
+        this.form[key] = this.cash;
+        return;
+      }
+      let temp = val.toString();
+      temp = temp.replace(/。/g, ".");
+      temp = temp.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+      temp = temp.replace(/^\./g, ""); //验证第一个字符是数字
+      temp = temp.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
+      temp = temp.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+      temp = temp.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
+      this.form[key] = temp;
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+  },
+  created() {
+    this.checkBindGzh();
+  },
+  components: {
+    vueQr,
+  },
+  watch: {
+    dialogVisible(val) {
+      if (val) {
+        this.form.cash = this.cash || 0;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.input-suffix {
+  display: flex;
+  align-items: center;
+}
+.withd-tips {
+  margin-top: 30px;
+  line-height: 10px;
+  color: #999;
+}
+.step-box {
+  margin-top: 20px;
+  .step-code-box {
+    width: 200px;
+    margin: 20px auto 0;
+  }
+}
+</style>

+ 185 - 0
src/views/salesman/person/index.vue

@@ -0,0 +1,185 @@
+<template>
+  <div class="sales-box">
+    <el-card>
+      <div slot="header" class="clearfix">
+        <span>基本资料</span>
+        <el-form
+          label-position="right"
+          label-width="120px"
+          :model="listData"
+          ref="listData"
+        >
+          <el-form-item
+            v-for="(items, indexs) in listitem"
+            :key="indexs"
+            :label="items.label"
+            :prop="items.prop"
+          >
+            <div v-if="items.scope === 'header_img'" class="header_img">
+              <el-image
+                class="imageStyBoxShow"
+                :src="
+                  items.value
+                    ? $methodsTools.splitImgHost(items.value)
+                    : defaultHead
+                "
+                :preview-src-list="[$methodsTools.splitImgHost(items.value)]"
+              >
+              </el-image>
+              <label for="imgs"><i class="btns"> 更换头像 </i></label>
+              <input
+                id="imgs"
+                type="file"
+                style="display: none"
+                @change="uploadImg"
+              />
+            </div>
+            <!-- <el-input v-else v-model="listData[items.prop]"></el-input> -->
+            <div v-else>{{ items.value }}</div>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { getSellerInfo, sellerEdit } from "@/api/salesman/user";
+export default {
+  data() {
+    return {
+      // 弹窗字段
+      listitem: [
+        {
+          label: " ",
+          prop: "avatar",
+          scope: "header_img",
+          value: "",
+        },
+        {
+          label: "姓名:",
+          prop: "realname",
+          value: "",
+        },
+        {
+          label: "手机号码:",
+          prop: "phonenumber",
+          value: "",
+        },
+        {
+          label: "身份证号:",
+          prop: "idCard",
+          value: "",
+        },
+        {
+          label: "总佣金:",
+          prop: "allCash",
+          value: "",
+        },
+        {
+          label: "已提现:",
+          prop: "cash",
+          value: "",
+        },
+        {
+          label: "可提现:",
+          prop: "usedCash",
+          value: "",
+        },
+      ],
+      //   弹窗数据
+      listData: {
+        realname: "",
+        telphone: "",
+        idCard: "",
+        status: 1,
+      },
+      defaultHead: require("../../../assets/images/defhead.png"),
+    };
+  },
+  methods: {
+    uploadImg(e) {
+      var file = e.target.files[0];
+      if (file === undefined) {
+        e.target.value = "";
+        return;
+      }
+      if (file.size > 0.3 * 1024 * 1024) {
+        this.$message.warning("图片不得大于300kb");
+        e.target.value = "";
+        return;
+      }
+      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      if (type[0] != "jpg" && type[0] != "png" && type[0] != "jpeg") {
+        this.$message.warning("上传格式需为:.jpg/.png/.jpeg");
+        e.target.value = "";
+        return;
+      }
+      this.$upload
+        .upload(file, 0)
+        .then((res) => {
+          sellerEdit({
+            avatar: res,
+          }).then((r) => {
+            this.$message.success("更新头像成功");
+            this.getSellerInfo();
+            this.$store.dispatch("GetInfo");
+          });
+        })
+        .finally(() => {
+          e.target.value = "";
+        });
+    },
+    getSellerInfo() {
+      getSellerInfo().then((res) => {
+        this.listitem.forEach((ele) => {
+          ele.value = res.data[ele.prop];
+          if (ele.prop == "allCash") {
+            ele.value = (
+              res.data.cash +
+              res.data.usedCash +
+              res.data.freezeCash
+            ).toFixed(2);
+          }
+        });
+      });
+    },
+  },
+  created() {
+    this.getSellerInfo();
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.sales-box {
+  width: 500px;
+  padding: 40px;
+  /deep/ {
+    .el-form-item {
+      margin-bottom: 20px;
+    }
+  }
+}
+.header_img {
+  display: flex;
+  align-items: center;
+  & > .imageStyBoxShow {
+    border-radius: 50%;
+    overflow: hidden;
+    width: 80px;
+    height: 80px;
+    margin-right: 18px;
+    border: 1px solid #999;
+  }
+  .btns {
+    border: 1px solid #333;
+    color: #333;
+    padding: 4px 6px;
+    font-style: normal;
+    border-radius: 8px;
+    cursor: pointer;
+    user-select: none;
+  }
+}
+</style>

+ 306 - 0
src/views/salesman/withdrawal/record.vue

@@ -0,0 +1,306 @@
+<template>
+  <div id="registeredUser">
+    <search-box-new
+      ref="searchBox"
+      :formData="formData"
+      :formList="formList"
+      @search="search"
+      @init="init"
+    />
+    <table-list
+      :tableSets="tableSet"
+      :tableData="tableData"
+      :navText="navText"
+      :loading="loading"
+    >
+      <template slot="btn" slot-scope="props">
+        <el-button
+          type="text"
+          v-if="props.scope.row.cwStatus == 0"
+          @click="withdraw(props.scope.row)"
+          >取消申请</el-button
+        >
+      </template>
+    </table-list>
+    <pagination
+      :total="total"
+      :pageSize="formData.pageSize"
+      :currentPage="formData.pageNum"
+      @handleSizeChange="handleSizeChange"
+      @handleCurrentChange="handleCurrentChange"
+    />
+  </div>
+</template>
+
+<script>
+import searchBoxNew from "@/components/searchBoxNew";
+import tableList from "@/components/tableList";
+import pagination from "@/components/pagination";
+import { getWithdrawalList } from "@/api/salesman/user";
+import { cancelApply } from "@/api/salesman/commission";
+
+export default {
+  name: "RegisteredUser",
+  components: { searchBoxNew, tableList, pagination },
+  data() {
+    return {
+      loading: false, //当前表单加载是否加载动画
+      navText: {
+        title: "活动列表",
+        index: 0,
+        ch: "条",
+        num: false,
+        choice: false,
+        addHide: true,
+        backFatherBtn: {
+          status: false,
+          title: "未定义",
+        },
+      },
+      //搜索
+      formList: [
+        {
+          prop: "cwSn",
+          placeholder: "提现单号",
+        },
+        {
+          prop1: "applyStartTime",
+          prop2: "applyEndTime",
+          placeholder1: "开始时间",
+          placeholder2: "结束时间",
+          scope: "moreDataPicker",
+        },
+      ],
+      formData: {},
+      // 表单
+      tableSet: [
+        {
+          label: "提现单号",
+          prop: "cwSn",
+          hidden: true,
+        },
+        {
+          label: "申请时间",
+          prop: "applyTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        // {
+        //   label: "提现方式",
+        //   prop: "sex",
+        //   hidden: true,
+        //   scope: "sex",
+        // },
+        // {
+        //   label: "账号",
+        //   prop: "nickname",
+        //   hidden: true,
+        // },
+        {
+          label: "金额(元)",
+          prop: "cash",
+          hidden: true,
+        },
+        {
+          label: "提现状态",
+          prop: "cwStatus",
+          hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "已取消",
+              value: -2,
+            },
+            {
+              label: "已拒绝",
+              value: -1,
+            },
+            {
+              label: "未审核",
+              value: 0,
+            },
+            {
+              label: "初审通过",
+              value: 1,
+            },
+            {
+              label: "二审通过",
+              value: 2,
+            },
+            {
+              label: "三审通过",
+              value: 3,
+            },
+            {
+              label: "已打款",
+              value: 4,
+            },
+          ],
+        },
+        {
+          label: "备注",
+          prop: "remark",
+          hidden: true,
+        },
+      ],
+      tableData: [], //表单数据
+      total: 0, //一共多少条
+      pageSize: 10, //每页多少条数据
+      currentPage: 1, //当前页码
+      dialogVisible: false,
+    };
+  },
+  mounted() {
+    this.search(2);
+  },
+  methods: {
+    search(int) {
+      this.loading = true;
+      if (int === 1) {
+        this.formData.pageNum = 1;
+      }
+      if (int === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          cwSn: "",
+          applyEndTime: "",
+          applyStartTime: "",
+        };
+      }
+      var data = JSON.parse(JSON.stringify(this.formData));
+      if (this.formData.applyEndTime) {
+        data.applyEndTime = data.applyEndTime / 1000;
+      }
+      if (this.formData.applyStartTime) {
+        data.applyStartTime = data.applyStartTime / 1000;
+      }
+      getWithdrawalList(data)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    init() {
+      this.search(2);
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.search();
+    },
+    withdraw(row) {
+      this.$confirm("将取消申请提现, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        cancelApply({ id: row.id, cwSn: row.cwSn }).then((res) => {
+          this.search();
+          this.$message.success("取消成功");
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.el-button {
+  border-radius: 8px;
+}
+/deep/.el-dialog {
+  border-radius: 8px;
+  .el-dialog__header {
+    padding: 0;
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .el-dialog__footer {
+    padding: 0;
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+  p {
+    margin: 5px 0px;
+  }
+}
+</style>

+ 176 - 68
src/views/system/menu/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+    >
       <el-form-item label="菜单名称" prop="menuName">
         <el-input
           v-model="queryParams.menuName"
@@ -11,7 +16,12 @@
         />
       </el-form-item>
       <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="菜单状态" clearable size="small">
+        <el-select
+          v-model="queryParams.status"
+          placeholder="菜单状态"
+          clearable
+          size="small"
+        >
           <el-option
             v-for="dict in dict.type.sys_normal_disable"
             :key="dict.value"
@@ -21,8 +31,16 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -35,7 +53,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['system:menu:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -44,9 +63,13 @@
           icon="el-icon-sort"
           size="mini"
           @click="toggleExpandAll"
-        >展开/折叠</el-button>
+          >展开/折叠</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
     <el-table
@@ -55,20 +78,40 @@
       :data="menuList"
       row-key="menuId"
       :default-expand-all="isExpandAll"
-      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
     >
-      <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
+      <el-table-column
+        prop="menuName"
+        label="菜单名称"
+        :show-overflow-tooltip="true"
+        width="160"
+      ></el-table-column>
       <el-table-column prop="icon" label="图标" align="center" width="100">
         <template slot-scope="scope">
           <svg-icon :icon-class="scope.row.icon" />
         </template>
       </el-table-column>
-      <el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
-      <el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
-      <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column
+        prop="orderNum"
+        label="排序"
+        width="60"
+      ></el-table-column>
+      <el-table-column
+        prop="perms"
+        label="权限标识"
+        :show-overflow-tooltip="true"
+      ></el-table-column>
+      <el-table-column
+        prop="component"
+        label="组件路径"
+        :show-overflow-tooltip="true"
+      ></el-table-column>
       <el-table-column prop="status" label="状态" width="80">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+          <dict-tag
+            :options="dict.type.sys_normal_disable"
+            :value="scope.row.status"
+          />
         </template>
       </el-table-column>
       <el-table-column label="创建时间" align="center" prop="createTime">
@@ -76,28 +119,36 @@
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
-          <el-button size="mini"
+          <el-button
+            size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:menu:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-plus"
             @click="handleAdd(scope.row)"
             v-hasPermi="['system:menu:add']"
-          >新增</el-button>
+            >新增</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:menu:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
@@ -135,15 +186,24 @@
                 @show="$refs['iconSelect'].reset()"
               >
                 <IconSelect ref="iconSelect" @selected="selected" />
-                <el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
+                <el-input
+                  slot="reference"
+                  v-model="form.icon"
+                  placeholder="点击选择图标"
+                  readonly
+                >
                   <svg-icon
                     v-if="form.icon"
                     slot="prefix"
                     :icon-class="form.icon"
                     class="el-input__icon"
-                    style="height: 32px;width: 16px;"
+                    style="height: 32px; width: 16px"
+                  />
+                  <i
+                    v-else
+                    slot="prefix"
+                    class="el-icon-search el-input__icon"
                   />
-                  <i v-else slot="prefix" class="el-icon-search el-input__icon" />
                 </el-input>
               </el-popover>
             </el-form-item>
@@ -155,14 +215,21 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="显示排序" prop="orderNum">
-              <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
+              <el-input-number
+                v-model="form.orderNum"
+                controls-position="right"
+                :min="0"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item v-if="form.menuType != 'F'">
               <span slot="label">
-                <el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="选择是外链则路由地址需要以`http(s)://`开头"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 是否外链
               </span>
@@ -175,8 +242,11 @@
           <el-col :span="12">
             <el-form-item v-if="form.menuType != 'F'" prop="path">
               <span slot="label">
-                <el-tooltip content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 路由地址
               </span>
@@ -186,8 +256,11 @@
           <el-col :span="12" v-if="form.menuType == 'C'">
             <el-form-item prop="component">
               <span slot="label">
-                <el-tooltip content="访问的组件路径,如:`system/user/index`,默认在`views`目录下" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="访问的组件路径,如:`system/user/index`,默认在`views`目录下"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 组件路径
               </span>
@@ -196,10 +269,17 @@
           </el-col>
           <el-col :span="12">
             <el-form-item v-if="form.menuType != 'M'">
-              <el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
+              <el-input
+                v-model="form.perms"
+                placeholder="请输入权限标识"
+                maxlength="100"
+              />
               <span slot="label">
-                <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 权限字符
               </span>
@@ -207,10 +287,17 @@
           </el-col>
           <el-col :span="12">
             <el-form-item v-if="form.menuType == 'C'">
-              <el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
+              <el-input
+                v-model="form.query"
+                placeholder="请输入路由参数"
+                maxlength="255"
+              />
               <span slot="label">
-                <el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`'
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 路由参数
               </span>
@@ -219,8 +306,11 @@
           <el-col :span="12">
             <el-form-item v-if="form.menuType == 'C'">
               <span slot="label">
-                <el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 是否缓存
               </span>
@@ -233,8 +323,11 @@
           <el-col :span="12">
             <el-form-item v-if="form.menuType != 'F'">
               <span slot="label">
-                <el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 显示状态
               </span>
@@ -243,15 +336,19 @@
                   v-for="dict in dict.type.sys_show_hide"
                   :key="dict.value"
                   :label="dict.value"
-                >{{dict.label}}</el-radio>
+                  >{{ dict.label }}</el-radio
+                >
               </el-radio-group>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item v-if="form.menuType != 'F'">
               <span slot="label">
-                <el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
-                <i class="el-icon-question"></i>
+                <el-tooltip
+                  content="选择停用则路由将不会出现在侧边栏,也不能被访问"
+                  placement="top"
+                >
+                  <i class="el-icon-question"></i>
                 </el-tooltip>
                 菜单状态
               </span>
@@ -260,7 +357,8 @@
                   v-for="dict in dict.type.sys_normal_disable"
                   :key="dict.value"
                   :label="dict.value"
-                >{{dict.label}}</el-radio>
+                  >{{ dict.label }}</el-radio
+                >
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -275,14 +373,20 @@
 </template>
 
 <script>
-import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
+import {
+  listMenu,
+  getMenu,
+  delMenu,
+  addMenu,
+  updateMenu,
+} from "@/api/system/menu";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import IconSelect from "@/components/IconSelect";
 
 export default {
   name: "Menu",
-  dicts: ['sys_show_hide', 'sys_normal_disable'],
+  dicts: ["sys_show_hide", "sys_normal_disable"],
   components: { Treeselect, IconSelect },
   data() {
     return {
@@ -305,22 +409,22 @@ export default {
       // 查询参数
       queryParams: {
         menuName: undefined,
-        visible: undefined
+        visible: undefined,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         menuName: [
-          { required: true, message: "菜单名称不能为空", trigger: "blur" }
+          { required: true, message: "菜单名称不能为空", trigger: "blur" },
         ],
         orderNum: [
-          { required: true, message: "菜单顺序不能为空", trigger: "blur" }
+          { required: true, message: "菜单顺序不能为空", trigger: "blur" },
         ],
         path: [
-          { required: true, message: "路由地址不能为空", trigger: "blur" }
-        ]
-      }
+          { required: true, message: "路由地址不能为空", trigger: "blur" },
+        ],
+      },
     };
   },
   created() {
@@ -334,7 +438,7 @@ export default {
     /** 查询菜单列表 */
     getList() {
       this.loading = true;
-      listMenu(this.queryParams).then(response => {
+      listMenu(this.queryParams).then((response) => {
         this.menuList = this.handleTree(response.data, "menuId");
         this.loading = false;
       });
@@ -347,14 +451,14 @@ export default {
       return {
         id: node.menuId,
         label: node.menuName,
-        children: node.children
+        children: node.children,
       };
     },
     /** 查询菜单下拉树结构 */
     getTreeselect() {
-      listMenu().then(response => {
+      listMenu().then((response) => {
         this.menuOptions = [];
-        const menu = { menuId: 0, menuName: '主类目', children: [] };
+        const menu = { menuId: 0, menuName: "主类目", children: [] };
         menu.children = this.handleTree(response.data, "menuId");
         this.menuOptions.push(menu);
       });
@@ -376,7 +480,7 @@ export default {
         isFrame: "1",
         isCache: "0",
         visible: "0",
-        status: "0"
+        status: "0",
       };
       this.resetForm("form");
     },
@@ -413,24 +517,24 @@ export default {
     handleUpdate(row) {
       this.reset();
       this.getTreeselect();
-      getMenu(row.menuId).then(response => {
+      getMenu(row.menuId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改菜单";
       });
     },
     /** 提交按钮 */
-    submitForm: function() {
-      this.$refs["form"].validate(valid => {
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.menuId != undefined) {
-            this.$api.editsystemmenu(this.form).then(response => {
+            this.$api.editsystemmenu(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addMenu(this.form).then(response => {
+            addMenu(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -441,13 +545,17 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
-        return delMenu(row.menuId);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    }
-  }
+      this.$modal
+        .confirm('是否确认删除名称为"' + row.menuName + '"的数据项?')
+        .then(function () {
+          return delMenu(row.menuId);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+  },
 };
 </script>

+ 19 - 13
src/views/systemSettings/menu/index.vue

@@ -154,7 +154,11 @@
             <el-form-item label="菜单类型" prop="menuType">
               <el-radio-group v-model="form.menuType">
                 <el-radio label="M">目录</el-radio>
-                <el-radio label="C" :disabled="form.menuType == 'M' && form.children.length > 0">菜单</el-radio>
+                <el-radio
+                  label="C"
+                  :disabled="form.menuType == 'M' && form.children.length > 0"
+                  >菜单</el-radio
+                >
                 <el-radio label="F">按钮</el-radio>
               </el-radio-group>
             </el-form-item>
@@ -308,10 +312,10 @@ export default {
         menuName: undefined,
         visible: undefined,
       },
-      showListMenu:[],
+      showListMenu: [],
       // 表单参数
       form: {
-        children : []
+        children: [],
       },
       // 表单校验
       rules: {
@@ -348,7 +352,7 @@ export default {
       this.loading = true;
       this.$api.getsystemmenu(this.queryParams).then((response) => {
         this.menuList = this.handleTree(response.data, "menuId");
-        this.showListMenu = response.data
+        this.showListMenu = response.data;
         this.loading = false;
       });
     },
@@ -377,9 +381,9 @@ export default {
     // },
     /** 查询菜单下拉树结构 */
     getTreeselect() {
-      this.$api.getsystemmenu().then(response => {
+      this.$api.getsystemmenu().then((response) => {
         this.menuOptions = [];
-        const menu = { menuId: 0, menuName: '主类目', children: [] };
+        const menu = { menuId: 0, menuName: "主类目", children: [] };
         menu.children = this.handleTree(response.data, "menuId");
         this.menuOptions.push(menu);
       });
@@ -407,7 +411,7 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        children:[],
+        children: [],
         menuId: undefined,
         parentId: 0,
         menuName: undefined,
@@ -434,7 +438,7 @@ export default {
     handleAdd(row) {
       this.reset();
       this.getTreeselect();
-      if (row != null && row.menuId && row.menuType === 'M') {
+      if (row != null && row.menuId && row.menuType === "M") {
         this.form.parentId = row.menuId;
       } else {
         this.form.parentId = 0;
@@ -444,14 +448,14 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      var self = this
+      var self = this;
       this.reset();
       this.getTreeselect();
       this.$api.enutreeselectmenu(row.menuId).then((response) => {
-        var children = self.showListMenu.filter(item => {
-          return item.parentId === response.data.menuId
-        })
-        response.data.children = children
+        var children = self.showListMenu.filter((item) => {
+          return item.parentId === response.data.menuId;
+        });
+        response.data.children = children;
         self.form = response.data;
         self.open = true;
         self.title = "修改菜单";
@@ -461,10 +465,12 @@ export default {
     submitForm: function () {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          this.form.tenantId = undefined
           if (this.form.menuId != undefined) {
             // if(this.form.component.length === 0){
             //   this.form.component = ''
             // }
+            this.form.tenantId = undefined;
             this.$api.editsystemmenu(this.form).then((response) => {
               // this.$message.success("修改成功");
               this.open = false;