index.jsx 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145
  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.officialCost === 1 ? this.state.costReduction : 0) : 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="1200px"
  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. <FormItem
  607. className="half-item"
  608. labelCol={{ span: 3 }}
  609. wrapperCol={{ span: 14 }}
  610. label="官费:"
  611. style={{
  612. display: this.state.displayFees,
  613. marginLeft: "63px",
  614. }}
  615. >
  616. {readOnly
  617. ? (this.state.officialCost === 1 ? '含官费' : this.state.officialCost === 0 ? '不含官费' : '')
  618. : <Radio.Group
  619. value={this.state.officialCost}
  620. onChange={(e) => {
  621. this.setState({ officialCost: e.target.value });
  622. if (e.target.value === 0) {
  623. this.setState({
  624. costReduction: ''
  625. })
  626. }
  627. }}
  628. >
  629. <Radio value={1}>含官费</Radio>
  630. <Radio value={0}>不含官费</Radio>
  631. </Radio.Group>}
  632. <span style={{ color: "red", marginLeft: "8px" }}>
  633. *
  634. </span>
  635. </FormItem>
  636. {
  637. readOnly ?
  638. <FormItem
  639. className="half-item"
  640. labelCol={{ span: 3 }}
  641. wrapperCol={{ span: 14 }}
  642. label="费减:"
  643. style={{
  644. display: this.state.displayFees,
  645. marginLeft: "63px",
  646. }}
  647. >
  648. {this.state.costReduction === 1 ? '有费减' : this.state.costReduction === 0 ? '无费减' : ''}
  649. <span style={{ color: "red", marginLeft: "8px" }}>
  650. *
  651. </span>
  652. </FormItem>
  653. :
  654. (this.state.patentType === 0 || this.state.patentType === 2) && this.state.officialCost === 1 &&
  655. <FormItem
  656. className="half-item"
  657. labelCol={{ span: 3 }}
  658. wrapperCol={{ span: 14 }}
  659. label="费减:"
  660. style={{
  661. display: this.state.displayFees,
  662. marginLeft: "63px",
  663. }}
  664. >
  665. {/*不含官费或者专利类型不为复审或者申请时置灰*/}
  666. <Radio.Group
  667. disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
  668. value={this.state.costReduction}
  669. onChange={(e) => {
  670. this.setState({ costReduction: e.target.value });
  671. }}
  672. >
  673. <Radio value={1}>有费减</Radio>
  674. <Radio value={0}>无费减</Radio>
  675. </Radio.Group>
  676. <span style={{ color: "red", marginLeft: "8px" }}>
  677. *
  678. </span>
  679. </FormItem>
  680. }
  681. <FormItem
  682. className="half-item"
  683. {...formItemLayout}
  684. label="实签价格(万元)"
  685. >
  686. {readOnly ? this.state.commodityPrice : <Input
  687. type='number'
  688. placeholder="请输入实签价格"
  689. disabled={isEdit}
  690. value={this.state.commodityPrice}
  691. style={{ width: "200px" }}
  692. onChange={(e) => {
  693. this.setState({ commodityPrice: e.target.value });
  694. }}
  695. ref="commodityPrice"
  696. />}
  697. {!readOnly && <span className="mandatory">*</span>}
  698. </FormItem>
  699. {
  700. //审计
  701. this.state.addProjectType == "3" &&
  702. <FormItem
  703. className="half-item"
  704. {...formItemLayout}
  705. label="服务年限"
  706. >
  707. {
  708. readOnly ?
  709. !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
  710. <Select
  711. mode="multiple"
  712. style={{ width: '200px' }}
  713. placeholder="请选择服务年限"
  714. value={this.state.serviceLife}
  715. onChange={(e) => {
  716. this.setState({
  717. serviceLife: e,
  718. })
  719. }}
  720. >
  721. {children}
  722. </Select>
  723. }
  724. {!readOnly && <span className="mandatory">*</span>}
  725. </FormItem>
  726. }
  727. <FormItem
  728. className="half-item"
  729. {...formItemLayout}
  730. label="主要业务"
  731. >
  732. {readOnly ? getboutique(this.state.main) : <Select
  733. placeholder="选择是否为主要业务"
  734. style={{ width: "200px" }}
  735. value={this.state.main}
  736. onChange={(e) => {
  737. this.setState({ main: e });
  738. }}
  739. >
  740. {boutique.map(function (item) {
  741. return (
  742. <Select.Option key={item.value}>
  743. {item.key}
  744. </Select.Option>
  745. );
  746. })}
  747. </Select>}
  748. {!readOnly && <span className="mandatory">*</span>}
  749. </FormItem>
  750. {
  751. isVip == 6 &&
  752. <FormItem
  753. className="half-item"
  754. {...formItemLayout}
  755. label="会员总服务年限"
  756. >
  757. {readOnly ?
  758. !this.state.yearSum ? "" :
  759. [
  760. { value: "0", key: "" },
  761. { value: "1", key: "一年" },
  762. { value: "2", key: "二年" },
  763. { value: "3", key: "三年" },
  764. { value: "4", key: "四年" },
  765. { value: "5", key: "五年" },
  766. ][this.state.yearSum]["key"] :
  767. <Select
  768. placeholder="请选择会员总服务年限"
  769. style={{ width: "200px" }}
  770. disabled={isEdit}
  771. value={typeof (this.state.yearSum) === "number" ? this.state.yearSum.toString() : this.state.yearSum}
  772. onChange={(e) => {
  773. this.setState({
  774. yearSum: e,
  775. serviceLife: [],
  776. serviceYear: undefined,
  777. });
  778. }}
  779. >
  780. {[
  781. { value: "1", key: "一年" },
  782. { value: "2", key: "二年" },
  783. { value: "3", key: "三年" },
  784. { value: "4", key: "四年" },
  785. { value: "5", key: "五年" },
  786. ].map(function (item) {
  787. return (
  788. <Select.Option key={item.value}>
  789. {item.key}
  790. </Select.Option>
  791. );
  792. })}
  793. </Select>}
  794. {!readOnly && <span className="mandatory">*</span>}
  795. </FormItem>
  796. }
  797. {
  798. isVip == 6 &&
  799. <FormItem
  800. className="half-item"
  801. {...formItemLayout}
  802. label="会员服务年限"
  803. >
  804. {
  805. readOnly ?
  806. !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
  807. <div>
  808. {
  809. this.state.serviceLife.map((tag) =>
  810. <Tag closable={!isEdit} key={tag} afterClose={() => this.handleClose(tag)}>
  811. {tag}
  812. </Tag>
  813. )
  814. }
  815. {
  816. !isEdit && (this.state.serviceLife.length < this.state.yearSum) &&
  817. <Button
  818. size="small"
  819. type="primary"
  820. onClick={() => {
  821. this.setState({
  822. addYears: true,
  823. addyear: undefined,
  824. isGive: undefined,
  825. })
  826. }}>
  827. + 添加服务年限
  828. </Button>
  829. }
  830. </div>
  831. // <Select
  832. // mode="multiple"
  833. // style={{ width: '200px' }}
  834. // placeholder="请选择服务年限"
  835. // value={this.state.serviceLife}
  836. // onChange={e => {
  837. // this.setState({
  838. // serviceLife: e,
  839. // serviceYear: undefined,
  840. // })
  841. // }}
  842. // >
  843. // {children}
  844. // </Select>
  845. }
  846. {/* {!readOnly && <span className="mandatory">*</span>} */}
  847. </FormItem>
  848. }
  849. {
  850. isVip == 6 &&
  851. <FormItem
  852. className="half-item"
  853. {...formItemLayout}
  854. label="本次派单"
  855. >
  856. {readOnly ?
  857. this.state.serviceYear :
  858. <Select
  859. placeholder="请选择本次派单年份"
  860. style={{ width: "200px" }}
  861. value={this.state.serviceYear}
  862. onChange={(e) => {
  863. this.setState({ serviceYear: e });
  864. }}
  865. >
  866. {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
  867. return (
  868. <Select.Option key={item} disabled={histYear.includes(item)}>
  869. {item}
  870. </Select.Option>
  871. );
  872. })}
  873. </Select>}
  874. {!readOnly && <span className="mandatory">*</span>}
  875. </FormItem>
  876. }
  877. {
  878. isVip == 6 &&
  879. <FormItem
  880. className="half-item"
  881. {...formItemLayout}
  882. label="合同期"
  883. >
  884. {
  885. readOnly ?
  886. !!this.state.contractTerm ? this.state.contractTerm.toString() : "" :
  887. <Select
  888. mode="multiple"
  889. style={{ width: '200px' }}
  890. placeholder="请选择合同期"
  891. disabled={this.state.cPeriod}
  892. value={this.state.contractTerm}
  893. onChange={e => {
  894. this.setState({
  895. contractTerm: e,
  896. })
  897. }}
  898. >
  899. {children}
  900. </Select>
  901. }
  902. {!readOnly && <span className="mandatory">*</span>}
  903. </FormItem>
  904. }
  905. {/* {
  906. this.state.orgCodeUrl.length > 0 &&
  907. <div className="clearfix">
  908. <FormItem
  909. labelCol={{ span: 4 }}
  910. wrapperCol={{ span: 16 }}
  911. label="附件"
  912. >
  913. <ImgList
  914. fileList={this.state.orgCodeUrl}
  915. domId="publicStatistics"
  916. />
  917. </FormItem>
  918. </div>
  919. } */}
  920. <div className="clearfix">
  921. <FormItem
  922. labelCol={{ span: 4 }}
  923. wrapperCol={{ span: 16 }}
  924. label="项目说明"
  925. >
  926. {readOnly ? this.state.taskComment :
  927. <Input
  928. type="textarea"
  929. placeholder=""
  930. autosize={{ minRows: 4 }}
  931. value={this.state.taskComment}
  932. onChange={(e) => {
  933. this.setState({ taskComment: e.target.value });
  934. }}
  935. />}
  936. </FormItem>
  937. {/* <div style={{ color: "red", marginLeft: 144 }}>
  938. 请详细说明项目服务时间,总服务时间及付款情况,如:<span style={{ color: "#333" }}>派2022年会员服务,总会员服务三年,客户付款情况说明</span>
  939. <p>未付款时,需进行特批审核,请详细说明预计付款时间等详细情况</p>
  940. </div> */}
  941. </div>
  942. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  943. {this.state.addProjectType === 5 ?
  944. <div className="clearfix">
  945. <FormItem
  946. className="half-item"
  947. {...formItemLayout}
  948. label="企业要求申报批次"
  949. >
  950. {readOnly ? (
  951. this.state.declarationBatch === 1 ? '第一批' :
  952. this.state.declarationBatch === 2 ? '第二批' :
  953. this.state.declarationBatch === 3 ? '第三批' :
  954. this.state.declarationBatch === 4 ? '第四批' : '未知'
  955. ) :
  956. <Select
  957. placeholder="请选择企业要求申报批次"
  958. style={{ width: "200px" }}
  959. value={this.state.declarationBatch}
  960. onChange={(e) => {
  961. this.setState({ declarationBatch: e });
  962. }}
  963. >
  964. <Select.Option value={1}>
  965. 第一批
  966. </Select.Option>
  967. <Select.Option value={2}>
  968. 第二批
  969. </Select.Option>
  970. <Select.Option value={3}>
  971. 第三批
  972. </Select.Option>
  973. <Select.Option value={4}>
  974. 第四批
  975. </Select.Option>
  976. </Select>}
  977. {!readOnly && <span className="mandatory">*</span>}
  978. </FormItem>
  979. <FormItem
  980. className="half-item"
  981. {...formItemLayout}
  982. label="申报年份"
  983. >
  984. {
  985. readOnly ? this.state.serviceYear :
  986. <Select
  987. style={{ width: '200px' }}
  988. placeholder="请选择申报年份"
  989. value={this.state.serviceYear}
  990. onChange={e => {
  991. this.setState({
  992. serviceYear: e,
  993. })
  994. }}
  995. >
  996. {
  997. vipYear.map(its => (
  998. <Option key={its}>{its}</Option>
  999. ))
  1000. }
  1001. </Select>
  1002. }
  1003. {!readOnly && <span className="mandatory">*</span>}
  1004. </FormItem>
  1005. </div> : null
  1006. }
  1007. {
  1008. this.props.isIso || this.state.isIso ? <div className="clearfix">
  1009. <FormItem
  1010. className="half-item"
  1011. {...formItemLayout}
  1012. label="是否包含认证费用"
  1013. >
  1014. {readOnly ? (
  1015. this.state.ifCertificationFee == "1" ? '包含' :
  1016. this.state.ifCertificationFee == "0" ? '不包含' : '未知'
  1017. ) : <Select
  1018. placeholder="请选择是否包含认证费用"
  1019. style={{ width: "200px" }}
  1020. value={this.state.ifCertificationFee}
  1021. onChange={(e) => {
  1022. this.setState({ ifCertificationFee: e });
  1023. }}
  1024. >
  1025. <Select.Option value={"0"}>否</Select.Option>
  1026. <Select.Option value={"1"}>是</Select.Option>
  1027. </Select>}
  1028. {!readOnly && <span className="mandatory">*</span>}
  1029. </FormItem>
  1030. </div> : null
  1031. }
  1032. {readOnly ? null : <FormItem
  1033. wrapperCol={{ span: 12, offset: 4 }}
  1034. className="half-middle"
  1035. >
  1036. <Button
  1037. className="submitSave"
  1038. type="primary"
  1039. onClick={() => {
  1040. if (this.state.jid) {
  1041. this.onChange();
  1042. } else {
  1043. this.onSubmit();
  1044. }
  1045. }}
  1046. >
  1047. 保存
  1048. </Button>
  1049. <Button
  1050. className="submitSave"
  1051. type="ghost"
  1052. onClick={this.props.onCancel}
  1053. >
  1054. 取消
  1055. </Button>
  1056. </FormItem>}
  1057. </div>
  1058. </Spin>
  1059. </Form>
  1060. {
  1061. this.state.addYears &&
  1062. <Modal
  1063. title="添加服务年限"
  1064. visible={this.state.addYears}
  1065. okText="添加"
  1066. onOk={() => {
  1067. if (!this.state.addyear) {
  1068. message.warn("请选择年份!")
  1069. return
  1070. }
  1071. if (this.state.isGive == undefined) {
  1072. message.warn("请选择是否赠送!")
  1073. return
  1074. }
  1075. let slist = this.state.serviceLife
  1076. if (this.state.isGive == 0) {
  1077. slist.push(this.state.addyear)
  1078. } else if (this.state.isGive == 1) {
  1079. let newYear = this.state.addyear + "(赠)"
  1080. slist.push(newYear)
  1081. }
  1082. this.setState({
  1083. serviceLife: slist,
  1084. addYears: false
  1085. })
  1086. }}
  1087. onCancel={() => {
  1088. this.setState({
  1089. addYears: false
  1090. })
  1091. }}
  1092. >
  1093. <Select
  1094. style={{ width: '200px', marginRight: 50 }}
  1095. placeholder="请选择年份"
  1096. onChange={e => {
  1097. this.setState({
  1098. addyear: e,
  1099. })
  1100. }}
  1101. >
  1102. {
  1103. vipYear.map(its => (
  1104. <Option
  1105. key={its}
  1106. disabled={this.state.serviceLife.toString().includes(its)}
  1107. >{its}</Option>
  1108. ))
  1109. }
  1110. </Select>
  1111. <RadioGroup
  1112. onChange={e => {
  1113. this.setState({
  1114. isGive: e.target.value
  1115. })
  1116. }}
  1117. value={this.state.isGive}
  1118. >
  1119. <Radio value={0}>非赠送</Radio>
  1120. <Radio value={1}>赠送</Radio>
  1121. </RadioGroup>
  1122. </Modal>
  1123. }
  1124. </Modal >
  1125. )
  1126. }
  1127. }
  1128. export default ProjectOperation;