ccjgmwz преди 3 години
родител
ревизия
c9933572de

+ 1 - 1
pages/erpbusiness/QRCode/QRCode.vue

@@ -3,7 +3,7 @@
 		<view class="qrcode">
 			<!-- <uqrcode ref="uqrcode"></uqrcode> -->
 			<img :src="imgSrc" alt="" class="img">
-			<view class="qrcode-text">客户扫码</view>
+			<!-- <view class="qrcode-text">客户扫码</view> -->
 		</view>
 	</view>
 </template>

+ 10 - 4
pages/erpbusiness/acquisitionInspection/acquisitionInspection.vue

@@ -34,7 +34,7 @@
 				<view class="row2" v-if="item.paymentManagement">
 					<view>{{item.paymentManagement.customerName}}</view>
 					<view>{{item.paymentManagement.carNo}}</view>
-					<view>{{item.paymentManagement.goodsName}}({{item.waterContent}}水)</view>
+					<view>{{item.paymentManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)</view>
 				</view>
 				<view class="row3">
 					<view class="row3-item">
@@ -52,9 +52,9 @@
 				</view>
 				<view class="row4">
 					<view v-if="item.status!='已称皮重'" class="right" @click="grossWeightClick(item)">毛重</view>
-					<view v-if="!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
-					!(item.paymentManagement&&item.paymentManagement.status=='部分收款')
-					" class="right" @click="tareClick(item)">皮重</view>
+					<view v-if="(!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
+					!(item.paymentManagement&&item.paymentManagement.status=='部分收款')) && item.status!='已质检'"
+					 class="right" @click="tareClick(item)">皮重</view>
 				</view>
 			</view>
 		</view>
@@ -70,6 +70,7 @@
 			return {
 				inputKeyword: '',
 				warehouseName: '',
+				warehouseId: '',
 				isShowWarehouse: false,
 				warehouseList: [],
 				isContent:false,
@@ -136,6 +137,7 @@
 						this.warehouseList.push(_obj)
 					}
 					this.warehouseName = this.warehouseList[0].label
+					this.warehouseId = this.warehouseList[0].value
 					this.getList()
 				})
 			},
