snow 2 年之前
父节点
当前提交
2568f3d4d0

+ 0 - 495
src/views/parameter/good/config copy/_details.ts

@@ -1,495 +0,0 @@
-/* eslint-disable prettier/prettier */
-import { h } from "vue";
-import { ElImage, ElTag } from "element-plus";
-import { DescriptionColumns } from "/@/components/BasicDescriptions";
-import { FormConfig } from "/@/components/PageSearch";
-import { createTooltip } from "/@/utils/tooltip";
-// import { payWayOptions, sendWayOptions, supplyAreaOptions } from "./_options";
-
-export const projectFormConfig: FormConfig = {
-  labelWidth: "100px",
-  formItems: [
-    {
-      label: "项目名称",
-      field: "name",
-      type: "input",
-      placeholder: "项目名称",
-      span: 12
-    },
-    {
-      label: "所属平台",
-      field: "platform",
-      placeholder: "客户公司名称",
-      span: 12,
-      slot: "platform"
-    },
-    {
-      label: "销售方",
-      field: "companyNo",
-      placeholder: "销售方",
-      slot: "companyNo",
-      span: 12
-    },
-    // {
-    //   label: "购买方",
-    //   field: "khNo",
-    //   slot: "khNo",
-    //   placeholder: "购买方",
-    //   span: 12
-    // },
-    {
-      label: "项目总预算",
-      field: "budget_total",
-      slot: "budget_total",
-      placeholder: "项目总预算",
-      span: 8
-    },
-    {
-      label: "要求到货时间",
-      field: "arrtime",
-      slot: "arrtime",
-      span: 8,
-      placeholder: "要求到货时间",
-      otherOptions: {
-        disabledDate(date) {
-          return date.getTime() < new Date().getTime() - 86400000;
-        }
-      }
-    },
-    {
-      label: "竞价截止时间",
-      field: "endtime",
-      placeholder: "竞价截止时间",
-      slot: "endtime",
-      span: 8,
-      otherOptions: {
-        disabledDate(date) {
-          return date.getTime() < new Date().getTime() - 86400000;
-        }
-      }
-    },
-    {
-      label: "项目用途",
-      field: "use_desc",
-      type: "input",
-      placeholder: "项目用途",
-      span: 24
-    },
-    {
-      label: "项目要求",
-      field: "ladder",
-      slot: "ladder",
-      span: 24
-    }
-  ]
-};
-
-//平台商品详情字段
-export const platformGoodColumns: DescriptionColumns = [
-  {
-    field: "good_name",
-    label: "商品名称",
-    span: 24,
-    render: (goodname, { skuCode, speclist }) => {
-      const goodName = speclist
-        ? speclist
-            .map(({ spec_name, spec_value }) => `${spec_name}[${spec_value}]`)
-            .join("_")
-        : "";
-
-      return createTooltip(
-        goodname + "_" + goodName,
-        "商品编号: " + skuCode,
-        360
-      );
-    }
-  },
-  {
-    field: "good_img",
-    label: "商品主图",
-    span: 12,
-    render: good_img => {
-      const previewSrcList = good_img ? good_img.split(",") : [];
-      return previewSrcList.map(src =>
-        h(ElImage, {
-          previewSrcList: [src],
-          src,
-          previewTeleported: true,
-          style: {
-            height: "20px",
-            width: "20px"
-          }
-        })
-      );
-    }
-  },
-  {
-    field: "good_info_img",
-    label: "商品详情图",
-    span: 12,
-    render: good_info_img => {
-      return h(ElImage, {
-        previewSrcList: [good_info_img],
-        src: good_info_img,
-        previewTeleported: true,
-        style: {
-          height: "20px",
-          width: "20px"
-        }
-      });
-    }
-  },
-  {
-    field: "company",
-    label: "业务企业名称",
-    span: 8,
-    render: (company, { companyNo }) =>
-      createTooltip(company, "业务企业编号: " + companyNo, 360)
-  },
-  {
-    field: "platform_name",
-    label: "所属平台",
-    span: 8
-  },
-  {
-    field: "brand_name",
-    label: "品牌",
-    span: 8
-  },
-  {
-    field: "cat_info",
-    label: "分类",
-    span: 8,
-    render(cat_info) {
-      return cat_info ? cat_info.map(({ name }) => name).join("_") : "";
-    }
-  },
-  {
-    field: "unit",
-    span: 8,
-    label: "单位"
-  },
-  {
-    field: "is_stock",
-    label: "是否库存品",
-    span: 6,
-    render(is_stock) {
-      return h(ElTag, null, {
-        default: () => (is_stock !== "0" ? "库存品" : "非库存品")
-      });
-    }
-  },
-  // {
-  //   field: "supply_area",
-  //   label: "供货区域",
-  //   span: 6,
-  //   render(supply_area) {
-  //     return h(ElTag, null, {
-  //       default: () =>
-  //         supplyAreaOptions.find(({ id }) => supply_area === id)?.label || "--"
-  //     });
-  //   }
-  // },
-  {
-    field: "good_type",
-    label: "是否定制",
-    span: 8,
-    render(good_type) {
-      return h(ElTag, null, {
-        default: () => (good_type !== "0" ? "是" : "否")
-      });
-    }
-  },
-  {
-    field: "tax",
-    label: "税点",
-    append: "%",
-    span: 4
-  },
-  {
-    field: "delivery_day",
-    label: "物流时间",
-    append: "天",
-    span: 4
-  },
-  {
-    field: "lead_time",
-    label: "供货周期",
-    append: "天",
-    span: 4
-  },
-  {
-    field: "sample_day",
-    label: "调样周期",
-    append: "天",
-    span: 4
-  },
-  {
-    field: "exclusive",
-    label: "专属类型",
-    span: 6,
-    render(exclusive) {
-      return exclusive ? exclusive.map(({ name }) => name).join("/") : "";
-    }
-  },
-  {
-    field: "weight",
-    label: "商品总克重",
-    append: "g",
-    span: 6
-  },
-  {
-    field: "noble",
-    label: "贵金属信息",
-    render(
-      _,
-      {
-        noble_weight,
-        noble_metal,
-        noble_name,
-        gold_price,
-        is_gold_price,
-        is_diff,
-        config,
-        other_config
-      }
-    ) {
-      if (!noble_metal) {
-        return "";
-      }
-
-      const weight = noble_weight ? `${noble_weight}g-${noble_name}` : "";
-
-      const price = gold_price ? gold_price : "0";
-
-      const isGoldPrice = is_gold_price === "0" ? "不" : "";
-
-      const diff = is_diff === "1" ? "有" : "无";
-
-      return `${weight}${price}元/g-${isGoldPrice}启用实时金价-${diff}工差-${config}-${other_config}`;
-    }
-  },
-  {
-    field: "delivery_place_cn",
-    label: "发货地",
-    span: 8
-  },
-  {
-    field: "customized",
-    label: "工期",
-    span: 8
-  },
-  {
-    field: "cgder",
-    label: "供应商负责人",
-    span: 4
-  },
-  {
-    field: "good_creater",
-    label: "商品创建人",
-    span: 4
-  },
-  {
-    field: "after_sales",
-    label: "售后说明",
-    span: 24
-  },
-  {
-    field: "good_remark",
-    label: "商品备注",
-    span: 24
-  },
-
-  {
-    field: "craft_desc",
-    label: "工艺说明",
-    span: 24
-  }
-];
-
-//采反商品详情字段
-export const commodityFeedbackColumns: DescriptionColumns = [
-  {
-    field: "good_name",
-    label: "商品名称",
-    span: 24,
-    render: (goodname, { spuCode, speclist }) => {
-      const goodName = speclist
-        ? speclist
-            .map(({ spec_name, spec_value }) => `${spec_name}[${spec_value}]`)
-            .join("_")
-        : "";
-
-      return createTooltip(
-        goodname + "_" + goodName,
-        "上线商品编号: " + spuCode,
-        360
-      );
-    }
-  },
-
-  {
-    field: "cat_info",
-    label: "分类",
-    span: 8,
-    render(cat_info) {
-      return cat_info ? cat_info.map(({ name }) => name).join("_") : "";
-    }
-  },
-
-  {
-    field: "brand_name",
-    label: "品牌",
-    span: 8
-  },
-
-  // {
-  //   field: "send_way",
-  //   label: "发货方式",
-  //   span: 8,
-  //   render(send_way) {
-  //     return h(ElTag, null, {
-  //       default: () =>
-  //         sendWayOptions.find(({ id }) => send_way === id)?.label || "--"
-  //     });
-  //   }
-  // },
-  {
-    field: "unit",
-    label: "单位",
-    span: 4
-  },
-  {
-    field: "tax",
-    label: "税点",
-    append: "%",
-    span: 4
-  },
-  // {
-  //   field: "pay_way",
-  //   label: "付款方式",
-  //   span: 4,
-  //   render(pay_way) {
-  //     return h(ElTag, null, {
-  //       default: () =>
-  //         payWayOptions.find(({ id }) => pay_way === id)?.label || "--"
-  //     });
-  //   }
-  // },
-
-  {
-    field: "weight",
-    label: "商品总克重",
-    append: "g",
-    span: 6
-  },
-
-  {
-    field: "addtime",
-    label: "反馈时间",
-    span: 6
-  },
-  {
-    field: "expire_day",
-    label: "竞价有效期",
-    append: "天",
-    span: 4
-  },
-
-  {
-    field: "delivery_day",
-    label: "物流时间",
-    append: "天",
-    span: 4
-  },
-  {
-    field: "work_day",
-    label: "生产工期",
-    append: "天",
-    span: 4
-  },
-  {
-    field: "cgder",
-    label: "供应商负责人",
-    span: 4
-  },
-  {
-    field: "creater",
-    label: "商品创建人",
-    span: 4
-  },
-  {
-    field: "supply_area",
-    label: "供货区域",
-    span: 4,
-    render(supply_area) {
-      return h(ElTag, null, {
-        default: () =>
-          supplyAreaOptions.find(({ id }) => supply_area === id)?.label || "--"
-      });
-    }
-  },
-
-  {
-    field: "good_img",
-    label: "商品图片",
-    span: 24,
-    render: good_img => {
-      const previewSrcList = good_img ? good_img.split(",") : [];
-      return previewSrcList.map(src =>
-        h(ElImage, {
-          previewSrcList: [src],
-          src,
-          previewTeleported: true,
-          style: {
-            height: "20px",
-            width: "20px"
-          }
-        })
-      );
-    }
-  },
-  {
-    field: "noble",
-    label: "贵金属信息",
-    span: 24,
-    render(
-      _,
-      {
-        noble_weight,
-        noble_metal,
-        noble_name,
-        gold_price,
-        is_gold_price,
-        is_diff,
-        config,
-        other_config
-      }
-    ) {
-      if (!noble_metal) {
-        return "--";
-      }
-
-      const weight = noble_weight ? `${noble_weight}g-${noble_name}` : "";
-
-      const price = gold_price ? gold_price : "0";
-
-      const isGoldPrice = is_gold_price === "0" ? "不" : "";
-
-      const diff = is_diff === "1" ? "有" : "无";
-
-      return `${weight}${price}元/g-${isGoldPrice}启用实时金价-${diff}工差-${config}-${other_config}`;
-    }
-  },
-
-  {
-    field: "cost_desc",
-    label: "工艺说明",
-    span: 24
-  },
-  {
-    field: "remark",
-    label: "采返备注",
-    span: 24
-  }
-];

