|
@@ -1,4 +1,5 @@
|
|
|
import CONFIG from "@/config";
|
|
|
+import { iunitprice } from "@/utils/expression";
|
|
|
|
|
|
export default function useColumns() {
|
|
|
const TableColumns = [
|
|
@@ -117,6 +118,7 @@ export default function useColumns() {
|
|
|
item: { key: "materialName", title: "物料名称", require: true },
|
|
|
attr: {
|
|
|
is: "el-popover-select-v2",
|
|
|
+ multiple: true,
|
|
|
valueKey: "name",
|
|
|
referName: "MATERIAL_PARAM",
|
|
|
dataMapping: {
|
|
@@ -141,7 +143,7 @@ export default function useColumns() {
|
|
|
{ item: { key: "specification", title: "规格" }, attr: {} },
|
|
|
{ item: { key: "model", title: "型号" }, attr: {} },
|
|
|
{
|
|
|
- item: { key: "unitName", title: "单位" },
|
|
|
+ item: { key: "unitName", title: "单位", hidden: false },
|
|
|
attr: {
|
|
|
is: "el-popover-select-v2",
|
|
|
valueKey: "name",
|
|
@@ -150,7 +152,7 @@ export default function useColumns() {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- item: { key: "puUnitName", title: "采购单位" },
|
|
|
+ item: { key: "puUnitName", title: "采购单位", hidden: false },
|
|
|
attr: {
|
|
|
is: "el-popover-select-v2",
|
|
|
valueKey: "name",
|
|
@@ -167,6 +169,8 @@ export default function useColumns() {
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
+ value: 1,
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -176,6 +180,7 @@ export default function useColumns() {
|
|
|
valueKey: "ntaxrate",
|
|
|
referName: "TAX_RATE_PARAM",
|
|
|
dataMapping: { tax: "ntaxrate" },
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -190,10 +195,7 @@ export default function useColumns() {
|
|
|
attr: {
|
|
|
formatter: (prop) => {
|
|
|
const { tax = 0, taxPrice = 0 } = prop;
|
|
|
- prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
|
|
|
- CONFIG.precision
|
|
|
- );
|
|
|
- return prop.price;
|
|
|
+ return (prop.price = iunitprice(tax, taxPrice));
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -248,12 +250,20 @@ export default function useColumns() {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
|
|
|
+ {
|
|
|
+ item: { key: "recentlyPrice", title: "最近价格" },
|
|
|
+ attr: {
|
|
|
+ is: "el-input-number",
|
|
|
+ precision: CONFIG.precision,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
item: { key: "isApprovalFirst", title: "首次报批" },
|
|
|
attr: {
|
|
|
is: "el-select",
|
|
|
dictName: "is_effective",
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -261,6 +271,7 @@ export default function useColumns() {
|
|
|
attr: {
|
|
|
is: "el-select",
|
|
|
dictName: "is_effective",
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -281,7 +292,7 @@ export default function useColumns() {
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- item: { width:100,key: "isChannel", title: "是否渠道变更" },
|
|
|
+ item: { width: 100, key: "isChannel", title: "是否渠道变更" },
|
|
|
attr: {
|
|
|
is: "el-select",
|
|
|
dictName: "is_effective",
|
|
@@ -289,68 +300,80 @@ export default function useColumns() {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
|
|
|
+ item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
|
|
|
attr: {
|
|
|
is: "el-select",
|
|
|
dictName: "is_effective",
|
|
|
value: "N",
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:100,key: "priceDiffer", title: "单价差" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 100, key: "priceDiffer", title: "单价差" },
|
|
|
attr: {
|
|
|
- is: "el-computed-input-v2",
|
|
|
formatter: (prop) => {
|
|
|
- return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
|
|
|
+ const { taxPrice = 0, recentlyPrice = 0 } = prop;
|
|
|
+ return (prop.priceDiffer = (
|
|
|
+ Number(taxPrice) - Number(recentlyPrice)
|
|
|
+ ).toFixed(CONFIG.precision));
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- item: { width:100,key: "increase", title: "涨幅" },
|
|
|
+ item: { width: 100, key: "increase", title: "涨幅(%)" },
|
|
|
attr: {
|
|
|
- is: "el-computed-input-v2",
|
|
|
formatter: (prop) => {
|
|
|
- return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
|
|
|
+ const { priceDiffer = 0, recentlyPrice = 0 } = prop;
|
|
|
+ return (prop.increase = recentlyPrice
|
|
|
+ ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
|
|
|
+ 2
|
|
|
+ )
|
|
|
+ : "0.00");
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
|
|
|
+ item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
|
|
|
attr: {
|
|
|
is: "el-computed-input-v2",
|
|
|
formatter: (prop) => {
|
|
|
- return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
|
|
|
+ return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
|
|
|
+ item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
|
|
|
attr: {
|
|
|
- is: "el-computed-input-v2",
|
|
|
formatter: (prop) => {
|
|
|
- return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
|
|
|
+ const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
|
|
|
+ return (prop.yAffectedAmount = (
|
|
|
+ Number(priceDiffer) * Number(yPurchaseQuantity)
|
|
|
+ ).toFixed(CONFIG.precision));
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- item: { width:150,key: "supplierName", title: "供应商名称" },
|
|
|
- attr: {is: "el-input"},
|
|
|
- },{
|
|
|
- item: { width:150,key: "bidPrice", title: "中标价" },
|
|
|
+ item: { width: 150, key: "supplierName", title: "供应商名称" },
|
|
|
+ attr: { is: "el-input" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "bidPrice", title: "中标价" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:150,key: "unitPrice", title: "单价" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "unitPrice", title: "单价" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:150,key: "profit", title: "利润比" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "profit", title: "利润比" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
@@ -358,22 +381,25 @@ export default function useColumns() {
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- item: { width:150,key: "supplierName1", title: "供应商名称1" },
|
|
|
- attr: {is: "el-input"},
|
|
|
- },{
|
|
|
- item: { width:150,key: "bidPrice1", title: "中标价1" },
|
|
|
+ item: { width: 150, key: "supplierName1", title: "供应商名称1" },
|
|
|
+ attr: { is: "el-input" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "bidPrice1", title: "中标价1" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:150,key: "unitPrice1", title: "单价1" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "unitPrice1", title: "单价1" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:150,key: "profit1", title: "利润比1" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "profit1", title: "利润比1" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
@@ -381,28 +407,30 @@ export default function useColumns() {
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- item: { width:150,key: "supplierName2", title: "供应商名称2" },
|
|
|
- attr: {is: "el-input"},
|
|
|
- },{
|
|
|
- item: { width:150,key: "bidPrice2", title: "中标价2" },
|
|
|
+ item: { width: 150, key: "supplierName2", title: "供应商名称2" },
|
|
|
+ attr: { is: "el-input" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "bidPrice2", title: "中标价2" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:150,key: "unitPrice2", title: "单价2" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "unitPrice2", title: "单价2" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
- },{
|
|
|
- item: { width:150,key: "profit2", title: "利润比2" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ item: { width: 150, key: "profit2", title: "利润比2" },
|
|
|
attr: {
|
|
|
is: "el-input-number",
|
|
|
precision: CONFIG.precision,
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
{ item: { key: "createByName", title: "创建人名称" }, attr: {} },
|
|
|
{ item: { key: "updateByName", title: "更新人名称" }, attr: {} },
|
|
|
],
|