Commit 9b43094c by yaxiLiuu

fixed the base function ï

parent ebd5255b
import fetch from 'isomorphic-fetch';
import * as actionTypes from '../actiontype/ScanBarCode';
import actionTypes_error from '../actiontype/error'
let domain = 'http://192.168.10.189:8083';
const fakeJsonData = {
"meta": {
"code": "200",
"message": "成功",
"success": true
},
"data": {
"needCheck": true,
"inventorylossId": 0,
"skuBaseInfoVo": {
"skuId": 972,
"skuNumber": "UB000972",
"skuName": "怡宝饮用纯净水",
"skuImagePath": "http://static.mjitech.com/static/sku/0/0/972/1503296770206.jpg",
"barcode": "6901285991219",
"skuAttributesVoList": [
{
"name": "净含量",
"value": "555",
"unit": "ml"
}
]
},
"inventory": null,
"skuPassVoList": [
{
"id": 14466,
"warehouseId": 21,
"cabinetAreaId": 21,
"shelfId": 21211,
"skuId": 972,
"skuPassNumber": 2,
"width": 6,
"xPosition": 10,
"yPosition": 15,
"xAxis": 6,
"yAxis": 6,
"x1Axis": 0,
"y1Axis": 45,
"xOffset": 13,
"yOffset": 12,
"status": "使用中",
"quantity": 0,
"realQuantity": 97,
"maxStock": 5,
"scrapQuantity": 0,
"remarks": "21_5_1_2",
"deleted": 0,
"skuName": "怡宝饮用纯净水",
"skuNumber": "UB000972",
"cabinetNumber": 3,
"willoffSkuNumber": 0
}
],
"packingList": [
"未确认包装情况",
"包装完整",
"包装损坏"
],
"positionList": [
"未确认位置",
"机械手平台",
"出货传送区",
"轨道",
"其他位置"
]
}
}
const fakeJsonData2 = {
"meta": {
"code": "200",
"message": "成功",
"success": true
},
"data": {}}
let domain = ENV.domain;
export function scanBarCodeGetProductInfo(postData) {
return (dispatch) => {
/*let url = String(domain+'/web/machine_pad/scanning_sku_barcode_for_add_loss_task');
console.log(url)
let url = String(domain+'/web/machine_pad/scanning_sku_barcode_for_add_loss_task');
fetch(url,{
credentials : 'include',
method : 'POST',
......@@ -102,38 +26,39 @@ export function scanBarCodeGetProductInfo(postData) {
}
}
).catch(e=>dispatch(console.log("出现错误"))
)*/
dispatch(initSuccess(fakeJsonData.data))
)
/* dispatch(initSuccess(fakeJsonData.data))*/
}
}
export function submitProductInfo(postaData) {
export function submitProductInfo(postData) {
return (dispatch)=>{
/* let url = String(domain+'/web/ssubmit_add_loss_task');
let url = String(domain+'/web/machine_pad/submit_add_loss_task');
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body : JSON.stringify(postData)
}).then((response) => response.json())
.then(
(json)=>{
if(json.is_succ){
}else{
}
}
).catch(e=>dispatch(console.log("出现错误"))
)*/
if(json.data){
let submit = {
"submit":true
}
dispatch(submitProductSuccess(submit))
}
}
).catch(e=>{console.error(e)}
)
/* */
}
}
export function saveEditProductInfo(data) {
console.log("=========action============")
console.log(data)
return (dispatach) =>{
dispatach(saveEditProductInfoSuccess(data))
}
......@@ -146,7 +71,7 @@ function initSuccess(data) {
data
}
}
function submitProductSuccess(data) {
export function submitProductSuccess(data) {
return {
type:actionTypes.SUBMIT_PRODUCT_SUCCESS,
data
......
import fetch from 'isomorphic-fetch';
import * as actionTypes from '../actiontype/otherQuestion';
const domain = 'http://test.mjitech.com';
const fakeJsonData = {
"meta": {
"code": "200",
"message": "成功",
"success": true
},
"data": {
"feeds": [
{
"id": 7,
"files": [
{
"id": 13,
"filePath": "http://static.mjitech.com/static/sku/0/0/2/1471329355724.jpg"
},
{
"id": 14,
"filePath": "http://static.mjitech.com/static/sku/0/0/425/1471329537289.jpg"
},
{
"id": 17,
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
}
],
"parentProblemName": null,
"subProblemName": null
},
{
"id": 6,
"files": [
{
"id": 13,
"filePath": "http://static.mjitech.com/static/sku/0/0/2/1471329355724.jpg"
},
{
"id": 14,
"filePath": "http://static.mjitech.com/static/sku/0/0/425/1471329537289.jpg"
},
{
"id": 17,
"filePath": "http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
}
],
"parentProblemName": null,
"subProblemName": null
}
],
"employee": {
"id": 5,
"employeeName": "机器库管员",
"headImageUrl": "/static/coupon/gounian/banner_hongbaotupian-3-14.jpg"
},
"warehouse": {
"id": 13,
"name": "华贸商业街",
"image": "/tmp/2018-05-25/1527243213701.jpg"
},
"problems": [
{
"id": 18,
"message": "机械故障",
"type": "OP",
"dicDetails": [
{
"messageId": 2,
"parentId": null,
"message": "fdffdfde3"
},
{
"messageId": 3,
"parentId": null,
"message": "55d5fdf"
},
{
"messageId": 4,
"parentId": null,
"message": "dfdf"
}
]
},
{
"id": 19,
"message": "下位机程序Bug",
"type": "OP",
"dicDetails": [
{
"messageId": 7,
"parentId": null,
"message": "其他问题89"
},
{
"messageId": 8,
"parentId": null,
"message": "dfdfdf"
const domain = ENV.domain;
//有服务器交互的actions
export function initGetOtherProblem(postData) {
return (dispatch) => {
let url = String(domain+'/web/machine_pad/list_other_fault.action');
console.log(url)
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
{
"messageId": 9,
"parentId": null,
"message": "werer"
body : JSON.stringify(postData)
}).then((response) => response.json())
.then(
(json)=>{
if(json.meta.success){
dispatch(initSuccess(json.data))
}else{
}
]
}
]
).catch(e=>{console.error(e)}
)
/* */
}
}
const fakseJsonData2 = {
"meta":
{
"code": "200",
"message": "成功",
"success": true
export function addNewProbem(postData) {
return (dispatch) => {
let url = String(domain+'/web/machine_pad/insert_problem.action');
console.log(url)
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
"data":
{
"feed":
{
"id": 10,
}
body : JSON.stringify(postData)
}).then((response) => response.json())
.then(
(json)=>{
if(json.meta.success){
dispatch(addNewProblemSuccess(json.data))
}else{
}
}
const fakeJsonData3 ={
"meta": {
"code": "200",
"message": "成功",
"success": true
},
"data": {
"feeds":[6,7]
}
}
const fakeJsonData4 = {
"meta": {
"code": "200",
"message": "成功",
"success": true
},
"data": {
).catch(e=>{console.error(e)}
)
/* */
}
}
//有服务器交互的actions
export function initGetOtherProblem(postData) {
export function deleteProblem(postData) {
return (dispatch) => {
/*let url = String(domain+'/web/machine_pad/list_other_fault.action');
let url = String(domain+'/web/machine_pad/skip_feed_problem.action');
console.log(url)
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body : JSON.stringify(postData)
}).then((response) => response.json())
.then(
(json)=>{
if(json.meta.is_succ){
initSuccess(json.data)
if(json.meta.success){
dispatch(deleteProblemSuccess({"submitOtherProblem":true,"feedIds":json.data.feedIds}))
}else{
}
}
).catch(e=>dispatch(console.log("出现错误"))
)*/
dispatch(initSuccess(fakeJsonData.data))
}
}
export function addNewProbem(postaData) {
return (dispatch) =>{
fakseJsonData2.data.feed.id++
dispatch(addNewProblemSuccess(fakseJsonData2.data))
}
}
export function deleteProblem(postData) {
console.log(postData)
return(dispatch)=>{
dispatch(deleteProblemSuccess(fakeJsonData3.data))
).catch(e=>{console.error(e)}
)
}
}
export function submitProblemList(postData) {
console.log("=====================postData==================");
console.log(postData);
return (dispatch)=>{
dispatch(submitProblemListSuccess(fakeJsonData4))
return (dispatch) => {
let url = String(domain+'/web/machine_pad/add_feed_problem.action');
console.log(url)
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body : JSON.stringify(postData)
}).then((response) => response.json())
.then(
(json)=>{
if(json.meta.success){
dispatch(submitProblemListSuccess({"submitOtherProblem":true}))
}else{
}
}
).catch(e=>{console.error(e)}
)
}
}
//本地负责数据维护的action
......
import fetch from 'isomorphic-fetch';
import * as actionTypes from '../actiontype/reportDamage';
import actionTypes_error from "../actiontype/error";
let domain = ENV.domain;
const fakeJson = {
"meta": {
"code": "200",
......@@ -211,16 +213,59 @@ const fakeJson2 = {
]
}
export function getReportDamageList (postData) {
return (dispatch)=>{
dispatch(getReportDamageListSuccess(fakeJson.data))
return (dispatch) => {
let url = String(domain+'/web/machine_pad/list_all_dealed_invetory_loss/'+postData.taskId+'.json');
console.log(url)
fetch(url,{
credentials : 'include',
method : 'GET',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body : {}
}).then((response) => response.json())
.then(
(json)=>{
//处理数据如果
if(json.meta.success){
dispatch(getReportDamageListSuccess(json.data))
}else{
dispatch(throwError(json.meta.message))
}
}).catch(e=>{console.error(e)}
)
}
}
export function deleteDamageItem(postaData) {
console.log(postaData)
console.log("dffffffffffffffffffffffffffffffff")
return (dispatch)=>{
dispatch(getReportDamageListSuccess(fakeJson2.data))
export function deleteDamageItem(postaData,taskId) {
return (dispatch) => {
let url = String(domain+'/web/machine_pad/delete_invetory_loss_by_saas');
console.log(url)
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body : JSON.stringify(postaData)
}).then((response) => response.json())
.then(
(json)=>{
//处理数据如果
let success = json.meta.success;
if(success){
dispatch(getReportDamageList({"taskId":500}))
}else{
dispatch(throwError(json.meta.message))
}
}
).catch(e=>{console.error(e)}
)
/* dispatch(initSuccess(fakeJsonData.data))*/
}
}
......@@ -239,3 +284,9 @@ function deleteDamageListSuccess(data) {
data
}
}
function throwError(data) {
return{
type:actionTypes_error.ADDERRORINFO,
errMsg:data
}
}
\ No newline at end of file
......@@ -36,6 +36,26 @@ export default class EditProblemItem extends React.Component{
});
}
componentWillReceiveProps(nextProps){
let nextImgList = nextProps.imgList;
let {editProblemItem,trouleId} = this.props
let imgList = this.props.imgList;
//修改值
if(String(nextImgList.files)!=String(imgList.files) || String(imgList.errorId)!= String(nextImgList.errorId)){
if(trouleId == Number(nextImgList.errorId)){
let data={};
data.type = "imgFiles";
data.files = nextImgList.files;
data.troubelId = trouleId;
editProblemItem(data);
}else{
console.log("==================不相等===========")
}
}
}
handleShowElement(value){
if(value == "showDetailElement"){
//点击了 小分类 检查如果大分类未选择则进行提示
......@@ -91,13 +111,14 @@ export default class EditProblemItem extends React.Component{
}
render(){
let props = this.props;
let imgFiles = props.baseInfo.files;
let imgFiles = props.baseInfo.files?props.baseInfo.files:[];
let troubleId = props.trouleId;
let taskType = props.taskType;
// 方法
// 1. 删除问题
let deleteProblem = props.deleteProblem;
// 2. 刷新图片
let reRreshImg = props.reRreshImg;
let getRefreshImg = props.getRefreshImg;
// 3. 添加图片
let addImg = props.addImg;
// 4. 删除图片
......@@ -122,7 +143,7 @@ export default class EditProblemItem extends React.Component{
return <ImgToolComponent
key={"troubelImg"+index}
noCloseBtn={false}
handleClikCloseFunc = {deleteImg}
handleClikCloseFunc = {deleteImg(troubleId,taskType,item.id)}
handleClikImgFunc = {()=>{}}
type={"custom"}
imgSrc = {item.filePath}
......@@ -135,7 +156,7 @@ export default class EditProblemItem extends React.Component{
<div className={"editUploadItem clearfix"}>
<span className={"closeBtn"} onClick={deleteProblem()}>×</span>
<div className={"newTroubleTitle"}>
新故障问题:故障 <span>SD568844</span>
新故障问题:故障 <span>{"OP0000"+troubleId}</span>
</div>
<div className={"newTroubleContent clearfix"}>
<span className={"startIcon"}>*</span>
......@@ -177,10 +198,8 @@ export default class EditProblemItem extends React.Component{
{imgListUi}
</div>
<div className={"operationLeft"}>
<ImgToolComponent type={"add"} handleClikImgFunc = {addImg} noCloseBtn = {true}></ImgToolComponent>
{
imgFiles && imgFiles.length>0?(<ImgToolComponent handleClikImgFunc = {reRreshImg} type={"refresh"} noCloseBtn = {true}></ImgToolComponent>):""
}
<ImgToolComponent type={"add"} handleClikImgFunc = {addImg()} noCloseBtn = {true}></ImgToolComponent>
<ImgToolComponent handleClikImgFunc = {getRefreshImg()} type={"refresh"} noCloseBtn = {true}></ImgToolComponent>
</div>
</div>
</div>
......
......@@ -10,7 +10,7 @@ export default class DamageItem extends React.Component{
}
render(){
let {itemInfo,deleteItem} = this.props;
let {lossPosition,packingStatus,skuBaseInfoVo,inventoryId} = itemInfo;
let {lossPosition,packingStatus,skuBaseInfoVo,inventoryLossId} = itemInfo;
let productContent = ''
skuBaseInfoVo.skuAttributesVoList.map((item,index)=>{
let newText = "";
......@@ -20,7 +20,7 @@ export default class DamageItem extends React.Component{
return (
<div className={"damageProductItem"}>
<span onClick={()=>{deleteItem(inventoryId)}} className={"closeBtn"}>×</span>
<span onClick={()=>{deleteItem(inventoryLossId)}} className={"closeBtn"}>×</span>
<div className={"productBaseInfo clearfix"}>
<img className={"productImg"} src= {skuBaseInfoVo.skuImagePath} alt=""/>
<div className={"baseNumber"}>
......
......@@ -67,13 +67,8 @@ export default class ProductDetailItem extends React.Component{
handleSubmit(){
let {inventorylossId,skuBaseInfoVo,handleSubmitProductInfo,data_currentProblemObj,changePages} = this.props;
let data = {};
data.inventoryLossId = inventorylossId;
data.lossPostion = this.state.currentPosition;
data.packingStatus = this.state.currentPakageStatus;
data.packingStatusImageIds = [];
handleSubmitProductInfo(data_currentProblemObj);
changePages(CONFIG.showPage[3])
}
render(){
......@@ -163,8 +158,8 @@ export default class ProductDetailItem extends React.Component{
<div className={"btnContainer"}>
<button
onClick={this.handleSubmit.bind(this)}
className={"submitEditBtn"+(this.state.currentPosition!=undefined && this.state.currentPakageStatus!=undefined?" selectBtn":"")}
disabled={this.state.currentPosition==undefined || this.state.currentPakageStatus==undefined?true:false}
className={"submitEditBtn"+(this.state.currentPosition==undefined || this.state.currentPakageStatus==undefined ||((Number(this.state.currentPakageStatus)==2 && imgFileList.length<=0))?" ":" selectBtn")}
disabled={this.state.currentPosition==undefined || this.state.currentPakageStatus==undefined ||(Number(this.state.currentPakageStatus)==2 && imgFileList.length<=0)?true:false}
>提交</button>
</div>
</div>
......
......@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import {getStoreInfo} from "../../actions/getStore";
import {getTroubleList,updateTroubleList} from "../../actions/getTroubles";
import {initGetOtherProblem,addNewProbem,deleteProblem,editProblemItem,submitProblemList} from "../../actions/otherQuestion"
import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo} from "../../actions/ScanBarCode"
import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo,submitProductSuccess} from "../../actions/ScanBarCode"
import {getReportDamageList,deleteDamageItem} from '../../actions/reportDamageList'
import {getRefreshImg,deleteImg} from "../../actions/refreshImg"
import {uploadError,addErrorInfo} from '../../actions/uploadError'
......@@ -384,12 +384,16 @@ class PageContainer extends React.Component {
break;
case showPage[2]:
pages = <ScanBarCodeContainer
headerInfo = {state.headerInfo}
storeInfo={state.storeInfo}
userInfo={state.userInfo}
getProductInfo = {(postData)=>dispatch(scanBarCodeGetProductInfo(postData))}
submitProductInfo = {(postData)=>dispatch(submitProductInfo(postData))}
getRefreshImg={(errorId,type)=>dispatch(getRefreshImg(errorId,type))}
deleteImg={(errorId,type,fileId)=>dispatch(deleteImg(errorId,type,fileId))}
saveEditProductInfo = {(postData)=>dispatch(saveEditProductInfo(postData))}
changePages={(data)=>this.changePages(data)}
submitProductSuccess = {(postData)=>dispatch(submitProductSuccess(postData))}
state = {state}
/>;
break;
......@@ -398,6 +402,9 @@ class PageContainer extends React.Component {
getReportDamageList = {(postData)=>dispatch(getReportDamageList(postData))}
deleteDamageItem = {(postData)=>{dispatch(deleteDamageItem(postData))}}
changePages={(data)=>this.changePages(data)}
headerInfo = {state.headerInfo}
storeInfo={state.storeInfo}
userInfo={state.userInfo}
state = {state}
/>;
break;
......@@ -408,7 +415,12 @@ class PageContainer extends React.Component {
editProblemItem = {(data)=>dispatch(editProblemItem(data))}
deleteProblem = {(data)=>dispatch(deleteProblem(data))}
submitProblemList = {(data)=>dispatch(submitProblemList(data))}
getRefreshImg={(errorId,type)=>dispatch(getRefreshImg(errorId,type))}
deleteImg={(errorId,type,fileId)=>dispatch(deleteImg(errorId,type,fileId))}
changePages={(data)=>this.changePages(data)}
headerInfo = {state.headerInfo}
storeInfo={state.storeInfo}
userInfo={state.userInfo}
state = {state}
/>;
break;
......
......@@ -11,15 +11,19 @@ export default class ReportDamagesListContainer extends React.Component{
super(props)
}
componentWillMount(){
let {getReportDamageList} = this.props;
let {getReportDamageList,state} = this.props;
let{userInfo,headerInfo,storeInfo} = state;
let postData = {};
postData.taskId=headerInfo.taskId?headerInfo.taskId:Number(500)
getReportDamageList(postData)
}
hanldeDeleteDamageItem(data){
let postData = {};
postData.inventoryLossId = data;
let {deleteDamageItem} = this.props;
deleteDamageItem(postData)
let {deleteDamageItem,state} = this.props;
let{userInfo,headerInfo,storeInfo} = state;
let taskId = headerInfo.taskId?headerInfo.taskId:Number(500);
deleteDamageItem(postData,taskId)
}
hanleAddMoreClick(){
let {changePages} = this.props;
......
......@@ -34,11 +34,15 @@ export default class ScanBarCodeContainer extends React.Component{
let {state,changePages} = nextProps;
let {scanBarCode,userInfo,storeInfo,refreshImg} = state;
let productInfo = state.scanBarCode;
let {inventorylossId,skuBaseInfoVo,packingList,positionList,data_currentProblemObj} = productInfo;
let {inventorylossId,skuBaseInfoVo,packingList,positionList,data_currentProblemObj,submit} = productInfo;
if(submit){
changePages(CONFIG.showPage[3])
}
let productDetailUi = <ProductDetailItem
skuBaseInfoVo = {skuBaseInfoVo}
packingList = {packingList}
positionList = {positionList}
inventorylossId = {inventorylossId}
data_currentProblemObj = {data_currentProblemObj}
handleAddImg ={this.handleAddImg.bind(this)}
handleDeleteImg ={this.handleDeleteImg.bind(this)}
......@@ -47,7 +51,6 @@ export default class ScanBarCodeContainer extends React.Component{
handleSaveEditProductInfo = {this.handleSaveEditProductInfo.bind(this)}
refreshImg = {refreshImg}
changePages = {changePages}
/>
if(scanBarCode.skuBaseInfoVo && scanBarCode.skuBaseInfoVo.skuId && this.state.showProductInfo){
this.setState({
......@@ -59,6 +62,9 @@ export default class ScanBarCodeContainer extends React.Component{
}
}
componentWillUnmount() {
console.log("===============submitProductSuccess===============");
let {submitProductSuccess} = this.props;
submitProductSuccess({"submit":false})
}
// 输入条形码改变 onchange事件监听 条形码的值
handleSaveInputBarCode(event){
......@@ -119,7 +125,6 @@ export default class ScanBarCodeContainer extends React.Component{
})
}
handleSaveEditProductInfo(data){
console.log("=================储存===")
let {saveEditProductInfo} = this.props;
saveEditProductInfo(data)
}
......@@ -132,14 +137,16 @@ export default class ScanBarCodeContainer extends React.Component{
//上传图片
handleAddImg(){
let {state} = this.props;
let {storeInfo} = state;
let {storeInfo,scanBarCode} = state;
console.log(scanBarCode);
console.log("+===================scanBarcode==============")
let tmpUrl = "";
tmpUrl: `${ENV.uploadImg}/${storeInfo.taskId}/${this.state.taskTy}`
tmpUrl = `${ENV.uploadImg}/${scanBarCode.inventorylossId}/${this.state.taskTy}`
this.setState({
"showQr":true,
"taskTy":tmpUrl
"qrUrl":tmpUrl
},()=>{
console.log(tmpUrl)
console.log(this.state.qrUrl)
})
console.log("添加照片")
}
......@@ -158,29 +165,27 @@ export default class ScanBarCodeContainer extends React.Component{
}
//点击编辑报损的商品的提交按钮
handleSubmitProductInfo(data){
let {submitProductInfo} = this.props;
let postaData ={};
postaData.taskId = "dfdf";
postaData.inventoryLossId = data.inventoryLossId;
postaData.lossPostion = data.lossPostion;
postaData.packingStatus = data.packingStatus;
postaData.packingStatusImageIds = data.packingStatusImageIds;
console.log(postaData)
submitProductInfo(postaData);
let {submitProductInfo,userInfo,storeInfo,headerInfo} = this.props;
//检查如果选择了 包装损坏还没有上传图片的话进行提示
let pakageStatus = data.packingStatus;
let packingStatusImageIds = data.data_currentProblemObj;
data.taskId = headerInfo.taskId?Number(headerInfo.taskId):Number(500)
submitProductInfo(data);
/* changePages(CONFIG.showPage[3])*/
//让弹窗消失
this.setState({
//让弹窗消失
/*this.setState({
showProductInfo:false,
popupInfo:{
"showPopup":false,
}
})
})*/
}
render() {
let {state} = this.props;
let {userInfo,storeInfo} = state;
let productInfo = state.scanBarCode;
let {inventorylossId,skuBaseInfoVo,packingList,positionList} = productInfo;
return (
<div className={"scanBarCodeContainer"}>
{this.state.showQr?(
......
......@@ -49,10 +49,14 @@ function addNewProblem(state,data) {
return newInfo;
}
function deleteProblemItem(state,data) {
let feedId = data.feeds;
feedId.map((item,index)=>{
delete allFeeds[item]
})
console.log('==================data===========');
console.log(data);
let feedId = data.feedIds;
if(feedId){
delete allFeeds[feedId]
}else{
allFeeds = {}
}
state.data_allProblemList = allFeeds;
let newInfo = Object.assign({},state,data);
return newInfo;
......@@ -70,6 +74,8 @@ function submitProblemList(state,data) {
function editProblem(state,data) {
console.log(data);
let problemId = data.troubelId;
console.log("=====================problemId");
console.log(problemId)
let type = data.type;
let currentProblemObj = allFeeds[problemId];
if(type == "remark"){
......@@ -81,6 +87,9 @@ function editProblem(state,data) {
if(type == "detailProblemType"){
currentProblemObj.detailProblemType = data.problemId;
}
if(type == "imgFiles"){
currentProblemObj.files = data.files;
}
state.data_allProblemList = allFeeds;
return state;
......
import * as actionTypes from '../actiontype/reportDamage';
function initDamgeListSuccess(state,data) {
console.log(data);
console.log("============newData");
let newInfo = Object.assign([],state,data);
console.log("reportDamageList=============")
console.log(state);
let newInfo = Object.assign([],data);
return newInfo;
}
function deleteDamgeItemSuccess(state,data) {
......@@ -13,8 +13,6 @@ export default function(state={}, action) {
switch (action.type) {
case actionTypes.INIT_GETDAMGELIST_SUCCESS:
return initDamgeListSuccess(state,action.data)
case actionTypes.DELET_DAMAGEITEM_SUCCESS:
return deleteDamgeItemSuccess(state,action.data)
default:
return state;
}
......
import * as actionTypes from '../actiontype/ScanBarCode';
let currentProductInfo = {};
function initSuccess(state,data) {
currentProductInfo.inventorylossId = data.inventorylossId;
currentProductInfo.inventoryLossId = data.inventorylossId;
currentProductInfo.packingStatusImageIds = [];
currentProductInfo.lossPostion = undefined;
currentProductInfo.packingStatus = undefined;
data.data_currentProblemObj = Object.assign({},currentProductInfo);
let newInfo = Object.assign({},state,data);
return newInfo;
......@@ -12,8 +15,6 @@ function submitSuccess(state,data) {
}
function saveInfoSuccess(state,data) {
console.log("====================reducer================")
console.log(data);
if(data.type == "productPosition"){
currentProductInfo.lossPostion = data.data;
}
......
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