zm
2021-04-01 802c31297a1ae5b8c2e8fb5c62e9790dfc5d7583
plugins/exchange/views/library/edit.php
@@ -225,17 +225,17 @@
        <div slot="header">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><span style="color: #409EFF;cursor: pointer"
                                          @click="$navigate({r:'plugin/exchange/mall/library/list'})">兑换码管理</span>
                                          @click="$navigate({r:'plugin/exchange/mall/library/list'})">提货卡管理</span>
                </el-breadcrumb-item>
                <el-breadcrumb-item v-if="id > 0 && !log">编辑兑换码库</el-breadcrumb-item>
                <el-breadcrumb-item v-if="id > 0 && !log">编辑提货卡</el-breadcrumb-item>
                <el-breadcrumb-item v-else-if="id > 0 && log">查看兑换详情</el-breadcrumb-item>
                <el-breadcrumb-item v-else>新增兑换码库</el-breadcrumb-item>
                <el-breadcrumb-item v-else>新增提货卡</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <el-form style="padding-bottom: 77px;" @submit.native.prevent size="small" :rules="rules" ref="form" :model="form" label-width="130px">
            <el-card style="margin-bottom: 10px">
                <div slot="header">基础设置</div>
                <el-form-item label="兑换码库名称" prop="name">
                <el-form-item label="提货卡名称" prop="name">
                    <div style="width: 450px">
                        <el-input :disabled="id > 0" v-model="form.name" placeholder="最多输入15个字" maxlength="15"></el-input>
                    </div>
@@ -257,14 +257,14 @@
                    <el-button class="height-button" type="text" @click="lookRule">查看规则</el-button>
                </el-form-item>
            </el-card>
            <!-- 兑换码规则 -->
            <!-- 提货卡规则 -->
            <el-card v-if="id == 0">
                <div slot="header">兑换码规则<span style="color: #ff4544;font-size: 10px;margin-left: 10px;">创建后不可更改</span></div>
                <div slot="header">提货卡规则<span style="color: #ff4544;font-size: 10px;margin-left: 10px;">创建后不可更改</span></div>
                <div class="rules" style="background-color: #ECF5FE">
                    <div>兑换码库创建后,后续生成的兑换码将按照下述规则执行;</div>
                    <div>兑换码库一经创建,将无法修改规则,请谨慎操作。</div>
                    <div>提货卡创建后,后续生成的提货卡将按照下述规则执行;</div>
                    <div>提货卡一经创建,将无法修改规则,请谨慎操作。</div>
                </div>
                <el-form-item label="兑换码有效期">
                <el-form-item label="提货卡有效期">
                    <el-radio v-model="form.expire_type" label="all">永久有效</el-radio>
                    <el-radio v-model="form.expire_type" label="fixed">固定时间</el-radio>
                    <el-radio v-model="form.expire_type" label="relatively">相对时间</el-radio>
@@ -281,7 +281,7 @@
                        </el-date-picker>
                    </div>
                    <div style="margin-top: 10px;" v-if="form.expire_type == 'relatively'" flex="dir:left cross:center">
                        <div>从兑换码生成时</div>
                        <div>从提货卡生成时</div>
                        <div class="expire-day">
                            <el-input min="0" oninput="if(this.value)this.value = this.value.replace(/[^0-9]/g, '')" type="number" v-model="form.expire_start_day">
                                <template slot="append">天</template>
@@ -306,10 +306,10 @@
                </el-form-item>
                <el-form-item label="卡号数字位数">
                    <div style="width: 100px">
                        <el-input :disabled="id > 0" v-model="form.card_no_num_len" placeholder="最多1位" maxlength="1" oninput ="value=value.replace(/[^\d]/g,'')"></el-input>
                        <el-input :disabled="id > 0" v-model="form.card_no_num_len" placeholder="最多15" maxlength="2" oninput ="value=value.replace(/[^\d]/g,'')"></el-input>
                    </div>
                </el-form-item>
                <el-form-item label="兑换码格式">
                <el-form-item label="密码格式">
                    <el-radio v-model="form.code_format" label="english_num">英文数字组合</el-radio>
                    <el-radio v-model="form.code_format" label="num">纯数字组合</el-radio>
                </el-form-item>
@@ -507,7 +507,7 @@
                                <el-select style="width: 100px" slot="prepend" v-model="logSearch.keyword_1">
                                    <el-option label="用户ID" :value="4"></el-option>
                                    <el-option label="昵称" :value="2"></el-option>
                                    <el-option label="兑换码" :value="8"></el-option>
                                    <el-option label="提货卡" :value="8"></el-option>
                                </el-select>
                                <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
                            </el-input>
@@ -533,7 +533,7 @@
                    </app-new-export-dialog-2>
                    </div>
                    <el-table :header-cell-style="{'background-color': '#fff'}" class="table-info" :data="list" border style="width: 100%" v-loading="listLoading">
                        <el-table-column prop="code" label="兑换码" width="220"></el-table-column>
                        <el-table-column prop="code" label="提货卡" width="220"></el-table-column>
                        <el-table-column prop="origin" label="兑换渠道">
                            <template slot-scope="scope">
                                <img style="margin-right: 10px;" height="24" width="24" :src="scope.row.platform_icon" alt=""/>
