浏览代码

Merge branch 'test' of git.echepei.com:sailun/sailun-tbr-web into test

qukaidi 4 年之前
父节点
当前提交
bced671b2c

+ 77 - 74
pages/me/Settlement-center/index.vue

@@ -5,39 +5,28 @@
 			<view class="content" v-for="(item,index) in datalist" :key="index">
 				<view class="content-one">
 				</view>
-				<text class="content-two">{{item.agentName}}</text>
-				<text class="content-three" @click="button(index)" :key='index'>核销返利</text>
+				<view style="display: flex;justify-content: space-between;">
+					<text class="content-two">{{item.agentName}}</text>
+					<text class="content-three" @click="button(index)">核销返利</text>
+				</view>
+				
 				<view class="content-four">
 					<text>品牌</text>
 					<text>奖励</text>
 					<text @click="checkedAll(index,item)" :key='index'>全选</text>
 				</view>
-				<checkbox-group @change="checkboxChange($event,index)">
+				<checkbox-group @change="checkboxChange($event,index,item.storegentBrandList)">
 				<view class="content-five" v-for="(item,brandIndex) in item.storegentBrandList" :key="brandIndex">
 					<view class="content-five-img">
 						<u-image width="100%" height="65%" scaleType="matrix" :src="item.logoUrl"></u-image>
-						<!-- {{ item.brandCode }} -->
 					</view>
 					<view class="content-five-view">
 						{{item.usableMoney}}元
 					</view>
-					<view>
-						<!-- <u-checkbox-group @change="checkboxGroupChange" :disabled="item.usableMoney==0?true:false">
-							<u-checkbox @change="checkboxChange(storegentBrandList[index],checkboxList[index],index)" v-model="checkboxList[index]" :key="index"></u-checkbox>
-						</u-checkbox-group> -->
-							<view class="" v-show="false">
-								{{index}}
-								{{ '^^^^' + checkboxList[index] }}
-								{{ '&&&' + isCheckedAll }}
-							</view>
-							
+					<view>						
 							<label>
-								<checkbox :value="JSON.stringify(item)" :checked="checkboxList[index]" :disabled="item.usableMoney==0" color="#FFCC33" style="transform:scale(0.7)"/>
+								<checkbox v-model="JSON.stringify(item)" :value="JSON.stringify(item)" :checked="checkboxList[index]" :disabled="item.usableMoney==0" v-if="item.usableMoney!=0" color="#FFCC33" style="transform:scale(0.7)"/>
 							</label>
-							<!-- <label>
-								<checkbox value="cb" color="#FFCC33" style="transform:scale(0.7)" />未选中
-							</label> -->
-					
 					</view>
 
 				</view>
@@ -71,12 +60,19 @@
 				list: [{}],
 				checkboxList: [],
 				idList:[],
-				isCheckedAll:false
+				listaa:['a','b','c'],
+				checkedAllList:[],
+				// isCheckedAll:false
 			};
 		},
 		created() {
 			this.getData()
 		},
