newAddProject.jsx 73 KB

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