Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
alanyangcn committed Sep 21, 2017
1 parent da7ddbc commit 2330c66
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class ElectricChargeDetails extends React.Component {
<div>
<span style={lightGrayStyle}>最后修改:</span>
<span style={{marginLeft: '10px'}}>{feesInfo.createName}</span>
<span style={{marginLeft: '10px'}}>{feesInfo.updateDate ? feesInfo.updateDate : feesInfo.createDate}</span>
<span style={{marginLeft: '10px'}}>{feesInfo.createDate}</span>
</div>
</Col>
</Row>
Expand Down
50 changes: 29 additions & 21 deletions src/modules/PROPERTY/components/ElectricCharge/PowerAddUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ class sumElectricityAddUp extends React.Component {
}
// 添加条目
add = () => {
console.log('powerType : ' + this.state.powerType)

this.deleteTotalColunm()
let json = this.props.form.getFieldsValue()
let jsonTwo = {}
Expand Down Expand Up @@ -545,12 +547,16 @@ class sumElectricityAddUp extends React.Component {
let powerLossRatio = this.state.Contract.powerLossRatio ? this.state.Contract.powerLossRatio / 100 : 0

if (this.state.powerType === 0) {
jsonTwo['electricLoss'] = 0
jsonTwo['electricLoss'] = 0 // 电损
jsonTwo['sumElectricity'] = (jsonTwo.needElectricity * json.ratio) ? (json.needElectricity * json.ratio) : 0
} else {
jsonTwo['electricLoss'] = this.state.Contract.powerLossRatio ? jsonTwo.needElectricity * jsonTwo.ratio * powerLossRatio : 0
jsonTwo['sumElectricity'] = jsonTwo.needElectricity * jsonTwo.ratio + jsonTwo['electricLoss']
}

console.log('电量 : ' + jsonTwo.needElectricity)
console.log('变比 : ' + jsonTwo.ratio)
console.log('该用户电损百分比 : ' + powerLossRatio)
jsonTwo['singleMoney'] = (jsonTwo.sumElectricity * jsonTwo.unitPrice) ? (jsonTwo.sumElectricity * jsonTwo.unitPrice) : 0
let sumElectricityRecordlList = this.state.sumElectricityRecordlList
sumElectricityRecordlList.push(jsonTwo)
Expand Down Expand Up @@ -638,28 +644,29 @@ class sumElectricityAddUp extends React.Component {
}
// 选择房间编号
chooseRoomNumber = async (value) => {
console.log(value)
// 查询上次抄表数
this.setState({loading: true})
let lastTimeData = await apiPost(
'/ElectricityFees/LastTimeNumber',
{
roomNumberOne: value,
buildingIdOne: this.state.Contract.buildId
if (value) {
// 查询上次抄表数
this.setState({loading: true})
let lastTimeData = await apiPost(
'/ElectricityFees/LastTimeNumber',
{
roomNumberOne: value,
buildingIdOne: this.state.Contract.buildId
}
)
lastTimeData = lastTimeData.data
if (lastTimeData !== null && lastTimeData !== '' && typeof (lastTimeData) !== 'undefined') {
this.props.form.setFieldsValue({
lastSurfaceNumber: this.props.id ? lastTimeData.lastSurfaceNumber : lastTimeData.surfaceNumber,
electricCostName: this.state.powerType !== 2 ? value : ''
})
} else {
this.props.form.setFieldsValue({
electricCostName: value
})
}
)
lastTimeData = lastTimeData.data
if (lastTimeData !== null && lastTimeData !== '' && typeof (lastTimeData) !== 'undefined') {
this.props.form.setFieldsValue({
lastSurfaceNumber: this.props.id ? lastTimeData.lastSurfaceNumber : lastTimeData.surfaceNumber,
electricCostName: this.state.powerType !== 2 ? value : ''
})
} else {
this.props.form.setFieldsValue({
electricCostName: value
})
this.setState({loading: false})
}
this.setState({loading: false})
}
handleConfirmPassword = (rule, value, callback) => {
debugger
Expand Down Expand Up @@ -878,6 +885,7 @@ class sumElectricityAddUp extends React.Component {
>{getFieldDecorator('roomNumberOne')(
<Select
showSearch
allowClear
placeholder="请选择房间编号"
optionFilterProp="children"
onChange={this.chooseRoomNumber}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class PowerInfomation extends React.Component {
<div>
<span style={lightGrayStyle}>最后修改:</span>
<span style={{marginLeft: '10px'}}>{fees.createName}</span>
<span style={{marginLeft: '10px'}}>{fees.updateDate ? fees.updateDate : fees.createDate}</span>
<span style={{marginLeft: '10px'}}>{fees.createDate}</span>
</div>
</Col>
</Row>
Expand Down

0 comments on commit 2330c66

Please sign in to comment.