Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
c2e9d6f4
Commit
c2e9d6f4
authored
May 10, 2022
by
前端-彭佳文
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2-220518' into 'v2-220518'
V2 220518 See merge request linkseeks-design/pro-platform!662
parents
3518b8d4
0a663306
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
60 deletions
+52
-60
MiniUnit.tsx
src/components/NiceForm/components/MiniUnit.tsx
+4
-1
material.ts
src/locales/zh-CN/material.ts
+17
-1
useGetDetailCommon.tsx
src/pages/commodity/material/common/useGetDetailCommon.tsx
+4
-19
add.tsx
src/pages/commodity/material/materialPendingAdd/add.tsx
+10
-23
add.tsx
...ages/commodity/material/materialPendingAdd/schema/add.tsx
+17
-16
No files found.
src/components/NiceForm/components/MiniUnit.tsx
View file @
c2e9d6f4
...
...
@@ -70,7 +70,10 @@ const MinUnit = (props) => {
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
'100%'
}
}
addonAfter=
{
addonAfter
}
disabled=
{
!
props
.
editable
}
/>
</
Form
.
Item
>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
name
)
}
disabled=
{
!
props
.
editable
}
/>
{
props
.
editable
&&
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
name
)
}
disabled=
{
!
props
.
editable
}
/>
}
</
div
>
))
}
<
Form
.
Item
>
...
...
src/locales/zh-CN/material.ts
View file @
c2e9d6f4
...
...
@@ -124,5 +124,20 @@ export default {
'material.costPrice.pattern'
:
'请填写数字且最多保留四位小数'
,
'material.add.supplier.material'
:
'添加供应商物料'
,
'member.modal.selectMaterial.title'
:
'选择会员'
'member.modal.selectMaterial.title'
:
'选择会员'
,
'material.output.title'
:
'产地与配送'
,
'material.materialsManufacturer'
:
'生产厂家'
,
'material.materialsOrigin'
:
'厂地'
,
'material.materialsDeparture'
:
'起运地'
,
'material.materialsDeliverPeriod'
:
'到货周期'
,
'material.materialsDeliveryMethod'
:
'交货方式'
,
'material.unitConversion.title'
:
'单位换算'
,
'material.sourceList.column'
:
'最小单位'
,
'material.contact.title'
:
'联系信息'
,
'material.chargeName'
:
'负责人'
,
'material.chargeUserId'
:
'负责人用户id'
,
'material.chargeAccount'
:
'负责人账号'
,
'material.chargeRoleName'
:
'负责人所属角色'
,
'material.contactMemberName'
:
'联系人'
,
'material.contactMemberPhone'
:
'联系人电话'
,
}
\ No newline at end of file
src/pages/commodity/material/common/useGetDetailCommon.tsx
View file @
c2e9d6f4
...
...
@@ -141,29 +141,12 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
},
[
initialValue
])
/*动态单位换算*/
const
unitInfoList
=
useMemo
(()
=>
{
// return [
// {
// title: intl.formatMessage({ id: 'material.unitName', defaultMessage: '最小单位' }),
// value: initialValue?.unitName
// },
// {
// title: intl.formatMessage({ id: 'material.unitName', defaultMessage: '包' }),
// value: initialValue?.unitName
// },
// {
// title: intl.formatMessage({ id: 'material.unitName', defaultMessage: '连' }),
// value: initialValue?.unitName
// },
// {
// title: intl.formatMessage({ id: 'material.unitName', defaultMessage: '箱' }),
// value: initialValue?.unitName
// },
// ]
if
(
!
initialValue
?.
unitConversions
)
{
return
[];
}
const
unitname
=
initialValue
?.
unitConversions
[
0
]?.
unitName
const
newValue
=
{
title
:
'最小单位'
,
value
:
unitname
}
if
(
initialValue
?.
unitConversions
[
0
]?.
subUnitConversionList
){
const
result
=
initialValue
?.
unitConversions
[
0
]?.
subUnitConversionList
.
map
((
_item
)
=>
{
return
{
title
:
_item
.
unitName
,
...
...
@@ -171,6 +154,8 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
}
})
return
[
newValue
,...
result
]
}
else
return
newValue
},
[
initialValue
?.
unitConversions
])
/*联系信息*/
const
contactInfoList
=
useMemo
(()
=>
{
...
...
@@ -189,7 +174,7 @@ function useGetDetailCommon<T extends GetProductGoodsGetGoodsProcessDetailRespon
},
]
},
[
initialValue
?.
unitConversions
])
},
[
initialValue
])
/** 动态物料属性 */
const
properties
=
useMemo
(()
=>
{
...
...
src/pages/commodity/material/materialPendingAdd/add.tsx
View file @
c2e9d6f4
...
...
@@ -183,7 +183,6 @@ const MaterialAdd = (props) => {
.filter((_item) => /customerAttribute-\d+/.test(_item));
const formatBrand = brand ? { brand: { id: brand } } : {}
/** 如果带货源清单 */
const withSourceList = query?.type === 'sourceData'
? {
...
...
@@ -276,7 +275,7 @@ const MaterialAdd = (props) => {
...withSourceList,
...withMaterialGroup,
...withChangeData,
unitConversions: unitConversions ? [unitConversions] : []
unitConversions: unitConversions
?.subUnitConversionList
? [unitConversions] : []
}
console.log("postData", postData)
...
...
@@ -322,7 +321,7 @@ const MaterialAdd = (props) => {
},
{
key: 'contactInfo',
name: intl.formatMessage({ id: 'material.contact
Info.title', defaultMessage: '联系人与负责人
' })
name: intl.formatMessage({ id: 'material.contact
.title', defaultMessage: '联系信息
' })
},
{
key: 'images',
...
...
@@ -367,7 +366,8 @@ const MaterialAdd = (props) => {
schema={schema}
actions={formActions}
onSubmit={handleSubmit}
value={formatInitialValue}
// value={formatInitialValue}
initialValues={formatInitialValue}
components={{
Cascader,
FormilyUploadFiles,
...
...
@@ -388,44 +388,31 @@ const MaterialAdd = (props) => {
useAsyncCascader('materialGroup', fetchTreeData);
useAsyncSelect('unitId', fetchUnit, ["name", "id"])
useAsyncSelect('unitConversions', fetchUnit, ["name", "id"])
useAsyncSelect('charge
Name
', fetchUserPage, ["name", "userId"])
useAsyncSelect('charge
UserId
', fetchUserPage, ["name", "userId"])
$('onFormMount').subscribe(() => {
if (isEdit) {
formActions.setFieldState('code', (state) => {
FormPath.setIn(state, 'editable', false);
})
}
})
$('onFieldMount', 'unitConversions').subscribe((fieldState) => {
console.log(fieldState.values,'0000000')
formActions.setFieldState('unitConversions', (state) => {
FormPath.setIn(state, 'value', fieldState.values);
})
})
$('onFieldValueChange', 'chargeName').subscribe((fieldState) => {
if (isAdd||isEdit) {
$('onFieldInputChange', 'chargeUserId').subscribe((fieldState) => {
formActions.setFieldState('contactMemberName', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.name);
})
formActions.setFieldState('chargeName', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.name);
})
formActions.setFieldState('contactMemberPhone', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.phone);
})
formActions.setFieldState('chargeUserId', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.userId);
})
formActions.setFieldState('chargeAccount', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.account);
})
formActions.setFieldState('chargeRoleName', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.roleName);
})
formActions.setFieldState('chargeName', (state) => {
FormPath.setIn(state, 'value', fieldState.values[1]?.name);
})
}
})
$('onFieldValueChange', 'category').subscribe((fieldState) => {
if (!fieldState.value || fieldState.value.length === 0) {
setSchema(
...
...
@@ -440,7 +427,7 @@ const MaterialAdd = (props) => {
getProductCustomerGetCustomerCategoryById({ id: categoryId })
.then((data) => {
const { customerAttributeList } = data.data;
if (customerAttributeList.length === 0) {
if (customerAttributeList
?
.length === 0) {
setSchema(
getSchema(null)
)
...
...
src/pages/commodity/material/materialPendingAdd/schema/add.tsx
View file @
c2e9d6f4
...
...
@@ -188,7 +188,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
},
properties
:
{
materialsManufacturer
:
{
title
:
intl
.
formatMessage
({
id
:
'material.materialsManufacturer
;
'
,
defaultMessage
:
'生产厂家'
}),
title
:
intl
.
formatMessage
({
id
:
'material.materialsManufacturer'
,
defaultMessage
:
'生产厂家'
}),
type
:
'string'
,
'x-rules'
:
[
{
...
...
@@ -248,7 +248,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
"x-component"
:
'MellowCard'
,
"x-component-props"
:
{
id
:
'unitConversion'
,
title
:
intl
.
formatMessage
({
id
:
'material.unitConversion.
123456789
'
,
defaultMessage
:
'单位换算'
})
title
:
intl
.
formatMessage
({
id
:
'material.unitConversion.
title
'
,
defaultMessage
:
'单位换算'
})
},
properties
:
{
layout
:
{
...
...
@@ -270,7 +270,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
properties
:
{
unitConversions
:
{
// type: 'object',
title
:
intl
.
formatMessage
({
id
:
'material.sourceList.column
.123456789
'
,
defaultMessage
:
'最小单位'
}),
title
:
intl
.
formatMessage
({
id
:
'material.sourceList.column'
,
defaultMessage
:
'最小单位'
}),
"x-component"
:
'MiniUnit'
,
// default: { minUnit: 1, unitGroup: [{ amount: 20, unitId: 1 }] }
},
...
...
@@ -284,7 +284,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
"x-component"
:
'MellowCard'
,
"x-component-props"
:
{
id
:
'test123456789'
,
title
:
intl
.
formatMessage
({
id
:
'material.
props.123456789
'
,
defaultMessage
:
'联系信息'
})
title
:
intl
.
formatMessage
({
id
:
'material.
contact.title
'
,
defaultMessage
:
'联系信息'
})
},
properties
:
{
layout
:
{
...
...
@@ -304,27 +304,28 @@ export const getSchema = (schema: ISchema | null): ISchema => {
}
},
properties
:
{
charge
Name
:
{
title
:
intl
.
formatMessage
({
id
:
'material.
sourceList.column.123456789
'
,
defaultMessage
:
'负责人'
}),
type
:
"string"
,
charge
UserId
:
{
title
:
intl
.
formatMessage
({
id
:
'material.
chargeName
'
,
defaultMessage
:
'负责人'
}),
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
showSearch
:
true
,
},
chargeUserId
:
{
title
:
intl
.
formatMessage
({
id
:
'material.sourceList.column.chargeUserId'
,
defaultMessage
:
'负责人用户id'
}),
description
:
`{{desc()}}`
},
chargeName
:
{
title
:
intl
.
formatMessage
({
id
:
'material.chargeUserId'
,
defaultMessage
:
'负责人用户id'
}),
type
:
"string"
,
enum
:
[],
display
:
false
,
},
chargeAccount
:
{
title
:
intl
.
formatMessage
({
id
:
'material.
sourceList.column.
chargeAccount'
,
defaultMessage
:
'负责人账号'
}),
title
:
intl
.
formatMessage
({
id
:
'material.chargeAccount'
,
defaultMessage
:
'负责人账号'
}),
type
:
"string"
,
enum
:
[],
display
:
false
,
},
chargeRoleName
:
{
title
:
intl
.
formatMessage
({
id
:
'material.
sourceList.column.
chargeRoleName'
,
defaultMessage
:
'负责人所属角色'
}),
title
:
intl
.
formatMessage
({
id
:
'material.chargeRoleName'
,
defaultMessage
:
'负责人所属角色'
}),
type
:
"string"
,
enum
:
[],
display
:
false
,
},
// 占位
...
...
@@ -333,7 +334,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
type
:
"object"
,
},
contactMemberName
:
{
title
:
intl
.
formatMessage
({
id
:
'material.
123456789
'
,
defaultMessage
:
'联系人'
}),
title
:
intl
.
formatMessage
({
id
:
'material.
contactMemberName
'
,
defaultMessage
:
'联系人'
}),
type
:
'string'
,
'x-rules'
:
[
{
limitByte
:
true
,
maxByte
:
40
,
}
...
...
@@ -345,7 +346,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
type
:
"object"
,
},
contactMemberPhone
:
{
title
:
intl
.
formatMessage
({
id
:
'material.
123456789
'
,
defaultMessage
:
'联系人电话'
}),
title
:
intl
.
formatMessage
({
id
:
'material.
contactMemberPhone
'
,
defaultMessage
:
'联系人电话'
}),
type
:
'string'
,
'x-rules'
:
[
{
limitByte
:
true
,
maxByte
:
40
,
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment