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 {
export interface UserRegister {
useType: UseType;
<<<<<<< HEAD
useDetail?: any;
=======
>>>>>>> 1e9b352414679e662c2d94fb6725cc5e998b77d3
}
export interface CountryList {
......
......@@ -54,6 +54,7 @@ const Goods: React.FC<{}> = () => {
const [brandValue, setBrandValue] = useState(undefined)
const [classData, setClassData] = useState<any>([])
const [classValue, setClassValue] = useState(undefined)
const [batchDeleteKeys, setBatchDeleteKeys] = useState<any>([])
const columns: ColumnType<any>[] = [
{
......@@ -153,6 +154,7 @@ const Goods: React.FC<{}> = () => {
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
setBatchDeleteKeys([...batchDeleteKeys, ...selectedRowKeys]);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
}
}
......@@ -221,7 +223,6 @@ const Goods: React.FC<{}> = () => {
const [step1DescriptState, setStep1DescriptState] = useState(step1Description)
const [step2DescriptState, setStep2DescriptState] = useState(step2Description)
// timer 计时器模拟导入过程
const [exceptionCheck, setExceptionCheck] = useState(false); // 默认无异常
const [exceptionData, setExceptionData] = useState(false); // 默认无异常
......@@ -282,13 +283,14 @@ const Goods: React.FC<{}> = () => {
const handleMenuClick = (e: any) => {
console.log('menu', e, selectedRowKeys); // 1 批量删除;2 删除导入批次
if(e.key === '1'){
PublicApi.postProductGoodsDeleteBatchGoods({idList: selectedRowKeys}).then(res=>{
//@ts-ignore
ref.current.reload()
})
console.log(batchDeleteKeys,'batchKeys')
// PublicApi.postProductGoodsDeleteBatchGoods({idList: selectedRowKeys}).then(res=>{
// //@ts-ignore
// ref.current.reload()
// })
}else if(e.key === '2'){
console.log('删除导入批次')
setDeleteBatchModal(true)
// console.log('删除导入批次')
// setDeleteBatchModal(true)
}
}
......
import React, { useState, useEffect, useRef } from 'react'
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 { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListShipperAddressResponse } from '@/services'
import { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListShipperAddressResponse, GetLogisticsSelectListFreightTemplateResponse } from '@/services'
import { store } from '@/store'
const { ProductStore } = store
......@@ -28,13 +28,15 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
const [logisticsForm] = Form.useForm()
const [logisticsCompanyLists, setLogisticsCompanyLists] = useState<GetLogisticsSelectListCompanyResponse>()
const [logisticsAddressList, setLogisticsAddressList] = useState<GetLogisticsSelectListShipperAddressResponse>()
const [logisticsTemplateList, setLogisticsTemplateList] = useState<GetLogisticsSelectListFreightTemplateResponse>()
const [isTemplate, setIsTemplate] = useState<boolean>(false)
const { productInfoByEdit } = ProductStore
useEffect(()=>{
//传入ref给父级
onRef(logisticsFormRef)
// 获取发货地址 物流公司
// 获取发货地址 物流公司 运费模板
PublicApi.getLogisticsSelectListShipperAddress().then(res=>{
setLogisticsAddressList(res.data)
})
......@@ -43,8 +45,16 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
setLogisticsCompanyLists(res.data)
})
PublicApi.getLogisticsSelectListFreightTemplate().then(res=>{
setLogisticsTemplateList(res.data)
})
}, [])
const onChangeTemplate = (e) => {
setIsTemplate(e.target.checked)
}
return (<>
<Form
{...layout}
......@@ -103,21 +113,29 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
]}
>
<Input suffix="KG" placeholder="请输入重量" />
{/* <Checkbox>使用运费模板(只有买家承担运费才能选择)</Checkbox> */}
</Form.Item>
{/* <Form.Item
name="chargeTemplate"
label="运费模板"
<Form.Item
name="useTemplate"
valuePropName="checked"
label=" "
>
<Select
placeholder="请选择运费模板"
allowClear
<Checkbox onChange={onChangeTemplate}>使用运费模板(只有买家承担运费才能选择)</Checkbox>
</Form.Item>
{
isTemplate && <Form.Item
name="templateId"
label="运费模板"
>
<Option value="SF">顺丰模板</Option>
<Option value="EMS">EMS模板</Option>
<Option value="COM">一般快递模板</Option>
</Select>
</Form.Item> */}
<Select
placeholder="请选择运费模板"
allowClear
>
{
logisticsTemplateList?.length>0 && logisticsTemplateList.map(_ => <Option key={_.id} value={_.id}>{_.name}</Option>)
}
</Select>
</Form.Item>
}
<Form.Item
name="sendAddress"
label="发货地址"
......
......@@ -418,6 +418,7 @@ const Products: React.FC<{}> = () => {
setCurrentOptionId(id)
PublicApi.getProductCommodityGetShop({id: id}).then(res => {
setShopsOption(res.data)
setCheckedValues(res.data.filter(_=>_.isCheck))
})
setIsUp(param)
setUpDownModal(true)
......@@ -428,10 +429,16 @@ const Products: React.FC<{}> = () => {
id: currentOptionId,
shopList: checkedValues
}
PublicApi.postProductCommodityPublishCommodity(params).then(res => {
if(res.code === 1000)
setUpDownModal(false)
})
if(isUp)
PublicApi.postProductCommodityPublishCommodity(params).then(res => {
if(res.code === 1000)
setUpDownModal(false)
})
else
PublicApi.postProductCommodityOffPublishCommodity(params).then(res => {
if(res.code === 1000)
setUpDownModal(false)
})
}
const handleCancelUp = () => {
......@@ -758,6 +765,7 @@ const Products: React.FC<{}> = () => {
visible={upDownModal}
onOk={handleUp}
onCancel={handleCancelUp}
forceRender={true}
>
<Form
layout="vertical"
......@@ -769,11 +777,11 @@ const Products: React.FC<{}> = () => {
<QuestionCircleOutlined />
</Tooltip>
</span>}>
<Checkbox.Group style={{ width: '100%' }} onChange={onChangeUpShop}>
<Checkbox.Group style={{ width: '100%' }} onChange={onChangeUpShop} value={checkedValues}>
<Row>
{
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>)
}
</Row>
......
......@@ -32,7 +32,6 @@ const { Step } = Steps;
const { TabPane } = Tabs;
const viewProducts: React.FC<{}> = () => {
const [productDetail, setPorductDetail] = useState<GetProductCommodityGetCommodityResponse>()
const [checkRecord, setCheckRecord] = useState<GetProductCommodityGetCommodityCheckRecordResponse>()
const [fixStep, setFixStep] = useState(0)
......@@ -42,6 +41,9 @@ const viewProducts: React.FC<{}> = () => {
const [tableRenderDatas, setTableRenderDatas] = useState<any[]>([])
const [attributeArrByImageRender, setAttributeArrByImageRender] = useState<any[]>([])
const [imageArrByImageRender, setImageArrByImageRender] = useState<any[]>([])
const [logisticTemplateName, setLogisticTemplateName] = useState<string>()
const [logisticResourceCompanyName, setLogisticResourceCompanyName] = useState<string>()
const [logisticResourceSendAddress, setLogisticResourceSendAddress] = useState<string>()
useEffect(() => {
const { id } = history.location.query
......@@ -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>[] = [
{
......@@ -373,7 +391,7 @@ const viewProducts: React.FC<{}> = () => {
<p>运费模版:</p>
</Col>
<Col span={20}>
<p>快递按重量计算运费模版</p>
<p>{logisticTemplateName}</p>
</Col>
</Row>
<Row>
......@@ -381,7 +399,7 @@ const viewProducts: React.FC<{}> = () => {
<p>物流公司:</p>
</Col>
<Col span={20}>
<p>{productDetail?.logistics?.company}</p>
<p>{logisticResourceCompanyName}</p>
</Col>
</Row>
<Row>
......@@ -389,7 +407,7 @@ const viewProducts: React.FC<{}> = () => {
<p>发货地址:</p>
</Col>
<Col span={20}>
<p>{productDetail?.logistics?.sendAddress}</p>
<p>{logisticResourceSendAddress}</p>
</Col>
</Row>
</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