wangchao 3 år sedan
förälder
incheckning
536e059b6d

+ 62 - 23
pages/erpbusiness/acquisitionInspection/grossWeightDetail1.vue

@@ -6,35 +6,35 @@
 				</view>
 				</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">仓库</view>
 				<view class="left">仓库</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.warehouseName}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">合同编号</view>
 				<view class="left">合同编号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.contractNo}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">货名</view>
 				<view class="left">货名</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.goodsName}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">车牌号</view>
 				<view class="left">车牌号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.carNumber}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">仓位号</view>
 				<view class="left">仓位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.binNumber}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">囤位号</view>
 				<view class="left">囤位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.storageNumber}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">出库类型</view>
 				<view class="left">出库类型</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.inOutType}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">货名</view>
 				<view class="left">货名</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.goodsName}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content1">
 		<view class="content1">
@@ -43,15 +43,16 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">皮重(公斤)</view>
 				<view class="left">皮重(公斤)</view>
-				<input class="right-bottom" placeholder="输入皮重"></input>
+				<view class="right">{{detailData.tare}}</view>
+				<!-- <input class="right-bottom" placeholder="输入皮重"></input> -->
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">毛重(公斤)</view>
 				<view class="left">毛重(公斤)</view>
-				<input class="right-bottom" placeholder="输入毛重"></input>
+				<input class="right-bottom" placeholder="输入毛重" v-model="grossWeight"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" style="border: 0;">
 			<view class="row row-bottom" style="border: 0;">
 				<view class="left">净重(公斤)</view>
 				<view class="left">净重(公斤)</view>
-				<input class="right-bottom" disabled placeholder="自动计算"></input>
+				<input class="right-bottom" disabled placeholder="自动计算" v-model="detailData.netWeight"></input>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
@@ -62,12 +63,13 @@
 		</view>
 		</view>
 		<u-toast ref="uToast"/>
 		<u-toast ref="uToast"/>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
-
+		<u-toast ref="uToast" />
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
 	import upload from '@/components/upload.vue';
 	import upload from '@/components/upload.vue';
+	import helper from '@/common/helper.js';
 	export default {
 	export default {
 		components: {
 		components: {
 			upload
 			upload
@@ -78,16 +80,39 @@
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
 				btnLoading: false, //防止重复点击
 				isAdd: true,
 				isAdd: true,
-				detailData: {
-					name: ""
-				}
+				detailData: {},
+				id:'',
+				grossWeight:''
 			}
 			}
 		},
 		},
 		onShow() {},
 		onShow() {},
 		onLoad(options) {
 		onLoad(options) {
+				this.id = helper.detailData.id
+				this.getGrossWeight()
 			// this.detailData = JSON.parse(options.detailData)
 			// this.detailData = JSON.parse(options.detailData)
 		},
 		},
+		watch:{
+			grossWeight(val){
+				console.log(val)
+				this.detailData.grossWeight = val
+				this.detailData.netWeight = parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)
+			},
+		},
 		methods: {
 		methods: {
+			getGrossWeight(){
+				this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
+					id: this.id
+				}).then(res => {
+					if (res.data.code == 200) {
+						console.log(res)
+						this.detailData = res.data.data
+						console.log(helper.selectContractNo.contractNo)
+						if (helper.selectContractNo.contractNo) {
+							this.detailData.contractNo = helper.selectContractNo.contractNo;
+						}
+					}
+				})
+			},
 			filterFileType(index, lists) {
 			filterFileType(index, lists) {
 				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
 				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
 					lists.splice(index, 1);
 					lists.splice(index, 1);
@@ -102,6 +127,7 @@
 			},
 			},
 			getImgUrl(res) {
 			getImgUrl(res) {
 				console.log(res)
 				console.log(res)
+				// this.detailData.pictureAddress =
 				console.log('------------res-----------')
 				console.log('------------res-----------')
 			},
 			},
 			onError(error) {
 			onError(error) {
@@ -113,18 +139,31 @@
 				console.log(e)
 				console.log(e)
 			},
 			},
 			onRemove(index) {},
 			onRemove(index) {},
