newEditProject.jsx 51 KB

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