index.jsx 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  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="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. <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. { value: "6", key: "六年" },
  767. { value: "7", key: "七年" },
  768. { value: "8", key: "八年" },
  769. { value: "9", key: "九年" },
  770. { value: "10", key: "十年" },
  771. ][this.state.yearSum]["key"] :
  772. <Select
  773. placeholder="请选择会员总服务年限"
  774. style={{ width: "200px" }}
  775. disabled={isEdit}
  776. value={typeof (this.state.yearSum) === "number" ? this.state.yearSum.toString() : this.state.yearSum}
  777. onChange={(e) => {
  778. this.setState({
  779. yearSum: e,
  780. serviceLife: [],
  781. serviceYear: undefined,
  782. });
  783. }}
  784. >
  785. {[
  786. { value: "1", key: "一年" },
  787. { value: "2", key: "二年" },
  788. { value: "3", key: "三年" },
  789. { value: "4", key: "四年" },
  790. { value: "5", key: "五年" },
  791. { value: "6", key: "六年" },
  792. { value: "7", key: "七年" },
  793. { value: "8", key: "八年" },
  794. { value: "9", key: "九年" },
  795. { value: "10", key: "十年" },
  796. ].map(function (item) {
  797. return (
  798. <Select.Option key={item.value}>
  799. {item.key}
  800. </Select.Option>
  801. );
  802. })}
  803. </Select>}
  804. {!readOnly && <span className="mandatory">*</span>}
  805. </FormItem>
  806. }
  807. {
  808. isVip == 6 &&
  809. <FormItem
  810. className="half-item"
  811. {...formItemLayout}
  812. label="会员服务年限"
  813. >
  814. {
  815. readOnly ?
  816. !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
  817. <div>
  818. {
  819. this.state.serviceLife.map((tag) =>
  820. <Tag closable={!isEdit} key={tag} afterClose={() => this.handleClose(tag)}>
  821. {tag}
  822. </Tag>
  823. )
  824. }
  825. {
  826. !isEdit && (this.state.serviceLife.length < this.state.yearSum) &&
  827. <Button
  828. size="small"
  829. type="primary"
  830. onClick={() => {
  831. this.setState({
  832. addYears: true,
  833. addyear: undefined,
  834. isGive: undefined,
  835. })
  836. }}>
  837. + 添加服务年限
  838. </Button>
  839. }
  840. </div>
  841. // <Select
  842. // mode="multiple"
  843. // style={{ width: '200px' }}
  844. // placeholder="请选择服务年限"
  845. // value={this.state.serviceLife}
  846. // onChange={e => {
  847. // this.setState({
  848. // serviceLife: e,
  849. // serviceYear: undefined,
  850. // })
  851. // }}
  852. // >
  853. // {children}
  854. // </Select>
  855. }
  856. {/* {!readOnly && <span className="mandatory">*</span>} */}
  857. </FormItem>
  858. }
  859. {
  860. isVip == 6 &&
  861. <FormItem
  862. className="half-item"
  863. {...formItemLayout}
  864. label="本次派单"
  865. >
  866. {readOnly ?
  867. this.state.serviceYear :
  868. <Select
  869. placeholder="请选择本次派单年份"
  870. style={{ width: "200px" }}
  871. value={this.state.serviceYear}
  872. onChange={(e) => {
  873. this.setState({ serviceYear: e });
  874. }}
  875. >
  876. {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
  877. return (
  878. <Select.Option key={item} disabled={histYear.includes(item)}>
  879. {item}
  880. </Select.Option>
  881. );
  882. })}
  883. </Select>}
  884. {!readOnly && <span className="mandatory">*</span>}
  885. </FormItem>
  886. }
  887. {
  888. isVip == 6 &&
  889. <FormItem
  890. className="half-item"
  891. {...formItemLayout}
  892. label="合同期"
  893. >
  894. {
  895. readOnly ?
  896. !!this.state.contractTerm ? this.state.contractTerm.toString() : "" :
  897. <Select
  898. mode="multiple"
  899. style={{ width: '200px' }}
  900. placeholder="请选择合同期"
  901. disabled={this.state.cPeriod}
  902. value={this.state.contractTerm}
  903. onChange={e => {
  904. this.setState({
  905. contractTerm: e,
  906. })
  907. }}
  908. >
  909. {children}
  910. </Select>
  911. }
  912. {!readOnly && <span className="mandatory">*</span>}
  913. </FormItem>
  914. }
  915. {/* {
  916. this.state.orgCodeUrl.length > 0 &&
  917. <div className="clearfix">
  918. <FormItem
  919. labelCol={{ span: 4 }}
  920. wrapperCol={{ span: 16 }}
  921. label="附件"
  922. >
  923. <ImgList
  924. fileList={this.state.orgCodeUrl}
  925. domId="publicStatistics"
  926. />
  927. </FormItem>
  928. </div>
  929. } */}
  930. <div className="clearfix">
  931. <FormItem
  932. labelCol={{ span: 4 }}
  933. wrapperCol={{ span: 16 }}
  934. label="项目说明"
  935. >
  936. {readOnly ? this.state.taskComment :
  937. <Input
  938. type="textarea"
  939. placeholder=""
  940. autosize={{ minRows: 4 }}
  941. value={this.state.taskComment}
  942. onChange={(e) => {
  943. this.setState({ taskComment: e.target.value });
  944. }}
  945. />}
  946. </FormItem>
  947. {/* <div style={{ color: "red", marginLeft: 144 }}>
  948. 请详细说明项目服务时间,总服务时间及付款情况,如:<span style={{ color: "#333" }}>派2022年会员服务,总会员服务三年,客户付款情况说明</span>
  949. <p>未付款时,需进行特批审核,请详细说明预计付款时间等详细情况</p>
  950. </div> */}
  951. </div>
  952. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  953. {this.state.addProjectType === 5 ?
  954. <div className="clearfix">
  955. <FormItem
  956. className="half-item"
  957. {...formItemLayout}
  958. label="企业要求申报批次"
  959. >
  960. {readOnly ? (
  961. this.state.declarationBatch === 1 ? '第一批' :
  962. this.state.declarationBatch === 2 ? '第二批' :
  963. this.state.declarationBatch === 3 ? '第三批' :
  964. this.state.declarationBatch === 4 ? '第四批' : '未知'
  965. ) :
  966. <Select
  967. placeholder="请选择企业要求申报批次"
  968. style={{ width: "200px" }}
  969. value={this.state.declarationBatch}
  970. onChange={(e) => {
  971. this.setState({ declarationBatch: e });
  972. }}
  973. >
  974. <Select.Option value={1}>
  975. 第一批
  976. </Select.Option>
  977. <Select.Option value={2}>
  978. 第二批
  979. </Select.Option>
  980. <Select.Option value={3}>
  981. 第三批
  982. </Select.Option>
  983. <Select.Option value={4}>
  984. 第四批
  985. </Select.Option>
  986. </Select>}
  987. {!readOnly && <span className="mandatory">*</span>}
  988. </FormItem>
  989. <FormItem
  990. className="half-item"
  991. {...formItemLayout}
  992. label="申报年份"
  993. >
  994. {
  995. readOnly ? this.state.serviceYear :
  996. <Select
  997. style={{ width: '200px' }}
  998. placeholder="请选择申报年份"
  999. value={this.state.serviceYear}
  1000. onChange={e => {
  1001. this.setState({
  1002. serviceYear: e,
  1003. })
  1004. }}
  1005. >
  1006. {
  1007. vipYear.map(its => (
  1008. <Option key={its}>{its}</Option>
  1009. ))
  1010. }
  1011. </Select>
  1012. }
  1013. {!readOnly && <span className="mandatory">*</span>}
  1014. </FormItem>
  1015. </div> : null
  1016. }
  1017. {
  1018. this.props.isIso || this.state.isIso ? <div className="clearfix">
  1019. <FormItem
  1020. className="half-item"
  1021. {...formItemLayout}
  1022. label="是否包含认证费用"
  1023. >
  1024. {readOnly ? (
  1025. this.state.ifCertificationFee == "1" ? '包含' :
  1026. this.state.ifCertificationFee == "0" ? '不包含' : '未知'
  1027. ) : <Select
  1028. placeholder="请选择是否包含认证费用"
  1029. style={{ width: "200px" }}
  1030. value={this.state.ifCertificationFee}
  1031. onChange={(e) => {
  1032. this.setState({ ifCertificationFee: e });
  1033. }}
  1034. >
  1035. <Select.Option value={"0"}>否</Select.Option>
  1036. <Select.Option value={"1"}>是</Select.Option>
  1037. </Select>}
  1038. {!readOnly && <span className="mandatory">*</span>}
  1039. </FormItem>
  1040. </div> : null
  1041. }
  1042. {readOnly ? null : <FormItem
  1043. wrapperCol={{ span: 12, offset: 4 }}
  1044. className="half-middle"
  1045. >
  1046. <Button
  1047. className="submitSave"
  1048. type="primary"
  1049. onClick={() => {
  1050. if (this.state.jid) {
  1051. this.onChange();
  1052. } else {
  1053. this.onSubmit();
  1054. }
  1055. }}
  1056. >
  1057. 保存
  1058. </Button>
  1059. <Button
  1060. className="submitSave"
  1061. type="ghost"
  1062. onClick={this.props.onCancel}
  1063. >
  1064. 取消
  1065. </Button>
  1066. </FormItem>}
  1067. </div>
  1068. </Spin>
  1069. </Form>
  1070. {
  1071. this.state.addYears &&
  1072. <Modal
  1073. title="添加服务年限"
  1074. visible={this.state.addYears}
  1075. okText="添加"
  1076. onOk={() => {
  1077. if (!this.state.addyear) {
  1078. message.warn("请选择年份!")
  1079. return
  1080. }
  1081. if (this.state.isGive == undefined) {
  1082. message.warn("请选择是否赠送!")
  1083. return
  1084. }
  1085. let slist = this.state.serviceLife
  1086. if (this.state.isGive == 0) {
  1087. slist.push(this.state.addyear)
  1088. } else if (this.state.isGive == 1) {
  1089. let newYear = this.state.addyear + "(赠)"
  1090. slist.push(newYear)
  1091. }
  1092. this.setState({
  1093. serviceLife: slist,
  1094. addYears: false
  1095. })
  1096. }}
  1097. onCancel={() => {
  1098. this.setState({
  1099. addYears: false
  1100. })
  1101. }}
  1102. >
  1103. <Select
  1104. style={{ width: '200px', marginRight: 50 }}
  1105. placeholder="请选择年份"
  1106. onChange={e => {
  1107. this.setState({
  1108. addyear: e,
  1109. })
  1110. }}
  1111. >
  1112. {
  1113. vipYear.map(its => (
  1114. <Option
  1115. key={its}
  1116. disabled={this.state.serviceLife.toString().includes(its)}
  1117. >{its}</Option>
  1118. ))
  1119. }
  1120. </Select>
  1121. <RadioGroup
  1122. onChange={e => {
  1123. this.setState({
  1124. isGive: e.target.value
  1125. })
  1126. }}
  1127. value={this.state.isGive}
  1128. >
  1129. <Radio value={0}>非赠送</Radio>
  1130. <Radio value={1}>赠送</Radio>
  1131. </RadioGroup>
  1132. </Modal>
  1133. }
  1134. </Modal >
  1135. )
  1136. }
  1137. }
  1138. export default ProjectOperation;