|
|
@@ -2,192 +2,261 @@
|
|
|
<div class="manage-root personnel-manage">
|
|
|
<Header />
|
|
|
<div class="manage-root-contain">
|
|
|
- <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
|
|
|
- <div class="manage-root-contain-right personnel-manage-right">
|
|
|
- <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
|
|
|
- <div class="personal-inner">
|
|
|
- <div class="common-title-box">
|
|
|
- <h3>兑换码列表</h3>
|
|
|
- <div class="btn-box">
|
|
|
- <el-button type="primary" size="small" @click="createCdkey(1)">批量创建</el-button>
|
|
|
- <el-button type="primary" size="small" @click="createCdkey(0)">创建兑换码</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="search-box">
|
|
|
- <div class="search-item">
|
|
|
- <label>搜索</label>
|
|
|
- <el-input
|
|
|
- placeholder="输入搜索内容"
|
|
|
- v-model="searchInput" maxlength="200">
|
|
|
- <i slot="suffix" class="el-input__icon el-icon-search" @click="getList(1)" style="cursor: pointer;"></i>
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
- <div class="search-item">
|
|
|
- <label>状态</label>
|
|
|
- <el-select v-model="searchStatus" @change="getList(1)" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in statusList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div class="search-item">
|
|
|
- <label>类型</label>
|
|
|
- <el-select v-model="searchType" @change="getList(1)" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in typeList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </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="name"
|
|
|
- label="兑换码名称"
|
|
|
- sortable="custom"
|
|
|
- width="163">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="code"
|
|
|
- label="兑换码"
|
|
|
- sortable="custom"
|
|
|
- width="170">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{scope.row.type===0?scope.row.code:'多个'}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="type"
|
|
|
- label="类型"
|
|
|
- sortable="custom"
|
|
|
- width="92" >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{scope.row.type===0?'普通兑换码':'批量兑换码'}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="goods_count"
|
|
|
- label="内容数"
|
|
|
- min-width="80">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="phone"
|
|
|
- label="使用情况"
|
|
|
- width="96">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{scope.row.person_count_use+'/'+scope.row.person_count_max}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="creator_name"
|
|
|
- label="创建人"
|
|
|
- width="88">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="create_time"
|
|
|
- label="创建时间"
|
|
|
- sortable="custom"
|
|
|
- width="164">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="end_date"
|
|
|
- label="到期日期"
|
|
|
- sortable="custom"
|
|
|
- width="126" >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="valid_status"
|
|
|
- label="状态"
|
|
|
- width="88" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="status-box">
|
|
|
- <span :style="{background:statusListCss[scope.row.valid_status].bg}"></span>
|
|
|
- <b :style="{color:statusListCss[scope.row.valid_status].color}">{{scope.row.valid_status_name}}</b>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="memo"
|
|
|
- label="备注"
|
|
|
- width="120">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- fixed="right"
|
|
|
- label="操作"
|
|
|
- width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- @click.native.prevent="handleEdit(scope.row)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- class="primary-btn">
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- @click.native.prevent="handleUp(scope.row, scope.$index)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- class="primary-btn"
|
|
|
- v-if="scope.row.valid_status===0">
|
|
|
- 启用
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- @click.native.prevent="handleUp(scope.row, scope.$index)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- class="red-btn"
|
|
|
- v-else-if="scope.row.valid_status===1">
|
|
|
- 停用
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- @click.native.prevent="handleRevoca(scope.row)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- class="primary-btn">
|
|
|
- 撤回
|
|
|
- </el-button>
|
|
|
- <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>
|
|
|
+ <nav-menu
|
|
|
+ class="manage-root-contain-left"
|
|
|
+ :activeMenuIndex="activeMenuIndex"
|
|
|
+ ></nav-menu>
|
|
|
+ <div class="manage-root-contain-right personnel-manage-right">
|
|
|
+ <breadcrumb
|
|
|
+ :breadcrumbList="breadcrumbList"
|
|
|
+ class="breadcrumb-box"
|
|
|
+ ></breadcrumb>
|
|
|
+ <div class="personal-inner">
|
|
|
+ <div class="common-title-box">
|
|
|
+ <h3>兑换码列表</h3>
|
|
|
+ <div class="btn-box">
|
|
|
+ <el-input
|
|
|
+ placeholder="输入聚水潭内部订单号"
|
|
|
+ v-model="orderNumber"
|
|
|
+ maxlength="200"
|
|
|
+ class="order-input"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ slot="suffix"
|
|
|
+ @click="createDiscountCode"
|
|
|
+ style="cursor: pointer"
|
|
|
+ v-loading="btnLoading"
|
|
|
+ >创建</span
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" size="small" @click="createCdkey(1)"
|
|
|
+ >批量创建</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" size="small" @click="createCdkey(0)"
|
|
|
+ >创建兑换码</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" size="small" @click="createQRcode"
|
|
|
+ >生成二维码</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="search-box">
|
|
|
+ <div class="search-item">
|
|
|
+ <label>搜索</label>
|
|
|
+ <el-input
|
|
|
+ placeholder="输入搜索内容"
|
|
|
+ v-model="searchInput"
|
|
|
+ maxlength="200"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ slot="suffix"
|
|
|
+ class="el-input__icon el-icon-search"
|
|
|
+ @click="getList(1)"
|
|
|
+ style="cursor: pointer"
|
|
|
+ ></i>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="search-item">
|
|
|
+ <label>状态</label>
|
|
|
+ <el-select
|
|
|
+ v-model="searchStatus"
|
|
|
+ @change="getList(1)"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="search-item">
|
|
|
+ <label>类型</label>
|
|
|
+ <el-select
|
|
|
+ v-model="searchType"
|
|
|
+ @change="getList(1)"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
+ </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="name"
|
|
|
+ label="兑换码名称"
|
|
|
+ sortable="custom"
|
|
|
+ width="163"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="code"
|
|
|
+ label="兑换码"
|
|
|
+ sortable="custom"
|
|
|
+ width="170"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.type === 0 ? scope.row.code : "多个" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="type"
|
|
|
+ label="类型"
|
|
|
+ sortable="custom"
|
|
|
+ width="92"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.type === 0 ? "普通兑换码" : "批量兑换码" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="goods_count" label="内容数" min-width="80">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="phone" label="使用情况" width="96">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.person_count_use + "/" + scope.row.person_count_max
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="creator_name" label="创建人" width="88">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="create_time"
|
|
|
+ label="创建时间"
|
|
|
+ sortable="custom"
|
|
|
+ width="164"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="end_date"
|
|
|
+ label="到期日期"
|
|
|
+ sortable="custom"
|
|
|
+ width="126"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="valid_status" label="状态" width="88">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="status-box">
|
|
|
+ <span
|
|
|
+ :style="{
|
|
|
+ background: statusListCss[scope.row.valid_status].bg,
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ <b
|
|
|
+ :style="{
|
|
|
+ color: statusListCss[scope.row.valid_status].color,
|
|
|
+ }"
|
|
|
+ >{{ scope.row.valid_status_name }}</b
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="memo" label="备注" width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column fixed="right" label="操作" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click.native.prevent="handleEdit(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ class="primary-btn"
|
|
|
+ >
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click.native.prevent="handleUp(scope.row, scope.$index)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ class="primary-btn"
|
|
|
+ v-if="scope.row.valid_status === 0"
|
|
|
+ >
|
|
|
+ 启用
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click.native.prevent="handleUp(scope.row, scope.$index)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ class="red-btn"
|
|
|
+ v-else-if="scope.row.valid_status === 1"
|
|
|
+ >
|
|
|
+ 停用
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click.native.prevent="handleRevoca(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ class="primary-btn"
|
|
|
+ >
|
|
|
+ 撤回
|
|
|
+ </el-button>
|
|
|
+ <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>
|
|
|
</div>
|
|
|
+ <el-dialog title="兑换二维码" :visible.sync="dialogVisible" width="500px">
|
|
|
+ <canvas
|
|
|
+ id="QRCode_header"
|
|
|
+ style="
|
|
|
+ width: 338px;
|
|
|
+ height: 338px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: block;
|
|
|
+ "
|
|
|
+ @click="createQRcode"
|
|
|
+ v-loading="codeloading"
|
|
|
+ ></canvas>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" type="primary" @click="dialogVisible = false"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -195,9 +264,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 QRCode from "qrcode";
|
|
|
|
|
|
export default {
|
|
|
//import引入的组件需要注入到对象中才能使用
|
|
|
@@ -206,224 +276,248 @@ export default {
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
- activeMenuIndex: "cdkey_manage",
|
|
|
- breadcrumbList:[
|
|
|
- {
|
|
|
- icon:'barcode-line',
|
|
|
- url:'',
|
|
|
- text:''
|
|
|
- },
|
|
|
- {
|
|
|
- icon:'',
|
|
|
- url:'',
|
|
|
- text:'兑换码管理'
|
|
|
- }
|
|
|
- ],
|
|
|
- searchInput: '',
|
|
|
- searchType: -1,
|
|
|
- searchStatus: -1,
|
|
|
- typeList:[
|
|
|
- {
|
|
|
- value:-1,
|
|
|
- label:'全部'
|
|
|
- },
|
|
|
- {
|
|
|
- value:0,
|
|
|
- label:'普通兑换码'
|
|
|
- },
|
|
|
- {
|
|
|
- value:1,
|
|
|
- label:'批量兑换码'
|
|
|
- }
|
|
|
- ],
|
|
|
- statusList:[
|
|
|
- {
|
|
|
- label: '全部',
|
|
|
- value: -1
|
|
|
- },
|
|
|
- {
|
|
|
- label: '使用中',
|
|
|
- value: 1
|
|
|
- },
|
|
|
- {
|
|
|
- label: '已停用',
|
|
|
- value: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: '已到期',
|
|
|
- value: 2
|
|
|
- }
|
|
|
- ],
|
|
|
- statusListCss:{
|
|
|
- 1:{
|
|
|
- text:'使用中',
|
|
|
- bg:'#165DFF',
|
|
|
- color:''
|
|
|
- },
|
|
|
- 0:{
|
|
|
- text:'已停用',
|
|
|
- bg:'#F53F3F',
|
|
|
- color:''
|
|
|
- },
|
|
|
- 2:{
|
|
|
- text:'已过期',
|
|
|
- bg:'#FF7D00',
|
|
|
- color:''
|
|
|
- }
|
|
|
+ activeMenuIndex: "cdkey_manage",
|
|
|
+ breadcrumbList: [
|
|
|
+ {
|
|
|
+ icon: "barcode-line",
|
|
|
+ url: "",
|
|
|
+ text: "",
|
|
|
},
|
|
|
- tableData:[
|
|
|
- // {
|
|
|
- // id:'1',
|
|
|
- // userName:'admin',
|
|
|
- // realName:'超级管理员',
|
|
|
- // sex:'0',
|
|
|
- // type:'0', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
|
|
|
- // email:'d.dkemi@kqtdgbo.tj',
|
|
|
- // phone:'13082684216',
|
|
|
- // status:'1',
|
|
|
- // data:'2018-02-03',
|
|
|
- // img:''
|
|
|
- // }
|
|
|
- ],
|
|
|
- pageSize: window.localStorage.getItem('pageSize')?Number(window.localStorage.getItem('pageSize')):10,
|
|
|
- pageNumber: window.localStorage.getItem('pageNumber')?Number(window.localStorage.getItem('pageNumber')):1,
|
|
|
- tableHeight: "", // 表格高度
|
|
|
- total_count: 0,
|
|
|
- dataSort: {},
|
|
|
- tableLoading: false,
|
|
|
- }
|
|
|
+ {
|
|
|
+ icon: "",
|
|
|
+ url: "",
|
|
|
+ text: "兑换码管理",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ searchInput: "",
|
|
|
+ searchType: -1,
|
|
|
+ searchStatus: -1,
|
|
|
+ typeList: [
|
|
|
+ {
|
|
|
+ value: -1,
|
|
|
+ label: "全部",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 0,
|
|
|
+ label: "普通兑换码",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: "批量兑换码",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ statusList: [
|
|
|
+ {
|
|
|
+ label: "全部",
|
|
|
+ value: -1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "使用中",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已停用",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已到期",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ statusListCss: {
|
|
|
+ 1: {
|
|
|
+ text: "使用中",
|
|
|
+ bg: "#165DFF",
|
|
|
+ color: "",
|
|
|
+ },
|
|
|
+ 0: {
|
|
|
+ text: "已停用",
|
|
|
+ bg: "#F53F3F",
|
|
|
+ color: "",
|
|
|
+ },
|
|
|
+ 2: {
|
|
|
+ text: "已过期",
|
|
|
+ bg: "#FF7D00",
|
|
|
+ color: "",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tableData: [
|
|
|
+ // {
|
|
|
+ // id:'1',
|
|
|
+ // userName:'admin',
|
|
|
+ // realName:'超级管理员',
|
|
|
+ // sex:'0',
|
|
|
+ // type:'0', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
|
|
|
+ // email:'d.dkemi@kqtdgbo.tj',
|
|
|
+ // phone:'13082684216',
|
|
|
+ // status:'1',
|
|
|
+ // data:'2018-02-03',
|
|
|
+ // img:''
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ pageSize: window.localStorage.getItem("pageSize")
|
|
|
+ ? Number(window.localStorage.getItem("pageSize"))
|
|
|
+ : 10,
|
|
|
+ pageNumber: window.localStorage.getItem("pageNumber")
|
|
|
+ ? Number(window.localStorage.getItem("pageNumber"))
|
|
|
+ : 1,
|
|
|
+ tableHeight: "", // 表格高度
|
|
|
+ total_count: 0,
|
|
|
+ dataSort: {},
|
|
|
+ tableLoading: false,
|
|
|
+ orderNumber: "",
|
|
|
+ btnLoading: false,
|
|
|
+ qr_code_url: "",
|
|
|
+ opts: {
|
|
|
+ errorCorrectionLevel: "H", //容错级别
|
|
|
+ type: "image/png", //生成的二维码类型
|
|
|
+ quality: 1, //二维码质量
|
|
|
+ margin: 0, //二维码留白边距
|
|
|
+ width: 330, //宽
|
|
|
+ height: 330, //高
|
|
|
+ text: "", //二维码内容
|
|
|
+ color: {
|
|
|
+ dark: "#333333", //前景色
|
|
|
+ light: "#fff", //背景色
|
|
|
+ },
|
|
|
+ },
|
|
|
+ codeloading: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ };
|
|
|
},
|
|
|
//计算属性 类似于data概念
|
|
|
- computed: {
|
|
|
- },
|
|
|
+ computed: {},
|
|
|
//监控data中数据变化
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
- createCdkey(type){
|
|
|
- window.localStorage.removeItem('cdKeyId')
|
|
|
- this.$router.push({
|
|
|
- path: '/createCdkey',
|
|
|
- query: {
|
|
|
- type: type
|
|
|
- }
|
|
|
- })
|
|
|
+ createCdkey(type) {
|
|
|
+ window.localStorage.removeItem("cdKeyId");
|
|
|
+ this.$router.push({
|
|
|
+ path: "/createCdkey",
|
|
|
+ query: {
|
|
|
+ type: type,
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
- handleSort(value){
|
|
|
- let dataSort = {
|
|
|
- prop: value.prop,
|
|
|
- order: value.order
|
|
|
- }
|
|
|
- this.dataSort = dataSort
|
|
|
- this.getList()
|
|
|
+ handleSort(value) {
|
|
|
+ let dataSort = {
|
|
|
+ prop: value.prop,
|
|
|
+ order: value.order,
|
|
|
+ };
|
|
|
+ this.dataSort = dataSort;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
// 撤回
|
|
|
- handleRevoca(row){
|
|
|
- this.$confirm('确定撤回吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let Mname = "/ShopServer/Manager/DiscountCodeManager/RecallDiscountCode";
|
|
|
- let data = {
|
|
|
- id: row.id
|
|
|
- };
|
|
|
- getLogin(Mname, data).then(res => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '撤回成功!'
|
|
|
- });
|
|
|
- this.getList()
|
|
|
+ handleRevoca(row) {
|
|
|
+ this.$confirm("确定撤回吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let Mname =
|
|
|
+ "/ShopServer/Manager/DiscountCodeManager/RecallDiscountCode";
|
|
|
+ let data = {
|
|
|
+ id: row.id,
|
|
|
+ };
|
|
|
+ getLogin(Mname, data).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "撤回成功!",
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- });
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
// 删除
|
|
|
- handleDelete(row){
|
|
|
- this.$confirm('确定删除吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let Mname = "/ShopServer/Manager/DiscountCodeManager/DeleteDiscountCode";
|
|
|
- let data = {
|
|
|
- id: row.id
|
|
|
- };
|
|
|
- getLogin(Mname, data).then(res => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- this.getList()
|
|
|
+ handleDelete(row) {
|
|
|
+ this.$confirm("确定删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let Mname =
|
|
|
+ "/ShopServer/Manager/DiscountCodeManager/DeleteDiscountCode";
|
|
|
+ let data = {
|
|
|
+ id: row.id,
|
|
|
+ };
|
|
|
+ getLogin(Mname, data).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- });
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
// 查询列表
|
|
|
- getList(page){
|
|
|
- this.tableLoading = true
|
|
|
- if(page){
|
|
|
- this.pageNumber = page
|
|
|
- }
|
|
|
- let MethodName = "/ShopServer/Manager/DiscountCodeManager/PageQueryDiscountCodeList";
|
|
|
- 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 = {
|
|
|
- content:this.searchInput.trim(),
|
|
|
- type:this.searchType,
|
|
|
- valid_status:this.searchStatus,
|
|
|
- page_capacity:this.pageSize,
|
|
|
- cur_page:this.pageNumber,
|
|
|
- order_column_list: order_column_list
|
|
|
+ getList(page) {
|
|
|
+ this.tableLoading = true;
|
|
|
+ if (page) {
|
|
|
+ this.pageNumber = page;
|
|
|
+ }
|
|
|
+ let MethodName =
|
|
|
+ "/ShopServer/Manager/DiscountCodeManager/PageQueryDiscountCodeList";
|
|
|
+ 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 = {
|
|
|
+ content: this.searchInput.trim(),
|
|
|
+ type: this.searchType,
|
|
|
+ valid_status: this.searchStatus,
|
|
|
+ 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.discount_code_list
|
|
|
- this.total_count = res.total_count
|
|
|
- }
|
|
|
+ this.tableLoading = false;
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.tableData = res.discount_code_list;
|
|
|
+ this.total_count = res.total_count;
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.tableLoading = false
|
|
|
+ this.tableLoading = false;
|
|
|
});
|
|
|
},
|
|
|
// 编辑账号
|
|
|
- handleEdit(row){
|
|
|
- // 根据登录用户判断当前用户是不是超管 在table里加上disabled
|
|
|
+ handleEdit(row) {
|
|
|
+ // 根据登录用户判断当前用户是不是超管 在table里加上disabled
|
|
|
|
|
|
- // 点击时记录页码和每页条数
|
|
|
- window.localStorage.setItem('pageSize',this.pageSize)
|
|
|
- window.localStorage.setItem('pageNumber',this.pageNumber)
|
|
|
- if(row&&row.id){
|
|
|
- this.$router.push({
|
|
|
- path: "/checkGoods",
|
|
|
- query: {
|
|
|
- id: row?row.id:'',
|
|
|
- type: row.type
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
+ // 点击时记录页码和每页条数
|
|
|
+ window.localStorage.setItem("pageSize", this.pageSize);
|
|
|
+ window.localStorage.setItem("pageNumber", this.pageNumber);
|
|
|
+ if (row && row.id) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/checkGoods",
|
|
|
+ query: {
|
|
|
+ id: row ? row.id : "",
|
|
|
+ type: row.type,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
// 停用 启用
|
|
|
handleUp(row, index) {
|
|
|
let Mname = "/ShopServer/Manager/DiscountCodeManager/StopDiscountCode";
|
|
|
let updataData = JSON.parse(JSON.stringify(row));
|
|
|
let data = {
|
|
|
- id: row.id
|
|
|
+ id: row.id,
|
|
|
};
|
|
|
if (row.valid_status === 0) {
|
|
|
// 下架状态
|
|
|
@@ -433,20 +527,20 @@ export default {
|
|
|
data.is_stop = "true";
|
|
|
updataData.valid_status = 0;
|
|
|
}
|
|
|
- getLogin(Mname, data).then(res => {
|
|
|
+ getLogin(Mname, data).then((res) => {
|
|
|
this.$message.success("操作成功");
|
|
|
this.$set(this.tableData, index, updataData);
|
|
|
- this.getList()
|
|
|
+ this.getList();
|
|
|
});
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
- this.pageSize = val
|
|
|
- this.pageNumber = 1
|
|
|
- this.getList()
|
|
|
+ this.pageSize = val;
|
|
|
+ this.pageNumber = 1;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
- this.pageNumber = val
|
|
|
- this.getList()
|
|
|
+ this.pageNumber = val;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
//计算table高度(动态设置table高度)
|
|
|
getTableHeight() {
|
|
|
@@ -458,67 +552,154 @@ export default {
|
|
|
this.tableHeight = window.innerHeight - tableH;
|
|
|
}
|
|
|
},
|
|
|
+ // 根据聚水潭订单号
|
|
|
+ createDiscountCode() {
|
|
|
+ if (this.orderNumber && this.orderNumber.trim()) {
|
|
|
+ this.btnLoading = true;
|
|
|
+ let MethodName =
|
|
|
+ "/ShopServer/Manager/DiscountCodeManager/CreateDiscountCode_UseJushuitanInnerOrderSN";
|
|
|
+ getLogin(MethodName, { order_sn: this.orderNumber.trim() })
|
|
|
+ .then((res) => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.$message.success("创建成功");
|
|
|
+ this.orderNumber = "";
|
|
|
+ this.getList("1");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.warning("请先输入聚水潭内部订单号");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 生成二维码
|
|
|
+ createQRcode() {
|
|
|
+ if (!this.qr_code_url) {
|
|
|
+ this.$confirm(
|
|
|
+ "请先去系统配置-聚水潭对接配置里设置用于扫码兑换的二维码的URL",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ closeOnClickModal: false,
|
|
|
+ }
|
|
|
+ ).then(({}) => {});
|
|
|
+ } else {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.codeloading = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ let msg = document.getElementById("QRCode_header");
|
|
|
+ QRCode.toCanvas(msg, this.qr_code_url, this.opts, function (error) {
|
|
|
+ if (error) {
|
|
|
+ console.log("二维码加载失败", error);
|
|
|
+ this.$message.error("二维码加载失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.codeloading = false;
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 得到配置信息
|
|
|
+ getInfo() {
|
|
|
+ let MethodName =
|
|
|
+ "/OrgServer/Manager/SysConfigManager/GetSysConfig_Jushuitan";
|
|
|
+ getLogin(MethodName, {})
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.qr_code_url = res.qr_code_url;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((res) => {});
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
this.getTableHeight();
|
|
|
- this.getList()
|
|
|
+ this.getList();
|
|
|
+ this.getInfo();
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问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类 */
|
|
|
+.btn-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.order-input {
|
|
|
+ width: 200px;
|
|
|
+ margin-right: 10px;
|
|
|
+
|
|
|
+ :deep .el-input__suffix {
|
|
|
+ background: #165dff;
|
|
|
+ right: 0;
|
|
|
+ border-radius: 0 2px 2px 0;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ :deep .el-input__suffix-inner {
|
|
|
+ span {
|
|
|
+ line-height: 32px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ height: 32px;
|
|
|
+ padding: 0 8px;
|
|
|
+ display: block;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
-.personal-inner{
|
|
|
- .user-info{
|
|
|
- .cell{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- .touxiang{
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- border-radius: 50%;
|
|
|
- margin-right: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .type-info{
|
|
|
- background: #F2F3F5;
|
|
|
- border-radius: 2px;
|
|
|
- color: #1D2129;
|
|
|
- padding: 2px 8px 3px 8px;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 22px;
|
|
|
- height: auto;
|
|
|
- border: none;
|
|
|
+.personal-inner {
|
|
|
+ .user-info {
|
|
|
+ .cell {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .touxiang {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
+ .type-info {
|
|
|
+ background: #f2f3f5;
|
|
|
+ border-radius: 2px;
|
|
|
+ color: #1d2129;
|
|
|
+ padding: 2px 8px 3px 8px;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 22px;
|
|
|
+ height: auto;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|