|
@@ -3,56 +3,56 @@ import { isSpecialSymbol } from "@/utils/validate";
|
|
|
const options1 = [
|
|
|
{ id: "0", name: "否" },
|
|
|
{ id: "1", name: "是" },
|
|
|
-]
|
|
|
+];
|
|
|
//专属类型
|
|
|
const options2 = [
|
|
|
{ id: "0", name: "非泰康" },
|
|
|
{ id: "1", name: "泰康" },
|
|
|
-]
|
|
|
+];
|
|
|
//销售权限
|
|
|
const options3 = [
|
|
|
{ id: "0", name: "无销售权限" },
|
|
|
{ id: "1", name: "有销售权限" },
|
|
|
-]
|
|
|
+];
|
|
|
|
|
|
//是否库存品
|
|
|
const options4 = [
|
|
|
{ id: "0", name: "非库存品" },
|
|
|
{ id: "1", name: "库存品" },
|
|
|
-]
|
|
|
+];
|
|
|
//是否启用实时金价
|
|
|
const options5 = [
|
|
|
{ id: "0", name: "否" },
|
|
|
{ id: "1", name: "是" },
|
|
|
-]
|
|
|
+];
|
|
|
//供货区域
|
|
|
const options6 = [
|
|
|
{ id: "1", name: "全国" },
|
|
|
{ id: "2", name: "全国除偏远" },
|
|
|
-]
|
|
|
+];
|
|
|
//是否启用阶梯
|
|
|
const options7 = [
|
|
|
{ id: "0", name: "否" },
|
|
|
{ id: "1", name: "是" },
|
|
|
-]
|
|
|
+];
|
|
|
//有无工差
|
|
|
const options8 = [
|
|
|
{ id: "0", name: "无工差" },
|
|
|
{ id: "1", name: "有工差" },
|
|
|
-]
|
|
|
+];
|
|
|
//配置要求
|
|
|
-const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"]
|
|
|
+const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"];
|
|
|
//付款方式
|
|
|
const options10 = [
|
|
|
{ id: "0", name: "现结" },
|
|
|
{ id: "1", name: "月清" },
|
|
|
{ id: "2", name: "双月清" },
|
|
|
-]
|
|
|
+];
|
|
|
//发货方式
|
|
|
const options11 = [
|
|
|
{ id: "0", name: "公司自提" },
|
|
|
{ id: "1", name: "供应商包邮" },
|
|
|
-]
|
|
|
+];
|
|
|
const listCol = [
|
|
|
{
|
|
|
prop: "cgdNo",
|
|
@@ -109,7 +109,7 @@ const listCol = [
|
|
|
width: "52px",
|
|
|
_slot_: "operation",
|
|
|
},
|
|
|
-]
|
|
|
+];
|
|
|
|
|
|
const validate_num = (rule, value, callback) => {
|
|
|
if (value === "") {
|
|
@@ -121,7 +121,8 @@ const validate_num = (rule, value, callback) => {
|
|
|
const validate_num_0 = (rule, value, callback) => {
|
|
|
if (value === "") {
|
|
|
callback(new Error("不能为空!"));
|
|
|
- } else if (value === "0" ||
|
|
|
+ } else if (
|
|
|
+ value === "0" ||
|
|
|
value === "0." ||
|
|
|
value === "0.0" ||
|
|
|
value === "0.00" ||
|
|
@@ -134,6 +135,7 @@ const validate_num_0 = (rule, value, callback) => {
|
|
|
};
|
|
|
const validate_desc = (rule, value, callback) => {
|
|
|
const { required } = rule;
|
|
|
+ console.log(required, value);
|
|
|
if (required && value === "") {
|
|
|
callback(new Error("不能为空!"));
|
|
|
} else if (value.length > 0 && isSpecialSymbol(value)) {
|
|
@@ -178,7 +180,7 @@ const rules = {
|
|
|
pname: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请输入商品名称",
|
|
|
+ validator: validate_desc,
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
@@ -356,7 +358,7 @@ const rules = {
|
|
|
config: [
|
|
|
{
|
|
|
required: true,
|
|
|
- type: 'array',
|
|
|
+ type: "array",
|
|
|
message: "请选择配置要求",
|
|
|
trigger: "change",
|
|
|
},
|
|
@@ -404,8 +406,19 @@ const rules = {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-export { options1, options2, options3, options4, options5, options6, options7, options8, options9, options10, options11, listCol, rules }
|
|
|
+};
|
|
|
+export {
|
|
|
+ options1,
|
|
|
+ options2,
|
|
|
+ options3,
|
|
|
+ options4,
|
|
|
+ options5,
|
|
|
+ options6,
|
|
|
+ options7,
|
|
|
+ options8,
|
|
|
+ options9,
|
|
|
+ options10,
|
|
|
+ options11,
|
|
|
+ listCol,
|
|
|
+ rules,
|
|
|
+};
|