index.jsx 41 KB

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