zory 13 uur geleden
bovenliggende
commit
ecf63efe51

+ 1 - 1
.env.production

@@ -5,4 +5,4 @@ NODE_ENV = production
 VUE_APP_TITLE = 印美打印
 
 # 接口地址
-VUE_APP_API_BASEURL = https://hx-mini-api.jsshuita.com.cn/api
+VUE_APP_API_BASEURL = /api

+ 2 - 2
src/api/model/dash.js

@@ -10,14 +10,14 @@ export default {
         },
     },
     store: {
-        url: `${config.API_URL}/dashboard/store`,
+        url: `${config.API_URL}/dashboard/data`,
         name: "-",
         get: async function (data = {}) {
             return await http.get(this.url, data);
         },
     },
     shop: {
-        url: `${config.API_URL}/dashboard/shop`,
+        url: `${config.API_URL}/mer/dashboard/data`,
         name: "-",
         get: async function (data = {}) {
             return await http.get(this.url, data);

+ 11 - 4
src/api/model/mOrder.js

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

+ 76 - 94
src/views/merchant/dashboard/index.vue

@@ -11,14 +11,25 @@
 	</div>
     <el-main>
         <div class="card-news mt0">
-            <div class="news-title">经营数据</div>
+            <div class="news-title">经营数据
+                <div class="title-open">
+                    <div class="name">显示数据</div>
+                    <el-switch
+                        v-model="hideState"
+                        :active-value="1"
+                        :inactive-value="0"
+                        size="large"
+                        @change="getHide"
+                    />
+                </div>
+            </div>
             <div class="total-panel">
                 <div :class="this.$store.state.global.ismobile?'panel-item m':'panel-item'" style="background-color: rgb(235, 241, 255);">
                     <div class="item-warp">
                         <div class="left">
                             <div class="title">今日营业额(元)</div>
-                            <div class="number">{{ todayData.order_money ? todayData.order_money:'0' }}</div>
-                            <div class="desc">来客订单金额</div>
+                            <div class="number">{{ todayData.userNum ? todayData.userNum:'0.00' }}</div>
+                            <div class="desc"></div>
                         </div>
                         <div class="right"><img src="@/assets/image/wave-1-icon.png" /></div>
                     </div>
@@ -28,8 +39,8 @@
                     <div class="item-warp">
                         <div class="left">
                             <div class="title">今日订单数(单)</div>
-                            <div class="number">{{ todayData.order_num ? todayData.order_num:'0' }}</div>
-                            <div class="desc">来客订单</div>
+                            <div class="number">{{ todayData.rechargeNum ? todayData.rechargeNum:'0.00' }}</div>
+                            <div class="desc"></div>
                         </div>
                         <div class="right"><img src="@/assets/image/wave-2-icon.png" /></div>
                     </div>
@@ -38,46 +49,38 @@
                 <div :class="this.$store.state.global.ismobile?'panel-item m':'panel-item'" style="background-color: rgb(255, 241, 214);">
                     <div class="item-warp">
                         <div class="left">
-                            <div class="title">今日核销(单)</div>
-                            <div class="number">{{ todayData.order_done ? todayData.order_done:'0' }}</div>
-                            <div class="desc">已完成核销</div>
+                            <div class="title">手机自助打印待处理(单)</div>
+                            <div class="number">{{ todayData.rechargeMoney ? todayData.rechargeMoney:'0.00' }}</div>
+                            <div class="desc"></div>
                         </div>
                         <div class="right"><img src="@/assets/image/wave-3-icon.png" /></div>
                     </div>
                     <div class="item-wave"><img src="@/assets/image/wave-3.png" /></div>
                 </div>
-                <div :class="this.$store.state.global.ismobile?'panel-item m':'panel-item'" style="background-color: rgb(250, 230, 244);">
-                    <div class="item-warp">
-                        <div class="left">
-                            <div class="title">今日待发货(单)</div>
-                            <div class="number">{{ todayData.order_send ? todayData.order_send:'0' }}</div>
-                            <div class="desc">待发快递</div>
-                        </div>
-                        <div class="right"><img src="@/assets/image/wave-4-icon.png" /></div>
-                    </div>
-                    <div class="item-wave"><img src="@/assets/image/wave-4.png" /></div>
-                </div>
-                <div :class="this.$store.state.global.ismobile?'panel-item m':'panel-item'" style="background-color: rgb(235, 255, 248);">
-                    <div class="item-warp">
-                        <div class="left">
-                            <div class="title">店铺数量</div>
-                            <div class="number">{{ todayData.store_num ? todayData.store_num:'0' }}</div>
-                            <div class="desc">开通绑定店铺数量</div>
-                        </div>
-                        <div class="right"><img src="@/assets/image/wave-5-icon.png" /></div>
-                    </div>
-                    <div class="item-wave"><img src="@/assets/image/wave-5.png" /></div>
-                </div>
             </div>
         </div>
         <el-row :gutter="20">
-            <el-col :span="this.$store.state.global.ismobile?24:12" :xs="24">
+            <el-col :span="this.$store.state.global.ismobile?24:24" :xs="24">
                 <div class="card-news mt10">
+                    <div class="date-check">
+                        <el-radio-group v-model="moneyDate" size="large" @change="getmoneyDate">
+                            <el-radio-button v-for="(city,indx) in dateData" :key="indx" :label="city.key">
+                                {{ city.name }}
+                            </el-radio-button>
+                        </el-radio-group>
+                    </div>
                     <scEcharts height="500px" :option="option2"></scEcharts>
                 </div>
             </el-col>
-            <el-col :span="this.$store.state.global.ismobile?24:12" :xs="24">
+            <el-col :span="this.$store.state.global.ismobile?24:24" :xs="24">
                 <div class="card-news mt10">
+                    <div class="date-check">
+                        <el-radio-group v-model="orderDate" size="large" @change="getorderDate">
+                            <el-radio-button v-for="(city,indx) in dateData" :key="indx" :label="city.key">
+                                {{ city.name }}
+                            </el-radio-button>
+                        </el-radio-group>
+                    </div>
                     <scEcharts height="500px" :option="option"></scEcharts>
                 </div>
             </el-col>
@@ -95,83 +98,42 @@ export default {
     },
     data(){
         return {
+            dateData:[{"name":"近7天","key":7},{"name":"近14天","key":14},{"name":"近30天","key":30}],
+            orderDate:7,
+            moneyDate:7,
+            hideState:0,
             pageLoading: false,
             dashboard: '0',
             todayData:{},
             blueBg,
             baseData:{},
             option2: {},
-            option: {
-                // title: {
-                //     left: 'left', 
-                //     text: '订单数据',
-                // },
-                // grid: {
-                //     top: '80px'
-                // },
-                // tooltip: {
-                //     trigger: 'axis'
-                // },
-                // legend: {
-                //     x: 'right',
-                //     data: ['呼出总数量', '接听总数量', '短信发送总数量', '添加微信总数量']
-                // },
-                // calculable: true,
-                // xAxis: {
-                //     type: 'category',
-                //     data: ['06-25', '06-26', '06-27', '06-28', '06-29', '06-30', '07-01', '07-02', '07-03', '07-04']
-                // },
-                // yAxis: [{
-                //     type: 'value'
-                // }],
-                // // yAxis: [{type: 'value', splitLine: {show: true}, gridIndex: 0, axisLabel: {formatter: '{value} 单'}}],
-                // series: [{
-                //     name: '呼出总数量',
-                //     data: [120, 200, 50, 80, 170, 210, 130,450,244,168],
-                //     smooth: true, showBackground: false,
-                //     areaStyle: {color: 'rgba(64, 158, 254, 0.6)'},
-                //     type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
-                //     emphasis:{focus: 'series'},
-                //     label: {position: 'top', formatter: '{c}', show: true},
-                // },{
-                //     name: '接听总数量',
-                //     data: [20, 210, 10, 180, 110, 100, 130,450,244,168],
-                //     smooth: true, showBackground: false,
-                //     areaStyle: {color: 'rgba(54, 206, 159, 0.6)'},
-                //     type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
-                //     emphasis:{focus: 'series'},
-                //     label: {position: 'top', formatter: '{c}', show: true},
-                // },{
-                //     name: '短信发送总数量',
-                //     data: [20, 210, 10, 80, 110, 100, 130,450,244,168],
-                //     smooth: true, showBackground: false,
-                //     areaStyle: {color: 'rgba(245, 110, 106, 0.6)'},
-                //     type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
-                //     emphasis:{focus: 'series'},
-                //     label: {position: 'top', formatter: '{c}', show: true},
-                // },{
-                //     name: '添加微信总数量',
-                //     data: [20, 210, 110, 180, 110, 100, 130,450,244,268],
-                //     smooth: true, showBackground: false,
-                //     areaStyle: {color: 'rgba(98, 108, 144, 0.6)'},
-                //     type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
-                //     emphasis:{focus: 'series'},
-                //     label: {position: 'top', formatter: '{c}', show: true},
-                // }]
-            },
+            option: {},
         }
     },
     created(){
         var baseData = this.$TOOL.data.get("SERVICE");
         this.baseData = baseData;
-        // this.getData()
+        this.getData()
     },
     methods: {
+        getmoneyDate(data){
+            this.moneyDate = data;
+            this.getData()
+        },
+        getorderDate(data){
+            this.orderDate = data;
+            this.getData()
+        },
+        getHide(data){
+            this.hideState = (data==1?1:0)
+            this.getData()
+        },
         async getData(){
             var loading = this.$loading();
-            var resp = await this.$API.dash.store.get();
+            var resp = await this.$API.dash.shop.get({"hide":this.hideState,"money":this.moneyDate,"order":this.orderDate});
             loading.close();
-            this.todayData = resp.data.today;
+            this.todayData = resp.data.data;
             let data = resp.data.moneys;
             let moneyDay = data.map(function (item) {
                 return item['当天日期'];
@@ -346,6 +308,12 @@ export default {
     display: flex;
     align-items: center;
 }
+.card-news .date-check{
+    position: absolute;
+    top: 10px;
+    right: 10px;
+    z-index: 99;
+}
 .total-panel-sub .sub-card .title.red::before{
     content: "";
     display: block;
@@ -413,7 +381,7 @@ export default {
     margin-bottom: 10px;
 }
 .total-panel .panel-item{
-    width: calc(20% - 9.6px);
+    width: calc(33.333333% - 9.6px);
     height: 130px;
     box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 8px;
     position: relative;
@@ -446,6 +414,7 @@ export default {
     width: 100%;
     height: auto;
     z-index: 9;
+    top: 0;
 }
 .total-panel .panel-item .item-wave img {
     width: 100%;
@@ -487,6 +456,7 @@ export default {
     background-color: #fff;
     padding: 20px;
     border-radius: 5px;
+    position: relative;
 }
 .news-title{
     font-size: 16px;
@@ -496,6 +466,18 @@ export default {
     display: flex;
     align-items: center;
 }
+.news-title .title-open{
+    margin-left: auto;
+    margin-right: 0;
+    font-size: 12px;
+    font-weight: normal;
+    color: #666;
+    display: flex;
+    align-items: center;
+}
+.news-title .title-open .name{
+    margin-right: 10px;
+}
 .news-title::before{
     content: "";
     width: 4px;

+ 7 - 3
src/views/merchant/order/index/components/search.vue

@@ -8,14 +8,18 @@
                 <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()">
+                            <el-input v-model="searchKey.orderid" 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>
+                                <el-option value="2" label="待打印"></el-option>
+                                <el-option value="3" label="打印失败"></el-option>
+                                <el-option value="4" label="已打印"></el-option>
+                                <el-option value="5" label="退款中"></el-option>
+                                <el-option value="6" label="退款失败"></el-option>
+                                <el-option value="7" label="已退款"></el-option>
                                 <template #prefix>状态</template>
                             </el-select>
                         </el-col>

+ 63 - 14
src/views/merchant/order/index/components/table.vue

@@ -1,26 +1,52 @@
 <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">
+        <el-table-column label="订单编号" width="200" prop="order_sn" fixed="left">
             <template #default="scope">
                 {{scope.row.order_sn}}
             </template>
         </el-table-column>
-        <el-table-column label="套餐信息" prop="time">
+        <el-table-column label="下单用户" prop="openid" width="220"></el-table-column>
+        <el-table-column label="订单金额" prop="money">
             <template #default="scope">
-                续费<span class="status-danger">{{scope.row.time}}天</span>
+                <div class="price" v-if="scope.row.discount > 0">
+                    <el-tag>{{ $TOOL.money(scope.row.discount) }}</el-tag>
+                    <div class="del">{{ $TOOL.money(scope.row.money) }}</div>
+                </div>
+                <div class="price" v-else>
+                    <el-tag>{{ $TOOL.money(scope.row.money) }}</el-tag>
+                </div>
             </template>
         </el-table-column>
-        <el-table-column label="套餐金额" prop="money">
+        <el-table-column label="额外加价" prop="money">
             <template #default="scope">
-                {{ scope.row.money }}元
+                {{ $TOOL.money(scope.row.extra_money) }}
             </template>
         </el-table-column>
-        <el-table-column label="支付状态" prop="certificate_id">
+        <el-table-column label="支付类型" prop="money">
             <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>
+                <el-tag>{{ payStatus[scope.row.status] }}</el-tag>
+            </template>
+        </el-table-column>
+        <el-table-column label="打印机" prop="money">
+            <template #default="scope">
+                {{ scope.row.print_name }}
+            </template>
+        </el-table-column>
+        <el-table-column label="取件方式" prop="money">
+            <template #default="scope">
+                {{ ostatus[scope.row.package] }}
+            </template>
+        </el-table-column>
+        <el-table-column label="取件号" prop="package_sn"></el-table-column>
+        <el-table-column label="失败原因" prop="money">
+            <template #default="scope">
+                {{ scope.row.reason?scope.row.reason:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="订单状态" prop="certificate_id">
+            <template #default="scope">
+                {{ status[scope.row.status] }}
             </template>
         </el-table-column>
         <el-table-column label="支付时间" prop="pay_at">
@@ -28,11 +54,28 @@
                 {{ scope.row.pay_at?scope.row.pay_at:'-' }}
             </template>
         </el-table-column>
+        <el-table-column label="打印时间" prop="pay_at">
+            <template #default="scope">
+                {{ scope.row.print_at?scope.row.print_at:'-' }}
+            </template>
+        </el-table-column>
         <el-table-column label="创建时间" prop="create_at">
             <template #default="scope">
                 {{ scope.row.create_at }}
             </template>
         </el-table-column>
+        <el-table-column label="操作" width="160" align="right" fixed="right">
+            <template #default="scope">
+                <el-button-group>
+                    <el-button text type="warning" size="small" @click="table_passwd(scope.row)">详情</el-button>
+                    <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
+                        <template #reference>
+                            <el-button text type="danger" size="small">退款</el-button>
+                        </template>
+                    </el-popconfirm>                    
+                </el-button-group>
+            </template>
+        </el-table-column>
     </scTable>
 </template>
 
@@ -46,14 +89,15 @@ export default {
             colorData:['','彩色','黑白'],
             duplexData:['','单面','双面'],
             list: {
-                apiObj: this.$API.mRenew.list
+                apiObj: this.$API.mOrder.list
             },
+            status: ['待支付','待打印', '打印失败', '已打印','申请退款','退款失败','已退款'],
+            ostatus: ['-','店内打印', '远程自取', '商家配送'],
+            payStatus:['-','微信','会员卡'],
             visible:false,
             dataSelect:[],
             dataSelectFull:[],
-            searchKey:{
-                type:this.type
-            }
+            searchKey:{}
         }
     },
     methods:{
@@ -83,4 +127,9 @@ export default {
         },
     }
 }
-</script>
+</script>
+
+<style>
+.price{display: flex;align-items: center;}
+.del{text-decoration: line-through;margin-left: 5px;color: #f00;}
+</style>

+ 21 - 5
src/views/merchant/order/index/index.vue

@@ -37,7 +37,6 @@
                 </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">
@@ -49,17 +48,34 @@
 
 <script>
 import search from './components/search';
-import optionBtn from './components/option';
 import tablePage from './components/table';
 export default {
     components: {
-        search,tablePage,optionBtn
+        search,tablePage
     },
-    data() {
+    data(){
         return {
-            
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
         }
     },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
 }
 </script>