Commit cd54cd87 authored by XieZhiXiong's avatar XieZhiXiong
parents ea7d5519 033cd60f
...@@ -219,12 +219,12 @@ const LogisticsForm: React.FC<Iprops> = (props) => { ...@@ -219,12 +219,12 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
deliveryType !== 3 && <Form.Item deliveryType !== 3 && <Form.Item
name="sendAddress" name="sendAddress"
label="发货地址" label="发货地址"
rules={[ // rules={[
{ // {
required: true, // required: true,
message: '请选择发货地址' // message: '请选择发货地址'
}, // },
]} // ]}
> >
<Select <Select
placeholder="请选择发货地址" placeholder="请选择发货地址"
......
...@@ -131,7 +131,7 @@ const ApproveSchema = { ...@@ -131,7 +131,7 @@ const ApproveSchema = {
labelAlign: 'top', labelAlign: 'top',
}, },
properties: { properties: {
state: { agree: {
type: 'radio', type: 'radio',
enum: [ enum: [
{ label: '审核通过', value: 1 }, { label: '审核通过', value: 1 },
...@@ -144,7 +144,7 @@ const ApproveSchema = { ...@@ -144,7 +144,7 @@ const ApproveSchema = {
"x-linkages": [ "x-linkages": [
{ {
type: 'value:visible', type: 'value:visible',
target: 'cause', target: 'reason',
condition: "{{$value === 0}}" condition: "{{$value === 0}}"
}, },
{ {
...@@ -159,7 +159,7 @@ const ApproveSchema = { ...@@ -159,7 +159,7 @@ const ApproveSchema = {
} }
] ]
}, },
cause: { reason: {
type: 'textarea', type: 'textarea',
"x-component-props": { "x-component-props": {
rows: 4, rows: 4,
......
import React, { useContext, useRef } from 'react' import React, { useContext, useRef } from 'react'
import { Modal, Button, message } from 'antd' import { Button, message } from 'antd'
import { createFormActions, ISchema } from '@formily/antd' import { createFormActions, ISchema } from '@formily/antd'
import ModalForm from '@/components/ModalForm' import ModalForm from '@/components/ModalForm'
import { history } from 'umi' import { history } from 'umi'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import { OrderDetailContext } from '../../_public/order/context' import { OrderDetailContext } from '../../_public/order/context'
import { fetchOptions } from '@/pages/balance/common'
export interface OrderElectronModalProps { export interface OrderElectronModalProps {
currentRef: any currentRef: any
...@@ -84,7 +82,7 @@ const schema: ISchema = { ...@@ -84,7 +82,7 @@ const schema: ISchema = {
type: 'string', type: 'string',
display: false, display: false,
}, },
state: { agree: {
type: 'radio', type: 'radio',
title: '是否审核通过', title: '是否审核通过',
enum: [ enum: [
...@@ -95,12 +93,12 @@ const schema: ISchema = { ...@@ -95,12 +93,12 @@ const schema: ISchema = {
"x-linkages": [ "x-linkages": [
{ {
type: 'value:visible', type: 'value:visible',
target: 'cause', target: 'reason',
condition: "{{$value === 0}}" condition: "{{$value === 0}}"
} }
] ]
}, },
cause: { reason: {
type: 'textarea', type: 'textarea',
"x-component-props": { "x-component-props": {
rows: 4, rows: 4,
...@@ -127,7 +125,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -127,7 +125,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const formRef = useRef<any>({}) const formRef = useRef<any>({})
const { data } = useContext(OrderDetailContext) const { data } = useContext(OrderDetailContext)
const { run, loading } = useHttpRequest(PublicApi.postContractContractSignSaleSignContractCreate, {ctlType: 'none'}) const { run, loading } = useHttpRequest(PublicApi.postContractContractSignSaleSignContractCreate, {ctlType: 'none'})
const { run: submitRun, loading: submitLoading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrder) const { run: submitRun, loading: submitLoading } = useHttpRequest(PublicApi.postOrderVendorValidateSubmit)
const createElectron = async () => { const createElectron = async () => {
const contractTemplateId = schemaActions.getFieldValue('contractTemplateId') const contractTemplateId = schemaActions.getFieldValue('contractTemplateId')
if (data.isElectronicContract === 1 && !contractTemplateId) { if (data.isElectronicContract === 1 && !contractTemplateId) {
...@@ -156,10 +154,9 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -156,10 +154,9 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const electronBtn = <Button style={{marginLeft: 24}} onClick={createElectron} loading={loading}>生成电子合同</Button> const electronBtn = <Button style={{marginLeft: 24}} onClick={createElectron} loading={loading}>生成电子合同</Button>
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
const params = { const params = {
...value, ...value,
id: data.id, orderId: data.orderId,
} }
const { code } = await submitRun(params) const { code } = await submitRun(params)
if (code === 1000) { if (code === 1000) {
...@@ -189,9 +186,6 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -189,9 +186,6 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
effects={($, actions) => { effects={($, actions) => {
$('onFormInit').subscribe(async () => { $('onFormInit').subscribe(async () => {
if (data.isElectronicContract === 1) { if (data.isElectronicContract === 1) {
// useAsyncSelect('contractTemplateId', async () => (await PublicApi.getContractSelectListContractTemplate()).data, ['name', 'id']).then(()=>{
// actions.setFieldValue("contractTemplateId", data.contractTemplateId)
// })
const res = await PublicApi.getContractSelectListContractTemplate() const res = await PublicApi.getContractSelectListContractTemplate()
let options = res.data.map(item => ({ let options = res.data.map(item => ({
label: item.name, label: item.name,
...@@ -212,9 +206,6 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -212,9 +206,6 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
}) })
actions.setFieldValue('usingElectronicContracts', data.usingElectronicContracts || 0) actions.setFieldValue('usingElectronicContracts', data.usingElectronicContracts || 0)
} }
$('onFieldValueChange', 'contractTemplateId').subscribe(state => {
// console.log(state.props)
})
// 采购合同下单 隐藏使用电子合同 // 采购合同下单 隐藏使用电子合同
if(data?.orderModel > 30) { if(data?.orderModel > 30) {
actions.setFieldState('usingElectronicContracts', state => { actions.setFieldState('usingElectronicContracts', state => {
......
...@@ -124,12 +124,12 @@ export const productColumns: any = [ ...@@ -124,12 +124,12 @@ export const productColumns: any = [
align: 'center', align: 'center',
key: 'unit' key: 'unit'
}, },
{ // {
title: '单价', // title: '单价',
dataIndex: 'price', // dataIndex: 'price',
align: 'center', // align: 'center',
key: 'price', // key: 'price',
}, // },
{ {
title: '已发货', title: '已发货',
dataIndex: 'delivered', dataIndex: 'delivered',
......
...@@ -158,9 +158,10 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -158,9 +158,10 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} else if (checked.id === 4) { // 余额支付 } else if (checked.id === 4) { // 余额支付
console.log('选择了余额支付') console.log('选择了余额支付')
setIsSpin(true) setIsSpin(true)
PublicApi.getPayAssetAccountGetUserBalance({ PublicApi.getPayAssetAccountBalance({
parentMemberId: data.vendorMemberId, fundMode: checked.fundMode,
parentMemberRoleId: data.vendorRoleId, vendorMemberId: data.vendorMemberId,
vendorRoleId: data.vendorRoleId,
}).then(res => { }).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
setBalanceInfo(res.data) setBalanceInfo(res.data)
......
...@@ -34,6 +34,7 @@ export const baseOrderListColumns: any = () => { ...@@ -34,6 +34,7 @@ export const baseOrderListColumns: any = () => {
dataIndex: 'vendorMemberName', dataIndex: 'vendorMemberName',
key: 'vendorMemberName', key: 'vendorMemberName',
ellipsis: true, ellipsis: true,
render: (t, r) => t ? t : r.memberName
}, },
{ {
title: '下单时间', title: '下单时间',
......
...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection'; ...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection';
const FirstApprovedOrderDetail: React.FC = () => { const FirstApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewed) const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidateGradeOne)
const approvedRef = useRef<any>({}) const approvedRef = useRef<any>({})
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
...@@ -24,7 +24,7 @@ const FirstApprovedOrderDetail: React.FC = () => { ...@@ -24,7 +24,7 @@ const FirstApprovedOrderDetail: React.FC = () => {
const handleSubmit = useCallback(() => { const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => { approvedRef.current.actions.submit().then(async ({values}) => {
const params = { const params = {
id: Number(id), orderId: Number(id),
...values ...values
} }
const result = await run(params) const result = await run(params)
......
...@@ -9,7 +9,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -9,7 +9,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
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 { PurchaseOrderInsideWorkState } from '@/constants/order'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import '../index.less' import '../index.less'
...@@ -18,12 +17,11 @@ import '../index.less' ...@@ -18,12 +17,11 @@ import '../index.less'
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementReviewedListOne(params) const { data } = await PublicApi.getOrderBuyerValidateGradeOnePage(params)
return data return data
} }
// TODO const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = () => {
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref, ref,
...@@ -31,23 +29,18 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -31,23 +29,18 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedAll) const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidateGradeOneBatch)
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 { code } = await run(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
if (canBitch) { if (code === 1000) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) ref.current.reload()
if (code === 1000) { rowSelectionCtl.setSelectRow([])
ref.current.reload() rowSelectionCtl.setSelectedRowKeys([])
rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('只能批量提交内部状态为审核中的订单')
} }
} }
return <PageHeaderWrapper> return <PageHeaderWrapper>
...@@ -57,7 +50,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -57,7 +50,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'orderId'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
......
...@@ -5,21 +5,12 @@ import { history } from 'umi' ...@@ -5,21 +5,12 @@ import { history } from 'umi'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants/order' import { PurchaseOrderInsideWorkState } from '@/constants/order'
// 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id', extendsSelection: { const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
getCheckboxProps: record => ({
// 不等于可提交审核的 都无法通过批量提交
disabled: record.interiorState !== PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER,
interiorState: record.interiorState,
})
}})
const handleSubmit = async (record) => { const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER) { history.push(`/memberCenter/tranactionAbility/purchaseOrder/firstApprovedOrder/detail?id=${record.orderId}`)
history.push(`/memberCenter/tranactionAbility/purchaseOrder/firstApprovedOrder/detail?id=${record.id}`)
}
// await PublicApi.postOrderQuotationBeReviewed({id}) // await PublicApi.postOrderQuotationBeReviewed({id})
// ref.current.reload() // ref.current.reload()
} }
......
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
// import { getOrderType } from '@/pages/transaction/effect'; import { getPurchaseOrderSelectOption } from '@/pages/transaction/effect';
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: any = () => { export const tableListSchema: any = () => {
// const OrderType = getOrderType() const res = getPurchaseOrderSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return { return {
type: 'object', type: 'object',
properties: { properties: {
orderNo: { orderNo: {
type: 'string', type: 'string',
"x-component": 'SearchFilter', "x-component": 'SearchFilter',
'x-component-props': { 'x-component-props': {
placeholder: '请输入订单编号', placeholder: '请输入订单编号',
align: 'flex-end', align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
}, },
"supplyMembersName": { },
type: 'string', [FORM_FILTER_PATH]: {
"x-component-props": { type: 'object',
placeholder: '请输入供应会员名称' 'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
} }
}, },
"type": { properties: {
type: 'string', digest: {
"x-component-props": { type: 'string',
placeholder: '请选择订单类型' 'x-component-props': {
placeholder: '请输入订单摘要',
}
}, },
// enum: OrderType.map(item => ({ "memberName": {
// label: item['name'], type: 'string',
// value: item['status'], "x-component-props": {
// })) placeholder: '请输入供应会员名称'
enum: [] }
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
}, },
}, "orderType": {
submit: { type: 'string',
'x-component': 'Submit', "x-component-props": {
'x-component-props': { placeholder: '请选择订单类型'
children: '查询', },
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
},
"[startDate, endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
// showTime: true,
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
}, },
}, },
}, },
}, }
} }
} }
} }
...@@ -64,6 +64,7 @@ export const procurementRenderField = (data) => { ...@@ -64,6 +64,7 @@ export const procurementRenderField = (data) => {
purchaseCount: item.quantity, purchaseCount: item.quantity,
taxInclusive: item.tax, taxInclusive: item.tax,
money: item.amount, money: item.amount,
imgUrl: item.logo,
// 冗余memberId memberRoleId查询自提地址使用 // 冗余memberId memberRoleId查询自提地址使用
memberId: data.vendorMemberId, memberId: data.vendorMemberId,
memberRoleId: data.vendorRoleId, memberRoleId: data.vendorRoleId,
...@@ -80,7 +81,6 @@ export const procurementProcessField = (value) => { ...@@ -80,7 +81,6 @@ export const procurementProcessField = (value) => {
skuId: item.productId, skuId: item.productId,
name: item.productName, name: item.productName,
logo: item.imgUrl, logo: item.imgUrl,
deliveryType: item.deliveryType.deliveryType,
quantity: item.purchaseCount, quantity: item.purchaseCount,
} }
}) })
......
...@@ -18,26 +18,28 @@ const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsync ...@@ -18,26 +18,28 @@ const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsync
ctx.setFieldState(productValue.path, state => { ctx.setFieldState(productValue.path, state => {
state.loading = true state.loading = true
}) })
// 折扣请求 // // 折扣请求
const asyncPriceRequests: any[] = await Promise.all(productData.filter(v => v.memberPrice === undefined).map(async v => { // const asyncPriceRequests: any[] = await Promise.all(productData.filter(v => v.memberPrice === undefined).map(async v => {
const {code, data} = await PublicApi.getMemberManageUpperCreditParamGet({ // const {code, data} = await PublicApi.getMemberManageUpperCreditParamGet({
parentMemberId: v.memberId, // parentMemberId: v.memberId,
parentMemberRoleId: v.memberRoleId // parentMemberRoleId: v.memberRoleId
}, {ttl: 60 * 1000, useCache: true}) // }, {ttl: 60 * 1000, useCache: true})
return code === 1000 ? { value: data.parameter, id: v.id } : { value: '', id: 0 } // return code === 1000 ? { value: data.parameter, id: v.id } : { value: '', id: 0 }
} // }
)) // ))
// 存在需要异步请求的, 则进行赋值 // // 存在需要异步请求的, 则进行赋值
if (asyncPriceRequests.length > 0) { // if (asyncPriceRequests.length > 0) {
const newData = productData.map((v, i) => { const newData = productData.map((v, i) => {
if (!v.memberPrice) { // if (!v.memberPrice) {
v.memberPrice = asyncPriceRequests.find(j => j.id === v.id)?.value || '' // v.memberPrice = asyncPriceRequests.find(j => j.id === v.id)?.value || ''
} // }
// // @ b2b订单不考虑会员折扣 字段固定100
v.discount = 100
return v return v
}) })
ctx.setFieldValue('products', newData) ctx.setFieldValue('products', newData)
} // }
ctx.setFieldState(productValue.path, state => { ctx.setFieldState(productValue.path, state => {
state.loading = false state.loading = false
}) })
......
...@@ -220,9 +220,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -220,9 +220,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const address = deliveryAddress[0] const address = deliveryAddress[0]
return { return {
...item, ...item,
spec: item.type,
quotedSpec: item.relevanceProductType,
deliveryType: item.logistics,
addressId: address.id, addressId: address.id,
address: address.fullAddress, address: address.fullAddress,
receiver: address.shipperName, receiver: address.shipperName,
......
import React, { useState, useCallback, useRef } from 'react'; import React, { useCallback } from 'react';
import { OrderDetailContext } from '../../../_public/order/context'; import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -12,12 +12,11 @@ import OrderDetailSection from '../../../components/orderDetailSection'; ...@@ -12,12 +12,11 @@ import OrderDetailSection from '../../../components/orderDetailSection';
const ReadySubmitOrderDetail: React.FC = () => { const ReadySubmitOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmit) const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidateSubmit)
const handleClick = useCallback(async () => { const handleClick = useCallback(async () => {
const params = { const params = {
id: Number(id), orderId: Number(id),
state: -1
} }
const result = await run(params) const result = await run(params)
......
import React from 'react' import React from 'react'
import { Card, Button, Space, message } from 'antd' import { Card, Button, Space } 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'
...@@ -9,40 +9,33 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -9,40 +9,33 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
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/order'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import '../index.less' import '../index.less'
// 待提交订单 // 待提交订单
export interface FirstApprovedOrderProps {} export interface ReadySubmitOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementSubmitList(params) const { data } = await PublicApi.getOrderBuyerValidateSubmitPage(params)
return data return data
} }
// TODO const ReadySubmitOrder:React.FC<ReadySubmitOrderProps> = (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.postOrderBuyerValidateSubmitBatch)
const handleBitchPush = async () => { const handleBitchPush = async () => {
const canBitch = !rowSelectionCtl.selectRow.some(v => v.externalState !== PurchaseOrderOutWorkState.SUBMIT_ORDER || v.interiorState !== PurchaseOrderInsideWorkState.SUBMIT_ORDER) const { code } = await run(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
if (canBitch) { if (code === 1000) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys}) ref.current.reload()
if (code === 1000) { rowSelectionCtl.setSelectRow([])
ref.current.reload() rowSelectionCtl.setSelectedRowKeys([])
rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('只能提交内部状态为审核通过并且外部状态为待提交的订单')
} }
} }
...@@ -53,7 +46,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -53,7 +46,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
fetchTableData={params => fetchTableData(params)} fetchTableData={params => fetchTableData(params)}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'orderId'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
...@@ -92,6 +85,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -92,6 +85,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} ReadySubmitOrder.defaultProps = {}
export default FirstApprovedOrder export default ReadySubmitOrder
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { Button, Popconfirm } from 'antd' import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant' import { baseOrderListColumns } from '../../constant'
import { history } from 'umi' import { history } from 'umi'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, PurchaseOrderOutWorkState } from '@/constants/order'
// 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'}) const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
const handleSubmit = async (id) => { const handleSubmit = async (id) => {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readySubmitOrder/detail?id=${id}&preview=0`) history.push(`/memberCenter/tranactionAbility/purchaseOrder/readySubmitOrder/detail?id=${id}&preview=0`)
} }
// 取消订单
const handleCancel = async (id) => {
await PublicApi.postOrderPurchaseOrderCancel({id})
ref.current.reload()
}
const secondColumns: any[] = baseOrderListColumns().concat([ const secondColumns: any[] = baseOrderListColumns().concat([
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
dataIndex: 'ctl', dataIndex: 'ctl',
key: 'ctl', key: 'ctl',
render: (text, record) => <Button type='link' onClick={() => handleSubmit(record.id)}>提交订单</Button> render: (text, record) => <Button type='link' onClick={() => handleSubmit(record.orderId)}>提交订单</Button>
} }
]) ])
......
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getPurchaseOrderSelectOption } from '@/pages/transaction/effect';
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: any = () => { export const tableListSchema: any = () => {
// const OrderType = getOrderType() const res = getPurchaseOrderSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return { return {
type: 'object', type: 'object',
properties: { properties: {
orderNo: { orderNo: {
type: 'string', type: 'string',
"x-component": 'SearchFilter', "x-component": 'SearchFilter',
'x-component-props': { 'x-component-props': {
placeholder: '请输入订单编号', placeholder: '请输入订单编号',
align: 'flex-end', align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
}, },
"supplyMembersName": { },
type: 'string', [FORM_FILTER_PATH]: {
"x-component-props": { type: 'object',
placeholder: '请输入供应会员名称' 'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
} }
}, },
"type": { properties: {
type: 'string', digest: {
"x-component-props": { type: 'string',
placeholder: '请选择订单类型' 'x-component-props': {
placeholder: '请输入订单摘要',
}
}, },
// enum: OrderType.map(item => ({ "memberName": {
// label: item['name'], type: 'string',
// value: item['status'], "x-component-props": {
// })) placeholder: '请输入供应会员名称'
enum: [] }
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
}, },
}, "orderType": {
submit: { type: 'string',
'x-component': 'Submit', "x-component-props": {
'x-component-props': { placeholder: '请选择订单类型'
children: '查询', },
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
},
"[startDate, endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
// showTime: true,
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
}, },
}, },
}, },
}, }
} }
} }
} }
...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection'; ...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection';
const SecondApprovedOrderDetail: React.FC = () => { const SecondApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedTwo) const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidateGradeTwo)
const approvedRef = useRef<any>({}) const approvedRef = useRef<any>({})
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
...@@ -24,7 +24,7 @@ const SecondApprovedOrderDetail: React.FC = () => { ...@@ -24,7 +24,7 @@ const SecondApprovedOrderDetail: React.FC = () => {
const handleSubmit = useCallback(() => { const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => { approvedRef.current.actions.submit().then(async ({values}) => {
const params = { const params = {
id: Number(id), orderId: Number(id),
...values ...values
} }
const result = await run(params) const result = await run(params)
......
...@@ -14,26 +14,23 @@ import { useHttpRequest } from '@/hooks/useHttpRequest' ...@@ -14,26 +14,23 @@ import { useHttpRequest } from '@/hooks/useHttpRequest'
// 二级待审核订单 // 二级待审核订单
export interface FirstApprovedOrderProps {} export interface SecondApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementReviewedListTwo(params) const { data } = await PublicApi.getOrderBuyerValidateGradeTwoPage(params)
return data return data
} }
// TODO const SecondApprovedOrder:React.FC<SecondApprovedOrderProps> = (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: 'orderId'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewedAllTwo) const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidateGradeTwoBatch)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
const { code } = await run({ const { code } = await run(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
ids: rowSelectionCtl.selectedRowKeys
})
if (code === 1000) { if (code === 1000) {
// 清空选中的值 // 清空选中的值
...@@ -49,7 +46,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -49,7 +46,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'orderId'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
...@@ -88,6 +85,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -88,6 +85,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} SecondApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default SecondApprovedOrder
...@@ -2,15 +2,11 @@ import React, { useRef } from 'react' ...@@ -2,15 +2,11 @@ import React, { useRef } from 'react'
import { Button } from 'antd' import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant' import { baseOrderListColumns } from '../../constant'
import { history } from 'umi' import { history } from 'umi'
import { PurchaseOrderInsideWorkState } from '@/constants/order'
// 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const handleSubmit = async (record) => { const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.TWO_LEVEL_AUDIT_ORDER) { history.push(`/memberCenter/tranactionAbility/purchaseOrder/secondApprovedOrder/detail?id=${record.orderId}`)
history.push(`/memberCenter/tranactionAbility/purchaseOrder/secondApprovedOrder/detail?id=${record.id}`)
}
} }
const secondColumns: any[] = baseOrderListColumns().concat([ const secondColumns: any[] = baseOrderListColumns().concat([
{ {
......
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getPurchaseOrderSelectOption } from '@/pages/transaction/effect';
export const tableListSchema: any = () => { export const tableListSchema: any = () => {
// const OrderType = getOrderType() const res = getPurchaseOrderSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return { return {
type: 'object', type: 'object',
properties: { properties: {
orderNo: { orderNo: {
type: 'string', type: 'string',
"x-component": 'SearchFilter', "x-component": 'SearchFilter',
'x-component-props': { 'x-component-props': {
placeholder: '请输入订单编号', placeholder: '请输入订单编号',
align: 'flex-end', align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
}, },
"supplyMembersName": { },
type: 'string', [FORM_FILTER_PATH]: {
"x-component-props": { type: 'object',
placeholder: '请输入供应会员名称' 'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
} }
}, },
"type": { properties: {
type: 'string', digest: {
"x-component-props": { type: 'string',
placeholder: '请选择订单类型' 'x-component-props': {
placeholder: '请输入订单摘要',
}
}, },
// enum: OrderType.map(item => ({ "memberName": {
// label: item['name'], type: 'string',
// value: item['status'], "x-component-props": {
// })) placeholder: '请输入供应会员名称'
enum: [] }
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
}, },
}, "orderType": {
submit: { type: 'string',
'x-component': 'Submit', "x-component-props": {
'x-component-props': { placeholder: '请选择订单类型'
children: '查询', },
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
},
"[startDate, endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
// showTime: true,
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
}, },
}, },
}, },
}, }
} }
} }
} }
...@@ -3,18 +3,9 @@ import { formatTimeString } from '@/utils' ...@@ -3,18 +3,9 @@ import { formatTimeString } from '@/utils'
import StatusColors from '@/pages/transaction/components/statusColors' import StatusColors from '@/pages/transaction/components/statusColors'
import EyePreview from '@/components/EyePreview' import EyePreview from '@/components/EyePreview'
import { history } from 'umi' import { history } from 'umi'
import { getSaleOrderSelectOption } from '../../effect'
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getSaleOrderAuditPageSelectOption } from '@/pages/transaction/effect'; import { getSaleOrderAuditPageSelectOption } from '@/pages/transaction/effect';
interface LayoutState {
/** flex布局的对齐方式 */
align?: string,
/** 列的样式 */
colStyle?: Object
}
/** 订单审核各个页面 只有订单类型查询的Schema */ /** 订单审核各个页面 只有订单类型查询的Schema */
export const tableListSchema: any = (align?: String, colStyle?: Object) => { export const tableListSchema: any = (align?: String, colStyle?: Object) => {
...@@ -43,7 +34,7 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => { ...@@ -43,7 +34,7 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
colStyle: colStyle || {marginRight: 20} colStyle: colStyle || {marginRight: 20}
}, },
properties: { properties: {
orderThe: { digest: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '请输入订单摘要', placeholder: '请输入订单摘要',
...@@ -89,14 +80,6 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => { ...@@ -89,14 +80,6 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
export const baseOrderListColumns: any = () => { export const baseOrderListColumns: any = () => {
// const res = getSaleOrderSelectOption()
// if(res) {
// const {
// orderTypes: OrderType,
// innerStatus: SaleOrderInsideWorkStateTexts,
// outerStatus: SaleOrderOutWorkStateTexts
// } = res
return [ return [
{ {
title: '订单号', title: '订单号',
...@@ -104,7 +87,6 @@ export const baseOrderListColumns: any = () => { ...@@ -104,7 +87,6 @@ export const baseOrderListColumns: any = () => {
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (text, record) => { render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return ( return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.orderId}`}> <EyePreview url={`${history.location.pathname}/preview?id=${record.orderId}`}>
{text} {text}
...@@ -121,8 +103,8 @@ export const baseOrderListColumns: any = () => { ...@@ -121,8 +103,8 @@ export const baseOrderListColumns: any = () => {
{ {
title: '采购会员', title: '采购会员',
align: 'center', align: 'center',
dataIndex: 'buyerMemberName', dataIndex: 'memberName',
key: 'buyerMemberName', key: 'memberName',
}, },
{ {
title: '下单时间', title: '下单时间',
...@@ -142,8 +124,6 @@ export const baseOrderListColumns: any = () => { ...@@ -142,8 +124,6 @@ export const baseOrderListColumns: any = () => {
align: 'center', align: 'center',
dataIndex: 'orderTypeName', dataIndex: 'orderTypeName',
key: 'orderTypeName', key: 'orderTypeName',
// filters: OrderType.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
// onFilter: (value, record) => value === record.orderType,
}, },
{ {
title: '外部状态', title: '外部状态',
...@@ -151,8 +131,6 @@ export const baseOrderListColumns: any = () => { ...@@ -151,8 +131,6 @@ export const baseOrderListColumns: any = () => {
dataIndex: 'outerStatusName', dataIndex: 'outerStatusName',
key: 'outerStatusName', key: 'outerStatusName',
render: (text, record) => <StatusColors status={text} type='out' text={record['outerStatusName']} />, render: (text, record) => <StatusColors status={text} type='out' text={record['outerStatusName']} />,
// filters: SaleOrderOutWorkStateTexts.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
// onFilter: (value, record) => value === record.outerStatus,
}, },
{ {
title: '内部状态', title: '内部状态',
...@@ -160,9 +138,6 @@ export const baseOrderListColumns: any = () => { ...@@ -160,9 +138,6 @@ export const baseOrderListColumns: any = () => {
dataIndex: 'innerStatusName', dataIndex: 'innerStatusName',
key: 'innerStatusName', key: 'innerStatusName',
render: (text, record) => <StatusColors status={text} type='saleInside' text={record['innerStatusName']} />, render: (text, record) => <StatusColors status={text} type='saleInside' text={record['innerStatusName']} />,
// filters: SaleOrderInsideWorkStateTexts.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
// onFilter: (value, record) => value === record.innerStatus,
}, },
] ]
// }
} }
import React, { useState, useCallback, useRef } from 'react'; import React, { useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context'; import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection'; ...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection';
const FirstApprovedOrderDetail: React.FC = () => { const FirstApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderOne) const { run, loading } = useHttpRequest(PublicApi.postOrderVendorValidateGradeOne)
const approvedRef = useRef<any>({}) const approvedRef = useRef<any>({})
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
...@@ -24,9 +24,8 @@ const FirstApprovedOrderDetail: React.FC = () => { ...@@ -24,9 +24,8 @@ const FirstApprovedOrderDetail: React.FC = () => {
const handleSubmit = useCallback(() => { const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async (v) => { approvedRef.current.actions.submit().then(async (v) => {
const params = { const params = {
id: Number(id), orderId: Number(id),
state: v.values.state, ...v,
cause: v.values.cause,
} }
const result = await run(params) const result = await run(params)
......
...@@ -17,11 +17,11 @@ import '../index.less' ...@@ -17,11 +17,11 @@ import '../index.less'
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderSubmittedReviewOrderOneList(params) const { data } = await PublicApi.getOrderVendorValidateGradeOnePage(params)
return data return data
} }
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = () => {
const { const {
columns, columns,
ref, ref,
...@@ -29,11 +29,11 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -29,11 +29,11 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelectionCtl rowSelectionCtl
} = useSelfTable() } = useSelfTable()
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderOneAll) const { run, loading } = useHttpRequest(PublicApi.postOrderVendorValidateGradeOneBatch)
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(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
if (code === 1000) { if (code === 1000) {
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
...@@ -50,7 +50,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -50,7 +50,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'orderId'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
......
...@@ -4,13 +4,12 @@ import { baseOrderListColumns } from '../../constant' ...@@ -4,13 +4,12 @@ import { baseOrderListColumns } from '../../constant'
import { history } from 'umi' import { history } from 'umi'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
// 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'}) const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
const handleSubmit = async (record) => { const handleSubmit = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/firstApprovedOrder/detail?id=${record.id}`) history.push(`/memberCenter/tranactionAbility/saleOrder/firstApprovedOrder/detail?id=${record.orderId}`)
} }
const secondColumns = () => { const secondColumns = () => {
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getOrderType } from '@/pages/transaction/effect';
export const tableListSchema: any = () => {
const OrderType = getOrderType()
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},
"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['name'],
value: item['status'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
}
...@@ -16,11 +16,11 @@ import { tableListSchema } from '../constant' ...@@ -16,11 +16,11 @@ import { tableListSchema } from '../constant'
export interface ReadyApprovedOrderProps {} export interface ReadyApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderSubmittedReviewOrderList(params) const { data } = await PublicApi.getOrderVendorValidateSubmitPage(params)
return data return data
} }
const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = (props) => { const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = () => {
const { columns, ref } = useSelfTable() const { columns, ref } = useSelfTable()
......
...@@ -3,7 +3,6 @@ import { Button } from 'antd' ...@@ -3,7 +3,6 @@ import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant' import { baseOrderListColumns } from '../../constant'
import { history } from 'umi' import { history } from 'umi'
// 业务hooks, 待审核订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
...@@ -22,7 +21,7 @@ export const useSelfTable = () => { ...@@ -22,7 +21,7 @@ export const useSelfTable = () => {
key: 'ctl', key: 'ctl',
render: (text, record) => { render: (text, record) => {
return <> return <>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button> <Button type='link' onClick={() => handleSubmit(record.orderId)}>提交审核</Button>
</> </>
} }
} }
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getSaleOrderAuditPageSelectOption } from '@/pages/transaction/effect';
export const tableListSchema: any = () => {
const res = getSaleOrderAuditPageSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-start',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginRight: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},
"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
}
}
import React, { useState, useCallback, useRef } from 'react'; import React, { useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context'; import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -14,7 +14,7 @@ import OrderElectronModal from '@/pages/transaction/components/orderElectronModa ...@@ -14,7 +14,7 @@ import OrderElectronModal from '@/pages/transaction/components/orderElectronModa
const ReadyConfirmOrderDetail: React.FC = () => { const ReadyConfirmOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderConfirmedOrder) const { run, loading } = useHttpRequest(PublicApi.postOrderVendorValidateConfirm)
const approvedRef = useRef<any>({}) const approvedRef = useRef<any>({})
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
...@@ -36,9 +36,8 @@ const ReadyConfirmOrderDetail: React.FC = () => { ...@@ -36,9 +36,8 @@ const ReadyConfirmOrderDetail: React.FC = () => {
const handleSubmit = () => { const handleSubmit = () => {
approvedRef.current.actions.submit().then(async (v) => { approvedRef.current.actions.submit().then(async (v) => {
const params = { const params = {
id: Number(id), orderId: Number(id),
state: v.values.state, ...v.values,
cause: v.values.cause,
} }
if(formContext.data.usingElectronicContracts && v.values.state) { // 使用合同 并且通过 if(formContext.data.usingElectronicContracts && v.values.state) { // 使用合同 并且通过
approvedRef.current.setVisible(false) approvedRef.current.setVisible(false)
......
...@@ -13,14 +13,14 @@ import '../index.less' ...@@ -13,14 +13,14 @@ import '../index.less'
// 待确认订单 // 待确认订单
export interface FirstApprovedOrderProps {} export interface ReadyConfirmOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderConfirmedOrderList(params) const { data } = await PublicApi.getOrderVendorValidateConfirmPage(params)
return data return data
} }
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const ReadyConfirmOrder:React.FC<ReadyConfirmOrderProps> = () => {
const { const {
columns columns
} = useSelfTable() } = useSelfTable()
...@@ -57,6 +57,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -57,6 +57,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} ReadyConfirmOrder.defaultProps = {}
export default FirstApprovedOrder export default ReadyConfirmOrder
...@@ -3,10 +3,9 @@ import { history } from 'umi' ...@@ -3,10 +3,9 @@ import { history } from 'umi'
import { Button } from 'antd' import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant' import { baseOrderListColumns } from '../../constant'
// 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const handleConfirm = async (record) => { const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmOrder/detail?id=${record.id}`) history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmOrder/detail?id=${record.orderId}`)
} }
const secondColumns = () => { const secondColumns = () => {
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getOrderType } from '@/pages/transaction/effect';
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: any = () => {
const OrderType = getOrderType()
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-start',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginRight: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},
"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['name'],
value: item['status'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
}
import React, { useState, useCallback, useRef } from 'react'; import React, { useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context'; import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection'; ...@@ -13,7 +13,7 @@ import OrderDetailSection from '../../../components/orderDetailSection';
const SecondApprovedOrderDetail: React.FC = () => { const SecondApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderTwo) const { run, loading } = useHttpRequest(PublicApi.postOrderVendorValidateGradeTwo)
const approvedRef = useRef<any>({}) const approvedRef = useRef<any>({})
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
...@@ -24,9 +24,8 @@ const SecondApprovedOrderDetail: React.FC = () => { ...@@ -24,9 +24,8 @@ const SecondApprovedOrderDetail: React.FC = () => {
const handleSubmit = useCallback(() => { const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async (v) => { approvedRef.current.actions.submit().then(async (v) => {
const params = { const params = {
id: Number(id), orderId: Number(id),
state: v.values.state, ...v.values
cause: v.values.cause,
} }
const result = await run(params) const result = await run(params)
......
...@@ -15,25 +15,23 @@ import '../index.less' ...@@ -15,25 +15,23 @@ import '../index.less'
// 二级待审核订单 // 二级待审核订单
export interface FirstApprovedOrderProps {} export interface SecondApprovedOrderProps {}
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderSubmittedReviewOrderTwoList(params) const { data } = await PublicApi.getOrderVendorValidateGradeTwoPage(params)
return data return data
} }
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { const SecondApprovedOrder:React.FC<SecondApprovedOrderProps> = (props) => {
const { const {
columns, columns,
ref ref
} = useSelfTable() } = useSelfTable()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'}) const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderTwoAll) const { run, loading } = useHttpRequest(PublicApi.postOrderVendorValidateGradeTwoBatch)
const handleSubmitBatch = async () => { const handleSubmitBatch = async () => {
const { code } = await run({ const { code } = await run(rowSelectionCtl.selectedRowKeys.map(item => ({ orderId: item })))
ids: rowSelectionCtl.selectedRowKeys
})
if (code === 1000) { if (code === 1000) {
rowSelectionCtl.setSelectRow([]) rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([]) rowSelectionCtl.setSelectedRowKeys([])
...@@ -48,7 +46,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -48,7 +46,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey={'id'} rowKey={'orderId'}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
...@@ -56,7 +54,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -56,7 +54,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
ctx: { ctx: {
inline: false, inline: false,
schema: tableListSchema('flex-end', { marginLeft: 20 }), schema: tableListSchema('flex-end', { marginLeft: 20 }),
// schema: tableListSchema(),
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
...@@ -88,6 +85,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -88,6 +85,6 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
</PageHeaderWrapper> </PageHeaderWrapper>
} }
FirstApprovedOrder.defaultProps = {} SecondApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default SecondApprovedOrder
...@@ -2,13 +2,12 @@ import React, { useRef } from 'react' ...@@ -2,13 +2,12 @@ import React, { useRef } from 'react'
import { Button } from 'antd' import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant' import { baseOrderListColumns } from '../../constant'
import { history } from 'umi' import { history } from 'umi'
import { SaleOrderInsideWorkState } from '@/constants/order'
// 业务hooks, 待新增订单 // 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const handleSubmit = async (record) => { const handleSubmit = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/secondApprovedOrder/detail?id=${record.id}`) history.push(`/memberCenter/tranactionAbility/saleOrder/secondApprovedOrder/detail?id=${record.orderId}`)
} }
const secondColumns = () => { const secondColumns = () => {
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getOrderType } from '@/pages/transaction/effect';
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: any = () => {
const OrderType = getOrderType()
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['name'],
value: item['status'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
}
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