瀏覽代碼

前端gjy

gjy 3 年之前
父節點
當前提交
5c27e1dc10

+ 49 - 8
pages/erpbusiness/add_quality_testing.vue

@@ -49,7 +49,7 @@
 			<view class="c-row b-b">
 				<view class="title">仓位号</view>
 				<view class="con-list">
-					<view @click='show=true'>{{gridList.binNumber}}</view>
+					<view @click='show=true'>{{gridList.binNumber?gridList.binNumber:'请选择仓位号'}}</view>
 					<u-picker :range="warehouseList" range-key="binNumber" @confirm='binNumberpicker($event)' v-model="show" mode="selector" >
 					</u-picker>
 				</view>
@@ -64,13 +64,17 @@
 			<view class="c-row b-b">
 				<view class="title">货名</view>
 				<view class="con-list">
-					{{gridList.goodsName}}
+					<view @click='show2=true'>{{gridList.goodsName}}</view>
+					<u-picker :range="goodsList" range-key="goodsName" @confirm='goodspicker($event)' v-model="show2" mode="selector" >
+					</u-picker>
 				</view>
 			</view>
 			<view class="c-row b-b">
 				<view class="title">类型</view>
 				<view class="con-list">
-					{{gridList.type}}
+					<view @click='show3=true'>{{gridList.type}}</view>
+					<u-picker :range="typeList" @confirm='typepicker($event)' v-model="show3" mode="selector" >
+					</u-picker>
 				</view>
 			</view>
 			<view class="c-row">
@@ -126,7 +130,7 @@
 					 name="input"></input>
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view class="c-row">
 				<view class="title">热损伤(%)</view>
 				<view class="con-list">
 					<input v-model='gridList.jiaorenli' placeholder="请输入热损伤占比"
@@ -174,12 +178,19 @@
 				carInfo: [],
 				gridCol: 4,
 				pageSize:10,
+				show3:false,
+				show2:false,
+				goodsList:[],
 				currentPage:1,
 				gridBorder: false,
 				headUrl:"../../static/img/myimg/YongHu@3x.png",
 				userphone:"",
 				username:"请更改昵称",
-				gridList: {},
+				gridList: {
+					natureOfGrainPurchase:'贸易粮',
+					type:'潮粮'
+				},
+				typeList:['潮粮','干粮'],
 				managementType:'',
 				warehouseName: '',
 				warehouseList:[],
@@ -228,7 +239,7 @@
 			}
 		},
 		onLoad(options){
-			console.log(options)
+			
 			this.commonWarehouseNo=options.commonWarehouseNo
 			this.warehouseCount=options.warehouseCount
 			 let number = '000' + this.warehouseCount
@@ -240,6 +251,10 @@
 			this.managementType=options.managementType
 		},
 		onShow() {
+			if(uni.getStorageSync('checkcustomer')){
+				this.gridList.customerName=uni.getStorageSync('checkcustomer').customerName
+				this.gridList.customerPhone=uni.getStorageSync('checkcustomer').customerPhone
+			}
 			var that = this
 				this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer',{
 					compId:'',
@@ -255,6 +270,21 @@
 						})
 					}
 				})