+ 0 - 81
src/views/parameter/good/config copy/_rules.ts

@@ -1,81 +0,0 @@
-import { FormRules } from "element-plus";
-
-export const ladderFormRules: FormRules = {
-  budget_price: {
-    trigger: "change",
-    required: true,
-    validator(_, value) {
-      if (value === "") return new Error("请输入预算单价");
-      if (Number(value) === 0) return new Error("预算单价不能为零!");
-      return true;
-    }
-  },
-  num: {
-    trigger: "change",
-    required: true,
-    message: "请输入购买数量",
-    validator(_, value) {
-      if (value === "") return new Error("请输入购买数量");
-      if (Number(value) === 0) return new Error("购买数量不能为零!");
-      return true;
-    }
-  },
-  good_type: {
-    trigger: "change",
-    required: true,
-    message: "请输入商品类型"
-  },
-  cat_id: {
-    trigger: "change",
-    required: true,
-    message: "请输入商品分类"
-  }
-};
-
-export const projectFormRules: FormRules = {
-  name: {
-    trigger: "change",
-    required: true,
-    message: "请输入项目名称"
-  },
-  platform: {
-    trigger: "change",
-    required: true,
-    message: "请输入客户公司名称"
-  },
-  companyNo: {
-    trigger: "change",
-    required: true,
-    message: "请输入销售方"
-  },
-  khNo: {
-    trigger: "change",
-    required: true,
-    message: "请输入购买方"
-  },
-  budget_total: {
-    trigger: "change",
-    required: true,
-    message: "请输入项目总预算"
-  },
-  arrtime: {
-    trigger: "change",
-    required: true,
-    message: "请输入要求到货时间"
-  },
-  endtime: {
-    trigger: "change",
-    required: true,
-    message: "请输入竞价截止时间"
-  },
-  use_desc: {
-    trigger: "change",
-    required: true,
-    message: "请输入项目用途"
-  },
-  ladder: {
-    trigger: "change",
-    required: true,
-    message: "请选择项目要求"
-  }
-};

