Commit 29f50b81 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:

parent 1ff03345
......@@ -24,6 +24,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import ModalTable from '@/components/ModalTable'
import { clearModalParams } from '@/utils'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
// import styles from './index.less'
const formActions = createFormActions();
......@@ -82,10 +83,11 @@ const Attribute: React.FC<{}> = () => {
const ref = useRef<any>({})
const syncRef = useRef<any>({})
const [syncVisible, setSyncVisible] = useState<boolean>(false)
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
// const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
// const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [syncLoading, setSyncLoading] = useState<boolean>(false)
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
......@@ -201,23 +203,23 @@ const Attribute: React.FC<{}> = () => {
setSyncVisible(true)
}
const rowSelection: any = {
type: 'checkbox',
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows)
setSelectedRowKeys(selectedRowKeys)
}
};
// const rowSelection: any = {
// type: 'checkbox',
// selectedRowKeys: selectedRowKeys,
// onChange: (selectedRowKeys: any, selectedRows: any) => {
// setSelectRow(selectedRows)
// setSelectedRowKeys(selectedRowKeys)
// }
// };
const handleAsyncOk = () => {
setSyncLoading(true)
if(selectedRowKeys.length) {
if(rowSelectionCtl.selectedRowKeys.length) {
// @ts-ignore
PublicApi.postProductCustomerSyncAttribute({idList: selectedRowKeys}).then(res => {
PublicApi.postProductCustomerSyncAttribute({idList: rowSelectionCtl.selectedRowKeys}).then(res => {
if(res.code === 1000) {
ref.current.reload()
setSelectedRowKeys([])
rowSelectionCtl.setSelectedRowKeys([])
}
setSyncVisible(false)
setSyncLoading(false)
......
......@@ -9,7 +9,7 @@ import {
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { MenuTree, StandardTable } from 'god';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
import { useTreeTabs } from '@/hooks/useTreeTabs';
......@@ -21,6 +21,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import { ISchema } from '@formily/antd';
import { clearModalParams } from '@/utils';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const treeActions = createTreeActions()
......@@ -91,8 +92,9 @@ const PropertyValue: React.FC<{}> = () => {
const [syncVisible, setSyncVisible] = useState(false)
const [syncLoading, setSyncLoading] = useState<boolean>(false)
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
// const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
// const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const {
treeData,
......@@ -282,26 +284,26 @@ const PropertyValue: React.FC<{}> = () => {
setSyncVisible(true)
}
const rowSelection: any = {
type: 'checkbox',
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows)
setSelectedRowKeys(selectedRowKeys)
}
};
// const rowSelection: any = {
// type: 'checkbox',
// selectedRowKeys: selectedRowKeys,
// onChange: (selectedRowKeys: any, selectedRows: any) => {
// setSelectRow(selectedRows)
// setSelectedRowKeys(selectedRowKeys)
// }
// };
const handleAsyncOk = () => {
setSyncLoading(true)
if(selectedRowKeys.length) {
if(rowSelectionCtl.selectedRowKeys.length) {
// @ts-ignore
PublicApi.postProductCustomerSyncAttributeValue({idList: selectedRowKeys}).then(res => {
PublicApi.postProductCustomerSyncAttributeValue({idList: rowSelectionCtl.selectedRowKeys}).then(res => {
if(res.code === 1000) {
if(ref?.current?.reload) {
ref.current.reload()
}
resetMenu()
setSelectedRowKeys([])
rowSelectionCtl.setSelectedRowKeys([])
}
setSyncVisible(false)
setSyncLoading(false)
......
......@@ -379,7 +379,6 @@ export const materialInfoColumns: any[] = [
dataIndex: 'amount',
align: 'center',
key: 'amount',
render: (t) => `¥${t}`
},
// 接口调用
{
......
......@@ -155,6 +155,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const address = deliveryAddress[0]
return {
...item,
spec: item.type,
quotedSpec: item.relevanceProductType,
deliveryType: item.logistics,
addressId: address.id,
address: address.fullAddress,
......
......@@ -37,24 +37,23 @@ const fetchOrderMode = async () => {
}
const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const { run: deleteRun } = useHttpRequest(PublicApi.postOrderProcurementOrderDeleteAll)
const { loading: submitLoading, run: submitRun } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmitExamineAll)
const { run: deleteRun } = useHttpRequest(PublicApi.postOrderBuyerCreateDeleteBatch)
const { loading: submitLoading, run: submitRun } = useHttpRequest(PublicApi.postOrderBuyerCreateSubmitBatch)
const currentRef = useRef<any>({})
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
const handleMenuClick = async (e) => {
switch(e.key) {
case '1': {
// 批量删除
const canDelete = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (canDelete) {
const { code } = await deleteRun({ids: rowSelectionCtl.selectedRowKeys})
if (rowSelectionCtl.selectRow.length) {
const { code } = await deleteRun(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
if (code === 1000) {
ref.current.reload()
rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('只能删除内部状态为未审核过的订单')
message.error('请先选择待新增的订单')
}
break;
}
......@@ -63,7 +62,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const handleBitchPush = async () => {
if (rowSelectionCtl.selectRow.length) {
const { code } = await submitRun({ids: rowSelectionCtl.selectedRowKeys})
const { code } = await submitRun(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
if (code === 1000) {
ref.current.reload()
rowSelectionCtl.setSelectRow([])
......
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