Commit cca6cc8a by yaxiLiuu

â€fixed the p1 bugsâ€

parent 26a7ee62
......@@ -73,7 +73,14 @@ export function deleteProblem(postData) {
.then(
(json)=>{
if(json.meta.success){
dispatch(deleteProblemSuccess({"submitOtherProblem":true,"feedIds":json.data.feedIds}))
if(postData.type == "deleteProblemAll"){
dispatch(deleteProblemSuccess({"submitOtherProblem":true,"feedIds":json.data.feedIds}))
}
if(postData.type == "deleteProblemOne"){
dispatch(deleteProblemSuccess({"feedIds":json.data.feedIds}))
}
}else{
}
......
......@@ -57,6 +57,7 @@ export default class EditProblemItem extends React.Component{
}
handleShowElement(value){
let that = this;
if(value == "showDetailElement"){
//点击了 小分类 检查如果大分类未选择则进行提示
if(!this.state.currentBigId){
......@@ -67,7 +68,14 @@ export default class EditProblemItem extends React.Component{
this.setState(
{
[value]:!this.state[value]
}
},()=>{
if(value == "showCategoryElement" && !this.state.showCategoryElement){
that.setState({
"showDetailElement":false
})
}
}
)
}
handleDetailProblem_Father(event){
......@@ -82,7 +90,8 @@ export default class EditProblemItem extends React.Component{
let childProblem = this.state.problemList[String(bigProblemId)].dicDetails;
this.setState({
currentDetailProblem:childProblem,
currentBigId:bigProblemId
currentBigId:bigProblemId,
showDetailElement:true
});
data.type = "problemType";
data.problemId = bigProblemId;
......@@ -198,8 +207,17 @@ export default class EditProblemItem extends React.Component{
{imgListUi}
</div>
<div className={"operationLeft"}>
<ImgToolComponent type={"add"} handleClikImgFunc = {addImg()} noCloseBtn = {true}></ImgToolComponent>
<ImgToolComponent handleClikImgFunc = {getRefreshImg()} type={"refresh"} noCloseBtn = {true}></ImgToolComponent>
<ImgToolComponent
disabled = {this.state.currentBigId || this.state.currentSmallId?false:true}
type={"add"}
handleClikImgFunc = {addImg()}
noCloseBtn = {true}
></ImgToolComponent>
<ImgToolComponent
disabled = {this.state.currentBigId || this.state.currentSmallId?false:true}
handleClikImgFunc = {getRefreshImg()}
type={"refresh"}
noCloseBtn = {true}></ImgToolComponent>
</div>
</div>
</div>
......
......@@ -84,7 +84,7 @@ export default class FinishAskContainer extends React.Component{
</div>
<div className={"finishAskButtons"}>
<Button text={"有"} style={{'marginTop':'120px'}} option={this.selectTask}/>
<Button text={"没有"} style={{'marginTop':'40px'}} option={this.closeDoor}/>
<Button text={"没有"} style={{'marginTop':'40px'}} option={this.beginCloseDoor}/>
<Clock style={{'marginTop':'40px'}} totalTime={60}
callback={this.judgeTask}/>
</div>
......
......@@ -63,11 +63,31 @@ export default class OtherQuestionContainer extends React.Component{
currentProblemId:troubleId
})
}
handleRealExitEditRemarkOpeation(type){
if(type == "exit"){
this.setState({
showTextArea:false,
showPop:false
})
}
if(type == "cancel"){
this.setState({
showPop:false})
}
}
// 2. 在编辑备注页面组件 点击返回
handleEditGoBack(){
this.setState({
showTextArea:false
showPop:true,
popupInfo:{
"popupText":"是否放弃更新编辑的内容",
"showPopup":true,
"popupButtons": [<ButtonComponent key={"btn"} option={this.handleRealExitEditRemarkOpeation.bind(this,"cancel")} text={"取消"}/>,<ButtonComponent key={"btn"} option={this.handleRealExitEditRemarkOpeation.bind(this,"exit")} text={"确定"}/>]
}
})
console.log("点击文本框页的返回键");
}
......@@ -98,13 +118,14 @@ export default class OtherQuestionContainer extends React.Component{
/*
* 删除已经编辑的的问题
* */
handleDeleteProblem(troubleId){
handleDeleteProblem(troubleId,type){
let {deleteProblem,headerInfo} = this.props;
console.log(deleteProblem);
let postData = {};
postData.feedIds =String(troubleId);
postData.employeeId = headerInfo.employeeId?headerInfo.employeeId:"20";
postData.storeId = headerInfo.storeId?headerInfo.storeId:"17";
postData.type = type;
deleteProblem(postData);
}
......@@ -139,7 +160,9 @@ export default class OtherQuestionContainer extends React.Component{
let problemsLength = postData.problems.length;
let needEdit = [];
postData.problems.map((item,index)=>{
if(item.problemType == undefined){
console.log("========提交=====")
console.log(item);
if(item.problemType == undefined || item.remark == ""){
needEdit.push(item.id)
}
if(index+1 == postData.problems.length && needEdit.length==0){
......@@ -210,6 +233,7 @@ export default class OtherQuestionContainer extends React.Component{
postData.feedIds ="";
postData.employeeId = headerInfo.employeeId?headerInfo.employeeId:"20";
postData.storeId = headerInfo.storeId?headerInfo.storeId:"17";
postData.type="deleteProblemAll"
deleteProblem(postData);
}
//二维码返回
......@@ -244,7 +268,7 @@ export default class OtherQuestionContainer extends React.Component{
baseInfo = {item}
remarkText = {currentRemark}
getRefreshImg = {()=>(this.handleRefreshProbelmImg.bind(this,troubleId,this.state.taskTy))}
deleteProblem = {()=>(this.handleDeleteProblem.bind(this,troubleId))}
deleteProblem = {()=>(this.handleDeleteProblem.bind(this,troubleId,"deleteProblemOne"))}
addImg = {()=>(this.handleAddImg.bind(this,troubleId))}
deleteImg = {(errorId,type,fileId)=>(this.handleDeleteImg.bind(this,errorId,type,fileId))}
taskType = {this.state.taskTy}
......@@ -264,11 +288,17 @@ export default class OtherQuestionContainer extends React.Component{
//控制Ui显示
let elementUI = '';
if(this.state.showTextArea){
elementUI = <TextArea
text={this.state.tmpText}
goBack={this.handleEditGoBack.bind(this)}
saveText={this.handleSaveRemarkText.bind(this)}
></TextArea>
elementUI = <div>
<TextArea
text={this.state.tmpText}
goBack={this.handleEditGoBack.bind(this)}
saveText={this.handleSaveRemarkText.bind(this)}
></TextArea>
{this.state.showPop?(
<PopupComponent popupInfo = {this.state.popupInfo}></PopupComponent>
):""}
</div>
}else if(this.state.showQr){
elementUI = <Qrcode goBack={this.handleQrBack.bind(this)} url={this.state.qrUrl}></Qrcode>
}else{
......
......@@ -153,14 +153,14 @@ export default class ScanBarCodeContainer extends React.Component{
handleDeleteImg(id){
console.log(id)
let {deleteImg,state} = this.props;
let {storeInfo} = state;
let {scanBarCode} = state;
console.log(this.state.taskTy)
deleteImg(storeInfo.taskId,this.state.taskTy,id);
deleteImg(scanBarCode.inventorylossId,this.state.taskTy,id);
}
handleRefreshImg(data){
let {getRefreshImg,state} = this.props;
let {storeInfo} = state;
getRefreshImg(storeInfo.taskId,this.state.taskTy);
let {scanBarCode} = state;
getRefreshImg(scanBarCode.inventorylossId,this.state.taskTy);
console.log("刷新照片")
}
//点击编辑报损的商品的提交按钮
......@@ -189,7 +189,7 @@ export default class ScanBarCodeContainer extends React.Component{
return (
<div className={"scanBarCodeContainer"}>
{this.state.showQr?(
<Qrcode goBack={this.handleQrBack.bind(this)} url={this.state.taskTy}></Qrcode>
<Qrcode goBack={this.handleQrBack.bind(this)} url={this.state.qrUrl}></Qrcode>
):(
<div>
<HeaderComponent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment