Tang 3 роки тому
батько
коміт
9a1d21d99d

+ 8 - 0
src/newApi/examapply.js

@@ -48,6 +48,14 @@ export default {
             params: data
         })
     },
+    //查询考试配置绑定用户列表
+    inquirepayservelistUser(data) {
+        return request({
+            url: '/system/apply/listUser',
+            method: 'get',
+            params: data
+        })
+    },
     //查询考试安排商品列表
     inquirepayservelistGoods(data) {
         return request({

+ 10 - 0
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -16,6 +16,11 @@
       :loading="loading"
       @editInfo="editInfo"
     >
+      <template slot="customize">
+        <el-button type="primary" @click="refactor"
+          >重构商品(开发中)</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button
@@ -267,6 +272,11 @@ export default {
     this.search();
   },
   methods: {
+    refactor() {
+      this.$router.push({
+        path: "commodityManageMentNewAdd",
+      });
+    },
     editInfo(v) {
       this.addClick(v, 0);
     },

+ 178 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/courseContent/courseCheck.vue

@@ -0,0 +1,178 @@
+<template>
+  <div id="courseCheck">
+    <el-dialog
+      @opened="prepareEnd"
+      :visible.sync="dialogVisibleTableBoxs"
+      width="900px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">添加课程</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisibleTableBoxs = false"
+          />
+        </div>
+      </div>
+      <el-table
+        ref="multipleTable"
+        :data="tableData"
+        border
+        @select-all="selectAll"
+        @select="select"
+        :row-key="getRowKeys"
+        :header-cell-style="{
+          'background-color': '#eee',
+          padding: '8px',
+          color: '#333',
+        }"
+      >
+        <el-table-column
+          align="center"
+          type="selection"
+          width="55"
+          header-align="center"
+          :selectable="checkboxT"
+          :reserve-selection="true"
+        >
+        </el-table-column>
+        <template v-for="(item, index) in tableSet">
+          <el-table-column
+            v-if="item.scope !== 'inputs'"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'Status'">
+                {{
+                  scope.row[item.prop] === 1
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
+                    : "未知"
+                }}
+              </span>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
+            >
+          </el-table-column></template
+        >
+      </el-table>
+      <pagination
+        :total="total"
+        :pageSize="formData.pageSize"
+        :currentPage="formData.pageNum"
+        @handleSizeChange="handleSizeChange"
+        @handleCurrentChange="handleCurrentChange"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleTableBoxs = false">取 消</el-button>
+        <el-button
+          type="primary"
+          :disabled="activeLists.length === 0"
+          @click="submitTab"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import pagination from "@/components/pagination";
+export default {
+  components: { pagination },
+  data() {
+    return {
+      dialogVisibleTableBoxs: false,
+      tableData: [],
+      tableSet: [
+        { label: "课程编码", prop: "code", width: "140px" },
+        { label: "名称前缀", prop: "prefixName", width: "160px" },
+        { label: "课程标题", prop: "courseName" },
+        {
+          label: "发布状态",
+          prop: "publishStatus",
+          scope: "Status",
+          width: "120px",
+        },
+      ],
+      formData: {},
+      activeLists: [],
+      disCheckList: [],
+      total: 0,
+    };
+  },
+  methods: {
+    /**
+     * 初始
+     */
+    openBox(obj, array) {
+      this.disCheckList = array;
+      this.formData = JSON.parse(JSON.stringify(obj));
+      this.getInfos();
+      this.dialogVisibleTableBoxs = true;
+      this.$nextTick(() => {
+        this.$refs.multipleTable.clearSelection();
+      });
+    },
+    /**
+     * 搜索数据
+     */
+    getInfos() {
+      this.$api.inquireCourseListS(this.formData).then((res) => {
+        this.tableData = res.rows;
+        this.total = res.total;
+      });
+    },
+    /**
+     * 开启动画结束执行
+     */
+    prepareEnd() {
+      this.activeLists = []; //初始清空勾选数据
+    },
+    /**
+     * 提交回调数据
+     */
+    submitTab() {
+      this.$message.success("添加成功");
+      this.dialogVisibleTableBoxs = false;
+      this.$emit("backData", this.activeLists);
+    },
+    selectAll(value) {
+      this.activeLists = value;
+    },
+    select(value) {
+      this.activeLists = value;
+    },
+    checkboxT(row, index) {
+      if (this.disCheckList.indexOf(row.courseId) !== -1) {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    getRowKeys(row) {
+      return row.courseId;
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.getInfos();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.getInfos();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+</style>

+ 68 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/courseContent/everyDayStudyNum.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="everyDayStudyNum">
+    <!-- 每天节学习数量 -->
+    <el-dialog
+      :visible.sync="everyDaySetBox"
+      width="300px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">每天学习限制</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="everyDaySetBox = false"
+          />
+        </div>
+      </div>
+      每天最多学习<el-input
+        style="width: 60px; margin: 0px 10px"
+        size="mini"
+        v-model="everyDaystyleNum"
+      />节视频
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="everyDaySetBox = false">取 消</el-button>
+        <el-button type="primary" @click="submitEveryDayStyleNumData"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      everyDaySetBox: false,
+      everyDaystyleNum: "",
+    };
+  },
+  methods: {
+    openBox(num) {
+      this.everyDaystyleNum = num;
+      this.everyDaySetBox = true
+    },
+    submitEveryDayStyleNumData() {
+      if (this.everyDaystyleNum) {
+        var ty = /^([1-9][0-9]*){1,3}$/;
+        if (ty.test(this.everyDaystyleNum)) {
+          this.$emit("backData", this.everyDaystyleNum);
+          this.everyDaySetBox = false;
+        } else {
+          this.$message.warning("请输入非零正整数");
+          return;
+        }
+      } else {
+        this.$emit("backData", "");
+        this.everyDaySetBox = false;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+</style>

+ 347 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/courseContent/handoutView.vue

@@ -0,0 +1,347 @@
+<template>
+  <div id="handoutView">
+    <!-- 选择讲义 -->
+    <el-dialog
+      :visible.sync="aboutJYBox"
+      width="400px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">关联讲义</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="aboutJYBox = false"
+          />
+        </div>
+      </div>
+      <el-button @click="openJYActiveBox">选择讲义</el-button>
+      <div v-if="handoutsIdTable">
+        {{ handoutsName }}
+        <i
+          class="el-icon-error"
+          style="color: #f56c6c"
+          @click="delHandouts"
+        ></i>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="aboutJYBox = false">取 消</el-button>
+        <el-button type="primary" @click="submitJYs">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- 关联讲义列表 -->
+    <el-dialog
+      :visible.sync="jYactiveBoxs"
+      width="980px"
+      append-to-body
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">关联讲义列表</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="jYactiveBoxs = false"
+          />
+        </div>
+      </div>
+      <el-table
+        ref="multipleTable"
+        :data="tableData"
+        border
+        :header-cell-style="{
+          'background-color': '#eee',
+          padding: '8px',
+          color: '#333',
+        }"
+      >
+        <el-table-column label="" width="45" align="center">
+          <template scope="scope">
+            <el-radio
+              :label="scope.row.handoutsId"
+              v-model="templateRadio"
+              @change.native="getTemplateRow(scope.$index, scope.row)"
+              >{{ "" }}</el-radio
+            >
+          </template>
+        </el-table-column>
+        <template v-for="(item, index) in tableSet">
+          <el-table-column
+            v-if="item.scope !== 'inputs'"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'Status'">
+                {{
+                  scope.row[item.prop] === 1
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
+                    : "未知"
+                }}
+              </span>
+              <ul v-else-if="item.scope === 'eduType'" class="ulAuto">
+                <template v-for="(itm, inds) in scope.row[item.prop]">
+                  <li :key="inds" v-if="inds === 0">
+                    {{
+                      itm.educationName +
+                      "-" +
+                      itm.projectName +
+                      "-" +
+                      itm.businessName
+                    }}
+                  </li>
+                </template>
+                <el-popover
+                  :key="Math.random()"
+                  placement="right"
+                  trigger="click"
+                >
+                  <ul>
+                    <li v-for="(itm, inds) in scope.row[item.prop]" :key="inds">
+                      {{ inds + 1 }}、
+                      {{
+                        itm.educationName +
+                        "-" +
+                        itm.projectName +
+                        "-" +
+                        itm.businessName
+                      }}
+                    </li>
+                  </ul>
+                  <el-button
+                    slot="reference"
+                    style="margin-left: 6px"
+                    type="text"
+                    v-if="scope.row[item.prop].length > 1"
+                    size="mini"
+                    >更多</el-button
+                  >
+                </el-popover>
+              </ul>
+              <span v-else-if="item.scope === 'canDownload'">{{
+                scope.row[item.prop] === 1 ? "是" : "否"
+              }}</span>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
+            >
+          </el-table-column></template
+        >
+      </el-table>
+      <pagination
+        :total="total"
+        :pageSize="formData.pageSize"
+        :currentPage="formData.pageNum"
+        @handleSizeChange="handleSizeChange"
+        @handleCurrentChange="handleCurrentChange"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="jYactiveBoxs = false">取 消</el-button>
+        <el-button type="primary" @click="submitBox">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import pagination from "@/components/pagination";
+export default {
+  components: { pagination },
+  data() {
+    return {
+      aboutJYBox: false,
+      handoutsName: "", //讲义名称
+      handoutsIdTable: "",
+      templateRadio: "", //临时选中ID
+      templateName: "", //临时选中Name
+      jYactiveBoxs: false,
+      total: 0,
+      tableSet: [
+        { label: "讲义编码", prop: "encoder", width: "150px" },
+        { label: "讲义标题", prop: "handoutsName" },
+        {
+          label: "是否可下载",
+          prop: "canDownload",
+          scope: "canDownload",
+          width: "140px",
+        },
+        { label: "发布状态", prop: "status", scope: "Status", width: "140px" },
+      ],
+      tableData: [],
+      formData: {},
+    };
+  },
+  methods: {
+    /**
+     * 初始化
+     */
+    openBox(id) {
+      if (id && !this.handoutsName) {
+        this.$api.obtainCourseHandouts(this.listData.handoutsId).then((res) => {
+          this.handoutsName = res.data.handoutsName;
+        });
+      }
+      this.handoutsIdTable = id;
+      this.aboutJYBox = true;
+    },
+    /**
+     * 删除讲义
+     */
+    delHandouts() {
+      this.handoutsIdTable = "";
+      this.handoutsName = "";
+    },
+    //确定讲义ID
+    submitJYs() {
+      this.$emit("backData", this.handoutsIdTable);
+      this.aboutJYBox = false;
+    },
+    openJYActiveBox() {
+      this.templateRadio = this.handoutsIdTable;
+      this.templateName = this.handoutsName;
+      this.formData = {
+        businessId: this.$parent.listData.businessId,
+        status: 1,
+        pageSize: 10,
+        pageNum: 1,
+        key: "",
+      };
+      this.getJyData();
+      this.jYactiveBoxs = true;
+    },
+    /**
+     * 确定选中
+     */
+    submitBox() {
+      this.handoutsIdTable = this.templateRadio;
+      this.handoutsName = this.templateName;
+      this.jYactiveBoxs = false;
+    },
+    /**
+     * 临时选中
+     */
+    getTemplateRow(index, row) {
+      this.templateRadio = row.handoutsId;
+      this.templateName = row.handoutsName;
+    },
+    /**
+     * 搜索
+     */
+    getJyData() {
+      this.$api.inquireCourseHandoutsList(this.formData).then((res) => {
+        this.total = res.total;
+        this.tableData = res.rows;
+      });
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.getJyData();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.getJyData();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.el-button {
+  border-radius: 8px;
+}
+/deep/.el-dialog {
+  border-radius: 8px;
+  .el-dialog__header {
+    padding: 0;
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .el-dialog__footer {
+    padding: 0;
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+  p {
+    margin: 5px 0px;
+  }
+}
+</style>

+ 257 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/courseContent/index.vue

@@ -0,0 +1,257 @@
+<template>
+  <div id="courseContent">
+    <div style="margin-bottom: 20px">
+      <el-button @click="addCourse" size="small">添加</el-button>
+      <el-button @click="openAudition" type="success" size="small"
+        >试听设置</el-button
+      >
+      <el-button type="primary" @click="openPlayPhotoSet" size="small"
+        >播放和拍照设置</el-button
+      >
+      <el-button type="primary" @click="openStyleNumSet" size="small"
+        >每天学习限制</el-button
+      >
+      <el-button type="primary" @click="openHandoutSet" size="small"
+        >关联讲义</el-button
+      >
+    </div>
+    <el-table
+      :data="tableData"
+      border
+      :header-cell-style="{
+        'background-color': '#eee',
+        padding: '8px',
+        color: '#333',
+      }"
+      :default-sort="{ prop: 'sort', order: 'ascending' }"
+    >
+      <el-table-column
+        v-for="(item, index) in tableSetVideo"
+        :width="item.width"
+        :key="index"
+        :label="item.label"
+        align="center"
+        :show-overflow-tooltip="true"
+        header-align="center"
+        :sortable="item.prop === 'sort'"
+        sort-by="sort"
+        :prop="item.prop"
+      >
+        <template slot-scope="scope">
+          <span v-if="item.scope === 'types'">{{
+            scope.row[item.prop] === 1
+              ? "录播"
+              : scope.row[item.prop] === 2
+              ? "直播"
+              : scope.row[item.prop] === 3
+              ? "回放"
+              : "未知"
+          }}</span>
+          <span v-else-if="item.scope === 'busin'">
+            {{ scope.row[item.prop1] + " - " + scope.row[item.prop2] }}
+          </span>
+          <span v-else-if="item.scope === 'Status'">
+            {{
+              scope.row[item.prop] === 1
+                ? "发布"
+                : scope.row[item.prop] === 0
+                ? "未发布"
+                : "未知"
+            }}
+          </span>
+          <div v-else-if="item.scope === 'inputs'">
+            <el-input-number
+              style="width: 50px"
+              size="small"
+              :controls="false"
+              v-model="scope.row[item.prop]"
+              controls-position="right"
+              :min="0"
+            ></el-input-number>
+          </div>
+          <span v-else>{{ scope.row[item.prop] }}</span></template
+        >
+      </el-table-column>
+      <el-table-column label="操作" align="center" fixed="right" width="100px">
+        <template slot-scope="scope">
+          <el-button type="text" @click="delCourse(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <popple-set
+      :key="Math.random()"
+      ref="poppleSet"
+      :tableData="tableData"
+      :auditionList="auditionList"
+      @uploadArrays="uploadArrays"
+    />
+    <course-check ref="courseCheck" @backData="backVideoData" />
+    <play-photo ref="playPhoto" @backData="backPlayPhotoData" />
+    <every-day-study-num ref="everyDayStudyNum" @backData="backEveryDaySet" />
+    <handout-view ref="handoutView" @backData="backHandoutView" />
+  </div>
+</template>
+
+<script>
+import poppleSet from "../../poppleSet.vue";
+import courseCheck from "./courseCheck.vue";
+import playPhoto from "./playPhoto.vue";
+import everyDayStudyNum from "./everyDayStudyNum.vue";
+import handoutView from "./handoutView.vue";
+
+export default {
+  components: {
+    poppleSet,
+    courseCheck,
+    playPhoto,
+    everyDayStudyNum,
+    handoutView,
+  },
+  props: ["listData"],
+  data() {
+    return {
+      tableSetVideo: [
+        { label: "排序", prop: "sort", scope: "inputs", width: "100" },
+        { label: "课程编码", prop: "code", width: "140" },
+        { label: "课程名称", prop: "courseName", width: "190" },
+        { label: "科目", prop: "subjectName", width: "150" },
+        { label: "专业", prop: "categoryName" },
+        { label: "院校", prop: "schoolName", width: "150" },
+        {
+          label: "业务层次",
+          prop1: "projectName",
+          prop2: "businessName",
+          scope: "busin",
+          width: "350px",
+        },
+        { label: "教育类型", prop: "educationName", width: "160" },
+        {
+          label: "发布状态",
+          prop: "publishStatus",
+          scope: "Status",
+          width: "120",
+        },
+      ],
+      tableData: [],
+      auditionList: [], //试听数据
+    };
+  },
+  methods: {
+    /**
+     * 点击添加函数
+     */
+    addCourse() {
+      //搜索条件
+      var data = {
+        businessId: this.listData.businessId,
+        status: 1,
+        pageSize: 10,
+        pageNum: 1,
+        publishStatus: 1,
+      };
+      //已选课程
+      var aList = this.tableData.map((item) => {
+        return item.courseId;
+      });
+      //打开选择课程组件
+      this.$refs.courseCheck.openBox(data, aList);
+    },
+    /**
+     * 选择课程回调数据
+     */
+    backVideoData(array) {
+      let copyData = JSON.parse(JSON.stringify(array));
+      if (this.tableData.length) {
+        let maxIndex = 0;
+        this.tableData.forEach((item) => {
+          if (item.sort > maxIndex) {
+            maxIndex = item.sort;
+          }
+        });
+        copyData.forEach((item, index) => {
+          item.sort = maxIndex + index + 1;
+        });
+      } else {
+        copyData.forEach((item, index) => {
+          item.sort = index + 1;
+        });
+      }
+      this.tableData = this.tableData.concat(copyData);
+    },
+    /**
+     * 删除课程
+     */
+    delCourse(item) {
+      const FINDINDEX = this.tableData.findIndex((items) => {
+        return items.courseId === item.courseId;
+      });
+      this.tableData.splice(FINDINDEX, 1);
+      this.auditionList = this.auditionList.filter((items) => {
+        return items.courseId !== item.courseId;
+      });
+      this.$message.success("删除成功");
+    },
+    /**
+     * 点击试听函数
+     */
+    openAudition() {
+      this.$refs.poppleSet.dialogVisible = true;
+    },
+    /**
+     * 试听回调数据
+     */
+    uploadArrays(arrays) {
+      this.auditionList = arrays;
+    },
+    /**
+     * 点击播放和拍照设置函数
+     */
+    openPlayPhotoSet() {
+      this.$refs.playPhoto.openBox(this.listData);
+    },
+    /**
+     * 播放和拍照设置回调数据
+     */
+    backPlayPhotoData(obj) {
+      this.$set(this.listData, "playConfig", obj.playConfig);
+      this.$set(this.listData, "photographConfig", obj.photographConfig);
+      this.$set(
+        this.listData,
+        "goodsPhotographExamConfig",
+        obj.goodsPhotographExamConfig
+      );
+    },
+    /**
+     * 点击学习限制函数
+     */
+    openStyleNumSet() {
+      this.$refs.everyDayStudyNum.openBox(this.listData.sectionMaxNum);
+    },
+    /**
+     * 学习限制回调数据
+     */
+    backEveryDaySet(num) {
+      this.$set(this.listData, "sectionMaxNum", num);
+    },
+    /**
+     * 点击选择讲义函数
+     */
+    openHandoutSet() {
+      if (!this.listData.businessId) {
+        this.$message.warning("请选择业务层次");
+        return;
+      }
+      this.$refs.handoutView.openBox(this.listData.handoutsId);
+    },
+    /**
+     * 讲义回调数据
+     */
+    backHandoutView(id) {
+      this.$set(this.listData, "handoutsId", id);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+</style>

+ 210 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/courseContent/playPhoto.vue

@@ -0,0 +1,210 @@
+<template>
+  <div id="playPhoto">
+    <!-- 播放和拍照设置 -->
+    <el-dialog
+      :visible.sync="dialogPhoto"
+      width="980px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">播放和拍照设置</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogPhoto = false"
+          />
+        </div>
+      </div>
+      <div class="dis_f">
+        <div>
+          <h4>视频播放</h4>
+          <div>
+            <span class="w_zq">自动播放</span
+            ><el-radio-group v-model="photoVideoList.playConfig.autoPlay">
+              <el-radio :label="1">开启</el-radio>
+              <el-radio :label="0">禁止</el-radio>
+            </el-radio-group>
+          </div>
+          <div>
+            <span class="w_zq">进度条拖拉</span
+            ><el-radio-group v-model="photoVideoList.playConfig.drag">
+              <el-radio :label="1">开启</el-radio>
+              <el-radio :label="0">禁止</el-radio>
+            </el-radio-group>
+          </div>
+          <div>
+            <span class="w_zq">快进慢进</span
+            ><el-radio-group v-model="photoVideoList.playConfig.speed">
+              <el-radio :label="1">开启</el-radio>
+              <el-radio :label="0">禁止</el-radio>
+            </el-radio-group>
+          </div>
+        </div>
+        <div style="width: 1px; background-color: #666; margin: 0px 14px"></div>
+        <div>
+          <h4>课程节-点播拍照</h4>
+          <div>
+            <el-radio-group
+              v-model="photoVideoList.photographConfig.photograph"
+            >
+              <el-radio :label="1">是</el-radio>
+              <el-radio
+                :label="0"
+                @change="photoVideoList.photographConfig.photoNum = ''"
+                >否</el-radio
+              >
+            </el-radio-group>
+          </div>
+          <div
+            v-if="photoVideoList.photographConfig.photograph === 1"
+            style="margin-top: 14px"
+          >
+            拍照数量:
+            <el-radio-group v-model="photoVideoList.photographConfig.photoNum">
+              <el-radio :label="1">1张</el-radio>
+              <el-radio :label="3">3张</el-radio>
+            </el-radio-group>
+          </div>
+        </div>
+        <div style="width: 1px; background-color: #666; margin: 0px 14px"></div>
+        <div>
+          <h4>课程节-直播拍照</h4>
+          <div>
+            <el-radio-group
+              v-model="photoVideoList.photographConfig.livephotograph"
+            >
+              <el-radio :label="1">是</el-radio>
+              <el-radio :label="0">否</el-radio>
+            </el-radio-group>
+          </div>
+          <div
+            v-if="photoVideoList.photographConfig.livephotograph === 1"
+            style="margin-top: 14px"
+          >
+            学习开始,就拍照,只拍1张照片
+          </div>
+        </div>
+        <div style="width: 1px; background-color: #000; margin: 0px 14px"></div>
+        <div>
+          <h4>课程章节-章测试卷-拍照</h4>
+          <div>
+            <el-radio-group
+              v-model="photoVideoList.goodsPhotographExamConfig.photograph"
+            >
+              <el-radio :label="1">是</el-radio>
+              <el-radio :label="0">否</el-radio>
+            </el-radio-group>
+          </div>
+          <div
+            v-if="photoVideoList.goodsPhotographExamConfig.photograph === 1"
+            style="margin-top: 14px"
+          >
+            学习开始,就拍照,只拍1张照片
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogPhoto = false">取消</el-button>
+        <el-button type="primary" @click="submitPhoto">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      dialogPhoto: false,
+      photoVideoList: {
+        playConfig: {
+          autoPlay: 0,
+          drag: 0,
+          speed: 0,
+        },
+        photographConfig: {
+          photograph: 0,
+          photoNum: "",
+          livephotograph: 0,
+        },
+        goodsPhotographExamConfig: {
+          photograph: 0,
+        },
+      }, //播放和拍照设置---暂存
+    };
+  },
+  methods: {
+    /**
+     * 初始进入
+     */
+    openBox(obj) {
+      if (obj.playConfig) {
+        this.photoVideoList.playConfig = JSON.parse(
+          JSON.stringify(obj.playConfig)
+        );
+      } else {
+        this.photoVideoList.playConfig = {
+          autoPlay: 0,
+          drag: 0,
+          speed: 0,
+        };
+      }
+      if (obj.photographConfig) {
+        this.photoVideoList.photographConfig = JSON.parse(
+          JSON.stringify(obj.photographConfig)
+        );
+      } else {
+        this.photoVideoList.photographConfig = {
+          photograph: 0,
+          photoNum: "",
+          livephotograph: 0,
+        };
+      }
+      if (obj.goodsPhotographExamConfig) {
+        this.photoVideoList.goodsPhotographExamConfig = JSON.parse(
+          JSON.stringify(obj.goodsPhotographExamConfig)
+        );
+      } else {
+        this.photoVideoList.goodsPhotographExamConfig = {
+          photograph: 0,
+        };
+      }
+      this.dialogPhoto = true;
+    },
+    //提交播放和拍照设置
+    submitPhoto() {
+      if (
+        this.photoVideoList.photographConfig.photograph === 1 &&
+        !this.photoVideoList.photographConfig.photoNum
+      ) {
+        this.$message.warning("请输入拍照数量");
+        return;
+      }
+      let obj = {
+        playConfig: this.photoVideoList.playConfig,
+        photographConfig: this.photoVideoList.photographConfig,
+        goodsPhotographExamConfig:
+          this.photoVideoList.goodsPhotographExamConfig,
+      };
+      this.dialogPhoto = false;
+      this.$emit("backData", obj);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dis_f {
+  display: flex;
+  justify-content: space-around;
+  & h4 {
+    margin: 10px 0px;
+  }
+}
+.w_zq {
+  display: inline-block;
+  width: 88px;
+}
+</style>

+ 244 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/index.vue

@@ -0,0 +1,244 @@
+<template>
+  <div id="newAdd">
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <h5>商品信息</h5>
+      <div class="boxBorderStyle">
+        <h5 class="segmentationStyle">基本信息</h5>
+        <product-information ref="productInformation" :listData="listData" />
+        <h5 class="segmentationStyle">商品价格和有效期</h5>
+        <price-period ref="pricePeriod" :listData="listData" />
+        <h5 class="segmentationStyle">课程内容</h5>
+        <course-content ref="courseContent" :listData="listData" />
+      </div>
+      <el-button @click="submitForm('listData')">提交</el-button>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import productInformation from "./productInformation.vue";
+import pricePeriod from "./pricePeriod.vue";
+import courseContent from "./courseContent/index.vue";
+export default {
+  components: {
+    productInformation,
+    pricePeriod,
+    courseContent,
+  },
+  data() {
+    var validatorstandPrice = (rule, value, callback) => {
+      var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
+      if (!reg.test(value)) {
+        return callback(new Error("请输入不超过两位小数点的价格数值"));
+      } else {
+        this.$refs["listData"].validateField("lowestPrice");
+        callback();
+      }
+    };
+    var validatorlowestPrice = (rule, value, callback) => {
+      console.log(this.listData);
+      var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
+      if (!reg.test(value)) {
+        return callback(new Error("请输入不超过两位小数点的价格数值"));
+      } else if (
+        this.listData.standPrice &&
+        parseFloat(value) > parseFloat(this.listData.standPrice)
+      ) {
+        return callback(new Error("价格不得高于商品标准价格"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      listData: {
+        coverUrl: "oss/images/avatar/20211013/1634097664410_1397766697",
+      },
+      rules: {
+        goodsType: [
+          {
+            required: true,
+            message: "请选择商品类型",
+            trigger: ["blur", "change"],
+          },
+        ],
+        goodsName: [
+          {
+            required: true,
+            message: "请输入商品名称",
+            trigger: "change",
+          },
+        ],
+        educationTypeId: [
+          {
+            required: true,
+            message: "请选择教育类型",
+            trigger: ["blur", "change"],
+          },
+        ],
+        businessId: [
+          {
+            required: true,
+            message: "请选择业务层次",
+            trigger: ["blur", "change"],
+          },
+        ],
+        subjectId: [
+          {
+            required: true,
+            message: "请选择科目",
+            trigger: ["blur", "change"],
+          },
+        ],
+        classHours: [
+          { required: true, message: "请输入学时", trigger: "blur" },
+        ],
+        timeArrays: [
+          {
+            required: true,
+            message: "请选择有效期",
+            trigger: ["blur", "change"],
+          },
+        ],
+        status: [
+          {
+            required: true,
+            message: "请选择状态",
+            trigger: ["blur", "change"],
+          },
+        ],
+        standPrice: [
+          { required: true, message: "请输入标准价格", trigger: "blur" },
+          { validator: validatorstandPrice, trigger: "blur" },
+        ],
+        lowestPrice: [
+          { required: true, message: "请输入最低价格", trigger: "blur" },
+          { validator: validatorlowestPrice, trigger: "blur" },
+        ],
+      },
+    };
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          alert("submit!");
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.boxBorderStyle {
+  margin: 10px 0px;
+  border: 1px solid #a4a4a4;
+  border-top: 2px solid rgb(179, 204, 255);
+  padding: 20px 40px;
+}
+.segmentationStyle {
+  border-bottom: 1px dashed #a4a4a4;
+  color: #a4a4a4;
+  padding: 4px 0px;
+  margin-bottom: 20px;
+}
+
+/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>

+ 346 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/pricePeriod.vue

@@ -0,0 +1,346 @@
+<template>
+  <div id="pricePeriod">
+    <el-row :gutter="20">
+      <el-col :span="12">
+        <el-form-item label="商品标准价格" prop="standPrice">
+          <el-input
+            :style="`max-width:${inputWidth}px;`"
+            v-model="listData.standPrice"
+            @change="judgestandPrice"
+            ><template slot="prepend">¥</template></el-input
+          >
+        </el-form-item>
+        <el-form-item label="商品最低价格" prop="lowestPrice">
+          <el-input
+            :style="`max-width:${inputWidth}px;`"
+            v-model="listData.lowestPrice"
+            @change="judgelowestPrice"
+            ><template slot="prepend">¥</template></el-input
+          >
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-radio-group v-model="listData.status">
+            <el-radio :label="1">有效</el-radio>
+            <el-radio :label="0">无效</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="商品有效期" prop="timeArrays">
+          <el-date-picker
+            v-model="listData.timeArrays"
+            type="datetimerange"
+            value-format="timestamp"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            @change="changeDataTime(listData.timeArrays)"
+          >
+          </el-date-picker>
+          <el-tooltip class="item" effect="dark" placement="right">
+            <div slot="content">
+              商品有效期:商品可以进行售卖的有效时间范围<br />
+              1.非时间范围,不可以上架进行售卖;<br />
+              2.到了结束日期,不需要人为操作,系统自动下架商品
+            </div>
+            <i
+              style="margin-left: 10px; font-size: 20px; color: #e6a23c"
+              class="el-icon-warning"
+            ></i>
+          </el-tooltip>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <h5 style="margin: 0px">
+          商品标准价格明细表:
+          <el-button type="text" @click="addPriceInfo">添加</el-button>
+        </h5>
+        <el-table
+          :data="listData.standPriceJson"
+          show-summary
+          :summary-method="totalPrice"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+        >
+          <el-table-column type="index" label="序号" width="80" align="center">
+          </el-table-column>
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span
+                v-if="item.scope === 'editInfo'"
+                @click="editPriceInfo(scope.row)"
+                class="clickSpan"
+                >{{ scope.row[item.prop] }}</span
+              >
+              <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>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="100px"
+          >
+            <template slot-scope="scope">
+              <el-button type="text" @click="delPriceInfo(scope.row)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-col>
+    </el-row>
+    <!-- 费用类型 -->
+    <el-dialog
+      @open="openFunc"
+      :visible.sync="dialogVisible"
+      width="500px"
+      :show-close="false"
+      :close-on-click-modal="false"
+      destroy-on-close
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">{{ popupStatus === 1 ? "添加" : "编辑" }}</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <el-form
+        label-position="right"
+        label-width="110px"
+        :model="priceDetails"
+        :rules="rulesItem"
+        ref="priceDetails"
+      >
+        <el-form-item
+          v-for="(items, indexs) in priceDetailsList"
+          :key="indexs"
+          :label="items.label"
+          :prop="items.prop"
+        >
+          <el-select
+            v-if="items.scope === 'select'"
+            v-model="priceDetails[items.prop]"
+            placeholder="请选择费用类型"
+          >
+            <el-option
+              v-for="(item, index) in paycost"
+              :key="index"
+              :label="item.costName"
+              :value="item.costId"
+            >
+            </el-option>
+          </el-select>
+          <el-input v-else v-model="priceDetails[items.prop]"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitForm('priceDetails')"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+export default {
+  props: ["listData"],
+  data() {
+    return {
+      inputWidth: 217,
+      tableSet: [
+        {
+          label: "费用类型",
+          prop: "priceTypeName",
+          prop1: "priceTypeId",
+          scope: "editInfo",
+        },
+        {
+          label: "费用金额(元)",
+          prop: "price",
+          scope: "leftCh",
+          ch: "¥",
+        },
+      ],
+      // 弹窗字段
+      priceDetailsList: [
+        {
+          label: "费用类型",
+          prop: "priceTypeId",
+          scope: "select",
+          options: [],
+        },
+        {
+          label: "费用金额",
+          prop: "price",
+        },
+      ],
+      priceInfoIndex: null, //当前编辑价格明细内容位置
+      popupStatus: null,
+      dialogVisible: false,
+      priceDetails: {},
+      rulesItem: {
+        priceTypeId: [
+          {
+            required: true,
+            message: "请选择费用类型",
+            trigger: ["blur", "change"],
+          },
+        ],
+        price: [
+          { required: true, message: "请输入费用金额", trigger: "blur" },
+          {
+            validator(rule, value, callback) {
+              var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
+              if (reg.test(value)) {
+                callback();
+              } else {
+                callback(new Error("请输入不超过两位小数点的价格数值"));
+              }
+            },
+            trigger: "blur",
+          },
+        ],
+      }, //表单验证
+    };
+  },
+  computed: { ...mapGetters(["paysupply", "educationType", "paycost"]) },
+  methods: {
+    judgestandPrice() {},
+    judgelowestPrice() {},
+    changeDataTime() {},
+    openFunc() {
+      if (this.$refs.priceDetails) {
+        this.$nextTick(() => {
+          this.$refs.priceDetails.clearValidate();
+        });
+      }
+    },
+    /**
+     * 新增价格明细条
+     */
+    addPriceInfo() {
+      this.priceDetails = {};
+      this.popupStatus = 1;
+      this.dialogVisible = true;
+    },
+    /**
+     * 修改价格明细条
+     */
+    editPriceInfo(row) {
+      this.priceInfoIndex = this.listData.standPriceJson.indexOf(row);
+      this.priceDetails = JSON.parse(JSON.stringify(row));
+      this.popupStatus = 2;
+      this.dialogVisible = true;
+    },
+    /**
+     * 删除价格明细条
+     */
+    delPriceInfo(row) {
+      this.listData.standPriceJson.splice(
+        this.listData.standPriceJson.indexOf(row),
+        1
+      );
+    },
+    /**
+     * 价格明细表-总价计算
+     */
+    totalPrice(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "总价";
+          return;
+        }
+        const values = data.map((item) => Number(item[column.property]));
+        if (!values.every((value) => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index] = "¥" + sums[index];
+        } else {
+          sums[index] = "";
+        }
+      });
+
+      return sums;
+    },
+    /**
+     * 价格明细表-表单验证
+     */
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.rulesTable();
+        } else {
+          return false;
+        }
+      });
+    },
+    /**
+     * 价格明细表-提交API
+     */
+    rulesTable() {
+      if (this.popupStatus === 2) {
+        this.$set(
+          this.listData.standPriceJson,
+          this.priceInfoIndex,
+          this.priceDetails
+        );
+      } else {
+        if (this.listData.standPriceJson) {
+          const repeatCheck = this.listData.standPriceJson.some((item) => {
+            return item.priceTypeId === this.priceDetails.priceTypeId;
+          });
+          if (repeatCheck) {
+            this.$message.warning("已存在相同费用类型,禁止重复");
+            return;
+          }
+        } else {
+          this.$set(this.listData, "standPriceJson", []);
+        }
+        for (let i = 0; i < this.paycost.length; i++) {
+          if (
+            this.paycost[i].costId === Number(this.priceDetails.priceTypeId)
+          ) {
+            this.priceDetails.priceTypeName = this.paycost[i].costName;
+            break;
+          }
+        }
+        this.listData.standPriceJson.push(this.priceDetails);
+      }
+      this.dialogVisible = false;
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+</style>

+ 324 - 0
src/views/Marketing/goods/commodityManageMent/newAdd/productInformation.vue

@@ -0,0 +1,324 @@
+<template>
+  <div id="productInformation">
+    <el-row :gutter="20">
+      <el-col :span="12">
+        <el-form-item label="年份" prop="year">
+          <el-date-picker
+            v-model="listData.year"
+            type="year"
+            value-format="yyyy"
+            placeholder="请选择年份"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="供应方(服务)" prop="supplyId">
+          <el-select
+            v-model="listData.supplyId"
+            placeholder="请选择供应方(服务)"
+          >
+            <el-option
+              v-for="(item, index) in paysupply"
+              :key="index"
+              :label="`${item.supplyName}(${item.serveName})`"
+              :value="item.supplyId"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="商品类型" prop="goodsType">
+          <el-select
+            v-model="listData.goodsType"
+            placeholder="请选择商品类型"
+            @change="changeTypes"
+          >
+            <el-option
+              v-for="(item, index) in goodsTypeOptions"
+              :key="index"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="教育类型" prop="educationTypeId">
+          <el-select
+            v-model="listData.educationTypeId"
+            placeholder="请选择教育类型"
+          >
+            <el-option
+              v-for="(item, index) in educationType"
+              :key="index"
+              :label="item.educationName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="业务层次"
+          prop="businessId"
+          v-if="listData.educationTypeId"
+        >
+          <el-select v-model="listData.businessId" placeholder="请选择业务层次">
+            <el-option
+              v-for="(item, index) in newCourTypeOptions"
+              :key="index"
+              :label="item.projectName + '-' + item.businessName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="院校"
+          prop="schoolId"
+          v-if="listData.businessId && tireStatus.includes(3)"
+        >
+          <el-select v-model="listData.schoolId" placeholder="请选择院校">
+            <el-option
+              v-for="(item, index) in newSchoolOption"
+              :key="index"
+              :label="item.schoolName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="专业"
+          prop="majorId"
+          v-if="listData.businessId && tireStatus.includes(4)"
+        >
+          <el-select v-model="listData.majorId" placeholder="请选择专业">
+            <el-option
+              v-for="(item, index) in newMajorOption"
+              :key="index"
+              :label="item.categoryName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="商品名称" prop="goodsName">
+          <el-input
+            :style="`max-width: ${inputWidth}px`"
+            v-model="listData.goodsName"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          label="学时"
+          :prop="listData.goodsType === 1 ? 'classHours' : ''"
+        >
+          <el-input
+            :style="`max-width: ${inputWidth}px`"
+            v-model="listData.classHours"
+          ></el-input> </el-form-item
+      ></el-col>
+      <el-col :span="12">
+        <el-form-item label="商品封面">
+          <div class="goodsImage_Style">
+            <div class="imageStyBox" v-if="!listData.coverUrl">
+              <label for="uplose">
+                <i class="el-icon-circle-plus-outline iconStsz"></i
+              ></label>
+              <input
+                ref="file"
+                type="file"
+                style="display: none"
+                id="uplose"
+                @change="getImgFile"
+              />
+            </div>
+            <el-image
+              v-else
+              class="imageStyBoxShow"
+              :src="$methodsTools.splitImgHost(listData.coverUrl)"
+              :preview-src-list="[
+                $methodsTools.splitImgHost(listData.coverUrl),
+              ]"
+            >
+            </el-image>
+            <div class="labelMsg">
+              注:请上传小于300kb,尺寸为750*440的图片,支持gif、jpg、jpeg、png等类型
+            </div>
+          </div>
+          <el-button
+            v-if="listData.coverUrl"
+            type="danger"
+            size="mini"
+            class="margin-top: 20px;"
+            @click="clearImgs"
+            >删除</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+export default {
+  props: ["listData"],
+  data() {
+    return {
+      goodsTypeOptions: [
+        {
+          label: "视频",
+          value: 1,
+        },
+        {
+          label: "题库",
+          value: 2,
+        },
+        {
+          label: "补考",
+          value: 3,
+        },
+        {
+          label: "前培",
+          value: 4,
+        },
+      ], //商品类型
+      newCourTypeOptions: [], //业务层次
+      newSchoolOption: [], //院校
+      newMajorOption: [], //专业
+      tireStatus: "",
+      inputWidth: 217,
+    };
+  },
+  watch: {
+    /**
+     * 教育类型切换
+     */
+    "listData.educationTypeId"(val) {
+      this.$set(this.listData, "businessId", "");
+      if (val) {
+        this.getTireStatus(val);
+        this.getBusinessList(val);
+      }
+    },
+    /**
+     * 业务层次切换
+     */
+    "listData.businessId"(val) {
+      this.$set(this.listData, "schoolId", "");
+      this.$set(this.listData, "majorId", "");
+      if (val) {
+        this.getInitBabelList(val);
+      }
+    },
+  },
+  computed: { ...mapGetters(["paysupply", "educationType"]) },
+  methods: {
+    /**
+     * 商品类型切换
+     */
+    changeTypes(val) {},
+    /**
+     * 根据条件获取业务层次列表
+     */
+    getBusinessList(val) {
+      this.$api
+        .inquirebusinessList({ status: 1, educationId: val })
+        .then((res) => {
+          this.newCourTypeOptions = res.rows;
+        });
+    },
+    /**
+     * 根据条件获取院校、专业列表
+     */
+    getInitBabelList(val) {
+      /**
+       * 院校
+       */
+      this.$api
+        .inquireUserSchool({ status: 1, businessId: val })
+        .then((res) => {
+          this.newSchoolOption = res.rows;
+        });
+      /**
+       * 专业
+       */
+      this.$api
+        .inquireCourseMajor({ status: 1, businessId: val })
+        .then((res) => {
+          this.newMajorOption = res.rows;
+        });
+    },
+    /**
+     * 获取该教育类型是否包含院校和专业
+     */
+    getTireStatus(val) {
+      for (let i = 0; i < this.educationType.length; i++) {
+        if (this.educationType[i].id === val) {
+          this.tireStatus = this.educationType[i].tireStatus;
+          break;
+        }
+      }
+    },
+    /**
+     * 上传商品封面
+     */
+    getImgFile(e) {
+      var self = this;
+      var file = e.target.files[0];
+      if (file === undefined) {
+        self.$set(self.listData, "coverUrl", "");
+        return;
+      }
+      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      let typeList = ["jpg", "png", "jpeg", "gif"];
+      if (!typeList.includes(type[0])) {
+        self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
+        e.target.value = "";
+        return;
+      }
+      if (file.size > 0.3 * 1024 * 1024) {
+        self.$message.error("图片不得大于300kb");
+        return;
+      }
+      this.$upload.upload(file, 2).then((res) => {
+        self.listData.coverUrl = res;
+      });
+    },
+    /**
+     * 删除商品封面
+     */
+    clearImgs() {
+      this.$set(this.listData, "coverUrl", "");
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.goodsImage_Style {
+  display: flex;
+}
+.imageStyBox {
+  width: 300px;
+  height: 150px;
+  border: 2px dashed #999;
+  border-radius: 28px;
+  line-height: 150px;
+  text-align: center;
+  flex-shrink: 0;
+  margin-right: 10px;
+}
+.imageStyBoxShow {
+  width: 300px;
+  height: 150px;
+  flex-shrink: 0;
+  margin-right: 10px;
+}
+.iconStsz {
+  font-size: 40px;
+  color: #67c23a;
+  cursor: pointer;
+}
+.labelMsg {
+  color: #999;
+  font-size: 13px;
+}
+</style>

+ 4 - 8
src/views/education/examManagement/examArrangement/applicableProducts/checkStudent.vue

@@ -255,10 +255,9 @@ export default {
       this.dialogVisible = true;
       this.getInitData(2);
       this.$nextTick(() => {
-        console.log(this.$parent.listDataGoods);
-        this.disCheckList = JSON.parse(
-          JSON.stringify(this.$parent.listDataGoods.userId)
-        );
+        this.disCheckList = this.$parent.listDataGoods.userId.map(item => {
+          return item.userId
+        })
         this.$refs.elTable.clearSelection();
       });
     },
@@ -301,10 +300,7 @@ export default {
       this.getInitData(2);
     },
     submit() {
-      let data = this.selectArr.map((item) => {
-        return item.userId;
-      });
-      this.$emit("backStudentList",data)
+      this.$emit("backStudentList",this.selectArr)
       this.selectArr = [];
       this.close();
     },

+ 9 - 17
src/views/education/examManagement/examArrangement/applicableProducts/index.vue

@@ -117,7 +117,7 @@
               ><el-form-item label="" label-width="78px"
                 ><ul class="ul_style_gy" v-if="listDataGoods.userId.length">
                   <li
-                    v-for="(item, index) in converStudent(listDataGoods.userId)"
+                    v-for="(item, index) in listDataGoods.userId"
                     :key="index"
                   >
                     {{ item.realname }} - {{ item.idCard
@@ -208,7 +208,6 @@ export default {
         userId: [],
       },
       goodsList: [],
-      studentList: [],
       bfListData: {},
       businessList: [],
     };
@@ -246,15 +245,6 @@ export default {
         return obj;
       };
     },
-    converStudent: function () {
-      return function (arrays) {
-        var obj = [];
-        obj = this.studentList.filter((item) => {
-          return arrays.indexOf(item.userId) !== -1;
-        });
-        return obj;
-      };
-    },
   },
   methods: {
     backData(activeData) {
@@ -282,13 +272,10 @@ export default {
             .then((result) => {
               this.goodsList = result.rows;
             });
-          /**
-           * 获取学员列表
-           */
           this.$api
-            .inquiregradestudentlistStudent({ status: "0,1" })
+            .inquirepayservelistUser({ applyId: row.applyId })
             .then((res) => {
-              this.studentList = res.rows;
+              this.listDataGoods.userId = res.rows;
             });
           if (res.data.goodsType && res.data.goodsId.length) {
             if (!res.data.userId) {
@@ -335,6 +322,11 @@ export default {
           break;
         }
       }
+      if(this.listDataGoods.userId.length){
+        data.userId = this.listDataGoods.userId.map(item => {
+          return item.userId
+        })
+      }
       this.$api.systemapplyaddGoods(data).then((res) => {
         this.$message.success("适用商品设置成功");
         this.dialogVisiblenew = false;
@@ -348,7 +340,7 @@ export default {
     },
     delStudent(row) {
       const IDS = this.listDataGoods.userId.filter((item) => {
-        return item !== row.userId;
+        return item.userId !== row.userId;
       });
       this.$set(this.listDataGoods, "userId", IDS);
     },