Sfoglia il codice sorgente

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

# Conflicts:
#	pages/erpbusiness/examine_quality_testing.vue
ccjgmwz 3 anni fa
parent
commit
9d1277c78a

+ 14 - 2
pageD/identity/companyIdentity.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="center">
 	<view class="center">
-		<view class="top">
+		<view v-if='!status' class="top">
 			<text @click='consent' v-bind:class="switchs1">公司</text>
 			<text @click='consent' v-bind:class="switchs1">公司</text>
 			<text @click='consent' v-bind:class="switchs2">个人</text>
 			<text @click='consent' v-bind:class="switchs2">个人</text>
 		</view>
 		</view>
@@ -117,7 +117,7 @@
 				id1: "../../static/img/authentication/identityup(3).png",
 				id1: "../../static/img/authentication/identityup(3).png",
 				id2: "../../static/img/authentication/identitylow(3).png",
 				id2: "../../static/img/authentication/identitylow(3).png",
 				identityImgs1: {},
 				identityImgs1: {},
-
+status:false,
 				identityAuthenticationInfo: {},
 				identityAuthenticationInfo: {},
 				tempFilePaths: [],
 				tempFilePaths: [],
 				businessLicenseAddressUrl: "",
 				businessLicenseAddressUrl: "",
@@ -126,6 +126,18 @@
 		},
 		},
 		computed: {
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 			...mapState(['hasLogin', 'userInfo'])
+		},
+		onLoad(options) {
+			if(options.status){
+				this.status=true
+				this.consentStatus = false
+				this.consentStatus1 = true
+				this.switchs1 = "switchs2"
+				this.switchs2 = "switchs1"
+			}
+		},
+		onShow(){
+			
 		},
 		},
 		methods: {
 		methods: {
 			filterFileType(index, lists) {
 			filterFileType(index, lists) {

+ 34 - 9
pages/erp/contactCustomerService/contactCustomerService.vue

@@ -3,17 +3,18 @@
 		<view class="content">
 		<view class="content">
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">姓名</view>
 				<view class="left">姓名</view>
-				<input @input='calculate' class="right-bottom" placeholder="请输入姓名"></input>
+				<input v-model="personInfo.name" 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 @input='calculate' class="right-bottom" placeholder="请输入电话"></input>
+				<input class="right-bottom" v-model="personInfo.mobilePhone" placeholder="请输入电话"></input>
 			</view>
 			</view>
 			<view class="row no-boder">
 			<view class="row no-boder">
 				<view class="left">留言</view>
 				<view class="left">留言</view>
 			</view>
 			</view>
 			<view class="row no-boder">
 			<view class="row no-boder">
-				<u-input v-model="value" :type="type" :border="border" :height="height" :auto-height="autoHeight" />
+				<u-input v-model="personInfo.message" :type="type" :border="border" :height="height"
+					:auto-height="autoHeight" />
 			</view>
 			</view>
 			<view class="bottom">
 			<view class="bottom">
 				<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
 				<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
@@ -33,10 +34,16 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
-				value: '',
+				personInfo: {
+					name: '',
+					mobilePhone: '',
+					message: '',
+					type: 1
+
+				},
 				type: 'textarea',
 				type: 'textarea',
 				border: true,
 				border: true,
-				height: 100,
+				height: 150,
 				autoHeight: true,
 				autoHeight: true,
 			}
 			}
 		},
 		},
@@ -105,11 +112,29 @@
 			},
 			},
 			calculate() {},
 			calculate() {},
 			submit() {
 			submit() {
-				this.$refs.uToast.show({
-					title: '登录成功',
-					type: 'error',
-					url: '/pages/user/index'
+				if (!this.personInfo.name) {
+					this.$refs.uToast.show({
+						title: '姓名不能为空!',
+						type: 'error',
+					})
+				}
+				if (!this.personInfo.mobilePhone) {
+					this.$refs.uToast.show({
+						title: '电话号码不能为空!',
+						type: 'error',
+					})
+				}
+				this.$api.doRequest('post', '/openServiceInfo/api/addInfo', this.personInfo).then(res => {
+					
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '提交成功,客服人员会及时与您取得联系。!',
+							type: 'success',
+							back: true
+						})
+					}
 				})
 				})
+
 			}
 			}
 		}
 		}
 	}
 	}

+ 129 - 65
pages/erp/exWarehousing/exWarehousing.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<view class="warp">
 	<view class="warp">
 		<view class="top">
 		<view class="top">
-			<view class="top-left">鲅鱼圈一号库</view>
-			<view>102仓位</view>
+			<view class="top-left">{{warehouseName}}</view>
+			<view>{{binNumber}}仓位</view>
 		</view>
 		</view>
 		<view class="content">
 		<view class="content">
 			<view class="row">
 			<view class="row">
@@ -33,20 +33,22 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">净重(吨)</view>
 				<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>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">扣重比</view>
 				<view class="left">扣重比</view>
-				<input v-model='detailData.deductWeight' class="right-bottom" placeholder="输入扣重比"></input>
+				<input v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">干粮水分(%)</view>
 				<view class="left">干粮水分(%)</view>
-				<input v-model='detailData.waterMin' class="right-bottom" placeholder="输入干粮水分占比"></input>
+				<input v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">潮粮水分(%)</view>
 				<view class="left">潮粮水分(%)</view>
-				<input v-model='detailData.waterContent' class="right-bottom" placeholder="输入潮粮水分占比"></input>
+				<input v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">纯重(吨)</view>
 				<view class="left">纯重(吨)</view>
@@ -80,7 +82,8 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">车牌号</view>
 				<view class="left">车牌号</view>
-				<input v-model='detailData.carNumber' class="right-bottom" placeholder="请输入车牌号"></input>
+				<input v-if="!isPC" v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
+				<view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
@@ -95,31 +98,38 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">质检员</view>
 				<view class="left">质检员</view>
-				<input v-model='detailData.qualityInspector' class="right-bottom" placeholder="输入质检员姓名"></input>
+				<input v-model='detailData.warehouseInOutDetail.qualityInspector' 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 v-model='detailData.waterContent' class="right-bottom" placeholder="输入水分占比"></input>
+				<input v-model='detailData.warehouseInOutDetail.waterContent' 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 v-model='detailData.bulkDensity' class="right-bottom"  placeholder="输入容重"></input>
+				<input v-model='detailData.warehouseInOutDetail.bulkDensity' 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 v-model='detailData.jiaorenli' class="right-bottom" placeholder="输入热损伤占比"></input>
+				<input v-model='detailData.warehouseInOutDetail.jiaorenli' 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 v-model='detailData.impurity' class="right-bottom" placeholder="输入杂质占比"></input>
+				<input v-model='detailData.warehouseInOutDetail.impurity' 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 v-model='detailData.mildewGrain' class="right-bottom" placeholder="输入霉变粒占比"></input>
+				<input v-model='detailData.warehouseInOutDetail.mildewGrain' 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 v-model='detailData.imperfectGrain' class="right-bottom" placeholder="输入不完善粒占比"></input>
+				<input v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
+					placeholder="输入不完善粒占比"></input>
 			</view>
 			</view>
 		</view>
 		</view>
 		<u-toast ref="uToast" />
 		<u-toast ref="uToast" />
@@ -132,7 +142,10 @@
 
 
 <script>
 <script>
 	import upload from '@/components/upload.vue';
 	import upload from '@/components/upload.vue';
-	import helper from '@/common/helper.js'; 
+	import helper from '@/common/helper.js';
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 	export default {
 		components: {
 		components: {
 			upload
 			upload
@@ -147,9 +160,10 @@
 				show5: false,
 				show5: false,
 				show6: false,
 				show6: false,
 				show7: false,
 				show7: false,
-				contractNoList: [{
-					contractNo: "123"
-				}],
+				isPC: true,
+				// contractNoList: [{
+				// 	contractNo: ""
+				// }],
 				typeList: [{
 				typeList: [{
 						type: "干粮"
 						type: "干粮"
 					},
 					},
@@ -188,16 +202,17 @@
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
 				btnLoading: false, //防止重复点击
 				isAdd: true,
 				isAdd: true,
+				warehouseName: '',
+				binNumber: '',
 				detailData: {
 				detailData: {
 					contractNo: "请选择合同编号或移库任务编号",
 					contractNo: "请选择合同编号或移库任务编号",
-					carNo: '辽H12345',
-					name: "",
 					type: "请选择类型",
 					type: "请选择类型",
 					grade: "请输入品级",
 					grade: "请输入品级",
 					agent: "请选择经办人",
 					agent: "请选择经办人",
 					inOutDate: "请选择出库日期",
 					inOutDate: "请选择出库日期",
 					inOutType: "请选择出库类型",
 					inOutType: "请选择出库类型",
-					qualityInspectionManagement: {}
+					warehouseInOutDetail: {},
+					gradeKey: "",
 				},
 				},
 				params: {
 				params: {
 					year: true,
 					year: true,
@@ -207,31 +222,70 @@
 					minute: true,
 					minute: true,
 					second: true
 					second: true
 				},
 				},
-				inOutDate1: "",
+				// inOutDate1: "",
+				netWeight: ""
 			}
 			}
 		},
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		watch: {
+			netWeight: function(v) {
+				this.pureWeightCount()
+			},
+		},
 		onLoad(options) {
 		onLoad(options) {
 			this.id = options.id
 			this.id = options.id
 			this.cangId = options.cangId
 			this.cangId = options.cangId
 		},
 		},
 		onShow() {
 		onShow() {
+			this.binNumber = helper.erpWarehouse.binNumber
+			this.warehouseName = helper.erpWarehouse.warehouseName
+			this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
+			if(uni.getStorageSync('erpContractNo').contractNo){
+				this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
+			}
+			this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
+			if (!uni.getStorageSync('erpContractNo').tranCarInfoList)
+			 uni.getStorageSync('erpContractNo').tranCarInfoList = []
+			if (!this.detailData.contractNo) {
+				this.detailData.contractNo = '请选择合同编号'
+			} else {
+				if(uni.getStorageSync('erpContractNo').tranCarInfoList){
+				if (uni.getStorageSync('erpContractNo').tranCarInfoList.length == 0) {
+					this.isPC = false
+				}}
+			}
+			if (!this.detailData.goodsName) {
+				this.detailData.goodsName = '货名'
+			}
 			//出库类型
 			//出库类型
 			this.outWarehouse()
 			this.outWarehouse()
 			//经办人
 			//经办人
 			this.handler()
 			this.handler()
 		},
 		},
 		methods: {
 		methods: {
-			outWarehouse(){
+			//计算纯重
+			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', {
 				this.$api.doRequest('get', '/commonSysParameter/getInfo', {
 					constId: 'CON6'
 					constId: 'CON6'
 				}).then(res => {
 				}).then(res => {
 					this.warehousingTypeList = res.data.data
 					this.warehousingTypeList = res.data.data
 				})
 				})
 			},
 			},
-			handler(){
+			handler() {
 				this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
 				this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
-					compId:helper.erpWarehouse.compId,
-					warehouseId:helper.erpWarehouse.warehouseId
+					compId: helper.erpWarehouse.compId,
+					warehouseId: helper.erpWarehouse.warehouseId
 				}).then(res => {
 				}).then(res => {
 					this.handlerList = res.data.data
 					this.handlerList = res.data.data
 				})
 				})
@@ -243,14 +297,16 @@
 				this.detailData.type = this.typeList[e].type
 				this.detailData.type = this.typeList[e].type
 			},
 			},
 			pjPicker(e) {
 			pjPicker(e) {
+				this.detailData.gradeKey = e[0]
 				this.detailData.grade = this.pjList[e].type
 				this.detailData.grade = this.pjList[e].type
 			},
 			},
 			handlerPicker(e) {
 			handlerPicker(e) {
+				this.detailData.agentKey = e[0]
 				this.detailData.agent = this.handlerList[e].staffName
 				this.detailData.agent = this.handlerList[e].staffName
 			},
 			},
 			dateChange(e) {
 			dateChange(e) {
-				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
-				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
+				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute +":" + e.second
+				// this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 			},
 			},
 			warehousingTypePicker(e) {
 			warehousingTypePicker(e) {
 				this.detailData.inOutType = this.warehousingTypeList[e].constValue
 				this.detailData.inOutType = this.warehousingTypeList[e].constValue
@@ -269,7 +325,7 @@
 			},
 			},
 			calculate() {
 			calculate() {
 				if (this.detailData.grossWeight && this.detailData.tare) {
 				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) {
 			getImgUrl(res) {
@@ -285,36 +341,37 @@
 			binNumberpicker(e) {
 			binNumberpicker(e) {
 				this.detailData.binNumber = this.positionList[e[0]].binNumber
 				this.detailData.binNumber = this.positionList[e[0]].binNumber
 			},
 			},
-			getWeighingManagement() {
-				this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
-					id: this.id
-				}).then(res => {
-					if (res.data.code == 200) {
-						this.detailData = res.data.data
-					}
-				})
-				this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-					id: this.cangId
-				}).then(res => {
-					if (res.data.code == 200) {
-						this.positionList = res.data.data.warehousePositionInfoList
-					}
-				})
-				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					compId: '',
-					flag: 5
-				}).then(res => {
-					if (res.data.code == 200) {
-						this.contractNoList = res.data.data
-					}
-				})
-			},
-			onProgress(e) {
-				console.log(e)
-			},
+			// getWeighingManagement() {
+			// 	this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
+			// 		id: this.id
+			// 	}).then(res => {
+			// 		if (res.data.code == 200) {
+			// 			this.detailData = res.data.data
+			// 		}
+			// 	})
+			// 	this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+			// 		id: this.cangId
+			// 	}).then(res => {
+			// 		if (res.data.code == 200) {
+			// 			this.positionList = res.data.data.warehousePositionInfoList
+			// 		}
+			// 	})
+			// 	this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+			// 		compId: '',
+			// 		flag: 5
+			// 	}).then(res => {
+			// 		if (res.data.code == 200) {
+			// 			this.contractNoList = res.data.data
+			// 		}
+			// 	})
+			// },
+			onProgress(e) {},
 			onRemove(index) {},
 			onRemove(index) {},
 			submit(num) {
 			submit(num) {
-				
+				if (!this.detailData.grossWeight) {
+					this.$api.msg('毛重不能为空')
+					return
+				}
 				if (!this.detailData.grossWeight) {
 				if (!this.detailData.grossWeight) {
 					this.$api.msg('毛重不能为空')
 					this.$api.msg('毛重不能为空')
 					return
 					return
@@ -330,20 +387,27 @@
 					this.$api.msg('毛重输入错误!')
 					this.$api.msg('毛重输入错误!')
 					return
 					return
 				}
 				}
+				this.detailData.baseId = helper.erpWarehouse.warehouseId
+				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
+				this.detailData.positionId = helper.erpWarehouse.positionId
+				this.detailData.binNumber = this.binNumber
+				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
 				this.detailData.compId = helper.erpWarehouse.compId
 				this.detailData.compId = helper.erpWarehouse.compId
+				this.detailData.netWeight = this.netWeight
+				this.detailData.inOutFlag = 1
+				this.detailData.taskType = "出库任务"
+				this.detailData.pcFlag = 0
 				let title = ""
 				let title = ""
-				if(num == 1 ){
-					this.detailData.inOutFlag = 1
+				if (num == 1) {
 					this.detailData.statusFlag = 1
 					this.detailData.statusFlag = 1
+					this.detailData.backOffice = this.userInfo.userName
+					this.detailData.backOfficeId = this.userInfo.id
 					title = "暂存成功"
 					title = "暂存成功"
-				}else if(num == 2){
-					this.detailData.inOutFlag = 1
+				} else if (num == 2) {
 					this.detailData.statusFlag = 3
 					this.detailData.statusFlag = 3
 					title = "提交成功"
 					title = "提交成功"
 				}
 				}
 				let that = this
 				let that = this
-				console.log(this.detailData,"提交对象")
-				return
 				uni.showModal({
 				uni.showModal({
 					content: "确定提交出库信息?",
 					content: "确定提交出库信息?",
 					success(res) {
 					success(res) {
@@ -361,7 +425,7 @@
 			},
 			},
 			slectcontractNo() {
 			slectcontractNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
+					url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
 				})
 				})
 			},
 			},
 			slectCarNo() {
 			slectCarNo() {

+ 91 - 68
pages/erp/improvedExWaehousing/improvedExWaehousing.vue

@@ -1,112 +1,135 @@
 <template>
 <template>
 	<view class="wrap">
 	<view class="wrap">
 		<view class="dropdown content1">
 		<view class="dropdown content1">
-			<view class="left"  @click='show1=true'>
+			<view class="left" @click='show1=true'>
 				<view>{{warehouseName}}</view>
 				<view>{{warehouseName}}</view>
-				<u-icon name="arrow-right" color=""></u-icon>
-				<u-select v-model="show1" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
-				</u-select>
+				<u-icon name="arrow-right"></u-icon>
+				<!-- <u-picker v-model="show1" :default-value='[0]' mode="selector" :list="warehouseList" @confirm="confirmWarehouse">
+				</u-picker> -->
+				<u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
+					:range="warehouseList"></u-picker>
 			</view>
 			</view>
-			<view class="right"  @click='show2=true'>
-				<view>{{positionName}}</view>
-				<u-icon name="arrow-right" color=""></u-icon>
-				<u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
-				</u-select>
+			<view class="right" @click='show2=true'>
+				<view>{{binNumber}}仓位</view>
+				<u-icon name="arrow-right"></u-icon>
+				<!-- <u-picker v-model="show2" :default-value='[0]' mode="selector" :list="positionList" @confirm="confirmPositon">
+				</u-picker> -->
+				<u-picker @confirm="warehouseCWchange" range-key='binNumber' mode="selector" v-model="show2"
+					:range="warehouseCWList"></u-picker>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
 			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
 			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
-				<view class="item-style">{{item.val1}}</view>
-				<view class="item-style">{{item.val2}}</view>
-				<view class="item-style">{{item.val3}}</view>
-				<view class="item-style">{{item.val4}}</view>
+				<view class="item-style">{{item.contractNo}}</view>
+				<view class="item-style">{{item.carNo}}</view>
+				<view class="item-style">{{item.inOutDate}}</view>
+				<view class="item-style">{{item.backOffice}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import helper from '@/common/helper.js';
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				show1:false,
-				show2:false,
-				warehouseName: '鲅鱼圈一号库',
-				positionName: '102仓位',
-					warehouseList: [
-						{
-						"label": '1',
-						"value": '1'
-						}
-					],
-					positionList: [
-						{
-						"label": '102仓位',
-						"value": '1'
-						}
-					],
-					dataList:[
-						{
-						val1:'我是合同编号',
-						val2:'我是车牌号',
-						val3:'我是暂存时间',
-						val4:'我是提交人姓名'
-					},
-					{
-						val1:'我是合同编号',
-						val2:'我是车牌号',
-						val3:'我是暂存时间',
-						val4:'我是提交人姓名'
-					},
-					{
-						val1:'我是合同编号',
-						val2:'我是车牌号',
-						val3:'我是暂存时间',
-						val4:'我是提交人姓名'
-					},
-					]
+				show1: false,
+				show2: false,
+				currentPage: 1,
+				pageSize: 10,
+				positionId: "",
+				binNumber: "",
+				// warehouseName: '鲅鱼圈一号库',
+				// positionName: '102仓位',
+				binNumber: "",
+				warehouseName: '',
+				warehouseList: [],
+				warehouseCWList:[],
+				
+				// positionList: [{
+				// 	"label": '102仓位',
+				// 	"value": '1'
+				// }],
+				dataList: []
 			}
 			}
 		},
 		},
+		onLoad() {
+			this.positionId = helper.erpWarehouse.positionId
+			this.getList()
+		},
+		onShow() {
+			let _data = helper.erpWarehouse
+			this.positionId = _data.positionId
+			this.warehouseList = _data.allWarehouse
+			this.warehouseCWList = _data.warehouseCWList
+			this.warehouseName = _data.warehouseName
+			this.binNumber = _data.binNumber
+		},
 		methods: {
 		methods: {
-			confirmWarehouse(){},
-			confirmPositon(){},
-			goDetail(val){
+			getList() {
+				this.$api.doRequest('get', '/warehouseInOutInfo/selectWarehouseInOutInfo', {
+					positionId:this.positionId,
+					baseId: helper.erpWarehouse.warehouseId,
+					currentPage: this.currentPage,
+					pageSize: this.pageSize,
+					inOutFlag:1
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.dataList = res.data.data.records
+					}
+				})
+			},
+			warehousechange(e) {
+				 this.warehouseName = this.warehouseList[e[0]].warehouseName
+			},
+			warehouseCWchange(e) {
+				 this.binNumber = this.warehouseCWList[e[0]].binNumber
+			},
+			goDetail(val) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'improvedWrehousingDetail?data='+val,
-					
+					url: '/pages/erp/improvedExWaehousing/improvedExWaehousingDetail?data=' + JSON.stringify(val),
 				})
 				})
 			}
 			}
-			
+
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-	.dropdown{
+	.dropdown {
 		display: flex;
 		display: flex;
-		margin:20rpx 0;
+		margin: 20rpx 0;
 		justify-content: space-between;
 		justify-content: space-between;
-		.left,.right{
+
+		.left,
+		.right {
 			display: flex;
 			display: flex;
 		}
 		}
 	}
 	}
-	.content1{
-		background: red;
-		padding: 20rpx;
+
+	.content1 {
+		padding: 40rpx 20rpx;
 		margin: 20rpx;
 		margin: 20rpx;
 		border-radius: 10rpx;
 		border-radius: 10rpx;
+		background: #FFFFFF;
 	}
 	}
