Explorar el Código

监管平台-需求调整

Tang hace 2 años
padre
commit
7ae3573237

+ 6 - 0
src/api/api.js

@@ -101,11 +101,17 @@ import studyAccountStatus from '../newApi/studyAccountStatus'//学习账号标
 import mock from '../newApi/mock'//模考管理
 import mockSub from '../newApi/mockSub'//预约模考管理
 import systemExam from '../newApi/systemExam'//模考活动列表
+//分销相关
+
+import poster from '../fxApi/poster'//海报列表
+import temp from '../fxApi/temp'//分销活动列表
 
 
 
 // 导入对应模块------------------------
 export default {
+    ...poster,
+    ...temp,
     ...courseEducationType,
     ...courseProjectType,
     ...applyAreas,

+ 18 - 7
src/components/Study/StudentInfo.vue

@@ -4,15 +4,25 @@
       <div class="left"><i></i><span>学员信息</span></div>
       <div class="goods_info">
         <span v-for="(item, i) in headList" :key="i">
-          <strong style="color: red">「{{ i + 1 }}」</strong>
-          {{ item.lebel }}
-          <span v-if="item.key != 'num' && item.key != 'time'">{{
+          <strong>「{{ i + 1 }}」</strong>
+          <span style="padding-left: 0px">{{ item.lebel }}</span>
+          <!-- <span v-if="item.key != 'num' && item.key != 'time'">{{
+            userData[item.key]
+          }}</span> -->
+
+          <span v-if="item.key == 'goodsName'">{{ userData[item.key] }}</span>
+          <span v-else-if="item.key == 'className'">{{
             userData[item.key]
           }}</span>
+          <span
+            v-else-if="item.key == 'classHours'"
+            style="color: red; font-weight: bold"
+            >{{ parseInt(userData["finishSectionDuration"] / 60 / 45) }}</span
+          >
           <span v-else-if="item.key == 'num'"
             >完成{{ userData.stuAllNum + userData.recordNum }}节的内容学习</span
           >
-          <span v-else-if="item.key == 'time'" style="padding-right: 50px;"
+          <span v-else-if="item.key == 'time'" style="padding-right: 50px"
             >{{ $methodsTools.onlyForma(userData.studyStartTime, false) }} -
             {{ $methodsTools.onlyForma(userData.studyEndTime, false) }}</span
           >
@@ -118,7 +128,7 @@ export default {
       const list = [
         { lebel: "所在班级:", key: "className" },
         { lebel: "学时:", key: "classHours" },
-        { lebel: "", key: "num" },
+        // { lebel: "", key: "num" },
         { lebel: "学习时间:", key: "time" },
       ];
       if (this.all) {
@@ -165,7 +175,7 @@ export default {
       flex-wrap: wrap;
       span {
         font-size: 14px;
-        padding-left: 20px;
+        padding-left: 10px;
         white-space: nowrap;
       }
     }
@@ -237,4 +247,5 @@ export default {
     }
   }
 }
-</style>>
+</style>
+>

+ 353 - 0
src/components/goodsList/index.vue

@@ -0,0 +1,353 @@
+<template>
+  <div id="">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="1088px"
+      :show-close="false"
+      :close-on-click-modal="false"
+      destroy-on-close
+      @closed="close"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">选择商品</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <search-box-new
+        ref="searchBox"
+        :formData="formData"
+        :formList="formList"
+        @search="search"
+        @init="search(2)"
+        :topType="topType"
+      />
+      <el-table
+        ref="table"
+        row-key="goodsId"
+        :data="tableData"
+        v-loading="loading"
+        border
+        style="width: 100%"
+        @selection-change="selectionChange"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+          reserve-selection
+          :selectable="dis_active"
+        >
+        </el-table-column>
+        <el-table-column
+          align="center"
+          type="index"
+          :disabled="true"
+        ></el-table-column>
+        <template v-for="(item, index) in tableSet">
+          <el-table-column
+            header-align="center"
+            :align="item.align ? item.align : 'center'"
+            :prop="item.prop"
+            :label="item.label"
+            :width="item.width || ''"
+            ><template slot-scope="scope"
+              ><div v-if="item.scope === 'options'">
+                <template v-for="(itemt, indext) in item.options">
+                  <span v-if="itemt.value === scope.row[item.prop]">{{
+                    itemt.label
+                  }}</span>
+                </template>
+              </div>
+              <span v-else-if="item.scope === 'leftCh'"
+                >{{ item.ch }}{{ scope.row[item.prop] }}</span
+              >
+              <span v-else>{{ scope.row[item.prop] }}</span></template
+            >
+          </el-table-column>
+        </template>
+      </el-table>
+      <div style="margin-top: 10px; text-align: center">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="formData.pageNum"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="formData.pageSize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+        >
+        </el-pagination>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitTable" :loading="disbtn"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import searchBoxNew from "@/components/searchBoxNew";
+export default {
+  components: { searchBoxNew },
+  data() {
+    return {
+      topType: true,
+      disbtn: false,
+      dialogVisible: false,
+      //搜索
+      formList: [
+        {
+          prop: "educationTypeId",
+          placeholder: "教育类型",
+          scope: "educationType",
+        },
+        {
+          prop: "businessId",
+          placeholder: "业务层次",
+          scope: "businessLevel",
+          edu: "educationTypeId",
+        },
+        {
+          prop: "schoolId",
+          placeholder: "院校",
+          scope: "schoolList",
+          edu: "educationTypeId",
+        },
+        {
+          prop: "majorId",
+          placeholder: "专业",
+          scope: "Professional",
+          edu: "educationTypeId",
+        },
+        {
+          prop: "subjectId",
+          placeholder: "科目",
+          scope: "sujectType",
+          edu: "educationTypeId",
+        },
+        {
+          prop: "status",
+          placeholder: "商品状态",
+          scope: "select",
+          noClear: false,
+          options: [
+            {
+              label: "全部状态",
+              value: "0,1",
+            },
+            {
+              label: "有效",
+              value: 1,
+            },
+            {
+              label: "无效",
+              value: 0,
+            },
+          ],
+        },
+        {
+          prop: "goodsStatus",
+          placeholder: "前台可售状态",
+          scope: "select",
+          options: [
+            {
+              label: "已上架",
+              value: 1,
+            },
+            {
+              label: "未上架",
+              value: 0,
+            },
+          ],
+        },
+        {
+          prop1: "validityStartTime",
+          prop2: "validityEndTime",
+          placeholder1: "商品有效期开始时间",
+          placeholder2: "商品有效期结束时间",
+          scope: "moreDataPicker",
+        },
+        // {
+        //   prop: "orderGoodsStatus",
+        //   placeholder: "退款状态",
+        //   scope: "select",
+        //   options: [
+        //     {
+        //       label: "已退款",
+        //       value: 1,
+        //     },
+        //     {
+        //       label: "退款中",
+        //       value: 2,
+        //     },
+        //     {
+        //       label: "拒绝退款",
+        //       value: 3,
+        //     },
+        //   ],
+        // },
+        {
+          prop: "goodsName",
+          placeholder: "请输入商品名称",
+        },
+      ],
+      formData: {
+        goodsType: "",
+        status: "0,1",
+        pageSize: 10,
+        pageNum: 1,
+      },
+      // 表单
+      tableSet: [
+        {
+          label: "商品名称",
+          prop: "goodsName",
+          hidden: true,
+        },
+        {
+          label: "商品编码",
+          prop: "code",
+          hidden: true,
+        },
+        {
+          label: "科目",
+          prop: "subjectNames",
+          hidden: true,
+        },
+        {
+          label: "学时",
+          prop: "classHours",
+          hidden: true,
+        },
+        {
+          label: "商品价格",
+          prop: "standPrice",
+          hidden: true,
+          scope: "leftCh",
+          ch: "¥",
+        },
+        {
+          label: "商品划线价",
+          prop: "linePrice",
+          hidden: true,
+          scope: "leftCh",
+          ch: "¥",
+        },
+        {
+          label: "可售状态",
+          prop: "goodsStatus",
+          hidden: true,
+          scope: "options",
+          options: [
+            {
+              label: "正常",
+              value: 1,
+            },
+            {
+              label: "关闭",
+              value: 0,
+            },
+          ],
+        },
+      ],
+      tableData: [],
+      loading: false,
+      total: 0,
+      outActive: [], //置灰列表
+      active: [], //当前选中
+    };
+  },
+  methods: {
+    selectionChange(e) {
+      this.active = e;
+    },
+    showBox(e) {
+      if (e && e.length > 0) {
+        this.outActive = e;
+      }
+      this.search(2);
+      this.dialogVisible = true;
+    },
+    dis_active(e) {
+      return this.outActive.includes(e.goodsId) ? false : true;
+    },
+    search(int) {
+      if (int === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          goodsType: "",
+          status: "0,1",
+        };
+      }
+      if (int === 3) {
+        this.formData.pageNum = 1;
+      }
+      var data = JSON.parse(JSON.stringify(this.formData));
+      if (this.formData.validityStartTime) {
+        data.validityStartTime = data.validityStartTime / 1000;
+      }
+      if (this.formData.validityEndTime) {
+        data.validityEndTime = data.validityEndTime / 1000;
+      }
+      this.loading = true;
+      this.$api
+        .inquireGoods(data)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    submitTable() {
+      if (this.active.length === 0) {
+        this.$message.warning("请勾选商品");
+        return;
+      }
+      this.disbtn = true;
+      const array = this.active.map((item) => {
+        return {
+          goodsId: item.goodsId,
+          goodsName: item.goodsName,
+          goodsPrice: item.standPrice,
+          profitMax: "",
+          profitType: 1,
+          profitOne: "",
+          profitTwo: "",
+          profitThree: "",
+        };
+      });
+      this.dialogVisible = false;
+      this.$emit("backGoodsList", array);
+    },
+    close() {
+      this.disbtn = false;
+      this.$refs.table.clearSelection();
+      this.outActive = [];
+      this.active = [];
+    },
+    handleSizeChange(e) {
+      this.formData.pageSize = e;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(e) {
+      this.formData.pageNum = e;
+      this.search();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 1 - 1
src/components/modelView/index.vue

@@ -8,7 +8,7 @@
     <img
       :style="modelData.background.css"
       v-if="modelData.background.checked"
-      :src="modelData.background.name"
+      :src="$methodsTools.splitImgHost(modelData.background.name)"
       alt=""
       crossorigin="anonymous"
     />

+ 42 - 0
src/fxApi/poster.js

@@ -0,0 +1,42 @@
+import request from '@/utils/request' //引入axios请求及拦截器
+export default {
+    //新增海报模板
+    distributionpostersave(data) {
+        return request({
+            url: '/distribution/poster/save', 
+            method: 'post',
+            data
+        })
+    },
+    //修改海报模板
+    editdistributionposter(data) {
+        return request({
+            url: '/distribution/poster/edit',
+            method: 'post',
+            data
+        })
+    },
+    //查询海报模板列表
+    inquiredistributionposterlist(data) {
+        return request({
+            url: '/distribution/poster/list',
+            method: 'get',
+            params: data
+        })
+    },
+    //获取海报模板详细信息
+    obtaindistributionposter(data) {
+        return request({
+            url: `/distribution/poster/` + data,
+            method: 'get',
+        })
+    },
+    //查询海报模板列表
+    inquiredistributionposterimagelist(data) {
+        return request({
+            url: '/distribution/poster/image/list',
+            method: 'get',
+            params: data
+        })
+    },
+}

+ 74 - 0
src/fxApi/temp.js

@@ -0,0 +1,74 @@
+import request from '@/utils/request' //引入axios请求及拦截器
+export default {
+    //新增分销活动模板
+    distributiontempsave(data) {
+        return request({
+            url: '/distribution/temp/save', 
+            method: 'post',
+            data
+        })
+    },
+    //修改分销活动模板
+    editdistributiontemp(data) {
+        return request({
+            url: '/distribution/temp/edit',
+            method: 'post',
+            data
+        })
+    },
+    //启用-禁用
+    editdistributiontempupdatestatus(data) {
+        return request({
+            url: '/distribution/temp/update/status',
+            method: 'post',
+            data
+        })
+    },
+    //导出【请填写功能名称】列表
+    distributiontempexport(data) {
+        return request({
+            url: '/distribution/temp/export',
+            method: 'get',
+            params: data
+        })
+    },
+    //查询分销活动模板列表
+    distributiontemplist(data) {
+        return request({
+            url: '/distribution/temp/list',
+            method: 'get',
+            params: data
+        })
+    },
+    //活动模板发布
+    distributiontemppublishdata(data) {
+        return request({
+            url: `/distribution/temp/publish/` + data,
+            method: 'get',
+        })
+    },
+    //获取分销活动模板详细信息
+    distributiontempdata(data) {
+        return request({
+            url: `/distribution/temp/` + data,
+            method: 'get',
+        })
+    },
+    //查询系统商户列表
+    systemtenantlist(data) {
+        return request({
+            url: '/system/tenant/list',
+            method: 'get',
+            params: data
+        })
+    },
+    //分销业务员列表
+    distributiontempsellerlist(data) {
+        return request({
+            url: '/distribution/temp/seller/list',
+            method: 'get',
+            params: data
+        })
+    },
+    
+}

+ 124 - 0
src/views/Marketing/activitySystem/activityList/activityInfo/first.vue

@@ -0,0 +1,124 @@
+<template>
+  <div id="">
+    <el-row>
+      <el-col :span="14">
+        <el-form-item label="活动名称" prop="name">
+          <el-input v-model="ruleForm.name"></el-input>
+        </el-form-item>
+        <el-form-item label="选择模板" prop="posterTempId">
+          <el-select v-model="ruleForm.posterTempId" placeholder="请选择模板">
+            <el-option
+              v-for="item in modelList"
+              :label="item.name"
+              :value="item.posterTempId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="活动时间" prop="timeList">
+          <el-date-picker
+            v-model="ruleForm.timeList"
+            type="datetimerange"
+            :picker-options="pickerOptions"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            value-format="timestamp"
+          >
+          </el-date-picker>
+        </el-form-item>
+        </el-col
+      >
+      <el-col :span="6" :offset="4" v-show="ruleForm.posterTempId">
+        <div style="text-align: center">
+          <el-image
+            style="width: 187.5px; height: 333.5px"
+            :src="ModelUrl(ruleForm.posterTempId)"
+            :preview-src-list="[ModelUrl(ruleForm.posterTempId)]"
+          >
+          </el-image>
+          <h2>模板预览</h2>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    ruleForm: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      modelList: [],
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getModelList();
+  },
+  computed: {
+    ModelUrl: function () {
+      return function (k) {
+        if (k) {
+          for (let i = 0; i < this.modelList.length; i++) {
+            if (this.modelList[i].posterTempId === k) {
+              return this.$methodsTools.splitImgHost(
+                this.modelList[i].posterUrl
+              );
+            }
+          }
+        } else {
+          return "";
+        }
+      };
+    },
+  },
+  methods: {
+    //获取模板列表
+    getModelList() {
+      this.$api.inquiredistributionposterlist({ status: 1 }).then((res) => {
+        this.modelList = res.rows;
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

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

@@ -0,0 +1,283 @@
+<template>
+  <div id="">
+    <el-form
+      :model="ruleForm"
+      :rules="rules"
+      ref="ruleForm"
+      label-width="120px"
+      class="demo-ruleForm"
+      :disabled="id ? true : false"
+    >
+      <First :ruleForm="ruleForm"></First>
+      <Second :ruleForm="ruleForm" @backGoodsList="backGoodsList"></Second>
+      <Three :ruleForm="ruleForm" @backTenantList="backTenantList"></Three
+    ></el-form>
+    <div style="text-align: center">
+      <el-button @click="close">取消</el-button>
+      <el-button type="primary" @click="submitForm('ruleForm')" v-if="!id"
+        >保存</el-button
+      >
+      <el-button type="primary" @click="submitForm('ruleForm', true)" v-if="!id"
+        >发布</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import First from "./first.vue";
+import Second from "./second.vue";
+import Three from "./three.vue";
+export default {
+  components: { First, Second, Three },
+  data() {
+    return {
+      ruleForm: {
+        publishStatus: 0,
+        goodsList: [], //商品列表
+        tenantList: [], //机构列表
+      },
+      rules: {
+        name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
+        posterTempId: [
+          { required: true, message: "请选择模板", trigger: "change" },
+        ],
+        timeList: [
+          { required: true, message: "请选择活动时间", trigger: "change" },
+        ],
+        freezingPeriod: [
+          { required: true, message: "请输入佣金冻结天数", trigger: "blur" },
+        ],
+      },
+      id: "",
+    };
+  },
+  created() {
+    this.id = this.$route.query.id;
+    if (this.id) {
+      this.getInit();
+    }
+  },
+  methods: {
+    close() {
+        this.$store.dispatch("tagsView/exitView", this.$route).then((res) => {
+          this.$router.push({
+            path: "activityList",
+          });
+        });
+    },
+    getInit() {
+      this.$api.distributiontempdata(this.id).then((res) => {
+        res.data.timeList = [
+          parseInt(res.data.startTime * 1000),
+          parseInt(res.data.endTime * 1000),
+        ];
+        this.$nextTick(() => {
+          this.ruleForm = res.data;
+        });
+      });
+    },
+    //提交
+    submitForm(formName, status) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.checkGoodsFunc()
+            .then(() => {
+              var data = JSON.parse(JSON.stringify(this.ruleForm));
+              data.startTime = data.timeList[0] / 1000;
+              data.endTime = data.timeList[1] / 1000;
+              if (status) {
+                data.publishStatus = 1;
+              }
+              this.$api[
+                data.id ? "editdistributiontemp" : "distributiontempsave"
+              ](data).then((res) => {
+                this.$message.success("成功");
+                setTimeout(() => {
+                  this.$store
+                    .dispatch("tagsView/exitView", this.$route)
+                    .then((res) => {
+                      this.$router.push({
+                        path: "activityList",
+                      });
+                    });
+                }, 300);
+              });
+            })
+            .catch((err) => {
+              this.$message.error(err);
+            });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    //处理商品佣金逻辑
+    checkGoodsFunc() {
+      return new Promise((resolve, reject) => {
+        for (let i = 0; i < this.ruleForm.goodsList.length; i++) {
+          if (this.ruleForm.goodsList[i].profitType === 1) {
+            //百分比处理
+            if (this.ruleForm.goodsList[i].profitMax > 100) {
+              return reject(`请检查第${i + 1}个商品的数组设置`);
+            } else {
+              let countNum =
+                parseFloat(this.ruleForm.goodsList[i].profitOne) +
+                parseFloat(this.ruleForm.goodsList[i].profitTwo) +
+                parseFloat(this.ruleForm.goodsList[i].profitThree);
+              if (countNum > this.ruleForm.goodsList[i].profitMax) {
+                return reject(
+                  `请检查第${
+                    i + 1
+                  }个商品的佣金设置,三个级别佣金相加不能大于数值`
+                );
+              }
+            }
+          }
+          if (this.ruleForm.goodsList[i].profitType === 2) {
+            //固定金额处理
+            if (
+              this.ruleForm.goodsList[i].profitMax >
+              this.ruleForm.goodsList[i].goodsPrice
+            ) {
+              return reject(`请检查第${i + 1}个商品的数组设置`);
+            } else {
+              let countNum =
+                parseFloat(this.ruleForm.goodsList[i].profitOne) +
+                parseFloat(this.ruleForm.goodsList[i].profitTwo) +
+                parseFloat(this.ruleForm.goodsList[i].profitThree);
+              if (countNum > this.ruleForm.goodsList[i].profitMax) {
+                return reject(
+                  `请检查第${
+                    i + 1
+                  }个商品的佣金设置,三个级别佣金相加不能大于数值`
+                );
+              }
+            }
+          }
+        }
+        resolve();
+      });
+    },
+    //商品列表选中返回
+    backGoodsList(e) {
+      this.$nextTick(() => {
+        this.ruleForm.goodsList.push(...e);
+      });
+    },
+    //机构列表选中返回
+    backTenantList(e) {
+      this.$nextTick(() => {
+        this.ruleForm.tenantList.push(...e);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+/deep/.el-button {
+  border-radius: 8px;
+}
+
+/deep/.el-dialog {
+  border-radius: 8px;
+
+  .el-dialog__header {
+    padding: 0;
+
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+
+  .el-dialog__footer {
+    padding: 0;
+
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+
+  p {
+    margin: 5px 0px;
+  }
+}
+</style>

+ 210 - 0
src/views/Marketing/activitySystem/activityList/activityInfo/second.vue

@@ -0,0 +1,210 @@
+<template>
+  <div id="">
+    <el-row>
+      <el-col :span="24">
+        <el-form-item label="设置商品及佣金" prop="goodsList">
+          <p>
+            <el-button type="primary" @click="activeGoods">新增</el-button>
+          </p>
+          <el-table :data="ruleForm.goodsList" border style="width: 100%">
+            <el-table-column
+              align="center"
+              v-for="(item, index) in goodsSet"
+              :key="index"
+              :prop="item.prop"
+              :label="item.label"
+              :width="item.width"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                <el-input-number
+                  v-if="item.scope === 'price'"
+                  style="width: 100px"
+                  v-model="scope.row[item.prop]"
+                  :precision="scope.row['profitType'] === 1 ? 0 : 2"
+                  :min="0"
+                  :controls="false"
+                ></el-input-number>
+                <el-input-number
+                  v-else-if="item.scope === 'goodsPrice'"
+                  style="width: 100px"
+                  v-model="scope.row[item.prop]"
+                  :precision="2"
+                  :min="0"
+                  :controls="false"
+                  @change="
+                    {
+                      (scope.row['profitMax'] = ''),
+                        (scope.row['profitOne'] = ''),
+                        (scope.row['profitTwo'] = ''),
+                        (scope.row['profitThree'] = '');
+                    }
+                  "
+                ></el-input-number>
+                <el-input-number
+                  v-else-if="item.scope === 'priceChan'"
+                  style="width: 100px"
+                  v-model="scope.row[item.prop]"
+                  :precision="scope.row['profitType'] === 1 ? 0 : 2"
+                  :min="0"
+                  :max="
+                    scope.row['profitType'] === 1
+                      ? 100
+                      : scope.row['profitType'] === 2
+                      ? scope.row['goodsPrice']
+                      : ''
+                  "
+                  :controls="false"
+                ></el-input-number>
+                <el-select
+                  v-else-if="item.scope === 'select'"
+                  v-model="scope.row[item.prop]"
+                  placeholder="请选择分佣方式"
+                  @change="
+                    {
+                      (scope.row['profitMax'] = ''),
+                        (scope.row['profitOne'] = ''),
+                        (scope.row['profitTwo'] = ''),
+                        (scope.row['profitThree'] = '');
+                    }
+                  "
+                >
+                  <el-option
+                    v-for="item in profitTypeList"
+                    :label="item.label"
+                    :value="item.value"
+                  ></el-option>
+                </el-select>
+                <span v-else>{{ scope.row[item.prop] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              fixed="right"
+              label="操作"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  type="text"
+                  size="small"
+                  @click="ruleForm.goodsList.splice(scope.$index, 1)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column></el-table
+          >
+        </el-form-item>
+        <p
+          style="
+            color: rgba(134, 144, 156, 1);
+            font-size: 16px;
+            margin-left: 120px;
+          "
+        >
+          分佣方式设置为百分比时,数值不能超过100%,3个等级的佣金总和不能超过100%;<br />分佣方式设置为固定金额时,数值不能超过该固定金额,3个等级的佣金总和不能超过该数值。
+        </p>
+        <el-form-item label="佣金冻结期" prop="freezingPeriod">
+          <el-input-number
+            style="width: 70px"
+            v-model="ruleForm.freezingPeriod"
+            :precision="0"
+            :max="9999"
+            :min="0"
+            :controls="false"
+          ></el-input-number>
+          <span style="margin-left: 8px; font-weight: bold">天</span>
+        </el-form-item>
+        <p
+          style="
+            color: rgba(134, 144, 156, 1);
+            font-size: 16px;
+            margin-left: 120px;
+          "
+        >
+          冻结期的设置要考虑到退款的可能并设置安全合理的天数,建议最少为3天;
+        </p>
+      </el-col>
+    </el-row>
+    <goodsList ref="goodsList" v-on="$listeners"></goodsList>
+  </div>
+</template>
+
+<script>
+import goodsList from "@/components/goodsList";
+export default {
+  components: { goodsList },
+  props: {
+    ruleForm: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      goodsSet: [
+        {
+          label: "商品名称",
+          prop: "goodsName",
+        },
+        {
+          label: "价格",
+          prop: "goodsPrice",
+          scope: "goodsPrice",
+          width: "130",
+        },
+        {
+          label: "分佣方式",
+          prop: "profitType",
+          scope: "select",
+          width: "170",
+        },
+        {
+          label: "数值",
+          prop: "profitMax",
+          scope: "priceChan",
+          width: "130",
+        },
+        {
+          label: "一级佣金",
+          prop: "profitOne",
+          scope: "price",
+          width: "130",
+        },
+        {
+          label: "二级佣金",
+          prop: "profitTwo",
+          scope: "price",
+          width: "130",
+        },
+        {
+          label: "三级佣金",
+          prop: "profitThree",
+          scope: "price",
+          width: "130",
+        },
+      ],
+      profitTypeList: [
+        {
+          label: "百分比(%)",
+          value: 1,
+        },
+        {
+          label: "固定金额(元)",
+          value: 2,
+        },
+      ],
+    };
+  },
+  methods: {
+    activeGoods() {
+      const array = this.ruleForm.goodsList.map((item) => item.goodsId);
+      this.$refs.goodsList.showBox(array);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 194 - 0
src/views/Marketing/activitySystem/activityList/activityInfo/tenant.vue

@@ -0,0 +1,194 @@
+<template>
+  <div id="">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="1088px"
+      :show-close="false"
+      :close-on-click-modal="false"
+      destroy-on-close
+      @closed="close"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">选择机构</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <el-table
+        ref="table"
+        row-key="tenantId"
+        :data="tableData"
+        v-loading="loading"
+        border
+        style="width: 100%"
+        @selection-change="selectionChange"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+          reserve-selection
+          :selectable="dis_active"
+        >
+        </el-table-column>
+        <el-table-column
+          align="center"
+          type="index"
+          :disabled="true"
+        ></el-table-column>
+        <template v-for="(item, index) in tableSet">
+          <el-table-column
+            header-align="center"
+            :align="item.align ? item.align : 'center'"
+            :prop="item.prop"
+            :label="item.label"
+            :width="item.width || ''"
+            ><template slot-scope="scope"
+              ><div v-if="item.scope === 'options'">
+                <template v-for="(itemt, indext) in item.options">
+                  <span v-if="itemt.value === scope.row[item.prop]">{{
+                    itemt.label
+                  }}</span>
+                </template>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
+            >
+          </el-table-column>
+        </template>
+      </el-table>
+      <div style="margin-top: 10px; text-align: center">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="formData.pageNum"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="formData.pageSize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+        >
+        </el-pagination>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitTable" :loading="disbtn"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      disbtn: false,
+      dialogVisible: false,
+      formData: {
+        pageSize: 10,
+        pageNum: 1,
+      },
+      // 表单
+      tableSet: [
+        {
+          label: "租户ID",
+          prop: "tenantId",
+          hidden: true,
+        },
+        {
+          label: "租户名称",
+          prop: "tenantName",
+          hidden: true,
+        },
+        {
+          label: "地址",
+          prop: "address",
+          hidden: true,
+        },
+        {
+          label: "状态",
+          prop: "status",
+          hidden: true,
+          scope: "options",
+          options: [
+            {
+              label: "启用",
+              value: 1,
+            },
+            {
+              label: "失效",
+              value: 0,
+            },
+          ],
+        },
+      ],
+      tableData: [],
+      loading: false,
+      total: 0,
+      outActive: [], //置灰列表
+      active: [], //当前选中
+    };
+  },
+  methods: {
+    selectionChange(e) {
+      this.active = e;
+    },
+    showBox(e) {
+      if (e && e.length > 0) {
+        this.outActive = e;
+      }
+      this.getList(true);
+      this.dialogVisible = true;
+    },
+    dis_active(e) {
+      return this.outActive.includes(e.tenantId) ? false : true;
+    },
+    getList(int) {
+      if (int) {
+        this.formData = { pageSize: 10, pageNum: 1 };
+      }
+      this.loading = true;
+      this.$api
+        .systemtenantlist(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    submitTable() {
+      if (this.active.length === 0) {
+        this.$message.warning("请勾选机构");
+        return;
+      }
+      this.disbtn = true;
+      this.dialogVisible = false;
+      this.$emit("backTenantList", this.active);
+    },
+    close() {
+      this.disbtn = false;
+      this.$refs.table.clearSelection();
+      this.outActive = [];
+      this.active = [];
+    },
+    handleSizeChange(e) {
+      this.formData.pageSize = e;
+      this.formData.pageNum = 1;
+      this.getList();
+    },
+    handleCurrentChange(e) {
+      this.formData.pageNum = e;
+      this.getList();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 120 - 0
src/views/Marketing/activitySystem/activityList/activityInfo/three.vue

@@ -0,0 +1,120 @@
+<template>
+  <div id="">
+    <el-row>
+      <el-col :span="24">
+        <el-form-item label="选择推送机构" prop="tenantList">
+          <p>
+            <el-button type="primary" @click="activeTenant">新增</el-button>
+          </p>
+          <el-table :data="ruleForm.tenantList" border style="width: 100%">
+            <el-table-column
+              align="center"
+              v-for="(item, index) in mechanismSet"
+              :key="index"
+              :prop="item.prop"
+              :label="item.label"
+              :width="item.width"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                <div v-if="item.scope === 'options'">
+                  <template v-for="(itemt, indext) in item.options">
+                    <span v-if="itemt.value === scope.row[item.prop]">{{
+                      itemt.label
+                    }}</span>
+                  </template>
+                </div>
+                <span v-else>{{ scope.row[item.prop] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              fixed="right"
+              label="操作"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  type="text"
+                  size="small"
+                  @click="ruleForm.tenantList.splice(scope.$index, 1)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column></el-table
+          >
+        </el-form-item>
+        <el-form-item label="描述" prop="remark">
+          <el-input
+            type="textarea"
+            :rows="6"
+            v-model="ruleForm.remark"
+          ></el-input>
+          <p style="color: rgba(134, 144, 156, 1); font-size: 14px">
+            说明:<br />1.
+            当订单完成以后,该链路上所有推广者根据其相应等级进行分佣,每个推广者的分佣金额或比例不会超过商品的最大限额<br />2.
+            考虑到商品退款情况,商品金额需要完全入账方可解冻对应佣金,具体时间需与业务部门沟通<br />3.
+            选择固定数值时请注意商品成本
+          </p>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <tenant ref="tenant" v-on="$listeners"></tenant>
+  </div>
+</template>
+
+<script>
+import tenant from "./tenant";
+export default {
+  components: { tenant },
+  props: {
+    ruleForm: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      mechanismSet: [
+        {
+          label: "租户ID",
+          prop: "tenantId",
+        },
+        {
+          label: "租户名称",
+          prop: "tenantName",
+        },
+        {
+          label: "地址",
+          prop: "address",
+        },
+        {
+          label: "状态",
+          prop: "status",
+          scope: "options",
+          options: [
+            {
+              label: "启用",
+              value: 1,
+            },
+            {
+              label: "失效",
+              value: 0,
+            },
+          ],
+        },
+      ],
+    };
+  },
+  methods: {
+    activeTenant() {
+      const array = this.ruleForm.tenantList.map((item) => item.tenantId);
+      this.$refs.tenant.showBox(array);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 302 - 7
src/views/Marketing/activitySystem/activityList/index.vue

@@ -1,21 +1,316 @@
 <template>
-  <div id="">
-活动列表
+  <div id="ActivityList">
+    <search-box-new
+      ref="searchBox"
+      :formData="formData"
+      :formList="formList"
+      @search="search"
+      @init="init"
+    />
+    <table-list
+      rowKey="id"
+      ref="tableList"
+      :tableSets="tableSet"
+      :tableData="tableData"
+      :navText="navText"
+      :loading="loading"
+      @addClick="addClick"
+    >
+      <template slot="btn" slot-scope="props">
+        <el-button type="text" @click="editClick(props.scope.row)"
+          >详情</el-button
+        ><el-button
+          v-if="props.scope.row.publishStatus === 0"
+          type="text"
+          @click="sendUpload(props.scope.row)"
+          >发布</el-button
+        >
+      </template>
+    </table-list>
+    <pagination
+      :total="total"
+      :pageSize="formData.pageSize"
+      :currentPage="formData.pageNum"
+      @handleSizeChange="handleSizeChange"
+      @handleCurrentChange="handleCurrentChange"
+    />
   </div>
 </template>
 
 <script>
+import searchBoxNew from "@/components/searchBoxNew";
+import tableList from "@/components/tableList";
+import pagination from "@/components/pagination";
 export default {
-  data () {
+  name: "ActivityList",
+  components: { searchBoxNew, tableList, pagination },
+  data() {
     return {
-    }
+      disabledBtn: false,
+      loading: false, //当前表单加载是否加载动画
+      navText: {
+        title: "活动管理",
+        index: 0,
+        ch: "条",
+        num: true,
+        choice: false,
+        addHide: false,
+        openCheckMore: true,
+        changeWidth: "100px",
+        backFatherBtn: {
+          status: false,
+          title: "配置下单填选模板",
+        },
+      },
+      //搜索
+      formList: [
+        {
+          lable: "活动名称",
+          prop: "name",
+          placeholder: "请输入活动名称",
+        },
+      ],
+      formData: {
+        pageSize: 10,
+        pageNum: 1,
+      },
+      // 表单
+      tableSet: [
+        {
+          label: "活动名称",
+          prop: "name",
+          hidden: true,
+        },
+        {
+          label: "活动类型",
+          prop: "type",
+          hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "分销活动",
+              value: 1,
+            },
+          ],
+        },
+        {
+          label: "模板",
+          prop: "posterTempName",
+          hidden: true,
+        },
+        {
+          label: "活动开始时间",
+          prop: "startTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "活动结束时间",
+          prop: "endTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "创建时间",
+          prop: "createTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "发布状态",
+          prop: "publishStatus",
+          hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "已发布",
+              value: 1,
+            },
+            {
+              label: "未发布",
+              value: 0,
+            },
+          ],
+        },
+        {
+          label: "备注",
+          prop: "remark",
+          hidden: true,
+        },
+      ],
+      tableData: [], //表单数据
+      total: 0, //一共多少条
+    };
+  },
+  created() {
+    this.search();
   },
   methods: {
+    addClick() {
+      this.$router.push({
+        path: "activityInfo",
+      });
+      // this.$refs.model.showBox();
+    },
+    editClick(e) {
+      this.$router.push({
+        path: "activityInfo",
+        query: {
+          id: e.id,
+        },
+      });
+    },
+    search(v) {
+      this.loading = true;
+      if (v === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+        };
+      }
+      var data = JSON.parse(JSON.stringify(this.formData));
+      // if (this.formData.classStartTime) {
+      //   data.classStartTime = parseInt(data.classStartTime / 1000);
+      // }
+      // if (this.formData.classEndTime) {
+      //   data.classEndTime = parseInt(data.classEndTime / 1000);
+      // }
+      this.$api
+        .distributiontemplist(data)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    init() {
+      this.search(2);
+    },
+    sendUpload(v) {
+      this.$alert("是否发布", "提示", {
+        dangerouslyUseHTMLString: true,
+      })
+        .then(() => {
+          this.$api.distributiontemppublishdata(v.id).then((res) => {
+            this.$message.success("发布成功");
+            this.search();
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
 
-  }
-}
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.search();
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-
+/deep/.el-button {
+  border-radius: 8px;
+}
+/deep/.el-dialog {
+  border-radius: 8px;
+  .el-dialog__header {
+    padding: 0;
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .el-dialog__footer {
+    padding: 0;
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+  p {
+    margin: 5px 0px;
+  }
+}
+.numInputs {
+  width: 150px;
+}
 </style>

+ 38 - 18
src/views/Marketing/activitySystem/posterList/index.vue

@@ -17,12 +17,12 @@
       @addClick="addClick"
     >
       <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="Status(props.scope.row)"
-          >启用/禁用</el-button
-        >
         <el-button type="text" @click="editClick(props.scope.row)"
           >编辑</el-button
         >
+        <el-button type="text" @click="Status(props.scope.row)">{{
+          props.scope.row.status === 1 ? "关闭" : "开启"
+        }}</el-button>
       </template>
     </table-list>
     <pagination
@@ -40,10 +40,10 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
-import model from "./model.vue"
+import model from "./model.vue";
 export default {
   name: "PosterList",
-  components: { searchBoxNew, tableList, pagination,model },
+  components: { searchBoxNew, tableList, pagination, model },
   data() {
     return {
       disabledBtn: false,
@@ -65,13 +65,12 @@ export default {
       //搜索
       formList: [
         {
-          lable: "姓名",
+          lable: "模板名称",
           prop: "name",
-          placeholder: "请输入姓名",
+          placeholder: "请输入模板名称",
         },
       ],
       formData: {
-        status: "0,1",
         pageSize: 10,
         pageNum: 1,
       },
@@ -79,7 +78,7 @@ export default {
       tableSet: [
         {
           label: "模板编号",
-          prop: "id",
+          prop: "posterTempId",
           hidden: true,
         },
         {
@@ -89,17 +88,29 @@ export default {
         },
         {
           label: "创建时间",
-          prop: "name",
+          prop: "createTime",
           hidden: true,
+          scope:"aTimeList"
         },
         {
           label: "使用状态",
-          prop: "name",
+          prop: "status",
           hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "开启",
+              value: 1,
+            },
+            {
+              label: "关闭",
+              value: 0,
+            },
+          ],
         },
         {
           label: "备注",
-          prop: "name",
+          prop: "remark",
           hidden: true,
         },
       ],
@@ -111,18 +122,27 @@ export default {
     this.search();
   },
   methods: {
-    Status(){},
-    addClick(){
-      this.$refs.model.showBox()
+    Status(e) {
+      this.$api
+        .editdistributionposter({
+          posterTempId: e.posterTempId,
+          status: e.status === 1 ? 0 : 1,
+        })
+        .then((res) => {
+          this.$message.success("操作成功");
+          this.search();
+        });
+    },
+    addClick() {
+      this.$refs.model.showBox();
     },
     editClick(e) {
-      console.log("编辑", e);
+      this.$refs.model.showBox(JSON.parse(JSON.stringify(e)))
     },
     search(v) {
       this.loading = true;
       if (v === 2) {
         this.formData = {
-          status: "0,1",
           pageSize: 10,
           pageNum: 1,
         };
@@ -135,7 +155,7 @@ export default {
         data.classEndTime = parseInt(data.classEndTime / 1000);
       }
       this.$api
-        .inquirebusinessList(data)
+        .inquiredistributionposterlist(data)
         .then((res) => {
           this.tableData = res.rows;
           this.total = res.total;

+ 248 - 105
src/views/Marketing/activitySystem/posterList/model.vue

@@ -2,7 +2,7 @@
   <div id="">
     <el-dialog
       :visible.sync="dialogVisible"
-      width="960px"
+      width="1060px"
       :show-close="false"
       :close-on-click-modal="false"
     >
@@ -12,94 +12,118 @@
           <img src="@/assets/images/Close@2x.png" alt="" @click="close" />
         </div>
       </div>
-      <div id="content">
-        <modelView
-          ref="modelView"
-          :modelData="modelData"
-          @changeModelData="changeModelData"
-        ></modelView>
-        <div class="right">
-          <div class="lis">
-            <el-checkbox v-model="modelData.title.checked">标题:</el-checkbox
-            ><el-input v-model="modelData.title.name"></el-input
-            ><el-color-picker
-              v-model="modelData.title.css.color"
-              show-alpha
-            ></el-color-picker>
-            <el-input
-              placeholder="请输入字体大小"
-              v-model="modelData.title.css.fontSize"
-            >
-              <template slot="prepend">字体大小</template></el-input
-            >
-          </div>
-          <div class="lis">
-            <el-checkbox v-model="modelData.background.checked"
-              >背景图:</el-checkbox
-            ><el-select
-              v-model="modelData.background.name"
-              placeholder="请选择"
-            >
-              <el-option
-                v-for="(item, index) in backImgList"
-                :key="index"
-                :label="item.label"
-                :value="item.name"
-              >
-              </el-option>
-            </el-select>
-          </div>
-          <div class="lis">
-            <el-checkbox v-model="modelData.goods.checked">商品图:</el-checkbox
-            ><input id="goods" type="file" @change="uploadImg" />
-          </div>
-          <div class="lis">
-            <el-checkbox v-model="modelData.distribution.checked"
-              >分销码</el-checkbox
-            >
-            <el-checkbox v-model="modelData.cardCode.checked"
-              >电子名片码</el-checkbox
-            >
-          </div>
-          <div class="lis">
-            <el-checkbox v-model="modelData.advertise.checked"
-              >广告语:</el-checkbox
-            ><el-input v-model="modelData.advertise.name"></el-input
-            ><el-color-picker
-              v-model="modelData.advertise.css.color"
-              show-alpha
-            ></el-color-picker>
-            <el-input
-              placeholder="请输入字体大小"
-              v-model="modelData.advertise.css.fontSize"
-            >
-              <template slot="prepend">字体大小</template></el-input
-            >
-          </div>
-          <div class="lis">
-            <el-checkbox v-model="modelData.mechanism.checked"
-              >机构:</el-checkbox
-            ><el-input v-model="modelData.mechanism.name"></el-input
-            ><el-color-picker
-              v-model="modelData.mechanism.css.color"
-              show-alpha
-            ></el-color-picker>
-            <el-input
-              placeholder="请输入字体大小"
-              v-model="modelData.mechanism.css.fontSize"
-            >
-              <template slot="prepend">字体大小</template></el-input
-            >
-          </div>
-          <el-button @click="submits">保存</el-button>
-        </div>
-      </div>
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+        ><el-form-item label="模板名称" prop="name">
+          <el-input v-model="ruleForm.name"></el-input>
+        </el-form-item>
+        <el-form-item label="模板配置">
+          <div id="content">
+            <modelView
+              ref="modelView"
+              :modelData="modelData"
+              @changeModelData="changeModelData"
+            ></modelView>
+            <div class="right">
+              <div class="lis">
+                <el-checkbox v-model="modelData.title.checked"
+                  >标题:</el-checkbox
+                ><el-input v-model="modelData.title.name"></el-input
+                ><el-color-picker
+                  v-model="modelData.title.css.color"
+                  show-alpha
+                ></el-color-picker>
+                <el-input
+                  placeholder="请输入字体大小"
+                  v-model="modelData.title.css.fontSize"
+                >
+                  <template slot="prepend">字体大小</template></el-input
+                >
+              </div>
+              <div class="lis">
+                <el-checkbox v-model="modelData.background.checked"
+                  >背景图:</el-checkbox
+                ><el-select
+                  v-model="modelData.background.name"
+                  placeholder="请选择"
+                >
+                  <el-option
+                    v-for="(item, index) in backImgList"
+                    :key="index"
+                    :label="item.name"
+                    :value="item.url"
+                  >
+                  </el-option>
+                </el-select>
+              </div>
+              <div class="lis">
+                <el-checkbox v-model="modelData.goods.checked"
+                  >商品图:</el-checkbox
+                ><input id="goods" type="file" @change="uploadImg" />
+              </div>
+              <div class="lis">
+                <el-checkbox v-model="modelData.distribution.checked"
+                  >分销码</el-checkbox
+                >
+                <el-checkbox v-model="modelData.cardCode.checked"
+                  >电子名片码</el-checkbox
+                >
+              </div>
+              <div class="lis">
+                <el-checkbox v-model="modelData.advertise.checked"
+                  >广告语:</el-checkbox
+                ><el-input v-model="modelData.advertise.name"></el-input
+                ><el-color-picker
+                  v-model="modelData.advertise.css.color"
+                  show-alpha
+                ></el-color-picker>
+                <el-input
+                  placeholder="请输入字体大小"
+                  v-model="modelData.advertise.css.fontSize"
+                >
+                  <template slot="prepend">字体大小</template></el-input
+                >
+              </div>
+              <div class="lis">
+                <el-checkbox v-model="modelData.mechanism.checked"
+                  >机构:</el-checkbox
+                ><el-input v-model="modelData.mechanism.name"></el-input
+                ><el-color-picker
+                  v-model="modelData.mechanism.css.color"
+                  show-alpha
+                ></el-color-picker>
+                <el-input
+                  placeholder="请输入字体大小"
+                  v-model="modelData.mechanism.css.fontSize"
+                >
+                  <template slot="prepend">字体大小</template></el-input
+                >
+              </div>
+            </div>
+          </div> </el-form-item
+        ><el-form-item label="状态" prop="status">
+          <el-radio-group v-model="ruleForm.status">
+            <el-radio :label="1">开启</el-radio>
+            <el-radio :label="0">关闭</el-radio>
+          </el-radio-group> </el-form-item
+        ><el-form-item label="备注" prop="remark">
+          <el-input
+            type="textarea"
+            v-model="ruleForm.remark"
+            :rows="4"
+          ></el-input> </el-form-item
+      ></el-form>
+
       <span slot="footer" class="dialog-footer">
         <el-button @click="close">取 消</el-button>
         <el-button
           type="primary"
           :loading="disabledBtn"
-          @click="submit('listData')"
+          @click="submit('ruleForm')"
           >确 定</el-button
         >
       </span>
@@ -116,13 +140,13 @@ export default {
       dialogVisible: false,
       disabledBtn: false,
       //   弹窗数据
-      listData: {},
-
-      backImgList: [
-        { label: "模板1", name: require("@/assets/model_images/model1.png") },
-        { label: "模板2", name: require("@/assets/model_images/model2.png") },
-        { label: "模板3", name: require("@/assets/model_images/model3.png") },
-      ],
+      ruleForm: {},
+      rules: {
+        name: [{ required: true, message: "请输入模板名称", trigger: "blur" }],
+        status: [{ required: true, message: "请选择状态", trigger: "change" }],
+        remark: [{ required: false, message: "请输入备注", trigger: "blur" }],
+      },
+      backImgList: [],
       modelData: {
         background: {
           name: "",
@@ -206,25 +230,144 @@ export default {
       },
     };
   },
+  created() {
+    this.getPosterBackgroundImgList();
+  },
   methods: {
+    //获取模板底图
+    getPosterBackgroundImgList() {
+      this.$api.inquiredistributionposterimagelist().then((res) => {
+        this.backImgList = res.data;
+      });
+    },
     showBox(e) {
+      if (e) {
+        this.$nextTick(() => {
+          this.ruleForm = {
+            name: e.name,
+            posterTempId: e.posterTempId,
+            posterUrl: e.posterUrl,
+            remark: e.remark,
+            status: e.status,
+          };
+          this.modelData = JSON.parse(e.posterConfig);
+        });
+      } else {
+        this.$nextTick(() => {
+        this.modelData = {
+          background: {
+            name: "",
+            css: {
+              top: "0px",
+              left: "0px",
+              width: "375px",
+              height: "667px",
+              position: "absolute",
+            },
+          },
+          title: {
+            name: "",
+            top: 38,
+            left: 0,
+            width: 375,
+            height: 50,
+            css: {
+              textAlign: "center",
+              fontSize: "30px",
+              margin: "0px",
+            },
+          },
+          goods: {
+            // name: require("@/assets/model_images/model1.png"),
+            name: "",
+            top: 126,
+            left: 28,
+            width: 330,
+            height: 330,
+            css: {
+              width: "100%",
+              height: "100%",
+            },
+          },
+          distribution: {
+            name: "",
+            top: 476,
+            left: 114,
+            width: 121,
+            height: 111,
+            css: {
+              width: "100%",
+              height: "100%",
+            },
+          },
+          cardCode: {
+            name: "",
+            top: 476,
+            left: 244,
+            width: 125,
+            height: 112,
+            css: {
+              width: "100%",
+              height: "100%",
+            },
+          },
+          advertise: {
+            name: "",
+            top: 490,
+            left: 0,
+            width: 102,
+            height: 96,
+            css: {
+              fontSize: "20px",
+              margin: "0px",
+            },
+          },
+          mechanism: {
+            name: "",
+            top: 623,
+            left: 0,
+            width: 375,
+            height: 44,
+            css: {
+              fontSize: "16px",
+              textAlign: "center",
+              margin: "0px",
+            },
+          },
+        };
+          this.ruleForm = {};
+        });
+      }
       this.dialogVisible = true;
     },
-    submit() {
-      this.disabledBtn = true;
-      setTimeout(() => {
-        this.$message.success("提交成功");
-        this.disabledBtn = false;
-        this.dialogVisible = false;
-        this.search();
-      }, 500);
-    },
     close() {
+      this.$refs["ruleForm"].clearValidate();
       this.dialogVisible = false;
     },
-    async submits() {
-      const imgUrl = await this.$refs.modelView.changeFile();
-      console.log(imgUrl, this.modelData);
+    submit(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          this.disabledBtn = true;
+          this.ruleForm.posterUrl = await this.$refs.modelView.changeFile();
+          this.ruleForm.posterConfig = JSON.stringify(this.modelData);
+          this.$api[
+            this.ruleForm.posterTempId
+              ? "editdistributionposter"
+              : "distributionpostersave"
+          ](this.ruleForm)
+            .then((res) => {
+              this.dialogVisible = false;
+              console.log(this.$parent);
+              this.$parent.search();
+            })
+            .finally(() => {
+              this.disabledBtn = false;
+            });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
     },
     changeModelData(data) {
       const { name, left, top, width, height } = data;
@@ -245,7 +388,7 @@ export default {
       var self = this;
       var file = e.target.files[0];
       if (file === undefined) {
-        self.$set(self.listData, "coverUrl", "");
+        self.$set(self.modelData.goods, "name", "");
         return;
       }
       if (file.size > 0.3 * 1024 * 1024) {
@@ -266,7 +409,7 @@ export default {
       this.$upload
         .upload(file, 0)
         .then((res) => {
-          this.$set(this.modelData.goods, "name", res);
+          this.$set(self.modelData.goods, "name", res);
         })
         .finally(() => {
           e.target.value = "";

+ 23 - 36
src/views/Marketing/distribution/salesmanList/index.vue

@@ -17,15 +17,15 @@
       :loading="loading"
     >
       <template slot="customize">
-        <el-button @click="sales" type="success" size="medium">关联现有业务员</el-button>
+        <!-- <el-button @click="sales" type="success" size="medium">关联现有业务员</el-button> -->
       </template>
       <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="del(props.scope.row)">禁用</el-button>
+        <!-- <el-button type="text" @click="del(props.scope.row)">禁用</el-button>
         <el-button type="text" @click="del(props.scope.row)">启用</el-button>
         <el-button type="text" @click="editClick(props.scope.row)"
           >详情</el-button
         >
-        <el-button type="text" @click="del(props.scope.row)">删除</el-button>
+        <el-button type="text" @click="del(props.scope.row)">删除</el-button> -->
       </template>
     </table-list>
     <pagination
@@ -59,8 +59,9 @@ export default {
         ch: "条",
         num: true,
         choice: true,
-        addHide: false,
+        addHide: true,
         openCheckMore: true,
+        tableHide:true,
         changeWidth: "260px",
         backFatherBtn: {
           status: false,
@@ -71,17 +72,12 @@ export default {
       formList: [
         {
           lable: "邀请人",
-          prop: "name",
+          prop: "parentName",
           placeholder: "请输入邀请人",
         },
-        {
-          lable: "订单",
-          prop: "name",
-          placeholder: "请输入订单",
-        },
         {
           lable: "姓名",
-          prop: "name",
+          prop: "realname",
           placeholder: "请输入姓名",
         },
       ],
@@ -93,72 +89,63 @@ export default {
       // 表单
       tableSet: [
         {
-          label: "业务员",
-          prop: "name",
+          label: "业务员编码",
+          prop: "userAccount",
           hidden: true,
         },
         {
           label: "姓名",
-          prop: "name",
+          prop: "realname",
           hidden: true,
         },
         {
           label: "手机号",
-          prop: "name",
+          prop: "telphone",
           hidden: true,
         },
         {
           label: "身份证号",
-          prop: "name",
-          hidden: true,
-        },
-        {
-          label: "微信号",
-          prop: "name",
+          prop: "idCard",
           hidden: true,
         },
         {
           label: "所属机构",
-          prop: "name",
+          prop: "tenantName",
           hidden: true,
         },
         {
-          label: "职务",
-          prop: "name",
+          label: "是否完成提现授权",
+          prop: "gzhOpenId",
           hidden: true,
+          scope:"isgzhOpenId"
         },
         {
           label: "邀请人ID",
-          prop: "name",
+          prop: "parentAccount",
           hidden: true,
         },
         {
           label: "邀请人姓名",
-          prop: "name",
-          hidden: true,
-        },
-        {
-          label: "累计客户数",
-          prop: "name",
+          prop: "parentName",
           hidden: true,
         },
         {
           label: "累计推广员数",
-          prop: "name",
+          prop: "promotionNum",
           hidden: true,
         },
         {
           label: "账号状态",
-          prop: "bbb",
+          prop: "status",
           scope: "isOptions",
           hidden: true,
           options: [
             {
-              label: "同意",
+              label: "有效",
               value: 0,
             },
             {
-              label: "不同意",
+              label: "禁止",
               value: 1,
             },
           ],
@@ -194,7 +181,7 @@ export default {
       }
       var data = JSON.parse(JSON.stringify(this.formData));
       this.$api
-        .inquirebusinessList(data)
+        .distributiontempsellerlist(data)
         .then((res) => {
           this.tableData = res.rows;
           this.total = res.total;

+ 15 - 1
src/views/classHoursReview/component/ChapterTable.vue

@@ -26,7 +26,8 @@
       </el-table-column>
       <el-table-column align="center" prop="classHours" label="学时">
         <template slot-scope="scope">
-          {{ scope.row.classHours?scope.row.classHours.toFixed(1):scope.row.classHours }}
+          {{ chapterClassHours(scope.row) }}
+          <!-- {{ scope.row.classHours?scope.row.classHours.toFixed(1):scope.row.classHours }} -->
         </template>
       </el-table-column>
       <el-table-column align="center" label="开始学习时间">
@@ -67,6 +68,19 @@ export default {
   data() {
     return {};
   },
+  computed:{
+    chapterClassHours : function(){
+      return function(arr){
+        var num = 0
+        arr.classPeriodSectionList.forEach(item => {
+          if(item.durationTime){
+            num += parseFloat((item.durationTime / 60 / 45).toFixed(1))
+          }
+        })
+        return num
+      }
+    }
+  },
   components: {
     LessonTable,
   },

+ 2 - 1
src/views/classHoursReview/component/StudyTables.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="studyRecordTable">
+    <div style="height: 62px;">
     <div class="studyStyle" :class="{ 'isFixed': headerFixed }" :style="{'left':left}">
       <div class="a_style">
         <i></i>
@@ -68,7 +69,7 @@
         > -->
       </div>
     </div>
-
+  </div>
     <el-checkbox-group v-model="checkList" @change="handleCheckedCitiesChange">
       <component :is="keys[key]" v-for="key in Object.keys(tablesData)" :key="key" :tabledata="tablesData[key]"
         :label="key == 5 ? '卷' : '章'" :userImg="userImg"></component>

+ 35 - 35
src/views/classHoursReview/studyTimes.vue

@@ -27,41 +27,41 @@ export default {
     };
   },
   created() {
-    this.$api
-      .inquireGradegradelockPeriodStatus({
-        gradeId: Number(this.setData.id),
-        userId: Number(this.setData.userId),
-        goodsId: Number(this.setData.goodsId),
-      })
-      .then((res) => {
-        if (res.msg) {
-          this.$alert(`${res.msg}正在操作该页面,请关闭当前页`, "提示", {
-            dangerouslyUseHTMLString: true,
-            showClose: false,
-          }).then((result) => {
-            const SESSION = sessionStorage.getItem("hoursAudit");
-            let parseSession = {};
-            if (SESSION) {
-              parseSession = JSON.parse(SESSION);
-            }
-            if (parseSession.options.length > 1) {
-              this.$emit("removeTab", this.setData.keyId);
-            } else {
-              this.$store
-                .dispatch("tagsView/delView", this.$route)
-                .then((results) => {
-                  this.$router.go(-1);
-                });
-            }
-          });
-        } else {
-          this.getSetTime();
-          // 每10秒调用一次 锁定页面
-          this.setTimeDOM = setInterval(() => {
-            this.getSetTime();
-          }, 10000);
-        }
-      });
+    // this.$api
+    //   .inquireGradegradelockPeriodStatus({
+    //     gradeId: Number(this.setData.id),
+    //     userId: Number(this.setData.userId),
+    //     goodsId: Number(this.setData.goodsId),
+    //   })
+    //   .then((res) => {
+    //     if (res.msg) {
+    //       this.$alert(`${res.msg}正在操作该页面,请关闭当前页`, "提示", {
+    //         dangerouslyUseHTMLString: true,
+    //         showClose: false,
+    //       }).then((result) => {
+    //         const SESSION = sessionStorage.getItem("hoursAudit");
+    //         let parseSession = {};
+    //         if (SESSION) {
+    //           parseSession = JSON.parse(SESSION);
+    //         }
+    //         if (parseSession.options.length > 1) {
+    //           this.$emit("removeTab", this.setData.keyId);
+    //         } else {
+    //           this.$store
+    //             .dispatch("tagsView/delView", this.$route)
+    //             .then((results) => {
+    //               this.$router.go(-1);
+    //             });
+    //         }
+    //       });
+    //     } else {
+    //       this.getSetTime();
+    //       // 每10秒调用一次 锁定页面
+    //       this.setTimeDOM = setInterval(() => {
+    //         this.getSetTime();
+    //       }, 10000);
+    //     }
+    //   });
   },
   mounted() {
     this.getUserInfo(true);

+ 13 - 13
src/views/secondJian/completionList/index.vue

@@ -190,17 +190,17 @@ export default {
   },
   methods: {
     jumpPage(v) {
-      this.$api
-        .inquireGradegradelockPeriodStatus({
-          gradeId: v.gradeId,
-          userId: v.userId,
-          goodsId: v.goodsId,
-        })
-        .then((res) => {
-          if (res.msg) {
-            this.$message.warning(res.msg + "正在操作");
-            return;
-          } else {
+      // this.$api
+      //   .inquireGradegradelockPeriodStatus({
+      //     gradeId: v.gradeId,
+      //     userId: v.userId,
+      //     goodsId: v.goodsId,
+      //   })
+      //   .then((res) => {
+      //     if (res.msg) {
+      //       this.$message.warning(res.msg + "正在操作");
+      //       return;
+      //     } else {
             let data = {
               userId: v.userId,
               realName: v.realName,
@@ -220,8 +220,8 @@ export default {
               .catch(() => {
                 this.$message.error("存在异常,请联系开发人员");
               });
-          }
-        });
+        //   }
+        // });
     },
     checkSession(row) {
       return new Promise((resolve, reject) => {

+ 1 - 1
src/views/secondJian/learningList/index.vue

@@ -119,7 +119,7 @@ export default {
         },
         {
           label: "在线时间",
-          prop: "onLineTime",
+          prop: "recordEndTime",
           hidden: true,
           scope: "aTimeList",
         },

+ 13 - 13
src/views/secondZao/completionList/index.vue

@@ -190,17 +190,17 @@ export default {
   },
   methods: {
     jumpPage(v) {
-      this.$api
-        .inquireGradegradelockPeriodStatus({
-          gradeId: v.gradeId,
-          userId: v.userId,
-          goodsId: v.goodsId,
-        })
-        .then((res) => {
-          if (res.msg) {
-            this.$message.warning(res.msg + "正在操作");
-            return;
-          } else {
+      // this.$api
+      //   .inquireGradegradelockPeriodStatus({
+      //     gradeId: v.gradeId,
+      //     userId: v.userId,
+      //     goodsId: v.goodsId,
+      //   })
+      //   .then((res) => {
+      //     if (res.msg) {
+      //       this.$message.warning(res.msg + "正在操作");
+      //       return;
+      //     } else {
             let data = {
               userId: v.userId,
               realName: v.realName,
@@ -220,8 +220,8 @@ export default {
               .catch(() => {
                 this.$message.error("存在异常,请联系开发人员");
               });
-          }
-        });
+        //   }
+        // });
     },
     checkSession(row) {
       return new Promise((resolve, reject) => {

+ 1 - 1
src/views/secondZao/learningList/index.vue

@@ -119,7 +119,7 @@ export default {
         },
         {
           label: "在线时间",
-          prop: "onLineTime",
+          prop: "recordEndTime",
           hidden: true,
           scope: "aTimeList",
         },