huangfuli 3 年之前
父节点
当前提交
149bbfe74a
共有 2 个文件被更改,包括 117 次插入16 次删除
  1. 116 16
      src/views/outboundManagement/weighing.vue
  2. 1 0
      src/views/outboundManagement/weighingManagement.vue

+ 116 - 16
src/views/outboundManagement/weighing.vue

@@ -58,17 +58,17 @@
 						</ws-form-item>
 						<el-button type="primary" v-if="this.types == 2 || this.types == null">重新获取</el-button>
 						<!-- <div class="formItem"> -->
-							<ws-form-item label="净重(公斤)" span="1" prop="netWeight" v-if="this.types == 1">
-								<ws-input v-model="weighingList.netWeight" placeholder="请输入净重" maxlength="100"
-									size="small" disabled />
-							</ws-form-item>
+						<ws-form-item label="净重(公斤)" span="1" prop="netWeight" v-if="this.types == 1">
+							<ws-input v-model="weighingList.netWeight" placeholder="请输入净重" maxlength="100" size="small"
+								disabled />
+						</ws-form-item>
 						<!-- </div> -->
 						<div class="bangdan">
 							<el-form-item label="上传磅单" v-if="this.types == 1">
 							</el-form-item>
 							<el-upload action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
-								:on-success="(res, file) => {handlePictureCardPreview1(res)}" :on-remove="(value) => {handleRemove(value)}" class="photo2"
-								v-if="this.types == 1">
+								:on-success="(res, file) => {handlePictureCardPreview1(res)}"
+								:on-remove="(value) => {handleRemove(value)}" class="photo2" v-if="this.types == 1">
 								<i class="el-icon-plus"></i>
 							</el-upload>
 							<el-dialog :visible.sync="dialogVisible" v-if="this.types == 1">
@@ -105,13 +105,13 @@
 					storageNumber: '',
 					buckleMiscellaneous: 0,
 					compId: sessionStorage.getItem('ws-pf_compId'),
-					warehouseName: '',
 				},
 				disabled: false,
 				disabled1: false,
 				disabled2: false,
 				dialogVisible: false,
 				getbinNumberList: [],
+				warehouseName: '',
 				contractNoList: [],
 				inOutType: [{
 						value: '销售出库',
@@ -142,6 +142,7 @@
 			this.weighingList.carNumber = this.$route.query.carNumber
 			this.weighingList.goodsName = this.$route.query.goodsName
 			this.weighingList.inOutType = this.$route.query.inOutType
+			this.warehouseName = this.$route.query.warehouseName
 			let id = this.$route.query.id
 			this.relationId = this.$route.query.relationId
 			this.warehouseId = this.$route.query.warehouseId
@@ -222,8 +223,110 @@
 					})
 			},
 			print() {
-				(this.weighingList.secretaryWeigher =
-					sessionStorage.getItem('ws-pf_staffName')),
+				if (this.types == null || this.types == 2) {
+					if (!this.weighingList.contractNo) {
+						this.$message({
+							message: '合同编号不能为空',
+							type: 'warning',
+						})
+						return
+					}
+					if (!this.weighingList.binNumber) {
+						this.$message({
+							message: '仓位号不能为空',
+							type: 'warning',
+						})
+						return
+					}
+					if (!this.weighingList.storageNumber) {
+						this.$message({
+							message: '囤位号不能为空',
+							type: 'warning',
+						})
+						return
+					}
+					if (
+						this.weighingList.storageNumber.length < 1 ||
+						this.weighingList.storageNumber.length > 10
+					) {
+						this.$message({
+							message: '囤位号不超过10个字符!',
+							type: 'warning',
+						})
+						return
+					}
+					if (!this.weighingList.carNumber) {
+						this.$message({
+							message: '车牌号不能为空',
+							type: 'warning',
+						})
+						return
+					}
+					if (
+						this.weighingList.carNumber.length != 7
+					) {
+						this.$message({
+							message: '车牌号输入错误',
+							type: 'warning',
+						})
+						return
+					}
+					if (!this.weighingList.inOutType) {
+						this.$message({
+							message: '出库类型不能为空',
+							type: 'warning',
+						})
+						return
+					}
+					// if (!this.weighingList.tare) {
+					// 	this.$message({
+					// 		message: '皮重不能为空',
+					// 		type: 'warning',
+					// 	})
+					// 	return
+					// }
+					// if (
+					// 	isNaN(this.weighingList.tare) ||
+					// 	(String(this.weighingList.tare).indexOf('.') != -1 &&
+					// 		String(this.weighingList.tare).length -
+					// 		(String(this.weighingList.tare).indexOf('.') + 1) >
+					// 		1) ||
+					// 	this.weighingList.tare < 1 ||
+					// 	this.weighingList.tare > 100000
+					// ) {
+					// 	this.$message({
+					// 		message: '皮重输入错误!',
+					// 		type: 'warning',
+					// 	})
+					// 	return
+					// }
+				}
+				if (this.types == 1) {
+					if (!this.weighingList.grossWeight) {
+						this.$message({
+							message: '毛重不能为空',
+							type: 'warning',
+						})
+						return
+					}
+					if (
+						isNaN(this.weighingList.grossWeight) ||
+						(String(this.weighingList.grossWeight).indexOf('.') != -1 &&
+							String(this.weighingList.grossWeight).length -
+							(String(this.weighingList.grossWeight).indexOf('.') + 1) >
+							1) ||
+						this.weighingList.grossWeight < 1 ||
+						this.weighingList.grossWeight > 100000
+					) {
+						this.$message({
+							message: '毛重输入错误!',
+							type: 'warning',
+						})
+						return
+					}
+				}
+				this.weighingList.warehouseName = this.warehouseName
+				this.weighingList.secretaryWeigher = sessionStorage.getItem('ws-pf_staffName')
 				this.$confirm('确定保存检斤信息?', '提示', {
 						confirmButtonText: '确定',
 						cancelButtonText: '取消',
@@ -243,8 +346,7 @@
 										path: 'weighingManagement'
 									})
 								})
-								.catch((response) => {
-								})
+								.catch((response) => {})
 						} else if (this.types == 2) {
 							this.weighingList.warehouseId = this.warehouseId
 							tareEdit(this.weighingList)
@@ -258,11 +360,10 @@
 										path: 'weighingManagement'
 									})
 								})
-								.catch((response) => {
-								})
+								.catch((response) => {})
 						} else if (this.types == null) {
 							this.weighingList.warehouseId = this.warehouseId
-							tareAdd(this.weighingList,this.warehouseName)
+							tareAdd(this.weighingList)
 								.toPromise()
 								.then((response) => {
 									this.$notify.success({
@@ -273,8 +374,7 @@
 										path: 'weighingManagement'
 									})
 								})
-								.catch((response) => {
-								})
+								.catch((response) => {})
 						}
 					})
 					.catch(() => {

+ 1 - 0
src/views/outboundManagement/weighingManagement.vue

@@ -148,6 +148,7 @@
 						netWeight: row.netWeight,
 						relationId: row.relationId,
 						warehouseId: this.warehouseId,
+						warehouseName: this.warehouseName,
 					},
 				})
 			},