소스 검색

前端 小程序 收购检斤修改

zhongtianhaoyuan 3 년 전
부모
커밋
4de96883a3
3개의 변경된 파일90개의 추가작업 그리고 68개의 파일을 삭제
  1. 2 1
      common/helper.js
  2. 2 2
      config/index.js
  3. 86 65
      pages/erpbusiness/acquisitionInspection/acquisitionInspection.vue

+ 2 - 1
common/helper.js

@@ -2,6 +2,7 @@ import * as config from '../config'
 const selectContractNo = {}
 const detailData = {}
 const erpWarehouse={}
+const rolesList = []
 const now = Date.now || function () {  
     return new Date().getTime();  
 };  
@@ -26,7 +27,7 @@ const getListByUserId = function(){
 }
 const getUserAllRoles = (item) => {
 	console.log(item)
-	let rolesList = []
+	
 	for(let i = 0;i<item.length;i++){
 		rolesList.push(item[i].name)
 		console.log('用户权限',rolesList)

+ 2 - 2
config/index.js

@@ -1,7 +1,7 @@
 const dev = {
 	baseUrl: 'https://www.zthymaoyi.com',
-	// baseUrlNew: 'http://192.168.1.107:8090/',
-	baseUrlNew: 'http://api1.eliangeyun.com/',
+	baseUrlNew: 'http://192.168.1.107:8090/',
+	// baseUrlNew: 'http://api1.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 86 - 65
pages/erpbusiness/acquisitionInspection/acquisitionInspection.vue

@@ -34,7 +34,9 @@
 				<view class="row2" v-if="item.qualityInspectionManagement">
 					<view>{{item.qualityInspectionManagement.customerName}}</view>
 					<view>{{item.qualityInspectionManagement.carNo}}</view>
-					<view>{{item.qualityInspectionManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)</view>
+					<view>
+						{{item.qualityInspectionManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)
+					</view>
 				</view>
 				<view class="row3">
 					<view class="row3-item">
@@ -51,10 +53,11 @@
 					</view>
 				</view>
 				<view class="row4">
-					<view v-if="getRoles('acquisitionWeight.mao')&&item.status!='已称皮重'" class="right"  @click="grossWeightClick(item)">毛重</view>
+					<view v-if="getRoles('acquisitionWeight.mao')&&item.status!='已称皮重'" class="right"
+						@click="grossWeightClick(item)">毛重</view>
 					<view v-if="getRoles('acquisitionWeight.weight')&&(!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
-					!(item.paymentManagement&&item.paymentManagement.status=='部分收款')) && item.status!='已质检'"
-					 class="right" @click="tareClick(item)">皮重</view>
+					!(item.paymentManagement&&item.paymentManagement.status=='部分收款')) && item.status!='已质检' && item.allow != 2" class="right"
+						@click="tareClick(item)" >皮重</view>
 				</view>
 			</view>
 		</view>
@@ -76,19 +79,18 @@
 				warehouseId: '',
 				isShowWarehouse: false,
 				warehouseList: [],
-				isContent:false,
-				loadStatus:'noMore',
+				isContent: false,
+				loadStatus: 'noMore',
 				dataList: [],
-				pageSize:10,
-				currentPage:1,
-				cangid:''
+				pageSize: 10,
+				currentPage: 1,
+				cangid: ''
 			}
 		},
 		onShow() {
-			if(this.cangid){
-				uni.setStorageSync("cangid",this.cangid)
-			}
-			else{
+			if (this.cangid) {
+				uni.setStorageSync("cangid", this.cangid)
+			} else {
 				this.cangid = uni.getStorageSync("cangid")
 			}
 			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
@@ -126,16 +128,16 @@
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		onPullDownRefresh() {
-			this.currentPage=1
-			this.gridList=[]
+			this.currentPage = 1
+			this.gridList = []
 			this.getList(true)
-			setTimeout(function () {
+			setTimeout(function() {
 				uni.stopPullDownRefresh();
 			}, 1000);
 		},
-		 onReachBottom() {
-			 this.currentPage+=1
-		    this.getList(false)
+		onReachBottom() {
+			this.currentPage += 1
+			this.getList(false)
 			// this.getMoreNews()
 		},
 		methods: {
@@ -144,8 +146,8 @@
 				let _roles = uni.getStorageSync('rolesList')
 				for (let i = 0; i < _roles.length; i++) {
 					if (_roles[i] == role) {
-						 return true
-					} 
+						return true
+					}
 				}
 				return false
 			},
@@ -153,7 +155,7 @@
 				var that = this
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
 					compId: '',
-					personCharge:this.userInfo.phone
+					personCharge: this.userInfo.phone
 				}).then(res => {
 					console.log("warehouseBaseInfo", res)
 					let _resData = res.data.data
@@ -164,15 +166,15 @@
 							"value": _resData[i].id,
 						}
 						that.warehouseList.push(_obj)
-						if (that.cangid&&that.cangid == _resData[i].id) {
-						  that.warehouseName = _resData[i].warehouseName
-						  that.warehouseId =  _resData[i].id
-						} 
+						if (that.cangid && that.cangid == _resData[i].id) {
+							that.warehouseName = _resData[i].warehouseName
+							that.warehouseId = _resData[i].id
+						}
 					}
-					if(that.warehouseList.length > 0 && !that.cangid){
+					if (that.warehouseList.length > 0 && !that.cangid) {
 						that.warehouseName = that.warehouseList[0].label
-						that.warehouseId =  that.warehouseList[0].value
-						that.cangid =  that.warehouseList[0].value
+						that.warehouseId = that.warehouseList[0].value
+						that.cangid = that.warehouseList[0].value
 					}
 					this.getList(true)
 				})
@@ -180,39 +182,50 @@
 			//获取列表
 			getList(flag) {
 				uni.showLoading({
-					title:"正在加载"
+					title: "正在加载"
 				})
 				this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
-					compId: '',
-					currentPage: this.currentPage,
-					pageSize:this.pageSize,
-					searchKeyWord: this.inputKeyword,
-					warehouseName: this.warehouseName,
-					managementType: 1,
-				}).then(res => {
-					var data=res.data.data.records
-					if(flag){
-						this.dataList = data
-					}
-					else{
-						this.dataList = this.dataList.concat(data)
-					}
-					if(res.data.data.records.length==0){
-						this.isContent=true
-					}
-					console.log("--------------------------------")
-					console.log("this.dataList",this.dataList)
-					
-					uni.hideLoading()
-				})
-				.catch(res => {
-					uni.showToast({
-						title: '系统异常,请联系管理员',
-						icon: 'none',
-						duration: 2000
+						compId: '',
+						currentPage: this.currentPage,
+						pageSize: this.pageSize,
+						searchKeyWord: this.inputKeyword,
+						warehouseName: this.warehouseName,
+						managementType: 1,
+					}).then(res => {
+						var data = res.data.data.records
+
+
+						for (let i = 0; i < data.length; i++) {
+							if (data[i].paymentManagement) {
+								if (data[i].paymentManagement.approveStatus || data[i].paymentManagement.status !=
+									'待结算') {
+									data[i].allow = 2
+								}
+							} else {
+								data[i].allow = 1
+							}
+						}
+						if (flag) {
+							this.dataList = data
+						} else {
+							this.dataList = this.dataList.concat(data)
+						}
+						if (res.data.data.records.length == 0) {
+							this.isContent = true
+						}
+						console.log("--------------------------------")
+						console.log("this.dataList", this.dataList)
+
+						uni.hideLoading()
+					})
+					.catch(res => {
+						uni.showToast({
+							title: '系统异常,请联系管理员',
+							icon: 'none',
+							duration: 2000
+						})
+						uni.hideLoading()
 					})
-					uni.hideLoading()
-				})
 			},
 			selectWarehouse() {
 				this.isShowWarehouse = true
@@ -221,8 +234,8 @@
 				console.log(e)
 				this.warehouseName = e[0].label
 				this.dataList.warehouseName = e[0].label;
-				this.cangid=e[0].value
-				uni.setStorageSync("cangid",this.cangid)
+				this.cangid = e[0].value
+				uni.setStorageSync("cangid", this.cangid)
 				this.getList(true)
 			},
 			//毛重
@@ -321,10 +334,12 @@
 			display: flex;
 			margin-top: 30rpx;
 			padding-left: 14rpx;
+
 			.row3-item {
 				display: flex;
 				margin-right: 40rpx;
 				align-items: center;
+
 				.left {
 					background: #22C572;
 					border-radius: 10rpx;
@@ -351,18 +366,24 @@
 		}
 
 	}
-	.status1,.status2,.status3{
+
+	.status1,
+	.status2,
+	.status3 {
 		padding: 8rpx 12rpx;
 		border-radius: 50%;
 		color: white;
 	}
-	.status1{
+
+	.status1 {
 		background: #FD714F;
 	}
-	.status2{
+
+	.status2 {
 		background: #22C572;
 	}
-	.status3{
+
+	.status3 {
 		background: #3296FA;
 	}
 </style>