+ 0 - 67
src/views/parameter/good/config copy/content.config.ts

@@ -1,67 +0,0 @@
-import { ContentConfig } from "/@/components/PageContent";
-import {
-  httpList,
-  httpAdd,
-  httpUpdate,
-  httpStatus,
-  httpDelete
-} from "/@/api/parameter/good";
-import { renderStatus } from "/@/utils/column-helper";
-import { STATUS_OPTIONS } from "/@/config/status";
-
-const columns = [
-  {
-    type: "selection",
-    width: 55,
-    hide: ({ checkList }) => !checkList.includes("勾选列")
-  },
-
-  {
-    prop: "id",
-    label: "ID"
-  },
-  {
-    prop: "title",
-    label: "卡类型"
-  },
-
-  {
-    prop: "status",
-    label: "状态",
-    ...renderStatus(STATUS_OPTIONS)
-  },
-  {
-    prop: "contacts",
-    label: "联系人"
-  },
-  {
-    prop: "mobile",
-    label: "联系方式"
-  },
-  {
-    prop: "addtime",
-    label: "创建时间",
-    sortable: true
-  },
-
-  {
-    label: "操作",
-    fixed: "right",
-    width: 160,
-    slot: "operation"
-  }
-];
-
-const contentConfig: ContentConfig = {
-  title: "商品管理",
-  columns,
-  apis: {
-    httpAdd,
-    httpList,
-    httpUpdate,
-    httpStatus,
-    httpDelete
-  }
-};
-
-export default contentConfig;

