newAddProject.jsx 70 KB

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