newAddProject.jsx 50 KB

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