Commit ad2b117d authored by tjy's avatar tjy
parents 57400535 d441a906
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"@umijs/test": "^3.2.0", "@umijs/test": "^3.2.0",
"bizcharts": "^4.0.7", "bizcharts": "^4.0.7",
"copy-to-clipboard": "^3.3.1", "copy-to-clipboard": "^3.3.1",
"god": "0.1.18", "god": "^0.1.18",
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",
"mobx": "^5.15.4", "mobx": "^5.15.4",
"mobx-react": "^6.2.2", "mobx-react": "^6.2.2",
......
...@@ -58,7 +58,10 @@ const AddAtttribute: React.FC<{}> = () => { ...@@ -58,7 +58,10 @@ const AddAtttribute: React.FC<{}> = () => {
delete values.attributeShow delete values.attributeShow
if(JSON.stringify(values.attribute)==='{}') if(JSON.stringify(values.attribute)==='{}')
delete values.attribute delete values.attribute
PublicApi.postProductCustomerSaveOrUpdateCustomerAttribute(values) PublicApi.postProductCustomerSaveOrUpdateCustomerAttribute(values).then(res => {
if(res.code === 1000)
history.goBack()
})
}).catch(error => { }).catch(error => {
console.error(error) console.error(error)
}) })
......
...@@ -65,6 +65,7 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -65,6 +65,7 @@ const ClassProperty: React.FC<{}> = () => {
setTreeStatus(FormState.ADD) setTreeStatus(FormState.ADD)
}, },
addChildNode(node) { addChildNode(node) {
formActions.reset({ validate: false })
setNodeRecord({ setNodeRecord({
...node, ...node,
parentId: node.id, // 添加子级的时候 使用上一级的id作为parentId parentId: node.id, // 添加子级的时候 使用上一级的id作为parentId
......
...@@ -80,7 +80,10 @@ const AddPropertyValue: React.FC<{}> = () => { ...@@ -80,7 +80,10 @@ const AddPropertyValue: React.FC<{}> = () => {
if(JSON.stringify(pararms.attributeValue)==='{}') if(JSON.stringify(pararms.attributeValue)==='{}')
delete pararms.attributeValue delete pararms.attributeValue
//@ts-ignore //@ts-ignore
PublicApi.postProductCustomerSaveOrUpdateCustomerAttributeValue(pararms) PublicApi.postProductCustomerSaveOrUpdateCustomerAttributeValue(pararms).then(res => {
if(res.code === 1000)
history.goBack()
})
}).catch(error => { }).catch(error => {
console.error(error) console.error(error)
......
...@@ -15,6 +15,7 @@ import { StandardTable } from 'god' ...@@ -15,6 +15,7 @@ import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import styles from "./index.less" import styles from "./index.less"
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
const { Option } = Select; const { Option } = Select;
...@@ -54,6 +55,8 @@ const Goods: React.FC<{}> = () => { ...@@ -54,6 +55,8 @@ const Goods: React.FC<{}> = () => {
const [brandValue, setBrandValue] = useState(undefined) const [brandValue, setBrandValue] = useState(undefined)
const [classData, setClassData] = useState<any>([]) const [classData, setClassData] = useState<any>([])
const [classValue, setClassValue] = useState(undefined) const [classValue, setClassValue] = useState(undefined)
const [batchDeleteKeys, setBatchDeleteKeys] = useState<any>([])
const [goodsRowSelection, goodsRowCtl] = useRowSelectionTable()
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
...@@ -153,6 +156,7 @@ const Goods: React.FC<{}> = () => { ...@@ -153,6 +156,7 @@ const Goods: React.FC<{}> = () => {
onChange: (selectedRowKeys: any, selectedRows: any) => { onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows); setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys); setSelectedRowKeys(selectedRowKeys);
setBatchDeleteKeys([...batchDeleteKeys, ...selectedRowKeys]);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
} }
} }
...@@ -221,7 +225,6 @@ const Goods: React.FC<{}> = () => { ...@@ -221,7 +225,6 @@ const Goods: React.FC<{}> = () => {
const [step1DescriptState, setStep1DescriptState] = useState(step1Description) const [step1DescriptState, setStep1DescriptState] = useState(step1Description)
const [step2DescriptState, setStep2DescriptState] = useState(step2Description) const [step2DescriptState, setStep2DescriptState] = useState(step2Description)
// timer 计时器模拟导入过程 // timer 计时器模拟导入过程
const [exceptionCheck, setExceptionCheck] = useState(false); // 默认无异常 const [exceptionCheck, setExceptionCheck] = useState(false); // 默认无异常
const [exceptionData, setExceptionData] = useState(false); // 默认无异常 const [exceptionData, setExceptionData] = useState(false); // 默认无异常
...@@ -280,9 +283,9 @@ const Goods: React.FC<{}> = () => { ...@@ -280,9 +283,9 @@ const Goods: React.FC<{}> = () => {
) )
const handleMenuClick = (e: any) => { const handleMenuClick = (e: any) => {
console.log('menu', e, selectedRowKeys); // 1 批量删除;2 删除导入批次 // console.log('menu', e, selectedRowKeys); // 1 批量删除;2 删除导入批次
if(e.key === '1'){ if(e.key === '1'){
PublicApi.postProductGoodsDeleteBatchGoods({idList: selectedRowKeys}).then(res=>{ PublicApi.postProductGoodsDeleteBatchGoods({idList: goodsRowCtl.selectedRowKeys}).then(res=>{
//@ts-ignore //@ts-ignore
ref.current.reload() ref.current.reload()
}) })
...@@ -369,7 +372,7 @@ const Goods: React.FC<{}> = () => { ...@@ -369,7 +372,7 @@ const Goods: React.FC<{}> = () => {
<StandardTable <StandardTable
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowSelection={rowSelection} rowSelection={goodsRowSelection}
tableProps={{rowKey: "id"}} tableProps={{rowKey: "id"}}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
controlRender={ controlRender={
......
import React, { useState, useEffect, useRef } from 'react' import React, { useState, useEffect, useRef } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Form, Select, Radio, Input } from 'antd' import { Form, Select, Radio, Input, Checkbox } from 'antd'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListShipperAddressResponse } from '@/services' import { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListShipperAddressResponse, GetLogisticsSelectListFreightTemplateResponse } from '@/services'
import { store } from '@/store' import { store } from '@/store'
const { ProductStore } = store const { ProductStore } = store
...@@ -28,13 +28,15 @@ const LogisticsForm: React.FC<Iprops> = (props) => { ...@@ -28,13 +28,15 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
const [logisticsForm] = Form.useForm() const [logisticsForm] = Form.useForm()
const [logisticsCompanyLists, setLogisticsCompanyLists] = useState<GetLogisticsSelectListCompanyResponse>() const [logisticsCompanyLists, setLogisticsCompanyLists] = useState<GetLogisticsSelectListCompanyResponse>()
const [logisticsAddressList, setLogisticsAddressList] = useState<GetLogisticsSelectListShipperAddressResponse>() const [logisticsAddressList, setLogisticsAddressList] = useState<GetLogisticsSelectListShipperAddressResponse>()
const [logisticsTemplateList, setLogisticsTemplateList] = useState<GetLogisticsSelectListFreightTemplateResponse>()
const [isTemplate, setIsTemplate] = useState<boolean>(false)
const { productInfoByEdit } = ProductStore const { productInfoByEdit } = ProductStore
useEffect(()=>{ useEffect(()=>{
//传入ref给父级 //传入ref给父级
onRef(logisticsFormRef) onRef(logisticsFormRef)
// 获取发货地址 物流公司 // 获取发货地址 物流公司 运费模板
PublicApi.getLogisticsSelectListShipperAddress().then(res=>{ PublicApi.getLogisticsSelectListShipperAddress().then(res=>{
setLogisticsAddressList(res.data) setLogisticsAddressList(res.data)
}) })
...@@ -43,8 +45,16 @@ const LogisticsForm: React.FC<Iprops> = (props) => { ...@@ -43,8 +45,16 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
setLogisticsCompanyLists(res.data) setLogisticsCompanyLists(res.data)
}) })
PublicApi.getLogisticsSelectListFreightTemplate().then(res=>{
setLogisticsTemplateList(res.data)
})
}, []) }, [])
const onChangeTemplate = (e) => {
setIsTemplate(e.target.checked)
}
return (<> return (<>
<Form <Form
{...layout} {...layout}
...@@ -103,21 +113,29 @@ const LogisticsForm: React.FC<Iprops> = (props) => { ...@@ -103,21 +113,29 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
]} ]}
> >
<Input suffix="KG" placeholder="请输入重量" /> <Input suffix="KG" placeholder="请输入重量" />
{/* <Checkbox>使用运费模板(只有买家承担运费才能选择)</Checkbox> */}
</Form.Item> </Form.Item>
{/* <Form.Item <Form.Item
name="chargeTemplate" name="useTemplate"
label="运费模板" valuePropName="checked"
label=" "
> >
<Select <Checkbox onChange={onChangeTemplate}>使用运费模板(只有买家承担运费才能选择)</Checkbox>
placeholder="请选择运费模板" </Form.Item>
allowClear {
isTemplate && <Form.Item
name="templateId"
label="运费模板"
> >
<Option value="SF">顺丰模板</Option> <Select
<Option value="EMS">EMS模板</Option> placeholder="请选择运费模板"
<Option value="COM">一般快递模板</Option> allowClear
</Select> >
</Form.Item> */} {
logisticsTemplateList?.length>0 && logisticsTemplateList.map(_ => <Option key={_.id} value={_.id}>{_.name}</Option>)
}
</Select>
</Form.Item>
}
<Form.Item <Form.Item
name="sendAddress" name="sendAddress"
label="发货地址" label="发货地址"
......
...@@ -418,6 +418,7 @@ const Products: React.FC<{}> = () => { ...@@ -418,6 +418,7 @@ const Products: React.FC<{}> = () => {
setCurrentOptionId(id) setCurrentOptionId(id)
PublicApi.getProductCommodityGetShop({id: id}).then(res => { PublicApi.getProductCommodityGetShop({id: id}).then(res => {
setShopsOption(res.data) setShopsOption(res.data)
setCheckedValues(res.data.filter(_=>_.isCheck))
}) })
setIsUp(param) setIsUp(param)
setUpDownModal(true) setUpDownModal(true)
...@@ -428,10 +429,16 @@ const Products: React.FC<{}> = () => { ...@@ -428,10 +429,16 @@ const Products: React.FC<{}> = () => {
id: currentOptionId, id: currentOptionId,
shopList: checkedValues shopList: checkedValues
} }
PublicApi.postProductCommodityPublishCommodity(params).then(res => { if(isUp)
if(res.code === 1000) PublicApi.postProductCommodityPublishCommodity(params).then(res => {
setUpDownModal(false) if(res.code === 1000)
}) setUpDownModal(false)
})
else
PublicApi.postProductCommodityOffPublishCommodity(params).then(res => {
if(res.code === 1000)
setUpDownModal(false)
})
} }
const handleCancelUp = () => { const handleCancelUp = () => {
...@@ -758,6 +765,7 @@ const Products: React.FC<{}> = () => { ...@@ -758,6 +765,7 @@ const Products: React.FC<{}> = () => {
visible={upDownModal} visible={upDownModal}
onOk={handleUp} onOk={handleUp}
onCancel={handleCancelUp} onCancel={handleCancelUp}
forceRender={true}
> >
<Form <Form
layout="vertical" layout="vertical"
...@@ -769,11 +777,11 @@ const Products: React.FC<{}> = () => { ...@@ -769,11 +777,11 @@ const Products: React.FC<{}> = () => {
<QuestionCircleOutlined /> <QuestionCircleOutlined />
</Tooltip> </Tooltip>
</span>}> </span>}>
<Checkbox.Group style={{ width: '100%' }} onChange={onChangeUpShop}> <Checkbox.Group style={{ width: '100%' }} onChange={onChangeUpShop} value={checkedValues}>
<Row> <Row>
{ {
Array.isArray(shopsOption) && shopsOption.map((item, index) => <Col key={index} span={6}> Array.isArray(shopsOption) && shopsOption.map((item, index) => <Col key={index} span={6}>
<Checkbox checked={item.isCheck} value={item}>{item.name}</Checkbox> <Checkbox value={item}>{item.name}</Checkbox>
</Col>) </Col>)
} }
</Row> </Row>
......
...@@ -32,7 +32,6 @@ const { Step } = Steps; ...@@ -32,7 +32,6 @@ const { Step } = Steps;
const { TabPane } = Tabs; const { TabPane } = Tabs;
const viewProducts: React.FC<{}> = () => { const viewProducts: React.FC<{}> = () => {
const [productDetail, setPorductDetail] = useState<GetProductCommodityGetCommodityResponse>() const [productDetail, setPorductDetail] = useState<GetProductCommodityGetCommodityResponse>()
const [checkRecord, setCheckRecord] = useState<GetProductCommodityGetCommodityCheckRecordResponse>() const [checkRecord, setCheckRecord] = useState<GetProductCommodityGetCommodityCheckRecordResponse>()
const [fixStep, setFixStep] = useState(0) const [fixStep, setFixStep] = useState(0)
...@@ -42,6 +41,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -42,6 +41,9 @@ const viewProducts: React.FC<{}> = () => {
const [tableRenderDatas, setTableRenderDatas] = useState<any[]>([]) const [tableRenderDatas, setTableRenderDatas] = useState<any[]>([])
const [attributeArrByImageRender, setAttributeArrByImageRender] = useState<any[]>([]) const [attributeArrByImageRender, setAttributeArrByImageRender] = useState<any[]>([])
const [imageArrByImageRender, setImageArrByImageRender] = useState<any[]>([]) const [imageArrByImageRender, setImageArrByImageRender] = useState<any[]>([])
const [logisticTemplateName, setLogisticTemplateName] = useState<string>()
const [logisticResourceCompanyName, setLogisticResourceCompanyName] = useState<string>()
const [logisticResourceSendAddress, setLogisticResourceSendAddress] = useState<string>()
useEffect(() => { useEffect(() => {
const { id } = history.location.query const { id } = history.location.query
...@@ -69,6 +71,22 @@ const viewProducts: React.FC<{}> = () => { ...@@ -69,6 +71,22 @@ const viewProducts: React.FC<{}> = () => {
}) })
} }
}, []) }, [])
useEffect(() => {
if(productDetail?.logistics?.templateId)
PublicApi.getLogisticsFreightTemplateGet({id: productDetail?.logistics?.templateId + ''}).then(res => {
setLogisticTemplateName(res.data.name)
})
if(productDetail?.logistics?.company)
PublicApi.getLogisticsCompanyGet({id: productDetail?.logistics?.company + ''}).then(res => {
setLogisticResourceCompanyName(res.data.name)
})
if(productDetail?.logistics?.sendAddress)
PublicApi.getLogisticsShipperAddressGet({id: productDetail?.logistics?.sendAddress + ''}).then(res => {
const { provinceName, cityName, districtName, address } = res.data
setLogisticResourceSendAddress(provinceName + cityName + districtName + address)
})
}, [productDetail])
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
...@@ -373,7 +391,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -373,7 +391,7 @@ const viewProducts: React.FC<{}> = () => {
<p>运费模版:</p> <p>运费模版:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>快递按重量计算运费模版</p> <p>{logisticTemplateName}</p>
</Col> </Col>
</Row> </Row>
<Row> <Row>
...@@ -381,7 +399,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -381,7 +399,7 @@ const viewProducts: React.FC<{}> = () => {
<p>物流公司:</p> <p>物流公司:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>{productDetail?.logistics?.company}</p> <p>{logisticResourceCompanyName}</p>
</Col> </Col>
</Row> </Row>
<Row> <Row>
...@@ -389,7 +407,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -389,7 +407,7 @@ const viewProducts: React.FC<{}> = () => {
<p>发货地址:</p> <p>发货地址:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>{productDetail?.logistics?.sendAddress}</p> <p>{logisticResourceSendAddress}</p>
</Col> </Col>
</Row> </Row>
</Card> </Card>
......
...@@ -68,7 +68,6 @@ const AddRepository:React.FC<{}> = (props) => { ...@@ -68,7 +68,6 @@ const AddRepository:React.FC<{}> = (props) => {
const [memberRowSelection, memberRowCtl] = useRowSelectionTable() const [memberRowSelection, memberRowCtl] = useRowSelectionTable()
const [productRowSelection, productRowCtl] = useRowSelectionTable({type: 'radio'}) const [productRowSelection, productRowCtl] = useRowSelectionTable({type: 'radio'})
useUnitPreview(initValue, addSchemaAction) useUnitPreview(initValue, addSchemaAction)
const columnsSetMember: ColumnType<any>[] = [ const columnsSetMember: ColumnType<any>[] = [
{ {
......
...@@ -31,9 +31,9 @@ function beforeLogoUpload(file: UploadFile) { ...@@ -31,9 +31,9 @@ function beforeLogoUpload(file: UploadFile) {
if (!isJpgOrPng) { if (!isJpgOrPng) {
message.error('仅支持上传JPEG/JPG/PNG文件!'); message.error('仅支持上传JPEG/JPG/PNG文件!');
} }
const isLt2M = file.size / 1024 / 1024 < 2; const isLt2M = file.size / 1024 / 10 < 6;
if (!isLt2M) { if (!isLt2M) {
message.error('上传图片不超过2MB!'); message.error('上传图片不超过60K!');
} }
return isJpgOrPng && isLt2M; return isJpgOrPng && isLt2M;
} }
...@@ -61,6 +61,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -61,6 +61,7 @@ const AddBrand: React.FC<{}> = () => {
const [isEnableCheck, setIsEnableCheck] = useState(true) const [isEnableCheck, setIsEnableCheck] = useState(true)
const [responseId, setReponseId] = useState<number>(null) const [responseId, setReponseId] = useState<number>(null)
const [formValues, setFormValues] = useState<any>({}) const [formValues, setFormValues] = useState<any>({})
const [banSomeField, setBanSomeField] = useState<boolean>(false)
useEffect(()=>{ useEffect(()=>{
const { id } = history.location.query const { id } = history.location.query
...@@ -69,8 +70,10 @@ const AddBrand: React.FC<{}> = () => { ...@@ -69,8 +70,10 @@ const AddBrand: React.FC<{}> = () => {
if(res.code===1000){ if(res.code===1000){
const { data } = res const { data } = res
setFormValues(data) setFormValues(data)
form.setFieldsValue(data) // 不变动的情况下会丢失图片列表 form.setFieldsValue(data)
setlogoUrl(data.logoUrl) setlogoUrl(data.logoUrl)
if(data.status === 4)
setBanSomeField(true)
// 多图回显 // 多图回显
let proveImgs = Object.values(data.proveUrl) let proveImgs = Object.values(data.proveUrl)
let files = []; let files = [];
...@@ -168,7 +171,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -168,7 +171,7 @@ const AddBrand: React.FC<{}> = () => {
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>} backIcon={<ReutrnEle description="返回"/>}
title="新建品牌" title={history.location.query?.id?'修改品牌':'新建品牌'}
extra={[ extra={[
<Button key="2" disabled={isEnableCheck} onClick={handleApplyCheck}>直接提交审核</Button>, <Button key="2" disabled={isEnableCheck} onClick={handleApplyCheck}>直接提交审核</Button>,
<Button icon={<SaveOutlined />} key="1" type="primary" onClick={handleSave}> <Button icon={<SaveOutlined />} key="1" type="primary" onClick={handleSave}>
...@@ -197,7 +200,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -197,7 +200,7 @@ const AddBrand: React.FC<{}> = () => {
<Card headStyle={{borderBottom:'none'}} title="基本信息"> <Card headStyle={{borderBottom:'none'}} title="基本信息">
<Form.Item <Form.Item
name='name' name='name'
label='品牌名称' label={<span>品牌名称&nbsp;&nbsp;</span>}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -205,7 +208,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -205,7 +208,7 @@ const AddBrand: React.FC<{}> = () => {
}, },
]} ]}
> >
<Input placeholder="输入品牌名称" /> <Input disabled={banSomeField} placeholder="输入品牌名称" />
</Form.Item> </Form.Item>
{/* <Form.Item {/* <Form.Item
label='审核状态' label='审核状态'
...@@ -225,7 +228,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -225,7 +228,7 @@ const AddBrand: React.FC<{}> = () => {
</Form.Item> */} </Form.Item> */}
<Form.Item <Form.Item
name="logoUrl" name="logoUrl"
label="品牌LOGO" label={<span>品牌LOGO&nbsp;&nbsp;</span>}
// valuePropName="fileList" // valuePropName="fileList"
extra="支持JPG/PNG/JPEG,最大不超过 60K,为了减少加载数据量,只建议一级项目使用" extra="支持JPG/PNG/JPEG,最大不超过 60K,为了减少加载数据量,只建议一级项目使用"
rules={[ rules={[
...@@ -236,6 +239,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -236,6 +239,7 @@ const AddBrand: React.FC<{}> = () => {
]} ]}
> >
<Upload <Upload
disabled={banSomeField}
name="file" name="file"
listType="picture-card" listType="picture-card"
className="avatar-uploader" className="avatar-uploader"
...@@ -272,7 +276,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -272,7 +276,7 @@ const AddBrand: React.FC<{}> = () => {
data={{fileType:2}} data={{fileType:2}}
showUploadList={{ showPreviewIcon: false }} showUploadList={{ showPreviewIcon: false }}
> >
{fileList.length >= 4 ? null : uploadButton} {fileList.length >= 20 ? null : uploadButton}
</Upload> </Upload>
</Form.Item> </Form.Item>
</Col> </Col>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
height:120px; height:120px;
border:1px solid rgba(235,236,240,1); border:1px solid rgba(235,236,240,1);
img { img {
width: 100%;
height: 100%; height: 100%;
padding: 18px; padding: 18px;
} }
......
...@@ -15,7 +15,7 @@ import moment from 'moment' ...@@ -15,7 +15,7 @@ import moment from 'moment'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
const Trademark: React.FC<{}> = () => { const Trademark: React.FC<{}> = () => {
const ref = useRef({}) const ref = useRef<any>({})
const fetchData = (params: any) => { const fetchData = (params: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -132,7 +132,6 @@ const Trademark: React.FC<{}> = () => { ...@@ -132,7 +132,6 @@ const Trademark: React.FC<{}> = () => {
const confirm = (record: any) => { const confirm = (record: any) => {
PublicApi.postProductBrandUpdateBrandEnable({ id: record.id, isEnable: !record.isEnable }).then(res => { PublicApi.postProductBrandUpdateBrandEnable({ id: record.id, isEnable: !record.isEnable }).then(res => {
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
...@@ -143,13 +142,11 @@ const Trademark: React.FC<{}> = () => { ...@@ -143,13 +142,11 @@ const Trademark: React.FC<{}> = () => {
const handelDelete = (record: any) => { const handelDelete = (record: any) => {
PublicApi.postProductBrandDeleteBrand({ id: record.id }).then(res => { PublicApi.postProductBrandDeleteBrand({ id: record.id }).then(res => {
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
const handleApplyCheck = (record:any) => { const handleApplyCheck = (record:any) => {
PublicApi.postProductBrandApplyCheckBrand({id: record.id}).then(res=>{ PublicApi.postProductBrandApplyCheckBrand({id: record.id}).then(res=>{
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
......
...@@ -150,6 +150,7 @@ const viewBrand: React.FC<{}> = () => { ...@@ -150,6 +150,7 @@ const viewBrand: React.FC<{}> = () => {
type="primary" type="primary"
onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/addBrand?id=${brandInfo.id}`)} onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/addBrand?id=${brandInfo.id}`)}
disabled={!(brandInfo.status===1||brandInfo.status===3)} disabled={!(brandInfo.status===1||brandInfo.status===3)}
style={{display: !(brandInfo.status===1||brandInfo.status===3)?'none':'block'}}
> >
修改 修改
</Button>, </Button>,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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