-	.content2{
-		padding: 20rpx;
+
+	.content2 {
+		// padding: 20rpx;
 		margin: 20rpx;
 		margin: 20rpx;
-		border-bottom: 1px solid #ccc;
-		background: yellow;
-		.content2-item{
+		// border-bottom: 1px solid #ccc;
+		background: #FFFFFF;
+		border-radius: 10rpx;
+
+		.content2-item {
+			padding: 20rpx;
 			margin-bottom: 10rpx;
 			margin-bottom: 10rpx;
-			border-bottom:1px solid #ccc ;
+			border-bottom: 1px solid #ccc;
 			// padding-bottom: 10px;
 			// padding-bottom: 10px;
 		}
 		}
-		.item-style{
+
+		.item-style {
 			display: inline-block;
 			display: inline-block;
 			width: 50%;
 			width: 50%;
 		}
 		}

+ 214 - 128
pages/erp/improvedExWaehousing/improvedExWaehousingDetail.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<view class="warp">
 	<view class="warp">
 		<view class="top">
 		<view class="top">
-			<view class="top-left">鲅鱼圈一号库</view>
-			<view>102仓位</view>
+			<view class="top-left">{{warehouseName}}</view>
+			<view>{{binNumber}}仓位</view>
 		</view>
 		</view>
 		<view class="content">
 		<view class="content">
 			<view class="row">
 			<view class="row">
@@ -11,13 +11,15 @@
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">货名</view>
 				<view class="left">货名</view>
-				<view class="right">{{detailData.goodsName}}</view>
+				<view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
+				</view>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">类型</view>
 				<view class="left">类型</view>
-				<view @click='show1=true'>请选择类型</view>
+				<view @click='show1=true'>{{detailData.type}}</view>
 				<u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
 				<u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
 					mode="selector">
 					mode="selector">
+					<!-- <view class="">{{detailData.type}}</view> -->
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
@@ -27,74 +29,65 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">皮重(吨)</view>
 				<view class="left">皮重(吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="输入皮重"></input>
+				<input @input='calculate' v-model='detailData.tare' 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 @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算"></input>
+				<input v-model='netWeight' disabled class="right-bottom" placeholder="不可编辑,自动计算"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">扣重比</view>
 				<view class="left">扣重比</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="输入扣重比"></input>
+				<input v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">干粮水分(%)</view>
 				<view class="left">干粮水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="输入干粮水分占比"></input>
+				<input v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">潮粮水分(%)</view>
 				<view class="left">潮粮水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="输入潮粮水分占比"></input>
+				<input v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type == '潮粮'">
 				<view class="left">纯重(吨)</view>
 				<view class="left">纯重(吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算"></input>
+				<input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">品级</view>
 				<view class="left">品级</view>
-				<view @click='show3=true'>请选择品级</view>
-				<u-picker :range="pjList" range-key="name" @confirm='handlerPicker($event)' v-model="show3" mode="selector">
+				<view @click='show3=true'>{{detailData.grade}}</view>
+				<u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">经办人</view>
 				<view class="left">经办人</view>
-				<view @click='show6=true'>请选择经办人</view>
-				<u-picker :range="handlerList" range-key="name" @confirm='handlerPicker($event)' v-model="show6" mode="selector">
+				<view @click='show6=true'>{{detailData.agent}}</view>
+				<u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
+					mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">出库日期</view>
 				<view class="left">出库日期</view>
-				<view @click='show4=true'>请选择日期</view>
-				<u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar>
+				<view @click='show7=true'>{{detailData.inOutDate}}</view>
+				<u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
+				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">出库类型</view>
 				<view class="left">出库类型</view>
-				<view @click='show5=true'>请选择入库类型</view>
-				<u-picker :range="warehousingTypeList" range-key="type" @confirm='warehousingTypePicker($event)' v-model="show5" mode="selector">
+				<view @click='show5=true'>{{detailData.inOutType}}</view>
+				<u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
+					v-model="show5" mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
-			<view class="row">
+			<view class="row row-bottom">
 				<view class="left">车牌号</view>
 				<view class="left">车牌号</view>
-				<view @click='slectCarNo'>{{detailData.carNo}}</view>
-			</view>
-			<view class="row row-bottom has-btn">
-				<view class="left">成本(元/吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="自动获取"></input>
-					<u-button class="edit-btn">编辑</u-button>
-			</view>
-			<view class="row row-bottom has-btn">
-				<view class="left">运费(元/吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="自动获取"></input>
-					<u-button class="edit-btn">编辑</u-button>
+				<input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
 			<view class="left">上传磅单</view>
 			<view class="left">上传磅单</view>
-			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
+			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
 				:size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 				:size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 		</view>
 		</view>
@@ -104,49 +97,54 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">质检员</view>
 				<view class="left">质检员</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
 					placeholder="输入质检员姓名"></input>
 					placeholder="输入质检员姓名"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">水分(%)</view>
 				<view class="left">水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
 					placeholder="输入水分占比"></input>
 					placeholder="输入水分占比"></input>
 			</view>
 			</view>
-			<view class="row row-bottom" style="border: 0;">
+			<view class="row row-bottom">
 				<view class="left">容重(克/升)</view>
 				<view class="left">容重(克/升)</view>
-				<input v-model='detailData.netWeight' class="right-bottom" disabled placeholder="输入容重"></input>
+				<input v-model='detailData.warehouseInOutDetail.bulkDensity' 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 @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
 					placeholder="输入热损伤占比"></input>
 					placeholder="输入热损伤占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">杂质(%)</view>
 				<view class="left">杂质(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
 					placeholder="输入杂质占比"></input>
 					placeholder="输入杂质占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">霉变粒(%)</view>
 				<view class="left">霉变粒(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
 					placeholder="输入霉变粒占比"></input>
 					placeholder="输入霉变粒占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">不完善粒(%)</view>
 				<view class="left">不完善粒(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
 					placeholder="输入不完善粒占比"></input>
 					placeholder="输入不完善粒占比"></input>
 			</view>
 			</view>
 		</view>
 		</view>
 		<u-toast ref="uToast" />
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
 		<view class="bottom-btn">
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">暂存</u-button>
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
 	import upload from '@/components/upload.vue';
 	import upload from '@/components/upload.vue';
+	import helper from '@/common/helper.js';
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 	export default {
 		components: {
 		components: {
 			upload
 			upload
@@ -160,8 +158,9 @@
 				show4: false,
 				show4: false,
 				show5: false,
 				show5: false,
 				show6: false,
 				show6: false,
+				show7: false,
 				contractNoList: [{
 				contractNoList: [{
-					contractNo: "123"
+					contractNo: ""
 				}],
 				}],
 				typeList: [{
 				typeList: [{
 						type: "干粮"
 						type: "干粮"
@@ -171,13 +170,13 @@
 					}
 					}
 				],
 				],
 				pjList: [{
 				pjList: [{
-						type: "一等"
+						type: "一等"
 					},
 					},
 					{
 					{
-						type: "二等"
+						type: "二等"
 					},
 					},
 					{
 					{
-						type: "三等"
+						type: "三等"
 					},
 					},
 					{
 					{
 						type: "等外"
 						type: "等外"
@@ -196,55 +195,122 @@
 						name: "等外"
 						name: "等外"
 					}
 					}
 				],
 				],
-				warehousingTypeList: [{
-						type: "采购入库"
-					},
-					{
-						type: "采购入库"
-					},
-					{
-						type: "采购入库"
-					},
-					{
-						type: "采购入库"
-					}
-				],
+				warehousingTypeList: [],
 				action: this.$uploadUrl,
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
 				btnLoading: false, //防止重复点击
 				isAdd: true,
 				isAdd: true,
+				warehouseName: '',
+				binNumber: '',
 				detailData: {
 				detailData: {
-					contractNo: "123",
-					carNo:'辽H12345',
-					name: "",
-					goodsName: "123",
-					qualityInspectionManagement: {}
-				}
+					contractNo: "请选择合同编号或移库任务编号",
+					type: "请选择类型",
+					grade: "请输入品级",
+					agent: "请选择经办人",
+					inOutDate: "请选择出库日期",
+					inOutType: "请选择出库类型",
+					warehouseInOutDetail: {},
+					gradeKey: "",
+				},
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: true,
+					minute: true,
+					second: true
+				},
+				inOutDate1: "",
+				netWeight: "",
+				imgUrl: [], //图片展示
 			}
 			}
 		},
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		watch: {
+			netWeight: function(v) {
+				this.pureWeightCount()
+			},
+		},
 		onLoad(options) {
 		onLoad(options) {
-			this.id = options.id
+			this.detailData = JSON.parse(options.data)
+			this.netWeight = this.detailData.netWeight
+			console.log(this.detailData, "dmksj")
+
+			// this.imgUrl = this.detailData.addressUrl.split(",")
+
+			// for (let i = 0; i < this.detailData.addressUrl.split(",").length; i++) {
+				this.imgUrl.push({
+						url:this.detailData.addressUrl.split(",")[0]
+					})
+			// }
+			// console.log(this.imgUrl)
 			this.cangId = options.cangId
 			this.cangId = options.cangId
 		},
 		},
 		onShow() {
 		onShow() {
-			// this.getWeighingManagement()
+			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;
+			if (!this.detailData.contractNo) {
+				this.detailData.contractNo = '请选择合同编号'
+			}
+			if (!this.detailData.goodsName) {
+				this.detailData.goodsName = '货名'
+			}
+			//出库类型
+			this.outWarehouse()
+			//经办人
+			this.handler()
 		},
 		},
 		methods: {
 		methods: {
-			contractNopicker(e) {},
+			//计算纯重
+			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'
+				}).then(res => {
+					this.warehousingTypeList = res.data.data
+				})
+			},
+			handler() {
+				this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
+					compId: helper.erpWarehouse.compId,
+					warehouseId: helper.erpWarehouse.warehouseId
+				}).then(res => {
+					this.handlerList = res.data.data
+				})
+			},
+			contractNopicker(e) {
+
+			},
 			typePicker(e) {
 			typePicker(e) {
-				console.log(e)
+				this.detailData.type = this.typeList[e].type
 			},
 			},
 			pjPicker(e) {
 			pjPicker(e) {
-				console.log(e)
+				this.detailData.gradeKey = e[0]
+				this.detailData.grade = this.pjList[e].type
 			},
 			},
 			handlerPicker(e) {
 			handlerPicker(e) {
-				console.log(e)
+				this.detailData.agentKey = e[0]
+				this.detailData.agent = this.handlerList[e].staffName
 			},
 			},
-			dateChange(e){
-				console.log(e)
+			dateChange(e) {
+				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
+				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 			},
 			},
 			warehousingTypePicker(e) {
 			warehousingTypePicker(e) {
-				console.log(e)
+				this.detailData.inOutType = this.warehousingTypeList[e].constValue
 			},
 			},
 			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') {
@@ -259,7 +325,9 @@
 				}
 				}
 			},
 			},
 			calculate() {
 			calculate() {
-				this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
+				if (this.detailData.grossWeight && this.detailData.tare) {
+					this.netWeight = this.detailData.grossWeight - this.detailData.tare
+				}
 			},
 			},
 			getImgUrl(res) {
 			getImgUrl(res) {
 				this.detailData.addressUrl = res
 				this.detailData.addressUrl = res
@@ -271,43 +339,36 @@
 				console.log('------------error-----------')
 				console.log('------------error-----------')
 				console.log(error)
 				console.log(error)
 			},
 			},
-			contractNopicker(e) {
-				// this.detailData.goodsName=this.contractNoList[e[0]].goodsName
-				// this.detailData.contractNo=this.contractNoList[e[0]].contractNo
-			},
 			binNumberpicker(e) {
 			binNumberpicker(e) {
 				this.detailData.binNumber = this.positionList[e[0]].binNumber
 				this.detailData.binNumber = this.positionList[e[0]].binNumber
 			},
 			},
-			getWeighingManagement() {
-				this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
-					id: this.id
-				}).then(res => {
-					if (res.data.code == 200) {
-						console.log(res)
-						this.detailData = res.data.data
-					}
-				})
-				this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-					id: this.cangId
-				}).then(res => {
-					if (res.data.code == 200) {
-						this.positionList = res.data.data.warehousePositionInfoList
-					}
-				})
-				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					compId: '',
-					flag: 5
-				}).then(res => {
-					if (res.data.code == 200) {
-						this.contractNoList = res.data.data
-					}
-				})
-			},
-			onProgress(e) {
-				console.log(e)
-			},
+			// getWeighingManagement() {
+			// 	this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
+			// 		id: this.id
+			// 	}).then(res => {
+			// 		if (res.data.code == 200) {
+			// 			this.detailData = res.data.data
+			// 		}
+			// 	})
+			// 	this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+			// 		id: this.cangId
+			// 	}).then(res => {
+			// 		if (res.data.code == 200) {
+			// 			this.positionList = res.data.data.warehousePositionInfoList
+			// 		}
+			// 	})
+			// 	this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+			// 		compId: '',
+			// 		flag: 5
+			// 	}).then(res => {
+			// 		if (res.data.code == 200) {
+			// 			this.contractNoList = res.data.data
+			// 		}
+			// 	})
+			// },
+			onProgress(e) {},
 			onRemove(index) {},
 			onRemove(index) {},
-			submit() {
+			submit(num) {
 				if (!this.detailData.grossWeight) {
 				if (!this.detailData.grossWeight) {
 					this.$api.msg('毛重不能为空')
 					this.$api.msg('毛重不能为空')
 					return
 					return
@@ -323,31 +384,53 @@
 					this.$api.msg('毛重输入错误!')
 					this.$api.msg('毛重输入错误!')
 					return
 					return
 				}
 				}
+				this.detailData.baseId = helper.erpWarehouse.warehouseId
+				this.detailData.positionId = helper.erpWarehouse.positionId
+				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
+				this.detailData.binNumber = this.binNumber
+				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
+				this.detailData.compId = helper.erpWarehouse.compId
+				this.detailData.netWeight = this.netWeight
+				this.detailData.inOutFlag = 1
+				this.detailData.taskType = "出库任务"
+				this.detailData.pcFlag = 0
+				let title = ""
+				if (num == 1) {
+					this.detailData.statusFlag = 1
+					this.detailData.inOutDate = this.inOutDate1
+					this.detailData.backOffice = this.userInfo.userName
+					this.detailData.backOfficeId = this.userInfo.id
+					title = "暂存成功"
+				} else if (num == 2) {
+					this.detailData.statusFlag = 3
+					title = "提交成功"
+				}
+				console.log(this.detailData,"提交数据")
 				let that = this
 				let that = this
 				uni.showModal({
 				uni.showModal({
-					content: "确定提交检斤信息?",
+					content: "确定提交出库信息?",
 					success(res) {
 					success(res) {
 						if (res.confirm) {
 						if (res.confirm) {
-							that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',
+							that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
 								that.detailData).then(res => {
 								that.detailData).then(res => {
+									that.$api.msg(title)
 								if (res.data.code == 200) {
 								if (res.data.code == 200) {
-									that.$api.msg('提交成功')
+									that.$api.msg(title)
 									uni.navigateBack()
 									uni.navigateBack()
 								}
 								}
 							})
 							})
 						}
 						}
-
 					}
 					}
 				})
 				})
 			},
 			},
