Browse Source

兑换码添加画刊类型

natasha 1 year ago
parent
commit
2b7bd89700
2 changed files with 1496 additions and 1129 deletions
  1. 851 594
      src/views/cdkey_manage/AddGoods.vue
  2. 645 535
      src/views/cdkey_manage/CreateCdkey.vue

+ 851 - 594
src/views/cdkey_manage/AddGoods.vue

@@ -1,116 +1,266 @@
 <template>
   <div class="manage-root add-goods">
-    <Header/>
-    <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
+    <Header />
+    <breadcrumb
+      :breadcrumbList="breadcrumbList"
+      class="breadcrumb-box"
+    ></breadcrumb>
     <div class="manage-root-contain" v-loading="tableLoading">
-        <div class="common-title-box">
-            <h3>添加兑换内容 <span style="color:rgba(255, 20, 20, 1)" v-if="checkGoodsList.length>0">已选{{checkGoodsList.length}}</span></h3>
-            <div class="btn-box">
-                <el-button @click="$router.go(-1)" size="small">取消</el-button>
-                <el-button type="primary" @click="handleChooseGoods" size="small" :loading="loading"><svg-icon icon-class="Check" style="margin-right:8px"></svg-icon>完成</el-button>
-            </div>
+      <div class="common-title-box">
+        <h3>
+          添加兑换内容
+          <span
+            style="color: rgba(255, 20, 20, 1)"
+            v-if="checkGoodsList.length > 0"
+            >已选{{ checkGoodsList.length }}</span
+          >
+        </h3>
+        <div class="btn-box">
+          <el-button @click="$router.go(-1)" size="small">取消</el-button>
+          <el-button
+            type="primary"
+            @click="handleChooseGoods"
+            size="small"
+            :loading="loading"
+            ><svg-icon icon-class="Check" style="margin-right: 8px"></svg-icon
+            >完成</el-button
+          >
         </div>
-        <div class="filt-box">
-            <div class="filt-item">
-                <label>类型</label>
-                <ul>
-                    <li :class="[items.value===itemType?'active':'']" v-for="(items,indexs) in typeSelectList" :key="indexs" @click="itemType=items.value;getList(1)">
-                        <i v-if="items.value===itemType" class="el-icon-success"></i>
-                        {{items.label}}
-                    </li>
-                </ul>
-            </div>
-            <template v-if="itemType==='kecheng'">
-                <div class="filt-item">
-                    <label>学段</label>
-                    <ul>
-                        <li :class="[items.study_phase===courseForm.studyValue?'active':'',courseForm.categoryValue==='ZB'?'not-allow':'']" v-for="(items,indexs) in studyList" :key="indexs" @click="handleClick('courseForm','studyValue',items.study_phase)">
-                            <i v-if="items.study_phase===courseForm.studyValue" class="el-icon-success"></i>
-                            {{items.study_phase_name}}
-                        </li>
-                    </ul>
-                </div>
-                <div class="filt-item">
-                    <label>类别</label>
-                    <ul>
-                        <li :class="[itemt.value===courseForm.categoryValue?'active':'']" v-for="(itemt,indext) in categoryList" :key="indext" @click="handleClick('courseForm','categoryValue',itemt.value)">
-                            <i v-if="itemt.value===courseForm.categoryValue" class="el-icon-success"></i>
-                            {{itemt.label}}
-                        </li>
-                    </ul>
-                </div>
-            </template>
-            <template v-else-if="itemType==='baozhi'">
-                <div class="filt-item">
-                    <label>年份</label>
-                    <ul>
-                        <li :class="[itemy.value===baozhiForm.yearValue?'active':'']" v-for="(itemy,indexy) in yearList" :key="indexy" @click="handleClick('baozhiForm','yearValue',itemy.value)">
-                            <i v-if="itemy.value===baozhiForm.yearValue" class="el-icon-success"></i>
-                            {{itemy.label}}
-                        </li>
-                    </ul>
-                </div>
-                <div class="filt-item">
-                    <label>学段</label>
-                    <ul>
-                        <li :class="[items.study_phase===baozhiForm.studyValue?'active':'']" v-for="(items,indexs) in baozhiStudyList" :key="indexs" @click="handleClick('baozhiForm','studyValue',items.study_phase,items.study_phase_name)">
-                            <i v-if="items.study_phase===baozhiForm.studyValue" class="el-icon-success"></i>
-                            {{items.study_phase_name}}
-                        </li>
-                    </ul>
-                </div>
-                <div class="filt-item">
-                    <label>类型</label>
-                    <ul>
-                        <li :class="[itemt.value===baozhiForm.typeValue?'active':'']" v-for="(itemt,indext) in typeList" :key="indext" @click="handleClick('baozhiForm','typeValue',itemt.value)">
-                            <i v-if="itemt.value===baozhiForm.typeValue" class="el-icon-success"></i>
-                            {{itemt.label}}
-                        </li>
-                    </ul>
-                </div>
-            </template>
-            <template v-if="itemType==='jingdu'">
-                <div class="filt-item">
-                    <label>主题</label>
-                    <ul>
-                        <li :class="[itemy.value===jingduForm.categoryValue?'active':'']" v-for="(itemy,indexy) in themeList" :key="indexy" @click="handleClick('jingduForm','categoryValue',itemy.value)">
-                            <i v-if="itemy.value===baozhiForm.categoryValue" class="el-icon-success"></i>
-                            {{itemy.label}}
-                        </li>
-                    </ul>
-                </div>
-                <div class="filt-item">
-                    <label>学段</label>
-                    <ul>
-                        <li :class="[items.study_phase===jingduForm.studyValue?'active':'']" v-for="(items,indexs) in jingduStudyList" :key="indexs" @click="handleClick('jingduForm','studyValue',items.study_phase,items.study_phase_name)">
-                            <i v-if="items.study_phase===jingduForm.studyValue" class="el-icon-success"></i>
-                            {{items.study_phase_name}}
-                        </li>
-                    </ul>
-                </div>
-            </template>
-            <div class="filt-item">
-                <label>搜索</label>
-                <el-input placeholder="搜索" v-model="searchValue" maxlength="20">
-                    <el-button slot="append" icon="el-icon-search" @click="getList(1)"></el-button>
-                </el-input>
-            </div>
-        </div>
-        <ul class="item-box">
-            <li v-for="(itemC,indexC) in tableData" :key="indexC" @click="changeSelectGoods(itemC)">
-                <el-image
-                    class="image"
-                    :src="itemC.cover_image_url?itemC.cover_image_url:itemC.goods_type===2?require('../../assets/baozhi'+(Math.floor(Math.random()*2)+1)+'.png'):require('../../assets/kecheng'+(Math.floor(Math.random()*3)+1)+'.png')"
-                    :fit="'cover'">
-                </el-image>
-                <el-checkbox v-model="itemC.check" @change="changeSelectGoods(itemC)">{{itemC.name}}</el-checkbox>
+      </div>
+      <div class="filt-box">
+        <div class="filt-item">
+          <label>类型</label>
+          <ul>
+            <li
+              :class="[items.value === itemType ? 'active' : '']"
+              v-for="(items, indexs) in typeSelectList"
+              :key="indexs"
+              @click="
+                itemType = items.value;
+                getList(1);
+              "
+            >
+              <i v-if="items.value === itemType" class="el-icon-success"></i>
+              {{ items.label }}
             </li>
-        </ul>
-        <div class="nodata" v-if="total_count===0">
-            <img src="../../assets/nodata.png" />
-            <p>找不到文件</p>
+          </ul>
+        </div>
+        <template v-if="itemType === 'kecheng'">
+          <div class="filt-item">
+            <label>学段</label>
+            <ul>
+              <li
+                :class="[
+                  items.study_phase === courseForm.studyValue ? 'active' : '',
+                  courseForm.categoryValue === 'ZB' ? 'not-allow' : '',
+                ]"
+                v-for="(items, indexs) in studyList"
+                :key="indexs"
+                @click="
+                  handleClick('courseForm', 'studyValue', items.study_phase)
+                "
+              >
+                <i
+                  v-if="items.study_phase === courseForm.studyValue"
+                  class="el-icon-success"
+                ></i>
+                {{ items.study_phase_name }}
+              </li>
+            </ul>
+          </div>
+          <div class="filt-item">
+            <label>类别</label>
+            <ul>
+              <li
+                :class="[
+                  itemt.value === courseForm.categoryValue ? 'active' : '',
+                ]"
+                v-for="(itemt, indext) in categoryList"
+                :key="indext"
+                @click="handleClick('courseForm', 'categoryValue', itemt.value)"
+              >
+                <i
+                  v-if="itemt.value === courseForm.categoryValue"
+                  class="el-icon-success"
+                ></i>
+                {{ itemt.label }}
+              </li>
+            </ul>
+          </div>
+        </template>
+        <template v-else-if="itemType === 'baozhi'">
+          <div class="filt-item">
+            <label>年份</label>
+            <ul>
+              <li
+                :class="[itemy.value === baozhiForm.yearValue ? 'active' : '']"
+                v-for="(itemy, indexy) in yearList"
+                :key="indexy"
+                @click="handleClick('baozhiForm', 'yearValue', itemy.value)"
+              >
+                <i
+                  v-if="itemy.value === baozhiForm.yearValue"
+                  class="el-icon-success"
+                ></i>
+                {{ itemy.label }}
+              </li>
+            </ul>
+          </div>
+          <div class="filt-item">
+            <label>学段</label>
+            <ul>
+              <li
+                :class="[
+                  items.study_phase === baozhiForm.studyValue ? 'active' : '',
+                ]"
+                v-for="(items, indexs) in baozhiStudyList"
+                :key="indexs"
+                @click="
+                  handleClick(
+                    'baozhiForm',
+                    'studyValue',
+                    items.study_phase,
+                    items.study_phase_name
+                  )
+                "
+              >
+                <i
+                  v-if="items.study_phase === baozhiForm.studyValue"
+                  class="el-icon-success"
+                ></i>
+                {{ items.study_phase_name }}
+              </li>
+            </ul>
+          </div>
+          <div class="filt-item">
+            <label>类型</label>
+            <ul>
+              <li
+                :class="[itemt.value === baozhiForm.typeValue ? 'active' : '']"
+                v-for="(itemt, indext) in typeList"
+                :key="indext"
+                @click="handleClick('baozhiForm', 'typeValue', itemt.value)"
+              >
+                <i
+                  v-if="itemt.value === baozhiForm.typeValue"
+                  class="el-icon-success"
+                ></i>
+                {{ itemt.label }}
+              </li>
+            </ul>
+          </div>
+        </template>
+        <template v-if="itemType === 'jingdu'">
+          <div class="filt-item">
+            <label>主题</label>
+            <ul>
+              <li
+                :class="[
+                  itemy.value === jingduForm.categoryValue ? 'active' : '',
+                ]"
+                v-for="(itemy, indexy) in themeList"
+                :key="indexy"
+                @click="handleClick('jingduForm', 'categoryValue', itemy.value)"
+              >
+                <i
+                  v-if="itemy.value === baozhiForm.categoryValue"
+                  class="el-icon-success"
+                ></i>
+                {{ itemy.label }}
+              </li>
+            </ul>
+          </div>
+          <div class="filt-item">
+            <label>学段</label>
+            <ul>
+              <li
+                :class="[
+                  items.study_phase === jingduForm.studyValue ? 'active' : '',
+                ]"
+                v-for="(items, indexs) in jingduStudyList"
+                :key="indexs"
+                @click="
+                  handleClick(
+                    'jingduForm',
+                    'studyValue',
+                    items.study_phase,
+                    items.study_phase_name
+                  )
+                "
+              >
+                <i
+                  v-if="items.study_phase === jingduForm.studyValue"
+                  class="el-icon-success"
+                ></i>
+                {{ items.study_phase_name }}
+              </li>
+            </ul>
+          </div>
+        </template>
+        <template v-else-if="itemType === 'huakan'">
+          <div class="filt-item">
+            <label>年份</label>
+            <ul>
+              <li
+                :class="[itemy.value === huakanForm.yearValue ? 'active' : '']"
+                v-for="(itemy, indexy) in huakanyearList"
+                :key="indexy"
+                @click="handleClick('huakanForm', 'yearValue', itemy.value)"
+              >
+                <i
+                  v-if="itemy.value === huakanForm.yearValue"
+                  class="el-icon-success"
+                ></i>
+                {{ itemy.label }}
+              </li>
+            </ul>
+          </div>
+        </template>
+        <div class="filt-item">
+          <label>搜索</label>
+          <el-input placeholder="搜索" v-model="searchValue" maxlength="20">
+            <el-button
+              slot="append"
+              icon="el-icon-search"
+              @click="getList(1)"
+            ></el-button>
+          </el-input>
         </div>
