newEditProject.jsx 63 KB

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