import { h } from "vue"; import { ElImage, ElTag } from "element-plus"; import { createTooltip } from "/@/utils/tootip"; import { verification, required } from "/@/utils/verification"; export const good_type = [ { value: "0", label: "未设置" }, { value: "1", label: "已设置" } ]; export const stock_type = [ { value: "0", label: "非库存" }, { value: "1", label: "库存" } ]; //类目新增校验规则 export const cost_rules = verification( required("tax", "请选择税率"), required("cat_code", "请选择类目"), required("inv_tag", "请选择税率标识"), required("addTax", "请选择增值税管理内容"), required("inv_good_name", "请选择商品名称"), required("is_discount", "请选择是否包含优惠政策") ); export const good_detail_columns = [ { field: "spuCode", span: 6, label: "商品编码" }, { field: "good_name", span: 18, label: "商品名称" }, { field: "is_stock", label: "商品类型", span: 6, render(stock) { return h(ElTag, null, { default: () => stock_type.find(s => s.value === String(stock))?.label }); } }, { field: "inv_good_name", span: 18, label: "开票商品名称" }, { field: "companyName", label: "业务公司名称", render: (companyName, { companyNo }) => createTooltip(companyName, "业务公司编码 : " + companyNo, 270), span: 12 }, { field: "supplierName", label: "供应商名称", render: (supplierName, { supplierNo }) => createTooltip(supplierName, "供应商编码 : " + supplierNo, 270), span: 12 }, { field: "cat_name", span: 12, label: "分类名称" }, { field: "unit_name", label: "单位名称" }, { field: "status", label: "是否设置开票类目", render(status) { return h(ElTag, null, { default: () => good_type.find(s => s.value === String(status))?.label }); } }, { field: "inv_cat_name", label: "类目名称", span: 12 }, { field: "inv_cat_code", label: "类目编码" }, { field: "inv_tax", label: "类目税率额" }, { field: "good_img", label: "商品图", span: 12, render(imgSrc) { return imgSrc.split(",").map(src => h(ElImage, { src, previewSrcList: [src], style: { height: "20px", marginRight: "5px" } }) ); } }, { field: "creater", label: "创建人" }, { field: "addtime", label: "申请时间" }, { field: "after_sales", span: 24, label: "售后说明" }, { field: "craft_desc", span: 24, label: "工艺说明" } ]; export const inv_tag = [ // { // value: "0", // label: "非零税率" // }, { value: "1", label: "免税" }, { value: "2", label: "不征税" }, { value: "3", label: "零税率" } ]; export const add_tax = [ { value: "免税", label: "免税" }, { value: "不征税", label: "不征税" } ];