@@ -170,11 +172,15 @@
 			//毛重
 			grossWeightClick(val) {
 				console.log(val)
+				val.warehouseName = this.warehouseName
+				val.warehouseId = this.warehouseId
 				uni.navigateTo({
 					url: './grossWeightDetail?detailData=' + JSON.stringify(val)
 				})
 			},
 			tareClick(val) {
+				val.warehouseName = this.warehouseName
+				val.warehouseId = this.warehouseId
 				uni.navigateTo({
 					url: './tareDetail?detailData=' + JSON.stringify(val)
 				})

+ 4 - 3
pages/erpbusiness/acquisitionInspection/grossWeightDetail.vue

@@ -33,7 +33,7 @@
 				<view class="right">{{detailData.goodsName}}</view>
 			</view>
 			<view class="row row-bottom">
-				<view class="left">毛重</view>
+				<view class="left">毛重(公斤)</view>
 				<input class="right-bottom" placeholder="输入毛重" v-model="detailData.grossWeight"></input>
 			</view>
 		</view>
@@ -67,9 +67,10 @@
 						           	if(res.data.code==200){
 						           		that.$refs.uToast.show({
 						           			title: '提交成功',
-						           			type: 'success',
-						           			url: '/pages/erpbusiness/acquisitionInspection/acquisitionInspection'
+						           			type: 'success'
 						           		})
+										uni.navigateBack({
+										})
 						           	}else{
 						           		that.$refs.uToast.show({
 						           			title: '提交失败',

+ 17 - 18
pages/erpbusiness/acquisitionInspection/tareDetail.vue

@@ -38,11 +38,11 @@
 			</view>
 			<view class="row row-bottom">
 				<view class="left">皮重(公斤)</view>
-				<input class="right-bottom" placeholder="输入皮重" v-model="tare"></input>
+				<input class="right-bottom" placeholder="输入皮重" @input="changeInput" v-model="detailData.tare"></input>
 			</view>
 			<view class="row row-bottom">
 				<view class="left">扣杂(公斤)</view>
-				<input class="right-bottom" placeholder="输入扣杂" v-model="buckleMiscellaneous"></input>
+				<input class="right-bottom" placeholder="输入扣杂" @input="changeInput" v-model="detailData.buckleMiscellaneous"></input>
 			</view>
 			<view class="row row-bottom" style="border: 0;">
 				<view class="left">净重(公斤)</view>
@@ -58,40 +58,39 @@
 	export default {
 		data() {
 			return {
-				detailData: {},
-				tare:0,
-				buckleMiscellaneous:0
+				detailData: {
+					tare:0,
+					buckleMiscellaneous:0
+				},
 			}
 		},
 		onShow() {},
 		onLoad(options) {
 			this.detailData = JSON.parse(options.detailData)
-		},
-		watch:{
-			tare(val){
-				console.log(val)
-				this.detailData.tare = val
-				this.detailData.netWeight = parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)-parseFloat(this.detailData.buckleMiscellaneous)
-			},
-			buckleMiscellaneous(val){
-				this.detailData.buckleMiscellaneous = val
-				this.detailData.netWeight = parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)-parseFloat(this.detailData.buckleMiscellaneous)
+			if(!this.detailData.tare){
+				this.detailData.tare = 0
+			}
+			if(!this.detailData.buckleMiscellaneous){
+				this.detailData.buckleMiscellaneous = 0
 			}
 		},
 		methods: {
+			changeInput(){
+				this.detailData.netWeight = parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)-parseFloat(this.detailData.buckleMiscellaneous)
+			},
 			submit(){
 				let that = this;
 				uni.showModal({
 					content:"确定提交检斤信息?",
 					success() {
-						debugger
 						console.log(that.detailData)
 						that.$api.doRequest('post', '/weighingManagement/api/editTare',that.detailData).then(res => {
 							if(res.data.code==200){
 								that.$refs.uToast.show({
 									title: '提交成功',
-									type: 'success',
-									url: '/pages/erpbusiness/acquisitionInspection/acquisitionInspection'
+									type: 'success'
+								})
+								uni.navigateBack({
 								})
 							}else{
 								that.$refs.uToast.show({

+ 1 - 1
pages/erpbusiness/acquisitionInspection/warehouseWeighing.vue

@@ -33,7 +33,7 @@
 				<view class="row2" v-if="item.paymentManagement">
 					<view>{{item.paymentManagement.customerName}}</view>
 					<view>{{item.paymentManagement.carNo}}</view>
-					<view>{{item.paymentManagement.goodsName}}({{item.waterContent}}水)</view>
+					<view>{{item.paymentManagement.goodsName}}({{item.qualityInspectionManagement.waterContent}}水)</view>
 				</view>
 				<view class="row3">
 					<view class="row3-item">

+ 17 - 13
pages/erpbusiness/add_quality_testing.vue

@@ -254,7 +254,7 @@
 			 let number = '000' + this.warehouseCount
 			 number = number.substring(number.length - 4, number.length)
 			this.gridList.warehouseName=options.warehouseName
-			this.gridList.qualityNo='SGRK' + this.getdate() + this.commonWarehouseNo + number
+			this.gridList.qualityNo='ZCRK' + this.getdate() + this.commonWarehouseNo + number
 			this.purchasePriceList=uni.getStorageSync('purchasePriceList')
 			this.cangid=options.cangid
 			this.managementType=options.managementType
@@ -264,6 +264,8 @@
 				this.gridList.customerName=uni.getStorageSync('checkcustomer').customerName
 				this.gridList.customerPhone=uni.getStorageSync('checkcustomer').customerPhone
 			}
+			this.gridList.grade=this.gradeList[0].value
+			this.gridList.gradeKey=this.gradeList[0].key
 			var that = this
 				this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer',{
 					compId:'',
@@ -286,7 +288,9 @@
 						this.goodsList = res.data.data
 						if(this.goodsList.length > 0){
 							this.gridList.goodsName=this.goodsList[0].goodsName
+							this.waterContentChange()
 						}
+						
 						// for (let i = 0; i < res.data.data.length; i++) {
 						// 	this.goodsList.push(res.data.data[i].goodsName)
 						// }
@@ -335,18 +339,18 @@
 				})
 			},
 			getdate() {
-			        var date = new Date()
-			        var year = date.getFullYear() //获取完整的年份(4位)
-			        var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
-			        var datetime = date.getDate() //获取当前日(1-31)
-			        if (mouth < 10) {
-			          mouth = '0' + mouth
-			        }
-			        if (datetime < 10) {
-			          datetime = '0' + datetime
-			        }
-			        return year + mouth + datetime
-			      },
+				var date = new Date()
+				var year = date.getFullYear() //获取完整的年份(4位)
+				var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
+				var datetime = date.getDate() //获取当前日(1-31)
+				if (mouth < 10) {
+				  mouth = '0' + mouth
+				}
+				if (datetime < 10) {
+				  datetime = '0' + datetime
+				}
+				return year +'' + mouth + '' + datetime
+			},
 			submit(){
 				var that = this
 				if (!this.gridList.qualityNo) {

+ 75 - 61
pages/erpbusiness/customer.vue

@@ -145,45 +145,54 @@
 				
 			},
 			checkcustomer(item){
+				debugger
 				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'),
+					uni.showLoading({title: '加载中'})
+					that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
+						commonId:that.userInfo.id,
+						searchContent:item.customerName+'('+item.customerPhone+')',
+						functionType:3
 					}).then(res => {
-						for (let i = 0; i < this.purchasePriceList.length; i++) {
-							var data = res.data.data/1000
-							if(this.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
-								if(this.purchasePriceList[i].saleLimit - data < 50 || count > 0){
-									this.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${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()
-									})
-								}
+						that.$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 => {
+									uni.hideLoading()
+									for (let i = 0; i < that.purchasePriceList.length; i++) {
+										var data = res.data.data/1000
+										if(that.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
+											if(that.purchasePriceList[i].saleLimit - data < 50 || count > 0){
+												that.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data.toFixed(2)}吨,最高可售${that.purchasePriceList[i].saleLimit}吨。`)
+											}
+										}
+									}
+								})
 							}
-						}
+						})
+						uni.setStorageSync('checkcustomer',item)
+						uni.navigateBack()
 					})
+					.catch(res => {
+						uni.showToast({
+							title: '系统异常,请联系管理员',
+							icon: 'none',
+							duration: 2000
+						})
+						uni.hideLoading()
+					})
+					
+					
 					
 				}else{
 					this.$api.msg('客户身份不可用')
@@ -198,42 +207,47 @@
 				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',{
+						uni.showLoading({title: '加载中'})
+						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.setStorageSync('checkcustomer',this.customerList[i])
+							that.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount',{
 								compId:'',
-								customerName: this.customerList[i].customerName,
+								customerName: that.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')){
-										var data = res.data.data/1000
-										if(this.purchasePriceList[i].saleLimit -  data < 50 || count > 0){
-											this.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${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()
-											})
+									that.$api.doRequest('get', '/paymentManagement/cumulant',{
+										compId:'',
+										customerName: that.customerList[i].customerName,
+										goodsName: uni.getStorageSync('goodsName'),
+									}).then(res => {
+										for (let i = 0; i < that.purchasePriceList.length; i++) {
+											if(that.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
+												var data = res.data.data/1000
+												if(that.purchasePriceList[i].saleLimit -  data < 50 || count >0){
+													that.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data.toFixed(2)}吨,最高可售${that.purchasePriceList[i].saleLimit}吨。`)
+												}
+											}
 										}
-									}
+									})
 								}
 							})
-							
+							uni.navigateBack()							
+							uni.hideLoading()
+						})
+						.catch(res => {
+							uni.showToast({
+								title: '系统异常,请联系管理员',
+								icon: 'none',
+								duration: 2000
+							})
+							uni.hideLoading()
+						})
 					}
 				}
 			},

