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

fix

parent 3749c608
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":22,"typeName":"别删"},{"id":23,"typeName":"测试"},{"id":24,"typeName":"供应"},{"id":26,"typeName":"业务"},{"id":27,"typeName":"test"},{"id":28,"typeName":"123"},{"id":29,"typeName":"21321"}]},"useDetail":null},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}],"menuList":[{"code":"/memberCenter/commodityAbility","children":[{"code":"/mem"}]},{"code":"/memberCenter/commodityAbility/classAndProperty/class"}]}} {"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":24,"typeName":"供应"},{"id":33,"typeName":"hcx供应商"},{"id":34,"typeName":"test3"},{"id":35,"typeName":"test4"},{"id":36,"typeName":"test5"},{"id":37,"typeName":"test6"}]}},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}],"menuList":[{"code":"/memberCenter/commodityAbility","children":[{"code":"/mem"}]},{"code":"/memberCenter/commodityAbility/classAndProperty/class"}]}}
...@@ -15,10 +15,6 @@ export interface UseType { ...@@ -15,10 +15,6 @@ export interface UseType {
export interface UserRegister { export interface UserRegister {
useType: UseType; useType: UseType;
<<<<<<< HEAD
useDetail?: any;
=======
>>>>>>> 1e9b352414679e662c2d94fb6725cc5e998b77d3
} }
export interface CountryList { export interface CountryList {
......
...@@ -54,6 +54,7 @@ const Goods: React.FC<{}> = () => { ...@@ -54,6 +54,7 @@ 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 columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
...@@ -153,6 +154,7 @@ const Goods: React.FC<{}> = () => { ...@@ -153,6 +154,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 +223,6 @@ const Goods: React.FC<{}> = () => { ...@@ -221,7 +223,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); // 默认无异常
...@@ -282,13 +283,14 @@ const Goods: React.FC<{}> = () => { ...@@ -282,13 +283,14 @@ 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=>{ console.log(batchDeleteKeys,'batchKeys')
//@ts-ignore // PublicApi.postProductGoodsDeleteBatchGoods({idList: selectedRowKeys}).then(res=>{
ref.current.reload() // //@ts-ignore
}) // ref.current.reload()
// })
}else if(e.key === '2'){ }else if(e.key === '2'){
console.log('删除导入批次') // console.log('删除导入批次')
setDeleteBatchModal(true) // setDeleteBatchModal(true)
} }
} }
......
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>
......
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