newAddProject.jsx 50 KB

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