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
黄庭坚
jinfa-platform
Commits
78f1665c
Commit
78f1665c
authored
Jan 05, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对接待审核品牌相关功能
parent
efa7a23a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
34 deletions
+22
-34
checkBrand.tsx
src/pages/trademark/checkBrand.tsx
+2
-2
checkBrandDetail.tsx
src/pages/trademark/checkBrandDetail.tsx
+2
-2
index.tsx
...nsaction/saleOrder/addSaleDelevedOrder/constant/index.tsx
+2
-4
index.tsx
...pages/transaction/saleOrder/addSaleDelevedOrder/index.tsx
+10
-19
useProductTable.tsx
...n/saleOrder/addSaleDelevedOrder/model/useProductTable.tsx
+4
-5
index.ts
...transaction/saleOrder/addSaleDelevedOrder/schema/index.ts
+2
-2
No files found.
src/pages/trademark/checkBrand.tsx
View file @
78f1665c
...
...
@@ -6,13 +6,13 @@ import { StandardTable } from '@linkseeks/god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
moment
from
'moment'
import
EyePreview
from
'@/components/EyePreview'
import
{
getProductBrandGetPlatformBrandList
}
from
'@/services/ProductV2Api'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
}
from
'@formily/antd'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
useSetSearchValueInTable
from
'@/hooks/useSetSearchValueInTable'
import
{
getProductBrandGetUnCheckBrandList
}
from
'@/services/ProductV2Api'
const
formActions
=
createFormActions
();
...
...
@@ -52,7 +52,7 @@ const CheckBrand: React.FC<{}> = () => {
status
:
2
,
}
return
new
Promise
((
resolve
,
reject
)
=>
{
getProductBrandGet
Platform
BrandList
(
postData
).
then
(
res
=>
{
getProductBrandGet
UnCheck
BrandList
(
postData
).
then
(
res
=>
{
const
{
data
}
=
res
resolve
(
data
)
})
...
...
src/pages/trademark/checkBrandDetail.tsx
View file @
78f1665c
...
...
@@ -10,7 +10,7 @@ import { ColumnType } from 'antd/lib/table/interface'
import
ReutrnEle
from
'@/components/ReturnEle'
import
moment
from
'moment'
import
styles
from
'./index.less'
import
{
getProductBrandGetBrandCheckRecord
,
getProductBrandGet
Platform
Brand
,
postProductBrandCheckBrand
}
from
'@/services/ProductV2Api'
import
{
getProductBrandGetBrandCheckRecord
,
getProductBrandGetBrand
,
postProductBrandCheckBrand
}
from
'@/services/ProductV2Api'
const
{
Step
}
=
Steps
const
{
TextArea
}
=
Input
...
...
@@ -94,7 +94,7 @@ const CheckBrandDetail: React.FC<{}> = () => {
];
const
loadPageData
=
(
id
)
=>
{
getProductBrandGet
Platform
Brand
({
id
:
id
}).
then
(
res
=>
{
getProductBrandGetBrand
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
setBrandInfo
(
res
.
data
)
if
(
res
.
data
.
status
===
1
)
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/constant/index.tsx
View file @
78f1665c
...
...
@@ -28,14 +28,12 @@ export const procurementRenderField = (data) => {
})
}
/** 新增销售发货单 字段转换 */
/** 新增销售发货单
提交
字段转换 */
export
const
procurementProcessField
=
(
value
)
=>
{
value
.
products
=
value
.
products
.
map
(
item
=>
{
value
.
detailList
=
value
.
detailList
.
map
(
item
=>
{
return
{
...
item
,
productId
:
item
.
id
,
productNo
:
item
.
code
,
spec
:
item
.
type
,
}
})
return
value
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/index.tsx
View file @
78f1665c
...
...
@@ -6,17 +6,14 @@ import { createFormActions } from '@formily/antd'
import
{
SaveOutlined
}
from
'@ant-design/icons'
import
NiceForm
from
'@/components/NiceForm'
import
{
increaseSchema
}
from
'./schema'
// import { useMaterialTableChangeForAmount } from './effects'
import
{
procurementProcessField
,
procurementRenderField
,
procurmentRenderInit
}
from
'./constant'
import
{
useUpdate
}
from
'@umijs/hooks'
import
{
help
}
from
'../../common'
import
{
useProductTable
}
from
'./model/useProductTable'
import
FormDetailHeader
from
'@/components/FormDetailHeader'
import
FormDetailWrapper
from
'@/components/FormDetailWrapper'
import
{
FormDetailContext
}
from
'@/formSchema/context'
import
{
useFormDetail
}
from
'@/formSchema/effects/useFormDetail'
import
{
postPurchaseRequisitionCreate
,
postPurchaseRequisitionUpdate
}
from
'@/services/PurchaseV2Api'
import
{
getOrderVendorDetail
}
from
'@/services/OrderNewV2Api'
import
{
getOrderVendorDetail
,
postOrderVendorCreateSellDelivery
}
from
'@/services/OrderNewV2Api'
const
addSchemaAction
=
createFormActions
()
...
...
@@ -24,7 +21,6 @@ const addSchemaAction = createFormActions()
const
AddSaleDelevedOrder
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
formLoading
,
setFormLoading
]
=
useState
(
false
)
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
)
const
update
=
useUpdate
()
const
{
id
,
preview
=
null
}
=
usePageStatus
()
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
({})
const
{
formContext
}
=
useFormDetail
()
...
...
@@ -41,7 +37,7 @@ const AddSaleDelevedOrder:React.FC<{}> = () => {
const
_orderProductRequests
=
procurementRenderField
(
data
)
setInitFormValue
(()
=>
procurmentRenderInit
(
data
))
setTimeout
(()
=>
{
addSchemaAction
.
setFieldValue
(
'
products
'
,
_orderProductRequests
)
addSchemaAction
.
setFieldValue
(
'
detailList
'
,
_orderProductRequests
)
},
1000
)
setFormLoading
(
false
)
})
...
...
@@ -51,8 +47,7 @@ const AddSaleDelevedOrder:React.FC<{}> = () => {
const
handleSubmit
=
async
(
value
)
=>
{
try
{
let
fnResult
=
null
// 新增发货单/编辑发货单
// 新增发货单
const
params
=
{
...
value
}
if
(
formContext
.
innerFormErrors
)
{
throw
new
Error
(
intl
.
formatMessage
({
id
:
'saleOrder.qingwanshanfahuodan'
,
defaultMessage
:
'请完善发货单明细数据'
}))
...
...
@@ -61,18 +56,14 @@ const AddSaleDelevedOrder:React.FC<{}> = () => {
const
_params
=
procurementProcessField
(
params
)
console
.
log
(
_params
)
// if(id) {
// fnResult = await postPurchaseRequisitionUpdate({..._params, id})
// } else {
// fnResult = await postPurchaseRequisitionCreate(_params)
// }
// if (fnResult.code === 1000) {
// setTimeout(() => {
// history.push("/memberCenter/procurementAbility/purchaseRequisition/readyAddBill")
// }, 1000)
// } else {
const
fnResult
=
await
postOrderVendorCreateSellDelivery
({...
_params
,
id
})
if
(
fnResult
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
push
(
"/memberCenter/tranactionAbility/saleOrder/readyAddDelevedOrder"
)
},
1000
)
}
else
{
setBtnLoading
(
false
)
//
}
}
}
catch
(
error
)
{
setBtnLoading
(
false
)
error
?.
message
&&
message
.
error
(
error
.
message
)
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/model/useProductTable.tsx
View file @
78f1665c
...
...
@@ -18,17 +18,16 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const
intl
=
useIntl
()
const
handleDelete
=
(
record
)
=>
{
const
newData
=
[...
ctx
.
getFieldValue
(
'
products
'
)]
const
newData
=
[...
ctx
.
getFieldValue
(
'
detailList
'
)]
// 删除formvalue
const
colIndex
=
newData
.
findIndex
(
v
=>
v
.
id
===
record
.
id
)
newData
.
splice
(
colIndex
,
1
)
ctx
.
setFieldValue
(
'
products
'
,
newData
)
ctx
.
setFieldValue
(
'
detailList
'
,
newData
)
}
const
[
productColumns
,
setProductColumns
]
=
useState
(()
=>
{
// 渲染操作
productInfoColumns
[
productInfoColumns
.
length
-
1
].
render
=
(
text
,
record
)
=>
<
Button
type=
'link'
onClick=
{
()
=>
handleDelete
(
record
)
}
>
{
intl
.
formatMessage
({
id
:
'saleOrder.shanchu'
,
defaultMessage
:
'删除'
})
}
</
Button
>
// productInfoColumns[productInfoColumns.length - 2].render = (t, r) => r.amount && <span style={{color: 'red'}}>{intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency'})} {Number(r.amount).toFixed(2)}</span>
return
productInfoColumns
})
...
...
@@ -41,7 +40,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const
handleSave
=
row
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
newData
=
[...
ctx
.
getFieldValue
(
'
products
'
)];
const
newData
=
[...
ctx
.
getFieldValue
(
'
detailList
'
)];
const
index
=
newData
.
findIndex
(
item
=>
row
.
id
===
item
.
id
);
const
item
=
newData
[
index
];
// 算单行价格
...
...
@@ -50,7 +49,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
...
item
,
...
row
,
});
ctx
.
setFieldValue
(
'
products
'
,
newData
)
ctx
.
setFieldValue
(
'
detailList
'
,
newData
)
resolve
({
item
,
newData
})
})
};
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/schema/index.ts
View file @
78f1665c
...
...
@@ -50,7 +50,7 @@ const basicInfo: ISchema = {
span
:
1
}
},
deliv
erTime
:
{
ord
erTime
:
{
type
:
'string'
,
"x-component"
:
'date'
,
title
:
intl
.
formatMessage
({
id
:
'saleOrder.danjushijian'
,
defaultMessage
:
'单据时间'
}),
...
...
@@ -172,7 +172,7 @@ const material: ISchema = {
id
:
'orderMaterial'
,
},
properties
:
{
products
:
{
detailList
:
{
type
:
'array'
,
"x-component"
:
'MultTable'
,
required
:
true
,
...
...
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