Browse Source

交易确认,进口确认,互助委托添加按日期范围刷选

李书文 1 year ago
parent
commit
89edf66737

+ 1 - 1
App.vue

@@ -36,7 +36,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4191999_e5zep4g7w2a.ttf?t=1693296694547') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4191999_7iv6g88ty2h.ttf?t=1693811980958') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 1 - 1
common/style.scss

@@ -833,4 +833,4 @@
 		right: 11px;
 		line-height: 21px;
 	}
-}
+}

+ 5 - 0
common/util.js

@@ -185,6 +185,11 @@ const getDate = (obj = 'day') => {
 	if (obj == 'day') {
 		return `${year}-${month}-${day}`;
 	}
+	if (obj == 'lm') {
+		month = date.getMonth();
+		month = month > 9 ? month : '0' + month;
+		return `${year}-${month}-${day}`;
+	}
 	if (obj == 'time') {
 		return `${year}-${month}-${day}` + ' ' + Hours + ':' + Minutes;
 	}

+ 91 - 0
components/mcalendar/mcalendar.vue

@@ -0,0 +1,91 @@
+<template>
+	<view>
+		<view class="mcalendar">
+			<view class="con">
+				<text class="icon">&#xe621;</text>
+				<input placeholder="选择日期范围" :value="param.data" class="date" :disabled="true" @click="show = true" />
+				<text class="icon del" @click="clear()" v-if="param.data">&#xe61a;</text>
+				<text class="label" @click="today()">今天</text>
+			</view>
+		</view>
+		<u-calendar :show="show" mode="range" :minDate="minDate" @confirm="confirm" @close="show = false" :closeOnClickOverlay="true"></u-calendar>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'mcalendar',
+	props: {
+		value: {
+			type: Boolean,
+			default: false
+		}
+	},
+	data() {
+		return {
+			show: false,
+			minDate: this.util.getDate('lm'),
+			param: {}
+		};
+	},
+	watch: {
+		value(newValue) {
+			this.show = newValue;
+		}
+	},
+	methods: {
+		confirm(e) {
+			this.$emit('input', false);
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.param.data = e[0] + ' - ' + e[1];
+			this.show = false;
+			this.$emit('confirm', e);
+		},
+		today() {
+			this.param.dateBegin = this.util.getDate('day');
+			this.param.dateEnd = this.util.getDate('day');
+			this.param.data = this.util.getDate('day') + ' - ' + this.util.getDate('day');
+			this.$forceUpdate();
+			this.$emit('today', [this.util.getDate('day'), this.util.getDate('day')]);
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.param.data = '';
+			this.$forceUpdate();
+			this.$emit('clear');
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.mcalendar {
+	padding: 10px 10px 0px 10px;
+	.con {
+		padding: 10px 15px 10px 15px;
+		background-color: white;
+		border-radius: 20px;
+		color: $font-c;
+		overflow: hidden;
+		.icon {
+			padding-right: 10px;
+			float: left;
+			margin-top: 2px;
+		}
+		.del {
+			padding-left: 9px;
+		}
+		.date {
+			float: left;
+			width: 60%;
+		}
+		.label {
+			float: right;
+			color: $main-color;
+			padding-right: 5px;
+		}
+	}
+}
+</style>

+ 18 - 0
pages/market/one/confirm/apply.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<mcalendar v-model="show" @confirm="confirm" @clear="clear" @today="today"></mcalendar>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">{{ item.enterpriseName }}
@@ -40,6 +41,7 @@
 export default {
 	data() {
 		return {
+			show: false,
 			param: {
 				pageNo: 1,
 				pageSize: 10,
@@ -84,6 +86,22 @@ export default {
 		detail(item) {
 			uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
 		},
+		confirm(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.show = false;
+			this.refresh();
+		},
+		today(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.refresh();
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.refresh();
+		},
 		// 刷新数据
 		refresh() {
 			this.loadMore = true;

+ 18 - 0
pages/market/one/confirm/cooperation.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<mcalendar v-model="show" @confirm="confirm" @clear="clear" @today="today"></mcalendar>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">
@@ -41,6 +42,7 @@
 export default {
 	data() {
 		return {
+			show: false,
 			param: {
 				pageNo: 1,
 				pageSize: 10,
@@ -86,6 +88,22 @@ export default {
 		detail(item) {
 			uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
 		},
+		confirm(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.show = false;
+			this.refresh();
+		},
+		today(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.refresh();
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.refresh();
+		},
 		// 刷新数据
 		refresh() {
 			this.loadMore = true;

+ 24 - 6
pages/market/one/confirm/people.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<mcalendar v-model="show" @confirm="confirm" @clear="clear" @today="today"></mcalendar>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">{{ item.enterpriseName }}
@@ -26,7 +27,7 @@
 				<view class="op">
 					<view class="date">{{ item.createTime }}</view>
 					<template v-if="item.peopleConfirmStatus == 0">
-						<view class="an" style="color: #f44336"  @click.stop="confirmOrder(item.id)">边民确认</view>
+						<view class="an" style="color: #f44336" @click.stop="confirmOrder(item.id)">边民确认</view>
 					</template>
 				</view>
 			</view>
@@ -40,17 +41,18 @@
 export default {
 	data() {
 		return {
+			show: false,
 			param: {
 				pageNo: 1,
 				pageSize: 10,
 				//peopleConfirmStatus: 0, //边民确认状态
-				cooperEntrustStatus: 0,//互助委托申报确认状态
+				cooperEntrustStatus: 0, //互助委托申报确认状态
 				applyConfirmStatus: 0, //进口申报确认状态
 				finishStatus: 0, //订单完成状态
 				resaleStatus: 0 //订单转售状态
 			},
 			list: [],
-			loadMore: true,
+			loadMore: true
 		};
 	},
 	onLoad() {
@@ -81,8 +83,24 @@ export default {
 				}
 			});
 		},
+		confirm(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.show = false;
+			this.refresh();
+		},
+		today(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.refresh();
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.refresh();
+		},
 		detail(item) {
-			uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
+			uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
 		},
 		// 刷新数据
 		refresh() {
@@ -90,7 +108,7 @@ export default {
 			this.param.pageNo = 1;
 			this.list = [];
 			this.getData();
-		},
+		}
 	},
 	//下拉刷新
 	onPullDownRefresh() {
@@ -113,7 +131,7 @@ export default {
 page {
 	background-color: $pg;
 }
-.state{
+.state {
 	margin-right: -70px;
 }
 </style>