-        <!-- <el-pagination
+      </div>
+      <ul class="item-box">
+        <li
+          v-for="(itemC, indexC) in tableData"
+          :key="indexC"
+          @click="changeSelectGoods(itemC)"
+        >
+          <el-image
+            class="image"
+            :src="
+              itemC.cover_image_url || itemC.iss_cover_url
+                ? itemC.cover_image_url || itemC.iss_cover_url
+                : itemC.goods_type === 2
+                ? require('../../assets/baozhi' +
+                    (Math.floor(Math.random() * 2) + 1) +
+                    '.png')
+                : require('../../assets/kecheng' +
+                    (Math.floor(Math.random() * 3) + 1) +
+                    '.png')
+            "
+            :fit="'cover'"
+          >
+          </el-image>
+          <el-checkbox
+            v-model="itemC.check"
+            @change="changeSelectGoods(itemC)"
+            >{{ itemC.name || itemC.iss_name }}</el-checkbox
+          >
+        </li>
+      </ul>
+      <div class="nodata" v-if="total_count === 0">
+        <img src="../../assets/nodata.png" />
+        <p>找不到文件</p>
+      </div>
+      <!-- <el-pagination
             background
             :current-page="currentPages"
             :page-size="page_capacitys"
@@ -121,17 +271,19 @@
             @current-change="(val)=>handleCurrentChange(val,'currentPages')"
             v-if="total_count>0&&(courseForm.categoryValue==='ZB'||itemType==='jingdu')"
         /> -->
-        <el-pagination
-            background
-            :current-page="currentPage"
-            :page-size="page_capacity"
-            :page-sizes="[9, 18, 27, 36, 45, 54]"
-            :total="total_count"
-            layout="total, prev, pager, next, sizes, jumper"
-            @size-change="(val)=>handleSizeChange(val,'page_capacity','currentPage')"
-            @current-change="(val)=>handleCurrentChange(val,'currentPage')"
-            v-else-if="total_count>0"
-        />
+      <el-pagination
+        background
+        :current-page="currentPage"
+        :page-size="page_capacity"
+        :page-sizes="[9, 18, 27, 36, 45, 54]"
+        :total="total_count"
+        layout="total, prev, pager, next, sizes, jumper"
+        @size-change="
+          (val) => handleSizeChange(val, 'page_capacity', 'currentPage')
+        "
+        @current-change="(val) => handleCurrentChange(val, 'currentPage')"
+        v-else-if="total_count > 0"
+      />
     </div>
   </div>
 </template>
@@ -140,9 +292,9 @@
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
-import Breadcrumb from '../../components/Breadcrumb.vue';
+import Breadcrumb from "../../components/Breadcrumb.vue";
 import { getLogin } from "@/api/ajax";
