Commit 0193fc94 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 07906650 879a8752
This diff is collapsed.
......@@ -66,6 +66,11 @@ const OfferSearch = () => {
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
}
];
return (
......
......@@ -178,6 +178,7 @@ const InquiryOfferDetail = () => {
title: '含税/税率',
key: 'isTax',
dataIndex: 'isTax',
render: (_, record) => `${record.taxRate ? '是' : '否'}/${record.taxRate}`
},
{
title: '报价单价',
......
......@@ -63,7 +63,10 @@ const InquirySearch = () => {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button disabled={record.isQuoted === 1} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
render: (text: any, record: any) => <>
<Button disabled={record.isQuoted === 1} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
<Button disabled={record.isQuoted === 1} type='link'>二次询价</Button>
</>
}
];
......
......@@ -84,10 +84,18 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
setDataSource(res.data);
setProductQuote(res.data.inquiryListProductRequests)
form.setFieldsValue({
...res.data,
"inquiryListProductRequests": res.data.inquiryListProductRequests,
})
if (isEdit) {
form.setFieldsValue({
...res.data,
"inquiryListProductRequests": res.data.inquiryListProductRequests,
})
} else {
form.setFieldsValue({
"inquiryListNo": res.data.inquiryListNo,
"inquiryListProductRequests": res.data.inquiryListProductRequests,
})
}
}).catch(error => {
console.warn(error)
})
......@@ -166,6 +174,14 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
}
const getContacts = (value) => {
form.setFieldsValue({
"contacts": value.name,
'contactsPhone': value.phone,
'phoneCode': 86,
});
}
return (
<Context.Provider value={dataSource}>
<AddedLayout
......@@ -200,7 +216,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
>
<BasicInfoLayout getInquiryInfo={getInquiryInfo} inq={inquiry} isEdit={spam} />
<ProductQuoteLayout setProductQuote={productQuote} />
<OtherExplainLayout />
<OtherExplainLayout getContacts={getContacts} />
<AttachLayout enclosureUrls={enclosureUrls} getEnclosureUrls={getEnclosureUrls} removeEnclosureUrls={removeEnclosureUrls} />
</Form>
}
......
import React from 'react';
import { Row, Col, Form, Input, InputNumber } from 'antd';
import React, { useCallback, useState } from 'react';
import { Row, Col, Form, Input, InputNumber, Select, Button } from 'antd';
import Card from '@/pages/transaction/components/card';
import { LinkOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import TableModal from '@/pages/transaction/components/TableModal';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
interface OtherExplainLayoutProps {
/** 获取联系人 */
getContacts?: (e) => void,
}
const OtherExplainLayout: React.FC<OtherExplainLayoutProps> = (props: any) => {
const { getContacts } = props;
const [visible, setVisible] = useState<boolean>(false)
const handleFetchData = useCallback((params: any) => {
return new Promise(resolve => {
PublicApi.getMemberManageUsersPage({ ...params }).then(res => {
if (res.code !== 1000) {
return
}
resolve(res.data)
}).catch(error => {
console.warn(error)
})
})
}, [])
const toggle = (flag: boolean) => {
setVisible(flag)
}
const columns: any = [
{
title: '序号',
dataIndex: 'userId',
key: 'userId',
},
{
title: '用户姓名',
dataIndex: 'name',
key: 'name',
},
{
title: '手机号',
dataIndex: 'phone',
key: 'phone',
},
{
title: '所属机构',
dataIndex: 'orgName',
key: 'orgName',
},
]
const handleConfirm = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const target = selectRowRecord[0];
getContacts(target)
toggle(false)
}
return (
<Card
id="otherExplainLayout"
......@@ -27,6 +79,39 @@ const OtherExplainLayout: React.FC<OtherExplainLayoutProps> = (props: any) => {
]}>
<InputNumber min={0} style={{ width: '100%' }} />
</Form.Item>
<Form.Item
label='询价联系人'
name='contacts'
rules={[{ required: true, message: '请选择询价联系人' }]}
>
<Input.Search onSearch={() => toggle(true)} readOnly enterButton={<Button style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
</Form.Item>
<Form.Item
label='联系人电话'
required
style={{ marginBottom: '0px' }}
>
<Row gutter={16}>
<Col span={8}>
<Form.Item
name='phoneCode'
rules={[{ required: true, message: '请选择' }]}
>
<Select>
<Select.Option value={86}>86</Select.Option>
</Select>
</Form.Item>
</Col>
<Col span={16}>
<Form.Item
name='contactsPhone'
rules={[{ required: true, message: '请选择' }]}
>
<Input type='number' maxLength={11} />
</Form.Item>
</Col>
</Row>
</Form.Item>
<Form.Item label='交付说明' name='deliveryInstructions'>
<Input.TextArea maxLength={50} autoSize placeholder='最长100个字符,50个汉字' />
</Form.Item>
......@@ -49,6 +134,88 @@ const OtherExplainLayout: React.FC<OtherExplainLayoutProps> = (props: any) => {
</Form.Item>
</Col>
</Row>
<TableModal
modalType="Drawer"
visible={visible}
title="选择用户"
mode="radio"
tableProps={{
rowKey: 'userId',
}}
customKey="userId"
fetchData={handleFetchData}
onClose={() => toggle(false)}
onOk={handleConfirm}
columns={columns}
effects={($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect($, actions, "name", FORM_FILTER_PATH)
}}
schema={{
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
properties: {
name: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: '用户姓名',
align: 'flex-left',
}
}
}
},
[FORM_FILTER_PATH]: {
type: 'object',
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'flex-start',
flexWrap: 'nowrap'
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
PRO_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-mega-props": {
span: 5
},
"x-component-props": {
inline: true
},
properties: {
orgName: {
type: 'string',
"x-component-props": {
placeholder: '所属机构'
}
},
}
},
sumbit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}}
/>
</Card>
)
}
......
......@@ -66,6 +66,7 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
title: "含税/税率",
key: "isTax",
dataIndex: "isTax",
render: (_, record) => `${record.taxRate ? '是' : '否'}/${record.taxRate}`
},
{
title: "采购数量/单位",
......
......@@ -7,7 +7,6 @@ const Quote = (props: any) => {
return (
<AddQuoteForm
id={id}
isEdit
title={props.route.name}
fetchRequest={PublicApi.postTransactionProductQuotationAdd}
spam
......
......@@ -74,6 +74,8 @@ const ProductInquiryDetail = () => {
{ label: '交付日期', extra: format(data.deliveryTime) },
{ label: '交付地址', extra: data.fullAddress },
{ label: '报价截止时间', extra: format(data.quotationAsTime) },
{ label: '询价联系人', extra: data.contacts },
{ label: '联系人电话', extra: data.contactsPhone }
]
},
{
......
......@@ -51,8 +51,8 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
memberId: memberInfo.memberId,
memberRoleId: memberInfo.roleId,
memberRoleName: memberInfo.roleName,
fullAddress: fullAddress.children,
fullAddressId: res.fullAddressId,
fullAddress: fullAddress.fullAddress,
fullAddressId: fullAddress.fullAddressId,
offer: res.offer,
paymentType: res.paymentType,
taxes: res.taxes,
......@@ -100,7 +100,12 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
const getFullAddress = (info) => {
setFullAddress(info)
console.log(info)
const address = {
fullAddress: `${info.name} ${info.fullAddress} ${info.phone}`,
fullAddressId: info.id,
}
setFullAddress(address)
}
const getEnclosureUrls = (data) => {
......@@ -185,7 +190,8 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
roleName: data.memberName,
})
setFullAddress({
children: data.fullAddress,
fullAddress: data.fullAddress,
fullAddressId: data.fullAddressId,
})
setInquiryProduct(data.inquiryListProductRequests)
setEnclosureUrls(data.enclosureUrls)
......@@ -240,7 +246,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
>
<BasicInfoLatyout getMemberInfo={getMemberInfo} memb={memberInfo} isEdit={spam} />
<InquiryProductLayout getInquiryProduct={getInquiryProduct} member={memberInfo} setInquiryProduct={inquiryProduct} />
<TradeTermsLayout getFullAddress={getFullAddress} getContacts={getContacts} />
<TradeTermsLayout getFullAddress={getFullAddress} getContacts={getContacts} fullAddress={fullAddress} />
<AttachLayout enclosureUrls={enclosureUrls} getEnclosureUrls={getEnclosureUrls} removeEnclosureUrls={removeEnclosureUrls} />
</Form>
}
......
......@@ -5,3 +5,10 @@
}
}
}
.addressLayout {
:global {
.ant-form-item-control {
width: 0;
}
}
}
import React, { useCallback, useEffect, useState } from 'react';
import { Row, Col, Form, Input, DatePicker, Select, Button, Space } from 'antd';
import React, { useCallback, useState, useEffect } from 'react';
import { Row, Col, Form, Input, DatePicker, Select, Button } from 'antd';
import Card from '@/pages/transaction/components/card';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
import { LinkOutlined } from '@ant-design/icons';
import TableModal from '@/pages/transaction/components/TableModal';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import AddressSelect from '@/components/AddressSelect';
import style from './index.less';
import { isEmpty } from 'lodash';
const disabledDate = (current) => {
return current && current < moment().startOf('day');
......@@ -18,28 +20,14 @@ interface TradeTermsLayoutProps {
getFullAddress?: (e) => void,
/** 获取联系人 */
getContacts?: (e) => void,
/** 回显数据 */
fullAddress?: any,
}
const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
const { getFullAddress, getContacts } = props;
const [fullAddress, setFullAddress] = useState<any[]>([]);
const { getFullAddress, getContacts, fullAddress } = props;
const [visible, setVisible] = useState<boolean>(false)
useEffect(() => {
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
if (res.code !== 1000) {
return
}
setFullAddress(res.data)
}).catch(error => {
console.warn(error)
})
}, [])
const handleFullAddress = (_v, option) => {
getFullAddress(option)
}
const [address, setaddress] = useState<any>({})
const handleFetchData = useCallback((params: any) => {
return new Promise(resolve => {
PublicApi.getMemberManageUsersPage({ ...params }).then(res => {
......@@ -80,12 +68,20 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
},
]
const handleConfirm = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const handleConfirm = (_selectRowKeys: string[] | number[], selectRowRecord: any) => {
const target = selectRowRecord[0];
getContacts(target)
toggle(false)
}
useEffect(() => {
if (!isEmpty(fullAddress)) {
setaddress({
id: fullAddress.fullAddressId,
})
}
}, [fullAddress])
return (
<Card
id="tradeTermsLayout"
......@@ -100,21 +96,8 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
<Form.Item label='交付地址' name='fullAddressId' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select onChange={handleFullAddress}>
{
!isEmpty(fullAddress) && (
fullAddress.map(item => (
<Select.Option
key={item.id}
value={item.id}
>
{item.fullAddress}
</Select.Option>
))
)
}
</Select>
<Form.Item label='交付地址' className={style.addressLayout}>
<AddressSelect value={address} isDefaultAddress addressType={1} disabled={false} onChange={getFullAddress} />
</Form.Item>
<Form.Item label='报价截止时间' name='quotationAsTime' rules={[{ required: true, message: '请选择报价截止时间' }]}>
<DatePicker
......@@ -178,6 +161,7 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
</Form.Item>
</Col>
</Row>
{/* 选择用户 */}
<TableModal
modalType="Drawer"
visible={visible}
......@@ -260,6 +244,8 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
}
}}
/>
{/* 地址管理 */}
</Card>
)
}
......
......@@ -37,6 +37,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const [type, setType] = useState<number>(0);
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, setDataSource] = useState<any>([])
const [shopIdList,setShopIdList] = useState<number[]>([]);
const components = {
body: {
row: EditableRow,
......@@ -63,6 +64,9 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
useEffect(() => {
if (!isEmpty(data)) {
setType(data.activityType)
setShopIdList(data.shopList.map(item => {
return item.shopId
}))
}
}, [data])
......@@ -109,7 +113,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const handleFetchData = useCallback((params: any) => {
return new Promise(resolve => {
PublicApi.postProductCommodityCommonGetCommodityListByPlatform({ ...params }, { ctlType: 'none' }).then(res => {
PublicApi.postProductCommodityGetCommoditySkuListByShopId({ shopIdList, ...params }, { ctlType: 'none' }).then(res => {
if (res.code !== 1000) {
return
}
......@@ -121,9 +125,9 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
id: item.id,
productId: item.commodityId,
productName: item.name,
category: item.categoryName,
category: item.customerCategoryName,
brand: item.brandName,
status: item.status,
status: 5,
productImgUrl: item.mainPic,
unit: item.unitName,
price: item.unitPrice['0-0']
......@@ -134,13 +138,14 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
console.warn(error)
})
})
}, [])
}, [shopIdList])
const handleOk = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const rowRecord: any[] = [...selectRowRecord]
const productList = rowRecord.map(item => {
return {
id: item.id,
skuId: item.id,
productImgUrl: item.productImgUrl,
productId: item.productId,
productName: item.productName,
......@@ -229,7 +234,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
onOk={handleOk}
effects={($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect($, actions, "name", FORM_FILTER_PATH)
useStateFilterSearchLinkageEffect($, actions, "commodityName", FORM_FILTER_PATH)
}}
schema={{
type: "object",
......@@ -238,7 +243,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
type: "object",
"x-component": "mega-layout",
properties: {
name: {
commodityName: {
type: "string",
"x-component": "Search",
"x-mega-props": {},
......@@ -272,7 +277,7 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
inline: true
},
properties: {
categoryId: {
customerCategoryId: {
type: "string",
"x-component-props": {
placeholder: "商品品类",
......
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