shish 1 год назад
Родитель
Сommit
aa313381d2

+ 1 - 0
ghs/src/mock/userInfo.js

@@ -186,6 +186,7 @@ let menu = {
 		{id: '902',parentId: '9',name: '员工列表',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/staff/list',viewPath: 'views/staff/list.vue',keepAlive: 1},
 		{id: '903',parentId: '9',name: '角色列表',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/role/list',viewPath: 'views/staff/role-list.vue',keepAlive: 1},
 		{id: '904',	parentId: '9',name: '操作记录',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/operate/list',viewPath: 'views/staff/operate.vue',keepAlive: 1},
+		{id: '908',	parentId: '9',name: '配送业绩',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/staff/sendYj',viewPath: 'views/staff/sendYj.vue',keepAlive: 1},
 
 		{id: '10',parentId: null,name: '门店',type: 1,icon: 'iconguanggao',orderNum: 10,router: '/shop/list',viewPath: 'views/shop/list.vue',keepAlive: 1},
         {id: '1001',parentId: 10,name: '门店列表',type: 1,icon: 'iconguanggao',orderNum: 10,router: '/shop/list',viewPath: 'views/shop/list.vue',keepAlive: 1},

+ 7 - 0
ghs/src/service/stat/index.js

@@ -2,6 +2,13 @@ import { BaseService, Service } from '@/cool';
 @Service('stat')
 export class StatService extends BaseService {
 
+	sendYj(data) {
+		return this.request({
+			url: '/send',
+			params: data
+		});
+	}
+
 	getClassProfit(data) {
 		return this.request({
 			url: '/class-profit',

+ 148 - 0
ghs/src/views/staff/sendYj.vue

@@ -0,0 +1,148 @@
+<template>
+	<div class="shop-list">
+		<x-crud @load="onLoad">
+			<template #slot-date-select>
+                <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getDate" value-format="yyyy-MM-dd"
+                end-placeholder="结束日期" :picker-options="pickerOptions" size="mini"> </el-date-picker>
+			</template>
+
+			<template #slot-export-due>
+				<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportData()">导出数据</el-button>
+			</template>
+
+            <template #slot-total-amount>
+				<span style="font-size:15px;font-weight:bold;"></span>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+	data() {
+		return {
+			crud: null,
+            pickerOptions: {
+				shortcuts: [{
+					text: '最近一周',
+					onClick(picker) {
+					const end = new Date();
+					const start = new Date();
+					start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+					picker.$emit('pick', [start, end]);
+					}
+				}, {
+					text: '最近一个月',
+					onClick(picker) {
+					const end = new Date();
+					const start = new Date();
+					start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+					picker.$emit('pick', [start, end]);
+					}
+				}, {
+					text: '最近三个月',
+					onClick(picker) {
+					const end = new Date();
+					const start = new Date();
+					start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+					picker.$emit('pick', [start, end]);
+					}
+				}]
+            },
+            currentDateList:[],
+            startTime:'',
+            endTime:'',
+            searchTime:''
+		}
+	},
+	computed: {
+		...mapGetters(['shopInfo']),
+	},
+	methods: {
+		exportData(){
+			// this.$service.statCg.getProfit({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,export:1}).then(res => {
+			// 	if(res.file){
+			// 		window.location.href = res.file
+			// 	}
+			// })
+		},
+		onLoad({ ctx, app }) {
+                this.app = app;
+                ctx.service({
+                    page: () => {
+                        return this.$service.stat.sendYj({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then((res) => {
+							let list = [...res.list]
+                            return {
+                                list: list
+                            };
+                        });
+                    }
+                })
+				.set('table', {
+					columns: [
+						{
+							label: '姓名',
+							prop: 'staffName',
+							align: 'center',
+						},
+						{
+							label: '订单数',
+							prop: 'orderNum',
+							align: 'center',
+						},
+						{
+							label: '花材数',
+							prop: 'itemNum',
+							align: 'center',
+						},
+						{
+							label: '金额',
+							prop: 'amount',
+							align: 'center',
+						}
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 250,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: []
+					}
+				})
+				.set('layout', [
+					[   'slot-date-select',
+                        'slot-order-debt',
+						'slot-export-due',
+						'flex1'
+					],
+					[ 'data-table' ],
+                    ['slot-total-amount','flex1']
+				])
+				.done();
+			    app.refresh();
+		},
+        getDate(){
+            if(this.currentDateList){
+                this.searchTime = 'custom'
+                this.startTime = this.currentDateList[0]
+                this.endTime = this.currentDateList[1]
+            }else{
+                this.searchTime = ''
+                this.startTime = ''
+                this.endTime = ''
+            }
+            this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime});
+        }
+	},
+};
+</script>
+
+<style lang="stylus" scoped>
+.shop-list {
+  height: 100%;
+}
+</style>

+ 1 - 0
ghsApp/src/admin/billing/affirm.vue

@@ -456,6 +456,7 @@ export default {
       if(this.displayPackCost == true){
         finalPrice = Number(finalPrice) + Number(this.form.packCost)
       }
+      finalPrice = Number(finalPrice).toFixed(2)
       let currentPrice = parseFloat(finalPrice)
       this.modifyPrice = currentPrice 
       return currentPrice