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

fix:

parent 52088727
...@@ -182,7 +182,7 @@ const AddAtttribute: React.FC<{}> = () => { ...@@ -182,7 +182,7 @@ const AddAtttribute: React.FC<{}> = () => {
}, },
]} ]}
> >
<Input placeholder="输入属性组名" disabled={isSee} /> <Input maxLength={10} placeholder="输入属性组名" disabled={isSee} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={18}> <Col span={18}>
...@@ -204,7 +204,7 @@ const AddAtttribute: React.FC<{}> = () => { ...@@ -204,7 +204,7 @@ const AddAtttribute: React.FC<{}> = () => {
}, },
]} ]}
> >
<Input placeholder="输入属性名称" disabled={isSee} /> <Input maxLength={10} placeholder="输入属性名称" disabled={isSee} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={18}> <Col span={18}>
......
...@@ -28,7 +28,13 @@ export const classSchema: ISchema = { ...@@ -28,7 +28,13 @@ export const classSchema: ISchema = {
required: true, required: true,
"x-component-props": { "x-component-props": {
placeholder: '请输入品类名称' placeholder: '请输入品类名称'
} },
"x-rules": [
{
limitByte: true,
maxByte: 16
}
]
}, },
type: { type: {
type: 'number', type: 'number',
......
...@@ -204,7 +204,7 @@ const AddPropertyValue: React.FC<{}> = () => { ...@@ -204,7 +204,7 @@ const AddPropertyValue: React.FC<{}> = () => {
}, },
]} ]}
> >
<Input placeholder="输入属性值名称" disabled={isSee} /> <Input maxLength={12} placeholder="输入属性值名称" disabled={isSee} />
</Form.Item> </Form.Item>
} }
{ {
......
...@@ -242,7 +242,7 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -242,7 +242,7 @@ const DirectChannel: React.FC<{}> = () => {
} }
} }
// 判断所选商品 priceType, source, status一致 // 判断所选商品 priceType, ?source, status一致
const judgeType = () => { const judgeType = () => {
// let sourceArr = Array.from(new Set(selectRow.map((item:any) => item.channelCommodity.source))) // let sourceArr = Array.from(new Set(selectRow.map((item:any) => item.channelCommodity.source)))
let priceTypeArr = Array.from(new Set(selectRow.map((item:any) => item.channelCommodity.commodity.priceType))) let priceTypeArr = Array.from(new Set(selectRow.map((item:any) => item.channelCommodity.commodity.priceType)))
...@@ -341,7 +341,7 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -341,7 +341,7 @@ const DirectChannel: React.FC<{}> = () => {
}else{ }else{
if(isUp){ if(isUp){
if(checkedValues.length > 0){ if(checkedValues.length > 0){
PublicApi.postProductChannelCommodityPublishCommodity(params).then(res => { PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp}).then(res => {
setUpDownModal(false) setUpDownModal(false)
ref.current.reload() ref.current.reload()
setIsDisabledOKbtn(false) setIsDisabledOKbtn(false)
...@@ -351,7 +351,7 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -351,7 +351,7 @@ const DirectChannel: React.FC<{}> = () => {
message.error('请选择需要上架的渠道商城') message.error('请选择需要上架的渠道商城')
} }
}else{ }else{
PublicApi.postProductChannelCommodityPublishCommodity(params).then(res => { PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp}).then(res => {
setUpDownModal(false) setUpDownModal(false)
ref.current.reload() ref.current.reload()
setIsDisabledOKbtn(false) setIsDisabledOKbtn(false)
......
...@@ -25,14 +25,25 @@ const AddRule:React.FC<{}> = (props) => { ...@@ -25,14 +25,25 @@ const AddRule:React.FC<{}> = (props) => {
// 整体表单提交 // 整体表单提交
const formSubmit = async (values) => { const formSubmit = async (values) => {
values.products = values.products.map(item => ({ productId: item.id, productName: item.name, category: item.customerCategoryName, productPrice: item.priceType, brand: item.brandName })) console.log(values)
values.products = values.products.map(item => ({
productId: item.id,
commodityId: item.commodityId,
name: item.name,
customerCategoryName: item.customerCategoryName,
priceType: item.priceType,
brandName: item.brandName
}))
values.isElectronicContract = values.isElectronicContract ? 1 : 0 values.isElectronicContract = values.isElectronicContract ? 1 : 0
const params = omit(values, ['state']) // 移除不需要的字段 const params = omit(values, ['state']) // 移除不需要的字段
console.log(params, 'params') if(pageStatus === PageStatus.EDIT){
// await PublicApi.postOrderTradingRulesAdd(params) await PublicApi.postOrderTradingRulesUpdata(params)
// setTimeout(() => { }else if(pageStatus === PageStatus.ADD){
// history.goBack(-1) await PublicApi.postOrderTradingRulesAdd(params)
// }, 1000) }
setTimeout(() => {
history.goBack(-1)
}, 1000)
} }
return ( return (
......
...@@ -34,7 +34,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -34,7 +34,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const [visibleChannelRroduct, setVisibleChannelRroduct] = useState(false) const [visibleChannelRroduct, setVisibleChannelRroduct] = useState(false)
const [productRowSelection, productRowCtl] = useRowSelectionTable({customKey: 'id'}) const [productRowSelection, productRowCtl] = useRowSelectionTable({customKey: 'id'})
const [productsLength, setProductsLength] = useState(0) const [productsLength, setProductsLength] = useState(0)
const [initValue, setInitialValue] = useState({}); const [initValue, setInitialValue] = useState({})
const { const {
id, id,
...@@ -47,7 +47,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -47,7 +47,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
if(shopIds.length){ if(shopIds.length){
let shopInfo: any = GlobalConfig.web.shopInfo.filter(item => item.id === shopIds[0]) let shopInfo: any = GlobalConfig.web.shopInfo.filter(item => item.id === shopIds[0])
const res = await PublicApi.getProductCommodityCommonGetCommodityDetailList({ const res = await PublicApi.getProductCommodityCommonGetCommodityListBySeller({
...params, ...params,
shopType: shopInfo[0].type, shopType: shopInfo[0].type,
environment: shopInfo[0].environment, environment: shopInfo[0].environment,
...@@ -66,11 +66,6 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -66,11 +66,6 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
} }
const handleAddProductBtn = () => { const handleAddProductBtn = () => {
// const transactionProcesss = addSchemaAction.getFieldValue('transactionProcesssId')
// if (!transactionProcesss) {
// message.error('请先选择交易流程')
// return false
// }
const checkBoxs = addSchemaAction.getFieldValue('products') const checkBoxs = addSchemaAction.getFieldValue('products')
productRowCtl.setSelectedRowKeys(checkBoxs.map(v => v.id)) productRowCtl.setSelectedRowKeys(checkBoxs.map(v => v.id))
productRowCtl.setSelectRow(checkBoxs) productRowCtl.setSelectRow(checkBoxs)
...@@ -78,7 +73,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -78,7 +73,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
} }
// 新增商品 // 新增商品
const tableAddButton = <Button style={{marginBottom: 16}} block icon={<PlusOutlined/>} onClick={handleAddProductBtn} type='dashed'>选择指定商品</Button> const tableAddButton = <Button style={{marginBottom: 16}} block icon={<PlusOutlined/>} disabled={pageStatus === PageStatus.PREVIEW} onClick={handleAddProductBtn} type='dashed'>选择指定商品</Button>
const tableColumns = [ const tableColumns = [
{ {
...@@ -90,7 +85,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -90,7 +85,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
dataIndex: 'name', dataIndex: 'name',
title: '商品名称', title: '商品名称',
key: 'name', key: 'name',
render: (_, record) => <EyePreview url={`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${record.id}`}>{_}</EyePreview> render: (_, record) => <EyePreview url={`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${record.commodityId}`}>{_}</EyePreview>
}, },
{ {
dataIndex: 'customerCategoryName', dataIndex: 'customerCategoryName',
...@@ -118,7 +113,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -118,7 +113,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
{ {
dataIndex: 'ctl', dataIndex: 'ctl',
title: '操作', title: '操作',
render: (_, record) => <Button type='link' onClick={() => handleDeleteTable(record.id)}>删除</Button> render: (_, record) => <Button type='link' disabled={pageStatus === PageStatus.PREVIEW} onClick={() => handleDeleteTable(record.id)}>删除</Button>
} }
] ]
...@@ -249,6 +244,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -249,6 +244,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
setProductsLength(res.totalCount); setProductsLength(res.totalCount);
} }
addSchemaAction.setFieldValue('isElectronicContract', data?.isElectronicContract ? true : false) addSchemaAction.setFieldValue('isElectronicContract', data?.isElectronicContract ? true : false)
addSchemaAction.setFieldValue('transactionProcesssId', data?.transactionProcesssId)
addSchemaAction.setFieldValue('isTacitlyApprove', data?.isTacitlyApprove) addSchemaAction.setFieldValue('isTacitlyApprove', data?.isTacitlyApprove)
setInitialValue(data) setInitialValue(data)
} }
...@@ -259,7 +255,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -259,7 +255,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// 拿到绑定的商品 // 拿到绑定的商品
const getBindingProducts = async ({id = '1', current = '1', pageSize = '10'}) => { const getBindingProducts = async ({id = '1', current = '1', pageSize = '10'}) => {
const res = await PublicApi.getOrderTradingRulesProductList({tradingRulesId: id, current, pageSize}); const res = await PublicApi.getOrderTradingRulesProductList({tradingRulesId: id, current, pageSize, name: null});
return res.data return res.data
} }
...@@ -295,6 +291,11 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -295,6 +291,11 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
state.visible = parentState.value state.visible = parentState.value
}) })
}) })
$('onFieldValueChange', 'shopIds').subscribe(parentState => {
setFieldState('isTacitlyApprove', state => {
state.value = 1
})
})
}} }}
onSubmit={handleSubmit} onSubmit={handleSubmit}
actions={addSchemaAction} actions={addSchemaAction}
......
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