Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Router' into Router
Browse files Browse the repository at this point in the history
  • Loading branch information
damon committed Sep 21, 2017
2 parents 04a1ead + a24a0a9 commit 5c9682a
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 75 deletions.
12 changes: 4 additions & 8 deletions src/modules/FINANCE/components/ElectricInfo/PowerBillHead.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,15 @@ class PowerBillHead extends React.Component {
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="房间编号" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('roomNumber')(
<FormItem label="客户名称" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('clientName')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="客户名称" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('clientName')(
<FormItem label="房间编号" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('roomNumber')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
Expand Down
12 changes: 4 additions & 8 deletions src/modules/FINANCE/components/WaterFee/WaterBillHead.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,15 @@ class WaterBillHead extends React.Component {
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="房间编号" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('roomNumber')(
<FormItem label="客户名称" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('clientSubletName')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="客户名称" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('clientSubletName')(
<FormItem label="房间编号" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('roomNumber')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
Expand Down
6 changes: 3 additions & 3 deletions src/modules/FINANCE/containers/Electricity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ class Electricity extends React.Component {
}, {
title: '收费类型',
dataIndex: 'wattHourType',
render: function (text, record, index) {
render: function (text) {
let dataIndex = '固定单价'
if (record.wattHourType === 1) {
if (text === 1) {
dataIndex = '差额单价'
} else if (record.wattHourType === 2) {
} else if (text === 2) {
dataIndex = '功峰平谷'
}
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class ElectricChargeDetails extends React.Component {
}
handleCancel = (e) => {
this.setState({ visible: false,
isFirst: true})
isFirst: true,
collectMoney: false,
collectPenal: false})
this.props.refresh({}, {}, {})
}
initialRemarks = async (nextProps) => {
Expand Down Expand Up @@ -376,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 Expand Up @@ -562,7 +564,7 @@ function ExamineSuccessState (props) {
pagination={false}
/>
</div>
{props.fees.defaultPaymentStatus !== 2 &&
{props.fees.liquidatedDamages > 0 &&
<div>
<hr />
<div style={{
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
12 changes: 4 additions & 8 deletions src/modules/PROPERTY/components/ElectricCharge/PowerBillHead.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,15 @@ class PowerBillHead extends React.Component {
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="房间编号" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('roomNumber')(
<FormItem label="客户名称" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('clientName')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="客户名称" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('clientName')(
<FormItem label="房间编号" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('roomNumber')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class PowerInfomation extends React.Component {
list: [],
isFirst: true,
visible: false,
mainColumns: []
mainColumns: [],
value: 2
}
async initialRemarks (nextProps) {
if (this.state.isFirst && nextProps.visible) {
Expand Down Expand Up @@ -338,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
12 changes: 4 additions & 8 deletions src/modules/PROPERTY/components/WaterCharge/WaterBillHead.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,15 @@ class WaterBillHead extends React.Component {
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="房间编号" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('roomNumber')(
<FormItem label="客户名称" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('clientSubletName')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
</Col>
<Col span={spanEight}>
<FormItem label="客户名称" labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('clientSubletName')(
<FormItem label="房间编号" labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
{getFieldDecorator('roomNumber')(
<Input placeholder="请输入" style={{ width: 200 }} />
)}
</FormItem>
Expand Down
20 changes: 9 additions & 11 deletions src/modules/PROPERTY/containers/ElectricCharge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,15 @@ class ElectricCharge extends React.Component {
title: '收费类型',
dataIndex: 'wattHourType',
render: function (text) {
if (text) {
let dataIndex = '固定单价'
if (text === 1) {
dataIndex = '差额单价'
} else if (text === 2) {
dataIndex = '功峰平谷'
}
return (
<p>{dataIndex}</p>
)
let dataIndex = '固定单价'
if (text === 1) {
dataIndex = '差额单价'
} else if (text === 2) {
dataIndex = '功峰平谷'
}
return (
<p>{dataIndex}</p>
)
}
}, {
title: '本期电费周期',
Expand Down Expand Up @@ -280,7 +278,7 @@ class ElectricCharge extends React.Component {
}, {
title: ' 操作',
fixed: 'right',
width: '80',
width: '150',
dataIndex: 'opt',
render: function (text, record) {
console.log(record)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,12 @@ class ContractDetail extends React.Component {
</em> 元/度
<span style={{marginLeft: '20px'}}>
变比
<em className="color1">{this.state.contract.powerRatio}</em> 电损比
<em className="color1">{this.state.contract.powerLossRatio}</em>%
<em className="color1">{this.state.contract.powerRatio}</em>
{this.state.contract.powerType !== 0 &&
<span>
电损比<em className="color1">{this.state.contract.powerLossRatio}</em>%
</span>
}
</span>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ class ElectricityDetail extends React.Component {
<em className="color1">
功峰平谷
</em>}
单价 <em className="color1">{this.state.contract.powerUnitPrice}</em> 元/度 变比 <em className="color1">{this.state.contract.powerRatio}</em> 电损比 <em className="color1">{this.state.contract.powerLossRatio}</em>%</Col>
单价 <em className="color1">{this.state.contract.powerUnitPrice}</em> 元/度 变比 <em className="color1">{this.state.contract.powerRatio}</em>
{this.state.contract.powerType !== 0 &&
<span>电损比 <em className="color1">{this.state.contract.powerLossRatio}</em>%</span>
}
</Col>
</Row>
<Row>
<Col span={16}><b>水费收费方式:</b>
Expand Down

0 comments on commit 5c9682a

Please sign in to comment.