-			submit(){
-				let that = this
-				uni.showModal({
-					content:"确定提交检斤信息?",
-					success() {
+	submit(){
+		let that = this;
+		if(this.detailData.)
+		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({
 						that.$refs.uToast.show({
-						title: '提交成功',
-						type: 'success',
-					})
+							title: '提交成功',
+							type: 'success',
+							url: '/pages/erpbusiness/acquisitionInspection/acquisitionInspection'
+						})
+					}else{
+						that.$refs.uToast.show({
+							title: '提交失败',
+							type: 'error',
+						})
 					}
 					}
 				})
 				})
 			}
 			}
+		})
+	}
 		}
 		}
 	}
 	}
 </script>
 </script>

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

@@ -49,7 +49,7 @@
 			confirm(item){
 			confirm(item){
 				uni.navigateTo({
 				uni.navigateTo({
 					url:'tareDetail1',
 					url:'tareDetail1',
-					  success: function(res) {
+					  success: function(res) {debugger
 					   helper.selectContractNo = item
 					   helper.selectContractNo = item
 					  }
 					  }
 				})
 				})

+ 43 - 26
pages/erpbusiness/acquisitionInspection/tareDetail1.vue

@@ -10,27 +10,27 @@
 			</view>
 			</view>
 			<view class="row" @click="contractNoClick">
 			<view class="row" @click="contractNoClick">
 				<view class="left">合同编号</view>
 				<view class="left">合同编号</view>
-				<view class="right">仓库仓库仓库仓库仓库1></view>
+				<view class="right">{{detailData.contractNo}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">货名</view>
 				<view class="left">货名</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.goodsName}}</view>
 			</view>
 			</view>
 			<view class="row" style="text-align: right;">
 			<view class="row" style="text-align: right;">
 				<view class="left">车牌号</view>
 				<view class="left">车牌号</view>
-				<input class="right-bottom" placeholder="输入车牌号"></input>
+				<input class="right-bottom" placeholder="输入车牌号" v-model="detailData.carNumber"></input>
 			</view>
 			</view>
 			<view class="row" @click="binNoClick">
 			<view class="row" @click="binNoClick">
 				<view class="left">仓位号</view>
 				<view class="left">仓位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1></view>
+				<view class="right">{{detailData.binNumber}}</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">囤位号</view>
 				<view class="left">囤位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.storageNumber}}</view>
 			</view>
 			</view>
 			<view class="row row-bottom" @click="issueTypeClick">
 			<view class="row row-bottom" @click="issueTypeClick">
 				<view class="left">出库类型</view>
 				<view class="left">出库类型</view>
-				<view class="right">{{issueTypeVal}}></view>
+				<view class="right">{{detailData.inOutType}}></view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<div class="content1">
 		<div class="content1">
@@ -39,28 +39,29 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">皮重(公斤)</view>
 				<view class="left">皮重(公斤)</view>
-				<input class="right-bottom" placeholder="输入毛重"></input>
+				<input class="right-bottom" placeholder="输入皮重" v-model="detailData.tare"></input>
 			</view>
 			</view>
 		</div>
 		</div>
 		<!-- <u-select v-model="isShowContractNo" :list="contractNoList" @confirm="confirmContractNo"></u-select> -->
 		<!-- <u-select v-model="isShowContractNo" :list="contractNoList" @confirm="confirmContractNo"></u-select> -->
 		<u-select v-model="isShowBinNo" :list="binNoList" @confirm="confirmBinNo"></u-select>
 		<u-select v-model="isShowBinNo" :list="binNoList" @confirm="confirmBinNo"></u-select>
 		<u-select v-model="isShowIssueType" :list="issueTypeList" @confirm="confirmIssueTypeNo"></u-select>
 		<u-select v-model="isShowIssueType" :list="issueTypeList" @confirm="confirmIssueTypeNo"></u-select>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
