newAddProject.jsx 60 KB

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