|
@@ -66,8 +66,7 @@
|
|
|
<view class="row">
|
|
|
<view class="left">品级</view>
|
|
|
<view @click='show3=true'>{{detailData.grade}}</view>
|
|
|
- <u-picker :range="pjList" range-key="grade" @confirm='pjPicker($event)' v-model="show3"
|
|
|
- mode="selector">
|
|
|
+ <u-picker :range="pjList" range-key="grade" @confirm='pjPicker($event)' v-model="show3" mode="selector">
|
|
|
</u-picker>
|
|
|
</view>
|
|
|
<view class="row">
|
|
@@ -100,10 +99,10 @@
|
|
|
</view>
|
|
|
<view class="row row-bottom has-btn">
|
|
|
<view class="left">成本(元/吨)</view>
|
|
|
- <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"
|
|
|
+ <input 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 class="row row-bottom has-btn">
|
|
@@ -191,9 +190,9 @@
|
|
|
year: true,
|
|
|
month: true,
|
|
|
day: true,
|
|
|
- hour: true,
|
|
|
- minute: true,
|
|
|
- second: true
|
|
|
+ // hour: true,
|
|
|
+ // minute: true,
|
|
|
+ // second: true
|
|
|
},
|
|
|
isEditCB: 'false',
|
|
|
isEditYF: 'false',
|
|
@@ -244,10 +243,10 @@
|
|
|
inOutDate1: "",
|
|
|
detailData: {
|
|
|
contractNo: "请选择合同编号",
|
|
|
- carNo: '辽H12345',
|
|
|
+ carNo: '请输入车牌号',
|
|
|
type: "干粮",
|
|
|
goodsName: "123",
|
|
|
- inOutDate: '请输入入库日期',
|
|
|
+ inOutDate: '请选择入库日期',
|
|
|
grade: "一等品",
|
|
|
agent: '请选择经办人',
|
|
|
inOutType: '请选择入库类型',
|
|
@@ -256,6 +255,7 @@
|
|
|
tare: 0,
|
|
|
deductionAmount: 0,
|
|
|
netWeight: 0,
|
|
|
+ cost:0,
|
|
|
warehouseInOutDetail: {}
|
|
|
}
|
|
|
}
|
|
@@ -271,22 +271,38 @@
|
|
|
},
|
|
|
onShow() {
|
|
|
let _data = uni.getStorageSync('erpContractNo')
|
|
|
+ this.detailData.agent = helper.erpWarehouse.personCharge
|
|
|
this.detailData.goodsName = _data.goodsName;
|
|
|
this.detailData.contractNo = _data.contractNo;
|
|
|
this.detailData.goodsNameKey = _data.goodsNameKey;
|
|
|
- this.detailData.cost = _data.unitContractPrice
|
|
|
+ if(_data.unitContractPrice) {
|
|
|
+ this.detailData.cost = _data.unitContractPrice
|
|
|
+ }
|
|
|
+ let _day = new Date();
|
|
|
+ _day.setTime(_day.getTime());
|
|
|
+ this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
|
|
|
if (_data.inOutType == '采购入库') {
|
|
|
this.detailData.freight = 0
|
|
|
}
|
|
|
this.detailData.carNo = uni.getStorageSync('erpcarNo')
|
|
|
- if (!_data.tranCarInfoList) _data.tranCarInfoList = []
|
|
|
+ if (!_data.tranCarInfoList){
|
|
|
+ _data.tranCarInfoList = []
|
|
|
+ } else{
|
|
|
+ this.isPC = true
|
|
|
+ if(uni.getStorageSync('ContractNoCar')){
|
|
|
+ this.detailData.carNo = uni.getStorageSync('ContractNoCar')
|
|
|
+ }else{
|
|
|
+ this.detailData.carNo = _data.tranCarInfoList[0].carNo
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!this.detailData.contractNo) {
|
|
|
this.detailData.contractNo = '请选择合同编号'
|
|
|
- } else {
|
|
|
- if (_data.tranCarInfoList.length == 0) {
|
|
|
- this.isPC = false
|
|
|
- }
|
|
|
}
|
|
|
+ // else {
|
|
|
+ // if (_data.tranCarInfoList.length == 0) {
|
|
|
+ // this.isPC = false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
if (!this.detailData.goodsName) {
|
|
|
this.detailData.goodsName = '货名'
|
|
|
}
|
|
@@ -337,7 +353,7 @@
|
|
|
pjPicker(e) {
|
|
|
console.log(e)
|
|
|
this.detailData.gradeKey = e[0]
|
|
|
- this.detailData.grade = this.pjList[e].grade
|
|
|
+ this.detailData.grade = this.pjList[e].grade
|
|
|
},
|
|
|
handlerPicker(e) {
|
|
|
console.log(e)
|
|
@@ -345,8 +361,8 @@
|
|
|
},
|
|
|
dateChange(e) {
|
|
|
console.log(e)
|
|
|
- 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
|
|
|
+ this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
|
|
|
+ this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
|
|
|
},
|
|
|
warehousingTypePicker(e) {
|
|
|
this.detailData.inOutType = this.warehousingTypeList[e].constValue
|
|
@@ -419,6 +435,18 @@
|
|
|
this.isEditYF = false
|
|
|
},
|
|
|
submit(num) {
|
|
|
+ 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 -
|
|
@@ -430,6 +458,259 @@
|
|
|
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.deductionAmount) ||
|
|
|
+ (String(this.detailData.deductionAmount).indexOf('.') != -1 &&
|
|
|
+ String(this.detailData.deductionAmount).length -
|
|
|
+ (String(this.detailData.deductionAmount).indexOf('.') + 1) >
|
|
|
+ 2) ||
|
|
|
+ this.detailData.deductionAmount < 1 ||
|
|
|
+ this.detailData.deductionAmount > 10000
|
|
|
+ ) {
|
|
|
+ this.$api.msg('扣款输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.detailData.deductionAmount) {
|
|
|
+ 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.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
|
|
@@ -445,7 +726,7 @@
|
|
|
let title = ""
|
|
|
if (num == 1) {
|
|
|
this.detailData.statusFlag = 1
|
|
|
- // this.detailData.inOutDate = this.inOutDate1
|
|
|
+ this.detailData.inOutDate = this.inOutDate1
|
|
|
title = "暂存成功"
|
|
|
} else if (num == 2) {
|
|
|
this.detailData.statusFlag = 3
|
|
@@ -491,6 +772,9 @@
|
|
|
padding: 20rpx 20rpx 140rpx 20rpx;
|
|
|
|
|
|
.top {
|
|
|
+ border-radius: 20rpx;
|
|
|
+ background: white;
|
|
|
+ padding: 20rpx;
|
|
|
display: flex;
|
|
|
margin-bottom: 20rpx;
|
|
|
align-items: center;
|