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

feat: 新增商品/商品详情/商品审核对接新增字段

parent 3894d36b
......@@ -24,7 +24,7 @@ import asyncRoutes from '../router.config.json';
// import contracRoute from './contracRoute';
// export const routes = [CommodityRoute, MemberRoute, ShopRoute, ChannelRoute, TranactionRoute, AfterService, PayandSettleRoute, LogisticsRoute, AuthConfigRoute, HandlingRoute, BalaceRoute]
const isDev = true;
const isDev = false;
const homeRoute = {
path: `/memberCenter/home`,
name: 'home',
......
......@@ -196,6 +196,8 @@ export default {
'commodity.products.addProducts.onSave.error.2':'Please complete other product information! ',
'commodity.products.addProducts.onSave.error.3':'Commodity price is required! ',
'commodity.products.addProducts.onSave.error.4':'Commodity points are required! ',
'commodity.products.addProducts.onSave.error.5' : 'Please upload the product picture again!',
'commodity.products.addProducts.onSave.error.6' : 'Please upload the product picture!',
'commodity.products.addProducts.back':'Return',
'commodity.products.addProducts.title.1':'Edit product',
'commodity.products.addProducts.title.2':'New product',
......@@ -420,6 +422,7 @@ export default {
'commodity.products.viewProducts.constructTableData.planPrice.1':'Points (sub-unit)',
'commodity.products.viewProducts.constructTableData.planPrice.2':'Unit price (sub-unit)',
'commodity.products.viewProducts.constructTableData.priceRate':'Sub-unit price rate',
'commodity.products.viewProducts.constructTableData.hsCode' : 'HS Code',
'commodity.products.viewProducts.renderMoreList':'Expand',
'commodity.products.viewProducts.card.1.title':'Process progress',
'commodity.products.viewProducts.card.1.step.1':'New product',
......@@ -448,6 +451,10 @@ export default {
'commodity.products.viewProducts.card.4.marks':'Marks:',
'commodity.products.viewProducts.card.4.packing':'Packing list:',
'commodity.products.viewProducts.card.4.afterService':'After-sales service:',
'commodity.products.viewProducts.card.4.type' : 'Commodity typ:',
'commodity.products.viewProducts.card.4.type.1' : 'Proprietary products',
'commodity.products.viewProducts.card.4.type.2' : 'Upstream supply commodity',
'commodity.products.viewProducts.card.4.isCrossBorder' : 'Imported goods of cross-border e-commerce:',
'commodity.products.viewProducts.card.5.title':'Product attributes',
'commodity.products.viewProducts.card.5.tab.1':'Price attribute',
'commodity.products.viewProducts.card.5.tab.1.unitName':'Unit of measure:',
......@@ -853,6 +860,7 @@ export default {
'commodity.products.constant.deliveryTypeLabel.1':'logistics (default)',
'commodity.products.constant.deliveryTypeLabel.2':'Self mention',
'commodity.products.constant.deliveryTypeLabel.3':'No delivery required',
'commodity.products.constant.deliveryTypeLabel.4' : 'Logistics+self-delivery',
'commodity.products.constant.carriageTypeLabel.1':'The seller bears the freight (default)',
'commodity.products.constant.carriageTypeLabel.2':'The buyer bears the freight',
'commodity.products.constant.opeartionLabel.1':'Submit for review',
......@@ -1008,6 +1016,7 @@ export default {
'commodity.checkProductDetail.deliveryType.1': 'Logistics (default)',
'commodity.checkProductDetail.deliveryType.2': 'noutoasiakas',
'commodity.checkProductDetail.deliveryType.3': 'No distribution',
'commodity.checkProductDetail.deliveryType.4': 'Logistics+self-delivery',
'commodity.checkProductDetail.carriageType.1': 'Seller bears shipping costs (default)',
'commodity.checkProductDetail.carriageType.2': "Buyer's freight",
'commodity.checkProductDetail.constructTableData.productName.title': 'product name',
......@@ -1030,6 +1039,7 @@ export default {
'commodity.checkProductDetail.constructTableData.temp.4': 'unit price',
'commodity.checkProductDetail.constructTableData.temp.5': 'Deputy unit price rate',
'commodity.checkProductDetail.constructTableData.temp.6': 'Deputy unit price',
'commodity.checkProductDetail.constructTableData.hsCode': 'HS Code',
'commodity.checkProductDetail.renderMoreList.display': 'unfold',
'commodity.checkProductDetail.shangpinshenhe': 'Commodity audit',
'commodity.checkProductDetail.card.title1': 'The process schedule',
......@@ -1062,6 +1072,10 @@ export default {
'commodity.checkProductDetail.card4.p.3': 'shipping mark:',
'commodity.checkProductDetail.card4.p.4': 'packing list:',
'commodity.checkProductDetail.card4.p.5': 'after-sales service:',
'commodity.checkProductDetail.card.4.type' : 'Commodity typ:',
'commodity.checkProductDetail.card.4.type.1' : 'Proprietary products',
'commodity.checkProductDetail.card.4.type.2' : 'Upstream supply commodity',
'commodity.checkProductDetail.card.4.isCrossBorder' : 'Imported goods of cross-border e-commerce:',
'commodity.checkProductDetail.card.title5': 'commodity property',
'commodity.checkProductDetail.card5.tab': 'Property prices',
'commodity.checkProductDetail.card5.tab.p.1': 'measuring unit:',
......
......@@ -197,6 +197,8 @@ export default {
'commodity.products.addProducts.onSave.error.2' : '상품 기타 정보를 보완해 주세요!',
'commodity.products.addProducts.onSave.error.3' : '상품 가격은 필수입니다!',
'commodity.products.addProducts.onSave.error.4' : '상품 포인트는 필수입니다!',
'commodity.products.addProducts.onSave.error.5' : '상품 사진 다시 올려주세요!',
'commodity.products.addProducts.onSave.error.6' : '상품 사진 올려주세요!',
'commodity.products.addProducts.back' : '되돌아오다',
'commodity.products.addProducts.title.1' : '상품 편집',
'commodity.products.addProducts.title.2' : '신제품',
......@@ -421,6 +423,7 @@ export default {
'commodity.products.viewProducts.constructTableData.planPrice.1' : '포인트(보조 단위)',
'commodity.products.viewProducts.constructTableData.planPrice.2' : '단가(보조 단위)',
'commodity.products.viewProducts.constructTableData.priceRate' : '부단가율',
'commodity.products.viewProducts.constructTableData.hsCode' : 'HS 코딩',
'commodity.products.viewProducts.renderMoreList' : '펼치다',
'commodity.products.viewProducts.card.1.title' : '프로세스 진행률',
'commodity.products.viewProducts.card.1.step.1' : '신제품',
......@@ -449,6 +452,10 @@ export default {
'commodity.products.viewProducts.card.4.marks' : '마크:',
'commodity.products.viewProducts.card.4.packing' : '포장 명세서:',
'commodity.products.viewProducts.card.4.afterService' : '애프터서비스:',
'commodity.products.viewProducts.card.4.type' : '상품 종류:',
'commodity.products.viewProducts.card.4.type.1' : '자가경영 상품',
'commodity.products.viewProducts.card.4.type.2' : '상류 공급 상품',
'commodity.products.viewProducts.card.4.isCrossBorder' : '국제 전자상거래 수입 상품:',
'commodity.products.viewProducts.card.5.title' : '상품 속성',
'commodity.products.viewProducts.card.5.tab.1' : '가격 특성',
'commodity.products.viewProducts.card.5.tab.1.unitName' : '측정 단위:',
......@@ -853,6 +860,7 @@ export default {
'commodity.products.constant.deliveryTypeLabel.1' : '물류(기본값)',
'commodity.products.constant.deliveryTypeLabel.2' : '스스로 제기하다',
'commodity.products.constant.deliveryTypeLabel.3' : '배송 필요 없음',
'commodity.products.constant.deliveryTypeLabel.4' : '물류+셀프 인수',
'commodity.products.constant.carriageTypeLabel.1' : '판매자 부담 배송(기본값)',
'commodity.products.constant.carriageTypeLabel.2' : '구매자가 운임을 부담하다',
'commodity.products.constant.opeartionLabel.1' : '제출 심사',
......@@ -1008,6 +1016,7 @@ export default {
'commodity.checkProductDetail.deliveryType.1': '물류 (기본값)',
'commodity.checkProductDetail.deliveryType.2': '이후 제기',
'commodity.checkProductDetail.deliveryType.3': '배송이 필요 없습니다',
'commodity.checkProductDetail.deliveryType.4': '물류+셀프 인수',
'commodity.checkProductDetail.carriageType.1': '판매자 배송비 부담 (기본값)',
'commodity.checkProductDetail.carriageType.2': '구매자가 운송비를 부담하다',
'commodity.checkProductDetail.constructTableData.productName.title': '상품명',
......@@ -1030,6 +1039,7 @@ export default {
'commodity.checkProductDetail.constructTableData.temp.4': '단가',
'commodity.checkProductDetail.constructTableData.temp.5': '파라스트 레이트',
'commodity.checkProductDetail.constructTableData.temp.6': '부속단가',
'commodity.checkProductDetail.constructTableData.hsCode': 'HS 코딩',
'commodity.checkProductDetail.renderMoreList.display': '펴다',
'commodity.checkProductDetail.shangpinshenhe': '상품 심사',
'commodity.checkProductDetail.card.title1': '프로세스 진행',
......@@ -1062,6 +1072,10 @@ export default {
'commodity.checkProductDetail.card4.p.3': '음역어:',
'commodity.checkProductDetail.card4.p.4': '포장 명세서:',
'commodity.checkProductDetail.card4.p.5': '애프터 서비스:',
'commodity.checkProductDetail.card.4.type' : '상품 종류:',
'commodity.checkProductDetail.card.4.type.1' : '자가경영 상품',
'commodity.checkProductDetail.card.4.type.2' : '상류 공급 상품',
'commodity.checkProductDetail.card.4.isCrossBorder' : '국제 전자상거래 수입 상품:',
'commodity.checkProductDetail.card.title5': '상품 속성',
'commodity.checkProductDetail.card5.tab': '가격 속성',
'commodity.checkProductDetail.card5.tab.p.1': '측정 단위:',
......
......@@ -197,6 +197,8 @@ export default {
'commodity.products.addProducts.onSave.error.2' : '请完善商品其他信息!',
'commodity.products.addProducts.onSave.error.3' : '商品价格为必填项!',
'commodity.products.addProducts.onSave.error.4' : '商品积分为必填项!',
'commodity.products.addProducts.onSave.error.5' : '请重新上传商品图片!',
'commodity.products.addProducts.onSave.error.6' : '请上传商品图片!',
'commodity.products.addProducts.back' : '返回',
'commodity.products.addProducts.title.1' : '编辑商品',
'commodity.products.addProducts.title.2' : '新建商品',
......@@ -421,6 +423,7 @@ export default {
'commodity.products.viewProducts.constructTableData.planPrice.1' : '积分(副单位)',
'commodity.products.viewProducts.constructTableData.planPrice.2' : '单价(副单位)',
'commodity.products.viewProducts.constructTableData.priceRate' : '副单价率',
'commodity.products.viewProducts.constructTableData.hsCode' : 'HS编码',
'commodity.products.viewProducts.renderMoreList' : '展开',
'commodity.products.viewProducts.card.1.title' : '流程进度',
'commodity.products.viewProducts.card.1.step.1' : '新建商品',
......@@ -449,6 +452,10 @@ export default {
'commodity.products.viewProducts.card.4.marks' : '唛头:',
'commodity.products.viewProducts.card.4.packing' : '包装清单:',
'commodity.products.viewProducts.card.4.afterService' : '售后服务:',
'commodity.products.viewProducts.card.4.type' : '商品类型:',
'commodity.products.viewProducts.card.4.type.1' : '自营商品',
'commodity.products.viewProducts.card.4.type.2' : '上游供应商品',
'commodity.products.viewProducts.card.4.isCrossBorder' : '跨境电商进口商品:',
'commodity.products.viewProducts.card.5.title' : '商品属性',
'commodity.products.viewProducts.card.5.tab.1' : '价格属性',
'commodity.products.viewProducts.card.5.tab.1.unitName' : '计量单位:',
......@@ -854,6 +861,7 @@ export default {
'commodity.products.constant.deliveryTypeLabel.1' : '物流(默认)',
'commodity.products.constant.deliveryTypeLabel.2' : '自提',
'commodity.products.constant.deliveryTypeLabel.3' : '无需配送',
'commodity.products.constant.deliveryTypeLabel.4' : '物流+自提',
'commodity.products.constant.carriageTypeLabel.1' : '卖家承担运费(默认)',
'commodity.products.constant.carriageTypeLabel.2' : '买家承担运费',
'commodity.products.constant.opeartionLabel.1' : '提交审核',
......@@ -1009,6 +1017,7 @@ export default {
'commodity.checkProductDetail.deliveryType.1': '物流(默认)',
'commodity.checkProductDetail.deliveryType.2': '自提',
'commodity.checkProductDetail.deliveryType.3': '无需配送',
'commodity.checkProductDetail.deliveryType.4': '物流+自提',
'commodity.checkProductDetail.carriageType.1': '卖家承担运费(默认)',
'commodity.checkProductDetail.carriageType.2': '买家承担运费',
'commodity.checkProductDetail.constructTableData.productName.title': '商品名称',
......@@ -1031,6 +1040,7 @@ export default {
'commodity.checkProductDetail.constructTableData.temp.4': '单价',
'commodity.checkProductDetail.constructTableData.temp.5': '副单价率',
'commodity.checkProductDetail.constructTableData.temp.6': '副单价',
'commodity.checkProductDetail.constructTableData.hsCode': 'HS 编码',
'commodity.checkProductDetail.renderMoreList.display': '展开',
'commodity.checkProductDetail.shangpinshenhe': '商品审核',
'commodity.checkProductDetail.card.title1': '流程进度',
......@@ -1063,6 +1073,10 @@ export default {
'commodity.checkProductDetail.card4.p.3': '唛头:',
'commodity.checkProductDetail.card4.p.4': '包装清单:',
'commodity.checkProductDetail.card4.p.5': '售后服务:',
'commodity.checkProductDetail.card.4.type' : '商品类型:',
'commodity.checkProductDetail.card.4.type.1' : '自营商品',
'commodity.checkProductDetail.card.4.type.2' : '上游供应商品',
'commodity.checkProductDetail.card.4.isCrossBorder' : '跨境电商进口商品:',
'commodity.checkProductDetail.card.title5': '商品属性',
'commodity.checkProductDetail.card5.tab': '价格属性',
'commodity.checkProductDetail.card5.tab.p.1': '计量单位:',
......
......@@ -99,6 +99,7 @@ const AddProducts: React.FC<{}> = (props) => {
keywords: data.keywords,
description: data.description,
type: data.type,
isCrossBorder: data.isCrossBorder,
createTime: data.createTime,
})
setProductName(data?.name)
......@@ -277,7 +278,7 @@ const AddProducts: React.FC<{}> = (props) => {
_params.unitPriceAndPicList = priceAttributeParams.map((item, index) => {
const pic = productInfoByEdit.unitPriceAndPicList[index]?.commodityPic
if (!pic) {
throw new Error('请重新上传商品图片!')
throw new Error(intl.formatMessage({ id: 'commodity.products.addProducts.onSave.error.5'}))
}
return {
id: item.id,
......@@ -285,12 +286,13 @@ const AddProducts: React.FC<{}> = (props) => {
attributeAndValueList: item.attributeAndValueList,
unitPrice: item.unitPrice,
priceRate: item.priceRate,
commodityPic: pic
commodityPic: pic,
hsCode: item.hsCode,
}
})
}
} else {
throw new Error('请上传商品图片!')
throw new Error(intl.formatMessage({ id: 'commodity.products.addProducts.onSave.error.6'}))
}
} catch (e) {
return e
......
......@@ -33,7 +33,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
const [banCarriageType, setBanCarriageType] = useState(false)
const [template, setTemplate] = useState(false) // 是否必填运费模板
const { productInfoByEdit, selectCategoryId, productPriceType, isCrossProduct } = ProductStore
const { productInfoByEdit, selectCategoryId, productPriceType, isCrossBorder } = ProductStore
useEffect(() => {
//传入ref给父级
......@@ -90,18 +90,20 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
}, [productPriceType])
useEffect(() => {
if(isCrossProduct) {
if(isCrossBorder) {
logisticsForm.setFieldsValue({ deliveryType: 1 })
changeDeliveryType({target: { value: 1 }})
}
}, [isCrossProduct])
}, [isCrossBorder])
const changeDeliveryType = (e) => {
setDeliveryType(e.target.value)
setCarriageType(1)
setIsTemplate(false)
// @todo 跨境商品类型编辑 进入这里会充值物流信息表单 导致数据无法回显
logisticsForm.resetFields()
// 跨境商品类型编辑 不重置表单
if(!isCrossBorder || !history.location.query?.id) {
logisticsForm.resetFields()
}
logisticsForm.setFieldsValue({ deliveryType: e.target.value })
logisticsForm.setFieldsValue({ carriageType: 1 })
}
......@@ -145,7 +147,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
},
]}
>
<Radio.Group onChange={changeDeliveryType} disabled={isCrossProduct}>
<Radio.Group onChange={changeDeliveryType} disabled={isCrossBorder}>
<Radio value={1}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.logisticsForm.form.deliveryType.option.1' })}</Radio>
<Radio value={2}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.logisticsForm.form.deliveryType.option.2' })}</Radio>
<Radio value={3}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.logisticsForm.form.deliveryType.option.3' })}</Radio>
......
......@@ -79,8 +79,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
tabClickItem,
setProductPriceType,
isRecombination,
isCrossProduct,
setIsCrossProduct
isCrossBorder,
setIsCrossBorder
} = ProductStore
useEffect(() => {
......@@ -113,6 +113,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
handleAssistUnitSearch(getPriceAttributeFormParamsByEdit.subUnitName)
setMinOrderNumber(productInfoByEdit?.minOrder)
priceForm.setFieldsValue(getPriceAttributeFormParamsByEdit)
setIsCrossBorder(productInfoByEdit?.isCrossBorder)
setCombineAttributeChangeFatories(productInfoByEdit?.unitPriceAndPicList.length)
}
return () => {
......@@ -140,7 +141,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
*/
useEffect(() => {
constructedCallback()
}, [productName, selectedGoods, productSelectAttribute, planPrice, clearPrice.current, isCrossProduct])
}, [productName, selectedGoods, productSelectAttribute, planPrice, clearPrice.current, isCrossBorder])
useEffect(() => {
if (clearPrice.current) {
constructedCallback()
......@@ -256,7 +257,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
// 跨境商品的HS编码
if(isCrossProduct) {
if(isCrossBorder) {
_col.push({
title: intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' }),
dataIndex: intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' }),
......@@ -355,6 +356,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
} else {
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })] = {}
}
const hsCode = productInfoByEdit.unitPriceAndPicList[i]?.hsCode
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' })] = hsCode
} else {
if (_tableDataSource[i] && tableDataSource[i] && tableDataSource[i][intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })]) {
let unitPric = _tableDataSource[i] && tableDataSource[i] && tableDataSource[i][intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })]
......@@ -369,10 +372,13 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
} else {
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })] = {}
}
let hsCode = _tableDataSource[i] && tableDataSource[i] && tableDataSource[i][intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' })]
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' })] = hsCode
}
} else {
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.goodsName' })] = selectedGoods.length > 0 ? selectedGoods[0].id : 0
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })] = _tableDataSource[i] && tableDataSource[i] && tableDataSource[i][intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })] || {}
_tempObj[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' })] = _tableDataSource[i] && tableDataSource[i] && tableDataSource[i][intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.hsCode' })] || null
}
// 价格属性变动引发的构建清空价格(仅清空一次)
if (clearPrice.current) {
......@@ -408,7 +414,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
_tableDataSource.map(item => item[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })] = {})
}
}
// console.log(_tableDataSource, '_tableDataSource')
console.log(_tableDataSource, '_tableDataSource')
setTableDataSource(productName ? _tableDataSource : []) // 通过商品名称来判断是否显示表格数据
constructedPrarams()
......@@ -476,7 +482,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
hsCode: _tableDataSource[0] && _tableDataSource[0]['HS编码'],
}) /*带上货品id 带上单价*/ /* code1 end */
setPriceAttributeParams(_paramsArray)
// console.log(_paramsArray, '_paramsArray')
console.log(_paramsArray, '_paramsArray')
}
/**
......@@ -671,14 +677,17 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const onChangeProductType = (e) => {
const value = e.target.value
setProductType(value)
priceForm.setFieldsValue({type: value})
if(value === 2) {
setIsCrossProduct(false)
setIsCrossBorder(false)
priceForm.setFieldsValue({isCrossBorder: false})
}
}
const onChangeCrossProduct = (e) => {
const value = e.target.value
setIsCrossProduct(value)
setIsCrossBorder(value)
priceForm.setFieldsValue({isCrossBorder: value})
if(value) {
priceForm.setFieldsValue({ priceType: 1 })
handlePlanPriceChange({target:{value: 1}})
......@@ -831,10 +840,10 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
</Tooltip>
</span>
}
valuePropName="checked"
// valuePropName="checked"
initialValue={1}
>
<Radio.Group onChange={onChangeProductType} value={productType}>
<Radio.Group onChange={onChangeProductType}>
<Radio value={1}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.type.radio1' })}</Radio>
<Radio value={2}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.type.radio2' })}</Radio>
</Radio.Group>
......@@ -849,10 +858,10 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
</Tooltip>
</span>
}
valuePropName="checked"
// valuePropName="checked"
initialValue={false}
>
<Radio.Group onChange={onChangeCrossProduct} value={isCrossProduct} disabled={productType === 2}>
<Radio.Group onChange={onChangeCrossProduct} disabled={productType === 2}>
<Radio value={true}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isCrossBorder.radio1' })}</Radio>
<Radio value={false}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isCrossBorder.radio2' })}</Radio>
</Radio.Group>
......@@ -876,13 +885,13 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
{
history.location.query?.id ? <Radio.Group onChange={handlePlanPriceChange} disabled={!productInfoByEdit.isUpdateAttribute}>
<Radio value={1}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.1' })}</Radio>
<Radio value={2} disabled={isCrossProduct}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.2' })}</Radio>
<Radio value={3} disabled={isCrossProduct}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.3' })}</Radio>
<Radio value={2} disabled={isCrossBorder}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.2' })}</Radio>
<Radio value={3} disabled={isCrossBorder}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.3' })}</Radio>
<Radio value={4}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.4' })}</Radio>
</Radio.Group> : <Radio.Group onChange={handlePlanPriceChange}>
<Radio value={1}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.1' })}</Radio>
<Radio value={2} disabled={isCrossProduct}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.2' })}</Radio>
<Radio value={3} disabled={isCrossProduct}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.3' })}</Radio>
<Radio value={2} disabled={isCrossBorder}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.2' })}</Radio>
<Radio value={3} disabled={isCrossBorder}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.3' })}</Radio>
<Radio value={4}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.4' })}</Radio>
</Radio.Group>
}
......
......@@ -249,6 +249,7 @@ const CheckProductDetail: React.FC<{}> = () => {
if (type === 1) return intl.formatMessage({ id: 'commodity.checkProductDetail.deliveryType.1' })
else if (type === 2) return intl.formatMessage({ id: 'commodity.checkProductDetail.deliveryType.2' })
else if (type === 3) return intl.formatMessage({ id: 'commodity.checkProductDetail.deliveryType.3' })
else if (type === 4) return intl.formatMessage({ id: 'commodity.checkProductDetail.deliveryType.4' })
else return null
}
......@@ -293,6 +294,14 @@ const CheckProductDetail: React.FC<{}> = () => {
})
}
}
// 跨境商品 HS编码
if(product['isCrossBorder']) {
_col.push({
title: intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.hsCode' }),
dataIndex: intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.hsCode' }),
key: intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.hsCode' }),
})
}
_col.push({
title: product['priceType'] === 3 ? intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.price.title1' }) : intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.price.title2' }),
dataIndex: intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.price.dataIndex' }),
......@@ -346,6 +355,7 @@ const CheckProductDetail: React.FC<{}> = () => {
[intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.temp.2' })]: product['name'],
[intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.temp.3' })]: item.goods?.code + '/' + item.goods?.name + '/' + item.goods?.type,
...attrWithObj,
[intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.hsCode' })]: item.hsCode,
[intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.temp.4' })]: _price,
[intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.temp.5' })]: _priceRate,
[intl.formatMessage({ id: 'commodity.checkProductDetail.constructTableData.temp.6' })]: Array.isArray(_priceNumber) ? _priceNumber.map(_p => (Number(_p) * Number(_priceRate) / 100).toFixed(2)) : (Number(_priceNumber) * Number(_priceRate) / 100).toFixed(2)
......@@ -414,7 +424,7 @@ const CheckProductDetail: React.FC<{}> = () => {
{
str === 'area'
?
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName + '/' + (_item.cityName || '')}</p>)
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName + '/' + (_item.cityName || '') + (_item.regionName ? `/${_item.regionName}` : '')}</p>)
:
showDataSource.map((_item, _i) => <p key={_i}>{_item.name}</p>)
}
......@@ -583,10 +593,18 @@ const CheckProductDetail: React.FC<{}> = () => {
<Card headStyle={{ borderBottom: 'none' }} title={intl.formatMessage({ id: 'commodity.checkProductDetail.card.title4' })} style={{ height: '320px' }}>
<Row>
<Col span={4}>
<p>{intl.formatMessage({ id: 'commodity.checkProductDetail.card4.p.1' })}</p>
<p>{intl.formatMessage({ id: 'commodity.checkProductDetail.card.4.type' })}</p>
</Col>
<Col span={20}>
<p>{productDetail?.type === 1 ? intl.formatMessage({ id: 'commodity.checkProductDetail.card.4.type.1' }) : intl.formatMessage({ id: 'commodity.checkProductDetail.card.4.type.2' })}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p>{intl.formatMessage({ id: 'commodity.checkProductDetail.card.4.isCrossBorder' })}</p>
</Col>
<Col span={20}>
<p>{productDetail?.isInvoice ? intl.formatMessage({ id: 'commodity.checkProductDetail.card4.p.shi' }) : intl.formatMessage({ id: 'commodity.checkProductDetail.card4.p.fou' })}</p>
<p>{productDetail?.isCrossBorder ? intl.formatMessage({ id: 'common.button.yes' }) : intl.formatMessage({ id: 'common.button.no' })}</p>
</Col>
</Row>
<Row>
......
......@@ -56,6 +56,7 @@ export const deliveryTypeLabel = [
getIntl().formatMessage({ id: 'commodity.products.constant.deliveryTypeLabel.1' }),
getIntl().formatMessage({ id: 'commodity.products.constant.deliveryTypeLabel.2' }),
getIntl().formatMessage({ id: 'commodity.products.constant.deliveryTypeLabel.3' }),
getIntl().formatMessage({ id: 'commodity.products.constant.deliveryTypeLabel.4' }),
]
/** 商品运费类型 */
......
......@@ -164,6 +164,14 @@ const viewProducts: React.FC<{}> = () => {
})
}
}
// 跨境商品 HS编码
if(product?.isCrossBorder) {
_col.push({
title: intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.hsCode' }),
dataIndex: intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.hsCode' }),
key: intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.hsCode' }),
})
}
_col.push({
title: product?.priceType === 3 ? intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.unitPrice.1' }) : intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.unitPrice.2' }),
dataIndex: intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.unitPrice' }),
......@@ -210,15 +218,15 @@ const viewProducts: React.FC<{}> = () => {
const _price = orderlyLadderPrice(item.unitPrice)
const _priceRate = item.priceRate
const _priceNumber = Object.keys(_price)[0] === '0-0' ? Object.values(_price)[0] : Object.values(_price)
let temp = {
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.index' })]: index,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.commodityName' })]: product.name,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.goodsName' })]: item.goods?.code + '/' + item.goods?.name + '/' + item.goods?.type,
...attrWithObj,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.hsCode' })]: item.hsCode,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.unitPrice' })]: _price,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.planPrice' })]: _priceRate,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.priceRate' })]: Array.isArray(_priceNumber) ? _priceNumber.map(_p => (Number(_p) * Number(_priceRate) / 100).toFixed(2)) : (Number(_priceNumber) * Number(_priceRate) / 100).toFixed(2)
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.priceRate' })]: _priceRate,
[intl.formatMessage({ id: 'commodity.products.viewProducts.constructTableData.planPrice' })]: Array.isArray(_priceNumber) ? _priceNumber.map(_p => (Number(_p) * Number(_priceRate) / 100).toFixed(2)) : (Number(_priceNumber) * Number(_priceRate) / 100).toFixed(2)
}
return temp
})
......@@ -248,7 +256,7 @@ const viewProducts: React.FC<{}> = () => {
{
str === 'area'
?
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName + '/' + (_item.cityName || '')}</p>)
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName + '/' + (_item.cityName || '') + (_item.regionName ? `/${_item.regionName}` : '')}</p>)
:
showDataSource.map((_item, _i) => <p key={_i}>{_item.name}</p>)
}
......@@ -410,14 +418,22 @@ const viewProducts: React.FC<{}> = () => {
</Col>
<Col span={8}>
<Card headStyle={{ borderBottom: 'none' }} title={intl.formatMessage({ id: 'commodity.products.viewProducts.card.4.title' })} style={{ height: '100%' }}>
{/* <Row>
<Row>
<Col span={4}>
<p>提供发票:</p>
<p>{intl.formatMessage({ id: 'commodity.products.viewProducts.card.4.type' })}</p>
</Col>
<Col span={20}>
<p>{productDetail?.isInvoice?'是':'否'}</p>
<p>{productDetail?.type === 1 ? intl.formatMessage({ id: 'commodity.products.viewProducts.card.4.type.1' }) : intl.formatMessage({ id: 'commodity.products.viewProducts.card.4.type.2' })}</p>
</Col>
</Row> */}
</Row>
<Row>
<Col span={4}>
<p>{intl.formatMessage({ id: 'commodity.products.viewProducts.card.4.isCrossBorder' })}</p>
</Col>
<Col span={20}>
<p>{productDetail?.isCrossBorder ? intl.formatMessage({ id: 'common.button.yes' }) : intl.formatMessage({ id: 'common.button.no' })}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p>{intl.formatMessage({ id: 'commodity.products.viewProducts.card.4.taxRate' })}</p>
......
......@@ -31,7 +31,7 @@ class ProductStore implements IProductModule {
@observable public tabClickItem: any[] = []; // tab标签页点击项
@observable public productPriceType: any = null; // 商品价格类型
@observable public isRecombination: boolean = false; // 编辑时 是否重新属性组合
@observable public isCrossProduct: boolean = false; // 跨境商品
@observable public isCrossBorder: boolean = false; // 跨境商品
/** 计算操作 **/
// 加工接口返回的数据,用户编辑回显数据
......@@ -163,27 +163,28 @@ class ProductStore implements IProductModule {
this.selectBrandId = null;
this.productPriceType = null;
this.isRecombination = false;
this.isCrossBorder = false;
}
// 编辑时 品类变更 清空部分数据
@action.bound
public clearPartData(data?: any[]) {
this.productInfoByEdit.unitId = null;
this.productInfoByEdit.unitName = null;
this.productInfoByEdit.subUnitId = null;
this.productInfoByEdit.subUnitName = null;
this.productInfoByEdit.minOrder = null;
this.productInfoByEdit.isMemberPrice = false;
this.productInfoByEdit.priceType = 1;
this.productInfoByEdit.commodityAttributeList = [];
this.productInfoByEdit.unitPriceAndPicList = [];
this.productInfoByEdit.isAllAttributePic = true;
this.productInfoByEdit.commodityRemark = {};
this.productInfoByEdit.logistics = {deliveryType:1, carriageType: 1};
this.productInfoByEdit.isInvoice = null;
this.productInfoByEdit.marks = null;
this.productInfoByEdit.packing = null;
this.productInfoByEdit.afterService = null;
this.productInfoByEdit.unitId = null;
this.productInfoByEdit.unitName = null;
this.productInfoByEdit.subUnitId = null;
this.productInfoByEdit.subUnitName = null;
this.productInfoByEdit.minOrder = null;
this.productInfoByEdit.isMemberPrice = false;
this.productInfoByEdit.priceType = 1;
this.productInfoByEdit.commodityAttributeList = [];
this.productInfoByEdit.unitPriceAndPicList = [];
this.productInfoByEdit.isAllAttributePic = true;
this.productInfoByEdit.commodityRemark = {};
this.productInfoByEdit.logistics = {deliveryType:1, carriageType: 1};
this.productInfoByEdit.isInvoice = null;
this.productInfoByEdit.marks = null;
this.productInfoByEdit.packing = null;
this.productInfoByEdit.afterService = null;
}
@action.bound
......@@ -238,8 +239,8 @@ class ProductStore implements IProductModule {
// 是否跨境商品
@action.bound
public setIsCrossProduct(data: boolean) {
this.isCrossProduct = data
public setIsCrossBorder(data: boolean) {
this.isCrossBorder = data
}
}
......
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