index.jsx 51 KB

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