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

fix:

parent 90041bc7
......@@ -19,6 +19,7 @@ export interface IChannelProductModule {
selectedRole: IRole;
tableDataInSetPrice: GetProductChannelCommodityGetCommodityUnitPriceResponse[];
selectChannel: any[];
selectedSource: number;
setProductSelectRowInStore(data: any): void;
setProductSourceInStore(data: number): void;
......@@ -27,4 +28,5 @@ export interface IChannelProductModule {
setSelectedRole(data: IRole): void;
setTableDataInSetPrice(data: GetProductChannelCommodityGetCommodityUnitPriceResponse[]): void;
setSelectChannel(data: any): void;
setSelectSource(data: number): void;
}
\ No newline at end of file
......@@ -46,7 +46,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
const [selectProduct, setSelectProduct] = useState<GetProductChannelCommodityGetCommodityListResponseDetail[]>()
const { ChannelProudctStore } = store
const { setProductSourceInStore, setProductSelectRowInStore, setPriceType, setProductName } = ChannelProudctStore
const { setProductSourceInStore, setProductSelectRowInStore, setPriceType, setProductName, setSelectSource } = ChannelProudctStore
const productColumns: ColumnType<any>[] = [
{
......@@ -127,6 +127,10 @@ const SelectProduct:React.FC<IProps> = (props) => {
}, [])
useEffect(() => {
setSelectSource(source)
}, [source])
useEffect(() => {
console.log(productRowCtl.selectRow[0])
if(productRowCtl.selectRow.length>0){
setPriceType(productRowCtl.selectRow[0].priceType)
......
......@@ -67,6 +67,7 @@ const SetPrice:React.FC<IProps> = (props) => {
priceType,
productName,
productSelectRowInStore,
selectedSource,
setTableDataInSetPrice
} = ChannelProudctStore
......@@ -86,7 +87,7 @@ const SetPrice:React.FC<IProps> = (props) => {
// 获取商品规格列表
const fetchSpecData = (params?: any) => {
PublicApi.getProductChannelCommodityGetCommodityUnitPrice({id: productSelectRowInStore.id + ''}).then(res => {
PublicApi.getProductChannelCommodityGetCommodityUnitPrice({id: productSelectRowInStore.id + '', source: selectedSource}).then(res => {
const { data } = res
setOriginTableData(data)
if(data.length > 0)
......
......@@ -91,12 +91,12 @@ const DirectChannel: React.FC<{}> = () => {
},
{
title: '价格',
dataIndex: ['channelCommodity', 'commodity', 'min'],
dataIndex: 'min',
key: 'id',
render: (text:any, reocrd:any) => {
let min = reocrd.channelCommodity.commodity.min
let min = reocrd.min
let type = reocrd.channelCommodity.commodity.priceType
let max = reocrd.channelCommodity.commodity.max
let max = reocrd.max
if(type === 1){
if(max === min)
return <>{min}</>
......@@ -150,7 +150,7 @@ const DirectChannel: React.FC<{}> = () => {
},
{
title: '状态',
dataIndex: ['channelCommodity', 'status'],
dataIndex: 'status',
key: 'id',
render: (text:any, record:any) => {
let component: ReactNode = null
......@@ -169,14 +169,14 @@ const DirectChannel: React.FC<{}> = () => {
render: (text:any, record:any) => {
return (
<>
{(record.channelCommodity.status===5) ? <Button type='link' onClick={()=>clickUp(0, record.id)}>下架</Button> : ''}
{(record.channelCommodity.status===6) ?
{(record.status===5) ? <Button type='link' onClick={()=>clickUp(0, record.id)}>下架</Button> : ''}
{(record.status===6) ?
<>
<Button type='link' onClick={()=>clickUp(1, record.id)}>上架</Button>
<Button type='link' onClick={()=>clickModify(record)}>修改</Button>
</>
: ''}
{(record.channelCommodity.status===7) &&
{(record.status===7) &&
<>
<Button type='link' onClick={()=>clickUp(1, record.id)}>上架</Button>
<Dropdown overlay={
......@@ -247,7 +247,7 @@ const DirectChannel: React.FC<{}> = () => {
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)))
let statusArr = Array.from(new Set(selectRow.map((item:any) => item.channelCommodity.status)))
let statusArr = Array.from(new Set(selectRow.map((item:any) => item.status)))
return {
isPassJudge: sourceArr.length === 1 && priceTypeArr.length === 1 && statusArr.length ===1,
source: sourceArr,
......
......@@ -104,20 +104,35 @@ const ViewDriectChannel: React.FC<{}> = () => {
return <span style={{padding:'2px 5px',background:'rgba(244,245,247,1)',borderRadius:'4px'}}>已下架</span>
if(status === 7)
return <span style={{color:'#E63F3B',padding:'2px 5px',background:'rgba(255,235,230,1)',borderRadius:'4px'}}>未上架</span>
else
return null
}
const content = <>
<Descriptions colon={true} style={{marginTop:50}}>
<Descriptions.Item label="商品状态">{renderStatus(channelDetails?.channelCommodity?.status)}</Descriptions.Item>
<Descriptions.Item label="上级渠道">{channelDetails?.channelCommodity?.source === 1 && channelDetails?.channelCommodity?.parentMemberName}</Descriptions.Item>
<Descriptions.Item label="上架商城">
{
shopList.length>0 && shopList.map((item, index)=> item.isCheck && <span key={index}>{item.name}&nbsp;</span>)
renderStatus(channelDetails?.status) && <Descriptions.Item label="商品状态">{renderStatus(channelDetails?.status)}</Descriptions.Item>
}
{
channelDetails?.channelCommodity?.source === 1 && <Descriptions.Item label="上级渠道">{channelDetails?.channelCommodity?.parentMemberName}</Descriptions.Item>
}
{
channelDetails?.channelCommodity?.commodity?.customerCategory?.name && <Descriptions.Item label="商品品类">{channelDetails?.channelCommodity?.commodity?.customerCategory?.name}</Descriptions.Item>
}
{
shopList.length>0 &&
<Descriptions.Item label="上架商城">
{
shopList.map((item, index)=> item.isCheck && <span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>)
}
</Descriptions.Item>
}
{
channelDetails?.channelCommodity?.commodity?.brand?.name && <Descriptions.Item label="商品品牌">{channelDetails?.channelCommodity?.commodity?.brand?.name}</Descriptions.Item>
}
{
channelDetails?.channelCommodity?.commodity?.unitName && <Descriptions.Item label="单位">{channelDetails?.channelCommodity?.commodity?.unitName}</Descriptions.Item>
}
</Descriptions.Item>
<Descriptions.Item label="商品品类">{channelDetails?.channelCommodity?.commodity?.customerCategory?.name}</Descriptions.Item>
<Descriptions.Item label="商品品牌">{channelDetails?.channelCommodity?.commodity?.brand?.name}</Descriptions.Item>
<Descriptions.Item label="单位">{channelDetails?.channelCommodity?.commodity?.unitName}</Descriptions.Item>
<Descriptions.Item label="商品ID">{channelDetails?.id}</Descriptions.Item>
</Descriptions>
</>
......
......@@ -210,7 +210,7 @@ const viewProducts: React.FC<{}> = () => {
productDetail?.commodityShopList?.length>0 &&
<Descriptions.Item label="上架商城">
{
productDetail.commodityShopList.map((item, index)=><span key={index}>{item.name}&nbsp;</span>)
productDetail.commodityShopList.map((item, index)=><span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>)
}
</Descriptions.Item>
}
......
......@@ -40,7 +40,12 @@ const AddRule:React.FC<{}> = (props) => {
title={pageStatus === PageStatus.PREVIEW ? '查看交易规则' : ( pageStatus === PageStatus.EDIT ? '编辑交易规则' : '新增交易规则' )}
className="addRule"
extra={[
<Button key="1" onClick={() => addSchemaAction.submit()} type="primary" icon={<SaveOutlined />}>
<Button key="1"
onClick={() => addSchemaAction.submit()}
type="primary"
icon={<SaveOutlined />}
disabled={pageStatus === PageStatus.PREVIEW}
>
保存
</Button>,
]}
......
......@@ -35,7 +35,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
style: { height: '400px' }
},
properties: {
name: {
"name": {
type: 'string',
required: true,
title: '规则名称',
......@@ -49,7 +49,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
}
]
},
transactionProcesssId: {
"transactionProcesssId": {
type: 'string',
title: '流程选择',
required: true,
......@@ -58,7 +58,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
placeholder: '请选择交易流程',
className: 'fixed-ant-selected-down',
fetchSearch: PublicApi.getOrderTradingRulesTransactionProcessList,
}
},
},
MEGA_LAYOUT1_1: {
type: 'object',
......@@ -68,7 +68,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
wrapperCol: 24,
},
properties: {
isElectronicContract: {
"isElectronicContract": {
type: 'string',
"x-component-props": {
children: "使用电子合同"
......@@ -76,7 +76,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"x-component": "checkboxsingle",
default: false
},
electronicContractId: {
"electronicContractId": {
type: 'string',
required: true,
enum: [],
......@@ -151,7 +151,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
}
]
},
products: {
"products": {
type: 'array:number',
"x-component": 'MultTable',
"x-component-props": {
......
......@@ -14,15 +14,9 @@ class ChannelProductStore implements IChannelProductModule {
@observable public tableDataInSetPrice: any[] = null;
@observable public selectedRole: IRole = null;
@observable public selectChannel: any = null;
@observable public selectedSource: number = 1;
// 加工接口返回的数据,用户编辑回显数据
// @computed
// public get getBasicFormParamsByEdit(): IBasicFormParam {
// return {
// commodityAreaList: this.productInfoByEdit?.commodityAreaList.map(item => [item.provinceCode, item.cityCode]),
// }
// }
@action.bound
public setProductSourceInStore(data: number) {
......@@ -59,6 +53,11 @@ class ChannelProductStore implements IChannelProductModule {
this.selectChannel = data
}
@action.bound
public setSelectSource(data: number){
this.selectedSource = data
}
}
export default ChannelProductStore
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