vip.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. import React, { Component } from "react";
  2. import { AutoComplete, Button, Form, Input, message, Modal, Select, Spin, Tag, Radio, DatePicker } from "antd";
  3. import $ from "jquery";
  4. import moment from "moment";
  5. import ImgList from "../../common/imgList";
  6. import { splitUrl } from "../../tools";
  7. import { vipYear } from "../../dataDic";
  8. const FormItem = Form.Item;
  9. const Option = Select.Option;
  10. const RadioGroup = Radio.Group;
  11. const formItemLayout = {
  12. labelCol: { span: 8 },
  13. wrapperCol: { span: 14 },
  14. };
  15. const PicturesWall = React.createClass({
  16. getInitialState() {
  17. return {
  18. previewVisible: false,
  19. previewImage: "",
  20. fileList: this.props.pictureUrl,
  21. };
  22. },
  23. getDefaultProps() {
  24. return {
  25. changeClick: this.modifyChange,
  26. };
  27. },
  28. handleCancel() {
  29. this.setState({ previewVisible: false });
  30. },
  31. handlePreview(file) {
  32. this.setState({
  33. previewImage: file.url || file.thumbUrl,
  34. previewVisible: true,
  35. });
  36. },
  37. handleChange(info) {
  38. let fileList = info.fileList;
  39. this.setState({ fileList });
  40. this.props.fileList(fileList);
  41. },
  42. componentWillReceiveProps(nextProps) {
  43. this.state.fileList = nextProps.pictureUrl;
  44. },
  45. render() {
  46. const { fileList } = this.state;
  47. return (
  48. <div style={{ display: "inline-block" }}>
  49. <ImgList
  50. domId={this.props.domId}
  51. uploadConfig={{
  52. action: globalConfig.context + "/api/admin/orderProject/uploadMemberFile",
  53. data: { sign: "order_invoice_file" },
  54. multiple: true,
  55. listType: "picture-card",
  56. }}
  57. onChange={(infor) => {
  58. this.handleChange(infor);
  59. }}
  60. fileList={fileList}
  61. />
  62. </div>
  63. );
  64. },
  65. });
  66. class ProjectOperationVip extends Component {
  67. constructor(props) {
  68. super(props);
  69. this.state = {
  70. commodityName: undefined,
  71. commodityQuantity: 1,
  72. patentType: 0,
  73. officialCost: '',
  74. costReduction: '',
  75. commodityPrice: '',
  76. main: '',
  77. taskComment: '',
  78. declarationBatch: '',
  79. ifCertificationFee: '',
  80. displayFees: "none",
  81. customerArr: [],
  82. patentTypeList: [],
  83. loading: false,
  84. patentTransfer: props.dataInfor ? props.dataInfor.patentTransfer : 0, //收否为专利转让 0 否 1 是
  85. orgCodeUrl: [],
  86. serviceLife: [],
  87. histYear: [], //已派年份
  88. serviceYear: undefined, //本次派单
  89. isEdit: false,//是否可编辑
  90. contractTerm: [],//合同期
  91. addyear: undefined,//
  92. isGive: undefined,//是否赠送
  93. cPeriod: false, // 合同期是否可编辑
  94. }
  95. this.onSubmit = this.onSubmit.bind(this);
  96. this.httpChange = this.httpChange.bind(this);
  97. this.selectAuto = this.selectAuto.bind(this);
  98. this.setValue = this.setValue.bind(this);
  99. this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
  100. }
  101. componentDidMount() {
  102. this.setValue();
  103. }
  104. setValue() {
  105. const { dataInfor } = this.props;
  106. if (!(dataInfor && Object.keys(dataInfor).length > 0)) {
  107. } else {
  108. this.setState({
  109. fid: dataInfor.id,
  110. commodityId: dataInfor.commodityId, //项目ID
  111. commodityName: dataInfor.commodityName, //项目名称
  112. commodityQuantity: dataInfor.commodityQuantity, // 数量
  113. memberType: dataInfor.memberType.toString(),// 付款情况
  114. taskComment: dataInfor.taskComment, // 备注
  115. orgCodeUrl: dataInfor.pictureUrl ? splitUrl(dataInfor.pictureUrl, ",", globalConfig.avatarHost + "/upload") : [],// 附件
  116. yearSum: dataInfor.yearSum && dataInfor.yearSum.toString() || undefined,//会员总服务年限
  117. serviceLife: JSON.parse(dataInfor.serviceLife) || [],//会员服务年限
  118. serviceYear: dataInfor.serviceYear || undefined,//本次派单
  119. contractTerm: (!dataInfor.contractTerm || (dataInfor.contractTerm.indexOf("-") == -1)) ? [] : JSON.parse(dataInfor.contractTerm),//合同期
  120. });
  121. }
  122. }
  123. //
  124. getOrgCodeUrl(e) {
  125. this.setState({ orgCodeUrl: e });
  126. }
  127. // 新建会员项目
  128. onSubmit() {
  129. let pictureUrl = [];
  130. if (this.state.orgCodeUrl.length) {
  131. let picArr = [];
  132. this.state.orgCodeUrl.map(function (item) {
  133. if (
  134. item.response &&
  135. item.response.data &&
  136. item.response.data.length
  137. ) {
  138. picArr.push(item.response.data);
  139. }
  140. });
  141. pictureUrl = picArr.join(",");
  142. }
  143. if (this.state.commodityId === undefined || !this.state.commodityId) {
  144. message.warning("服务名称不匹配!");
  145. return
  146. }
  147. let reg = /^([0]|[1-9][0-9]*)$/;
  148. if (
  149. !this.state.commodityQuantity ||
  150. !reg.test(this.state.commodityQuantity)
  151. ) {
  152. message.warning("请输入正确商品数量!");
  153. return
  154. }
  155. if (this.state.memberType === undefined) {
  156. message.warning("请选择付款情况!");
  157. return
  158. }
  159. if (this.state.yearSum === undefined) {
  160. message.warning("请选择会员总服务年限!");
  161. return
  162. }
  163. if (this.state.serviceLife.length === 0) {
  164. message.warning("请添加会员服务年限!");
  165. return
  166. }
  167. if (this.state.serviceLife.length != this.state.yearSum) {
  168. message.warning("会员服务年限与总年限不符合!");
  169. return
  170. }
  171. if (this.state.serviceYear === undefined) {
  172. message.warning("请选择本次派单年份!");
  173. return
  174. }
  175. if (this.state.contractTerm.length === 0) {
  176. message.warning("请添加合同期!");
  177. return
  178. }
  179. if (this.state.memberType == "1" || this.state.memberType == "2") {
  180. if (typeof pictureUrl !== "string") {
  181. message.warning("请上传附件!");
  182. return
  183. }
  184. }
  185. this.setState({
  186. loading: true,
  187. });
  188. let infor = {
  189. orderNo: this.props.orderNo, //订单编号
  190. commodityId: this.state.commodityId, //项目编号
  191. commodityName: this.state.commodityName, //项目名称
  192. commodityQuantity: this.state.commodityQuantity, //商品数量
  193. commodityPrice: 0, //签单总价
  194. taskComment: this.state.taskComment, //服务说明
  195. memberType: this.state.memberType,//会员付款状态
  196. yearSum: this.state.yearSum,//会员总服务年限
  197. serviceLife: JSON.stringify(this.state.serviceLife),//会员服务年限
  198. serviceYear: this.state.serviceYear,//本次派单
  199. contractTerm: JSON.stringify(this.state.contractTerm),//合同期
  200. pictureUrl: pictureUrl.length ? pictureUrl : "",//附件
  201. }
  202. $.ajax({
  203. method: "POST",
  204. dataType: "json",
  205. crossDomain: false,
  206. url: globalConfig.context + "/api/admin/orderProject/addMemberProject",
  207. data: infor,
  208. }).done(
  209. function (data) {
  210. this.setState({
  211. loading: false,
  212. });
  213. if (!data.error.length) {
  214. Modal.success({
  215. title: '保存成功!',
  216. content: (
  217. <div>
  218. 已提出会员项目申请!请在
  219. <span style={{ color: "red" }}>“订单管理-我的会员项目“</span>
  220. 跟进查看会员项目的审核状态,审核通过,即表示添加会员项目完成!!!
  221. </div>),
  222. });
  223. this.props.onCancel();
  224. } else {
  225. message.warning(data.error[0].message);
  226. }
  227. }.bind(this)
  228. );
  229. }
  230. // 修改会员项目
  231. onChange() {
  232. let pictureUrl = [];
  233. if (this.state.orgCodeUrl.length) {
  234. let picArr = [];
  235. this.state.orgCodeUrl.map(function (item) {
  236. if (
  237. item.response &&
  238. item.response.data &&
  239. item.response.data.length
  240. ) {
  241. picArr.push(item.response.data);
  242. }
  243. });
  244. pictureUrl = picArr.join(",");
  245. }
  246. if (this.state.commodityId === undefined || !this.state.commodityId) {
  247. message.warning("服务名称不匹配!");
  248. return
  249. }
  250. let reg = /^([0]|[1-9][0-9]*)$/;
  251. if (
  252. !this.state.commodityQuantity ||
  253. !reg.test(this.state.commodityQuantity)
  254. ) {
  255. message.warning("请输入正确商品数量!");
  256. return false;
  257. }
  258. if (this.state.memberType === undefined) {
  259. message.warning("请选择付款情况!");
  260. return
  261. }
  262. if (this.state.yearSum === undefined) {
  263. message.warning("请选择会员总服务年限!");
  264. return
  265. }
  266. if (this.state.serviceLife.length === 0) {
  267. message.warning("请添加会员服务年限!");
  268. return
  269. }
  270. if (this.state.serviceLife.length != this.state.yearSum) {
  271. message.warning("会员服务年限与总年限不符合!");
  272. return
  273. }
  274. if (this.state.serviceYear === undefined) {
  275. message.warning("请选择本次派单年份!");
  276. return
  277. }
  278. if (this.state.contractTerm.length === 0) {
  279. message.warning("请添加合同期!");
  280. return
  281. }
  282. if (this.state.memberType == "1" || this.state.memberType == "2") {
  283. if (typeof pictureUrl !== "string") {
  284. message.warning("请上传附件!");
  285. return
  286. }
  287. }
  288. this.setState({
  289. loading: true,
  290. });
  291. $.ajax({
  292. method: "POST",
  293. dataType: "json",
  294. crossDomain: false,
  295. url: globalConfig.context + "/api/admin/orderProject/updateMemberProject",
  296. data: {
  297. id: this.state.fid, //任务ID
  298. commodityId: this.state.commodityId, //项目ID
  299. commodityName: this.state.commodityName, //项目名称
  300. orderNo: this.props.orderNo, //订单编号
  301. commodityQuantity: this.state.commodityQuantity, //数量
  302. taskComment: this.state.taskComment, //备注
  303. memberType: this.state.memberType,//会员付款状态
  304. yearSum: this.state.yearSum,//会员总服务年限
  305. serviceLife: JSON.stringify(this.state.serviceLife),//会员服务年限
  306. serviceYear: this.state.serviceYear,//本次派单
  307. contractTerm: JSON.stringify(this.state.contractTerm),//合同期
  308. pictureUrl: pictureUrl.length ? pictureUrl : "",//附件
  309. },
  310. }).done(
  311. function (data) {
  312. this.setState({
  313. loading: false,
  314. });
  315. if (!data.error.length) {
  316. message.success("保存成功!");
  317. this.props.onCancel();
  318. } else {
  319. message.warning(data.error[0].message);
  320. }
  321. }.bind(this)
  322. );
  323. }
  324. //
  325. httpChange(e) {
  326. this.setState({
  327. commodityName: e,
  328. });
  329. if (e.length >= 1) {
  330. this.supervisor(e);
  331. }
  332. }
  333. //加载(自动补全)
  334. supervisor(e) {
  335. //服务名称自动补全
  336. let api = "/api/admin/order/getBusinessProjectByName";
  337. $.ajax({
  338. method: "get",
  339. dataType: "json",
  340. crossDomain: false,
  341. url: globalConfig.context + api,
  342. data: {
  343. businessName: e,
  344. cname: "高新会员服务",
  345. },
  346. success: function (data) {
  347. let thedata = data.data;
  348. if (!thedata) {
  349. if (data.error && data.error.length) {
  350. message.warning(data.error[0].message);
  351. }
  352. thedata = {};
  353. }
  354. this.setState({
  355. customerArr: thedata,
  356. });
  357. }.bind(this),
  358. }).always(
  359. function () {
  360. }.bind(this)
  361. );
  362. }
  363. //
  364. selectAuto(value) {
  365. const { customerArr } = this.state;
  366. const { newData } = this.props
  367. const newdataSources = JSON.stringify(customerArr) == "{}" ? [] : customerArr;
  368. let cid = newdataSources.find((item) => item.bname == value).commodityId
  369. this.setState({
  370. commodityName: value,
  371. commodityId: cid,
  372. histYear: [],
  373. });
  374. if (newData && newData.length > 0) {
  375. let llist = []
  376. for (var i = 0; i < newData.length; i++) {
  377. if (newData[i].commodityId == cid) {
  378. llist.push(newData[i].serviceYear)
  379. }
  380. }
  381. this.setState({
  382. histYear: llist
  383. })
  384. for (var i = newData.length - 1; i >= 0; i--) {
  385. if (newData[i].commodityId == cid) {
  386. this.setState({
  387. yearSum: newData[i].yearSum.toString(), // 会员总服务年限
  388. serviceLife: JSON.parse(newData[i].serviceLife) || [], // 会员服务年限
  389. isEdit: true, // 不可编辑
  390. cPeriod: !newData[i].contractTerm ? false : true, //合同期编辑
  391. })
  392. } else {
  393. this.setState({
  394. yearSum: undefined,
  395. serviceLife: [],
  396. isEdit: false, // 可编辑
  397. cPeriod: false,
  398. })
  399. }
  400. return
  401. }
  402. }
  403. }
  404. handleClose(removedTag) {
  405. let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
  406. this.setState({
  407. serviceLife,
  408. // commodityQuantity: serviceLife.length == 0 ? undefined : serviceLife.length,
  409. yearSum: serviceLife.length == 0 ? undefined : serviceLife.length.toString(),
  410. serviceYear: undefined
  411. });
  412. }
  413. render() {
  414. let options = this.state.customerArr.map((group, index) => (
  415. <Select.Option key={index} value={group.bname}>
  416. {group.bname}
  417. </Select.Option>
  418. ));
  419. // let contList = vipYear.map(its => (
  420. // <Option key={its}>{its}</Option>
  421. // ));
  422. const { readOnly } = this.props;
  423. const { histYear, isEdit, cPeriod } = this.state
  424. const { RangePicker } = DatePicker;
  425. return (
  426. <Modal
  427. maskClosable={false}
  428. visible={this.props.visible}
  429. onOk={this.props.onCancel}
  430. onCancel={this.props.onCancel}
  431. width="900px"
  432. title={readOnly ? "会员详情" : !this.state.fid ? "添加会员项目" : "编辑会员项目"}
  433. footer=""
  434. className="admin-desc-content"
  435. >
  436. <Form
  437. layout="horizontal"
  438. >
  439. <Spin spinning={this.state.loading}>
  440. <div className="clearfix">
  441. <FormItem
  442. className="half-item"
  443. {...formItemLayout}
  444. label="服务名称"
  445. >
  446. {readOnly ? this.state.commodityName :
  447. <AutoComplete
  448. className="certain-category-search"
  449. dropdownClassName="certain-category-search-dropdown"
  450. dropdownMatchSelectWidth={false}
  451. style={{ width: "200px" }}
  452. dataSource={options}
  453. placeholder="输入服务名称"
  454. value={this.state.commodityName}
  455. onChange={this.httpChange}
  456. filterOption={true}
  457. onSelect={this.selectAuto}
  458. >
  459. <Input />
  460. </AutoComplete>}
  461. {!readOnly && <span className="mandatory">*</span>}
  462. </FormItem>
  463. <FormItem
  464. className="half-item"
  465. {...formItemLayout}
  466. label="服务数量"
  467. >
  468. {readOnly ? this.state.commodityQuantity :
  469. <Input
  470. placeholder="请输入服务数量"
  471. value={this.state.commodityQuantity}
  472. style={{ width: "200px" }}
  473. disabled={true}
  474. onChange={(e) => {
  475. this.setState({ commodityQuantity: e.target.value });
  476. }}
  477. ref="commodityQuantity"
  478. />}
  479. {!readOnly && <span className="mandatory">*</span>}
  480. <div
  481. style={{
  482. color: "red",
  483. position: "relative",
  484. left: "0"
  485. }}
  486. >注:会员项目单次限制,只能派一年</div>
  487. </FormItem>
  488. <FormItem
  489. className="half-item"
  490. {...formItemLayout}
  491. label="付款情况"
  492. >
  493. {readOnly ?
  494. [
  495. { value: "0", key: "已付会员节点全款" },
  496. { value: "1", key: "已付部分期款,需特批" },
  497. { value: "2", key: "未付款,需特批" }][this.state.memberType] :
  498. <Select
  499. placeholder="选择付款情况"
  500. style={{ width: "200px" }}
  501. value={this.state.memberType}
  502. onChange={(e) => {
  503. this.setState({ memberType: e });
  504. }}
  505. >
  506. {[
  507. { value: "0", key: "已付会员节点全款" },
  508. { value: "1", key: "已付部分期款,需特批" },
  509. { value: "2", key: "未付款,需特批" }].map(function (item) {
  510. return (
  511. <Select.Option key={item.value} value={item.value}>
  512. {item.key}
  513. </Select.Option>
  514. );
  515. })}
  516. </Select>}
  517. {!readOnly && <span className="mandatory">*</span>}
  518. </FormItem>
  519. <FormItem
  520. className="half-item"
  521. {...formItemLayout}
  522. label="会员总服务年限"
  523. >
  524. {
  525. this.state.yearSum == null ? "" :
  526. [
  527. { value: "0", key: "" },
  528. { value: "1", key: "一年" },
  529. { value: "2", key: "二年" },
  530. { value: "3", key: "三年" },
  531. { value: "4", key: "四年" },
  532. { value: "5", key: "五年" },
  533. { value: "6", key: "六年" },
  534. { value: "7", key: "七年" },
  535. { value: "8", key: "八年" },
  536. { value: "9", key: "九年" },
  537. { value: "10", key: "十年" },
  538. ][this.state.yearSum]["key"]
  539. }
  540. </FormItem>
  541. <FormItem
  542. className="half-item"
  543. {...formItemLayout}
  544. label="会员服务年限"
  545. >
  546. <div>
  547. {
  548. this.state.serviceLife.map((tag) =>
  549. <Tag closable={!isEdit} key={tag} afterClose={() => this.handleClose(tag)}>
  550. {tag}
  551. </Tag>
  552. )
  553. }
  554. {
  555. !isEdit && (this.state.serviceLife.length < 10) &&
  556. <Button
  557. size="small"
  558. type="primary"
  559. onClick={() => {
  560. this.setState({
  561. addYears: true,
  562. addyear: undefined,
  563. isGive: undefined,
  564. })
  565. }}>
  566. + 添加服务年限
  567. </Button>
  568. }
  569. </div>
  570. {/* {
  571. readOnly ?
  572. this.state.serviceLife.toString() :
  573. <Select
  574. disabled={isEdit}
  575. mode="multiple"
  576. style={{ width: '200px' }}
  577. placeholder="请选择服务年限"
  578. value={this.state.serviceLife}
  579. onChange={(e) => {
  580. this.setState({
  581. serviceLife: e,
  582. serviceYear: undefined,
  583. })
  584. }}
  585. >
  586. {contList}
  587. </Select>
  588. } */}
  589. {/* {!readOnly && <span className="mandatory">*</span>} */}
  590. </FormItem>
  591. {
  592. this.state.serviceLife.length > 0 &&
  593. <FormItem
  594. className="half-item"
  595. {...formItemLayout}
  596. label="本次派单"
  597. >
  598. {readOnly ?
  599. this.state.serviceYear :
  600. <Select
  601. placeholder="请选择本次派单年份"
  602. style={{ width: "200px" }}
  603. value={this.state.serviceYear}
  604. onChange={(e) => {
  605. console.log("==", e)
  606. this.setState({ serviceYear: e });
  607. }}
  608. >
  609. {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
  610. return (
  611. <Select.Option key={item} disabled={histYear.includes(item)}>
  612. {item}
  613. </Select.Option>
  614. );
  615. })}
  616. </Select>}
  617. {!readOnly && <span className="mandatory">*</span>}
  618. </FormItem>
  619. }
  620. <FormItem
  621. className="half-item"
  622. {...formItemLayout}
  623. label="合同期"
  624. >
  625. {
  626. readOnly ?
  627. !!this.state.contractTerm ? this.state.contractTerm.toString().replace(",", "至") : "" :
  628. <RangePicker
  629. style={{ width: 200 }}
  630. disabled={cPeriod}
  631. value={[
  632. this.state.contractTerm[0]
  633. ? moment(this.state.contractTerm[0])
  634. : null,
  635. this.state.contractTerm[1]
  636. ? moment(this.state.contractTerm[1])
  637. : null,
  638. ]}
  639. onChange={(data, dataString) => {
  640. this.setState({ contractTerm: dataString });
  641. }}
  642. />
  643. // <Select
  644. // mode="multiple"
  645. // style={{ width: '200px' }}
  646. // placeholder="请选择合同期"
  647. // disabled={this.state.cPeriod}
  648. // value={this.state.contractTerm}
  649. // onChange={e => {
  650. // this.setState({
  651. // contractTerm: e,
  652. // })
  653. // }}
  654. // >
  655. // {contList}
  656. // </Select>
  657. }
  658. {!readOnly && <span className="mandatory">*</span>}
  659. </FormItem>
  660. {
  661. (this.state.memberType == "1" || this.state.memberType == "2") &&
  662. <div className="clearfix">
  663. <FormItem
  664. labelCol={{ span: 4 }}
  665. wrapperCol={{ span: 16 }}
  666. label="上传附件"
  667. >
  668. <PicturesWall
  669. domId={'vip'}
  670. fileList={this.getOrgCodeUrl}
  671. pictureUrl={this.state.orgCodeUrl}
  672. />
  673. {!readOnly && <span className="mandatory">*</span>}
  674. </FormItem>
  675. <div style={{ color: "red", marginLeft: 144, marginBottom: 15 }}>
  676. 特批需上传附件图,请上传客户同意我方继续服务并安排给我司付款的聊天记录截图,
  677. <p>若没有客户同意继续服务及会安排付款的截图,特派流程将无法走下去,以免造成派单耽搁</p>
  678. </div>
  679. </div>
  680. }
  681. <div className="clearfix">
  682. <FormItem
  683. labelCol={{ span: 4 }}
  684. wrapperCol={{ span: 16 }}
  685. label="项目说明"
  686. >
  687. {readOnly ? this.state.taskComment :
  688. <Input
  689. type="textarea"
  690. placeholder="如:派2022年会员服务,总会员服务三年,客户付款情况说明"
  691. autosize={{ minRows: 4 }}
  692. value={this.state.taskComment}
  693. onChange={(e) => {
  694. this.setState({ taskComment: e.target.value });
  695. }}
  696. />}
  697. </FormItem>
  698. <div style={{ color: "red", marginLeft: 144 }}>
  699. 请详细说明项目服务时间,总服务时间及付款情况,如:<span style={{ color: "#333" }}>派2022年会员服务,总会员服务三年,客户付款情况说明</span>
  700. <p>未付款时,需进行特批审核,请详细说明预计付款时间等详细情况</p>
  701. </div>
  702. </div>
  703. {readOnly ? null : <FormItem
  704. wrapperCol={{ span: 12, offset: 4 }}
  705. className="half-middle"
  706. >
  707. <Button
  708. className="submitSave"
  709. type="primary"
  710. onClick={() => {
  711. if (!this.state.fid) {
  712. this.onSubmit()
  713. } else {
  714. this.onChange()
  715. }
  716. }}
  717. >
  718. 保存
  719. </Button>
  720. <Button
  721. className="submitSave"
  722. type="ghost"
  723. onClick={this.props.onCancel}
  724. >
  725. 取消
  726. </Button>
  727. </FormItem>}
  728. </div>
  729. </Spin>
  730. </Form>
  731. {
  732. this.state.addYears &&
  733. <Modal
  734. title="添加服务年限"
  735. visible={this.state.addYears}
  736. okText="添加"
  737. onOk={() => {
  738. if (!this.state.addyear) {
  739. message.warn("请选择年份!")
  740. return
  741. }
  742. if (this.state.isGive == undefined) {
  743. message.warn("请选择是否赠送!")
  744. return
  745. }
  746. let slist = this.state.serviceLife
  747. if (this.state.isGive == 0) {
  748. slist.push(this.state.addyear)
  749. } else if (this.state.isGive == 1) {
  750. let newYear = this.state.addyear + "(赠)"
  751. slist.push(newYear)
  752. }
  753. this.setState({
  754. serviceLife: slist,
  755. yearSum: slist.length.toString(),
  756. addYears: false
  757. })
  758. }}
  759. onCancel={() => {
  760. this.setState({
  761. addYears: false
  762. })
  763. }}
  764. >
  765. <Select
  766. style={{ width: '200px', marginRight: 50 }}
  767. placeholder="请选择年份"
  768. onChange={e => {
  769. this.setState({
  770. addyear: e,
  771. })
  772. }}
  773. >
  774. {
  775. vipYear.map(its => (
  776. <Select.Option
  777. key={its}
  778. disabled={this.state.serviceLife.toString().includes(its)}
  779. >{its}</Select.Option>
  780. ))
  781. }
  782. </Select>
  783. <RadioGroup
  784. onChange={e => {
  785. this.setState({
  786. isGive: e.target.value
  787. })
  788. }}
  789. value={this.state.isGive}
  790. >
  791. <Radio value={0}>非赠送</Radio>
  792. <Radio value={1}>赠送</Radio>
  793. </RadioGroup>
  794. </Modal>
  795. }
  796. </Modal>
  797. )
  798. }
  799. }
  800. export default ProjectOperationVip;