Commit 4bf65218 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理销售订单物流单入库单跳转,处理采购下单签电子合同校验问题

parent 9f5904b5
...@@ -71,9 +71,9 @@ export default { ...@@ -71,9 +71,9 @@ export default {
'menu.commodityAbility.adjustRepository': '仓位库存调拨', 'menu.commodityAbility.adjustRepository': '仓位库存调拨',
'menu.commodityAbility.priceManage': '价格管理', 'menu.commodityAbility.priceManage': '价格管理',
'menu.commodityAbility.priceManage.priceStrategy': '价格策略', 'menu.commodityAbility.priceManage.priceStrategy': '价格策略',
'menu.commodityAbility.priceManage.priceStrategy.addStrategy': '新建商品价格策略', 'menu.commodityAbility.priceManage.addStrategy': '新建商品价格策略',
'menu.commodityAbility.priceManage.priceStrategy.editStrategy': '编辑商品价格策略', 'menu.commodityAbility.priceManage.editStrategy': '编辑商品价格策略',
'menu.commodityAbility.priceManage.priceStrategy.previewStrategy': '查看商品价格策略', 'menu.commodityAbility.priceManage.previewStrategy': '查看商品价格策略',
'menu.commodityAbility.priceManage.fastModifyPrice': '快捷修改单价', 'menu.commodityAbility.priceManage.fastModifyPrice': '快捷修改单价',
// 会员能力 // 会员能力
'menu.memberAbility': '会员', 'menu.memberAbility': '会员',
......
...@@ -35,9 +35,9 @@ export const columnsSetMember: any[] = [ ...@@ -35,9 +35,9 @@ export const columnsSetMember: any[] = [
export const columnsSetProduct: any[] = [ export const columnsSetProduct: any[] = [
{ {
title: '商品ID', title: '商品ID',
dataIndex: 'id', dataIndex: 'commodityId',
align: 'center', align: 'center',
key: 'id', key: 'commodityId',
}, },
{ {
title: '商品名称', title: '商品名称',
......
...@@ -69,7 +69,7 @@ const selectMemberAction = createFormActions() ...@@ -69,7 +69,7 @@ const selectMemberAction = createFormActions()
const PriceSetting:React.FC<PriceSettingProps> = (props) => { const PriceSetting:React.FC<PriceSettingProps> = (props) => {
const { addSchemaAction, schema, formSubmit, onFieldChange = () => {} } = props const { addSchemaAction, schema, formSubmit, onFieldChange = () => {} } = props
const [visibleChannelMember, setVisibleChannelMember] = useState(false) const [visibleChannelMember, setVisibleChannelMember] = useState(false)
const [visibleChannelRroduct, setVisibleChannelRroduct] = useState(false) const [visibleProduct, setVisibleProduct] = useState(false)
const [visibleUnitProduct, setVisibleUnitProduct] = useState(false) const [visibleUnitProduct, setVisibleUnitProduct] = useState(false)
const [modifyModal, setModifyModal] = useState(false) const [modifyModal, setModifyModal] = useState(false)
...@@ -161,16 +161,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -161,16 +161,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
priceTypeList: [1, 2], priceTypeList: [1, 2],
}) })
return res.data return res.data
// const shopType = addSchemaAction.getFieldValue('shopType')
// let shopInfo: any = GlobalConfig.web.shopInfo.filter(item => item.id === shopType)
// console.log(shopInfo, 'skhopIndo0')
// const res = await PublicApi.getProductCommodityCommonGetCommodityListBySeller({
// shopType,
// environment: shopInfo[0].environment,
// priceTypeList: [1, 2],
// })
// return res.data
} }
// 指定规格商品列表 // 指定规格商品列表
...@@ -219,7 +209,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -219,7 +209,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
message.error('请先选择商品') message.error('请先选择商品')
return false return false
} }
// setVisibleChannelRroduct(true) setVisibleUnitProduct(true)
} }
const handleSetProductPrice = (id: any) => { const handleSetProductPrice = (id: any) => {
...@@ -234,7 +224,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -234,7 +224,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
return false return false
} }
setVisibleChannelRroduct(true) setVisibleProduct(true)
} }
// 新增会员 // 新增会员
const tableAddMemberButton = const tableAddMemberButton =
...@@ -267,15 +257,39 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -267,15 +257,39 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
<Button style={{marginBottom: 16}} block icon={<PlusOutlined/>} onClick={handleAddProductUnitBtn} type='dashed'>选择商品规格</Button> <Button style={{marginBottom: 16}} block icon={<PlusOutlined/>} onClick={handleAddProductUnitBtn} type='dashed'>选择商品规格</Button>
</> </>
// : null // : null
const tableProductColumns = [ const tableProductColumns = [
{ dataIndex: 'memberId', title: 'ID', }, // { dataIndex: 'memberId', title: 'ID', },
{ dataIndex: 'name', title: '商品名称' }, {
{ dataIndex: 'memberTypeName', title: '颜色' }, dataIndex: 'name',
{ dataIndex: 'memberTypeName', title: '尺码' }, title: '商品名称',
{ dataIndex: 'memberTypeName', title: '对应货品' }, },
{ dataIndex: 'memberTypeName', title: '单价(元)' },
{ {
dataIndex: 'ctl', title: '操作', render: (_, record) => <> dataIndex: 'memberTypeName',
title: '颜色',
},
{
dataIndex: 'memberTypeName',
title: '尺码'
},
{
dataIndex: 'memberTypeName',
title: '对应货品'
},
{
dataIndex: 'memberTypeName',
title: '单价(元)',
render: (text, record) => {
if (!text || JSON.stringify(text)==='{}') return null
return Object.keys(text).map((v, i) => {
return <><span key={i}>{v==='0-0'?'':`${v}:`} <span style={{color:'red'}}>{priceType===3?'':'¥'}{text[v]}</span></span><br /></>
})
}
},
{
dataIndex: 'ctl',
title: '操作',
render: (_, record) => <>
<Button type='link' onClick={() => handleDeleteProductTable(record.productId)}>删除</Button> <Button type='link' onClick={() => handleDeleteProductTable(record.productId)}>删除</Button>
<Button type='link' onClick={() => handleSetProductPrice(record.productId)}>设置价格</Button> <Button type='link' onClick={() => handleSetProductPrice(record.productId)}>设置价格</Button>
</> </>
...@@ -285,7 +299,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -285,7 +299,6 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
// 选择商品 // 选择商品
const connectProduct = <div className='connectBtn' onClick={handleAddProductBtn}><LinkOutlined style={{marginRight: 4}}/>选择</div> const connectProduct = <div className='connectBtn' onClick={handleAddProductBtn}><LinkOutlined style={{marginRight: 4}}/>选择</div>
// 仓位设置表单提交 // 仓位设置表单提交
const handleSubmit = async (values) => { const handleSubmit = async (values) => {
formSubmit && formSubmit(values) formSubmit && formSubmit(values)
...@@ -304,23 +317,24 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -304,23 +317,24 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
// 商品添加弹窗控制 // 商品添加弹窗控制
const handleOkAddProduct = async () => { const handleOkAddProduct = async () => {
setVisibleChannelRroduct(false) setVisibleProduct(false)
const selectResult = productRowCtl.selectRow[0] const selectResult = productRowCtl.selectRow[0]
if (!selectResult) { if (!selectResult) {
return null return null
} }
console.log(selectResult,'selectResult')
const goodsId = selectResult.goodsId const goodsId = selectResult.goodsId
setProductState(selectResult) setProductState(selectResult)
addSchemaAction.setFieldValue('productName', selectResult.name) addSchemaAction.setFieldValue('productName', selectResult.name)
addSchemaAction.setFieldValue('category', selectResult.customerCategoryName) addSchemaAction.setFieldValue('productId', selectResult.commodityId)
addSchemaAction.setFieldValue('brand', selectResult.brandName) // addSchemaAction.setFieldValue('category', selectResult.customerCategoryName)
addSchemaAction.setFieldValue('unit', selectResult.unitName) // addSchemaAction.setFieldValue('brand', selectResult.brandName)
addSchemaAction.setFieldValue('productId', selectResult.id) // addSchemaAction.setFieldValue('unit', selectResult.unitName)
addSchemaAction.setFieldState('inventory', state => { // addSchemaAction.setFieldState('inventory', state => {
state.props["x-props"] = { // state.props["x-props"] = {
addonAfter: <div style={{marginLeft: 4}}>{selectResult.unitName}</div> // addonAfter: <div style={{marginLeft: 4}}>{selectResult.unitName}</div>
} // }
}) // })
// 商品有可能没有货品, 没有货品时不请求 // 商品有可能没有货品, 没有货品时不请求
if (goodsId) { if (goodsId) {
...@@ -349,7 +363,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -349,7 +363,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
} }
const handleCancelAddProduct = () => { const handleCancelAddProduct = () => {
setVisibleChannelRroduct(false) setVisibleProduct(false)
} }
// 规格商品添加弹窗控制 // 规格商品添加弹窗控制
...@@ -358,7 +372,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -358,7 +372,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
} }
const handleCancelAddSpec = () => { const handleCancelAddSpec = () => {
setVisibleUnitProduct(false)
} }
const paginationChange = async (page: number, size: number) => { const paginationChange = async (page: number, size: number) => {
...@@ -506,7 +520,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => { ...@@ -506,7 +520,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
modalTitle='选择商品' modalTitle='选择商品'
confirm={handleOkAddProduct} confirm={handleOkAddProduct}
cancel={handleCancelAddProduct} cancel={handleCancelAddProduct}
visible={visibleChannelRroduct} visible={visibleProduct}
columns={columnsSetProduct} columns={columnsSetProduct}
rowSelection={productRowSelection} rowSelection={productRowSelection}
fetchTableData={params => fetchProductList(params)} fetchTableData={params => fetchProductList(params)}
......
...@@ -206,23 +206,11 @@ export const setPriceSchema: ISchema = { ...@@ -206,23 +206,11 @@ export const setPriceSchema: ISchema = {
}, },
required: true required: true
}, },
category: {
type: 'string',
display: false
},
brand: {
type: 'string',
display: false
},
unit: {
type: 'string',
display: false
},
productId: { productId: {
type: 'string', type: 'string',
display: false display: false
}, },
inventoryDeductWay: { priceType: {
type: 'radio', type: 'radio',
title: '商品定价', title: '商品定价',
required: true, required: true,
...@@ -237,7 +225,19 @@ export const setPriceSchema: ISchema = { ...@@ -237,7 +225,19 @@ export const setPriceSchema: ISchema = {
} }
], ],
default: 1 default: 1
} },
// category: {
// type: 'string',
// display: false
// },
// brand: {
// type: 'string',
// display: false
// },
// unit: {
// type: 'string',
// display: false
// },
} }
} }
} }
......
...@@ -184,6 +184,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -184,6 +184,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'deliveryNo', dataIndex: 'deliveryNo',
align: 'center', align: 'center',
key: 'deliveryNo', key: 'deliveryNo',
render: text => <a href={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?deliveryNo=${text}`}>{text}</a>
}, },
{ {
title: '发货时间', title: '发货时间',
...@@ -197,6 +198,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -197,6 +198,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'logisticsNo', dataIndex: 'logisticsNo',
align: 'center', align: 'center',
key: 'logisticsNo', key: 'logisticsNo',
render: text => <a href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${data.orderNo}`}>{text}</a>
}, },
{ {
title: '物流公司', title: '物流公司',
......
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd' import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants' import { PurchaseOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
// 一级待审核订单 // 一级待审核订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementReviewedListOne(params) const { data } = await PublicApi.getOrderProcurementReviewedListOne(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref, ref,
rowSelection, rowSelection,
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedAll) const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedAll)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
if (rowSelectionCtl.selectRow.length === 0) { if (rowSelectionCtl.selectRow.length === 0) {
message.error('请先勾选订单') message.error('请先勾选订单')
return ; return ;
} }
const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER) const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER)
if (canBitch) { if (canBitch) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
ref.current.reload() ref.current.reload()
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
} }
} else { } else {
message.error('只能批量提交内部状态为审核中的订单') message.error('只能批量提交内部状态为审核中的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button> <Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
...@@ -297,10 +297,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -297,10 +297,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
if(!judgementByCount || judgementByCount.includes(false)){ if(!judgementByCount || judgementByCount.includes(false)){
throw new Error('请填写商品采购数量') throw new Error('请填写商品采购数量')
} }
// 校验简单电子合同必选 // // 校验简单电子合同必选
if(processEnum === 24 && !usingElectronicContracts){ // if(processEnum === 24 && !usingElectronicContracts){
throw new Error('此订单必须签署电子合同') // throw new Error('此订单必须签署电子合同')
} // }
// logistics render字段字符串化 // logistics render字段字符串化
params.orderProductRequests = params.orderProductRequests.map(item => { params.orderProductRequests = params.orderProductRequests.map(item => {
let logistics: any = { ...item.logistics, render: item.logistics?.render ? JSON.stringify(item.logistics.render) : '' }; let logistics: any = { ...item.logistics, render: item.logistics?.render ? JSON.stringify(item.logistics.render) : '' };
......
import React from 'react' import React from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd' import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import { DatePicker } from '@formily/antd-components' import { DatePicker } from '@formily/antd-components'
import { useSelfTable } from './model/useReadyAddOrder' import { useSelfTable } from './model/useReadyAddOrder'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants' import { PurchaseOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
// 待新增订单 // 待新增订单
export interface ReadyAddOrderProps {} export interface ReadyAddOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementStayAddList(params) const { data } = await PublicApi.getOrderProcurementStayAddList(params)
return data return data
} }
// TODO // TODO
const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => { const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const { run: deleteRun } = useHttpRequest(PublicApi.postOrderProcurementOrderDeleteAll) const { run: deleteRun } = useHttpRequest(PublicApi.postOrderProcurementOrderDeleteAll)
const { loading: submitLoading, run: submitRun } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmitExamineAll) const { loading: submitLoading, run: submitRun } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmitExamineAll)
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable() const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
const handleMenuClick = async (e) => { const handleMenuClick = async (e) => {
switch(e.key) { switch(e.key) {
case '1': { case '1': {
// 批量删除 // 批量删除
const canDelete = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER) const canDelete = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (canDelete) { if (canDelete) {
const { code } = await deleteRun({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await deleteRun({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
ref.current.reload() ref.current.reload()
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
} }
} else { } else {
message.error('只能删除内部状态为未审核过的订单') message.error('只能删除内部状态为未审核过的订单')
} }
break; break;
} }
} }
} }
const handleBitchPush = async () => { const handleBitchPush = async () => {
const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER) const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (canBitch) { if (canBitch) {
const { code } = await submitRun({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await submitRun({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
ref.current.reload() ref.current.reload()
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
} }
} else { } else {
message.error('只能提交审核待新增的订单') message.error('只能提交审核待新增的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button <Button
icon={<PlusCircleOutlined/>} icon={<PlusCircleOutlined/>}
type='primary' type='primary'
// onClick={() => history.push('/memberCenter/tranactionAbility/purchaseOrder/orderDetail')} // onClick={() => history.push('/memberCenter/tranactionAbility/purchaseOrder/orderDetail')}
onClick={() => history.push('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/add')} onClick={() => history.push('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/add')}
> >
新建 新建
</Button> </Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交审核</Button> <Button onClick={handleBitchPush} loading={submitLoading}>批量提交审核</Button>
<DropDeleteDown> <DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}> <Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}> <Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除 批量删除
</Menu.Item> </Menu.Item>
</Menu> </Menu>
</DropDeleteDown> </DropDeleteDown>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
ReadyAddOrder.defaultProps = {} ReadyAddOrder.defaultProps = {}
export default ReadyAddOrder export default ReadyAddOrder
\ No newline at end of file
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd' import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
// 待归档订单 // 待归档订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderFiledOrderList(params) const { data } = await PublicApi.getOrderFiledOrderList(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref, ref,
rowSelection, rowSelection,
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderFiledOrderAddAll) const { run, loading } = useHttpRequest(PublicApi.postOrderFiledOrderAddAll)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
if (rowSelectionCtl.selectRow.length === 0) { if (rowSelectionCtl.selectRow.length === 0) {
message.error('请先勾选订单') message.error('请先勾选订单')
return ; return ;
} }
const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.FILLING_ORDER) const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.FILLING_ORDER)
if (canBitch) { if (canBitch) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
ref.current.reload() ref.current.reload()
} }
} else { } else {
message.error('只能批量提交内部状态为待确认归档的订单') message.error('只能批量提交内部状态为待确认归档的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button> <Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
import React from 'react' import React from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd' import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PurchaseOrderOutWorkState, PurchaseOrderInsideWorkState } from '@/constants' import { PurchaseOrderOutWorkState, PurchaseOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
// 待提交订单 // 待提交订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementSubmitList(params) const { data } = await PublicApi.getOrderProcurementSubmitList(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref, ref,
rowSelection, rowSelection,
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmitAll) const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmitAll)
const handleBitchPush = async () => { const handleBitchPush = async () => {
const canBitch = !rowSelectionCtl.selectRow.some(v => v.externalState !== PurchaseOrderOutWorkState.SUBMIT_ORDER || v.interiorState !== PurchaseOrderInsideWorkState.SUBMIT_ORDER) const canBitch = !rowSelectionCtl.selectRow.some(v => v.externalState !== PurchaseOrderOutWorkState.SUBMIT_ORDER || v.interiorState !== PurchaseOrderInsideWorkState.SUBMIT_ORDER)
if (canBitch) { if (canBitch) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
ref.current.reload() ref.current.reload()
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
} }
} else { } else {
message.error('只能提交内部状态为审核通过并且外部状态为待提交的订单') message.error('只能提交内部状态为审核通过并且外部状态为待提交的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
rowSelection={rowSelection} rowSelection={rowSelection}
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleBitchPush} loading={loading}>批量提交</Button> <Button onClick={handleBitchPush} loading={loading}>批量提交</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
import React from 'react' import React from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu } from 'antd' import { Card, Button, Space, Dropdown, Menu } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
// 二级待审核订单 // 二级待审核订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementReviewedListTwo(params) const { data } = await PublicApi.getOrderProcurementReviewedListTwo(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref ref
} = useSelfTable() } = useSelfTable()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'}) const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedAllTwo) const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedAllTwo)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
const { code } = await run({ const { code } = await run({
ids: rowSelectionCtl.selectedRowKeys ids: rowSelectionCtl.selectedRowKeys
}) })
if (code === 1000) { if (code === 1000) {
// 清空选中的值 // 清空选中的值
ref.current.reload() ref.current.reload()
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button> <Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd' import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
// 一级待审核订单 // 一级待审核订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderSubmittedReviewOrderOneList(params) const { data } = await PublicApi.getOrderSubmittedReviewOrderOneList(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref, ref,
rowSelection, rowSelection,
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderOneAll) const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderOneAll)
const handleBitchPush = async () => { const handleBitchPush = async () => {
if (rowSelectionCtl.selectedRowKeys.length > 0) { if (rowSelectionCtl.selectedRowKeys.length > 0) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
ref.current.reload() ref.current.reload()
} }
} else { } else {
message.error('请勾选要审核的订单') message.error('请勾选要审核的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button> <Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd' import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
// 待归档订单 // 待归档订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderListOfOrdersToBeFiled(params) const { data } = await PublicApi.getOrderListOfOrdersToBeFiled(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref, ref,
rowSelection, rowSelection,
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderOfOrdersToBeFiledAll) const { run, loading } = useHttpRequest(PublicApi.postOrderOfOrdersToBeFiledAll)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
if (rowSelectionCtl.selectRow.length === 0) { if (rowSelectionCtl.selectRow.length === 0) {
message.error('请先勾选订单') message.error('请先勾选订单')
return ; return ;
} }
const canBitch = !rowSelectionCtl.selectRow.some(v => v.purchaseOrderInteriorState !== SaleOrderInsideWorkState.FILLING_ORDER) const canBitch = !rowSelectionCtl.selectRow.some(v => v.purchaseOrderInteriorState !== SaleOrderInsideWorkState.FILLING_ORDER)
if (canBitch) { if (canBitch) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) { if (code === 1000) {
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
ref.current.reload() ref.current.reload()
} }
} else { } else {
message.error('只能批量提交内部状态为待确认归档的订单') message.error('只能批量提交内部状态为待确认归档的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button> <Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
import React from 'react' import React from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu } from 'antd' import { Card, Button, Space, Dropdown, Menu } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown' import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
// 二级待审核订单 // 二级待审核订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderSubmittedReviewOrderTwoList(params) const { data } = await PublicApi.getOrderSubmittedReviewOrderTwoList(params)
return data return data
} }
// TODO // TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref ref
} = useSelfTable() } = useSelfTable()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'}) const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderTwoAll) const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderTwoAll)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
const { code } = await run({ const { code } = await run({
ids: rowSelectionCtl.selectedRowKeys ids: rowSelectionCtl.selectedRowKeys
}) })
if (code === 1000) { if (code === 1000) {
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
ref.current.reload() ref.current.reload()
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'id'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
formilyProps={{ formilyProps={{
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema, schema: tableListSchema,
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}, },
components: { components: {
DateRangePickerUnix, DateRangePickerUnix,
Submit Submit
} }
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
} }
}} }}
formilyChilds={{ formilyChilds={{
children: <Space> children: <Space>
<Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button> <Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button>
</Space>, </Space>,
layouts: { layouts: {
span: 8 span: 8
} }
}} }}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
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