|
@@ -0,0 +1,483 @@
|
|
|
+/* 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 { GOOD_OPTIONS } from "/@/config/status";
|
|
|
+// import { payWayOptions, sendWayOptions, supplyAreaOptions } from "./_options";
|
|
|
+
|
|
|
+export const projectFormConfig: FormConfig = {
|
|
|
+ labelWidth: "85px",
|
|
|
+ formItems: [
|
|
|
+ {
|
|
|
+ label: "公司",
|
|
|
+ field: "company_id",
|
|
|
+ placeholder: "公司",
|
|
|
+ span: 12,
|
|
|
+ slot: "company_id"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "卡类型",
|
|
|
+ field: "card_id",
|
|
|
+ placeholder: "卡类型",
|
|
|
+ span: 12,
|
|
|
+ slot: "card_id"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "前缀",
|
|
|
+ field: "headname",
|
|
|
+ slot: "headname",
|
|
|
+ placeholder: "前缀",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "字母段",
|
|
|
+ field: "username_prefix",
|
|
|
+ type: "input",
|
|
|
+ placeholder: "字母段",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "年份段",
|
|
|
+ field: "username_year",
|
|
|
+ type: "number",
|
|
|
+ placeholder: "年份段",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "数字段",
|
|
|
+ field: "suffix",
|
|
|
+ slot: "suffix",
|
|
|
+ placeholder: "数字段",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "有效时间",
|
|
|
+ field: "time",
|
|
|
+ type: "date_picker",
|
|
|
+ otherOptions: {
|
|
|
+ type: "daterange",
|
|
|
+ startProp: "start",
|
|
|
+ endProp: "end",
|
|
|
+ startPlaceholder: "开始时间",
|
|
|
+ endPlaceholder: "结束时间",
|
|
|
+ format: "YYYY-MM-DD"
|
|
|
+ },
|
|
|
+ placeholder: "有效时间",
|
|
|
+ span: 12
|
|
|
+ }
|
|
|
+ ]
|
|
|
+};
|
|
|
+
|
|
|
+//平台商品详情字段
|
|
|
+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
|
|
|
+ }
|
|
|
+];
|