|
@@ -197,7 +197,6 @@ export default {
|
|
|
this.inspect.carNumber = this.$route.query.carNumber
|
|
|
this.inspect.goodsName = this.$route.query.goodsName
|
|
|
this.inspect.storageTagNo = this.$route.query.storageTagNo
|
|
|
- //this.inspect.personCharge = this.$route.query.personCharge
|
|
|
let id = this.$route.query.id
|
|
|
this.cangNo = this.$route.query.warehouseNo
|
|
|
this.count = Number(this.$route.query.count)+1
|
|
@@ -205,7 +204,6 @@ export default {
|
|
|
this.disabled = true
|
|
|
this.information = '查看'
|
|
|
}
|
|
|
- // this.calculation()
|
|
|
this.getList(id)
|
|
|
},
|
|
|
methods: {
|
|
@@ -222,71 +220,161 @@ export default {
|
|
|
}
|
|
|
return year + mouth + datetime
|
|
|
},
|
|
|
- // calculation() {
|
|
|
- // let number ='000'+ this.count
|
|
|
- // number = number.substring(number.length - 4,number.length)
|
|
|
- // this.inspect.qualityNo = 'SGRK' + this.getdate()+this.cangNo+number //SGRK+8位时间+3位仓库编号+4位序列号
|
|
|
- // // + this.verifyinit()
|
|
|
- // },
|
|
|
print() {
|
|
|
this.inspect.warehouseName = this.warehouseName
|
|
|
this.inspect.id = this.$route.query.id
|
|
|
this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
|
|
|
- this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
|
|
|
- // if(this.types == null || this.types == ''){
|
|
|
- this.$confirm('确定保存质检信息?', '提示', {
|
|
|
+ this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
|
|
|
+ if (!this.inspect.grade) {
|
|
|
+ this.$message({
|
|
|
+ message: '等级不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.inspect.impurity) {
|
|
|
+ this.$message({
|
|
|
+ message: '杂质不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.inspect.impurity).indexOf('.') != -1 && String(this.inspect.impurity).length - (String(this.inspect.impurity).indexOf('.') + 1) > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '杂质输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.inspect.impurity < 0 || this.inspect.impurity > 40) {
|
|
|
+ this.$message({
|
|
|
+ message: '杂质输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.inspect.waterContent) {
|
|
|
+ this.$message({
|
|
|
+ message: '水分不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.inspect.waterContent < 0 || this.inspect.waterContent > 40) {
|
|
|
+ this.$message({
|
|
|
+ message: '水分输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.inspect.waterContent).indexOf('.') != -1 && String(this.inspect.waterContent).length - (String(this.inspect.waterContent).indexOf('.') + 1) > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '水分输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.inspect.mildewGrain) {
|
|
|
+ this.$message({
|
|
|
+ message: '霉变粒不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.inspect.mildewGrain < 0 || this.inspect.mildewGrain > 40) {
|
|
|
+ this.$message({
|
|
|
+ message: '霉变粒输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.inspect.mildewGrain).indexOf('.') != -1 && String(this.inspect.mildewGrain).length - (String(this.inspect.mildewGrain).indexOf('.') + 1) > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '霉变粒输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.inspect.bulkDensity) {
|
|
|
+ this.$message({
|
|
|
+ message: '容重不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.inspect.bulkDensity < 500 || this.inspect.bulkDensity > 1000) {
|
|
|
+ this.$message({
|
|
|
+ message: '容重输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.inspect.bulkDensity).indexOf('.') != -1 && String(this.inspect.bulkDensity).length - (String(this.inspect.bulkDensity).indexOf('.') + 1) > 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '容重需输入整数',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.inspect.jiaorenli) {
|
|
|
+ this.$message({
|
|
|
+ message: '热损伤不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.inspect.jiaorenli < 0 || this.inspect.jiaorenli > 40) {
|
|
|
+ this.$message({
|
|
|
+ message: '热损伤输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.inspect.jiaorenli).indexOf('.') != -1 && String(this.inspect.jiaorenli).length - (String(this.inspect.jiaorenli).indexOf('.') + 1) > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '热损伤输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.inspect.imperfectGrain) {
|
|
|
+ this.$message({
|
|
|
+ message: '不完善粒不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.inspect.imperfectGrain < 0 || this.inspect.imperfectGrain > 40) {
|
|
|
+ this.$message({
|
|
|
+ message: '不完善粒输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (String(this.inspect.imperfectGrain).indexOf('.') != -1 && String(this.inspect.imperfectGrain).length - (String(this.inspect.imperfectGrain).indexOf('.') + 1) > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '不完善粒输入错误',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm('确定保存质检信息?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
|
-
|
|
|
addOut(this.inspect)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.$message.success('保存成功')
|
|
|
- // this.xx = true;
|
|
|
- // let newstr = document.getElementById('print').innerHTML
|
|
|
- // let oldstr = document.body.innerHTML
|
|
|
- // document.body.innerHTML = newstr
|
|
|
- // window.print()
|
|
|
- // document.body.innerHTML = oldstr
|
|
|
- // // window.location.reload()
|
|
|
this.$router.push({ path: 'qualityInspectionManagement' })
|
|
|
})
|
|
|
})
|
|
|
.catch(() => {
|
|
|
return false
|
|
|
})
|
|
|
-
|
|
|
- // }else if(this.types == 1){
|
|
|
- // this.$confirm('确定保存质检信息?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning',
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // // return
|
|
|
- // getinspectEdit(this.inspect)
|
|
|
- // .toPromise()
|
|
|
- // .then((response) => {
|
|
|
- // this.$message.success('修改成功')
|
|
|
- // // this.xx = true;
|
|
|
- // // let newstr = document.getElementById('print').innerHTML
|
|
|
- // // let oldstr = document.body.innerHTML
|
|
|
- // // document.body.innerHTML = newstr
|
|
|
- // // window.print()
|
|
|
- // // document.body.innerHTML = oldstr
|
|
|
- // // window.location.reload()
|
|
|
- // this.$router.push({ path: 'paymentManagement' })
|
|
|
- // })
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // return false
|
|
|
- // })
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
},
|
|
|
cancel() {
|
|
|
this.$router.push({ path: 'qualityInspectionManagement' })
|