Commit 9610dc7e authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理品牌重复提交问题,处理采购下单摘要校验问题

parent a5794d15
......@@ -67,6 +67,7 @@ const AddBrand: React.FC<{}> = () => {
const [formValues, setFormValues] = useState<any>({})
const [banSomeField, setBanSomeField] = useState<boolean>(false)
const [isDisabledSave, setIsDisabledSave] = useState<boolean>(false)
const [isDisabledCheck, setDisabledCheck] = useState<boolean>(false)
useEffect(()=>{
const { id } = history.location.query
......@@ -153,7 +154,9 @@ const AddBrand: React.FC<{}> = () => {
}
const handleApplyCheck = () => {
setDisabledCheck(true)
PublicApi.postProductBrandApplyCheckBrand({id: responseId}).then(res=>{
setDisabledCheck(false)
setCurrentStep(1)
setTimeout(() => {
history.goBack()
......@@ -183,7 +186,7 @@ const AddBrand: React.FC<{}> = () => {
backIcon={<ReutrnEle description="返回"/>}
title={history.location.query?.id?'修改品牌':'新建品牌'}
extra={[
<Button key="2" disabled={isEnableCheck} onClick={handleApplyCheck}>直接提交审核</Button>,
<Button key="2" disabled={isEnableCheck} onClick={handleApplyCheck} disabled={isDisabledCheck}>直接提交审核</Button>,
<Button icon={<SaveOutlined />} key="1" type="primary" onClick={handleSave} disabled={isDisabledSave}>
保存
</Button>,
......
......@@ -233,7 +233,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
}
})
// FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
// searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
// searchCustomerCategoryOptionEffect(schemaAction, actions, 'customerCategoryId')
// })
actions.setFieldState('brandId', state => {
state.props['x-component-props'].queryParams = {
......
......@@ -356,11 +356,18 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
}
// 高级筛选schema中用于输入搜索商品品类的Effect
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
/**
* @param ctx 外部表单action
* @param mctx 模态框表单action
* @param fieldName 字段名称
*/
export const searchCustomerCategoryOptionEffect = (ctx: any, mctx: any, fieldName: string) => {
let params: any = {}
params['memberId'] = ctx.getFieldValue('supplyMembersId')
params['memberRoleId'] = ctx.getFieldValue('supplyMembersRoleId')
mctx.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetMemberCategory(params).then(res => {
mctx.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
......
......@@ -194,7 +194,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}, [])
const handleSubmit = async (value) => {
console.log(value, 'value', addSchemaAction.getFieldValue("orderProductRequests"))
let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests))
let processEnum = value['processEnum']
let usingElectronicContracts = value['usingElectronicContracts']
......
......@@ -131,9 +131,12 @@ const basicInfo: ISchema = {
orderThe: {
type: 'string',
title: '订单摘要',
required: true,
"x-rules": [
{
required: true,
message: '请输入订单摘要'
},
{
limitByte: true,
maxByte: 60
}
......
import React, { useRef } from 'react'
import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { history } from 'umi'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
// 业务hooks
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyFileOrder/detail?id=${record.id}`)
}
}
const secondColumns: any[] = baseOrderListColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{
record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>归档</Button>
}
</>
}
])
return {
columns: secondColumns,
ref,
rowSelection,
rowSelectionCtl
}
}
import React, { useRef } from 'react'
import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { history } from 'umi'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
// 业务hooks
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyFileOrder/detail?id=${record.id}`)
}
}
const secondColumns: any[] = baseOrderListColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{
record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>归档</Button>
}
</>
}
])
return {
columns: secondColumns,
ref,
rowSelection,
rowSelectionCtl
}
}
......@@ -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: '入库单号',
......
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