|
@@ -246,7 +246,7 @@
|
|
|
carNo: '辽H12345',
|
|
|
type: "干粮",
|
|
|
goodsName: "123",
|
|
|
- inOutDate: '请输入入库日期',
|
|
|
+ inOutDate: '请选择入库日期',
|
|
|
grade: "一等品",
|
|
|
agent: '请选择经办人',
|
|
|
inOutType: '请选择入库类型',
|
|
@@ -421,7 +421,18 @@
|
|
|
this.isEditYF = false
|
|
|
},
|
|
|
submit(num) {
|
|
|
- debugger
|
|
|
+ if (!this.detailData.contractNo) {
|
|
|
+ this.$api.msg('合同编号不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.goodsName) {
|
|
|
+ this.$api.msg('货名不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.grossWeight) {
|
|
|
+ this.$api.msg('毛重不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
if (isNaN(this.detailData.grossWeight) ||
|
|
|
(String(this.detailData.grossWeight).indexOf('.') != -1 &&
|
|
|
String(this.detailData.grossWeight).length -
|
|
@@ -433,6 +444,261 @@
|
|
|
this.$api.msg('毛重输入错误!')
|
|
|
return
|
|
|
}
|
|
|
+ if (!this.detailData.tare) {
|
|
|
+ this.$api.msg('皮重不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (isNaN(this.detailData.tare) ||
|
|
|
+ (String(this.detailData.tare).indexOf('.') != -1 &&
|
|
|
+ String(this.detailData.tare).length -
|
|
|
+ (String(this.detailData.tare).indexOf('.') + 1) >
|
|
|
+ 3) ||
|
|
|
+ this.detailData.tare < 0 ||
|
|
|
+ this.detailData.tare > 10
|
|
|
+ ) {
|
|
|
+ this.$api.msg('皮重输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.detailData.deductionWeight) {
|
|
|
+ this.$api.msg('扣重不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (isNaN(this.detailData.deductionWeight) ||
|
|
|
+ (String(this.detailData.deductionWeight).indexOf('.') != -1 &&
|
|
|
+ String(this.detailData.deductionWeight).length -
|
|
|
+ (String(this.detailData.deductionWeight).indexOf('.') + 1) >
|
|
|
+ 1) ||
|
|
|
+ this.detailData.deductionWeight < 1 ||
|
|
|
+ this.detailData.deductionWeight > 100000
|
|
|
+ ) {
|
|
|
+ this.$api.msg('扣重输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.tare > this.detailData.grossWeight) {
|
|
|
+ this.$api.msg('皮重不能大于毛重')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.netWeight < 0) {
|
|
|
+ this.$api.msg('净重不能小于0')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.type == "潮粮") {
|
|
|
+ if (!this.detailData.buckleWeightRatio) {
|
|
|
+ this.$api.msg('扣重比不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (isNaN(this.detailData.buckleWeightRatio) ||
|
|
|
+ (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
|
|
|
+ String(this.detailData.buckleWeightRatio).length -
|
|
|
+ (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
|
|
|
+ 2) ||
|
|
|
+ this.detailData.buckleWeightRatio < 0 ||
|
|
|
+ this.detailData.buckleWeightRatio > 2
|
|
|
+ ) {
|
|
|
+ this.$api.msg('扣重比输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.solidGrainWater) {
|
|
|
+ this.$api.msg('干粮水分不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (isNaN(this.detailData.solidGrainWater) ||
|
|
|
+ (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
|
|
|
+ String(this.detailData.solidGrainWater).length -
|
|
|
+ (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
|
|
|
+ 1) ||
|
|
|
+ this.detailData.solidGrainWater < 1 ||
|
|
|
+ this.detailData.solidGrainWater > 40
|
|
|
+ ) {
|
|
|
+ this.$api.msg('干粮水分输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.tidalGrainWater) {
|
|
|
+ this.$api.msg('潮粮水分不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (isNaN(this.detailData.tidalGrainWater) ||
|
|
|
+ (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
|
|
|
+ String(this.detailData.tidalGrainWater).length -
|
|
|
+ (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
|
|
|
+ 1) ||
|
|
|
+ this.detailData.tidalGrainWater < 1 ||
|
|
|
+ this.detailData.tidalGrainWater > 40
|
|
|
+ ) {
|
|
|
+ this.$api.msg('潮粮水分输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.tidalGrainWater < this.detailData.solidGrainWater) {
|
|
|
+ this.$api.msg('潮粮水分输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.pureWeight) {
|
|
|
+ this.$api.msg('纯重不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.grade == "请输入品级") {
|
|
|
+ this.$api.msg('品级不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.agent == "请选择经办人") {
|
|
|
+ this.$api.msg('经办人不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.inOutDate == "请选择入库日期") {
|
|
|
+ this.$api.msg('入库日期不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.inOutType == "请选择出库类型") {
|
|
|
+ this.$api.msg('出库类型不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.carNo) {
|
|
|
+ this.$api.msg('车牌号不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.carNo.length != 7) {
|
|
|
+ this.$api.msg('车牌号输入有误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.addressUrl) {
|
|
|
+ this.$api.msg('请上传磅单')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.inOutType == '采购入库') {
|
|
|
+ if (!this.detailData.unitContractPrice) {
|
|
|
+ this.$api.msg('未获取到成本,请编辑后提交')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.unitContractPrice).indexOf('.') != -1 && String(this.detailData
|
|
|
+ .unitContractPrice).length - (String(
|
|
|
+ this.detailData.unitContractPrice).indexOf('.') + 1) > 2) {
|
|
|
+ this.$api.msg('成本输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.unitContractPrice < 0 || this.detailData.unitContractPrice > 20000) {
|
|
|
+ this.$api.msg('成本输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!this.detailData.cost) {
|
|
|
+ this.$api.msg('未获取到成本,请编辑后提交')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.cost).indexOf('.') != -1 && String(this.detailData
|
|
|
+ .cost).length - (String(
|
|
|
+ this.detailData.cost).indexOf('.') + 1) > 2) {
|
|
|
+ this.$api.msg('成本输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.cost < 0 || this.detailData.cost > 20000) {
|
|
|
+ this.$api.msg('成本输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // if (!this.detailData.freight) {
|
|
|
+ // this.$api.msg('运费不能为空')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ if (this.detailData.warehouseInOutDetail.qualityInspector) {
|
|
|
+ if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData
|
|
|
+ .warehouseInOutDetail
|
|
|
+ .qualityInspector > 10) {
|
|
|
+ this.$api.msg('质检员姓名需要2-10个字')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.warehouseInOutDetail.waterContent) {
|
|
|
+ if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
|
|
|
+ .detailData.tidalGrainWater) {
|
|
|
+ this.$api.msg('水分占比与潮粮水分不一致')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.detailData.type == "干粮") {
|
|
|
+ if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData
|
|
|
+ .warehouseInOutDetail
|
|
|
+ .waterContent > 40) {
|
|
|
+ this.$api.msg('热损伤占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
|
|
|
+ .detailData.warehouseInOutDetail.jiaorenli).length - (String(
|
|
|
+ this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
|
|
|
+ this.$api.msg('热损伤占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.warehouseInOutDetail.bulkDensity) {
|
|
|
+ if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
|
|
|
+ .bulkDensity > 1000) {
|
|
|
+ this.$api.msg('容重输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
|
|
|
+ .detailData.warehouseInOutDetail.bulkDensity).length - (
|
|
|
+ String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
|
|
|
+ this.$api.msg('容重输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.warehouseInOutDetail.jiaorenli) {
|
|
|
+ if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
|
|
|
+ .jiaorenli > 40) {
|
|
|
+ this.$api.msg('热损伤占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this
|
|
|
+ .detailData
|
|
|
+ .warehouseInOutDetail.jiaorenli).length - (String(
|
|
|
+ this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
|
|
|
+ this.$api.msg('热损伤占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.warehouseInOutDetail.impurity) {
|
|
|
+ if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
|
|
|
+ .impurity > 40) {
|
|
|
+ this.$api.msg('杂质占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this
|
|
|
+ .detailData
|
|
|
+ .warehouseInOutDetail.impurity).length - (String(
|
|
|
+ this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
|
|
|
+ this.$api.msg('杂质占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.warehouseInOutDetail.mildewGrain) {
|
|
|
+ if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
|
|
|
+ .mildewGrain > 40) {
|
|
|
+ this.$api.msg('霉变粒占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
|
|
|
+ .detailData
|
|
|
+ .warehouseInOutDetail.mildewGrain).length - (String(
|
|
|
+ this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
|
|
|
+ this.$api.msg('霉变粒占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.detailData.warehouseInOutDetail.imperfectGrain) {
|
|
|
+ if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
|
|
|
+ .imperfectGrain > 40) {
|
|
|
+ this.$api.msg('不完善粒占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
|
|
|
+ .detailData
|
|
|
+ .warehouseInOutDetail.imperfectGrain).length - (String(
|
|
|
+ this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
|
|
|
+ this.$api.msg('不完善粒占比输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.detailData.baseId = helper.erpWarehouse.warehouseId
|
|
|
this.detailData.warehouseName = helper.erpWarehouse.warehouseName
|
|
|
this.detailData.positionId = helper.erpWarehouse.positionId
|