+				this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName',{
+					warehouseId:this.cangid
+				}).then(res => {
+					if(res.data.data){
+						this.goodsList=res.data.data
+						// for (let i = 0; i < this.goodsList.length; i++) {
+							if(this.goodsList.some(item=>{return item.goodsName=='玉米'})){
+								this.gridList.goodsName='玉米'
+								uni.setStorageSync('goodsName',this.gridList.goodsName)
+							}else{
+								this.gridList.goodsName=this.goodsList[0].goodsName
+								uni.setStorageSync('goodsName',this.gridList.goodsName)
+							}
+					}
+				})
 		},
 		methods: {
 			gocustomer(){
@@ -363,11 +393,13 @@
 					confirmText: '提交',
 					success: function(res) {
 						if (res.confirm) {
-							that.$api.doRequest('post', '/qualityInspectionManagement/api/editQualityInspection',that.gridList).then(res => {
+							that.$api.doRequest('post', '/qualityInspectionManagement/api/addQualityInspection',that.gridList).then(res => {
 								if(res.data.code==200){
-									that.$api.msg('编辑质检成功')
+									that.$api.msg('提交成功')
 									uni.navigateBack({
 									})
+								}else{
+									hat.$api.msg('提交失败')
 								}
 							})
 						}
@@ -380,6 +412,15 @@
 				this.gridList.grade=this.gradeList[e[0]].value
 				this.gridList.gradeKey=this.gradeList[e[0]].key
 			},
+			goodspicker(e){
+				console.log(e)
+				// this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
+				this.gridList.goodsName=this.goodsList[e[0]].goodsName
+				uni.setStorageSync('goodsName',this.gridList.goodsName)
+			},
+			typepicker(e){
+				this.gridList.type=this.typeList[e[0]]
+			},
 			binNumberpicker(e){
 				this.gridList.binNumber=this.warehouseList[e[0]].binNumber
 			},

+ 138 - 30
pages/erpbusiness/customer.vue

@@ -4,7 +4,7 @@
 			<view style='background:#fff;display:flex;' class="cu-bar search">
 				<view style='flex:6;' class="search-form round Medium">
 					<text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
-					<input type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
+					<input @input='searchinput' type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
 						 placeholder="输入客户姓名或手机号" confirm-type="search"></input>
 				</view>
 				<view @click='doSearch()' class="Regular" style="width:4%;flex:1;">搜索</view>
@@ -13,11 +13,11 @@
 			</view>
 		</view>
 		<view class="content">
-			<view v-if='searchKeyWord.length==0'>近期客户</view>
-			<view v-if='searchKeyWord.length>0' class='searchwrap' v-for='item in gridList' @click='checkcustomer(item)'>
+			<view style='padding-left:20px;color:#AFB3BF;font-size:14px;' v-if='show==false'>近期客户</view>
+			<view v-if='searchKeyWord.length>0&&show==true' class='searchwrap' v-for='item in gridList' @click='checkcustomer(item)'>
 			{{item.customerName}}({{item.customerPhone}})
 			</view>
-			<view class='wrap' v-else>{{item.customerName}}({{item.customerPhone}})</view>
+			<view @click='recentcustomer(item)' class='wrap' v-else>{{item.searchContent}}</view>
 		</view>
 		
 		<view v-show="isContent">
@@ -71,6 +71,8 @@
 				showTran: true,
 				companyId: 1,
 				current: 4,
+				customerList:[],
+				purchasePriceList:[],
 				warehouseCount:'',
 				commonWarehouseNo:'',
 				cangid:''
@@ -111,60 +113,167 @@
 			}
 		},
 		onLoad(options){
-			this.managementType=options.managementType
+			this.purchasePriceList=uni.getStorageSync('purchasePriceList')
 		},
 		onShow() {
 			this.gridList=[]
 			this.$api.doRequest('get', '/searchRecordsInfo/selectSearchRecordsInfo',{
-				compId:'',
-				authenticationStatusKey:7,
+				pageSize:this.pageSize,
+				currentPage:this.currentPage,
+				functionType:"3",
+				commonId:this.userInfo.id
 			}).then(res => {
 				if(res.data.data){
 					this.gridList=res.data.data.records
 				}
 			})
+			this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer',{
+				compId:'',
+				authenticationStatusKey:7,
+			}).then(res => {
+				if(res.data.data){
+					this.customerList=res.data.data
+					}
+			})
 		},
 		methods: {
+			searchinput(e){
+				if(this.searchKeyWord.length==0){
+					this.show=false
+					this.getList()
+				}
+				
+			},
 			checkcustomer(item){
-				this.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
-					commonId:this.userInfo.id,
-					searchContent:item.customerName,
-					functionType:3
-				}).then(res => {
-				})
+				var that = this
+				var count=''
+				uni.showLoading({title: '加载中',mask:true})
+				if(item.authenticationStatus=='已认证'){
+
+					this.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount',{
+						compId:'',
+						customerName: item.customerName,
+						goodsName: uni.getStorageSync('goodsName'),
+					}).then(res => {
+						if(res.data.code==200){
+							count=res.data.data
+							
+						}
+					})
+					that.$api.doRequest('get', '/paymentManagement/cumulant',{
+						compId:'',
+						customerName: item.customerName,
+						goodsName: uni.getStorageSync('goodsName'),
+					}).then(res => {
+						for (let i = 0; i < this.purchasePriceList.length; i++) {
+							if(this.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
+								if(this.purchasePriceList[i].saleLimit - res.data.data < 50 || count > 0){
+									this.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${res.data.data}吨,最高可售${this.purchasePriceList[i].saleLimit}吨。`)
+								}else{
+										that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
+										commonId:that.userInfo.id,
+										searchContent:item.customerName+'('+item.customerPhone+')',
+										functionType:3
+									}).then(res => {
+										uni.hideLoading()
+										uni.setStorageSync('checkcustomer',item)
+										uni.navigateBack()
+									})
+								}
+							}
+						}
+					})
+					
+				}else{
+					this.$api.msg('客户身份不可用')
+				}
+				
+			},
+			recentcustomer(item){
+				var count=''
+				var that = this
+				var name=item.searchContent.split('(')[0]
+				
+				for(var i=0;i<this.customerList.length;i++){
+					// console.log(name,this.customerList[i].customerName,name==this.customerList[i].customerName)
+					if(this.customerList[i].customerName==name){
+						uni.showLoading({title: '加载中',mask:true})
+							this.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount',{
+								compId:'',
+								customerName: this.customerList[i].customerName,
+								goodsName: uni.getStorageSync('goodsName'),
+							}).then(res => {
+								if(res.data.code==200){
+									count=res.data.data
+									
+								}
+							})
+							that.$api.doRequest('get', '/paymentManagement/cumulant',{
+								compId:'',
+								customerName: this.customerList[i].customerName,
+								goodsName: uni.getStorageSync('goodsName'),
+							}).then(res => {
+								for (let i = 0; i < this.purchasePriceList.length; i++) {
+									if(this.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
+										if(this.purchasePriceList[i].saleLimit - res.data.data < 50 || count > 0){
+											this.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${res.data.data}吨,最高可售${this.purchasePriceList[i].saleLimit}吨。`)
+										}else{
+												that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
+												commonId:that.userInfo.id,
+												searchContent:this.customerList[i].customerName+'('+this.customerList[i].customerPhone+')',
+												functionType:3
+											}).then(res => {
+												uni.hideLoading()
+												uni.setStorageSync('checkcustomer',this.customerList[i])
+												uni.navigateBack()
+											})
+										}
+									}
+								}
+							})
+							
+					}
+				}
 			},
 			emptysearch(){
+				this.show=false
 				this.searchKeyWord=''
 				this.gridList=[]
 				this.currentPage=1
 				this.getList()
 			},
 			doSearch(){
+				this.show=true
 				this.gridList=[]
 				this.currentPage=1
 				this.getList()
 			},
