index.jsx 54 KB

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