index.jsx 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. import React, { Component } from "react";
  2. import { Alert, Button, Input, message, Modal, Spin, Form } from "antd";
  3. import $ from "jquery/src/ajax";
  4. const FormItem = Form.Item;
  5. const confirm = Modal.confirm;
  6. class PublicSupplement extends Component {
  7. constructor(props) {
  8. super(props);
  9. this.state = {
  10. visible: false,
  11. loading: false,
  12. supplement: "",
  13. nextPlan:""
  14. };
  15. this.addSupplement = this.addSupplement.bind(this);
  16. }
  17. addSupplement(e) {
  18. this.props.closeModel()
  19. e.stopPropagation();
  20. if (!this.state.supplement) {
  21. message.info("本次公出目标总结不能为空");
  22. return;
  23. }
  24. if (!this.state.nextPlan) {
  25. message.info("下一步公出计划不能为空");
  26. return;
  27. }
  28. this.setState({
  29. loading: true,
  30. });
  31. $.ajax({
  32. method: "post",
  33. dataType: "json",
  34. crossDomain: false,
  35. url: globalConfig.context + "/api/admin/release/addSupplement",
  36. data: {
  37. id: this.props.infor.prid,
  38. supplement:
  39. (this.props.infor.supplement ? this.props.infor.supplement + '/' : "") +
  40. this.state.supplement,
  41. nextPlan: (this.props.infor.nextPlan ? this.props.infor.nextPlan + '/' : "") +
  42. this.state.nextPlan,
  43. },
  44. }).done(
  45. function (data) {
  46. if (!data.error.length) {
  47. message.success("发布成功");
  48. this.setState({
  49. loading: false,
  50. visible: false,
  51. supplement: "",
  52. nextPlan:""
  53. });
  54. this.props.onCancel && this.props.onCancel();
  55. this.props.closeModel()
  56. } else {
  57. message.warning(data.error[0].message);
  58. }
  59. }.bind(this)
  60. );
  61. }
  62. render() {
  63. const formItemLayout = {
  64. labelCol: {
  65. xs: { span: 24 },
  66. sm: { span: 6 },
  67. },
  68. wrapperCol: {
  69. xs: { span: 24 },
  70. sm: { span: 14 },
  71. },
  72. };
  73. return (
  74. <div>
  75. <Button
  76. size="small"
  77. type="primary"
  78. onClick={(e) => {
  79. e.stopPropagation();
  80. this.setState({
  81. visible: true,
  82. });
  83. }}
  84. >
  85. 补写公出补充
  86. </Button>
  87. <Modal
  88. className="customeDetails"
  89. title="本次公出目标总结、下一步公出计划"
  90. width="500px"
  91. visible={this.state.visible}
  92. onOk={() => {
  93. this.setState({
  94. visible: false,
  95. });
  96. }}
  97. onCancel={() => {
  98. this.setState({
  99. visible: false,
  100. });
  101. }}
  102. footer=""
  103. >
  104. <Spin spinning={this.state.loading}>
  105. <div
  106. style={{
  107. display: "flex",
  108. flexFlow: "column",
  109. }}
  110. >
  111. <Form>
  112. <FormItem
  113. {...formItemLayout}
  114. label="本次公出目标总结"
  115. hasFeedback
  116. >
  117. <Input
  118. value={this.state.supplement}
  119. style={{ height: "50px" }}
  120. placeholder="本次公出目标总结:针对今天面谈已经达到的初步目标,需要注意的事项等"
  121. type={"textarea"}
  122. onChange={(e) => {
  123. this.setState({
  124. supplement: e.target.value,
  125. });
  126. }}
  127. />
  128. </FormItem>
  129. <FormItem
  130. {...formItemLayout}
  131. label="下一次公出计划"
  132. hasFeedback
  133. >
  134. <Input
  135. value={this.state.nextPlan}
  136. style={{ height: "50px" }}
  137. placeholder="计划什么时候再次面谈?计划面谈什么内容或者计划达成什么目标?预计什么时候达成合作?"
  138. type={"textarea"}
  139. onChange={(e) => {
  140. this.setState({
  141. nextPlan: e.target.value,
  142. });
  143. }}
  144. />
  145. </FormItem>
  146. </Form>
  147. {/* <div>
  148. <Input
  149. value={this.state.supplement}
  150. style={{ height: "50px" }}
  151. placeholder="本次公出目标总结:针对今天面谈已经达到的初步目标,需要注意的事项等"
  152. type={"textarea"}
  153. onChange={(e) => {
  154. this.setState({
  155. supplement: e.target.value,
  156. });
  157. }}
  158. />
  159. </div>
  160. <Input
  161. value={this.state.supplement}
  162. style={{ height: "50px" }}
  163. placeholder="下一步公出计划:计划什么时候再次面谈?计划面谈什么内容或者计划达成什么目标?预计什么时候达成合作?"
  164. type={"textarea"}
  165. onChange={(e) => {
  166. this.setState({
  167. supplement: e.target.value,
  168. });
  169. }}
  170. /> */}
  171. <div
  172. style={{
  173. paddingTop: "5px",
  174. color: "#F00",
  175. paddingBottom: "15px",
  176. fontSize: "10px",
  177. }}
  178. >
  179. 面谈总结,沟通完后记录今天交流的情况。计划下一次什么时候再面谈?该如何面谈?该如何跟进?
  180. </div>
  181. <Button
  182. type="primary"
  183. style={{ marginTop: "10px", marginBottom: "10px" }}
  184. onClick={(e) => {
  185. let _this = this;
  186. confirm({
  187. title: "确定要提交公出补充吗?",
  188. content: "公出补充提交成功后无法删除",
  189. onOk() {
  190. _this.addSupplement(e);
  191. },
  192. onCancel() {},
  193. });
  194. }}
  195. >
  196. 保存
  197. </Button>
  198. </div>
  199. </Spin>
  200. </Modal>
  201. </div>
  202. );
  203. }
  204. }
  205. export default PublicSupplement;