+		computed:{
+			ckeck(){
+				return this.checkboxList
+			}
+		},
 		methods: {
 			// 获取结算中心数据
 			getData() {
@@ -95,7 +91,7 @@
 						// this.checkboxList.length = this.datalist.length
 						for(var i=0;i<this.datalist.length;i++){
 							this.Arry[i] = []
-							this.checkboxList.push(false)
+							this.checkboxList[i] = false
 						}
 						console.log(this.checkboxList)
 						console.log(res.data.data[0].storegentBrandList)
@@ -130,19 +126,16 @@
 			},
 
 			checkboxChange1() {
-				console.log("###")
+			
 			},
 			// 选中某个复选框时,由checkbox时触发
 			// ,bollean,index
-			checkboxChange(e,index){
+			checkboxChange(e,index,dataArr){
 				console.log(e)
 				let newArr = []
 				// this.Arry.length = this.datalist.length
 				// this.Arry[index] = []
 				console.log(this.Arry)
-				// 调用数组的每个元素并将元素传递给回调函数
-				// item回调函数
-				// JSON.parse()将回调函数字符串转为对象取出
 				e.detail.value.forEach((item) =>{
 					var obj = {
 						"storeId":this.$store.state.storeInfo.storeId,
@@ -156,77 +149,88 @@
 					newArr.push(obj)
 				})
 				this.Arry[index] = newArr
-				console.log(this.Arry[index])
-				console.log('%%%%%%',this.Arry)
+				if(this.Arry[index].length == dataArr.filter((item)=>{
+					return item.usableMoney != 0
+				}).length ){
+					this.$set(this.checkboxList, index, true);
+					}else{
+					this.$set(this.checkboxList, index, false);
+					}
 			},
-			// 核销返利
-			button(index) {
-				console.log(index)
-				console.log(this.Arry[index])
-				request({
-						url: '/myapp/storeCancel',
-						method: 'post',
-						data: this.Arry[index]
-					}).then(res => {
-						console.log(res)
-						if(res.data.msg=="success") {
-							uni.showToast({
-							    title: '核销返利成功',
-							    duration: 2000
-							});
+				// 核销返利
+				button(index) {
+					console.log(index)
+					console.log(this.Arry[index])
+					request({
+							url: '/myapp/storeCancel',
+							method: 'post',
+							data: this.Arry[index]
+						}).then(res => {
+							console.log(res)
+							if(res.data.msg=="success") {
+								uni.showToast({
+								    title: '核销返利成功',
+								    duration: 2000
+								});
+								this.getData()
+								
+							}else {
+								uni.showToast({
+								    title: '核销返利失败',
+									icon: false,
+								    duration: 2000
+								});
+							}
 							
-						}else {
-							uni.showToast({
-							    title: '核销返利失败',
-								icon: false,
-							    duration: 2000
-							});
-						}
-						
-					}).catch(err => {
-						console.log(err)
-					})
-					.finally(() => {
-						setTimeout(() => {
-							uni.hideLoading();
-							this.loading = false;
-						}, 1000)
-				
-					})
-				
+						}).catch(err => {
+							console.log(err)
+						})
+						.finally(() => {
+							setTimeout(() => {
+								uni.hideLoading();
+								this.loading = false;
+							}, 1000)
+					
+						})
 			},
 			// 选中任一checkbox时,由checkbox-group触发
 			checkboxGroupChange(e) {
 				// console.log(e);
+				// console.log("###");
 			},
 			// 全选
 			checkedAll(index,e) {
 				console.log(e)
-				this.isCheckedAll = !this.isCheckedAll
+				// this.isCheckedAll = !this.isCheckedAll
+				// this.Arry[index] = []
 				console.log(index,e)
 				let newArr=[]
-				console.log(this.checkboxList)
+				// this.isCheckedAll = !this.isCheckedAll
 				if(this.Arry[index].length == e.storegentBrandList.filter((item)=>{
-					return item.usableMoney !=0
+					return item.usableMoney != 0
 				}).length ){
-					this.checkboxList[index] = false
+					this.$set(this.checkboxList, index, false);
 					this.Arry[index] = []
 				}else{
-					this.checkboxList[index] = true
+					this.$set(this.checkboxList, index, true);
 					for(var i=0;i<e.storegentBrandList.length;i++){
 						if( e.storegentBrandList[i].usableMoney !=0){
 							var obj = {
-								"storeId":this.$store.state.storeInfo.storeId,
+								"storeId": "3000",
 								"amount": e.storegentBrandList[i].usableMoney,
 								"brandCode": e.storegentBrandList[i].brandCode,
 								"kunnr": e.storegentBrandList[i].agentId
 							}
 							newArr.push(obj)
 						}
+						
 					}
 					this.Arry[index] = newArr
 				}
-				console.log(this.Arry,this.checkboxList)		
+				
+				console.log(this.Arry,this.checkboxList)
+				
+				
 			}
 		},
 	}
@@ -287,9 +291,8 @@
 		height: 40rpx;
 		display: inline-block;
 		background-color: #3A9FF2;
-		position: relative;
-		top: -14rpx;
-		left: 430rpx;
+		margin-top: -20rpx;
+		margin-right: 20rpx;
 		border-radius: 10rpx;
 		font-size: 24rpx;
 		color: #fff;
@@ -315,7 +318,7 @@
 		margin-left: 100rpx;
 		font-weight: bolder;
 		margin-right: 30rpx;
-		padding-bottom: 40rpx;
+		padding-bottom: 20rpx;
 	}
 
 	.content-five-img {
@@ -325,6 +328,6 @@
 	}
 
 	.content-five-view {
-		margin-left: -100rpx;
+		margin-left: -150rpx;
 	}
 </style>

+ 39 - 100
pages/me/Statistical-task/index.vue

@@ -54,31 +54,30 @@
 				pixelRatio: 1,
 				piearr: [],
 				textarea: '',
-				// name: '',
-				pieObj:{
-					series:[
-						{
-							data:60,
-							name:'已完成'
-						},
-						{
-							data:40,
-							name:'未完成'
-						},
-					]
-				},
-				pieObj2:{
-					series:[
-						{
-							data:60,
-							name:'已完成'
-						},
-						{
-							data:40,
-							name:'未完成'
-						},
-					]
-				}
+				// pieObj:{
+				// 	series:[
+				// 		{
+				// 			data:60,
+				// 			name:'已完成'
+				// 		},
+				// 		{
+				// 			data:40,
+				// 			name:'未完成'
+				// 		},
+				// 	]
+				// },
+				// pieObj2:{
+				// 	series:[
+				// 		{
+				// 			data:60,
+				// 			name:'已完成'
+				// 		},
+				// 		{
+				// 			data:40,
+				// 			name:'未完成'
+				// 		},
+				// 	]
+				// }
 			}
 		},
 		onLoad() {
@@ -102,7 +101,10 @@
 						}
 					}).then(res => {
 						console.log(res)
+						console.log(this.$store.state.storeInfo.storeId)
 						this.orderList = res.data.data
+						
+						
 						for(var i=0;i<res.data.data.length;i++){
 							let  monthPie = {
 								series: []
@@ -110,94 +112,35 @@
 							let quarterPie = {
 								series: []
 							}
-							
 							for(var j=0;j<res.data.data[i].storeMonthList.length;j++){
-								// var _this = this
-								this.name = res.data.data[i].storeMonthList[j].data
-								let name = ""
-								console.log(this.name)
 								let monthObj = {
 									data:null,
 									name:'',
+									percent:''
 								}
 								let quarterObj = {
 									data:null,
 									name:'',
+									percent:'',
 								}
-								name= res.data.data[i].storeMonthList[j].data
-								console.log(name)
+								
 								monthObj.data = res.data.data[i].storeMonthList[j].data
 								monthObj.name = res.data.data[i].storeMonthList[j].name
+								monthObj.percent = res.data.data[i].storeMonthList[j].percent
 								quarterObj.data = res.data.data[i].storeQuarterList[j].data
 								quarterObj.name = res.data.data[i].storeQuarterList[j].name
+								quarterObj.percent = res.data.data[i].storeQuarterList[j].percent
 								
 								console.log('^^^^',monthObj)
 								console.log('9999999',quarterObj)
-								
 								monthPie.series.push(monthObj)
 								quarterPie.series.push(quarterObj)
-								
 							}
 							
 							console.log(`mouthPie${i}`,monthPie,quarterPie)
 							 this.showPie(`mouthPie${i}`,monthPie);
 							 this.showPie(`quarterPie${i}`,quarterPie)
-							// this[`${this.refVal}`]
 						}
-						
-						
-						// let HstoreMonthList = res.data.data[0].storeMonthList
-						// let SstoreMonthList = res.data.data[1].storeMonthList
-						// for(var i=0;i<HstoreMonthList.length;i++){
-						// 	let obj = {
-						// 		data:null,
-						// 		name:'',
-						// 	}
-						// 	obj.data = HstoreMonthList[i].data
-						// 	obj.name = HstoreMonthList[i].name
-						// 	console.log(obj)
-						// 	Pie.series[i] = obj
-						// }
-						// this.showPie("canvasPie", Pie);
-						//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
-						// for (let i = 0; i < res.data.data.length; i++) {
-						// 	for(let j=0;j<res.data.data[i].storeMonthList.length;j++){
-						// 		let obj = {
-						// 			data:null,
-						// 			name:'',
-						// 		}
-						// 		console.log(res.data.data[i].storeMonthList[j].data)
-						// 		console.log(res.data.data[i].storeMonthList[j].name)
-						// 		obj.data = res.data.data[i].storeMonthList[j].data
-						// 		obj.name = res.data.data[i].storeMonthList[j].name
-						// 		Pie.series[j] = obj
-						// 	}
-						// 	this.showPie("canvasPie", Pie);
-							// this.pieObj = res.data.data[i].storeMonthList
-							// for(let j =0;j<res.data.data[i].storeMonthList.length;j++){
-							// 	let obj = {
-							// 		name:'',
-							// 		data:null
-							// 	}
-							// 	obj.name = res.data.data[i].storeMonthList[j].name
-							// 	obj.data = res.data.data[i].storeMonthList[j].data
-							// 	Pie.series[j] = obj
-							// 	console.log('^^^^^',Pie)
-							// 	this.showPie("canvasPie",Pie);
-							// }
-							// let obj = {
-							// 	name:'',
-							// 	data:null
-							// }
-							// obj.name = res.data.data[i]
-						// Pie.series = res.data.data[i].storeMonthList;
-						// console.log(this.pieObj)
-						// console.log(Pie)
-						
-						
-						
-						// }
-						
 					}).catch(err => {
 						console.log(err)
 					})
@@ -208,8 +151,8 @@
 						}, 300)
 					})
 			},
-			showPie(canvasId, chartData) {
-				console.log('8888888',canvasId,chartData)
+			showPie(canvasId, chartData,percent) {
+				console.log('8888888',canvasId,chartData,percent)
 				canvasObj[canvasId]=new uCharts({
 					$this: _self,
 					canvasId: canvasId,
@@ -231,18 +174,18 @@
 					background: '#fff',
 					pixelRatio: _self.pixelRatio,
 					series: chartData.series,
-					animation: false,
+					animation: true,
 					width: _self.cWidth,
 					height: _self.cHeight,
 					disablePieStroke: true,
 					dataLabel: true,
 					subtitle: {
-						// name: 40,1
+						name:chartData.series[0].percent ,
 						color: '#7cb5ec',
 						fontSize: 12 * _self.pixelRatio,
 					},
 					title: {
-						name: '完成',
+						name: '完成',
 						color: '#666666',
 						fontSize: 13 * _self.pixelRatio,
 					},
@@ -267,11 +210,7 @@
 			// 	});
 			// },
 			touchPie(e,id){
-				console.log(e,id)
-				
-				// canvaPie.touchLegend(e, {
-				// 	animation: false
-				// });
+				console.log(e)
 				canvasObj[id].showToolTip(e, {
 						format: function (item) {
 								return item.name + ':' + item.data 
@@ -350,7 +289,7 @@
 	}
 
 	.qiun-charts-three>view:nth-child(2) {
-		width: 150rpx;
+		width: 180rpx;
 		height: 22rpx;
 		background-color: #000000;
 		color: #fff;

+ 2 - 2
pages/me/Write-off-management/index.vue

@@ -36,14 +36,14 @@
 						</view>
 					</view>
 				</view>
-
+<u-loadmore :status="status" />
 			</view>
 			<view v-else style="margin-top: 100rpx;">
 				<u-empty text="暂无数据" mode="list"></u-empty>
 			</view>
 
 		</view>
-		<u-loadmore :status="status" />
+		
 	</view>
 </template>
 

+ 7 - 22
pages/msg/System-message/index.vue

@@ -3,7 +3,7 @@
 	<view class="header">
 		<view class="content" v-for="(item,index) in orderList" @click="inDetails" :key="index">
 			<view class="content-one">
-				<text class="content-one-first">{{item.msgTitle}}</text>
+				<text class="content-one-first">{{item.msgTitle}} {{item.sendUserId}}</text>
 				<text class="content-one-second">{{item.data}}</text>
 			</view>
 			<!-- 中间的虚线 -->
@@ -11,27 +11,9 @@
 			</view>
 
 			<text class="content-three">
-				{{msgContent}}
+				{{msgContent.replace(/<[^>]+>/g,"")}}
 			</text>
-			<!-- <view class="content-four">
-				订单编号:{{item.number}}
-			</view>
-			<view class="content-four">
-				创建时间:{{item.time}}
-			</view>
-			<view class="content-four">
-				订单条数:{{item.amount}}条
-			</view>
-			<view class="content-four">
-				联系人:{{item.name}}
-			</view>
-			<view class="content-four">
-				联系电话:{{item.Telephone}}
-			</view>
-			<view class="content-four">
-				零售店地址:{{item.address}}
-			</view> -->
-			<view class="content-five">
+			<view class="content-five" v-if="item.sendUserId==17||item.sendUserId==19">
 				<text class="content-five-first">查看订单详情</text>
 				<text class="content-five-second">
 					<u-icon name="arrow-right"></u-icon>
@@ -81,7 +63,10 @@
 					}).then(res => {
 						console.log(res)
 						this.orderList = res.data.list
-						this.msgContent = res.data.list[0].msgContent
+						// this.msgContent = res.data.list[0].msgContent
+						for(var i = 0; i<res.data.list.length; i++) {
+							this.msgContent = res.data.list[i].msgContent
+						}
 
 
 

+ 4 - 3
pages/msg/index.vue

@@ -190,7 +190,7 @@ image {
 
 .title {
   text-align: left;
-  font-size: 29rpx;
+  font-size: 34rpx;
   color: #333333;
   font-weight: bold;
   margin-top: 20rpx;
@@ -198,6 +198,7 @@ image {
 
 .title-wrap {
   width: 280rpx;
+  margin-left: 30rpx;
 }
 
 .title-wrap-one {
@@ -207,8 +208,8 @@ image {
 }
 
 .title-wrap-two {
-  margin-left: 150rpx;
-  margin-top: 10rpx;
+  margin-left: 130rpx;
+  margin-top: 20rpx;
 }
 
 .title-wrap-two > view:nth-child(1) {