+ 23 - 13
pages/erpbusiness/quality_testing.vue

@@ -11,9 +11,9 @@
 			<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 v-if='managementType==1' type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
+					<input v-if='managementType==1' type="text" maxlength="20"  v-model="searchKeyWord" @confirm="doSearch()"
 						 placeholder="输入编号、客户名、车牌号" confirm-type="search"></input>
-					<input v-if='managementType==3' type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
+					<input v-if='managementType==3' type="text" maxlength="20"  v-model="searchKeyWord" @confirm="doSearch()"
 						 placeholder="输入合同编号、车牌号" confirm-type="search"></input>
 				</view>
 				<view @click='doSearch()' class="Regular" style="width:4%;flex:1;">搜索</view>
@@ -229,7 +229,7 @@
 				this.currentPage=1
 				this.getList()
 			},
-			warehousechange(e){
+			warehousechange(e){debugger
 				this.warehouseName=this.selector[e[0]].warehouseName
 				this.cangid=this.selector[e[0]].id
 				this.warehouseCount = this.selector[e[0]].count
@@ -247,7 +247,7 @@
 					searchType: this.searchType,
 					managementType:this.managementType,
 					warehouseName: this.warehouseName,
-					compId:'2710b21efc1e4393930c5dc800010dc4',
+					compId:'',
 					// pcFlag:1
 				}).then(res => {
 					if(res.data.data){
@@ -276,15 +276,25 @@
 				})
 			},
 			del(item){
-				this.$api.doRequest('post', '/qualityInspectionManagement/api/deleteQualityInspection',{
-					id:item.id
-				}).then(res => {
-					if(res.data.code==200){
-						this.$api.msg('删除成功')
-						this.gridList=[]
-						this.getList()
-					}else{
-						this.$api.msg('系统异常,请联系管理员')
+				var that=this
+				uni.showModal({
+					content: "是否删除该质检信息?",
+					showCancel: true,
+					confirmText: '删除',
+					success: function(res) {
+						if (res.confirm) {
+							that.$api.doRequest('post', '/qualityInspectionManagement/api/deleteQualityInspection',{
+								id:item.id
+							}).then(res => {
+								if(res.data.code==200){
+									that.$api.msg('删除成功')
+									that.gridList=[]
+									that.getList()
+								}else{
+									that.$api.msg('系统异常,请联系管理员')
+								}
+							})
+						}
 					}
 				})
 			},