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

feat: 新增商品为跨境类型可输入HS编码

parent 5a4a729e
......@@ -37,10 +37,10 @@ interface Iprops {
}
interface AreaParams {
provinceCode: any;
provinceName: any;
cityCode: any;
cityName: any;
provinceCode: string;
provinceName: string;
cityCode: string;
cityName: string;
}
const BasicInfoForm: React.FC<Iprops> = (props) => {
......@@ -121,14 +121,14 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
}, [getBasicFormParamsByEdit])
const handleBrandSearch = (value?: any) => {
const handleBrandSearch = (value?: string) => {
getProductSelectGetSelectBrand({ name: value || '' }).then(res => {
if (res.code === 1000)
setBrandData(res.data)
})
}
const handleBrandChange = (value: any) => {
const handleBrandChange = (value) => {
setBrandValue(value)
setSelectBrandId(value)
}
......@@ -143,7 +143,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
)
}
const onCustomerCategoryChange = (value: any) => {
const onCustomerCategoryChange = (value) => {
let seletCategoryId = value[value.length - 1]
if (seletCategoryId) {
getProductCustomerGetCustomerCategoryById({ id: seletCategoryId }).then(res => {
......@@ -158,7 +158,8 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
setShowCategory(null)
}
const onCommodityAreaChange = (value: any, selected: any) => {
const onCommodityAreaChange = (value, selected) => {
console.log(selected, 'selected')
let areaParams: AreaParams = {
provinceCode: null,
provinceName: null,
......@@ -173,7 +174,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
}
const onChangeName = (value: any) => {
const onChangeName = (value) => {
setProductName(value)
}
......@@ -222,7 +223,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
},
]}
>
<Input placeholder={intl.formatMessage({ id: 'commodity.products.addProductsItem.basicInfoForm.form.customerCategoryName.placeholder' })} disabled={history.location.query?.id} defaultValue={productInfoByEdit.customerCategory.fullName} />
<Input placeholder={intl.formatMessage({ id: 'commodity.products.addProductsItem.basicInfoForm.form.customerCategoryName.placeholder' })} disabled={!!history.location.query?.id} defaultValue={productInfoByEdit.customerCategory.fullName} />
</Form.Item>
:
<Form.Item
......@@ -237,7 +238,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
>
<Cascader
allowClear={false}
disabled={history.location.query?.id}
disabled={!!history.location.query?.id}
options={customerCategoryTree}
fieldNames={{ label: 'title', value: 'id', children: 'children' }}
onChange={onCustomerCategoryChange}
......
......@@ -33,7 +33,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
const [banCarriageType, setBanCarriageType] = useState(false)
const [template, setTemplate] = useState(false) // 是否必填运费模板
const { productInfoByEdit, selectCategoryId, productPriceType } = ProductStore
const { productInfoByEdit, selectCategoryId, productPriceType, isCrossProduct } = ProductStore
useEffect(() => {
//传入ref给父级
......@@ -85,6 +85,12 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
}
}, [productPriceType])
useEffect(() => {
if(isCrossProduct) {
logisticsForm.setFieldsValue({ deliveryType: 1 })
}
}, [isCrossProduct])
const changeDeliveryType = (e) => {
setDeliveryType(e.target.value)
setCarriageType(1)
......@@ -133,7 +139,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
},
]}
>
<Radio.Group onChange={changeDeliveryType}>
<Radio.Group onChange={changeDeliveryType} disabled={isCrossProduct}>
<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>
......
......@@ -31,6 +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; // 跨境商品
/** 计算操作 **/
// 加工接口返回的数据,用户编辑回显数据
......@@ -234,6 +235,12 @@ class ProductStore implements IProductModule {
this.isRecombination = data
}
// 是否跨境商品
@action.bound
public setIsCrossProduct(data: boolean) {
this.isCrossProduct = data
}
}
export default ProductStore
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