newAddProject.jsx 60 KB

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