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
6b94933d
Commit
6b94933d
authored
Apr 12, 2023
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 去掉不用代码
parent
6bf50182
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
153 deletions
+69
-153
index.jsx
src/pages/businessManage/info/index.jsx
+69
-109
service.js
src/pages/businessManage/service.js
+0
-4
staticdata.js
src/pages/businessManage/staticdata.js
+0
-40
No files found.
src/pages/businessManage/info/index.jsx
View file @
6b94933d
...
...
@@ -39,14 +39,7 @@ import {
import
{
validatePhone
,
validateEMail
,
validNumber
}
from
'
@/utils/validator
'
;
import
{
getErrorMessage
}
from
'
@/utils/utils
'
;
import
MapModal
from
'
@/components/BaiduMap
'
;
import
{
apiCategoryList
,
apiEditStoreInfo
,
apiRecognize
,
apiRevision
}
from
'
../service
'
;
import
{
infoTypeFind
,
infoTypeChecked
,
infoTypeEdit
,
infoTypeRevision
,
infoTypeInfo
,
}
from
'
../staticdata
'
;
import
{
apiCategoryList
,
apiEditStoreInfo
,
apiRecognize
}
from
'
../service
'
;
const
{
Option
}
=
Select
;
const
{
Item
:
FormItem
}
=
Form
;
...
...
@@ -61,7 +54,6 @@ class BusinessInfo extends Component {
state
=
{
id
:
null
,
type
:
infoTypeFind
,
businessInfo
:
{
customList
:
[],
settlementType
:
1
,
...
...
@@ -71,15 +63,9 @@ class BusinessInfo extends Component {
categoryList
:
[],
// 主要类目
serviceFacilitys
:
[],
// 服务设施
bankList
:
[],
// 开户行
// eslint-disable-next-line react/no-unused-state
tagVisible
:
false
,
// eslint-disable-next-line react/no-unused-state
tagValue
:
''
,
settlementType
:
1
,
loading
:
false
,
visibleMap
:
false
,
visibleLoading
:
false
,
calculateType
:
[
1
,
1
],
checkboxDisabled
:
false
,
mainCategoryId
:
null
,
companyNamedis
:
false
,
// 公司名称
...
...
@@ -111,14 +97,6 @@ class BusinessInfo extends Component {
});
};
// eslint-disable-next-line react/sort-comp
getDataInfo
=
type
=>
({
key
:
type
,
name
:
businessTypeDesc
[
type
],
chargeMethod
:
1
,
calculateType
:
1
,
});
// 计费类型改变
onChangeCalculateType
=
(
e
,
i
)
=>
{
this
.
setState
(
state
=>
{
...
...
@@ -159,68 +137,12 @@ class BusinessInfo extends Component {
});
};
// 处理图片
dealImgInfo
=
async
(
type
,
url
)
=>
{
const
imgType
=
{
businessLicenseImage
:
2
,
idCardPortraitImage
:
5
,
idCardEmblemImage
:
4
,
};
if
(
!
url
)
{
return
;
}
this
.
setState
({
visibleLoading
:
true
,
});
const
data
=
await
apiRecognize
({
imageUrl
:
url
,
imageType
:
imgType
[
type
],
});
if
(
data
.
businessCode
===
'
0000
'
)
{
const
res
=
data
.
data
;
const
info
=
{};
this
.
setState
(
state
=>
{
if
(
type
===
'
businessLicenseImage
'
)
{
info
.
socialCode
=
res
.
socialCode
||
''
;
info
.
companyName
=
res
.
companyName
||
''
;
info
.
businessLicensePeriod
=
res
.
businessLicensePeriod
?
moment
(
res
.
businessLicensePeriod
)
:
''
;
}
else
if
(
type
===
'
idCardPortraitImage
'
)
{
info
.
legalPersonName
=
res
.
legalPersonName
||
''
;
info
.
legalPersonIdCard
=
res
.
legalPersonIdCard
||
''
;
}
else
if
(
type
===
'
idCardEmblemImage
'
&&
res
.
legalPersonPeriod
)
{
// 身份证有效期处理
const
date
=
res
.
legalPersonPeriod
.
split
(
'
-
'
)
||
[];
info
.
legalPersonStart
=
date
[
0
]
&&
moment
(
date
[
0
]);
info
.
legalPersonEnd
=
date
[
1
]
&&
date
[
1
]
!==
'
长期
'
?
moment
(
date
[
1
])
:
''
;
info
.
checked
=
date
[
1
]
&&
date
[
1
]
===
'
长期
'
?
[
'
长期
'
]
:
[];
const
checkboxDisabled
=
date
[
1
]
&&
date
[
1
]
===
'
长期
'
;
this
.
setState
({
checkboxDisabled
,
});
// info.legalPersonPeriod = res.legalPersonPeriod
// .replace(/\./g, '/')
// .split('-')
// .map(o => moment(o));
}
return
{
businessInfo
:
Object
.
assign
(
state
.
businessInfo
,
info
),
};
});
this
.
props
.
form
.
setFieldsValue
({
...
info
,
});
}
else
{
notification
.
error
({
message
:
data
.
msg
});
}
this
.
setState
({
visibleLoading
:
false
,
});
};
/* eslint-disable no-return-assign */
saveInputRef
=
input
=>
(
this
.
input
=
input
);
// 获取主营类目
async
getCategoryList
(
e
)
{
const
data
=
await
apiCategoryList
(
e
);
if
(
!
data
.
data
)
return
;
this
.
setState
({
categoryList
:
data
.
data
});
}
// 返回
onCancel
=
()
=>
{
...
...
@@ -338,19 +260,6 @@ class BusinessInfo extends Component {
}
};
openMap
(
e
,
disabled
)
{
if
(
!
disabled
)
{
this
.
setState
({
visibleMap
:
e
,
});
}
}
// eslint-disable-next-line class-methods-use-this
disabledDate
(
current
)
{
return
current
&&
current
<
moment
(
moment
().
format
(
'
YYYY-MM-DD
'
));
}
onChangeBusinessModel
=
e
=>
{
this
.
getCategoryList
(
e
);
this
.
props
.
form
.
setFieldsValue
({
...
...
@@ -358,12 +267,68 @@ class BusinessInfo extends Component {
});
};
// 获取主营类目
async
getCategoryList
(
e
)
{
const
data
=
await
apiCategoryList
(
e
);
if
(
!
data
.
data
)
return
;
this
.
setState
({
categoryList
:
data
.
data
});
}
/* eslint-disable no-return-assign */
saveInputRef
=
input
=>
(
this
.
input
=
input
);
// 处理图片
dealImgInfo
=
async
(
type
,
url
)
=>
{
const
imgType
=
{
businessLicenseImage
:
2
,
idCardPortraitImage
:
5
,
idCardEmblemImage
:
4
,
};
if
(
!
url
)
{
return
;
}
this
.
setState
({
visibleLoading
:
true
,
});
const
data
=
await
apiRecognize
({
imageUrl
:
url
,
imageType
:
imgType
[
type
],
});
if
(
data
.
businessCode
===
'
0000
'
)
{
const
res
=
data
.
data
;
const
info
=
{};
this
.
setState
(
state
=>
{
if
(
type
===
'
businessLicenseImage
'
)
{
info
.
socialCode
=
res
.
socialCode
||
''
;
info
.
companyName
=
res
.
companyName
||
''
;
info
.
businessLicensePeriod
=
res
.
businessLicensePeriod
?
moment
(
res
.
businessLicensePeriod
)
:
''
;
}
else
if
(
type
===
'
idCardPortraitImage
'
)
{
info
.
legalPersonName
=
res
.
legalPersonName
||
''
;
info
.
legalPersonIdCard
=
res
.
legalPersonIdCard
||
''
;
}
else
if
(
type
===
'
idCardEmblemImage
'
&&
res
.
legalPersonPeriod
)
{
// 身份证有效期处理
const
date
=
res
.
legalPersonPeriod
.
split
(
'
-
'
)
||
[];
info
.
legalPersonStart
=
date
[
0
]
&&
moment
(
date
[
0
]);
info
.
legalPersonEnd
=
date
[
1
]
&&
date
[
1
]
!==
'
长期
'
?
moment
(
date
[
1
])
:
''
;
info
.
checked
=
date
[
1
]
&&
date
[
1
]
===
'
长期
'
?
[
'
长期
'
]
:
[];
const
checkboxDisabled
=
date
[
1
]
&&
date
[
1
]
===
'
长期
'
;
this
.
setState
({
checkboxDisabled
,
});
// info.legalPersonPeriod = res.legalPersonPeriod
// .replace(/\./g, '/')
// .split('-')
// .map(o => moment(o));
}
return
{
businessInfo
:
Object
.
assign
(
state
.
businessInfo
,
info
),
};
});
this
.
props
.
form
.
setFieldsValue
({
...
info
,
});
}
else
{
notification
.
error
({
message
:
data
.
msg
});
}
this
.
setState
({
visibleLoading
:
false
,
});
};
render
()
{
const
{
...
...
@@ -1165,11 +1130,6 @@ class BusinessInfo extends Component {
</
Button
>
</
div
>
</
Form
>
<
MapModal
visible=
{
this
.
state
.
visibleMap
}
onCancel=
{
()
=>
this
.
openMap
(
false
)
}
onSetPoint=
{
e
=>
this
.
onSetPoint
(
e
)
}
></
MapModal
>
{
this
.
state
.
visibleLoading
&&
(
<
div
className=
{
styles
.
spinBox
}
>
<
div
className=
{
styles
.
spinBoxWrapper
}
>
...
...
src/pages/businessManage/service.js
View file @
6b94933d
...
...
@@ -26,10 +26,6 @@ export const apiServiceFacility = () =>
export
const
apiBankList
=
()
=>
request
.
get
(
'
/api/merchants/suppliers/banks/list
'
,
{
prefix
:
kdspApi
});
// 订正
export
const
apiRevision
=
params
=>
request
.
post
(
'
/api/consoles/suppliers/register/revision
'
,
{
prefix
:
kdspApi
,
data
:
params
});
/**
* 上传文件
* imageType: 1-主头图,2-营业执照,3-电子签章,4-法人身份证国徽面,5-法人身份证人像面,6-类目所需资质,7-其它证件,8-开户许可证
...
...
src/pages/businessManage/staticdata.js
deleted
100644 → 0
View file @
6bf50182
import
{
Button
,
Popconfirm
}
from
'
antd
'
;
import
React
from
'
react
'
;
// import router from 'umi/router';
import
{
history
}
from
'
umi
'
;
// 状态:0-填写未完成,1-待审核,2-待易宝入网,3-易宝入网中,4-待易宝签约,5-待平台签约,6-完成,7-驳回
export
const
checkStatus
=
{
// 0: { text: '填写未完成' },
1
:
{
text
:
'
待审核
'
},
// 2: { text: '待易宝入网' },
3
:
{
text
:
'
易宝入网中
'
},
4
:
{
text
:
'
待易宝签约
'
},
5
:
{
text
:
'
待平台签约
'
},
// 6: { text: '完成' },
// 7: { text: '驳回' },
};
// 详情类型
export
const
infoTypeFind
=
'
find
'
;
// 查看
export
const
infoTypeChecked
=
'
checked
'
;
// 审核
export
const
infoTypeEdit
=
'
edit
'
;
// 编辑
export
const
infoTypeRevision
=
'
revision
'
;
// 订正
export
const
infoTypeInfo
=
'
info
'
;
// 审核之后查看
export
const
infoTypeAdd
=
'
add
'
;
// 添加
// 商户类型
export
const
supplierType
=
{
pop
:
{
text
:
'
POP商户
'
},
供应商
:
{
text
:
'
供应商
'
},
};
export
const
toInfo
=
({
id
},
type
=
'
find
'
)
=>
{
history
.
push
(
`/BusinessInfo?id=
${
id
}
&type=
${
type
}
`
);
};
export
const
businessTypeDesc
=
{
1
:
'
到家业务
'
,
2
:
'
实物业务
'
,
3
:
'
到店业务
'
,
};
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