index.jsx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import React,{Component} from "react";
  2. import {Alert, Button, Input, message, Modal, Spin} from "antd";
  3. import $ from "jquery/src/ajax";
  4. const confirm = Modal.confirm;
  5. class PublicSupplement extends Component{
  6. constructor(props) {
  7. super(props);
  8. this.state={
  9. visible:false,
  10. loading:false,
  11. supplement:''
  12. }
  13. this.addSupplement = this.addSupplement.bind(this)
  14. }
  15. addSupplement(e){
  16. e.stopPropagation();
  17. if(!this.state.supplement){
  18. message.info('指导意见不能为空')
  19. return;
  20. }
  21. this.setState({
  22. loading: true,
  23. });
  24. $.ajax({
  25. method: "post",
  26. dataType: "json",
  27. crossDomain: false,
  28. url: globalConfig.context + "/api/admin/release/addSupplement",
  29. data: {
  30. id:this.props.infor.prid,
  31. supplement:(this.props.infor.supplement ? this.props.infor.supplement : '')+this.state.supplement
  32. },
  33. }).done(function(data) {
  34. if(!data.error.length) {
  35. message.success("发布成功");
  36. this.setState({
  37. loading: false,
  38. visible: false,
  39. supplement:''
  40. });
  41. this.props.onCancel && this.props.onCancel();
  42. } else {
  43. message.warning(data.error[0].message);
  44. }
  45. }.bind(this));
  46. }
  47. render() {
  48. return (
  49. <div>
  50. <Button size="small" type="primary" onClick={(e)=>{
  51. e.stopPropagation();
  52. this.setState({
  53. visible:true
  54. })
  55. }}>补写公出补充</Button>
  56. <Modal
  57. className="customeDetails"
  58. title="公出补充"
  59. width='500px'
  60. visible={this.state.visible}
  61. onOk={()=>{
  62. this.setState({
  63. visible: false,
  64. })
  65. }}
  66. onCancel={()=>{
  67. this.setState({
  68. visible: false,
  69. })
  70. }}
  71. footer=''
  72. >
  73. <Spin spinning={this.state.loading}>
  74. <div style={{
  75. display:'flex',
  76. flexFlow:'column',
  77. }}>
  78. <Input
  79. value={this.state.supplement}
  80. style={{ height:'100px' }}
  81. placeholder="请输入公出补充"
  82. type={'textarea'}
  83. onChange={(e)=>{
  84. this.setState({
  85. supplement: e.target.value,
  86. })
  87. }}
  88. />
  89. <div style={{paddingTop:'5px',color:'#F00',paddingBottom:'15px',fontSize:'10px'}}>面谈总结,沟通完后记录今天交流的情况。计划下一次什么时候再面谈?该如何面谈?该如何跟进?</div>
  90. <Button
  91. type="primary"
  92. style={{ marginTop: "10px", marginBottom: '10px' }}
  93. onClick={(e)=>{
  94. let _this = this;
  95. confirm({
  96. title: '确定要提交公出补充吗?',
  97. content: '公出补充提交成功后无法删除',
  98. onOk() {
  99. _this.addSupplement(e);
  100. },
  101. onCancel() {},
  102. });
  103. }}
  104. >
  105. 保存
  106. </Button>
  107. </div>
  108. </Spin>
  109. </Modal>
  110. </div>
  111. );
  112. }
  113. }
  114. export default PublicSupplement;