@@ -576,21 +576,21 @@
                    </div>
                </div>
            </el-card>
            <!-- 兑换码管理 -->
            <!-- 提货卡管理 -->
            <el-card v-if="id > 0 && !log">
                <div slot="header" style="width: 100%;" flex="main:justify cross:center">
                    <div>兑换码管理</div>
                    <div>提货卡管理</div>
                    <div>
                        <!--<el-button @click="getActivity" size="small" type="primary">生成动态活码</el-button>-->
                        <el-button @click="appendDialog=true;num=''" size="small" type="primary">批量生成兑换码</el-button>
                        <el-button @click="appendDialog=true;num=''" size="small" type="primary">批量生成提货卡</el-button>
                        <el-button type="primary" @click="uploadVisible = true" size="small">批量导入卡号</el-button>                        
                        <el-button type="primary" @click="exportData" size="small">导出卡密数据</el-button>
                    </div>
                </div>
                <div class="rules use-rules">
                    <div>使用说明:</div>
                    <div>礼品卡关联兑换码库后,每售出一张礼品卡,则在此处自动生成一个新的兑换码,不需要您主动生成兑换码。</div>
                    <div>批量生成的兑换码,生成方式为“手动”,系统无法直接发售,需要您自行导出使用,可用来帮助线下发售实体卡片或者作为电子卡密出售。</div>
                    <div>礼品卡关联提货卡后,每售出一张礼品卡,则在此处自动生成一个新的提货卡,不需要您主动生成提货卡。</div>
                    <div>批量生成的提货卡,生成方式为“手动”,系统无法直接发售,需要您自行导出使用,可用来帮助线下发售实体卡片或者作为电子卡密出售。</div>
                </div>
                <div class="table-body">
                    <div flex="wrap:wrap cross:center" style="margin-bottom: 15px;">
@@ -1079,7 +1079,7 @@
        </span>
    </el-dialog>
    <el-dialog title="批量生成兑换码" :visible.sync="appendDialog" width="30%">
    <el-dialog title="批量生成提货卡" :visible.sync="appendDialog" width="30%">
        <el-form @submit.native.prevent size="small" label-width="100px">
            <el-form-item label="生成数量" prop="num">
                <el-input v-model="num" min="0" oninput="if(this.value.length>3)this.value=1000;this.value = this.value.replace(/[^0-9]/g, '')" type="number" :max="1000">
@@ -1125,13 +1125,13 @@
            <el-form-item v-if="!exchangeVisible" label="兑换有效期" prop="expire_type">
                <div v-if="form.expire_type == 'all'">永久(永久)</div>
                <div v-if="form.expire_type == 'fixed'">固定时间({{form.expire_start_time}}至{{form.expire_end_time}})</div>
                <div v-if="form.expire_type == 'relatively'">相对时间(从兑换码生成时第{{form.expire_start_day}}天至第{{form.expire_end_day}}天)</div>
                <div v-if="form.expire_type == 'relatively'">相对时间(从提货卡生成时第{{form.expire_start_day}}天至第{{form.expire_end_day}}天)</div>
            </el-form-item>
            <el-form-item v-if="!exchangeVisible" label="兑换模式" prop="mode">
                <div v-if="form.mode == 0">全部奖励品</div>
                <div v-if="form.mode == 1">任选一份奖励品</div>
            </el-form-item>
            <el-form-item v-if="!exchangeVisible" label="兑换码格式" prop="code_format">
            <el-form-item v-if="!exchangeVisible" label="密码格式" prop="code_format">
                <div v-if="form.code_format == 'english_num'">英文数字组合</div>
                <div v-if="form.code_format == 'num'">纯数字组合</div>
            </el-form-item>
@@ -1334,7 +1334,7 @@
                rewards: [],
                rules: {
                    name: [
                        { required: true, message: '请输入兑换码库名称', trigger: 'blur' }
                        { required: true, message: '请输入提货卡名称', trigger: 'blur' }
                    ],
                },
            };
@@ -1384,7 +1384,7 @@
            },
            allDownload() {
                if(this.qrList.length == 0) {
                    this.$message.error('请选择要下载的兑换码');
                    this.$message.error('请选择要下载的提货卡');
                    return false
                }
                var zip = new JSZip();
@@ -1542,9 +1542,9 @@
                    this.rewards = this.form.rewards.slice((page-1)*6,(page-1)*6+6);
                }
            },
            // 禁用兑换码
            // 禁用提货卡
            ban(row) {
                this.$confirm('禁用该条兑换码, 是否继续?', '提示', {
                this.$confirm('禁用该条提货卡, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
@@ -1571,7 +1571,7 @@
                    })
                })
            },
            // 生成兑换码
            // 生成提货卡
            append() {
                if(this.num > 0) {
                    this.appendLoading = true;