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