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

fix: 评标模板已经关联不给予更改操作,对接SRM订单修改

parent 3ee6e3fd
...@@ -77,8 +77,8 @@ const memberCenterRoute = { ...@@ -77,8 +77,8 @@ const memberCenterRoute = {
// AuthConfigRoute, // AuthConfigRoute,
// MemberRoute, // MemberRoute,
// HandlingRoute, // HandlingRoute,
marketingRoute, // marketingRoute,
// ...asyncRoutes, ...asyncRoutes,
{ {
path: '/memberCenter/noAuth', path: '/memberCenter/noAuth',
auth: false, auth: false,
......
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { Button, Popconfirm } from 'antd' import { Button, message, Popconfirm } from 'antd'
import StatusSwitch from '@/components/StatusSwitch' import StatusSwitch from '@/components/StatusSwitch'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview' import EyePreview from '@/components/EyePreview'
...@@ -67,13 +67,29 @@ export const useSelfTable = () => { ...@@ -67,13 +67,29 @@ export const useSelfTable = () => {
} }
const handleDelete = (id) => { const handleDelete = (id) => {
PublicApi.postPurchaseTemplateDeleteBatchTemplate({ idList: [id] }).then(res => { if(!verifyCorrelation(id)) {
if(res.code === 1000) { PublicApi.postPurchaseTemplateDeleteBatchTemplate({ idList: [id] }).then(res => {
ref.current.reload() if(res.code === 1000) {
} ref.current.reload()
}) }
})
} else {
return message.error('该评标模板已经被使用,不能删除')
}
} }
const handleEdit = (id) => {
if(!verifyCorrelation(id)) {
history.push(`/memberCenter/procurementAbility/callForBids/remarkBidTemplate/edit?id=${id}`)
} else {
return message.error('该评标模板已经被使用,不能修改')
}
}
const verifyCorrelation = async (id) => {
const { data } = await getPurchaseTemplateGetTemplateIsUse({id})
return data
}
const secondColumns: any[] = baseBidListColumns.concat([ const secondColumns: any[] = baseBidListColumns.concat([
{ {
...@@ -82,7 +98,7 @@ export const useSelfTable = () => { ...@@ -82,7 +98,7 @@ export const useSelfTable = () => {
dataIndex: 'ctl', dataIndex: 'ctl',
key: 'ctl', key: 'ctl',
render: (text, record) => <> render: (text, record) => <>
<Button type='link' onClick={() => history.push(`/memberCenter/procurementAbility/callForBids/remarkBidTemplate/edit?id=${record.id}`)}>编辑</Button> <Button type='link' onClick={() => handleEdit(record.id)}>编辑</Button>
<Popconfirm <Popconfirm
title="确定要执行该操作?" title="确定要执行该操作?"
onConfirm={() => handleDelete(record.id)} onConfirm={() => handleDelete(record.id)}
...@@ -91,7 +107,6 @@ export const useSelfTable = () => { ...@@ -91,7 +107,6 @@ export const useSelfTable = () => {
> >
<Button <Button
type='link' type='link'
// onClick={() => handleDelete(record.id)}
>删除</Button> >删除</Button>
</Popconfirm> </Popconfirm>
</> </>
......
import { ISchema } from "@formily/antd";
export const schema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": "mega-layout",
"x-component-props": {
grid: true,
autoRow: true,
labelCol: 4,
labelAlign: 'left',
columns: 2
},
properties: {
addresId: {
type: 'string',
enum: [],
title: '发货地址',
"x-rules": [
{
message: '请选择发货地址',
required: true
}
],
"x-mega-props": {
span: 1
}
},
deliveryTime: {
type: 'string',
"x-component": 'date',
title: '发货日期',
"x-rules": [
{
message: '请选择发货日期',
required: true
}
],
"x-mega-props": {
full: true,
span: 1
}
},
logisticsNo: {
type: 'string',
title: '物流单号',
"x-rules": [
{
limitByte: true,
maxByte: 20
},
],
"x-mega-props": {
span: 1
}
},
logisticsCompanyId: {
type: 'string',
enum: [],
title: '物流公司',
"x-mega-props": {
span: 1
}
},
products: {
type: 'array',
"x-component": 'MultTable',
"x-component-props": {
rowKey: 'skuId',
columns: "{{productColumns}}",
components: "{{productComponents}}",
// expandable: "{{productChildren}}",
// pagination: { size: 'small' }
},
"x-mega-props": {
span: 2
}
},
address: {
type: 'string',
display: false
},
company: {
type: 'string',
display: false
}
}
}
}
}
// 商品列 @todo 补充积分类型文案
export const productColumns: any = [
{
title: '商品ID',
dataIndex: 'skuId',
align: 'center',
key: 'skuId'
},
{
title: '商品名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: '单价',
dataIndex: 'price',
align: 'center',
key: 'price',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'leftCount',
align: 'center',
key: 'leftCount',
},
{
title: '已收货',
dataIndex: 'received',
align: 'center',
key: 'received',
},
{
title: '差异数量',
dataIndex: 'differCount',
align: 'center',
key: 'differCount',
},
{
title: '发货数量',
dataIndex: 'deliveryCount',
align: 'left',
key: 'deliveryCount',
formItem: 'input',
editable: true,
width: 140,
},
]
// 物料列
export const materialColumns: any = [
{
title: 'ID',
dataIndex: 'productId',
align: 'center',
key: 'productId',
className: 'commonHide'
},
{
title: '物料编号',
dataIndex: 'productNo',
align: 'center',
key: 'productNo',
},
{
title: '物料名称/规格',
dataIndex: 'name',
align: 'center',
key: 'name',
// render: (t, r) => `${t}/${r.type}`
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '关联报价商品ID/名称/规格/品类/品牌',
dataIndex: 'quotedSkuId',
align: 'center',
key: 'quotedSkuId',
render: (t, r) => `${t}/${r.quotedName || ''}/${r.quotedCategory || ''}/${r.quotedBrand || ''}`
},
{
title: '采购数量',
dataIndex: 'quantity',
align: 'center',
key: 'quantity',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'leftCount',
align: 'center',
key: 'leftCount',
},
{
title: '已收货',
dataIndex: 'received',
align: 'center',
key: 'received',
},
{
title: '差异数量',
dataIndex: 'differCount',
align: 'center',
key: 'differCount',
},
{
title: '发货数量',
dataIndex: 'deliveryCount',
align: 'left',
key: 'deliveryCount',
formItem: 'input',
editable: true,
width: 140,
},
]
import React, { useContext, useRef, useEffect, useState } from 'react' import React, { useContext, useRef, useEffect, useState } from 'react'
import { Button, Drawer } from 'antd' import { Button, Drawer } from 'antd'
import NiceForm from '@/components/NiceForm' import NiceForm from '@/components/NiceForm'
import { createFormActions, ISchema } from '@formily/antd' import { createFormActions } from '@formily/antd'
import { history } from 'umi' import { history } from 'umi'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect' import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { OrderDetailContext } from '../../_public/order/context' import { OrderDetailContext } from '../../_public/order/context'
import moment from 'moment' import moment from 'moment'
import { useProductTable } from './model/useProductTable' import { useProductTable } from './model/useProductTable'
import { OrderKindType } from '@/constants/order'
import { schema } from './constant'
export interface OrderHandDeleveModalProps { export interface OrderHandDeleveModalProps {
currentRef: any currentRef: any
...@@ -15,116 +17,15 @@ export interface OrderHandDeleveModalProps { ...@@ -15,116 +17,15 @@ export interface OrderHandDeleveModalProps {
const schemaActions = createFormActions() const schemaActions = createFormActions()
const schema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": "mega-layout",
"x-component-props": {
// labelAlign: 'left',
// labelCol: 6,
grid: true,
autoRow: true,
labelCol: 4,
labelAlign: 'left',
columns: 2
},
properties: {
addresId: {
type: 'string',
enum: [],
title: '发货地址',
"x-rules": [
{
message: '请选择发货地址',
required: true
}
],
"x-mega-props": {
span: 1
}
},
deliveryTime: {
type: 'string',
"x-component": 'date',
title: '发货日期',
"x-rules": [
{
message: '请选择发货日期',
required: true
}
],
"x-mega-props": {
full: true,
span: 1
}
},
logisticsNo: {
type: 'string',
title: '物流单号',
"x-rules": [
// {
// required: true,
// message: '请输入物流单号'
// },
{
limitByte: true,
maxByte: 20
},
],
"x-mega-props": {
span: 1
}
},
logisticsCompanyId: {
type: 'string',
enum: [],
title: '物流公司',
// "x-rules": [
// {
// message: '请选择物流公司',
// required: true
// }
// ],
"x-mega-props": {
span: 1
}
},
products: {
type: 'array',
"x-component": 'MultTable',
"x-component-props": {
rowKey: 'skuId',
columns: "{{productColumns}}",
components: "{{productComponents}}",
// expandable: "{{productChildren}}",
// pagination: { size: 'small' }
},
"x-mega-props": {
span: 2
}
},
address: {
type: 'string',
display: false
},
company: {
type: 'string',
display: false
}
}
}
}
}
const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => { const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => {
const { data } = useContext(OrderDetailContext) const { data } = useContext(OrderDetailContext)
const { orderKind } = data || {}
const contractOrder = (orderKind === OrderKindType.SRM_ORDER)
const dataRef = useRef<any>({}) const dataRef = useRef<any>({})
const { currentRef } = props const { currentRef } = props
const [visible, setVisible] = useState<boolean>(false) const [visible, setVisible] = useState<boolean>(false)
const [loading, setLoading] = useState<boolean>(false) const [loading, setLoading] = useState<boolean>(false)
const { productColumns, productComponents, ...sectionProps } = useProductTable(schemaActions) const { productColumns, productComponents, ...sectionProps } = useProductTable(schemaActions, contractOrder)
useEffect(() => { useEffect(() => {
if (currentRef) { if (currentRef) {
......
import React, { useState } from 'react' import React, { useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'; import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell'; import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { productColumns, materialColumns } from '../constant';
// @todo 补充积分类型文案
const productColumns: any = [
{
title: '商品ID',
dataIndex: 'skuId',
align: 'center',
key: 'skuId'
},
{
title: '商品名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: '单价',
dataIndex: 'price',
align: 'center',
key: 'price',
},
// {
// title: '采购数量',
// dataIndex: 'quantity',
// align: 'center',
// key: 'quantity',
// },
// {
// title: '含税',
// dataIndex: 'tax',
// align: 'center',
// key: 'tax',
// render: (text) => text ? '是' : '否'
// },
// {
// title: '金额',
// dataIndex: 'amount',
// align: 'center',
// key: 'amount',
// },
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'leftCount',
align: 'center',
key: 'leftCount',
},
{
title: '已收货',
dataIndex: 'received',
align: 'center',
key: 'received',
},
{
title: '差异数量',
dataIndex: 'differCount',
align: 'center',
key: 'differCount',
},
{
title: '发货数量',
dataIndex: 'deliveryCount',
align: 'left',
key: 'deliveryCount',
formItem: 'input',
editable: true,
width: 140,
},
]
/** /**
* @param ctx schemaAction * @param ctx schemaAction
*/ */
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => { export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, kind: boolean) => {
const productComponents = { const productComponents = {
body: { body: {
...@@ -139,9 +48,27 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -139,9 +48,27 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}; };
}) })
const materialMergeColumns = materialColumns.map(col => {
if (!col.editable) {
return col;
}
return {
...col,
onCell: record => ({
record,
editable: ctx.getFormState().editable === false ? false : col.editable,
dataIndex: col.dataIndex,
title: col.title,
formItem: col.formItem,
formItemProps: col.formItemProps,
handleSave
}),
};
})
return { return {
productColumns: productMergeColumns, productColumns: kind ? materialMergeColumns : productMergeColumns,
productComponents, productComponents,
} }
} }
...@@ -339,9 +339,9 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => { ...@@ -339,9 +339,9 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
}, },
{ {
title: '关联报价商品ID/名称/规格/品类/品牌', title: '关联报价商品ID/名称/规格/品类/品牌',
dataIndex: 'quotedProductId', dataIndex: 'quotedSkuId',
align: 'center', align: 'center',
key: 'quotedProductId', key: 'quotedSkuId',
render: (t, r) => `${t}/${r.quotedName}/${r.quotedCategory}/${r.quotedBrand}` render: (t, r) => `${t}/${r.quotedName}/${r.quotedCategory}/${r.quotedBrand}`
}, },
{ {
......
...@@ -501,9 +501,9 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => { ...@@ -501,9 +501,9 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
}, },
{ {
title: '关联报价商品ID/名称/规格/品类/品牌', title: '关联报价商品ID/名称/规格/品类/品牌',
dataIndex: 'quotedProductId', dataIndex: 'quotedSkuId',
align: 'center', align: 'center',
key: 'quotedProductId', key: 'quotedSkuId',
render: (t, r) => `${t}/${r.quotedName}/${r.quotedCategory}/${r.quotedBrand}` render: (t, r) => `${t}/${r.quotedName}/${r.quotedCategory}/${r.quotedBrand}`
}, },
{ {
......
...@@ -56,7 +56,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => { ...@@ -56,7 +56,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
schemaAction.setFieldValue('contractNo', item.contractNo) schemaAction.setFieldValue('contractNo', item.contractNo)
schemaAction.setFieldValue('contract', item) schemaAction.setFieldValue('contract', item)
const { data } = await fetchOrderApi.getContractPurchaseMaterielList({ const { data } = await fetchOrderApi.getContractPurchaseMaterielList({
contractId: item.id, contractId: item?.id || item?.contractId,
current: 1, current: 1,
pageSize: 999, pageSize: 999,
}) })
...@@ -80,7 +80,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => { ...@@ -80,7 +80,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
temp.relevanceProductCategory = v.associatedCategory; temp.relevanceProductCategory = v.associatedCategory;
temp.relevanceProductBrand = v.associatedBrand; temp.relevanceProductBrand = v.associatedBrand;
temp.price = v.price; temp.price = v.price;
temp.stock = v.bidCount; temp.stock = v.supplierInventory;
temp.tax = v.isHasTax; temp.tax = v.isHasTax;
temp.taxRate = v.taxRate; temp.taxRate = v.taxRate;
// @ 配送方式 默认物流 // @ 配送方式 默认物流
......
...@@ -103,7 +103,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => { ...@@ -103,7 +103,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
temp.relevanceProductCategory = v.associatedCategory; temp.relevanceProductCategory = v.associatedCategory;
temp.relevanceProductBrand = v.associatedBrand; temp.relevanceProductBrand = v.associatedBrand;
temp.price = v.price; temp.price = v.price;
temp.stock = v.bidCount; temp.stock = v.supplierInventory;
temp.tax = v.isHasTax; temp.tax = v.isHasTax;
temp.taxRate = v.taxRate; temp.taxRate = v.taxRate;
// @ 配送方式 默认物流 // @ 配送方式 默认物流
......
...@@ -25,13 +25,42 @@ export const PriceComp = (props) => { ...@@ -25,13 +25,42 @@ export const PriceComp = (props) => {
</div> </div>
} }
/** 修改采购合同下单 回显字段转换 */ /** 修改合同下单 初始值转换 */
export const procurmentRenderInit = (initValue: any) => {
// ...data.consignee,
// ...data.contract,
return {
...initValue.requirement.detail,
vendorMemberId: initValue.vendorMemberId,
vendorMemberName: initValue.vendorMemberName,
vendorRoleId: initValue.vendorRoleId,
product: initValue.product,
deliveryAddresId: initValue.consignee.consigneeId,
hasInvoice: initValue.hasInvoice,
orderId: initValue.orderId,
orderKind: initValue.orderKind,
orderMode: initValue.orderMode,
orderModeName: initValue.orderModeName,
type: initValue.orderTypeName,
digest: initValue.digest,
deliverDate: initValue.consignee.deliverDate,
theInvoiceId: initValue.invoice.invoiceId,
hasContract: initValue.hasContract,
contractNo: initValue.contract.contractNo,
contract: {...initValue.contract},
}
}
/** 修改采购合同下单 回显商品字段转换 */
export const procurementRenderField = (_orderProductRequests) => { export const procurementRenderField = (_orderProductRequests) => {
return _orderProductRequests.map(item => { return _orderProductRequests.map(item => {
return { return {
...item, ...item,
// 此id为sukId // 此id为sukId
relevanceProductId: item.quotedProductId, relevanceProductId: item.quotedSkuId,
// relevanceSkuId: item.quotedSkuId, // relevanceSkuId: item.quotedSkuId,
relevanceProductName: item.quotedName, relevanceProductName: item.quotedName,
relevanceProductBrand: item.quotedBrand, relevanceProductBrand: item.quotedBrand,
...@@ -57,8 +86,8 @@ export const procurementProcessField = (value) => { ...@@ -57,8 +86,8 @@ export const procurementProcessField = (value) => {
quotedSkuId: item.relevanceProductId, quotedSkuId: item.relevanceProductId,
quotedName: item.relevanceProductName, quotedName: item.relevanceProductName,
quotedSpec: item.relevanceProductType, quotedSpec: item.relevanceProductType,
materialCategory: item.relevanceProductCategory, quotedCategory: item.relevanceProductCategory,
materialBrand: item.relevanceProductBrand, quotedBrand: item.relevanceProductBrand,
} }
}) })
return value return value
......
...@@ -9,7 +9,7 @@ import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons' ...@@ -9,7 +9,7 @@ import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm' import NiceForm from '@/components/NiceForm'
import { mergeAllSchemas } from './schema' import { mergeAllSchemas } from './schema'
import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useOrderUpdateChangeOther, useProductTableChangeForPay } from './effects' import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useOrderUpdateChangeOther, useProductTableChangeForPay } from './effects'
import { orderCombination, orderTypeLabelMap, procurementProcessField, procurementRenderField } from './constant' import { orderCombination, orderTypeLabelMap, procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import CirculationRecord from '../components/circulationRecord' import CirculationRecord from '../components/circulationRecord'
import SelectAddress from './components/selectAddress' import SelectAddress from './components/selectAddress'
import TheInvoiceList from './components/theInvoiceList' import TheInvoiceList from './components/theInvoiceList'
...@@ -107,14 +107,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -107,14 +107,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
PublicApi.getOrderBuyerCreateDetail({ orderId: id }).then(res => { PublicApi.getOrderBuyerCreateDetail({ orderId: id }).then(res => {
const { data } = res const { data } = res
const _orderProductRequests = procurementRenderField(data.product.products) const _orderProductRequests = procurementRenderField(data.product.products)
setInitFormValue({ setInitFormValue(() => procurmentRenderInit(data))
...data,
...data.consignee,
...data.contract,
...data.requirement.detail,
})
setTimeout(() => { setTimeout(() => {
addSchemaAction.setFieldValue('products', _orderProductRequests) addSchemaAction.setFieldValue('products', _orderProductRequests)
addSchemaAction.setFieldValue('contract', {...data.contract})
}, 1000) }, 1000)
setFormLoading(false) setFormLoading(false)
}) })
...@@ -161,7 +157,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -161,7 +157,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}) })
console.log(deliveryAddress) console.log(deliveryAddress)
params.products = params.products.map(item => { params.products = params.products.map(item => {
// const address = deliveryAddress.filter(item => item.isDefault)[0]
const address = deliveryAddress[0] const address = deliveryAddress[0]
return { return {
...item, ...item,
...@@ -190,27 +185,29 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -190,27 +185,29 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
} }
// 合同数据字段转换 // 合同数据字段转换
params.contract = { if(pageStatus === PageStatus.ADD) {
contractId: params.contract.id, params.contract = {
contractNo: params.contract.contractNo, contractId: params.contract.id,
digest: params.contract.contractAbstract, contractNo: params.contract.contractNo,
effectDate: params.contract.startTime, digest: params.contract.contractAbstract,
expireDate: params.contract.endTime, effectDate: params.contract.startTime,
partB: params.contract.partyBName, expireDate: params.contract.endTime,
contractType: params.contract.sourceType, partB: params.contract.partyBName,
leftAmount: params.contract.freeAmount, contractType: params.contract.sourceType,
receiptNo: params.contract.sourceNo, leftAmount: params.contract.freeAmount,
receiptNo: params.contract.sourceNo,
}
} }
// 交付地址数据字段转换拼接 查询省市区冗余 // 交付地址数据字段转换拼接 查询省市区冗余
const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({ const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({
id: params.deliveryAddresId.id id: params.deliveryAddresId?.id || params.deliveryAddresId
}) })
const { data: countryCode } = await PublicApi.getManageCountryAreaGetTelCode({}) const { data: countryCode } = await PublicApi.getManageCountryAreaGetTelCode({})
params.consignee = { params.consignee = {
deliverDate: params.deliverDate, deliverDate: params.deliverDate,
consigneeId: params.deliveryAddresId.id, consigneeId: addressDetail.id,
consignee: params.deliveryAddresId.receiverName, consignee: addressDetail.receiverName,
provinceCode: addressDetail.provinceCode, provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode, cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode, districtCode: addressDetail.districtCode,
...@@ -230,11 +227,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -230,11 +227,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
} }
} }
const _params = procurementProcessField(params)
console.log(_params)
if(id) { if(id) {
fnResult = await PublicApi.postOrderBuyerCreateSrmUpdate({...params, id}) fnResult = await PublicApi.postOrderBuyerCreateSrmUpdate({..._params, orderId: id})
} else { } else {
const _params = procurementProcessField(params)
console.log(_params)
fnResult = await PublicApi.postOrderBuyerCreateSrm(_params) fnResult = await PublicApi.postOrderBuyerCreateSrm(_params)
} }
if (fnResult.code === 1000) { if (fnResult.code === 1000) {
......
...@@ -156,26 +156,6 @@ const basicInfo: ISchema = { ...@@ -156,26 +156,6 @@ const basicInfo: ISchema = {
title: '采购合同信息', title: '采购合同信息',
visible: false visible: false
} }
// contractId: {
// type: 'number',
// title: '采购合同ID',
// visible: false
// },
// quotationNo: {
// type: 'string',
// title: '对应单据',
// visible: false
// },
// sourceType: {
// type: 'number',
// title: '合同下单的寻源类型',
// visible: false
// },
// purchaseType: {
// type: 'number',
// title: '合同下单的是否有限制下单金额',
// visible: false
// },
} }
}, },
......
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