Commit e61ef76b authored by xiexiuxing's avatar xiexiuxing

解决请购单的bug

parent b5c56195
......@@ -703,4 +703,10 @@ export default {
'purchaseRequisition.jigoumingcheng': 'organ name',
'purchaseRequisition.caigoushouhuodan': 'Purchase receipt',
'purchaseRequisition.dingdan': 'order',
'purchaseRequisition.wuliaozu':'Material group',
'purchaseRequisition.shengchangchangjia':'Manufacturer',
'purchaseRequisition.changdi':'Place of Origin',
'purchaseRequisition.beizu':'remarks',
'purchaseRequisition.neirongbuneng1weikong':'Content cannot be empty',
}
......@@ -701,4 +701,9 @@ export default {
'purchaseRequisition.jigoumingcheng': '기관 명칭',
'purchaseRequisition.caigoushouhuodan': '구매 인보이스',
'purchaseRequisition.dingdan': '주문',
'purchaseRequisition.wuliaozu':'재료 그룹',
'purchaseRequisition.shengchangchangjia':'생산자',
'purchaseRequisition.changdi':'생산지',
'purchaseRequisition.beizu':'비고',
'purchaseRequisition.neirongbuneng1weikong':'컨텐트는 비워둘 수 없습니다.',
}
......@@ -702,6 +702,10 @@ export default {
'purchaseRequisition.jigoumingcheng': '机构名称',
'purchaseRequisition.caigoushouhuodan': '采购收货单',
'purchaseRequisition.dingdan': '订单',
'purchaseRequisition.wuliaozu':'物料组',
'purchaseRequisition.shengchangchangjia':'生产厂家',
'purchaseRequisition.changdi':'产地',
'purchaseRequisition.beizu':'备注',
'purchaseRequisition.neirongbuneng1weikong':'内容不能为空',
}
......@@ -29,6 +29,11 @@ const BidMaterial: React.FC<BidMaterialProps> = ({ cardTitle }) => {
key: 'name',
},
{
title: intl.formatMessage({ id: 'purchaseRequisition.wuliaozu', defaultMessage: '物料组' }),
dataIndex: 'goodsGroup',
key: 'goodsGroup',
},
{
title: intl.formatMessage({ id: 'purchaseRequisition.guigexinghao', defaultMessage: '规格型号' }),
dataIndex: 'spec',
key: 'spec',
......@@ -60,12 +65,12 @@ const BidMaterial: React.FC<BidMaterialProps> = ({ cardTitle }) => {
key: 'quantity',
},
{
title: "生产厂家",
title: intl.formatMessage({ id: 'purchaseRequisition.shengchangchangjia', defaultMessage: '生产厂家' }),
dataIndex: 'manuFacturer',
key: 'manuFacturer',
},
{
title: "产地",
title: intl.formatMessage({ id: 'purchaseRequisition.changdi', defaultMessage: '产地' }),
dataIndex: 'placeOrigin',
key: 'placeOrigin',
},
......@@ -79,6 +84,11 @@ const BidMaterial: React.FC<BidMaterialProps> = ({ cardTitle }) => {
title: intl.formatMessage({ id: 'purchaseRequisition.yizhuandingdanshu', defaultMessage: '已转订单数量' }),
dataIndex: 'transferQuantity',
key: 'transferQuantity',
},
{
title: intl.formatMessage({ id: 'purchaseRequisition.beizu', defaultMessage: '备注' }),
dataIndex: 'remark',
key: 'remark',
}
];
......
......@@ -84,20 +84,20 @@ export const materialColumns: any[] = [
key: 'unitName'
},
{
title: "生产厂家",
title: getIntl().formatMessage({ id: 'purchaseRequisition.shengchangchangjia', defaultMessage: '生产厂家' }),
dataIndex: 'manufacturer',
align: 'center',
key: 'manufacturer',
},
{
title: "厂地",
dataIndex: 'placeOrigin',
title: getIntl().formatMessage({ id: 'purchaseRequisition.changdi', defaultMessage: '产地' }),
dataIndex: 'origin',
align: 'center',
key: 'placeOrigin',
key: 'origin',
},
{
title: "备注",
title: getIntl().formatMessage({ id: 'purchaseRequisition.beizu', defaultMessage: '备注' }),
dataIndex: 'remake',
align: 'center',
key: 'remake'
......@@ -140,6 +140,7 @@ const MaterialModalTable: React.FC<MaterialModalTableProps> = (props) => {
temp.unit = v?.unitName || v?.unit || null;
temp.manuFacturer = v?.manufacturer
temp.placeOrigin = v?.origin
temp.goodsGroup = v?.materialGroup?.name;
return temp
})
let originIds = tempOriginData.map(item => item.id)
......
......@@ -19,7 +19,7 @@ export interface MaterialTableCellProps {
const EditableContext = React.createContext<any>({});
export const MaterialEditableRow: React.FC<any> = ({...props }) => {
export const MaterialEditableRow: React.FC<any> = ({ ...props }) => {
const [form] = Form.useForm();
const ctx = {
......@@ -35,7 +35,7 @@ export const MaterialEditableRow: React.FC<any> = ({...props }) => {
};
export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
title,
editable,
children,
......@@ -44,7 +44,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
handleSave,
forceEdit,
formItem,
formItemProps={},
formItemProps = {},
...restProps
}) => {
const formItemRef = useRef<any>();
......@@ -57,7 +57,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
const [receiveInfo, setReceiveInfo] = useState<any>()
const getReceiveInfo = async () => {
const { data: deliveryAddress} = await getLogisticsSelectListMemberShipperAddress({
const { data: deliveryAddress } = await getLogisticsSelectListMemberShipperAddress({
memberId: record.memberId,
roleId: record.memberRoleId
})
......@@ -80,7 +80,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
const change = async (va, op, idx) => {
console.log(va, op, idx)
// 自提情况下 显示地址
if(va === 2) {
if (va === 2) {
setShowAddress(true)
getReceiveInfo()
} else {
......@@ -97,11 +97,11 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
}
const chooseFormItem = (type, v) => {
switch(type) {
switch (type) {
// input类型
case 'input': {
return <Input
style={{width: 80}}
style={{ width: 80 }}
type='number'
ref={formItemRef}
onChange={save}
......@@ -110,10 +110,20 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
className="purchase_amount_input"
/>
}
// select选择类型
case 'select': {
case 'inputText': {
return <Input
style={{ width: 80 }}
ref={formItemRef}
onChange={save}
{...formItemProps}
id={dataIndex + record.id}
className="purchase_amount_input"
/>
}
// select选择类型
case 'select': {
return <Select
style={{width: 80}}
style={{ width: 80 }}
ref={formItemRef}
onChange={(value, option) => change(value, option, dataIndex)}
id={dataIndex + record.id}
......@@ -129,7 +139,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
const validatorNumber = (rule, value, callback) => {
try {
let _value = Number(value)
if(_value > Number.MAX_SAFE_INTEGER) {
if (_value > Number.MAX_SAFE_INTEGER) {
throw new Error(intl.formatMessage({ id: 'purchaseRequisition.shuzhijingduyi', defaultMessage: '数值精度溢出' }))
}
callback()
......@@ -157,25 +167,32 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
{
validator: validatorNumber
},
] : [
{
pattern: /^\d+(\.\d{1,4})?$/,
message: intl.formatMessage({ id: 'purchaseRequisition.danjiajinxiansi', defaultMessage: '单价仅限四位小数' }),
},
{
validator: validatorNumber
}
]}
] : dataIndex === 'remark' ?
[
{
required: true,
message: intl.formatMessage({ id: 'purchaseRequisition.neirongbuneng1weikong', defaultMessage: '内容不能为空' }),
},
]
: [
{
pattern: /^\d+(\.\d{1,4})?$/,
message: intl.formatMessage({ id: 'purchaseRequisition.danjiajinxiansi', defaultMessage: '单价仅限四位小数' }),
},
{
validator: validatorNumber
}
]}
>
{chooseFormItem(formItem, record[dataIndex] || '')}
</Form.Item>
{
showAddress
?
<Popover content={
?
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> {intl.formatMessage({ id: 'purchaseRequisition.zitidizhi', defaultMessage: '自提地址' })}</h3>
<h3><EnvironmentOutlined /> {intl.formatMessage({ id: 'purchaseRequisition.zitidizhi', defaultMessage: '自提地址' })}</h3>
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
......@@ -185,10 +202,10 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
</div>
</Row>
}>
<span style={{position: 'absolute', right: 0, top: '42%', }}><EnvironmentOutlined/></span>
</Popover>
:
null
<span style={{ position: 'absolute', right: 0, top: '42%', }}><EnvironmentOutlined /></span>
</Popover>
:
null
}
</>
}
......
......@@ -132,6 +132,12 @@ export const materialInfoColumns: any[] = [
key: 'name',
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.wuliaozu', defaultMessage: '物料组' }),
dataIndex: 'goodsGroup',
align: 'center',
key: 'goodsGroup',
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.guigexinghao', defaultMessage: '规格型号' }),
dataIndex: 'type',
align: 'center',
......@@ -173,7 +179,7 @@ export const materialInfoColumns: any[] = [
editable: true,
},
{
title: "生产厂家",
title: getIntl().formatMessage({ id: 'purchaseRequisition.shengchangchangjia', defaultMessage: '生产厂家' }),
dataIndex: 'manuFacturer',
align: 'center',
key: 'manuFacturer',
......@@ -185,17 +191,17 @@ export const materialInfoColumns: any[] = [
},
{
title: "厂地",
title: getIntl().formatMessage({ id: 'purchaseRequisition.changdi', defaultMessage: '产地' }),
dataIndex: 'placeOrigin',
align: 'center',
key: 'placeOrigin',
},
{
title: "备注",
title: getIntl().formatMessage({ id: 'purchaseRequisition.beizu', defaultMessage: '备注' }),
dataIndex: 'remark',
align: 'center',
key: 'remark',
formItem: 'input',
formItem: 'inputText',
editable: true,
},
{
......
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