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

fix:

parent e17c41d4
......@@ -4,6 +4,7 @@ import { Row } from 'antd'
import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import moment from 'moment'
import { AddressPop } from '../components/productModalTable'
import { GlobalConfig } from '@/global/config';
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -138,22 +139,30 @@ export const orderTypeLabel = ['',
// '采购招标合同',
]
export const orderTypeLabelMap = {
"5": "现货采购",
"6": "现货采购",
"7": "询价采购",
"8": "需求采购",
"9": "集采",
"10": "渠道直采",
"11": "渠道直采",
"12": "渠道现货",
"13": "渠道现货",
// "24": "积分兑换",
// "25": "渠道积分兑换",
"32": "采购询价合同",
"33": "采购招标合同",
"34": "采购竞价合同",
}
// export const orderTypeLabelMap = {
// "5": "现货采购",
// "6": "现货采购",
// "7": "询价采购",
// "8": "需求采购",
// "9": "集采",
// "10": "渠道直采",
// "11": "渠道直采",
// "12": "渠道现货",
// "13": "渠道现货",
// // "24": "积分兑换",
// // "25": "渠道积分兑换",
// "32": "采购询价合同",
// "33": "采购招标合同",
// "34": "采购竞价合同",
// }
export const orderTypeLabelMap = () => {
let tempObject: { [key: number]: string } = {}
GlobalConfig['web']['orderMode'].map(item => {
tempObject[item['value']] = item['label']
})
return tempObject;
}
// 支付方式
export const payTypeLabel = [
......
......@@ -206,10 +206,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}, [])
useEffect(() => {
console.log(initFormValue, 'init')
}, [initFormValue])
const handleSubmit = async (value) => {
let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests))
let processEnum = value['processEnum']
......@@ -589,7 +585,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// 判断合同下单
if(value > 30) {
ctx.setFieldState('quotationNo', state => {
state.props.title = orderTypeLabelMap[value]
state.props.title = orderTypeLabelMap()[value]
state.visible = true
})
ctx.setFieldState('needTheInvoice', state => {
......@@ -663,7 +659,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
addSchemaAction.setFieldState('orderProductRequests', productState => {
productState.props["x-component-props"] = {
...productState.props["x-component-props"],
prefix: editable ? materialAddButton : '',
prefix: editable && pageStatus === PageStatus.ADD ? materialAddButton : '',
}
})
// }, 500)
......@@ -679,7 +675,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// }, 500)
}
// 选择某种类型时, 需显示对应的订单类型
ctx.setFieldValue('type', orderTypeLabelMap[value])
ctx.setFieldValue('type', orderTypeLabelMap()[value])
})
useEditHideField()
// 商品信息的改动 驱动支付信息变化
......
......@@ -60,11 +60,12 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const [materialColumns, setMaterialColumns] = useState(() => {
const { pageStatus } = usePageStatus()
if (pageStatus === PageStatus.ADD) {
// 渲染操作
materialInfoColumns[materialInfoColumns.length - 1].render = (text, record) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
// 渲染单价
materialInfoColumns[7].render = (t, r) => {
materialInfoColumns[8].render = (t, r) => {
if(orderModel === OrderModalType["HAND_ORDER"]) {
return <PriceComp priceSection={r.unitPrice}/>
} else {
......@@ -82,13 +83,13 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
} else {
// 渲染单价
materialInfoColumns[7].render = (t, r) => <span style={{color: 'red'}}>{r.price}</span>
materialInfoColumns[8].render = (t, r) => <span style={{color: 'red'}}>{r.price}</span>
// 渲染商品ID
materialInfoColumns[0].render = (t, r) => r.productId
materialInfoColumns[materialInfoColumns.length - 1].render = (t, r) => null
}
return materialInfoColumns
})
const handleShowMaterial = () => {
......
......@@ -69,6 +69,7 @@ export const tableListSchema: ISchema = {
// 基本信息
const basicInfo: ISchema = {
"x-index": 0,
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
......@@ -257,6 +258,7 @@ const basicInfo: ISchema = {
}
// 订单商品
export const orderProduct: ISchema = {
"x-index": 2,
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
......@@ -287,6 +289,7 @@ export const orderProduct: ISchema = {
// 合同下单 订单物料
export const orderMaterial: ISchema = {
"x-index": 2,
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
......@@ -317,6 +320,7 @@ export const orderMaterial: ISchema = {
// 支付信息
export const payInfo: ISchema = {
"x-index": 3,
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
......@@ -345,6 +349,7 @@ export const payInfo: ISchema = {
// 交付信息
const submitInfo: ISchema = {
"x-index": 1,
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
......@@ -406,6 +411,7 @@ const submitInfo: ISchema = {
// 其他信息
const ortherInfo: ISchema = {
"x-index": 4,
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
......
......@@ -51,8 +51,8 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
}
const handleBitchPush = async () => {
const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (canBitch) {
// const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (rowSelectionCtl.selectRow.length) {
const { code } = await submitRun({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) {
ref.current.reload()
......@@ -60,7 +60,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('只能提交审核待新增的订单')
message.error('请先选择待新增的订单')
}
}
......
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