-			slectcontractNo(){
+			slectcontractNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/erp/exWarehousing/selectContractNo'
+					url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
 				})
 				})
 			},
 			},
-			slectCarNo(){
+			slectCarNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/erp/exWarehousing/selectCarNo'
+					url: '/pages/erp/exWarehousing/selectCarNo'
 				})
 				})
 			},
 			},
 		}
 		}
@@ -415,7 +498,7 @@
 
 
 	.content2 {
 	.content2 {
 		margin-top: 10px;
 		margin-top: 10px;
-		display: flex;
+		// display: flex;
 		align-items: center;
 		align-items: center;
 
 
 		.left {
 		.left {
@@ -428,17 +511,20 @@
 		background: #22C572;
 		background: #22C572;
 		border-radius: 10rpx;
 		border-radius: 10rpx;
 	}
 	}
-	.edit-btn{
+
+	.edit-btn {
 		background: #22C572;
 		background: #22C572;
 		width: 100rpx;
 		width: 100rpx;
 		height: 50rpx;
 		height: 50rpx;
 		margin: 0;
 		margin: 0;
 		color: white;
 		color: white;
 	}
 	}
-	.has-btn{
+
+	.has-btn {
 		align-items: center;
 		align-items: center;
 	}
 	}
-	.bottom-btn{
+
+	.bottom-btn {
 		width: 92%;
 		width: 92%;
 		position: fixed;
 		position: fixed;
 		bottom: 40rpx;
 		bottom: 40rpx;

+ 110 - 73
pages/erp/improvedWrehousing/improvedWrehousing.vue

@@ -1,114 +1,151 @@
 <template>
 <template>
 	<view class="wrap">
 	<view class="wrap">
 		<view class="dropdown content1">
 		<view class="dropdown content1">
-			<view class="left"  @click='show1=true'>
+			<view class="left" @click='show1=true'>
 				<view>{{warehouseName}}</view>
 				<view>{{warehouseName}}</view>
-				<u-icon name="arrow-right" color=""></u-icon>
-				<u-select v-model="show1" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
-				</u-select>
+				<u-icon name="arrow-right"></u-icon>
+				<u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
+					:range="warehouseList"></u-picker>
 			</view>
 			</view>
-			<view class="right"  @click='show2=true'>
-				<view>{{positionName}}</view>
-				<u-icon name="arrow-right" color=""></u-icon>
-				<u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
-				</u-select>
+			<view class="right" @click='show2=true'>
+				<view>{{binNumber}}仓位</view>
+				<u-icon name="arrow-right"></u-icon>
+				<u-picker @confirm="warehouseCWchange" range-key='binNumber' mode="selector" v-model="show2"
+					:range="warehouseCWList"></u-picker>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
 			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
 			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
-				<view class="item-style">{{item.val1}}</view>
-				<view class="item-style">{{item.val2}}</view>
-				<view class="item-style">{{item.val3}}</view>
-				<view class="item-style">{{item.val4}}</view>
+				<view class="row">
+					<view class="left">合同编号</view>
+					<view>{{item.contractNo}}</view>
+				</view>
+				<view class="row">
+					<view class="left">车牌号</view>
+					<view>{{item.carNo}}</view>
+				</view>
+				<view class="row">
+					<view class="left">暂存时间</view>
+					<view>{{item.inOutDate}}</view>
+				</view>
+				<view class="row no-boder">
+					<view class="left">提交人</view>
+					<view>{{item.backOffice}}</view>
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import helper from '@/common/helper.js';
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				show1:false,
-				show2:false,
-				warehouseName: '鲅鱼圈一号库',
-				positionName: '102仓位',
-					warehouseList: [
-						{
-						"label": '1',
-						"value": '1'
-						}
-					],
-					positionList: [
-						{
-						"label": '102仓位',
-						"value": '1'
-						}
-					],
-					dataList:[
-						{
-						val1:'我是合同编号',
-						val2:'我是车牌号',
-						val3:'我是暂存时间',
-						val4:'我是提交人姓名'
-					},
-					{
-						val1:'我是合同编号',
-						val2:'我是车牌号',
-						val3:'我是暂存时间',
-						val4:'我是提交人姓名'
-					},
-					{
-						val1:'我是合同编号',
-						val2:'我是车牌号',
-						val3:'我是暂存时间',
-						val4:'我是提交人姓名'
-					},
-					]
+				show1: false,
+				show2: false,
+				currentPage: 1,
+				pageSize: 9999,
+				positionId: "",
+				binNumber: "",
+				warehouseName: '',
+				positionName: '',
+				warehouseList: [],
+				warehouseCWList: [],
+				dataList: [],
+				allWarehouse: []
 			}
 			}
 		},
 		},
+		onLoad() {
+
+		},
+		onShow() {
+			console.log("完善入库-仓库信息", helper.erpWarehouse)
+			let _data = helper.erpWarehouse
+			this.warehouseName = _data.warehouseName
+			this.warehouseList = _data.allWarehouse
+			this.warehouseCWList = _data.warehouseCWList
+			this.binNumber = _data.binNumber
+			this.positionId = _data.positionId
+			this.getList()
+		},
 		methods: {
 		methods: {
-			confirmWarehouse(){},
-			confirmPositon(){},
-			goDetail(val){
+			getList() {
+				this.$api.doRequest('get', '/warehouseInOutInfo/selectWarehouseInOutInfo', {
+					positionId: helper.erpWarehouse.positionId,
+					baseId: helper.erpWarehouse.warehouseId,
+					currentPage: this.currentPage,
+					pageSize: this.pageSize,
+					inOutFlag: 2
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.dataList = res.data.data.records
+					}
+				})
+			},
+			warehousechange(e) {
+				 this.warehouseName = this.warehouseList[e[0]].warehouseName
+			},
+			warehouseCWchange(e) {
+				 this.binNumber = this.warehouseCWList[e[0]].binNumber
+			},
+			goDetail(val) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'improvedWrehousingDetail?data='+val,
-					
+					url: '/pages/erp/improvedWrehousing/improvedWrehousingDetail?data=' + JSON.stringify(val),
 				})
 				})
 			}
 			}
-			
+
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-	.dropdown{
+	.dropdown {
 		display: flex;
 		display: flex;
-		margin:20rpx 0;
+		margin: 20rpx 0;
 		justify-content: space-between;
 		justify-content: space-between;
-		.left,.right{
+
+		.left,
+		.right {
 			display: flex;
 			display: flex;
 		}
 		}
 	}
 	}
-	.content1{
-		background: red;
-		padding: 20rpx;
+
+	.content1 {
+		padding: 40rpx 20rpx;
 		margin: 20rpx;
 		margin: 20rpx;
 		border-radius: 10rpx;
 		border-radius: 10rpx;
+		background: #FFFFFF;
 	}
 	}
-	.content2{
-		padding: 20rpx;
-		margin: 20rpx;
-		border-bottom: 1px solid #ccc;
-		background: yellow;
-		.content2-item{
-			margin-bottom: 10rpx;
-			border-bottom:1px solid #ccc ;
-			// padding-bottom: 10px;
+	
+	.content2 {
+		.row {
+			display: flex;
+			justify-content: space-between;
+			border-bottom: 1px solid #EEEEEE;
+			padding: 21rpx 0;
+	
+			.right,
+			input {
+				font-size: 28rpx;
+				color: #333333;
+			}
 		}
 		}
-		.item-style{
-			display: inline-block;
-			width: 50%;
+	
+		.row-bottom {
+			.right-bottom {
+				width: 300rpx;
+				text-align: right;
+			}
 		}
 		}
 	}
 	}
+	.content2-item{
+		background: white;
+		margin:0 20rpx 20rpx 20rpx;
+		padding: 10rpx;
+		border-radius: 15rpx;
+	}
+	.no-boder{
+		    border-bottom: none!important;
+	}
 </style>
 </style>

+ 210 - 91
pages/erp/improvedWrehousing/improvedWrehousingDetail.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<view class="warp">
 	<view class="warp">
 		<view class="top">
 		<view class="top">
-			<view class="top-left">鲅鱼圈一号库</view>
-			<view>102仓位</view>
+			<view class="top-left">{{warehouseName}}</view>
+			<view>{{binNumber}}仓位</view>
 		</view>
 		</view>
 		<view class="content">
 		<view class="content">
 			<view class="row">
 			<view class="row">
@@ -15,7 +15,7 @@
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">类型</view>
 				<view class="left">类型</view>
-				<view @click='show1=true'>请选择类型</view>
+				<view @click='show1=true'>{{detailData.type}}</view>
 				<u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
 				<u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
 					mode="selector">
 					mode="selector">
 				</u-picker>
 				</u-picker>
