newAddProject.jsx 67 KB

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