Commit 1509e360 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

Merge branch 'dev' into test

parents 17492215 3ab6693c
...@@ -220,6 +220,7 @@ const TabTree: React.FC<TabTreeProps> = props => { ...@@ -220,6 +220,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
handleCheck, handleCheck,
customExpandkeys, customExpandkeys,
enableSearch = false, enableSearch = false,
checkStrictly = false
} = props; } = props;
const selfActions = useTreeActions(actions) const selfActions = useTreeActions(actions)
...@@ -352,6 +353,7 @@ const TabTree: React.FC<TabTreeProps> = props => { ...@@ -352,6 +353,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
checkedKeys={selected} checkedKeys={selected}
expandedKeys={expandkeys} expandedKeys={expandkeys}
autoExpandParent={autoExpandParent} autoExpandParent={autoExpandParent}
checkStrictly={checkStrictly}
onExpand={onExpand} onExpand={onExpand}
onCheck={(keys, nodes) => { onCheck={(keys, nodes) => {
const { node, checked, checkedNodes } = nodes; const { node, checked, checkedNodes } = nodes;
......
...@@ -210,6 +210,7 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -210,6 +210,7 @@ const MemberDetail: React.FC<{}> = () => {
actions={treeActions} actions={treeActions}
treeData={treeData} treeData={treeData}
handleSelect={handleSelect} handleSelect={handleSelect}
checkStrictly={true}
customKey='id' customKey='id'
disabled={pageStatus === PageStatus.PREVIEW} disabled={pageStatus === PageStatus.PREVIEW}
/> />
......
...@@ -794,8 +794,9 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -794,8 +794,9 @@ const AddLogistics: React.FC<{}> = () => {
rowSelection={shippingRowSelection} rowSelection={shippingRowSelection}
cancel={() => setshippingvisible(false)} cancel={() => setshippingvisible(false)}
confirm={handleShipping} confirm={handleShipping}
resetModal={{destroyOnClose: true, forceRender: true}}
forceRender={true}
fetchTableData={params => fetchShippingData(params)} fetchTableData={params => fetchShippingData(params)}
resetModal={{ destroyOnClose: true }}
tableProps={{ rowKey: 'id' }} tableProps={{ rowKey: 'id' }}
modalType='logisticsDelivery' modalType='logisticsDelivery'
searchName='invoicesNo' searchName='invoicesNo'
...@@ -807,8 +808,9 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -807,8 +808,9 @@ const AddLogistics: React.FC<{}> = () => {
columns={invoicesColumns} columns={invoicesColumns}
invoicesNo={query.invoicesNo} invoicesNo={query.invoicesNo}
relevanceType={relevanceType} relevanceType={relevanceType}
resetModal={{ destroyOnClose: true }}
tableProps={{ rowKey: 'id' }} tableProps={{ rowKey: 'id' }}
resetModal={{destroyOnClose: true, forceRender: true}}
forceRender={true}
rowSelection={invoicesRowSelection} rowSelection={invoicesRowSelection}
cancel={() => setinvoicesvisible(false)} cancel={() => setinvoicesvisible(false)}
confirm={handleInvoices} confirm={handleInvoices}
...@@ -818,6 +820,7 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -818,6 +820,7 @@ const AddLogistics: React.FC<{}> = () => {
modalTitle='选择商品' modalTitle='选择商品'
visible={visible} visible={visible}
columns={(createType !== 4 && createType !== 5 && createType !== 6) ? SelectGoodsColumns : AfterSalesSelectGoodsColumns} columns={(createType !== 4 && createType !== 5 && createType !== 6) ? SelectGoodsColumns : AfterSalesSelectGoodsColumns}
resetModal={{destroyOnClose: true, forceRender: true}}
forceRender={true} forceRender={true}
fetchTableData={(params) => fetchData(params)} fetchTableData={(params) => fetchData(params)}
cancel={() => setvisible(false)} cancel={() => setvisible(false)}
......
...@@ -15,7 +15,7 @@ const CommonHeader: React.FC<ShopHeaderPropsType> = (props) => { ...@@ -15,7 +15,7 @@ const CommonHeader: React.FC<ShopHeaderPropsType> = (props) => {
const { title, logoUrl, type, shopUrlParam } = props const { title, logoUrl, type, shopUrlParam } = props
const getLink = () => { const getLink = () => {
let url: string = '' let url: string
switch(type) { switch(type) {
case LAYOUT_TYPE.channel: case LAYOUT_TYPE.channel:
url = `${GlobalConfig.channelRootRoute}?channelId=${shopUrlParam}` url = `${GlobalConfig.channelRootRoute}?channelId=${shopUrlParam}`
......
...@@ -5,6 +5,7 @@ import { history } from 'umi' ...@@ -5,6 +5,7 @@ import { history } from 'umi'
import { FileTextOutlined, DownOutlined } from '@ant-design/icons' import { FileTextOutlined, DownOutlined } from '@ant-design/icons'
import isEmpty from 'lodash/isEmpty' import isEmpty from 'lodash/isEmpty'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import ImageBox from '@/components/ImageBox'
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth'
import styles from './index.less' import styles from './index.less'
...@@ -19,7 +20,7 @@ const Header: React.FC<HeaderPropsType> = (props) => { ...@@ -19,7 +20,7 @@ const Header: React.FC<HeaderPropsType> = (props) => {
const [count, setCount] = useState<number>(0) const [count, setCount] = useState<number>(0)
const { search } = history.location.query const { search } = history.location.query
let handleScroll = () => { const handleScroll = () => {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
const floatSearch = document.getElementById("floatSearch") const floatSearch = document.getElementById("floatSearch")
if (floatSearch) { if (floatSearch) {
...@@ -50,7 +51,7 @@ const Header: React.FC<HeaderPropsType> = (props) => { ...@@ -50,7 +51,7 @@ const Header: React.FC<HeaderPropsType> = (props) => {
}, []) }, [])
useEffect(() => { useEffect(() => {
if (!!search) { if (search) {
setSearchValue(search) setSearchValue(search)
} else { } else {
setSearchValue("") setSearchValue("")
...@@ -97,7 +98,7 @@ const Header: React.FC<HeaderPropsType> = (props) => { ...@@ -97,7 +98,7 @@ const Header: React.FC<HeaderPropsType> = (props) => {
<div className={styles.header}> <div className={styles.header}>
<div className={styles.header_container}> <div className={styles.header_container}>
<div className={styles.logo}> <div className={styles.logo}>
<img src={logo} /> <ImageBox width={145} height={50} imgUrl={logo} />
</div> </div>
<div className={styles.mall_search}> <div className={styles.mall_search}>
<div className={styles.mall_search_tags}> <div className={styles.mall_search_tags}>
......
...@@ -4,14 +4,10 @@ import { Button, message, InputNumber, Table, Form } from 'antd'; ...@@ -4,14 +4,10 @@ import { Button, message, InputNumber, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { ISchema, createAsyncFormActions, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'; import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import ModalTable, { ModalTableProps } from '@/components/ModalTable'; import ModalTable, { ModalTableProps } from '@/components/ModalTable';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
interface queryProps extends ModalTableProps { interface queryProps extends ModalTableProps {
member?: any, member?: any,
...@@ -23,23 +19,17 @@ interface queryProps extends ModalTableProps { ...@@ -23,23 +19,17 @@ interface queryProps extends ModalTableProps {
const EnquiryGoods: React.FC<queryProps> = (props) => { const EnquiryGoods: React.FC<queryProps> = (props) => {
const { member, schemaAction, getGoodsList, editData, type, ...restProps } = props const { member, schemaAction, getGoodsList, editData, type, ...restProps } = props
const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions()
const onChange = (value) => {
setValue(value);
};
// 会员添加弹窗控制 // 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false); const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [goodsList, setgoodsList] = useState<any>([]); const [goodsList, setgoodsList] = useState<any>([]);
const [inquiryGoods, setinquiryGoods] = useState<any>([]); const [inquiryGoods, setinquiryGoods] = useState<any>([]);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' }); const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const [brand, setbrand] = useState<any>([]);
const [form] = Form.useForm() const [form] = Form.useForm()
const handleOkAddMember = () => { const handleOkAddMember = () => {
setVisibleChannelMember(false); setVisibleChannelMember(false);
const arr: any[] = []; const arr: any[] = [];
const inquiry: any[] = []; const inquiry: any[] = [];
console.log(memberRowCtl.selectRow, 100000)
memberRowCtl.selectRow.forEach((v, i) => { memberRowCtl.selectRow.forEach((v, i) => {
inquiry.push(v) inquiry.push(v)
arr.push({ arr.push({
...@@ -168,12 +158,18 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -168,12 +158,18 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 删除选中的项 // 删除选中的项
const selectData = [...inquiryGoods]; const selectData = [...inquiryGoods];
const idx = selectData.findIndex(v => v.id === record.productId); if (type !== 1) {
console.log(newData, selectData); const idx = selectData.findIndex(v => v.productId === record.productId);
console.log(colIndex, idx); selectData.splice(idx, 1)
selectData.splice(idx, 1) memberRowCtl.setSelectRow(selectData)
memberRowCtl.setSelectRow(selectData) memberRowCtl.setSelectedRowKeys(selectData.map(v => v.productId))
memberRowCtl.setSelectedRowKeys(selectData.map(v => v.id)) } else {
const idx = selectData.findIndex(v => v.id === record.productId);
selectData.splice(idx, 1)
memberRowCtl.setSelectRow(selectData)
memberRowCtl.setSelectedRowKeys(selectData.map(v => v.id))
}
setinquiryGoods(selectData)
setgoodsList(newData) setgoodsList(newData)
getGoodsList(newData) getGoodsList(newData)
} }
...@@ -182,23 +178,26 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -182,23 +178,26 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
useEffect(() => { useEffect(() => {
if (Object.keys(editData).length > 0) { if (Object.keys(editData).length > 0) {
const arr: any[] = []; const arr: any[] = [];
const inquiry: any[] = [];
editData.inquiryListProductRequests.forEach(item => { editData.inquiryListProductRequests.forEach(item => {
inquiry.push(item)
arr.push({ arr.push({
id: item.productId, id: item.productId,
name: item.productName, name: item.productName,
customerCategoryName: item.category, customerCategoryName: item.category,
brandName: item.brand, brandName: item.brand,
unitName:item.unit, unitName: item.unit,
logistics:item.logistics, logistics: item.logistics,
memberId:item.memberId, memberId: item.memberId,
memberRoleId:item.memberRoleId, memberRoleId: item.memberRoleId,
mainPic:item.imgUrl, mainPic: item.imgUrl,
purchaseCount: item.purchaseCount purchaseCount: item.purchaseCount
}) })
}) })
memberRowCtl.setSelectRow(arr); memberRowCtl.setSelectRow(arr);
memberRowCtl.setSelectedRowKeys(editData.inquiryListProductRequests.map(v => v.productId)) memberRowCtl.setSelectedRowKeys(editData.inquiryListProductRequests.map(v => v.productId))
setgoodsList(editData.inquiryListProductRequests); setgoodsList(editData.inquiryListProductRequests);
setinquiryGoods(inquiry)
} }
}, [editData]) }, [editData])
...@@ -216,7 +215,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -216,7 +215,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
cancel={handleCancelAddMember} cancel={handleCancelAddMember}
visible={visibleChannelMember} visible={visibleChannelMember}
forceRender={visibleChannelMember} forceRender={visibleChannelMember}
resetModal={{destroyOnClose: true, forceRender: true}} resetModal={{ destroyOnClose: true, forceRender: true }}
columns={columnsSetMember} columns={columnsSetMember}
rowSelection={memberRowSelection} rowSelection={memberRowSelection}
fetchTableData={params => fetchGoodsList(params)} fetchTableData={params => fetchGoodsList(params)}
......
...@@ -170,6 +170,7 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -170,6 +170,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
fetchTableData={params => fetchMemberList(params)} fetchTableData={params => fetchMemberList(params)}
modalType='selectRfqOrder' modalType='selectRfqOrder'
searchName='orderNo' searchName='orderNo'
forceRender={true}
tableProps={{ tableProps={{
rowKey: 'orderId', rowKey: 'orderId',
}} }}
......
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