newAddProject.jsx 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453
  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)) {
  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) ? this.state.costReduction : 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) &&
  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.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 < 10) &&
  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. { value: "6", key: "六年" },
  888. { value: "7", key: "七年" },
  889. { value: "8", key: "八年" },
  890. { value: "9", key: "九年" },
  891. { value: "10", key: "十年" },
  892. ][this.state.yearSum]["key"]
  893. }
  894. </FormItem>
  895. }
  896. {
  897. // 会员合同期
  898. isVip == 6 &&
  899. <div className="clearfix">
  900. <FormItem
  901. className="half-item"
  902. {...formItemLayout}
  903. >
  904. </FormItem>
  905. <FormItem
  906. className="half-item"
  907. {...formItemLayout}
  908. label="合同期"
  909. >
  910. {
  911. <RangePicker
  912. style={{ width: 200 }}
  913. disabled={isEdit}
  914. value={[
  915. this.state.contractTerm[0]
  916. ? moment(this.state.contractTerm[0])
  917. : null,
  918. this.state.contractTerm[1]
  919. ? moment(this.state.contractTerm[1])
  920. : null,
  921. ]}
  922. onChange={(data, dataString) => {
  923. this.setState({ contractTerm: dataString });
  924. }}
  925. />
  926. }
  927. {<span className="mandatory">*</span>}
  928. </FormItem>
  929. </div>
  930. }
  931. {
  932. // 审计
  933. this.state.addProjectType == "3" &&
  934. <div className="clearfix">
  935. <FormItem
  936. labelCol={{ span: 4 }}
  937. wrapperCol={{ span: 16 }}
  938. label=""
  939. >
  940. <span style={{ color: "red" }}>注:派单年度的上年度总资产和收入。如,当前为2022年,那么需要填写2021年的总资产和收入!</span>
  941. </FormItem>
  942. <FormItem
  943. className="half-item"
  944. label="企业上年度总资产(万元)"
  945. {...formItemLayout}
  946. >
  947. <Input
  948. type='number'
  949. placeholder=""
  950. value={this.state.lastYearCapital}
  951. style={{ width: "200px" }}
  952. onChange={(e) => {
  953. this.setState({ lastYearCapital: e.target.value });
  954. }}
  955. />
  956. {<span className="mandatory">*</span>}
  957. </FormItem>
  958. <FormItem
  959. className="half-item"
  960. label="企业上年度总收入(万元)"
  961. {...formItemLayout}
  962. >
  963. <Input
  964. type='number'
  965. placeholder=""
  966. value={this.state.lastYearIncome}
  967. style={{ width: "200px" }}
  968. onChange={(e) => {
  969. this.setState({ lastYearIncome: e.target.value });
  970. }}
  971. />
  972. {<span className="mandatory">*</span>}
  973. </FormItem>
  974. </div>
  975. }
  976. {
  977. // 普通项目说明
  978. isVip != 6 &&
  979. <div className="clearfix">
  980. <FormItem
  981. labelCol={{ span: 4 }}
  982. wrapperCol={{ span: 16 }}
  983. label="项目说明"
  984. >
  985. {
  986. <Input
  987. type="textarea"
  988. placeholder=""
  989. autosize={{ minRows: 3 }}
  990. value={this.state.taskComment}
  991. onChange={(e) => {
  992. this.setState({ taskComment: e.target.value });
  993. }}
  994. />
  995. }
  996. </FormItem>
  997. </div>
  998. }
  999. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  1000. {this.state.addProjectType === 5 &&
  1001. <div className="clearfix">
  1002. <FormItem
  1003. className="half-item"
  1004. {...formItemLayout}
  1005. label="企业要求申报批次"
  1006. >
  1007. {
  1008. <Select
  1009. placeholder="请选择企业要求申报批次"
  1010. style={{ width: "200px" }}
  1011. value={this.state.declarationBatch}
  1012. onChange={(e) => {
  1013. this.setState({ declarationBatch: e });
  1014. }}
  1015. >
  1016. <Select.Option value={1}>
  1017. 第一批
  1018. </Select.Option>
  1019. <Select.Option value={2}>
  1020. 第二批
  1021. </Select.Option>
  1022. <Select.Option value={3}>
  1023. 第三批
  1024. </Select.Option>
  1025. <Select.Option value={4}>
  1026. 第四批
  1027. </Select.Option>
  1028. </Select>
  1029. }
  1030. {<span className="mandatory">*</span>}
  1031. </FormItem>
  1032. <FormItem
  1033. className="half-item"
  1034. {...formItemLayout}
  1035. label="申报年份"
  1036. >
  1037. {
  1038. <Select
  1039. style={{ width: '200px' }}
  1040. placeholder="请选择申报年份"
  1041. value={this.state.serviceYear}
  1042. onChange={e => {
  1043. this.setState({
  1044. serviceYear: e,
  1045. })
  1046. }}
  1047. >
  1048. {
  1049. vipYear.map(its => (
  1050. <Option key={its}>{its}</Option>
  1051. ))
  1052. }
  1053. </Select>
  1054. }
  1055. {<span className="mandatory">*</span>}
  1056. </FormItem>
  1057. </div>
  1058. }
  1059. {
  1060. this.props.isIso || this.state.isIso ?
  1061. <div className="clearfix">
  1062. <FormItem
  1063. className="half-item"
  1064. {...formItemLayout}
  1065. label="是否包含认证费用"
  1066. >
  1067. {
  1068. <Select
  1069. placeholder="请选择是否包含认证费用"
  1070. style={{ width: "200px" }}
  1071. value={this.state.ifCertificationFee}
  1072. onChange={(e) => {
  1073. this.setState({ ifCertificationFee: e });
  1074. }}
  1075. >
  1076. <Select.Option value={"0"}>否</Select.Option>
  1077. <Select.Option value={"1"}>是</Select.Option>
  1078. </Select>
  1079. }
  1080. {<span className="mandatory">*</span>}
  1081. </FormItem>
  1082. </div> : null
  1083. }
  1084. {((isVip != 6) || (isVip == 6 && !isEdit)) &&
  1085. <div className="clearfix">
  1086. <FormItem
  1087. wrapperCol={{ span: 12, offset: 8 }}
  1088. className="half-middle"
  1089. >
  1090. <Button
  1091. className="submitSave"
  1092. type="primary"
  1093. onClick={() => {
  1094. this.onSubmit();
  1095. }}
  1096. >
  1097. 保存
  1098. </Button>
  1099. <Button
  1100. className="submitSave"
  1101. type="ghost"
  1102. onClick={this.props.onCancel}
  1103. >
  1104. 取消
  1105. </Button>
  1106. </FormItem>
  1107. </div>
  1108. }
  1109. {
  1110. // 会员项目子集列表
  1111. isEdit &&
  1112. !!this.state.splitList && this.state.splitList.length > 0 &&
  1113. this.state.splitList.map((item) =>
  1114. <div
  1115. key={item.id}
  1116. className="clearfix"
  1117. style={{
  1118. width: "100%",
  1119. borderTop: "1px dashed #000000",
  1120. padding: "10px 0"
  1121. }}
  1122. >
  1123. <FormItem
  1124. className="half-item"
  1125. {...formItemLayout}
  1126. label="本次派单"
  1127. >
  1128. {item.serviceYear}
  1129. </FormItem>
  1130. <FormItem
  1131. className="half-item"
  1132. {...formItemLayout}
  1133. label="服务数量"
  1134. >
  1135. {item.commodityQuantity}
  1136. </FormItem>
  1137. {
  1138. type == "vipAdd" &&
  1139. <FormItem
  1140. className="half-item"
  1141. {...formItemLayout}
  1142. label="付款情况"
  1143. >
  1144. {item.memberType == "0"
  1145. ? "已付会员节点全款" : item.memberType == "1"
  1146. ? "已付部分期款,需特批" : item.memberType == "2"
  1147. ? "未付款,需特批" : ""}
  1148. </FormItem>
  1149. }
  1150. {
  1151. type == "vipAdd" &&
  1152. (item.memberType == "1" || item.memberType == "2") &&
  1153. <div className="clearfix">
  1154. <FormItem
  1155. labelCol={{ span: 4 }}
  1156. wrapperCol={{ span: 16 }}
  1157. label="附件"
  1158. >
  1159. {item.pictureUrl ?
  1160. <div>
  1161. <ImgList fileList={splitUrl(item.pictureUrl, ",", globalConfig.avatarHost + "/upload")} ItemWidth={'96px'} />
  1162. </div> : <div />}
  1163. </FormItem>
  1164. </div>
  1165. }
  1166. <div className="clearfix">
  1167. <FormItem
  1168. labelCol={{ span: 4 }}
  1169. wrapperCol={{ span: 16 }}
  1170. label="项目说明"
  1171. >
  1172. {item.taskComment}
  1173. </FormItem>
  1174. </div>
  1175. </div>
  1176. )
  1177. }
  1178. {
  1179. this.state.splitList.length < this.state.yearSum &&
  1180. <div
  1181. className="clearfix"
  1182. style={{
  1183. width: "100%",
  1184. borderTop: "1px dashed #000000",
  1185. padding: "30px 0 10px 0"
  1186. }}
  1187. >
  1188. {
  1189. isEdit &&
  1190. !this.state.addFrom &&
  1191. this.state.splitList.length < this.state.yearSum &&
  1192. <div className="clearfix">
  1193. <FormItem
  1194. wrapperCol={{ span: 19, offset: 8 }}
  1195. className="half-middle"
  1196. >
  1197. <Button
  1198. type="primary"
  1199. onClick={() => {
  1200. this.setState({
  1201. addFrom: true
  1202. })
  1203. }}
  1204. >
  1205. + 添加本次派单
  1206. </Button>
  1207. <span style={{ color: "#61BBE2", marginLeft: 10 }}>请填写本次派单的年份,派单表示立即安排人员开始相关的工作!!!</span>
  1208. </FormItem>
  1209. </div>
  1210. }
  1211. {
  1212. this.state.addFrom &&
  1213. <div>
  1214. <FormItem
  1215. className="half-item"
  1216. {...formItemLayout}
  1217. label="本次派单"
  1218. >
  1219. <Select
  1220. placeholder="请选择本次派单年份"
  1221. style={{ width: "200px" }}
  1222. value={this.state.serviceYear}
  1223. onChange={(e) => {
  1224. this.setState({ serviceYear: e });
  1225. }}
  1226. >
  1227. {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
  1228. return (
  1229. <Select.Option key={item} disabled={histYear.includes(item)}>
  1230. {item}
  1231. </Select.Option>
  1232. );
  1233. })}
  1234. </Select>
  1235. {<span className="mandatory">*</span>}
  1236. </FormItem>
  1237. <FormItem
  1238. className="half-item"
  1239. {...formItemLayout}
  1240. label="服务数量"
  1241. >
  1242. <Input
  1243. placeholder="请输入服务数量"
  1244. disabled={isVip == 6}
  1245. value={1}
  1246. style={{ width: "200px" }}
  1247. // onChange={(e) => {
  1248. // this.setState({ commodityQuantity: e.target.value });
  1249. // }}
  1250. ref="commodityQuantity"
  1251. />
  1252. {<span className="mandatory">*</span>}
  1253. </FormItem>
  1254. {
  1255. this.props.type == "vipAdd" &&
  1256. <FormItem
  1257. className="half-item"
  1258. {...formItemLayout}
  1259. label="付款情况"
  1260. >
  1261. {
  1262. <Select
  1263. placeholder="选择付款情况"
  1264. style={{ width: "200px" }}
  1265. value={this.state.memberType}
  1266. onChange={(e) => {
  1267. this.setState({ memberType: e });
  1268. }}
  1269. >
  1270. {[
  1271. { value: "0", key: "已付会员节点全款" },
  1272. { value: "1", key: "已付部分期款,需特批" },
  1273. { value: "2", key: "未付款,需特批" }].map(function (item) {
  1274. return (
  1275. <Select.Option key={item.value}>
  1276. {item.key}
  1277. </Select.Option>
  1278. );
  1279. })}
  1280. </Select>
  1281. }
  1282. <span className="mandatory">*</span>
  1283. </FormItem>
  1284. }
  1285. {
  1286. (this.state.memberType == "1" || this.state.memberType == "2") && this.props.type == "vipAdd" &&
  1287. <div className="clearfix">
  1288. <FormItem
  1289. labelCol={{ span: 4 }}
  1290. wrapperCol={{ span: 16 }}
  1291. label="上传附件"
  1292. >
  1293. <PicturesWall
  1294. domId={'vip'}
  1295. fileList={this.getOrgCodeUrl}
  1296. pictureUrl={this.state.orgCodeUrl}
  1297. />
  1298. {<span className="mandatory">*</span>}
  1299. </FormItem>
  1300. <div style={{ color: "red", marginLeft: 144, marginBottom: 15 }}>
  1301. 特批需上传附件图,请上传客户同意我方继续服务并安排给我司付款的聊天记录截图,
  1302. <p>若没有客户同意继续服务及会安排付款的截图,特派流程将无法走下去,以免造成派单耽搁</p>
  1303. </div>
  1304. </div>
  1305. }
  1306. <div className="clearfix">
  1307. <FormItem
  1308. labelCol={{ span: 4 }}
  1309. wrapperCol={{ span: 16 }}
  1310. label="项目说明"
  1311. >
  1312. <Input
  1313. type="textarea"
  1314. placeholder=""
  1315. autosize={{ minRows: 2 }}
  1316. value={this.state.taskComment}
  1317. onChange={(e) => {
  1318. this.setState({ taskComment: e.target.value });
  1319. }}
  1320. />
  1321. </FormItem>
  1322. </div>
  1323. <div className="clearfix">
  1324. <FormItem
  1325. wrapperCol={{ span: 12, offset: 8 }}
  1326. className="half-middle"
  1327. >
  1328. <Button
  1329. className="submitSave"
  1330. type="primary"
  1331. onClick={() => { this.addMemberFirstSonProject() }}
  1332. >
  1333. 保存
  1334. </Button>
  1335. <Button
  1336. className="submitSave"
  1337. type="ghost"
  1338. onClick={() => {
  1339. this.setState({
  1340. addFrom: false
  1341. })
  1342. }}
  1343. >
  1344. 取消
  1345. </Button>
  1346. </FormItem>
  1347. </div>
  1348. </div>
  1349. }
  1350. </div>
  1351. }
  1352. </div>
  1353. </Spin>
  1354. </Form>
  1355. {
  1356. this.state.addYears &&
  1357. <Modal
  1358. title="添加服务年限"
  1359. visible={this.state.addYears}
  1360. okText="添加"
  1361. onOk={() => {
  1362. if (!this.state.addyear) {
  1363. message.warn("请选择年份!")
  1364. return
  1365. }
  1366. if (this.state.isGive == undefined) {
  1367. message.warn("请选择是否赠送!")
  1368. return
  1369. }
  1370. let slist = this.state.serviceLife
  1371. if (this.state.isGive == 0) {
  1372. slist.push(this.state.addyear)
  1373. } else if (this.state.isGive == 1) {
  1374. let newYear = this.state.addyear + "(赠)"
  1375. slist.push(newYear)
  1376. }
  1377. this.setState({
  1378. serviceLife: slist,
  1379. yearSum: slist.length.toString(),
  1380. addYears: false
  1381. })
  1382. }}
  1383. onCancel={() => {
  1384. this.setState({
  1385. addYears: false
  1386. })
  1387. }}
  1388. >
  1389. <Select
  1390. style={{ width: '200px', marginRight: 50 }}
  1391. placeholder="请选择年份"
  1392. onChange={e => {
  1393. this.setState({
  1394. addyear: e,
  1395. })
  1396. }}
  1397. >
  1398. {
  1399. vipYear.map(its => (
  1400. <Option
  1401. key={its}
  1402. disabled={this.state.serviceLife.toString().includes(its)}
  1403. >{its}</Option>
  1404. ))
  1405. }
  1406. </Select>
  1407. <RadioGroup
  1408. onChange={e => {
  1409. this.setState({
  1410. isGive: e.target.value
  1411. })
  1412. }}
  1413. value={this.state.isGive}
  1414. >
  1415. <Radio value={0}>非赠送</Radio>
  1416. <Radio value={1}>赠送</Radio>
  1417. </RadioGroup>
  1418. </Modal>
  1419. }
  1420. </Modal >
  1421. )
  1422. }
  1423. }
  1424. export default NewAddProject;