Commit 15cdf00d authored by 前端-彭佳文's avatar 前端-彭佳文

Merge branch 'fix418' into 'v2-220418'

待审核请购单 一级二级,待提交请购单页面显示问题 See merge request linkseeks-design/pro-platform!496
parents 286286fd 21561974
......@@ -604,7 +604,7 @@ export default {
'purchaseRequisition.qingshuruquxiao': 'Please enter the reason for cancellation',
'purchaseRequisition.zhongzhiyuanyin': 'Reason for suspension',
'purchaseRequisition.shenhe': 'Review',
'purchaseRequisition.tijiaoshenhe': 'Submit',
'purchaseRequisition.tijiaoshenhe': 'Documents review',
'purchaseRequisition.xinjian': 'New',
'purchaseRequisition.shifouzhixingshan': 'Do you want to delete it? ',
'purchaseRequisition.xiugai': 'Modify',
......
......@@ -602,7 +602,7 @@ export default {
'purchaseRequisition.qingshuruquxiao': '취소 이유를 입력하십시오.',
'purchaseRequisition.zhongzhiyuanyin': '중단 원인',
'purchaseRequisition.shenhe': '심사',
'purchaseRequisition.tijiaoshenhe': '제출',
'purchaseRequisition.tijiaoshenhe': '증빙서류 심사',
'purchaseRequisition.xinjian': '새로 만들다',
'purchaseRequisition.shifouzhixingshan': '삭제 작업을 수행하시겠습니까?',
'purchaseRequisition.xiugai': '수정',
......
......@@ -601,8 +601,8 @@ export default {
'purchaseRequisition.zaicishuruni': '在此输入你的原因, 最多50个汉字',
'purchaseRequisition.qingshuruquxiao': '请输入取消原因',
'purchaseRequisition.zhongzhiyuanyin': '中止原因',
'purchaseRequisition.shenhe': '审核',
'purchaseRequisition.tijiaoshenhe': '提交',
'purchaseRequisition.shenhe': '提交',
'purchaseRequisition.tijiaoshenhe': '单据审核',
'purchaseRequisition.xinjian': '新建',
'purchaseRequisition.shifouzhixingshan': '是否执行删除操作?',
'purchaseRequisition.xiugai': '修改',
......
......@@ -80,7 +80,7 @@ const BillDetailHeader: React.FC<BillDetailHeaderProps> = ({
<ArrowLeftOutlined onClick={() => backLink ? history.push(backLink) : history.goBack()} />
</Col>
<Col>
<div className={style.titleAvatorText}>{formContext.data.requisitionNo}</div>
<div className={style.titleAvatorText}>{`${formContext.data.digest}|${formContext.data.requisitionNo}`}</div>
</Col>
</Row>
<Row>
......
......@@ -97,7 +97,6 @@ const BidMaterial: React.FC<BidMaterialProps> = ({ cardTitle }) => {
];
const renderDescription = async (record) => {
console.log(record, 'dd')
const newData = [...tableData];
const index = newData.findIndex(item => record.id === item.id);
const item = newData[index];
......
......@@ -49,7 +49,7 @@ const FirstOrderPreview: React.FC = () => {
extraRight={
<AuthButton btnCode='firstApprovedBill.xiangqingshenhe'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '单据审核' })}
</Button>
</AuthButton>
}
......
......@@ -17,6 +17,7 @@ import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from '../
import { useIntl, getIntl } from 'umi'
import { fetchTreeData, useAsyncCascader } from './useGetTableSearchData'
import { getProductGoodsGetGoodsByMemberList } from '@/services/ProductV2Api'
import DrawerTable from '@/components/DrawerTable'
export interface MaterialModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -166,9 +167,6 @@ const MaterialModalTable: React.FC<MaterialModalTableProps> = (props) => {
clearModalParams()
}
const otherHandle = <>
<a className="ant-btn" href="/memberCenter/commodityAbility/material/pendingAdd/add" target="_blank" style={{ marginRight: 16 }}>{intl.formatMessage({ id: 'purchaseRequisition.xinzenghuopin', defaultMessage: '新增货品' })}</a>
<Tooltip title={intl.formatMessage({ id: 'purchaseRequisition.dianjichaxun', defaultMessage: '点击查询,列表可显示新增的物料' })}>
......@@ -186,61 +184,60 @@ const MaterialModalTable: React.FC<MaterialModalTableProps> = (props) => {
}
return (
<ModalTable
modalTitle={intl.formatMessage({ id: 'purchaseRequisition.xuanzewuliao', defaultMessage: '选择物料' })}
width={1200}
columns={materialColumns}
visible={visible}
// 抽屉
<DrawerTable
drawerTitle={intl.formatMessage({ id: 'table.purchase.xuanzezhuanjia' })}
confirm={handleConfirm}
actions={addSchemaAction}
cancel={handleCancel}
fetchTableData={getPurchaseRequesitionMaterielList}
visible={visible}
columns={materialColumns}
rowSelection={rowSelection}
resetModal={{ destroyOnClose: true }}
modalType='none'
tableProps={{
rowKey: 'id',
onRow: (record) => ({
onClick: () => {
rowSelectionCtl.appendSelectRow(record);
rowSelectionCtl.appendSelectRowKeys(record.id);
},
})
fetchTableData={getPurchaseRequesitionMaterielList}
formilyLayouts={{
justify: 'space-between'
}}
formilyProps={{
ctx: {
schema: addRequesitionMaterialSchema,
components: {
ModalSearch: Search,
Submit,
Children,
CustomInputSearch,
CustomCategorySearch,
Cascader,
Checkbox,
},
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'code',
FORM_FILTER_PATH,
);
useAsyncCascader('materialGroupId', fetchTreeData)
FormEffectHooks.onFieldChange$('brandId').subscribe(() => {
searchBrandOptionEffect(actions, 'brandId')
})
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(() => {
searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
})
formilyChilds={{
children: otherHandle,
layouts: {
order: 1,
span: 4
}
}}
formilyProps={
{
ctx: {
schema: addRequesitionMaterialSchema,
components: {
Submit,
CustomInputSearch,
CustomCategorySearch,
Cascader,
Checkbox,
},
effects: ($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect(
$,
actions,
'code',
FORM_FILTER_PATH,
);
}
},
expressionScope: {
otherHandle
layouts: {
order: 2,
span: 20
}
}
}
resetDrawer={{
destroyOnClose: true
}}
tableProps={{
rowKey: 'id',
}}
{...restProps}
/>
)
}
......
......@@ -137,30 +137,30 @@ export const materialInfoColumns: any[] = [
align: 'center',
key: 'goodsGroup',
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.guigexinghao', defaultMessage: '规格型号' }),
dataIndex: 'type',
align: 'center',
key: 'type',
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.pinlei', defaultMessage: '品类' }),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.pinpai', defaultMessage: '品牌' }),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.danwei', defaultMessage: '单位' }),
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
// {
// title: getIntl().formatMessage({ id: 'purchaseRequisition.guigexinghao', defaultMessage: '规格型号' }),
// dataIndex: 'type',
// align: 'center',
// key: 'type',
// },
// {
// title: getIntl().formatMessage({ id: 'purchaseRequisition.pinlei', defaultMessage: '品类' }),
// dataIndex: 'category',
// align: 'center',
// key: 'category',
// },
// {
// title: getIntl().formatMessage({ id: 'purchaseRequisition.pinpai', defaultMessage: '品牌' }),
// dataIndex: 'brand',
// align: 'center',
// key: 'brand',
// },
// {
// title: getIntl().formatMessage({ id: 'purchaseRequisition.danwei', defaultMessage: '单位' }),
// dataIndex: 'unit',
// align: 'center',
// key: 'unit',
// },
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.yugudanjia', defaultMessage: '预估单价(元)' }),
dataIndex: 'price',
......@@ -178,24 +178,24 @@ export const materialInfoColumns: any[] = [
formItem: 'input',
editable: true,
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.shengchangchangjia', defaultMessage: '生产厂家' }),
dataIndex: 'manuFacturer',
align: 'center',
key: 'manuFacturer',
render: (text, record) => {
return (
<span>{record.manuFacturer}</span>
)
}
// {
// title: getIntl().formatMessage({ id: 'purchaseRequisition.shengchangchangjia', defaultMessage: '生产厂家' }),
// dataIndex: 'manuFacturer',
// align: 'center',
// key: 'manuFacturer',
// render: (text, record) => {
// return (
// <span>{record.manuFacturer}</span>
// )
// }
},
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.changdi', defaultMessage: '产地' }),
dataIndex: 'placeOrigin',
align: 'center',
key: 'placeOrigin',
},
// },
// {
// title: getIntl().formatMessage({ id: 'purchaseRequisition.changdi', defaultMessage: '产地' }),
// dataIndex: 'placeOrigin',
// align: 'center',
// key: 'placeOrigin',
// },
{
title: getIntl().formatMessage({ id: 'purchaseRequisition.beizu', defaultMessage: '备注' }),
dataIndex: 'remark',
......@@ -220,7 +220,6 @@ export const materialInfoColumns: any[] = [
]
export const RequisitiColumns: any[] = [
{
title: "姓名",
......
......@@ -15,8 +15,47 @@
.Select{
background: rgba(0,169,143,0.04);
border: 1px solid #00A98F;
}
}
}
.childrenWrap {
background-color: #fff;
.childrenTitle {
height: 100%;
background: linear-gradient(to left, #FFFFFF, #DAF2E7);
color: #00B37A;
p {
padding-left: 16px;
margin: 0;
font-size: 12px;
height: 14px;
line-height: 14px;
}
padding: 12px 0;
}
.childrenContent {
margin-top: 8px;
p {
margin: 0;
span {
height: 12px;
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 12px;
padding-right: 10px;
}
}
}
}
.restContainer {
margin-top: 24px;
:global {
.ant-table-expanded-row td {
padding: 0;
}
}
}
import React, { useRef, useState, useEffect } from 'react'
import { history, useIntl } from 'umi'
import { usePageStatus } from '@/hooks/usePageStatus'
import { Button, Col, message, Radio, Row, Select, Upload } from 'antd'
import { Button, Card, Col, message, Radio, Row, Select, Upload } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd'
import { SaveOutlined, LinkOutlined, UploadOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
......@@ -47,8 +47,9 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
const intl = useIntl()
const { form } = useFormSpy({ selector: [['onFieldValueChange', 'products']], reducer: v => v })
const data = form.getFieldValue('products')
const sum = data.reduce((prev, next) => (prev * 1000 + (next.amount || 0) * 1000) / 1000, 0)
const total = data.reduce((prev, next) => (prev * 1000 + (next.quantity || 0) * 1000) / 1000, 0)
console.log(data, 'data')
const sum = data ? data.reduce((prev, next) => (prev * 1000 + (next.amount || 0) * 1000) / 1000, 0) : 0
const total = data ? data.reduce((prev, next) => (prev * 1000 + (next.quantity || 0) * 1000) / 1000, 0) : 0
return <RowStyle>
<Col span={2}>
......@@ -80,7 +81,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
const intl = useIntl()
// 请购单物料
const { materialAddButton, materialRef, materialColumns, materialComponents, ...surplusProps } = useMaterialTable(addSchemaAction)
const { materialAddButton, materialRef, materialColumns, materialComponents, materialChildren, ...surplusProps } = useMaterialTable(addSchemaAction)
useEffect(() => {
if (id) {
......@@ -433,12 +434,12 @@ const IncreaseRequisition: React.FC<{}> = () => {
<AuthButton btnCode={id ? 'increaseRequisition.bianji' : 'increaseRequisition.xingzheng'}>
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
{intl.formatMessage({ id: 'purchaseRequisition.baocun', defaultMessage: '保存' })}
</Button>,
</Button>
</AuthButton>
]}
/>
<FormDetailWrapper>
<Card className={styles.restContainer}>
<NiceForm
loading={formLoading}
previewPlaceholder=' '
......@@ -477,6 +478,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
materialAddButton,
RequisitionerBtn,
materialComponents,
materialChildren,
help,
enclosureColumns,
enclosureColumnsButton,
......@@ -484,7 +486,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
}}
/>
</Card>
</FormDetailWrapper>
</FormDetailContext.Provider>
......
import { useRef, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { Button } from 'antd';
import { Button, Row, Col, Spin } from 'antd';
import { getIntl, useIntl } from 'umi';
import { materialInfoColumns } from '../constant';
import MaterialTableCell, { MaterialEditableRow } from '../components/materialTableCell';
import { useModalTable } from './useModalTable';
import { useIntl } from 'umi';
import style from '../index.less'
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
const intl = getIntl();
export const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['quantity']) || 0
......@@ -47,7 +50,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
}
}
const materialAddButton = <Button onClick={handleShowMaterial} block type='default' style={{ margin: '24px auto' }}>{intl.formatMessage({ id: 'purchaseRequisition.xuanzecaigouwu', defaultMessage: '选择采购物料' })}</Button>
const materialAddButton = <Button onClick={handleShowMaterial} block type='default' style={{ margin: '24px auto' }}>{intl.formatMessage({ id: 'common.button.select', defaultMessage: '选择' })}</Button>
const materialComponents = {
body: {
row: MaterialEditableRow,
......@@ -89,11 +92,66 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
};
})
const renderDescription = (record) => {
const newData = [...ctx.getFieldValue('products')];
const index = newData.findIndex(item => record.id === item.id);
const item = newData[index];
newData[index] = item
item.description = (<div className={style.childrenWrap}>
<Row>
<Col span={3}>
<div className={style.childrenTitle}>
<p>{intl.formatMessage({ id: 'purchaseRequisition.wuliao' })}</p>
<p>{intl.formatMessage({ id: 'purchaseRequisition.xinxi' })}</p>
</div>
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>{intl.formatMessage({ id: 'purchaseRequisition.guigexinghao', defaultMessage: '规格型号' })}:</span>{record.spec}</p>
<p><span>{intl.formatMessage({ id: 'purchaseRequisition.pinlei', defaultMessage: '品类' })}:</span>{record.category}</p>
</div>
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>{intl.formatMessage({ id: 'purchaseRequisition.pinpai', defaultMessage: '品牌' })}:</span>{record.brand}</p>
<p><span>{intl.formatMessage({ id: 'purchaseRequisition.danwei', defaultMessage: '单位' })}:</span>{record.unit}</p>
</div>
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>{intl.formatMessage({ id: 'purchaseRequisition.shengchangchangjia', defaultMessage: '生产厂家' })}:</span>{record.manuFacturer}</p>
<p><span>{intl.formatMessage({ id: 'purchaseRequisition.changdi', defaultMessage: '产地' })}:</span>{record.placeOrigin}</p>
</div>
</Col>
</Row>
</div>)
ctx.setFieldValue('products', [...newData])
}
// 嵌套子表格
const materialChildren = {
expandedRowRender: record => <p style={{ margin: 0 }}>{ record?.id ? (record.description || <Spin size="small" style={{margin: '15px auto', width: '100%'}} />) : null}</p>,
rowExpandable: record => record.name !== 'Not Expandable',
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
onExpand: (expanded, record) => {
if(expanded) {
renderDescription(record)
}
}
}
return {
materialRef,
materialAddButton,
materialColumns: materialMergeColumns,
materialComponents,
materialChildren,
visible,
setVisible,
rowSelection,
......
......@@ -243,7 +243,7 @@ const material: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: getIntl().formatMessage({ id: 'purchaseRequisition.dingdanwuliao', defaultMessage: '订单物料' }),
title: getIntl().formatMessage({ id: 'purchaseRequisition.qinggouwuliao', defaultMessage: '请购物料' }),
id: 'orderMaterial',
},
properties: {
......@@ -252,10 +252,11 @@ const material: ISchema = {
"x-component": 'MultTable',
required: true,
"x-component-props": {
rowKey: 'index',
rowKey: 'id',
columns: "{{materialColumns}}",
components: "{{materialComponents}}",
prefix: "{{materialAddButton}}",
expandable: "{{materialChildren}}",
},
},
NO_SUBMIT_SPY: {
......
......@@ -8,12 +8,54 @@ import { getIntl } from 'umi';
export const addRequesitionMaterialSchema: ISchema = {
type: 'object',
properties: {
code: {
type: 'string',
'x-component': 'ModalSearch',
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
placeholder: getIntl().formatMessage({ id: 'purchaseRequisition.qingshuruhuohao', defaultMessage: '请输入物料编号' }),
align: 'flex-start',
full: true,
autoRow: true,
justifyContent: 'flex-end',
align: 'flex-right',
className: 'sc-fzpans',
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{otherHandle}}',
},
},
ctlRight: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
// flexWrap: 'wrap',
// width: '100%',
justifyContent: 'flex-end',
// style: {
// marginRight: 0,
// }
},
// colStyle: {
// marginTop: 20,
// },
},
properties: {
watch: {
"x-component": 'Checkbox',
title:'只查看供应商可供应物料',
},
code: {
type: 'string',
'x-component': 'SearchFilter',
'x-component-props': {
placeholder: getIntl().formatMessage({ id: 'purchaseRequisition.qingshuruhuohao', defaultMessage: '请输入物料编号' }),
},
},
}
},
},
},
[FORM_FILTER_PATH]: {
......@@ -21,8 +63,9 @@ import { getIntl } from 'umi';
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
// flexWrap: 'nowrap',
justifyContent: 'flex-start',
flexWrap: 'wrap',
width: '100%',
justifyContent: 'flex-end',
style: {
marginRight: 0,
}
......@@ -36,7 +79,7 @@ import { getIntl } from 'umi';
type: 'string',
'x-component-props': {
placeholder: getIntl().formatMessage({ id: 'purchaseRequisition.materialName', defaultMessage: '物料名称' }),
style: { width: '174px' },
// style: { width: '174px' },
},
},
brandId: {
......@@ -49,7 +92,7 @@ import { getIntl } from 'umi';
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px' },
// style: { width: '145px' },
searchValue: null,
dataoption: [],
},
......@@ -61,7 +104,7 @@ import { getIntl } from 'umi';
placeholder: getIntl().formatMessage({ id: 'purchaseRequisition.shangpinpinlei', defaultMessage: '商品品类' }),
showSearch: true,
notFoundContent: null,
style: { width: '174px' },
// style: { width: '145px' },
dataoption: [],
fieldNames: { label: 'title', value: 'id', children: 'children' },
},
......@@ -71,23 +114,19 @@ import { getIntl } from 'umi';
'x-component': 'Cascader',
'x-component-props': {
placeholder: '物料组',
allowClear: true,
allowClear: true,
fieldNames: { label: 'title', value: 'id', children: 'children' },
style: { width: '150px' },
// style: { width: '145px' },
showSearch: true
},
},
},
type: {
type: 'string',
"x-component-props": {
placeholder: getIntl().formatMessage({ id: 'purchaseRequisition.guigexinghao', defaultMessage: '规格型号' }),
style: { width: '174px' },
// style: { width: '174px' },
}
},
watch: {
"x-component": 'Checkbox',
title:'只查看供应商可供应物料',
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
......@@ -97,12 +136,6 @@ import { getIntl } from 'umi';
children: getIntl().formatMessage({ id: 'purchaseRequisition.chaxun', defaultMessage: '查询' })
}
},
submit1: {
"x-component": 'Children',
"x-component-props": {
children: '{{otherHandle}}'
}
}
}
}
}
......
......@@ -36,7 +36,7 @@ const ReadySubmitBillDetail: React.FC = () => {
extraRight={
<AuthButton btnCode='readySubmitBill.xiangqingsheng'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
{intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })}
</Button>
</AuthButton>
}
......
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