...
|
...
|
@@ -19,27 +19,66 @@ export default class TransferShipmentCell extends Component { |
|
|
|
|
|
constructor(props) {
|
|
|
super (props);
|
|
|
this._onSubmitEditing = this._onSubmitEditing.bind(this);
|
|
|
this._onChangeText = this._onChangeText.bind(this);
|
|
|
this._onCheckBoxChanged = this._onCheckBoxChanged.bind(this);
|
|
|
|
|
|
let {resource} = this.props;
|
|
|
let data = resource?resource.toJS():null;
|
|
|
|
|
|
this.state = {
|
|
|
hasChecked: false,
|
|
|
hasChecked: data.checked?data.checked:false,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
_onSubmitEditing(event){
|
|
|
let value = event.nativeEvent.text;
|
|
|
}
|
|
|
|
|
|
_onChangeText(text){
|
|
|
let {resource} = this.props;
|
|
|
let data = resource?resource.toJS():null;
|
|
|
let id = data?data.id:0;
|
|
|
let lackNum = data.lackNum?data.lackNum:0;//缺货数
|
|
|
let shipmentsNums = data.shipmentsNums?data.shipmentsNums:0;//发货数量
|
|
|
let buyingNums = data.buyingNums?data.buyingNums:0;//外采数量 销售数
|
|
|
let lastNum = buyingNums - lackNum - shipmentsNums;//实际应发数
|
|
|
let num = text;
|
|
|
|
|
|
if ((num | 0) === num || num > lastNum) {
|
|
|
num = -1;
|
|
|
}
|
|
|
this.props.setPurchaseNum && this.props.setPurchaseNum(num,id);
|
|
|
}
|
|
|
|
|
|
_onCheckBoxChanged(checked){
|
|
|
this.setState({hasChecked : !checked});
|
|
|
let {resource} = this.props;
|
|
|
let data = resource?resource.toJS():null;
|
|
|
let id = data?data.id:0;
|
|
|
|
|
|
this.props.checkUp && this.props.checkUp(!checked,id);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
let checkedLable = 'SKU: 2541123 下单时间:2017-05-02'
|
|
|
let {resource} = this.props;
|
|
|
let data = resource?resource.toJS():null;
|
|
|
if (!data) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
let sku = data.productSku?data.productSku:0;//sku
|
|
|
let createTime = data.createTime?data.createTime:0;//下单时间
|
|
|
let id = data.id?data.id:0;//单号
|
|
|
let factoryGoodsName = data.factoryGoodsName?data.factoryGoodsName:0;//厂家颜色
|
|
|
let sizeName = data.sizeName?data.sizeName:0;//尺码名
|
|
|
let skuFactoryCode = data.skuFactoryCode?data.skuFactoryCode:0;//商品条码
|
|
|
let lackNum = data.lackNum?data.lackNum:0;//缺货数
|
|
|
let shipmentsNums = data.shipmentsNums?data.shipmentsNums:0;//发货数量
|
|
|
let num = data.num?data.num:0;//输入发货
|
|
|
|
|
|
let inStoreNum = data.inStoreNum?data.inStoreNum:0;//入库数量 收货数量
|
|
|
let buyingNums = data.buyingNums?data.buyingNums:0;//外采数量 销售数
|
|
|
let lastNum = buyingNums - lackNum - shipmentsNums;//实际应发数
|
|
|
let checkedLable = 'SKU: ' + sku + ' ' + '下单时间:' + createTime;
|
|
|
let lackNumTextColor = lackNum > 0 ? 'red' : 'black';
|
|
|
let textInputColor = num >= 0 ? 'transparent' : 'red';
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<View style={styles.titleBar}>
|
...
|
...
|
@@ -55,30 +94,53 @@ export default class TransferShipmentCell extends Component { |
|
|
onChange={this._onCheckBoxChanged}
|
|
|
/>
|
|
|
<TouchableOpacity onPress={() => {
|
|
|
this.props.goToStatsPage && this.props.goToStatsPage(CONFIG.statsKey.outOfStock);
|
|
|
this.props.goToStatsPage && this.props.goToStatsPage(CONFIG.statsKey.outOfStock,resource);
|
|
|
}}>
|
|
|
<View style={styles.tip}>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
<View style={styles.cell}>
|
|
|
<Text style={styles.cellText} numberOfLines={1}>商品条码:KT-2017156</Text>
|
|
|
<Text style={styles.cellText} numberOfLines={1}>商品条码:{skuFactoryCode}</Text>
|
|
|
</View>
|
|
|
<View style={styles.cell}>
|
|
|
<Text style={styles.cellText} numberOfLines={1}>规格:红色/L 单号:175023</Text>
|
|
|
<Text style={styles.cellText} numberOfLines={1}>规格:{factoryGoodsName}/{sizeName} 单号:{id}</Text>
|
|
|
</View>
|
|
|
<View style={styles.cell}>
|
|
|
<Text style={styles.cellText1} numberOfLines={1}>缺货数:1110</Text>
|
|
|
<Text style={styles.cellText2} numberOfLines={1}>收获数:1111</Text>
|
|
|
<Text style={styles.cellText3} numberOfLines={1}>已发数:1110</Text>
|
|
|
<Text style={styles.cellText4} numberOfLines={1}>当前需发数:5111</Text>
|
|
|
<Text style={{
|
|
|
fontSize:15,
|
|
|
marginLeft: 10,
|
|
|
width: 2 * Math.ceil((width-10)/9),
|
|
|
textAlign: 'left',
|
|
|
color: lackNumTextColor,
|
|
|
}}
|
|
|
numberOfLines={1}>
|
|
|
缺货数:{lackNum}
|
|
|
</Text>
|
|
|
<Text style={styles.cellText2} numberOfLines={1}>收获数:{inStoreNum}</Text>
|
|
|
<Text style={styles.cellText3} numberOfLines={1}>已发数:{shipmentsNums}</Text>
|
|
|
<Text style={styles.cellText4} numberOfLines={1}>当前需发数:{lastNum}</Text>
|
|
|
</View>
|
|
|
<View style={styles.textInputCell}>
|
|
|
<Text style={styles.cellText} numberOfLines={1}>发货:</Text>
|
|
|
<TextInput style={styles.inputText}
|
|
|
<Text style={styles.cellText} numberOfLines={1}>
|
|
|
发货:
|
|
|
</Text>
|
|
|
<TextInput style={{
|
|
|
width: width - 80,
|
|
|
height: 40,
|
|
|
backgroundColor:'transparent',
|
|
|
fontSize:15,
|
|
|
marginLeft: 10,
|
|
|
borderWidth: 1,
|
|
|
borderColor: '#CCC',
|
|
|
borderRadius: 4,
|
|
|
marginTop: 5,
|
|
|
color: 'black',
|
|
|
backgroundColor: textInputColor,
|
|
|
}}
|
|
|
ref = 'textInput'
|
|
|
placeholder={'单行输入'}
|
|
|
onSubmitEditing={this._onSubmitEditing}
|
|
|
keyboardType={'numeric'}
|
|
|
onChangeText={this._onChangeText}
|
|
|
/>
|
|
|
</View>
|
...
|
...
|
@@ -103,7 +165,7 @@ const styles = StyleSheet.create({ |
|
|
titleBar: {
|
|
|
width: width,
|
|
|
height: 40,
|
|
|
backgroundColor: 'yellow',
|
|
|
backgroundColor: 'rgb(254,220,220)',
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
},
|
...
|
...
|
@@ -151,7 +213,7 @@ const styles = StyleSheet.create({ |
|
|
fontSize:15,
|
|
|
width: 2 * Math.ceil((width-10)/9),
|
|
|
textAlign: 'left',
|
|
|
color: 'red',
|
|
|
color: 'black',
|
|
|
},
|
|
|
cellText3: {
|
|
|
fontSize:15,
|
...
|
...
|
|