+ 0 - 100
src/views/parameter/good/config copy/modal.config.ts

@@ -1,100 +0,0 @@
-import { ModalConfig } from "/@/components/PageModal/src/types";
-import { GOOD_OPTIONS } from "/@/config/status";
-const modalConfig: ModalConfig = {
-  title: "商品",
-  colLayout: { span: 24 },
-  itemStyle: {},
-  contact: "good",
-  labelWidth: "85px",
-  formItems: [
-    {
-      field: "name",
-      type: "input",
-      label: "商品名称",
-      placeholder: "商品名称",
-      span: 24,
-      rules: [{ required: true, trigger: "blur", message: "请输入商品名称" }]
-    },
-    {
-      field: "type",
-      type: "select",
-      label: "商品类型",
-      placeholder: "商品类型",
-      span: 8,
-      options: GOOD_OPTIONS,
-      rules: [{ required: true, trigger: "change", message: "请选择商品类型" }]
-    },
-    {
-      field: "unit",
-      type: "input",
-      label: "单位",
-      placeholder: "单位",
-      span: 8,
-      rules: [{ required: true, trigger: "blur", message: "请输入步长" }]
-    },
-    {
-      field: "price",
-      type: "number",
-      label: "售价",
-      placeholder: "售价",
-      span: 8,
-      rules: [{ required: true, trigger: "blur", message: "请输入售价" }]
-    },
-    {
-      field: "img1",
-      type: "img_upload",
-      label: "封面图",
-      placeholder: "封面图",
-      span: 8,
-      rules: [{ required: true, trigger: "blur", message: "请输入备注" }]
-    },
-    {
-      field: "a",
-      type: "number",
-      label: "起订量",
-      placeholder: "起订量",
-      span: 8,
-      rules: [{ required: true, trigger: "blur", message: "请输入起订量" }]
-    },
-    {
-      field: "b",
-      type: "number",
-      label: "步长",
-      placeholder: "步长",
-      span: 8,
-      rules: [{ required: true, trigger: "blur", message: "请输入步长" }]
-    },
-
-    {
-      field: "img2",
-      type: "img_upload",
-      label: "轮播图",
-      placeholder: "轮播图",
-      span: 16,
-      rules: [{ required: true, trigger: "blur", message: "请输入备注" }]
-    },
-    {
-      field: "img3",
-      type: "img_upload_list",
-      label: "详情图",
-      placeholder: "详情图",
-      rules: [{ required: true, trigger: "blur", message: "请输入备注" }]
-    },
-    {
-      field: "arr",
-      type: "input",
-      label: "产品参数",
-      placeholder: "产品参数",
-      rules: [{ required: true, trigger: "blur", message: "请输入备注" }]
-    },
-    {
-      field: "remark",
-      type: "textarea",
-      label: "备注",
-      placeholder: "备注",
-      rules: [{ required: false, trigger: "blur", message: "请输入备注" }]
-    }
-  ]
-};
-
-export default modalConfig;

