浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

achao 2 年之前
父节点
当前提交
cdb6d7a5f1
共有 1 个文件被更改,包括 40 次插入6 次删除
  1. 40 6
      pages/task/my_task.vue

+ 40 - 6
pages/task/my_task.vue

@@ -7,7 +7,11 @@
 					@custom="searchKeyWord()"></u-search>
 			</view>
 			<view style='justify-content: space-between;' class='flex'>
-				<view ></view>
+				<view class='changewarehouse'>
+					<view  @click='show=true'>{{businessCodetext?businessCodetext:'选择类型'}}<text class='cuIcon-unfold'></text></view>
+					<u-picker @confirm="businessCodechange" range-key='receiptName' mode="selector" v-model="show"
+						:range="typeList"></u-picker>
+				</view>
 				<view class="company">
 					<image class='icon' style='width:19px;height:19px;' src="../../static/img/icon_qiye@3x.png"
 							mode=""></image> {{compName}}
@@ -79,10 +83,14 @@
 				isLoadMore: false, //是否加载中
 				isSole: false,
 				showTran: true,
+				show:false,
 				scrollTop: 0,
 				isContent: true,
 				statusFlag: 1,
 				current: 1,
+				typeList:[],
+				businessCodetext:'',
+				businessCode:'',
 				pcUserInfo: {},
 				warehouseInOutInfo: {
 					pageSize: 10,
@@ -221,7 +229,6 @@
 		onShow() {
 			var that =this
 			// setTimeout(()=>{
-				
 				uni.getStorage({
 					key: 'compName1',
 					success: function (res) {
@@ -231,6 +238,18 @@
 				});
 				 // = uni.getStorageSync('compName1').company
 			// },1000)
+			this.$api.doRequest('get', '//noticeCopyInfo/typeDropDown').then(res => {
+				if (res.data.code == 200) {
+					this.typeList=res.data.data
+					this.typeList.unshift({receiptName:'全部类型'})
+				} else {
+					uni.showToast({
+						title: "系统异常,请联系管理员",
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			})
 			if(this.statusFlag==1){
 				this.taskInfo=[]
 				this.pages=1
@@ -342,6 +361,17 @@
 			// 	}
 			// 	return false
 			// },
+			businessCodechange(e){
+				if(e[0]==0){
+					this.businessCode=''
+				}else{
+					this.businessCode=this.typeList[e[0]].businessCode
+				}
+				this.businessCodetext=this.typeList[e[0]].receiptName
+				this.pages = 1
+				this.taskInfo=[]
+				this.getIndexBuyData(1,this.keyword)
+			},
 			change(status) {
 				console.log(status);
 			},
@@ -385,6 +415,7 @@
 					title: "正在加载"
 				})
 				var data = {}
+				data.businessCode=that.businessCode
 				if (this.statusFlag == 1) {
 					data.searchKeyword = searchKeyword
 					data.currentPage = pages
@@ -504,12 +535,14 @@
 						} else {
 							that.isSole = false
 						}
-						if (res.data.data.records.length == 0 && this.data.currentPage == 1 && this.statusFlag ==
+						if (res.data.data.records.length == 0 && this.pages == 1 && this.statusFlag ==
 							3 ||
-							res.data.data.records.length == 0 && this.warehouseInOutInfo.currentPage == 1 && this
+							res.data.data.records.length == 0 && this.pages == 1 && this
 							.statusFlag == 1 ||
-							res.data.data.records.length == 0 && this.warehouseInOutInfo.currentPage == 1 && this
-							.statusFlag == 5) {
+							res.data.data.records.length == 0 && this.pages == 1 && this
+							.statusFlag == 5||
+							res.data.data.records.length == 0 && this.pages == 1 && this
+							.statusFlag == 7) {
 							console.log()
 							this.taskInfo = []
 						}
@@ -534,6 +567,7 @@
 			tabcarchange(statusFlag) {
 				this.statusFlag = statusFlag
 				this.pages = 1
+				this.taskInfo=[]
 				this.getIndexBuyData(statusFlag)
 			},
 			navToDetailPage(item) {