|
@@ -47,6 +47,8 @@ export default class EditSettledStore extends Component {
|
|
show_radio_flag: false,
|
|
show_radio_flag: false,
|
|
query: props.location.query,
|
|
query: props.location.query,
|
|
siteList: [],
|
|
siteList: [],
|
|
|
|
+ storeGradeIdList: {},
|
|
|
|
+ openTimeList: {},
|
|
currentSite: {}, // 当前站点
|
|
currentSite: {}, // 当前站点
|
|
store_detail: {},
|
|
store_detail: {},
|
|
store_base_info: [{ //店铺信息
|
|
store_base_info: [{ //店铺信息
|
|
@@ -322,31 +324,32 @@ export default class EditSettledStore extends Component {
|
|
type: 'global/getLayoutCollapsed',
|
|
type: 'global/getLayoutCollapsed',
|
|
});
|
|
});
|
|
const { query } = this.state;
|
|
const { query } = this.state;
|
|
- await this.getStoreOpenTime();
|
|
|
|
this.get_detail({ storeId: query.id });
|
|
this.get_detail({ storeId: query.id });
|
|
- this.get_store_grade();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//获取开店时长列表
|
|
//获取开店时长列表
|
|
- getStoreOpenTime = async () => {
|
|
|
|
- let { store_business_info } = this.state;
|
|
|
|
- const { dispatch } = this.props;
|
|
|
|
- await dispatch({
|
|
|
|
- type: 'store/get_store_open_time',
|
|
|
|
- callback: (res) => {
|
|
|
|
- if (res.state == 200) {
|
|
|
|
- let tmp_data = [];
|
|
|
|
- res.data.map(item => {
|
|
|
|
- tmp_data.push({ key: item, name: item + '年' });
|
|
|
|
- });
|
|
|
|
- let tar_data = store_business_info.filter(item => item.name == 'openTime')[0];
|
|
|
|
- tar_data.sel_data = tmp_data;
|
|
|
|
- this.setState({
|
|
|
|
- store_business_info,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ getStoreOpenTime = (webSite) => {
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
+ let { openTimeList } = this.state;
|
|
|
|
+ const { dispatch } = this.props;
|
|
|
|
+ dispatch({
|
|
|
|
+ type: 'store/get_store_open_time',
|
|
|
|
+ payload: {webSite},
|
|
|
|
+ callback: (res) => {
|
|
|
|
+ if (res.state == 200) {
|
|
|
|
+ let tmp_data = [];
|
|
|
|
+ res.data.map(item => {
|
|
|
|
+ tmp_data.push({ key: item, name: item + '年' });
|
|
|
|
+ });
|
|
|
|
+ openTimeList[webSite] = tmp_data;
|
|
|
|
+ this.setState({
|
|
|
|
+ openTimeList,
|
|
|
|
+ }, () => resolve());
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
switchBillType = (e) => {
|
|
switchBillType = (e) => {
|
|
@@ -376,31 +379,42 @@ export default class EditSettledStore extends Component {
|
|
};
|
|
};
|
|
|
|
|
|
//获取店铺等级
|
|
//获取店铺等级
|
|
- 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,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ get_store_grade = (webSite) => {
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
+ let { storeGradeIdList } = this.state;
|
|
|
|
+ const { dispatch } = this.props;
|
|
|
|
+ dispatch({
|
|
|
|
+ type: 'store/get_grade_lists',
|
|
|
|
+ payload: { pageSize: list_com_page_more, webSite },
|
|
|
|
+ callback: (res) => {
|
|
|
|
+ if (res.state == 200) {
|
|
|
|
+ storeGradeIdList[webSite] = res.data.list
|
|
|
|
+ this.setState({
|
|
|
|
+ storeGradeIdList,
|
|
|
|
+ }, () => resolve());
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ getInitData = async (siteList) => {
|
|
|
|
+ const promiseList = [];
|
|
|
|
+ siteList.forEach(site => {
|
|
|
|
+ promiseList.push(this.get_store_grade(site.webSite));
|
|
|
|
+ promiseList.push(this.getStoreOpenTime(site.webSite))
|
|
|
|
+ })
|
|
|
|
+ await Promise.all(promiseList)
|
|
|
|
+ }
|
|
|
|
+
|
|
get_detail = (params) => {
|
|
get_detail = (params) => {
|
|
const { dispatch } = this.props;
|
|
const { dispatch } = this.props;
|
|
let { store_detail, store_base_info, personal_front_card_img, store_business_info, replenish_img, business_license_img, settle_info } = this.state;
|
|
let { store_detail, store_base_info, personal_front_card_img, store_business_info, replenish_img, business_license_img, settle_info } = this.state;
|
|
dispatch({
|
|
dispatch({
|
|
type: 'store/get_settled_store_apply_detail',
|
|
type: 'store/get_settled_store_apply_detail',
|
|
payload: params,
|
|
payload: params,
|
|
- callback: res => {
|
|
|
|
|
|
+ callback: async res => {
|
|
if (res.state == 200) {
|
|
if (res.state == 200) {
|
|
store_detail = res.data;
|
|
store_detail = res.data;
|
|
for (let i = 0; i < store_base_info.length; i++) {
|
|
for (let i = 0; i < store_base_info.length; i++) {
|
|
@@ -562,6 +576,7 @@ export default class EditSettledStore extends Component {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (siteListData.length) {
|
|
if (siteListData.length) {
|
|
|
|
+ await this.getInitData(siteListData)
|
|
siteListData.forEach(item => {
|
|
siteListData.forEach(item => {
|
|
const matchItem = storeBusinessVOList.find(vo => vo.webSite === item.webSite);
|
|
const matchItem = storeBusinessVOList.find(vo => vo.webSite === item.webSite);
|
|
if (matchItem) {
|
|
if (matchItem) {
|
|
@@ -570,7 +585,7 @@ export default class EditSettledStore extends Component {
|
|
name: `${info.name}_${matchItem.webSite}`,
|
|
name: `${info.name}_${matchItem.webSite}`,
|
|
text: matchItem[info.name] ?? '',
|
|
text: matchItem[info.name] ?? '',
|
|
initialValue: matchItem[info.name]
|
|
initialValue: matchItem[info.name]
|
|
- })).map(this.parseSiteItem)
|
|
|
|
|
|
+ })).map((tag) => this.parseSiteItem(tag, item.webSite))
|
|
}
|
|
}
|
|
})
|
|
})
|
|
const sortSiteList = siteListData.sort((a, b) => Number(a.webSite) - Number(b.webSite));
|
|
const sortSiteList = siteListData.sort((a, b) => Number(a.webSite) - Number(b.webSite));
|
|
@@ -595,11 +610,20 @@ export default class EditSettledStore extends Component {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
- parseSiteItem = (item) => {
|
|
|
|
|
|
+ parseSiteItem = (item, webSite) => {
|
|
|
|
+ const { storeGradeIdList, openTimeList} = this.state;
|
|
if (item.name == 'billCycle') {
|
|
if (item.name == 'billCycle') {
|
|
item.initialValue = 1;
|
|
item.initialValue = 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (item.name.includes('storeGradeId')) {
|
|
|
|
+ item.sel_data = storeGradeIdList[webSite]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (item.name.includes('openTime')) {
|
|
|
|
+ item.sel_data = openTimeList[webSite]
|
|
|
|
+ }
|
|
|
|
+
|
|
return item;
|
|
return item;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -833,7 +857,7 @@ export default class EditSettledStore extends Component {
|
|
<Scrollbars autoHeight
|
|
<Scrollbars autoHeight
|
|
autoHeightMax={300}>
|
|
autoHeightMax={300}>
|
|
<Table rowKey={'bindId'} pagination={false} columns={columns}
|
|
<Table rowKey={'bindId'} pagination={false} columns={columns}
|
|
- dataSource={store_detail.storeGoodsCateVOList} size={'small'}/>
|
|
|
|
|
|
+ dataSource={store_detail.storeGoodsCateVOList?.filter(item => item.webSite === currentSite.webSite)} size={'small'}/>
|
|
</Scrollbars>
|
|
</Scrollbars>
|
|
</div>
|
|
</div>
|
|
{getSldEmptyH(10)}
|
|
{getSldEmptyH(10)}
|