zory 1 day ago
parent
commit
651d74a06e

+ 10 - 0
src/api/model/mMember.js

@@ -9,4 +9,14 @@ export default {
             return await http.get(this.url, params);
         },
     },
+    combo:{
+        url: `${config.API_URL}/mer/member/combo`,
+        name: "-",
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
 }

+ 33 - 0
src/api/model/mOrder.js

@@ -0,0 +1,33 @@
+import config from "@/config";
+import http from "@/utils/request";
+
+export default {
+    list: {
+        url: `${config.API_URL}/combo/list`,
+        name: "-",
+        get: async function (data = {}) {
+            return await http.get(this.url, data);
+        },
+    },
+    save: {
+        url: `${config.API_URL}/combo/save`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+    batch: {
+        url: `${config.API_URL}/combo/batch`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+    del: {
+        url: `${config.API_URL}/combo/del`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+}

+ 106 - 1
src/views/merchant/member/recharge/index.vue

@@ -1,3 +1,108 @@
 <template>
+    <el-container>
+        <el-main>
+            <el-card shadow="never" header="充值套餐设置" class="borderNone" v-loading="loadingState">
+                <el-form ref="dialogForm" :model="formData" :rules="rules" label-width="100px" label-position="top">
+                    <el-form-item label="功能开关" prop="state">
+                        <el-radio-group v-model="formData.state">
+                            <el-radio border :label="1">默认套餐</el-radio>
+                            <el-radio border :label="2">自定义套餐</el-radio>
+                            <el-radio border :label="3">关闭</el-radio>
+                        </el-radio-group>
+                        <div class="el-form-item-msg">关闭后,整个门店将不支持会员卡支付</div>
+                    </el-form-item>
+                    <template v-if="formData.state==1">
+                        <fieldset class="layui-elem-field">
+                            <legend><el-tag type="success" size="large">小提示</el-tag></legend>
+                            <div class="font-s14">
+                                90%的店铺都在使用
+                            </div>
+                        </fieldset>
+                        <el-row :gutter="15" class="">
+                            <el-col :span="12" class="" v-for="(item,index) in systemData" :key="index">
+                                <fieldset class="layui-elem-field">
+                                    <legend><el-tag type="success" size="large">{{item.name}}</el-tag></legend>
+                                    <div class="form-flex">充值¥<el-tag type="warning" size="large">{{item.money}}</el-tag>元,送¥<el-tag type="warning" size="large">{{item.old_money}}</el-tag>元</div>
+                                </fieldset>
+                            </el-col>
+                        </el-row>
+                    </template>
+                    <template v-if="formData.state==2">
+                        <fieldset class="layui-elem-field">
+                            <legend><el-tag type="success" size="large">小提示</el-tag></legend>
+                            <div class="font-s14 color-red">
+                                首充金额及首充赠送金额不超过50元,其他套餐赠送比例不超过50%
+                            </div>
+                        </fieldset>
+                        <el-row :gutter="15" class="">
+                            <el-col :span="12" class="" v-for="(item,index) in shopData" :key="index">
+                                <fieldset class="layui-elem-field">
+                                    <legend><el-tag type="success" size="large">{{item.name}}</el-tag></legend>
+                                    <div class="form-flex">充值¥<el-input v-model="item.money" style="width: 120px" autosize><template #append>元</template></el-input>送¥<el-input v-model="item.old_money" autosize style="width: 140px"><template #append>元</template></el-input></div>
+                                </fieldset>
+                            </el-col>
+                        </el-row>
+                    </template>
+                </el-form>
+            </el-card>
+            <!-- <el-card shadow="never" header="宣传物料下载" class="borderNone mt10" v-loading="loadingState"></el-card> -->
+        </el-main>
+        <el-footer>
+            <el-button type="primary" size="large" :loading="isSaveing" @click="saveForm">保存</el-button>
+        </el-footer>
+    </el-container>
+</template>
 
-</template>
+<script>
+export default {
+    data() {
+        return {
+            loadingState:false,
+            formData:{},
+            systemData:[],
+            shopData:[],
+            rules:{
+                state: [
+                    {required: true, message: '请选择'}
+                ],
+            },
+            isSaveing:false
+        }
+    },
+    mounted(){
+        this.getData()
+    },
+    methods: {
+        async saveForm(){
+            var validate = await this.$refs.dialogForm.validate().catch(()=>{});
+            if(!validate){ return false }
+            this.isSaveing = true;
+            let submitData = JSON.parse(JSON.stringify(this.formData));
+            if (submitData.state == 2) {
+                submitData.shop = this.shopData;
+            }
+            var resp = await this.$API.mMember.combo.post(submitData);
+            this.isSaveing = false;
+            if (resp.code !== 1) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+        },
+        async getData(){
+            var resp = await this.$API.mMember.combo.get();
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg)
+            }
+            this.formData.state = resp.data.state;
+            this.systemData = resp.data.system;
+            this.shopData = resp.data.shop;
+        }
+    }
+}
+</script>
+
+<style>
+.font-s14{font-size: 14px;}
+.color-red{color: #f00;}
+.form-flex{font-size: 14px;display: flex;align-items: center;gap: 10px;}
+</style>

+ 3 - 0
src/views/merchant/order/index/components/detail.vue

@@ -0,0 +1,3 @@
+<template>
+
+</template>

+ 50 - 0
src/views/merchant/order/index/components/option.vue

@@ -0,0 +1,50 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">按需操作</el-tag>
+        </legend>
+        <div class="op-header">
+            <div class="left-panel">
+                <el-button type="primary" icon="el-icon-plus" @click="table_add(2)">新增员工账号</el-button>
+                <!-- <el-button type="primary" icon="el-icon-download" @click="table_export()">导出</el-button> -->
+            </div>
+        </div>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    props: {
+        type: { type: String, default: "1" },
+        dataSelect: { type: Array, default: () => [] },
+        dataSelectFull: { type: Array, default: () => [] }
+    },
+    data(){
+        return {
+
+        }
+    },
+    methods: {
+        async table_batch_status(status){
+            if (this.dataSelect.length == 0) {
+                return this.$message.error("请选择修改数据")
+            }
+            let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+            var resp = await this.$API.mStaff.batch.post(submitData);
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.$emit("success");
+        },
+        handleSuccess(){
+            this.$emit("success");
+        },
+        table_add(type){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("add")
+            })
+        },
+    }
+}
+</script>

+ 49 - 0
src/views/merchant/order/index/components/search.vue

@@ -0,0 +1,49 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.name" placeholder="订单编号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>订单编号</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
+                                <el-option value="1" label="冻结"></el-option>
+                                <el-option value="2" label="正常"></el-option>
+                                <template #prefix>状态</template>
+                            </el-select>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 86 - 0
src/views/merchant/order/index/components/table.vue

@@ -0,0 +1,86 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        
+        <el-table-column label="订单编号" prop="order_sn">
+            <template #default="scope">
+                {{scope.row.order_sn}}
+            </template>
+        </el-table-column>
+        <el-table-column label="套餐信息" prop="time">
+            <template #default="scope">
+                续费<span class="status-danger">{{scope.row.time}}天</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="套餐金额" prop="money">
+            <template #default="scope">
+                {{ scope.row.money }}元
+            </template>
+        </el-table-column>
+        <el-table-column label="支付状态" prop="certificate_id">
+            <template #default="scope">
+                <div class="status-danger" v-if="scope.row.status==0"><sc-status-indicator type="danger"></sc-status-indicator> 待支付</div>
+                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator>已完成</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="支付时间" prop="pay_at">
+            <template #default="scope">
+                {{ scope.row.pay_at?scope.row.pay_at:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="创建时间" prop="create_at">
+            <template #default="scope">
+                {{ scope.row.create_at }}
+            </template>
+        </el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    props: {
+        type: { type: String, default: "1" }
+    },
+    data(){
+        return {
+            colorData:['','彩色','黑白'],
+            duplexData:['','单面','双面'],
+            list: {
+                apiObj: this.$API.mRenew.list
+            },
+            visible:false,
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{
+                type:this.type
+            }
+        }
+    },
+    methods:{
+        table_edit(data){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("edit",this.type).setData(data)
+            })
+        },
+        table_del(data){
+            this.$confirm("确定要删除该数据吗?","删除确认",{type: 'warning'}).then(async ()=>{
+                var resp = await this.$API.mPrice.del.post({"id":data.id,"type":""});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg)
+                }
+                this.$message.success(resp.msg)
+                this.$refs.table.refresh()
+            }).catch(()=>{});
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+    }
+}
+</script>

+ 88 - 1
src/views/merchant/order/index/index.vue

@@ -1,3 +1,90 @@
 <template>
+    <el-container class="flex-column">
+        <div class="table-search" style="border-bottom: 0;">
+            <el-card shadow="never" class="borderNone mb10">
+                <template #header>
+                    <div class="news-title">订单数统计</div>
+                </template>
+                <div class="user-card-body">
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">全部订单</div>
+                    </div>
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">待打印</div>
+                    </div>
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">打印失败</div>
+                    </div>
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">已完成</div>
+                    </div>
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">申请退款</div>
+                    </div>
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">退款失败</div>
+                    </div>
+                    <div class="card-item">
+                        <div class="card-num">0 <span>单</span></div>
+                        <div class="card-tips">已退款</div>
+                    </div>
+                </div>
+            </el-card>
+            <search @success="handleSuccess"></search>
+            <!-- <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" type="3"></optionBtn> -->
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull"></tablePage>
+            </div>
+        </el-main>
+    </el-container>
+</template>
 
-</template>
+<script>
+import search from './components/search';
+import optionBtn from './components/option';
+import tablePage from './components/table';
+export default {
+    components: {
+        search,tablePage,optionBtn
+    },
+    data() {
+        return {
+            
+        }
+    },
+}
+</script>
+
+<style>
+.user-card-body{display: flex;align-items: center;justify-content: space-around;padding: 10px 0;}
+.user-card-body .card-item{text-align: center;}
+.user-card-body .card-item .card-num span{font-size: 12px;color: #666;font-weight: normal;}
+.user-card-body .card-tips{font-size: 12px;color: #666;display: flex;align-items: center;}
+.user-card-body .card-tips i{font-style: normal;margin-left: 5px;}
+.user-card-body .card-num{font-size: 20px;font-weight: bold;}
+.mb10{margin-bottom: 15px;}
+.news-title{
+    font-size: 16px;
+    color: #000;
+    font-weight: bold;
+    margin-bottom: 10px;
+    display: flex;
+    align-items: center;
+}
+.news-title::before{
+    content: "";
+    width: 4px;
+    height: 16px;
+    display: block;
+    background-color: var(--el-color-primary);;
+    margin-right: 8px;
+}
+</style>

+ 3 - 0
src/views/merchant/order/qrcode/components/detail.vue

@@ -0,0 +1,3 @@
+<template>
+
+</template>

+ 50 - 0
src/views/merchant/order/qrcode/components/option.vue

@@ -0,0 +1,50 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">按需操作</el-tag>
+        </legend>
+        <div class="op-header">
+            <div class="left-panel">
+                <el-button type="primary" icon="el-icon-plus" @click="table_add(2)">新增员工账号</el-button>
+                <!-- <el-button type="primary" icon="el-icon-download" @click="table_export()">导出</el-button> -->
+            </div>
+        </div>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    props: {
+        type: { type: String, default: "1" },
+        dataSelect: { type: Array, default: () => [] },
+        dataSelectFull: { type: Array, default: () => [] }
+    },
+    data(){
+        return {
+
+        }
+    },
+    methods: {
+        async table_batch_status(status){
+            if (this.dataSelect.length == 0) {
+                return this.$message.error("请选择修改数据")
+            }
+            let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+            var resp = await this.$API.mStaff.batch.post(submitData);
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.$emit("success");
+        },
+        handleSuccess(){
+            this.$emit("success");
+        },
+        table_add(type){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("add")
+            })
+        },
+    }
+}
+</script>

+ 49 - 0
src/views/merchant/order/qrcode/components/search.vue

@@ -0,0 +1,49 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.name" placeholder="订单编号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>订单编号</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
+                                <el-option value="1" label="冻结"></el-option>
+                                <el-option value="2" label="正常"></el-option>
+                                <template #prefix>状态</template>
+                            </el-select>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 86 - 0
src/views/merchant/order/qrcode/components/table.vue

