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
150a2485
Commit
150a2485
authored
Sep 28, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:新建交易规则选所有商品提交异常
parent
7a88dc8b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
66 deletions
+25
-66
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+2
-5
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+0
-15
logisticsForm.tsx
...ages/commodity/products/addProductsItem/logisticsForm.tsx
+1
-1
otherForm.tsx
src/pages/commodity/products/addProductsItem/otherForm.tsx
+2
-3
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+3
-8
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+2
-11
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+2
-7
selectGoodsForm.tsx
...es/commodity/products/addProductsItem/selectGoodsForm.tsx
+4
-8
addRule.tsx
src/pages/transaction/transactionRules/addRule.tsx
+9
-8
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
150a2485
...
...
@@ -3,7 +3,8 @@ import { history } from 'umi';
import
{
Button
,
Card
,
Tabs
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
SaveOutlined
,
EditFilled
,
SaveOutlined
,
EditFilled
,
}
from
'@ant-design/icons'
import
ReutrnEle
from
'@/components/ReturnEle'
...
...
@@ -20,9 +21,6 @@ import ProductDescFormCloud from './addProductsItem/productDescFormCloud'
import
{
useLocalStore
,
observer
}
from
'mobx-react'
import
{
store
}
from
'@/store'
import
{
PublicApi
}
from
'@/services/api'
import
{
render
}
from
'@/app'
;
const
demoFetch
=
require
(
'../../../../demo'
).
fetchConfig
const
{
TabPane
}
=
Tabs
...
...
@@ -78,7 +76,6 @@ const AddProducts: React.FC<{}> = (props) => {
// 获取页面使用模板
const
productDescriptionTemplate
=
async
()
=>
{
let
globalData
=
await
demoFetch
()
//@ts-ignore
PublicApi
.
getTemplateGoodsFindUseGoodsTemplate
({
siteId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
...
...
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
150a2485
...
...
@@ -37,19 +37,12 @@ const layoutFormList = {
push
:
2
},
}
const
tailLayout
=
{
wrapperCol
:
{
offset
:
2
,
span
:
12
,
},
}
interface
Iprops
{
onChangeAttributeList
:
(
attributeLists
:
any
)
=>
void
;
onRef
:
(
refs
:
any
)
=>
void
;
}
interface
AreaParams
{
provinceCode
:
any
;
provinceName
:
any
;
...
...
@@ -382,14 +375,6 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
>
{
showCategory
&&
<><
span
className=
"commonStatusValid"
></
span
>
{
renderCategoryType
()
}
</>
}
</
Form
.
Item
>
{
/* <Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
保存
</Button>
<Button className={styles.ml20}>
取消
</Button>
</Form.Item> */
}
</
Form
>
</>)
}
...
...
src/pages/commodity/products/addProductsItem/logisticsForm.tsx
View file @
150a2485
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Form
,
Select
,
Radio
,
Input
,
Checkbox
,
InputNumber
}
from
'antd'
import
{
Form
,
Select
,
Radio
,
Checkbox
,
InputNumber
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetLogisticsSelectListCompanyResponse
,
GetLogisticsSelectListShipperAddressResponse
,
GetLogisticsSelectListFreightTemplateResponse
}
from
'@/services'
import
{
store
}
from
'@/store'
...
...
src/pages/commodity/products/addProductsItem/otherForm.tsx
View file @
150a2485
import
React
,
{
use
State
,
use
Effect
,
useRef
}
from
'react'
import
React
,
{
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Form
,
Select
,
Radio
,
Input
}
from
'antd'
import
{
Form
,
Radio
,
Input
}
from
'antd'
import
{
store
}
from
'@/store'
import
{
validatorByte
}
from
'@/utils/regExp'
const
{
ProductStore
}
=
store
...
...
@@ -18,7 +18,6 @@ export interface Iprops {
onRef
:
(
refs
:
any
)
=>
void
;
}
const
{
Option
}
=
Select
const
{
TextArea
}
=
Input
const
OtherForm
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
150a2485
import
React
,
{
useState
,
useEffect
,
useRef
,
use
Context
,
useCallback
,
use
Memo
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Form
,
Select
,
Checkbox
,
Tooltip
,
Radio
,
Input
,
Table
,
Modal
,
Row
,
Col
,
InputNumber
,
message
}
from
'antd'
import
{
Button
,
Form
,
Select
,
Checkbox
,
Tooltip
,
Radio
,
Input
,
Table
,
Modal
,
Row
,
Col
,
InputNumber
}
from
'antd'
import
styles
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
EyeOutlined
,
QuestionCircleOutlined
,
SettingOutlined
,
PlusOutlined
,
MinusOutlined
,
}
from
'@ant-design/icons'
import
{
QuestionCircleOutlined
,
SettingOutlined
,
PlusOutlined
,
MinusOutlined
,
}
from
'@ant-design/icons'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
store
}
from
'@/store'
import
{
IProductSelectAttribute
}
from
'@/module/productModule'
import
moment
from
'moment'
import
{
observable
}
from
'mobx'
const
_
=
require
(
"lodash"
);
...
...
@@ -49,7 +46,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const
[
setPriceModal
,
setSetPriceModal
]
=
useState
(
false
)
const
[
ladderPrice
,
setLadderPrice
]
=
useState
(
false
)
const
[
curretSetPriceRow
,
setCurrentSetPriceRow
]
=
useState
<
any
>
()
// const [stateTableData, setStateTableData] = useState<any[]>()
const
[
combineAttributeArray
,
setCombineAttributeArray
]
=
useState
<
any
[]
>
([])
const
[
attributeObjArr
,
setAttributeObjArr
]
=
useState
<
any
[]
>
([])
const
[
attributeValObjArr
,
setAttributeValObjArr
]
=
useState
<
any
[]
>
([])
...
...
@@ -422,7 +418,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setPriceForm
.
resetFields
()
setLadderPrice
(
false
)
setPlanPrice
(
v
.
target
.
value
)
// priceTypeRef.current = v.target.value
}
const
setPriceOk
=
()
=>
{
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
150a2485
import
React
,
{
useState
,
useEffect
,
useRef
,
useContext
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Form
,
Select
,
Checkbox
,
Tabs
,
Input
,
DatePicker
}
from
'antd'
import
styles
from
'./index.less'
import
{
Form
,
Select
,
Checkbox
,
Tabs
,
Input
,
DatePicker
}
from
'antd'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
store
}
from
'@/store'
...
...
@@ -270,14 +269,6 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
)
}
</
Tabs
>
{
/* <Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
保存
</Button>
<Button className={styles.ml20}>
取消
</Button>
</Form.Item> */
}
</
Form
>
{
attributesData
?.
length
===
0
&&
<
span
style=
{
{
opacity
:
0.6
}
}
>
暂无数据!
</
span
>
}
</>)
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
150a2485
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Form
,
Select
,
Checkbox
,
message
,
Input
,
Tabl
e
,
Modal
,
Row
,
Col
,
Alert
,
Upload
,
Radio
}
from
'antd'
import
{
messag
e
,
Modal
,
Row
,
Col
,
Alert
,
Upload
,
Radio
}
from
'antd'
import
{
PlusOutlined
}
from
'@ant-design/icons'
import
CustomTabs
,
{
ItemPane
}
from
'@/components/CustomTabs'
import
styles
from
'./index.less'
import
{
UploadFile
,
UploadChangeParam
}
from
'antd/lib/upload/interface'
;
import
{
UploadFile
}
from
'antd/lib/upload/interface'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
{
inject
,
observer
}
from
'mobx-react'
...
...
@@ -36,12 +35,8 @@ const ProductImageForm: React.FC<{}> = (props) => {
// 编辑下 flag为false 不清空;编辑下 flag为true 新建清空
if
(
history
.
location
.
query
?.
id
&&
!
flagRef
.
current
)
{
flagRef
.
current
=
true
console
.
log
(
'不清空'
)
}
else
{
// constructImageListByRender([])
// setSetImageType(true)
onChangeSetImageType
({
target
:
{
value
:
true
}})
console
.
log
(
'清空'
)
}
},
[
selectCategoryId
])
...
...
src/pages/commodity/products/addProductsItem/selectGoodsForm.tsx
View file @
150a2485
import
React
,
{
useState
,
useEffect
,
use
Context
,
use
Ref
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Form
,
Select
,
Checkbox
}
from
'antd'
import
styles
from
'./index.less'
import
{
Form
,
Checkbox
}
from
'antd'
//
import styles from './index.less'
import
{
PublicApi
}
from
'@/services/api'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
...
...
@@ -20,11 +20,7 @@ const layout = {
},
}
export
interface
Iprops
{
}
const
SelectGoodsForm
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
SelectGoodsForm
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({})
const
[
selectGoodsForm
]
=
Form
.
useForm
()
const
[
isSelectGoods
,
setIsSelectGoods
]
=
useState
<
boolean
>
(
true
)
// 货品table显示隐藏
...
...
src/pages/transaction/transactionRules/addRule.tsx
View file @
150a2485
...
...
@@ -28,14 +28,15 @@ const AddRule:React.FC<{}> = (props) => {
// 整体表单提交
const
formSubmit
=
async
(
values
)
=>
{
setIsDisabled
(
true
)
values
.
products
=
values
.
products
.
map
(
item
=>
({
productId
:
item
.
id
,
commodityId
:
item
.
commodityId
,
name
:
item
.
name
,
customerCategoryName
:
item
.
customerCategoryName
,
priceType
:
item
.
priceType
,
brandName
:
item
.
brandName
}))
if
(
values
?.
products
)
values
.
products
=
values
.
products
.
map
(
item
=>
({
productId
:
item
.
id
,
commodityId
:
item
.
commodityId
,
name
:
item
.
name
,
customerCategoryName
:
item
.
customerCategoryName
,
priceType
:
item
.
priceType
,
brandName
:
item
.
brandName
}))
values
.
isElectronicContract
=
values
.
isElectronicContract
?
1
:
0
const
params
=
omit
(
values
,
[
'state'
])
// 移除不需要的字段
...
...
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