|
@@ -16,6 +16,7 @@ import {
|
|
|
getSldEmptyH,
|
|
|
sucTip,
|
|
|
sldSvgIcon,
|
|
|
+ list_com_page_more
|
|
|
} from '@/utils/utils';
|
|
|
import global from '@/global.less';
|
|
|
import router from 'umi/router';
|
|
@@ -106,17 +107,21 @@ export default class ApplyStoreDetail extends Component {
|
|
|
label: `${sldComLanguage('店铺名称')}`,
|
|
|
name: 'storeName',
|
|
|
extra: ``,
|
|
|
- item_height: 42,
|
|
|
text: ``,
|
|
|
}, {
|
|
|
- type: 'show_text',
|
|
|
- label: `${sldComLanguage('店铺等级')}`,
|
|
|
- name: 'storeGradeName',
|
|
|
- extra: ``,
|
|
|
- item_height: 42,
|
|
|
- text: ``,
|
|
|
- },
|
|
|
-
|
|
|
+ type: 'select',
|
|
|
+ label: `${sldComLanguage('店铺等级')}`,
|
|
|
+ name: 'storeGradeId',
|
|
|
+ sel_data: [],
|
|
|
+ sele_key: 'gradeId',
|
|
|
+ sele_name: 'gradeName',
|
|
|
+ diy: true,
|
|
|
+ required: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: `${sldComLanguage('请选择店铺等级')}`,
|
|
|
+ }],
|
|
|
+ },
|
|
|
{
|
|
|
type: 'select',
|
|
|
label: `${sldComLanguage('开店时长')}`,
|
|
@@ -234,19 +239,40 @@ export default class ApplyStoreDetail extends Component {
|
|
|
titleName: '',
|
|
|
submiting: false,
|
|
|
modal_width: 500,
|
|
|
+ gradeList: [],
|
|
|
};
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
+ this.get_store_grade();
|
|
|
+ this.getStoreOpenTime();
|
|
|
this.props.dispatch({
|
|
|
type: 'global/getLayoutCollapsed',
|
|
|
});
|
|
|
const { query } = this.state;
|
|
|
- this.getStoreOpenTime();
|
|
|
this.get_detail({ applyId: query.id });
|
|
|
this.get_reason_list();//获取审核拒绝的理由
|
|
|
}
|
|
|
|
|
|
+ //获取店铺等级
|
|
|
+ get_store_grade = () => {
|
|
|
+ let { store_business_info } = this.state;
|
|
|
+ const { dispatch } = this.props;
|
|
|
+ dispatch({
|
|
|
+ type: 'store/get_grade_lists',
|
|
|
+ payload: { pageSize: list_com_page_more },
|
|
|
+ callback: (res) => {
|
|
|
+ if (res.state == 200) {
|
|
|
+ let tar_data = store_business_info.filter(item => item.name == 'storeGradeId')[0];
|
|
|
+ tar_data.sel_data = res.data.list;
|
|
|
+ this.setState({
|
|
|
+ store_business_info,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
//获取开店时长列表
|
|
|
getStoreOpenTime = () => {
|
|
|
let { store_business_info } = this.state;
|
|
@@ -321,25 +347,41 @@ export default class ApplyStoreDetail extends Component {
|
|
|
//身份证信息-end
|
|
|
|
|
|
//店铺经营信息-start
|
|
|
- store_business_info.map(item => {
|
|
|
- if (item.name == 'applyYear') {
|
|
|
- item.text = `${store_detail[item.name]}${sldComLanguage('年')}`;
|
|
|
- } else {
|
|
|
- item.text = store_detail[item.name];
|
|
|
- }
|
|
|
- });
|
|
|
+ // store_business_info.map(item => {
|
|
|
+ // if (item.name == 'applyYear') {
|
|
|
+ // item.text = `${store_detail[item.name]}${sldComLanguage('年')}`;
|
|
|
+ // } else {
|
|
|
+ // item.text = store_detail[item.name];
|
|
|
+ // }
|
|
|
+ // });
|
|
|
|
|
|
- store_business_info_chakan.map(item => {
|
|
|
- if (item.name == 'applyYear') {
|
|
|
- item.text = `${store_detail[item.name]}${sldComLanguage('年')}`;
|
|
|
- } else {
|
|
|
- item.text = store_detail[item.name];
|
|
|
- }
|
|
|
- });
|
|
|
+ // store_business_info_chakan.map(item => {
|
|
|
+ // if (item.name == 'applyYear') {
|
|
|
+ // item.text = `${store_detail[item.name]}${sldComLanguage('年')}`;
|
|
|
+ // } else {
|
|
|
+ // item.text = store_detail[item.name];
|
|
|
+ // }
|
|
|
+ // });
|
|
|
//店铺经营信息-end
|
|
|
|
|
|
// 店铺经营类型区分站点--start
|
|
|
- const { storeGoodsCateVOList } = store_detail;
|
|
|
+ // store_detail.storeBusinessVOList = [
|
|
|
+ // {
|
|
|
+ // storeGradeId: 1,
|
|
|
+ // storeGradeName: '5颗星',
|
|
|
+ // openTime: null,
|
|
|
+ // webSite: '1',
|
|
|
+ // storeName: '111',
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // storeGradeId: 2,
|
|
|
+ // storeGradeName: '4颗星',
|
|
|
+ // openTime: null,
|
|
|
+ // webSite: '2',
|
|
|
+ // storeName: '22'
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ const { storeGoodsCateVOList, storeBusinessVOList } = store_detail;
|
|
|
const siteListData = [];
|
|
|
storeGoodsCateVOList?.forEach(item => {
|
|
|
if (!siteListData.find(site => site.webSite === item.webSite)) {
|
|
@@ -350,6 +392,23 @@ export default class ApplyStoreDetail extends Component {
|
|
|
}
|
|
|
});
|
|
|
if (siteListData.length) {
|
|
|
+ siteListData.forEach(item => {
|
|
|
+ const matchItem = storeBusinessVOList.find(vo => vo.webSite === item.webSite);
|
|
|
+ if (matchItem) {
|
|
|
+ item.store_business_info = store_business_info.map(info => ({
|
|
|
+ ...info,
|
|
|
+ name: `${info.name}_${matchItem.webSite}`,
|
|
|
+ text: matchItem[info.name] ?? '',
|
|
|
+ // initialValue: matchItem[info.name]
|
|
|
+ }))
|
|
|
+ item.store_business_info_chakan = store_business_info_chakan.map(info => ({
|
|
|
+ ...info,
|
|
|
+ name: `${info.name}_${matchItem.webSite}`,
|
|
|
+ text: matchItem[info.name] ?? "",
|
|
|
+ // initialValue: matchItem[info.name]
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ })
|
|
|
const sortSiteList = siteListData.sort((a, b) => Number(a.webSite) - Number(b.webSite));
|
|
|
this.setState({siteList: sortSiteList});
|
|
|
this.setState({currentSite: siteListData[0]})
|
|
@@ -357,11 +416,11 @@ export default class ApplyStoreDetail extends Component {
|
|
|
// 店铺经营类型区分站点--end
|
|
|
|
|
|
this.setState({
|
|
|
- store_base_info,
|
|
|
+ // store_base_info,
|
|
|
store_detail,
|
|
|
card_data,
|
|
|
store_business_info,
|
|
|
- store_business_info_chakan,
|
|
|
+ // store_business_info_chakan,
|
|
|
business_data,
|
|
|
more_qualification_data,
|
|
|
});
|
|
@@ -482,7 +541,7 @@ export default class ApplyStoreDetail extends Component {
|
|
|
|
|
|
//审核通过
|
|
|
agree = () => {
|
|
|
- const { store_detail } = this.state;
|
|
|
+ const { store_detail, currentSite, siteList } = this.state;
|
|
|
let scalingBindIdsArray = [];
|
|
|
store_detail.storeGoodsCateVOList.map(item => {
|
|
|
scalingBindIdsArray.push(`${item.bindId}-${item.scaling}`);
|
|
@@ -492,8 +551,23 @@ export default class ApplyStoreDetail extends Component {
|
|
|
param.scalingBindIds = scalingBindIdsArray.join(',');
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
if(!err){
|
|
|
- param.openTime = values.openTime
|
|
|
+ param.storeBusinessVOList = store_detail.storeBusinessVOList.map(item => ({
|
|
|
+ storeGradeId: values[`storeGradeId_${item.webSite}`],
|
|
|
+ // storeGradeName: '5颗星',
|
|
|
+ openTime: values[`openTime_${item.webSite}`],
|
|
|
+ webSite: item.webSite,
|
|
|
+ // storeName: item.storeName,
|
|
|
+ }))
|
|
|
this.operate(param);
|
|
|
+ } else {
|
|
|
+ const errorKeys = Object.keys(err);
|
|
|
+ const firstKeyBelongSite = errorKeys[0].replace(/^[^_]*_/, "");
|
|
|
+ if(currentSite.webSite !== firstKeyBelongSite) {
|
|
|
+ this.setCurrentSite({
|
|
|
+ webSite: firstKeyBelongSite,
|
|
|
+ webSiteName: siteList.find(site => site.webSite === firstKeyBelongSite)?.webSiteName
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -556,17 +630,24 @@ export default class ApplyStoreDetail extends Component {
|
|
|
</div>
|
|
|
))}
|
|
|
</div>
|
|
|
- {sldCommonTitle(`${sldComLanguage('店铺经营信息')}`, '#333', 5, 15, 15)}
|
|
|
- {store_detail.state == 1 &&
|
|
|
- <SldTableRowTwo r_color={'#333'} l_color={'#999'} l_fontw={500} r_fontw={600} form={this.props.form}
|
|
|
- data={store_business_info}/>
|
|
|
- }
|
|
|
-
|
|
|
- {store_detail.state == 3 &&
|
|
|
- <SldTableRowTwo r_color={'#333'} l_color={'#999'} l_fontw={500} r_fontw={600} form={this.props.form}
|
|
|
- data={store_business_info_chakan}/>
|
|
|
- }
|
|
|
-
|
|
|
+ <div className={global.site_info_list}>
|
|
|
+ {sldCommonTitle(`${sldComLanguage('店铺经营信息')}`, '#333', 5, 15, 15)}
|
|
|
+ {siteList.map((site) => (
|
|
|
+ <div
|
|
|
+ key={site.webSite}
|
|
|
+ className={`${global.site_info_item} ${site.webSite === currentSite.webSite ? global.site_info_active : ''}`}
|
|
|
+ >
|
|
|
+ <SldTableRowTwo
|
|
|
+ r_color={'#333'}
|
|
|
+ l_color={'#999'}
|
|
|
+ l_fontw={500}
|
|
|
+ r_fontw={600}
|
|
|
+ form={this.props.form}
|
|
|
+ data={store_detail.state == 1 ? site.store_business_info : site.store_business_info_chakan}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
{sldCommonTitle(`${sldComLanguage('经营类目')}`, '#333', 5, 15, 15)}
|
|
|
{/*{store_detail.state == 1 &&*/}
|
|
|
{/*<div className={`${global.flex_row_end_end}`} style={{ paddingBottom: 10, marginTop: -40 }}>*/}
|