newEditProject.jsx 65 KB

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