123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- import CONFIG from "@/config";
- export default function useColumns() {
- const TableColumns = [
- {
- item: { width: 100, key: "priceCode", title: "价格编码" },
- attr: {},
- },
- {
- item: { width: 100, key: "supplierName", title: "供应商" },
- attr: {},
- },
- {
- item: { width: 100, key: "puOrgName", title: "采购组织" },
- attr: {},
- },
- {
- item: { width: 100, key: "currencyName", title: "币种" },
- attr: {},
- },
- {
- item: { width: 100, key: "explainStr", title: "价格合理性说明" },
- attr: {},
- },
- {
- item: { width: 100, key: "buyerName", title: "采购员" },
- attr: {},
- },
- {
- item: { width: 100, key: "puDeptName", title: "采购部门" },
- attr: {},
- },
- {
- item: { width: 100, key: "createByName", title: "创建人" },
- attr: {},
- },
- {
- item: { key: "isEffective", title: "是否已推价格" },
- attr: {
- is: "el-dict-tag",
- dictName: "is_effective",
- },
- },
- {
- item: { width: 100, key: "approveTime", title: "单据申请日期" },
- attr: {},
- },
- {
- item: { width: 100, key: "file", title: "附件" },
- attr: { is: "el-file-preview" },
- },
- {
- item: { width: 100, key: "sourceType", title: "来源单据类型" },
- attr: {
- is: "el-dict-tag",
- dictName: "price_source",
- },
- },
- {
- item: { width: 100, key: "status", title: "单据状态" },
- attr: {
- is: "el-dict-tag",
- dictName: "sys_status",
- },
- },
- ];
- const TabColumns = [
- {
- item: {
- title: "物料信息表",
- width: 100,
- key: "priceApplyItems",
- },
- attr: {
- value: [],
- },
- TableColumns: [
- {
- item: { width: 100, key: "materialCode", title: "物料编码" },
- attr: {},
- },
- {
- item: { width: 100, key: "materialName", title: "物料名称" },
- attr: {},
- },
- { item: { width: 100, key: "specification", title: "规格" }, attr: {} },
- { item: { width: 100, key: "model", title: "型号" }, attr: {} },
- {
- item: { width: 100, key: "manufacturerName", title: "生产厂家" },
- attr: {},
- },
- {
- item: { width: 100, key: "unitName", title: "单位" },
- attr: {},
- },
- // {
- // item: { width: 100, key: "puUnitName", title: "采购单位" },
- // attr: {},
- // },
- // {
- // item: { width: 100, key: "conversionRate", title: "采购换算率" },
- // attr: {
- // is: "el-computed-input-v2",
- // formatter: (prop) => {
- // return prop == null ? 0 : (prop * 1);
- // },
- // },
- // },
- {
- item: { width: 100, key: "customerName", title: "客户" },
- attr: {},
- },
- {
- item: { width: 100, key: "taxPrice", title: "含税单价" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "tax", title: "税率%" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "price", title: "无税单价" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- // {
- // item: { width: 100, key: "currencyName", title: "币种" },
- // attr: {},
- // },
- {
- item: { width: 100, key: "periodBegin", title: "价格有效期(起)" },
- attr: {},
- },
- {
- item: { width: 100, key: "periodEnd", title: "价格有效期(止)" },
- attr: {},
- },
- {
- item: { width: 100, key: "recentlyPrice", title: "最近价格" },
- attr: {},
- },
- {
- item: {
- width: 100,
- key: "recentlyPriceDate",
- title: "最近价格日期",
- },
- attr: {},
- },
- {
- item: { width: 100, key: "isApprovalFirst", title: "首次报批" },
- attr: {
- is: "el-dict-tag",
- dictName: "is_effective",
- },
- },
- {
- item: { width: 100, key: "isPriceAdjustmentName", title: "调价类型" },
- attr: {
- },
- },
- {
- item: { width: 100, key: "priceDiffer", title: "单价差" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "increase", title: "涨幅(%)" },
- attr: {
- formatter: (prop) => {
- const { priceDiffer = 0, recentlyPrice = 0 } = prop;
- return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0%");
- },
- },
- },
- {
- item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
- attr: {
- // is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop.yPurchaseQuantity
- },
- },
- },
- {
- item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
- attr: {
- formatter: (prop) => {
- const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
- return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
- },
- },
- },
- {
- item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "priceType", title: "价格类型" },
- attr: {
- is: "el-dict-tag",
- dictName: "sys_price_type",
- },
- },
- {
- item: { width: 100, key: "isDistributionPrice", title: "配送价" },
- attr: {
- is: "el-dict-tag",
- dictName: "is_effective",
- },
- },
- {
- item: { width: 100, key: "isChannel", title: "是否渠道变更" },
- attr: {
- is: "el-dict-tag",
- dictName: "is_effective",
- },
- },
- {
- item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
- attr: {
- is: "el-dict-tag",
- dictName: "is_effective",
- },
- },
- {
- item: { width: 100, key: "supplierName", title: "供应商名称1" },
- attr: {},
- },
- {
- item: { width: 100, key: "bidPrice", title: "中标价1" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "unitPrice", title: "单价1" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "profit", title: "利润比1" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "supplierName1", title: "供应商名称2" },
- attr: {},
- },
- {
- item: { width: 100, key: "bidPrice1", title: "中标价2" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "unitPrice1", title: "单价2" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "profit1", title: "利润比2" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "supplierName2", title: "供应商名称3" },
- attr: {},
- },
- {
- item: { width: 100, key: "bidPrice2", title: "中标价3" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "unitPrice2", title: "单价3" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- {
- item: { width: 100, key: "profit2", title: "利润比3" },
- attr: {
- is: "el-computed-input-v2",
- formatter: (prop) => {
- return prop == null ? 0 : (prop * 1);
- },
- },
- },
- // {
- // item: { width: 100, key: "createByName", title: "创建人名称" },
- // attr: {},
- // },
- // {
- // item: { width: 100, key: "updateByName", title: "更新人名称" },
- // attr: {},
- // },
- ],
- },
- ];
- return { TableColumns, TabColumns };
- }
|