Commit 064b78b1 authored by hubaoshan's avatar hubaoshan

pd 1.0

parent 53247982
...@@ -102,7 +102,8 @@ export default { ...@@ -102,7 +102,8 @@ export default {
{ pattern: /^.*,.*/ | /^.*$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' } { pattern: /^.*,.*/ | /^.*$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }
], ],
qty: [{ validator: this.validatorQty, trigger: 'blur' }], qty: [{ validator: this.validatorQty, trigger: 'blur' }],
value2: [{ pattern: /^[^,]+,[\d{4}\/\d{2}\/\d{2},[1-9]\d*],[^,]+,[^,]+$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }] // value2: [{ pattern: /^[^,]+,[^,]+,\d{4}\/\d{2}\/\d{2},[1-9]\d*,\d+$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }]
value2: [{ pattern: /^[^,]+,[^,]+,\d{4}\/\d{2}\/\d{2},[1-9]\d*,[^,]+/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }]
} }
} }
}, },
...@@ -309,38 +310,40 @@ export default { ...@@ -309,38 +310,40 @@ export default {
unit: values[4], unit: values[4],
cj_name: values[5] cj_name: values[5]
} }
console.log(newObj)
this.$refs.from.validate(valid => { this.$refs.from.validate(valid => {
if (valid) { if (valid) {
if (this.form.ptype === 30) { if (!values[0] && !values[1] && !values[2] && !values[3] && !values[4]) {
if (!values[0] || !values[1] || !values[2] || !values[3] || !values[4]) { console.log('1')
this.$message.error({ this.$message.error({
message: '前5个值不能为空,请检查', message: '前5个值不能为空,请检查',
duration: 2000 duration: 2000
}) })
this.form.value2 = '' this.form.value2 = ''
}
} else if (this.responsePn && this.responsePn !== '' && this.responsePn !== undefined) { } else if (this.responsePn && this.responsePn !== '' && this.responsePn !== undefined) {
if (this.obj.pn !== this.responsePn) { if (values[0] !== this.responsePn) {
console.log('2')
this.$message.error({ this.$message.error({
message: '您输入的pn:' + this.obj.pn + '与返回pn:' + this.responsePn + '的不一样', message: '您输入的pn:' + values[0] + '与返回pn:' + this.responsePn + '的不一样',
duration: 2000 duration: 2000
}) })
this.form.pn = '' this.form.pn = ''
}
} else { } else {
console.log('obj.pn', newObj.pn) console.log('3')
console.log('newPn', this.newPn)
this.form.qty = this.form.qty * values[3] this.form.qty = this.form.qty * values[3]
const newLot = values[1] const newLot = values[1]
const tooPn = values[0] const tooPn = values[0]
console.log('tooPn', tooPn)
const item = { const item = {
qty: this.form.qty, qty: this.form.qty,
newPn: tooPn, newPn: tooPn,
lot: newLot, lot: newLot,
cheBzq: values[2],
cheBz: '',
cheUnit: values[4],
cheCjName: values[5],
...this.form ...this.form
} }
console.log('pn', item) console.log('item', item)
addIncomeWmsBox(item).then(res => { addIncomeWmsBox(item).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success('保存成功') this.$message.success('保存成功')
...@@ -353,6 +356,7 @@ export default { ...@@ -353,6 +356,7 @@ export default {
}) })
} }
} }
}
}) })
}, },
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment