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
683bfd22
Commit
683bfd22
authored
Jan 07, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixbug-1.0.1' into dev
parents
41711913
916310ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
302 additions
and
171 deletions
+302
-171
env.js
env.js
+47
-2
package.json
package.json
+2
-0
equity-1.png
src/assets/imgs/equity-1.png
+0
-0
equity-2.png
src/assets/imgs/equity-2.png
+0
-0
equity-3.png
src/assets/imgs/equity-3.png
+0
-0
index.tsx
src/components/NiceForm/components/AntUpload/index.tsx
+7
-4
index.less
src/pages/afterService/components/AddressFormItem/index.less
+4
-0
index.tsx
src/pages/afterService/components/AddressFormItem/index.tsx
+17
-10
index.tsx
src/pages/afterService/components/OuterCirculation/index.tsx
+8
-2
index.ts
...vice/components/RefundModal/UploadVoucher/schema/index.ts
+12
-5
index.tsx
src/pages/afterService/components/ReturnDetailInfo/index.tsx
+2
-1
index.tsx
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
+10
-8
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+4
-1
index.tsx
...pplication/repairPrSubmit/components/RepairForm/index.tsx
+4
-1
index.tsx
...Service/returnApplication/components/DetailInfo/index.tsx
+1
-0
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+3
-1
index.tsx
src/pages/member/components/EquityInfo/index.tsx
+8
-2
auditModel.tsx
src/pages/transaction/goodsOffer/components/auditModel.tsx
+119
-120
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+38
-10
fetchBillList.ts
...ckSellStorage/bills/components/BillsForm/fetchBillList.ts
+3
-1
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+0
-0
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+11
-2
formEffectUtils.ts
src/utils/formEffectUtils.ts
+2
-1
No files found.
env.js
View file @
683bfd22
...
...
@@ -2,6 +2,29 @@
const
path
=
require
(
'path'
)
module
.
exports
=
{
all
:
{
SITE_ID
:
'1'
,
BACK_GATEWAY
:
'http://lingxi-all.wg.shushangyun.com'
,
USE_ROUTE_CONFIG
:
false
,
SOCKET_URL
:
'ws://lingxi-all.wg.shushangyun.com'
,
ssh
:
JSON
.
stringify
({
user
:
"www"
,
// Password optional, prompted if none given
password
:
"!@#project_$%^231(1)wwwuser3"
,
host
:
"119.23.219.65"
,
port
:
8122
,
localRoot
:
path
.
resolve
(
'./dist/'
),
remoteRoot
:
"/usr/local/nginx/html/lingxi/yanshi/api/all/web/dist/"
,
// include: ["*", "**/*"], // this would upload everything except dot files
include
:
[
"*"
],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true
deleteRemote
:
true
,
// Passive mode is forced (EPSV command is not sent)
forcePasv
:
true
})
},
scm
:
{
SITE_ID
:
'1'
,
BACK_GATEWAY
:
'http://lingxi-scm.wg.shushangyun.com'
,
...
...
@@ -47,5 +70,28 @@ module.exports = {
// Passive mode is forced (EPSV command is not sent)
forcePasv
:
true
})
},
25
:
{
SITE_ID
:
'352'
,
BACK_GATEWAY
:
'http://10.0.0.25:8100'
,
USE_ROUTE_CONFIG
:
true
,
SOCKET_URL
:
'ws://10.0.0.25:8100'
,
ssh
:
JSON
.
stringify
({
user
:
"root"
,
// Password optional, prompted if none given
password
:
"123456"
,
host
:
"10.0.0.25"
,
port
:
22
,
localRoot
:
path
.
resolve
(
'./dist/'
),
remoteRoot
:
"/data/.jenkins/workspace/lingxi-business-platform/dist/"
,
// include: ["*", "**/*"], // this would upload everything except dot files
include
:
[
"*"
],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true
deleteRemote
:
true
,
// Passive mode is forced (EPSV command is not sent)
forcePasv
:
true
})
}
}
\ No newline at end of file
}
package.json
View file @
683bfd22
...
...
@@ -4,6 +4,7 @@
"scripts"
:
{
"upload:scm"
:
"cross-env local=scm taskName=upload yarn scripts:build"
,
"upload:10"
:
"cross-env local=10 taskName=upload yarn scripts:build"
,
"upload:25"
:
"cross-env local=25 taskName=upload yarn scripts:build"
,
"api"
:
"god-ytt"
,
"scripts:build"
:
"node scripts/run"
,
"scripts:build-yxc"
:
"node scripts/run http://yxc-web-demo.shushangyun.com/api"
,
...
...
@@ -17,6 +18,7 @@
"build:dev"
:
"pm2 start scripts/devServer.js"
,
"build:clean"
:
"cross-env NODE_OPTIONS=--max_old_space_size=4096 umi build"
,
"build:scm"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com yarn build"
,
"build:all"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-all.wg.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lingxi-all.wg.shushangyun.com yarn build"
,
"build:10"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.10:9400 yarn build"
,
"postinstall"
:
"umi generate tmp"
,
"prettier"
:
"prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'"
,
...
...
src/assets/imgs/equity-1.png
View replaced file @
41711913
View file @
683bfd22
6.71 KB
|
W:
|
H:
5.74 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/imgs/equity-2.png
View replaced file @
41711913
View file @
683bfd22
6.06 KB
|
W:
|
H:
6.71 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/imgs/equity-3.png
View replaced file @
41711913
View file @
683bfd22
5.74 KB
|
W:
|
H:
6.06 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/components/NiceForm/components/AntUpload/index.tsx
View file @
683bfd22
...
...
@@ -153,6 +153,7 @@ export interface IUploaderProps {
locale
:
{
[
name
:
string
]:
any
}
value
:
any
[]
listType
?:
UploadListType
readOnly
?:
boolean
}
export
const
Upload
=
connect
({
...
...
@@ -279,10 +280,12 @@ export const Upload = connect({
onRemove=
{
this
.
onRemoveHandler
}
listType=
{
listType
}
>
<
Button
style=
{
{
margin
:
'0 0 10px'
}
}
>
<
UploadOutlined
/>
{
(
locale
&&
locale
.
uploadText
)
||
'上传文件'
}
</
Button
>
{
!
others
.
readOnly
?
(
<
Button
style=
{
{
margin
:
'0 0 10px'
}
}
>
<
UploadOutlined
/>
{
(
locale
&&
locale
.
uploadText
)
||
'上传文件'
}
</
Button
>
)
:
null
}
</
AntdUpload
>
)
}
...
...
src/pages/afterService/components/AddressFormItem/index.less
View file @
683bfd22
...
...
@@ -36,6 +36,10 @@
&.disabled {
cursor: not-allowed;
}
&.hide {
display: none;
}
}
}
...
...
src/pages/afterService/components/AddressFormItem/index.tsx
View file @
683bfd22
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 10:30:54
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-11-19 15:36:34
* @LastEditTime: 202
1-01-06 14:18:10
* @Description: 地址 Form Item
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
;
...
...
@@ -31,15 +31,21 @@ interface AddressFormItemProps {
onChange
:
(
id
:
string
)
=>
{};
// 禁用的
disabled
?:
boolean
;
/**
* 只读的
*/
readOnly
?:
boolean
;
};
const
AddressFormItem
:
React
.
FC
<
AddressFormItemProps
>
&
{
isFieldComponent
:
boolean
}
=
({
value
,
showCount
=
3
,
dataSource
=
[],
onChange
,
disabled
=
false
,
})
=>
{
const
AddressFormItem
:
React
.
FC
<
AddressFormItemProps
>
&
{
isFieldComponent
:
boolean
}
=
(
props
)
=>
{
const
{
value
,
showCount
=
3
,
dataSource
=
[],
onChange
,
disabled
=
false
,
readOnly
,
}
=
props
;
const
[
showMore
,
setShowMore
]
=
useState
(
false
);
// useEffect(() => {
...
...
@@ -52,7 +58,7 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
// }, [dataSource]);
const
showDataSource
=
!
showMore
?
[...
dataSource
].
splice
(
0
,
showCount
)
:
dataSource
;
const
showDataSource
=
!
showMore
&&
!
readOnly
?
[...
dataSource
].
splice
(
0
,
showCount
)
:
dataSource
;
const
handleToogleMore
=
()
=>
{
setShowMore
(
!
showMore
)
...
...
@@ -72,6 +78,7 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
className=
{
classNames
(
styles
[
'addressList-item'
],
{
[
styles
.
active
]:
item
.
id
===
(
value
&&
value
.
id
),
[
styles
.
disabled
]:
disabled
,
[
styles
.
hide
]:
readOnly
&&
item
.
id
!==
(
value
&&
value
.
id
),
})
}
onClick=
{
()
=>
handleSelectItem
(
item
)
}
key=
{
item
.
id
}
...
...
@@ -85,7 +92,7 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
</
li
>
))
}
</
ul
>
{
dataSource
.
length
>
showCount
&&
(
{
(
dataSource
.
length
>
showCount
)
&&
!
readOnly
&&
(
<
div
className=
{
styles
.
more
}
onClick=
{
handleToogleMore
}
...
...
src/pages/afterService/components/OuterCirculation/index.tsx
View file @
683bfd22
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:47:07
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-10-27 10:33:24
* @LastEditTime: 202
1-01-06 11:44:39
* @Description: 外部流转组件
*/
import
React
from
'react'
;
...
...
@@ -14,6 +14,7 @@ interface OuterCirculation {
steps
:
{
title
:
string
,
description
:
string
,
status
:
'finish'
|
'wait'
,
}[];
current
:
number
;
};
...
...
@@ -35,7 +36,12 @@ const OuterCirculation: React.FC<OuterCirculation> = ({
{
(
steps
&&
steps
.
length
>
0
)
?
(
<
Steps
style=
{
{
marginTop
:
30
}
}
progressDot
current=
{
current
}
>
{
steps
.
map
((
item
,
index
)
=>
(
<
Steps
.
Step
key=
{
index
}
title=
{
item
.
title
}
description=
{
item
.
description
}
/>
<
Steps
.
Step
key=
{
index
}
title=
{
item
.
title
}
description=
{
item
.
description
}
status=
{
item
.
status
}
/>
))
}
</
Steps
>
)
:
(
...
...
src/pages/afterService/components/RefundModal/UploadVoucher/schema/index.ts
View file @
683bfd22
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-06 15:04:20
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
;
...
...
@@ -8,25 +15,25 @@ export const uploadVoucherModalSchema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
6
,
wrapperCol
:
18
,
labelCol
:
4
,
wrapperCol
:
20
,
labelAlign
:
'left'
,
full
:
true
,
},
properties
:
{
name
:
{
type
:
'string'
,
title
:
'账户名称'
,
title
:
'账户名称
:
'
,
'x-component'
:
'Text'
,
},
bankAccount
:
{
type
:
'string'
,
title
:
'银行账号'
,
title
:
'银行账号
:
'
,
'x-component'
:
'Text'
,
},
bankDeposit
:
{
type
:
'string'
,
title
:
'开户行'
,
title
:
'开户行
:
'
,
'x-component'
:
'Text'
,
},
fileList
:
{
...
...
src/pages/afterService/components/ReturnDetailInfo/index.tsx
View file @
683bfd22
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 18:02:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-29 11:00:2
2
* @LastEditTime: 202
1-01-06 15:05:3
2
* @Description: 退款明细
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -254,6 +254,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
if
(
onRefund
)
{
onRefund
(
values
).
finally
(()
=>
{
setSubmitLoading
(
false
);
setRefundModalVisible
(
false
);
});
}
};
...
...
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
View file @
683bfd22
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-0
5 13:51:21
* @LastEditTime: 2021-01-0
6 14:30:16
* @Description: 查看退货数量与退款金额 抽屉
*/
import
React
from
'react'
;
...
...
@@ -159,14 +159,16 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
onClick=
{
handleClose
}
style=
{
{
marginRight
:
8
}
}
>
取消
</
Button
>
<
Button
onClick=
{
()
=>
schemaAction
.
submit
()
}
type=
"primary"
>
确定
{
onSubmit
?
'取消'
:
'关闭'
}
</
Button
>
{
onSubmit
&&
(
<
Button
onClick=
{
()
=>
schemaAction
.
submit
()
}
type=
"primary"
>
确定
</
Button
>
)
}
</
div
>
}
destroyOnClose
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
683bfd22
...
...
@@ -384,9 +384,11 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
})
.
finally
(()
=>
{
.
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
@@ -501,6 +503,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
...
detailInfo
,
replaceGoodsList
:
replaceGoodsList
.
data
,
}
}
previewPlaceholder=
" "
expressionScope=
{
{
TableAddButton
,
OuterStatus
,
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/index.tsx
View file @
683bfd22
...
...
@@ -233,9 +233,11 @@ const RepairForm: React.FC<BillsFormProps> = ({
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
})
.
finally
(()
=>
{
.
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
@@ -343,6 +345,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
...
detailInfo
,
repairGoodsList
:
repairGoodsList
.
data
,
}
}
previewPlaceholder=
" "
expressionScope=
{
{
TableAddButton
,
OuterStatus
,
...
...
src/pages/afterService/returnApplication/components/DetailInfo/index.tsx
View file @
683bfd22
...
...
@@ -361,6 +361,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
title
:
item
.
taskName
,
description
:
item
.
roleName
,
step
:
item
.
step
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
683bfd22
...
...
@@ -398,9 +398,11 @@ const ReturnForm: React.FC<BillsFormProps> = ({
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
})
.
finally
(()
=>
{
.
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
src/pages/member/components/EquityInfo/index.tsx
View file @
683bfd22
...
...
@@ -70,6 +70,12 @@ const equityTxtMap = {
3
:
'积分'
,
};
const
clsMap
=
{
1
:
'tofo-item-tag-price'
,
2
:
'tofo-item-tag-recurrence'
,
3
:
'tofo-item-tag-integral'
,
};
const
EquityInfo
:
React
.
FC
<
EquityInfoProps
>
=
({
equityInfo
=
{},
fetchReceivedList
,
...
...
@@ -248,9 +254,9 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
</
div
>
<
div
className=
{
styles
[
'tofo-item-extra'
]
}
>
<
span
className=
{
classNames
(
styles
[
'tofo-item-tag'
],
styles
[
'tofo-item-tag-price'
])
}
className=
{
classNames
(
styles
[
'tofo-item-tag'
],
styles
[
clsMap
[
item
.
rightTypeEnum
]
])
}
>
{
item
.
parameter
}
{
equityTxtMap
[
item
.
rightTypeEnum
]
||
''
}
{
item
.
parameter
}
%
{
equityTxtMap
[
item
.
rightTypeEnum
]
||
''
}
</
span
>
</
div
>
</
li
>
...
...
src/pages/transaction/goodsOffer/components/auditModel.tsx
View file @
683bfd22
import
React
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
import
{
Input
,
Radio
,
FormMegaLayout
}
from
'@formily/antd-components'
import
{
PublicApi
}
from
'@/services/api'
;
const
actions
=
createFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
;
export
interface
Params
{
id
:
number
|
string
;
type
:
number
|
string
;
//1是待提交询价单 2是一级 3是二级
dialogVisible
:
boolean
;
onCancel
:
Function
;
onOK
?:
Function
;
}
const
AuditModal
:
React
.
FC
<
Params
>
=
(
props
)
=>
{
const
useFormEffects
=
()
=>
{
const
{
setFieldState
}
=
createFormActions
()
onFieldChange$
(
'state'
).
subscribe
(({
value
})
=>
{
setFieldState
(
'cause'
,
state
=>
{
if
(
value
==
1
)
{
state
.
visible
=
false
}
else
{
state
.
visible
=
true
}
})
})
}
const
handletOk
=
(
values
:
any
)
=>
{
let
value
=
{
...
values
}
value
.
id
=
props
.
id
switch
(
props
.
type
)
{
case
2
:
PublicApi
.
postOrderInquiryDocumentsReview
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
case
3
:
PublicApi
.
postOrderInquiryDocumentsReviewTwo
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
case
6
:
PublicApi
.
postOrderInquiryListSubmit
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
}
}
return
(
<
Modal
title=
'单据审核'
width=
{
576
}
visible=
{
props
.
dialogVisible
}
onOk=
{
()
=>
actions
.
submit
()
}
onCancel=
{
()
=>
props
.
onCancel
()
}
destroyOnClose
afterClose=
{
()
=>
actions
.
reset
()
}
okText=
'确定'
cancelText=
{
`取消`
}
>
<
SchemaForm
layout=
"vertical"
labelCol=
{
6
}
components=
{
{
Input
,
Radio
:
Radio
.
Group
,
TextArea
:
Input
.
TextArea
}
}
actions=
{
actions
}
effects=
{
()
=>
useFormEffects
()
}
onSubmit=
{
(
values
)
=>
handletOk
(
values
)
}
initialValues=
{
{
state
:
1
}
}
>
<
Field
enum=
{
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
}
]
}
name=
'state'
required
x
-
component=
"Radio"
x
-
component
-
props=
{
{
}
}
/>
<
Field
title=
'审核不通过原因'
name=
"cause"
x
-
component=
"TextArea"
required
x
-
component
-
props=
{
{
placeholder
:
'在此输入你的内容,最多60个汉字'
}
}
x
-
rules=
{
{
max
:
60
,
// maximum:10,//最大数值
message
:
'原因最多60个汉字'
}
}
/>
</
SchemaForm
>
</
Modal
>
)
}
export
default
AuditModal
\ No newline at end of file
import
React
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
import
{
Input
,
Radio
,
FormMegaLayout
}
from
'@formily/antd-components'
import
{
PublicApi
}
from
'@/services/api'
;
const
actions
=
createFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
;
export
interface
Params
{
id
:
number
|
string
;
type
:
number
|
string
;
//1是待提交询价单 2是一级 3是二级
dialogVisible
:
boolean
;
onCancel
:
Function
;
onOK
?:
Function
;
}
const
AuditModal
:
React
.
FC
<
Params
>
=
(
props
)
=>
{
const
useFormEffects
=
()
=>
{
const
{
setFieldState
}
=
createFormActions
()
onFieldChange$
(
'state'
).
subscribe
(({
value
})
=>
{
setFieldState
(
'cause'
,
state
=>
{
if
(
value
==
1
)
{
state
.
visible
=
false
}
else
{
state
.
visible
=
true
}
})
})
}
const
handletOk
=
(
values
:
any
)
=>
{
let
value
=
{
...
values
}
value
.
id
=
props
.
id
switch
(
props
.
type
)
{
case
2
:
PublicApi
.
postOrderInquiryDocumentsReview
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
case
3
:
PublicApi
.
postOrderInquiryDocumentsReviewTwo
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
case
6
:
PublicApi
.
postOrderInquiryListSubmit
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
}
})
break
;
}
}
return
(
<
Modal
title=
'单据审核'
width=
{
576
}
visible=
{
props
.
dialogVisible
}
onOk=
{
()
=>
actions
.
submit
()
}
onCancel=
{
()
=>
props
.
onCancel
()
}
destroyOnClose
afterClose=
{
()
=>
actions
.
reset
()
}
okText=
'确定'
cancelText=
{
`取消`
}
>
<
SchemaForm
layout=
"vertical"
labelCol=
{
6
}
components=
{
{
Input
,
Radio
:
Radio
.
Group
,
TextArea
:
Input
.
TextArea
}
}
actions=
{
actions
}
effects=
{
()
=>
useFormEffects
()
}
onSubmit=
{
(
values
)
=>
handletOk
(
values
)
}
initialValues=
{
{
state
:
1
}
}
>
<
Field
enum=
{
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
}
]
}
name=
'state'
required
x
-
component=
"Radio"
x
-
component
-
props=
{
{
}
}
/>
<
Field
title=
'审核不通过原因'
name=
"cause"
x
-
component=
"TextArea"
required
x
-
component
-
props=
{
{
placeholder
:
'在此输入你的内容,最多60个汉字'
}
}
x
-
rules=
{
{
max
:
60
,
// maximum:10,//最大数值
message
:
'原因最多60个汉字'
}
}
/>
</
SchemaForm
>
</
Modal
>
)
}
export
default
AuditModal
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
683bfd22
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-0
4 11:22:36
* @LastEditTime: 2021-01-0
7 10:21:44
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -257,6 +257,7 @@ export const useBusinessEffects = (context, actions) => {
break
;
}
// 其他的走内部单据
default
:
{
freeEnumItem
(
newEnum
,
'value'
,
DEPENDENT_DOC_INTERNAL
);
break
;
...
...
@@ -285,6 +286,7 @@ export const useBusinessEffects = (context, actions) => {
if
(
current
)
{
linkage
.
value
(
'invoicesTypeCode'
,
current
.
number
);
linkage
.
value
(
'direction'
,
current
.
direction
);
}
linkage
.
componentProps
(
'orderNo'
,
params
);
});
...
...
@@ -344,7 +346,7 @@ export const useBusinessEffects = (context, actions) => {
if
(
res
.
code
===
1000
)
{
const
goodOptions
=
res
.
data
.
map
(
item
=>
({
label
:
item
.
productName
,
value
:
item
.
productI
d
,
value
:
item
.
i
d
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
res
.
data
);
...
...
@@ -357,6 +359,9 @@ export const useBusinessEffects = (context, actions) => {
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
// 设置配送方式相关字段数据
setFieldValue
(
'transport'
,
DELIVERY_TYPE
[
first
.
deliveryType
]);
setFieldValue
(
'deliveryType'
,
first
.
deliveryType
);
// 从加工单详情获取 商品 数据
PublicApi
.
getEnhanceSupplierToBeAddStorageDetails
({
id
:
first
.
id
,
...
...
@@ -370,7 +375,7 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
details
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}${
item
.
orderNo
?
'---'
+
item
.
orderNo
:
''
}
`
,
value
:
item
.
productI
d
,
value
:
item
.
i
d
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
.
map
(
item
=>
({
...
...
@@ -388,6 +393,9 @@ export const useBusinessEffects = (context, actions) => {
// 加工发货单
case
DOC_TYPE_PROCESS_INVOICE
:
{
// 设置配送方式相关字段数据
setFieldValue
(
'transport'
,
DELIVERY_TYPE
[
first
.
deliveryType
]);
setFieldValue
(
'deliveryType'
,
first
.
deliveryType
);
// 从加工单详情获取 商品 数据
PublicApi
.
getEnhanceProcessToBeAddDeliveryDetails
({
id
:
first
.
id
,
...
...
@@ -400,7 +408,7 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
details
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}${
item
.
orderNo
?
'---订单号:'
+
item
.
orderNo
:
''
}
`
,
value
:
item
.
productI
d
,
value
:
item
.
i
d
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
);
...
...
@@ -436,12 +444,13 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
data
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}
---订单号:
${
item
.
orderNo
}
`
,
value
:
item
.
product
Id
,
value
:
item
.
orderRecord
Id
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
data
.
map
(
item
=>
({
...
item
,
price
:
item
.
purchasePrice
,
// 与采购入库单、销售发货单统一
id
:
item
.
orderRecordId
,
})));
FormPath
.
setIn
(
state
,
'props.enum'
,
goodOptions
);
});
...
...
@@ -471,12 +480,13 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
data
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}
---订单号:
${
item
.
orderNo
}
`
,
value
:
item
.
product
Id
,
value
:
item
.
orderRecord
Id
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
data
.
map
(
item
=>
({
...
item
,
price
:
item
.
purchasePrice
,
// 与采购入库单、销售发货单统一
id
:
item
.
orderRecordId
,
})));
FormPath
.
setIn
(
state
,
'props.enum'
,
goodOptions
);
});
...
...
@@ -513,9 +523,11 @@ export const useBusinessEffects = (context, actions) => {
// 关联明细 商品下拉框 联动商品ID、单价
onFieldInputChange$
(
'invoicesDetailsRequests.*.product'
).
subscribe
(
fieldState
=>
{
const
{
name
,
originAsyncData
,
value
}
=
fieldState
;
const
current
=
originAsyncData
.
find
(
item
=>
item
.
productI
d
===
value
);
const
current
=
originAsyncData
.
find
(
item
=>
item
.
i
d
===
value
);
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
const
relevanceInvoicesVal
=
getFieldValue
(
'relevanceInvoices'
);
console
.
log
(
'value'
,
value
)
console
.
log
(
'current'
,
current
)
// 取消选择
if
(
!
value
)
{
...
...
@@ -760,7 +772,6 @@ export const useBusinessEffects = (context, actions) => {
onFieldInputChange$
(
'invoicesDetailsRequests.*.productCount'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
const
relevanceInvoicesVal
=
getFieldValue
(
'relevanceInvoices'
);
const
originAsyncData
=
getFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.product`
...
...
@@ -773,7 +784,7 @@ export const useBusinessEffects = (context, actions) => {
}),
state
=>
state
.
value
,
);
const
current
=
originAsyncData
?
originAsyncData
.
find
(
item
=>
item
.
productI
d
===
goodId
)
:
null
;
const
current
=
originAsyncData
?
originAsyncData
.
find
(
item
=>
item
.
i
d
===
goodId
)
:
null
;
if
(
!
current
)
{
return
;
...
...
@@ -876,4 +887,20 @@ export const useBusinessEffects = (context, actions) => {
}
);
});
// 对应单据改变
onFieldValueChange$
(
'relevanceInvoices'
).
subscribe
(
fieldState
=>
{
const
{
value
}
=
fieldState
;
// 对应单据等于内部单据
// formily 的 bug,设置了 display 为 false,该列还是会展示在页面中
// 所以把title设置
if
(
value
===
DEPENDENT_DOC_INTERNAL
)
{
linkage
.
display
(
'*(orderNo,memberName,address,transport)'
,
false
);
linkage
.
display
(
'invoicesDetailsRequests.*.*(product,productId,price,amount)'
,
false
);
}
else
{
linkage
.
display
(
'*(orderNo,memberName,address,transport)'
);
linkage
.
display
(
'invoicesDetailsRequests.*.*(product,productId,price,amount)'
);
}
});
}
\ No newline at end of file
src/pages/transaction/stockSellStorage/bills/components/BillsForm/fetchBillList.ts
View file @
683bfd22
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-12-22 17:57:26
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-23 11:24:44
* @LastEditTime: 202
1-01-07 10:15:47
* @Description: 获取 单据列表 弹窗数据接口相关
*/
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -62,6 +62,7 @@ export const getMachiningWarehousingList = async (params: any) => {
fullAddress
:
item
.
receiveAddress
||
''
,
receiverName
:
item
.
receiveUserName
||
''
,
phone
:
item
.
receiveUserTel
||
''
,
orderNo
:
item
.
noticeNo
,
})),
total
:
res
.
data
.
totalCount
,
};
...
...
@@ -85,6 +86,7 @@ export const getMachiningDeliveryList = async (params: any) => {
fullAddress
:
item
.
receiveAddress
||
''
,
receiverName
:
item
.
receiveUserName
||
''
,
phone
:
item
.
receiveUserTel
||
''
,
orderNo
:
item
.
noticeNo
,
})),
total
:
res
.
data
.
totalCount
,
};
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
683bfd22
This diff is collapsed.
Click to expand it.
src/pages/transaction/stockSellStorage/bills/components/BillsForm/schema/index.ts
View file @
683bfd22
...
...
@@ -379,12 +379,17 @@ export const addBillSchema: ISchema = {
},
// 会员id,可以是采购会员id、销售会员id
membersId
:
{
type
:
'
boolean
'
,
type
:
'
string
'
,
display
:
false
,
},
// 会员角色id,可以是采购会员角色id、销售会员角色id
membersRoleId
:
{
type
:
'boolean'
,
type
:
'string'
,
display
:
false
,
},
// 单据类型方向
direction
:
{
type
:
'string'
,
display
:
false
,
},
},
...
...
@@ -481,16 +486,19 @@ export const addBillSchema: ISchema = {
message
:
'请选择商品'
,
},
],
display
:
true
,
},
productId
:
{
type
:
'string'
,
title
:
'商品ID'
,
'x-component'
:
'Text'
,
display
:
true
,
},
price
:
{
type
:
'string'
,
title
:
'单价'
,
'x-component'
:
'Text'
,
display
:
true
,
},
productCount
:
{
type
:
'string'
,
...
...
@@ -513,6 +521,7 @@ export const addBillSchema: ISchema = {
type
:
'string'
,
title
:
'金额'
,
'x-component'
:
'Text'
,
display
:
true
,
},
// 额外的数据,用于收集不需要展示的数据
extraData
:
{
...
...
src/utils/formEffectUtils.ts
View file @
683bfd22
...
...
@@ -19,6 +19,7 @@ export const useLinkageUtils = () => {
loading
:
linkage
(
'loading'
,
true
),
loaded
:
linkage
(
'loading'
,
false
),
value
:
linkage
(
'value'
),
componentProps
:
linkage
(
'props.x-component-props'
,
{})
componentProps
:
linkage
(
'props.x-component-props'
,
{}),
display
:
linkage
(
'display'
,
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