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

+ 3 - 1
ghs/src/cool/request/index.js

@@ -74,6 +74,7 @@ import refund from '@/service/refund/index';
 import costChange from '@/service/cost-change/index';
 import liveOrder from '@/service/live-order/index';
 import liveOrderCustom from '@/service/live-order-custom/index';
+import checkout from '@/service/check-out/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
@@ -153,7 +154,8 @@ export function SET_SERVICE({ store }) {
 		ghsItemClass,
 		statBook,
 		ghs,
-		stat
+		stat,
+		checkout
 	};
 
 	Vue.prototype.$service = modules;

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

@@ -153,6 +153,7 @@ let menu = {
 		{id: '225',parentId: 2,name: '余额变动',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/custom-balance-list',viewPath: 'views/member/custom-balance-list.vue',keepAlive: 1},
 		{id: '228',parentId: 2,name: '客户业绩',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/yj',viewPath: 'views/custom/yj.vue',keepAlive: 1},
 		{id: '226',parentId: 2,name: '应收统计',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/account',viewPath: 'views/custom/account.vue',keepAlive: 1},
+		{id: '230',parentId: 2,name: '结账记录',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/custom-clear-list',viewPath: 'views/member/custom-clear-list.vue',keepAlive: 1},
 
 		{id: '3',parentId: null,name: '订单',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
         {id: '301',parentId: 3,name: '订单列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},

+ 6 - 0
ghs/src/service/check-out/index.js

@@ -0,0 +1,6 @@
+import { BaseService, Service } from '@/cool';
+@Service('check-out')
+export class CheckOutService extends BaseService {
+
+}
+export default new CheckOutService();

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

@@ -9,5 +9,12 @@ export class ClearService extends BaseService {
 		});
 	}
 
+	customList(data) {
+		return this.request({
+			url: '/custom-list',
+			params: data
+		});
+	}
+
 }
 export default new ClearService();

+ 301 - 0
ghs/src/views/member/custom-clear-list.vue

@@ -0,0 +1,301 @@
+<template>
+	<div class="app-list-content">
+		<x-crud class="liu-crud-wrap" @load="onLoad">
+
+			<template #slot-tabs>
+				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex">
+					<el-tab-pane v-for="(item, index) in tabsData" :key="index" :label="`${item.text}`" :name="item.key" ></el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<template #table-column-amount="{scope}">
+				<span> {{ scope.row.io == 1 ? '+' : '-' }} {{ scope.row.amount }} </span>
+			</template>
+
+			<template #table-column-payTime="{scope}">
+				<span v-if="scope.row.payTime!='0000-00-00 00:00:00' && scope.row.payTime.substr(5,5)!=scope.row.addTime.substr(5,5)">
+					{{ scope.row.payTime }}
+				</span>
+				<span v-else>-</span>
+			</template>
+
+			<template #table-column-capitalType="{scope}">
+				<span v-if="scope.row.capitalType == 20">结账</span>
+				<span v-else-if="scope.row.capitalType == 10">下单</span>
+				<span v-else-if="scope.row.capitalType == 40">售后</span>
+				<span v-else>其它</span>
+			</template>
+
+			<template #slot-search-list="{scope}">
+
+				<el-select @change="getCurrentCp" v-model="currentCustomName" filterable remote reserve-keyword placeholder="搜索客户" clearable 
+				:remote-method="searchCpInfo" :loading="loading" style="width:200px;margin-right:10px;" size="middle">
+    				<el-option v-for="item in customInfoList" :key="item.id" :label="`${item.name}(${item.id})`" :value="item.id"> </el-option>
+  				</el-select>
+
+				<span style="margin-left:9px;font-size:28px;">结账时间:</span>
+				<el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
+				class="custom-date-picker" end-placeholder="结束日期" :picker-options="pickerOptions" size="middle" style="margin-right:8px;">
+				</el-date-picker>
+
+				<el-button type="primary" size="middle" style="margin-left:10px;" @click="exportData()">导出数据</el-button>
+
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters, mapActions } from 'vuex';
+export default {
+	components: {
+	},
+	data() {
+		return {
+			app: null,
+			tabIndex: '0',
+			tabsData: [
+				{
+					text: '列表',
+					key: '0',
+					val: 0
+				},
+			],
+			customInfoList: [],
+			loading: false,
+			currentCustomName:'',
+			customId:0,
+			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]);
+                }
+            }]
+      		},
+			startTime:'',
+			endTime:'',
+			searchTime:'',
+			currentDateList:[],
+		};
+	},
+	methods: {
+		onLoad({ ctx, app }) {
+			this.app = app;
+			if (this.$route.query.customId) {
+				this.customId = this.$route.query.customId;
+				this.currentCustomName = this.$route.query.customName ? this.$route.query.customName : ''
+			}
+			ctx.service(this.$service.checkout)
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center',
+							width: 100
+						},
+						{
+							prop: 'addTime',
+							label: '创建时间',
+							align: 'center',
+							width: 160
+						},
+						{
+							prop: 'payTime',
+							label: '结账时间',
+							align: 'center',
+							width: 160
+						},
+						{
+							prop: 'orderSn',
+							label: '编号',
+							align: 'center',
+							width: 140
+						},
+						{
+							prop: 'customId',
+							label: '客户ID',
+							align: 'center',
+							width: 100
+						},
+						{
+							prop: 'customName',
+							label: '客户名称',
+							align: 'center',
+							width: 150
+						},
+						{
+							prop: 'customMobile',
+							label: '手机号',
+							align: 'center',
+							width: 120
+						},
+						{
+							prop: 'onlinePay',
+							label: '线上付款',
+							align: 'center',
+							width: 90
+						},
+						{
+							prop: 'payWay',
+							label: '支付方式',
+							align: 'center',
+							width: 90
+						},
+						{
+							prop: 'status',
+							label: '状态',
+							align: 'center',
+							width: 90
+						},
+						{
+							prop: 'num',
+							label: '订单数',
+							align: 'center',
+							width: 90
+						},
+						{
+							prop: 'prePrice',
+							label: '总金额',
+							align: 'center',
+							width: 120
+						},
+						{
+							prop: 'actPrice',
+							label: '实付金额',
+							align: 'center',
+							width: 120
+						}
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 120,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: ['slot-column-option']
+					}
+				})
+				.set('dict', {
+					search: {
+						keyWord: 'name'
+					}
+				})
+				.set('search', {
+					key: { placeholder: '...' }
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['slot-search-list'],
+					['data-table'],
+					['flex1', 'pagination']
+				])
+				.done();
+				this.refreshData()
+		},
+		getCurrentCp(e){
+			this.customId = e
+			this.refreshData()
+		},
+		refreshData(){
+      		this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,customId:this.customId})
+    	},
+		exportData(){
+			this.$service.customDebtChange.getList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,customId:this.customId,pageSize:9999999,export:1}).then(res => {
+				if(res.file){
+					window.location.href = res.file
+				}
+			})
+		},
+		searchCpInfo(query) {
+			let that = this
+			if (query !== '') {
+				this.loading = true;
+				this.$service.custom.list({name:query,type:0}).then(res=>{
+					that.loading = false
+					that.customInfoList = res.list	
+				})
+			} else {
+				this.customInfoList = []
+			}
+		},
+		getSearchDate(){
+			if (this.$util.isEmpty(this.currentDateList)) {
+				this.searchTime = ''
+				this.startTime = ''
+				this.endTime = ''
+			}else{
+				this.searchTime = 'custom'
+				this.startTime = this.currentDateList[0]
+				this.endTime = this.currentDateList[1]
+			}
+			this.refreshData()
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.user-name-warp {
+	display: flex;
+	align-items: center;
+	span {
+		margin-left: 6px;
+	}
+}
+.recharge-modal-content {
+	@include disFlex(center, space-around);
+	.card-name {
+		width: 200px;
+		height: 100%;
+		border-right: 1px solid $borderColor;
+	}
+}
+
+.store-icon {
+	i {
+		font-size: 18px;
+	}
+
+	.el-icon-check {
+		color: #fee470;
+	}
+
+	.el-icon-close {
+		color: #999;
+	}
+}
+.accounts-list{
+    width: 80%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 0 auto;
+    padding-bottom: 20px;
+    .accounts-center{
+      width: 80%;
+    }
+  }
+</style>