newAddProject.jsx 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  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. labelCol={{ span: 4 }}
  722. wrapperCol={{ span: 14 }}
  723. label="专利类型:"
  724. style={{
  725. display: this.state.displayFees,
  726. marginLeft: "63px",
  727. }}
  728. >
  729. {
  730. <Select
  731. placeholder="请选择专利类型"
  732. style={{ width: "200px" }}
  733. value={this.state.patentType}
  734. onChange={(e) => {
  735. this.setState({ patentType: e });
  736. if (e !== 0 && e !== 2) {
  737. this.setState({
  738. costReduction: ''
  739. })
  740. }
  741. }}
  742. >
  743. {this.state.patentTypeList.map(function (v, k) {
  744. return (
  745. <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
  746. );
  747. })}
  748. </Select>
  749. }
  750. <span style={{ color: "red", marginLeft: "8px" }}>
  751. *
  752. </span>
  753. </FormItem>}
  754. <FormItem
  755. className="half-item"
  756. labelCol={{ span: 3 }}
  757. wrapperCol={{ span: 14 }}
  758. label="官费:"
  759. style={{
  760. display: this.state.displayFees,
  761. marginLeft: "63px",
  762. }}
  763. >
  764. {
  765. <Radio.Group
  766. value={this.state.officialCost}
  767. onChange={(e) => {
  768. this.setState({ officialCost: e.target.value });
  769. if (e.target.value === 0) {
  770. this.setState({
  771. costReduction: ''
  772. })
  773. }
  774. }}
  775. >
  776. <Radio value={1}>含官费</Radio>
  777. <Radio value={0}>不含官费</Radio>
  778. </Radio.Group>
  779. }
  780. <span style={{ color: "red", marginLeft: "8px" }}>
  781. *
  782. </span>
  783. </FormItem>
  784. {
  785. (this.state.patentType === 0 || this.state.patentType === 2) && this.state.officialCost === 1 &&
  786. <FormItem
  787. className="half-item"
  788. labelCol={{ span: 3 }}
  789. wrapperCol={{ span: 14 }}
  790. label="费减:"
  791. style={{
  792. display: this.state.displayFees,
  793. marginLeft: "63px",
  794. }}
  795. >
  796. {/*不含官费或者专利类型不为复审或者申请时置灰*/}
  797. <Radio.Group
  798. disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
  799. value={this.state.costReduction}
  800. onChange={(e) => {
  801. this.setState({ costReduction: e.target.value });
  802. }}
  803. >
  804. <Radio value={1}>有费减</Radio>
  805. <Radio value={0}>无费减</Radio>
  806. </Radio.Group>
  807. <span style={{ color: "red", marginLeft: "8px" }}>
  808. *
  809. </span>
  810. </FormItem>
  811. }
  812. {
  813. //审计
  814. this.state.addProjectType == "3" &&
  815. <FormItem
  816. className="half-item"
  817. {...formItemLayout}
  818. label="服务年限"
  819. >
  820. {
  821. <Select
  822. mode="multiple"
  823. style={{ width: '200px' }}
  824. placeholder="请选择服务年限"
  825. value={this.state.serviceLife}
  826. onChange={(e) => {
  827. this.setState({
  828. serviceLife: e,
  829. })
  830. }}
  831. >
  832. {children}
  833. </Select>
  834. }
  835. {<span className="mandatory">*</span>}
  836. </FormItem>
  837. }
  838. {
  839. isVip == 6 &&
  840. <FormItem
  841. className="half-item"
  842. {...formItemLayout}
  843. label="会员服务年限"
  844. >
  845. {
  846. <div>
  847. {
  848. this.state.serviceLife.map((tag) =>
  849. <Tag closable={!isEdit} key={tag}
  850. afterClose={() => this.handleClose(tag)}
  851. >{tag}</Tag>
  852. )
  853. }
  854. {
  855. !isEdit && (this.state.serviceLife.length < 5) &&
  856. <Button
  857. size="small"
  858. type="primary"
  859. onClick={() => {
  860. this.setState({
  861. addYears: true,
  862. addyear: undefined,
  863. isGive: undefined,
  864. })
  865. }}>
  866. + 添加服务年限
  867. </Button>
  868. }
  869. </div>
  870. }
  871. </FormItem>
  872. }
  873. {
  874. isVip == 6 &&
  875. <FormItem
  876. className="half-item"
  877. {...formItemLayout}
  878. label="会员总服务年限"
  879. >
  880. {
  881. !this.state.yearSum ? "" :
  882. [
  883. { value: "0", key: "" },
  884. { value: "1", key: "一年" },
  885. { value: "2", key: "二年" },
  886. { value: "3", key: "三年" },
  887. { value: "4", key: "四年" },
  888. { value: "5", key: "五年" },
  889. ][this.state.yearSum]["key"]
  890. }
  891. </FormItem>
  892. }
  893. {
  894. // 会员合同期
  895. isVip == 6 &&
  896. <div className="clearfix">
  897. <FormItem
  898. className="half-item"
  899. {...formItemLayout}
  900. >
  901. </FormItem>
  902. <FormItem
  903. className="half-item"
  904. {...formItemLayout}
  905. label="合同期"
  906. >
  907. {
  908. <RangePicker
  909. style={{ width: 200 }}
  910. disabled={isEdit}
  911. value={[
  912. this.state.contractTerm[0]
  913. ? moment(this.state.contractTerm[0])
  914. : null,
  915. this.state.contractTerm[1]
  916. ? moment(this.state.contractTerm[1])
  917. : null,
  918. ]}
  919. onChange={(data, dataString) => {
  920. this.setState({ contractTerm: dataString });
  921. }}
  922. />
  923. }
  924. {<span className="mandatory">*</span>}
  925. </FormItem>
  926. </div>
  927. }
  928. {
  929. // 审计
  930. this.state.addProjectType == "3" &&
  931. <div className="clearfix">
  932. <FormItem
  933. labelCol={{ span: 4 }}
  934. wrapperCol={{ span: 16 }}
  935. label=""
  936. >
  937. <span style={{ color: "red" }}>注:派单年度的上年度总资产和收入。如,当前为2022年,那么需要填写2021年的总资产和收入!</span>
  938. </FormItem>
  939. <FormItem
  940. className="half-item"
  941. label="企业上年度总资本(万元)"
  942. {...formItemLayout}
  943. >
  944. <Input
  945. type='number'
  946. placeholder=""
  947. value={this.state.lastYearCapital}
  948. style={{ width: "200px" }}
  949. onChange={(e) => {
  950. this.setState({ lastYearCapital: e.target.value });
  951. }}
  952. />
  953. {<span className="mandatory">*</span>}
  954. </FormItem>
  955. <FormItem
  956. className="half-item"
  957. label="企业上年度总收入(万元)"
  958. {...formItemLayout}
  959. >
  960. <Input
  961. type='number'
  962. placeholder=""
  963. value={this.state.lastYearIncome}
  964. style={{ width: "200px" }}
  965. onChange={(e) => {
  966. this.setState({ lastYearIncome: e.target.value });
  967. }}
  968. />
  969. {<span className="mandatory">*</span>}
  970. </FormItem>
  971. </div>
  972. }
  973. {
  974. // 普通项目说明
  975. isVip != 6 &&
  976. <div className="clearfix">
  977. <FormItem
  978. labelCol={{ span: 4 }}
  979. wrapperCol={{ span: 16 }}
  980. label="项目说明"
  981. >
  982. {
  983. <Input
  984. type="textarea"
  985. placeholder=""
  986. autosize={{ minRows: 3 }}
  987. value={this.state.taskComment}
  988. onChange={(e) => {
  989. this.setState({ taskComment: e.target.value });
  990. }}
  991. />
  992. }
  993. </FormItem>
  994. </div>
  995. }
  996. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  997. {this.state.addProjectType === 5 &&
  998. <div className="clearfix">
  999. <FormItem
  1000. className="half-item"
  1001. {...formItemLayout}
  1002. label="企业要求申报批次"
  1003. >
  1004. {
  1005. <Select
  1006. placeholder="请选择企业要求申报批次"
  1007. style={{ width: "200px" }}
  1008. value={this.state.declarationBatch}
  1009. onChange={(e) => {
  1010. this.setState({ declarationBatch: e });
  1011. }}
  1012. >
  1013. <Select.Option value={1}>
  1014. 第一批
  1015. </Select.Option>
  1016. <Select.Option value={2}>
  1017. 第二批
  1018. </Select.Option>
  1019. <Select.Option value={3}>
  1020. 第三批
  1021. </Select.Option>
  1022. <Select.Option value={4}>
  1023. 第四批
  1024. </Select.Option>
  1025. </Select>
  1026. }
  1027. {<span className="mandatory">*</span>}
  1028. </FormItem>
  1029. <FormItem
  1030. className="half-item"
  1031. {...formItemLayout}
  1032. label="申报年份"
  1033. >
  1034. {
  1035. <Select
  1036. style={{ width: '200px' }}
  1037. placeholder="请选择申报年份"
  1038. value={this.state.serviceYear}
  1039. onChange={e => {
  1040. this.setState({
  1041. serviceYear: e,
  1042. })
  1043. }}
  1044. >
  1045. {
  1046. vipYear.map(its => (
  1047. <Option key={its}>{its}</Option>
  1048. ))
  1049. }
  1050. </Select>
  1051. }
  1052. {<span className="mandatory">*</span>}
  1053. </FormItem>
  1054. </div>
  1055. }
  1056. {
  1057. this.props.isIso || this.state.isIso ?
  1058. <div className="clearfix">
  1059. <FormItem
  1060. className="half-item"
  1061. {...formItemLayout}
  1062. label="是否包含认证费用"
  1063. >
  1064. {
  1065. <Select
  1066. placeholder="请选择是否包含认证费用"
  1067. style={{ width: "200px" }}
  1068. value={this.state.ifCertificationFee}
  1069. onChange={(e) => {
  1070. this.setState({ ifCertificationFee: e });
  1071. }}
  1072. >
  1073. <Select.Option value={"0"}>否</Select.Option>
  1074. <Select.Option value={"1"}>是</Select.Option>
  1075. </Select>
  1076. }
  1077. {<span className="mandatory">*</span>}
  1078. </FormItem>
  1079. </div> : null
  1080. }
  1081. {((isVip != 6) || (isVip == 6 && !isEdit)) &&
  1082. <div className="clearfix">
  1083. <FormItem
  1084. wrapperCol={{ span: 12, offset: 8 }}
  1085. className="half-middle"
  1086. >
  1087. <Button
  1088. className="submitSave"
  1089. type="primary"
  1090. onClick={() => {
  1091. this.onSubmit();
  1092. }}
  1093. >
  1094. 保存
  1095. </Button>
  1096. <Button
  1097. className="submitSave"
  1098. type="ghost"
  1099. onClick={this.props.onCancel}
  1100. >
  1101. 取消
  1102. </Button>
  1103. </FormItem>
  1104. </div>
  1105. }
  1106. {
  1107. // 会员项目子集列表
  1108. isEdit &&
  1109. !!this.state.splitList && this.state.splitList.length > 0 &&
  1110. this.state.splitList.map((item) =>
  1111. <div
  1112. key={item.id}
  1113. className="clearfix"
  1114. style={{
  1115. width: "100%",
  1116. borderTop: "1px dashed #000000",
  1117. padding: "10px 0"
  1118. }}
  1119. >
  1120. <FormItem
  1121. className="half-item"
  1122. {...formItemLayout}
  1123. label="本次派单"
  1124. >
  1125. {item.serviceYear}
  1126. </FormItem>
  1127. <FormItem
  1128. className="half-item"
  1129. {...formItemLayout}
  1130. label="服务数量"
  1131. >
  1132. {item.commodityQuantity}
  1133. </FormItem>
  1134. {
  1135. type == "vipAdd" &&
  1136. <FormItem
  1137. className="half-item"
  1138. {...formItemLayout}
  1139. label="付款情况"
  1140. >
  1141. {item.memberType == "0"
  1142. ? "已付会员节点全款" : item.memberType == "1"
  1143. ? "已付部分期款,需特批" : item.memberType == "2"
  1144. ? "未付款,需特批" : ""}
  1145. </FormItem>
  1146. }
  1147. {
  1148. type == "vipAdd" &&
  1149. (item.memberType == "1" || item.memberType == "2") &&
  1150. <div className="clearfix">
  1151. <FormItem
  1152. labelCol={{ span: 4 }}
  1153. wrapperCol={{ span: 16 }}
  1154. label="附件"
  1155. >
  1156. {item.pictureUrl ?
  1157. <div>
  1158. <ImgList fileList={splitUrl(item.pictureUrl, ",", globalConfig.avatarHost + "/upload")} ItemWidth={'96px'} />
  1159. </div> : <div />}
  1160. </FormItem>
  1161. </div>
  1162. }
  1163. <div className="clearfix">
  1164. <FormItem
  1165. labelCol={{ span: 4 }}
  1166. wrapperCol={{ span: 16 }}
  1167. label="项目说明"
  1168. >
  1169. {item.taskComment}
  1170. </FormItem>
  1171. </div>
  1172. </div>
  1173. )
  1174. }
  1175. {
  1176. this.state.splitList.length < this.state.yearSum &&
  1177. <div
  1178. className="clearfix"
  1179. style={{
  1180. width: "100%",
  1181. borderTop: "1px dashed #000000",
  1182. padding: "30px 0 10px 0"
  1183. }}
  1184. >
  1185. {
  1186. isEdit &&
  1187. !this.state.addFrom &&
  1188. this.state.splitList.length < this.state.yearSum &&
  1189. <div className="clearfix">
  1190. <Button
  1191. type="primary"
  1192. onClick={() => {
  1193. this.setState({
  1194. addFrom: true
  1195. })
  1196. }}
  1197. >
  1198. + 本次派单
  1199. </Button>
  1200. </div>
  1201. }
  1202. {
  1203. this.state.addFrom &&
  1204. <div>
  1205. <FormItem
  1206. className="half-item"
  1207. {...formItemLayout}
  1208. label="本次派单"
  1209. >
  1210. <Select
  1211. placeholder="请选择本次派单年份"
  1212. style={{ width: "200px" }}
  1213. value={this.state.serviceYear}
  1214. onChange={(e) => {
  1215. this.setState({ serviceYear: e });
  1216. }}
  1217. >
  1218. {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
  1219. return (
  1220. <Select.Option key={item} disabled={histYear.includes(item)}>
  1221. {item}
  1222. </Select.Option>
  1223. );
  1224. })}
  1225. </Select>
  1226. {<span className="mandatory">*</span>}
  1227. </FormItem>
  1228. <FormItem
  1229. className="half-item"
  1230. {...formItemLayout}
  1231. label="服务数量"
  1232. >
  1233. <Input
  1234. placeholder="请输入服务数量"
  1235. disabled={isVip == 6}
  1236. value={1}
  1237. style={{ width: "200px" }}
  1238. // onChange={(e) => {
  1239. // this.setState({ commodityQuantity: e.target.value });
  1240. // }}
  1241. ref="commodityQuantity"
  1242. />
  1243. {<span className="mandatory">*</span>}
  1244. </FormItem>
  1245. {
  1246. this.props.type == "vipAdd" &&
  1247. <FormItem
  1248. className="half-item"
  1249. {...formItemLayout}
  1250. label="付款情况"
  1251. >
  1252. {
  1253. <Select
  1254. placeholder="选择付款情况"
  1255. style={{ width: "200px" }}
  1256. value={this.state.memberType}
  1257. onChange={(e) => {
  1258. this.setState({ memberType: e });
  1259. }}
  1260. >
  1261. {[
  1262. { value: "0", key: "已付会员节点全款" },
  1263. { value: "1", key: "已付部分期款,需特批" },
  1264. { value: "2", key: "未付款,需特批" }].map(function (item) {
  1265. return (
  1266. <Select.Option key={item.value}>
  1267. {item.key}
  1268. </Select.Option>
  1269. );
  1270. })}
  1271. </Select>
  1272. }
  1273. <span className="mandatory">*</span>
  1274. </FormItem>
  1275. }
  1276. {
  1277. (this.state.memberType == "1" || this.state.memberType == "2") && this.props.type == "vipAdd" &&
  1278. <div className="clearfix">
  1279. <FormItem
  1280. labelCol={{ span: 4 }}
  1281. wrapperCol={{ span: 16 }}
  1282. label="上传附件"
  1283. >
  1284. <PicturesWall
  1285. domId={'vip'}
  1286. fileList={this.getOrgCodeUrl}
  1287. pictureUrl={this.state.orgCodeUrl}
  1288. />
  1289. {<span className="mandatory">*</span>}
  1290. </FormItem>
  1291. <div style={{ color: "red", marginLeft: 144, marginBottom: 15 }}>
  1292. 特批需上传附件图,请上传客户同意我方继续服务并安排给我司付款的聊天记录截图,
  1293. <p>若没有客户同意继续服务及会安排付款的截图,特派流程将无法走下去,以免造成派单耽搁</p>
  1294. </div>
  1295. </div>
  1296. }
  1297. <div className="clearfix">
  1298. <FormItem
  1299. labelCol={{ span: 4 }}
  1300. wrapperCol={{ span: 16 }}
  1301. label="项目说明"
  1302. >
  1303. <Input
  1304. type="textarea"
  1305. placeholder=""
  1306. autosize={{ minRows: 2 }}
  1307. value={this.state.taskComment}
  1308. onChange={(e) => {
  1309. this.setState({ taskComment: e.target.value });
  1310. }}
  1311. />
  1312. </FormItem>
  1313. </div>
  1314. <div className="clearfix">
  1315. <FormItem
  1316. wrapperCol={{ span: 12, offset: 8 }}
  1317. className="half-middle"
  1318. >
  1319. <Button
  1320. className="submitSave"
  1321. type="primary"
  1322. onClick={() => { this.addMemberFirstSonProject() }}
  1323. >
  1324. 保存
  1325. </Button>
  1326. <Button
  1327. className="submitSave"
  1328. type="ghost"
  1329. onClick={() => {
  1330. this.setState({
  1331. addFrom: false
  1332. })
  1333. }}
  1334. >
  1335. 取消
  1336. </Button>
  1337. </FormItem>
  1338. </div>
  1339. </div>
  1340. }
  1341. </div>
  1342. }
  1343. </div>
  1344. </Spin>
  1345. </Form>
  1346. {
  1347. this.state.addYears &&
  1348. <Modal
  1349. title="添加服务年限"
  1350. visible={this.state.addYears}
  1351. okText="添加"
  1352. onOk={() => {
  1353. if (!this.state.addyear) {
  1354. message.warn("请选择年份!")
  1355. return
  1356. }
  1357. if (this.state.isGive == undefined) {
  1358. message.warn("请选择是否赠送!")
  1359. return
  1360. }
  1361. let slist = this.state.serviceLife
  1362. if (this.state.isGive == 0) {
  1363. slist.push(this.state.addyear)
  1364. } else if (this.state.isGive == 1) {
  1365. let newYear = this.state.addyear + "(赠)"
  1366. slist.push(newYear)
  1367. }
  1368. this.setState({
  1369. serviceLife: slist,
  1370. yearSum: slist.length.toString(),
  1371. addYears: false
  1372. })
  1373. }}
  1374. onCancel={() => {
  1375. this.setState({
  1376. addYears: false
  1377. })
  1378. }}
  1379. >
  1380. <Select
  1381. style={{ width: '200px', marginRight: 50 }}
  1382. placeholder="请选择年份"
  1383. onChange={e => {
  1384. this.setState({
  1385. addyear: e,
  1386. })
  1387. }}
  1388. >
  1389. {
  1390. vipYear.map(its => (
  1391. <Option
  1392. key={its}
  1393. disabled={this.state.serviceLife.toString().includes(its)}
  1394. >{its}</Option>
  1395. ))
  1396. }
  1397. </Select>
  1398. <RadioGroup
  1399. onChange={e => {
  1400. this.setState({
  1401. isGive: e.target.value
  1402. })
  1403. }}
  1404. value={this.state.isGive}
  1405. >
  1406. <Radio value={0}>非赠送</Radio>
  1407. <Radio value={1}>赠送</Radio>
  1408. </RadioGroup>
  1409. </Modal>
  1410. }
  1411. </Modal >
  1412. )
  1413. }
  1414. }
  1415. export default NewAddProject;