newEditProject.jsx 68 KB

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