|
@@ -0,0 +1,303 @@
|
|
|
+import { isnumber, isMobile } from "@/utils/validate";
|
|
|
+const validatemobile = (rule, value, callback) => {
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("收货电话不能为空!"));
|
|
|
+ } else {
|
|
|
+ if (!isMobile(value)) {
|
|
|
+ callback(new Error("收货电话格式不正确!"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+const validate_num = (rule, value, callback) => {
|
|
|
+ const { required } = rule;
|
|
|
+ if (required && value === "") {
|
|
|
+ callback(new Error("单价不能为空!"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+};
|
|
|
+const validate_num_0 = (rule, value, callback) => {
|
|
|
+ const { required } = rule;
|
|
|
+ if (required && value === "") {
|
|
|
+ callback(new Error("数量不能为空!"));
|
|
|
+ } else if (required && value === "0") {
|
|
|
+ callback(new Error("数量不能为零!"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+};
|
|
|
+const coption = [
|
|
|
+ {
|
|
|
+ value: "1",
|
|
|
+ label: "卡券支付",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "2",
|
|
|
+ label: "现金支付",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "3",
|
|
|
+ label: "混合支付",
|
|
|
+ },
|
|
|
+]
|
|
|
+const options = [
|
|
|
+ {
|
|
|
+ value: "1",
|
|
|
+ label: "卡券支付",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "2",
|
|
|
+ label: "现金支付",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "3",
|
|
|
+ label: "混合支付",
|
|
|
+ },
|
|
|
+]
|
|
|
+const ruleForm = {
|
|
|
+ id: "",
|
|
|
+ platform_code: "",
|
|
|
+ po_code: "",
|
|
|
+ platform_time: "",
|
|
|
+ plat_code: "",
|
|
|
+ sale_source: "",
|
|
|
+ mode: "",
|
|
|
+ contactor: "",
|
|
|
+ mobile: "",
|
|
|
+ price: "",
|
|
|
+ num: "",
|
|
|
+ before_discount_all_price: "",
|
|
|
+ activity_name: "",
|
|
|
+
|
|
|
+ order_remark: "",
|
|
|
+
|
|
|
+ addr: "",
|
|
|
+ addr_code: [],
|
|
|
+}
|
|
|
+const rules = {
|
|
|
+ contactor: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ trigger: "blur",
|
|
|
+ message: "联系人不能为空",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ mobile: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: validatemobile,
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+
|
|
|
+ addr_code: [
|
|
|
+ {
|
|
|
+ type: "array",
|
|
|
+ required: true,
|
|
|
+ message: "收货省市区不能为空",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ addr: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "详细地址不能为空",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ num: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: validate_num_0,
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ price: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: validate_num,
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+}
|
|
|
+
|
|
|
+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: "1", name: "待完善成本" },
|
|
|
+ { id: "2", name: "待产品审核" },
|
|
|
+ { id: "3", name: "待财务定价" },
|
|
|
+ { id: "4", name: "待财务审核定价" },
|
|
|
+ { id: "5", name: "待上线" },
|
|
|
+ { id: "6", name: "上线成功" },
|
|
|
+ { id: "7", name: "审核失败" },
|
|
|
+ { id: "8", name: "已下线" },
|
|
|
+]
|
|
|
+
|
|
|
+const options9 = [
|
|
|
+ { id: "0", name: "现结" },
|
|
|
+ { id: "1", name: "月清" },
|
|
|
+ { id: "2", name: "双月清" },
|
|
|
+]
|
|
|
+const onlineColumns = [
|
|
|
+ {
|
|
|
+ prop: "good_name",
|
|
|
+ label: "商品名称",
|
|
|
+ _slot_: "good_name",
|
|
|
+ span: 24,
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "company",
|
|
|
+ label: "业务企业名称",
|
|
|
+ _slot_: "company",
|
|
|
+ span:24
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "platform_name",
|
|
|
+ label: "所属平台",
|
|
|
+ span:24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "brand_name",
|
|
|
+ label: "品牌",
|
|
|
+ span:24
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "cat_info",
|
|
|
+ label: "分类",
|
|
|
+ _slot_:'cat_info',
|
|
|
+ span:24
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "unit",
|
|
|
+ label: "单位",
|
|
|
+ span:10
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "is_stock",
|
|
|
+ label: "是否库存品",
|
|
|
+ _slot_: "is_stock",
|
|
|
+ span:14
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "tax",
|
|
|
+ label: "税点",
|
|
|
+ append: '%',
|
|
|
+ span:10
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "exclusive",
|
|
|
+ label: "专属类型",
|
|
|
+ _slot_: "exclusive",
|
|
|
+ span:14
|
|
|
+ },
|
|
|
+]
|
|
|
+export {
|
|
|
+ options1,
|
|
|
+ options2,
|
|
|
+ options3,
|
|
|
+ options4,
|
|
|
+ options5,
|
|
|
+ options6,
|
|
|
+ options7,
|
|
|
+ options8,
|
|
|
+ options9,
|
|
|
+ onlineColumns,
|
|
|
+ coption,
|
|
|
+ options,
|
|
|
+ ruleForm,
|
|
|
+ rules,
|
|
|
+}
|