Commit 60fc2df8 authored by Bill's avatar Bill

merge: 合并yarn.lock

parents 51151037 72bd0516
......@@ -63,7 +63,11 @@ const Table: React.FC<Iprops> = (props: any) => {
return new Promise((resolve, reject) => {
if (!Array.isArray(fetch)) {
fetch({ ...params }).then(res => {
resolve(res.data)
const data = {
totalCount: res.data.totalCount,
data: res.data.data || []
}
resolve(data)
}).catch(error => {
console.warn(error)
})
......
......@@ -8,26 +8,30 @@ const { onFormInit$ } = FormEffectHooks
* @param service 触发的异步函数, 需返回一个{label: any, value: any}形式的数组
*/
export const useAsyncInitSelect = (name: string[], service: () => Promise<any>) => {
const { dispatch, setFieldState } = createFormActions()
const linkage = useLinkageUtils()
const { dispatch, setFieldState } = createFormActions();
const linkage = useLinkageUtils();
onFormInit$().subscribe(() => {
setFieldState(name, state => {
FormPath.setIn(state, 'props.x-props.hasFeedback', true)
})
name.forEach(v => linkage.loaded(v))
const nameStr: string = name.toString();
const formPath: string = `*(${nameStr})`;
setFieldState(formPath, state => {
FormPath.setIn(state, 'props.x-props.hasFeedback', true);
});
linkage.loading(formPath);
service().then(res => {
name.forEach(v => {
linkage.loaded(v)
linkage.enum(v, res[v])
})
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch && dispatch('requestAsyncSelect', {
linkage.enum(v, res[v] || []);
});
// 请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch?.('requestAsyncSelect', {
name,
payload: res
})
}).catch(err => {
// linkage.loaded(name)
// linkage.enum(name, [])
})
payload: res,
});
}).finally(() => {
linkage.loaded(formPath);
});
})
}
\ No newline at end of file
import React from 'react';
import React, { useRef } from 'react';
import { history } from 'umi';
import { Button, Tag, Typography } from 'antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
......@@ -13,6 +13,7 @@ import { getMarketingPlatformActivityExecutePage, getMarketingPlatformActivityGe
const { onFormMount$ } = FormEffectHooks;
const Search = () => {
const ref = useRef<any>({})
const columns: ColumnType<any>[] = [
{
title: 'ID',
......@@ -91,40 +92,35 @@ const Search = () => {
return (
<TableLayout
reload={ref}
columns={columns}
effects="id"
fetch={getMarketingPlatformActivityExecutePage}
useStateEffects={useStateEffects}
schema={{
type: 'object',
type: "object",
properties: {
mageLayout: {
megalayout: {
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'space-between'
}
},
"x-component": "mega-layout",
properties: {
id: {
type: 'string',
'x-component': 'Search',
'x-rules': [{
pattern: PATTERN_MAPS.quantity,
message: '请输入活动ID',
}],
'x-component-props': {
placeholder: '活动ID'
placeholder: '活动ID',
align: "flex-left",
},
'x-rules': [
{
pattern: PATTERN_MAPS.quantity,
message: '请输入ID',
},
],
},
},
}
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: "flex-start",
......@@ -135,62 +131,68 @@ const Search = () => {
}
},
properties: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '活动名称',
allowClear: true,
style: {
width: 160,
},
PRO_LAYOUT: {
type: "object",
"x-component": "mega-layout",
"x-mega-props": {
span: 5
},
},
'[startTime,endTime]': {
type: 'daterange',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
allowClear: true,
style: {
width: 240,
},
"x-component-props": {
inline: true
},
},
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '活动类型',
allowClear: true,
style: {
width: 160,
properties: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '活动名称',
style: {
width: 160,
},
},
},
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态',
allowClear: true,
style: {
width: 160,
'[startTime,endTime]': {
type: 'daterange',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
},
activityType: {
type: 'string',
'x-component-props': {
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
outerStatus: {
type: 'string',
'x-component-props': {
placeholder: '外部状态',
style: {
width: 160,
},
},
enum: [],
},
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
sumbit: {
"x-component": "Submit",
"x-mega-props": {
span: 1
},
},
},
},
},
"x-component-props": {
children: "查询"
}
}
}
}
}
}}
/>
);
......
......@@ -92,11 +92,11 @@ const DetialLayout = () => {
return
}
let { data } = res;
let externalLogStates: any = [];
let externalLogs: any = [];
if (data.outerTaskList) {
data.outerTaskList.forEach((item: any) => {
externalLogStates.push({
let interiorLogStates: any = [];
let interiorLogs: any = [];
if (data.innerTaskList) {
data.innerTaskList.forEach((item: any) => {
interiorLogStates.push({
state: item.step,
stateName: null,
isExecute: item.isExecute,
......@@ -104,11 +104,11 @@ const DetialLayout = () => {
roleName: item.roleName,
})
})
data.externalLogStates = externalLogStates;
data.interiorLogStates = interiorLogStates;
}
if (data.outerRecordDOList) {
data.outerRecordDOList.forEach((item: any, index: number) => {
externalLogs.push({
if (data.innerRecordDOList) {
data.innerRecordDOList.forEach((item: any, index: number) => {
interiorLogs.push({
operation: item.operate,
createTime: item.operateTime,
roleName: item.roleName,
......@@ -119,7 +119,7 @@ const DetialLayout = () => {
step: index,
})
})
data.externalLogs = externalLogs;
data.interiorLogs = interiorLogs;
}
if (data.activityType === ACTIVITY_TYPE_6) {
setRemind(remindLayout(data.activityType, data.activityDefined.giveType, data.activityDefined.giftType));
......
......@@ -9,9 +9,10 @@ import { FormEffectHooks } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
getMarketingPlatformMerchantActivityGetActivityTypeList,
getMarketingPlatformMerchantActivityGetOuterStatusList,
getMarketingPlatformMerchantActivityGetInnerStatusList,
getMarketingPlatformMerchantActivityPage
} from '@/services/MarketingV2Api';
import { PATTERN_MAPS } from '@/constants/regExp';
const { onFormMount$ } = FormEffectHooks;
const MerchantMarketingSearch = () => {
......@@ -71,9 +72,9 @@ const MerchantMarketingSearch = () => {
console.warn(err)
})
/** 外部状态 */
getMarketingPlatformMerchantActivityGetOuterStatusList().then(res => {
getMarketingPlatformMerchantActivityGetInnerStatusList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('outerStatus', _enum);
linkage.enum('innerStatus', _enum);
}).catch(err => {
console.warn(err)
})
......@@ -97,6 +98,10 @@ const MerchantMarketingSearch = () => {
id: {
type: 'string',
'x-component': 'Search',
'x-rules': [{
pattern: PATTERN_MAPS.quantity,
message: '请输入活动ID',
}],
'x-component-props': {
placeholder: '活动ID',
align: "flex-left",
......@@ -155,10 +160,10 @@ const MerchantMarketingSearch = () => {
},
enum: [],
},
outerStatus: {
innerStatus: {
type: 'string',
'x-component-props': {
placeholder: '部状态',
placeholder: '部状态',
style: {
width: 160,
},
......
......@@ -251,7 +251,16 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
return;
}
let newData = [...suitableMemberList];
newData = newData.concat(RowCtl.selectRow.map((item) => ({ ...item, disabled: true })));
for (let i = 0; i < RowCtl.selectRow.length; i++) {
const item = RowCtl.selectRow[i];
// 防止重复添加
if (!newData.find((current) => current.onlyId === item.onlyId)) {
newData.push({
...item,
disabled: false,
});
}
}
setSuitableMemberList(newData);
const filtered = newData.map(({ onlyId, disabled, ...rest }) => ({ ...rest }));
triggerChange(filtered);
......@@ -298,17 +307,16 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
});
if (res.code === 1000) {
const { data = {} }: any = res;
const {
memberTypes = [],
levels = [],
suitableMemberTypes = [],
} = data;
} = res.data;
return {
memberType: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
memberTypeEnum: memberTypes.map(item => ({ label: item.name, value: item.value })),
level: levels.map(item => ({ label: item.levelTag, value: item.level })),
suitableMemberType: suitableMemberTypes.map(item => ({ label: item.name, value: item.value })),
suitableMemberType: suitableMemberTypes?.map(item => ({ label: item.name, value: item.value })),
};
}
return {};
......@@ -400,7 +408,7 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['memberType', 'level', 'suitableMemberType'],
['memberTypeEnum', 'level', 'suitableMemberType'],
fetchSelectOptions,
);
},
......
......@@ -69,6 +69,7 @@ export const drawerSchema: ISchema = {
'x-component': 'NumberPicker',
'x-component-props': {
placeholder: '会员ID',
min: 0,
},
},
memberTypeEnum: {
......
......@@ -86,6 +86,7 @@ const CategoryAttributes: React.FC<{}> = () => {
const [selectedTableRowKeys, setSelectedTableRowKeys] = useState<Array<number>>([]) //表格选择
const [linkTableRowData, setLinkTableRowData] = useState<any[]>([])
const [attributeRowSelection, attributeRowCtl] = useRowSelectionTable()
const flag = useRef<boolean>(false)
const {
treeStatus,
......@@ -105,9 +106,13 @@ const CategoryAttributes: React.FC<{}> = () => {
// 获取选中项的关联属性列表
useEffect(() => {
if (selectKey)
if (selectKey && flag.current) {
ref.current.reload()
// ref.current.reload({ current: 1, pageSize: 10, name: '', categoryId: selectKey, isByCategory: true })
} else if(!selectKey) {
flag.current = false
} else {
flag.current = true
}
}, [selectKey])
const fetchLinkAttributeData = (params: any) => {
......
......@@ -26,6 +26,7 @@ const PropertyValue: React.FC<{}> = () => {
const [selectKey, setSelectKey] = useState(undefined)
const [selectNode, setSelectNode] = useState<any>()
const [customExpandkeys, setCustomExpandkeys] = useState<any>()
const flag = useRef<boolean>(false)
const {
treeStatus,
......@@ -58,9 +59,13 @@ const PropertyValue: React.FC<{}> = () => {
}, [])
useEffect(() => {
if (selectKey)
if (selectKey && flag.current) {
ref.current.reload()
// ref.current.reload({current: 1, pageSize: 10, name: '', attributeId: selectKey})
} else if(!selectKey) {
flag.current = false
} else {
flag.current = true
}
}, [selectKey])
const onHandleSelect = (key, node) => {
......
......@@ -12,7 +12,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { createFormActions, FormEffectHooks } from '@formily/antd'
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from '../effect'
import { getProductCommodityGetPlatformCommodityList } from '@/services/ProductV2Api'
import { getProductCommodityGetPlatformUnCheckCommodityList } from '@/services/ProductV2Api'
const formActions = createFormActions();
......@@ -143,7 +143,7 @@ const Products: React.FC<{}> = () => {
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
getProductCommodityGetPlatformCommodityList({ ...params, status: 2 }).then(res => {
getProductCommodityGetPlatformUnCheckCommodityList(params).then(res => {
const { data } = res
resolve(data)
})
......
......@@ -398,7 +398,13 @@ const viewProducts: React.FC<{}> = () => {
<Steps progressDot current={fixStep}>
<Step title="新建商品" description="供应商" />
<Step title="提交审核" description="供应商" />
<Step title="审核" description="平台" />
{
productDetail?.checkType === 1
?
<Step title="审核" description="供应商" />
:
<Step title="审核" description="平台" />
}
<Step title="完成" description="" />
</Steps>
</Card>
......
......@@ -174,7 +174,13 @@ const viewBrand: React.FC<{}> = () => {
<Card headStyle={{borderBottom:'none'}} title="流程进度">
<Steps progressDot current={fixStep}>
<Step title="提交审核" description="供应商" />
<Step title="审核品牌" description="平台" />
{
brandInfo.type === 1
?
<Step title="审核品牌" description="供应商" />
:
<Step title="审核品牌" description="平台" />
}
<Step title="完成" description="" />
</Steps>
</Card>
......
......@@ -78,7 +78,7 @@ const RowLayout: React.FC<IProps> = (props: any) => {
<div className={style['card-badge']}>
{item.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED ? (priceContrast === 1 ? '已解密' : '未加密') : '未解密'}
</div>
{item.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED && <Typography.Link href={`/purchase/demandBidMgt/offer/quote/detail?id=${item.id}&number=${item.quotedPriceNo}&turn=${item.turn}`} className={style['card-link']}>查看报价详情</Typography.Link>}
{item.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED && <Typography.Link href={`/purchaseManage/demandVouch/demandBidMgt/offer/quote/detail?id=${item.id}&number=${item.quotedPriceNo}&turn=${item.turn}`} className={style['card-link']}>查看报价详情</Typography.Link>}
{item.isDecrypt === PRICECONTRAST_TYPE.UNDECRYPTED && <Tooltip placement="topLeft" title='当前报价为密封报价,请先解密报价单'><Typography.Text className={style['card-link']} type='success'>查看报价详情</Typography.Text></Tooltip>}
</div>
</Col>
......
......@@ -26,7 +26,7 @@ const Offter = () => {
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<EyePreview url={`/purchase/demandVouch/demandBidMgt/demand/detail?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<EyePreview url={`/purchaseManage/demandVouch/demandBidMgt/demand/detail?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
)
}, {
title: '需求摘要',
......@@ -88,7 +88,7 @@ const Offter = () => {
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<Button type='link' onClick={() => history.push(`/purchase/demandVouch/demandBidMgt/offer/preview?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`)}>查看</Button>
<Button type='link' onClick={() => history.push(`/purchaseManage/demandVouch/demandBidMgt/offer/preview?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`)}>查看</Button>
)
}];
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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