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

fix:

parent 52088727
......@@ -182,7 +182,7 @@ const AddAtttribute: React.FC<{}> = () => {
},
]}
>
<Input placeholder="输入属性组名" disabled={isSee} />
<Input maxLength={10} placeholder="输入属性组名" disabled={isSee} />
</Form.Item>
</Col>
<Col span={18}>
......@@ -204,7 +204,7 @@ const AddAtttribute: React.FC<{}> = () => {
},
]}
>
<Input placeholder="输入属性名称" disabled={isSee} />
<Input maxLength={10} placeholder="输入属性名称" disabled={isSee} />
</Form.Item>
</Col>
<Col span={18}>
......
......@@ -28,7 +28,13 @@ export const classSchema: ISchema = {
required: true,
"x-component-props": {
placeholder: '请输入品类名称'
},
"x-rules": [
{
limitByte: true,
maxByte: 16
}
]
},
type: {
type: 'number',
......
......@@ -204,7 +204,7 @@ const AddPropertyValue: React.FC<{}> = () => {
},
]}
>
<Input placeholder="输入属性值名称" disabled={isSee} />
<Input maxLength={12} placeholder="输入属性值名称" disabled={isSee} />
</Form.Item>
}
{
......
......@@ -242,7 +242,7 @@ const DirectChannel: React.FC<{}> = () => {
}
}
// 判断所选商品 priceType, source, status一致
// 判断所选商品 priceType, ?source, status一致
const judgeType = () => {
// 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)))
......@@ -341,7 +341,7 @@ const DirectChannel: React.FC<{}> = () => {
}else{
if(isUp){
if(checkedValues.length > 0){
PublicApi.postProductChannelCommodityPublishCommodity(params).then(res => {
PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp}).then(res => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
......@@ -351,7 +351,7 @@ const DirectChannel: React.FC<{}> = () => {
message.error('请选择需要上架的渠道商城')
}
}else{
PublicApi.postProductChannelCommodityPublishCommodity(params).then(res => {
PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp}).then(res => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
......
......@@ -25,14 +25,25 @@ const AddRule:React.FC<{}> = (props) => {
// 整体表单提交
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
const params = omit(values, ['state']) // 移除不需要的字段
console.log(params, 'params')
// await PublicApi.postOrderTradingRulesAdd(params)
// setTimeout(() => {
// history.goBack(-1)
// }, 1000)
if(pageStatus === PageStatus.EDIT){
await PublicApi.postOrderTradingRulesUpdata(params)
}else if(pageStatus === PageStatus.ADD){
await PublicApi.postOrderTradingRulesAdd(params)
}
setTimeout(() => {
history.goBack(-1)
}, 1000)
}
return (
......
......@@ -34,7 +34,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const [visibleChannelRroduct, setVisibleChannelRroduct] = useState(false)
const [productRowSelection, productRowCtl] = useRowSelectionTable({customKey: 'id'})
const [productsLength, setProductsLength] = useState(0)
const [initValue, setInitialValue] = useState({});
const [initValue, setInitialValue] = useState({})
const {
id,
......@@ -47,7 +47,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
if(shopIds.length){
let shopInfo: any = GlobalConfig.web.shopInfo.filter(item => item.id === shopIds[0])
const res = await PublicApi.getProductCommodityCommonGetCommodityDetailList({
const res = await PublicApi.getProductCommodityCommonGetCommodityListBySeller({
...params,
shopType: shopInfo[0].type,
environment: shopInfo[0].environment,
......@@ -66,11 +66,6 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
}
const handleAddProductBtn = () => {
// const transactionProcesss = addSchemaAction.getFieldValue('transactionProcesssId')
// if (!transactionProcesss) {
// message.error('请先选择交易流程')
// return false
// }
const checkBoxs = addSchemaAction.getFieldValue('products')
productRowCtl.setSelectedRowKeys(checkBoxs.map(v => v.id))
productRowCtl.setSelectRow(checkBoxs)
......@@ -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 = [
{
......@@ -90,7 +85,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
dataIndex: 'name',
title: '商品名称',
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',
......@@ -118,7 +113,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
{
dataIndex: 'ctl',
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) => {
setProductsLength(res.totalCount);
}
addSchemaAction.setFieldValue('isElectronicContract', data?.isElectronicContract ? true : false)
addSchemaAction.setFieldValue('transactionProcesssId', data?.transactionProcesssId)
addSchemaAction.setFieldValue('isTacitlyApprove', data?.isTacitlyApprove)
setInitialValue(data)
}
......@@ -259,7 +255,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// 拿到绑定的商品
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
}
......@@ -295,6 +291,11 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
state.visible = parentState.value
})
})
$('onFieldValueChange', 'shopIds').subscribe(parentState => {
setFieldState('isTacitlyApprove', state => {
state.value = 1
})
})
}}
onSubmit={handleSubmit}
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