+ 0 - 31
src/views/parameter/good/config copy/search.config.ts

@@ -1,31 +0,0 @@
-import { FormConfig } from "/@/components/PageSearch";
-import { STATUS_OPTIONS } from "/@/config/status";
-import { convertOptions } from "/@/utils/column-helper";
-
-const searchFormConfig: FormConfig = {
-  formItems: [
-    {
-      field: "status",
-      type: "select",
-      placeholder: "状态",
-      options: convertOptions(STATUS_OPTIONS)
-    },
-    {
-      field: "title",
-      type: "input",
-      placeholder: "企业名称"
-    },
-    {
-      field: "contacts",
-      type: "input",
-      placeholder: "联系人"
-    },
-    {
-      field: "mobile",
-      type: "input",
-      placeholder: "联系方式"
-    }
-  ]
-};
-
-export default searchFormConfig;

+ 17 - 10
src/views/parameter/good/config/_rules.ts

@@ -1,4 +1,3 @@
-import { number } from "echarts";
 import { FormRules } from "element-plus";
 
 export const ladderFormRules: FormRules = {
@@ -6,7 +5,8 @@ export const ladderFormRules: FormRules = {
     trigger: "change",
     required: true,
     validator(_, value) {
-      if (value ?? "" === "") return new Error("请输入商品名称");
+      const val = value ?? "";
+      if (val === "") return new Error("请输入商品名称");
       return true;
     }
   },
@@ -15,7 +15,8 @@ export const ladderFormRules: FormRules = {
     required: true,
     message: "请上传封面图",
     validator(_, value) {
-      if (value ?? "" === "") return new Error("请上传封面图");
+      const val = value ?? "";
+      if (val === "") return new Error("请上传封面图");
       return true;
     }
   },
@@ -36,7 +37,9 @@ export const projectFormRules: FormRules = {
     trigger: "change",
     required: true,
     validator(_, value) {
-      if (value ?? "" === "") return new Error("请输入商品名称");
+      console.log(value);
+      const val = value ?? "";
+      if (val === "") return new Error("请输入商品名称");
       return true;
     }
   },
@@ -45,7 +48,8 @@ export const projectFormRules: FormRules = {
     required: true,
     message: "请上传封面图",
     validator(_, value) {
-      if (value ?? "" === "") return new Error("请上传封面图");
+      const val = value ?? "";
+      if (val === "") return new Error("请上传封面图");
       return true;
     }
   },
@@ -65,7 +69,8 @@ export const projectFormRules: FormRules = {
     message: "请输入售价",
     validator(_, value) {
       console.log(typeof value + "--售价--" + value);
-      if (value ?? "" === "") return new Error("请输入售价");
+      const val = value ?? "";
+      if (val === "") return new Error("请输入售价");
       return true;
     }
   },
@@ -96,7 +101,8 @@ export const projectFormRules: FormRules = {
     message: "请上传轮播图",
     validator(_, value) {
       console.log(value);
-      // if (value ?? "" === "") return new Error("请上传轮播图");
+      // const val = value ?? "";
+      // if (val === "") return new Error("请上传轮播图");
       return true;
     }
   },
@@ -106,7 +112,8 @@ export const projectFormRules: FormRules = {
     required: true,
     message: "请上传详情图",
     validator(_, value) {
-      if (value ?? "" === "") return new Error("请上传详情图");
+      const val = value ?? "";
+      if (val === "") return new Error("请上传详情图");
       return true;
     }
   },
@@ -114,9 +121,9 @@ export const projectFormRules: FormRules = {
     trigger: "change",
     type: "array",
     required: true,
-    message: "请输入商品参数",
     validator(_, value) {
-      if (value ?? "" === "") return new Error("请输入商品参数");
+      const val = value ?? "";
+      if (val === "") return new Error("请输入商品参数");
       return true;
     }
   }

+ 3 - 3
src/views/parameter/good/cpns/ladder-table.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { goodTypeOptions } from "../config/_options";
+// import { goodTypeOptions } from "../config/_options";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 
 const emit = defineEmits(["choose", "delete", "update"]);
@@ -17,14 +17,14 @@ defineProps<{
         {{ $index + 1 }}
       </template>
     </ElTableColumn>
-
+    <!-- 
     <ElTableColumn prop="good_type" label="商品类型">
       <template #="{ row }">
         <ElTag>{{
           goodTypeOptions.find(({ id }) => id === row.good_type)?.label || "--"
         }}</ElTag>
       </template>
-    </ElTableColumn>
+    </ElTableColumn> -->
     <ElTableColumn prop="budget_price" label="预算单价" />
 
     <ElTableColumn prop="num" label="购买数量" />

+ 2 - 1
src/views/parameter/good/cpns/project-form.vue

@@ -26,11 +26,12 @@ const props = defineProps<{
 
 const loading = ref(false);
 const { formItems } = projectFormConfig;
+console.log(formItems);
 
 const responseHandle = useResponseHandle();
 const basicFormRef = ref<InstanceType<typeof ElForm>>(null);
 const formData = ref<Record<string, any>>(createDefaultData(formItems));
-
+console.log(formData);
 const ladderModalRef = ref<InstanceType<typeof LadderModal>>(null);
 
 function requesetCategoryById(id: string) {