lhl пре 11 месеци
родитељ
комит
8fc9102179

+ 24 - 0
src/api/finance.js

@@ -208,4 +208,28 @@ export function userMoneyExport (data) {
         method: 'get',
         params: data
     });
+}
+
+/**
+ * @description 订单汇总/导出
+ * @param {Number} param data {Number} 请求参数data
+ */
+export function orderExport (data) {
+    return request({
+        url: `finance/finance/SummaryAll`,
+        method: 'get',
+        params: data
+    });
+}
+
+/**
+ * @description 订单汇总/导出
+ * @param {Number} param data {Number} 请求参数data
+ */
+export function czExport (data) {
+    return request({
+        url: `finance/finance/Summaryrecharge`,
+        method: 'get',
+        params: data
+    });
 }

+ 314 - 0
src/pages/finance/all/cz.vue

@@ -0,0 +1,314 @@
+<template>
+	<!-- 财务-提现申请 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="card_pd">
+				<!-- 查询条件 -->
+				<Form ref="formValidate" inline :model="formValidate" :label-width="labelWidth"
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="时间选择:">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal"
+							format="yyyy/MM/dd HH:mm" type="datetimerange" placement="bottom-end" placeholder="自定义时间"
+							class="input-width" :options="options"></DatePicker>
+					</FormItem>
+					<FormItem label="门店:">
+						<Select v-model="formValidate.store_id" clearable filterable @on-change="userSearchs"
+							class="input-add">
+							<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem>
+						<!-- <Button type="primary" @click="selChange" class="btn-add">查询</Button> -->
+						<Button @click="exportExcel">导出</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<!-- <cards-data :cardLists="cardLists" v-if="extractStatistics"></cards-data> -->
+		<Card :bordered="false" dis-hover>
+			<!-- 表格 -->
+			<Table ref="table" :columns="formValidate.store_id == -1 ?columns: columnss" :data="tabList" class="ivu-mt" :loading="loading" no-data-text="暂无数据"
+				no-filtered-data-text="暂无筛选结果">
+				<template slot-scope="{ row, index }" slot="name">
+					<span> {{ row.name || '平台' }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="huifu">
+					<span> {{ row.huifu_sum?  (row.huifu_sum*0.003).toFixed(2) : '' }}</span>
+				</template>
+			</Table>
+		</Card>
+	</div>
+</template>
+<script>
+	import exportExcel from "@/utils/newToExcel.js";
+	import cardsData from "@/components/cards/cards";
+	import searchFrom from "@/components/publicSearchFrom";
+	import {
+		mapState
+	} from "vuex";
+	import {
+		getuserMoneyList,
+		cashEditApi,
+		refuseApi,
+		userMoneyExport,
+		czExport
+	} from "@/api/finance";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import editFrom from "@/components/from/from";
+	import timeOptions from "@/utils/timeOptions";
+	import {
+		staffListInfo
+	} from "@/api/store";
+	export default {
+		name: "cashApply",
+		components: {
+			cardsData,
+			searchFrom,
+			editFrom
+		},
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd hh:mm");
+				}
+			},
+		},
+		data() {
+			return {
+				modal_loading: false,
+				options: timeOptions,
+				fail_msg: {
+					message: "输入信息不完整或有误!",
+				},
+				modals: false,
+				total: 0,
+				cardLists: [],
+				loading: false,
+				columns: [{
+						title: "时间",
+						key: "day",
+						width: 180,
+					},
+					{
+						title: "充值总金额",
+						key: "rech_sum",
+						minWidth: 180,
+					},
+					{
+						title: "现金充值",
+						key: "cash_sum",
+						minWidth: 90,
+					},
+					{
+						title: "汇付充值",
+						key: "huifu_sum",
+						minWidth: 100,
+					},
+					{
+						title: "汇付手续费",
+						slot: "huifu",
+						minWidth: 100,
+					},
+
+				],
+				columnss: [{
+						title: "时间",
+						key: "day",
+						width: 180,
+					},
+					{
+						title: '门店',
+						slot: "name",
+						width: 180,
+					},
+					{
+						title: "充值总金额",
+						key: "rech_sum",
+						minWidth: 180,
+					},
+					{
+						title: "现金充值",
+						key: "cash_sum",
+						minWidth: 90,
+					},
+					{
+						title: "汇付充值",
+						key: "huifu_sum",
+						minWidth: 100,
+					},
+					{
+						title: "汇付手续费",
+						slot: "huifu",
+						minWidth: 100,
+					},
+				
+				],
+				tabList: [],
+				formValidate: {
+					data: "",
+					store_id: -1
+				},
+				extractStatistics: {},
+				timeVal: [],
+				FromData: null,
+				extractId: 0,
+				staffData: [],
+			};
+		},
+		watch: {
+			$route() {
+				if (
+					this.$route.fullPath === "/finance/user_extract/index?status=0"
+				) {
+					this.getPath();
+				}
+			},
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		mounted() {
+			this.getList();
+			this.staffList()
+		},
+		methods: {
+			userSearchs(e) {
+				this.getList();
+			},
+			staffList() {
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data;
+						this.staffData = this.staffData.concat([{
+							id: 0,
+							name: '门店汇总'
+						}])
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			exportExcel() {
+				czExport({
+					data: this.formValidate.data,
+					store_id: this.formValidate.store_id,
+					excal: 1
+				})
+					.then((res) => {
+						let data = res.data
+						exportExcel(data.header, data.filekey, data.fileName, data.export);
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			getPath() {
+				// this.formValidate.page = 1;
+				this.formValidate.status = parseInt(this.$route.query.status);
+				this.getList();
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.formValidate.data = this.timeVal[0] ? this.timeVal.join("-") : "";
+				// this.formValidate.page = 1;
+				this.getList();
+			},
+			// 选择时间
+			selectChange(tab) {
+				// this.formValidate.page = 1;
+				this.formValidate.data = tab;
+				this.timeVal = [];
+				this.getList();
+			},
+			// 选择
+			selChange() {
+				// this.formValidate.page = 1;
+				this.getList();
+			},
+			reset() {
+				this.formValidate = {
+					status: "",
+					extract_type: "",
+					nireid: "",
+					data: "",
+					page: 1,
+					limit: 20
+				};
+				this.timeVal = [];
+				// this.$refs.formValidate.resetFields()
+				this.getList();
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				czExport(this.formValidate)
+					.then(async (res) => {
+						let data = res.data;
+						this.tabList = data;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+		},
+	};
+</script>
+<style scoped lang="stylus">
+	.btn-add {
+		margin: 0 14px 0 -90px;
+	}
+
+	.ivu-mt .type .item {
+		margin: 3px 0;
+	}
+
+	.card_pd {
+		padding: 20px 20px 0;
+	}
+
+	.Refresh {
+		font-size: 12px;
+		color: #1890FF;
+		cursor: pointer;
+	}
+
+	.status>>>.item~.item {
+		margin-left: 6px;
+	}
+
+	.status>>>.statusVal {
+		margin-bottom: 7px;
+	}
+
+	/* .ivu-mt >>> .ivu-table-header */
+	/* border-top:1px dashed #ddd!important */
+	.type {
+		padding: 3px 0;
+		box-sizing: border-box;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 364 - 0
src/pages/finance/all/order.vue

@@ -0,0 +1,364 @@
+<template>
+	<!-- 财务-提现申请 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="card_pd">
+				<!-- 查询条件 -->
+				<Form ref="formValidate" inline :model="formValidate" :label-width="labelWidth"
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="时间选择:">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal"
+							format="yyyy/MM/dd HH:mm" type="datetimerange" placement="bottom-end" placeholder="自定义时间"
+							class="input-width" :options="options"></DatePicker>
+					</FormItem>
+					<FormItem label="门店:">
+						<Select v-model="formValidate.store_id" clearable filterable @on-change="userSearchs"
+							class="input-add">
+							<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem>
+						<!-- <Button type="primary" @click="selChange" class="btn-add">查询</Button> -->
+						<Button @click="exportExcel">导出</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<!-- <cards-data :cardLists="cardLists" v-if="extractStatistics"></cards-data> -->
+		<Card :bordered="false" dis-hover>
+			<!-- 表格 -->
+			<Table ref="table" :columns="formValidate.store_id == -2? columns: columnss" :data="tabList" class="ivu-mt" :loading="loading" no-data-text="暂无数据"
+				no-filtered-data-text="暂无筛选结果">
+				<template slot-scope="{ row, index }" slot="yue">
+					<span> {{ row.yue || 0 }}</span>
+				</template>
+			</Table>
+		</Card>
+
+		<!-- 编辑表单-->
+		<edit-from ref="edits" :FromData="FromData" @submitFail="submitFail"></edit-from>
+		<!-- 拒绝通过-->
+		<Modal v-model="modals" scrollable closable title="未通过原因" :mask-closable="false">
+			<Input v-model="fail_msg.message" type="textarea" :rows="4" placeholder="请输入未通过原因" />
+			<div slot="footer">
+				<Button type="primary" size="large" long :loading="modal_loading" @click="oks">确定</Button>
+			</div>
+		</Modal>
+	</div>
+</template>
+<script>
+	import exportExcel from "@/utils/newToExcel.js";
+	import cardsData from "@/components/cards/cards";
+	import searchFrom from "@/components/publicSearchFrom";
+	import {
+		mapState
+	} from "vuex";
+	import {
+		getuserMoneyList,
+		cashEditApi,
+		refuseApi,
+		userMoneyExport,
+		orderExport
+	} from "@/api/finance";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import editFrom from "@/components/from/from";
+	import timeOptions from "@/utils/timeOptions";
+	import {
+		staffListInfo
+	} from "@/api/store";
+	export default {
+		name: "cashApply",
+		components: {
+			cardsData,
+			searchFrom,
+			editFrom
+		},
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd hh:mm");
+				}
+			},
+		},
+		data() {
+			return {
+				modal_loading: false,
+				options: timeOptions,
+				fail_msg: {
+					message: "输入信息不完整或有误!",
+				},
+				modals: false,
+				total: 0,
+				cardLists: [],
+				loading: false,
+				columns: [{
+						title: "时间",
+						key: "day",
+						width: 180,
+					},
+					{
+						title: "订单总金额",
+						key: "sum_order",
+						minWidth: 90,
+					},
+					{
+						title: "现金支付",
+						key: "cash",
+						minWidth: 180,
+					},
+					{
+						title: "余额支付",
+						slot: "yue",
+						minWidth: 90,
+					},
+					{
+						title: "汇付支付",
+						key: "huifu",
+						minWidth: 100,
+					},
+					{
+						title: "汇付手续费",
+						key: "huifu_fee",
+						minWidth: 150,
+					},
+					{
+						title: "趣豆使用",
+						key: "use_qudou",
+						minWidth: 150,
+					},
+					{
+						title: "趣豆抵扣",
+						key: "use_pay_price",
+						minWidth: 150,
+					},
+					// {
+					// 	title: "添加时间",
+					// 	key: "add_time",
+					// 	minWidth: 100,
+					// },
+
+				],
+				columnss: [{
+						title: "时间",
+						key: "day",
+						width: 180,
+					},
+					{
+						title: "来源",
+						key: "name",
+						width: 180,
+					},
+					{
+						title: "订单总金额",
+						key: "sum_order",
+						minWidth: 90,
+					},
+					{
+						title: "现金支付",
+						key: "cash",
+						minWidth: 180,
+					},
+					{
+						title: "余额支付",
+						slot: "yue",
+						minWidth: 90,
+					},
+					{
+						title: "汇付支付",
+						key: "huifu",
+						minWidth: 100,
+					},
+					{
+						title: "汇付手续费",
+						key: "huifu_fee",
+						minWidth: 150,
+					},
+					{
+						title: "趣豆使用",
+						key: "use_qudou",
+						minWidth: 150,
+					},
+					{
+						title: "趣豆抵扣",
+						key: "use_pay_price",
+						minWidth: 150,
+					},
+					// {
+					// 	title: "添加时间",
+					// 	key: "add_time",
+					// 	minWidth: 100,
+					// },
+				
+				],
+				tabList: [],
+				formValidate: {
+					data: "",
+					store_id: -2
+				},
+				extractStatistics: {},
+				timeVal: [],
+				FromData: null,
+				extractId: 0,
+				staffData: [],
+			};
+		},
+		watch: {
+			$route() {
+				if (
+					this.$route.fullPath === "/finance/user_extract/index?status=0"
+				) {
+					this.getPath();
+				}
+			},
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		mounted() {
+			this.getList();
+			this.staffList()
+		},
+		methods: {
+			userSearchs(e) {
+				this.getList();
+			},
+			staffList() {
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data;
+						this.staffData = this.staffData.concat([{
+							id: 0,
+							name: '平台汇总'
+						},{
+							id: -1,
+							name: '门店汇总'
+						}])
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			exportExcel() {
+				orderExport({
+					data: this.formValidate.data,
+					store_id: this.formValidate.store_id,
+					excal: 1
+				})
+					.then((res) => {
+						let data = res.data
+						exportExcel(data.header, data.filekey, data.fileName, data.export);
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			getPath() {
+				// this.formValidate.page = 1;
+				this.formValidate.status = parseInt(this.$route.query.status);
+				this.getList();
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.formValidate.data = this.timeVal[0] ? this.timeVal.join("-") : "";
+				// this.formValidate.page = 1;
+				this.getList();
+			},
+			// 选择时间
+			selectChange(tab) {
+				// this.formValidate.page = 1;
+				this.formValidate.data = tab;
+				this.timeVal = [];
+				this.getList();
+			},
+			// 选择
+			selChange() {
+				// this.formValidate.page = 1;
+				this.getList();
+			},
+			reset() {
+				this.formValidate = {
+					status: "",
+					extract_type: "",
+					nireid: "",
+					data: "",
+					page: 1,
+					limit: 20
+				};
+				this.timeVal = [];
+				// this.$refs.formValidate.resetFields()
+				this.getList();
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				orderExport(this.formValidate)
+					.then(async (res) => {
+						let data = res.data;
+						this.tabList = data;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+		},
+	};
+</script>
+<style scoped lang="stylus">
+	.btn-add {
+		margin: 0 14px 0 -90px;
+	}
+
+	.ivu-mt .type .item {
+		margin: 3px 0;
+	}
+
+	.card_pd {
+		padding: 20px 20px 0;
+	}
+
+	.Refresh {
+		font-size: 12px;
+		color: #1890FF;
+		cursor: pointer;
+	}
+
+	.status>>>.item~.item {
+		margin-left: 6px;
+	}
+
+	.status>>>.statusVal {
+		margin-bottom: 7px;
+	}
+
+	/* .ivu-mt >>> .ivu-table-header */
+	/* border-top:1px dashed #ddd!important */
+	.type {
+		padding: 3px 0;
+		box-sizing: border-box;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 3 - 1
src/pages/finance/yue/index.vue

@@ -338,7 +338,9 @@
 		},
 		methods: {
 			exportExcel() {
-				userMoneyExport()
+				userMoneyExport({
+					data: this.formValidate.data
+				})
 					.then((res) => {
 						let data = res.data
 						exportExcel(data.header, data.filekey, data.fileName, data.export);

+ 18 - 14
src/pages/order/orderList/components/tableList.vue

@@ -597,21 +597,25 @@
 				'getSupplier_id',
 			]),
 			qudou(row) {
-				let delfromData = {
-					title: '退还趣豆',
-					url: `/qudou_ref/${row.id}`,
-					method: 'post',
-					ids: idss,
+				try{
+					let delfromData = {
+						title: '退还趣豆',
+						url: `order/qudou_ref/${row.id}`,
+						method: 'post',
+					}
+					this.$modalSure(delfromData)
+						.then((res) => {
+							this.$Message.success(res.msg)
+							this.checkUidList = []
+							this.getList()
+						})
+						.catch((res) => {
+							this.$Message.error(res.msg)
+						})
+				}catch(err) {
+					console.log(err)
 				}
-				this.$modalSure(delfromData)
-					.then((res) => {
-						this.$Message.success(res.msg)
-						this.checkUidList = []
-						this.getList()
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg)
-					})
+				
 			},
 			visibleChange(visible) {
 				this.is_split_order = 0;

+ 18 - 0
src/router/modules/finance.js

@@ -67,6 +67,24 @@ export default {
 		        title: '余额记录'
 		    },
 		    component: () => import('@/pages/finance/yue/index')
+		},
+		{
+		    path: 'order',
+		    name: `${pre}order`,
+		    meta: {
+		        auth: ['admin-finance-order'],
+		        title: '余额记录'
+		    },
+		    component: () => import('@/pages/finance/all/order')
+		},
+		{
+		    path: 'cz',
+		    name: `${pre}cz`,
+		    meta: {
+		        auth: ['admin-finance-cz'],
+		        title: '余额记录'
+		    },
+		    component: () => import('@/pages/finance/all/cz')
 		}
     ]
 };