解决bug

This commit is contained in:
red-deng-deng 2021-11-25 21:01:57 +08:00
parent 6750d99ba8
commit 892e3ecaf4
6 changed files with 134 additions and 93 deletions

View File

@ -72,7 +72,7 @@ export default class commoditylist extends React.Component{
distdata:[],
selectiondata:[],
limit:10,
filterList:[{id:0,label:"商品类型",menuList:[{id:0,name:"卡密"},{id:1,name:"直充"}]},
filterList:[{id:0,label:"商品类型",menuList:[{id:2,name:"卡密"},{id:1,name:"直充"}]},
],
menuList:[{id:0,name:"商品类型",check:false}],
drawerVisible:false
@ -220,7 +220,17 @@ export default class commoditylist extends React.Component{
}
this.getTableList(data);//更新列表
}
//状态筛选
selectedId(e){
this.setState({status:e});
let data = {
code_batch_id:sessionStorage.getItem("code_id"),
page:this.state.page,
limit:this.state.limit,
product_type:e
}
this.getTableList(data);//更新列表
}
render(){
const { current, pageSize } = this.state;
return(
@ -236,7 +246,7 @@ export default class commoditylist extends React.Component{
<Ipt icon="search" placeholder={"请输入商品名称进行匹配查询"} countShow={false} height={'36px'} width={'260px'} value={this.state.key_word} onChange={(e)=>this.setState({key_word:e})} wordSearch={this.sureFn.bind(this)} alignment={'left'}/>
</p>
<div>
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList}></Filterbar>
{/* <Filterbar selectFn={(e)=>{this.selectedId(e)}} filterList={this.state.filterList} menuList={this.state.menuList}></Filterbar> */}
</div>
{this.state.selectiondata.length>0?(<Alert
@ -250,6 +260,7 @@ export default class commoditylist extends React.Component{
<Grid
isMultiple={true}
spliteColor={'#fff'}
dataCount={this.state.dataCount}
tableData={this.state.distdata}
Column={Column}
countbarVisible={false}

View File

@ -1,4 +1,7 @@
#exchangecodeaboutlist{
.th-head {
border-top: 1px solid #e0e0e0;
}
width: 98%;
margin: 0 auto;
.codetable{

View File

@ -25,6 +25,7 @@ export default class adduserinfo extends React.Component{
stock:"",
name:"",
show_url:"",
loadshow:false,
describe_url:"",
},
cur_product:null,
@ -95,7 +96,7 @@ export default class adduserinfo extends React.Component{
})
this.setState({cur_product:sel_item})
this.setState({model:temp})
this.setState({model:temp,loadshow:true})
},(err)=>{
@ -297,7 +298,8 @@ export default class adduserinfo extends React.Component{
<FormItem labelname="商品成本" prop="cost_price" id="cost_price">
<div className="line-value">{this.state.model.cost_price}</div>
</FormItem>
<FormItem labelname="商品库存" prop="stock" id="stock">
{
this.state.loadshow? <FormItem labelname="商品库存" prop="stock" id="stock">
<Ipt onChange={(e)=>{
let model2 = this.state.model;
model2.stock = e;
@ -310,11 +312,11 @@ export default class adduserinfo extends React.Component{
this.setState({model:model2})
}}
value={this.state.model.stock} placeholder={"请输入"} labelWidth={'0px'} maxLength={5} height={'36px'} width={'520px'} alignment={'left'}/>
</FormItem>
<FormItem id="contract_price" labelname="合同价" prop="contract_price">
value={this.state.model.stock} placeholder={"请输入"} labelWidth={'0px'} maxLength={7} height={'36px'} width={'520px'} alignment={'left'}/>
</FormItem> :null
}
{
this.state.loadshow?<FormItem id="contract_price" labelname="合同价" prop="contract_price">
<Ipt onChange={(e)=>{
let model2 = this.state.model;
model2.contract_price = e;
@ -329,8 +331,10 @@ export default class adduserinfo extends React.Component{
value={this.state.model.contract_price} placeholder={"请输入"} labelWidth={'0px'} maxLength={16} height={'36px'} width={'520px'} alignment={'left'}/>
</FormItem>
<FormItem id="name" labelname="商品名称" prop="name">
</FormItem> :null
}
{
this.state.loadshow? <FormItem id="name" labelname="商品名称" prop="name">
<Ipt onChange={(e)=>{
let model2 = this.state.model;
model2.name = e;
@ -343,7 +347,8 @@ export default class adduserinfo extends React.Component{
}}
value={this.state.model.name} placeholder={"请输入"} labelWidth={'0px'} maxLength={16} height={'36px'} width={'520px'} alignment={'left'}/>
</FormItem>
</FormItem> :null
}
<FormItem id="official_price" labelname="商品官方价" prop="official_price">

View File

@ -476,7 +476,7 @@ componentDidUpdate(prevProps,prevState){
value={this.state.combinedValue}
showTime={{
format: 'HH:mm:ss',
defaultTime: ['12:00:00', '23:59:59'],
defaultTime: ['00:00:00', '23:59:59'],
}}
format="YYYY-MM-DD HH:mm:ss"
onChange={this.onChangeCombinedDate}

View File

@ -125,7 +125,33 @@ export default class acclist extends React.Component{
getKeyList(data){
getKeyList(time={}){
let _self=this;
let {page,limit,key_word,product_type}=_self.state;
let data={page,limit}
data.plan_id=sessionStorage.getItem("key_plan_id");
if(this.state.combinedValue&&this.state.combinedValue[0]){
data.begin_time=this.state.combinedValue[0];
data.end_time=this.state.combinedValue[1];
}
if(product_type){
data.product_type=product_type;
}
if(key_word){
data.key_word=key_word;
}
if(time&&time[0]){
data.begin_time=time[0];
data.end_time=time[1];
}
if(time&&time[0]==null&&time.length>1){
delete data.begin_time;
delete data.end_time;
}
if(this.state.activepage==0){
delete data.status;
}
getKeyList(data).then((res)=>{
handelResponse(res,(req,msg)=>{
this.setState({distdata:req.data})
@ -139,20 +165,13 @@ export default class acclist extends React.Component{
//分页
onPageChange(e){
this.setState({page:e})
let data = {
page:e,
limit:this.state.limit,
plan_id: sessionStorage.getItem("key_plan_id")
setTimeout(()=>{
this.getKeyList();
},0);
}
this.getKeyList(data);
}
componentDidMount(e){
let data = {
page:1,
limit:10,
plan_id: sessionStorage.getItem("key_plan_id")
}
this.getKeyList(data);
componentDidMount(){
this.getKeyList();
}
@ -188,7 +207,12 @@ export default class acclist extends React.Component{
]}]
sessionStorage.setItem('breaknav',JSON.stringify(activerou));
}
//page
pageChange(e){
this.setState({page:e});
}
tabFn(index){
this.setState({activepage:index,key_word:''});
if(index==1||index==2){
@ -209,17 +233,7 @@ export default class acclist extends React.Component{
}
this.setState({page:1,limit:10})
setTimeout(() => {
let data = {
page:1,
limit:10,
status:this.state.activepage,
plan_id: sessionStorage.getItem("key_plan_id")
}
if(index==0){
delete data.status;
}
this.getKeyList(data);
this.getKeyList();
}, 10);
}
@ -307,15 +321,7 @@ onEditRow(status,row){
//敲回车查询
iptsureFn(){
let data = {
page:1,
limit:10,
key_word:this.state.key_word,
plan_id: sessionStorage.getItem("key_plan_id")}
if(this.state.activepage){
data.status=this.state.activepage;
}
this.getKeyList(data);
this.getKeyList();
}
componentWillMount(){
@ -497,30 +503,41 @@ phoneChange=(e)=>
});
}
}
//limit
countChange(e){
this.setState({page:1,limit:e});
setTimeout(() => {
this.getKeyList();
}, 0);
}
//选择时间
onChangeCombinedDate(e){
this.setState({combinedValue:e});
this.getKeyList(e);
}
// 监听组件内部状态的变化:
componentDidUpdate(prevProps,prevState){
// 参数分别为改变之前的数据状态对象
if(prevState.key_word!=this.state.key_word &&!this.state.key_word){
let data = {
page:1,
limit:10,
plan_id: sessionStorage.getItem("key_plan_id")}
if(this.state.activepage){
data.status=this.state.activepage;
}
this.getKeyList(data);
this.getKeyList();
}
}
render(){
const date = <CombinedDateRangePicker
className="zent-datepicker-demo"
value={this.state.combinedValue}
format="YYYY-MM-DD"
onChange={(e)=>{this.onChangeCombinedDate(e)}}
/>
showTime={{
format: 'HH:mm:ss',
defaultTime: ['00:00:00', '23:59:59'],
}}
format="YYYY-MM-DD HH:mm:ss"
onChange={this.onChangeCombinedDate.bind(this)}
/>
const { current, pageSize } = this.state;
return(
<div id="exchangecodelist">
@ -532,6 +549,11 @@ phoneChange=(e)=>
</p>
<div className="code-table">
<Grid
countChange={
(e)=>{
this.countChange(e)
}
}
spliteColor={'#fff'}
tableData={this.state.distdata}
Column={Column}

View File

@ -24,7 +24,7 @@ export default class acclist extends React.Component{
limit:10,
tabList:[{title:"营销计划列表"}],
distdata:[{title:'士大夫大师傅'}],
filterList:[{id:0,label:"状态",menuList:[{id:0,name:"草稿"},{id:2,name:"审核中"},{id:4,name:"生效中"},{id:5,name:"暂停中"},{id:1,name:"创建中"},{id:3,name:"待生效"}]},
filterList:[{id:0,label:"状态",menuList:[{id:100,name:"草稿"},{id:2,name:"审核中"},{id:4,name:"生效中"},{id:5,name:"暂停中"},{id:1,name:"创建中"},{id:3,name:"待生效"}]},
],
menuList:[{id:0,name:"状态",check:false}],
email:"",
@ -460,7 +460,7 @@ export default class acclist extends React.Component{
}
if(com == "switch")
{
return <Switch size="small" checked={rowData.open == 1} onChange={(e)=>{this.onSwitchChange(e,rowData)}}></Switch>;
return <Switch size="small" checked={rowData.open == 1} disabled={rowData.status==0||rowData.status==6} onChange={(e)=>{this.onSwitchChange(e,rowData)}}></Switch>;
}
if(com == "status")
{