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,48 +310,51 @@ export default { ...@@ -309,48 +310,51 @@ 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('3')
console.log('obj.pn', newObj.pn) this.form.qty = this.form.qty * values[3]
console.log('newPn', this.newPn) const newLot = values[1]
this.form.qty = this.form.qty * values[3] const tooPn = values[0]
const newLot = values[1] const item = {
const tooPn = values[0] qty: this.form.qty,
console.log('tooPn', tooPn) newPn: tooPn,
const item = { lot: newLot,
qty: this.form.qty, cheBzq: values[2],
newPn: tooPn, cheBz: '',
lot: newLot, cheUnit: values[4],
...this.form cheCjName: values[5],
} ...this.form
console.log('pn', item)
addIncomeWmsBox(item).then(res => {
if (res.code === 200) {
this.$message.success('保存成功')
this.resetForm()
this.getOrderCode()
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
} }
}) console.log('item', item)
addIncomeWmsBox(item).then(res => {
if (res.code === 200) {
this.$message.success('保存成功')
this.resetForm()
this.getOrderCode()
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
}
})
}
} }
} }
}) })
......
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