@@ -27,82 +27,95 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">皮重(吨)</view>
 				<view class="left">皮重(吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="输入皮重"></input>
+				<input @input='calculate' v-model='detailData.tare' 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 @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="0"></input>
+				<input @input='calculate' v-model='detailData.deductionWeight' 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 @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算"></input>
+				<input @input='' v-model='netWeight' class="right-bottom" placeholder="不可编辑,自动计算"
+					:disabled="true"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">扣款(元/吨)</view>
 				<view class="left">扣款(元/吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="0"></input>
+				<input @input='' v-model='detailData.deductionAmount' class="right-bottom" placeholder="输入扣款"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">扣重比</view>
 				<view class="left">扣重比</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="输入扣重比"></input>
+				<input @input='' v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">干粮水分(%)</view>
 				<view class="left">干粮水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="输入干粮水分占比"></input>
+				<input @input='' v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">潮粮水分(%)</view>
 				<view class="left">潮粮水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom" placeholder="输入潮粮水分占比"></input>
+				<input @input='' v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
-			<view class="row row-bottom">
+			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">纯重(吨)</view>
 				<view class="left">纯重(吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算"></input>
+				<input @input='calculate' v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"
+					:disabled="true"></input>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">品级</view>
 				<view class="left">品级</view>
-				<view @click='show3=true'>请选择品级</view>
-				<u-picker :range="pjList" range-key="name" @confirm='handlerPicker($event)' v-model="show3" mode="selector">
+				<view @click='show3=true'>{{detailData.grade}}</view>
+				<u-picker :range="pjList" range-key="grade" @confirm='handlerPicker($event)' v-model="show3"
+					mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">经办人</view>
 				<view class="left">经办人</view>
-				<view @click='show6=true'>请选择经办人</view>
-				<u-picker :range="handlerList" range-key="name" @confirm='handlerPicker($event)' v-model="show6" mode="selector">
+				<view @click='show6=true'>{{detailData.agent}}</view>
+				<u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
+					mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">入库日期</view>
 				<view class="left">入库日期</view>
-				<view @click='show4=true'>请选择日期</view>
-				<u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar>
+				<view @click='show4=true'>{{detailData.inOutDate}}</view>
+				<u-picker v-model="show4" mode="time" @confirm='dateChange($event)' :params="params">
+					<!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
+				</u-picker>
+				<!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">入库类型</view>
 				<view class="left">入库类型</view>
-				<view @click='show5=true'>请选择入库类型</view>
-				<u-picker :range="warehousingTypeList" range-key="type" @confirm='warehousingTypePicker($event)' v-model="show5" mode="selector">
+				<view @click='show5=true'>{{detailData.inOutType}}</view>
+				<u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
+					v-model="show5" mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
-			<view class="row">
+			<view class="row row-bottom">
 				<view class="left">车牌号</view>
 				<view class="left">车牌号</view>
-				<view @click='slectCarNo'>{{detailData.carNo}}</view>
+				<input v-if="!isPC" @input='' v-model='detailData.carNo' class="right-bottom"
+					placeholder="请输入车牌号"></input>
+				<view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view>
 			</view>
 			</view>
 			<view class="row row-bottom has-btn">
 			<view class="row row-bottom has-btn">
 				<view class="left">成本(元/吨)</view>
 				<view class="left">成本(元/吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="自动获取"></input>
-					<u-button class="edit-btn">编辑</u-button>
+				<input v-if="detailData.inOutType=='采购入库'" v-model='detailData.cost' class="right-bottom"
+					placeholder="自动获取" :disabled="isEditCB"></input>
+				<input v-if="detailData.inOutType!='采购入库'" v-model='detailData.cost' class="right-bottom"
+					placeholder="自动获取" :disabled="isEditCB"></input>
+				<u-button class="edit-btn" hover-class="none" @click="editCB">编辑</u-button>
 			</view>
 			</view>
 			<view class="row row-bottom has-btn">
 			<view class="row row-bottom has-btn">
 				<view class="left">运费(元/吨)</view>
 				<view class="left">运费(元/吨)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.freight' :disabled="isEditYF" class="right-bottom"
 					placeholder="自动获取"></input>
 					placeholder="自动获取"></input>
-					<u-button class="edit-btn">编辑</u-button>
+				<u-button class="edit-btn" hover-class="none" @click="editYF">编辑</u-button>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
 			<view class="left">上传磅单</view>
 			<view class="left">上传磅单</view>
-			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
+			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
 				:size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 				:size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 		</view>
 		</view>
@@ -112,49 +125,54 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">质检员</view>
 				<view class="left">质检员</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
 					placeholder="输入质检员姓名"></input>
 					placeholder="输入质检员姓名"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">水分(%)</view>
 				<view class="left">水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
 					placeholder="输入水分占比"></input>
 					placeholder="输入水分占比"></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 v-model='detailData.netWeight' class="right-bottom" disabled placeholder="输入容重"></input>
+				<input v-model='detailData.warehouseInOutDetail.bulkDensity' 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 @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
 					placeholder="输入热损伤占比"></input>
 					placeholder="输入热损伤占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">杂质(%)</view>
 				<view class="left">杂质(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
 					placeholder="输入杂质占比"></input>
 					placeholder="输入杂质占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">霉变粒(%)</view>
 				<view class="left">霉变粒(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
 					placeholder="输入霉变粒占比"></input>
 					placeholder="输入霉变粒占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">不完善粒(%)</view>
 				<view class="left">不完善粒(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
 					placeholder="输入不完善粒占比"></input>
 					placeholder="输入不完善粒占比"></input>
 			</view>
 			</view>
 		</view>
 		</view>
 		<u-toast ref="uToast" />
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
 		<view class="bottom-btn">
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">暂存</u-button>
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	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
@@ -168,6 +186,19 @@
 				show4: false,
 				show4: false,
 				show5: false,
 				show5: false,
 				show6: false,
 				show6: false,
+				isPC: true,
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: true,
+					minute: true,
+					second: true
+				},
+				isEditCB: 'false',
+				isEditYF: 'false',
+				warehouseName: '',
+				binNumber: '',
 				contractNoList: [{
 				contractNoList: [{
 					contractNo: "123"
 					contractNo: "123"
 				}],
 				}],
@@ -179,80 +210,143 @@
 					}
 					}
 				],
 				],
 				pjList: [{
 				pjList: [{
-						type: "一等"
+						grade: "一等品"
 					},
 					},
 					{
 					{
-						type: "二等"
+						grade: "二等品"
 					},
 					},
 					{
 					{
-						type: "三等"
+						grade: "三等品"
 					},
 					},
 					{
 					{
-						type: "等外"
+						grade: "等外"
 					}
 					}
 				],
 				],
 				handlerList: [{
 				handlerList: [{
-						name: "张三"
-					},
-					{
-						name: "二等"
-					},
-					{
-						name: "三等"
-					},
-					{
-						name: "等外"
-					}
-				],
-				warehousingTypeList: [{
-						type: "采购入库"
+						agent: "张三"
 					},
 					},
 					{
 					{
-						type: "采购入库"
+						agent: "二等"
 					},
 					},
 					{
 					{
-						type: "采购入库"
+						agent: "三等"
 					},
 					},
 					{
 					{
-						type: "采购入库"
+						agent: "等外"
 					}
 					}
 				],
 				],
+				warehousingTypeList: [],
 				action: this.$uploadUrl,
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
 				btnLoading: false, //防止重复点击
 				isAdd: true,
 				isAdd: true,
+				netWeight: 0,
+				inOutDate1: "",
 				detailData: {
 				detailData: {
-					contractNo: "123",
-					carNo:'辽H12345',
-					name: "",
+					contractNo: "请选择合同编号",
+					carNo: '辽H12345',
+					type: "干粮",
 					goodsName: "123",
 					goodsName: "123",
-					qualityInspectionManagement: {}
-				}
+					inOutDate: '请输入入库日期',
+					grade: "一等品",
+					agent: '请选择经办人',
+					inOutType: '请选择入库类型',
+					deductionWeight: 0,
+					grossWeight: 0,
+					tare: 0,
+					deductionAmount: 0,
+					netWeight: 0,
+					warehouseInOutDetail: {}
+				},
+				imgUrl: []
 			}
 			}
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
-			this.id = options.id
-			this.cangId = options.cangId
+			this.detailData = JSON.parse(options.data)
+			this.binNumber = helper.erpWarehouse.binNumber
+			this.warehouseName = helper.erpWarehouse.warehouseName
+			this.compId = helper.erpWarehouse.compId
+			if(this.detailData.addressUrl){
+				this.imgUrl.push({
+					url: this.detailData.addressUrl.split(",")[0]
+				})
+			}
+			console.log(this.imgUrl)
+			console.log(helper.erpWarehouse)
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo']),
 		},
 		},
 		onShow() {
 		onShow() {
-			// this.getWeighingManagement()
+			if (this.detailData.inOutType == '采购入库') {
+				this.detailData.freight = 0
+			}
+			if (!this.detailData.tranCarInfoList) this.detailData.tranCarInfoList = []
+			if (!this.detailData.contractNo) {
+				this.detailData.contractNo = '请选择合同编号'
+			} else {
+				if (this.detailData.tranCarInfoList.length == 0) {
+					this.isPC = false
+				}
+			}
+			if (!this.detailData.goodsName) {
+				this.detailData.goodsName = '货名'
+			}
+			// 获取入库类型
+			this.getrkType()
+			//获取经办人
+			this.getPerson()
+			console.log(this.detailData)
+		},
+		watch: {
+			netWeight: function(v) {
+				this.pureWeightCount()
+			},
 		},
 		},
 		methods: {
 		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)
+				}
+			},
+			getPerson() {
+				this.$api.doRequest('get', '/staff/query/getStaffListByCompId', {
+					compId: this.compId
+				}).then(res => {
+					this.handlerList = res.data.data
+				})
+			},
+			getrkType() {
+				this.$api.doRequest('get', '/commonSysParameter/getInfo', {
+					constId: 'CON5'
+				}).then(res => {
+					this.warehousingTypeList = res.data.data
+				})
+			},
 			contractNopicker(e) {},
 			contractNopicker(e) {},
 			typePicker(e) {
 			typePicker(e) {
 				console.log(e)
 				console.log(e)
+				this.detailData.type = this.typeList[e].type
 			},
 			},
 			pjPicker(e) {
 			pjPicker(e) {
 				console.log(e)
 				console.log(e)
 			},
 			},
 			handlerPicker(e) {
 			handlerPicker(e) {
 				console.log(e)
 				console.log(e)
+				this.detailData.agent = this.handlerList[e].staffName
 			},
 			},
-			dateChange(e){
+			dateChange(e) {
 				console.log(e)
 				console.log(e)
+				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
+				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute 
 			},
 			},
 			warehousingTypePicker(e) {
 			warehousingTypePicker(e) {
-				console.log(e)
+				this.detailData.inOutType = this.warehousingTypeList[e].constValue
 			},
 			},
 			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') {
@@ -267,7 +361,7 @@
 				}
 				}
 			},
 			},
 			calculate() {
 			calculate() {
-				this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
+				this.netWeight = this.detailData.grossWeight - this.detailData.tare - this.detailData.deductionWeight
 			},
 			},
 			getImgUrl(res) {
 			getImgUrl(res) {
 				this.detailData.addressUrl = res
 				this.detailData.addressUrl = res
@@ -315,11 +409,13 @@
 				console.log(e)
 				console.log(e)
 			},
 			},
 			onRemove(index) {},
 			onRemove(index) {},
-			submit() {
-				if (!this.detailData.grossWeight) {
-					this.$api.msg('毛重不能为空')
-					return
-				}
+			editCB() {
+				this.isEditCB = false
+			},
+			editYF() {
+				this.isEditYF = false
+			},
+			submit(num) {
 				if (isNaN(this.detailData.grossWeight) ||
 				if (isNaN(this.detailData.grossWeight) ||
 					(String(this.detailData.grossWeight).indexOf('.') != -1 &&
 					(String(this.detailData.grossWeight).indexOf('.') != -1 &&
 						String(this.detailData.grossWeight).length -
 						String(this.detailData.grossWeight).length -
@@ -331,31 +427,51 @@
 					this.$api.msg('毛重输入错误!')
 					this.$api.msg('毛重输入错误!')
 					return
 					return
 				}
 				}
+				this.detailData.baseId = helper.erpWarehouse.warehouseId
+				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
+				this.detailData.positionId = helper.erpWarehouse.positionId
+				this.detailData.binNumber = this.binNumber
+				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
+				this.detailData.compId = helper.erpWarehouse.compId
+				this.detailData.netWeight = this.netWeight
+				this.detailData.backOffice = this.userInfo.userName
+				this.detailData.backOfficeId = this.userInfo.id
+				this.detailData.inOutFlag = 2
+				this.detailData.taskType = "入库任务"
+				this.detailData.pcFlag = 0
+				let title = ""
+				if (num == 1) {
+					this.detailData.statusFlag = 1
+					this.detailData.inOutDate = this.inOutDate1
+					title = "暂存成功"
+				} else if (num == 2) {
+					this.detailData.statusFlag = 3
+					title = "提交成功"
+				}
 				let that = this
 				let that = this
 				uni.showModal({
 				uni.showModal({
-					content: "确定提交检斤信息?",
+					content: "确定提交入库库信息?",
 					success(res) {
 					success(res) {
 						if (res.confirm) {
 						if (res.confirm) {
-							that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',
+							that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
 								that.detailData).then(res => {
 								that.detailData).then(res => {
 								if (res.data.code == 200) {
 								if (res.data.code == 200) {
-									that.$api.msg('提交成功')
+									that.$api.msg(title)
 									uni.navigateBack()
 									uni.navigateBack()
 								}
 								}
 							})
 							})
 						}
 						}
-
 					}
 					}
 				})
 				})
 			},
 			},
-			slectcontractNo(){
+			slectcontractNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/erp/warehousing/selectContractNo'
+					url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
 				})
 				})
 			},
 			},
-			slectCarNo(){
+			slectCarNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/erp/warehousing/selectCarNo'
+					url: '/pages/erp/warehousing/selectCarNo'
 				})
 				})
 			},
 			},
 		}
 		}
@@ -436,17 +552,20 @@
 		background: #22C572;
 		background: #22C572;
 		border-radius: 10rpx;
 		border-radius: 10rpx;
 	}
 	}
-	.edit-btn{
+
+	.edit-btn {
 		background: #22C572;
 		background: #22C572;
 		width: 100rpx;
 		width: 100rpx;
 		height: 50rpx;
 		height: 50rpx;
 		margin: 0;
 		margin: 0;
 		color: white;
 		color: white;
 	}
 	}
-	.has-btn{
+
+	.has-btn {
 		align-items: center;
 		align-items: center;
 	}
 	}
-	.bottom-btn{
+
+	.bottom-btn {
 		width: 92%;
 		width: 92%;
 		position: fixed;
 		position: fixed;
 		bottom: 40rpx;
 		bottom: 40rpx;

+ 99 - 49
pages/erp/index.vue

@@ -1,39 +1,45 @@
 <template>
 <template>
 	<view class="wrap">
 	<view class="wrap">
-		<view class="comp" @click='show0=true'>
-			<view>{{compName}}</view>
-			<u-icon name="arrow-right" color=""></u-icon>
-			<u-picker @confirm="compChange" range-key='compName' mode="selector" v-model="show0"
-				:range="compList"></u-picker>
-		</view>
-		<view class='title'>仓库管理</view>
-		<view class="dropdown">
-			<view class="left" @click='show1=true'>
-				<view>{{warehouseName}}</view>
-				<u-icon name="arrow-right" color=""></u-icon>
-				<u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
-					:range="warehouseList"></u-picker>
+		<view v-if="!isShowAlert">
+			<view class="comp" @click='show0=true'>
+				<view>{{compName}}</view>
+				<u-icon name="arrow-right" color="" v-if="compList.length>1"></u-icon>
+				<u-picker @confirm="compChange" range-key='compName' mode="selector" v-model="show0"
+					:range="compList" v-if="compList.length>1"></u-picker>
 			</view>
 			</view>
-			<view class="right" @click='show2=true'>
-				<view>{{binNumber}}仓位</view>
-				<u-icon name="arrow-right" color=""></u-icon>
-				<u-picker @confirm="warehouseCWchange" range-key='binNumber' mode="selector" v-model="show2"
-					:range="warehouseCWList"></u-picker>
+			<view class='title'>仓库管理</view>
+			<view class="dropdown">
+				<view class="left" @click='show1=true'>
+					<view>{{warehouseName}}</view>
+					<u-icon name="arrow-right" color=""></u-icon>
+					<u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
+						:range="warehouseList"></u-picker>
+				</view>
+				<view class="right" @click='show2=true'>
+					<view>{{binNumber}}仓位</view>
+					<u-icon name="arrow-right" color=""></u-icon>
+					<u-picker @confirm="warehouseCWchange" range-key='binNumber' mode="selector" v-model="show2"
+						:range="warehouseCWList"></u-picker>
+				</view>
 			</view>
 			</view>
-		</view>
-
-		<view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
-			<view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
-				v-if="index<gridCol*2">
-				<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
-					<image :src="item.src" class="sign"></image>
+			
+			<view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
+				<view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
+					v-if="index<gridCol*2">
+					<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
+						<image :src="item.src" class="sign"></image>
+					</view>
+			
+					<text>{{item.name}}</text>
 				</view>
 				</view>
-
-				<text>{{item.name}}</text>
 			</view>
 			</view>
 		</view>
 		</view>
-		<u-modal v-model="isShowAlert" confirm-color='#22C572' confirm-text='立即开通' title='您尚未开通ERP业务'
-			:content="content"></u-modal>
+		
+		<u-modal v-model="isShowAlert"
+		 :title-style="{fontSize: '18px',fontWeight:'500'}" 
+		 :content-style="{fontSize: '14px',fontWeight:'400'}" 
+		 confirm-color='#22C572' confirm-text='立即开通' title='您尚未开通ERP业务'
+		 :content="content" @confirm="goOpenService"></u-modal>
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
@@ -51,18 +57,17 @@ import helper from '@/common/helper.js';
 				show1: false,
 				show1: false,
 				show2: false,
 				show2: false,
 				isShowAlert: false,
 				isShowAlert: false,
-				compName:'黑龙江中天昊元贸易有限公司',
-				compList:[{
-						compName:'黑龙江中天昊元贸易有限公司'
-				}
-				],
+				compName:'',
+				compList:[],
 				content: '易粮易运ERP系统包含合同管理、仓库管理、运输管理、结算管理等多个模块,可为粮企提供粮食贸易的全流程服务,平台诚邀您的加入。',
 				content: '易粮易运ERP系统包含合同管理、仓库管理、运输管理、结算管理等多个模块,可为粮企提供粮食贸易的全流程服务,平台诚邀您的加入。',
 				warehouseName: '暂无仓库',
 				warehouseName: '暂无仓库',
 				binNumber: '暂无',
 				binNumber: '暂无',
 				compId:'',
 				compId:'',
 				warehouseId:"",
 				warehouseId:"",
+				positionId:"",
 				warehouseList: [],
 				warehouseList: [],
 				warehouseCWList:[],
 				warehouseCWList:[],
+				allWarehouse:[],
 				gridCol: 4,
 				gridCol: 4,
 				gridBorder: false,
 				gridBorder: false,
 				gridList: [{
 				gridList: [{
@@ -124,7 +129,6 @@ import helper from '@/common/helper.js';
 		},
 		},
 
 
 		onLoad() {
 		onLoad() {
-			this.init()
 		},
 		},
 		// #ifndef MP
 		// #ifndef MP
 		onNavigationBarButtonTap(e) {
 		onNavigationBarButtonTap(e) {
@@ -170,8 +174,31 @@ import helper from '@/common/helper.js';
 					})
 					})
 				}
 				}
 			})
 			})
