Commit 1abe915c authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理商品筛选上架商品批量导出二维码异常

parent 486fa92d
......@@ -3,7 +3,7 @@ import { TableRowSelection } from 'antd/es/table/interface'
import { mergeArrByKey, dupliArr } from '@/utils'
import { useSelections } from '@umijs/hooks'
interface useRowSelectionTableCtl {
export interface useRowSelectionTableCtl {
selectRow: any[],
selectedRowKeys: any[],
setSelectRow(rows: any[]),
......@@ -120,4 +120,4 @@ export const useRowSelectionTable = (options: useRowSelectionOptions = {}): [Tab
}
return [rowSelection, { selectRow, setSelectRow, selectedRowKeys, setSelectedRowKeys, appendSelectRow, appendSelectRowKeys }]
}
\ No newline at end of file
}
......@@ -167,6 +167,8 @@ export default {
'transaction_components.qitayaoqiu': 'Other requirements',
'transaction_components.jiaofuxinxi': 'Delivery Information',
'transaction_components.qitaxinxi': 'Other information',
'transaction_components.pintuanxinxi': 'Order group information',
'transaction_components.pintuanzhuangtai': 'Spell group status',
'transaction_components.kaijuleixing': 'Issuing Type',
'transaction_components.fapiaozhonglei': 'Invoice type',
'transaction_components.fapiaotaitou': 'Invoice header',
......
......@@ -167,6 +167,8 @@ export default {
'transaction_components.qitayaoqiu': '기타 요구 사항',
'transaction_components.jiaofuxinxi': '제공 정보',
'transaction_components.qitaxinxi': '기타 정보',
'transaction_components.pintuanxinxi': '주문서 묶음 정보',
'transaction_components.pintuanzhuangtai': '단체 모음 상태',
'transaction_components.kaijuleixing': '구형',
'transaction_components.fapiaozhonglei': '영수증 종류',
'transaction_components.fapiaotaitou': '영수증',
......
......@@ -167,6 +167,8 @@ export default {
'transaction_components.qitayaoqiu': '其他要求',
'transaction_components.jiaofuxinxi': '交付信息',
'transaction_components.qitaxinxi': '其他信息',
'transaction_components.pintuanxinxi': '订单拼团信息',
'transaction_components.pintuanzhuangtai': '拼团状态',
'transaction_components.kaijuleixing': '开具类型',
'transaction_components.fapiaozhonglei': '发票种类',
'transaction_components.fapiaotaitou': '发票抬头',
......
......@@ -33,7 +33,7 @@ import UpperProductModalTable from './components/upperProductModalTable'
import { getProductCommodityGetCommodityList, getProductCommodityGetShop, GetProductCommodityGetShopResponse, postProductCommodityApplyCheckCommodity, postProductCommodityCopyCommodity, postProductCommodityDeleteBatchCommodity, postProductCommodityExportCommodityQrCode, postProductCommodityGetShopBatch, postProductCommodityOffPublishCommodity, postProductCommodityOffPublishCommodityBatch, postProductCommodityPublishCommodity, postProductCommodityPublishCommodityBatch } from '@/services/ProductV2Api'
import { getTemplateWebMemberShopWebFindCurrMemberShop } from '@/services/TemplateV2Api'
import PutawayGuide from './components/putawayGuide'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { useRowSelectionTable, useRowSelectionTableCtl } from '@/hooks/useRowSelectionTable'
const { confirm } = Modal;
......@@ -60,6 +60,7 @@ const Products: React.FC<{}> = () => {
const [exportQrcodeModal, setExportQrcodeModal] = useState<boolean>(false)
const [exportLoading, setExportLoading] = useState<boolean>(false)
const currentRefRow = useRef<any>([])
const currentCtrlRef = useRef<useRowSelectionTableCtl>()
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' });
const upperRef = useRef<any>({})
const [giudeVisible, setGiudeVisible] = useState<boolean>(false)
......@@ -69,6 +70,8 @@ const Products: React.FC<{}> = () => {
const { searchData, formatInitialValue, clear } = useSetSearchValueInTable()
useEffect(() => {
console.log(RowCtl.selectRow)
currentCtrlRef.current = RowCtl
currentRefRow.current = RowCtl.selectRow
}, [RowCtl])
......@@ -477,7 +480,8 @@ const Products: React.FC<{}> = () => {
} else {
postProductCommodityOffPublishCommodityBatch({ idList: selectedRowKeys }).then(res => {
ref.current.reload()
RowCtl.setSelectedRowKeys([])
currentCtrlRef.current.setSelectedRowKeys([])
currentCtrlRef.current.setSelectRow([])
})
}
},
......@@ -508,6 +512,8 @@ const Products: React.FC<{}> = () => {
handleBatch(e.key)
} else if(e.key === '5') {
if(!currentRefRow.current.every(item => item.status === 5)) {
currentCtrlRef.current.setSelectedRowKeys([])
currentCtrlRef.current.setSelectRow([])
return message.error(intl.formatMessage({ id: 'commodity.products.schema.fastSchema.qingxuanzeshangjiashangpin' }))
}
selectedRowKeys.length ? setExportQrcodeModal(true) : message.error(intl.formatMessage({ id: 'commodity.products.handleBatchDelete.error' }))
......
......@@ -103,6 +103,10 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
{ title: intl.formatMessage({id: 'transaction_components.qitayaoqiu'}), name: 'remark' },
]
const promotionInfo = [
{ title: intl.formatMessage({id: 'transaction_components.pintuanzhuangtai'}), name: 'promotionStatusName' },
]
const applyInvoice = () => {
setApplyVisible(true)
reload()
......@@ -210,6 +214,13 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
</MellowCard>
</Col>
{
data.groupOrder ? <Col span={24} style={{ marginTop: 24 }}>
<MellowCard title={intl.formatMessage({id: 'transaction_components.pintuanxinxi'})} fullHeight>
<RenderCard infoList={promotionInfo} dataSource={{...data, ...data.requirement}} />
</MellowCard>
</Col> : null
}
{
(data.orderKind === OrderKindType.SRM_ORDER) || !data.hasContract ?
null
:
......
......@@ -90,8 +90,7 @@ export const useSelfTable = () => {
]
const handleConfirm = async (record) => {
// history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/detail?id=${record.orderId}&batchNo=${record.batchNo}`)
console.log(record)
}
return {
......
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