@@ -0,0 +1,86 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        
+        <el-table-column label="订单编号" prop="order_sn">
+            <template #default="scope">
+                {{scope.row.order_sn}}
+            </template>
+        </el-table-column>
+        <el-table-column label="套餐信息" prop="time">
+            <template #default="scope">
+                续费<span class="status-danger">{{scope.row.time}}天</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="套餐金额" prop="money">
+            <template #default="scope">
+                {{ scope.row.money }}元
+            </template>
+        </el-table-column>
+        <el-table-column label="支付状态" prop="certificate_id">
+            <template #default="scope">
+                <div class="status-danger" v-if="scope.row.status==0"><sc-status-indicator type="danger"></sc-status-indicator> 待支付</div>
+                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator>已完成</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="支付时间" prop="pay_at">
+            <template #default="scope">
+                {{ scope.row.pay_at?scope.row.pay_at:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="创建时间" prop="create_at">
+            <template #default="scope">
+                {{ scope.row.create_at }}
+            </template>
+        </el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    props: {
+        type: { type: String, default: "1" }
+    },
+    data(){
+        return {
+            colorData:['','彩色','黑白'],
+            duplexData:['','单面','双面'],
+            list: {
+                apiObj: this.$API.mRenew.list
+            },
+            visible:false,
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{
+                type:this.type
+            }
+        }
+    },
+    methods:{
+        table_edit(data){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("edit",this.type).setData(data)
+            })
+        },
+        table_del(data){
+            this.$confirm("确定要删除该数据吗?","删除确认",{type: 'warning'}).then(async ()=>{
+                var resp = await this.$API.mPrice.del.post({"id":data.id,"type":""});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg)
+                }
+                this.$message.success(resp.msg)
+                this.$refs.table.refresh()
+            }).catch(()=>{});
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+    }
+}
+</script>

+ 53 - 1
src/views/merchant/order/qrcode/index.vue

@@ -1,3 +1,55 @@
 <template>
+    <el-container class="flex-column">
+        <div class="table-search" style="border-bottom: 0;">
+            <search @success="handleSuccess"></search>
+            <!-- <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" type="3"></optionBtn> -->
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull"></tablePage>
+            </div>
+        </el-main>
+    </el-container>
+</template>
 
-</template>
+<script>
+import search from './components/search';
+import optionBtn from './components/option';
+import tablePage from './components/table';
+export default {
+    components: {
+        search,tablePage,optionBtn
+    },
+    data() {
+        return {
+            
+        }
+    },
+}
+</script>
+
+<style>
+.user-card-body{display: flex;align-items: center;justify-content: space-around;padding: 10px 0;}
+.user-card-body .card-item{text-align: center;}
+.user-card-body .card-item .card-num span{font-size: 12px;color: #666;font-weight: normal;}
+.user-card-body .card-tips{font-size: 12px;color: #666;display: flex;align-items: center;}
+.user-card-body .card-tips i{font-style: normal;margin-left: 5px;}
+.user-card-body .card-num{font-size: 20px;font-weight: bold;}
+.mb10{margin-bottom: 15px;}
+.news-title{
+    font-size: 16px;
+    color: #000;
+    font-weight: bold;
+    margin-bottom: 10px;
+    display: flex;
+    align-items: center;
+}
+.news-title::before{
+    content: "";
+    width: 4px;
+    height: 16px;
+    display: block;
+    background-color: var(--el-color-primary);;
+    margin-right: 8px;
+}
+</style>

+ 1 - 1
src/views/merchant/shop/detail/index.vue

@@ -1,7 +1,7 @@
 <template>
     <el-container>
         <el-main>
-            <el-card shadow="never" header="店铺详情" class="borderNone mt10" v-loading="loadingState">
+            <el-card shadow="never" header="店铺详情" class="borderNone" v-loading="loadingState">
                 <fieldset class="layui-elem-field">
                     <legend><el-tag type="danger">小提示</el-tag></legend>
                     <div class="font-s14">除店铺名称,客服电话,营业时间以外,均不可自行修改。若需修改,请到微信服务群联系售后</div>