+			this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany',{
+				phone:this.userInfo.phone
+			}).then(res => {
+				if (res.data.code == 200) {
+					if(res.data.data.length==0){
+						this.isShowAlert = true
+					}else{
+						this.isShowAlert = false
+					}
+					this.compList = res.data.data
+					this.compName = res.data.data[0].compName
+					this.init(res.data.data[0].compId)
+				}
+			})
 		},
 		},
 		methods: {
 		methods: {
+			getCompWarehouse(){},
+			goOpenService(){
+				if (!this.hasLogin) {
+					url = '/pages/public/login';
+				}
+				uni.navigateTo({
+					url: '/pages/erp/openService/openService'
+				})
+			},
 			/**
 			/**
 			 * 统一跳转接口,拦截未登录路由
 			 * 统一跳转接口,拦截未登录路由
 			 * navigator标签现在默认没有转场动画,所以用view
 			 * navigator标签现在默认没有转场动画,所以用view
@@ -204,13 +231,15 @@ import helper from '@/common/helper.js';
 					})
 					})
 				} else {
 				} else {
 					if (item.url) {
 					if (item.url) {
-						console.log(this.warehouseId,"id")
 						helper.erpWarehouse = {
 						helper.erpWarehouse = {
 							warehouseName:this.warehouseName,
 							warehouseName:this.warehouseName,
 							binNumber:this.binNumber,
 							binNumber:this.binNumber,
 							compId:this.compId,
 							compId:this.compId,
-							agent:this.agent,
-							warehouseId:this.warehouseId
+							warehouseId:this.warehouseId,
+							baseId:this.baseId,
+							allWarehouse:this.allWarehouse,
+							warehouseCWList:this.warehouseCWList,
+							positionId: this.positionId
 						}
 						}
 						uni.navigateTo({
 						uni.navigateTo({
 							url: item.url
 							url: item.url
@@ -220,17 +249,19 @@ import helper from '@/common/helper.js';
 			},
 			},
 			confirmWarehouse() {},
 			confirmWarehouse() {},
 			confirmPositon() {},
 			confirmPositon() {},
-			compChange(){},
-			init() {
+			compChange(e){
+				this.compName = this.compList[e[0]].compName
+				this.init(this.compList[e[0]].compId)
+			},
+			init(compId) {
+				debugger
 				console.log(this.userInfo)
 				console.log(this.userInfo)
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
-					compId: '',
+					compId: compId,
 				}).then(res => {
 				}).then(res => {
-					if (res.data.data) {
+					if (res.data.data.length!=0) {
 						console.log('res',res.data.data)
 						console.log('res',res.data.data)
-						if (res.data.data.length == 0) {
-							this.isShowAlert = true
-						} else {
+							this.allWarehouse = res.data.data
 							this.warehouseName = res.data.data[0].warehouseName
 							this.warehouseName = res.data.data[0].warehouseName
 							this.warehouseList = res.data.data;
 							this.warehouseList = res.data.data;
 							this.compId = res.data.data[0].compId
 							this.compId = res.data.data[0].compId
@@ -238,24 +269,33 @@ import helper from '@/common/helper.js';
 							this.binNumber = res.data.data[0].positionInfos[0].binNumber
 							this.binNumber = res.data.data[0].positionInfos[0].binNumber
 							this.warehouseCWList = res.data.data[0].positionInfos
 							this.warehouseCWList = res.data.data[0].positionInfos
 							this.warehouseId = res.data.data[0].id
 							this.warehouseId = res.data.data[0].id
+							this.baseId = res.data.data[0].positionInfos[0].baseId
+							this.positionId = res.data.data[0].positionInfos[0].id
 							console.log('this.warehouseCWList',this.warehouseCWList)
 							console.log('this.warehouseCWList',this.warehouseCWList)
-							// this.makeBinNumber()
-						}
+					}	
+					else{
+						this.warehouseList=[]
+						this.warehouseCWList = []
+						this.warehouseName='暂无仓库'
+						this.binNumber='暂无'
 					}
 					}
 				})
 				})
 			},
 			},
 			makeBinNumber(){
 			makeBinNumber(){
 			
 			
 			},
 			},
-			warehousechange(e) {
+			warehousechange(e) {debugger
 				this.warehouseName = this.warehouseList[e[0]].warehouseName
 				this.warehouseName = this.warehouseList[e[0]].warehouseName
 				this.compId = this.warehouseList[e[0]].compId
 				this.compId = this.warehouseList[e[0]].compId
 				this.agent = this.warehouseList[e[0]].agent
 				this.agent = this.warehouseList[e[0]].agent
 				this.warehouseId =this.warehouseList[e[0]].id
 				this.warehouseId =this.warehouseList[e[0]].id
 				this.warehouseCWList = this.warehouseList[e[0]].positionInfos
 				this.warehouseCWList = this.warehouseList[e[0]].positionInfos
+				this.warehouseCWchange([0])
 			},
 			},
 			warehouseCWchange(e){
 			warehouseCWchange(e){
 				this.binNumber = this.warehouseCWList[e[0]].binNumber
 				this.binNumber = this.warehouseCWList[e[0]].binNumber
+				this.baseId = this.warehouseCWList[e[0]].baseId
+				this.positionId = this.warehouseCWList[e[0]].id
 			}
 			}
 
 
 		}
 		}
@@ -287,6 +327,7 @@ import helper from '@/common/helper.js';
 
 
 		.title {
 		.title {
 			font-size: 16px;
 			font-size: 16px;
+			font-weight: 700;
 		}
 		}
 	}
 	}
 
 
@@ -357,10 +398,12 @@ import helper from '@/common/helper.js';
 		display: flex;
 		display: flex;
 		margin: 20rpx 0;
 		margin: 20rpx 0;
 		justify-content: space-between;
 		justify-content: space-between;
-
+		border-bottom: 1px solid #EEEEEE;
+		padding-bottom: 20rpx;
 		.left,
 		.left,
 		.right {
 		.right {
 			display: flex;
 			display: flex;
+			align-items: center;
 		}
 		}
 	}
 	}
 	.comp{
 	.comp{
@@ -369,5 +412,12 @@ import helper from '@/common/helper.js';
 		font-weight: 500;
 		font-weight: 500;
 		color: #333333;
 		color: #333333;
 		margin-bottom: 20rpx;
 		margin-bottom: 20rpx;
+		padding-bottom: 20rpx;
+		font-weight: 700;
+		border-bottom: 1px solid #EEEEEE;
+	}
+	 .-model__title{
+		background: red;
+		color: red;
 	}
 	}
 </style>
 </style>

+ 32 - 8
pages/erp/openService/openService.vue

@@ -3,17 +3,18 @@
 		<view class="content">
 		<view class="content">
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">姓名</view>
 				<view class="left">姓名</view>
-				<input @input='calculate' class="right-bottom" placeholder="请输入姓名"></input>
+				<input v-model="personInfo.name" 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 @input='calculate' class="right-bottom" placeholder="请输入电话"></input>
+				<input class="right-bottom" v-model="personInfo.mobilePhone" placeholder="请输入电话"></input>
 			</view>
 			</view>
 			<view class="row no-boder">
 			<view class="row no-boder">
 				<view class="left">留言</view>
 				<view class="left">留言</view>
 			</view>
 			</view>
 			<view class="row no-boder">
 			<view class="row no-boder">
-				<u-input v-model="value" :type="type" :border="border" :height="height" :auto-height="autoHeight" />
+				<u-input v-model="personInfo.message" :type="type" :border="border" :height="height"
+					:auto-height="autoHeight" />
 			</view>
 			</view>
 			<view class="bottom">
 			<view class="bottom">
 				<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
 				<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
@@ -33,7 +34,13 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
-				value: '',
+				personInfo: {
+					name: '',
+					mobilePhone: '',
+					message: '',
+					type: 1
+
+				},
 				type: 'textarea',
 				type: 'textarea',
 				border: true,
 				border: true,
 				height: 150,
 				height: 150,
@@ -105,11 +112,28 @@
 			},
 			},
 			calculate() {},
 			calculate() {},
 			submit() {
 			submit() {
-				this.$refs.uToast.show({
-					title: '登录成功',
-					type: 'error',
-					url: '/pages/user/index'
+				if (!this.personInfo.name) {
+					this.$refs.uToast.show({
+						title: '姓名不能为空!',
+						type: 'error',
+					})
+				}
+				if (!this.personInfo.mobilePhone) {
+					this.$refs.uToast.show({
+						title: '电话号码不能为空!',
+						type: 'error',
+					})
+				}
+				this.$api.doRequest('post', '/openServiceInfo/api/addInfo', this.personInfo).then(res => {
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '提交成功,客服人员会及时与您取得联系。!',
+							type: 'success',
+							back: true
+						})
+					}
 				})
 				})
+
 			}
 			}
 		}
 		}
 	}
 	}

+ 12 - 21
pages/erp/warehousing/selectCarNo.vue

@@ -4,16 +4,16 @@
 			<u-search placeholder="输入车牌号" :show-action="false" v-model="inputKeyword"></u-search>
 			<u-search placeholder="输入车牌号" :show-action="false" v-model="inputKeyword"></u-search>
 		</view>
 		</view>
 		<view class="content2" v-if="!inputKeyword">
 		<view class="content2" v-if="!inputKeyword">
-			<view class="title">编号123456789可选车牌号如下:</view>
+			<view class="title">编号{{contractNo}}可选车牌号如下:</view>
 			<view class="item-contnet">
 			<view class="item-contnet">
 				<view class="item-list" v-for="(item,index) in newList" :key="index" @click="confirm(item)">
 				<view class="item-list" v-for="(item,index) in newList" :key="index" @click="confirm(item)">
-					{{item.contractNo}}
+					{{item.carNo}}({{item.tranCarNo}})
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content3" v-if="inputKeyword">
 		<view class="content3" v-if="inputKeyword">
 			<view class="search-item-list" v-for="(item,index) in filterNewList" :key="index" @click="confirm(item)">
 			<view class="search-item-list" v-for="(item,index) in filterNewList" :key="index" @click="confirm(item)">
-				{{item.contractNo}}
+				{{item.carNo}}
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
@@ -27,19 +27,21 @@
 				inputKeyword: '',
 				inputKeyword: '',
 				newList: [],
 				newList: [],
 				filterNewList: [],
 				filterNewList: [],
-				compId: ''
+				compId: '',
+				contractNo:''
 			}
 			}
 		},
 		},
-		onShow() {},
+		onShow() {
+			this.newList = uni.getStorageSync('erpContractNo').tranCarInfoList
+			this.contractNo = uni.getStorageSync('erpContractNo').contractNo
+		},
 		onLoad(options) {
 		onLoad(options) {
-			this.compId = options.compId
-			console.log(helper.selectContractNo); 
-			this.getContractNoList()
+			
 		},
 		},
 		watch: {
 		watch: {
 			inputKeyword(val) {
 			inputKeyword(val) {
 				this.filterNewList = this.newList.filter(function(item) {
 				this.filterNewList = this.newList.filter(function(item) {
-					if (item.contractNo.indexOf(val) > -1) {
+					if (item.carNo.indexOf(val) > -1) {
 						return item
 						return item
 					}
 					}
 				})
 				})
@@ -47,20 +49,9 @@
 		},
 		},
 		methods: {
 		methods: {
 			confirm(item){
 			confirm(item){
-				uni.setStorageSync('ContractNo', item);
+				uni.setStorageSync('erpcarNo', item);
 				uni.navigateBack({})
 				uni.navigateBack({})
 			},
 			},
-			getContractNoList() {
-				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					compId: this.compId,
-					flag: 5,
-				}).then(res => {
-					if (res.data.code == 200) {
-						console.log(res)
-						this.newList = res.data.data
-					}
-				})
-			},
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 38 - 22
pages/erp/warehousing/selectContractNo.vue

@@ -37,7 +37,8 @@
 				newSelectList:[],
 				newSelectList:[],
 				filterNewList: [],
 				filterNewList: [],
 				moreList:[],
 				moreList:[],
-				compId: ''
+				compId: '',
+				flag:""
 			}
 			}
 		},
 		},
 
 
@@ -48,7 +49,8 @@
 			this.newSelectList =  uni.getStorageSync('erpContractNoList');
 			this.newSelectList =  uni.getStorageSync('erpContractNoList');
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
-			this.compId = options.compId
+			this.flag = options.flag
+			this.compId = helper.erpWarehouse.compId 
 			console.log(helper.selectContractNo); 
 			console.log(helper.selectContractNo); 
 			this.getContractNoList()
 			this.getContractNoList()
 		},
 		},
@@ -69,6 +71,11 @@
 					_list=[]
 					_list=[]
 				}
 				}
 				if(_list.length<=20){
 				if(_list.length<=20){
+					_list = _list.filter(function(val) {
+						if (val.contractNo!=item.contractNo) {
+							return val
+						}
+					})
 					_list.unshift(item)
 					_list.unshift(item)
 				}else{
 				}else{
 					_list.unshift(item).pop(item)
 					_list.unshift(item).pop(item)
@@ -78,26 +85,35 @@
 				uni.navigateBack({})
 				uni.navigateBack({})
 			},
 			},
 			getContractNoList() {
 			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.moreList = res.data.data
+							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
+						}
+					})
+				}
+				
 			},
 			},
 		
 		
 		}
 		}

+ 178 - 88
pages/erp/warehousing/warehousing.vue

@@ -27,81 +27,90 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">皮重(吨)</view>
 				<view class="left">皮重(吨)</view>
-				<input @input='calculate' v-model='detailData.tare' class="right-bottom"
-					placeholder="输入皮重"></input>
+				<input @input='calculate' v-model='detailData.tare' 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 @input='calculate' v-model='detailData.deductionWeight' class="right-bottom" placeholder="0"></input>
+				<input @input='calculate' v-model='detailData.deductionWeight' 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 @input='calculate' v-model='detailData.netWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算" :disabled="true"></input>
+				<input @input='' v-model='netWeight' class="right-bottom" placeholder="不可编辑,自动计算"
+					:disabled="true"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">扣款(元/吨)</view>
 				<view class="left">扣款(元/吨)</view>
-				<input @input='calculate' v-model='detailData.deductionAmount' class="right-bottom" placeholder="0"></input>
+				<input @input='' v-model='detailData.deductionAmount' class="right-bottom" placeholder="输入扣款"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">扣重比</view>
 				<view class="left">扣重比</view>
-				<input @input='calculate' v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"></input>
+				<input @input='' v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">干粮水分(%)</view>
 				<view class="left">干粮水分(%)</view>
-				<input @input='calculate' v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"></input>
+				<input @input='' v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">潮粮水分(%)</view>
 				<view class="left">潮粮水分(%)</view>
-				<input @input='calculate' v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"></input>
+				<input @input='' v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
+					@input="pureWeightCount"></input>
 			</view>
 			</view>
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 			<view class="row row-bottom" v-if="detailData.type=='潮粮'">
 				<view class="left">纯重(吨)</view>
 				<view class="left">纯重(吨)</view>
-				<input @input='calculate' v-model='detailData.pureWeight' class="right-bottom"
-					placeholder="不可编辑,自动计算" :disabled="true"></input>
+				<input @input='calculate' v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"
+					:disabled="true"></input>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">品级</view>
 				<view class="left">品级</view>
 				<view @click='show3=true'>{{detailData.grade}}</view>
 				<view @click='show3=true'>{{detailData.grade}}</view>
-				<u-picker :range="pjList" range-key="grade" @confirm='handlerPicker($event)' v-model="show3" mode="selector">
+				<u-picker :range="pjList" range-key="grade" @confirm='pjPicker($event)' v-model="show3"
+					mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">经办人</view>
 				<view class="left">经办人</view>
 				<view @click='show6=true'>{{detailData.agent}}</view>
 				<view @click='show6=true'>{{detailData.agent}}</view>
-				<u-picker :range="handlerList" range-key="agent" @confirm='handlerPicker($event)' v-model="show6" mode="selector">
+				<u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
+					mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row">
 			<view class="row">
-			    <view class="left">入库日期</view>
-			    <view @click='show4=true'>{{detailData.inOutDate}}</view>
-			    <u-picker v-model="show4" mode="time" @confirm='dateChange($event)' :params="params">
-			     <!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
-			    </u-picker>
-			    <!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
-			   </view>
+				<view class="left">入库日期</view>
+				<view @click='show4=true'>{{detailData.inOutDate}}</view>
+				<u-picker v-model="show4" mode="time" @confirm='dateChange($event)' :params="params">
+					<!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
+				</u-picker>
+				<!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
+			</view>
 			<view class="row">
 			<view class="row">
 				<view class="left">入库类型</view>
 				<view class="left">入库类型</view>
 				<view @click='show5=true'>{{detailData.inOutType}}</view>
 				<view @click='show5=true'>{{detailData.inOutType}}</view>
-				<u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)' v-model="show5" mode="selector">
+				<u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
+					v-model="show5" mode="selector">
 				</u-picker>
 				</u-picker>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">车牌号</view>
 				<view class="left">车牌号</view>
-				<input v-if="true" @input='' v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
-				<view @click='slectCarNo' v-if="false">{{detailData.carNo}}</view>
+				<input v-if="!isPC" @input='' v-model='detailData.carNo' class="right-bottom"
+					placeholder="请输入车牌号"></input>
+				<view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view>
 			</view>
 			</view>
 			<view class="row row-bottom has-btn">
 			<view class="row row-bottom has-btn">
 				<view class="left">成本(元/吨)</view>
 				<view class="left">成本(元/吨)</view>
-				<input @input='' v-model='detailData.grossWeight' class="right-bottom"
-					placeholder="自动获取" disabled="isEditCB"></input>
-					<u-button class="edit-btn" @click="edit">编辑</u-button>
+				<input v-if="detailData.inOutType=='采购入库'" v-model='detailData.cost' class="right-bottom"
+					placeholder="自动获取" :disabled="isEditCB"></input>
+				<input v-if="detailData.inOutType!='采购入库'" v-model='detailData.cost' class="right-bottom"
+					placeholder="自动获取" :disabled="isEditCB"></input>
+				<u-button class="edit-btn" hover-class="none" @click="editCB">编辑</u-button>
 			</view>
 			</view>
 			<view class="row row-bottom has-btn">
 			<view class="row row-bottom has-btn">
 				<view class="left">运费(元/吨)</view>
 				<view class="left">运费(元/吨)</view>
-				<input @input='' v-model='detailData.grossWeight' disabled="isEditYF" class="right-bottom"
+				<input @input='' v-model='detailData.freight' :disabled="isEditYF" class="right-bottom"
 					placeholder="自动获取"></input>
 					placeholder="自动获取"></input>
-					<u-button class="edit-btn">编辑</u-button>
+				<u-button class="edit-btn" hover-class="none" @click="editYF">编辑</u-button>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
@@ -116,50 +125,54 @@
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">质检员</view>
 				<view class="left">质检员</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
 					placeholder="输入质检员姓名"></input>
 					placeholder="输入质检员姓名"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">水分(%)</view>
 				<view class="left">水分(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
 					placeholder="输入水分占比"></input>
 					placeholder="输入水分占比"></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 v-model='detailData.netWeight' class="right-bottom" disabled placeholder="输入容重"></input>
+				<input v-model='detailData.warehouseInOutDetail.bulkDensity' 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 @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
 					placeholder="输入热损伤占比"></input>
 					placeholder="输入热损伤占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">杂质(%)</view>
 				<view class="left">杂质(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
 					placeholder="输入杂质占比"></input>
 					placeholder="输入杂质占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">霉变粒(%)</view>
 				<view class="left">霉变粒(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
 					placeholder="输入霉变粒占比"></input>
 					placeholder="输入霉变粒占比"></input>
 			</view>
 			</view>
 			<view class="row row-bottom">
 			<view class="row row-bottom">
 				<view class="left">不完善粒(%)</view>
 				<view class="left">不完善粒(%)</view>
-				<input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
+				<input @input='' v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
 					placeholder="输入不完善粒占比"></input>
 					placeholder="输入不完善粒占比"></input>
 			</view>
 			</view>
 		</view>
 		</view>
 		<u-toast ref="uToast" />
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
 		<view class="bottom-btn">
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">暂存</u-button>
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	import upload from '@/components/upload.vue';
 	import upload from '@/components/upload.vue';
-	import helper from '@/common/helper.js'; 
+	import helper from '@/common/helper.js';
 	export default {
 	export default {
 		components: {
 		components: {
 			upload
 			upload
@@ -173,18 +186,19 @@
 				show4: false,
 				show4: false,
 				show5: false,
 				show5: false,
 				show6: false,
 				show6: false,
+				isPC: true,
 				params: {
 				params: {
-				     year: true,
-				     month: true,
-				     day: true,
-				     hour: true,
-				     minute: true,
-				     second: true
-				    },
-					isEditCB:'false',
-					isEditYF:'false',
-				warehouseName:'',
-				binNumber:'',
+					year: true,
+					month: true,
+					day: true,
+					hour: true,
+					minute: true,
+					second: true
+				},
+				isEditCB: 'false',
+				isEditYF: 'false',
+				warehouseName: '',
+				binNumber: '',
 				contractNoList: [{
 				contractNoList: [{
 					contractNo: "123"
 					contractNo: "123"
 				}],
 				}],
@@ -226,16 +240,23 @@
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
 				btnLoading: false, //防止重复点击
 				isAdd: true,
 				isAdd: true,
+				netWeight: 0,
+				inOutDate1: "",
 				detailData: {
 				detailData: {
 					contractNo: "请选择合同编号",
 					contractNo: "请选择合同编号",
-					carNo:'辽H12345',
+					carNo: '辽H12345',
 					type: "干粮",
 					type: "干粮",
 					goodsName: "123",
 					goodsName: "123",
-					inOutDate:'请输入入库日期',
-					grade:"一等品",
-					agent:'张三',
-					inOutType:'请选择入库类型',
-					qualityInspectionManagement: {}
+					inOutDate: '请输入入库日期',
+					grade: "一等品",
+					agent: '请选择经办人',
+					inOutType: '请选择入库类型',
+					deductionWeight: 0,
+					grossWeight: 0,
+					tare: 0,
+					deductionAmount: 0,
+					netWeight: 0,
+					warehouseInOutDetail: {}
 				}
 				}
 			}
 			}
 		},
 		},
@@ -243,50 +264,92 @@
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.warehouseName = helper.erpWarehouse.warehouseName
 			this.warehouseName = helper.erpWarehouse.warehouseName
 			this.compId = helper.erpWarehouse.compId
 			this.compId = helper.erpWarehouse.compId
-			//获取经办人
-			// this.detailData.agent = helper.erpWarehouse.agent
 			console.log(helper.erpWarehouse)
 			console.log(helper.erpWarehouse)
 		},
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo']),
+		},
 		onShow() {
 		onShow() {
-			this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
-			this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
-			if(!this.detailData.contractNo){
+			let _data = uni.getStorageSync('erpContractNo')
+			this.detailData.goodsName = _data.goodsName;
+			this.detailData.contractNo = _data.contractNo;
+			this.detailData.goodsNameKey = _data.goodsNameKey;
+			this.detailData.cost = _data.unitContractPrice
+			if (_data.inOutType == '采购入库') {
+				this.detailData.freight = 0
+			}
+			this.detailData.carNo = uni.getStorageSync('erpcarNo')
+			if (!_data.tranCarInfoList) _data.tranCarInfoList = []
+			if (!this.detailData.contractNo) {
 				this.detailData.contractNo = '请选择合同编号'
 				this.detailData.contractNo = '请选择合同编号'
+			} else {
+				if (_data.tranCarInfoList.length == 0) {
+					this.isPC = false
+				}
 			}
 			}
-			if(!this.detailData.goodsName){
+			if (!this.detailData.goodsName) {
 				this.detailData.goodsName = '货名'
 				this.detailData.goodsName = '货名'
 			}
 			}
+			console.log('当前合同', _data)
 			// 获取入库类型
 			// 获取入库类型
 			this.getrkType()
 			this.getrkType()
-			
+			//获取经办人
+			this.getPerson()
+
+		},
+		watch: {
+			netWeight: function(v) {
+				this.pureWeightCount()
+			},
 		},
 		},
 		methods: {
 		methods: {
-			getrkType(){
+			//计算纯重
+			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)
+				}
+			},
+			getPerson() {
+				this.$api.doRequest('get', '/staff/query/getStaffListByCompId', {
+					compId: this.compId
+				}).then(res => {
+					this.handlerList = res.data.data
+				})
+			},
+			getrkType() {
 				this.$api.doRequest('get', '/commonSysParameter/getInfo', {
 				this.$api.doRequest('get', '/commonSysParameter/getInfo', {
-				    constId: 'CON5'
-				   }).then(res => {
-				    this.warehousingTypeList = res.data.data
-				   })
+					constId: 'CON5'
+				}).then(res => {
+					this.warehousingTypeList = res.data.data
+				})
 			},
 			},
 			contractNopicker(e) {},
 			contractNopicker(e) {},
 			typePicker(e) {
 			typePicker(e) {
 				console.log(e)
 				console.log(e)
 				this.detailData.type = this.typeList[e].type
 				this.detailData.type = this.typeList[e].type
-				
-				
+
+
 			},
 			},
 			pjPicker(e) {
 			pjPicker(e) {
 				console.log(e)
 				console.log(e)
+				this.detailData.gradeKey = e[0]
+				    this.detailData.grade = this.pjList[e].grade
 			},
 			},
 			handlerPicker(e) {
 			handlerPicker(e) {
 				console.log(e)
 				console.log(e)
+				this.detailData.agent = this.handlerList[e].staffName
 			},
 			},
-			dateChange(e){
+			dateChange(e) {
 				console.log(e)
 				console.log(e)
-				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
+				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute + ":" + e.second 
+				// this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute 
 			},
 			},
 			warehousingTypePicker(e) {
 			warehousingTypePicker(e) {
-				console.log(e)
+				this.detailData.inOutType = this.warehousingTypeList[e].constValue
 			},
 			},
 			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') {
@@ -301,7 +364,7 @@
 				}
 				}
 			},
 			},
 			calculate() {
 			calculate() {
-				this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
+				this.netWeight = this.detailData.grossWeight - this.detailData.tare - this.detailData.deductionWeight
 			},
 			},
 			getImgUrl(res) {
 			getImgUrl(res) {
 				this.detailData.addressUrl = res
 				this.detailData.addressUrl = res
@@ -349,11 +412,13 @@
 				console.log(e)
 				console.log(e)
 			},
 			},
 			onRemove(index) {},
 			onRemove(index) {},
-			submit() {
-				if (!this.detailData.grossWeight) {
-					this.$api.msg('毛重不能为空')
-					return
-				}
+			editCB() {
+				this.isEditCB = false
+			},
+			editYF() {
+				this.isEditYF = false
+			},
+			submit(num) {
 				if (isNaN(this.detailData.grossWeight) ||
 				if (isNaN(this.detailData.grossWeight) ||
 					(String(this.detailData.grossWeight).indexOf('.') != -1 &&
 					(String(this.detailData.grossWeight).indexOf('.') != -1 &&
 						String(this.detailData.grossWeight).length -
 						String(this.detailData.grossWeight).length -
@@ -365,15 +430,36 @@
 					this.$api.msg('毛重输入错误!')
 					this.$api.msg('毛重输入错误!')
 					return
 					return
 				}
 				}
+				this.detailData.baseId = helper.erpWarehouse.warehouseId
+				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
+				this.detailData.positionId = helper.erpWarehouse.positionId
+				this.detailData.binNumber = this.binNumber
+				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
+				this.detailData.compId = helper.erpWarehouse.compId
+				this.detailData.netWeight = this.netWeight
+				this.detailData.backOffice = this.userInfo.userName
+				this.detailData.backOfficeId = this.userInfo.id
+				this.detailData.inOutFlag = 2
+				this.detailData.taskType = "入库任务"
+				this.detailData.pcFlag = 0
+				let title = ""
+				if (num == 1) {
+					this.detailData.statusFlag = 1
+					// this.detailData.inOutDate = this.inOutDate1
+					title = "暂存成功"
+				} else if (num == 2) {
+					this.detailData.statusFlag = 3
+					title = "提交成功"
+				}
 				let that = this
 				let that = this
 				uni.showModal({
 				uni.showModal({
-					content: "确定提交检斤信息?",
+					content: "确定提交入库库信息?",
 					success(res) {
 					success(res) {
 						if (res.confirm) {
 						if (res.confirm) {
-							that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',
+							that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
 								that.detailData).then(res => {
 								that.detailData).then(res => {
 								if (res.data.code == 200) {
 								if (res.data.code == 200) {
-									that.$api.msg('提交成功')
+									that.$api.msg(title)
 									uni.navigateBack()
 									uni.navigateBack()
 								}
 								}
 							})
 							})
@@ -381,14 +467,14 @@
 					}
 					}
 				})
 				})
 			},
 			},
-			slectcontractNo(){
+			slectcontractNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/erp/warehousing/selectContractNo?compId='+this.compId
+					url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
 				})
 				})
 			},
 			},
-			slectCarNo(){
+			slectCarNo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/erp/warehousing/selectCarNo'
+					url: '/pages/erp/warehousing/selectCarNo'
 				})
 				})
 			},
 			},
 		}
 		}
@@ -407,6 +493,7 @@
 		.top {
 		.top {
 			display: flex;
 			display: flex;
 			margin-bottom: 20rpx;
 			margin-bottom: 20rpx;
+			align-items: center;
 
 
 			.top-left {
 			.top-left {
 				margin-right: 20rpx;
 				margin-right: 20rpx;
@@ -469,17 +556,20 @@
 		background: #22C572;
 		background: #22C572;
 		border-radius: 10rpx;
 		border-radius: 10rpx;
 	}
 	}
-	.edit-btn{
+
+	.edit-btn {
 		background: #22C572;
 		background: #22C572;
 		width: 100rpx;
 		width: 100rpx;
 		height: 50rpx;
 		height: 50rpx;
 		margin: 0;
 		margin: 0;
 		color: white;
 		color: white;
 	}
 	}
-	.has-btn{
+
+	.has-btn {
 		align-items: center;
 		align-items: center;
 	}
 	}
-	.bottom-btn{
+
+	.bottom-btn {
 		width: 92%;
 		width: 92%;
 		position: fixed;
 		position: fixed;
 		bottom: 40rpx;
 		bottom: 40rpx;

+ 1 - 1
pages/erpbusiness/examine_quality_testing.vue

@@ -117,7 +117,7 @@
 			<view class="c-row ">
 			<view class="c-row ">
 				<view class="title">霉变粒(%)</view>
 				<view class="title">霉变粒(%)</view>
 				<view class="con-list">
 				<view class="con-list">
-					{{gridList.impurity}}
+					{{gridList.mildewGrain}}
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="c-row ">
 			<view class="c-row ">

+ 2 - 2
pages/erpbusiness/sm/sm.vue

@@ -94,7 +94,7 @@
 			//粮商认证
 			//粮商认证
 			toGrainMerchantCertification(){
 			toGrainMerchantCertification(){
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/attestation/indexTwo'
+					url:'/pageD/identity/companyIdentity?status=1'
 				})
 				})
 			},
 			},
 			
 			
@@ -158,7 +158,7 @@
 						}
 						}
 					});
 					});
 			},
 			},
-			submit() {debugger
+			submit() {
 				if(this.flag) return
 				if(this.flag) return
 				let _isAllCheck = false
 				let _isAllCheck = false
 				for (let i = 0; i < this.grainMerchantList.length; i++) {
 				for (let i = 0; i < this.grainMerchantList.length; i++) {

+ 0 - 1
pages/grain_pulse/home.vue

@@ -261,7 +261,6 @@
 					}
 					}
 					uni.hideLoading()
 					uni.hideLoading()
 				}).catch(res => {
 				}).catch(res => {
-							debugger
 					that.isLoadMore=false
 					that.isLoadMore=false
 					that.loadStatus = 'nomore'
 					that.loadStatus = 'nomore'
 					if(that.currentPage>1){that.currentPage=1}
 					if(that.currentPage>1){that.currentPage=1}