-			warehousechange(e){
-				this.warehouseName=this.selector[e[0]].warehouseName
-				this.cangid=this.selector[e[0]].id
-				this.warehouseCount = this.selector[e[0]].count
-				this.commonWarehouseNo=this.selector[e[0]].commonWarehouseNo
-				uni.setStorageSync('purchasePriceList',this.selector[e[0]].purchasePriceList)
-				this.getList()
-				console.log(e)
-			},
 			getList(){
 				var that = this
-				this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer',{
-					compId:'',
-					authenticationStatusKey:7,
-					searchKeyWord:this.searchKeyWord
-				}).then(res => {
+				var url=''
+				var data={}
+				if(this.searchKeyWord.length>0){
+					url='/identityAuthenticationInfo/identityAuthenticationInfoCustomer'
+					data={
+						compId:'',
+						authenticationStatusKey:7,
+						searchKeyWord:this.searchKeyWord
+					}
+				}else{
+					url='/searchRecordsInfo/selectSearchRecordsInfo'
+					data={
+						pageSize:this.pageSize,
+						currentPage:this.currentPage,
+						functionType:"3",
+						commonId:this.userInfo.id
+					}
+				}
+				this.$api.doRequest('get', url,data).then(res => {
 					if(res.data.data){
-						let data = res.data.data
+						let data = res.data.data.records?res.data.data.records:res.data.data
 						//采购信息
 						if (data.length > 0) {
-								that.gridList = that.gridList.concat(data)
+								that.gridList = data
 						}else{
 							if(this.currentPage==1){
 								that.gridList=[]
@@ -172,7 +281,6 @@
 							this.isContent=true
 						}
 					}
-					// console.log(that.gridList)
 				})
 			},
 			edit(item){

+ 20 - 7
pages/erpbusiness/examine_quality_testing.vue

@@ -8,31 +8,43 @@
 					{{gridList.warehouseName}}
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view v-if='managementType==1' class="c-row b-b">
 				<view class="title">编号</view>
 				<view class="con-list">
 					{{gridList.qualityNo}}
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view v-if='managementType==3' class="c-row b-b">
+				<view class="title">合同编号</view>
+				<view class="con-list">
+					{{gridList.contractNo}}
+				</view>
+			</view>
+			<view v-if='managementType==1' class="c-row b-b">
 				<view class="title">客户</view>
 				<view class="con-list">
 					{{gridList.customerName}}({{gridList.customerPhone}})
 				</view>
 			</view>
+			<view v-if='managementType==3' class="c-row b-b">
+				<view class="title">货名</view>
+				<view class="con-list">
+					{{gridList.goodsName}}
+				</view>
+			</view>
 			<view class="c-row b-b">
 				<view class="title">车牌号</view>
 				<view class="con-list">
 					{{gridList.carNumber}}
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view v-if='managementType==1' class="c-row b-b">
 				<view class="title">扣重比</view>
 				<view class="con-list">
 					{{gridList.buckleWeightRatio}}
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view v-if='managementType==1' class="c-row b-b">
 				<view class="title">购粮性质</view>
 				<view class="con-list">
 					{{gridList.natureOfGrainPurchase}}
@@ -50,19 +62,19 @@
 					{{gridList.storageTagNo}}
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view v-if='managementType==1' class="c-row b-b">
 				<view class="title">货名</view>
 				<view class="con-list">
 					{{gridList.goodsName}}
 				</view>
 			</view>
-			<view class="c-row b-b">
+			<view v-if='managementType==1' class="c-row b-b">
 				<view class="title">类型</view>
 				<view class="con-list">
 					{{gridList.type}}
 				</view>
 			</view>
-			<view class="c-row">
+			<view v-if='managementType==1' class="c-row">
 				<view class="title">净重单价(元/公斤)</view>
 				<view class="con-list">
 					{{gridList.tidalGrainPrice}}
@@ -217,6 +229,7 @@
 			console.log(options)
 			this.id=options.id
 			this.cangid=options.cangid
+			this.managementType=options.managementType
 		},
 		onShow() {
 			var that = this

+ 33 - 14
pages/erpbusiness/quality_testing.vue

@@ -1,6 +1,13 @@
 <template>
 	<view>
+		<view class='navbar' style='position:fixed;background:#fff;top:0;width:100%;z-index:3;'>
+			<view class="back-btn cuIcon-back" @click="navBack"></view>
+				<view class='header-content' v-if='managementType==3'>出库质检</view>
+				<view class='header-content' v-if='managementType==1'>收购质检</view>
+		</view>
+		
 		<view class="header">
+
 			<view style='background:#fff;display:flex;' class="cu-bar search">
 				<view style='flex:6;' class="search-form round Medium">
 					<text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
@@ -54,7 +61,7 @@
 		<view v-show="isContent">
 			<uni-load-more :status="loadStatus"></uni-load-more>
 		</view>
-		<view class="footer">
+		<view v-if='managementType==1' class="footer">
 			<view @click='add' class="button">新增</view>
 		</view>
 	</view>
@@ -317,10 +324,8 @@
 				this.inputStatus = 'none'
 				this.genderShow = false
 			},
-			myAccount() {
-				uni.navigateTo({
-					url: `/pageA/pages/contract`
-				})
+			navBack() {
+				uni.navigateBack();
 			},
 			/**
 			 * 统一跳转接口,拦截未登录路由
@@ -334,12 +339,6 @@
 					url
 				})
 			},
-			mycarClick(carNo) {
-				this.modalName = null
-				uni.navigateTo({
-					url: `/pageB/car/mycar_detail?carNo=${carNo}`
-				})
-			},
 			scanCode() {
 				uni.scanCode({
 					success: function(res) {
@@ -700,6 +699,28 @@
 	.cu-list>.cu-item:after{
 		border:none;
 	}
+	.back-btn {
+		position: fixed;
+		left: 40upx;
+		z-index: 9999;
+		padding-top: var(--status-bar-height);
+		top: 30upx;
+		font-size: 36upx;
+		color: $font-color-dark;
+	}
+	.navbar{
+		height:50px;
+	}
+	.header-content {
+		position: fixed;
+		left: 50%;
+		transform: translateX(-50%);
+		z-index: 9999;
+		padding-top: var(--status-bar-height);
+		top: 30upx;
+		font-size: 36upx;
+		color: $font-color-dark;
+	}
 	.sign{
 		width: 40px;
 		height: 40px;
@@ -764,11 +785,9 @@
 	}
 	.header{
 		background:#fff;
+		margin-top:60px;
 		border-radius:0px 0px 16px 16px;
 	}
-	.content{
-		margin-bottom:100px;
-	}
 	.footer{
 		background:#fff;
 		position:fixed;