|
|
|
@ -2857,11 +2857,12 @@ const handleSubmit = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
await nextTick(); |
|
|
|
|
|
|
|
|
|
if (!formEl) return; |
|
|
|
|
formEl.validate(async valid => { |
|
|
|
|
formEl.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.submitLoadingBtn = true; |
|
|
|
|
|
|
|
|
|
const timer = setTimeout(async () => { |
|
|
|
|
try { |
|
|
|
|
let _arr = []; |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < details.goodsList.length; i++) { |
|
|
|
@ -2870,7 +2871,8 @@ const handleSubmit = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
if (!val.goodsName || !isNumber(val.num) || val.num === 0) |
|
|
|
|
return ElMessage.warning('请填写正确的货物名称和件数'); |
|
|
|
|
|
|
|
|
|
if (_arr.includes(val.goodsName)) return ElMessage.warning('存在重复的货物名称,请移除'); |
|
|
|
|
if (_arr.includes(val.goodsName)) |
|
|
|
|
return ElMessage.warning('存在重复的货物名称,请移除'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (!(details.query.totalFreight > 0)) return ElMessage.warning('请输入大于零的运费'); |
|
|
|
@ -3033,9 +3035,11 @@ const handleSubmit = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
clearTimeout(timer); |
|
|
|
|
// 关闭页面laoding |
|
|
|
|
details.loadingObj.submitLoadingBtn = false; |
|
|
|
|
} |
|
|
|
|
}, 500); |
|
|
|
|
} else { |
|
|
|
|
console.log('error submit!'); |
|
|
|
|
return false; |
|
|
|
|