|
|
@ -200,7 +200,7 @@ |
|
|
<el-form-item label="产品名称" required @change="ifGold" prop="goodsName"> |
|
|
<el-form-item label="产品名称" required @change="ifGold" prop="goodsName"> |
|
|
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName"></ProductSelect> |
|
|
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName"></ProductSelect> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item v-show="!isGold" label="产品数量" required prop="goodNum"> |
|
|
|
|
|
|
|
|
<el-form-item v-show="!isGold" label="产品数量" required> |
|
|
<div style="display: flex;"> |
|
|
<div style="display: flex;"> |
|
|
<el-input style="padding-right: 30px; flex: 3;" v-model="addFormData.goodNum" |
|
|
<el-input style="padding-right: 30px; flex: 3;" v-model="addFormData.goodNum" |
|
|
placeholder="请输入产品数量" /> |
|
|
placeholder="请输入产品数量" /> |
|
|
@ -667,6 +667,18 @@ const handleAddForm = async () => { |
|
|
ElMessage.error(testGold().message); |
|
|
ElMessage.error(testGold().message); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
//单独校验产品数量 |
|
|
|
|
|
if (!isGold.value) { |
|
|
|
|
|
if (!addFormData.value.goodNum) { |
|
|
|
|
|
ElMessage.error('请输入产品数量'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
const positiveIntReg = /^[1-9]\d*$/; |
|
|
|
|
|
if (!positiveIntReg.test(addFormData.value.goodNum)) { |
|
|
|
|
|
ElMessage.error('产品数量必须为正整数'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 处理时间格式 |
|
|
// 处理时间格式 |
|
|
if (addFormData.value.payTime) { |
|
|
if (addFormData.value.payTime) { |
|
|
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
@ -704,6 +716,18 @@ const handleEditForm = async () => { |
|
|
ElMessage.error(testGold().message); |
|
|
ElMessage.error(testGold().message); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
//单独校验产品数量 |
|
|
|
|
|
if (!isGold.value) { |
|
|
|
|
|
if (!addFormData.value.goodNum) { |
|
|
|
|
|
ElMessage.error('请输入产品数量'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
const positiveIntReg = /^[1-9]\d*$/; |
|
|
|
|
|
if (!positiveIntReg.test(addFormData.value.goodNum)) { |
|
|
|
|
|
ElMessage.error('产品数量必须为正整数'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 处理时间格式 |
|
|
// 处理时间格式 |
|
|
if (addFormData.value.payTime) { |
|
|
if (addFormData.value.payTime) { |
|
|
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
|