gjy 2 년 전
부모
커밋
050551850d
3개의 변경된 파일12개의 추가작업 그리고 18개의 파일을 삭제
  1. 4 2
      pages/erpbusiness/quality_testing.vue
  2. 2 2
      pages/task/my_task.vue
  3. 6 14
      pages/user/user.vue

+ 4 - 2
pages/erpbusiness/quality_testing.vue

@@ -248,7 +248,9 @@
 			this.managementType = options.managementType
 		},
 		onShow() {
-			this.companyList=uni.getStorageSync('companyList')
+			console.log(uni.getStorageSync('compName1'),11111111)
+			this.compName = uni.getStorageSync('compName1').company
+			// this.companyList=uni.getStorageSync('companyList')
 			uni.setStorageSync('isClick', false)
 			uni.showLoading({
 				title: "正在加载"
@@ -293,7 +295,7 @@
 					this.getList(true)
 				}
 			})
-			that.compName = uni.getStorageSync('compName1')
+			
 			
 		},
 		methods: {

+ 2 - 2
pages/task/my_task.vue

@@ -92,7 +92,7 @@
 				keyword: "",
 				copyTaskInfo: [],
 				pcUserInfo:{},
-				compName:{}
+				compName:''
 			};
 		},
 		onBackPress(e) {
@@ -220,7 +220,7 @@
 		},
 		onShow() {
 			var that =this
-			that.compName = uni.getStorageSync('compName1')
+			that.compName = uni.getStorageSync('compName1').company
 			if(this.statusFlag==1){
 				this.taskInfo=[]
 				this.pages=1

+ 6 - 14
pages/user/user.vue

@@ -29,7 +29,6 @@
 				v-if="index<gridCol*2">
 				<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
 					<image :src="item.src" class="sign"></image>
-
 					<text style="color: #333333;">{{item.name}}</text>
 				</view>
 			</view>
@@ -103,7 +102,6 @@
 		},
 		data() {
 			return {
-				pcUserInfo:{},
 				isShowAlert: false,
 				content: '您尚未登录,是否立即登录?',
 				haveCompany: false,
@@ -399,8 +397,7 @@
 		},
 		onShow() {
 			// console.log(111111111)
-			this.pcUserInfo = uni.getStorageSync('pcUserInfo')
-			if (this.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
@@ -486,26 +483,21 @@
 
 				// 	}
 				// });
+				if(uni.getStorageSync('compName1')){
+					that.compName = uni.getStorageSync('compName1').company
+				}
 				that.$api.doRequest('get', '/commonUser/getCompOwn', {
 					phone: that.userInfo.phone
 				}).then(res => {
 					if (res.data.data) {
 						that.companyList = res.data.data
-						if(that.pcUserInfo){
-							for(let i=0;i<that.companyList.length;i++){
-								if(that.pcUserInfo.compId == that.companyList[i].compId){
-									uni.setStorageSync('compName1',that.companyList[i].compName)
-									that.compName = that.companyList[i].compName
-								}
-								
-							}
-						}
+						uni.setStorageSync('companyList', that.companyList)
 						console.log("that.3333")
 						console.log(that.companyList)
 						if (that.companyList.length > 0) {
 							if (!that.compName) {
 								that.compName = that.companyList[0].compName
-								uni.setStorageSync('compName1', that.companyList[0].compName)
+								uni.setStorageSync('compName1', {company:that.companyList[0].compName})
 							}
 							console.log("this.compName")
 							console.log(that.compName)