|
@@ -431,6 +431,316 @@ export default {
|
|
|
},
|
|
|
//提交按钮
|
|
|
submit() {
|
|
|
+ if (!this.dataList.goodsName) {
|
|
|
+ this.$message({
|
|
|
+ message: '货名不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.grossWeight) {
|
|
|
+ this.$message({
|
|
|
+ message: '毛重不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.grossWeight <= 0 ||
|
|
|
+ this.dataList.grossWeight > 10000 ||
|
|
|
+ (String(this.dataList.grossWeight).indexOf('.') != -1 &&
|
|
|
+ String(this.dataList.grossWeight).length -
|
|
|
+ (String(this.dataList.grossWeight).indexOf('.') + 1) >
|
|
|
+ 3)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '毛重输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.tare < 0 ||
|
|
|
+ this.dataList.tare > 10000 ||
|
|
|
+ (String(this.dataList.tare).indexOf('.') != -1 &&
|
|
|
+ String(this.dataList.tare).length -
|
|
|
+ (String(this.dataList.tare).indexOf('.') + 1) >
|
|
|
+ 3)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '皮重输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.agent) {
|
|
|
+ this.$message({
|
|
|
+ message: '经办人不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.agent.length < 2 ||
|
|
|
+ this.dataList.agent.length > 10
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '经办人输入有误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.grade) {
|
|
|
+ this.$message({
|
|
|
+ message: '品级不能为空!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.inOutDate) {
|
|
|
+ this.$message({
|
|
|
+ message: '入库日期不能为空!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.inOutType) {
|
|
|
+ this.$message({
|
|
|
+ message: '入库类型不能为空!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.carNo) {
|
|
|
+ this.$message({
|
|
|
+ message: '车牌号不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.dataList.carNo.length > 7) {
|
|
|
+ this.$message({
|
|
|
+ message: '车牌号输入错误,请输入7个字符之内',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.dataList.contractNo) {
|
|
|
+ this.$message({
|
|
|
+ message: '合同编号不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.contractNo.length < 6 ||
|
|
|
+ this.dataList.contractNo.length > 20
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '合同编号长度不符合要求,请输入6-20个字符之内',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.dataList.netWeight > this.$route.query.capacity) {
|
|
|
+ this.$message({
|
|
|
+ message: '入库量大于该仓库容量!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //自检员
|
|
|
+ if (this.dataList.warehouseInOutDetail.qualityInspector) {
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.qualityInspector.length <
|
|
|
+ 2 ||
|
|
|
+ this.dataList.warehouseInOutDetail.qualityInspector.length > 10
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '质检员姓名长度错误!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataList.warehouseInOutDetail.waterContent) {
|
|
|
+ if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
|
|
|
+ this.$message({
|
|
|
+ message: '水分(%)非数字!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.waterContent < 1 ||
|
|
|
+ this.dataList.warehouseInOutDetail.waterContent > 40 ||
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.waterContent
|
|
|
+ ).indexOf('.') != -1 &&
|
|
|
+ String(this.dataList.warehouseInOutDetail.waterContent)
|
|
|
+ .length -
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.waterContent
|
|
|
+ ).indexOf('.') +
|
|
|
+ 1) >
|
|
|
+ 2)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //杂质
|
|
|
+ if (this.dataList.warehouseInOutDetail.impurity) {
|
|
|
+ if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
|
|
|
+ this.$message({
|
|
|
+ message: '杂质(%)非数字!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.impurity < 1 ||
|
|
|
+ this.dataList.warehouseInOutDetail.impurity > 40 ||
|
|
|
+ (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
|
|
|
+ '.'
|
|
|
+ ) != -1 &&
|
|
|
+ String(this.dataList.warehouseInOutDetail.impurity).length -
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.impurity
|
|
|
+ ).indexOf('.') +
|
|
|
+ 1) >
|
|
|
+ 2)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //霉变
|
|
|
+ if (this.dataList.warehouseInOutDetail.mildewGrain) {
|
|
|
+ if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
|
|
|
+ this.$message({
|
|
|
+ message: '霉变粒(%)非数字!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
|
|
|
+ this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
|
|
|
+ (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
|
|
|
+ '.'
|
|
|
+ ) != -1 &&
|
|
|
+ String(this.dataList.warehouseInOutDetail.mildewGrain).length -
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.mildewGrain
|
|
|
+ ).indexOf('.') +
|
|
|
+ 1) >
|
|
|
+ 2)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //热损伤
|
|
|
+ if (this.dataList.warehouseInOutDetail.jiaorenli) {
|
|
|
+ if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
|
|
|
+ this.$message({
|
|
|
+ message: '热损伤(%)非数字!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
|
|
|
+ this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
|
|
|
+ (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
|
|
|
+ '.'
|
|
|
+ ) != -1 &&
|
|
|
+ String(this.dataList.warehouseInOutDetail.jiaorenli).length -
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.jiaorenli
|
|
|
+ ).indexOf('.') +
|
|
|
+ 1) >
|
|
|
+ 2)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //不完整粒(%)
|
|
|
+ if (this.dataList.warehouseInOutDetail.imperfectGrain) {
|
|
|
+ if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
|
|
|
+ this.$message({
|
|
|
+ message: '不完整粒(%)非数字!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
|
|
|
+ this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
|
|
|
+ (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
|
|
|
+ '.'
|
|
|
+ ) != -1 &&
|
|
|
+ String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.imperfectGrain
|
|
|
+ ).indexOf('.') +
|
|
|
+ 1) >
|
|
|
+ 2)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //容重
|
|
|
+ if (this.dataList.warehouseInOutDetail.bulkDensity) {
|
|
|
+ if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
|
|
|
+ this.$message({
|
|
|
+ message: '容重(克/升)非数字!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataList.warehouseInOutDetail.bulkDensity < 1 ||
|
|
|
+ this.dataList.warehouseInOutDetail.bulkDensity > 40 ||
|
|
|
+ (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
|
|
|
+ '.'
|
|
|
+ ) != -1 &&
|
|
|
+ String(this.dataList.warehouseInOutDetail.bulkDensity).length -
|
|
|
+ (String(
|
|
|
+ this.dataList.warehouseInOutDetail.bulkDensity
|
|
|
+ ).indexOf('.') +
|
|
|
+ 1) >
|
|
|
+ 0)
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$refs.dataList.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
|
|
@@ -448,24 +758,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // //暂存按钮
|
|
|
- // returnWarehouse() {
|
|
|
- // this.$refs.dataList.validate((valid) => {
|
|
|
- // if (valid) {
|
|
|
- // this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
|
|
|
- // this.dataList.statusFlag = 1
|
|
|
- // addstorageputList(this.dataList)
|
|
|
- // .toPromise()
|
|
|
- // .then((response) => {
|
|
|
- // this.$message.success('添加成功')
|
|
|
- // this.$router.push({ path: 'warehouseManagementList' })
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
tarechange(e) {
|
|
|
if (this.dataList.grossWeight && this.dataList.tare) {
|
|
|
this.dataList.netWeight = Number(
|