index.jsx 42 KB

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