Commit 4e57c28a authored by XieZhiXiong's avatar XieZhiXiong
parents 274d0be1 62bb59a7
...@@ -55,13 +55,12 @@ ...@@ -55,13 +55,12 @@
} }
.commodityList { .commodityList {
display: flex;
flex-wrap: wrap;
padding: 0 5px 50px 0; padding: 0 5px 50px 0;
overflow-y: auto; overflow-y: auto;
height: 100vh; height: 100vh;
.commodityItem { .commodityItem {
display: inline-block;
width: 50%; width: 50%;
.commodityItemBody { .commodityItemBody {
......
...@@ -149,7 +149,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -149,7 +149,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
if(isMemberPrice) { if(isMemberPrice) {
parameter = await getMemberCredit(item.commodityUnitPrice.commodity.memberId, item.commodityUnitPrice.commodity.memberRoleId) parameter = await getMemberCredit(item.commodityUnitPrice.commodity.memberId, item.commodityUnitPrice.commodity.memberRoleId)
} }
Object.keys(unitPrice).forEach(key => { unitPrice && Object.keys(unitPrice).forEach(key => {
const keyArr = key.split('-') const keyArr = key.split('-')
const min = keyArr[0] const min = keyArr[0]
const max = keyArr[1] const max = keyArr[1]
...@@ -225,6 +225,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -225,6 +225,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
const index = checkedList.indexOf(id) const index = checkedList.indexOf(id)
checkedList.splice(index, 1) checkedList.splice(index, 1)
setCheckedList(checkedList) setCheckedList(checkedList)
if(checkedList.length === 0) {
setIndeterminate(false)
}
} }
} }
...@@ -319,7 +322,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -319,7 +322,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
if (isEmpty(priceItem)) { if (isEmpty(priceItem)) {
priceItem = getMaxCountRange(priceRange, count) priceItem = getMaxCountRange(priceRange, count)
} }
return parseFloat(priceItem.price) * count return (priceItem && priceItem.price) ? parseFloat(priceItem.price) * count : 0
} }
} }
......
...@@ -67,6 +67,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -67,6 +67,7 @@ const AddBrand: React.FC<{}> = () => {
const [formValues, setFormValues] = useState<any>({}) const [formValues, setFormValues] = useState<any>({})
const [banSomeField, setBanSomeField] = useState<boolean>(false) const [banSomeField, setBanSomeField] = useState<boolean>(false)
const [isDisabledSave, setIsDisabledSave] = useState<boolean>(false) const [isDisabledSave, setIsDisabledSave] = useState<boolean>(false)
const [isDisabledCheck, setDisabledCheck] = useState<boolean>(false)
useEffect(()=>{ useEffect(()=>{
const { id } = history.location.query const { id } = history.location.query
...@@ -153,7 +154,9 @@ const AddBrand: React.FC<{}> = () => { ...@@ -153,7 +154,9 @@ const AddBrand: React.FC<{}> = () => {
} }
const handleApplyCheck = () => { const handleApplyCheck = () => {
setDisabledCheck(true)
PublicApi.postProductBrandApplyCheckBrand({id: responseId}).then(res=>{ PublicApi.postProductBrandApplyCheckBrand({id: responseId}).then(res=>{
setDisabledCheck(false)
setCurrentStep(1) setCurrentStep(1)
setTimeout(() => { setTimeout(() => {
history.goBack() history.goBack()
...@@ -183,7 +186,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -183,7 +186,7 @@ const AddBrand: React.FC<{}> = () => {
backIcon={<ReutrnEle description="返回"/>} backIcon={<ReutrnEle description="返回"/>}
title={history.location.query?.id?'修改品牌':'新建品牌'} title={history.location.query?.id?'修改品牌':'新建品牌'}
extra={[ 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 icon={<SaveOutlined />} key="1" type="primary" onClick={handleSave} disabled={isDisabledSave}>
保存 保存
</Button>, </Button>,
......
...@@ -233,7 +233,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => { ...@@ -233,7 +233,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
} }
}) })
// FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => { // FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
// searchCustomerCategoryOptionEffect(actions, 'customerCategoryId') // searchCustomerCategoryOptionEffect(schemaAction, actions, 'customerCategoryId')
// }) // })
actions.setFieldState('brandId', state => { actions.setFieldState('brandId', state => {
state.props['x-component-props'].queryParams = { state.props['x-component-props'].queryParams = {
......
...@@ -356,11 +356,18 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -356,11 +356,18 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
} }
// 高级筛选schema中用于输入搜索商品品类的Effect // 高级筛选schema中用于输入搜索商品品类的Effect
/**
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => { * @param ctx 外部表单action
context.getFieldState(fieldName, state => { * @param mctx 模态框表单action
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => { * @param fieldName 字段名称
context.setFieldState(fieldName, state => { */
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 state.props['x-component-props'].dataoption = res.data
}) })
}) })
......
...@@ -194,7 +194,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -194,7 +194,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}, []) }, [])
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
console.log(value, 'value', addSchemaAction.getFieldValue("orderProductRequests"))
let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests)) let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests))
let processEnum = value['processEnum'] let processEnum = value['processEnum']
let usingElectronicContracts = value['usingElectronicContracts'] let usingElectronicContracts = value['usingElectronicContracts']
......
...@@ -131,9 +131,12 @@ const basicInfo: ISchema = { ...@@ -131,9 +131,12 @@ const basicInfo: ISchema = {
orderThe: { orderThe: {
type: 'string', type: 'string',
title: '订单摘要', title: '订单摘要',
required: true,
"x-rules": [ "x-rules": [
{ {
required: true,
message: '请输入订单摘要'
},
{
limitByte: true, limitByte: true,
maxByte: 60 maxByte: 60
} }
......
import React, { useRef } from 'react' 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 { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
// 业务hooks // 业务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: 'id'})
const handleSubmit = async (record) => { const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER) { if (record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyFileOrder/detail?id=${record.id}`) history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyFileOrder/detail?id=${record.id}`)
} }
} }
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) => <> render: (text, record) => <>
{ {
record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER && record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>归档</Button> <Button type='link' onClick={() => handleSubmit(record)}>归档</Button>
} }
</> </>
} }
]) ])
return { return {
columns: secondColumns, columns: secondColumns,
ref, ref,
rowSelection, rowSelection,
rowSelectionCtl rowSelectionCtl
} }
} }
...@@ -62,7 +62,7 @@ export const useSelfTable = () => { ...@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key: 'sumPrice', key: 'sumPrice',
render: (t, r) => r.type === 7 || r.type === 8 ? t : '¥' + t 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 收货单号跳转 // @todo 收货单号跳转
{ {
title: '入库单号', 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