Commit 8a734ed8 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理商品移除发票字段;处理价格策略设置阶梯价格和空情况下筛选会员数据异常;处理销售订单页面采购会员筛选字段错误问题,处理订单发货记录物流单和发货入库单跳…

fix:处理商品移除发票字段;处理价格策略设置阶梯价格和空情况下筛选会员数据异常;处理销售订单页面采购会员筛选字段错误问题,处理订单发货记录物流单和发货入库单跳转异常,处理待确认订单审核不通过状态的订单实行禁用通过处理
parent 5b1cc840
......@@ -5,7 +5,7 @@ export interface IHttpRequestReturn<T> {
data: T | null,
loading: boolean,
err: any,
run(params?: any)
run(params?: any, config?: any)
}
export interface useHttpRequestConfig extends IApiRequest {
......@@ -20,10 +20,10 @@ export function useHttpRequest<T>(api: (params?, config?) => Promise<T>, selfCon
const [loading, setLoading] = useState(false)
const [data, setData] = useState<T | null>(null)
const [err, setErr] = useState()
const run = (params) => {
const run = (params, config?) => {
return new Promise((resolve, reject) => {
setLoading(true)
api(params).then((res: any) => {
api(params, config).then((res: any) => {
setData(res.data)
resolve(res)
}).catch(err => {
......@@ -43,4 +43,4 @@ export function useHttpRequest<T>(api: (params?, config?) => Promise<T>, selfCon
err,
run
}
}
\ No newline at end of file
}
......@@ -303,7 +303,7 @@ const SetPrice:React.FC<IProps> = (props) => {
},
[]
)
let result = range.reduce((a, b) => { if(a<b) return b })
let result = range.map(Number).reduce((a, b) => { if(a<b) return b })
if(!result) throw new Error('请正确输入阶梯数量范围');
callback()
}
......
......@@ -53,6 +53,7 @@ const OtherForm: React.FC<Iprops> = (props) => {
otherForm.setFieldsValue({"isInvoice": false})
setDisabledInvoice(true)
} else {
otherForm.setFieldsValue({"isInvoice": true})
setDisabledInvoice(false)
}
}, [productPriceType])
......@@ -74,6 +75,7 @@ const OtherForm: React.FC<Iprops> = (props) => {
required: true,
message: "请选择是否提供发票"
}]}
style={{ display: "none" }}
>
<Radio.Group size="small" disabled={disabledInvoice}>
<Radio.Button value={true} style={{ width: 100, textAlign: 'center' }}></Radio.Button>
......
......@@ -34,10 +34,10 @@ export const columnsSetMember: any[] = [
export const columnsSetProduct: any[] = [
{
title: '商品ID',
dataIndex: 'id',
title: '商品编号',
dataIndex: 'code',
align: 'center',
key: 'id',
key: 'code',
},
{
title: '商品名称',
......
......@@ -60,16 +60,17 @@ const MemberModal:React.FC<MemberModalProps> = (props) => {
schemaAction.setFieldValue('commodityMemberList', hasMember.concat(rowSelectionCtl.selectRow))
rowSelectionCtl.setSelectedRowKeys([])
rowSelectionCtl.setSelectRow([])
console.log(hasMember, rowSelectionCtl.selectRow)
} else {
schemaAction.setFieldValue('commodityMemberList', rowSelectionCtl.selectRow)
schemaAction.setFieldState('commodityMemberList', state => {
state.dataSource = rowSelectionCtl.selectRow
})
}
}
const fetchMemberList = async (params) => {
const excludeIds = await PublicApi.getProductCommodityGetStrategyMemberByCommodityId({commodityId: schemaAction.getFieldValue("productId")}, {ctlType: 'none'})
let checkedMember = schemaAction.getFieldValue('commodityMemberList')
console.log(schemaAction.getFieldState('commodityMemberList'), 'state')
if(schemaAction.getFieldState('commodityMemberList').isDelete) {
params.excludeList = checkedMember.map(item => ({
memberId: item.memberId,
......
......@@ -126,7 +126,7 @@ const PriceModal:React.FC<PriceModalProps> = (props) => {
},
[]
)
let result = range.reduce((a, b) => { if(a<b) return b })
let result = range.map(Number).reduce((a, b) => { if(a<b) return b })
if(!result) throw new Error('请正确输入阶梯数量范围');
callback()
}
......
......@@ -49,6 +49,9 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
PublicApi.getProductCommodityGetUnitPriceStrategy({id}).then(res => {
const { initValue } = transformDataForNiceForm(res.data, addSchemaAction)
setInitialFormValue(initValue)
addSchemaAction.setFieldState('commodityMemberList', state => {
state.dataSource = initValue.commodityMemberList
})
})
}
}, [])
......@@ -122,6 +125,10 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
let commodityMemberList = addSchemaAction.getFieldValue("commodityMemberList").filter(item => item.name === value)
addSchemaAction.setFieldValue("commodityMemberList", commodityMemberList)
if(!value) {
addSchemaAction.setFieldValue("commodityMemberList", addSchemaAction.getFieldState("commodityMemberList")["dataSource"])
}
}
......
......@@ -11,6 +11,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const'
import ModalSearch from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import { clearModalParams } from '@/utils'
export interface ProductModalProps {
type?: 'radio' | 'checkbox',
......@@ -62,13 +63,20 @@ const ProductModal:React.FC<ProductModalProps> = (props) => {
schemaAction.setFieldValue('productName', selectResult.name)
schemaAction.setFieldValue('productId', selectResult.id)
clearModalParams()
}
const handleCancel = () => {
setVisible(false)
clearModalParams()
}
return (
<ModalTable
modalTitle='选择商品'
confirm={handleOkAddProduct}
cancel={() => setVisible(false)}
cancel={handleCancel}
visible={visible}
columns={columnsSetProduct}
rowSelection={rowSelection}
......
......@@ -37,9 +37,14 @@ const PriceManage: React.FC<{}> = () => {
{text}
</EyePreview>
},
// {
// title: '商品ID',
// dataIndex: ["commodity", "id"],
// key: 'commodity',
// },
{
title: '商品ID',
dataIndex: ["commodity", "id"],
title: '商品编号',
dataIndex: ["commodity", "code"],
key: 'commodity',
},
{
......
......@@ -85,7 +85,7 @@ export const schema: ISchema = {
commodityName: {
type: 'string',
'x-component-props': {
placeholder: '商品名称',
placeholder: '商品编号或名称',
style: { width: '174px' },
}
},
......
import React, { useContext, useEffect, useState } from 'react'
import ModalForm from '@/components/ModalForm'
import { createFormActions, registerVirtualBox } from '@formily/antd'
import { createFormActions, registerVirtualBox, FormEffectHooks } from '@formily/antd'
import { OrderDetailContext } from '../../_public/order/context'
import { Checkbox } from 'antd'
......@@ -184,6 +184,14 @@ const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
const { data } = useContext(OrderDetailContext)
const [checkedContract, setCheckedContract] = useState<boolean>(false)
// useEffect(() => {
// console.log(data)
// // 上一级审核不通过
// if(data && data.purchaseOrderInteriorState === 6) {
// approvedActions.setFieldValue("state", 0)
// }
// }, [data])
useEffect(() => {
if (currentRef) {
currentRef.current = Object.assign({}, currentRef.current, {actions: approvedActions})
......@@ -212,6 +220,14 @@ const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
children: <><Checkbox onChange={onChange} />&nbsp;&nbsp;<a href={data.electronicContractUrl} target="blank">{data.electronicContractName}</a></>
}
})
if(data && data.purchaseOrderInteriorState === 6) {
ctx.setFieldValue("state", 0)
ctx.setFieldState("state", state => {
state.props["x-component-props"] = {
disabled: true
}
})
}
})
}}
modalProps={{confirmLoading: loading}}
......
......@@ -126,7 +126,7 @@ const schema: ISchema = {
const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const formRef = useRef<any>({})
const { data } = useContext(OrderDetailContext)
const { run, loading } = useHttpRequest(PublicApi.postOrderSignatureSignContractCreate, {ctlType: 'none'})
const { run, loading } = useHttpRequest(PublicApi.postOrderContractSignSaleSignContractCreate, {ctlType: 'none'})
const { run: submitRun, loading: submitLoading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrder)
const createElectron = async () => {
const contractTemplateId = schemaActions.getFieldValue('contractTemplateId')
......@@ -135,12 +135,12 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
return ;
}
const orderId = data.orderId
const signMemberId = data.createMemberId
const memberId = data.createMemberId
const params = {
contractTemplateId,
orderId,
signMemberId
memberId
}
const { code, data: resData } = await run(params)
......
......@@ -193,7 +193,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
dataIndex: 'logisticsNo',
align: 'center',
key: 'logisticsNo',
render: text => <a href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${data.orderNo}`}>{text}</a>
render: text => <a target="blank" href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${text}`}>{text}</a>
},
{
title: '物流公司',
......@@ -206,7 +206,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
dataIndex: 'storageNo',
align: 'center',
key: 'storageNo',
render: text => <a href={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?storageNo=${text}`}>{text}</a>
render: text => <a href={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?invoicesNo=${text}`}>{text}</a>
},
{
title: '入库时间',
......
......@@ -16,7 +16,10 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const { currentRef, type, ctx } = props
const { data } = useContext(OrderDetailContext)
// @ts-ignore
const { run, loading } = useHttpRequest(type === 'saleOrder' ? PublicApi.postOrderSignaturePlatformSign : PublicApi.postOrderElectronicContractsAffirm)
// 采购过来确认先调用 OrderContractSignProcurementSign 在执行 postOrderElectronicContractsAffirm
// 销售过来确认先调用 OrderContractSignSaleSign 在执行 postOrderConfirmedOrder
// const { run, loading } = useHttpRequest(type === 'saleOrder' ? PublicApi.OrderContractSignSaleSign : PublicApi.postOrderElectronicContractsAffirm)
const { run, loading } = useHttpRequest(type === 'saleOrder' ? PublicApi.postOrderContractSignSaleSign : PublicApi.postOrderContractSignProcurementSign)
const [visible, setVisible] = useState(false)
useEffect(() => {
currentRef.current = {
......@@ -26,13 +29,13 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
}, [])
const handleSubmit = async () => {
console.log('签署')
let params: any = {}
if(type === 'saleOrder') {
params.contractName = data.electronicContractName
params.contractUrl = data.electronicContractUrl
} else {
params.id = parseInt(data.id)
params.signatureLogId = data.signatureLogId
// params.id = parseInt(data.id)
}
const res = await run(params)
if (res.code === 1000) {
......@@ -44,7 +47,10 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
signatureLogId: res.data.signatureLogId
})
} else {
history.goBack()
// history.goBack()
handleContractsAffirm({
id: Number(data.id),
})
}
}
}
......@@ -58,6 +64,15 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
}
}
const handleContractsAffirm = async (params) => {
const res = await PublicApi.postOrderElectronicContractsAffirm(params, { ctlType: 'none' })
if(res.code === 1000) {
history.goBack()
} else {
message.error(res.message)
}
}
return (
<Modal
width={1000}
......
......@@ -75,8 +75,6 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
{ title: '其他要求', name: 'restsRequire' },
]
console.log(data,'data')
return (
<>
<Row style={{ marginTop: 24 }} gutter={24}>
......
......@@ -76,7 +76,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const { id } = usePageStatus()
const { data, payList, currentPayInfoId } = useContext(OrderDetailContext)
const transformPayList: any = data ? formatting(payList, "payType") : []
const { run, loading } = useHttpRequest(PublicApi.postOrderPendingOrderPay)
const [visible, setVisible] = useState(false)
const [checked, setChecked] = useState<any>({})
const [current, setCurrent] = useState(0) // 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款 6支付宝 1000清除
......@@ -92,6 +91,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const [balanceInfo, setBalanceInfo] = useState<any>()
const [payOnReceived, setPayOnReceived] = useState<boolean>(false) // 是否要禁用到付方式
const [blankAccountInfo, setBlankAccountInfo] = useState<any>()
const { run, loading } = useHttpRequest(PublicApi.postOrderPendingOrderPay)
useEffect(() => {
if (currentRef) {
......@@ -311,7 +311,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
params.payOrderUrls = payOrderUrls.join(',')
}
const res = await run(params)
const res = await run(params, mobilePayFlag.current === 4 ? { ctlType: "none" } : null)
if (res.code === 1000) {
if(mobilePayFlag.current !== 4) { // 非微信
history.goBack()
......@@ -561,6 +561,9 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
maxLength={number.length}
onChange={onChange}
visibilityToggle={false}
readOnly={true}
onFocus={(e) => e.target.removeAttribute('readonly')}
onBlur={(e) => e.target.setAttribute('readonly', 'true')}
/>
</div>
</div>
......
......@@ -122,6 +122,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
title='查看支付结果'
visible={visible}
onCancel={()=>setVisible(false)}
onOk={()=>setVisible(false)}
>
<List
itemLayout="horizontal"
......
......@@ -184,7 +184,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'deliveryNo',
align: 'center',
key: 'deliveryNo',
render: text => <a href={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?deliveryNo=${text}`}>{text}</a>
render: text => <a target="blank" href={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?invoicesNo=${text}`}>{text}</a>
},
{
title: '发货时间',
......@@ -198,7 +198,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'logisticsNo',
align: 'center',
key: 'logisticsNo',
render: text => <a href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${data.orderNo}`}>{text}</a>
render: text => <a href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${text}`}>{text}</a>
},
{
title: '物流公司',
......
......@@ -163,7 +163,7 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
const { externalProcurementOrderLogResponses, interiorProcurementOrderLogResponses } = data
// 复杂流程或者多次支付显示标题
const isShowOuterTitle = data?.processEnum !== 24 || data?.paymentInformationResponses?.length > 1
// const isShowOuterTitle = data?.processEnum !== 24 || data?.paymentInformationResponses?.length > 1
return (
<>
......@@ -171,16 +171,14 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
(externalProcurementOrderLogResponses?.length > 0 || interiorProcurementOrderLogResponses?.length > 0) &&
<MellowCard style={{marginTop: 24}} bordered={false}>
<Tabs defaultActiveKey="1">
{
isShowOuterTitle && <Tabs.TabPane tab='外部订单流转记录' key="1">
<Table
columns={outOrderCols}
dataSource={externalProcurementOrderLogResponses}
pagination={false}
rowKey="id"
/>
</Tabs.TabPane>
}
<Tabs.TabPane tab='外部订单流转记录' key="1">
<Table
columns={outOrderCols}
dataSource={externalProcurementOrderLogResponses}
pagination={false}
rowKey="id"
/>
</Tabs.TabPane>
{
interiorProcurementOrderLogResponses?.length > 0 && <Tabs.TabPane tab='内部订单流转记录' key="2">
<Table
......
import React, { useRef } from 'react'
import { history, Link } from 'umi'
import { Button, Row, Col, Modal } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderInsideWorkState, DOC_TYPE_PURCHASE_RECEIPT, DOC_TYPE_SALES_INVOICE } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
// 业务hooks, 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const customOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/addPurchaseWarehouseOrder/preview?id=${record.id}`}>
{text}
</EyePreview>
)
}
},
{
title: '订单摘要/下单时间',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
render: (text, record) => <>
<div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>,
width: 200
},
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
},
{
title: '订单总额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: text => '¥' + text
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 发货单号跳转
{
title: '入库单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
key: 'type',
render: (text) => ORDER_TYPE[text]
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: text => <StatusColors status={text} type='out'/>
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text) => <StatusColors status={text} type='inside'/>
},
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.interiorState === PurchaseOrderInsideWorkState.READY_WAREHOUSE_APPROVED_ORDER &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
}
{ record.interiorState === PurchaseOrderInsideWorkState.WAREHOUSE_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增入库单</Button>
}
</>
}
]
const handleConfirm = async (record) => {
const modal = Modal.confirm({
title: '确认审核操作',
content: `是否确认审核入库单号为${record.invoiceNumber}的采购入库单?`,
onOk: async () => {
const { code } = await PublicApi.postOrderAuditSalesInvoice({
id: record.orderDeliveryDetailsId,
orderId: record.id
})
if (code === 1000) {
modal.destroy()
ref.current.reload()
}
}
})
}
const handleAdd = async (record) => {
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_PURCHASE_RECEIPT}&relevanceInvoices=1`)
}
return {
columns: customOrderColumns,
ref
}
}
import React, { useRef } from 'react'
import { history, Link } from 'umi'
import { Button, Row, Col, Modal } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderInsideWorkState, DOC_TYPE_PURCHASE_RECEIPT, DOC_TYPE_SALES_INVOICE } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
// 业务hooks, 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const customOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/addPurchaseWarehouseOrder/preview?id=${record.id}`}>
{text}
</EyePreview>
)
}
},
{
title: '订单摘要/下单时间',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
render: (text, record) => <>
<div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>,
width: 200
},
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
},
{
title: '订单总额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: text => '¥' + text
},
{ title: '已发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `${text}次` : '' },
// @todo 发货单号跳转
{
title: '入库单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
key: 'type',
render: (text) => ORDER_TYPE[text]
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: text => <StatusColors status={text} type='out'/>
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text) => <StatusColors status={text} type='inside'/>
},
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.interiorState === PurchaseOrderInsideWorkState.READY_WAREHOUSE_APPROVED_ORDER &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
}
{ record.interiorState === PurchaseOrderInsideWorkState.WAREHOUSE_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增入库单</Button>
}
</>
}
]
const handleConfirm = async (record) => {
const modal = Modal.confirm({
title: '确认审核操作',
content: `是否确认审核入库单号为${record.invoiceNumber}的采购入库单?`,
onOk: async () => {
const { code } = await PublicApi.postOrderAuditSalesInvoice({
id: record.orderDeliveryDetailsId,
orderId: record.id
})
if (code === 1000) {
modal.destroy()
ref.current.reload()
}
}
})
}
const handleAdd = async (record) => {
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_PURCHASE_RECEIPT}&relevanceInvoices=1`)
}
return {
columns: customOrderColumns,
ref
}
}
......@@ -67,7 +67,7 @@ export const fetchOrderApi = {
// 生成电子合同
async createContract(params) {
const { data } = await PublicApi.postOrderSignaturePreOrderSignContractCreate(params, {ctlType: "none"})
const { data } = await PublicApi.postOrderContractSignProcurementSignContractCreate(params, {ctlType: "none"})
return data
},
......
......@@ -12,7 +12,6 @@ export interface SimpleElectronModalProps {
const SimpleElectronModal:React.FC<SimpleElectronModalProps> = (props) => {
const { currentRef, schemaAction } = props
// @ts-ignore
// const { run, loading } = useHttpRequest(PublicApi.postOrderSignatureOrderSettleSign, { ctlType: "none" })
const [visible, setVisible] = useState(false)
const [confirmLoading, setConfirmLoading] = useState(false)
const signatureState = useRef(null)
......@@ -39,11 +38,11 @@ const SimpleElectronModal:React.FC<SimpleElectronModalProps> = (props) => {
const handleSubmit = async () => {
setConfirmLoading(true)
// const res = await run(contracts)
const res = await PublicApi.postOrderSignatureOrderSettleSign(contracts, { ctlType: "none" })
const res = await PublicApi.postOrderContractSignProcurementOneStepSign(contracts, { ctlType: "none" })
if(res.code === 1000) {
timer = setInterval(() => {
if (signatureState.current !== 4) {
PublicApi.getOrderSignatureOrderSettleSignDetail({signatureLogId: res.data.signatureLogId + ''}).then(_res => {
PublicApi.getOrderContractSignOrderSettleSignDetail({signatureLogId: res.data.signatureLogId + ''}).then(_res => {
if(_res.code === 1000) {
signatureState.current = _res.data.state
if(_res.data.state === 4) {
......
......@@ -213,8 +213,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
if(electronicContractId) {
fetchOrderApi.createContract({
contractTemplateId: electronicContractId,
signMemberId:value['supplyMembersId'],
signRoleId: value['supplyMembersRoleId'],
memberId:value['supplyMembersId'],
roleId: value['supplyMembersRoleId'],
quotationNo: value["quotationNo"],
orderProductRequests: _orderProductRequests.map(v => {
v.price = 1
......
......@@ -15,6 +15,7 @@ const ReadyConfirmContract: React.FC = () => {
const payRef = useRef<any>({})
const handleClick = useCallback(() => {
console.log(data, currentPayInfoId)
// 处理积分支付跳转
if(data && currentPayInfoId){
if(data.paymentInformationResponses.length > 0){
......
......@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key: 'sumPrice',
render: text => '¥' + text
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
{ title: '已发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `${text}次` : '' },
// @todo 发货单号跳转
{
title: '发货单号',
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -52,7 +52,7 @@ export const useSelfTable = () => {
key: 'sumPrice',
render: text => '¥' + text
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
{ title: '已发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `${text}次` : '' },
// @todo 发货单号跳转
{
title: '发货单号',
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key: 'sumPrice',
render: (t, r) => (r.type === 7 || r.type === 8) ? t : '¥' + t
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
{ title: '已发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `${text}次` : '' },
// @todo 发货单号跳转
{
title: '发货单号',
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api';
import { Button } from 'antd';
import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader';
import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper';
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
import OrderElectronModal from '@/pages/transaction/components/orderElectronModal';
const ReadyConfirmOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderConfirmedOrder)
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => {
PublicApi.getOrderSignatureAuthAuthState().then(res => {
if(res.code === 1000) {
approvedRef.current.setVisible(true)
}
})
}, [])
const electronRef = useRef<any>({})
// const handleClick = useCallback(() => {
// electronRef.current.setVisible(true)
// }, [])
// 提交表单
const handleSubmit = () => {
approvedRef.current.actions.submit().then(async (v) => {
const params = {
id: Number(id),
state: v.values.state,
cause: v.values.cause,
}
if(formContext.data.usingElectronicContracts && v.values.state) { // 使用合同 并且通过
approvedRef.current.setVisible(false)
electronRef.current.setVisible(true)
} else {
const result = await run(params)
if (result.code === 1000) {
approvedRef.current.setVisible(false)
history.goBack()
}
}
})
}
return (
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick}>
确认订单
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
{/* 提交时触发的弹窗集合 */}
<ApprovedOrderModal
currentRef={approvedRef}
onConfirm={handleSubmit}
loading={loading}
isUseElectronicContract={formContext.data?.usingElectronicContracts ? true : false}
/>
{/* 提交时触发的签合同弹窗集合 */}
<OrderElectronModal
currentRef={electronRef}
type='saleOrder'
ctx={approvedRef.current.actions}
/>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyConfirmOrderDetail;
\ No newline at end of file
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api';
import { Button } from 'antd';
import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader';
import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper';
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
import OrderElectronModal from '@/pages/transaction/components/orderElectronModal';
const ReadyConfirmOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderConfirmedOrder)
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => {
PublicApi.getOrderSignatureAuthAuthState().then(res => {
if(res.code === 1000) {
approvedRef.current.setVisible(true)
}
})
}, [])
const electronRef = useRef<any>({})
// const handleClick = useCallback(() => {
// electronRef.current.setVisible(true)
// }, [])
// 提交表单
const handleSubmit = () => {
approvedRef.current.actions.submit().then(async (v) => {
const params = {
id: Number(id),
state: v.values.state,
cause: v.values.cause,
}
if(formContext.data.usingElectronicContracts && v.values.state) { // 使用合同 并且通过
approvedRef.current.setVisible(false)
electronRef.current.setVisible(true)
} else {
const result = await run(params)
if (result.code === 1000) {
approvedRef.current.setVisible(false)
history.goBack()
}
}
})
}
return (
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick}>
确认订单
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
{/* 提交时触发的弹窗集合 */}
<ApprovedOrderModal
currentRef={approvedRef}
onConfirm={handleSubmit}
loading={loading}
isUseElectronicContract={formContext.data?.usingElectronicContracts ? true : false}
/>
{/* 提交时触发的签合同弹窗集合 */}
<OrderElectronModal
currentRef={electronRef}
type='saleOrder'
ctx={approvedRef.current.actions}
/>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyConfirmOrderDetail;
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key: 'sumPrice',
render: text => '¥' + text
},
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
{ title: '已发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `${text}次` : '' },
// @todo 发货单号跳转
{
title: '发货单号',
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
......@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
......
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