newAddProject.jsx 73 KB

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