|
@@ -167,6 +167,7 @@ class ChangeDetail extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
+ rotateDeg: 0,
|
|
|
previewVisible: false,
|
|
|
buttonStatus: true,
|
|
|
changeType: 2,
|
|
@@ -243,12 +244,16 @@ class ChangeDetail extends Component {
|
|
|
key: "dels",
|
|
|
render: (text, record, index) => {
|
|
|
return (
|
|
|
- <div style={{ display:
|
|
|
- (this.props.data.processState == 7 ||
|
|
|
- this.props.data.processState == 8) &&
|
|
|
- this.props.data.status == 4
|
|
|
- ? "none"
|
|
|
- : "block"}}>
|
|
|
+ <div
|
|
|
+ style={{
|
|
|
+ display:
|
|
|
+ (this.props.data.processState == 7 ||
|
|
|
+ this.props.data.processState == 8) &&
|
|
|
+ this.props.data.status == 4
|
|
|
+ ? "none"
|
|
|
+ : "block"
|
|
|
+ }}
|
|
|
+ >
|
|
|
<Popconfirm
|
|
|
title="是否删除?"
|
|
|
onConfirm={() => {
|
|
@@ -293,8 +298,11 @@ class ChangeDetail extends Component {
|
|
|
this.addcontact = this.addcontact.bind(this);
|
|
|
this.contactSave = this.contactSave.bind(this);
|
|
|
this.confirmDelet = this.confirmDelet.bind(this);
|
|
|
- this.finish = this.finish.bind(this)
|
|
|
- this.reload = this.reLoad.bind(this)
|
|
|
+ this.finish = this.finish.bind(this);
|
|
|
+ this.reload = this.reLoad.bind(this);
|
|
|
+ this.downImg = this.downImg.bind(this);
|
|
|
+ this.upImg = this.upImg.bind(this);
|
|
|
+ this.rotate = this.rotate.bind(this);
|
|
|
}
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
@@ -316,7 +324,6 @@ class ChangeDetail extends Component {
|
|
|
|
|
|
componentDidMount() {
|
|
|
window.setTimeout(() => {
|
|
|
-
|
|
|
const contactList = this.props.contactList;
|
|
|
contactList.forEach(item => {
|
|
|
item.load = true;
|
|
@@ -324,7 +331,6 @@ class ChangeDetail extends Component {
|
|
|
this.setState({
|
|
|
contactList
|
|
|
});
|
|
|
-
|
|
|
}, 0);
|
|
|
}
|
|
|
// componentDidMount() {
|
|
@@ -347,6 +353,45 @@ class ChangeDetail extends Component {
|
|
|
// });
|
|
|
// }
|
|
|
|
|
|
+ downImg() {
|
|
|
+ let num = 0;
|
|
|
+ for (let i = 0; i < this.props.pictureUrl.length; i++) {
|
|
|
+ if (this.props.pictureUrl[i].url == this.state.previewImage) {
|
|
|
+ num = i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (num == this.props.pictureUrl.length - 1) {
|
|
|
+ return message.warning("已经是最后一张了哦");
|
|
|
+ }
|
|
|
+ this.state.previewImage = this.props.pictureUrl[num + 1].url;
|
|
|
+ this.setState({
|
|
|
+ previewImage: this.state.previewImage,
|
|
|
+ rotateDeg: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+ upImg() {
|
|
|
+ let num = 0;
|
|
|
+ for (let i = 0; i < this.props.pictureUrl.length; i++) {
|
|
|
+ if (this.props.pictureUrl[i].url == this.state.previewImage) {
|
|
|
+ num = i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (num == 0) {
|
|
|
+ return message.warning("已经是第一张了哦");
|
|
|
+ }
|
|
|
+ this.state.previewImage = this.props.pictureUrl[num - 1].url;
|
|
|
+ this.setState({
|
|
|
+ previewImage: this.state.previewImage,
|
|
|
+ rotateDeg: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+ rotate() {
|
|
|
+ let rotateDeg = this.state.rotateDeg + 90;
|
|
|
+ this.setState({
|
|
|
+ rotateDeg
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
reset() {
|
|
|
this.setState({
|
|
|
paymentTimes: null,
|
|
@@ -450,7 +495,6 @@ class ChangeDetail extends Component {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// 完成订单
|
|
@@ -463,10 +507,10 @@ class ChangeDetail extends Component {
|
|
|
type: this.props.data.type,
|
|
|
id: this.props.data.id
|
|
|
},
|
|
|
- success: (data) => {
|
|
|
- if(data) {
|
|
|
+ success: data => {
|
|
|
+ if (data) {
|
|
|
message.success("保存成功!");
|
|
|
- window.location.reload()
|
|
|
+ window.location.reload();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -499,9 +543,9 @@ class ChangeDetail extends Component {
|
|
|
function(data) {
|
|
|
if (!data.error.length) {
|
|
|
message.success("保存成功!");
|
|
|
- let num = 0
|
|
|
+ let num = 0;
|
|
|
this.state.contactList.forEach(item => {
|
|
|
- num += +item.amount
|
|
|
+ num += +item.amount;
|
|
|
// if (item.key == index.key) {
|
|
|
// item.load = true;
|
|
|
// let time = this.timestampToTime(new Date().getTime());
|
|
@@ -513,8 +557,7 @@ class ChangeDetail extends Component {
|
|
|
refundInvoice: num
|
|
|
});
|
|
|
this.reLoad();
|
|
|
- console.log("bug",this.state);
|
|
|
-
|
|
|
+ console.log("bug", this.state);
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
}
|
|
@@ -569,10 +612,10 @@ class ChangeDetail extends Component {
|
|
|
if (index.key) {
|
|
|
let num = this.state.contactList.findIndex(item => item.key == index.key);
|
|
|
this.state.contactList.splice(num, 1);
|
|
|
- let total = 0
|
|
|
- this.state.contactList.forEach((item) => {
|
|
|
- total += +item.amount
|
|
|
- })
|
|
|
+ let total = 0;
|
|
|
+ this.state.contactList.forEach(item => {
|
|
|
+ total += +item.amount;
|
|
|
+ });
|
|
|
this.setState({
|
|
|
contactList: this.state.contactList,
|
|
|
refundInvoice: total
|
|
@@ -598,10 +641,10 @@ class ChangeDetail extends Component {
|
|
|
|
|
|
this.state.contactList.splice(num, 1);
|
|
|
|
|
|
- let total = 0
|
|
|
- this.state.contactList.forEach((item) => {
|
|
|
- total += +item.amount
|
|
|
- })
|
|
|
+ let total = 0;
|
|
|
+ this.state.contactList.forEach(item => {
|
|
|
+ total += +item.amount;
|
|
|
+ });
|
|
|
this.setState({
|
|
|
contactList: this.state.contactList,
|
|
|
refundInvoice: total
|
|
@@ -752,14 +795,16 @@ class ChangeDetail extends Component {
|
|
|
},
|
|
|
labelB: "应退金额(万元)",
|
|
|
formItemLayoutB: formItemLayout,
|
|
|
- dataB: this.props.data.refundableAmount ? this.props.data.refundableAmount : "0",
|
|
|
+ dataB: this.props.data.refundableAmount
|
|
|
+ ? this.props.data.refundableAmount
|
|
|
+ : "0",
|
|
|
onChangeB: value => {
|
|
|
this.setState({
|
|
|
refundableAmount: value
|
|
|
});
|
|
|
},
|
|
|
mark: true
|
|
|
- },
|
|
|
+ }
|
|
|
// {
|
|
|
// labelA: "备注",
|
|
|
// formItemLayoutA: formItemLayout,
|
|
@@ -869,15 +914,21 @@ class ChangeDetail extends Component {
|
|
|
visible={this.state.previewVisible}
|
|
|
onCancel={() => {
|
|
|
this.setState({ previewVisible: false }, () => {
|
|
|
- this.foo.reset();
|
|
|
+ this.reset();
|
|
|
});
|
|
|
}}
|
|
|
>
|
|
|
<img
|
|
|
alt=""
|
|
|
- style={{ width: "100%" }}
|
|
|
+ style={{
|
|
|
+ width: "100%",
|
|
|
+ transform: `rotate(${this.state.rotateDeg}deg)`
|
|
|
+ }}
|
|
|
src={this.state.previewImage || ""}
|
|
|
/>
|
|
|
+ <Button onClick={this.rotate}>旋转</Button>
|
|
|
+ <Button onClick={this.upImg}>上一张</Button>
|
|
|
+ <Button onClick={this.downImg}>下一张</Button>
|
|
|
</Modal>
|
|
|
<Rizhi changeId={this.props.data.id} />
|
|
|
</Form.Item>
|