newEditProject.jsx 62 KB

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