Browse Source

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

wangchao 3 years ago
parent
commit
707f25c40a

+ 22 - 19
pages/erp/exWarehousing/exWarehousing.vue

@@ -33,20 +33,19 @@
 			</view>
 			<view class="row row-bottom">
 				<view class="left">净重(吨)</view>
-				<input @input='calculate' v-model='detailData.netWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算"></input>
+				<input v-model='netWeight' disabled class="right-bottom" placeholder="不可编辑,自动计算"></input>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">扣重比</view>
-				<input v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"></input>
+				<input v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比" @input="pureWeightCount"></input>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">干粮水分(%)</view>
-				<input v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"></input>
+				<input v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比" @input="pureWeightCount"></input>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">潮粮水分(%)</view>
-				<input v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"></input>
+				<input v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"  @input="pureWeightCount"></input>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">纯重(吨)</view>
@@ -192,8 +191,6 @@
 				binNumber:'',
 				detailData: {
 					contractNo: "请选择合同编号或移库任务编号",
-					carNo: '辽H12345',
-					name: "",
 					type: "请选择类型",
 					grade: "请输入品级",
 					agent: "请选择经办人",
@@ -211,21 +208,24 @@
 					second: true
 				},
 				inOutDate1: "",
+				netWeight:""
 			}
 		},
+		watch:{
+			netWeight:function(v){
+				this.pureWeightCount()
+			},
+		},
 		onLoad(options) {
 			this.id = options.id
 			this.cangId = options.cangId
 		},
 		onShow() {
-			console.log(helper.erpWarehouse.baseId,"仓位id")
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.warehouseName = helper.erpWarehouse.warehouseName
 			this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
 			this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
 			this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
-			console.log(this.detailData.goodsNameKey,"keyzhi")
-			console.log(uni.getStorageSync('erpContractNoList'))
 			if(!this.detailData.contractNo){
 				this.detailData.contractNo = '请选择合同编号'
 			}
@@ -238,6 +238,14 @@
 			this.handler()
 		},
 		methods: {
+			//计算纯重
+			pureWeightCount(){
+				if(this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this.detailData.tidalGrainWater){
+					// 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
+					this.detailData.pureWeight = 100-(this.detailData.tidalGrainWater - this.detailData.solidGrainWater)*this.netWeight*this.detailData.buckleWeightRatio/100
+				   this.detailData.pureWeight= this.detailData.pureWeight.toFixed(3)
+				}
+			},
 			outWarehouse(){
 				this.$api.doRequest('get', '/commonSysParameter/getInfo', {
 					constId: 'CON6'
@@ -260,11 +268,11 @@
 				this.detailData.type = this.typeList[e].type
 			},
 			pjPicker(e) {
-				console.log(e[0],"dd")
 				this.detailData.gradeKey = e[0]
 				this.detailData.grade = this.pjList[e].type
 			},
 			handlerPicker(e) {
+				this.detailData.agentKey = e[0]
 				this.detailData.agent = this.handlerList[e].staffName
 			},
 			dateChange(e) {
@@ -288,7 +296,7 @@
 			},
 			calculate() {
 				if (this.detailData.grossWeight && this.detailData.tare) {
-					this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
+					this.netWeight = this.detailData.grossWeight - this.detailData.tare
 				}
 			},
 			getImgUrl(res) {
@@ -329,7 +337,6 @@
 				})
 			},
 			onProgress(e) {
-				console.log(e)
 			},
 			onRemove(index) {},
 			submit(num) {
@@ -352,11 +359,9 @@
 				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
 				this.detailData.positionId = helper.erpWarehouse.baseId
 				this.detailData.binNumber = this.binNumber
-				console.log(this.detailData.positionId,"仓库id")
-				console.log(this.detailData.binNumber,"仓库号")
 				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
-				console.log(this.detailData.goodsNameKey,"|key值")
 				this.detailData.compId = helper.erpWarehouse.compId
+				this.detailData.netWeight = this.netWeight
 				this.detailData.inOutFlag = 1
 				this.detailData.taskType = "出库任务"
 				this.detailData.pcFlag = 0 
@@ -370,8 +375,6 @@
 					title = "提交成功"
 				}
 				let that = this
-				console.log(this.detailData,"提交对象")
-				return
 				uni.showModal({
 					content: "确定提交出库信息?",
 					success(res) {
@@ -389,7 +392,7 @@
 			},
 			slectcontractNo() {
 				uni.navigateTo({
-					url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
+					url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
 				})
 			},
 			slectCarNo() {

+ 2 - 3
pages/erp/improvedExWaehousing/improvedExWaehousing.vue

@@ -34,6 +34,8 @@
 				show2:false,
 				currentPage: 1,
 				pageSize: 10,
+				positionId:"",
+				binNumber:"",
 				warehouseName: '鲅鱼圈一号库',
 				positionName: '102仓位',
 					warehouseList: [
@@ -76,8 +78,6 @@
 		},
 		methods: {
 			getList(){
-				// this.detailData.positionId = helper.erpWarehouse.baseId
-				// this.detailData.binNumber = this.binNumber
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectWarehouseInOutInfo',
 					{positionId:helper.erpWarehouse.baseId,binNumber:helper.erpWarehouse.binNumber,currentPage:this.currentPage,pageSize:this.pageSize}).then(res => {
 					if (res.data.code == 200) {
@@ -91,7 +91,6 @@
 			goDetail(val){
 				uni.navigateTo({
 					url:'improvedWrehousingDetail?data='+val,
-					
 				})
 			}
 			

+ 31 - 21
pages/erp/warehousing/selectContractNo.vue

@@ -37,7 +37,8 @@
 				newSelectList:[],
 				filterNewList: [],
 				moreList:[],
-				compId: ''
+				compId: '',
+				flag:""
 			}
 		},
 
@@ -48,6 +49,7 @@
 			this.newSelectList =  uni.getStorageSync('erpContractNoList');
 		},
 		onLoad(options) {
+			this.flag = options.flag
 			this.compId = helper.erpWarehouse.compId 
 			console.log(helper.selectContractNo); 
 			this.getContractNoList()
@@ -84,26 +86,34 @@
 				uni.navigateBack({})
 			},
 			getContractNoList() {
-				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					compId: this.compId,
-					flag: 7,
-				}).then(res => {
-					if (res.data.code == 200) {
-						console.log(res)
-						this.newList = res.data.data
-						// this.makeMoreList()
-					}
-				})
-				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					compId: this.compId,
-					flag: 6,
-				}).then(res => {
-					if (res.data.code == 200) {
-						console.log(res)
-						this.moreList = res.data.data
-						// this.makeMoreList()
-					}
-				})
+				if(this.flag){
+					this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+						compId: this.compId,
+						flag: 5,
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.newList = res.data.data
+						}
+					})
+				}else{
+					this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+						compId: this.compId,
+						flag: 7,
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.newList = res.data.data
+						}
+					})
+					this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+						compId: this.compId,
+						flag: 6,
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.moreList = res.data.data
+						}
+					})
+				}
+				
 			},
 		
 		}