newAddProject.jsx 51 KB

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