Commit 74f69c4f authored by 武广's avatar 武广

fix: 修改实物商品和电子卡券编辑状态

parent 1c2006cd
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'sc'; const environment = 'xyqb';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`, kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`,
......
...@@ -90,6 +90,7 @@ const FormInformationBasic = forwardRef((props, ref) => { ...@@ -90,6 +90,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
> >
<Cascader <Cascader
placeholder="请选择商品类目!" placeholder="请选择商品类目!"
disabled={customer.isEdit}
showSearch={{ filter: filterCategoryOptions }} showSearch={{ filter: filterCategoryOptions }}
fieldNames={{ label: 'name', value: 'id', children: 'children' }} fieldNames={{ label: 'name', value: 'id', children: 'children' }}
onChange={props.onCategoryChange} onChange={props.onCategoryChange}
...@@ -104,8 +105,8 @@ const FormInformationBasic = forwardRef((props, ref) => { ...@@ -104,8 +105,8 @@ const FormInformationBasic = forwardRef((props, ref) => {
extra="若需新增品牌请联系业务员" extra="若需新增品牌请联系业务员"
> >
<Select <Select
disabled={customer.isService}
showSearch showSearch
disabled={customer.isEdit && !customer.isCard}
placeholder="请选择商品品牌" placeholder="请选择商品品牌"
filterOption={fileterBrandOptions} filterOption={fileterBrandOptions}
> >
...@@ -124,14 +125,9 @@ const FormInformationBasic = forwardRef((props, ref) => { ...@@ -124,14 +125,9 @@ const FormInformationBasic = forwardRef((props, ref) => {
{ required: true, min: 2, message: '请输入最少两个字符的商品名称!', whitespace: true }, { required: true, min: 2, message: '请输入最少两个字符的商品名称!', whitespace: true },
]} ]}
> >
<Input placeholder="请输入商品名称" /> <Input placeholder="请输入商品名称" disabled={customer.isEdit && !customer.isCard} />
</Form.Item> </Form.Item>
</Popover> </Popover>
{customer.isJDGoods && (
<Button key="jdMsg" danger type="text">
*本列表的商品名称仅供搜索使用,不在前端作展示。若要修改APP端展示的商品名称,请在商品信息中修改。
</Button>
)}
{!customer.isCard && ( {!customer.isCard && (
<Form.Item <Form.Item
name="character" name="character"
......
...@@ -201,7 +201,12 @@ const CreateBatchFormItems = ({ specInitValue, batchChange, editRef, defaultColu ...@@ -201,7 +201,12 @@ const CreateBatchFormItems = ({ specInitValue, batchChange, editRef, defaultColu
fieldNames={{ label: 'secondSpecValue', value: 'secondSpecValue' }} fieldNames={{ label: 'secondSpecValue', value: 'secondSpecValue' }}
/> />
{formItems.concat( {formItems.concat(
<Button key="batch" type="primary" onClick={batchChange}> <Button
key="batch"
type="primary"
disabled={customer.isEdit && !customer.isCard}
onClick={batchChange}
>
批量设置 批量设置
</Button>, </Button>,
)} )}
......
...@@ -92,19 +92,14 @@ const FormRuleSetting = forwardRef((props, ref) => { ...@@ -92,19 +92,14 @@ const FormRuleSetting = forwardRef((props, ref) => {
> >
<Form.Item name="purchaseTime" label="购买时间" {...rangeConfig}> <Form.Item name="purchaseTime" label="购买时间" {...rangeConfig}>
<RangePicker <RangePicker
showTime={{
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
}}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
defaultPickerValue={[nowDateTime, nowDateTimeEnd]} defaultPickerValue={[nowDateTime, nowDateTimeEnd]}
/> />
</Form.Item> </Form.Item>
<Form.Item name="useTime" label="有效期" {...rangeConfig}> <Form.Item name="useTime" label="有效期" {...rangeConfig}>
<RangePicker <RangePicker
showTime={{
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
}}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
defaultPickerValue={[nowDateTime, nowDateTimeEnd]}
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
......
...@@ -160,6 +160,7 @@ const FormRuleVPictures = forwardRef((props, ref) => { ...@@ -160,6 +160,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<UploadImage <UploadImage
multiple={false} multiple={false}
name="commonImageList" name="commonImageList"
disabled={customer.isEdit && !customer.isCard}
limit={imgConfig.commonImageList.limit} limit={imgConfig.commonImageList.limit}
pictures={commonImageList} pictures={commonImageList}
setPictureList={list => onCommonSuccessEvent(list)} setPictureList={list => onCommonSuccessEvent(list)}
...@@ -181,6 +182,7 @@ const FormRuleVPictures = forwardRef((props, ref) => { ...@@ -181,6 +182,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<UploadImage <UploadImage
name="cardImageList" name="cardImageList"
limit={imgConfig.cardImageList.limit} limit={imgConfig.cardImageList.limit}
disabled={customer.isEdit && !customer.isCard}
pictures={cardImageList} pictures={cardImageList}
setPictureList={list => onCardSuccessImageList(list)} setPictureList={list => onCardSuccessImageList(list)}
/> />
...@@ -201,6 +203,7 @@ const FormRuleVPictures = forwardRef((props, ref) => { ...@@ -201,6 +203,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<UploadImage <UploadImage
name={key} name={key}
limit={11} limit={11}
disabled={customer.isEdit && !customer.isCard}
pictures={imageList[key]} pictures={imageList[key]}
setPictureList={list => onPictureSuccessEvent(list, key)} setPictureList={list => onPictureSuccessEvent(list, key)}
/> />
...@@ -230,6 +233,7 @@ const FormRuleVPictures = forwardRef((props, ref) => { ...@@ -230,6 +233,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<UploadImage <UploadImage
limit={imgConfig.detailImageList.limit} limit={imgConfig.detailImageList.limit}
name="detailImageList" name="detailImageList"
disabled={customer.isEdit && !customer.isCard}
pictures={detailImageList} pictures={detailImageList}
setPictureList={list => onDetailSuccessImageList(list)} setPictureList={list => onDetailSuccessImageList(list)}
/> />
......
...@@ -176,10 +176,12 @@ const UploadImage = forwardRef((props, ref) => { ...@@ -176,10 +176,12 @@ const UploadImage = forwardRef((props, ref) => {
onClick={() => handlePreview(item)} onClick={() => handlePreview(item)}
/> */} /> */}
<EyeOutlined className={styles.maskIcon} onClick={() => handlePreview(item)} /> <EyeOutlined className={styles.maskIcon} onClick={() => handlePreview(item)} />
{!disabled && (
<DeleteOutlined <DeleteOutlined
className={styles.maskIcon} className={styles.maskIcon}
onClick={() => handleRemove(item)} onClick={() => handleRemove(item)}
/> />
)}
{/* <Icon {/* <Icon
type="delete" type="delete"
className={styles.maskIcon} className={styles.maskIcon}
......
...@@ -58,34 +58,6 @@ export const TaskList = (canAddService, canAddNormal) => [ ...@@ -58,34 +58,6 @@ export const TaskList = (canAddService, canAddNormal) => [
}, },
}, },
}, },
// {
// name: '电子卡卷',
// type: 3,
// desc: '无需物流',
// hide: true,
// imgConfig: {
// commonImageList: {
// title: '封面图片',
// rule: true,
// limit: 11,
// renderExtra(leng) {
// return `建议尺寸: ##宽##高 (${leng} / 1) `;
// },
// },
// imageList: {
// rule: true,
// limit: 1,
// },
// detailImageList: {
// title: '商品图片',
// rule: true,
// limit: null,
// renderExtra() {
// return '请上传商品图!';
// },
// },
// },
// },
{ {
name: '电子卡卷', name: '电子卡卷',
type: 4, type: 4,
...@@ -166,7 +138,7 @@ export const StaticColumns = customer => [ ...@@ -166,7 +138,7 @@ export const StaticColumns = customer => [
min: 0, min: 0,
}, },
roleRules: { required: true }, roleRules: { required: true },
disabeldRender: () => customer.isJDGoods, disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '佣金费率', title: '佣金费率',
...@@ -189,7 +161,7 @@ export const StaticColumns = customer => [ ...@@ -189,7 +161,7 @@ export const StaticColumns = customer => [
min: 0, min: 0,
}, },
roleRules: { required: true }, roleRules: { required: true },
// disabeldRender: () => customer.isService, disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '销售价', title: '销售价',
...@@ -202,6 +174,7 @@ export const StaticColumns = customer => [ ...@@ -202,6 +174,7 @@ export const StaticColumns = customer => [
precision: 2, precision: 2,
min: 0, min: 0,
}, },
disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '重量(kg)', title: '重量(kg)',
...@@ -220,7 +193,7 @@ export const StaticColumns = customer => [ ...@@ -220,7 +193,7 @@ export const StaticColumns = customer => [
precision: 3, precision: 3,
max: 999999.999, max: 999999.999,
}, },
// disabeldRender: () => customer.isService, disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '库存', title: '库存',
...@@ -237,7 +210,7 @@ export const StaticColumns = customer => [ ...@@ -237,7 +210,7 @@ export const StaticColumns = customer => [
min: 0, min: 0,
}, },
roleRules: { required: true }, roleRules: { required: true },
disabeldRender: v => v.id && customer.isService, disabeldRender: () => customer.isEdit,
}, },
{ {
title: '库存预警', title: '库存预警',
...@@ -250,7 +223,7 @@ export const StaticColumns = customer => [ ...@@ -250,7 +223,7 @@ export const StaticColumns = customer => [
precision: 0, precision: 0,
maxLength: 5, maxLength: 5,
}, },
// disabeldRender: () => customer.isService, disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '商品自编码', title: '商品自编码',
...@@ -259,7 +232,7 @@ export const StaticColumns = customer => [ ...@@ -259,7 +232,7 @@ export const StaticColumns = customer => [
role: [1, 2], role: [1, 2],
inputType: 'input', inputType: 'input',
roleRules: { required: true }, roleRules: { required: true },
disabeldRender: () => customer.isService, disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '京东链接', title: '京东链接',
...@@ -268,7 +241,7 @@ export const StaticColumns = customer => [ ...@@ -268,7 +241,7 @@ export const StaticColumns = customer => [
role: [1, 2], role: [1, 2],
inputType: 'input', inputType: 'input',
roleRules: { required: false }, roleRules: { required: false },
disabeldRender: () => customer.isService, disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: 'sku名称', title: 'sku名称',
...@@ -277,6 +250,7 @@ export const StaticColumns = customer => [ ...@@ -277,6 +250,7 @@ export const StaticColumns = customer => [
role: customer.isEdit && customer.isJDGoods ? [1, 2] : [], role: customer.isEdit && customer.isJDGoods ? [1, 2] : [],
inputType: 'btnText', inputType: 'btnText',
roleRules: { required: false }, roleRules: { required: false },
disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
{ {
title: '操作', title: '操作',
...@@ -289,5 +263,6 @@ export const StaticColumns = customer => [ ...@@ -289,5 +263,6 @@ export const StaticColumns = customer => [
min: 0, min: 0,
}, },
roleRules: { required: false }, roleRules: { required: false },
disabeldRender: () => customer.isEdit && !customer.isCard,
}, },
]; ];
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