newAddProject.jsx 50 KB

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