newAddProject.jsx 60 KB

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