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

Merge branch 'dev' into test

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