newEditProject.jsx 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885
  1. import React, { Component } from "react";
  2. import {
  3. AutoComplete, Button, Icon, Form, Input, message,
  4. Modal, Radio, Select, Spin, Tag, DatePicker,
  5. Checkbox
  6. } from "antd";
  7. import { boutique } from "../../dataDic";
  8. import $, { error } from "jquery";
  9. import { getboutique, splitUrl } from "../../tools";
  10. import moment from "moment";
  11. import { vipYear, YearList } from "../../dataDic";
  12. import ImgList from "../imgList";
  13. import "./project.css";
  14. const FormItem = Form.Item;
  15. const Option = Select.Option;
  16. const RadioGroup = Radio.Group;
  17. const confirm = Modal.confirm;
  18. const CheckboxGroup = Checkbox.Group;
  19. const formItemLayout = {
  20. labelCol: { span: 8 },
  21. wrapperCol: { span: 14 },
  22. };
  23. /**
  24. * 编辑项目 和 查看项目详情
  25. */
  26. class newEditProject extends Component {
  27. constructor(props) {
  28. super(props);
  29. this.state = {
  30. commodityName: '',//项目名称
  31. commodityQuantity: '',//项目数量
  32. patentType: 0,
  33. officialCost: '',
  34. costReduction: '',
  35. commodityPrice: '',//项目价格
  36. main: '',//主要项目 0否 1是
  37. lastYearCapital: '',//上年度总资本
  38. lastYearIncome: '',//上年度总资本
  39. taskComment: '',//项目说明
  40. declarationBatch: '',
  41. ifCertificationFee: '',
  42. displayFees: "none",
  43. customerArr: [],
  44. patentTypeList: [],
  45. loading: false,
  46. orgCodeUrl: [],
  47. patentTransfer: props.dataInfor ? props.dataInfor.patentTransfer : 0, //收否为专利转让 0 否 1 是
  48. serviceLife: [],
  49. isVip: undefined,
  50. histYear: [],
  51. contractTerm: [],//合同期
  52. addyear: undefined,//
  53. isGive: undefined,//是否赠送
  54. splitList: [],//子集
  55. addFrom: false,
  56. isMedit: 0,
  57. isYear: false,//审计是否需要修改上年度年份
  58. checkType: [], //会员项目勾选的类型
  59. newCheck: [], // 子项勾选的类型
  60. }
  61. this.getpatentTypeList = this.getpatentTypeList.bind(this);
  62. this.setValue = this.setValue.bind(this);
  63. }
  64. componentDidMount() {
  65. this.getpatentTypeList();
  66. this.setValue();
  67. }
  68. /**
  69. * 获取高新会员勾选类型
  70. * @param {Array} checkTypeList 当前勾选的列表
  71. * @returns {Array} newCheckType
  72. */
  73. getCheckTypeList(checkTypeList) {
  74. let newCheckType = [];
  75. if (checkTypeList instanceof Array) {
  76. // 高新会员
  77. let htMember = 0;
  78. // 加计扣除
  79. let additionalDeduction = 0;
  80. // 研发奖补
  81. let rdAwardsubsidy = 0;
  82. checkTypeList.map(item => {
  83. if (item.htMember == 1) {
  84. htMember = 1;
  85. }
  86. if (item.additionalDeduction == 1) {
  87. additionalDeduction = 1;
  88. }
  89. if (item.rdAwardsubsidy == 1) {
  90. rdAwardsubsidy = 1;
  91. }
  92. });
  93. if (htMember) {
  94. newCheckType.push(1);
  95. }
  96. if (additionalDeduction) {
  97. newCheckType.push(2);
  98. }
  99. if (rdAwardsubsidy) {
  100. newCheckType.push(3);
  101. }
  102. }
  103. return newCheckType;
  104. }
  105. setValue() {
  106. const { dataInfor, children = "splitList", type = "", readOnly } = this.props;
  107. if (!(dataInfor && Object.keys(dataInfor).length > 0)) { return; }
  108. if (type == "change") {
  109. // 变更编辑 taskType 0通用 1专利 2软著 3审计 4双软 5高新 6商标
  110. if (dataInfor.taskType === 1) {
  111. this.setState({
  112. displayFees: "block",
  113. costReduction: dataInfor.costReduction,
  114. officialCost: dataInfor.officialCost,
  115. patentType: dataInfor.patentType ? dataInfor.patentType : 0,
  116. });
  117. } else {
  118. this.setState({
  119. displayFees: "none",
  120. });
  121. }
  122. } else {
  123. // 正常编辑 type 0通用 1专利 2软著 3审计 4双软 5高新 6商标
  124. if (dataInfor.type === 1) {
  125. this.setState({
  126. displayFees: "block",
  127. costReduction: dataInfor.costReduction,
  128. officialCost: dataInfor.officialCost,
  129. patentType: dataInfor.patentType ? dataInfor.patentType : 0,
  130. });
  131. } else {
  132. this.setState({
  133. displayFees: "none",
  134. });
  135. }
  136. }
  137. let splitList = [];
  138. if (!!dataInfor.splitList) {
  139. splitList = dataInfor.splitList.filter(item => item.type != 3);
  140. }
  141. if (!!dataInfor.list) {
  142. splitList = dataInfor.list.filter(item => item.type != 3);;
  143. }
  144. let llist = []
  145. for (var i = 0; i < splitList.length; i++) {
  146. // if (dataInfor.splitList[i].commodityId == dataInfor.commodityId) {
  147. // llist.push(dataInfor.splitList[i].serviceYear != dataInfor.serviceYear && dataInfor.splitList[i].serviceYear)
  148. // }
  149. if (splitList[i].type != 3) {
  150. llist.push(splitList[i].serviceYear)
  151. }
  152. }
  153. let newCheckType = [];
  154. if ([0, 2, 3].indexOf(dataInfor.projectType) > -1) {
  155. // 单边会员和简单会员
  156. newCheckType = [1];
  157. } else {
  158. newCheckType = this.getCheckTypeList(splitList);
  159. }
  160. // if (dataInfor.projectType == 1) {
  161. // if (dataInfor.htMember == 1) {
  162. // newCheckType.push(1)
  163. // }
  164. // if (dataInfor.additionalDeduction == 1) {
  165. // newCheckType.push(2)
  166. // }
  167. // if (dataInfor.rdAwardsubsidy == 1) {
  168. // newCheckType.push(3)
  169. // }
  170. // }
  171. this.setState({
  172. jid: dataInfor.id, //项目ID
  173. kid: dataInfor.commodityId, //商品ID
  174. commodityName: dataInfor.commodityName, //项目名称
  175. commodityPrice: dataInfor.commodityPrice, //金额
  176. commodityQuantity: dataInfor.commodityQuantity, //数量
  177. patentTypeName: dataInfor.patentTypeName,//专利类型名称
  178. taskComment: dataInfor.cSort == 6 ? undefined : dataInfor.taskComment, //备注
  179. main: dataInfor.main.toString(), //是否为主要
  180. addState: 0,
  181. addnextVisible: true,
  182. addProjectType: type == "change" ? dataInfor.taskType : dataInfor.type,
  183. declarationBatch: dataInfor.declarationBatch || 1,//申报批次(只有高新有)
  184. ifCertificationFee: isNaN(parseInt(dataInfor.ifCertificationFee)) ? '' : dataInfor.ifCertificationFee,//是否包含认证费
  185. isIso: dataInfor.commodityName.indexOf("贯标") !== -1,
  186. orgCodeUrl: dataInfor.pictureUrl ? splitUrl(dataInfor.pictureUrl, ",", globalConfig.avatarHost + "/upload") : [],//
  187. isYear: !dataInfor.lastYear ? true : false,//
  188. lastYear: dataInfor.lastYear,//上年度年份
  189. lastYearCapital: dataInfor.lastYearCapital,//上年度总资本
  190. lastYearIncome: dataInfor.lastYearIncome,//上年度总收入
  191. isVip: dataInfor.cSort,
  192. yearSum: dataInfor.yearSum,//会员总服务年限
  193. serviceLife: !dataInfor.serviceLife ? [] : JSON.parse(dataInfor.serviceLife), // 会员服务年限
  194. contractTerm: (!dataInfor.contractTerm || (dataInfor.contractTerm.indexOf("-") == -1)) ? [] : JSON.parse(dataInfor.contractTerm), // 合同期
  195. serviceYear: dataInfor.cSort == 6 ? undefined : dataInfor.serviceYear,//本次派单
  196. histYear: llist, // 本次已派单
  197. oldSplitList: JSON.parse(JSON.stringify(splitList)),
  198. splitList,
  199. tid: dataInfor.id, // 父级项目id
  200. isMedit: readOnly ? 3 : dataInfor.cSort == 6 ? 0 : 1,// 会员项目默认0不可编辑 普通项目默认1可编辑
  201. projectType: dataInfor.projectType, // 会员项目类型
  202. checkType: newCheckType, // 会员项目勾选类型
  203. technologyProjectType: dataInfor.technologyProjectType, //科技项目
  204. ordinaryRisk: dataInfor.ordinaryRisk, //知识产权申请类型
  205. days: dataInfor.days, // 软著 天数
  206. scheme: dataInfor.scheme, // 软著 方案
  207. });
  208. }
  209. onChange(text) {
  210. const { flag, message } = this.validSunProTypeIsNull();
  211. if (!flag) {
  212. message.warning(message);
  213. return;
  214. }
  215. const updatedList = this.getUpdatedSubProject();
  216. let subLen = updatedList.length;
  217. if (subLen === 0) {
  218. this.saveParentProject(text);
  219. }
  220. updatedList.map((item) => this.handleUpdateSubProject(item, () => {
  221. subLen -= 1;
  222. if (subLen === 0) {
  223. this.saveParentProject(text);
  224. }
  225. }, () => {
  226. subLen -= 1;
  227. this.saveParentProject(text);
  228. }));
  229. }
  230. saveParentProject(text) {
  231. const { type = "", dataInfor } = this.props
  232. if (isNaN(parseFloat(this.state.commodityPrice))) {
  233. message.warning("请输入正确的金额!");
  234. return false;
  235. }
  236. let reg = /^([0]|[1-9][0-9]*)$/;
  237. if (
  238. !this.state.commodityQuantity ||
  239. !reg.test(this.state.commodityQuantity)
  240. ) {
  241. message.warning("请输入正确服务数量!");
  242. return false;
  243. }
  244. // 3审计
  245. if (this.state.addProjectType == "3") {
  246. if (this.state.serviceLife.length === 0) {
  247. message.warning("请选择服务年限!");
  248. return
  249. }
  250. if (this.state.serviceLife.length != this.state.commodityQuantity) {
  251. message.warning("服务数量与服务年限不符!");
  252. return
  253. }
  254. if (this.state.isYear && !this.state.lastYear) {
  255. message.warning("请选择上年度年份!");
  256. return
  257. }
  258. if (isNaN(parseFloat(this.state.lastYearCapital))) {
  259. message.warning("请输入正确的企业上年度总资本!");
  260. return
  261. }
  262. if (isNaN(parseFloat(this.state.lastYearIncome))) {
  263. message.warning("请输入正确的企业上年度总收入!");
  264. return
  265. }
  266. }
  267. if (!this.state.main) {
  268. message.warning("请选择是否为主要项目!");
  269. return false;
  270. }
  271. // 5高新
  272. if (this.state.addProjectType === 5) {
  273. if (!this.state.declarationBatch) {
  274. message.warning("请选择企业要求申报批次!");
  275. return
  276. }
  277. if (!this.state.serviceYear) {
  278. message.warning("请选择申报年份!");
  279. return
  280. }
  281. }
  282. if (this.state.isVip == 6) {
  283. // if (this.state.yearSum === undefined) {
  284. // message.warning("请选择会员总服务年限!");
  285. // return
  286. // }
  287. if (this.state.serviceLife.length === 0) {
  288. message.warning("请添加会员服务年限!");
  289. return
  290. }
  291. // if (this.state.serviceLife.length != this.state.yearSum) {
  292. // message.warning("会员服务年限与总年限不符合!");
  293. // return
  294. // }
  295. // if (this.state.serviceYear === undefined) {
  296. // message.warning("请选择本次派单年份!");
  297. // return
  298. // }
  299. // if (this.state.projectType == 1 && !this.state.checkType.includes(1)) {
  300. // message.warning("请勾选高新会员");
  301. // return
  302. // }
  303. if (this.state.contractTerm.length === 0 || this.state.contractTerm[1] == "") {
  304. message.warning("请填写合同期!");
  305. return
  306. }
  307. }
  308. if (this.state.isVip == 3) { //科技项目
  309. if (!this.state.technologyProjectType && this.state.technologyProjectType != 0) {
  310. message.warning("请选择科技项目!");
  311. return
  312. }
  313. }
  314. if (this.state.isVip == 8 && this.state.addProjectType != 2) { //知识产权
  315. if (!this.state.ordinaryRisk && this.state.ordinaryRisk != 0) {
  316. message.warning("请选择申请类型!");
  317. return
  318. }
  319. }
  320. if (this.state.addProjectType == 2) {
  321. if (!this.state.days && this.state.days != 0) {//天数
  322. message.warning("请选择是否加急!");
  323. return
  324. }
  325. if (!this.state.scheme && this.state.scheme != 0) {//方案
  326. message.warning("请选择是否有方案!");
  327. return
  328. }
  329. }
  330. this.setState({
  331. loading: true,
  332. });
  333. let infor = {
  334. id: this.state.jid, //项目ID
  335. commodityId: this.state.kid, //商品ID
  336. orderNo: this.props.orderNo, //订单编号
  337. main: this.state.main, //是否为主要
  338. commodityPrice: this.state.commodityPrice, //金额
  339. commodityQuantity: this.state.commodityQuantity, //数量
  340. taskComment: this.state.taskComment, //备注
  341. }
  342. if (this.state.displayFees === 'block') {
  343. infor.officialCost = this.state.officialCost //是否有官费
  344. infor.costReduction = (this.state.patentType === 0 || this.state.patentType === 2) ? this.state.costReduction : 0//是否有费减
  345. infor.patentType = this.state.patentType //专利类型
  346. }
  347. if (this.state.isIso) {
  348. infor.ifCertificationFee = this.state.ifCertificationFee || undefined;//是否包含认证费用
  349. }
  350. if (this.state.addProjectType == "3") {//审计
  351. infor.serviceLife = JSON.stringify(this.state.serviceLife) //服务年限
  352. infor.lastYear = this.state.lastYear //上年度年份
  353. infor.lastYearCapital = this.state.lastYearCapital //上年度总资本
  354. infor.lastYearIncome = this.state.lastYearIncome //上年度总收入
  355. }
  356. if (this.state.addProjectType == "5") {//高新
  357. infor.declarationBatch = this.state.declarationBatch || undefined//申报批次
  358. infor.serviceYear = this.state.serviceYear //申报年份
  359. }
  360. if (this.state.isVip == 6) {//会员
  361. infor.yearSum = this.state.yearSum //会员总服务年限
  362. infor.serviceLife = JSON.stringify(this.state.serviceLife) //会员服务年限
  363. // infor.serviceYear = this.state.serviceYear //本次派单年份
  364. infor.contractTerm = JSON.stringify(this.state.contractTerm)//合同期
  365. if (this.state.projectType == 1) {
  366. const checkType = this.getCheckTypeList(this.state.oldSplitList);
  367. infor.htMember = checkType.includes(1) ? 1 : 0
  368. infor.additionalDeduction = checkType.includes(2) ? 1 : 0
  369. infor.rdAwardsubsidy = checkType.includes(3) ? 1 : 0
  370. }
  371. }
  372. if (this.state.isVip == 3) { //科技项目
  373. infor.technologyProjectType = this.state.technologyProjectType
  374. }
  375. if (this.state.isVip == 8 && this.state.addProjectType != 2) { //知识产权
  376. infor.ordinaryRisk = this.state.ordinaryRisk
  377. }
  378. if (this.state.addProjectType == 2) {
  379. infor.days = this.state.days //天数
  380. infor.scheme = this.state.scheme //方案
  381. }
  382. // 新开单与签单项目变更 -- 编辑项目
  383. if (type == "change") {
  384. infor.id = dataInfor.id
  385. infor.type = dataInfor.tid ? 2 : 1
  386. infor.tid = dataInfor.tid
  387. }
  388. $.ajax({
  389. method: "POST",
  390. dataType: "json",
  391. crossDomain: false,
  392. url: globalConfig.context + type == "change"
  393. ? "/api/admin/orderChange/updateChangeTask"
  394. : "/api/admin/newOrder/updateOrderTask",
  395. data: infor,
  396. }).done(
  397. function (data) {
  398. this.setState({
  399. loading: false,
  400. });
  401. if (!data.error.length) {
  402. message.success("保存成功!");
  403. if (this.state.isVip == 6) {
  404. text == "submit" &&
  405. this.setState({
  406. isMedit: 0
  407. })
  408. } else {
  409. this.props.onCancel();
  410. }
  411. } else {
  412. message.warning(data.error[0].message);
  413. }
  414. }.bind(this)
  415. );
  416. }
  417. getpatentTypeList() {
  418. $.ajax({
  419. method: "get",
  420. dataType: "json",
  421. crossDomain: false,
  422. url: globalConfig.context + '/api/admin/orderProject/getPatentType',
  423. success: function (data) {
  424. if (data.error.length === 0) {
  425. this.setState({
  426. patentTypeList: data.data
  427. })
  428. } else {
  429. message.warning(data.error[0].message);
  430. };
  431. }.bind(this)
  432. });
  433. }
  434. // 删除子项目
  435. deleteMemberSonProject(id) {
  436. const { splitList, histYear } = this.state
  437. $.ajax({
  438. method: "POST",
  439. dataType: "json",
  440. crossDomain: false,
  441. url: globalConfig.context +
  442. this.props.type == "change"
  443. ? '/api/admin/orderChange/deleteMemberSonProject'
  444. : '/api/admin/orderProject/deleteMemberSonProject',
  445. data: {
  446. id,
  447. },
  448. success: function (data) {
  449. if (data.error.length === 0) {
  450. this.onChange()
  451. let splList = splitList
  452. let hlist = []
  453. for (var i = 0; i < splitList.length; i++) {
  454. if (id == splitList[i].id) {
  455. //如果是 type==1 新增 就彻底删除 否则 改为type==3
  456. if (splList[i].type == 0 || splList[i].type == 2) {
  457. splList[i].type = 3
  458. } else {
  459. splList.splice(i, 1)
  460. }
  461. // hlist.splice(i, 1)
  462. }
  463. }
  464. for (var j = 0; j < splList.length; j++) {
  465. splList[j].type != 3 && hlist.push(splList[j].serviceYear)
  466. }
  467. let newCheckType = this.getCheckTypeList(splList);
  468. this.setState({
  469. splitList: splList,
  470. histYear: hlist,
  471. checkType: newCheckType,
  472. })
  473. } else {
  474. message.warning(data.error[0].message);
  475. };
  476. }.bind(this)
  477. });
  478. }
  479. // 恢复子项目
  480. updateMemberSonProject(id, taskComment) {
  481. const { splitList, histYear, serviceYear } = this.state
  482. $.ajax({
  483. method: "POST",
  484. dataType: "json",
  485. crossDomain: false,
  486. url: globalConfig.context + '/api/admin/orderChange/updateMemberSonProject',
  487. data: {
  488. id,
  489. taskComment,
  490. },
  491. success: function (data) {
  492. if (data.error.length === 0) {
  493. // this.onChange()
  494. let splList = splitList
  495. let histList = histYear
  496. for (var i = 0; i < splList.length; i++) {
  497. if (splList[i].id == data.data.id) {
  498. splList[i].type = data.data.type
  499. splList[i].taskComment = data.data.taskComment
  500. }
  501. }
  502. histList.push(serviceYear)
  503. this.setState({
  504. addFrom: false,
  505. splitList: splList,
  506. histYear: histList,
  507. serviceYear: undefined,
  508. taskComment: undefined,
  509. isMedit: 0,
  510. })
  511. message.success("保存成功!")
  512. } else {
  513. message.warning(data.error[0].message);
  514. };
  515. }.bind(this)
  516. });
  517. }
  518. handleClose(removedTag) {
  519. let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
  520. this.setState({
  521. serviceLife,
  522. commodityQuantity: serviceLife.length == 0 ? undefined : serviceLife.length,
  523. yearSum: serviceLife.length == 0 ? undefined : serviceLife.length.toString(),
  524. serviceYear: undefined
  525. });
  526. }
  527. aGain() {
  528. const { serviceLife } = this.state
  529. this.setState({
  530. serviceLife: serviceLife,
  531. commodityQuantity: serviceLife.length == 0 ? undefined : serviceLife.length,
  532. yearSum: serviceLife.length == 0 ? undefined : serviceLife.length.toString(),
  533. })
  534. }
  535. tagClose(tag) {
  536. const _this = this
  537. let serviceLife = this.state.serviceLife.filter(t => { return t !== tag });
  538. let delid = ""
  539. const { splitList = [], } = this.state
  540. if (serviceLife.length < 1) {
  541. Modal.error({
  542. title: '提示',
  543. content: (
  544. <div>
  545. <p style={{ color: "red" }}>会员服务年限必须保留一个</p>
  546. </div>
  547. ),
  548. onOk() { },
  549. });
  550. return
  551. }
  552. for (var i = 0; i < splitList.length; i++) {
  553. if (tag == splitList[i].serviceYear && splitList[i].type != 3) {
  554. delid = splitList[i].id
  555. }
  556. }
  557. if (delid != "") {
  558. confirm({
  559. title: '确定要删除吗',
  560. content: '会员子项目也会一并删除',
  561. okText: '确定',
  562. okType: 'danger',
  563. cancelText: '取消',
  564. onOk() {
  565. _this.setState({
  566. serviceLife: serviceLife,
  567. commodityQuantity: serviceLife.length == 0 ? undefined : serviceLife.length,
  568. yearSum: serviceLife.length == 0 ? undefined : serviceLife.length.toString(),
  569. serviceYear: undefined
  570. });
  571. _this.deleteMemberSonProject(delid)
  572. },
  573. onCancel() {
  574. // _this.aGain()
  575. },
  576. });
  577. } else {
  578. this.setState({
  579. serviceLife,
  580. commodityQuantity: serviceLife.length == 0 ? undefined : serviceLife.length,
  581. yearSum: serviceLife.length == 0 ? undefined : serviceLife.length.toString(),
  582. serviceYear: undefined
  583. }, () => {
  584. this.onChange()
  585. });
  586. }
  587. }
  588. // 添加会员子项目
  589. addMemberFirstSonProject() {
  590. if (!this.state.serviceYear) {
  591. message.warning("请选择本次派单年份!");
  592. return
  593. }
  594. let info = {
  595. tid: this.state.tid,
  596. serviceYear: this.state.serviceYear,
  597. taskComment: this.state.taskComment,
  598. }
  599. let changeInfo = {
  600. id: this.state.tid,
  601. serviceYear: this.state.serviceYear,
  602. taskComment: this.state.taskComment,
  603. }
  604. if (this.state.projectType == 1) {
  605. info.htMember = this.state.newCheck.includes(1) ? 1 : 0
  606. info.additionalDeduction = this.state.newCheck.includes(2) ? 1 : 0
  607. info.rdAwardsubsidy = this.state.newCheck.includes(3) ? 1 : 0
  608. changeInfo.htMember = this.state.newCheck.includes(1) ? 1 : 0
  609. changeInfo.additionalDeduction = this.state.newCheck.includes(2) ? 1 : 0
  610. changeInfo.rdAwardsubsidy = this.state.newCheck.includes(3) ? 1 : 0
  611. }
  612. if (this.state.recoveryId != "") {
  613. this.updateMemberSonProject(this.state.recoveryId, this.state.taskComment)
  614. return
  615. }
  616. this.setState({
  617. loading: true,
  618. });
  619. $.ajax({
  620. method: "POST",
  621. dataType: "json",
  622. crossDomain: false,
  623. url: globalConfig.context +
  624. this.props.type == "change"
  625. ? "/api/admin/orderChange/addMemberSonProject"
  626. : "/api/admin/orderProject/addMemberFirstSonProject",
  627. data: this.props.type == "change" ? changeInfo : info,
  628. success: function (data) {
  629. this.setState({
  630. loading: false
  631. });
  632. if (data.error.length === 0) {
  633. message.success("保存成功!");
  634. let list = this.state.splitList
  635. let histList = this.state.histYear
  636. list.push(data.data)
  637. histList.push(data.data.serviceYear)
  638. this.setState({
  639. addFrom: false,
  640. splitList: list,
  641. histYear: histList,
  642. serviceYear: undefined,
  643. taskComment: undefined,
  644. isMedit: 0,
  645. newCheck: [],
  646. checkType: this.getNewCheckType(data.data, this.state.checkType), // 临时显示
  647. })
  648. } else {
  649. message.warning(data.error[0].message);
  650. };
  651. }.bind(this)
  652. });
  653. }
  654. getNewCheckType(item, list = []) {
  655. let newCheckType = list
  656. if (item.htMember == 1) {
  657. newCheckType.push(1)
  658. }
  659. if (item.additionalDeduction == 1) {
  660. newCheckType.push(2)
  661. }
  662. if (item.rdAwardsubsidy == 1) {
  663. newCheckType.push(3)
  664. }
  665. return [...new Set(newCheckType)]
  666. }
  667. // 获取修改过的高新会员子项目
  668. getUpdatedSubProject() {
  669. const updatedList = [];
  670. const { splitList, oldSplitList } = this.state;
  671. splitList.map(newSubItem => {
  672. let oldSubItem = oldSplitList.find(item => item.id === newSubItem.id);
  673. if (!!oldSubItem) {
  674. if (newSubItem.htMember != oldSubItem.htMember
  675. || newSubItem.additionalDeduction != oldSubItem.additionalDeduction
  676. || newSubItem.rdAwardsubsidy != oldSubItem.rdAwardsubsidy) {
  677. updatedList.push(newSubItem);
  678. }
  679. }
  680. });
  681. return updatedList;
  682. }
  683. // 验证子项目是否有会员类型为空的情况
  684. validSunProTypeIsNull() {
  685. const updatedList = this.getUpdatedSubProject();
  686. let flag = true; // 判断是否有子项,会员类型都为空,如果存在,则不进行批量更新
  687. let messageText = "";
  688. for (let i=0; i<updatedList.length; i++) {
  689. let item = updatedList[i];
  690. if (item.htMember != 1 && item.additionalDeduction != 1 && item.rdAwardsubsidy != 1) {
  691. flag = false;
  692. messageText = `${item.serviceYear}会员类型不能为空!`
  693. break;
  694. }
  695. }
  696. return { flag, message: messageText }
  697. }
  698. // loopPostUpdateSubProject() {
  699. // }
  700. // 修改子项目
  701. handleUpdateSubProject(item, succCallback, errCallback) {
  702. const { type } = this.props;
  703. let prams = {
  704. [type === "change" ? "id" : "tid"]: item.id,
  705. htMember: item.htMember,
  706. additionalDeduction: item.additionalDeduction,
  707. rdAwardsubsidy: item.rdAwardsubsidy,
  708. taskComment: item.taskComment
  709. };
  710. let url = type == "change" ? "/api/admin/orderChange/updateMemberSonProject" : "/api/admin/orderProject/updateMemberSonProject"
  711. $.ajax({
  712. method: "POST",
  713. dataType: "json",
  714. crossDomain: false,
  715. url,
  716. data: prams,
  717. success: res => {
  718. if (!res.error.length) {
  719. const { splitList, oldSplitList } = this.state;
  720. // 更新原始的子项目列表,便于计算后续改动的会员类型
  721. let oldSplitIdx = oldSplitList.findIndex(oldItem => oldItem.id === item.id)
  722. oldSplitIdx
  723. if (oldSplitIdx > -1) {
  724. oldSplitList[oldSplitIdx] = JSON.parse(JSON.stringify(item));
  725. }
  726. // 更新项目的会员类型
  727. let checkType = this.getCheckTypeList(oldSplitList);
  728. this.setState({
  729. checkType,
  730. oldSplitList
  731. }, () => {
  732. succCallback && succCallback();
  733. });
  734. } else {
  735. errCallback && errCallback();
  736. message.error(res.error[0].message);
  737. }
  738. }
  739. }).catch(err => {
  740. errCallback && errCallback();
  741. });
  742. }
  743. render() {
  744. let children = vipYear.map(its => (
  745. <Option key={its}>{its}</Option>
  746. ));
  747. let plainOptions = [0, 3].indexOf(this.state.projectType) > -1
  748. ? [{ label: '仅提供单变会员', value: 1 },] : this.state.projectType == 2
  749. ? [{ label: '仅填报表,仅咨询,不出备查资料', value: 1 }] : this.state.projectType == 1
  750. ? [
  751. { label: '高新会员', value: 1 },
  752. { label: '加计扣除', value: 2 },
  753. { label: '研发奖补', value: 3 }
  754. ] : this.state.projectType == 7 ? ["仅提供单边会员服务"] : []
  755. const { RangePicker } = DatePicker;
  756. const { readOnly } = this.props;
  757. const { isVip, histYear, isMedit } = this.state
  758. return (
  759. <Modal
  760. maskClosable={false}
  761. visible={this.props.visible}
  762. onOk={this.props.onCancel}
  763. onCancel={this.props.onCancel}
  764. width="900px"
  765. title={readOnly ? "项目任务详情" : "编辑项目任务"}
  766. footer=""
  767. className="admin-desc-content"
  768. >
  769. <Form
  770. layout="horizontal"
  771. >
  772. <Spin spinning={this.state.loading}>
  773. <div>
  774. <div className="clearfix">
  775. <FormItem
  776. className="half-item"
  777. {...formItemLayout}
  778. label="服务名称"
  779. >
  780. {this.state.commodityName}
  781. </FormItem>
  782. {
  783. isVip != 6 &&
  784. <FormItem
  785. className="half-item"
  786. {...formItemLayout}
  787. label="服务数量"
  788. >
  789. {readOnly ? this.state.commodityQuantity :
  790. <Input
  791. placeholder="请输入服务数量"
  792. disabled={isVip == 6}
  793. value={this.state.commodityQuantity}
  794. style={{ width: "200px" }}
  795. onChange={(e) => {
  796. this.setState({ commodityQuantity: e.target.value });
  797. }}
  798. ref="commodityQuantity"
  799. />}
  800. {!readOnly && <span className="mandatory">*</span>}
  801. </FormItem>
  802. }
  803. </div>
  804. <FormItem
  805. className="half-item"
  806. {...formItemLayout}
  807. label="实签价格(万元)"
  808. >
  809. {readOnly ? this.state.commodityPrice :
  810. <Input
  811. type='number'
  812. placeholder="请输入实签价格"
  813. disabled={isMedit != 1}
  814. value={this.state.commodityPrice}
  815. style={{ width: "200px" }}
  816. onChange={(e) => {
  817. this.setState({ commodityPrice: e.target.value });
  818. }}
  819. ref="commodityPrice"
  820. />}
  821. {!readOnly && <span className="mandatory">*</span>}
  822. </FormItem>
  823. <FormItem
  824. className="half-item"
  825. {...formItemLayout}
  826. label="主要业务"
  827. >
  828. {readOnly ? getboutique(this.state.main) :
  829. <Select
  830. placeholder="选择是否为主要业务"
  831. disabled={isMedit != 1}
  832. style={{ width: "200px" }}
  833. value={this.state.main}
  834. onChange={(e) => {
  835. this.setState({ main: e });
  836. }}
  837. >
  838. {boutique.map(function (item) {
  839. return (
  840. <Select.Option key={item.value}>
  841. {item.key}
  842. </Select.Option>
  843. );
  844. })}
  845. </Select>}
  846. {!readOnly && <span className="mandatory">*</span>}
  847. </FormItem>
  848. {
  849. !this.state.patentTransfer &&
  850. <FormItem
  851. className="half-item"
  852. {...formItemLayout}
  853. label="专利类型:"
  854. style={{
  855. display: this.state.displayFees,
  856. }}
  857. >
  858. {readOnly ? this.state.patentTypeName :
  859. <Select
  860. placeholder="请选择专利类型"
  861. style={{ width: "200px" }}
  862. value={this.state.patentType}
  863. onChange={(e) => {
  864. this.setState({ patentType: e });
  865. if (e !== 0 && e !== 2) {
  866. this.setState({
  867. costReduction: ''
  868. })
  869. }
  870. }}
  871. >
  872. {this.state.patentTypeList.map(function (v, k) {
  873. return (
  874. <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
  875. );
  876. })}
  877. </Select>}
  878. <span style={{ color: "red", marginLeft: "8px" }}>
  879. *
  880. </span>
  881. </FormItem>
  882. }
  883. {
  884. // 知识产权
  885. isVip == 8 && this.state.addProjectType != 2 &&
  886. <div className="clearfix">
  887. <FormItem
  888. className="half-item"
  889. {...formItemLayout}
  890. label="申请"
  891. >
  892. {
  893. <Radio.Group
  894. disabled={readOnly}
  895. value={this.state.ordinaryRisk}
  896. onChange={(e) => {
  897. this.setState({ ordinaryRisk: e.target.value });
  898. }}
  899. >
  900. <Radio value={0}>普通申请</Radio>
  901. <Radio value={1}>风险代理</Radio>
  902. </Radio.Group>
  903. }
  904. </FormItem>
  905. </div>
  906. }
  907. {
  908. // 软著
  909. this.state.addProjectType == 2 &&
  910. <div className="clearfix">
  911. <FormItem
  912. className="half-item"
  913. {...formItemLayout}
  914. label="天数"
  915. >
  916. {
  917. <Radio.Group
  918. disabled={readOnly}
  919. value={this.state.days}
  920. onChange={(e) => {
  921. this.setState({ days: e.target.value });
  922. }}
  923. >
  924. <Radio value={0}>普通</Radio>
  925. <Radio value={1}>加急</Radio>
  926. </Radio.Group>
  927. }
  928. </FormItem>
  929. </div>
  930. }
  931. {
  932. // 软著
  933. this.state.addProjectType == 2 &&
  934. <div className="clearfix">
  935. <FormItem
  936. className="half-item"
  937. {...formItemLayout}
  938. label="方案"
  939. >
  940. {
  941. <Radio.Group
  942. disabled={readOnly}
  943. value={this.state.scheme}
  944. onChange={(e) => {
  945. this.setState({ scheme: e.target.value });
  946. }}
  947. >
  948. <Radio value={0}>无方案</Radio>
  949. <Radio value={1}>有方案</Radio>
  950. </Radio.Group>
  951. }
  952. </FormItem>
  953. </div>
  954. }
  955. <div className="clearfix">
  956. <FormItem
  957. className="half-item"
  958. {...formItemLayout}
  959. label="官费:"
  960. style={{
  961. display: this.state.displayFees,
  962. }}
  963. >
  964. {readOnly
  965. ? (this.state.officialCost === 1 ? '含官费' : this.state.officialCost === 0 ? '不含官费' : '')
  966. : <Radio.Group
  967. value={this.state.officialCost}
  968. onChange={(e) => {
  969. this.setState({ officialCost: e.target.value });
  970. if (e.target.value === 0) {
  971. this.setState({
  972. costReduction: ''
  973. })
  974. }
  975. }}
  976. >
  977. <Radio value={1}>含官费</Radio>
  978. <Radio value={0}>不含官费</Radio>
  979. </Radio.Group>}
  980. <span style={{ color: "red", marginLeft: "8px" }}>
  981. *
  982. </span>
  983. </FormItem>
  984. </div>
  985. <div className="clearfix">
  986. {
  987. readOnly ?
  988. <FormItem
  989. className="half-item"
  990. {...formItemLayout}
  991. label="费减:"
  992. style={{
  993. display: this.state.displayFees,
  994. }}
  995. >
  996. {this.state.costReduction === 1 ? '有费减' : this.state.costReduction === 0 ? '无费减' : ''}
  997. <span style={{ color: "red", marginLeft: "8px" }}>
  998. *
  999. </span>
  1000. </FormItem>
  1001. :
  1002. (this.state.patentType === 0 || this.state.patentType === 2) &&
  1003. <div className="clearfix">
  1004. <FormItem
  1005. className="half-item"
  1006. {...formItemLayout}
  1007. label="费减:"
  1008. style={{
  1009. display: this.state.displayFees,
  1010. }}
  1011. >
  1012. {/*不含官费或者专利类型不为复审或者申请时置灰*/}
  1013. <Radio.Group
  1014. disabled={this.state.patentType !== 0 && this.state.patentType !== 2}
  1015. value={this.state.costReduction}
  1016. onChange={(e) => {
  1017. this.setState({ costReduction: e.target.value });
  1018. }}
  1019. >
  1020. <Radio value={1}>有费减</Radio>
  1021. <Radio value={0}>无费减</Radio>
  1022. </Radio.Group>
  1023. <span style={{ color: "red", marginLeft: "8px" }}>
  1024. *
  1025. </span>
  1026. </FormItem>
  1027. </div>
  1028. }
  1029. </div>
  1030. {
  1031. //审计
  1032. this.state.addProjectType == "3" &&
  1033. <FormItem
  1034. className="half-item"
  1035. {...formItemLayout}
  1036. label="服务年限"
  1037. >
  1038. {
  1039. readOnly ?
  1040. !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
  1041. <Select
  1042. mode="multiple"
  1043. style={{ width: '200px' }}
  1044. placeholder="请选择服务年限"
  1045. value={this.state.serviceLife}
  1046. onChange={(e) => {
  1047. this.setState({
  1048. serviceLife: e,
  1049. })
  1050. }}
  1051. >
  1052. {children}
  1053. </Select>
  1054. }
  1055. {!readOnly && <span className="mandatory">*</span>}
  1056. </FormItem>
  1057. }
  1058. {
  1059. isVip == 6 &&
  1060. <FormItem
  1061. className="half-item"
  1062. {...formItemLayout}
  1063. label="会员服务年限"
  1064. >
  1065. {
  1066. readOnly ?
  1067. !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
  1068. <div>
  1069. {
  1070. this.state.serviceLife.map((tag) =>
  1071. <Tag
  1072. key={tag}
  1073. // closable={!isEdit}
  1074. // afterClose={() => this.handleClose(tag)}
  1075. // onClose={() => this.tagClose(tag)}
  1076. onClick={() => isMedit == 1 && this.tagClose(tag)}
  1077. >{tag + " "}{isMedit == 1 && <Icon type="close" />}</Tag>
  1078. )
  1079. }
  1080. {
  1081. isMedit == 1 && (this.state.serviceLife.length < 10) &&
  1082. <Button
  1083. size="small"
  1084. type="primary"
  1085. onClick={() => {
  1086. this.setState({
  1087. addYears: true,
  1088. addyear: undefined,
  1089. isGive: undefined,
  1090. })
  1091. }}>
  1092. + 添加服务年限
  1093. </Button>
  1094. }
  1095. </div>
  1096. }
  1097. </FormItem>
  1098. }
  1099. {
  1100. isVip == 6 &&
  1101. <FormItem
  1102. className="half-item"
  1103. {...formItemLayout}
  1104. label="会员总服务年限"
  1105. >
  1106. {
  1107. !this.state.yearSum ? "" :
  1108. [
  1109. { value: "0", key: "" },
  1110. { value: "1", key: "一年" },
  1111. { value: "2", key: "二年" },
  1112. { value: "3", key: "三年" },
  1113. { value: "4", key: "四年" },
  1114. { value: "5", key: "五年" },
  1115. { value: "6", key: "六年" },
  1116. { value: "7", key: "七年" },
  1117. { value: "8", key: "八年" },
  1118. { value: "9", key: "九年" },
  1119. { value: "10", key: "十年" },
  1120. ][this.state.yearSum]["key"]
  1121. }
  1122. </FormItem>
  1123. }
  1124. {
  1125. // 会员合同期
  1126. isVip == 6 &&
  1127. <div className="clearfix">
  1128. <FormItem
  1129. className="half-item"
  1130. {...formItemLayout}
  1131. label={this.state.projectType == 3
  1132. ? '单边会员' : this.state.projectType == 2
  1133. ? '简单会员' : this.state.projectType == 1
  1134. ? '会员' : this.state.projectType == 0
  1135. ? '其他' : ' '}
  1136. >
  1137. <CheckboxGroup
  1138. // disabled={this.state.projectType == 3 || this.state.projectType == 2 || isMedit != 1}
  1139. disabled
  1140. style={{ width: 200 }}
  1141. options={plainOptions}
  1142. value={this.state.checkType}
  1143. onChange={e => {
  1144. this.setState({
  1145. checkType: e
  1146. })
  1147. }}
  1148. />
  1149. </FormItem>
  1150. <FormItem
  1151. className="half-item"
  1152. {...formItemLayout}
  1153. label="合同期"
  1154. >
  1155. {
  1156. readOnly ?
  1157. !!this.state.contractTerm ? this.state.contractTerm.toString().replace(",", "至") : "" :
  1158. <RangePicker
  1159. style={{ width: 200 }}
  1160. disabled={isMedit != 1}
  1161. value={[
  1162. this.state.contractTerm[0]
  1163. ? moment(this.state.contractTerm[0])
  1164. : null,
  1165. this.state.contractTerm[1]
  1166. ? moment(this.state.contractTerm[1])
  1167. : null,
  1168. ]}
  1169. onChange={(data, dataString) => {
  1170. this.setState({ contractTerm: dataString });
  1171. }}
  1172. />
  1173. }
  1174. {!readOnly && <span className="mandatory">*</span>}
  1175. </FormItem>
  1176. </div>
  1177. }
  1178. {
  1179. // 科技项目
  1180. isVip == 3 &&
  1181. <div className="clearfix">
  1182. <FormItem
  1183. labelCol={{ span: 4 }}
  1184. wrapperCol={{ span: 16 }}
  1185. label='科技项目'
  1186. >
  1187. <RadioGroup
  1188. disabled={readOnly}
  1189. onChange={e => {
  1190. this.setState({
  1191. technologyProjectType: e.target.value
  1192. })
  1193. }}
  1194. value={this.state.technologyProjectType}
  1195. >
  1196. <Radio value={3}>国家级</Radio>
  1197. <Radio value={2}>省级</Radio>
  1198. <Radio value={1}>市区级</Radio>
  1199. <Radio value={0}>简易项目</Radio>
  1200. </RadioGroup>
  1201. </FormItem>
  1202. </div>
  1203. }
  1204. {
  1205. // 审计
  1206. this.state.addProjectType == "3" &&
  1207. <div className="clearfix">
  1208. <FormItem
  1209. labelCol={{ span: 4 }}
  1210. wrapperCol={{ span: 16 }}
  1211. label=""
  1212. >
  1213. <span style={{ color: "red" }}>注:派单年度的上年度总资产和收入。如,当前为2022年,那么需要填写2021年的总资产和收入!</span>
  1214. </FormItem>
  1215. {
  1216. this.state.isYear && !readOnly &&
  1217. <div className="clearfix">
  1218. <FormItem
  1219. className="half-item"
  1220. label="企业上年度年份"
  1221. {...formItemLayout}
  1222. >
  1223. <Select
  1224. style={{ width: '200px' }}
  1225. placeholder="请选择年份"
  1226. value={this.state.lastYear}
  1227. onChange={e => {
  1228. this.setState({
  1229. lastYear: e,
  1230. })
  1231. }}
  1232. >
  1233. {
  1234. YearList.map(its => (
  1235. <Option key={its}>{its}</Option>
  1236. ))
  1237. }
  1238. </Select>
  1239. <span className="mandatory">*</span>
  1240. </FormItem>
  1241. </div>
  1242. }
  1243. <FormItem
  1244. className="half-item"
  1245. label="企业上年度总资产(万元)"
  1246. {...formItemLayout}
  1247. >
  1248. {
  1249. readOnly ? this.state.lastYearCapital :
  1250. <Input
  1251. type='number'
  1252. placeholder=""
  1253. value={this.state.lastYearCapital}
  1254. style={{ width: "200px" }}
  1255. onChange={(e) => {
  1256. this.setState({ lastYearCapital: e.target.value });
  1257. }}
  1258. />
  1259. }
  1260. {!readOnly && <span className="mandatory">*</span>}
  1261. </FormItem>
  1262. <FormItem
  1263. className="half-item"
  1264. label="企业上年度总收入(万元)"
  1265. {...formItemLayout}
  1266. >
  1267. {
  1268. readOnly ? this.state.lastYearIncome :
  1269. <Input
  1270. type='number'
  1271. placeholder=""
  1272. value={this.state.lastYearIncome}
  1273. style={{ width: "200px" }}
  1274. onChange={(e) => {
  1275. this.setState({ lastYearIncome: e.target.value });
  1276. }}
  1277. />
  1278. }
  1279. {!readOnly && <span className="mandatory">*</span>}
  1280. </FormItem>
  1281. </div>
  1282. }
  1283. {
  1284. // 普通项目说明
  1285. isVip != 6 &&
  1286. <div className="clearfix">
  1287. <FormItem
  1288. labelCol={{ span: 4 }}
  1289. wrapperCol={{ span: 16 }}
  1290. label="项目说明"
  1291. >
  1292. {readOnly ? this.state.taskComment :
  1293. <Input
  1294. type="textarea"
  1295. placeholder=""
  1296. autosize={{ minRows: 4 }}
  1297. value={this.state.taskComment}
  1298. onChange={(e) => {
  1299. this.setState({ taskComment: e.target.value });
  1300. }}
  1301. />}
  1302. </FormItem>
  1303. </div>
  1304. }
  1305. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  1306. {
  1307. this.state.addProjectType === 5 &&
  1308. <div className="clearfix">
  1309. <FormItem
  1310. className="half-item"
  1311. {...formItemLayout}
  1312. label="企业要求申报批次"
  1313. >
  1314. {readOnly ? (
  1315. this.state.declarationBatch === 1 ? '第一批' :
  1316. this.state.declarationBatch === 2 ? '第二批' :
  1317. this.state.declarationBatch === 3 ? '第三批' :
  1318. this.state.declarationBatch === 4 ? '第四批' : '未知'
  1319. ) :
  1320. <Select
  1321. placeholder="请选择企业要求申报批次"
  1322. style={{ width: "200px" }}
  1323. value={this.state.declarationBatch}
  1324. onChange={(e) => {
  1325. this.setState({ declarationBatch: e });
  1326. }}
  1327. >
  1328. <Select.Option value={1}>
  1329. 第一批
  1330. </Select.Option>
  1331. <Select.Option value={2}>
  1332. 第二批
  1333. </Select.Option>
  1334. <Select.Option value={3}>
  1335. 第三批
  1336. </Select.Option>
  1337. <Select.Option value={4}>
  1338. 第四批
  1339. </Select.Option>
  1340. </Select>}
  1341. {!readOnly && <span className="mandatory">*</span>}
  1342. </FormItem>
  1343. <FormItem
  1344. className="half-item"
  1345. {...formItemLayout}
  1346. label="申报年份"
  1347. >
  1348. {
  1349. readOnly ? this.state.serviceYear :
  1350. <Select
  1351. style={{ width: '200px' }}
  1352. placeholder="请选择申报年份"
  1353. value={this.state.serviceYear}
  1354. onChange={e => {
  1355. this.setState({
  1356. serviceYear: e,
  1357. })
  1358. }}
  1359. >
  1360. {
  1361. vipYear.map(its => (
  1362. <Option key={its}>{its}</Option>
  1363. ))
  1364. }
  1365. </Select>
  1366. }
  1367. {!readOnly && <span className="mandatory">*</span>}
  1368. </FormItem>
  1369. </div>
  1370. }
  1371. {
  1372. this.props.isIso || this.state.isIso ?
  1373. <div className="clearfix">
  1374. <FormItem
  1375. className="half-item"
  1376. {...formItemLayout}
  1377. label="是否包含认证费用"
  1378. >
  1379. {readOnly ? (
  1380. this.state.ifCertificationFee == "1" ? '包含' :
  1381. this.state.ifCertificationFee == "0" ? '不包含' : '未知'
  1382. ) : <Select
  1383. placeholder="请选择是否包含认证费用"
  1384. style={{ width: "200px" }}
  1385. value={this.state.ifCertificationFee}
  1386. onChange={(e) => {
  1387. this.setState({ ifCertificationFee: e });
  1388. }}
  1389. >
  1390. <Select.Option value={"0"}>否</Select.Option>
  1391. <Select.Option value={"1"}>是</Select.Option>
  1392. </Select>}
  1393. {!readOnly && <span className="mandatory">*</span>}
  1394. </FormItem>
  1395. </div> : null
  1396. }
  1397. {
  1398. isMedit == 0 && isVip == 6 &&
  1399. <div className="clearfix">
  1400. <FormItem
  1401. wrapperCol={{ span: 12, offset: 8 }}
  1402. className="half-middle"
  1403. >
  1404. <Button
  1405. className="submitSave"
  1406. onClick={() => {
  1407. this.setState({
  1408. isMedit: 1
  1409. })
  1410. }}
  1411. >
  1412. 重新编辑项目任务
  1413. </Button>
  1414. </FormItem>
  1415. </div>
  1416. }
  1417. {
  1418. ((!readOnly && isVip != 6) || (isVip == 6 && isMedit == 1)) &&
  1419. <div className="clearfix">
  1420. <FormItem
  1421. wrapperCol={{ span: 12, offset: 8 }}
  1422. className="half-middle"
  1423. >
  1424. <Button
  1425. className="submitSave"
  1426. type="primary"
  1427. onClick={() => {
  1428. this.onChange("submit");
  1429. }}
  1430. >
  1431. 保存
  1432. </Button>
  1433. <Button
  1434. className="submitSave"
  1435. type="ghost"
  1436. onClick={() => {
  1437. isVip == 6
  1438. ? this.setState({
  1439. isMedit: 0
  1440. })
  1441. : this.props.onCancel()
  1442. }}
  1443. >
  1444. 取消
  1445. </Button>
  1446. </FormItem>
  1447. </div>
  1448. }
  1449. {
  1450. // 会员项目子集列表
  1451. !!this.state.splitList && this.state.splitList.length > 0 &&
  1452. this.state.splitList.map((item, splitIdx) =>
  1453. // 标识为 3=删 不显示
  1454. item.type != 3 &&
  1455. <div
  1456. key={item.id}
  1457. className="clearfix"
  1458. style={{
  1459. width: "100%",
  1460. borderTop: "1px dashed #000000",
  1461. padding: "10px 0"
  1462. }}
  1463. >
  1464. <FormItem
  1465. className="half-item"
  1466. {...formItemLayout}
  1467. label="本次派单"
  1468. >
  1469. {item.serviceYear}
  1470. </FormItem>
  1471. <FormItem
  1472. className="half-item"
  1473. {...formItemLayout}
  1474. label="服务数量"
  1475. >
  1476. {item.commodityQuantity}
  1477. </FormItem>
  1478. {
  1479. this.state.projectType == 1 &&
  1480. <FormItem
  1481. className="half-item"
  1482. {...formItemLayout}
  1483. label="会员"
  1484. >
  1485. <CheckboxGroup
  1486. disabled={ isMedit == 1 ? false : true }
  1487. style={{ width: 200 }}
  1488. options={[
  1489. { label: '高新会员', value: 1 },
  1490. { label: '加计扣除', value: 2 },
  1491. { label: '研发奖补', value: 3 }
  1492. ]}
  1493. value={this.getNewCheckType(item)}
  1494. onChange={e => {
  1495. if (e.indexOf(1) > -1) {
  1496. this.state.splitList[splitIdx].htMember = 1;
  1497. } else {
  1498. this.state.splitList[splitIdx].htMember = 0;
  1499. }
  1500. if (e.indexOf(2) > -1) {
  1501. this.state.splitList[splitIdx].additionalDeduction = 1;
  1502. } else {
  1503. this.state.splitList[splitIdx].additionalDeduction = 0;
  1504. }
  1505. if (e.indexOf(3) > -1) {
  1506. this.state.splitList[splitIdx].rdAwardsubsidy = 1;
  1507. } else {
  1508. this.state.splitList[splitIdx].rdAwardsubsidy = 0;
  1509. }
  1510. this.setState({
  1511. splitList: this.state.splitList
  1512. })
  1513. }}
  1514. />
  1515. </FormItem>
  1516. }
  1517. {
  1518. (item.memberType == "0" || item.memberType == "1" || item.memberType == "2") &&
  1519. <FormItem
  1520. className="half-item"
  1521. {...formItemLayout}
  1522. label="付款情况"
  1523. >
  1524. {item.memberType == "0"
  1525. ? "已付会员节点全款" : item.memberType == "1"
  1526. ? "已付部分期款,需特批" : item.memberType == "2"
  1527. ? "未付款,需特批" : ""}
  1528. </FormItem>
  1529. }
  1530. {
  1531. (item.memberType == "1" || item.memberType == "2") &&
  1532. <div className="clearfix">
  1533. <FormItem
  1534. labelCol={{ span: 4 }}
  1535. wrapperCol={{ span: 16 }}
  1536. label="附件"
  1537. >
  1538. {item.pictureUrl ?
  1539. <div>
  1540. <ImgList fileList={splitUrl(item.pictureUrl, ",", globalConfig.avatarHost + "/upload")} ItemWidth={'96px'} />
  1541. </div> : <div />}
  1542. </FormItem>
  1543. </div>
  1544. }
  1545. <div className="clearfix">
  1546. <FormItem
  1547. labelCol={{ span: 4 }}
  1548. wrapperCol={{ span: 16 }}
  1549. label="项目说明"
  1550. >
  1551. {item.taskComment}
  1552. </FormItem>
  1553. </div>
  1554. {/* { isMedit == 1 && this.state.projectType == 1 ? (
  1555. <div style={{textAlign: "center"}}>
  1556. <Button type="primary" onClick={() => this.handleUpdateSubProject(item)}>确认修改</Button>
  1557. </div>
  1558. ) : null } */}
  1559. {/* {
  1560. (isMedit == 0 || isMedit == 2) &&
  1561. <div className="clearfix">
  1562. <FormItem
  1563. wrapperCol={{ span: 12, offset: 10 }}
  1564. className="half-middle"
  1565. >
  1566. <Button type="danger"
  1567. onClick={() => {
  1568. const _this = this
  1569. confirm({
  1570. title: '确定要删除吗',
  1571. content: '确定删除本次派单吗',
  1572. okText: '确定',
  1573. okType: 'danger',
  1574. cancelText: '取消',
  1575. onOk() {
  1576. _this.deleteMemberSonProject(item.id)
  1577. },
  1578. onCancel() { },
  1579. });
  1580. }}
  1581. >删除</Button>
  1582. </FormItem>
  1583. </div>
  1584. } */}
  1585. </div>
  1586. )
  1587. }
  1588. {
  1589. (isMedit == 0 || isMedit == 2) &&
  1590. this.state.splitList.filter((item) => { return item.type != 3 }).length < this.state.yearSum &&
  1591. <div
  1592. className="clearfix"
  1593. style={{
  1594. width: "100%",
  1595. borderTop: "1px dashed #000000",
  1596. padding: "30px 0 10px 0"
  1597. }}
  1598. >
  1599. {
  1600. !this.state.addFrom &&
  1601. // this.state.splitList.length < this.state.yearSum &&
  1602. this.state.splitList.filter((item) => { return item.type != 3 }).length < this.state.yearSum &&
  1603. <div className="clearfix">
  1604. <FormItem
  1605. wrapperCol={{ span: 19, offset: 8 }}
  1606. className="half-middle"
  1607. >
  1608. <Button
  1609. type="primary"
  1610. onClick={() => {
  1611. this.setState({
  1612. addFrom: true,
  1613. })
  1614. }}
  1615. >
  1616. + 添加本次派单
  1617. </Button>
  1618. <span style={{ color: "#61BBE2", marginLeft: 10 }}>请填写本次派单的年份,派单表示立即安排人员开始相关的工作!!!</span>
  1619. </FormItem>
  1620. </div>
  1621. }
  1622. {
  1623. this.state.addFrom &&
  1624. <div>
  1625. <FormItem
  1626. className="half-item"
  1627. {...formItemLayout}
  1628. label="本次派单"
  1629. >
  1630. <Select
  1631. placeholder="请选择本次派单年份"
  1632. style={{ width: "200px" }}
  1633. value={this.state.serviceYear}
  1634. onChange={(e) => {
  1635. let addId = ""
  1636. let addtext = ""
  1637. if (!!this.state.splitList) {
  1638. for (var i = 0; i < this.state.splitList.length; i++) {
  1639. if (this.state.splitList[i].serviceYear == e && this.state.splitList[i].type == 3) {
  1640. addId = this.state.splitList[i].id
  1641. addtext = this.state.splitList[i].taskComment
  1642. }
  1643. }
  1644. }
  1645. this.setState({
  1646. serviceYear: e,
  1647. recoveryId: addId,
  1648. taskComment: addtext,
  1649. });
  1650. }}
  1651. >
  1652. {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
  1653. return (
  1654. <Select.Option key={item} disabled={histYear.includes(item)}>
  1655. {item}
  1656. </Select.Option>
  1657. );
  1658. })}
  1659. </Select>
  1660. {<span className="mandatory">*</span>}
  1661. </FormItem>
  1662. <FormItem
  1663. className="half-item"
  1664. {...formItemLayout}
  1665. label="服务数量"
  1666. >
  1667. <Input
  1668. placeholder="请输入服务数量"
  1669. disabled={isVip == 6}
  1670. value={1}
  1671. style={{ width: "200px" }}
  1672. ref="commodityQuantity"
  1673. />
  1674. {<span className="mandatory">*</span>}
  1675. </FormItem>
  1676. {
  1677. this.state.projectType == 1 &&
  1678. <div className="clearfix">
  1679. <FormItem
  1680. className="half-item"
  1681. {...formItemLayout}
  1682. label="会员"
  1683. >
  1684. <CheckboxGroup
  1685. style={{ width: 200 }}
  1686. options={[
  1687. { label: '高新会员', value: 1 },
  1688. { label: '加计扣除', value: 2 },
  1689. { label: '研发奖补', value: 3 }
  1690. ]}
  1691. value={this.state.newCheck}
  1692. onChange={e => {
  1693. this.setState({
  1694. newCheck: e
  1695. })
  1696. }}
  1697. />
  1698. </FormItem>
  1699. </div>
  1700. }
  1701. <div className="clearfix">
  1702. <FormItem
  1703. labelCol={{ span: 4 }}
  1704. wrapperCol={{ span: 16 }}
  1705. label="项目说明"
  1706. >
  1707. <Input
  1708. type="textarea"
  1709. placeholder=""
  1710. autosize={{ minRows: 2 }}
  1711. value={this.state.taskComment}
  1712. onChange={(e) => {
  1713. this.setState({ taskComment: e.target.value });
  1714. }}
  1715. />
  1716. </FormItem>
  1717. </div>
  1718. <div className="clearfix">
  1719. <FormItem
  1720. wrapperCol={{ span: 12, offset: 8 }}
  1721. className="half-middle"
  1722. >
  1723. <Button
  1724. className="submitSave"
  1725. type="primary"
  1726. onClick={() => {
  1727. this.addMemberFirstSonProject()
  1728. }}
  1729. >
  1730. 保存
  1731. </Button>
  1732. <Button
  1733. className="submitSave"
  1734. type="ghost"
  1735. onClick={() => {
  1736. this.setState({
  1737. addFrom: false
  1738. })
  1739. }}
  1740. >
  1741. 取消
  1742. </Button>
  1743. </FormItem>
  1744. </div>
  1745. </div>
  1746. }
  1747. </div>
  1748. }
  1749. </div>
  1750. </Spin>
  1751. </Form>
  1752. {
  1753. this.state.addYears &&
  1754. <Modal
  1755. title="添加服务年限"
  1756. visible={this.state.addYears}
  1757. okText="添加"
  1758. onOk={() => {
  1759. if (!this.state.addyear) {
  1760. message.warn("请选择年份!")
  1761. return
  1762. }
  1763. if (this.state.isGive == undefined) {
  1764. message.warn("请选择是否赠送!")
  1765. return
  1766. }
  1767. let slist = this.state.serviceLife
  1768. let newYear = this.state.addyear
  1769. if (this.state.isGive == 0) {
  1770. newYear.map(year => {
  1771. slist.push(year)
  1772. })
  1773. } else if (this.state.isGive == 1) {
  1774. newYear.map(year => {
  1775. slist.push(year + "(赠)")
  1776. })
  1777. }
  1778. this.setState({
  1779. serviceLife: slist,
  1780. commodityQuantity: slist.length,
  1781. yearSum: slist.length.toString(),
  1782. addYears: false
  1783. }, () => {
  1784. // let addId = ""
  1785. // if (!!this.state.splitList) {
  1786. // for (var i = 0; i < this.state.splitList.length; i++) {
  1787. // if (this.state.splitList[i].serviceYear == newYear && this.state.splitList[i].type == 3) {
  1788. // addId = this.state.splitList[i].id
  1789. // }
  1790. // }
  1791. // }
  1792. // addId == ""
  1793. // ? this.onChange()
  1794. // : this.updateMemberSonProject(addId)
  1795. })
  1796. }}
  1797. onCancel={() => {
  1798. this.setState({
  1799. addYears: false
  1800. })
  1801. }}
  1802. >
  1803. <Select
  1804. mode="multiple"
  1805. style={{ width: '200px', marginRight: 50 }}
  1806. placeholder="请选择年份"
  1807. onChange={e => {
  1808. this.setState({
  1809. addyear: e,
  1810. })
  1811. }}
  1812. >
  1813. {
  1814. vipYear.map(its => (
  1815. <Option
  1816. key={its}
  1817. disabled={this.state.serviceLife.toString().includes(its)}
  1818. >{its}</Option>
  1819. ))
  1820. }
  1821. </Select>
  1822. <RadioGroup
  1823. onChange={e => {
  1824. this.setState({
  1825. isGive: e.target.value
  1826. })
  1827. }}
  1828. value={this.state.isGive}
  1829. >
  1830. <Radio value={0}>非赠送</Radio>
  1831. <Radio value={1}>赠送</Radio>
  1832. </RadioGroup>
  1833. </Modal>
  1834. }
  1835. </Modal >
  1836. )
  1837. }
  1838. }
  1839. export default newEditProject;