Commit a92b41ab authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:

parent 45c937c1
...@@ -23,6 +23,7 @@ import { GetProductCustomerGetCustomerAttributeResponse } from '@/services'; ...@@ -23,6 +23,7 @@ import { GetProductCustomerGetCustomerAttributeResponse } from '@/services';
const treeActions = createTreeActions() const treeActions = createTreeActions()
const fetchAttributeTreeData = async (params?) => { const fetchAttributeTreeData = async (params?) => {
// @ts-ignore
const res = await PublicApi.getProductCustomerGetCustomerAttributeTree({filterInput: true}) const res = await PublicApi.getProductCustomerGetCustomerAttributeTree({filterInput: true})
return res return res
} }
......
...@@ -303,6 +303,7 @@ const Goods: React.FC<{}> = () => { ...@@ -303,6 +303,7 @@ const Goods: React.FC<{}> = () => {
ref.current.reload() ref.current.reload()
}) })
}, },
okType: 'danger',
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel');
}, },
......
...@@ -136,7 +136,6 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -136,7 +136,6 @@ const AddProducts: React.FC<{}> = (props) => {
delete _item.goodsId delete _item.goodsId
_item.attributeAndValueList.map(__item => { _item.attributeAndValueList.map(__item => {
delete __item.customerAttributeName delete __item.customerAttributeName
// __item.customerAttributeValueId = __item.id
// **** 新字段结构变更 // **** 新字段结构变更
__item.customerAttribute = { id: __item.customerAttributeId } __item.customerAttribute = { id: __item.customerAttributeId }
__item.customerAttributeValue = { id: __item.id, value: __item.value } __item.customerAttributeValue = { id: __item.id, value: __item.value }
...@@ -145,8 +144,6 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -145,8 +144,6 @@ const AddProducts: React.FC<{}> = (props) => {
delete __item.customerAttributeId delete __item.customerAttributeId
}) })
} }
// _item.attributeAndValueList = _item.goodsCustomerAttributeList
// delete _item.goodsCustomerAttributeList
if(_item.commodityPic.length>0){ if(_item.commodityPic.length>0){
// 编辑情况下兼顾手动添加图片列表属性 // 编辑情况下兼顾手动添加图片列表属性
_item.commodityPic = _item.commodityPic.map(__item => __item?.response?.data || __item?.url) _item.commodityPic = _item.commodityPic.map(__item => __item?.response?.data || __item?.url)
...@@ -165,23 +162,23 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -165,23 +162,23 @@ const AddProducts: React.FC<{}> = (props) => {
return e return e
} }
_params.unitPriceAndPicList = productAttributeAndImageParams _params.unitPriceAndPicList = productAttributeAndImageParams
}else{ }else{ // 编辑 没有点击商品图片
_params.unitPriceAndPicList = productInfoByEdit.unitPriceAndPicList _params.unitPriceAndPicList = productInfoByEdit.unitPriceAndPicList
} }
if(clickTabIndex.indexOf("3")===-1) if(clickTabIndex.indexOf("3")===-1) // 商品属性
_params.commodityAttributeList = productInfoByEdit.commodityAttributeList _params.commodityAttributeList = productInfoByEdit.commodityAttributeList
if(clickTabIndex.indexOf("4")===-1){ if(clickTabIndex.indexOf("4")===-1){ // 价格属性
_params.unitId = productInfoByEdit.unitId _params.unitId = productInfoByEdit.unitId
_params.unitName = productInfoByEdit.unitName _params.unitName = productInfoByEdit.unitName
_params.minOrder = productInfoByEdit.minOrder _params.minOrder = productInfoByEdit.minOrder
_params.priceType = productInfoByEdit.priceType _params.priceType = productInfoByEdit.priceType
_params.isMemberPrice = productInfoByEdit.isMemberPrice _params.isMemberPrice = productInfoByEdit.isMemberPrice
} }
if(clickTabIndex.indexOf("6")===-1) if(clickTabIndex.indexOf("6")===-1) // 商品描述
_params.commodityRemark = productInfoByEdit.commodityRemark _params.commodityRemark = productInfoByEdit.commodityRemark
if(clickTabIndex.indexOf("7")===-1) if(clickTabIndex.indexOf("7")===-1) // 物流
_params.logistics = productInfoByEdit.logistics _params.logistics = productInfoByEdit.logistics
if(clickTabIndex.indexOf("8")===-1){ if(clickTabIndex.indexOf("8")===-1){ // 其他
_params.isInvoice = productInfoByEdit.isInvoice _params.isInvoice = productInfoByEdit.isInvoice
_params.marks = productInfoByEdit.marks _params.marks = productInfoByEdit.marks
_params.packing = productInfoByEdit.packing _params.packing = productInfoByEdit.packing
......
...@@ -40,11 +40,17 @@ const OtherForm: React.FC<Iprops> = (props) => { ...@@ -40,11 +40,17 @@ const OtherForm: React.FC<Iprops> = (props) => {
ref={otherFormRef} ref={otherFormRef}
colon={false} colon={false}
autoComplete="off" autoComplete="off"
initialValues={history.location.query?.id ? getOtherFormParamsByEdit : { isInvoice: false }} initialValues={history.location.query?.id ? getOtherFormParamsByEdit : {}}
> >
<Form.Item <Form.Item
name="isInvoice" name="isInvoice"
label="提供发票" label="提供发票"
rules={[
{
required: true,
message: '请选择是否提供发票'
}
]}
> >
<Radio.Group size="small"> <Radio.Group size="small">
<Radio.Button value={true} style={{ width: 100, textAlign: 'center' }}></Radio.Button> <Radio.Button value={true} style={{ width: 100, textAlign: 'center' }}></Radio.Button>
......
...@@ -50,10 +50,8 @@ const ProductImageForm: React.FC<Iprops> = (props) => { ...@@ -50,10 +50,8 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
/* 给数据添加图片字段 */ /* 给数据添加图片字段 */
useEffect(()=>{ useEffect(()=>{
// console.log('图片111', priceAttributeParams)
let _priceAttributeParams: any = [] let _priceAttributeParams: any = []
if(productInfoByEdit?.id){ // id判断是否新增还是编辑 if(productInfoByEdit?.id){ // id判断是否新增还是编辑
// console.log('图片222', priceAttributeParams)
setSetImageType(productInfoByEdit.isAllAttributePic) setSetImageType(productInfoByEdit.isAllAttributePic)
setIsAllAttributePic(productInfoByEdit.isAllAttributePic) setIsAllAttributePic(productInfoByEdit.isAllAttributePic)
let _commodityPicList = productInfoByEdit.unitPriceAndPicList.map(_ => _.commodityPic) let _commodityPicList = productInfoByEdit.unitPriceAndPicList.map(_ => _.commodityPic)
...@@ -87,7 +85,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => { ...@@ -87,7 +85,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
// } // }
setPriceAttributeParamsByRender(_priceAttributeParams) setPriceAttributeParamsByRender(_priceAttributeParams)
setProductAttributeAndImageParams(_priceAttributeParams) setProductAttributeAndImageParams(_priceAttributeParams)
console.log(_priceAttributeParams, priceAttributeParams, '_p') // 这里可能为空数组 console.log(_priceAttributeParams, priceAttributeParams, '_p') // 这里可能为空数组 ** 如果不到此页面 前一个是旧数据 后面的为新数据
// 初始化若是按所有属性共用做显示处理 // 初始化若是按所有属性共用做显示处理
if(setImageType && _priceAttributeParams.length>0){ if(setImageType && _priceAttributeParams.length>0){
setCommonImageList(_priceAttributeParams[0].commodityPic) setCommonImageList(_priceAttributeParams[0].commodityPic)
......
...@@ -84,13 +84,11 @@ const Products: React.FC<{}> = () => { ...@@ -84,13 +84,11 @@ const Products: React.FC<{}> = () => {
{ {
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'id',
align: 'center',
key: 'id', key: 'id',
}, },
{ {
title: '商品名称', title: '商品名称',
dataIndex: 'name', dataIndex: 'name',
align: 'center',
key: 'name', key: 'name',
className: 'commonPickColor', className: 'commonPickColor',
render: (text: any, record: any) => <span className="commonPickColor" onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></span> render: (text: any, record: any) => <span className="commonPickColor" onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></span>
...@@ -98,19 +96,16 @@ const Products: React.FC<{}> = () => { ...@@ -98,19 +96,16 @@ const Products: React.FC<{}> = () => {
{ {
title: '品类', title: '品类',
dataIndex: ['customerCategory', 'name'], dataIndex: ['customerCategory', 'name'],
align: 'center',
key: 'customerCategory.name', key: 'customerCategory.name',
}, },
{ {
title: '品牌', title: '品牌',
dataIndex: ['brand', 'name'], dataIndex: ['brand', 'name'],
align: 'center',
key: 'brand.name', key: 'brand.name',
}, },
{ {
title: '单位', title: '单位',
dataIndex: 'unitName', dataIndex: 'unitName',
align: 'center',
key: 'unitName', key: 'unitName',
}, },
{ {
...@@ -156,7 +151,6 @@ const Products: React.FC<{}> = () => { ...@@ -156,7 +151,6 @@ const Products: React.FC<{}> = () => {
{ {
title: '审核状态', title: '审核状态',
dataIndex: 'status', dataIndex: 'status',
align: 'center',
key: 'status', key: 'status',
render: (text: any, record: any) => { render: (text: any, record: any) => {
let component: ReactNode = null let component: ReactNode = null
...@@ -205,40 +199,7 @@ const Products: React.FC<{}> = () => { ...@@ -205,40 +199,7 @@ const Products: React.FC<{}> = () => {
{ {
title: '操作', title: '操作',
dataIndex: 'option', dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => renderOptionButton(record) render: (text: any, record: any) => renderOptionButton(record)
// {
// return (
// <>
// <Popconfirm
// title="确定要执行这个操作?"
// onConfirm={() => handleBatchDelete([record.id])}
// onCancel={cancel}
// okText="是"
// cancelText="否"
// >
// <Button type='link'>删除</Button>
// </Popconfirm>
// <Dropdown overlay={
// <Menu>
// <Menu.Item>
// {record.status === 1 ? <Button type='link' onClick={()=>clickSubmitCheck(record)}>提交审核</Button> : ''}
// </Menu.Item>
// {(record.status === 4 || record.status === 6) ? <Menu.Item><Button type='link' onClick={() => clickUp(1, record.id)}>上架</Button></Menu.Item> : ''}
// {record.status === 5 ? <Menu.Item><Button type='link' onClick={() => clickUp(0, record.id)}>下架</Button></Menu.Item> : ''}
// {record.status === 3 || record.status === 1 ? <Menu.Item><Button type='link' onClick={() => clickModify(record.id)}>修改</Button></Menu.Item> : ''}
// <Menu.Item>
// <Button type='link' onClick={()=>clickCopy(record)}>复制</Button>
// </Menu.Item>
// </Menu>
// }>
// <a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
// 更多 <CaretDownOutlined />
// </a>
// </Dropdown>
// </>
// )
// }
} }
]; ];
......
...@@ -360,7 +360,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -360,7 +360,7 @@ const viewProducts: React.FC<{}> = () => {
<Col span={20}> <Col span={20}>
<p> <p>
{ {
productDetail?.commodityAreaList.map(_item => <p>{_item.provinceName+'/'+(_item.cityName||'')}</p>) productDetail?.commodityAreaList.length>0 ? productDetail?.commodityAreaList.map(_item => <p>{_item.provinceName+'/'+(_item.cityName||'')}</p>) : '全国'
} }
</p> </p>
</Col> </Col>
......
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