achao 2 gadi atpakaļ
vecāks
revīzija
3606c8e2cf
2 mainītis faili ar 138 papildinājumiem un 127 dzēšanām
  1. 20 16
      pages/user/newReport.vue
  2. 118 111
      pages/user/user.vue

+ 20 - 16
pages/user/newReport.vue

@@ -155,7 +155,7 @@
 					</view>
 				</view>
 				<view class="row2">
-					<qiun-data-charts type="bar" :opts="opts4" :chartData="chartData4" />
+					<qiun-data-charts type="bar" :opts="opts4" :chartData="chartData4" :ontouch="true" />
 				</view>
 				<view class="row3">
 					<view class="list-item flex jcsb" v-for="(item,index) in InventoryList">
@@ -177,7 +177,7 @@
 					</view>
 				</view>
 				<view class="row6">
-					<qiun-data-charts type="column" :opts="opts5" :chartData="chartData5" />
+					<qiun-data-charts type="column" :opts="opts5" :chartData="chartData5" :ontouch="true" />
 				</view>
 				<view class="row7">
 					<view class="left title-lv2" style="margin: 30rpx;">
@@ -449,6 +449,7 @@
 					}
 				},
 				opts4: {
+					enableScroll: true,
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
 					],
@@ -459,9 +460,8 @@
 					xAxis: {
 						boundaryGap: "justify",
 						disableGrid: false,
-						min: 0,
 						axisLine: false,
-						max: 40
+						itemCount: 4,
 					},
 					yAxis: {},
 					extra: {
@@ -480,13 +480,15 @@
 					}
 				},
 				opts5: {
+					enableScroll: true,
 					color: ["#8D9EE9"],
 					padding: [15, 15, 0, 5],
 					legend: {
 						show: false,
 					},
 					xAxis: {
-						disableGrid: true
+						disableGrid: true,
+						itemCount: 4,
 					},
 					yAxis: {
 						data: [{
@@ -894,19 +896,21 @@
 			},
 			makeDate6(val) {
 				let _data = []
-				for (let i = 0; i < val[10].biViewInfoList.length; i++) {
-					let _obj = {
-						name: val[10].biViewInfoList[i].name,
-						value: val[10].biViewInfoList[i].weight
+				if (val[10].biViewInfoList) {
+					for (let i = 0; i < val[10].biViewInfoList.length; i++) {
+						let _obj = {
+							name: val[10].biViewInfoList[i].name,
+							value: val[10].biViewInfoList[i].weight
+						}
+						_data.push(_obj)
 					}
-					_data.push(_obj)
+					let res6 = {
+						series: [{
+							data: _data
+						}]
+					};
+					this.chartData6 = JSON.parse(JSON.stringify(res6));
 				}
-				let res6 = {
-					series: [{
-						data: _data
-					}]
-				};
-				this.chartData6 = JSON.parse(JSON.stringify(res6));
 			},
 			selectMakeDate7(val) {
 				console.log(11)

+ 118 - 111
pages/user/user.vue

@@ -246,7 +246,7 @@
 						src: '../../static/img/myimg/erp.png',
 						tips: 0,
 						url: `/pages/erp/index`,
-						show: uni.getStorageSync('pcUserInfo')?true:false
+						show: uni.getStorageSync('pcUserInfo') ? true : false
 					},
 					{
 						num: 1,
@@ -256,7 +256,7 @@
 						src: '../../static/img/myimg/sg.png',
 						tips: 0,
 						url: `/pages/erpbusiness/index`,
-						show: uni.getStorageSync('pcUserInfo')?true:false
+						show: uni.getStorageSync('pcUserInfo') ? true : false
 					},
 					{
 						num: 2,
@@ -274,7 +274,7 @@
 						src: '../../static/img/sign/myTask@2x.png',
 						tips: 0,
 						url: '/pages/task/my_task',
-						show: uni.getStorageSync('pcUserInfo')?true:false
+						show: uni.getStorageSync('pcUserInfo') ? true : false
 					},
 					{
 						num: 4,
@@ -300,8 +300,8 @@
 						// icon: 'cuIcon-edit',
 						src: '../../static/img/sign/shujubaobiao@2x.png',
 						tips: 0,
-						url: `/pages/user/report`,
-						show: uni.getStorageSync('pcUserInfo')?true:false
+						url: `/pages/user/newReport`,
+						show: uni.getStorageSync('pcUserInfo') ? true : false
 					},
 					{
 						num: 7,
@@ -310,7 +310,7 @@
 						src: '../../static/img/sign/kudianjiankong@2x.png',
 						tips: 0,
 						url: `/pages/user/depotMonitoring`,
-						show: uni.getStorageSync('pcUserInfo')?true:false
+						show: uni.getStorageSync('pcUserInfo') ? true : false
 					},
 					{
 						num: 8,
@@ -319,7 +319,7 @@
 						src: '../../static/img/oa_office/oaOffice.png',
 						tips: 0,
 						url: `/pages/oa_office/the_oaOffice`,
-						show: uni.getStorageSync('pcUserInfo')?true:false
+						show: uni.getStorageSync('pcUserInfo') ? true : false
 					},
 					// {
 					// 	num: 9,
@@ -384,7 +384,7 @@
 		},
 		// #endif
 		computed: {
-			...mapState(['hasLogin', 'userInfo','clientId']),
+			...mapState(['hasLogin', 'userInfo', 'clientId']),
 			// 手机号中间4位加*
 			starUserphone() {
 				let reg = /^(\d{3})\d{4}(\d{4})$/;
@@ -398,18 +398,20 @@
 		},
 		onShow() {
 			// console.log(111111111)
-			if(uni.getStorageSync('pcUserInfo')){
+			if (uni.getStorageSync('pcUserInfo')) {
 				// console.log(2222222)
 				for (var i = 0; i < this.gridList1.length; i++) {
-					if(this.gridList1[i].num==0||this.gridList1[i].num==1||this.gridList1[i].num==3||this.gridList1[i].num==6||this.gridList1[i].num==7||this.gridList1[i].num==8){
-						this.gridList1[i].show=true
+					if (this.gridList1[i].num == 0 || this.gridList1[i].num == 1 || this.gridList1[i].num == 3 || this
+						.gridList1[i].num == 6 || this.gridList1[i].num == 7 || this.gridList1[i].num == 8) {
+						this.gridList1[i].show = true
 					}
 				}
-			}else{
+			} else {
 				// console.log(33333333)
 				for (var i = 0; i < this.gridList1.length; i++) {
-					if(this.gridList1[i].num==0||this.gridList1[i].num==1||this.gridList1[i].num==3||this.gridList1[i].num==6||this.gridList1[i].num==7||this.gridList1[i].num==8){
-						this.gridList1[i].show=false
+					if (this.gridList1[i].num == 0 || this.gridList1[i].num == 1 || this.gridList1[i].num == 3 || this
+						.gridList1[i].num == 6 || this.gridList1[i].num == 7 || this.gridList1[i].num == 8) {
+						this.gridList1[i].show = false
 					}
 				}
 			}
@@ -427,7 +429,7 @@
 				index: 4
 			})
 			this.loadData()
-			console.log("hasLogin", this.hasLogin)				
+			console.log("hasLogin", this.hasLogin)
 			var that = this
 			if (this.userInfo) {
 				if (!this.userInfo.avatarUrl) {
@@ -467,7 +469,7 @@
 						// });
 					}
 				})
-									console.log("this.1111")
+				console.log("this.1111")
 				// uni.getStorage({
 				// 	key: 'compName1',
 				// 	success: function (res) {
@@ -479,7 +481,7 @@
 				// 		}
 				// 	},
 				// 	fail() {
-						
+
 				// 	}
 				// });
 				that.$api.doRequest('get', '/commonUser/getCompOwn', {
@@ -487,18 +489,17 @@
 				}).then(res => {
 					if (res.data.data) {
 						that.companyList = res.data.data
-							console.log("that.3333")
-							console.log(that.companyList)
+						console.log("that.3333")
+						console.log(that.companyList)
 						if (that.companyList.length > 0) {
-							if(!that.compName){
+							if (!that.compName) {
 								that.compName = that.companyList[0].compName
 								uni.setStorageSync('compName1', that.companyList[0].compName)
 							}
 							console.log("this.compName")
 							console.log(that.compName)
 							that.haveCompany = true
-						}
-						else{
+						} else {
 							that.haveCompany = false
 						}
 					}
@@ -520,100 +521,106 @@
 				this.isShowAlert = false
 			},
 			compconfirm(e) {
-				var that=this
+				var that = this
 				uni.showLoading({
 					title: '登录中',
-					mask:true
+					mask: true
 				})
-				console.log("clinetId",this.clientId)
-				this.$api.doRequest('get','/commonUser/login',{phone:this.userInfo.phone,password:"999999",cid:this.clientId}).then(res => {
-					if(res.data.code==200){
-						console.log("userInfo",res.data.data)
-						uni.setStorageSync('userInfo', res.data.data)
-						this.$api.doRequest('post','/commonUser/api/loginQuickly',{
-							mobilePhone: this.userInfo.phone,
-							companyName: this.companyList[e[0]].compName,
-							veriCode: "123456",}).then(res1 => {
-							console.log("loginQuickly",res)
-							if(res1.data.code==200){
-								uni.setStorageSync('pcUserInfo', res1.data.data)
-								uni.setStorageSync('compName1', that.companyList[e[0]].compName)
-								that.compName = that.companyList[e[0]].compName
-								helper.getListByUserId()
-							}
-							else{
-								// that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
-								// veriCode: "123456",}).then(res2 => {
-								// 	uni.setStorageSync('pcUserInfo', res2.data.data)
-								// 	helper.getListByUserId()
-								// })
-							}
-							that.$store.commit('login', res.data.data)
-							var name = 'userInfo';
-							var value = res.data.data;
-							that.$store.commit('$uStore', {
-								name,
-								value
-							});
-							// that.liangxinLogin()
-							
-							// uni.switchTab({
-							// 	url: '/pages/sale/information'
-							// });
-							uni.hideLoading()
-							uni.hideKeyboard()
-							uni.showTabBar()
-							uni.removeTabBarBadge({
-								index: 4
-							})
-							that.loadData()
-							that.username = that.userInfo.userName ? that.userInfo.userName : uni.getStorageSync("userInfo").data
-								.userName
-							that.userphone = that.userInfo.phone ? that.userInfo.phone : uni.getStorageSync("userInfo").data.phone
-							that.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
-								console.log("noticeNumber", res)
-								if (res.data.data) {
-									let name = 'myTip';
-									let value = res.data.data.total;
-									that.$store.commit('$uStore', {
-										name,
-										value
-									});
-									if (value != 0 && value) {
-										uni.setTabBarBadge({
-											index: 4,
-											text: value + ""
-										})
-									}
-									name = 'taskTip';
-									value = res.data.data.total;
-									that.$store.commit('$uStore', {
-										name,
-										value
-									});
-									// name = 'contractTip';
-									// value = res.data.data.contractTip;
-									// that.$store.commit('$uStore', {
-									// 	name,
-									// 	value
-									// });
+				console.log("clinetId", this.clientId)
+				this.$api.doRequest('get', '/commonUser/login', {
+						phone: this.userInfo.phone,
+						password: "999999",
+						cid: this.clientId
+					}).then(res => {
+						if (res.data.code == 200) {
+							console.log("userInfo", res.data.data)
+							uni.setStorageSync('userInfo', res.data.data)
+							this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
+								mobilePhone: this.userInfo.phone,
+								companyName: this.companyList[e[0]].compName,
+								veriCode: "123456",
+							}).then(res1 => {
+								console.log("loginQuickly", res)
+								if (res1.data.code == 200) {
+									uni.setStorageSync('pcUserInfo', res1.data.data)
+									uni.setStorageSync('compName1', that.companyList[e[0]].compName)
+									that.compName = that.companyList[e[0]].compName
+									helper.getListByUserId()
+								} else {
+									// that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
+									// veriCode: "123456",}).then(res2 => {
+									// 	uni.setStorageSync('pcUserInfo', res2.data.data)
+									// 	helper.getListByUserId()
+									// })
 								}
+								that.$store.commit('login', res.data.data)
+								var name = 'userInfo';
+								var value = res.data.data;
+								that.$store.commit('$uStore', {
+									name,
+									value
+								});
+								// that.liangxinLogin()
+
+								// uni.switchTab({
+								// 	url: '/pages/sale/information'
+								// });
+								uni.hideLoading()
+								uni.hideKeyboard()
+								uni.showTabBar()
+								uni.removeTabBarBadge({
+									index: 4
+								})
+								that.loadData()
+								that.username = that.userInfo.userName ? that.userInfo.userName : uni
+									.getStorageSync("userInfo").data
+									.userName
+								that.userphone = that.userInfo.phone ? that.userInfo.phone : uni
+									.getStorageSync("userInfo").data.phone
+								that.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
+									console.log("noticeNumber", res)
+									if (res.data.data) {
+										let name = 'myTip';
+										let value = res.data.data.total;
+										that.$store.commit('$uStore', {
+											name,
+											value
+										});
+										if (value != 0 && value) {
+											uni.setTabBarBadge({
+												index: 4,
+												text: value + ""
+											})
+										}
+										name = 'taskTip';
+										value = res.data.data.total;
+										that.$store.commit('$uStore', {
+											name,
+											value
+										});
+										// name = 'contractTip';
+										// value = res.data.data.contractTip;
+										// that.$store.commit('$uStore', {
+										// 	name,
+										// 	value
+										// });
+									}
+								})
+								that.$api.msg('切换成功')
 							})
-							that.$api.msg('切换成功')
-						})
-						
-					}else{
-						uni.hideLoading()
-						uni.showToast({
-							title: res.data.message,
-							icon:'none',
-							duration: 2000
-						})
-					}
-				})
-				.catch(res => {
-				    console.log(res);
-				});
+
+						} else {
+							uni.hideLoading()
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					})
+					.catch(res => {
+						console.log(res);
+					});