喷雾工序打印赋值

This commit is contained in:
2022-07-13 19:02:31 +08:00
parent 407390a793
commit 60fa5f13de
3 changed files with 28 additions and 6 deletions

View File

@@ -114,10 +114,25 @@ export default {
next()
},
activated () {
this.val2 = this.$store.getters.materObj.material_code
this.materialId = this.$store.getters.materObj.material_id
if (this.$store.getters.materObj.standard_weight) {
this.val4 = Number(this.$store.getters.materObj.standard_weight).toFixed(3) + ''
if (JSON.stringify(this.$store.getters.materObj1) !== '{}') {
if (JSON.stringify(this.$store.getters.materObj) === '{}') {
this.val2 = this.$store.getters.materObj1.material_code
this.materialId = this.$store.getters.materObj1.material_id
this.val3 = this.$store.getters.materObj1.pcsn
this.val4 = '50.000'
}
if (JSON.stringify(this.$store.getters.materObj) !== '{}') {
this.val2 = this.$store.getters.materObj.material_code
this.materialId = this.$store.getters.materObj.material_id
this.val4 = Number(this.$store.getters.materObj.standard_weight).toFixed(3) + ''
}
}
if (JSON.stringify(this.$store.getters.materObj1) === '{}') {
if (JSON.stringify(this.$store.getters.materObj) !== '{}') {
this.val2 = this.$store.getters.materObj.material_code
this.materialId = this.$store.getters.materObj.material_id
this.val4 = Number(this.$store.getters.materObj.standard_weight).toFixed(3) + ''
}
}
},
methods: {
@@ -264,6 +279,7 @@ export default {
goIn () {
if (this.$route.query.url === 'ProcessSpray') {
this.$store.dispatch('materObj1', {})
this.$store.dispatch('materObj', {})
this.$store.dispatch('setKeepAlive', ['ProcessSpray'])
this.$router.push('/ProcessSpray')
}

View File

@@ -254,6 +254,11 @@ export default {
/** 打印 */
async _bagPrint () {
this.disabled2 = true
if (parseFloat(this.val4) <= 0 || isNaN(parseFloat(this.val4))) {
this.toast('重量必须大于0')
this.disabled2 = false
return
}
if (this.val2 === '' || this.val2 === undefined) {
this.toast('粉料编码不能为空')
this.disabled2 = false