-import { mapState } from 'vuex'; 
+import { mapState } from "vuex";
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -151,218 +303,265 @@ export default {
   data() {
     //这里存放数据
     return {
-        breadcrumbList:[
-            {
-                icon:'barcode-line',
-                url:'',
-                text:''
-            },
-            {
-                icon:'',
-                url:'',
-                notLink: true,
-                text:'兑换码管理'
-            },
-            {
-                icon:'',
-                url:'',
-                text:'创建兑换码'
-            },
-            {
-                icon:'',
-                url:'',
-                text:'添加内容'
-            }
-        ],
-        pageLoading: false,
-        tableData:[],
-        tableHeight: "", // 表格高度
-        total_count: 0,
-        loading: false,
-        tableLoading: false,
-        itemType: 'baozhi',
-        typeSelectList: [
-            {
-                label: '报纸',
-                value: 'baozhi'
-            },
-            {
-                label: '精读',
-                value: 'jingdu'
-            },
-            {
-                label: '课程',
-                value: 'kecheng'
-            }
-        ],
-        yearList:[
-            {
-                value: -1,
-                label: '全部'
-            }
-        ],
-        studyList:[
-            {
-                study_phase: -1,
-                study_phase_name: '全部'
-            }
-        ],
-        baozhiStudyList:[],
-        categoryList:[
-            {
-                value: 'LB',
-                label: '录播'
-            },
-            {
-                value: 'ZB',
-                label: '直播'
-            },
-        ],
-        typeList:[
-            {
-                value: 0,
-                label: '单本'
-            },
-            {
-                value: 1,
-                label: '专辑'
-            },
-        ],
-        courseForm:{
-            studyValue: -1,
-            categoryValue: 'LB'
+      breadcrumbList: [
+        {
+          icon: "barcode-line",
+          url: "",
+          text: "",
         },
-        baozhiForm:{
-            yearValue: -1,
-            studyValue: -1,
-            typeValue: 0,
+        {
+          icon: "",
+          url: "",
+          notLink: true,
+          text: "兑换码管理",
         },
-        jingduForm:{
-            studyValue: 11,
-            categoryValue: ''
+        {
+          icon: "",
+          url: "",
+          text: "创建兑换码",
         },
-        searchValue: '',
-        page_capacity: 18, 
-        currentPage: 1,
-        currentPages: 1,
-        page_capacitys: 8, // 每页条数
-        themeList:[],
-        jingduStudyList: [
-            {
-                study_phase: 11,
-                study_phase_name: '小学'
-            },
-            {
-                study_phase: 21,
-                study_phase_name: '初一'
-            },
-            {
-                study_phase: 22,
-                study_phase_name: '初二'
-            },
-            {
-                study_phase: 23,
-                study_phase_name: '初三'
-            }
-        ],
-        checkGoodsList:[],
-        checkGoodsIdList: []
-    }
+        {
+          icon: "",
+          url: "",
+          text: "添加内容",
+        },
+      ],
+      pageLoading: false,
+      tableData: [],
+      tableHeight: "", // 表格高度
+      total_count: 0,
+      loading: false,
+      tableLoading: false,
+      itemType: "baozhi",
+      typeSelectList: [
+        {
+          label: "报纸",
+          value: "baozhi",
+        },
+        {
+          label: "精读",
+          value: "jingdu",
+        },
+        {
+          label: "课程",
+          value: "kecheng",
+        },
+        {
+          label: "画刊",
+          value: "huakan",
+        },
+      ],
+      yearList: [
+        {
+          value: -1,
+          label: "全部",
+        },
+      ],
+      huakanyearList: [
+        {
+          value: null,
+          label: "全部",
+        },
+      ],
+      studyList: [
+        {
+          study_phase: -1,
+          study_phase_name: "全部",
+        },
+      ],
+      baozhiStudyList: [],
+      categoryList: [
+        {
+          value: "LB",
+          label: "录播",
+        },
+        {
+          value: "ZB",
+          label: "直播",
+        },
+      ],
+      typeList: [
+        {
+          value: 0,
+          label: "单本",
+        },
+        {
+          value: 1,
+          label: "专辑",
+        },
+      ],
+      courseForm: {
+        studyValue: -1,
+        categoryValue: "LB",
+      },
+      baozhiForm: {
+        yearValue: -1,
+        studyValue: -1,
+        typeValue: 0,
+      },
+      jingduForm: {
+        studyValue: 11,
+        categoryValue: "",
+      },
+      huakanForm: {
+        yearValue: null,
+        key_word: "",
+      },
+      searchValue: "",
+      page_capacity: 18,
+      currentPage: 1,
+      currentPages: 1,
+      page_capacitys: 8, // 每页条数
+      themeList: [],
+      jingduStudyList: [
+        {
+          study_phase: 11,
+          study_phase_name: "小学",
+        },
+        {
+          study_phase: 21,
+          study_phase_name: "初一",
+        },
+        {
+          study_phase: 22,
+          study_phase_name: "初二",
+        },
+        {
+          study_phase: 23,
+          study_phase_name: "初三",
+        },
+      ],
+      checkGoodsList: [],
+      checkGoodsIdList: [],
+    };
   },
   //计算属性 类似于data概念
-  computed: {
-  },
+  computed: {},
   //监控data中数据变化
   watch: {},
   //方法集合
   methods: {
-    changeSelectGoods(item){
-        if(this.checkGoodsIdList.indexOf(item.goods_id)>-1){
-            this.checkGoodsIdList.splice(this.checkGoodsIdList.indexOf(item.goods_id),1)
-            this.checkGoodsList.splice(this.checkGoodsIdList.indexOf(item.goods_id),1)
-            item.check = false
-        }else{
-            this.checkGoodsIdList.push(item.goods_id)
-            this.checkGoodsList.push({
-                goods_id: item.goods_id,
-                goods_type: item.goods_type
-            })
-            item.check = true
-        }
+    changeSelectGoods(item) {
+      if (this.checkGoodsIdList.indexOf(item.goods_id) > -1) {
+        this.checkGoodsIdList.splice(
+          this.checkGoodsIdList.indexOf(item.goods_id),
+          1
+        );
+        this.checkGoodsList.splice(
+          this.checkGoodsIdList.indexOf(item.goods_id),
+          1
+        );
+        item.check = false;
+      } else {
+        this.checkGoodsIdList.push(item.goods_id);
+        this.checkGoodsList.push({
+          goods_id: item.goods_id,
+          goods_type: item.goods_type,
+        });
+        item.check = true;
+      }
     },
-    getList(val){
-        this.tableLoading = true
-        if(val){
-            this.pageNumber = val
-        }
-        let MethodName = "/ShopServer/Manager/GoodsQuery/PageQueryCourseList"
-        let data = {
-            page_capacity:this.page_capacity,
-            cur_page: this.currentPage,
-            search_content: this.searchValue.trim(),
-        }
-        if(this.itemType==='baozhi'){
-            MethodName = "/ShopServer/Manager/GoodsQuery/PageQueryIssueList"
-            data.year_label = this.baozhiForm.yearValue
-            data.study_phase = this.baozhiForm.studyValue
-            data.comb_flag = this.baozhiForm.typeValue==1?null:this.baozhiForm.typeValue
-            data.album_flag = this.baozhiForm.typeValue==0?null:this.baozhiForm.typeValue
-            getLogin(MethodName, data)
-            .then((res) => {
-                this.tableLoading = false
-                if(res.status===1){
-                    res.issue_list.forEach(item => {
-                        item.goods_type = 2
-                        item.goods_id = item.id
-                        item.check = this.checkGoodsIdList.indexOf(item.id)>-1?true:false
-                    });
-                    this.tableData = res.issue_list
-                    this.total_count = res.total_count
-                }
-            })
-            .catch(() => {
-                this.tableLoading = false
-            }); 
-        }else if(this.itemType==='kecheng'){
-            data.course_type = this.courseForm.categoryValue,
-            data.study_phase = this.courseForm.studyValue
-            getLogin(MethodName, data)
-            .then((res) => {
-                this.tableLoading = false
-                if(res.status===1){
-                    res.course_list.forEach(item => {
-                        item.goods_type = this.courseForm.categoryValue==='ZB'?1:0
-                        item.goods_id = item.id
-                        item.check = this.checkGoodsIdList.indexOf(item.id)>-1?true:false
-                    });
-                    this.tableData = res.course_list
-                    this.total_count = res.total_count
-                }
-            })
-            .catch(() => {
-                this.tableLoading = false
-            }); 
-        }else if(this.itemType==='jingdu'){
-            MethodName = "/ShopServer/Manager/GoodsQuery/PageQueryIreadArticleList"
-            data.label = this.jingduForm.categoryValue
-            data.study_phase = this.jingduForm.studyValue
-            getLogin(MethodName, data)
-            .then((res) => {
-                this.tableLoading = false
-                if(res.status===1){
-                    res.iread_article_list.forEach(item => {
-                        item.goods_type = 3
-                        item.goods_id = item.id
-                        item.check = this.checkGoodsIdList.indexOf(item.id)>-1?true:false
-                    });
-                    this.tableData = res.iread_article_list
-                    this.total_count = res.total_count
-                }
-            })
-            .catch(() => {
-                this.tableLoading = false
-            });
-        }
+    getList(val) {
+      this.tableLoading = true;
+      if (val) {
+        this.pageNumber = val;
+      }
+      let MethodName = "/ShopServer/Manager/GoodsQuery/PageQueryCourseList";
+      let data = {
+        page_capacity: this.page_capacity,
+        cur_page: this.currentPage,
+        search_content: this.searchValue.trim(),
+      };
+      if (this.itemType === "baozhi") {
+        MethodName = "/ShopServer/Manager/GoodsQuery/PageQueryIssueList";
+        data.year_label = this.baozhiForm.yearValue;
+        data.study_phase = this.baozhiForm.studyValue;
+        data.comb_flag =
+          this.baozhiForm.typeValue == 1 ? null : this.baozhiForm.typeValue;
+        data.album_flag =
+          this.baozhiForm.typeValue == 0 ? null : this.baozhiForm.typeValue;
+        getLogin(MethodName, data)
+          .then((res) => {
+            this.tableLoading = false;
+            if (res.status === 1) {
+              res.issue_list.forEach((item) => {
+                item.goods_type = 2;
+                item.goods_id = item.id;
+                item.check =
+                  this.checkGoodsIdList.indexOf(item.id) > -1 ? true : false;
+              });
+              this.tableData = res.issue_list;
+              this.total_count = res.total_count;
+            }
+          })
+          .catch(() => {
+            this.tableLoading = false;
+          });
+      } else if (this.itemType === "kecheng") {
+        (data.course_type = this.courseForm.categoryValue),
+          (data.study_phase = this.courseForm.studyValue);
+        getLogin(MethodName, data)
+          .then((res) => {
+            this.tableLoading = false;
+            if (res.status === 1) {
+              res.course_list.forEach((item) => {
+                item.goods_type =
+                  this.courseForm.categoryValue === "ZB" ? 1 : 0;
+                item.goods_id = item.id;
+                item.check =
+                  this.checkGoodsIdList.indexOf(item.id) > -1 ? true : false;
+              });
+              this.tableData = res.course_list;
+              this.total_count = res.total_count;
+            }
+          })
+          .catch(() => {
+            this.tableLoading = false;
+          });
+      } else if (this.itemType === "jingdu") {
+        MethodName = "/ShopServer/Manager/GoodsQuery/PageQueryIreadArticleList";
+        data.label = this.jingduForm.categoryValue;
+        data.study_phase = this.jingduForm.studyValue;
+        getLogin(MethodName, data)
+          .then((res) => {
+            this.tableLoading = false;
+            if (res.status === 1) {
+              res.iread_article_list.forEach((item) => {
+                item.goods_type = 3;
+                item.goods_id = item.id;
+                item.check =
+                  this.checkGoodsIdList.indexOf(item.id) > -1 ? true : false;
+              });
+              this.tableData = res.iread_article_list;
+              this.total_count = res.total_count;
+            }
+          })
+          .catch(() => {
+            this.tableLoading = false;
+          });
+      } else if (this.itemType === "huakan") {
+        MethodName = "/PaperServer/Manager/PicIssueManager/PageQueryIssue";
+        data.year_label = this.huakanForm.yearValue;
+        data.key_word = this.searchValue.trim();
+
+        getLogin(MethodName, data)
+          .then((res) => {
+            this.tableLoading = false;
+            if (res.status === 1) {
+              res.data.list.forEach((item) => {
+                item.goods_type = 4;
+                item.goods_id = item.id;
+                item.check =
+                  this.checkGoodsIdList.indexOf(item.id) > -1 ? true : false;
+              });
+              this.tableData = res.data.list;
+              this.total_count = res.data.total_count;
+            }
+          })
+          .catch(() => {
+            this.tableLoading = false;
+          });
+      }
     },
     //计算table高度(动态设置table高度)
     getTableHeight() {
@@ -374,336 +573,394 @@ export default {
         this.tableHeight = window.innerHeight - tableH;
       }
     },
-    handleSizeChange(val,type,page) {
-        this[type] = val
-        this[page] = 1;
-        this.getList()
+    handleSizeChange(val, type, page) {
+      this[type] = val;
+      this[page] = 1;
+      this.getList();
     },
-    handleCurrentChange(val,type) {
-        this[type] = val
-        this.getList()
+    handleCurrentChange(val, type) {
+      this[type] = val;
+      this.getList();
     },
     // 去掉前后空格
-    handleTrim(form,fild){
-        this[form][fild] = this[form][fild].trim()
+    handleTrim(form, fild) {
+      this[form][fild] = this[form][fild].trim();
     },
-    handleClick(form,file,value,name){
-        if(form==='courseForm'&&file==='categoryValue'&&value==='ZB'){
-            this.courseForm.studyValue = -1
-        }else if(form==='courseForm'&&file==='categoryValue'&&value==='LB'){
-            this.courseForm.studyValue = window.localStorage.getItem("courseFormstudyValue")?window.localStorage.getItem("courseFormstudyValue")*1:-1
-        }
-        if(form==='courseForm'&&file==='studyValue'&&this.courseForm.categoryValue==='ZB'){
-            return false
-        }
-        this[form][file] = value
-        this.currentPage = 1;
-        this.currentPages = 1
-        this.getList()
+    handleClick(form, file, value, name) {
+      if (form === "courseForm" && file === "categoryValue" && value === "ZB") {
+        this.courseForm.studyValue = -1;
+      } else if (
+        form === "courseForm" &&
+        file === "categoryValue" &&
+        value === "LB"
+      ) {
+        this.courseForm.studyValue = window.localStorage.getItem(
+          "courseFormstudyValue"
+        )
+          ? window.localStorage.getItem("courseFormstudyValue") * 1
+          : -1;
+      }
+      if (
+        form === "courseForm" &&
+        file === "studyValue" &&
+        this.courseForm.categoryValue === "ZB"
+      ) {
+        return false;
+      }
+      this[form][file] = value;
+      this.currentPage = 1;
+      this.currentPages = 1;
+      this.getList();
     },
     // 提交表单
-    handleChooseGoods(){
-        if(this.checkGoodsList.length===0){
-            this.$message.warning('至少需要选择一个内容')
-            return
-        }
-        this.loading = true
-        let MethodName = "/ShopServer/Manager/DiscountCodeManager/AddGoodsToDiscountCode";
-        let data = {
-            discount_code_id: window.localStorage.getItem('cdKeyId')?window.localStorage.getItem('cdKeyId'):'',
-            goods_list: this.checkGoodsList,
-        }
-        getLogin(MethodName, data)
+    handleChooseGoods() {
+      if (this.checkGoodsList.length === 0) {
+        this.$message.warning("至少需要选择一个内容");
+        return;
+      }
+      this.loading = true;
+      let MethodName =
+        "/ShopServer/Manager/DiscountCodeManager/AddGoodsToDiscountCode";
+      let data = {
+        discount_code_id: window.localStorage.getItem("cdKeyId")
+          ? window.localStorage.getItem("cdKeyId")
+          : "",
+        goods_list: this.checkGoodsList,
+      };
+      getLogin(MethodName, data)
         .then((res) => {
-            this.loading = false
-            if(res.status===1){
-                this.$router.go(-1)
-            }
-        }).catch((res) =>{
-            this.loading = false
+          this.loading = false;
+          if (res.status === 1) {
+            this.$router.go(-1);
+          }
         })
+        .catch((res) => {
+          this.loading = false;
+        });
     },
     // 学段列表
-    getStudyList(){
-        let MethodName = "/OrgServer/DictManager/GetStudyPhaseList"
-        getLogin(MethodName, {})
+    getStudyList() {
+      let MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
+      getLogin(MethodName, {})
         .then((res) => {
-            if(res.status===1){
-                let studyList = [
-                        {
-                            study_phase: -1,
-                            study_phase_name: '全部'
-                        }
-                    ]
-                this.studyList = studyList.concat(res.study_phase_list)
-                this.baozhiStudyList = res.study_phase_list
-                this.baozhiForm.studyValue = window.localStorage.getItem("baozhiFormstudyValue")?window.localStorage.getItem("baozhiFormstudyValue")*1:res.study_phase_list[0]?res.study_phase_list[0].study_phase:-1
-                if(this.itemType==='baozhi'){
-                    this.titleName = window.localStorage.getItem("baozhiFormstudyValueName")?window.localStorage.getItem("baozhiFormstudyValueName"):res.study_phase_list[0]?res.study_phase_list[0].study_phase_name:''
-                }else if(this.itemType==='jingdu'){
-                    this.titleName = window.localStorage.getItem("jingduFormstudyValueName")?window.localStorage.getItem("jingduFormstudyValueName"):res.study_phase_list[0]?res.study_phase_list[0].study_phase_name:''
-                }else if(this.itemType==='kecheng'){
-                    this.titleName = window.localStorage.getItem("courseFormstudyValueName")?window.localStorage.getItem("courseFormstudyValueName"):res.study_phase_list[0]?res.study_phase_list[0].study_phase_name:''
-                }
-                
+          if (res.status === 1) {
+            let studyList = [
+              {
+                study_phase: -1,
+                study_phase_name: "全部",
+              },
+            ];
+            this.studyList = studyList.concat(res.study_phase_list);
+            this.baozhiStudyList = res.study_phase_list;
+            this.baozhiForm.studyValue = window.localStorage.getItem(
+              "baozhiFormstudyValue"
+            )
+              ? window.localStorage.getItem("baozhiFormstudyValue") * 1
+              : res.study_phase_list[0]
+              ? res.study_phase_list[0].study_phase
+              : -1;
+            if (this.itemType === "baozhi") {
+              this.titleName = window.localStorage.getItem(
+                "baozhiFormstudyValueName"
+              )
+                ? window.localStorage.getItem("baozhiFormstudyValueName")
+                : res.study_phase_list[0]
+                ? res.study_phase_list[0].study_phase_name
+                : "";
+            } else if (this.itemType === "jingdu") {
+              this.titleName = window.localStorage.getItem(
+                "jingduFormstudyValueName"
+              )
+                ? window.localStorage.getItem("jingduFormstudyValueName")
+                : res.study_phase_list[0]
+                ? res.study_phase_list[0].study_phase_name
+                : "";
+            } else if (this.itemType === "kecheng") {
+              this.titleName = window.localStorage.getItem(
+                "courseFormstudyValueName"
+              )
+                ? window.localStorage.getItem("courseFormstudyValueName")
+                : res.study_phase_list[0]
+                ? res.study_phase_list[0].study_phase_name
+                : "";
             }
+          }
         })
-        .catch(() => {
-            
-        }); 
+        .catch(() => {});
     },
     // 获取年份列表
-    getYearList(){
-        this.yearList = [
-            {
-                value: -1,
-                label: '全部'
-            }
-        ]
-        let yearList = []
-        let MethodName = "/ShopServer/Client/ShopHomeQuery/GetIssueYearLabelList"
-        getLogin(MethodName, {})
+    getYearList() {
+      this.yearList = [
+        {
+          value: -1,
+          label: "全部",
+        },
+      ];
+      let yearList = [];
+      let MethodName = "/ShopServer/Client/ShopHomeQuery/GetIssueYearLabelList";
+      getLogin(MethodName, {})
         .then((res) => {
-            if(res.status===1){
-                res.year_label_list.forEach(nowYear => {
-                    let obj = {
-                        value: nowYear,
-                        label: nowYear
-                    }
-                    yearList.push(obj)
-                })
-                this.yearList = this.yearList.concat(yearList)
-            }
+          if (res.status === 1) {
+            res.year_label_list.forEach((nowYear) => {
+              let obj = {
+                value: nowYear,
+                label: nowYear,
+              };
+              yearList.push(obj);
+            });
+            this.yearList = this.yearList.concat(yearList);
+          }
         })
         .catch(() => {
-            this.loading = false
+          this.loading = false;
         });
-        
+      this.huakanyearList = [
+        {
+          value: null,
+          label: "全部",
+        },
+      ];
+      getLogin(MethodName, { goods_type: 4 })
+        .then((res) => {
+          if (res.status === 1) {
+            let yearLists = [];
+            res.year_label_list.forEach((nowYear) => {
+              let obj = {
+                value: nowYear,
+                label: nowYear,
+              };
+              yearLists.push(obj);
+            });
+            this.huakanyearList = this.huakanyearList.concat(yearLists);
+          }
+        })
+        .catch(() => {});
     },
-    getLabelList(){
-        this.themeList = [
-            {
-                value: '',
-                label: '全部'
-            }
-        ]
-        let yearList = []
-        let MethodName = "/ShopServer/Manager/GoodsQuery/GetIreadArticleLabelList"
-        getLogin(MethodName, {})
+    getLabelList() {
+      this.themeList = [
+        {
+          value: "",
+          label: "全部",
+        },
+      ];
+      let yearList = [];
+      let MethodName =
+        "/ShopServer/Manager/GoodsQuery/GetIreadArticleLabelList";
+      getLogin(MethodName, {})
         .then((res) => {
-            if(res.status===1){
-                res.label_list.forEach(nowYear => {
-                    let obj = {
-                        value: nowYear,
-                        label: nowYear
-                    }
-                    yearList.push(obj)
-                })
-                this.themeList = this.themeList.concat(yearList)
-            }
+          if (res.status === 1) {
+            res.label_list.forEach((nowYear) => {
+              let obj = {
+                value: nowYear,
+                label: nowYear,
+              };
+              yearList.push(obj);
+            });
+            this.themeList = this.themeList.concat(yearList);
+          }
         })
         .catch(() => {
-            this.loading = false
+          this.loading = false;
         });
-    }
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    this.getTableHeight()
-    this.getStudyList()
-    this.getYearList()
-    this.getLabelList()
-    this.getList()
+    this.getTableHeight();
+    this.getStudyList();
+    this.getYearList();
+    this.getLabelList();
+    this.getList();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-    let _this = this
-    let input = document.querySelector('input');
-    input.addEventListener('keyup', function(event) {
-        // 判断是否按下回车键
-        if (event.keyCode === 13) {
-            // 回车键被按下,执行你想要的操作
-            _this.getList(1)
-        }
+    let _this = this;
+    let input = document.querySelector("input");
+    input.addEventListener("keyup", function (event) {
+      // 判断是否按下回车键
+      if (event.keyCode === 13) {
+        // 回车键被按下,执行你想要的操作
+        _this.getList(1);
+      }
     });
   },
   //生命周期-创建之前
-  beforeCreated() { },
+  beforeCreated() {},
   //生命周期-挂载之前
-  beforeMount() { },
+  beforeMount() {},
   //生命周期-更新之前
-  beforUpdate() { },
+  beforUpdate() {},
   //生命周期-更新之后
-  updated() { },
+  updated() {},
   //生命周期-销毁之前
-  beforeDestory() { },
+  beforeDestory() {},
   //生命周期-销毁完成
-  destoryed() { },
+  destoryed() {},
   //如果页面有keep-alive缓存功能,这个函数会触发
-  activated() { }
-}
+  activated() {},
+};
 </script>
 <style lang="scss" scoped>
 /* @import url(); 引入css类 */
-.breadcrumb-box{
-    width: 1408px;
-    margin: 0 auto;
-    position: initial;
+.breadcrumb-box {
+  width: 1408px;
+  margin: 0 auto;
+  position: initial;
 }
-.manage-root-contain{
-    width: 1408px;
-    height: calc(100vh - 120px);
-    overflow: auto;
-    margin: 0 auto;
-    border-radius: 4px;
-    background: #FFF;
-    padding: 24px;
-    display: block;
-    .common-title-box{
-        width: 100%;
-        .el-icon-arrow-left{
-            font-weight: 500;
-            margin-right: 8px;
-            cursor: pointer;
-        }
+.manage-root-contain {
+  width: 1408px;
+  height: calc(100vh - 120px);
+  overflow: auto;
+  margin: 0 auto;
+  border-radius: 4px;
+  background: #fff;
+  padding: 24px;
+  display: block;
+  .common-title-box {
+    width: 100%;
+    .el-icon-arrow-left {
+      font-weight: 500;
+      margin-right: 8px;
+      cursor: pointer;
     }
-    .filt-box{
-        margin: 24px 0;
+  }
+  .filt-box {
+    margin: 24px 0;
+  }
+  .filt-item {
+    display: flex;
+    margin-bottom: 8px;
+    label {
+      width: 52px;
+      font-weight: 400;
+      font-size: 16px;
+      line-height: 32px;
+      color: #2f3742;
+      flex-shrink: 0;
     }
-    .filt-item{
+    ul {
+      list-style: none;
+      display: flex;
+      flex-flow: wrap;
+      padding: 0;
+      margin: 0;
+      li {
+        margin: 0 8px 16px 0;
+        background: #f2f3f5;
+        border-radius: 2px;
+        padding: 3px 11px;
+        font-weight: 500;
+        font-size: 16px;
+        line-height: 24px;
+        color: #2f3742;
+        cursor: pointer;
+        border: 1px solid #f2f3f5;
+        height: 32px;
+        box-sizing: border-box;
         display: flex;
-        margin-bottom: 8px;
-        label{
-            width: 52px;
-            font-weight: 400;
-            font-size: 16px;
-            line-height: 32px;
-            color: #2F3742;
-            flex-shrink: 0;
+        align-items: center;
+        &:hover {
+          color: #165dff;
         }
-        ul{
-            list-style: none;
-            display: flex;
-            flex-flow: wrap;
-            padding: 0;
-            margin: 0;
-            li{
-                margin: 0 8px 16px 0;
-                background: #F2F3F5;
-                border-radius: 2px;
-                padding: 3px 11px;
-                font-weight: 500;
-                font-size: 16px;
-                line-height: 24px;
-                color: #2F3742;
-                cursor: pointer;
-                border: 1px solid #F2F3F5;
-                height: 32px;
-                box-sizing: border-box;
-                display: flex;
-                align-items: center;
-                &:hover{
-                    color: #165DFF;
-                }
-                &.not-allow{
-                    cursor: not-allowed;
-                    background: #F2F3F5;
-                    color: #C1C5CD;
-                }
-                &.active{
-                    color: #165DFF;
-                    border-color: #165DFF;
-                    background: #FFFFFF;
-                    .el-icon-success{
-                        margin-right: 4px;
-                        font-size: 12px;
-                        margin-top: 2px;
-                    }
-                }
-                &.not-allow.active{
-                    color: #CEDCFE;
-                    border-color: #CEDCFE;
-                }
-            }
+        &.not-allow {
+          cursor: not-allowed;
+          background: #f2f3f5;
+          color: #c1c5cd;
         }
-        .el-input{
-            width: 240px;
-            height: 32px;
-            background: #F2F3F5;
-            border-radius: 2px;
+        &.active {
+          color: #165dff;
+          border-color: #165dff;
+          background: #ffffff;
+          .el-icon-success {
+            margin-right: 4px;
+            font-size: 12px;
+            margin-top: 2px;
+          }
         }
-    }
-}
-.item-box{
-    padding: 0 0 0 40px;
-    margin: 0;
-    list-style: none;
-    display: flex;
-    flex-flow: wrap;
-    li{
-        width: 120px;
-        margin: 12px;
-        .image{
-            width: 120px;
-            height: 168px;
-        }
-        .el-checkbox{
-            width: 120px;
-            display: flex;
+        &.not-allow.active {
+          color: #cedcfe;
+          border-color: #cedcfe;
         }
+      }
+    }
+    .el-input {
+      width: 240px;
+      height: 32px;
+      background: #f2f3f5;
+      border-radius: 2px;
     }
+  }
 }
-.nodata {
-    text-align: center;
-    img {
-        width: 329px;
+.item-box {
+  padding: 0 0 0 40px;
+  margin: 0;
+  list-style: none;
+  display: flex;
+  flex-flow: wrap;
+  li {
+    width: 120px;
+    margin: 12px;
+    .image {
+      width: 120px;
+      height: 168px;
     }
-    p {
-        color: #A8A8A8;
-        font-size: 14px;
-        font-weight: 400;
-        line-height: 22px;
-        margin: 30px 0;
+    .el-checkbox {
+      width: 120px;
+      display: flex;
     }
+  }
+}
+.nodata {
+  text-align: center;
+  img {
+    width: 329px;
+  }
+  p {
+    color: #a8a8a8;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 22px;
+    margin: 30px 0;
+  }
 }
 </style>
 <style lang="scss">
-.filt-box{
-    input{
-        height: 32px;
-        line-height: 32px;
-        background: #F2F3F5;
-        border: none;
-    }
-    .el-input__icon{
-        line-height: 32px;
-        cursor: pointer;
-        color: #4E5969 !important;
-    }
-    .el-input-group__append{
-        background: #F2F3F5;
-        border: none;
-    }
-    .el-button{
-        padding: 9px 12px;
-    }
+.filt-box {
+  input {
+    height: 32px;
+    line-height: 32px;
+    background: #f2f3f5;
+    border: none;
+  }
+  .el-input__icon {
+    line-height: 32px;
+    cursor: pointer;
+    color: #4e5969 !important;
+  }
+  .el-input-group__append {
+    background: #f2f3f5;
+    border: none;
+  }
+  .el-button {
+    padding: 9px 12px;
+  }
 }
-.add-goods{
-    .item-box{
-        .el-checkbox{
-            padding: 12px 0;
-            .el-checkbox__inner{
-                margin-top: 5px;
-            }
-            .el-checkbox__label{
-                width: 100px;
-                white-space: normal;
-                color:#2F3742;
-                font-size: 14px;
-                font-weight: 400;
-                line-height: 22px; 
-            }
-        }
+.add-goods {
+  .item-box {
+    .el-checkbox {
+      padding: 12px 0;
+      .el-checkbox__inner {
+        margin-top: 5px;
+      }
+      .el-checkbox__label {
+        width: 100px;
+        white-space: normal;
+        color: #2f3742;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+      }
     }
+  }
 }
 </style>

+ 645 - 535
src/views/cdkey_manage/CreateCdkey.vue

@@ -2,149 +2,254 @@
   <div class="manage-root cdkey-create">
     <Header />
     <div class="manage-root-contain">
-        <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
-        <div class="manage-root-contain-right">
-            <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
-            <div class="create-top">
-                <div class="common-title-box">
-                    <h3>{{id?'编辑兑换码':'创建兑换码'}}</h3>
-                    <div class="btn-box" v-if="id||!id&&stepIndex!==2">
-                        <el-button size="small" :disabled="true">上一步</el-button>
-                        <el-button type="primary" size="small" @click="handleStep('+')" :disabled="stepIndex===2" :loading="loading">下一步</el-button>
-                    </div>
-                </div>
-                <el-steps :active="stepIndex" align-center>
-                    <el-step title="基本信息" description="填写兑换码基本信息">
-                        <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
-                    </el-step>
-                    <el-step :title="id?'编辑兑换内容':'添加兑换内容'" description="为兑换码添加内容">
-                        <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
-                    </el-step>
-                    <el-step :title="id?'完成编辑':'完成创建'" :description="id?'兑换码编辑完成':'兑换码创建完成'">
-                        <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
-                    </el-step>
-                </el-steps>
+      <nav-menu
+        class="manage-root-contain-left"
+        :activeMenuIndex="activeMenuIndex"
+      ></nav-menu>
+      <div class="manage-root-contain-right">
+        <breadcrumb
+          :breadcrumbList="breadcrumbList"
+          class="breadcrumb-box"
+        ></breadcrumb>
+        <div class="create-top">
+          <div class="common-title-box">
+            <h3>{{ id ? "编辑兑换码" : "创建兑换码" }}</h3>
+            <div class="btn-box" v-if="id || (!id && stepIndex !== 2)">
+              <el-button size="small" :disabled="true">上一步</el-button>
+              <el-button
+                type="primary"
+                size="small"
+                @click="handleStep('+')"
+                :disabled="stepIndex === 2"
+                :loading="loading"
+                >下一步</el-button
+              >
             </div>
-            <div class="create-bottom">
-                <el-form :model="organizeForm" :rules="rulesOrganize" ref="organizeForm" label-width="100px" class="registerForm" v-if="stepIndex===0">
-                    <el-form-item label="兑换码名称" prop="name">
-                        <el-input v-model="organizeForm.name" placeholder="请输入兑换码名称" @blur="handleTrim('organizeForm','name')" maxlength="20"></el-input>
-                        <p class="tips">不超过20个字</p>
-                    </el-form-item>
-                    <el-form-item label="可使用人数" prop="person_count_max" class="price-box" v-if="type===0">
-                        <el-input-number v-model="organizeForm.person_count_max" @change="handleChange" :min="0" :max="500" size="small" class="personal-ceil"></el-input-number>
-                        <span class="append">人</span>
-                        <p class="tips">最多不超过 500 次</p>
-                    </el-form-item>
-                    <el-form-item label="有效期" prop="valid_day_count" class="validity-box">
-                        <el-input placeholder="请输入内容" v-model="organizeForm.valid_day_count" type="number" :min="1" maxlength="20">
-                            <template slot="append">天</template>
-                        </el-input>
-                    </el-form-item>
-                    <el-form-item label="兑换码" prop="subcode_import_file_id" v-if="type===1">
-                        <div class="article-mp3-box">
-                            <ul v-if="organizeForm.subcode_import_file_list&&organizeForm.subcode_import_file_list.length>0" class="article-mp3-list">
-                                <li v-for="(item,index) in organizeForm.subcode_import_file_list" :key="index">
-                                    <a><svg-icon :icon-class="'txt'" class="icon-logo"></svg-icon><span>{{item.name}}</span></a>
-                                    <i class="el-icon-error" @click="handleDelResource(index)"></i>
-                                </li>
-                            </ul>
-                            <upload :class="['article-mp3']" :datafileList="organizeForm.subcode_import_file_list" :changeFillId="handleAvatarSuccess" :fileName="'articleMp3'" uploadType="txt" tips=' ' :filleNumber="1" :showList="true" />
-                        </div>
-                        <p class="tips">只能上传txt类型文件</p>
-                    </el-form-item>
-                    <el-form-item label="备注" prop="memo">
-                        <el-input
-                            type="textarea"
-                            :rows="4"
-                            placeholder="请输入"
-                            v-model="organizeForm.memo"
-                            maxlength="200"
-                            show-word-limit>
-                        </el-input>
-                    </el-form-item>
-                </el-form>
-                <div v-if="stepIndex===1">
-                    <div class="issue-top">
-                        <h4 class="issue-top-left">
-                            内容列表
-                        </h4>
-                        <el-button type="primary" size="small" @click="addGoods">添加内容</el-button>
-                    </div>
-                    <el-table
-                        class="search-table"
-                        :data="tableData"
-                        style="width: 100%"
-                        @sort-change="handleSort"
-                        :default-sort = dataSort
-                        :max-height="tableHeight"
-                        v-loading="tableLoading">
-                        <el-table-column
-                            type="index"
-                            label="#"
-                            sortable
-                            width="54"
-                            :index="(pageNumber-1)*pageSize+1">
-                        </el-table-column>
-                        <el-table-column
-                            prop="goods_name"
-                            label="名称"
-                            sortable="custom">
-                        </el-table-column>
-                        <el-table-column
-                            prop="goods_type"
-                            label="类型"
-                            sortable="custom"
-                            width="150" >
-                            <template slot-scope="scope">
-                                <span class="items-type" :style="{background:goodsTypeListCss[scope.row.goods_type]?goodsTypeListCss[scope.row.goods_type].bg:'', color:goodsTypeListCss[scope.row.goods_type]?goodsTypeListCss[scope.row.goods_type].color:''}">{{scope.row.goods_type_name}}</span>
-                            </template>
-                        </el-table-column>
-                        <el-table-column
-                            prop="goods_study_phase"
-                            label="学段"
-                            sortable="custom"
-                            width="120">
-                            <template slot-scope="scope">
-                                {{scope.row.goods_study_phase_name}}
-                            </template>
-                        </el-table-column>
-                        <el-table-column
-                            fixed="right"
-                            label="操作"
-                            width="180">
-                            <template slot-scope="scope">
-                                <el-button
-                                    @click.native.prevent="handleDelete(scope.row, scope.$index)"
-                                    type="text"
-                                    size="small"
-                                    class="red-btn">
-                                    删除
-                                </el-button>
-                            </template>
-                        </el-table-column>
-                    </el-table>
-                    <el-pagination
-                        background
-                        @size-change="handleSizeChange"
-                        @current-change="handleCurrentChange"
-                        :current-page="pageNumber"
-                        :page-sizes="[10, 20, 30, 40]"
-                        :page-size="pageSize"
-                        layout="total, prev, pager, next, sizes, jumper"
-                        :total="total_count">
-                    </el-pagination>
-                </div>
-                <div v-if="stepIndex===2">
-                    <el-result icon="success" :subTitle="id?'兑换码编辑成功':'兑换码创建成功'">
-                        <template slot="extra">
-                            <el-button size="small" @click="handleback">返回列表</el-button>
-                            <el-button type="primary" size="small" @click="handleCreate">继续创建</el-button>
-                        </template>
-                    </el-result>
-                </div>
+          </div>
+          <el-steps :active="stepIndex" align-center>
+            <el-step title="基本信息" description="填写兑换码基本信息">
+              <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
+            </el-step>
+            <el-step
+              :title="id ? '编辑兑换内容' : '添加兑换内容'"
+              description="为兑换码添加内容"
+            >
+              <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
+            </el-step>
+            <el-step
+              :title="id ? '完成编辑' : '完成创建'"
+              :description="id ? '兑换码编辑完成' : '兑换码创建完成'"
+            >
+              <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
+            </el-step>
+          </el-steps>
+        </div>
+        <div class="create-bottom">
+          <el-form
+            :model="organizeForm"
+            :rules="rulesOrganize"
+            ref="organizeForm"
+            label-width="100px"
+            class="registerForm"
+            v-if="stepIndex === 0"
+          >
+            <el-form-item label="兑换码名称" prop="name">
+              <el-input
+                v-model="organizeForm.name"
+                placeholder="请输入兑换码名称"
+                @blur="handleTrim('organizeForm', 'name')"
+                maxlength="20"
+              ></el-input>
+              <p class="tips">不超过20个字</p>
+            </el-form-item>
+            <el-form-item
+              label="可使用人数"
+              prop="person_count_max"
+              class="price-box"
+              v-if="type === 0"
+            >
+              <el-input-number
+                v-model="organizeForm.person_count_max"
+                @change="handleChange"
+                :min="0"
+                :max="500"
+                size="small"
+                class="personal-ceil"
+              ></el-input-number>
+              <span class="append">人</span>
+              <p class="tips">最多不超过 500 次</p>
+            </el-form-item>
+            <el-form-item
+              label="有效期"
+              prop="valid_day_count"
+              class="validity-box"
+            >
+              <el-input
+                placeholder="请输入内容"
+                v-model="organizeForm.valid_day_count"
+                type="number"
+                :min="1"
+                maxlength="20"
+              >
+                <template slot="append">天</template>
+              </el-input>
+            </el-form-item>
+            <el-form-item
+              label="兑换码"
+              prop="subcode_import_file_id"
+              v-if="type === 1"
+            >
+              <div class="article-mp3-box">
+                <ul
+                  v-if="
+                    organizeForm.subcode_import_file_list &&
+                    organizeForm.subcode_import_file_list.length > 0
+                  "
+                  class="article-mp3-list"
+                >
+                  <li
+                    v-for="(
+                      item, index
+                    ) in organizeForm.subcode_import_file_list"
+                    :key="index"
+                  >
+                    <a
+                      ><svg-icon
+                        :icon-class="'txt'"
+                        class="icon-logo"
+                      ></svg-icon
+                      ><span>{{ item.name }}</span></a
+                    >
+                    <i
+                      class="el-icon-error"
+                      @click="handleDelResource(index)"
+                    ></i>
+                  </li>
+                </ul>
+                <upload
+                  :class="['article-mp3']"
+                  :datafileList="organizeForm.subcode_import_file_list"
+                  :changeFillId="handleAvatarSuccess"
+                  :fileName="'articleMp3'"
+                  uploadType="txt"
+                  tips=" "
+                  :filleNumber="1"
+                  :showList="true"
+                />
+              </div>
+              <p class="tips">只能上传txt类型文件</p>
+            </el-form-item>
+            <el-form-item label="备注" prop="memo">
+              <el-input
+                type="textarea"
+                :rows="4"
+                placeholder="请输入"
+                v-model="organizeForm.memo"
+                maxlength="200"
+                show-word-limit
+              >
+              </el-input>
+            </el-form-item>
+          </el-form>
+          <div v-if="stepIndex === 1">
+            <div class="issue-top">
+              <h4 class="issue-top-left">内容列表</h4>
+              <el-button type="primary" size="small" @click="addGoods"
+                >添加内容</el-button
+              >
             </div>
+            <el-table
+              class="search-table"
+              :data="tableData"
+              style="width: 100%"
+              @sort-change="handleSort"
+              :default-sort="dataSort"
+              :max-height="tableHeight"
+              v-loading="tableLoading"
+            >
+              <el-table-column
+                type="index"
+                label="#"
+                sortable
+                width="54"
+                :index="(pageNumber - 1) * pageSize + 1"
+              >
+              </el-table-column>
+              <el-table-column prop="goods_name" label="名称" sortable="custom">
+              </el-table-column>
+              <el-table-column
+                prop="goods_type"
+                label="类型"
+                sortable="custom"
+                width="150"
+              >
+                <template slot-scope="scope">
+                  <span
+                    class="items-type"
+                    :style="{
+                      background: goodsTypeListCss[scope.row.goods_type]
+                        ? goodsTypeListCss[scope.row.goods_type].bg
+                        : '',
+                      color: goodsTypeListCss[scope.row.goods_type]
+                        ? goodsTypeListCss[scope.row.goods_type].color
+                        : '',
+                    }"
+                    >{{ scope.row.goods_type_name }}</span
+                  >
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="goods_study_phase"
+                label="学段"
+                sortable="custom"
+                width="120"
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.goods_study_phase_name }}
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="180">
+                <template slot-scope="scope">
+                  <el-button
+                    @click.native.prevent="
+                      handleDelete(scope.row, scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                    class="red-btn"
+                  >
+                    删除
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+            <el-pagination
+              background
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="pageNumber"
+              :page-sizes="[10, 20, 30, 40]"
+              :page-size="pageSize"
+              layout="total, prev, pager, next, sizes, jumper"
+              :total="total_count"
+            >
+            </el-pagination>
+          </div>
+          <div v-if="stepIndex === 2">
+            <el-result
+              icon="success"
+              :subTitle="id ? '兑换码编辑成功' : '兑换码创建成功'"
+            >
+              <template slot="extra">
+                <el-button size="small" @click="handleback">返回列表</el-button>
+                <el-button type="primary" size="small" @click="handleCreate"
+                  >继续创建</el-button
+                >
+              </template>
+            </el-result>
+          </div>
         </div>
+      </div>
     </div>
   </div>
 </template>
@@ -153,10 +258,10 @@
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
-import NavMenu from "../../components/NavMenu.vue"
-import Breadcrumb from '../../components/Breadcrumb.vue';
+import NavMenu from "../../components/NavMenu.vue";
+import Breadcrumb from "../../components/Breadcrumb.vue";
 import { getLogin } from "@/api/ajax";
-import Upload from "../../components/Upload.vue"
+import Upload from "../../components/Upload.vue";
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -165,286 +270,291 @@ export default {
   data() {
     //这里存放数据
     const validateValidity = (rule, value, callback) => {
-        if (value === '') {
-            callback(new Error('请输入有效期'));
+      if (value === "") {
+        callback(new Error("请输入有效期"));
+      } else {
+        if (value < 1) {
+          callback(new Error("请输入有效期"));
         } else {
-            if (value<1) {
-                callback(new Error('请输入有效期'));
-            } else {
-                callback();
-            }
+          callback();
         }
+      }
     };
     return {
-        goodsTypeListCss:{
-            2:{
-                text:'报纸',
-                color:'#165DFF',
-                bg:'#E8F7FF'
-            },
-            // '2':{
-            //     text:'画刊',
-            //     color:'#F53F3F',
-            //     bg:'#FFECE8'
-            // },
-            '3':{
-                text:'精读',
-                color:'#0FC6C2',
-                bg:'#E8FFFB'
-            },
-            0:{
-                text:'课程',
-                color:'#722ED1',
-                bg:'#F5E8FF'
-            },
-            1:{
-                text:'课程',
-                color:'#722ED1',
-                bg:'#F5E8FF'
-            },
-            10:{
-                text:'课程',
-                color:'#722ED1',
-                bg:'#F5E8FF'
-            },
-            // '5':{
-            //     text:'报纸专辑',
-            //     color:'#165DFF',
-            //     bg:'#E8F7FF'
-            // },
-            // '6':{
-            //     text:'画刊专辑',
-            //     color:'#F53F3F',
-            //     bg:'#FFECE8'
-            // }
+      goodsTypeListCss: {
+        2: {
+          text: "报纸",
+          color: "#165DFF",
+          bg: "#E8F7FF",
         },
-        activeMenuIndex: "cdkey_manage",
-        breadcrumbList:[
-            {
-                icon:'barcode-line',
-                url:'',
-                text:''
-            },
-            {
-                icon:'',
-                url:'',
-                text:'兑换码管理'
-            }
-        ],
-        id:this.$route.query.id?this.$route.query.id:'',
-        organizeForm:{
-            name: '',
-            person_count_max: 50,
-            valid_day_count: 30,
-            memo: '',
-            subcode_import_file_list: [], 
-            subcode_import_file_id: '', 
-            type: this.$route.query.type?this.$route.query.type*1:0
+        // '2':{
+        //     text:'画刊',
+        //     color:'#F53F3F',
+        //     bg:'#FFECE8'
+        // },
+        3: {
+          text: "精读",
+          color: "#0FC6C2",
+          bg: "#E8FFFB",
         },
-        rulesOrganize:{
-            name:[
-                { required: true, message: '请输入兑换码名称', trigger: 'blur' },
-                { max: 20, message: '兑换码名称最多20位', trigger:'change' },
-            ],
-            person_count_max:[
-                { required: true, message: '请输入可使用人数', trigger: 'blur' }
-            ],
-            valid_day_count:[
-                { required: true, validator: validateValidity, trigger: 'blur' }
-            ],
-            subcode_import_file_id:[
-                { required: true, message: '请上传兑换码文件', trigger: 'blur' }
-            ],
+        0: {
+          text: "课程",
+          color: "#722ED1",
+          bg: "#F5E8FF",
         },
-        stepIndex:window.localStorage.getItem('cdKeyId')?1:0, // 步骤索引
-        loading: false,
-        cdKeyId: window.localStorage.getItem('cdKeyId')?window.localStorage.getItem('cdKeyId'):'',
-        tableLoading: false,
-        pageSize: 10, 
-        pageNumber: 1,
-        tableHeight: "", // 表格高度
-        total_count: 0,
-        dataSort: {},
-        tableData: [],
-        type: this.$route.query.type?this.$route.query.type*1:0,
-    }
+        1: {
+          text: "课程",
+          color: "#722ED1",
+          bg: "#F5E8FF",
+        },
+        10: {
+          text: "课程",
+          color: "#722ED1",
+          bg: "#F5E8FF",
+        },
+        // '5':{
+        //     text:'报纸专辑',
+        //     color:'#165DFF',
+        //     bg:'#E8F7FF'
+        // },
+        4: {
+          text: "画刊",
+          color: "#F53F3F",
+          bg: "#FFECE8",
+        },
+      },
+      activeMenuIndex: "cdkey_manage",
+      breadcrumbList: [
+        {
+          icon: "barcode-line",
+          url: "",
+          text: "",
+        },
+        {
+          icon: "",
+          url: "",
+          text: "兑换码管理",
+        },
+      ],
+      id: this.$route.query.id ? this.$route.query.id : "",
+      organizeForm: {
+        name: "",
+        person_count_max: 50,
+        valid_day_count: 30,
+        memo: "",
+        subcode_import_file_list: [],
+        subcode_import_file_id: "",
+        type: this.$route.query.type ? this.$route.query.type * 1 : 0,
+      },
+      rulesOrganize: {
+        name: [
+          { required: true, message: "请输入兑换码名称", trigger: "blur" },
+          { max: 20, message: "兑换码名称最多20位", trigger: "change" },
+        ],
+        person_count_max: [
+          { required: true, message: "请输入可使用人数", trigger: "blur" },
+        ],
+        valid_day_count: [
+          { required: true, validator: validateValidity, trigger: "blur" },
+        ],
+        subcode_import_file_id: [
+          { required: true, message: "请上传兑换码文件", trigger: "blur" },
+        ],
+      },
+      stepIndex: window.localStorage.getItem("cdKeyId") ? 1 : 0, // 步骤索引
+      loading: false,
+      cdKeyId: window.localStorage.getItem("cdKeyId")
+        ? window.localStorage.getItem("cdKeyId")
+        : "",
+      tableLoading: false,
+      pageSize: 10,
+      pageNumber: 1,
+      tableHeight: "", // 表格高度
+      total_count: 0,
+      dataSort: {},
+      tableData: [],
+      type: this.$route.query.type ? this.$route.query.type * 1 : 0,
+    };
   },
   //计算属性 类似于data概念
-  computed: {
-    
-  },
+  computed: {},
   //监控data中数据变化
-  watch: {
-    
-  },
+  watch: {},
   //方法集合
   methods: {
     // 删除
-    handleDelete(row){
-        this.$confirm('确定删除吗?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-            let Mname = "/ShopServer/Manager/DiscountCodeManager/DeleteGoodsFromDiscountCode";
-            let data = {
-                discount_code_id: this.cdKeyId,
-                goods_type: row.goods_type,
-                goods_id: row.goods_id
-            };
-            getLogin(Mname, data).then(res => {
-                this.$message({
-                    type: 'success',
-                    message: '删除成功!'
-                });
-                this.getGoodsList()
+    handleDelete(row) {
+      this.$confirm("确定删除吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let Mname =
+            "/ShopServer/Manager/DiscountCodeManager/DeleteGoodsFromDiscountCode";
+          let data = {
+            discount_code_id: this.cdKeyId,
+            goods_type: row.goods_type,
+            goods_id: row.goods_id,
+          };
+          getLogin(Mname, data).then((res) => {
+            this.$message({
+              type: "success",
+              message: "删除成功!",
             });
-        }).catch(() => {
-               
-        });
+            this.getGoodsList();
+          });
+        })
+        .catch(() => {});
     },
     // 删除资源文件
-    handleDelResource(i){
-        this.$confirm("确定删除吗?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-        }).then(() => {
-            this.organizeForm.subcode_import_file_list.splice(i, 1);
-            this.organizeForm.subcode_import_file_id = ''
-            this.$forceUpdate()
-        });
+    handleDelResource(i) {
+      this.$confirm("确定删除吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.organizeForm.subcode_import_file_list.splice(i, 1);
+        this.organizeForm.subcode_import_file_id = "";
+        this.$forceUpdate();
+      });
     },
-    handleAvatarSuccess(fileList,name) {
-        this.organizeForm.subcode_import_file_list = fileList
-        this.organizeForm.subcode_import_file_id = fileList[0]&&fileList[0].response&&fileList[0].response.file_info_list&&fileList[0].response.file_info_list[0]?fileList[0].response.file_info_list[0].file_id:''
-        this.$forceUpdate()
+    handleAvatarSuccess(fileList, name) {
+      this.organizeForm.subcode_import_file_list = fileList;
+      this.organizeForm.subcode_import_file_id =
+        fileList[0] &&
+        fileList[0].response &&
+        fileList[0].response.file_info_list &&
+        fileList[0].response.file_info_list[0]
+          ? fileList[0].response.file_info_list[0].file_id
+          : "";
+      this.$forceUpdate();
     },
     handleSizeChange(val) {
-        this.pageSize = val
-        this.pageNumber = 1
-        this.getGoodsList()
+      this.pageSize = val;
+      this.pageNumber = 1;
+      this.getGoodsList();
     },
     handleCurrentChange(val) {
-        this.pageNumber = val
-        this.getGoodsList()
+      this.pageNumber = val;
+      this.getGoodsList();
     },
-    handleSort(value){
-        let dataSort = {
-            prop: value.prop,
-            order: value.order
-        }
-        this.dataSort = dataSort
-        this.getGoodsList()
+    handleSort(value) {
+      let dataSort = {
+        prop: value.prop,
+        order: value.order,
+      };
+      this.dataSort = dataSort;
+      this.getGoodsList();
     },
     // 上一步下一步
-    handleStep(type){
-        if(type=='-'){
-            // if(this.stepIndex>0) this.stepIndex--
-        }else{
-            if(this.stepIndex===0) {
-                this.$refs['organizeForm'].validate((valid) => {
-                    if (valid) {
-                        this.handleCreateCdkey()
-                    } else {
-                        return false;
-                    }
-                });
-            }else if(this.stepIndex===1){
-                if(this.tableData.length===0){
-                    this.$message.warning('请添加内容')
-                    return false 
-                }
-                this.stepIndex++
+    handleStep(type) {
+      if (type == "-") {
+        // if(this.stepIndex>0) this.stepIndex--
+      } else {
+        if (this.stepIndex === 0) {
+          this.$refs["organizeForm"].validate((valid) => {
+            if (valid) {
+              this.handleCreateCdkey();
+            } else {
+              return false;
             }
+          });
+        } else if (this.stepIndex === 1) {
+          if (this.tableData.length === 0) {
+            this.$message.warning("请添加内容");
+            return false;
+          }
+          this.stepIndex++;
         }
+      }
     },
-    changeIcon(flag){
-        this[flag] = !this[flag]
+    changeIcon(flag) {
+      this[flag] = !this[flag];
     },
     // 返回列表
-    handleback(){
-        localStorage.setItem("pageNumber",1)
-        this.$router.push({
-            path: "/cdkey_manage",
-            query: {
-                
-            },
-        });
+    handleback() {
+      localStorage.setItem("pageNumber", 1);
+      this.$router.push({
+        path: "/cdkey_manage",
+        query: {},
+      });
     },
     //继续创建
-    handleCreate(){
-        window.localStorage.removeItem('cdKeyId')
-        this.$router.replace('/createCdkey')
-        location.reload()
+    handleCreate() {
+      window.localStorage.removeItem("cdKeyId");
+      this.$router.replace("/createCdkey");
+      location.reload();
     },
     handleChange(value) {
-        // console.log(value)
+      // console.log(value)
     },
-    handleCreateCdkey(){
-        this.loading = true
-        let MethodName = "/ShopServer/Manager/DiscountCodeManager/CreateDiscountCode";
-        this.organizeForm.valid_day_count = this.organizeForm.valid_day_count*1
-        let form = this.organizeForm
-        let data = form
-        getLogin(MethodName, data)
+    handleCreateCdkey() {
+      this.loading = true;
+      let MethodName =
+        "/ShopServer/Manager/DiscountCodeManager/CreateDiscountCode";
+      this.organizeForm.valid_day_count = this.organizeForm.valid_day_count * 1;
+      let form = this.organizeForm;
+      let data = form;
+      getLogin(MethodName, data)
         .then((res) => {
-            this.loading = false
-            if(res.status===1){
-               this.cdKeyId = res.id
-               this.stepIndex++
-               window.localStorage.removeItem('cdKeyId')
-               this.getGoodsList()
-            }
+          this.loading = false;
+          if (res.status === 1) {
+            this.cdKeyId = res.id;
+            this.stepIndex++;
+            window.localStorage.removeItem("cdKeyId");
+            this.getGoodsList();
+          }
         })
         .catch(() => {
-            this.loading = false
+          this.loading = false;
         });
     },
     // 去掉前后空格
-    handleTrim(form,fild){
-        this[form][fild] = this[form][fild].trim()
+    handleTrim(form, fild) {
+      this[form][fild] = this[form][fild].trim();
     },
-    getGoodsList(){
-        this.tableLoading = true
-        let MethodName = "/ShopServer/Manager/DiscountCodeManager/PageQueryDiscountCodeGoodsList";
-        let order_column_list = []
-        if(this.dataSort != {}){
-            if(this.dataSort.order=='descending'){
-                order_column_list = [this.dataSort.prop + ':desc']
-            }else if(this.dataSort.order=='ascending'){
-                // 升序不传值
-                order_column_list = [this.dataSort.prop]
-            }else{
-                order_column_list = ['create_time:desc']
-            }
-        }else{
-            order_column_list = ['create_time:desc']
-        }
-        let data = {
-            discount_code_id: this.cdKeyId,
-            page_capacity:this.pageSize,
-            cur_page:this.pageNumber,
-            order_column_list: order_column_list
+    getGoodsList() {
+      this.tableLoading = true;
+      let MethodName =
+        "/ShopServer/Manager/DiscountCodeManager/PageQueryDiscountCodeGoodsList";
+      let order_column_list = [];
+      if (this.dataSort != {}) {
+        if (this.dataSort.order == "descending") {
+          order_column_list = [this.dataSort.prop + ":desc"];
+        } else if (this.dataSort.order == "ascending") {
+          // 升序不传值
+          order_column_list = [this.dataSort.prop];
+        } else {
+          order_column_list = ["create_time:desc"];
         }
-        getLogin(MethodName, data)
+      } else {
+        order_column_list = ["create_time:desc"];
+      }
+      let data = {
+        discount_code_id: this.cdKeyId,
+        page_capacity: this.pageSize,
+        cur_page: this.pageNumber,
+        order_column_list: order_column_list,
+      };
+      getLogin(MethodName, data)
         .then((res) => {
-            this.tableLoading = false
-            if(res.status===1){
-               this.tableData = res.goods_list
-               this.total_count = res.total_count
-            }
+          this.tableLoading = false;
+          if (res.status === 1) {
+            this.tableData = res.goods_list;
+            this.total_count = res.total_count;
+          }
         })
         .catch(() => {
-            this.tableLoading = false
+          this.tableLoading = false;
         });
     },
     // 添加商品
-    addGoods(){
-        window.localStorage.setItem('cdKeyId',this.cdKeyId)
-        this.$router.push({
-            path:'/addGoods'
-        })
+    addGoods() {
+      window.localStorage.setItem("cdKeyId", this.cdKeyId);
+      this.$router.push({
+        path: "/addGoods",
+      });
     },
     //计算table高度(动态设置table高度)
     getTableHeight() {
@@ -460,195 +570,195 @@ export default {
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     let obj = {
-        icon:'',
-        url:'',
-        text:'创建兑换码'
-    }
-    if(this.id){
-        obj.text = '编辑兑换码'
-        // this.getCourseInfo()
+      icon: "",
+      url: "",
+      text: "创建兑换码",
+    };
+    if (this.id) {
+      obj.text = "编辑兑换码";
+      // this.getCourseInfo()
     }
-    this.breadcrumbList.push(obj)
-    this.getTableHeight()
-    if(this.stepIndex===1){
-        this.getGoodsList()
+    this.breadcrumbList.push(obj);
+    this.getTableHeight();
+    if (this.stepIndex === 1) {
+      this.getGoodsList();
     }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-
-  },
+  mounted() {},
   //生命周期-创建之前
-  beforeCreated() { },
+  beforeCreated() {},
   //生命周期-挂载之前
-  beforeMount() { },
+  beforeMount() {},
   //生命周期-更新之前
-  beforUpdate() { },
+  beforUpdate() {},
   //生命周期-更新之后
-  updated() { },
+  updated() {},
   //生命周期-销毁之前
-  beforeDestory() { },
+  beforeDestory() {},
   //生命周期-销毁完成
-  destoryed() { },
+  destoryed() {},
   //如果页面有keep-alive缓存功能,这个函数会触发
-  activated() { }
-}
+  activated() {},
+};
 </script>
 <style lang="scss" scoped>
 /* @import url(); 引入css类 */
-.create-top{
-    background: #FFFFFF;
-    border-radius: 4px;
-    padding: 24px;
-    .common-title-box{
-        margin-bottom: 4px;
-    }
+.create-top {
+  background: #ffffff;
+  border-radius: 4px;
+  padding: 24px;
+  .common-title-box {
+    margin-bottom: 4px;
+  }
 }
-.create-bottom{
-    padding: 40px 40px;
-    margin-top: 16px;
-    background: #FFFFFF;
-    border-radius: 4px;
-    height: calc(100vh - 292px);
-    overflow: auto;
-    .tips{
-        margin: 0;
-        color: #86909C;
-        font-size: 12px;
-        line-height: 20px;
-    }
-    .issue-top{
-        display: flex;
-        justify-content: space-between;
-        margin-bottom: 8px;
-        &-left{
-            margin: 0;
-            color: #1D2129;
-            font-size: 20px;
-            font-weight: 500;
-            line-height: 28px;
-            span{
-                margin-left: 4px;
-                color: #86909C;
-                font-size: 14px;
-                font-weight: 400;
-                line-height: 22px;
-            }
-        }
+.create-bottom {
+  padding: 40px 40px;
+  margin-top: 16px;
+  background: #ffffff;
+  border-radius: 4px;
+  height: calc(100vh - 292px);
+  overflow: auto;
+  .tips {
+    margin: 0;
+    color: #86909c;
+    font-size: 12px;
+    line-height: 20px;
+  }
+  .issue-top {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 8px;
+    &-left {
+      margin: 0;
+      color: #1d2129;
+      font-size: 20px;
+      font-weight: 500;
+      line-height: 28px;
+      span {
+        margin-left: 4px;
+        color: #86909c;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+      }
     }
+  }
 }
-.items-type{
-    padding: 1px 8px;
-    font-weight: 500;
-    font-size: 14px;
-    line-height: 22px;
-    border-radius: 2px;
+.items-type {
+  padding: 1px 8px;
+  font-weight: 500;
+  font-size: 14px;
+  line-height: 22px;
+  border-radius: 2px;
 }
-.article-mp3-box{
-    display: flex;
-    height: 32px;
-    align-items: center;
+.article-mp3-box {
+  display: flex;
+  height: 32px;
+  align-items: center;
 }
-.article-mp3{
-    width: 82px;
+.article-mp3 {
+  width: 82px;
+  height: 32px;
+  font-size: 0;
+  &-has {
+    width: 320px;
+  }
+}
+.article-mp3-list {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+  display: inline-block;
+  width: 226px;
+  li {
+    padding: 5px 12px;
     height: 32px;
-    font-size: 0;
-    &-has{
-        width: 320px;
+    border-radius: 2px 0px 0px 2px;
+    background: #f2f3f5;
+    display: flex;
+    align-items: center;
+    a {
+      color: #1d2129;
+      display: flex;
+      align-items: center;
+      flex: 1;
+      span {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        flex: 1;
+        display: block;
+        font-size: 14px;
+        line-height: 22px;
+        width: 163px;
+      }
+      .svg-icon {
+        width: 16px;
+        height: 16px;
+        margin-right: 4px;
+        color: #1d2129;
+      }
     }
-}
-.article-mp3-list{
-    list-style: none;
-    margin: 0;
-    padding: 0;
-    display: inline-block;
-    width: 226px;
-    li{
-        padding: 5px 12px;
-        height: 32px;
-        border-radius: 2px 0px 0px 2px;
-        background: #F2F3F5;
-        display: flex;
-        align-items: center;
-        a{
-            color: #1D2129;
-            display: flex;
-            align-items: center;
-            flex: 1;
-            span{
-                overflow:hidden;
-                text-overflow:ellipsis;
-                white-space: nowrap;
-                flex: 1;
-                display: block;
-                font-size: 14px;
-                line-height: 22px;
-                width: 163px;
-            }
-            .svg-icon{
-                width: 16px;
-                height: 16px;
-                margin-right: 4px;
-                color: #1D2129;
-            }
-        }
-        .el-icon-error{
-            color: #4E5969;
-            cursor: pointer;
-            margin-left: 4px;
-        }
+    .el-icon-error {
+      color: #4e5969;
+      cursor: pointer;
+      margin-left: 4px;
     }
+  }
 }
 </style>
 
 <style lang="scss">
-.cdkey-create{
-    .personal-ceil{
-        width: 200px;
-        .el-input__inner{
-            width: 200px;
-            padding: 0 60px;
-        }
+.cdkey-create {
+  .personal-ceil {
+    width: 200px;
+    .el-input__inner {
+      width: 200px;
+      padding: 0 60px;
     }
-    .el-range-input{
-        background: #F2F3F5;
+  }
+  .el-range-input {
+    background: #f2f3f5;
+  }
+  .el-tag {
+    background: #fff;
+  }
+  .validity-box {
+    width: 350px;
+    .el-input-group {
+      width: 250px;
     }
-    .el-tag{
-        background: #fff;
+    .el-input-group__append {
+      border: none;
+      border-left: 1px solid #e5e6eb;
+      background: #f2f3f5;
     }
-    .validity-box{
-        width: 350px;
-        .el-input-group{
-            width: 250px;
-        }
-        .el-input-group__append{
-            border: none;
-            border-left: 1px solid #E5E6EB;
-            background: #F2F3F5;
-        }
-    }   
-    .price-box{
-        width: 300px;
-        display: inline-block;
-        .el-form-item__content{
-            position: relative;
-            .prepend,.append{
-                position: absolute;
-                left: 44px;
-                font-size: 14px;
-                line-height: 22px;
-                color: #1D2129;
-                line-height: 34px;
-            }
-            .append{
-                left: 142px;
-            }
-        }
+  }
+  .price-box {
+    width: 300px;
+    display: inline-block;
+    .el-form-item__content {
+      position: relative;
+      .prepend,
+      .append {
+        position: absolute;
+        left: 44px;
+        font-size: 14px;
+        line-height: 22px;
+        color: #1d2129;
+        line-height: 34px;
+      }
+      .append {
+        left: 142px;
+      }
     }
+  }
 }
-.el-date-picker__editor-wrap{
-    .el-input, .el-textarea{
-        width: auto;
-    }
+.el-date-picker__editor-wrap {
+  .el-input,
+  .el-textarea {
+    width: auto;
+  }
 }
-</style>
+</style>