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

fix:

parent e6d84293
......@@ -8,7 +8,7 @@
// import MemberRoute from './memberRoute' // 会员能力路由
// import ShopRoute from './shopRoute' // 店铺能力路由
// import ChannelRoute from './channelRoute' // 渠道能力路由
// import TranactionRoute from './tranactionRoute' // 交易能力路由
import TranactionRoute from './tranactionRoute' // 交易能力路由
// import LogisticsRoute from './logisticsRoutes' // 物流能力路由
// import PayandSettleRoute from './payandSettle' //支付与结算
// import AuthConfigRoute from './authConfigRoute'
......@@ -68,7 +68,7 @@ const memberCenterRoute = {
// },
// ShopRoute,
// CommodityRoute,
// srm开发临时使用...
TranactionRoute,
// ChannelRoute,
// ShopRoute,
// ProcurementRoute,
......
......@@ -37,17 +37,47 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/add',
name: 'addReadyAddOrder',
component: '@/pages/transaction/purchaseOrder/orderCollect',
hideInMenu: true,
},
component: '@/pages/transaction/purchaseOrder/orderCollect',
hideInMenu: true,
},
// 待新增订单-编辑订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/edit',
name: 'editReadyAddOrder',
component: '@/pages/transaction/purchaseOrder/orderCollect',
hideInMenu: true,
},
hideInMenu: true,
},
/** NEW Order */
// 待新增订单-新增SRM订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/srm/add',
name: 'addReadyAddOrder',
component: '@/pages/transaction/purchaseOrder/orderCollectSrm',
hideInMenu: true,
},
// 待新增订单-编辑SRM订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/srm/edit',
name: 'editReadyAddOrder',
component: '@/pages/transaction/purchaseOrder/orderCollectSrm',
hideInMenu: true,
},
// 待新增订单-新增B2B订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/add',
name: 'addReadyAddOrder',
component: '@/pages/transaction/purchaseOrder/orderCollectB2b',
hideInMenu: true,
},
// 待新增订单-编辑B2B订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/edit',
name: 'editReadyAddOrder',
component: '@/pages/transaction/purchaseOrder/orderCollectB2b',
hideInMenu: true,
},
/** NEW Order end */
// 一级审核
{
path: '/memberCenter/tranactionAbility/purchaseOrder/firstApprovedOrder',
......@@ -66,9 +96,9 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/firstApprovedOrder/detail',
name: 'firstApprovedOrderDetail',
component: '@/pages/transaction/purchaseOrder/firstApprovedOrder/detail',
hideInMenu: true,
noMargin: true,
component: '@/pages/transaction/purchaseOrder/firstApprovedOrder/detail',
hideInMenu: true,
noMargin: true,
},
// 二级审核
{
......@@ -88,9 +118,9 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/secondApprovedOrder/detail',
name: 'secondApprovedOrderDetail',
component: '@/pages/transaction/purchaseOrder/secondApprovedOrder/detail',
hideInMenu: true,
noMargin: true,
component: '@/pages/transaction/purchaseOrder/secondApprovedOrder/detail',
hideInMenu: true,
noMargin: true,
},
// 待提交订单
{
......@@ -110,9 +140,9 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readySubmitOrder/detail',
name: 'readySubmitOrderDetail',
component: '@/pages/transaction/purchaseOrder/readySubmitOrder/detail',
hideInMenu: true,
noMargin: true,
component: '@/pages/transaction/purchaseOrder/readySubmitOrder/detail',
hideInMenu: true,
noMargin: true,
},
// 待确认电子合同
{
......@@ -132,9 +162,9 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyConfirmContract/detail',
name: 'readyConfirmContractDetail',
component: '@/pages/transaction/purchaseOrder/readyConfirmContract/detail',
hideInMenu: true,
noMargin: true,
component: '@/pages/transaction/purchaseOrder/readyConfirmContract/detail',
hideInMenu: true,
noMargin: true,
},
// 待支付订单
{
......@@ -154,9 +184,9 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail',
name: 'readyPayOrderDetail',
component: '@/pages/transaction/purchaseOrder/readyPayOrder/detail',
hideInMenu: true,
noMargin: true,
component: '@/pages/transaction/purchaseOrder/readyPayOrder/detail',
hideInMenu: true,
noMargin: true,
},
// 待新增入库单订单
{
......@@ -190,9 +220,9 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/detail',
name: 'readyReceiveOrderDetail',
component: '@/pages/transaction/purchaseOrder/readyReceiveOrder/detail',
hideInMenu: true,
noMargin: true,
component: '@/pages/transaction/purchaseOrder/readyReceiveOrder/detail',
hideInMenu: true,
noMargin: true,
},
// 待归档订单
{
......@@ -212,10 +242,10 @@ export default [
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyFileOrder/detail',
name: 'readyFileOrderDetail',
component: '@/pages/transaction/purchaseOrder/readyFileOrder/detail',
hideInMenu: true,
component: '@/pages/transaction/purchaseOrder/readyFileOrder/detail',
hideInMenu: true,
noMargin: true,
},
]
}
]
\ No newline at end of file
]
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-04-21 18:13:25
* @LastEditors: zwp
* @LastEditTime: 2021-06-02 09:51:00
* @LastEditTime: 2021-08-02 09:51:00
* @Description: 订单能力相关常量
*/
......@@ -55,24 +55,6 @@ export const ORDER_TYPE_BIDDING_CONTRACT = 10;
*/
export const ORDER_TYPE_TENDER_CONTRACT = 11;
/**
* 对应中文 @参考下面的 ORDER_TYPE
*/
// export const ORDER_TYPE = {
// [ORDER_TYPE_INQUIRYT_PURCHASE]: '询价采购',
// [ORDER_TYPE_DEMAND_PURCHASE]: '需求采购',
// [ORDER_TYPE_STORE_PURCHASE]: '现货采购',
// [ORDER_TYPE_CENTRAL_PURCHASE]: '集采',
// [ORDER_TYPE_CHANNEL_DIRECT_MINING]: '渠道直采',
// [ORDER_TYPE_CHANNEL_STORE]: '渠道现货',
// [ORDER_TYPE_POINTS]: '积分兑换',
// [ORDER_TYPE_CHANNEL_POINTS]: '渠道积分兑换',
// [ORDER_TYPE_INQUIRY_CONTRACT]: '采购询价合同',
// [ORDER_TYPE_BIDDING_CONTRACT]: '采购竞价合同',
// [ORDER_TYPE_TENDER_CONTRACT]: '采购招标合同',
// };
/** 评价管理里面使用的订单类型常量 */
......@@ -178,51 +160,13 @@ export const OrderTypeMap = {
11: "采购竞价合同下单"
}
// 下单模式
// 下单模式 *NEW
export enum OrderModalType {
/**
* 进货单下单
*/
PURCHASE_ORDER = 5,
/**
* 手工下单
*/
HAND_ORDER,
/**
* 询价报价下单
*/
INQUIRY_QUOTATION_ORDER,
/**
* 需求报价下单
*/
DEMAND_QUOTATION_ORDER,
/**
* 合并订单下单
*/
CONSOLIDATED_ORDER,
/**
* 渠道直采进货单下单
*/
CHANNEL_DIRECT_PURCHASE_ORDER,
/**
* 渠道直采手工下单
*/
CHANNEL_DIRECT_MINING_ORDER,
/**
* 渠道现货进货单下单
*/
CHANNEL_SPOT_PURCHASE_ORDER,
/**
* 渠道现货手工下单
*/
CHANNEL_SPOT_MANUAL_ORDER,
INQUIRY_QUOTATION_ORDER = 7,
/**
* 采购询价合同下单
......@@ -240,6 +184,7 @@ export enum OrderModalType {
PURCHASE_BIDDING_CONTRACT_ORDER = 33,
}
/** 订单外部显示文案 */
export const PurchaseOrderOutWorkStateTexts = {
"-1": "取消订单",
......
import React, { useEffect } from 'react'
import { EnvironmentOutlined } from '@ant-design/icons'
import { Popover, Row, Space } from 'antd'
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
return pickInfo && pickInfo.deliverType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<p>{pickInfo.receiver} / {pickInfo.phone}</p>
<p>{pickInfo.address}</p>
</div>
</Row>
}>
{children}
</Popover>
</Space> : children
}
......@@ -6,8 +6,8 @@ import { PublicApi } from '@/services/api'
import styled from 'styled-components'
import { createFormActions } from '@formily/antd'
import MellowCard from '@/components/MellowCard'
import { AddressPop } from '../../purchaseOrder/orderCollect/components/productModalTable'
import { DELIVERY_TYPE, OrderModalType } from '@/constants/order'
import { AddressPop } from '../addressPop'
export interface OrderProductTableProps {
editable: boolean
......
......@@ -10,7 +10,6 @@ import MellowCard from '@/components/MellowCard'
import { usePageStatus } from '@/hooks/usePageStatus'
import ModalTable from '@/components/ModalTable'
import { formatTimeString } from '@/utils'
import { AddressPop } from '../../purchaseOrder/orderCollect/components/productModalTable'
import {
DELIVERY_TYPE,
OrderModalType,
......@@ -19,6 +18,7 @@ import {
ORDER_TYPE2_TENDER_CONTRACT,
SaleOrderInsideWorkStateTexts
} from '@/constants/order'
import { AddressPop } from '../addressPop'
export interface OrderProductTableProps {}
......@@ -371,7 +371,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
};
const handlePreviewWarehouse = (record) => {
setCheckProductId(record.productId)
setCheckProductId(record.skuId)
setWarehouseVisible(true)
}
......
......@@ -74,7 +74,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const [recordId, setRecordId] = useState<any>()
const ref = useRef<any>({})
const destoryRef = useRef<any>({})
const { run, loading } = useHttpRequest(PublicApi.postOrderPurchaseOrderCancel)
const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerCancel)
// 售后唤起弹窗
const handleSaleAfter = (id) => {
......
......@@ -70,31 +70,6 @@ export const materialColumns: any[] = [
},
]
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
let receiveInfo = pickInfo?.render && JSON.parse(pickInfo.render)
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
{/* <p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p> */}
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
<p>{receiveInfo.provinceName + receiveInfo.cityName + receiveInfo.districtName + receiveInfo.address}</p>
</>
}
</div>
</Row>
}>
{children}
</Popover>
</Space> : children
}
const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
const { type = 'checkbox', schemaAction, confirmModal, currentRef, sectionProps, ...restProps } = props
const { visible, setVisible, rowSelection, rowSelectionCtl } = sectionProps
......
......@@ -72,24 +72,6 @@ const orderProductShopTypeMaps = {
[OrderModalType.CHANNEL_SPOT_MANUAL_ORDER]: 4
}
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
return pickInfo && pickInfo.deliverType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<p>{pickInfo.receiver} / {pickInfo.phone}</p>
<p>{pickInfo.address}</p>
</div>
</Row>
}>
{children}
</Popover>
</Space> : children
}
export const filterProductDataById = (data, targetData) => {
return targetData.reduce(async (prev: any[], next) => {
const { logistics } = next
......
......@@ -3,8 +3,8 @@ import { formatTimeString } from '@/utils'
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';
import { AddressPop } from '@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......
......@@ -409,7 +409,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
return message.error('请先选择适应商城')
}
const orderModel = addSchemaAction.getFieldValue('orderModel')
if (orderModel === OrderModalType.INQUIRY_QUOTATION_ORDER || orderModel === OrderModalType.CONSOLIDATED_ORDER) {
if (orderModel === OrderModalType.INQUIRY_QUOTATION_ORDER) {
inquiryRef.current.setVisible(true)
} else {
demandRef.current.setVisible(true)
......@@ -622,14 +622,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// 手动切换过下单模式, 需重置受下单模式影响的字段
if (editable) {
if (value === OrderModalType.PURCHASE_ORDER) {
// 进货单下单,尝试回显保存的数据
console.log(shopDataRef.current)
// 初始化时绑定加载进货单数据的函数
state.remoteDataFn(shopDataRef.current)
return ;
}
ctx.reset({
validate: false,
selector: '*(quotationNo,supplyMembersName,supplyMembersId,orderProductRequests,orderThe)'
......@@ -654,21 +646,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
console.log(pageStatus, value, '666')
const quotationOrderValue = ctx.getFieldValue('quotationNo')
if (
value === OrderModalType.HAND_ORDER ||
value === OrderModalType.CHANNEL_DIRECT_MINING_ORDER ||
value === OrderModalType.CHANNEL_SPOT_MANUAL_ORDER ||
(value === OrderModalType.CONSOLIDATED_ORDER && quotationOrderValue)
) {
setTimeout(() => {
addSchemaAction.setFieldState('orderProductRequests', productState => {
productState.props["x-component-props"] = {
...productState.props["x-component-props"],
prefix: editable ? productAddButton : '',
}
})
})
removeContractColumn()
} else if (
value === OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER ||
value === OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER ||
value === OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER
......@@ -748,7 +725,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderCombination,
addNewAddress,
CirculationRecord: <CirculationRecord/>,
handleQuotation: (value) => addSchemaAction.getFieldValue('orderModel') === OrderModalType.CONSOLIDATED_ORDER && !!value,
handleQuotation: (value) => !!value,
help,
}}
/>
......
......@@ -72,24 +72,6 @@ const orderProductShopTypeMaps = {
[OrderModalType.CHANNEL_SPOT_MANUAL_ORDER]: 4
}
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
return pickInfo && pickInfo.deliverType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<p>{pickInfo.receiver} / {pickInfo.phone}</p>
<p>{pickInfo.address}</p>
</div>
</Row>
}>
{children}
</Popover>
</Space> : children
}
export const filterProductDataById = (data, targetData) => {
return targetData.reduce(async (prev: any[], next) => {
const { logistics } = next
......
......@@ -3,8 +3,8 @@ import { formatTimeString } from '@/utils'
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';
import { AddressPop } from '@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......
......@@ -484,7 +484,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderCombination,
addNewAddress,
CirculationRecord: <CirculationRecord/>,
handleQuotation: (value) => addSchemaAction.getFieldValue('orderModel') === OrderModalType.CONSOLIDATED_ORDER && !!value,
help,
}}
/>
......
......@@ -97,36 +97,17 @@ const basicInfo: ISchema = {
{
type: 'value:visible',
"target": "quotationNo",
"condition": `{{orderCombination.showQuotationNoOrder.includes($value)}}`
"condition": `{{orderCombination.showQuotationField.includes($value)}}`
},
// 联动显示单据按钮
{
type: "value:schema",
"target": "quotationNo",
condition: `{{!!$value && orderCombination.showQuotationNoOrderBtn.includes($value) || orderCombination.showPurchaseContract.includes($value)}}`,
condition: `{{!!$value && orderCombination.showQuotationBtn.includes($value)}}`,
schema: {
"x-component-props": {
disabled: true,
addonAfter: "{{orderCombination.showQuotationNoOrderBtn.includes($value) ? orderNoPrice : orderContract}}"
}
},
otherwise: {
visible: true,
"x-component-props": {
disabled: true,
addonAfter: ""
}
}
},
// 联动显示供应会员按钮
{
type: "value:schema",
"target": "supplyMembersName",
condition: `{{$self.editable && $value && orderCombination.showSupplyMembersNameBtn.includes($value)}}`,
schema: {
"x-component-props": {
disabled: true,
addonAfter: "{{orderMember}}"
addonAfter: "{{orderNoPrice}}"
}
},
otherwise: {
......@@ -171,7 +152,7 @@ const basicInfo: ISchema = {
{
type: 'value:schema',
target: "supplyMembersName",
condition: `{{$self.editable && handleQuotation($value)}}`,
condition: `{{$self.editable && !!$value}}`,
schema: {
"x-component-props": {
disabled: true,
......
......@@ -70,31 +70,6 @@ export const materialColumns: any[] = [
},
]
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
let receiveInfo = pickInfo?.render && JSON.parse(pickInfo.render)
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
{/* <p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p> */}
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
<p>{receiveInfo.provinceName + receiveInfo.cityName + receiveInfo.districtName + receiveInfo.address}</p>
</>
}
</div>
</Row>
}>
{children}
</Popover>
</Space> : children
}
const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
const { type = 'checkbox', schemaAction, confirmModal, currentRef, sectionProps, ...restProps } = props
const { visible, setVisible, rowSelection, rowSelectionCtl } = sectionProps
......
......@@ -3,8 +3,8 @@ import { formatTimeString } from '@/utils'
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';
import { AddressPop } from '@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -76,52 +76,26 @@ export const procurementProcessField = (value) => {
/***********控制订单模式联动其他字段的数组集合 *******/
export const orderCombination = {
// 需从外部页面传入参数生成的订单联动, 用于禁用下单模式的手动选择
queryPageOrderModal: [
OrderModalType.PURCHASE_ORDER,
OrderModalType.CHANNEL_DIRECT_PURCHASE_ORDER,
OrderModalType.CHANNEL_SPOT_PURCHASE_ORDER
],
// 是否显示报价单字段
showQuotationNoOrder: [
showQuotationField: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
OrderModalType.DEMAND_QUOTATION_ORDER,
OrderModalType.CONSOLIDATED_ORDER
],
// 是否显示报价单按钮
showQuotationNoOrderBtn: [
showQuotationSelectBtn: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
OrderModalType.DEMAND_QUOTATION_ORDER,
OrderModalType.CONSOLIDATED_ORDER,
],
// 是否显示选择采购合同按钮
showPurchaseContract: [
// 是否显示采购合同字段
showPurchaseContractField: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
// 是否显示供应会员按钮
showSupplyMembersNameBtn: [
OrderModalType.HAND_ORDER,
OrderModalType.CHANNEL_DIRECT_MINING_ORDER,
OrderModalType.CHANNEL_SPOT_MANUAL_ORDER,
OrderModalType.CONSOLIDATED_ORDER
],
// 渠道会员专属下单类型
channelMemberOrderModal: [
OrderModalType.CHANNEL_DIRECT_PURCHASE_ORDER,
OrderModalType.CHANNEL_DIRECT_MINING_ORDER,
OrderModalType.CHANNEL_SPOT_PURCHASE_ORDER,
OrderModalType.CHANNEL_SPOT_MANUAL_ORDER
// 是否显示选择采购合同按钮
showPurchaseContractBtn: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
// 企业个人会员专属下单类型
individualsMemberOrderModal: [
OrderModalType.PURCHASE_ORDER,
OrderModalType.HAND_ORDER,
OrderModalType.INQUIRY_QUOTATION_ORDER,
OrderModalType.DEMAND_QUOTATION_ORDER,
OrderModalType.CONSOLIDATED_ORDER,
]
}
export const orderTypeLabel = ['',
......@@ -134,28 +108,8 @@ export const orderTypeLabel = ['',
'渠道直采',
'渠道现货',
'渠道现货',
// '采购询价合同',
// '采购竞价合同',
// '采购招标合同',
]
// 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 => {
......
......@@ -94,42 +94,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// 表单初始化时,对应操作
export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const { modelType = 0, spam_id } = history.location.query
const typeEnums = parseInt(modelType)
const auth: any = getAuth()
FormEffectHooks.onFormMount$().subscribe(async () => {
ctx.setFieldState('orderModel', state => {
state.props.enum = state.props.enum.map(v => {
const assign: any = Object.assign({}, v)
// 过滤服务提供者
if (auth.memberRoleType === 2) { // 采购商
// 企业+个人
if ((auth.memberType === 1 || auth.memberType === 2) && (assign.value > 9 && assign.value < 30)) {
assign.disabled = true
}
// 渠道(企业+个人)
if ((auth.memberType === 3 || auth.memberType === 4) && assign.value < 10) {
assign.disabled = true
}
// 商城下单
if (orderCombination.queryPageOrderModal.includes(assign.value) && typeEnums !== assign.value) {
assign.disabled = true
}
// 禁用积分
if (assign.value === 24 || assign.value === 25) {
assign.disabled = true
}
} else {
assign.disabled = true
}
return assign
}).sort((prev, next) => prev.disabled ? prev.value : next.value - prev.value)
})
// 写入收货地址数据
useProductAddress(ctx)
})
......
......@@ -84,14 +84,12 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
/** 采购订单SRM下单 有选择采购合同和显示物料 */
const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const shopDataRef = useRef<any>({})
const memberRef = useRef<any>({})
const inquiryRef = useRef<any>({})
const contractOrderRef = useRef<any>({}) // 合同下单选采购合同
const [formLoading, setFormLoading] = useState(false)
const [btnLoading, setBtnLoading] = useState(false)
const update = useUpdate()
const productSumPriceRef = useRef<any>(0)
const { pageStatus, id, page_type = '0', modelType, spam_id } = usePageStatus()
const { pageStatus, id, page_type = '0', modelType, om } = usePageStatus()
const [initFormSchema, setInitFormSchema] = useState<any>(() => ({...mergeAllSchemas[page_type]}))
const [initFormValue, setInitFormValue] = useState<any>(() => {
let resultState = {}
......@@ -238,23 +236,14 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
}
// 选择会员弹窗
const handleOrderMember = () => {
if(!addSchemaAction.getFieldValue('shopId')) {
return message.error('请先选择适应商城')
}
memberRef.current.setVisible(true)
}
// 选择合同
const handleOrderContract = () => {
if(!addSchemaAction.getFieldValue('shopId')) {
return message.error('请先选择适应商城')
}
// if(!addSchemaAction.getFieldValue('shopId')) {
// return message.error('请先选择适应商城')
// }
contractOrderRef.current.setVisible(true)
}
const orderMember = pageStatus !== PageStatus.PREVIEW && <div className='connectBtn' onClick={handleOrderMember}><LinkOutlined style={{marginRight: 4}}/>选择</div>
const orderContract = pageStatus !== PageStatus.PREVIEW && <div className='connectBtn' onClick={handleOrderContract}><LinkOutlined style={{marginRight: 4}}/>选择</div>
// 新增收货地址
......@@ -336,23 +325,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// setProductSumPrice(payload)
productSumPriceRef.current = payload
})
$('onFieldInputChange', 'orderModel').subscribe(state => {
const { editable, value } = state
// 手动切换过下单模式, 需重置受下单模式影响的字段
if (editable) {
ctx.reset({
validate: false,
selector: '*(quotationNo,supplyMembersName,supplyMembersId,orderProductRequests,orderThe)'
})
// 清空弹窗所选的值
memberRef.current.rowSelectionCtl.setSelectRow([])
memberRef.current.rowSelectionCtl.setSelectedRowKeys([])
inquiryRef.current.rowSelectionCtl.setSelectRow([])
inquiryRef.current.rowSelectionCtl.setSelectedRowKeys([])
}
})
useOrderFormInitEffect(ctx)
useModelTypeChange(state => {
const { value } = state
......@@ -368,7 +340,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}}
expressionScope={{
orderMember,
orderContract,
materialColumns,
materialAddButton,
......@@ -376,7 +347,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderCombination,
addNewAddress,
CirculationRecord: <CirculationRecord/>,
handleQuotation: (value) => addSchemaAction.getFieldValue('orderModel') === OrderModalType.CONSOLIDATED_ORDER && !!value,
help,
}}
/>
......
......@@ -13,59 +13,6 @@ const getShopTypeMap = (() => {
}))
})()
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: ISchema = {
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: '请输入订单摘要',
}
},
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
}
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
// 基本信息
const basicInfo: ISchema = {
......@@ -92,40 +39,21 @@ const basicInfo: ISchema = {
enum: GlobalConfig.web.orderMode.map(v => { delete v.platformType; return v}),
title: '下单模式',
"x-linkages": [
// 联动显示单据字段
// 联动显示合同编号字段
{
type: 'value:visible',
"target": "quotationNo",
"condition": `{{orderCombination.showQuotationNoOrder.includes($value)}}`
"condition": `{{orderCombination.showPurchaseContractField.includes($value)}}`
},
// 联动显示单据按钮
// 联动显示选择合同按钮
{
type: "value:schema",
"target": "quotationNo",
condition: `{{!!$value && orderCombination.showQuotationNoOrderBtn.includes($value) || orderCombination.showPurchaseContract.includes($value)}}`,
condition: `{{!!$value && orderCombination.showPurchaseContractBtn.includes($value)}}`,
schema: {
"x-component-props": {
disabled: true,
addonAfter: "{{orderCombination.showQuotationNoOrderBtn.includes($value) ? orderNoPrice : orderContract}}"
}
},
otherwise: {
visible: true,
"x-component-props": {
disabled: true,
addonAfter: ""
}
}
},
// 联动显示供应会员按钮
{
type: "value:schema",
"target": "supplyMembersName",
condition: `{{$self.editable && $value && orderCombination.showSupplyMembersNameBtn.includes($value)}}`,
schema: {
"x-component-props": {
disabled: true,
addonAfter: "{{orderMember}}"
addonAfter: "{{orderContract}}"
}
},
otherwise: {
......@@ -161,7 +89,7 @@ const basicInfo: ISchema = {
},
quotationNo: {
type: 'string',
title: '对应报价单号',
title: '对应合同编号',
visible: false,
"x-component-props": {
disabled: true,
......@@ -170,7 +98,7 @@ const basicInfo: ISchema = {
{
type: 'value:schema',
target: "supplyMembersName",
condition: `{{$self.editable && handleQuotation($value)}}`,
condition: `{{$self.editable && !!$value}}`,
schema: {
"x-component-props": {
disabled: true,
......@@ -428,114 +356,7 @@ const ortherInfo: ISchema = {
}
}
// 审核单据
const auditRecord: ISchema = {
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
tab: '审核单据'
},
properties: {
NO_SUBMIT_LAYOUT_3: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'left',
labelCol: 4,
wrapperCol: 10
},
properties: {
state: {
title: '是否审核通过',
type: 'radio',
required: true,
enum: [
{
label: '审核通过',
value: 1
},
{
label: '审核不通过',
value: 0
}
],
editable: true,
default: 1,
"x-linkages": [
{
type: 'value:visible',
target: 'cause',
condition: "{{$value === 0}}"
}
]
},
cause: {
type: 'textarea',
title: '审核不通过原因',
required: true,
"x-component-props": {
rows: 3
},
editable: true,
}
}
}
}
}
// 电子合同
const electronicResult: ISchema = {
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
tab: '电子合同'
},
properties: {
NO_SUBMIT_LAYOUT_3: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'left',
labelCol: 4,
wrapperCol: 10
},
properties: {
electronic: {
title: '电子合同',
type: 'checkbox',
required: true,
enum: [
{
label: 'pdf',
value: true
}
],
editable: true,
default: false
}
}
}
}
}
// 流转记录
const transformRecord: ISchema = {
type: 'object',
"x-component": 'tabpane',
"x-component-props": {
tab: '流转记录'
},
properties: {
RECORD: {
type: 'object',
"x-component": 'VirtualChildren',
"x-component-props": {
children: "{{CirculationRecord}}"
}
}
}
}
// 新增订单详情
export const orderDetailSchema: ISchema = {
type: 'object',
......@@ -548,7 +369,6 @@ export const orderDetailSchema: ISchema = {
submitInfo,
orderMaterial,
ortherInfo,
transformRecord,
}
}
}
......@@ -566,8 +386,6 @@ export const auditOneSchema: ISchema = {
submitInfo,
orderMaterial,
ortherInfo,
auditRecord,
transformRecord
}
}
}
......@@ -602,8 +420,6 @@ export const orderElectronicSchema: ISchema = {
submitInfo,
orderMaterial,
ortherInfo,
electronicResult,
transformRecord
}
}
}
......
......@@ -11,7 +11,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import { useSelfTable } from './model/useReadyAddOrder'
import { PurchaseOrderInsideWorkState } from '@/constants/order'
import { OrderModalType, PurchaseOrderInsideWorkState } from '@/constants/order'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import '../index.less'
......@@ -71,16 +71,11 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
approvedActions.submit().then(async ({values}) => {
console.log(values)
currentRef.current.setVisible(false)
// const params = {
// id: Number(id),
// ...values
// }
// const result = await run(params)
// if (result.code === 1000) {
// approvedRef.current.setVisible(false)
// history.goBack()
// }
if(values.orderModel === OrderModalType.INQUIRY_QUOTATION_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/add?modelType=${values.orderModel}`)
} else {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/srm/add?modelType=${values.orderModel}`)
}
})
}
......
......@@ -39,7 +39,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const { run: runPause, loading: loadingEnd } = useHttpRequest(PublicApi.postOrderVendorTerminate)
// 提交取消
const handleSubmit = useCallback(() => {
const handleSubmit = () => {
destroyActions.submit().then(async ({values}: any) => {
const result = await run({ orderId: values.id, reason: values.cancelReason })
if (result.code === 1000) {
......@@ -49,10 +49,10 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}, 800)
}
})
}, [])
}
// 提交中止
const handleSubmitPause = useCallback(() => {
const handleSubmitPause = () => {
pauseActions.submit().then(async ({values}: any) => {
const result = await runPause({ orderId: values.id, reason: values.auditOpinion })
if (result.code === 1000) {
......@@ -62,7 +62,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}, 800)
}
})
}, [])
}
const handleEvaluate = (id) => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`)
......
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