Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
7978af77
Commit
7978af77
authored
Feb 04, 2021
by
FE-安焕焕
👣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
售后地址设置和对账记录
parent
935d8070
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1329 additions
and
2 deletions
+1329
-2
config.js
config/config.js
+15
-0
env.config.js
config/env.config.js
+2
-2
form.jsx
src/pages/afterSaleAddress/form.jsx
+258
-0
index.jsx
src/pages/afterSaleAddress/index.jsx
+190
-0
index.less
src/pages/afterSaleAddress/index.less
+5
-0
model.js
src/pages/afterSaleAddress/model.js
+11
-0
services.js
src/pages/afterSaleAddress/services.js
+77
-0
index.jsx
src/pages/reconciliation/detail/index.jsx
+132
-0
modal.jsx
src/pages/reconciliation/detail/modal.jsx
+82
-0
form.jsx
src/pages/reconciliation/form.jsx
+265
-0
index.jsx
src/pages/reconciliation/index.jsx
+164
-0
index.less
src/pages/reconciliation/index.less
+5
-0
model.js
src/pages/reconciliation/model.js
+11
-0
services.js
src/pages/reconciliation/services.js
+112
-0
No files found.
config/config.js
View file @
7978af77
...
@@ -102,6 +102,21 @@ export default {
...
@@ -102,6 +102,21 @@ export default {
name
:
'
batchDeliveryOrder
'
,
name
:
'
batchDeliveryOrder
'
,
component
:
'
./orderManage/batchDelivery
'
,
component
:
'
./orderManage/batchDelivery
'
,
},
},
{
path
:
'
/afterSaleAddress
'
,
name
:
'
afterSaleAddress
'
,
component
:
'
./afterSaleAddress
'
,
},
{
path
:
'
/reconciliation
'
,
name
:
'
reconciliation
'
,
component
:
'
./reconciliation
'
,
},
{
path
:
'
/reconciliation/detail
'
,
name
:
'
reconciliationDetail
'
,
component
:
'
./reconciliation/detail/index
'
,
},
{
{
component
:
'
./404
'
,
component
:
'
./404
'
,
},
},
...
...
config/env.config.js
View file @
7978af77
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
let
envAPi
=
{
let
envAPi
=
{
api
:
'
//backstms-vcc
2
.liangkebang.net
'
,
api
:
'
//backstms-vcc
3
.liangkebang.net
'
,
// kdspApi: '//yapi.quantgroups.com/mock/351',
// kdspApi: '//yapi.quantgroups.com/mock/351',
// kdspApi: 'http://192.168.28.172:8042',
// kdspApi: 'http://192.168.28.172:8042',
kdspApi
:
'
https://kdsp-op
-vcc2
.liangkebang.net
'
,
kdspApi
:
'
https://kdsp-op
eration-vcc3
.liangkebang.net
'
,
};
};
let
prodApi
=
{
let
prodApi
=
{
...
...
src/pages/afterSaleAddress/form.jsx
0 → 100644
View file @
7978af77
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Form
,
Select
,
Input
,
notification
}
from
'
antd
'
;
import
_
from
'
lodash
'
;
import
{
addrQuery
,
update
}
from
'
./services
'
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
const
layout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
16
},
};
const
AddressForm
=
props
=>
{
const
{
visible
,
supplierList
}
=
props
;
const
[
formData
,
setFormData
]
=
useState
(()
=>
_
.
cloneDeep
(
props
.
value
));
const
[
provinceList
,
setProvinceList
]
=
useState
([]);
const
[
cityList
,
setCityList
]
=
useState
([]);
const
[
countyList
,
setCountyList
]
=
useState
([]);
const
[
townList
,
setTownList
]
=
useState
([]);
const
{
getFieldDecorator
}
=
props
.
form
;
const
areaData
=
[
{
name
:
'
省
'
,
key
:
'
province
'
,
child
:
'
city
'
,
data
:
provinceList
,
required
:
true
,
},
{
name
:
'
市
'
,
key
:
'
city
'
,
child
:
'
county
'
,
data
:
cityList
,
required
:
true
,
},
{
name
:
'
县
'
,
key
:
'
county
'
,
child
:
'
town
'
,
data
:
countyList
,
},
{
name
:
'
镇
'
,
key
:
'
town
'
,
child
:
''
,
data
:
townList
,
},
];
const
resetForm
=
()
=>
{
props
.
form
.
resetFields
();
setFormData
({});
};
const
onCancel
=
()
=>
{
props
.
onClose
();
resetForm
();
};
const
getAddr
=
async
(
val
,
type
,
edit
)
=>
{
const
data
=
await
addrQuery
({
parentId
:
val
?.
key
||
val
});
switch
(
type
)
{
case
'
city
'
:
setCityList
(
data
);
if
(
!
edit
)
{
setCountyList
([]);
setTownList
([]);
props
.
form
.
setFieldsValue
({
city
:
{
key
:
''
,
label
:
''
},
county
:
{
key
:
''
,
label
:
''
},
town
:
{
key
:
''
,
label
:
''
},
});
}
break
;
case
'
county
'
:
setCountyList
(
data
);
if
(
!
edit
)
{
setTownList
([]);
props
.
form
.
setFieldsValue
({
county
:
{
key
:
''
,
label
:
''
},
town
:
{
key
:
''
,
label
:
''
},
});
}
break
;
case
'
town
'
:
setTownList
(
data
);
if
(
!
edit
)
{
props
.
form
.
setFieldsValue
({
town
:
{
key
:
''
,
label
:
''
}
});
}
break
;
default
:
break
;
}
};
const
getFormData
=
()
=>
{
const
data
=
_
.
cloneDeep
(
props
.
value
);
if
(
data
.
id
)
{
getAddr
(
data
.
provinceId
,
'
city
'
,
'
edit
'
);
getAddr
(
data
.
cityId
,
'
county
'
,
'
edit
'
);
getAddr
(
data
.
countyId
,
'
town
'
,
'
edit
'
);
return
{
...
data
,
province
:
{
key
:
data
.
provinceId
??
null
,
label
:
data
.
provinceName
??
null
,
},
city
:
{
key
:
data
.
cityId
??
null
,
label
:
data
.
cityName
??
null
,
},
county
:
{
key
:
data
.
countyId
??
null
,
lable
:
data
.
countyName
??
null
,
},
town
:
{
key
:
data
.
townId
??
null
,
label
:
data
.
townName
??
null
,
},
};
}
return
data
;
};
useEffect
(()
=>
{
async
function
getProvince
()
{
const
data
=
await
addrQuery
();
setProvinceList
(
data
);
}
getProvince
();
setFormData
(()
=>
_
.
cloneDeep
(
getFormData
()));
},
[
props
.
value
]);
const
handleSubmit
=
()
=>
{
props
.
form
.
validateFields
(
async
(
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
const
{
province
=
{},
city
=
{},
county
=
{},
town
=
{}
}
=
fieldsValue
;
const
params
=
{
...
fieldsValue
,
provinceId
:
province
.
key
,
provinceName
:
province
.
label
,
cityId
:
city
.
key
,
cityName
:
city
.
label
,
countyId
:
county
.
key
,
countyName
:
county
.
label
,
townId
:
town
.
key
,
townName
:
town
.
label
,
id
:
formData
.
id
,
};
delete
params
.
province
;
delete
params
.
city
;
delete
params
.
county
;
delete
params
.
town
;
const
businessCode
=
await
update
(
params
);
if
(
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
操作成功
'
});
resetForm
();
props
.
onClose
(
'
success
'
);
}
});
};
return
(
<
Modal
title=
{
`${formData.id ? '修改' : '增加'}售后地址`
}
visible=
{
visible
}
onCancel=
{
()
=>
onCancel
()
}
onOk=
{
handleSubmit
}
>
<
Form
{
...
layout
}
name=
"formData"
>
<
FormItem
label=
"供应商名称"
>
{
getFieldDecorator
(
'
shopId
'
,
{
initialValue
:
formData
.
shopId
,
rules
:
[
{
required
:
true
,
message
:
'
请选择供应商名称!
'
,
},
],
})(
<
Select
showSearch
placeholder=
"请选择供应商名称"
allowClear
>
{
supplierList
.
map
(
item
=>
(
<
Option
value=
{
item
.
id
}
key=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>,
)
}
</
FormItem
>
{
areaData
.
map
(
area
=>
(
<
FormItem
label=
{
area
.
name
}
name=
{
area
.
key
}
key=
{
area
.
key
}
>
{
getFieldDecorator
(
area
.
key
,
{
initialValue
:
formData
[
area
.
key
],
rules
:
[
{
required
:
area
.
required
,
message
:
`请选择${area.name}!`
,
},
],
})(
<
Select
showSearch
placeholder=
{
`请选择${area.name}`
}
onChange=
{
val
=>
getAddr
(
val
,
area
.
child
)
}
labelInValue
allowClear
>
{
area
.
data
.
map
(
item
=>
(
<
Option
value=
{
item
.
addrId
}
key=
{
item
.
addrId
}
>
{
item
.
addrName
}
</
Option
>
))
}
</
Select
>,
)
}
</
FormItem
>
))
}
<
FormItem
label=
"详情地址"
>
{
getFieldDecorator
(
'
detail
'
,
{
initialValue
:
formData
.
detail
,
rules
:
[
{
required
:
true
,
message
:
'
请输入详情地址!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
label=
"联系人姓名"
>
{
getFieldDecorator
(
'
receiverName
'
,
{
initialValue
:
formData
.
receiverName
,
rules
:
[
{
required
:
true
,
message
:
'
请输入联系人姓名!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
label=
"联系人电话"
>
{
getFieldDecorator
(
'
receiverTel
'
,
{
initialValue
:
formData
.
receiverTel
,
rules
:
[
{
required
:
true
,
message
:
'
请输入联系人电话!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
label=
"备注"
>
{
getFieldDecorator
(
'
remark
'
,
{
initialValue
:
formData
.
remark
,
})(<
Input
/>)
}
</
FormItem
>
</
Form
>
</
Modal
>
);
};
export
default
Form
.
create
()(
AddressForm
);
src/pages/afterSaleAddress/index.jsx
0 → 100644
View file @
7978af77
import
{
Button
,
Select
,
Popconfirm
,
notification
}
from
'
antd
'
;
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
ProTable
from
'
@ant-design/pro-table
'
;
import
lodash
from
'
lodash
'
;
import
styles
from
'
./index.less
'
;
import
AddrForm
from
'
./form
'
;
import
{
del
,
query
,
supplier
}
from
'
./services
'
;
const
{
Option
}
=
Select
;
const
TableList
=
()
=>
{
const
[
supplierList
,
setSupplierList
]
=
useState
([]);
const
[
shopId
,
setShopId
]
=
useState
(
null
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
formValue
,
setFormValue
]
=
useState
({});
const
actionRef
=
useRef
();
useEffect
(()
=>
{
async
function
fetchData
()
{
const
data
=
await
supplier
();
setSupplierList
(
data
);
}
fetchData
();
},
[]);
const
changeSupplier
=
res
=>
{
setShopId
(
res
);
};
const
reload
=
type
=>
{
if
(
type
)
{
setShopId
(
null
);
}
actionRef
.
current
.
reload
();
};
const
delAction
=
async
({
id
})
=>
{
const
businessCode
=
await
del
(
id
);
if
(
businessCode
===
'
0000
'
)
{
reload
();
notification
.
success
({
message
:
'
删除成功!
'
});
}
};
const
editAction
=
async
row
=>
{
setFormValue
(()
=>
lodash
.
cloneDeep
(
row
));
setVisible
(
true
);
};
const
addAction
=
()
=>
{
setFormValue
({});
setVisible
(
true
);
};
const
onClose
=
res
=>
{
setVisible
(
false
);
if
(
res
)
{
reload
();
}
};
const
columns
=
[
{
title
:
'
供应商名称
'
,
dataIndex
:
'
shopId
'
,
key
:
'
shopId
'
,
hideInTable
:
true
,
valueType
:
'
select
'
,
renderFormItem
:
()
=>
(
<
Select
onChange=
{
changeSupplier
}
value=
{
shopId
}
allowClear
>
{
supplierList
.
map
(
item
=>
(
<
Option
value=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
),
},
{
title
:
'
供应商名称
'
,
dataIndex
:
'
supplierName
'
,
key
:
'
supplierName
'
,
hideInSearch
:
true
,
},
{
title
:
'
省
'
,
dataIndex
:
'
provinceName
'
,
key
:
'
provinceName
'
,
hideInSearch
:
true
,
width
:
100
,
},
{
title
:
'
市
'
,
dataIndex
:
'
cityName
'
,
key
:
'
cityName
'
,
hideInSearch
:
true
,
width
:
100
,
},
{
title
:
'
县
'
,
dataIndex
:
'
countyName
'
,
key
:
'
countyName
'
,
hideInSearch
:
true
,
width
:
100
,
},
{
title
:
'
镇
'
,
dataIndex
:
'
townName
'
,
key
:
'
townName
'
,
hideInSearch
:
true
,
width
:
100
,
},
{
title
:
'
详细地址
'
,
dataIndex
:
'
detail
'
,
key
:
'
detail
'
,
hideInSearch
:
true
,
},
{
title
:
'
收件人姓名
'
,
dataIndex
:
'
receiverName
'
,
key
:
'
receiverName
'
,
hideInSearch
:
true
,
width
:
150
,
},
{
title
:
'
收货人电话
'
,
dataIndex
:
'
receiverTel
'
,
key
:
'
receiverTel
'
,
hideInSearch
:
true
,
width
:
150
,
},
{
title
:
'
备注
'
,
dataIndex
:
'
remark
'
,
key
:
'
remark
'
,
hideInSearch
:
true
,
},
{
title
:
'
操作
'
,
dataIndex
:
'
option
'
,
key
:
'
option
'
,
valueType
:
'
option
'
,
render
:
(
_
,
row
)
=>
[
<
Button
key=
"edit"
type=
"primary"
onClick=
{
()
=>
{
editAction
(
row
);
}
}
>
修改
</
Button
>,
<
Popconfirm
placement=
"topLeft"
title=
"确定要删除吗?"
onConfirm=
{
()
=>
{
delAction
(
row
);
}
}
okText=
"删除"
cancelText=
"取消"
>
<
Button
key=
"del"
type=
"danger"
className=
{
styles
.
btn
}
>
删除
</
Button
>
</
Popconfirm
>,
],
},
];
return
(
<
PageHeaderWrapper
>
<
ProTable
className=
{
styles
.
protable
}
actionRef=
{
actionRef
}
columns=
{
columns
}
params=
{
{
shopId
}
}
request=
{
res
=>
query
(
res
)
}
rowKey=
"id"
bordered
scroll=
{
{
x
:
1500
}
}
toolBarRender=
{
()
=>
[
<
Button
key=
"3"
type=
"primary"
onClick=
{
addAction
}
>
添加售后地址
</
Button
>,
]
}
onReset=
{
()
=>
reload
(
'
reset
'
)
}
/>
<
AddrForm
visible=
{
visible
}
supplierList=
{
supplierList
}
value=
{
formValue
}
onClose=
{
onClose
}
></
AddrForm
>
</
PageHeaderWrapper
>
);
};
export
default
TableList
;
src/pages/afterSaleAddress/index.less
0 → 100644
View file @
7978af77
.protable {
table {
margin: 20px;
}
}
src/pages/afterSaleAddress/model.js
0 → 100644
View file @
7978af77
const
Model
=
{
namespace
:
'
afterSale
'
,
state
:
{
tableData
:
[],
typeList
:
[],
organizationList
:
[],
},
effects
:
{},
reducers
:
{},
};
export
default
Model
;
src/pages/afterSaleAddress/services.js
0 → 100644
View file @
7978af77
import
{
stringify
}
from
'
querystring
'
;
import
_
from
'
lodash
'
;
import
request
from
'
@/utils/request
'
;
import
config
from
'
../../../config/env.config
'
;
// 查询
export
async
function
query
(
params
)
{
const
tempParams
=
{
...
params
,
pageNo
:
params
.
current
,
};
delete
tempParams
.
current
;
try
{
const
{
data
:
{
current
,
records
,
total
,
size
},
}
=
await
request
.
post
(
'
/api/kdsp/supplier/after-sales-addrs-page
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
(
_
.
omitBy
(
tempParams
,
v
=>
!
v
)),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
{
current
,
data
:
records
.
map
(
v
=>
({
...
v
,
logisticsStatus
:
`_
${
v
.
logisticsStatus
}
`
})),
total
,
pageSize
:
size
,
};
}
catch
(
error
)
{
return
{};
}
}
export
async
function
supplier
()
{
const
{
data
}
=
await
request
.
get
(
'
/api/kdsp/supplier/supplier-list-query
'
,
{
prefix
:
config
.
kdspApi
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
data
;
}
export
async
function
del
(
id
)
{
const
{
businessCode
}
=
await
request
.
post
(
'
/api/kdsp/supplier/after-sales-addrs-delete
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
({
id
}),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
businessCode
;
}
export
async
function
update
(
params
)
{
const
{
businessCode
}
=
await
request
.
post
(
'
/api/kdsp/supplier/after-sales-addrs-save-or-update
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
(
params
),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
},
);
return
businessCode
;
}
export
async
function
addrQuery
(
params
)
{
const
{
data
}
=
await
request
.
get
(
'
/api/kdsp/area/addr/query
'
,
{
prefix
:
config
.
kdspApi
,
params
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
data
;
}
src/pages/reconciliation/detail/index.jsx
0 → 100644
View file @
7978af77
import
{
Button
}
from
'
antd
'
;
import
React
,
{
useRef
,
useState
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
ProTable
from
'
@ant-design/pro-table
'
;
import
styles
from
'
../index.less
'
;
import
ActionModal
from
'
./modal
'
;
import
{
detailQuery
}
from
'
../services
'
;
const
TableList
=
props
=>
{
const
[
visibleModal
,
setVisibleModal
]
=
useState
(
false
);
const
[
modalValue
,
setModalValue
]
=
useState
({});
const
{
batchNo
}
=
props
.
location
.
query
;
const
actionRef
=
useRef
();
const
reload
=
()
=>
{
actionRef
.
current
.
reload
();
};
const
onClose
=
type
=>
{
if
(
type
)
{
reload
();
}
setVisibleModal
(
false
);
};
const
openAction
=
row
=>
{
setModalValue
(()
=>
row
);
setVisibleModal
(
true
);
};
const
columns
=
[
{
title
:
'
订单号
'
,
dataIndex
:
'
orderNo
'
,
key
:
'
orderNo
'
,
hideInSearch
:
true
,
},
{
title
:
'
京东订单号
'
,
dataIndex
:
'
jdOrderId
'
,
key
:
'
jdOrderId
'
,
hideInSearch
:
true
,
},
{
title
:
'
售后单号
'
,
dataIndex
:
'
afterServiceNo
'
,
key
:
'
afterServiceNo
'
,
hideInSearch
:
true
,
},
{
title
:
'
我方交易金额
'
,
dataIndex
:
'
ownTradeAmount
'
,
key
:
'
ownTradeAmount
'
,
hideInSearch
:
true
,
},
{
title
:
'
三方交易金额
'
,
dataIndex
:
'
thirdTradeAmount
'
,
key
:
'
thirdTradeAmount
'
,
hideInSearch
:
true
,
},
{
title
:
'
交易类型
'
,
dataIndex
:
'
tradeType
'
,
key
:
'
tradeType
'
,
hideInSearch
:
true
,
valueEnum
:
{
1
:
'
订单支付
'
,
2
:
'
取消订单退款
'
,
3
:
'
售后退款
'
,
},
},
{
title
:
'
交易日期
'
,
dataIndex
:
'
tradeDate
'
,
key
:
'
tradeDate
'
,
hideInSearch
:
true
,
},
{
title
:
'
状态
'
,
dataIndex
:
'
status
'
,
key
:
'
status
'
,
valueEnum
:
{
1
:
'
平
'
,
2
:
'
不平
'
,
},
},
{
title
:
'
备注信息
'
,
dataIndex
:
'
remarks
'
,
key
:
'
remarks
'
,
hideInSearch
:
true
,
},
{
title
:
'
操作
'
,
dataIndex
:
'
townName
'
,
key
:
'
townName
'
,
hideInSearch
:
true
,
render
:
(
_
,
row
)
=>
[
<
Button
key=
"edit"
type=
"primary"
onClick=
{
()
=>
{
openAction
(
row
);
}
}
>
补齐
</
Button
>,
],
},
];
return
(
<
PageHeaderWrapper
>
<
ProTable
className=
{
styles
.
protable
}
actionRef=
{
actionRef
}
columns=
{
columns
}
params=
{
{
batchNo
}
}
request=
{
res
=>
detailQuery
(
res
)
}
rowKey=
"id"
bordered
scroll=
{
{
x
:
1500
}
}
search=
{
{
collapsed
:
false
,
}
}
/>
<
ActionModal
visible=
{
visibleModal
}
formData=
{
modalValue
}
onClose=
{
onClose
}
></
ActionModal
>
</
PageHeaderWrapper
>
);
};
export
default
TableList
;
src/pages/reconciliation/detail/modal.jsx
0 → 100644
View file @
7978af77
import
React
from
'
react
'
;
import
{
Modal
,
Form
,
Select
,
Input
,
notification
}
from
'
antd
'
;
import
{
updateStatus
}
from
'
../services
'
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
const
layout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
16
},
};
const
valueEnum
=
[
{
status
:
1
,
text
:
'
平
'
,
},
{
status
:
2
,
text
:
'
不平
'
,
},
];
const
StatusForm
=
props
=>
{
const
{
visible
,
formData
}
=
props
;
const
{
getFieldDecorator
}
=
props
.
form
;
const
resetForm
=
()
=>
{
props
.
form
.
resetFields
();
};
const
onCancel
=
()
=>
{
props
.
onClose
();
resetForm
();
};
const
handleSubmit
=
()
=>
{
props
.
form
.
validateFields
(
async
(
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
const
params
=
{
...
fieldsValue
,
id
:
formData
.
id
,
};
const
businessCode
=
await
updateStatus
(
params
);
if
(
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
操作成功
'
});
resetForm
();
props
.
onClose
(
'
success
'
);
}
});
};
return
(
<
Modal
title=
"对账手动补齐"
visible=
{
visible
}
onCancel=
{
()
=>
onCancel
()
}
onOk=
{
handleSubmit
}
>
<
Form
{
...
layout
}
name=
"formData"
>
<
FormItem
label=
"状态"
>
{
getFieldDecorator
(
'
status
'
,
{
initialValue
:
formData
.
status
,
rules
:
[
{
required
:
true
,
message
:
'
请选择状态!
'
,
},
],
})(
<
Select
showSearch
placeholder=
""
>
{
valueEnum
.
map
(
item
=>
(
<
Option
value=
{
item
.
status
}
key=
{
item
.
status
}
>
{
item
.
text
}
</
Option
>
))
}
</
Select
>,
)
}
</
FormItem
>
<
FormItem
label=
"备注"
>
{
getFieldDecorator
(
'
remarks
'
,
{
initialValue
:
formData
.
remarks
,
})(<
Input
/>)
}
</
FormItem
>
</
Form
>
</
Modal
>
);
};
export
default
Form
.
create
()(
StatusForm
);
src/pages/reconciliation/form.jsx
0 → 100644
View file @
7978af77
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Form
,
Select
,
Input
,
notification
}
from
'
antd
'
;
import
_
from
'
lodash
'
;
import
{
update
}
from
'
./services
'
;
import
{
addrQuery
}
from
'
../afterSaleAddress/services
'
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
const
layout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
16
},
};
const
AddressForm
=
props
=>
{
const
{
visible
,
supplierList
}
=
props
;
const
[
formData
,
setFormData
]
=
useState
(()
=>
_
.
cloneDeep
(
props
.
value
));
const
[
provinceList
,
setProvinceList
]
=
useState
([]);
const
[
cityList
,
setCityList
]
=
useState
([]);
const
[
countyList
,
setCountyList
]
=
useState
([]);
const
[
townList
,
setTownList
]
=
useState
([]);
const
{
getFieldDecorator
}
=
props
.
form
;
const
areaData
=
[
{
name
:
'
省
'
,
key
:
'
province
'
,
child
:
'
city
'
,
data
:
provinceList
,
required
:
true
,
},
{
name
:
'
市
'
,
key
:
'
city
'
,
child
:
'
county
'
,
data
:
cityList
,
required
:
true
,
},
{
name
:
'
县
'
,
key
:
'
county
'
,
child
:
'
town
'
,
data
:
countyList
,
},
{
name
:
'
镇
'
,
key
:
'
town
'
,
child
:
''
,
data
:
townList
,
},
];
const
resetForm
=
()
=>
{
props
.
form
.
resetFields
();
setFormData
({});
};
const
onCancel
=
()
=>
{
props
.
onClose
();
resetForm
();
};
const
getAddr
=
async
(
val
,
type
,
edit
)
=>
{
const
data
=
await
addrQuery
({
parentId
:
val
?.
key
||
val
});
switch
(
type
)
{
case
'
city
'
:
setCityList
(
data
);
if
(
!
edit
)
{
setCountyList
([]);
setTownList
([]);
props
.
form
.
setFieldsValue
({
city
:
{
key
:
''
,
label
:
''
},
county
:
{
key
:
''
,
label
:
''
},
town
:
{
key
:
''
,
label
:
''
},
});
}
break
;
case
'
county
'
:
setCountyList
(
data
);
if
(
!
edit
)
{
setTownList
([]);
props
.
form
.
setFieldsValue
({
county
:
{
key
:
''
,
label
:
''
},
town
:
{
key
:
''
,
label
:
''
},
});
}
break
;
case
'
town
'
:
setTownList
(
data
);
if
(
!
edit
)
{
props
.
form
.
setFieldsValue
({
town
:
{
key
:
''
,
label
:
''
}
});
}
break
;
default
:
break
;
}
};
const
getFormData
=
()
=>
{
const
data
=
_
.
cloneDeep
(
props
.
value
);
if
(
data
.
id
)
{
getAddr
(
data
.
provinceId
,
'
city
'
,
'
edit
'
);
getAddr
(
data
.
cityId
,
'
county
'
,
'
edit
'
);
getAddr
(
data
.
countyId
,
'
town
'
,
'
edit
'
);
return
{
...
data
,
province
:
{
key
:
data
.
provinceId
??
null
,
label
:
data
.
provinceName
??
null
,
},
city
:
{
key
:
data
.
cityId
??
null
,
label
:
data
.
cityName
??
null
,
},
county
:
{
key
:
data
.
countyId
??
null
,
lable
:
data
.
countyName
??
null
,
},
town
:
{
key
:
data
.
townId
??
null
,
label
:
data
.
townName
??
null
,
},
};
}
return
data
;
};
useEffect
(()
=>
{
async
function
getProvince
()
{
const
data
=
await
addrQuery
();
setProvinceList
(
data
);
}
getProvince
();
setFormData
(()
=>
_
.
cloneDeep
(
getFormData
()));
},
[
props
.
value
]);
const
handleSubmit
=
()
=>
{
props
.
form
.
validateFields
(
async
(
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
const
{
province
=
{},
city
=
{},
county
=
{},
town
=
{}
}
=
fieldsValue
;
const
params
=
{
...
fieldsValue
,
provinceId
:
province
.
key
,
provinceName
:
province
.
label
,
cityId
:
city
.
key
,
cityName
:
city
.
label
,
countyId
:
county
.
key
,
countyName
:
county
.
label
,
townId
:
town
.
key
,
townName
:
town
.
label
,
id
:
formData
.
id
,
};
delete
params
.
province
;
delete
params
.
city
;
delete
params
.
county
;
delete
params
.
town
;
const
businessCode
=
await
update
(
params
);
if
(
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
操作成功
'
});
resetForm
();
props
.
onClose
(
'
success
'
);
}
});
};
return
(
<
Modal
title=
{
`${formData.id ? '修改' : '增加'}售后地址`
}
visible=
{
visible
}
onCancel=
{
()
=>
onCancel
()
}
onOk=
{
handleSubmit
}
>
<
Form
{
...
layout
}
name=
"formData"
>
<
FormItem
label=
"供应商名称"
>
{
getFieldDecorator
(
'
shopId
'
,
{
initialValue
:
formData
.
shopId
,
rules
:
[
{
required
:
true
,
message
:
'
请选择供应商名称!
'
,
},
],
})(
<
Select
showSearch
placeholder=
"请选择供应商名称"
allowClear
>
{
supplierList
.
map
(
item
=>
(
<
Option
value=
{
item
.
id
}
key=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>,
)
}
</
FormItem
>
{
areaData
.
map
(
area
=>
(
<
FormItem
label=
{
area
.
name
}
name=
{
area
.
key
}
key=
{
area
.
key
}
>
{
getFieldDecorator
(
area
.
key
,
{
initialValue
:
formData
[
area
.
key
],
rules
:
[
{
required
:
area
.
required
,
message
:
`请选择${area.name}!`
,
},
],
})(
<
Select
showSearch
placeholder=
{
`请选择${area.name}`
}
onChange=
{
val
=>
getAddr
(
val
,
area
.
child
)
}
labelInValue
allowClear
>
{
area
.
data
.
map
(
item
=>
(
<
Option
value=
{
item
.
addrId
}
key=
{
item
.
addrId
}
>
{
item
.
addrName
}
</
Option
>
))
}
</
Select
>,
)
}
</
FormItem
>
))
}
<
FormItem
label=
"详情地址"
>
{
getFieldDecorator
(
'
detail
'
,
{
initialValue
:
formData
.
detail
,
rules
:
[
{
required
:
true
,
message
:
'
请输入详情地址!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
label=
"联系人姓名"
>
{
getFieldDecorator
(
'
receiverName
'
,
{
initialValue
:
formData
.
receiverName
,
rules
:
[
{
required
:
true
,
message
:
'
请输入联系人姓名!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
label=
"联系人电话"
>
{
getFieldDecorator
(
'
receiverTel
'
,
{
initialValue
:
formData
.
receiverTel
,
rules
:
[
{
required
:
true
,
message
:
'
请输入联系人电话!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
label=
"备注"
>
{
getFieldDecorator
(
'
remark
'
,
{
initialValue
:
formData
.
remark
,
rules
:
[
{
required
:
true
,
message
:
'
请输入备注!
'
,
},
],
})(<
Input
/>)
}
</
FormItem
>
</
Form
>
</
Modal
>
);
};
export
default
Form
.
create
()(
AddressForm
);
src/pages/reconciliation/index.jsx
0 → 100644
View file @
7978af77
import
{
Button
,
Select
}
from
'
antd
'
;
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
ProTable
from
'
@ant-design/pro-table
'
;
import
Link
from
'
umi/link
'
;
import
styles
from
'
./index.less
'
;
import
{
query
,
supplier
,
downDetail
}
from
'
./services
'
;
const
{
Option
}
=
Select
;
const
TableList
=
()
=>
{
const
[
supplierList
,
setSupplierList
]
=
useState
([]);
const
[
shopId
,
setShopId
]
=
useState
(
null
);
const
actionRef
=
useRef
();
useEffect
(()
=>
{
async
function
fetchData
()
{
const
data
=
await
supplier
();
setSupplierList
(
data
);
}
fetchData
();
},
[]);
const
changeSupplier
=
res
=>
{
setShopId
(
res
);
};
const
reload
=
type
=>
{
if
(
type
)
{
setShopId
(
null
);
}
actionRef
.
current
.
reload
();
};
const
down
=
({
batchNo
})
=>
{
downDetail
({
batchNo
});
};
const
columns
=
[
{
title
:
'
对账批次号
'
,
dataIndex
:
'
batchNo
'
,
key
:
'
batchNo
'
,
hideInSearch
:
true
,
},
{
title
:
'
交易日期
'
,
dataIndex
:
'
tradeDate
'
,
key
:
'
tradeDate
'
,
hideInSearch
:
true
,
},
{
title
:
'
交易日期
'
,
dataIndex
:
'
dateRange
'
,
key
:
'
dateRange
'
,
valueType
:
'
dateRange
'
,
hideInTable
:
true
,
},
{
title
:
'
供应商名称
'
,
dataIndex
:
'
shopId
'
,
key
:
'
shopId
'
,
hideInTable
:
true
,
valueType
:
'
select
'
,
renderFormItem
:
()
=>
(
<
Select
onChange=
{
changeSupplier
}
value=
{
shopId
}
allowClear
>
{
supplierList
.
map
(
item
=>
(
<
Option
value=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
),
},
{
title
:
'
供应商名称
'
,
dataIndex
:
'
supplierName
'
,
key
:
'
supplierName
'
,
hideInSearch
:
true
,
},
{
title
:
'
我方对账条数
'
,
dataIndex
:
'
ownCount
'
,
key
:
'
ownCount
'
,
hideInSearch
:
true
,
},
{
title
:
'
三方对账条数
'
,
dataIndex
:
'
thirdCount
'
,
key
:
'
thirdCount
'
,
hideInSearch
:
true
,
},
{
title
:
'
对账成功条数
'
,
dataIndex
:
'
succCount
'
,
key
:
'
succCount
'
,
hideInSearch
:
true
,
},
{
title
:
'
对账状态
'
,
dataIndex
:
'
status
'
,
key
:
'
status
'
,
valueEnum
:
{
1
:
'
平
'
,
2
:
'
不平
'
,
},
},
{
title
:
'
操作
'
,
dataIndex
:
'
option
'
,
key
:
'
option
'
,
valueType
:
'
option
'
,
width
:
120
,
render
:
(
_
,
row
)
=>
[
<
Link
to=
{
{
pathname
:
'
/reconciliation/detail
'
,
query
:
{
batchNo
:
row
.
batchNo
,
},
}
}
>
<
Button
key=
"edit"
type=
"primary"
>
查看详情
</
Button
>
</
Link
>,
],
},
{
title
:
'
下载
'
,
dataIndex
:
'
townName
'
,
key
:
'
townName
'
,
width
:
100
,
hideInSearch
:
true
,
render
:
(
_
,
row
)
=>
[
<
Button
key=
"edit"
type=
"primary"
onClick=
{
()
=>
{
down
(
row
);
}
}
>
下载
</
Button
>,
],
},
];
return
(
<
PageHeaderWrapper
>
<
ProTable
className=
{
styles
.
protable
}
actionRef=
{
actionRef
}
columns=
{
columns
}
params=
{
{
shopId
}
}
request=
{
res
=>
query
(
res
)
}
rowKey=
"id"
bordered
scroll=
{
{
x
:
1500
}
}
search=
{
{
collapsed
:
false
,
}
}
onReset=
{
()
=>
reload
(
'
reset
'
)
}
/>
</
PageHeaderWrapper
>
);
};
export
default
TableList
;
src/pages/reconciliation/index.less
0 → 100644
View file @
7978af77
.protable {
table {
margin: 20px;
}
}
src/pages/reconciliation/model.js
0 → 100644
View file @
7978af77
const
Model
=
{
namespace
:
'
reconciliation
'
,
state
:
{
tableData
:
[],
typeList
:
[],
organizationList
:
[],
},
effects
:
{},
reducers
:
{},
};
export
default
Model
;
src/pages/reconciliation/services.js
0 → 100644
View file @
7978af77
import
{
stringify
}
from
'
querystring
'
;
import
_
from
'
lodash
'
;
import
request
from
'
@/utils/request
'
;
import
{
saveAs
}
from
'
file-saver
'
;
import
{
format
}
from
'
date-fns
'
;
import
config
from
'
../../../config/env.config
'
;
// 查询
export
async
function
query
(
params
)
{
const
tempParams
=
{
...
params
,
startDate
:
params
.
dateRange
?.[
0
],
endDate
:
params
.
dateRange
?.[
1
],
pageNo
:
params
.
current
,
};
delete
tempParams
.
dateRange
;
delete
tempParams
.
current
;
try
{
const
{
data
:
{
current
,
records
,
total
,
size
},
}
=
await
request
.
post
(
'
/api/kdsp/account/account-verify-record-page
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
(
_
.
omitBy
(
tempParams
,
v
=>
!
v
)),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
{
current
,
data
:
records
.
map
(
v
=>
({
...
v
,
logisticsStatus
:
`_
${
v
.
logisticsStatus
}
`
})),
total
,
pageSize
:
size
,
};
}
catch
(
error
)
{
return
{};
}
}
export
async
function
supplier
()
{
const
{
data
}
=
await
request
.
get
(
'
/api/kdsp/supplier/supplier-list-query
'
,
{
prefix
:
config
.
kdspApi
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
data
;
}
export
async
function
downDetail
(
params
)
{
const
data
=
await
request
.
get
(
'
/api/kdsp/account/account-verify-detail-downLoad
'
,
{
params
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
prefix
:
config
.
kdspApi
,
responseType
:
'
arrayBuffer
'
,
});
const
blob
=
new
Blob
([
data
]);
saveAs
(
blob
,
`对账明细-
${
format
(
new
Date
(),
'
yyyyMMddHHmmss
'
)}
.xlsx`
);
}
export
async
function
detailQuery
(
params
)
{
const
tempParams
=
{
...
params
,
pageNo
:
params
.
current
,
};
delete
tempParams
.
current
;
try
{
const
{
data
:
{
current
,
records
,
total
,
size
},
}
=
await
request
.
post
(
'
/api/kdsp/account/account-verify-detail-page
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
(
_
.
omitBy
(
tempParams
,
v
=>
!
v
)),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
{
current
,
data
:
records
.
map
(
v
=>
({
...
v
,
logisticsStatus
:
`_
${
v
.
logisticsStatus
}
`
})),
total
,
pageSize
:
size
,
};
}
catch
(
error
)
{
return
{};
}
}
export
async
function
updateStatus
(
params
)
{
const
{
businessCode
}
=
await
request
.
post
(
'
/api/kdsp/account/account-verify-detail-update
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
(
params
),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
});
return
businessCode
;
}
export
async
function
update
(
params
)
{
const
{
businessCode
}
=
await
request
.
post
(
'
/api/kdsp/supplier/after-sales-addrs-save-or-update
'
,
{
prefix
:
config
.
kdspApi
,
data
:
stringify
(
params
),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
},
);
return
businessCode
;
}
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