newEditProject.jsx 63 KB

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