|
@@ -173,7 +173,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
url: globalConfig.context + '/api/admin/ProjectSize/listProjectSize',
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
- pageSize: this.state.pagination.pageSize,
|
|
|
+ pageSize: this.state.formatPagination.pageSize,
|
|
|
pid:this.state.editId,
|
|
|
},
|
|
|
success: function (data) {
|
|
@@ -191,19 +191,19 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
formatPname: thisdata.pname,//规格名称
|
|
|
formatBname: thisdata.bname,//项目品类
|
|
|
formatPrice: thisdata.price,//市场价
|
|
|
- formatOffset: thisdata.offset*10,//最低折扣
|
|
|
+ formatOffset: thisdata.offset,//最低折扣
|
|
|
formatActivityPrice: thisdata.activityPrice,//活动价
|
|
|
formatActivityFlag:thisdata.activityFlag,//活动生效标识
|
|
|
formatMemberPrice:thisdata.memberPrice,//会员价
|
|
|
formatStatus:thisdata.status,//会员价
|
|
|
});
|
|
|
};
|
|
|
- this.state.pagination.current = data.data.pageNo;
|
|
|
- this.state.pagination.total = data.data.totalCount;
|
|
|
+ this.state.formatPagination.current = data.data.pageNo;
|
|
|
+ this.state.formatPagination.total = data.data.totalCount;
|
|
|
};
|
|
|
this.setState({
|
|
|
formatDataSource: theArr,
|
|
|
- pagination: this.state.pagination
|
|
|
+ formatPagination: this.state.formatPagination
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
@@ -232,6 +232,18 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
return '共' + total + '条数据';
|
|
|
}
|
|
|
},
|
|
|
+ formatPagination: {
|
|
|
+ defaultCurrent: 1,
|
|
|
+ defaultPageSize: 10,
|
|
|
+ showQuickJumper: true,
|
|
|
+ pageSize: 10,
|
|
|
+ onChange: function (page) {
|
|
|
+ this.loadData(page);
|
|
|
+ }.bind(this),
|
|
|
+ showTotal: function (total) {
|
|
|
+ return '共' + total + '条数据';
|
|
|
+ }
|
|
|
+ },
|
|
|
ContactsLists: [{
|
|
|
title: '业务项目名称',
|
|
|
dataIndex: 'formatBname',
|
|
@@ -338,7 +350,6 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
thedata = {};
|
|
|
};
|
|
|
var contactIds=[];
|
|
|
- //for (let item in data.data) {
|
|
|
for(var i=0;i<data.data.length;i++){
|
|
|
let theData = data.data[i];
|
|
|
theArr.push(
|
|
@@ -362,6 +373,15 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
//编辑部门,保存
|
|
|
edithandleSubmit(e){
|
|
|
e.preventDefault();
|
|
|
+ let offsetText;
|
|
|
+ if(this.state.editOffset){
|
|
|
+ if(this.state.editOffset>10||this.state.editOffset<0){
|
|
|
+ message.warning('最低折扣请输入0到10之间的数字');
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ offsetText=this.state.editOffset;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
let theorgCodeUrl = [];
|
|
|
if(this.state.orgCodeUrl.length) {
|
|
@@ -414,7 +434,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
cid:superText,//项目业务品类
|
|
|
bname:this.state.editName,//业务项目名称
|
|
|
price:this.state.editPrice,//市场价
|
|
|
- offset:this.state.editOffset,//最低折扣
|
|
|
+ offset:offsetText,//最低折扣
|
|
|
activityPrice:this.state.editActivityPrice,//活动价
|
|
|
activityFlag:this.state.editActivityFlag,//活动生效标识
|
|
|
memberPrice:this.state.editMemberPrice,//项目ID
|
|
@@ -465,6 +485,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
this.selectSuperId();
|
|
|
this.state.RowData = record;
|
|
|
this.setState({
|
|
|
+ callnub:'1',
|
|
|
editvisible: true,
|
|
|
selectedRowKeys:[],
|
|
|
rowId:record.businessId,
|
|
@@ -486,9 +507,14 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
} else {
|
|
|
- ProvinceCity.push(parseInt(thisdata.province));
|
|
|
- ProvinceCity.push(parseInt(thisdata.city));
|
|
|
- ProvinceCity.push(parseInt(thisdata.district));
|
|
|
+ if(thisdata.country==1){
|
|
|
+ ProvinceCity.push(0);
|
|
|
+ }else{
|
|
|
+ ProvinceCity.push(parseInt(thisdata.province));
|
|
|
+ ProvinceCity.push(parseInt(thisdata.city));
|
|
|
+ ProvinceCity.push(parseInt(thisdata.district));
|
|
|
+ }
|
|
|
+
|
|
|
theArr.push({
|
|
|
editId: thisdata.id,//每一条记录的ID
|
|
|
editName:thisdata.bname,//项目名称
|
|
@@ -509,8 +535,8 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
editIntroduce:thisdata.introduce,//服务内容
|
|
|
editValueEffect:thisdata.valueEffect,//价值及作用
|
|
|
editClientSize:thisdata.clientSize,//基本条件
|
|
|
- orgCodeUrl: thisdata.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
- cditCompanyLogoUrl: thisdata.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
+ orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
+ cditCompanyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
|
|
|
});
|
|
|
};
|
|
@@ -534,8 +560,8 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
editIntroduce:thisdata.introduce,//服务内容
|
|
|
editValueEffect:thisdata.valueEffect,//价值及作用
|
|
|
editClientSize:thisdata.clientSize,//基本条件
|
|
|
- orgCodeUrl: thisdata.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
- companyLogoUrl: thisdata.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
+ orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
+ companyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
editDataSource: theArr,
|
|
|
ProvinceCity:ProvinceCity,
|
|
|
});
|
|
@@ -563,7 +589,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
message.warning('最低折扣请输入0到10之间的数字');
|
|
|
return false;
|
|
|
}else{
|
|
|
- offsetText=this.state.formatOffset/10;
|
|
|
+ offsetText=this.state.formatOffset;
|
|
|
}
|
|
|
}
|
|
|
this.props.form.validateFields((err, values) => {
|
|
@@ -610,7 +636,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
message.warning('最低折扣请输入0到10之间的数字');
|
|
|
return false;
|
|
|
}else{
|
|
|
- offsetText=this.state.formatOffset/10;
|
|
|
+ offsetText=this.state.formatOffset;
|
|
|
}
|
|
|
}
|
|
|
this.props.form.validateFields((err, values) => {
|
|
@@ -648,7 +674,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- //新增一个品类,保存
|
|
|
+ //新增一个项目,保存
|
|
|
addhandleSubmit(e){
|
|
|
e.preventDefault();
|
|
|
if(!this.state.categoryName){
|
|
@@ -703,7 +729,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
loading: false
|
|
|
});
|
|
|
if (!data.error.length) {
|
|
|
- message.success('新增品类成功!');
|
|
|
+ message.success('新增项目成功!');
|
|
|
this.handleCancel();
|
|
|
this.selectSuperId();
|
|
|
} else {
|
|
@@ -732,7 +758,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/ProjectSize/deleteProject",
|
|
|
data: {
|
|
|
- id: deletedIds
|
|
|
+ id:deletedIds
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -765,7 +791,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/ProjectSize/stopProject",
|
|
|
data: {
|
|
|
- id: deletedIds
|
|
|
+ id:deletedIds
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -780,7 +806,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
}.bind(this));
|
|
|
},
|
|
|
//规格整行删除
|
|
|
- delectRow() {
|
|
|
+ delectRowSize() {
|
|
|
let deletedIds = '';
|
|
|
for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
let rowItem = this.state.selectedRows[idx];
|
|
@@ -813,7 +839,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
}.bind(this));
|
|
|
},
|
|
|
//规格整行停用
|
|
|
- blockRow() {
|
|
|
+ blockRowSize() {
|
|
|
let deletedIds = '';
|
|
|
for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
let rowItem = this.state.selectedRows[idx];
|
|
@@ -850,6 +876,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
this.setState({
|
|
|
visible: true
|
|
|
});
|
|
|
+ this.addReset();
|
|
|
},
|
|
|
editClick(e) {
|
|
|
this.state.RowData = {};
|
|
@@ -891,6 +918,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
search() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
+ //搜索部分的清零
|
|
|
reset() {
|
|
|
this.state.bname = '';//项目名称清零
|
|
|
this.state.cid = undefined;//品类名称清零
|
|
@@ -899,6 +927,12 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
this.state.status = undefined;//项目状态清零
|
|
|
this.loadData();
|
|
|
},
|
|
|
+ //新增部分的清零
|
|
|
+ addReset(){
|
|
|
+ this.state.categoryName='';//项目名称清零
|
|
|
+ this.state.ProvinceCity=undefined;
|
|
|
+ this.state.addCid=undefined;
|
|
|
+ },
|
|
|
//规格新增清零
|
|
|
formatReset() {
|
|
|
this.state.formatPname = '';//规格名称清零
|
|
@@ -912,6 +946,9 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
},
|
|
|
//详情tab切换数据处理
|
|
|
callback(e) {
|
|
|
+ this.setState({
|
|
|
+ callnub: e,
|
|
|
+ })
|
|
|
if(e == 1) {
|
|
|
|
|
|
}
|
|
@@ -925,24 +962,6 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
searchMore: !this.state.searchMore
|
|
|
});
|
|
|
},
|
|
|
- //更多搜索是否全国(更多搜索后面的)
|
|
|
-// isSearchChina() {
|
|
|
-// this.setState({
|
|
|
-// searchChina: !this.state.searchChina
|
|
|
-// });
|
|
|
-// },
|
|
|
- //是否全国的显示与否(新增项目)
|
|
|
-// chinaSwitch() {
|
|
|
-// this.setState({
|
|
|
-// chinaMore: !this.state.chinaMore
|
|
|
-// });
|
|
|
-// },
|
|
|
- //是否全国的显示与否(编辑项目)
|
|
|
-// tanSwitch() {
|
|
|
-// this.setState({
|
|
|
-// tanMore: !this.state.tanMore
|
|
|
-// });
|
|
|
-// },
|
|
|
render() {
|
|
|
const FormItem = Form.Item
|
|
|
const rowSelection = {
|
|
@@ -985,7 +1004,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
</Button>
|
|
|
</Popconfirm>
|
|
|
<Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
|
|
|
- <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
|
|
|
+ <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px',display:'none'}}
|
|
|
disabled={!hasSelected}
|
|
|
>停用<Icon type="minus" />
|
|
|
</Button>
|
|
@@ -1099,7 +1118,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
|
|
|
<FormItem wrapperCol={{ span: 12, offset: 7 }}>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
|
- <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'50px'}}>取消</Button>
|
|
|
+ <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'15px'}}>取消</Button>
|
|
|
</FormItem>
|
|
|
</Spin>
|
|
|
</Form >
|
|
@@ -1115,23 +1134,21 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
<Form horizontal onSubmit={this.formathandleSubmit} id="demand-form">
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<div className="clearfix">
|
|
|
- <FormItem
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 7 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="项目名称"
|
|
|
+ >
|
|
|
+ <span style={{width:'94%'}}>{this.state.editName}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
labelCol={{ span: 7 }}
|
|
|
wrapperCol={{ span: 12 }}
|
|
|
label="规格名称" >
|
|
|
<Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
|
|
|
onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
|
|
|
<span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <div className="clearfix" >
|
|
|
- <FormItem
|
|
|
- labelCol={{ span: 7 }}
|
|
|
- wrapperCol={{ span: 12 }}
|
|
|
- label="创建人"
|
|
|
- >
|
|
|
- <span style={{width:'94%'}}>{this.state.editCreateId}</span>
|
|
|
- </FormItem>
|
|
|
+ </FormItem>
|
|
|
<FormItem
|
|
|
labelCol={{ span: 7 }}
|
|
|
wrapperCol={{ span: 12 }}
|
|
@@ -1195,7 +1212,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
</div>
|
|
|
<FormItem wrapperCol={{ span: 12, offset: 7 }}>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
|
- <Button className="set-submit" type="ghost" onClick={this.formathandleCancel} style={{marginLeft:'50px'}}>取消</Button>
|
|
|
+ <Button className="set-submit" type="ghost" onClick={this.formathandleCancel} style={{marginLeft:'15px'}}>取消</Button>
|
|
|
</FormItem>
|
|
|
</Spin>
|
|
|
</Form >
|
|
@@ -1292,7 +1309,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
|
|
|
<FormItem wrapperCol={{ span: 12, offset: 7 }}>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
|
- <Button className="set-submit" type="ghost" onClick={this.editformathandleCancel} style={{marginLeft:'50px'}}>取消</Button>
|
|
|
+ <Button className="set-submit" type="ghost" onClick={this.editformathandleCancel} style={{marginLeft:'15px'}}>取消</Button>
|
|
|
</FormItem>
|
|
|
</Spin>
|
|
|
</Form >
|
|
@@ -1308,7 +1325,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
onCancel={this.edithandleCancel}
|
|
|
footer=''
|
|
|
>
|
|
|
- <Tabs defaultActiveKey="1" onChange={this.callback}>
|
|
|
+ <Tabs defaultActiveKey="1" onChange={this.callback} activeKey={this.state.callnub}>
|
|
|
<TabPane tab="业务项目基本资料" key="1">
|
|
|
<Form horizontal onSubmit={this.edithandleSubmit} id="demand-form">
|
|
|
<Spin spinning={this.state.loading}>
|
|
@@ -1487,7 +1504,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
<p>图片建议:图片要清晰。(200*200)</p>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
- <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'190px',marginBottom:'20px',marginTop:'20px'}}>保存</Button>
|
|
|
+ <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'190px',marginBottom:'20px',marginTop:'110px'}}>保存</Button>
|
|
|
<Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px',marginBottom:'20px'}}>取消</Button>
|
|
|
|
|
|
</Spin>
|
|
@@ -1495,14 +1512,14 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
</TabPane>
|
|
|
<TabPane tab="业务项目规格" key="2">
|
|
|
<div className="clearfix" >
|
|
|
- <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
|
|
|
+ <Popconfirm title="是否删除?" onConfirm={this.delectRowSize} okText="是" cancelText="否">
|
|
|
<Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
|
|
|
disabled={!hasSelected}
|
|
|
>删除<Icon type="minus" />
|
|
|
</Button>
|
|
|
</Popconfirm>
|
|
|
- <Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
|
|
|
- <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
|
|
|
+ <Popconfirm title="是否停用?" onConfirm={this.blockRowSize} okText="是" cancelText="否" >
|
|
|
+ <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px',display:'none'}}
|
|
|
disabled={!hasSelected}
|
|
|
>停用<Icon type="minus" />
|
|
|
</Button>
|
|
@@ -1513,7 +1530,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Form horizontal id="demand-form" onSubmit={this.contactSave} >
|
|
|
<Table
|
|
|
- pagination={this.state.pagination}
|
|
|
+ pagination={this.state.formatPagination}
|
|
|
columns={this.state.ContactsLists}
|
|
|
dataSource={this.state.formatDataSource}
|
|
|
rowSelection={rowSelection}
|