newEditProject.jsx 67 KB

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