Przeglądaj źródła

修改样式及菜单

plg 8 miesięcy temu
rodzic
commit
15d96c250e

+ 5 - 0
public/index.html

@@ -64,3 +64,8 @@
 </body>
 
 </html>
+<style>
+ body{
+  font-size: 14px;
+ }
+</style>

BIN
src/assets/img/commons/jhTop.png


BIN
src/assets/img/commons/jhTopSuo.png


BIN
src/assets/img/login/login_bg.png


BIN
src/assets/img/login/login_bg1.png


BIN
src/assets/img/login/login_bg2.png


BIN
src/assets/img/login/login_title.png


BIN
src/assets/img/login/password.png


BIN
src/assets/img/login/persion.png


+ 464 - 0
src/components/ChannelRegister.vue

@@ -0,0 +1,464 @@
+<template>
+  <div>
+    <el-dialog
+      :title="isView ? '渠道新增' : '渠道编辑'"
+      :visible.sync="dialogVisible"
+      :before-close="cancle"
+      width="60%"
+    >
+      <el-form
+        :inline="true"
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="120px"
+        class="demo-ruleForm"
+      >
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="头像" prop="avatar">
+              <el-upload
+                accept=".png, .jpg, .jpeg"
+                class="avatar-uploader"
+                name="file"
+                :action="action"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+              >
+                <img v-if="ruleForm.avatar" :src="ruleForm.avatar" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                <div class="el-upload__tip" slot="tip">
+                  建议上传jpg/png/jpeg文件,且不超过500kb
+                </div>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="公司名称" prop="name">
+              <el-input
+                v-model="ruleForm.name"
+                class="inputCom"
+                placeholder="请输入公司名称"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="所在省" prop="province">
+              <el-input
+                v-model="ruleForm.province"
+                class="inputCom"
+                placeholder="请输入所在省"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="所在市" prop="city">
+              <el-input
+                v-model="ruleForm.city"
+                class="inputCom"
+                placeholder="请输入所在市"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="地址" prop="address">
+              <el-input
+                v-model="ruleForm.address"
+                class="inputCom"
+                placeholder="请输入地址"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="税号" prop="taxId">
+              <el-input
+                v-model="ruleForm.taxId"
+                class="inputCom"
+                placeholder="请输入税号"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="法人" prop="corporate">
+              <el-input
+                v-model="ruleForm.corporate"
+                class="inputCom"
+                placeholder="请输入法人"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="手机号" prop="phone">
+              <el-input
+                v-model="ruleForm.phone"
+                class="inputCom"
+                placeholder="请输入手机号"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="身份证号" prop="idNumber">
+              <el-input
+                v-model="ruleForm.idNumber"
+                class="inputCom"
+                placeholder="请输入身份证号"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="状态" prop="status">
+              <el-select v-model="ruleForm.status" placeholder="请选择状态">
+                <el-option
+                  :label="item.name"
+                  :value="item.status"
+                  v-for="item in statusList"
+                  :key="item.status"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancle">取 消</el-button>
+        <el-button
+          v-show="isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >确 定</el-button
+        >
+        <el-button
+          v-show="!isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >修 改</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+// import { oSessionStorage } from "../../utils/utils";
+import { oSessionStorage } from "../utils/utils";
+import { basePath } from "../utils/http";
+import md5 from "md5";
+export default {
+  data() {
+    var validatePass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入密码"));
+      } else if (value.length < 6) {
+        callback(new Error("密码至少6位"));
+      } else {
+        callback();
+      }
+    };
+    var validatePhone = (rule, value, callback) => {
+      let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+      if (value === "") {
+        callback(new Error("请输入手机号"));
+      } else if (!myreg.test(value)) {
+        callback(new Error("请输入正确格式"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      action: "",
+      disableFlag: false,
+      phoneFlag: false,
+      flag: 3,
+      dialogVisible: false,
+      //渠道列表
+      statusList: [
+        { name: "签约", status: "1" },
+        { name: "解约", status: "0" },
+      ],
+      ruleForm: {
+        id: "",
+        //头像
+        avatar: "",
+        //公司名称
+        name: "",
+        //所在省
+        province: "",
+        //所在市
+        city: "",
+        //地址
+        address: "",
+        //税号
+        taxId: "",
+        //法人
+        corporate: "",
+        //手机号
+        phone: "",
+        //身份证号
+        idNumber: "",
+        //状态
+        status: "",
+        //删除状态
+        isDelete: "0",
+      },
+      isView: true,
+      rules: {
+        name: [{ required: true, message: "请输入公司名称", trigger: "blur" }],
+        province: [{ required: true, message: "请输入所在省", trigger: "blur" }],
+        phone: [
+          { required: true, message: "请输入手机号", trigger: "blur" },
+          {
+            pattern: /^1[3456789]\d{9}$/,
+            message: "请输入正确的手机号",
+            trigger: ["blur", "change"],
+          },
+        ],
+        idNumber: [
+          { required: true, message: "请输入身份证号", trigger: "blur" },
+          {
+            pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
+            message: "请输入正确的身份证号",
+            trigger: ["blur", "change"],
+          },
+        ],
+        city: [{ required: true, message: "请输入所在市", trigger: "blur" }],
+        address: [{ required: true, message: "请输入地址", trigger: "blur" }],
+        status: [{ required: true, message: "请输选择渠道", trigger: "change" }],
+      },
+    };
+  },
+  mounted() {
+    let userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    this.ruleForm.parentCode = userInfo.invitationCode;
+    this.action = basePath + "/file/customUpload";
+    //获取渠道信息
+
+    // this.ruleForm.type = "3";
+    // this.getChannel();
+  },
+  methods: {
+    beforeAvatarUpload(file) {
+      const fileName = file.name;
+      const fileType = fileName.substring(fileName.lastIndexOf("."));
+      if (fileType !== ".jpg" && fileType !== ".jpeg" && fileType !== ".png") {
+        // alert("请上传jpg、jpge或png的图片!");
+        this.$message.error('请上传jpg、jpge或png的图片!')
+        return false;
+      }
+      return true;
+    },
+    //handleAvatarSuccess
+    //上传成功后的回调
+    handleAvatarSuccess(data) {
+      if (data.code == 200) {
+        this.ruleForm.avatar = basePath + "/file/show?filePath=" + data.data;
+        console.log(basePath + "/file/show?filePath=" + data.data);
+      } else {
+        //失败
+      }
+    },
+    phoneCheck() {
+      //判断是否重复
+      this.$http.get(`v1/system/checkPhone/${this.ruleForm.phone}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          if (res.data) {
+            this.phoneFlag = true;
+          } else {
+            this.phoneFlag = false;
+            // this.$toast.success({ message: "手机号重复" });
+            this.$message.warning("手机号重复");
+          }
+        } else {
+          // this.$toast.fail({ message: res.msg });
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    timeChange(val) {
+      if (val !== null) {
+        //根据时间得到格式化的数据
+        this.ruleForm.birthDate = this.formatterTime(val);
+      }
+    },
+    formatterTime(val) {
+      let date = new Date(val);
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      month = this.formatterMon(month);
+      let day = date.getDate();
+      day = this.formatterMon(day);
+      return year + "-" + month + "-" + day;
+    },
+    formatterMon(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val;
+      }
+    },
+    open(val) {
+      this.dialogVisible = true;
+      this.isView = val;
+
+      this.$nextTick(() => {
+        this.$refs["ruleForm"].clearValidate();
+      });
+    },
+    edit(val) {
+      this.dialogVisible = true;
+      this.isView = false;
+      this.ruleForm.id = val.id;
+      this.ruleForm.avatar = val.avatar;
+      this.ruleForm.name = val.name;
+      this.ruleForm.province = val.province;
+
+      this.ruleForm.city = val.city;
+
+      this.ruleForm.address = val.address;
+
+      this.ruleForm.taxId = val.taxId;
+
+      this.ruleForm.corporate = val.corporate;
+      this.ruleForm.phone = val.phone;
+
+      this.ruleForm.idNumber = val.idNumber;
+      this.ruleForm.status = val.status;
+      this.ruleForm.isDelete = val.isDelete;
+    },
+    cancle() {
+      //清空表单
+      this.ruleForm.id = "";
+      this.ruleForm.avatar = "";
+      this.ruleForm.name = "";
+      this.ruleForm.province = "";
+
+      this.ruleForm.city = "";
+
+      this.ruleForm.address = "";
+
+      this.ruleForm.taxId = "";
+
+      this.ruleForm.corporate = "";
+      this.ruleForm.phone = "";
+
+      this.ruleForm.idNumber = "";
+      this.ruleForm.status = "";
+      this.$refs["ruleForm"].clearValidate();
+      this.dialogVisible = false;
+    },
+    submitCom() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          //判断是编辑还是新增
+          if (this.isView) {
+            this.register();
+          } else {
+            this.editUserFun();
+          }
+
+          //都校验通过后可以触发注册接口了
+          //调用方法进行入参
+        }
+      });
+    },
+    register() {
+      let that = this;
+      this.$http.post(
+        `/channel/save`,
+        {
+          avatar: this.ruleForm.avatar,
+          name: this.ruleForm.name,
+          province: this.ruleForm.province,
+          city: this.ruleForm.city,
+          address: this.ruleForm.address,
+          taxId: this.ruleForm.taxId,
+          corporate: this.ruleForm.corporate,
+          phone: this.ruleForm.phone,
+          idNumber: this.ruleForm.idNumber,
+          status: this.ruleForm.status,
+          isDelete: 0,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            this.$message.success(res.msg);
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+    editUserFun() {
+      let that = this;
+      this.$http.post(
+        `/channel/save`,
+        {
+          ...this.ruleForm,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+            this.$message.success("修改成功");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+  },
+};
+</script>
+<style scoped>
+.inputCom {
+  width: 200px;
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+  border: 1px solid;
+}
+
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+</style>

+ 70 - 0
src/components/ContractChannelPoster.vue

@@ -0,0 +1,70 @@
+<template>
+  <div>
+    <el-dialog title="二维码预览" :visible.sync="dialogVisible" width="50%" top="5vh">
+      <div class="dia_out">
+        <!-- <el-image class="image_class" :src="url" /> -->
+        <el-image class="image_class"  src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="downLoadImage">下载</el-button>
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { oSessionStorage } from "../utils/utils";
+import { basePath } from "../utils/http";
+export default {
+  data() {
+    return {
+      dialogVisible: false,
+      channelId: "",
+      url: "http://10.113.248.3:8086/file/show?filePath=./images/cloud.bef3ccbc.jpg",
+    };
+  },
+  mounted() {},
+  methods: {
+    downLoadImage() {
+      window.open(`${basePath}/file/download/${this.channelId}`)
+      // this.$http.getDown(`/file/download/${this.channelId}`, {}, (res) => {
+      //   const url = window.URL.createObjectURL(new Blob([res.data])); // 创建一个URL对象
+      //   const link = document.createElement("a"); // 创建一个a标签
+      //   link.href = url; // 设置a标签的href属性为URL对象
+      //   link.setAttribute("download", "file.pdf"); // 设置a标签的download属性为要保存的文件名
+      //   document.body.appendChild(link); // 将a标签添加到DOM中
+      //   link.click(); // 模拟点击a标签进行下载
+      //   document.body.removeChild(link); // 下载完成后,移除a标签
+      // });
+    },
+    open(val) {
+      this.dialogVisible = true;
+      this.channelId=val.channelId;
+      this.url = basePath + "/file/show?filePath=" + val.poster;
+      //   this.queryById();
+    },
+    //调用查询接口
+    // queryById() {
+    //   this.$http.get(`/sign/findById/${this.id}`, {}, (res) => {
+    //     //  this.$toast.success({message:'成功'});
+    //     if (res && res.code == 200) {
+    //       //将值赋值给list
+    //       this.channelList = res.data;
+    //     } else {
+    //       this.$message.error(res.msg);
+    //     }
+    //   });
+    // },
+  },
+};
+</script>
+<style scope>
+.image_class {
+  width: 270px;
+  height: 480px;
+}
+.dia_out {
+  /* text-align: center; */
+}
+</style>

+ 455 - 0
src/components/ContractChannelRegister.vue

@@ -0,0 +1,455 @@
+<template>
+  <div>
+    <el-dialog
+      :title="isView ? '签约新增' : '签约编辑'"
+      :visible.sync="dialogVisible"
+      :before-close="cancle"
+      width="60%"
+    >
+      <el-form
+        :inline="true"
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="120px"
+        class="demo-ruleForm"
+      >
+        
+        <el-row>
+     
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="剩余次数" prop="unuse">
+              <el-input-number
+                v-model="ruleForm.unuse"
+                class="inputCom"
+                :min="0"
+                placeholder="请输入剩余次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+         
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="充值使用次数" prop="rechargeUsed">
+              <el-input-number
+                v-model="ruleForm.rechargeUsed"
+                class="inputCom"
+                  :min="0"
+                placeholder="请输入充值使用次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+         
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="累计充值次数" prop="rechargeCount">
+              <el-input-number
+                v-model="ruleForm.rechargeCount"
+                class="inputCom"
+                :min="0"
+                placeholder="请输入累计充值次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="签约单次金额" prop="signAmount">
+              <el-input-number
+               :min="0"
+                v-model="ruleForm.signAmount"
+                class="inputCom"
+                placeholder="请输入签约单次金额"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="海报背景图" prop="background">
+              <el-upload
+                accept=".png, .jpg, .jpeg"
+                class="avatar-uploader"
+                name="file"
+                :action="action"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+              >
+                <img v-if="ruleForm.background" :src="ruleForm.background" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                <div class="el-upload__tip" slot="tip">
+                  海报背景图建议上传720*1280分辨率图片
+                </div>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+          
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancle">取 消</el-button>
+        <el-button
+          v-show="isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >确 定</el-button
+        >
+        <el-button
+          v-show="!isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >修 改</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+// import { oSessionStorage } from "../../utils/utils";
+import { oSessionStorage } from "../utils/utils";
+import { basePath } from "../utils/http";
+import md5 from "md5";
+export default {
+  data() {
+    var validatePass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入密码"));
+      } else if (value.length < 6) {
+        callback(new Error("密码至少6位"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      channelList: [],
+      action: "",
+      disableFlag: false,
+      phoneFlag: false,
+      flag: 3,
+      dialogVisible: false,
+      //渠道列表
+      statusList: [
+        { name: "签约", status: "1" },
+        { name: "解约", status: "0" },
+      ],
+      selfPageList:[
+        { name: "是", status: "1" },
+        { name: "否", status: "0" },
+      ],
+      ruleForm: {
+        id: "",
+        //渠道id
+        channelId: "",
+        //渠道名字
+        channelName:'',
+        //已使用次数
+        used:'',
+        //单次价格
+        singlePrice:'',
+        //充值使用次数
+        rechargeUsed:'',
+        //剩余次数
+        unuse:'',
+        //累计充值次数
+        rechargeCount:'',
+        //签约单次金额
+        signAmount:'',
+        //有效时间起
+        effectiveDate:'',
+        //有效时间止
+        expirationDate:'',
+        //签约状态
+        status:'',
+        //自定义收尾页
+        selfPage:'',
+        //备注
+        remarks:'',
+        //背景图地址
+        background:'',
+        //海报
+        poster:'',
+      },
+      isView: true,
+      rules: {
+        singlePrice: [{ required: true, message: "请输入单次价格", trigger: "blur" }],
+        used: [{ required: true, message: "请输入已使用次数", trigger: "blur" }],
+        rechargeUsed: [{ required: true, message: "请输入充值使用次数", trigger: "blur" }],
+        unuse: [{ required: true, message: "请输入剩余次数", trigger: "blur" }],
+        rechargeCount: [{ required: true, message: "请输入累计充值次数", trigger: "blur" }],
+        signAmount: [{ required: true, message: "请输入签约单次金额", trigger: "blur" }],
+        status: [{ required: true, message: "请输选择状态", trigger: "change" }],
+      },
+    };
+  },
+  mounted() {
+    let userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    this.ruleForm.parentCode = userInfo.invitationCode;
+    this.action = basePath + "/file/customUpload";
+    //获取渠道信息
+    this.getChannel();
+
+    // this.ruleForm.type = "3";
+    this.getChannel();
+  },
+  methods: {
+    getChannel() {
+      this.$http.get(`/channel/findAll`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          //将值赋值给list
+          this.channelList = res.data;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    beforeAvatarUpload(file) {
+      const fileName = file.name;
+      const fileType = fileName.substring(fileName.lastIndexOf("."));
+      if (fileType !== ".jpg" && fileType !== ".jpeg" && fileType !== ".png") {
+        // alert("请上传jpg、jpge或png的图片!");
+        this.$message.error("请上传jpg、jpge或png的图片!");
+        return false;
+      }
+      return true;
+    },
+    //handleAvatarSuccess
+    //上传成功后的回调
+    handleAvatarSuccess(data) {
+      if (data.code == 200) {
+        this.ruleForm.background = basePath + "/file/show?filePath=" + data.data;
+        console.log(basePath + "/file/show?filePath=" + data.data);
+      } else {
+        //失败
+      }
+    },
+    phoneCheck() {
+      //判断是否重复
+      this.$http.get(`v1/system/checkPhone/${this.ruleForm.phone}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          if (res.data) {
+            this.phoneFlag = true;
+          } else {
+            this.phoneFlag = false;
+            // this.$toast.success({ message: "手机号重复" });
+            this.$message.warning("手机号重复");
+          }
+        } else {
+          // this.$toast.fail({ message: res.msg });
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    timeChange(val) {
+      if (val !== null) {
+        //根据时间得到格式化的数据
+        this.ruleForm.birthDate = this.formatterTime(val);
+      }
+    },
+    formatterTime(val) {
+      let date = new Date(val);
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      month = this.formatterMon(month);
+      let day = date.getDate();
+      day = this.formatterMon(day);
+      return year + "-" + month + "-" + day;
+    },
+    formatterMon(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val;
+      }
+    },
+    open(val) {
+      this.dialogVisible = true;
+      this.isView = val;
+
+      this.$nextTick(() => {
+        this.$refs["ruleForm"].clearValidate();
+      });
+    },
+    edit(val) {
+      this.dialogVisible = true;
+      this.isView = false;
+  
+      this.ruleForm.id=val.id;
+      this.ruleForm.channelId=val.channelId;
+      this.ruleForm.channelName=val.channelName;
+      this.ruleForm.used=val.used;
+      this.ruleForm.singlePrice=val.singlePrice;
+      this.ruleForm.rechargeUsed=val.rechargeUsed;
+      this.ruleForm.unuse=val.unuse;
+      this.ruleForm.rechargeCount=val.rechargeCount;
+      this.ruleForm.signAmount=val.signAmount;
+      this.ruleForm.effectiveDate=val.effectiveDate;
+      this.ruleForm.expirationDate=val.expirationDate;
+      this.ruleForm.status=val.status;
+      this.ruleForm.selfPage=val.selfPage;
+      this.ruleForm.remarks=val.remarks;
+      this.ruleForm.background=val.background;
+      this.ruleForm.poster=val.poster;
+    },
+    cancle() {
+      //清空表单
+      this.ruleForm.id=''
+      this.ruleForm.channelId=''
+      this.ruleForm.channelName=''
+      this.ruleForm.used=''
+      this.ruleForm.singlePrice=''
+      this.ruleForm.rechargeUsed=''
+      this.ruleForm.unuse=''
+      this.ruleForm.rechargeCount=''
+      this.ruleForm.signAmount=''
+      this.ruleForm.effectiveDate=''
+      this.ruleForm.expirationDate=''
+      this.ruleForm.status=''
+      this.ruleForm.selfPage=''
+      this.ruleForm.remarks=''
+      this.ruleForm.background=''
+      this.ruleForm.poster=''
+      this.$refs["ruleForm"].clearValidate();
+      this.dialogVisible = false;
+    },
+    submitCom() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          //判断是编辑还是新增
+          if (this.isView) {
+            this.register();
+          } else {
+            this.editUserFun();
+          }
+
+          //都校验通过后可以触发注册接口了
+          //调用方法进行入参
+        }
+      });
+    },
+    getChannelName(){
+      if(this.ruleForm.channelId==''){
+        this.ruleForm.channelName=''
+      }else{
+        for(let i=0;i<this.channelList.length;i++){
+          if(this.ruleForm.channelId==this.channelList[i].id){
+            this.ruleForm.channelName=this.channelList[i].name;
+          }
+        }
+      }
+      
+    },
+    register() {
+
+      this.getChannelName();
+
+      let that = this;
+      this.$http.post(
+        `/sign/save`,
+        {
+          channelId: this.ruleForm.channelId,
+          channelName: this.ruleForm.channelName,
+          singlePrice: this.ruleForm.singlePrice,
+          used:this.ruleForm.singlePrice,
+          unuse:this.ruleForm.unuse,
+          rechargeUsed:this.ruleForm.rechargeUsed,
+          rechargeCount:this.ruleForm.rechargeCount,
+          signAmount:this.ruleForm.signAmount,
+          effectiveDate:this.ruleForm.effectiveDate,
+          expirationDate:this.ruleForm.expirationDate,
+          status:this.ruleForm.status,
+          selfPage:this.ruleForm.selfPage,
+          remarks:this.ruleForm.remarks,
+          background:this.ruleForm.background,
+          poster:this.ruleForm.poster,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            this.$message.success(res.msg);
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+    editUserFun() {
+      this.getChannelName();
+      let that = this;
+      this.$http.post(
+        `/sign/save`,
+        {
+          ...this.ruleForm,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+            this.$message.success("修改成功");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+  },
+};
+</script>
+<style>
+.el-date-picker__editor-wrap>>> .el-input{
+  width:auto !important
+}
+.el-date-picker__editor-wrap>>> .el-input__inner{
+  width:auto !important
+}
+</style>
+<style scoped>
+.inputCom {
+  width: 200px;
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+  border: 1px solid;
+}
+
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+
+</style>
+

+ 71 - 0
src/components/ContractPoster.vue

@@ -0,0 +1,71 @@
+<template>
+  <div>
+    <el-dialog title="二维码预览" :visible.sync="dialogVisible" width="50%" top="5vh">
+      <div class="dia_out">
+        <el-image class="image_class"  :src="url" ></el-image>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="downLoadImage">下载</el-button>
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { oSessionStorage } from "../utils/utils";
+import { basePath } from "../utils/http";
+export default {
+  data() {
+    return {
+      dialogVisible: false,
+      channelId: "",
+      //url: "http://10.113.248.3:8086/file/show?filePath=./images/cloud.bef3ccbc.jpg",
+      url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
+      //
+    };
+  },
+  mounted() {},
+  methods: {
+    downLoadImage() {
+        window.open(`${basePath}/file/download/${this.channelId}`)
+    //   this.$http.getDown(`/file/download/${this.channelId}`, {}, (res) => {
+    //     const url = window.URL.createObjectURL(new Blob([res.data])); // 创建一个URL对象
+    //     const link = document.createElement("a"); // 创建一个a标签
+    //     link.href = url; // 设置a标签的href属性为URL对象
+    //     link.setAttribute("download", "file.pdf"); // 设置a标签的download属性为要保存的文件名
+    //     document.body.appendChild(link); // 将a标签添加到DOM中
+    //     link.click(); // 模拟点击a标签进行下载
+    //     document.body.removeChild(link); // 下载完成后,移除a标签
+    //   });
+    },
+    open(val) {
+      this.dialogVisible = true;
+      this.channelId=val.channelId;
+      this.url = basePath + "/file/show?filePath=" + val.poster;
+      //   this.queryById();
+    },
+    //调用查询接口
+    // queryById() {
+    //   this.$http.get(`/sign/findById/${this.id}`, {}, (res) => {
+    //     //  this.$toast.success({message:'成功'});
+    //     if (res && res.code == 200) {
+    //       //将值赋值给list
+    //       this.channelList = res.data;
+    //     } else {
+    //       this.$message.error(res.msg);
+    //     }
+    //   });
+    // },
+  },
+};
+</script>
+<style scope>
+.image_class {
+  width: 270px;
+  height: 480px;
+}
+.dia_out {
+  /* text-align: center; */
+}
+</style>

+ 553 - 0
src/components/ContractRegister.vue

@@ -0,0 +1,553 @@
+<template>
+  <div>
+    <el-dialog
+      :title="isView ? '签约新增' : '签约编辑'"
+      :visible.sync="dialogVisible"
+      :before-close="cancle"
+      width="60%"
+    >
+      <el-form
+        :inline="true"
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="120px"
+        class="demo-ruleForm"
+      >
+        
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="渠道" prop="channelId" >
+              <el-select v-model="ruleForm.channelId" placeholder="请选择渠道">
+                <el-option
+                  :label="item.name"
+                  :value="item.id"
+                  v-for="item in channelList"
+                  :key="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="已使用次数" prop="used">
+              <el-input-number
+                v-model="ruleForm.used"
+                type="number"
+                :min="0"
+                class="inputCom"
+                placeholder="请输入已使用次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="单次价格" prop="singlePrice">
+              <el-input-number
+                v-model="ruleForm.singlePrice"
+                class="inputCom"
+                :min="0"
+                placeholder="请输入单次价格"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="充值使用次数" prop="rechargeUsed">
+              <el-input-number
+                v-model="ruleForm.rechargeUsed"
+                class="inputCom"
+                  :min="0"
+                placeholder="请输入充值使用次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="剩余次数" prop="unuse">
+              <el-input-number
+                v-model="ruleForm.unuse"
+                class="inputCom"
+                :min="0"
+                placeholder="请输入剩余次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="累计充值次数" prop="rechargeCount">
+              <el-input-number
+                v-model="ruleForm.rechargeCount"
+                class="inputCom"
+                :min="0"
+                placeholder="请输入累计充值次数"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="签约单次金额" prop="signAmount">
+              <el-input-number
+               :min="0"
+                v-model="ruleForm.signAmount"
+                class="inputCom"
+                placeholder="请输入签约单次金额"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="有效时间起" prop="effectiveDate" >
+              <el-date-picker
+                v-model="ruleForm.effectiveDate"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                popper-class="dateClass"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="有效时间止" prop="expirationDate" class="block">
+              <el-date-picker
+                v-model="ruleForm.expirationDate"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                popper-class="dateClass"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="状态" prop="status">
+              <el-select v-model="ruleForm.status" placeholder="请选择状态">
+                <el-option
+                  :label="item.name"
+                  :value="item.status"
+                  v-for="item in statusList"
+                  :key="item.status"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="自定义收尾页" prop="selfPage">
+              <el-select v-model="ruleForm.selfPage" placeholder="请选择">
+                <el-option
+                  :label="item.name"
+                  :value="item.status"
+                  v-for="item in selfPageList"
+                  :key="item.status"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="备注" prop="remarks">
+              <el-input
+                v-model="ruleForm.remarks"
+                class="inputCom"
+                placeholder="请输入备注"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="海报背景图" prop="background">
+              <el-upload
+                accept=".png, .jpg, .jpeg"
+                class="avatar-uploader"
+                name="file"
+                :action="action"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+              >
+                <img v-if="ruleForm.background" :src="ruleForm.background" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                <div class="el-upload__tip" slot="tip">
+                  海报背景图建议上传720*1280分辨率图片
+                </div>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+          
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancle">取 消</el-button>
+        <el-button
+          v-show="isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >确 定</el-button
+        >
+        <el-button
+          v-show="!isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >修 改</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+// import { oSessionStorage } from "../../utils/utils";
+import { oSessionStorage } from "../utils/utils";
+import { basePath } from "../utils/http";
+import md5 from "md5";
+export default {
+  data() {
+    var validatePass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入密码"));
+      } else if (value.length < 6) {
+        callback(new Error("密码至少6位"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      channelList: [],
+      action: "",
+      disableFlag: false,
+      phoneFlag: false,
+      flag: 3,
+      dialogVisible: false,
+      //渠道列表
+      statusList: [
+        { name: "签约", status: "1" },
+        { name: "解约", status: "0" },
+      ],
+      selfPageList:[
+        { name: "是", status: "1" },
+        { name: "否", status: "0" },
+      ],
+      ruleForm: {
+        id: "",
+        //渠道id
+        channelId: "",
+        //渠道名字
+        channelName:'',
+        //已使用次数
+        used:'',
+        //单次价格
+        singlePrice:'',
+        //充值使用次数
+        rechargeUsed:'',
+        //剩余次数
+        unuse:'',
+        //累计充值次数
+        rechargeCount:'',
+        //签约单次金额
+        signAmount:'',
+        //有效时间起
+        effectiveDate:'',
+        //有效时间止
+        expirationDate:'',
+        //签约状态
+        status:'',
+        //自定义收尾页
+        selfPage:'',
+        //备注
+        remarks:'',
+        //背景图地址
+        background:'',
+        //海报
+        poster:'',
+        isDelete:0
+      },
+      isView: true,
+      rules: {
+        singlePrice: [{ required: true, message: "请输入单次价格", trigger: "blur" }],
+        used: [{ required: true, message: "请输入已使用次数", trigger: "blur" }],
+        rechargeUsed: [{ required: true, message: "请输入充值使用次数", trigger: "blur" }],
+        unuse: [{ required: true, message: "请输入剩余次数", trigger: "blur" }],
+        rechargeCount: [{ required: true, message: "请输入累计充值次数", trigger: "blur" }],
+        signAmount: [{ required: true, message: "请输入签约单次金额", trigger: "blur" }],
+        status: [{ required: true, message: "请输选择状态", trigger: "change" }],
+      },
+    };
+  },
+  mounted() {
+    let userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    this.ruleForm.parentCode = userInfo.invitationCode;
+    this.action = basePath + "/file/customUpload";
+    //获取渠道信息
+    this.getChannel();
+
+    // this.ruleForm.type = "3";
+    this.getChannel();
+  },
+  methods: {
+    getChannel() {
+      this.$http.get(`/channel/findAll`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          //将值赋值给list
+          this.channelList = res.data;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    beforeAvatarUpload(file) {
+      const fileName = file.name;
+      const fileType = fileName.substring(fileName.lastIndexOf("."));
+      if (fileType !== ".jpg" && fileType !== ".jpeg" && fileType !== ".png") {
+        // alert("请上传jpg、jpge或png的图片!");
+        this.$message.error("请上传jpg、jpge或png的图片!");
+        return false;
+      }
+      return true;
+    },
+    //handleAvatarSuccess
+    //上传成功后的回调
+    handleAvatarSuccess(data) {
+      if (data.code == 200) {
+        this.ruleForm.background = basePath + "/file/show?filePath=" + data.data;
+        console.log(basePath + "/file/show?filePath=" + data.data);
+      } else {
+        //失败
+      }
+    },
+    phoneCheck() {
+      //判断是否重复
+      this.$http.get(`v1/system/checkPhone/${this.ruleForm.phone}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          if (res.data) {
+            this.phoneFlag = true;
+          } else {
+            this.phoneFlag = false;
+            // this.$toast.success({ message: "手机号重复" });
+            this.$message.warning("手机号重复");
+          }
+        } else {
+          // this.$toast.fail({ message: res.msg });
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    timeChange(val) {
+      if (val !== null) {
+        //根据时间得到格式化的数据
+        this.ruleForm.birthDate = this.formatterTime(val);
+      }
+    },
+    formatterTime(val) {
+      let date = new Date(val);
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      month = this.formatterMon(month);
+      let day = date.getDate();
+      day = this.formatterMon(day);
+      return year + "-" + month + "-" + day;
+    },
+    formatterMon(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val;
+      }
+    },
+    open(val) {
+      this.dialogVisible = true;
+      this.isView = val;
+
+      this.$nextTick(() => {
+        this.$refs["ruleForm"].clearValidate();
+      });
+    },
+    edit(val) {
+      this.dialogVisible = true;
+      this.isView = false;
+  
+      this.ruleForm.id=val.id;
+      this.ruleForm.channelId=val.channelId;
+      this.ruleForm.channelName=val.channelName;
+      this.ruleForm.used=val.used;
+      this.ruleForm.singlePrice=val.singlePrice;
+      this.ruleForm.rechargeUsed=val.rechargeUsed;
+      this.ruleForm.unuse=val.unuse;
+      this.ruleForm.rechargeCount=val.rechargeCount;
+      this.ruleForm.signAmount=val.signAmount;
+      this.ruleForm.effectiveDate=val.effectiveDate;
+      this.ruleForm.expirationDate=val.expirationDate;
+      this.ruleForm.status=val.status;
+      this.ruleForm.selfPage=val.selfPage;
+      this.ruleForm.remarks=val.remarks;
+      this.ruleForm.background=val.background;
+      this.ruleForm.poster=val.poster;
+      this.ruleForm.isDelete=val.isDelete;
+    },
+    cancle() {
+      //清空表单
+      this.ruleForm.id=''
+      this.ruleForm.channelId=''
+      this.ruleForm.channelName=''
+      this.ruleForm.used=''
+      this.ruleForm.singlePrice=''
+      this.ruleForm.rechargeUsed=''
+      this.ruleForm.unuse=''
+      this.ruleForm.rechargeCount=''
+      this.ruleForm.signAmount=''
+      this.ruleForm.effectiveDate=''
+      this.ruleForm.expirationDate=''
+      this.ruleForm.status=''
+      this.ruleForm.selfPage=''
+      this.ruleForm.remarks=''
+      this.ruleForm.background=''
+      this.ruleForm.poster=''
+      this.$refs["ruleForm"].clearValidate();
+      this.dialogVisible = false;
+    },
+    submitCom() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          //判断是编辑还是新增
+          if (this.isView) {
+            this.register();
+          } else {
+            this.editUserFun();
+          }
+
+          //都校验通过后可以触发注册接口了
+          //调用方法进行入参
+        }
+      });
+    },
+    getChannelName(){
+      if(this.ruleForm.channelId==''){
+        this.ruleForm.channelName=''
+      }else{
+        for(let i=0;i<this.channelList.length;i++){
+          if(this.ruleForm.channelId==this.channelList[i].id){
+            this.ruleForm.channelName=this.channelList[i].name;
+          }
+        }
+      }
+      
+    },
+    register() {
+
+      this.getChannelName();
+
+      let that = this;
+      this.$http.post(
+        `/sign/save`,
+        {
+          channelId: this.ruleForm.channelId,
+          channelName: this.ruleForm.channelName,
+          singlePrice: this.ruleForm.singlePrice,
+          used:this.ruleForm.singlePrice,
+          unuse:this.ruleForm.unuse,
+          rechargeUsed:this.ruleForm.rechargeUsed,
+          rechargeCount:this.ruleForm.rechargeCount,
+          signAmount:this.ruleForm.signAmount,
+          effectiveDate:this.ruleForm.effectiveDate,
+          expirationDate:this.ruleForm.expirationDate,
+          status:this.ruleForm.status,
+          selfPage:this.ruleForm.selfPage,
+          remarks:this.ruleForm.remarks,
+          background:this.ruleForm.background,
+          poster:this.ruleForm.poster,
+          isDelete:this.ruleForm.isDelete
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            this.$message.success(res.msg);
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+    editUserFun() {
+      this.getChannelName();
+      let that = this;
+      this.$http.post(
+        `/sign/save`,
+        {
+          ...this.ruleForm,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+            this.$message.success("修改成功");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+  },
+};
+</script>
+<style>
+.dateClass .el-input__inner {
+  width: 140px;
+}
+
+.dateClass .el-input {
+  width: 140px;
+}
+.el-date-editor .el-icon-circle-close {
+    cursor: pointer;
+    margin-right: 10px;
+}
+</style>
+<style scoped>
+
+
+.inputCom {
+  width: 200px;
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+  border: 1px solid;
+}
+
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+
+</style>
+

+ 86 - 0
src/components/ContractTopUp.vue

@@ -0,0 +1,86 @@
+<template>
+  <div>
+    <el-dialog title="充值次数" :visible.sync="centerDialogVisible" width="50%">
+      <el-form :model="ruleForm" :rules="rules" ref="ruleForm">
+        <el-form-item prop="count" label="充值次数">
+          <el-input-number
+            v-model="ruleForm.count"
+            :min="0"
+            class="inputCom"
+          ></el-input-number>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancle('ruleForm')">取 消</el-button>
+        <el-button type="primary" @click="submitForm('ruleForm')">提 交</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      centerDialogVisible: false,
+      id: "",
+      ruleForm: {
+        count: "",
+      },
+      rules: {
+        count: [{ required: true, message: "请填写充值次数", trigger: "blur" }],
+      },
+    };
+  },
+  mounted() {},
+  methods: {
+    cancle(formName) {
+      this.$refs[formName].resetFields();
+      this.centerDialogVisible = false;
+    },
+    open(val) {
+      this.id = val;
+      this.centerDialogVisible = true;
+      console.log(this.centerDialogVisible);
+    },
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          //校验通过后
+          //调用接口开始提交
+          // alert('submit!');
+          this.saveCount()
+        } else {
+          // console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    saveCount() {
+      let that =this;
+      this.$http.post(
+        `/sign/recharge`,
+        {
+          id: this.id,
+          count: this.ruleForm.count,
+        },
+        (res) => {
+          //  this.$toast.success({message:'成功'});
+          if (res && res.code == 200) {
+            //将值赋值给list
+            this.$message.success(res.msg);
+            this.centerDialogVisible = false;
+            that.$emit("search");
+          } else {
+            this.$message.error(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+<style scoped>
+.inputCom {
+  width: 200px;
+}
+</style>

+ 166 - 148
src/components/Register.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <el-dialog :title="flag===2?'新增医生':'新增代理'" :visible.sync="dialogVisible" :before-close="cancle" width="60%">
+    <el-dialog
+      :title="isView ? '用户新增' : '用户编辑'"
+      :visible.sync="dialogVisible"
+      :before-close="cancle"
+      width="60%"
+    >
       <el-form
         :inline="true"
         :model="ruleForm"
@@ -9,121 +14,58 @@
         label-width="120px"
         class="demo-ruleForm"
       >
-
         <el-row>
-          <el-col :span="12">
-            <el-form-item label="用户名称" prop="name">
-              <el-input v-model="ruleForm.name" class="inputCom"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="性别" prop="gender">
-              <el-radio-group v-model="ruleForm.gender" class="inputCom">
-                <el-radio label="0">男</el-radio>
-                <el-radio label="1">女</el-radio>
-              </el-radio-group>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="用户名" prop="name">
+              <el-input :disabled="!isView" v-model="ruleForm.name" class="inputCom"></el-input>
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="出生年月" prop="birthDate">
-              <el-date-picker
-                  class="inputCom"
-                  type="date"
-                  placeholder="出生年月"
-                  v-model="ruleForm.birthDate"
-                  @change="timeChange"
-              ></el-date-picker>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="手机号" prop="phone">
-              <el-input
-                  v-model="ruleForm.phone"
-                  @blur="phoneCheck"
-                  autocomplete="off"
-                  class="inputCom"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row v-if="flag == 2">
-          <el-col :span="12">
-            <el-form-item
-                v-show="this.flag === 2"
-                label="医院名称"
-                prop="hospitalName"
-            >
-              <el-input v-model="ruleForm.hospitalName" class="inputCom"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item
-                v-show="this.flag === 2"
-                label="科室名称"
-                prop="departmentName"
-            >
-              <el-input
-                  v-model="ruleForm.departmentName"
-                  class="inputCom"
-              ></el-input>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="用户昵称" prop="userName">
+              <el-input v-model="ruleForm.userName" class="inputCom"></el-input>
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row v-if="flag == 2">
-          <el-col :span="12">
-            <el-form-item
-                v-show="this.flag === 2"
-                label="职称"
-                prop="professionalTitle"
-            >
-              <el-input
-                  v-model="ruleForm.professionalTitle"
-                  class="inputCom"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="密码" prop="password">
-              <el-input
-                  v-model="ruleForm.password"
-                  type="password"
-                  autocomplete="new-password"
-                  class="inputCom"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12" v-if="flag != 2">
+          <el-col :xs="24" v-show="isView" :sm="24" :md="12" :lg="12" :xl="12">
             <el-form-item label="密码" prop="password">
               <el-input
-                  v-model="ruleForm.password"
-                  type="password"
-                  autocomplete="new-password"
-                  class="inputCom"
+                v-model="ruleForm.password"
+                type="password"
+                placeholder="请输入密码"
+                autocomplete="new-password"
+                class="inputCom"
               ></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="确认密码" prop="confirmPassword">
-              <el-input
-                  class="inputCom"
-                  v-model="ruleForm.confirmPassword"
-                  type="password"
-              ></el-input>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="所属渠道" prop="channel">
+              <el-select v-model="ruleForm.channel" placeholder="请选择渠道">
+                <el-option
+                  :label="item.name"
+                  :value="item.id"
+                  v-for="item in channelList"
+                  :key="item.id"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
-
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="cancle">取 消</el-button>
-        <el-button type="primary" :disabled="disableFlag" @click="submitCom"
+        <el-button
+          v-show="isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
           >确 定</el-button
         >
+        <el-button
+          v-show="!isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >修 改</el-button
+        >
       </span>
     </el-dialog>
   </div>
@@ -136,9 +78,9 @@ export default {
   data() {
     var validatePass = (rule, value, callback) => {
       if (value === "") {
-        callback(new Error("请输入确认密码"));
-      } else if (value !== this.ruleForm.password) {
-        callback(new Error("两次输入密码不一致"));
+        callback(new Error("请输入密码"));
+      } else if (value.length<6) {
+        callback(new Error("密码至少6位"));
       } else {
         callback();
       }
@@ -158,32 +100,31 @@ export default {
       phoneFlag: false,
       flag: 3,
       dialogVisible: false,
+      //渠道列表
+      channelList: [{ name: "渠道天成", id: "1" }],
       ruleForm: {
+        id: "",
         name: "",
-        gender: "0",
-        birthDate: "",
-        phone: "",
+        userName: "",
         password: "",
-        confirmPassword: "",
-        parentCode: "", //parentCode
-        type: 3, //0普通用户扫码注册;1医生用户扫码注册;2代理添加医生用户;3超管添加代理用户
-        hospitalName: "", //医院名称
-        departmentName: "", //科室名称
-        professionalTitle: "", //职称
+        channel: "",
+        channelId: "",
+        openId: "",
+        phone: "",
+        photoPath: "",
+        state: "",
+        type: "",
       },
+      isView: true,
       rules: {
         name: [{ required: true, message: "请输入用户名称", trigger: "blur" }],
-        birthDate: [
-          { required: true, message: "请选择生日", trigger: "change" },
-        ],
-        phone: [
-          { required: true, message: "请输入手机号", trigger: "blur" },
-          { validator: validatePhone, required: true, trigger: "blur" },
+        userName: [
+          { required: true, message: "请输入用户昵称", trigger: "blur" },
         ],
-        password: [{ required: true, message: "请输密码", trigger: "blur" }],
-        confirmPassword: [
-          { required: true, message: "请输入确认密码", trigger: "blur" },
-          { validator: validatePass, trigger: "blur" },
+        // password: [{ required: true, message: "请输密码", trigger: "blur" }],
+        password: [{ required: true, validator: validatePass, trigger: "blur" }],
+        channel: [
+          { required: true, message: "请输选择渠道", trigger: "change" },
         ],
       },
     };
@@ -191,9 +132,25 @@ export default {
   mounted() {
     let userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
     this.ruleForm.parentCode = userInfo.invitationCode;
+
+    //获取渠道信息
+
     // this.ruleForm.type = "3";
+    this.getChannel();
   },
   methods: {
+    //获取渠道信息
+    getChannel() {
+      this.$http.get(`/channel/findAll`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          //将值赋值给list
+          this.channelList = res.data;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
     phoneCheck() {
       //判断是否重复
       this.$http.get(
@@ -207,11 +164,11 @@ export default {
             } else {
               this.phoneFlag = false;
               // this.$toast.success({ message: "手机号重复" });
-              this.$message.warning('手机号重复')
+              this.$message.warning("手机号重复");
             }
           } else {
             // this.$toast.fail({ message: res.msg });
-            this.$message.error(res.msg)
+            this.$message.error(res.msg);
           }
         }
       );
@@ -239,66 +196,127 @@ export default {
       }
     },
     open(val) {
-      this.flag = val;
-      this.ruleForm.type = val;
       this.dialogVisible = true;
-      console.log(this.dialogVisible);
+      this.isView = val;
 
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.$refs["ruleForm"].clearValidate();
-      })
+      });
+    },
+    edit(val) {
+      this.dialogVisible = true;
+      this.isView = false;
+      this.ruleForm.id = val.id;
+      this.ruleForm.name = val.name;
+      this.ruleForm.userName = val.userName;
+      this.ruleForm.password = val.password;
+      this.ruleForm.channel = val.channelId;
+      this.ruleForm.channelId = val.channelId;
+      this.ruleForm.openId = val.openId;
+      this.ruleForm.phone = val.phone;
+      this.ruleForm.photoPath = val.photoPath;
+      this.ruleForm.state = val.state;
+      this.ruleForm.type = val.tyep;
     },
     cancle() {
       //清空表单
       this.ruleForm.name = "";
-      this.ruleForm.gender = "0";
-      this.ruleForm.birthDate = "";
-      this.ruleForm.phone = "";
+
       this.ruleForm.password = "";
-      this.ruleForm.confirmPassword = "";
-      // this.ruleForm.confirmPassword = "";
-      this.ruleForm.hospitalName = "";
-      this.ruleForm.departmentName = "";
-      this.ruleForm.professionalTitle = "";
+      this.ruleForm.userName = "";
+      this.ruleForm.channel = "";
 
-      this.$refs["ruleForm"].clearValidate();
+      // this.$refs["ruleForm"].clearValidate();
       this.dialogVisible = false;
     },
     submitCom() {
       this.$refs["ruleForm"].validate((valid) => {
         if (valid) {
-          if (this.phoneFlag) {
-            this.disableFlag = true;
+          //判断是编辑还是新增
+          if (this.isView) {
             this.register();
           } else {
-            // this.$toast.success({ message: "手机号重复" });
-            this.$message.warning('手机号重复')
+            this.editUserFun();
           }
+
+          //都校验通过后可以触发注册接口了
           //调用方法进行入参
         }
       });
     },
     register() {
       let that = this;
-      this.dialogVisible = false;
-      this.ruleForm.password = md5(this.ruleForm.password);
-      this.ruleForm.confirmPassword = md5(this.ruleForm.confirmPassword);
-
+      // this.ruleForm.password = md5(this.ruleForm.password);
+      let password = md5(this.ruleForm.password);
+      this.$http.post(
+        `/user/save`,
+        {
+          channelId: this.ruleForm.channel,
+          phone: "",
+          name: this.ruleForm.name,
+          userName: this.ruleForm.userName,
+          password: password,
+          id: "",
+          state: "1",
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+    editUserFun() {
+      let that = this;
+      // this.ruleForm.password = md5(this.ruleForm.password);
+      // let password = md5(this.ruleForm.password);
+      // this.ruleForm.id = val.id;
+      // this.ruleForm.name = val.name;
+      // this.ruleForm.userName = val.userName;
+      // this.ruleForm.password = "";
+      // this.ruleForm.channel = val.channelId;
+      // this.ruleForm.channelId = val.channelId;
+      // this.ruleForm.openId = val.openId;
+      // this.ruleForm.phone = val.phone;
+      // this.ruleForm.photoPath = val.photoPath;
+      // this.ruleForm.state = val.state;
+      // this.ruleForm.type = val.tyep;
       this.$http.post(
-        `v1/system/registerUser`,
+        `/user/save`,
         {
-          ...this.ruleForm, //解构对象
+          id: this.ruleForm.id,
+          name: this.ruleForm.name,
+          userName: this.ruleForm.userName,
+          password: this.ruleForm.password,
+          channelId: this.ruleForm.channel,
+          openId:this.ruleForm.openId,
+          phone: this.ruleForm.phone,
+          photoPath: this.ruleForm.photoPath,
+          state: this.ruleForm.state,
+          type:this.ruleForm.type
+          // ...this.ruleForm, //解构对象
         },
         (res) => {
           this.disableFlag = false;
           if (res && res.code == 200) {
+            this.dialogVisible = false;
             // this.$toast.success({ message: "成功" });
-            this.$message.success('成功')
             //调用父组件的查询方法
             that.$emit("search");
+            this.$message.success('修改成功')
           } else {
             // this.$toast.fail({ message: res.msg });
-            this.$message.error(res.msg)
+            this.$message.error(res.msg);
           }
           //清空缓存
           this.cancle();

+ 423 - 0
src/components/StaffRegister.vue

@@ -0,0 +1,423 @@
+<template>
+  <div>
+    <el-dialog
+      :title="isView ? '用户新增' : '用户编辑'"
+      :visible.sync="dialogVisible"
+      :before-close="cancle"
+      width="60%"
+    >
+      <el-form
+        :inline="true"
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="120px"
+        class="demo-ruleForm"
+      >
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="头像" prop="avatar">
+              <el-upload
+                 accept=".png, .jpg, .jpeg"
+                class="avatar-uploader"
+                name="file"
+                :action="action"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+              >
+                <img v-if="ruleForm.avatar" :src="ruleForm.avatar" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                <div class="el-upload__tip" slot="tip">
+                  建议上传jpg/png/jpeg文件,且不超过500kb
+                </div>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="姓名" prop="name">
+              <el-input
+                v-model="ruleForm.name"
+                class="inputCom"
+                placeholder="请输入姓名"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="个人描述" prop="description">
+              <el-input
+                v-model="ruleForm.description"
+                class="inputCom"
+                placeholder="请输入描述"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="岗位" prop="job">
+              <el-input
+                v-model="ruleForm.job"
+                class="inputCom"
+                placeholder="请输入岗位"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="邮箱" prop="mail">
+              <el-input
+                v-model="ruleForm.mail"
+                class="inputCom"
+                placeholder="请输入邮箱"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="手机号" prop="phone">
+              <el-input
+                v-model="ruleForm.phone"
+                class="inputCom"
+                placeholder="请输入手机号"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <el-form-item label="状态" prop="state">
+              <el-select v-model="ruleForm.state" placeholder="请选择状态">
+                <el-option
+                  :label="item.name"
+                  :value="item.state"
+                  v-for="item in stateList"
+                  :key="item.state"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancle">取 消</el-button>
+        <el-button
+          v-show="isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >确 定</el-button
+        >
+        <el-button
+          v-show="!isView"
+          type="primary"
+          :disabled="disableFlag"
+          @click="submitCom"
+          >修 改</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+// import { oSessionStorage } from "../../utils/utils";
+import { oSessionStorage } from "../utils/utils";
+import { basePath } from "../utils/http";
+import md5 from "md5";
+export default {
+  data() {
+    var validatePass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入密码"));
+      } else if (value.length < 6) {
+        callback(new Error("密码至少6位"));
+      } else {
+        callback();
+      }
+    };
+    var validatePhone = (rule, value, callback) => {
+      let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+      if (value === "") {
+        callback(new Error("请输入手机号"));
+      } else if (!myreg.test(value)) {
+        callback(new Error("请输入正确格式"));
+      } else {
+        callback();
+      }
+    };
+    return {
+        action:'',
+      disableFlag: false,
+      phoneFlag: false,
+      flag: 3,
+      dialogVisible: false,
+      //渠道列表
+      stateList: [
+        { name: "签约", state: "1" },
+        { name: "解约", state: "0" },
+      ],
+      ruleForm: {
+        id: "",
+        channelId: "",
+        //头像
+        avatar: "",
+        //员工姓名
+        name: "",
+        //描述
+        description: "",
+        //岗位
+        job: "",
+        //邮箱
+        mail: "",
+        //手机号
+        phone: "",
+        //状态
+        state: "",
+        // //删除状态
+        isDelete: "0",
+      },
+      isView: true,
+      rules: {
+        name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
+        phone: [
+          { required: true, message: "请输入手机号", trigger: "blur" },
+          { pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: ["blur", "change"] },
+        ],
+        state: [{ required: true, message: "请输选择状态", trigger: "change" }],
+        mail: [
+          { required: true, message: "请输选择邮箱", trigger: "blur" },
+          { type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] },
+        ],
+      },
+    };
+  },
+  mounted() {
+    let userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    this.ruleForm.parentCode = userInfo.invitationCode;
+    this.action = basePath+ "/file/customUpload";
+    //获取到router 传输过来的信息
+    this.ruleForm.channelId = this.$route.query.channelId;
+
+    //获取渠道信息
+
+    // this.ruleForm.type = "3";
+  },
+  methods: {
+    beforeAvatarUpload(file) {
+      const fileName = file.name;
+      const fileType = fileName.substring(fileName.lastIndexOf("."));
+      if (fileType !== ".jpg" && fileType !== ".jpeg" && fileType !== ".png") {
+        // alert("请上传jpg、jpge或png的图片!");
+        this.$message.error('请上传jpg、jpge或png的图片!')
+        return false;
+      }
+      return true;
+    },
+    //handleAvatarSuccess
+    //上传成功后的回调
+    handleAvatarSuccess(data) {
+      if (data.code == 200) {
+        this.ruleForm.avatar = basePath + "/file/show?filePath=" + data.data;
+        console.log(basePath + "/file/show?filePath=" + data.data);
+      } else {
+        //失败
+      }
+    },
+    phoneCheck() {
+      //判断是否重复
+      this.$http.get(`v1/system/checkPhone/${this.ruleForm.phone}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          if (res.data) {
+            this.phoneFlag = true;
+          } else {
+            this.phoneFlag = false;
+            // this.$toast.success({ message: "手机号重复" });
+            this.$message.warning("手机号重复");
+          }
+        } else {
+          // this.$toast.fail({ message: res.msg });
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    timeChange(val) {
+      if (val !== null) {
+        //根据时间得到格式化的数据
+        this.ruleForm.birthDate = this.formatterTime(val);
+      }
+    },
+    formatterTime(val) {
+      let date = new Date(val);
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      month = this.formatterMon(month);
+      let day = date.getDate();
+      day = this.formatterMon(day);
+      return year + "-" + month + "-" + day;
+    },
+    formatterMon(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val;
+      }
+    },
+    open(val) {
+      this.dialogVisible = true;
+      this.isView = val;
+
+      this.$nextTick(() => {
+        this.$refs["ruleForm"].clearValidate();
+      });
+    },
+    edit(val) {
+      this.dialogVisible = true;
+      this.isView = false;
+      this.ruleForm.id = val.id;
+      this.ruleForm.channelId = val.channelId;
+      this.ruleForm.avatar = val.avatar;
+      this.ruleForm.name = val.name;
+      this.ruleForm.description = val.description;
+      this.ruleForm.phone = val.phone;
+      this.ruleForm.mail = val.mail;
+      this.ruleForm.job = val.job;
+      this.ruleForm.state = val.state;
+      this.ruleForm.isDelete = val.isDelete;
+    },
+    cancle() {
+      //清空表单
+      //   id: "",
+      //     channelId:'',
+      //     //头像
+      //     avatar: "",
+      //     //员工姓名
+      //     name: "",
+      //     //描述
+      //     description: "",
+      //     //岗位
+      //     job: "",
+      //     //邮箱
+      //     mail: "",
+      //     //手机号
+      //     phone: "",
+      //     //状态
+      //     state: "",
+      this.ruleForm.id = "";
+      // this.ruleForm.channelId='';
+      this.ruleForm.avatar = "";
+      this.ruleForm.name = "";
+      this.ruleForm.description = "";
+      this.ruleForm.job = "";
+      this.ruleForm.mail = "";
+      this.ruleForm.phone = "";
+      this.ruleForm.state = "";
+      this.ruleForm.isDelete = "";
+      this.$refs["ruleForm"].clearValidate();
+      this.dialogVisible = false;
+    },
+    submitCom() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          //判断是编辑还是新增
+          if (this.isView) {
+            this.register();
+          } else {
+            this.editUserFun();
+          }
+
+          //都校验通过后可以触发注册接口了
+          //调用方法进行入参
+        }
+      });
+    },
+    register() {
+      let that = this;
+      this.$http.post(
+        `/staff/save`,
+        {
+          avatar: this.ruleForm.avatar,
+          name: this.ruleForm.name,
+          description: this.ruleForm.description,
+          job: this.ruleForm.job,
+          mail: this.ruleForm.mail,
+          phone: this.ruleForm.phone,
+          state: this.ruleForm.state,
+          channelId: this.ruleForm.channelId,
+          isDelete: this.ruleForm.isDelete,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            this.$message.success(res.msg);
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+    editUserFun() {
+      let that = this;
+      this.$http.post(
+        `/staff/save`,
+        {
+          ...this.ruleForm,
+          // ...this.ruleForm, //解构对象
+        },
+        (res) => {
+          this.disableFlag = false;
+          if (res && res.code == 200) {
+            this.dialogVisible = false;
+            // this.$toast.success({ message: "成功" });
+            //调用父组件的查询方法
+            that.$emit("search");
+            this.$message.success("修改成功");
+          } else {
+            // this.$toast.fail({ message: res.msg });
+            this.$message.error(res.msg);
+          }
+          //清空缓存
+          this.cancle();
+        }
+      );
+    },
+  },
+};
+</script>
+<style scoped>
+.inputCom {
+  width: 200px;
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+  border: 1px solid;
+}
+
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+</style>

+ 1 - 2
src/main.js

@@ -10,9 +10,8 @@ import http from "@/utils/http";
 import ElementUI from 'element-ui';
 import * as echarts from "echarts"
 Vue.prototype.$echarts = echarts
-
+ElementUI.Dialog.props.lockScroll.default = false;
 Vue.use(ElementUI);
-
 Vue.prototype.$http = http;
 Vue.prototype.bus=new Vue();
 

+ 38 - 0
src/router/router.js

@@ -27,6 +27,44 @@ export const routerList = [
                 name: "userManage",
                 component: () => import('../views/manage/userManage'),
             },
+            {
+                path: "roleManage",
+                name: "roleManage",
+                component: () => import('../views/manage/roleManage'),
+            },
+            //渠道信息、、签约详情
+            {
+                path: "channelInfo",
+                name: "channelInfo",
+                component: () => import('../views/manage/channelInfo/channelInfo'),
+            },
+             //渠道信息、、订单结算
+             {
+                path: "orderSettlement",
+                name: "orderSettlement",
+                component: () => import('../views/manage/channelInfo/orderSettlement'),
+            },
+            //渠道管理 、、渠道信息
+            {
+                path: "channelManagement",
+                name: "channelManagement",
+                component: () => import('../views/manage/channelManagement/channelManagement'),
+            },
+            {
+                path: "contract",
+                name: "contract",
+                component: () => import('../views/manage/channelManagement/contract'),
+            },
+            
+            //员工管理
+            {
+                path: "staff",
+                name: "staff",
+                component: () => import('../views/manage/channelManagement/staff'),
+            },
+
+
+
             {
                 path: "agencyUserManage",
                 name: "agencyUserManage",

+ 187 - 53
src/utils/http.js

@@ -1,7 +1,7 @@
-import axios from 'axios';
+import axios from "axios";
 // import { Toast } from 'vant';
-import { Message } from 'element-ui';
-import { Decrypt, Encrypt } from './utils';
+import { Message } from "element-ui";
+import { Decrypt, Encrypt } from "./utils";
 import { oSessionStorage } from "./utils";
 import { router } from "@/router";
 
@@ -14,24 +14,53 @@ import { router } from "@/router";
 // axios.defaults.baseURL = 'https://gengnao.cn:8070/';
 // axios.defaults.baseURL = 'http://152.136.24.101:8071';
 // axios.defaults.baseURL = 'https://81.70.207.4:8070';
-axios.defaults.baseURL = 'https://child.hhnao.com:8070';
+// axios.defaults.baseURL = 'https://child.hhnao.com:8070';
+// axios.defaults.baseURL = 'https://child.hhnao.com:8070';
+// export const basePath='http://10.113.248.3:8086'
+export const basePath='http://43.143.198.30:8086'
+axios.defaults.baseURL = basePath;
+// axios.defaults.baseURL = "http://43.143.198.30:8086";
+
 //设置端口
 // var urlCode ='http://152.136.24.101:8997';
 // var urlCode ='http://43.143.198.30:8085';
-var urlCode ='https://child.hhnao.com';
+// var urlCode ='https://child.hhnao.com';
+var urlCode = "";
+
+//接口白名单 
+var whiteList=[
+  '/user/blogin','/user/getCode'
+]
 
 // axios.defaults.baseURL = 'http://cognitive.wistcm.com:8060/';
 // axios.defaults.baseURL = process.env.VUE_APP_BASE_URL;
 
-sessionStorage.setItem('codeImage',urlCode);
+sessionStorage.setItem("codeImage", urlCode);
 
 axios.defaults.timeout = 30000; // 超时时间
-axios.defaults.headers.common['Content-Type'] = 'application/JSON;charset=UTF-8';
+axios.defaults.headers.common["Content-Type"] =
+  "application/JSON;charset=UTF-8";
 axios.defaults.withCredentials = true;
 // let loadingInstance
 
+axios.interceptors.request.use(
+  function (config) {
+    for(let i=0;i<whiteList.length;i++){
+      if(whiteList[i]!==config.url){
+        ////不在白名单内,需要判断用户是否在,不在的话存储到登录页
+        
+        if(oSessionStorage.getItem("userInfo")==''){
+          router.replace({
+            path: "/",
+            // query: {redirect: router.currentRoute.fullPath}
+          });
+        }
+        //在此判断需要  判断用户缓存是否存在
+          // break
+      }
+    }
+    //发送请求前判断token是存在
 
-axios.interceptors.request.use(function (config) {
     // 在发送请求之前做些什么
     // loadingInstance = Loading.service({
     //     lock: true,
@@ -48,70 +77,175 @@ axios.interceptors.request.use(function (config) {
     //         config.headers.Authorization = `Bearer ${sessionStorage.getItem(`${userId}token`)}`;
     //     }
     // }
-
-    config.headers.Authorization = oSessionStorage.getItem("token") ? `Bearer ${oSessionStorage.getItem('token')}` : '';
+    config.headers.Authorization = oSessionStorage.getItem("token")
+      ? `Bearer ${oSessionStorage.getItem("token")}`
+      : "";
 
     return config;
-}, function (error) {
+  },
+  function (error) {
     // 对请求错误做些什么
     return Promise.reject(error);
-});
+  }
+);
 
 // 添加响应拦截器
-axios.interceptors.response.use(function (response) {
+axios.interceptors.response.use(
+  function (response) {
     // 对响应数据做点什么
     // loadingInstance.close();
     //返回code若为401,则表示token有问题
     if (response.data.code === 401) {
-        // 重定向到登录页
-        router.replace({
-            path: '/',
-            // query: {redirect: router.currentRoute.fullPath}
-        });
-        // Toast.fail(response.data.msg);
-        Message.error(response.data.msg);
+      // 重定向到登录页
+      router.replace({
+        path: "/",
+        // query: {redirect: router.currentRoute.fullPath}
+      });
+      // Toast.fail(response.data.msg);
+      Message.error(response.data.msg);
     }
 
     return response;
-}, function (error) {
+  },
+  function (error) {
     // 对响应错误做点什么
     // loadingInstance.close();
     return Promise.reject(error);
-});
+  }
+);
 
 const http = {
-    get: (url, data, sCallBack) => {
-        if (data) {
-            data = Encrypt(JSON.stringify(data));
+  get: (url, data, sCallBack) => {
+    if (data) {
+      data = Encrypt(JSON.stringify(data));
+    }
+    axios.get(url, { params: data }).then((res) => {
+      res.data = JSON.parse(Decrypt(res.data));
+      if (sCallBack) {
+        sCallBack(res.data);
+      }
+    });
+  },
+  getImg: (url, data, sCallBack) => {
+    if (data) {
+      data = Encrypt(JSON.stringify(data));
+    }
+    axios({
+      method: "get",
+      url: url,
+      responseType: "blob",
+      params: data,
+      headers: {
+        Accept: "application/octet-stream",
+      //  "Content-Disposition":"attachment"
+      },
+    },{responseType:"arraybuffer"}).then((res) => {
+      sCallBack(res);
+    });
+  },
+  getDown: (url, data, sCallBack) => {
+    if (data) {
+      data = Encrypt(JSON.stringify(data));
+    }
+    axios({
+      method: "get",
+      url: url,
+      responseType: "blob",
+      params: data,
+      headers: {
+        // Accept: "application/octet-stream",
+        "Content-Disposition": "attachment" 
+      },
+    }).then((res) => {
+      sCallBack(res);
+    });
+  },
+  post: (url, data, sucessCallBack, errCallBack) => {
+    if (data) {
+      data = Encrypt(JSON.stringify(data));
+    }
+    axios.post(url, { data: data }).then((res) => {
+      // res.status
+      if (res) {
+        res.data = JSON.parse(Decrypt(res.data));
+      }
+
+      if (res.status >= 200 && res.status < 300) {
+        if (sucessCallBack) {
+          sucessCallBack(res.data);
         }
-        axios.get(url, { params: data }).then(res => {
-            res.data = JSON.parse(Decrypt(res.data));
-            if (sCallBack) {
-                sCallBack(res.data);
-            }
-        })
-    },
-    post: (url, data, sucessCallBack, errCallBack) => {
-        if (data) {
-            data = Encrypt(JSON.stringify(data));
+      } else if (res.status === 401) {
+        //token过期了
+      } else {
+        if (errCallBack) {
+          errCallBack(res.data);
+        } else {
+          // Toast(res.data.msg);
+          Message.error(res.data.msg);
         }
-        axios.post(url, { data: data }).then(res => {
-            if (res) {
-                res.data = JSON.parse(Decrypt(res.data));
-            }
-            if (res.data.code == 200) {
-                if (sucessCallBack) {
-                    sucessCallBack(res.data);
-                }
-            } else {
-                if (errCallBack) {
-                    errCallBack(res.data);
-                } else {
-                    // Toast(res.data.msg);
-                    Message.error(res.data.msg);
-                }
-            }
-        })
+      }
+
+      // if (res.data.code == 200) {
+      //     if (sucessCallBack) {
+      //         sucessCallBack(res.data);
+      //     }
+      // } else if(res.data.code == 2001){
+      //     if (sucessCallBack) {
+      //         sucessCallBack(res.data);
+      //     }
+      // }else {
+      //     if (errCallBack) {
+      //         errCallBack(res.data);
+      //     } else {
+      //         // Toast(res.data.msg);
+      //         Message.error(res.data.msg);
+      //     }
+      // }
+    });
+  },
+  delete: (url, data, sucessCallBack, errCallBack) => {
+    if (data) {
+      data = Encrypt(JSON.stringify(data));
     }
-}
+    axios.delete(url, { data: data }).then((res) => {
+      // res.status
+      if (res) {
+        res.data = JSON.parse(Decrypt(res.data));
+      }
+
+      if (res.status >= 200 && res.status < 300) {
+        if (sucessCallBack) {
+          sucessCallBack(res.data);
+        }
+      } else if (res.status === 401) {
+        //token过期了
+      } else {
+        if (errCallBack) {
+          errCallBack(res.data);
+        } else {
+          // Toast(res.data.msg);
+          Message.error(res.data.msg);
+        }
+      }
+
+      // if (res.data.code == 200) {
+      //     if (sucessCallBack) {
+      //         sucessCallBack(res.data);
+      //     }
+      // } else if(res.data.code == 2001){
+      //     if (sucessCallBack) {
+      //         sucessCallBack(res.data);
+      //     }
+      // }else {
+      //     if (errCallBack) {
+      //         errCallBack(res.data);
+      //     } else {
+      //         // Toast(res.data.msg);
+      //         Message.error(res.data.msg);
+      //     }
+      // }
+    });
+  },
+};
+
 export default http;

+ 2 - 2
src/utils/utils.js

@@ -1,8 +1,8 @@
 import { Toast } from 'vant';
 const CryptoJS = require('crypto-js');  //引用AES源码js
 
-const key = CryptoJS.enc.Utf8.parse("Sp5biS+gX+#CqAFF");  //十六位十六进制数作为密钥
-const iv = CryptoJS.enc.Utf8.parse('ud2E8l6wchltwIDA');   //十六位十六进制数作为密钥偏移量
+const key = CryptoJS.enc.Utf8.parse("4-[nyNW8rO0zT#Wx");  //十六位十六进制数作为密钥
+const iv = CryptoJS.enc.Utf8.parse('U8noy&QjEQ[ffjWm');   //十六位十六进制数作为密钥偏移量
 
 //解密方法
 const Decrypt = function (word) {

+ 156 - 58
src/views/loginNew.vue

@@ -1,52 +1,89 @@
 <template>
   <div class="login-wrapper-new">
     <div class="login-left-bg">
+      <div></div>
       <!--      <img src="../assets/img/login/login_bg.png" alt=""/>-->
     </div>
     <div class="login-left-new">
-      <p class="login-title-p">登录锦泓税务报告</p>
-      <!-- <img
-        class="login-left-top-new"
-        src="../assets/img/login/login_title.png"
-      /> -->
+      <!-- <p class="login-title-p">登录锦泓税务报告</p> -->
+      <img class="login-left-top-new" src="../assets/img/login/login_title.png" />
       <el-form
         class="login-left-middle-new"
         :model="ruleForm"
         :rules="rules"
         ref="ruleForm"
         :label-position="'left'"
-        label-width="60px"
+        label-width="10px"
         size="mini"
       >
-        <el-form-item label="账号" prop="account" class="account-new">
-          <div class="login-label" slot="label">
-            账&nbsp;&nbsp;&nbsp;&nbsp;号:
-          </div>
+        <el-form-item label="" prop="account" class="account-new">
           <el-input
             class="input-account-new"
             type="text"
             v-model="ruleForm.account"
             placeholder="请输入账号"
             autocomplete="off"
-          ></el-input>
+          >
+            <template slot="prefix">
+            <div class="account-inner">
+                 <img
+                  style="height: 20px;margin-left:10px"
+                  src="../assets/img/login/persion.png" />
+                  <div class="account-inner-line">
+                  </div>
+            </div>
+            </template>
+          </el-input>
+          <!-- <img src="../assets/img/login/persion.png" /> -->
         </el-form-item>
-        <el-form-item label="密码" class="account-two-new" prop="pass">
-          <div class="login-label" slot="label">
-            密&nbsp;&nbsp;&nbsp;&nbsp;码:
-          </div>
+        <el-form-item label="" class="account-two-new" prop="pass">
           <el-input
             class="input-password-new"
             type="password"
             placeholder="请输入密码"
             v-model="ruleForm.pass"
             autocomplete="off"
-          ></el-input>
+          >
+          <template slot="prefix">
+            <div class="account-inner">
+                 <img
+                  style="height: 20px;margin-left:10px"
+                  src="../assets/img/login/password.png" />
+                  <div class="account-inner-line">
+                  </div>
+            </div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="" class="account-two-new" prop="imgText">
+          <el-input
+            class="input-password-new"
+            type="text"
+            placeholder="请输入验证码"
+            v-model="ruleForm.imgText"
+            autocomplete="off"
+          >
+          <template slot="prefix">
+            <div class="account-inner">
+                 <img
+                  style="height: 20px;margin-left:10px"
+                  src="../assets/img/login/password.png" />
+                  <div class="account-inner-line">
+                  </div>
+            </div>
+            </template>
+            <template  slot="suffix"> <el-image
+             
+              class="code-class"
+              style="height: 100%"
+              :src="imageUrl"
+              @click="getCode()"
+            ></el-image
+          ></template>
+           </el-input>
         </el-form-item>
         <el-form-item class="button-new-parent">
-          <el-button
-            class="button-new"
-            type="primary"
-            @click="submitForm('ruleForm')"
+          <el-button class="button-new" type="primary" @click="submitForm('ruleForm')"
             >登&nbsp;录</el-button
           >
           <!-- <el-button @click="resetForm('ruleForm')">重置</el-button> -->
@@ -78,7 +115,7 @@
       </div>
     </div> -->
 
-     <!-- <div class="beian">
+    <!-- <div class="beian">
       <div style='display:flex'>
         <div >
           <a class='beianDetail'
@@ -146,52 +183,84 @@ export default {
         callback();
       }
     };
+    var validateImgText = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入验证码"));
+      } else {
+        // if (this.ruleForm.type !== '') {
+        //   this.$refs.ruleForm.validateField('type');
+        // }
+        callback();
+      }
+    };
     return {
+      input1: "",
+      imageUrl: "",
       ruleForm: {
         account: "",
         pass: "",
         type: "0",
+        imgText: "",
       },
       rules: {
         account: [{ validator: validateAccount, trigger: "blur" }],
         pass: [{ validator: validatePass, trigger: "blur" }],
         type: [{ validator: validateType, trigger: "change" }],
+        imgText: [{ validator: validateImgText, trigger: "blur" }],
       },
     };
   },
+  mounted() {
+    this.getCode();
+  },
   methods: {
+    getCode() {
+      this.$http.getImg(`/user/getCode`, {}, (res) => {
+        let blob = new Blob([res.data], { type: "image/jpeg" });
+        this.imageUrl = window.URL.createObjectURL(blob);
+      });
+    },
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.$http.post(
-            "/v1/system/login",
+            `/user/blogin`,
+            //"/v1/system/login",
             {
-              phone: this.ruleForm.account,
+              name: this.ruleForm.account,
               password: md5(this.ruleForm.pass),
-              authCode: this.authCode,
-              type: 0,
+              imgText: this.ruleForm.imgText,
+              // type: 0,
             },
             (res) => {
               console.log(res, "登录返回");
               if (res && res.code == 200) {
-                oSessionStorage.setItem(
-                  "userInfo",
-                  JSON.stringify(res.data.user)
-                );
-
+                oSessionStorage.setItem("userInfo", JSON.stringify(res.data.user));
                 oSessionStorage.setItem("token", res.data.token);
                 // oSessionStorage.setItem("invitationCode", res.data.user.invitationCode);
-                // debugger;
                 //如果类型返回的是0则为普通用户
                 //如果类型返回的是1则为管理员用户
-
-                if (res.data.user.roleType === "0") {
-                  this.$message.warning("账号密码错误");
-                  // this.$router.push({ path: "/home" });
-                  // this.$router.push({ path: "/manageMain" });
+                // this.$router.push({ path: "/manage/adminHome" });
+                if (res.data.user.type == "1") {
+                  this.$router.push({ path: "/manage/userManage" });
                 } else {
-                  this.$router.push({ path: "/manage/adminHome" });
+                  this.$router.push({ path: "/manage/channelInfo" });
                 }
+
+                // if (res.data.user.roleType === "0") {
+                //   this.$message.warning("账号密码错误");
+                //   // this.$router.push({ path: "/home" });
+                //   // this.$router.push({ path: "/manageMain" });
+                // } else {
+                //   this.$router.push({ path: "/manage/adminHome" });
+                // }
+              } else if (res && res.code == 2001) {
+                //调用刷新的方法
+                this.getCode();
+                this.$message({
+                  message: res.msg,
+                  type: "error",
+                });
               } else {
                 this.$message({
                   message: res.msg,
@@ -214,22 +283,26 @@ export default {
 </script>
 <style scoped>
 .input-account-new >>> .el-input__inner {
-  background-color: transparent !important;
+  background-color: #ffffff !important;
   background-image: none;
   border-radius: 30px;
   border: 0px solid #dcdfe6;
   box-sizing: border-box;
+
   /*color: #fff;*/
   color: #000;
   display: inline-block;
-  height: 40px;
-  line-height: 40px;
+  height: 45px;
+  line-height: 45px;
   outline: 0;
-  padding: 0 15px;
+  padding-left: 60px;
   -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
   transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
   width: 100%;
 }
+.account-new >>> .el-input {
+  display: table !important;
+}
 
 .input-account-new >>> .el-input__inner::placeholder {
   /*color: #f9f9f9;*/
@@ -240,7 +313,7 @@ export default {
   color: #9a9a9a;
 }
 .input-password-new >>> .el-input__inner {
-  background-color: transparent !important;
+  background-color: #ffffff !important;
   background-image: none;
   border-radius: 30px;
   border: 0px solid #dcdfe6;
@@ -248,17 +321,18 @@ export default {
   /*color: #fff;*/
   color: #000;
   display: inline-block;
-  height: 40px;
-  line-height: 40px;
+  height: 45px;
+  line-height: 45px;
   outline: 0;
-  padding: 0 15px;
+  padding-left: 60px;
   -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
   transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
   width: 100%;
 }
 .button-new-parent >>> .el-form-item__content {
-  width: 100%;
-  margin-left: 0px !important;
+  width: 100px;
+  /* margin-left: 0px !important; */
+  text-align: center;
 }
 </style>
 
@@ -275,7 +349,9 @@ export default {
   //background: url(../assets/img/login/59.png) no-repeat center;
   //background-size: 100% 100%;
   background: url("../assets/img/login/login_bg.png") no-repeat left;
-  background-size: calc(70% + 16px) 100%;
+
+  background-size: 100% 100%;
+  //  background-size: calc(70% + 16px) 100%;
   // height: 100vh;
   // padding-top:0%;
   display: flex;
@@ -283,7 +359,7 @@ export default {
   justify-content: space-between;
   align-items: center;
   .login-left-bg {
-    width: 70%;
+    width: 60%;
     height: 100%;
     img {
       width: 100%;
@@ -294,13 +370,14 @@ export default {
     width: 30%;
     height: 100%;
     box-sizing: border-box;
-    padding-top: 10%;
+    padding-top: 3%;
     //display: inline-block;
     //margin-top: 14%;
     // margin-top:10px;
     //margin-left: 70%;
     //background-color: #89ccd8;
-    background-color: #fff;
+    background-color: transparent;
+    margin-right: 4%;
 
     // width: 459px;
     // max-width:459px;
@@ -328,7 +405,7 @@ export default {
           display: inline-block;
           margin-top: 8px;
           //color: #fff;
-          color: #0263c4;
+
           font-size: 16px;
           font-weight: bold;
         }
@@ -343,6 +420,7 @@ export default {
       }
       .account-two-new {
         color: #fff;
+
         margin-bottom: 10%;
         .login-label {
           display: inline-block;
@@ -362,21 +440,24 @@ export default {
         }
       }
       .button-new-parent {
+        display: flex;
+        justify-content: center;
         width: 100%;
         .button-new {
           //background: #ffffff;
-          background: #0576e6;
+          background: #B3E9FF;
           border-radius: 30px 30px 30px 30px;
           opacity: 1;
-          border: 1px solid #ffffff;
+          // border: 1px solid #ffffff;
           width: 100%;
           margin-left: 0px;
           height: 44px;
           //color: #25a3b7;
-          color: #fff;
+          color: #1D53EA;
           font-size: 18px;
           margin-top: 40px;
           margin-bottom: 40px;
+          font-weight: 700;
         }
       }
     }
@@ -724,14 +805,31 @@ export default {
   font-size: 15px;
   z-index: 1000;
 }
-.beianDetail{
+.beianDetail {
   display: flex;
   justify-items: center;
   align-items: center;
 }
-.login-title-p{
+.login-title-p {
   text-align: center;
   font-size: 20px;
-  margin-bottom:40px;
+  margin-bottom: 40px;
+}
+.code-class {
+  height: 100%;
+  border-radius: 20px;
+}
+.account-inner{
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  height: 50px;
+}
+.account-inner-line{
+  width: 1px;
+  background-color: #B5C8FF;
+  height: 30px;
+  margin-left: 10px;
 }
 </style>

+ 593 - 0
src/views/manage/channelInfo/channelInfo.vue

@@ -0,0 +1,593 @@
+<template>
+  <div class="record-warp">
+    <div class="record-main">
+      <!-- <el-row>
+        <el-col :span="24">
+          <div class="search-head">
+            <span>渠道:</span>
+            <el-select v-model="channel" placeholder="请选择渠道">
+              <el-option
+                :label="item.name"
+                :value="item.id"
+                v-for="item in channelList"
+                :key="item.id"
+              ></el-option> </el-select
+            >&nbsp;&nbsp;&nbsp;&nbsp;
+            <el-button type="primary" icon="el-icon-search" @click="searchTarget"
+              >搜索</el-button
+            >
+            <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch"
+              >清空</el-button
+            >
+          </div>
+        </el-col>
+      </el-row> -->
+      <!-- <el-row class="add_user_class">
+        <el-col :span="24">
+          <div class="search-head">
+            <el-button type="primary" icon="el-icon-plus" @click="addUser"
+              >新增</el-button
+            >
+          </div>
+        </el-col>
+      </el-row> -->
+
+      <div class="table-content">
+        <el-table
+          :data="tableData"
+          :row-style="{ height: '0px' }"
+          :cell-style="{ padding: '5px' }"
+        >
+          <!-- <el-table-column prop="channelName" label="渠道" align="center" width="">
+          </el-table-column> -->
+          <el-table-column prop="used" label="已使用次数" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="singlePrice" label="单次价格" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="rechargeUsed"
+            label="充值使用次数"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column prop="unuse" label="剩余次数" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="rechargeCount"
+            label="累计充值次数"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column prop="signAmount" label="签约单次金额" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="effectiveDate"
+            label="有效时间起"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column
+            prop="expirationDate"
+            label="有效时间止"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+
+          <el-table-column
+            prop="status"
+            label="状态"
+            align="center"
+            :formatter="formatterStatus"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column prop="remarks" label="备注" align="center" width="">
+        </el-table-column>
+          <!-- <el-table-column
+            prop="selfPage"
+            label="自定义首尾页"
+            align="center"
+            :formatter="formatterSelfPage"
+            width=""
+          >
+          </el-table-column> -->
+          <!-- <el-table-column prop="isDelete" label="删除状态" align="center" :formatter="formatterDelete" width="">
+                      </el-table-column> -->
+          <el-table-column label="操作" width="200px" align="center" fixed="right">
+            <template slot-scope="scope">
+              <el-button
+                @click="viewUser(scope.row)"
+                v-if="scope.row.state != 0"
+                type="text"
+                size="small"
+                >查看</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="editUser(scope.row)"
+                >编辑</el-button
+              >
+
+              <!-- <el-popconfirm
+                v-if="scope.row.state != 0"
+                title="确定删除吗?"
+                placement="top"
+                @confirm="deleteChannel(scope.$index, scope.row)"
+              >
+                <el-button
+                  size="small"
+                  style="margin-left: 10px"
+                  type="text"
+                  slot="reference"
+                  >删除</el-button
+                >
+              </el-popconfirm> -->
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="viewPoster(scope.row)"
+                >查看海报</el-button
+              >
+              <!-- <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="topUpCount(scope.row)"
+                >充值次数</el-button
+              > -->
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <el-pagination
+        small
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="pageNum"
+        layout="total, prev, pager, next"
+        :page-size="pageSize"
+        :total="total"
+      >
+      </el-pagination>
+      <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
+          </el-pagination> -->
+    </div>
+    <ContractChannelRegister ref="register" @search="searchTarget" />
+    <ContractPoster ref="poster" @search="searchTarget" />
+    <ContractTopUp ref="topUp" @search="searchTarget" />
+
+    <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
+      <div>
+        <el-row>
+
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">已使用次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.used }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">单次价格</div>
+              <div class="user_out_subNext">
+                {{ detailObj.singlePrice }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">充值使用次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.rechargeUsed }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">剩余次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.unuse }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">累计充值次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.rechargeCount }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">签约单次金额</div>
+              <div class="user_out_subNext">
+                {{ detailObj.signAmount }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">有效时间起</div>
+              <div class="user_out_subNext">
+                {{ detailObj.effectiveDate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">有效时间止</div>
+              <div class="user_out_subNext">
+                {{ detailObj.expirationDate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">状态</div>
+              <div class="user_out_subNext">
+                {{ detailObj.status == "1" ? "签约" : "解约" }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">备注</div>
+              <div class="user_out_subNext">
+                {{ detailObj.remarks }}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">海报背景图</div>
+              <div class="user_out_subNext">
+                <el-image
+                  :src="detailObj.background"
+                  style="width: 150px; height: 150px"
+                />
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { oSessionStorage } from "../../../utils/utils";
+import contractChannelRegister from "../../../components/ContractChannelRegister.vue";
+
+import contractPoster from "../../../components/ContractPoster.vue";
+import contractTopUp from "../../../components/ContractTopUp.vue";
+export default {
+  name: "channelManagement",
+  components: {
+    ContractChannelRegister: contractChannelRegister,
+    ContractPoster: contractPoster,
+  },
+  data() {
+    return {
+      centerDialogVisible: false,
+      editUserFlag: false,
+      startTime: "",
+      endTime: "",
+      value1: null,
+      total: 0,
+      pageSize: 10,
+      pageNum: 1,
+      keyword: "",
+      tableData: [],
+      userInfo: {}, //用户信息
+      userId: "", //用户id
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
+      hospitalOrDepartment: "", //医院科室
+
+      invitationCode: "",
+      roleType: "0",
+      type: 0,
+      view: {
+        name: "",
+        userName: "",
+        channelId: "",
+        role: "",
+      },
+      detailObj: {},
+      channel: "",
+      channelList: [{ name: "渠道天成", id: "1" }],
+    };
+  },
+  created() {},
+  mounted() {
+    this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    console.log(this.userInfo);
+
+    if (this.userInfo.type == "1") {
+      this.channel = "";
+    } else if (this.userInfo.type == "0") {
+      this.channel = this.userInfo.channelId;
+    }
+    this.invitationCode = this.userInfo.invitationCode;
+    this.getChannel();
+    //判断是超级管理员吗
+    if (this.userInfo.roleType == "1") {
+      this.type = 0;
+    } else if (this.userInfo.roleType == "3") {
+      //如果登录的是代理用户
+      this.type = 4;
+    } else if (this.userInfo.roleType == "2") {
+      this.type = 5;
+    }
+
+    if (this.$route.query.invitationCode) {
+      this.invitationCode = this.$route.query.invitationCode;
+      this.type = this.$route.query.type;
+    }
+    if (!this.userInfo) {
+      //如果用户信息不存在跳转登陆页
+      this.$router.push({ path: "/" });
+    }
+    this.searchTarget();
+  },
+  methods: {
+    //充值次数
+    topUpCount(row) {
+      // console.log(this.$refs.topUp)
+      this.$refs.topUp.open(row.id);
+    },
+    //查看海报
+    viewPoster(row) {
+      this.$refs.poster.open(row);
+    },
+    //格式化自定义首尾页
+    formatterSelfPage(row) {
+      if (row.selfPage == "0") {
+        return "否";
+      } else {
+        return "是";
+      }
+    },
+    //获取渠道信息
+    getChannel() {
+      this.$http.get(`/channel/findAll`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          //将值赋值给list
+          this.channelList = res.data;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    //员工管理
+    userManage(row) {
+      this.$router.push({ path: "/manage/staff", query: { channelId: row.id } });
+    },
+    //格式化状态
+    formatterStatus(row) {
+      if (row.status == "1") {
+        return "签约";
+      } else if (row.status == "0") {
+        return "解约";
+      } else {
+        return "";
+      }
+    },
+    formatterDelete(row) {
+      if (row.isDelete == 0) {
+        return "正常";
+      } else {
+        return "已删除";
+      }
+    },
+    resetUser(index, val) {
+      console.log(val);
+      this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("重置成功");
+          this.searchTarget();
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+      //重置密码
+    },
+    editUser(row) {
+      this.editRegisterUser(row);
+    },
+    viewUser(row) {
+      this.detailObj = row;
+      this.centerDialogVisible = true;
+    },
+    addUser() {
+      this.addRegisterUser(true);
+    },
+    clearSearch() {
+      this.channel = "";
+      this.searchTarget();
+    },
+    formatterRole(val) {
+      if (val.type == "1") {
+        return "超级管理员";
+      } else {
+        return "渠道用户";
+      }
+    },
+
+    forma(val) {
+      if (val.gender == "0") {
+        return "男";
+      } else {
+        return "女";
+      }
+    },
+    addRegisterUser(val) {
+      this.$refs.register.open(val);
+    },
+    editRegisterUser(val) {
+      this.$refs.register.edit(val);
+    },
+    deleteChannel(index, row) {
+      this.$http.delete(`/sign/delete/${row.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("删除成功");
+          this.searchTarget();
+        } else {
+          this.$message.error("删除失败");
+        }
+      });
+    },
+
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.searchList();
+    },
+    //根据现有情况进行搜索
+    searchList() {
+      //  let url =``
+      let data = {};
+      if (this.channel == "" || this.channel == null) {
+        data = {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+        };
+      } else {
+        data = {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+          channelId: this.channel,
+        };
+      }
+      this.$http.post(`/sign/find`, data, (res) => {
+        // console.log(res,'用户测试记录')
+        if (res && res.code == 200) {
+          this.tableData = res.data.content;
+          this.total = res.data.totalElements;
+        } else {
+          // this.$toast.fail(res.msg);
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    searchTarget() {
+      this.pageNum = 1;
+      this.searchList();
+    },
+    //跳转首页
+    goHome() {
+      this.$router.push({ path: "/home" });
+    },
+    //跳转记录页
+    goRecord() {
+      this.$router.push({ path: "/record" });
+    },
+    //退出登陆
+    logout() {
+      oSessionStorage.removeItem("userInfo");
+      oSessionStorage.removeItem("token");
+      this.$router.push({ path: "/" });
+    },
+    //点击日历获取日期
+    getDate(param) {
+      // console.log(param,"日期。。。")
+      this.userRecord(param.dateStr);
+    },
+    //点击获取月出勤次数
+    getTimes(param) {
+      this.monthTimes = param;
+    },
+    // 用户测试记录显示
+    userRecord(date) {
+      this.$http.get(
+        `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
+        {},
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.listData = res.data;
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../../styles/theme.less";
+
+.record-warp {
+  width: 100%;
+  height: 80vh;
+  //background: url(../../assets/img/index/19.png) no-repeat center;
+  //background-size: 100% 100%;
+  position: relative;
+
+  .record-main {
+    width: 100%;
+    height: 100%;
+    box-sizing: border-box;
+    overflow-y: auto;
+
+    .search-head {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .zc-title {
+        color: #606266;
+        font-size: 14px;
+      }
+    }
+
+    .table-content {
+      margin: 10px 0;
+    }
+  }
+}
+
+.add_user_class {
+  margin-top: 10px;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3;
+}
+</style>

+ 583 - 0
src/views/manage/channelInfo/orderSettlement.vue

@@ -0,0 +1,583 @@
+<template>
+  <div class="record-warp">
+    <div class="record-main">
+      <!-- <el-row>
+          <el-col :span="24">
+            <div class="search-head">
+              <span>渠道:</span>
+              <el-select v-model="channel" placeholder="请选择渠道">
+                <el-option
+                  :label="item.name"
+                  :value="item.id"
+                  v-for="item in channelList"
+                  :key="item.id"
+                ></el-option> </el-select
+              >&nbsp;&nbsp;&nbsp;&nbsp;
+              <el-button type="primary" icon="el-icon-search" @click="searchTarget"
+                >搜索</el-button
+              >
+              <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch"
+                >清空</el-button
+              >
+            </div>
+          </el-col>
+        </el-row> -->
+      <!-- <el-row class="add_user_class">
+          <el-col :span="24">
+            <div class="search-head">
+              <el-button type="primary" icon="el-icon-plus" @click="addUser"
+                >新增</el-button
+              >
+            </div>
+          </el-col>
+        </el-row> -->
+
+      <div class="table-content">
+        <el-table
+          :data="tableData"
+          :row-style="{ height: '0px' }"
+          :cell-style="{ padding: '5px' }"
+        >
+          <el-table-column prop="channelId" label="渠道Id" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="title" label="标题" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="amount"
+            label="金额"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column prop="status" label="状态" align="center" width="" :formatter="formatterOrder">
+          </el-table-column>
+          <!-- <el-table-column
+            prop="rechargeCount"
+            label="累计充值次数"
+            align="center"
+            width=""
+          >
+          </el-table-column> -->
+          <el-table-column prop="effectiveDate" label="类型" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="expirationDate"
+            label="订单日期起"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column
+            prop="expirationDate"
+            label="订单日期止"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+
+          <el-table-column
+            prop="createDate"
+            label="创建时间"
+            align="center"
+            width=""
+          >
+          </el-table-column>
+
+          <!-- <el-table-column
+            prop="status"
+            label="状态"
+            align="center"
+            :formatter="formatterStatus"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column prop="remarks" label="备注" align="center" width="">
+          </el-table-column> -->
+          <!-- <el-table-column
+              prop="selfPage"
+              label="自定义首尾页"
+              align="center"
+              :formatter="formatterSelfPage"
+              width=""
+            >
+            </el-table-column> -->
+          <!-- <el-table-column prop="isDelete" label="删除状态" align="center" :formatter="formatterDelete" width="">
+                        </el-table-column> -->
+          <!-- <el-table-column label="操作" width="200px" align="center" fixed="right">
+            <template slot-scope="scope">
+              <el-button
+                @click="viewUser(scope.row)"
+                v-if="scope.row.state != 0"
+                type="text"
+                size="small"
+                >查看</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="editUser(scope.row)"
+                >编辑</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="viewPoster(scope.row)"
+                >查看海报</el-button
+              >
+            </template>
+          </el-table-column> -->
+        </el-table>
+      </div>
+
+      <el-pagination
+        small
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="pageNum"
+        layout="total, prev, pager, next"
+        :page-size="pageSize"
+        :total="total"
+      >
+      </el-pagination>
+      <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
+            </el-pagination> -->
+    </div>
+    <ContractChannelRegister ref="register" @search="searchTarget" />
+    <ContractPoster ref="poster" @search="searchTarget" />
+    <ContractTopUp ref="topUp" @search="searchTarget" />
+
+    <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
+      <div>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">已使用次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.used }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">单次价格</div>
+              <div class="user_out_subNext">
+                {{ detailObj.singlePrice }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">充值使用次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.rechargeUsed }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">剩余次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.unuse }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">累计充值次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.rechargeCount }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">签约单次金额</div>
+              <div class="user_out_subNext">
+                {{ detailObj.signAmount }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">有效时间起</div>
+              <div class="user_out_subNext">
+                {{ detailObj.effectiveDate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">有效时间止</div>
+              <div class="user_out_subNext">
+                {{ detailObj.expirationDate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">状态</div>
+              <div class="user_out_subNext">
+                {{ detailObj.status == "1" ? "签约" : "解约" }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">备注</div>
+              <div class="user_out_subNext">
+                {{ detailObj.remarks }}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">海报背景图</div>
+              <div class="user_out_subNext">
+                <el-image
+                  :src="detailObj.background"
+                  style="width: 150px; height: 150px"
+                />
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { oSessionStorage } from "../../../utils/utils";
+import contractChannelRegister from "../../../components/ContractChannelRegister.vue";
+
+import contractPoster from "../../../components/ContractPoster.vue";
+import contractTopUp from "../../../components/ContractTopUp.vue";
+export default {
+  name: "channelManagement",
+  components: {
+    ContractChannelRegister: contractChannelRegister,
+    ContractPoster: contractPoster,
+  },
+  data() {
+    return {
+      centerDialogVisible: false,
+      editUserFlag: false,
+      startTime: "",
+      endTime: "",
+      value1: null,
+      total: 0,
+      pageSize: 10,
+      pageNum: 1,
+      keyword: "",
+      tableData: [],
+      userInfo: {}, //用户信息
+      userId: "", //用户id
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
+      hospitalOrDepartment: "", //医院科室
+
+      invitationCode: "",
+      roleType: "0",
+      type: 0,
+      view: {
+        name: "",
+        userName: "",
+        channelId: "",
+        role: "",
+      },
+      detailObj: {},
+      channel: "",
+      channelList: [{ name: "渠道天成", id: "1" }],
+    };
+  },
+  created() {},
+  mounted() {
+    this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    console.log(this.userInfo);
+
+    if (this.userInfo.type == "1") {
+      this.channel = "";
+    } else if (this.userInfo.type == "0") {
+      this.channel = this.userInfo.channelId;
+    }
+    // this.invitationCode = this.userInfo.invitationCode;
+    this.getChannel();
+    //判断是超级管理员吗
+    // if (this.userInfo.roleType == "1") {
+    //   this.type = 0;
+    // } else if (this.userInfo.roleType == "3") {
+    //   //如果登录的是代理用户
+    //   this.type = 4;
+    // } else if (this.userInfo.roleType == "2") {
+    //   this.type = 5;
+    // }
+
+    // if (this.$route.query.invitationCode) {
+    //   this.invitationCode = this.$route.query.invitationCode;
+    //   this.type = this.$route.query.type;
+    // }
+    if (!this.userInfo) {
+      //如果用户信息不存在跳转登陆页
+      this.$router.push({ path: "/" });
+    }
+    this.searchTarget();
+  },
+  methods: {
+    formatterOrder(row){
+      if(row.status=='1'){
+        return '已结算'
+      }else{
+        return '待结算'
+      }
+    },
+    //充值次数
+    topUpCount(row) {
+      // console.log(this.$refs.topUp)
+      this.$refs.topUp.open(row.id);
+    },
+    //查看海报
+    viewPoster(row) {
+      this.$refs.poster.open(row);
+    },
+    //格式化自定义首尾页
+    formatterSelfPage(row) {
+      if (row.selfPage == "0") {
+        return "否";
+      } else {
+        return "是";
+      }
+    },
+    //获取渠道信息
+    getChannel() {
+      this.$http.get(`/channel/findAll`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          //将值赋值给list
+          this.channelList = res.data;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    //员工管理
+    userManage(row) {
+      this.$router.push({ path: "/manage/staff", query: { channelId: row.id } });
+    },
+    //格式化状态
+    formatterStatus(row) {
+      if (row.status == "1") {
+        return "签约";
+      } else if (row.status == "0") {
+        return "解约";
+      } else {
+        return "";
+      }
+    },
+    formatterDelete(row) {
+      if (row.isDelete == 0) {
+        return "正常";
+      } else {
+        return "已删除";
+      }
+    },
+    resetUser(index, val) {
+      console.log(val);
+      this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("重置成功");
+          this.searchTarget();
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+      //重置密码
+    },
+    editUser(row) {
+      this.editRegisterUser(row);
+    },
+    viewUser(row) {
+      this.detailObj = row;
+      this.centerDialogVisible = true;
+    },
+    addUser() {
+      this.addRegisterUser(true);
+    },
+    clearSearch() {
+      this.channel = "";
+      this.searchTarget();
+    },
+    formatterRole(val) {
+      if (val.type == "1") {
+        return "超级管理员";
+      } else {
+        return "渠道用户";
+      }
+    },
+
+    forma(val) {
+      if (val.gender == "0") {
+        return "男";
+      } else {
+        return "女";
+      }
+    },
+    addRegisterUser(val) {
+      this.$refs.register.open(val);
+    },
+    editRegisterUser(val) {
+      this.$refs.register.edit(val);
+    },
+    deleteChannel(index, row) {
+      this.$http.delete(`/sign/delete/${row.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("删除成功");
+          this.searchTarget();
+        } else {
+          this.$message.error("删除失败");
+        }
+      });
+    },
+
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.searchList();
+    },
+    //根据现有情况进行搜索
+    searchList() {
+      //  let url =``
+      let data = {};
+      if (this.channel == "" || this.channel == null) {
+        data = {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+        };
+      } else {
+        data = {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+          channelId: this.channel,
+        };
+      }
+      this.$http.post(`/order/find`, data, (res) => {
+        // console.log(res,'用户测试记录')
+        if (res && res.code == 200) {
+          this.tableData = res.data.content;
+          this.total = res.data.totalElements;
+        } else {
+          // this.$toast.fail(res.msg);
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    searchTarget() {
+      this.pageNum = 1;
+      this.searchList();
+    },
+    //跳转首页
+    goHome() {
+      this.$router.push({ path: "/home" });
+    },
+    //跳转记录页
+    goRecord() {
+      this.$router.push({ path: "/record" });
+    },
+    //退出登陆
+    logout() {
+      oSessionStorage.removeItem("userInfo");
+      oSessionStorage.removeItem("token");
+      this.$router.push({ path: "/" });
+    },
+    //点击日历获取日期
+    getDate(param) {
+      // console.log(param,"日期。。。")
+      this.userRecord(param.dateStr);
+    },
+    //点击获取月出勤次数
+    getTimes(param) {
+      this.monthTimes = param;
+    },
+    // 用户测试记录显示
+    userRecord(date) {
+      this.$http.get(
+        `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
+        {},
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.listData = res.data;
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../../styles/theme.less";
+
+.record-warp {
+  width: 100%;
+  height: 80vh;
+  //background: url(../../assets/img/index/19.png) no-repeat center;
+  //background-size: 100% 100%;
+  position: relative;
+
+  .record-main {
+    width: 100%;
+    height: 100%;
+    box-sizing: border-box;
+    overflow-y: auto;
+
+    .search-head {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .zc-title {
+        color: #606266;
+        font-size: 14px;
+      }
+    }
+
+    .table-content {
+      margin: 10px 0;
+    }
+  }
+}
+
+.add_user_class {
+  margin-top: 10px;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3;
+}
+</style>

+ 494 - 0
src/views/manage/channelManagement/channelManagement.vue

@@ -0,0 +1,494 @@
+<template>
+  <div class="record-warp">
+    <div class="record-main">
+      <el-row style="display:flex">
+        <el-col :span="24">
+          <div class="search-head">
+            <span>公司名称:</span>
+            <el-input v-model="name" clearable placeholder="请输入公司名称"></el-input
+            >&nbsp;&nbsp;&nbsp;&nbsp;
+            <el-button type="primary" icon="el-icon-search" @click="searchTarget"
+              >搜索</el-button
+            >
+            <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch"
+              >清空</el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+      <el-row  style="display:flex" class="add_user_class">
+        <el-col :span="24">
+          <div class="search-head">
+            <el-button type="primary" icon="el-icon-plus" @click="addUser"
+              >新增</el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+      <!-- height="600px" -->
+      <div class="table-content" style="display: flex;">
+        <el-table
+          :data="tableData"
+          
+          :row-style="{ height: '0px' }"
+          :cell-style="{ padding: '5px' }"
+        >
+          <!-- <el-table-column prop="name" label="姓名" align="center" width=""  show-overflow-tooltip>
+            </el-table-column> -->
+          <el-table-column label="头像" align="center" width="">
+            <template slot-scope="scope">
+              <el-image :src="scope.row.avatar" />
+            </template>
+          </el-table-column>
+          <el-table-column prop="name" label="公司名称" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="province" label="所在省" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="city" label="所在市" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="address" label="地址" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="taxId" label="税号" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="corporate" label="法人" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="phone" label="手机号" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="idNumber" label="身份证号" align="center" width="">
+          </el-table-column>
+          <el-table-column
+            prop="status"
+            label="状态"
+            align="center"
+            :formatter="formatterStatus"
+            width=""
+          >
+          </el-table-column>
+          <!-- <el-table-column prop="isDelete" label="删除状态" align="center" :formatter="formatterDelete" width="">
+                    </el-table-column> -->
+          <el-table-column label="操作" width="200px" align="center" fixed="right">
+            <template slot-scope="scope">
+              <el-button
+                @click="viewUser(scope.row)"
+                v-if="scope.row.state != 0"
+                type="text"
+                size="small"
+                >查看</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="editUser(scope.row)"
+                >编辑</el-button
+              >
+
+              <el-popconfirm
+                v-if="scope.row.state != 0"
+                title="确定删除吗?"
+                placement="top"
+                @confirm="deleteChannel(scope.$index, scope.row)"
+              >
+                <el-button
+                  size="small"
+                  style="margin-left: 10px"
+                  type="text"
+                  slot="reference"
+                  >删除</el-button
+                >
+              </el-popconfirm>
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="userManage(scope.row)"
+                >员工管理</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <el-pagination
+      style="display:flex"
+        small
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="pageNum"
+        layout="total, prev, pager, next"
+        :page-size="pageSize"
+        :total="total"
+      >
+      </el-pagination>
+      <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
+        </el-pagination> -->
+    </div>
+    <ChannelRegister ref="register" @search="searchTarget" />
+    <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
+      <div>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">头像</div>
+              <div class="user_out_subNext">
+                <el-image :src="detailObj.avatar" style="width: 150px; height: 150px" />
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">公司名称</div>
+              <div class="user_out_subNext" style="height: 200px">
+                {{ detailObj.name }}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">所在省</div>
+              <div class="user_out_subNext">
+                {{ detailObj.province }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">所在市</div>
+              <div class="user_out_subNext">
+                {{ detailObj.city }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">所在市</div>
+              <div class="user_out_subNext">
+                {{ detailObj.address }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">税号</div>
+              <div class="user_out_subNext">
+                {{ detailObj.taxId }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">法人</div>
+              <div class="user_out_subNext">
+                {{ detailObj.corporate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">手机号</div>
+              <div class="user_out_subNext">
+                {{ detailObj.phone }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">身份证号</div>
+              <div class="user_out_subNext">
+                {{ detailObj.idNumber }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">状态</div>
+              <div class="user_out_subNext">
+                {{ detailObj.status == "1" ? "签约" : "解约" }}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { oSessionStorage } from "../../../utils/utils";
+import channelRegister from "../../../components/ChannelRegister.vue";
+export default {
+  name: "channelManagement",
+  components: {
+    ChannelRegister: channelRegister,
+  },
+  data() {
+    return {
+      centerDialogVisible: false,
+      editUserFlag: false,
+      startTime: "",
+      endTime: "",
+      value1: null,
+      total: 0,
+      pageSize: 10,
+      pageNum: 1,
+      keyword: "",
+      tableData: [],
+      userInfo: {}, //用户信息
+      userId: "", //用户id
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
+      hospitalOrDepartment: "", //医院科室
+
+      invitationCode: "",
+      roleType: "0",
+      type: 0,
+      view: {
+        name: "",
+        userName: "",
+        channelId: "",
+        role: "",
+      },
+      detailObj: {},
+    };
+  },
+  created() {},
+  mounted() {
+    this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    this.invitationCode = this.userInfo.invitationCode;
+    //判断是超级管理员吗
+    if (this.userInfo.roleType == "1") {
+      this.type = 0;
+    } else if (this.userInfo.roleType == "3") {
+      //如果登录的是代理用户
+      this.type = 4;
+    } else if (this.userInfo.roleType == "2") {
+      this.type = 5;
+    }
+
+    if (this.$route.query.invitationCode) {
+      this.invitationCode = this.$route.query.invitationCode;
+      this.type = this.$route.query.type;
+    }
+    if (!this.userInfo) {
+      //如果用户信息不存在跳转登陆页
+      this.$router.push({ path: "/" });
+    }
+    this.searchTarget();
+  },
+  methods: {
+    //员工管理
+    userManage(row) {
+      this.$router.push({ path: "/manage/staff", query: { channelId: row.id } });
+    },
+    //格式化状态
+    formatterStatus(row) {
+      if (row.status == "1") {
+        return "签约";
+      } else if (row.status == "0") {
+        return "解约";
+      } else {
+        return "";
+      }
+    },
+    formatterDelete(row) {
+      if (row.isDelete == 0) {
+        return "正常";
+      } else {
+        return "已删除";
+      }
+    },
+    resetUser(index, val) {
+      console.log(val);
+      this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("重置成功");
+          this.searchTarget();
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+      //重置密码
+    },
+    editUser(row) {
+      this.editRegisterUser(row);
+    },
+    viewUser(row) {
+      this.detailObj = row;
+      this.centerDialogVisible = true;
+    },
+    addUser() {
+      this.addRegisterUser(true);
+    },
+    clearSearch() {
+      this.name = "";
+      this.userName = "";
+      this.searchTarget();
+    },
+    formatterRole(val) {
+      if (val.type == "1") {
+        return "超级管理员";
+      } else {
+        return "渠道用户";
+      }
+    },
+
+    forma(val) {
+      if (val.gender == "0") {
+        return "男";
+      } else {
+        return "女";
+      }
+    },
+    addRegisterUser(val) {
+      this.$refs.register.open(val);
+    },
+    editRegisterUser(val) {
+      this.$refs.register.edit(val);
+    },
+    deleteChannel(index, row) {
+      this.$http.delete(`/channel/delete/${row.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("删除成功");
+          this.searchTarget();
+        } else {
+          this.$message.error("删除失败");
+        }
+      });
+    },
+
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.searchList();
+    },
+    //根据现有情况进行搜索
+    searchList() {
+      //  let url =``
+      this.$http.post(
+        `/channel/find`,
+        {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+          name: this.name,
+          // isDelete: 0,
+        },
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.tableData = res.data.content;
+            this.total = res.data.totalElements;
+          } else {
+            // this.$toast.fail(res.msg);
+            this.$message.error(res.msg);
+          }
+        }
+      );
+    },
+    searchTarget() {
+      this.pageNum = 1;
+      this.searchList();
+    },
+    //跳转首页
+    goHome() {
+      this.$router.push({ path: "/home" });
+    },
+    //跳转记录页
+    goRecord() {
+      this.$router.push({ path: "/record" });
+    },
+    //退出登陆
+    logout() {
+      oSessionStorage.removeItem("userInfo");
+      oSessionStorage.removeItem("token");
+      this.$router.push({ path: "/" });
+    },
+    //点击日历获取日期
+    getDate(param) {
+      // console.log(param,"日期。。。")
+      this.userRecord(param.dateStr);
+    },
+    //点击获取月出勤次数
+    getTimes(param) {
+      this.monthTimes = param;
+    },
+    // 用户测试记录显示
+    userRecord(date) {
+      this.$http.get(
+        `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
+        {},
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.listData = res.data;
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../../styles/theme.less";
+
+.record-warp {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  .record-main {
+    width: 100%;
+    // height: 100%;
+    
+    overflow-y: auto;
+    display: flex;
+  flex-direction: column;
+
+    .search-head {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .zc-title {
+        color: #606266;
+        font-size: 14px;
+      }
+    }
+
+    .table-content {
+      margin: 10px 0;
+    }
+  }
+}
+
+.add_user_class {
+  margin-top: 10px;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3;
+}
+</style>

+ 587 - 0
src/views/manage/channelManagement/contract.vue

@@ -0,0 +1,587 @@
+<template>
+  <div class="record-warp">
+    <div class="record-main">
+      <el-row>
+        <el-col :span="24">
+          <div class="search-head">
+            <span>渠道:</span>
+            <el-select v-model="channel" placeholder="请选择渠道">
+              <el-option
+                :label="item.name"
+                :value="item.id"
+                v-for="item in channelList"
+                :key="item.id"
+              ></el-option> </el-select
+            >&nbsp;&nbsp;&nbsp;&nbsp;
+            <el-button type="primary" icon="el-icon-search" @click="searchTarget"
+              >搜索</el-button
+            >
+            <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch"
+              >清空</el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+      <el-row class="add_user_class">
+        <el-col :span="24">
+          <div class="search-head">
+            <el-button type="primary" icon="el-icon-plus" @click="addUser"
+              >新增</el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+
+      <div class="table-content">
+        <el-table
+          :data="tableData"
+          :row-style="{ height: '0px' }"
+          :cell-style="{ padding: '5px' }"
+        >
+          <el-table-column prop="channelName" label="渠道" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="used" label="已使用次数" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="singlePrice" label="单次价格" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="rechargeUsed" label="充值使用次数" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="unuse" label="剩余次数" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="rechargeCount" label="累计充值次数" align="center" width="">
+        </el-table-column>
+        <el-table-column prop="signAmount" label="签约单次金额" align="center" width="">
+        </el-table-column>
+          <el-table-column prop="effectiveDate" label="有效时间起" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="expirationDate" label="有效时间止" align="center" width="">
+          </el-table-column>
+        
+          <el-table-column
+            prop="status"
+            label="状态"
+            align="center"
+            :formatter="formatterStatus"
+            width=""
+          >
+          </el-table-column>
+          <el-table-column
+            prop="selfPage"
+            label="自定义首尾页"
+            align="center"
+            :formatter="formatterSelfPage"
+            width=""
+          >
+          </el-table-column>
+          <!-- <el-table-column prop="isDelete" label="删除状态" align="center" :formatter="formatterDelete" width="">
+                    </el-table-column> -->
+          <el-table-column label="操作" width="200px" align="center" fixed="right">
+            <template slot-scope="scope">
+              <el-button
+                @click="viewUser(scope.row)"
+                v-if="scope.row.state != 0"
+                type="text"
+                size="small"
+                >查看</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="editUser(scope.row)"
+                >编辑</el-button
+              >
+
+              <el-popconfirm
+                v-if="scope.row.state != 0"
+                title="确定删除吗?"
+                placement="top"
+                @confirm="deleteChannel(scope.$index, scope.row)"
+              >
+                <el-button
+                  size="small"
+                  style="margin-left: 10px"
+                  type="text"
+                  slot="reference"
+                  >删除</el-button
+                >
+              </el-popconfirm>
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="viewPoster(scope.row)"
+                >查看海报</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                v-if="scope.row.state != 0"
+                @click="topUpCount(scope.row)"
+                >充值次数</el-button
+              >
+            </template>
+            
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <el-pagination
+        small
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="pageNum"
+        layout="total, prev, pager, next"
+        :page-size="pageSize"
+        :total="total"
+      >
+      </el-pagination>
+      <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
+        </el-pagination> -->
+    </div>
+    <ContractRegister ref="register" @search="searchTarget" />
+    <ContractPoster ref="poster" @search="searchTarget" />
+    <ContractTopUp ref="topUp" @search="searchTarget" />
+    
+    <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
+      <div>
+       
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">渠道</div>
+              <div class="user_out_subNext">
+                {{ detailObj.channelName }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">已使用次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.used }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">单次价格</div>
+              <div class="user_out_subNext">
+                {{ detailObj.singlePrice }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">充值使用次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.rechargeUsed }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">剩余次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.unuse }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">累计充值次数</div>
+              <div class="user_out_subNext">
+                {{ detailObj.rechargeCount }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">签约单次金额</div>
+              <div class="user_out_subNext">
+                {{ detailObj.signAmount }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">有效时间起</div>
+              <div class="user_out_subNext">
+                {{ detailObj.effectiveDate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">有效时间止</div>
+              <div class="user_out_subNext">
+                {{ detailObj.expirationDate }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">状态</div>
+              <div class="user_out_subNext">
+                {{ detailObj.status == "1" ? "签约" : "解约" }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">自定义首尾页</div>
+              <div class="user_out_subNext">
+                {{ detailObj.selfPage == "1" ? "是" : "否" }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">备注</div>
+              <div class="user_out_subNext">
+                {{ detailObj.remarks}}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">海报背景图</div>
+              <div class="user_out_subNext">
+                <el-image :src="detailObj.background" style="width: 150px; height: 150px" />
+              </div>
+            </div>
+          </el-col>
+        
+        </el-row>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { oSessionStorage } from "../../../utils/utils";
+import contractRegister from "../../../components/ContractRegister.vue";
+
+import contractPoster from "../../../components/ContractPoster.vue";
+import contractTopUp from "../../../components/ContractTopUp.vue";
+export default {
+  name: "channelManagement",
+  components: {
+    ContractRegister:contractRegister,
+    ContractPoster: contractPoster,
+    ContractTopUp:contractTopUp
+  },
+  data() {
+    return {
+      centerDialogVisible: false,
+      editUserFlag: false,
+      startTime: "",
+      endTime: "",
+      value1: null,
+      total: 0,
+      pageSize: 10,
+      pageNum: 1,
+      keyword: "",
+      tableData: [],
+      userInfo: {}, //用户信息
+      userId: "", //用户id
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
+      hospitalOrDepartment: "", //医院科室
+
+      invitationCode: "",
+      roleType: "0",
+      type: 0,
+      view: {
+        name: "",
+        userName: "",
+        channelId: "",
+        role: "",
+      },
+      detailObj: {},
+      channel: "",
+      channelList: [{ name: "渠道天成", id: "1" }],
+    };
+  },
+  created() {},
+  mounted() {
+    this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    console.log(this.userInfo);
+
+    if (this.userInfo.type == "1") {
+      this.channel = "";
+    } else if (this.userInfo.type == "0") {
+      this.channel = this.userInfo.channelId;
+    }
+    this.invitationCode = this.userInfo.invitationCode;
+    this.getChannel();
+    //判断是超级管理员吗
+    if (this.userInfo.roleType == "1") {
+      this.type = 0;
+    } else if (this.userInfo.roleType == "3") {
+      //如果登录的是代理用户
+      this.type = 4;
+    } else if (this.userInfo.roleType == "2") {
+      this.type = 5;
+    }
+
+    if (this.$route.query.invitationCode) {
+      this.invitationCode = this.$route.query.invitationCode;
+      this.type = this.$route.query.type;
+    }
+    if (!this.userInfo) {
+      //如果用户信息不存在跳转登陆页
+      this.$router.push({ path: "/" });
+    }
+    this.searchTarget();
+  },
+  methods: {
+    //充值次数
+    topUpCount(row){
+        // console.log(this.$refs.topUp)
+        this.$refs.topUp.open(row.id)
+    },
+    //查看海报
+    viewPoster(row){
+        this.$refs.poster.open(row)
+    },
+    //格式化自定义首尾页
+    formatterSelfPage(row){
+        if(row.selfPage=='0'){
+            return '否'
+        }else{
+            return '是'
+        }
+    },
+    //获取渠道信息
+    getChannel() {
+      this.$http.get(`/channel/findAll`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          //将值赋值给list
+          this.channelList = res.data;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    //员工管理
+    userManage(row) {
+      this.$router.push({ path: "/manage/staff", query: { channelId: row.id } });
+    },
+    //格式化状态
+    formatterStatus(row) {
+      if (row.status == "1") {
+        return "签约";
+      } else if (row.status == "0") {
+        return "解约";
+      } else {
+        return "";
+      }
+    },
+    formatterDelete(row) {
+      if (row.isDelete == 0) {
+        return "正常";
+      } else {
+        return "已删除";
+      }
+    },
+    resetUser(index, val) {
+      console.log(val);
+      this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("重置成功");
+          this.searchTarget();
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+      //重置密码
+    },
+    editUser(row) {
+      this.editRegisterUser(row);
+    },
+    viewUser(row) {
+      this.detailObj = row;
+      this.centerDialogVisible = true;
+    },
+    addUser() {
+      this.addRegisterUser(true);
+    },
+    clearSearch() {
+      this.channel = "";
+      this.searchTarget();
+    },
+    formatterRole(val) {
+      if (val.type == "1") {
+        return "超级管理员";
+      } else {
+        return "渠道用户";
+      }
+    },
+
+    forma(val) {
+      if (val.gender == "0") {
+        return "男";
+      } else {
+        return "女";
+      }
+    },
+    addRegisterUser(val) {
+      this.$refs.register.open(val);
+    },
+    editRegisterUser(val) {
+      this.$refs.register.edit(val);
+    },
+    deleteChannel(index, row) {
+      this.$http.delete(`/sign/delete/${row.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("删除成功");
+          this.searchTarget();
+        } else {
+          this.$message.error("删除失败");
+        }
+      });
+    },
+
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.searchList();
+    },
+    //根据现有情况进行搜索
+    searchList() {
+      //  let url =``
+      let data = {};
+      if (this.channel == "" || this.channel == null) {
+        data = {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+        };
+      } else {
+        data = {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+          channelId: this.channel,
+        };
+      }
+      this.$http.post(`/sign/find`, data, (res) => {
+        // console.log(res,'用户测试记录')
+        if (res && res.code == 200) {
+          this.tableData = res.data.content;
+          this.total = res.data.totalElements;
+        } else {
+          // this.$toast.fail(res.msg);
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    searchTarget() {
+      this.pageNum = 1;
+      this.searchList();
+    },
+    //跳转首页
+    goHome() {
+      this.$router.push({ path: "/home" });
+    },
+    //跳转记录页
+    goRecord() {
+      this.$router.push({ path: "/record" });
+    },
+    //退出登陆
+    logout() {
+      oSessionStorage.removeItem("userInfo");
+      oSessionStorage.removeItem("token");
+      this.$router.push({ path: "/" });
+    },
+    //点击日历获取日期
+    getDate(param) {
+      // console.log(param,"日期。。。")
+      this.userRecord(param.dateStr);
+    },
+    //点击获取月出勤次数
+    getTimes(param) {
+      this.monthTimes = param;
+    },
+    // 用户测试记录显示
+    userRecord(date) {
+      this.$http.get(
+        `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
+        {},
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.listData = res.data;
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../../styles/theme.less";
+
+.record-warp {
+  width: 100%;
+  height: 80vh;
+  //background: url(../../assets/img/index/19.png) no-repeat center;
+  //background-size: 100% 100%;
+  position: relative;
+
+  .record-main {
+    width: 100%;
+    height: 100%;
+    box-sizing: border-box;
+    overflow-y: auto;
+
+    .search-head {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .zc-title {
+        color: #606266;
+        font-size: 14px;
+      }
+    }
+
+    .table-content {
+      margin: 10px 0;
+    }
+  }
+}
+
+.add_user_class {
+  margin-top: 10px;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3;
+}
+</style>

+ 469 - 0
src/views/manage/channelManagement/staff.vue

@@ -0,0 +1,469 @@
+<template>
+  <div class="record-warp">
+    <div class="record-main">
+      <el-row>
+        <!-- <el-col :span="24">
+          <div class="search-head">
+            <span>公司名称:</span>
+            <el-input v-model="name" clearable placeholder="请输入公司名称"></el-input>&nbsp;&nbsp;&nbsp;&nbsp;
+            <el-button type="primary" icon="el-icon-search" @click="searchTarget">搜索</el-button>
+            <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch">清空</el-button>
+          </div>
+        </el-col> -->
+      </el-row>
+      <el-row class="add_user_class">
+        <el-col :span="24">
+          <div class="search-head">
+            <el-button type="primary" icon="el-icon-plus" @click="addUser"
+              >新增</el-button
+            >
+            <el-button type="primary" icon="el-icon-back" @click="goBack"
+              >返回</el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+
+      <div class="table-content">
+        <el-table
+          :data="tableData"
+          :row-style="{ height: '0px' }"
+          :cell-style="{ padding: '5px' }"
+        >
+          <!-- <el-table-column prop="name" label="姓名" align="center" width=""  show-overflow-tooltip>
+            </el-table-column> -->
+          <el-table-column label="头像" align="center" width="">
+            <template slot-scope="scope">
+              <el-image :src="scope.row.avatar" />
+            </template>
+          </el-table-column>
+          <el-table-column prop="name" label="姓名" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="description" label="个人描述" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="job" label="岗位" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="mail" label="邮箱" align="center" width="">
+          </el-table-column>
+          <el-table-column prop="phone" label="手机号" align="center" width="">
+          </el-table-column>
+
+          <el-table-column
+            prop="state"
+            label="状态"
+            align="center"
+            :formatter="formatterState"
+            width=""
+          >
+          </el-table-column>
+          <!-- <el-table-column
+            prop="isDelete"
+            label="删除状态"
+            align="center"
+            :formatter="formatterIsDelete"
+            width=""
+          >
+          </el-table-column> -->
+          <!-- <el-table-column prop="isDelete" label="删除状态" align="center" :formatter="formatterDelete" width="">
+                    </el-table-column> -->
+          <el-table-column label="操作" width="200px" align="center" fixed="right">
+            <template slot-scope="scope">
+              <el-button @click="viewUser(scope.row)" type="text" size="small"
+                >查看</el-button
+              >
+              <el-button type="text" size="small" @click="editUser(scope.row)"
+                >编辑</el-button
+              >
+
+              <el-popconfirm
+                title="确定删除吗?"
+                placement="top"
+                @confirm="deleteStaff(scope.$index, scope.row)"
+              >
+                <el-button
+                  size="small"
+                  style="margin-left: 10px"
+                  type="text"
+                  slot="reference"
+                  >删除</el-button
+                >
+              </el-popconfirm>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <el-pagination
+        small
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="pageNum"
+        layout="total, prev, pager, next"
+        :page-size="pageSize"
+        :total="total"
+      >
+      </el-pagination>
+      <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
+        </el-pagination> -->
+    </div>
+    <StaffRegister ref="register" @search="searchTarget" />
+    <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
+      <div>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">头像</div>
+              <div class="user_out_subNext">
+                <el-image :src="detailObj.avatar" style="width: 150px; height: 150px" />
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub" style="height: 200px">姓名</div>
+              <div class="user_out_subNext" style="height: 200px">
+                {{ detailObj.name }}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">个人描述</div>
+              <div class="user_out_subNext">
+                {{ detailObj.description }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">岗位</div>
+              <div class="user_out_subNext">
+                {{ detailObj.job }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">邮箱</div>
+              <div class="user_out_subNext">
+                {{ detailObj.mail }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">手机号</div>
+              <div class="user_out_subNext">
+                {{ detailObj.phone }}
+              </div>
+            </div>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <div class="user_out">
+              <div class="user_out_sub">状态</div>
+              <div class="user_out_subNext">
+                {{ detailObj.state == "1" ? "签约" : "解约" }}
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { oSessionStorage } from "../../../utils/utils";
+import staffRegister from "../../../components/StaffRegister.vue";
+export default {
+  name: "channelManagement",
+  components: {
+    StaffRegister: staffRegister,
+  },
+  data() {
+    return {
+      centerDialogVisible: false,
+      editUserFlag: false,
+      startTime: "",
+      endTime: "",
+      value1: null,
+      total: 0,
+      pageSize: 10,
+      pageNum: 1,
+      keyword: "",
+      tableData: [],
+      userInfo: {}, //用户信息
+      userId: "", //用户id
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
+      hospitalOrDepartment: "", //医院科室
+
+      invitationCode: "",
+      roleType: "0",
+      type: 0,
+      view: {
+        name: "",
+        userName: "",
+        channelId: "",
+        role: "",
+      },
+      detailObj: {},
+    };
+  },
+  created() {},
+  mounted() {
+    this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+
+    this.view.channelId = this.$route.query.channelId;
+
+    this.invitationCode = this.userInfo.invitationCode;
+    //判断是超级管理员吗
+    if (this.userInfo.roleType == "1") {
+      this.type = 0;
+    } else if (this.userInfo.roleType == "3") {
+      //如果登录的是代理用户
+      this.type = 4;
+    } else if (this.userInfo.roleType == "2") {
+      this.type = 5;
+    }
+
+    if (this.$route.query.invitationCode) {
+      this.invitationCode = this.$route.query.invitationCode;
+      this.type = this.$route.query.type;
+    }
+    if (!this.userInfo) {
+      //如果用户信息不存在跳转登陆页
+      this.$router.push({ path: "/" });
+    }
+    this.searchTarget();
+  },
+  methods: {
+    goBack(){
+        this.$router.go(-1)
+    },
+    //格式化状态
+    formatterIsDelete(row) {
+      if ((row.isDelete == "0")) {
+        return "正常";
+      } else if ((row.isDelete == "1")) {
+        return "已删除";
+      }else{
+        return ''
+      }
+    },
+    //格式化状态
+    formatterState(row) {
+      if (row.state == "1") {
+        return "签约";
+      } else if (row.state == "0") {
+        return "解约";
+      } else {
+        return "";
+      }
+    },
+    formatterDelete(row) {
+      if (row.isDelete == 0) {
+        return "正常";
+      } else {
+        return "已删除";
+      }
+    },
+    resetUser(index, val) {
+      console.log(val);
+      this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("重置成功");
+          this.searchTarget();
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+      //重置密码
+    },
+    editUser(row) {
+      this.editRegisterUser(row);
+    },
+    viewUser(row) {
+      this.detailObj = row;
+      this.centerDialogVisible = true;
+    },
+    addUser() {
+      this.addRegisterUser(true);
+    },
+    clearSearch() {
+      this.name = "";
+      this.userName = "";
+      this.searchTarget();
+    },
+    formatterRole(val) {
+      if (val.type == "1") {
+        return "超级管理员";
+      } else {
+        return "渠道用户";
+      }
+    },
+
+    forma(val) {
+      if (val.gender == "0") {
+        return "男";
+      } else {
+        return "女";
+      }
+    },
+    addRegisterUser(val) {
+      this.$refs.register.open(val);
+    },
+    editRegisterUser(val) {
+      this.$refs.register.edit(val);
+    },
+    deleteStaff(index, row) {
+      this.$http.delete(`/staff/delete/${row.id}`, {}, (res) => {
+        //  this.$toast.success({message:'成功'});
+        if (res && res.code == 200) {
+          this.$message.success("删除成功");
+          this.searchTarget();
+        } else {
+          this.$message.error("删除失败");
+        }
+      });
+    },
+
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.searchList();
+    },
+    //根据现有情况进行搜索
+    searchList() {
+      //  let url =``
+      this.$http.post(
+        `/staff/find`,
+        {
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+          channelId: this.view.channelId,
+          // name: this.name,
+          // isDelete: 0,
+        },
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.tableData = res.data.content;
+            this.total = res.data.totalElements;
+          } else {
+            // this.$toast.fail(res.msg);
+            this.$message.error(res.msg);
+          }
+        }
+      );
+    },
+    searchTarget() {
+      this.pageNum = 1;
+      this.searchList();
+    },
+    //跳转首页
+    goHome() {
+      this.$router.push({ path: "/home" });
+    },
+    //跳转记录页
+    goRecord() {
+      this.$router.push({ path: "/record" });
+    },
+    //退出登陆
+    logout() {
+      oSessionStorage.removeItem("userInfo");
+      oSessionStorage.removeItem("token");
+      this.$router.push({ path: "/" });
+    },
+    //点击日历获取日期
+    getDate(param) {
+      // console.log(param,"日期。。。")
+      this.userRecord(param.dateStr);
+    },
+    //点击获取月出勤次数
+    getTimes(param) {
+      this.monthTimes = param;
+    },
+    // 用户测试记录显示
+    userRecord(date) {
+      this.$http.get(
+        `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
+        {},
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.listData = res.data;
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../../styles/theme.less";
+
+.record-warp {
+  width: 100%;
+  height: 80vh;
+  //background: url(../../assets/img/index/19.png) no-repeat center;
+  //background-size: 100% 100%;
+  position: relative;
+
+  .record-main {
+    width: 100%;
+    height: 100%;
+    box-sizing: border-box;
+    overflow-y: auto;
+
+    .search-head {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .zc-title {
+        color: #606266;
+        font-size: 14px;
+      }
+    }
+
+    .table-content {
+      margin: 10px 0;
+    }
+  }
+}
+
+.add_user_class {
+  margin-top: 10px;
+  display: flex;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3;
+}
+</style>

+ 375 - 163
src/views/manage/manageMain.vue

@@ -1,74 +1,85 @@
 <template>
-  <el-container>
-    <el-header class="shadow-menu">
-      <el-row class="admin-header-content">
-        <el-col :span="12">
-          <div class="admin-logo-content">
-            <!--            <img src="../../assets/manage/manage_logo.png" alt="" />-->
-            锦泓税务报告
-          </div>
-        </el-col>
-        <!--<el-col :offset="15" :span="1">-->
-        <!--<div class="admin-head-content" key="large">-->
-        <!--<el-avatar :size="size" :src="circleUrl"></el-avatar>-->
-        <!--</div>-->
-        <!--</el-col>-->
-        <el-col :span="12" class="just-right">
-          <el-menu
-            :default-active="activeIndex"
-            class="el-menu-demo"
-            mode="horizontal"
-            background-color="#57ACBB"
-            text-color="#fff"
-            active-text-color="#fff"
-          >
-            <el-submenu index="2" class="rightExit">
-              <template slot="title" :size="size" :src="circleUrl">{{
-                userInfo.name
-              }}</template>
-              <el-menu-item v-if="userType == 2" index="2-1" @click="downCode(userInfo.name+'-'+userInfo.userNumber)">下载专属邀请码</el-menu-item>
-              <el-menu-item index="2-1" @click="escape()">退出</el-menu-item>
-              <el-menu-item index="2-1" @click="changePwd()"
-                >修改密码</el-menu-item
-              >
-            </el-submenu>
-          </el-menu>
-<!--          <vue-qr v-show='false' :ref="'Qrcode'+userInfo.id" :text='urlJump+userInfo.invitationCode' :size="500" :width='1' ></vue-qr>-->
-          <vue-qr v-show='false' :ref="userInfo.name+'-'+userInfo.userNumber" :text='urlJump+userInfo.invitationCode' :size="500" :width='1' ></vue-qr>
-        </el-col>
-      </el-row>
-    </el-header>
-    <el-container>
-      <el-aside style="width: auto">
-    
-        <el-menu
-         ref='menu'
-          class="el-menu-vertical-demo shadow-menu aside-menu"
-          :router="true"
-          :default-active="active"
-          :collapse="isCollapse"
-          text-color="#333"
-          active-text-color="#fff"
-          @select="selectMenu"
+  <el-container style="height: 100vh; overflow: hidden">
+    <el-aside style="width: auto">
+      <el-menu
+        :unique-opened="true"
+        ref="menu"
+        :collapse-transition="false"
+        class="el-menu-vertical-demo shadow-menu aside-menu"
+        :router="true"
+        :default-active="active"
+        :collapse="isCollapse"
+        text-color="#333"
+        active-text-color="#fff"
+        @select="selectMenu"
+      >
+        <!-- <img  src="../../assets/img/commons/jhTop.png" /> -->
+        <img v-show="!isCollapse" src="../../assets/img/commons/jhTop.png" />
+        <img
+          v-show="isCollapse"
+          style="menu_top_suo"
+          src="../../assets/img/commons/jhTopSuo.png"
+        />
+        <el-submenu
+          v-for="item in menuList"
+          :key="item.id"
+          :index="item.path"
+          v-show="item.showItem"
         >
-          <el-menu-item
-            v-for="item in menuList"
-            :key="item.id"
-            :index="item.path"
-            v-show="item.showItem"
-          >
+          <template slot="title">
             <i :class="item.icon"></i>
-            <span slot="title">{{ item.name }}</span>
-          </el-menu-item>
-        </el-menu>
-      </el-aside>
-    
-      <el-container>
+            <span class="menu_name">{{ item.name }}</span>
+          </template>
+          <el-menu-item-group>
+            <el-menu-item v-for="el in item.child" :key="el.id" :index="el.path">
+              <span class="menu_sub_tt"
+                ><span class="menu_sub_t1"></span>{{ el.name }}</span
+              >
+            </el-menu-item>
+          </el-menu-item-group>
+        </el-submenu>
+      </el-menu>
+    </el-aside>
+    <el-container style="height: 100vh; display: flex; flex-direction: column">
+      <el-header class="shadow-menu">
+        <el-row class="admin-header-content">
+          <el-col :span="12"> </el-col>
+
+          <el-col :span="12" class="just-right">
+            <el-menu
+              :default-active="activeIndex"
+              class="el-menu-demo"
+              mode="horizontal"
+              background-color="#57ACBB"
+              text-color="#fff"
+              active-text-color="#fff"
+            >
+              <el-submenu index="2" class="rightExit">
+                <template slot="title" :size="size" :src="circleUrl">{{
+                  userInfo.userName
+                }}</template>
+
+                <el-menu-item index="2-1" @click="escape()">退出</el-menu-item>
+                <el-menu-item index="2-1" @click="changePwd()">修改密码</el-menu-item>
+              </el-submenu>
+            </el-menu>
+
+            <vue-qr
+              v-show="false"
+              :ref="userInfo.name + '-' + userInfo.userNumber"
+              :text="urlJump + userInfo.invitationCode"
+              :size="500"
+              :width="1"
+            ></vue-qr>
+          </el-col>
+        </el-row>
+      </el-header>
+      <el-container style="flex: 1; overflow: auto">
         <el-header class="main-header">
           <el-row>
             <el-col :span="1">
               <div class="menu-hide" @click="changeMenu">
-                <i class="el-icon-s-fold" style="color: #000"></i>
+                <i class="el-icon-s-fold" style="color: #000; font-size: 20px"></i>
               </div>
             </el-col>
             <el-col :span="10">
@@ -82,20 +93,21 @@
           </el-row>
         </el-header>
 
-        <el-main class="el-mains" style="background-color: #f5f5f5">
-          <transition name="fade" mode="out-in">
-            <router-view></router-view>
-          </transition>
+        <el-main style="background-color: #f5f5f5; display: flex">
+          <div class="el-main-inner">
+            <transition name="fade" mode="out-in">
+              <router-view></router-view>
+            </transition>
+          </div>
         </el-main>
-        
+        <!-- <el-footer>
+          <div style="background-color:#000000">递交</div>
+          </el-footer> -->
+        <!-- <el-footer style="padding-left: 0px; padding-right: 0px">
+      <Footer />
+    </el-footer> -->
       </el-container>
-  
     </el-container>
-              <!-- <Footer
-    /> -->
-    <el-footer style="padding-left: 0px; padding-right: 0px"
-      ><Footer
-    /></el-footer>
 
     <!---lxh-修改密码-->
     <el-dialog
@@ -135,9 +147,7 @@
           </el-form-item>
 
           <el-form-item>
-            <el-button type="primary" @click="submitForm('ruleForm')"
-              >提交</el-button
-            >
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
             <el-button @click="resetForm('ruleForm')">重置</el-button>
           </el-form-item>
         </el-form>
@@ -147,7 +157,7 @@
 </template>
 <script>
 import md5 from "md5";
-import vueQr from 'vue-qr'
+import vueQr from "vue-qr";
 import { mapGetters, mapActions } from "vuex";
 import { oSessionStorage } from "@/utils/utils";
 import register from "@/components/Register";
@@ -156,7 +166,7 @@ export default {
   name: "manageMain",
   components: {
     vueQr,
-    Footer
+    Footer,
   },
   computed: {
     // ...mapGetters(['sacleListName']),
@@ -223,61 +233,189 @@ export default {
       userInfo: {}, //用户信息
       dialogVisible: false, //弹出窗是否可见
       size: "small",
-      circleUrl:
-        "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
+      circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
       activeIndex: "10",
       activeIndex2: "1",
       isCollapse: false,
       userType: "",
       menuList: [
         {
-          id: 0,
-          name: "首页",
+          id: "0",
+          name: "渠道信息",
           icon: "el-icon-s-home",
-          path: "/manage/adminHome",
+          path: "0",
           showItem: true,
+          child: [
+            {
+              id: "01",
+              name: "签约详情",
+              parentName: "渠道信息",
+              icon: "el-icon-user-solid",
+              path: "/manage/channelInfo",
+              showItem: true,
+            },
+            {
+              id: "02",
+              name: "订单结算",
+              icon: "el-icon-user-solid",
+              parentName: "渠道信息",
+              path: "/manage/orderSettlement",
+              showItem: true,
+            },
+            // {
+            //   id: "03",
+            //   name: "邀请链接",
+            //   icon: "el-icon-user-solid",
+            //   path: "/manage/agencyUserManage",
+            //   showItem: true,
+            // },
+            // {
+            //   id: "04",
+            //   name: "报告记录",
+            //   icon: "el-icon-user-solid",
+            //   path: "/manage/agencyUserManage",
+            //   showItem: true,
+            // },
+          ],
         },
         {
-          id: 1,
-          name: "代理管理",
+          id: "1",
+          name: "渠道管理",
           icon: "el-icon-user-solid",
-          path: "/manage/agencyUserManage",
+          path: "",
           showItem: true,
+          child: [
+            {
+              id: "11",
+              name: "渠道信息",
+              icon: "el-icon-user-solid",
+              parentName: "渠道管理",
+              path: "/manage/channelManagement",
+              showItem: true,
+            },
+            {
+              id: "12",
+              name: "签约详情",
+              icon: "el-icon-user-solid",
+              parentName: "渠道管理",
+              path: "/manage/contract",
+              showItem: true,
+            },
+          ],
         },
+        /*  
+          {
+            id: '2',
+            name: "财税报告",
+            icon: "el-icon-user-solid",
+            path: "/manage/doctorUserManage",
+            showItem: true,
+            child:[{
+                id: '21',
+                name: "接口价格",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },{
+                id: '22',
+                name: "产品定价",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },{
+                id: '23',
+                name: "报告记录",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },]
+          },
+          {
+            id: '3',
+            name: "订单管理",
+            icon: "el-icon-user-solid",
+            path: "/manage/userManage",
+            showItem: true,
+            child:[
+              {
+                id: '31',
+                name: "用户订单",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },
+              {
+                id: '32',
+                name: "邀约订单",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },
+              {
+                id: '33',
+                name: "订单结算",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },
+            ]
+          },
+          {
+            id: '4',
+            name: "邀请管理",
+            icon: "el-icon-s-order",
+            path: "/manage/gameRecord1",
+            showItem: true,
+            child:[
+              {
+                id: '41',
+                name: "邀请链接",
+                icon: "el-icon-user-solid",
+                path: "/manage/agencyUserManage",
+                showItem: true,
+              },
+            ]
+          },*/
         {
-          id: 2,
-          name: "医生管理",
-          icon: "el-icon-user-solid",
-          path: "/manage/doctorUserManage",
-          showItem: true,
-        },
-        // {
-        //   id: 2,
-        //   name: "医生用户管理",
-        //   icon: "el-icon-user-solid",
-        //   path: "2",
-        //   showItem: true,
-        // },
-        {
-          id: 3,
+          id: "5",
           name: "用户管理",
-          icon: "el-icon-user-solid",
-          path: "/manage/userManage",
+          icon: "el-icon-s-order",
+          path: "/manage/gameRecord2",
           showItem: true,
+          child: [
+            {
+              parentName: "用户管理",
+              id: "51",
+              name: "用户管理",
+              icon: "el-icon-user-solid",
+              path: "/manage/userManage",
+              showItem: true,
+            },
+            {
+              parentName: "用户管理",
+              id: "52",
+              name: "角色管理",
+              icon: "el-icon-user-solid",
+              path: "/manage/roleManage",
+              showItem: true,
+            },
+          ],
         },
-        // {
-        //   id: 4,
-        //   name: "用户记录",
-        //   icon: "el-icon-s-order",
-        //   path: "/manage/userRecord",
-        //   showItem: true,
-        // },
         {
-          id: 5,
-          name: "游戏记录",
+          id: "6",
+          name: "数据大屏",
           icon: "el-icon-s-order",
-          path: "/manage/gameRecord",
+          // path: "/manage/gameRecord",
           showItem: true,
+          child: [
+            {
+              id: "61",
+              name: "大屏",
+              icon: "el-icon-user-solid",
+              path: "/manage/agencyUserManage",
+              showItem: true,
+            },
+          ],
         },
       ],
       //面包屑页签
@@ -295,37 +433,28 @@ export default {
       },
       rules: {
         pass: [{ required: true, validator: validatePass, trigger: "blur" }],
-        checkPass: [
-          { required: true, validator: validatePass2, trigger: "blur" },
-        ],
-        oldpass: [
-          { required: true, validator: validatePassOld, trigger: "blur" },
-        ],
+        checkPass: [{ required: true, validator: validatePass2, trigger: "blur" }],
+        oldpass: [{ required: true, validator: validatePassOld, trigger: "blur" }],
       },
       ifAdmin: false,
       ifSupAdmin: false,
       active: "/manage/adminHome",
-      urlJump:'http://152.136.24.101:8997?invitationCode=', //二维码跳转链接
+      urlJump: "http://152.136.24.101:8997?invitationCode=", //二维码跳转链接
     };
   },
   created() {
     if (oSessionStorage.getItem("userInfo")) {
       this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
-      this.userType = this.userInfo.roleType;
+      this.userType = this.userInfo.type;
       console.log(this.userInfo, "有用户信息吗");
       //假如是代理用户则 //代理用户菜单不显示
-      if (this.userType == "3") {
+      if (this.userType == "0") {
         for (let i = 0; i < this.menuList.length; i++) {
-          if (this.menuList[i].id == "1") {
-            this.menuList[i].showItem = false;
-          }
-        }
-      } else if (this.userType == "2") {
-        for (let i = 0; i < this.menuList.length; i++) {
-          if (this.menuList[i].id == "2") {
-            this.menuList[i].showItem = false;
-          }
-          if (this.menuList[i].id == "1") {
+          if (
+            this.menuList[i].id == "5" ||
+            this.menuList[i].id == "6" ||
+            this.menuList[i].id == "1"
+          ) {
             this.menuList[i].showItem = false;
           }
         }
@@ -333,16 +462,15 @@ export default {
     }
   },
   mounted() {
-    let codeImage = sessionStorage.getItem('codeImage');
-    this.urlJump=codeImage+'?invitationCode='
-    let that =this;
+    let codeImage = sessionStorage.getItem("codeImage");
+    this.urlJump = codeImage + "?invitationCode=";
+    let that = this;
     // 页面初始化或者刷新页面初始化页签及激活菜单-2020-03-17 lwl
     this.active = this.$route.path;
-    // debugger;
     this.selectMenu(this.$route.path);
     this.bus.$on("menuStatusUpdate", (e) => {
-      console.log(that.$refs.menu.activeIndex)
-      that.$refs.menu.activeIndex=e
+      console.log(that.$refs.menu.activeIndex);
+      that.$refs.menu.activeIndex = e;
       that.active = e;
       //  that.$forceUpdate()
       that.selectMenu(e);
@@ -366,17 +494,24 @@ export default {
           this.crumbParent = item.name;
           this.crumbChild = null;
           return;
+        } else {
+          item.child.forEach((i) => {
+            if (i.path == param) {
+              this.crumbParent = i.parentName;
+              this.crumbChild = i.name;
+            }
+          });
         }
       });
     },
     //下载专属二维码
     downCode(linkId) {
-      const iconUrl =this.$refs[linkId].$el.src;
-      const a = document.createElement('a');
-      const event =new MouseEvent('click');
-      a.download=linkId;
-      a.href=iconUrl;
-      a.dispatchEvent(event)
+      const iconUrl = this.$refs[linkId].$el.src;
+      const a = document.createElement("a");
+      const event = new MouseEvent("click");
+      a.download = linkId;
+      a.href = iconUrl;
+      a.dispatchEvent(event);
     },
     // 退出
     escape() {
@@ -394,21 +529,28 @@ export default {
 
     /*lxh-修改密码*/
     submitForm(formName) {
-      console.log(this.userInfo)
+      console.log(this.userInfo);
       this.$refs[formName].validate((valid) => {
         if (valid) {
-            this.$http.post(
-              "/v1/system/updatePassword",
-              {
-                id: this.userInfo.id,
-                password: md5(this.ruleForm.pass),
-                oldPassword: md5(this.ruleForm.oldpass),
-              },
-              (res) => {
-                (this.ruleForm.oldpass = ""),
-                  (this.ruleForm.pass = ""),
-                  (this.ruleForm.checkPass = ""),
-                  (this.dialogVisible = false);
+          this.$http.post(
+            "/user/update/password",
+            {
+              id: this.userInfo.id,
+              newPassword: md5(this.ruleForm.pass),
+              oldPassword: md5(this.ruleForm.oldpass),
+            },
+            (res) => {
+              if (res.code == 2001) {
+                this.$message({
+                  message: "旧密码错误",
+                  type: "error",
+                });
+              }
+              if (res.code == 200) {
+                this.ruleForm.oldpass = "";
+                this.ruleForm.pass = "";
+                this.ruleForm.checkPass = "";
+                this.dialogVisible = false;
                 this.$message({
                   message: "密码修改完成!",
                   type: "success",
@@ -418,7 +560,8 @@ export default {
                   path: "/",
                 });
               }
-            );
+            }
+          );
         } else {
           console.log("error submit!!");
           return false;
@@ -437,6 +580,27 @@ export default {
   },
 };
 </script>
+>
+<style>
+.el-submenu__title:hover {
+  background-color: #80a1ff;
+}
+.el-menu {
+  background-color: #23315a;
+}
+.el-menu-item-group .el-menu-item.is-active {
+  background-color: #80a1ff !important;
+}
+.el-menu-item-group .el-menu-item:hover {
+  background-color: #80a1ff !important;
+}
+.el-menu-item-group__title {
+  padding: 0px !important;
+  line-height: normal;
+  font-size: 12px;
+  color: #909399;
+}
+</style>
 <style lang="less" scoped>
 .el-menu-vertical-demo:not(.el-menu--collapse) {
   width: 200px;
@@ -494,17 +658,23 @@ export default {
 }
 
 .aside-menu {
+  background-color: #000000;
   /*height: 98vh;*/
-  height: 92vh;
+  height: 100vh;
   text-align: left;
   /*padding-top: 60px;*/
+  border-top-right-radius: 40px;
+  border-bottom-right-radius: 40px;
 }
+
 .aside-menu .el-menu-item.is-active {
-  background: #57acbb !important;
+  background: #80a1ff !important;
 }
+
 .el-menu-item-group .el-menu-item.is-active {
-  background: #57acbb !important;
+  background: #80a1ff !important;
 }
+
 .fade-enter {
   opacity: 0;
 }
@@ -517,6 +687,7 @@ export default {
 .fade-enter-active {
   transition: opacity 0s;
 }
+
 /*.rightExit {*/
 /*float: right !important;*/
 /*}*/
@@ -540,9 +711,11 @@ export default {
   justify-content: space-between;
   align-items: center;
 }
+
 .admin-header-content .el-col {
   height: 100% !important;
 }
+
 .admin-header-content .admin-logo-content {
   /*box-sizing: border-box;*/
   /*width: 100%;*/
@@ -555,10 +728,12 @@ export default {
   text-align: left;
   line-height: 45px;
 }
+
 .admin-header-content .admin-logo-content img {
   width: 100%;
   height: 100%;
 }
+
 .admin-header-content .admin-head-content {
   width: 100%;
   height: 100%;
@@ -568,26 +743,63 @@ export default {
   align-items: center;
   flex: 1;
 }
+
 .admin-header-content .el-menu-demo {
   height: 100%;
 }
+
 .el-menu--horizontal > .el-submenu .el-submenu__title,
 /deep/.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
   border-bottom: none !important;
 }
+
 /deep/.el-menu--horizontal > .el-submenu .el-submenu__icon-arrow {
   color: #fff;
 }
+
 .el-menu.el-menu--horizontal {
   border-bottom: none;
 }
+
 .admin-breadcrumb {
   padding-top: 3px;
   margin-left: -18px;
 }
+
 .just-right {
   display: flex;
   flex-direction: row;
   justify-content: flex-end;
 }
+.el-main-inner {
+  display: flex;
+
+  width: 100%;
+
+  background-color: #fff;
+  padding: 20px;
+  border-radius: 40px;
+}
+.el-main {
+  box-sizing: border-box !important;
+  display: flex !important;
+  overflow: hidden !important;
+}
+.menu_name {
+  color: #ffffff;
+}
+.menu_sub_tt {
+  margin-left: 10px;
+  color: white;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  .menu_sub_t1 {
+    background-color: #ffffff;
+    border-radius: 50%;
+    width: 5px;
+    height: 5px;
+    margin-right:10px
+  }
+}
 </style>

+ 248 - 0
src/views/manage/roleManage.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="record-warp">
+    <div class="record-main">
+      <!-- <el-row>
+        <el-col :span="24">
+          <div class="search-head">
+            <span>用户名:</span>
+            <el-input v-model="name" clearable placeholder="请输入用户名"></el-input
+            >&nbsp;&nbsp;&nbsp;&nbsp;
+            <span>用户昵称:</span>
+            <el-input v-model="userName" clearable placeholder="请输入用户昵称"></el-input
+            >&nbsp;&nbsp;
+            <el-button type="primary" icon="el-icon-search" @click="searchTarget"
+              >搜索</el-button
+            >
+            <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch"
+              >清空</el-button
+            >
+          </div>
+        </el-col>
+      </el-row> -->
+
+      <div class="table-content">
+        <el-table
+          :data="tableData"
+          :row-style="{ height: '0px' }"
+          :cell-style="{ padding: '5px' }"
+        >
+          <!-- <el-table-column prop="name" label="姓名" align="center" width=""  show-overflow-tooltip>
+            </el-table-column> -->
+        
+        
+          <el-table-column
+            prop="roleName"
+            label="角色名称"
+            align="center"
+            width=""
+          ></el-table-column>
+          <el-table-column
+            prop="roleId"
+            label="角色编码"
+            align="center"
+            width=""
+            :formatter="formatterRole"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <el-pagination
+        small
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="pageNum"
+        layout="total, prev, pager, next"
+        :page-size="pageSize"
+        :total="total"
+      >
+      </el-pagination>
+      <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
+        </el-pagination> -->
+    </div>
+  </div>
+</template>
+
+<script>
+import { oSessionStorage } from "../../utils/utils";
+export default {
+  name: "userManage",
+  components: {},
+  data() {
+    return {
+      centerDialogVisible: false,
+      editUserFlag: false,
+      startTime: "",
+      endTime: "",
+      value1: null,
+      total: 2,
+      pageSize: 10,
+      pageNum: 1,
+      keyword: "",
+      tableData: [],
+      userInfo: {}, //用户信息
+      userId: "", //用户id
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
+      hospitalOrDepartment: "", //医院科室
+
+      invitationCode: "",
+      roleType: "0",
+      type: 0,
+      view: {
+        name: "",
+        userName: "",
+        channelId: "",
+        role: "",
+      },
+    };
+  },
+  created() {},
+  mounted() {
+    this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
+    this.invitationCode = this.userInfo.invitationCode;
+    //判断是超级管理员吗
+    if (this.userInfo.roleType == "1") {
+      this.type = 0;
+    } else if (this.userInfo.roleType == "3") {
+      //如果登录的是代理用户
+      this.type = 4;
+    } else if (this.userInfo.roleType == "2") {
+      this.type = 5;
+    }
+
+    if (this.$route.query.invitationCode) {
+      this.invitationCode = this.$route.query.invitationCode;
+      this.type = this.$route.query.type;
+    }
+    if (!this.userInfo) {
+      //如果用户信息不存在跳转登陆页
+      this.$router.push({ path: "/" });
+    }
+    this.searchTarget();
+  },
+  methods: {
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.searchList();
+    },
+    //根据现有情况进行搜索
+    searchList() {
+      //  let url =``
+      this.$http.get(`/role/find`, {}, (res) => {
+        // console.log(res,'用户测试记录')
+        if (res && res.code == 200) {
+          this.tableData = res.data;
+        } else {
+          // this.$toast.fail(res.msg);
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    searchTarget() {
+      this.pageNum = 1;
+      this.searchList();
+    },
+    //跳转首页
+    goHome() {
+      this.$router.push({ path: "/home" });
+    },
+    //跳转记录页
+    goRecord() {
+      this.$router.push({ path: "/record" });
+    },
+    //退出登陆
+    logout() {
+      oSessionStorage.removeItem("userInfo");
+      oSessionStorage.removeItem("token");
+      this.$router.push({ path: "/" });
+    },
+    //点击日历获取日期
+    getDate(param) {
+      // console.log(param,"日期。。。")
+      this.userRecord(param.dateStr);
+    },
+    //点击获取月出勤次数
+    getTimes(param) {
+      this.monthTimes = param;
+    },
+    // 用户测试记录显示
+    userRecord(date) {
+      this.$http.get(
+        `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
+        {},
+        (res) => {
+          // console.log(res,'用户测试记录')
+          if (res && res.code == 200) {
+            this.listData = res.data;
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../styles/theme.less";
+
+.record-warp {
+  width: 100%;
+  height: 80vh;
+  //background: url(../../assets/img/index/19.png) no-repeat center;
+  //background-size: 100% 100%;
+  position: relative;
+
+  .record-main {
+    width: 100%;
+    height: 100%;
+    box-sizing: border-box;
+    overflow-y: auto;
+
+    .search-head {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .zc-title {
+        color: #606266;
+        font-size: 14px;
+      }
+    }
+
+    .table-content {
+      margin: 10px 0;
+    }
+  }
+}
+
+.add_user_class {
+  margin-top: 10px;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3;
+}
+</style>

+ 157 - 214
src/views/manage/userManage.vue

@@ -3,151 +3,99 @@
     <div class="record-main">
       <el-row>
         <el-col :span="24">
-
           <div class="search-head">
-            <el-input
-                v-model="nameOrNumber"
-                clearable
-                placeholder="请输入姓名或编号"
-            ></el-input>&nbsp;&nbsp;
-            <span class="zc-title">注册日期</span>&nbsp;&nbsp;
-            <el-date-picker
-                clearable
-                class="popperClass"
-                v-model="value1"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                @change="timeFo"
-            >
-            </el-date-picker>&nbsp;&nbsp;
-            <el-button type="primary" @click="searchTarget">搜索</el-button>
+            <span>用户名:</span>
+            <el-input v-model="name" clearable placeholder="请输入用户名"></el-input>&nbsp;&nbsp;&nbsp;&nbsp;
+            <span>用户昵称:</span>
+            <el-input v-model="userName" clearable placeholder="请输入用户昵称"></el-input>&nbsp;&nbsp;
+            <el-button type="primary" icon="el-icon-search" @click="searchTarget">搜索</el-button>
+            <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch">清空</el-button>
+          </div>
+        </el-col>
+      </el-row>
+      <el-row class="add_user_class">
+        <el-col :span="24">
+          <div class="search-head">
+            <el-button type="primary" icon="el-icon-plus" @click="addUser">新增用户</el-button>
           </div>
-
         </el-col>
       </el-row>
 
       <div class="table-content">
-        <el-table
-          :data="tableData"
-          :row-style="{ height: '0px' }"
-          :cell-style="{ padding: '5px' }"
-        >
-          <el-table-column prop="name" label="姓名" align="center" width=""  show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column
-            show-overflow-tooltip
-            prop="userNumber"
-            label="编号"
-            align="center"
-            width=""
-          >
+        <el-table :data="tableData" :row-style="{ height: '0px' }" :cell-style="{ padding: '5px' }">
+          <!-- <el-table-column prop="name" label="姓名" align="center" width=""  show-overflow-tooltip>
+          </el-table-column> -->
+          <el-table-column show-overflow-tooltip prop="name" label="用户名" align="center" width="">
           </el-table-column>
-          <el-table-column
-            prop="gender"
-            label="性别"
-            align="center"
-            :formatter="forma"
-            width=""
-          >
+          <el-table-column prop="userName" label="用户昵称" align="center" width="">
           </el-table-column>
-          <el-table-column
-            prop="birthDate"
-            label="出生日期"
-            align="center"
-            width=""
-          ></el-table-column>
-          <el-table-column
-            prop="phone"
-            label="联系方式"
-            align="center"
-            width=""
-            show-overflow-tooltip
-          >
+          <!-- <el-table-column prop="state" label="用户状态" align="center" :formatter="formatterDelete" width="">
+          </el-table-column> -->
+          <el-table-column prop="channelId" label="所属渠道ID" align="center" width=""></el-table-column>
+          <el-table-column prop="type" label="所属角色" align="center" width="" :formatter="formatterRole"
+            show-overflow-tooltip>
           </el-table-column>
-          <el-table-column
-            prop="remainingDays"
-            label="剩余有效天数"
-            align="center"
-            width=""
-          ></el-table-column>
-<!--          <el-table-column-->
-<!--            prop="invitationCode"-->
-<!--            label="累计付款金额"-->
-<!--            align="center"-->
-<!--            width=""-->
-<!--          ></el-table-column>-->
-          <el-table-column
-            prop="registrationTime"
-            label="注册时间"
-            align="center"
-            width=""
-            show-overflow-tooltip
-          ></el-table-column>
           <el-table-column label="操作" width="510px" align="center">
             <template slot-scope="scope">
-              <el-button :disabled="scope.row.remainingDays >= 10" size="small" type="primary" @click.native.prevent="reminder(scope.row)">缴费提醒</el-button>
-              <el-button
-                  size="small"
-                  type="primary"
-                  @click.native.prevent="setDays(scope.$index, scope.row)">
-                修改剩余天数
-              </el-button>
-              <el-button
-                @click.native.prevent="resetPassword(scope.$index, scope.row)"
-                size="small"
-                type="primary"
-              >
-                重置密码
-              </el-button>
-              <el-button
-                @click.native.prevent="viewRecode(scope.$index, scope.row)"
-                size="small"
-                type="primary"
-              >
-                查看测试记录
-              </el-button>
+              <el-button @click="viewUser(scope.row)" v-if="scope.row.state != 0" type="text"
+                size="small">查看</el-button>
+              <el-button type="text" size="small" v-if="scope.row.state != 0"
+                @click="editUser(scope.row)">编辑</el-button>
 
-              <el-popconfirm
-                title="确定删除吗?"
-                placement="top"
-                @confirm="deleteUser(scope.$index, scope.row)"
-              >
-                <el-button
-                  size="small"
-                  style="margin-left: 10px"
-                  type="danger"
-                  slot="reference"
-                  >删除</el-button
-                >
+              <el-popconfirm v-if="scope.row.state != 0" title="确定删除吗?" placement="top"
+                @confirm="deleteUser(scope.$index, scope.row)">
+                <el-button size="small" style="margin-left: 10px" type="text" slot="reference">删除</el-button>
+              </el-popconfirm>
+              <el-popconfirm v-if="scope.row.state != 0" title="密码将重置为123456" placement="top"
+                @confirm="resetUser(scope.$index, scope.row)">
+                <el-button size="small" style="margin-left: 10px" type="text" slot="reference">重置密码</el-button>
               </el-popconfirm>
-              <!-- <el-button
-               type='primary'
-                @click.native.prevent="deleteUser(scope.$index, scope.row)"
-                size="small"
-              >
-                删除
-              </el-button> -->
             </template>
           </el-table-column>
         </el-table>
       </div>
 
-      <el-pagination
-        small
-        background
-        @current-change="handleCurrentChange"
-        :current-page.sync="pageNum"
-        layout="total, prev, pager, next"
-        :page-size="pageSize"
-        :total="total"
-      >
+      <el-pagination small background @current-change="handleCurrentChange" :current-page.sync="pageNum"
+        layout="total, prev, pager, next" :page-size="pageSize" :total="total">
       </el-pagination>
       <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
       </el-pagination> -->
     </div>
-    <Register ref="register" />
+    <Register ref="register" @search="searchTarget" />
+    <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
+      <div>
+        <div class="user_out">
+          <div class="user_out_sub">
+            用户名
+          </div>
+          <div class="user_out_subNext">
+            {{ view.name }}
+          </div>
+          <div class="user_out_sub">
+            用户昵称
+          </div>
+          <div class="user_out_subNext">
+            {{ view.userName }}
+          </div>
+
+        </div>
+        <div class="user_out">
+          <div class="user_out_sub">
+            所属渠道
+          </div>
+          <div class="user_out_subNext">
+            {{ view.channelId }}
+          </div>
+          <div class="user_out_sub">
+            所属角色
+          </div>
+          <div class="user_out_subNext">
+            {{ view.role }}
+          </div>
+
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -161,6 +109,8 @@ export default {
   },
   data() {
     return {
+      centerDialogVisible: false,
+      editUserFlag: false,
       startTime: "",
       endTime: "",
       value1: null,
@@ -171,15 +121,22 @@ export default {
       tableData: [],
       userInfo: {}, //用户信息
       userId: "", //用户id
-      nameOrNumber: "", //编号搜索
+      name: "", //根据名称搜索
+      userName: "", //根据昵称搜索
       hospitalOrDepartment: "", //医院科室
 
       invitationCode: "",
       roleType: "0",
       type: 0,
+      view: {
+        name: '',
+        userName: '',
+        channelId: '',
+        role: ''
+      },
     };
   },
-  created() {},
+  created() { },
   mounted() {
     this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
     this.invitationCode = this.userInfo.invitationCode;
@@ -201,83 +158,57 @@ export default {
       //如果用户信息不存在跳转登陆页
       this.$router.push({ path: "/" });
     }
-    // debugger;
-    // if (!this.userInfo) {
-    //   //如果用户信息不存在跳转登陆页
-    //   this.$router.push({ path: "/" });
-    // }
-    // this.userId = this.userInfo.id;
-    // this.userRecord(this.nowtime);
     this.searchTarget();
   },
   methods: {
-    timeFo(val) {
-      if (val !== null) {
-        this.startTime = this.formatterTime(val[0]);
-        this.endTime = this.formatterTime(val[1]);
+    formatterDelete(row) {
+      if (row.state == 0) {
+        return '已删除'
       } else {
-        this.startTime = "";
-        this.endTime = "";
-      }
-      this.searchTarget();
-    },
-    //时间格式化
-    formatterTime(val) {
-      let year = val.getFullYear();
-      let month = val.getMonth() + 1;
-      if (month < 10) {
-        month = "0" + month;
-      }
-      let day = val.getDate();
-      if (day < 10) {
-        day = "0" + day;
+        return '正常'
       }
-      return year + "-" + month + "-" + day;
     },
-    reminder(param){
-      // this.$message.error('开发中...')
-      this.$http.get(`v1/system/paymentReminder/${param.phone}`, {}, (res) => {
+    resetUser(index,val){
+      console.log(val)
+      this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
-          this.$message.success("发送成功");
+          this.$message.success("重置成功");
           this.searchTarget();
         } else {
-          this.$message.error("发送短信提醒失败");
+          this.$message.error(res.msg);
         }
       });
-
+      //重置密码
     },
-    //修改剩余天数
-    setDays(index,param) {
+    editUser(row) {
 
-        this.$prompt('请输入剩余有效天数', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          inputPattern: /^\+?[1-9]\d*$/,
-          inputErrorMessage: '请输入大于0天的整天数'
-        }).then(({ value }) => {
-          // this.$message({type: 'success', message: '开发中...'});
-          this.$http.post(`user/update`,
-            {
-              ...param,
-              remainingDays: value
-            },(res) => {
-            //  this.$toast.success({message:'成功'});
-            if (res && res.code == 200) {
-              this.$message.success("修改剩余天数成功");
-              this.searchTarget();
-            } else {
-              this.$message.error("修改剩余天数失败");
-            }
-          });
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '取消修改'
-          });
-        });
+      this.editRegisterUser(row)
 
     },
+    viewUser(row) {
+      this.view.name = row.name
+      this.view.userName = row.userName
+      this.view.channelId = row.channelId
+      this.view.role = row.type == '0' ? '渠道用户' : ''
+      this.centerDialogVisible = true;
+    },
+    addUser() {
+      this.addRegisterUser(true);
+    },
+    clearSearch() {
+      this.name = "";
+      this.userName = "";
+      this.searchTarget();
+    },
+    formatterRole(val) {
+      if (val.type == "1") {
+        return "超级管理员";
+      } else {
+        return "渠道用户";
+      }
+    },
+
     forma(val) {
       if (val.gender == "0") {
         return "男";
@@ -285,23 +216,14 @@ export default {
         return "女";
       }
     },
-    addRegisterUser() {
-      this.$refs.register.open(3);
+    addRegisterUser(val) {
+      this.$refs.register.open(val);
     },
-    resetPassword(val, value) {
-      //登陆接口调用
-      this.$http.post(`user/resetPassword/${value.id}`, {}, (res) => {
-        //  this.$toast.success({message:'成功'});
-        if (res && res.code == 200) {
-          this.$message.success("重置成功");
-          this.searchTarget();
-        } else {
-          this.$message.error(res.msg);
-        }
-      });
+    editRegisterUser(val){
+      this.$refs.register.edit(val);
     },
     deleteUser(index, row) {
-      this.$http.post(`user/delete/${row.id}`, {}, (res) => {
+      this.$http.delete(`/user/delete/${row.id}`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
           this.$message.success("删除成功");
@@ -311,10 +233,7 @@ export default {
         }
       });
     },
-    viewRecode(index, row) {
-      sessionStorage.setItem("manageUserId", row.id);
-      this.$router.push({ path: "/manage/userRecord/detail" });
-    },
+
     handleCurrentChange(val) {
       this.pageNum = val;
       this.searchList();
@@ -323,22 +242,19 @@ export default {
     searchList() {
       //  let url =``
       this.$http.post(
-        `user/findAll`,
+        `/user/find`,
         {
           pageNum: this.pageNum,
           pageSize: this.pageSize,
-          invitationCode: this.invitationCode,
-          nameOrNumber: this.nameOrNumber,
-          hospitalOrDepartment: this.hospitalOrDepartment,
-          type: this.type,
-          beginTime: this.startTime,
-          endTime: this.endTime,
+          phone: "",
+          name: this.name,
+          userName: this.userName,
         },
         (res) => {
           // console.log(res,'用户测试记录')
           if (res && res.code == 200) {
-            this.tableData = res.data.userEntities;
-            this.total = res.data.num;
+            this.tableData = res.data.content;
+            this.total = res.data.totalElements;
           } else {
             // this.$toast.fail(res.msg);
             this.$message.error(res.msg);
@@ -392,7 +308,6 @@ export default {
 };
 </script>
 
-
 <style lang="less" scoped>
 @import "../../styles/theme.less";
 
@@ -408,6 +323,7 @@ export default {
     height: 100%;
     box-sizing: border-box;
     overflow-y: auto;
+
     .search-head {
       width: 100%;
       display: flex;
@@ -420,9 +336,36 @@ export default {
         font-size: 14px;
       }
     }
+
     .table-content {
       margin: 10px 0;
     }
   }
 }
+
+.add_user_class {
+  margin-top: 10px;
+}
+
+.user_out {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  border: 1px solid #eeeeef;
+  line-height: 50px;
+  margin-top: 10px;
+}
+
+.user_out_sub {
+  flex: 1;
+  background-color: #fafafa;
+  text-align: center;
+  // color:#ffffff
+
+}
+
+.user_out_subNext {
+  padding-left: 10px;
+  flex: 3
+}
 </style>