-
+		<u-toast ref="uToast" />
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	import helper from '@/common/helper.js'; 
+	import helper from '@/common/helper.js';
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
 				// isShowContractNo: false,
 				// isShowContractNo: false,
 				isShowBinNo: false,
 				isShowBinNo: false,
 				isShowIssueType: false,
 				isShowIssueType: false,
-				issueTypeVal: "销售出库",
-				detailData: {},
-				id:'',
+				detailData: {
+					inOutType: "销售出库"
+				},
+				id: '',
 				contractNoList: [],
 				contractNoList: [],
 				binNoList: [],
 				binNoList: [],
 				issueTypeList: [{
 				issueTypeList: [{
@@ -84,26 +85,27 @@
 		},
 		},
 		onShow() {},
 		onShow() {},
 		onLoad(options) {
 		onLoad(options) {
-			console.log(helper.detailData); 
-			if(helper.selectContractNo){
-				
-			}
 			this.id = helper.detailData.id
 			this.id = helper.detailData.id
 			this.getWeighingManagement()
 			this.getWeighingManagement()
 		},
 		},
 		methods: {
 		methods: {
-			getWeighingManagement(){
-					this.$api.doRequest('get', '/weighingManagement/getWeighingManagement',
-					{id: this.id}).then(res => {
-						if(res.data.code==200){
+			getWeighingManagement() {
+				this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
+					id: this.id
+				}).then(res => {
+					if (res.data.code == 200) {
 						console.log(res)
 						console.log(res)
 						this.detailData = res.data.data
 						this.detailData = res.data.data
+						console.log(helper.selectContractNo.contractNo)
+						if (helper.selectContractNo.contractNo) {
+							this.detailData.contractNo = helper.selectContractNo.contractNo;
 						}
 						}
-					})
+					}
+				})
 			},
 			},
 			contractNoClick() {
 			contractNoClick() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:"selectContractNo?compId="+this.detailData.compId
+					url: "selectContractNo?compId=" + this.detailData.compId
 				})
 				})
 			},
 			},
 			binNoClick() {
 			binNoClick() {
@@ -116,12 +118,27 @@
 			confirmBinNo(e) {},
 			confirmBinNo(e) {},
 			confirmIssueTypeNo(e) {
 			confirmIssueTypeNo(e) {
 				console.log(e)
 				console.log(e)
-				this.issueTypeVal = e[0].label
+				this.detailData.inOutType = e[0].label
 			},
 			},
-			submit(){
+			submit() {
+				let that = this
 				uni.showModal({
 				uni.showModal({
-					content:"确定提交检斤信息?",
-					success() {
+					content: "确定提交检斤信息?",
+					success: function(res) {
+						debugger
+						if (res.confirm) {
+							that.$api.doRequest('post', '/weighingManagement/api/editTareOut', that.detailData)
+								.then(res => {
+									if (res.data.code == 200) {
+										console.log(res)
+										that.$refs.uToast.show({
+											title: '提交成功',
+											type: 'success',
+											url: '/pages/erpbusiness/acquisitionInspection/warehouseWeighing'
+										})
+									}
+								})
+						}
 						console.log("提交")
 						console.log("提交")
 					}
 					}
 				})
 				})

+ 3 - 2
pages/erpbusiness/acquisitionInspection/warehouseWeighing.vue

@@ -151,14 +151,15 @@
 			grossWeightClick(val) {
 			grossWeightClick(val) {
 				if (val.status == "已质检") return;
 				if (val.status == "已质检") return;
 				console.log(val)
 				console.log(val)
+					helper.detailData = val
 				uni.navigateTo({
 				uni.navigateTo({
-					url: './grossWeightDetail1?detailData=' + JSON.stringify(val)
+					url: './grossWeightDetail1'
 				})
 				})
 			},
 			},
 			tareClick(val) {debugger
 			tareClick(val) {debugger
 				helper.detailData = val
 				helper.detailData = val
 				uni.navigateTo({
 				uni.navigateTo({
-					url: './tareDetail1?detailData=' + JSON.stringify(val)
+					url: './tareDetail1'
 				})
 				})
 			},
 			},
 			delClick(val) {
 			delClick(val) {