|
@@ -273,6 +273,24 @@
|
|
|
// import costFormAddEdit from "./costFormAddEdit";
|
|
|
import asyncRequest from "@/apis/service/goodStore/goodsOnline";
|
|
|
import showVoucherModel from "@/components/show-voucher-model";
|
|
|
+import { isAlphanumeric, isnumber, validAlphabets } from "@/utils/validate";
|
|
|
+
|
|
|
+const validate_plat_code = (rule, value, callback) => {
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("平台商品编号不能为空!"));
|
|
|
+ } else {
|
|
|
+ if (isnumber(value)) {
|
|
|
+ callback();
|
|
|
+ } else if (validAlphabets(value)) {
|
|
|
+ callback();
|
|
|
+ } else if (isAlphanumeric(value)) {
|
|
|
+ callback();
|
|
|
+ } else {
|
|
|
+ callback("平台商品编号仅支持数字和字母!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
export default {
|
|
|
name: "exam-form",
|
|
|
props: [
|
|
@@ -423,7 +441,8 @@ export default {
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入平台商品编号",
|
|
|
- trigger: "blur",
|
|
|
+ validator:validate_plat_code
|
|
|
+ // trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
remark: [
|