Commit 8057832d authored by GuanHua's avatar GuanHua
parents 9281f52e e6971da9
......@@ -204,6 +204,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
}, []);
const handleVisibleDrawer = (flag?: boolean) => {
if (flag) { editAddressId.current = null; } // 解决点击编辑然后关掉弹窗再进来新增变成编辑的问题
setVisibleDrawer(!!flag);
};
......@@ -539,6 +540,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
width={800}
onClose={() => handleVisibleDrawer(false)}
visible={visibleDrawer}
destroyOnClose
footer={
<div
style={{
......
......@@ -50,7 +50,6 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
if (res.code !== 1000) {
return
}
setDataSource(res.data);
PublicApi.getTransactionProductInquiryDetails({ id: res.data.inquiryListId.toString() }).then(resolve => {
if (resolve.code !== 1000) {
return
......@@ -73,7 +72,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}).catch(error => {
console.warn(error)
})
setDataSource(res.data);
}).catch(error => {
console.warn(error)
})
......@@ -152,6 +151,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
inquiryListProductRequests.forEach((item: any) => {
item.money = count(item.purchaseCount, item.price)
})
setDataSource(resolve.data)
setProductQuote(inquiryListProductRequests);
form.setFieldsValue({
"inquiryListProductRequests": inquiryListProductRequests,
......
......@@ -88,6 +88,8 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
}
}, [inq])
console.log(context, 96)
return (
<Card
id="basicInfoLayout"
......
......@@ -38,7 +38,7 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
setDataSource([...dataSource]);
}
const handleJump = (data:any) => {
const handleJump = (data: any) => {
window.open(`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/inquiry/detail/${data.commodityId}`)
}
......@@ -218,7 +218,7 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
rules={[{ required: true, message: "请添加商品" }]}
>
<Table
rowKey="productId"
rowKey={(record) => record.productId}
columns={columns}
dataSource={dataSource}
pagination={false}
......@@ -228,10 +228,11 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
title='历史报价'
visible={visible}
onClose={() => setVisible(false)}
destroyOnClose
>
<StandardTable
columns={hitoryColumns}
tableProps={{ rowKey: 'productId' }}
tableProps={{ rowKey: 'id' }}
fetchTableData={fetchTableData}
/>
</Drawer>
......
......@@ -37,6 +37,13 @@ export interface ListType {
const actions = createFormActions()
const diaLogForm: React.FC<ListProps> = (props) => {
const {
query: {
id,
},
pathname,
} = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [formIsHalfFilledOut, setFormIsHalfFilledOut] = useState(true)
const [provinceList, setProvinceList] = useState([])
const [editable, setEditable] = useState<boolean>(true)
......@@ -48,14 +55,11 @@ const diaLogForm: React.FC<ListProps> = (props) => {
* @return:
*/
useEffect(() => {
let {id , isSee} = history.location.query
let _title = history.location.query.isSee ? '查看' :
let _title = (path === 'detail') ? '查看' :
Number(id) === 0 ? '新建' : '编辑'
if (history.location.query.isSee) {
if (path === 'detail') {
setEditable(false)
}
// console.log(id,typeof id,history.location.query.isSee,typeof history.location.query.isSee)
setHeaderTitle(`${_title}运费模板`)
PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = []
......@@ -82,20 +86,19 @@ const diaLogForm: React.FC<ListProps> = (props) => {
})
}
if(isSee) {
if (path === 'detail') {
setFormIsHalfFilledOut(false)
}
}, [])
const FormSumbit = (values: any) => {
let id = history.location.query.id
let value = { ...values }
if(value.designateList.length === 1 && JSON.stringify(value.designateList[0]) === '{}'){
if (value.designateList.length === 1 && JSON.stringify(value.designateList[0]) === '{}') {
delete value.designateList
}
if (!id) {
PublicApi.postLogisticsFreightTemplateAdd(value).then(res => {
if(res.code === 1000){
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
}, 1000)
......@@ -107,7 +110,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
} else {
value.id = Number(id)
PublicApi.postLogisticsFreightTemplateUpdate(value).then(res => {
if(res.code === 1000){
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
}, 1000)
......@@ -285,7 +288,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
placeholder: '最长60个字符,30个汉字'
}}
x-rules={{
max:30
max: 30
}}
/>
</FormMegaLayout>
......@@ -397,7 +400,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
</Col>
</Row>
</Card>
<Prompt when={formIsHalfFilledOut} message="您还有未保存的内容,是否确定要离开" />
<Prompt when={formIsHalfFilledOut} message="您还有未保存的内容,是否确定要离开" />
</PageHeaderWrapper>
)
}
......
......@@ -200,8 +200,8 @@ const AddedMarketing = () => {
detail='新增营销活动'
tabLink={[
{ id: 'basicInfoLayout', title: '基本信息' },
{ id: 'rulesLayout', title: '活动规则' },
{ id: 'shopLayout', title: '适用商城' },
{ id: 'rulesLayout', title: '活动规则' },
{ id: 'activityProductLayout', title: '活动商品' },
{ id: 'partakeUserLayout', title: '参与用户' },
]}
......@@ -227,8 +227,8 @@ const AddedMarketing = () => {
}}
>
<BasicInfoLayout form={form} focus$={focus$} />
<RulesLayout form={form} focus$={focus$} />
<ShopLayout onGetShopList={handleGetShopList} onSetShopList={shopList} />
<RulesLayout form={form} focus$={focus$} />
<ProductListLayout activityId={activityId && { activityId: activityId }} form={form} focus$={focus$} shopIdList={shopIdList} fieldApi={PublicApi.getMarketingMerchantActivityDetailGoodsPage} />
<PartakeUserLayout onGetLevel={handleGetLevel} onSetLevel={memberLevelList} setMemberType={memberType} />
</Form>
......
......@@ -52,7 +52,6 @@ const OfferExplain: React.FC<IProps> = (props: any) => {
const handleHidden = () => {
let flag: boolean = false;
console.log(checkRound, round, 123)
if (checkRound !== round) {
flag = true
}
......
......@@ -334,12 +334,12 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const handleRadioGroup = (e) => {
const params = { ...data };
const { value } = e.target;
const { value} = e.target;
const index = e.target['data-index'];
setIdx(index);
setCount(value);
if (!params[index]) {
const isTurn = value === 1 ? 1 : value - 1
const isTurn = value === 1 ? 1 : index === 0 ? value - 1 : value;
fetchTableData(isTurn, index)
/** 返回给兄弟 */
} else {
......
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