Commit b4e94350 authored by guang.wu's avatar guang.wu

fix: 处理g显示问题

parent 41a1755f
...@@ -315,7 +315,7 @@ const FormPriceOrStock = forwardRef((props, ref) => { ...@@ -315,7 +315,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
inputType: 'text', inputType: 'text',
}); });
} }
// console.log('customer.isGold :>> ', customer.isGold);
// isGoodsManage用来判断是否是popGoodsManage页面,这个页面是用来应付审计团队的,没有实际功能,这里删掉了供货价字段,正常业务逻辑不用考虑这个字段,这就用第一个数据就好了 // isGoodsManage用来判断是否是popGoodsManage页面,这个页面是用来应付审计团队的,没有实际功能,这里删掉了供货价字段,正常业务逻辑不用考虑这个字段,这就用第一个数据就好了
const isGoodsManage = window.location.pathname.indexOf('popGoodsManage') < 0; const isGoodsManage = window.location.pathname.indexOf('popGoodsManage') < 0;
const dynamicColumns = [ const dynamicColumns = [
...@@ -456,7 +456,7 @@ const FormPriceOrStock = forwardRef((props, ref) => { ...@@ -456,7 +456,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
setMergeTable(Boolean(editData.secondSpecValue && editData.secondSpecValue.length)); setMergeTable(Boolean(editData.secondSpecValue && editData.secondSpecValue.length));
setTableData(fliterSkuListSortData(skuList) || []); setTableData(fliterSkuListSortData(skuList) || []);
} }
}, [customer.isEdit, customer.isUseCache, editData, skuList]); }, [customer.isEdit, customer.isUseCache, editData, skuList, customer.isGold]);
useEffect(() => { useEffect(() => {
if (!editData) { if (!editData) {
......
...@@ -159,170 +159,173 @@ export const WeeksList = [ ...@@ -159,170 +159,173 @@ export const WeeksList = [
value: 7, value: 7,
}, },
]; ];
export const StaticColumns = customer => [ export const StaticColumns = customer =>
{ // console.log('StaticColumns customer.isGold :>> ', customer.isGold);
title: '供货价', [
dataIndex: 'supplyPrice', {
editable: true, title: '供货价',
batchRole: [1, 2, 3, 4], dataIndex: 'supplyPrice',
roleProps: { editable: true,
precision: 2, batchRole: [1, 2, 3, 4],
min: 0, roleProps: {
}, precision: 2,
batchProps: { min: 0,
precision: 2, },
min: 0, batchProps: {
}, precision: 2,
roleRules: { required: true }, min: 0,
disabeldRender: () => customer.isDisabled, },
}, roleRules: { required: true },
{ disabeldRender: () => customer.isDisabled,
title: '佣金费率',
dataIndex: 'commissionRate',
editable: true,
role: [4],
roleRules: { required: false },
roleProps: {
min: 0,
},
// batchProps: {
// min: 0,
// },
},
{
title: '市场价',
dataIndex: 'marketPrice',
editable: true,
batchRole: [1, 2, 3, 4],
roleProps: {
precision: 2,
min: 0,
},
batchProps: {
precision: 2,
min: 0,
}, },
roleRules: { required: true }, {
disabeldRender: () => customer.isDisabled, title: '佣金费率',
}, dataIndex: 'commissionRate',
{ editable: true,
title: '销售价', role: [4],
dataIndex: 'salePrice', roleRules: { required: false },
editable: true, roleProps: {
batchRole: [4], min: 0,
role: [4], },
roleRules: { required: true }, // batchProps: {
roleProps: { // min: 0,
precision: 2, // },
min: 0,
}, },
batchProps: { {
precision: 2, title: '市场价',
min: 0, dataIndex: 'marketPrice',
editable: true,
batchRole: [1, 2, 3, 4],
roleProps: {
precision: 2,
min: 0,
},
batchProps: {
precision: 2,
min: 0,
},
roleRules: { required: true },
disabeldRender: () => customer.isDisabled,
}, },
disabeldRender: () => customer.isDisabled, {
}, title: '销售价',
{ dataIndex: 'salePrice',
title: `重量(${customer.isGold ? 'g' : 'kg'})`, editable: true,
dataIndex: 'weight', batchRole: [4],
editable: true, role: [4],
batchRole: [1], roleRules: { required: true },
batchProps: { roleProps: {
min: 0, precision: 2,
precision: customer.isGold ? 2 : 3, min: 0,
max: customer.isGold ? 100 : 999999.999, },
batchProps: {
precision: 2,
min: 0,
},
disabeldRender: () => customer.isDisabled,
}, },
role: [1], {
roleRules: { required: true }, title: `重量(${customer.isGold ? 'g' : 'kg'})`,
roleProps: { dataIndex: 'weight',
min: 0, editable: true,
precision: customer.isGold ? 2 : 3, batchRole: [1],
max: customer.isGold ? 100 : 999999.999, batchProps: {
min: 0,
precision: customer.isGold ? 2 : 3,
max: customer.isGold ? 100 : 999999.999,
},
role: [1],
roleRules: { required: true },
roleProps: {
min: 0,
precision: customer.isGold ? 2 : 3,
max: customer.isGold ? 100 : 999999.999,
},
disabeldRender: () => customer.isDisabled,
}, },
disabeldRender: () => customer.isDisabled, {
}, title: '库存',
{ dataIndex: 'productStock',
title: '库存', editable: true,
dataIndex: 'productStock', role: [1, 2, 4],
editable: true, batchRole: [1, 2, 4],
role: [1, 2, 4], batchProps: {
batchRole: [1, 2, 4], precision: 0,
batchProps: { step: 1,
precision: 0, min: 0,
step: 1, },
min: 0, roleProps: {
min: 0,
step: 1,
precision: 0,
},
roleRules: { required: true },
disabeldRender: record => {
if (record.stock === null) return false;
return customer.isEdit && customer.isNormal;
},
}, },
roleProps: { {
min: 0, title: '库存预警',
step: 1, dataIndex: 'productStockWarning',
precision: 0, editable: true,
batchRole: [1],
role: [1, 4],
roleProps: {
min: 0,
precision: 0,
maxLength: 5,
},
batchProps: {
min: 0,
precision: 0,
maxLength: 5,
},
disabeldRender: () => customer.isDisabled,
}, },
roleRules: { required: true }, {
disabeldRender: record => { title: '商品自编码',
if (record.stock === null) return false; dataIndex: 'thirdSkuNo',
return customer.isEdit && customer.isNormal; editable: true,
role: [1, 2],
inputType: 'input',
roleRules: { required: true },
disabeldRender: () => customer.isDisabled,
}, },
}, {
{ title: '京东链接',
title: '库存预警', dataIndex: 'skuLink',
dataIndex: 'productStockWarning', editable: true,
editable: true, role: [1, 2],
batchRole: [1], inputType: 'input',
role: [1, 4], roleRules: { required: false },
roleProps: { disabeldRender: () => customer.isDisabled,
min: 0,
precision: 0,
maxLength: 5,
}, },
batchProps: { {
min: 0, title: 'sku名称',
precision: 0, dataIndex: 'name',
maxLength: 5, editable: true,
role: customer.isEdit && customer.isJDGoods ? [1, 2] : [],
inputType: 'btnText',
roleRules: { required: false },
disabeldRender: () => customer.isDisabled,
}, },
disabeldRender: () => customer.isDisabled, {
}, title: '操作',
{ editable: true,
title: '商品自编码', dataIndex: 'option',
dataIndex: 'thirdSkuNo', role: [1, 2],
editable: true, inputType: 'option',
role: [1, 2], roleProps: {
inputType: 'input', isJDGoods: customer.isJDGoods,
roleRules: { required: true }, disabled: customer.isDisabled,
disabeldRender: () => customer.isDisabled, min: 0,
}, },
{ roleRules: { required: false },
title: '京东链接', disabeldRender: () => customer.isDisabled,
dataIndex: 'skuLink',
editable: true,
role: [1, 2],
inputType: 'input',
roleRules: { required: false },
disabeldRender: () => customer.isDisabled,
},
{
title: 'sku名称',
dataIndex: 'name',
editable: true,
role: customer.isEdit && customer.isJDGoods ? [1, 2] : [],
inputType: 'btnText',
roleRules: { required: false },
disabeldRender: () => customer.isDisabled,
},
{
title: '操作',
editable: true,
dataIndex: 'option',
role: [1, 2],
inputType: 'option',
roleProps: {
isJDGoods: customer.isJDGoods,
disabled: customer.isDisabled,
min: 0,
}, },
roleRules: { required: false }, ];
disabeldRender: () => customer.isDisabled,
},
];
// 这部分是用来应付审计团队的,没有实际功能,这里删掉了供货价字段,正常业务逻辑不用考虑这里 // 这部分是用来应付审计团队的,没有实际功能,这里删掉了供货价字段,正常业务逻辑不用考虑这里
export const StaticColumnsPop = customer => [ export const StaticColumnsPop = customer => [
{ {
......
...@@ -527,6 +527,7 @@ const ServiceGoods = options => { ...@@ -527,6 +527,7 @@ const ServiceGoods = options => {
isUseCache, // 是否使用缓存数据 isUseCache, // 是否使用缓存数据
onEventBus, onEventBus,
}; };
// console.log('providerValue.isGold :>> ', providerValue.isGold);
return ( return (
<Modal <Modal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment