newAddProject.jsx 74 KB

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