changeApply.js 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645
  1. // 变更--驳回
  2. import React, { Component } from "react";
  3. import {
  4. Form,
  5. Select,
  6. Input,
  7. Button,
  8. message,
  9. Spin,
  10. Tag,
  11. Table,
  12. Col,
  13. Popconfirm,
  14. Modal,
  15. AutoComplete,
  16. DatePicker,
  17. Radio,
  18. } from "antd";
  19. import $ from "jquery/src/ajax";
  20. import moment from "moment";
  21. import ResolutionDetail from "@/resolutionDetail";
  22. import PicturesWall from "./picturesWall";
  23. import Rizhi from "./rizhi";
  24. import {
  25. cuiJieDian,
  26. orderTypes,
  27. customerType,
  28. jiedian,
  29. tepi,
  30. boutique
  31. } from "@/dataDic.js";
  32. import { moneyVerify } from "@/tools.js"
  33. import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
  34. // F:\developmentFile\kede-client\js\component\common\projectOperation\index.jsx
  35. import ProjectOperation from "../../../../common/projectOperation";
  36. const FormItem = Form.Item;
  37. const confirm = Modal.confirm;
  38. const Option = AutoComplete.Option;
  39. const formItemLayout = {
  40. labelCol: { span: 8 },
  41. wrapperCol: { span: 14 }
  42. };
  43. class ChangeApply extends Component {
  44. constructor(props) {
  45. super(props);
  46. this.state = {
  47. data: {},
  48. voucherUrl: [],
  49. dataSource: [],
  50. cuiDataSource: [],
  51. loading: false,
  52. changeCuiList: [
  53. {
  54. title: "变更状态",
  55. dataIndex: "type",
  56. key: "type",
  57. render: (text) => {
  58. let str = "";
  59. let color = "";
  60. if (text == 1) {
  61. str = "增";
  62. color = "#87d068";
  63. } else if (text == 2) {
  64. str = "改";
  65. color = "#108ee9";
  66. } else if (text == 3) {
  67. str = "删";
  68. color = "#f50";
  69. }
  70. return (
  71. <Tag
  72. color={color}
  73. style={{ display: text == 0 ? "none" : "inline-block" }}
  74. >
  75. {str}
  76. </Tag>
  77. );
  78. },
  79. },
  80. {
  81. title: "项目名称",
  82. dataIndex: "commodityName",
  83. key: "commodityName",
  84. render: (text, record, index) => {
  85. let dataArr = this.state.proDataSource || [];
  86. if (text) {
  87. if (record.ctid) {
  88. return <span>{text + "-" + record.ctid}</span>;
  89. } else {
  90. let tid = record.tid;
  91. let ctid = "";
  92. dataArr.forEach((item, index) => {
  93. if (item.tid == tid) {
  94. ctid = item.id;
  95. }
  96. });
  97. return <span>{text + "-" + ctid}</span>;
  98. }
  99. }
  100. return (
  101. <Select
  102. placeholder="请选择名称"
  103. style={{ width: "150px" }}
  104. disabled={this.state.getLoad && record.sortName ? true : false}
  105. onChange={(e) => {
  106. let num = e.lastIndexOf("-");
  107. let ctid = e.substr(num + 1);
  108. record.sortName = e.substring(0, num);
  109. dataArr.forEach((item) => {
  110. if (
  111. item.commodityName == record.sortName &&
  112. ctid == item.id
  113. ) {
  114. record.cname = item.cname;
  115. record.ctid = item.id;
  116. record.isSave = true;
  117. record.sort = item.cSort;
  118. cuiJieDian.forEach((item) => {
  119. if (item.value == record.sort) {
  120. record.arr = item.children;
  121. let yearFlag = true;
  122. if (record.sort == 6) {
  123. yearFlag = false;
  124. }
  125. this.setState({
  126. getLoad: true,
  127. yearFlag,
  128. });
  129. }
  130. });
  131. }
  132. });
  133. }}
  134. >
  135. {dataArr.map((item, index) => {
  136. if (item.type == 3) {
  137. return (
  138. <Select.Option
  139. key={item.id}
  140. value={item.commodityName + "-" + item.id}
  141. disabled
  142. >
  143. {item.commodityName + "-" + item.id}
  144. </Select.Option>
  145. );
  146. } else {
  147. return (
  148. <Select.Option
  149. key={item.id}
  150. value={item.commodityName + "-" + item.id}
  151. >
  152. {item.commodityName + "-" + item.id}
  153. </Select.Option>
  154. );
  155. }
  156. })}
  157. </Select>
  158. );
  159. },
  160. },
  161. {
  162. title: "项目分类",
  163. dataIndex: "projectType",
  164. key: "projectType",
  165. render: (text, record) => {
  166. if (text) {
  167. let arr = this.state.proDataSource || [];
  168. let str = "";
  169. for (let i = 0; i < arr.length; i++) {
  170. if (this.state.proDataSource[i].cSort == text) {
  171. str = this.state.proDataSource[i].cname;
  172. return <span>{str}</span>;
  173. }
  174. }
  175. }
  176. if (this.state.getLoad) {
  177. return (
  178. <Select
  179. style={{ width: "150px" }}
  180. placeholder="请选择分类"
  181. value={record.cname}
  182. >
  183. <Select.Option key={record.sort} value={record.cname}>
  184. {record.cname}
  185. </Select.Option>
  186. </Select>
  187. );
  188. } else {
  189. return (
  190. <Select style={{ width: "150px" }} placeholder="请选择分类">
  191. <Select.Option key={record.sort} value={record.cname}>
  192. {record.cname}
  193. </Select.Option>
  194. </Select>
  195. );
  196. }
  197. },
  198. },
  199. {
  200. title: "催款科目",
  201. dataIndex: "dunTypeName",
  202. key: "dunTypeName",
  203. render: (text, record) => {
  204. if (text) {
  205. return <span>{text}</span>;
  206. }
  207. if (this.state.getLoad) {
  208. let arr = record.arr || [];
  209. return (
  210. <div>
  211. <Select
  212. style={{ width: "150px", marginRight: 5 }}
  213. placeholder="请选择分类"
  214. onChange={(e) => {
  215. record.dunType = e;
  216. if (record.dunType != 0) {
  217. record.customizeTimes = "";
  218. record.customizeName = "";
  219. }
  220. if (e == 0) {
  221. record.dunTypeCustom = true;
  222. } else {
  223. record.dunTypeCustom = false;
  224. }
  225. if (e != 1) {
  226. this.setState({
  227. timeFlag: true,
  228. });
  229. } else {
  230. this.setState({
  231. timeFlag: false,
  232. });
  233. }
  234. if (e == 1 && record.sort == 6) {
  235. this.setState({
  236. yearFlag: true,
  237. });
  238. } else if (e != 1 && record.sort == 6) {
  239. this.setState({
  240. yearFlag: false,
  241. });
  242. }
  243. if (record.sort == 3 && e == 3) {
  244. this.setState({
  245. boFlag: true,
  246. });
  247. } else {
  248. this.setState({
  249. boFlag: false,
  250. });
  251. }
  252. }}
  253. >
  254. {arr.map((item) => {
  255. record;
  256. return (
  257. <Select.Option key={item.value} value={item.value}>
  258. {item.key}
  259. </Select.Option>
  260. );
  261. })}
  262. <Select.Option key={0} value={0}>
  263. 自定义
  264. </Select.Option>
  265. </Select>
  266. {record.dunType == 0 ? (
  267. <Input
  268. value={record.customizeName}
  269. placeholder="请输入自定义名称"
  270. required="required"
  271. onChange={(e) => {
  272. record.customizeName = e.target.value;
  273. this.setState({
  274. contactList: this.state.contactList,
  275. });
  276. }}
  277. style={{ width: "120px" }}
  278. />
  279. ) : (
  280. ""
  281. )}
  282. </div>
  283. );
  284. } else {
  285. return (
  286. <Select style={{ width: "150px" }} placeholder="请选择分类">
  287. <Select.Option key={0} value={"请选择上一项"}></Select.Option>
  288. </Select>
  289. );
  290. }
  291. },
  292. },
  293. {
  294. title: "收款时间(特批需选择时间)",
  295. dataIndex: "waitDay",
  296. key: "waitDay",
  297. render: (text, record) => {
  298. if (record.dunTypeName) {
  299. if (record.customizeTimes) {
  300. return record.customizeTimes;
  301. }
  302. if (text == 0) {
  303. var str = "当天";
  304. } else if (!text) {
  305. var str = "";
  306. } else {
  307. var str = text + "天";
  308. }
  309. return <span>{str}</span>;
  310. }
  311. return (
  312. <div>
  313. {record.dunType == 0 ? (
  314. <DatePicker
  315. style={{ width: 150 }}
  316. disabledDate={(e) => {
  317. let time = moment(e).valueOf();
  318. let today = Date.parse(new Date());
  319. if (time <= today) {
  320. return true;
  321. }
  322. }}
  323. onChange={(e, t) => {
  324. record.customizeTimes = t;
  325. }}
  326. />
  327. ) : (
  328. <Select
  329. placeholder="请选择时间"
  330. style={{ width: "160px" }}
  331. disabled={
  332. this.state.approval != 0 && !this.state.timeFlag
  333. ? false
  334. : true
  335. }
  336. onChange={(e) => {
  337. record.waitDay = e;
  338. }}
  339. >
  340. <Select.Option key={0}>当天</Select.Option>
  341. <Select.Option key={3}>3天</Select.Option>
  342. <Select.Option key={5}>5天</Select.Option>
  343. <Select.Option key={7}>7天</Select.Option>
  344. <Select.Option key={15}>15天</Select.Option>
  345. </Select>
  346. )}
  347. </div>
  348. );
  349. },
  350. },
  351. {
  352. title: "金额(万元)",
  353. dataIndex: "money",
  354. key: "money",
  355. render: (text, record) => {
  356. if (record.dunTypeName) {
  357. if (record.appropriationRatio) {
  358. return <span>{record.appropriationRatio}(拨款比例)</span>;
  359. } else {
  360. return <span>{text}</span>;
  361. }
  362. }
  363. if (this.state.boFlag) {
  364. return (
  365. <div>
  366. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  367. <Select
  368. placeholder="选择"
  369. defaultValue={"金额"}
  370. onChange={(e) => {
  371. record.boStatus = e;
  372. }}
  373. >
  374. <Select.Option key={true}>比例</Select.Option>
  375. <Select.Option key={false}>金额</Select.Option>
  376. </Select>
  377. </div>
  378. <div style={{ float: "right" }}>
  379. <Input
  380. type='number'
  381. value={record.money}
  382. key={record.id}
  383. required="required"
  384. onChange={(e) => {
  385. record.money = e.target.value;
  386. this.setState({
  387. contactList: this.state.contactList,
  388. });
  389. }}
  390. style={{ width: "120px" }}
  391. />
  392. </div>
  393. </div>
  394. );
  395. } else {
  396. return (
  397. <div>
  398. <Input
  399. type='number'
  400. value={record.money}
  401. placeholder="请输入金额(必填项)"
  402. key={record.id}
  403. required="required"
  404. onChange={(e) => {
  405. record.money = e.target.value;
  406. this.setState({ contactList: this.state.contactList });
  407. }}
  408. style={{ width: "120px" }}
  409. />
  410. </div>
  411. );
  412. }
  413. },
  414. },
  415. {
  416. title: "服务年限",
  417. dataIndex: "startDate",
  418. key: "startDate",
  419. render: (text, record) => {
  420. if (record.dunTypeName) {
  421. return <span>{text}</span>;
  422. }
  423. return (
  424. <div>
  425. {
  426. record.dunType != 0 ?
  427. <Select
  428. placeholder="请选择年限"
  429. style={{ width: "150px" }}
  430. disabled={this.state.yearFlag ? true : false}
  431. onChange={(e) => {
  432. record.effectiveCount = e;
  433. }}
  434. >
  435. {/* <Select.Option key={null}>无</Select.Option> */}
  436. <Select.Option key={1}>一年</Select.Option>
  437. <Select.Option key={3}>两年</Select.Option>
  438. <Select.Option key={5}>三年</Select.Option>
  439. <Select.Option key={7}>四年</Select.Option>
  440. <Select.Option key={9}>五年</Select.Option>
  441. </Select> : <div />
  442. }
  443. </div>
  444. );
  445. },
  446. },
  447. {
  448. title: "催款状态",
  449. dataIndex: "status",
  450. key: "status",
  451. render: (text) => {
  452. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  453. },
  454. },
  455. {
  456. title: "操作",
  457. dataIndex: "dels",
  458. key: "dels",
  459. render: (text, record, index) => {
  460. return (
  461. <div>
  462. <Popconfirm
  463. title="是否删除?"
  464. onConfirm={() => {
  465. this.changeDeleteCui(record);
  466. }}
  467. okText="删除"
  468. cancelText="不删除"
  469. >
  470. <Button
  471. disabled={this.state.listCuiFlag}
  472. style={{
  473. marginRight: "10px",
  474. display: this.state.displayList ? "none" : "block",
  475. }}
  476. >
  477. 删除
  478. </Button>
  479. </Popconfirm>
  480. {record.isSave ? (
  481. <Button
  482. type="primary"
  483. style={{ marginTop: 5 }}
  484. onClick={(e) => {
  485. this.changeSaveCui(record);
  486. }}
  487. >
  488. 保存
  489. </Button>
  490. ) : (
  491. ""
  492. )}
  493. </div>
  494. );
  495. },
  496. },
  497. ],
  498. resVisible: false,
  499. proColumns: [
  500. {
  501. title: "变更状态",
  502. dataIndex: "type",
  503. key: "type",
  504. render: (text, record) => {
  505. let str = "";
  506. let color = "";
  507. if (text == 1) {
  508. str = "增";
  509. color = "#87d068";
  510. } else if (text == 2) {
  511. str = "改";
  512. color = "#108ee9";
  513. } else if (text == 3) {
  514. str = "删";
  515. color = "#f50";
  516. }
  517. return (
  518. <span>
  519. <Tag
  520. color={color}
  521. style={{ display: text == 0 ? "none" : "inline-block" }}
  522. >
  523. {str}
  524. </Tag>
  525. {record.splitStatus == 1 ? (
  526. <Tag
  527. color="#108ee9"
  528. >
  529. 父项目
  530. </Tag>
  531. ) : (
  532. ""
  533. )}
  534. {record.splitStatus == 2 ? (
  535. <Tag
  536. color="#108ee9"
  537. >
  538. 子项目
  539. </Tag>
  540. ) : (
  541. ""
  542. )}
  543. </span>
  544. );
  545. },
  546. },
  547. {
  548. title: "业务项目名称",
  549. dataIndex: "commodityName",
  550. key: "commodityName",
  551. render: (text, record) => {
  552. return <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span>{"-" + record.id}</span>
  553. }
  554. },
  555. {
  556. title: "项目类别",
  557. dataIndex: "cname",
  558. key: "cname",
  559. },
  560. {
  561. title: "项目数量",
  562. dataIndex: "commodityQuantity",
  563. key: "commodityQuantity",
  564. },
  565. {
  566. title: "金额(万元)",
  567. dataIndex: "commodityPrice",
  568. key: "commodityPrice",
  569. render: (text, record) => {
  570. if (record.splitStatus == 2) {
  571. return "/";
  572. } else {
  573. return text;
  574. }
  575. },
  576. },
  577. {
  578. title: "主要项目",
  579. dataIndex: "main",
  580. key: "main",
  581. render: (text) => {
  582. return text ? "是" : "否";
  583. },
  584. },
  585. {
  586. title: "项目负责人",
  587. dataIndex: "receiverName",
  588. key: "receiverName",
  589. },
  590. {
  591. title: "项目说明",
  592. dataIndex: "taskComment",
  593. key: "taskComment",
  594. render: (text) => {
  595. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  596. },
  597. },
  598. {
  599. title: "操作",
  600. dataIndex: "ABC",
  601. key: "ABC",
  602. render: (text, record) => {
  603. return (
  604. <div>
  605. <Button
  606. onClick={(e) => {
  607. e.stopPropagation();
  608. this.showConfirm(this.changeDeletePro, record);
  609. }}
  610. disabled={this.state.listFlag}
  611. style={{
  612. display: this.state.displayList ? "none" : "block",
  613. }}
  614. >
  615. 删除
  616. </Button>
  617. </div>
  618. );
  619. },
  620. },
  621. ],
  622. patentTypeList: [],
  623. displayFees: "none",
  624. };
  625. this.departmentList = this.departmentList.bind(this);
  626. this.changeApply = this.changeApply.bind(this);
  627. this.getVoucherUrl = this.getVoucherUrl.bind(this);
  628. this.proList = this.proList.bind(this);
  629. this.cuiList = this.cuiList.bind(this);
  630. this.showConfirm = this.showConfirm.bind(this);
  631. this.showConfirmChange = this.showConfirmChange.bind(this);
  632. this.changeAddPro = this.changeAddPro.bind(this);
  633. this.changeProSubmit = this.changeProSubmit.bind(this);
  634. this.changeDeletePro = this.changeDeletePro.bind(this);
  635. this.changeAddCui = this.changeAddCui.bind(this);
  636. this.changeDeleteCui = this.changeDeleteCui.bind(this);
  637. this.changeSaveCui = this.changeSaveCui.bind(this);
  638. this.submitChange = this.submitChange.bind(this);
  639. this.editCui = this.editCui.bind(this);
  640. this.editPro = this.editPro.bind(this);
  641. this.submitEditCui = this.submitEditCui.bind(this);
  642. this.submitEditPro = this.submitEditPro.bind(this);
  643. this.nextCancel = this.nextCancel.bind(this);
  644. this.customerChange = this.customerChange.bind(this);
  645. this.selectAuto = this.selectAuto.bind(this);
  646. this.supervisor = this.supervisor.bind(this);
  647. this.httpChange = this.httpChange.bind(this);
  648. this.showRes = this.showRes.bind(this);
  649. this.resCancel = this.resCancel.bind(this);
  650. this.deleteChange = this.deleteChange.bind(this);
  651. this.not = this.not.bind(this);
  652. }
  653. componentDidMount() {
  654. this.getpatentTypeList()
  655. }
  656. nextCancel() {
  657. this.setState({
  658. addnextVisible: false,
  659. changeVisible: false
  660. });
  661. }
  662. showConfirm(fn, record) {
  663. confirm({
  664. title: "确定删除此项目吗?",
  665. content: (
  666. <span style={{ color: "red" }}>
  667. 删除后会将该项目下的所有催款节点自动清除!!!
  668. </span>
  669. ),
  670. onOk() {
  671. fn(record);
  672. },
  673. onCancel() { }
  674. });
  675. }
  676. showConfirmChange(fn, record) {
  677. confirm({
  678. title: "确定取消本次变更吗?",
  679. content: (
  680. <span style={{ color: "red" }}>
  681. 取消后本次变更将作废!!!
  682. </span>
  683. ),
  684. onOk() {
  685. fn();
  686. },
  687. onCancel() { }
  688. });
  689. }
  690. getpatentTypeList() {
  691. $.ajax({
  692. method: "get",
  693. dataType: "json",
  694. crossDomain: false,
  695. url: globalConfig.context + '/api/admin/orderProject/getPatentType',
  696. success: function (data) {
  697. if (data.error.length === 0) {
  698. this.setState({
  699. patentTypeList: data.data
  700. })
  701. } else {
  702. message.warning(data.error[0].message);
  703. };
  704. }.bind(this)
  705. });
  706. }
  707. //服务值改变时请求客户名称
  708. httpChange(e) {
  709. this.state.gid = "";
  710. if (e.length >= 1) {
  711. this.supervisor(e, false);
  712. }
  713. this.setState({
  714. commodityName: e
  715. });
  716. }
  717. //客户名称自动补全
  718. customerChange(e) {
  719. if (this.state.customType) {
  720. this.state.autoId = "";
  721. if (e.length >= 2) {
  722. this.supervisor(e, true);
  723. }
  724. this.setState({
  725. customerName: e
  726. });
  727. } else {
  728. this.setState({
  729. customerName: ""
  730. });
  731. message.warning("客户所属类型必须指定");
  732. }
  733. }
  734. //上级主管输入框失去焦点是判断客户是否存在
  735. selectAuto(value) {
  736. let kid = [];
  737. let fwList = this.state.customerArr;
  738. fwList.map(function (item) {
  739. if (value == item.bname) {
  740. kid = item;
  741. }
  742. });
  743. if (kid.type == "1") {
  744. this.setState({
  745. displayFees: "block",
  746. patentTransfer: kid.patentTransfer,
  747. });
  748. } else {
  749. this.setState({
  750. displayFees: "none",
  751. });
  752. }
  753. this.setState({
  754. commodityName: value,
  755. gid: kid.id,
  756. addProjectType: kid.type,
  757. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  758. commodityFirstPayment: kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment,
  759. isIso: value.indexOf("贯标") !== -1,// 是否为贯标项目
  760. });
  761. }
  762. //加载(自动补全)
  763. supervisor(e, state) {
  764. //客户名称与服务名称自动补全
  765. let api = state
  766. ? "/api/admin/customer/getCustomerByName"
  767. : "/api/admin/order/getBusinessProjectByName";
  768. $.ajax({
  769. method: "get",
  770. dataType: "json",
  771. crossDomain: false,
  772. url: globalConfig.context + api,
  773. data: state
  774. ? {
  775. name: e,
  776. type: this.state.customType
  777. }
  778. : {
  779. businessName: e
  780. },
  781. success: function (data) {
  782. let thedata = data.data;
  783. if (!thedata) {
  784. if (data.error && data.error.length) {
  785. message.warning(data.error[0].message);
  786. }
  787. thedata = {};
  788. }
  789. this.setState({
  790. states: state,
  791. customerArr: thedata
  792. });
  793. }.bind(this)
  794. }).always(
  795. function () {
  796. this.setState({
  797. loading: false
  798. });
  799. }.bind(this)
  800. );
  801. }
  802. //变更申请
  803. changeApply() {
  804. if (moneyVerify(this.state.data.totalAmount)) {
  805. return false;
  806. }
  807. if (moneyVerify(this.state.data.changeAmount)) {
  808. return false;
  809. }
  810. if (
  811. this.state.data.type == 0 ||
  812. this.state.data.type == 1 ||
  813. this.state.data.type == 3
  814. ) {
  815. if (this.state.data.settlementAmount < this.state.data.changeAmount) {
  816. message.warning("退款金额大于已收款金额");
  817. return;
  818. }
  819. }
  820. this.setState({
  821. loading: true
  822. })
  823. let theorgCodeUrl = [];
  824. if (this.state.voucherUrl.length) {
  825. let picArr = [];
  826. this.state.voucherUrl.map(function (item) {
  827. if (item.response && item.response.data && item.response.data.length) {
  828. picArr.push(item.response.data);
  829. }
  830. });
  831. theorgCodeUrl = picArr.join(",");
  832. }
  833. Object.assign(this.state.data, {
  834. id: this.props.orderData.id, //订单编号
  835. changeType: 0,
  836. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  837. consultantExamine: [],
  838. managerExamine: []
  839. });
  840. $.ajax({
  841. method: "post",
  842. dataType: "json",
  843. crossDomain: false,
  844. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  845. data: this.state.data
  846. }).done(
  847. function (data) {
  848. if (!data.error.length) {
  849. message.success("变更成功!");
  850. this.props.onCancel();
  851. this.setState({
  852. loading: false
  853. });
  854. } else {
  855. message.warning(data.error[0].message);
  856. this.setState({
  857. loading: false
  858. });
  859. }
  860. }.bind(this)
  861. );
  862. }
  863. // componentDidMount() {
  864. // window.setTimeout(() => {
  865. // this.loadDataChange();
  866. // }, 10);
  867. // }
  868. // loadDataChange() {
  869. // console.log(this.props);
  870. // $.ajax({
  871. // method: "get",
  872. // dataType: "json",
  873. // crossDomain: false,
  874. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  875. // data: {
  876. // changeId: this.props.data.id
  877. // },
  878. // success: function(data) {
  879. // if (data.error.length || data.data.list == "") {
  880. // if (data.error && data.error.length) {
  881. // message.warning(data.error[0].message);
  882. // }
  883. // } else {
  884. // this.setState({
  885. // dataSource: data.data
  886. // });
  887. // }
  888. // }.bind(this)
  889. // });
  890. // }
  891. // 拆分详细
  892. showRes(record) {
  893. this.setState({
  894. resVisible: true,
  895. resRecord: record
  896. })
  897. }
  898. resCancel() {
  899. this.setState({
  900. resVisible: false
  901. })
  902. }
  903. cuiList(id) {
  904. this.setState({
  905. loading: true,
  906. });
  907. $.ajax({
  908. method: "get",
  909. dataType: "json",
  910. crossDomain: false,
  911. url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
  912. data: {
  913. id: id || this.state.data.id
  914. },
  915. success: function (data) {
  916. this.setState({
  917. cuiDataSource: data.data,
  918. loading: false,
  919. });
  920. if (data.data && data.data.length) {
  921. if (id) {
  922. this.setState({
  923. listCuiFlag: true,
  924. });
  925. }
  926. this.setState({
  927. cuiDataSource: data.data,
  928. });
  929. this.setState({
  930. loading: false,
  931. });
  932. } else if (data.error && data.error.length) {
  933. message.warning(data.error[0].message);
  934. this.setState({
  935. loading: false,
  936. });
  937. }
  938. }.bind(this)
  939. });
  940. }
  941. proList(id) {
  942. this.setState({
  943. loading: true
  944. })
  945. $.ajax({
  946. method: "get",
  947. dataType: "json",
  948. crossDomain: false,
  949. url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
  950. data: {
  951. id: id || this.state.data.id
  952. },
  953. success: function (data) {
  954. this.setState({
  955. loading: false
  956. })
  957. if (data.data && data.data.length) {
  958. if (id) {
  959. this.setState({
  960. listFlag: true
  961. });
  962. }
  963. data.data.forEach(item => {
  964. item.key = item.id
  965. })
  966. this.setState({
  967. proDataSource: data.data
  968. });
  969. this.setState({
  970. loading: false,
  971. });
  972. } else if (data.error && data.error.length) {
  973. message.warning(data.error[0].message)
  974. this.setState({
  975. loading: false,
  976. });
  977. }
  978. }.bind(this)
  979. });
  980. }
  981. departmentList() {
  982. $.ajax({
  983. method: "get",
  984. dataType: "json",
  985. crossDomain: false,
  986. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  987. data: {},
  988. success: function (data) {
  989. let thedata = data.data;
  990. let theArr = [];
  991. if (!thedata) {
  992. if (data.error && data.error.length) {
  993. message.warning(data.error[0].message);
  994. }
  995. } else {
  996. thedata.map(function (item, index) {
  997. theArr.push({
  998. key: index,
  999. name: item.name,
  1000. id: item.id
  1001. });
  1002. });
  1003. }
  1004. this.setState({
  1005. departmentArr: theArr
  1006. });
  1007. }.bind(this)
  1008. });
  1009. }
  1010. getVoucherUrl(e) {
  1011. this.setState({
  1012. voucherUrl: e
  1013. });
  1014. }
  1015. changeAddPro() {
  1016. this.setState({
  1017. changeVisible: true,
  1018. gid: "",
  1019. customerArr: [],
  1020. commodityName: "",
  1021. commodityQuantity: "",
  1022. commodityId: "",
  1023. taskComment: "",
  1024. main: undefined,
  1025. commodityPrice: ""
  1026. });
  1027. }
  1028. changeProSubmit() {
  1029. if (this.state.gid == undefined || !this.state.gid) {
  1030. message.warning("服务名称不匹配!");
  1031. return
  1032. }
  1033. let reg = /^([0]|[1-9][0-9]*)$/;
  1034. if (
  1035. !this.state.commodityQuantity ||
  1036. !reg.test(this.state.commodityQuantity)
  1037. ) {
  1038. message.warning("请输入正确商品数量!");
  1039. return
  1040. }
  1041. if (this.state.displayFees === 'block') {
  1042. if (this.state.patentType === "" && !this.state.patentTransfer) {
  1043. message.warning("请选择专利类型!");
  1044. return
  1045. }
  1046. if (this.state.officialCost === '') {
  1047. message.warning("请选择官费!");
  1048. return
  1049. }
  1050. if (this.state.costReduction === "" && (this.state.patentType === 0 || this.state.patentType === 2) && this.state.officialCost === 1) {
  1051. message.warning("请选择费减!");
  1052. return
  1053. }
  1054. }
  1055. if (!this.state.commodityPrice) {
  1056. message.warning("请输入金额!");
  1057. return
  1058. }
  1059. if (!this.state.main) {
  1060. message.warning("请选择是否为主要项目!");
  1061. return
  1062. }
  1063. this.setState({
  1064. loading: true
  1065. });
  1066. let type = 0;
  1067. if (this.state.typeChange == 4 || this.state.typeChange == 5) {
  1068. type = 1;
  1069. }
  1070. $.ajax({
  1071. method: "post",
  1072. dataType: "json",
  1073. crossDomain: false,
  1074. url: globalConfig.context + "/api/admin/orderChange/addChangeTask",
  1075. data: {
  1076. commodityId: this.state.gid, //商品ID
  1077. orderNo: this.state.data.orderNo, //订单编号
  1078. commodityName: this.state.commodityName, //商品名称
  1079. commodityQuantity: this.state.commodityQuantity, //商品数量
  1080. commodityPrice: this.state.commodityPrice, //签单总价
  1081. taskComment: this.state.taskComment, //服务说明
  1082. main: this.state.main, //是否为主要项目
  1083. cid: this.state.data.id, //变更ID
  1084. type
  1085. },
  1086. success: function (data) {
  1087. let theArr = [];
  1088. if (data.error && data.error.length) {
  1089. message.warning(data.error[0].message);
  1090. } else {
  1091. message.success("保存成功");
  1092. this.nextCancel();
  1093. this.proList();
  1094. }
  1095. }.bind(this)
  1096. }).always(
  1097. function () {
  1098. this.setState({
  1099. loading: false
  1100. });
  1101. }.bind(this)
  1102. );
  1103. }
  1104. changeDeletePro(record) {
  1105. this.setState({
  1106. loading: true
  1107. });
  1108. $.ajax({
  1109. method: "post",
  1110. dataType: "json",
  1111. crossDomain: false,
  1112. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  1113. data: {
  1114. id: record.id,
  1115. type: 3,
  1116. tid: record.tid,
  1117. splitStatus: record.splitStatus
  1118. },
  1119. success: function (data) {
  1120. let theArr = [];
  1121. if (data.error && data.error.length) {
  1122. message.warning(data.error[0].message);
  1123. } else {
  1124. message.success("删除成功");
  1125. this.proList();
  1126. this.cuiList();
  1127. }
  1128. }.bind(this)
  1129. }).always(
  1130. function () {
  1131. this.setState({
  1132. loading: false
  1133. });
  1134. }.bind(this)
  1135. );
  1136. }
  1137. //点击新增变更催款节点
  1138. changeAddCui() {
  1139. this.state.cuiDataSource.push({
  1140. key: this.state.cuiDataSource.length,
  1141. money: "",
  1142. dunSubject: undefined,
  1143. orderNo: this.state.data.orderNo,
  1144. dunTarget: this.state.kehuId
  1145. });
  1146. this.setState({
  1147. cuiDataSource: this.state.cuiDataSource,
  1148. cuiFlag: true
  1149. });
  1150. }
  1151. //删除变更收款节点
  1152. changeDeleteCui(index) {
  1153. if (index.id) {
  1154. this.state.cuiDataSource.splice(index.id, 1);
  1155. this.setState({
  1156. contactListNew: this.state.cuiDataSource,
  1157. cuiFlag: false,
  1158. addFlag: false,
  1159. boFlag: false
  1160. });
  1161. $.ajax({
  1162. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  1163. method: "post",
  1164. data: {
  1165. id: index.id,
  1166. type: 3,
  1167. tid: index.tid,
  1168. did: index.did
  1169. }
  1170. }).done(
  1171. function (data) {
  1172. this.setState({
  1173. loading: false
  1174. });
  1175. if (!data.error.length) {
  1176. message.success("删除成功!");
  1177. this.setState({
  1178. cuiFlag: false
  1179. });
  1180. this.cuiList();
  1181. } else {
  1182. message.warning(data.error[0].message);
  1183. }
  1184. }.bind(this)
  1185. );
  1186. } else {
  1187. this.state.cuiDataSource.splice(index.key, 1);
  1188. this.setState({
  1189. cuiDataSource: this.state.cuiDataSource,
  1190. cuiFlag: false,
  1191. addFlag: false,
  1192. boFlag: false
  1193. });
  1194. }
  1195. }
  1196. changeSaveCui(record) {
  1197. if (record.boStatus == "false") {
  1198. record.boStatus = false;
  1199. } else if (record.boStatus == "true") {
  1200. record.boStatus = true;
  1201. }
  1202. if (!this.state.yearFlag) {
  1203. if (!record.effectiveCount && !record.dunTypeCustom) {
  1204. message.warning("请选择服务年限");
  1205. return;
  1206. }
  1207. } else {
  1208. record.effectiveCount = "";
  1209. }
  1210. if (isNaN(parseInt(record.money)) && !record.boStatus) {
  1211. message.warning("请填写金额");
  1212. return;
  1213. } else if ((isNaN(parseInt(record.money)) && record.boStatus)) {
  1214. message.warning("请填写比例");
  1215. return;
  1216. }
  1217. if (record.boStatus) {
  1218. if (
  1219. typeof +record.money == "number" &&
  1220. +record.money >= 0 &&
  1221. +record.money <= 1
  1222. ) {
  1223. record.appropriationRatio = record.money;
  1224. } else {
  1225. message.warning("金额比例填写错误,比例范围0~1");
  1226. return;
  1227. }
  1228. }
  1229. if (!record.dunType && record.dunType != 0) {
  1230. message.warning("请选择对应科目");
  1231. return;
  1232. }
  1233. if (record.dunType != 1) {
  1234. record.waitDay = "";
  1235. }
  1236. this.setState({
  1237. loading: true
  1238. });
  1239. if (record.boStatus) {
  1240. $.ajax({
  1241. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  1242. method: "post",
  1243. data: {
  1244. orderNo: record.orderNo,
  1245. ctid: record.ctid,
  1246. projectType: record.sort,
  1247. dunType: record.dunType,
  1248. appropriationRatio: record.appropriationRatio,
  1249. waitDay: record.waitDay,
  1250. effectiveCount: record.effectiveCount,
  1251. cid: this.state.data.id, //变更ID
  1252. ustomizeTimes:
  1253. record.dunType == 0 ? record.customizeTimes : undefined,
  1254. customizeName:
  1255. record.dunType == 0 ? record.customizeName : undefined,
  1256. }
  1257. }).done(
  1258. function (data) {
  1259. this.setState({
  1260. loading: false,
  1261. });
  1262. if (!data.error.length) {
  1263. message.success("保存成功!");
  1264. this.setState({
  1265. cuiFlag: false,
  1266. boFlag: false,
  1267. addFlag: false,
  1268. });
  1269. this.cuiList();
  1270. } else {
  1271. message.warning(data.error[0].message);
  1272. }
  1273. }.bind(this)
  1274. );
  1275. } else {
  1276. $.ajax({
  1277. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  1278. method: "post",
  1279. data: {
  1280. orderNo: record.orderNo,
  1281. ctid: record.ctid,
  1282. projectType: record.sort,
  1283. dunType: record.dunType,
  1284. money: record.money,
  1285. waitDay: record.waitDay,
  1286. effectiveCount: record.effectiveCount,
  1287. cid: this.state.data.id, //变更ID
  1288. customizeTimes:
  1289. record.dunType == 0 ? record.customizeTimes : undefined,
  1290. customizeName:
  1291. record.dunType == 0 ? record.customizeName : undefined,
  1292. }
  1293. }).done(
  1294. function (data) {
  1295. this.setState({
  1296. loading: false,
  1297. });
  1298. if (!data.error.length) {
  1299. message.success("保存成功!");
  1300. this.setState({
  1301. cuiFlag: false,
  1302. boFlag: false,
  1303. addFlag: false,
  1304. });
  1305. this.cuiList();
  1306. } else {
  1307. message.warning(data.error[0].message);
  1308. }
  1309. }.bind(this)
  1310. );
  1311. }
  1312. }
  1313. submitChange() {
  1314. if (
  1315. this.state.typeChange == undefined ||
  1316. (this.state.typeChange == "" && this.state.typeChange != 0)
  1317. ) {
  1318. message.warning("请选择变更类型");
  1319. return false;
  1320. }
  1321. if (
  1322. this.state.typeChange == 0 ||
  1323. this.state.typeChange == 1 ||
  1324. this.state.typeChange == 3
  1325. ) {
  1326. if (this.state.settlementAmount < this.state.changeAmount) {
  1327. message.warning("退款金额大于已收款金额");
  1328. return;
  1329. }
  1330. }
  1331. if (this.state.processStatus != 5 || this.state.processStatus != 6) {
  1332. message.warning("当前订单流程不能发起变更!");
  1333. return false;
  1334. }
  1335. if (this.state.changeAmount === "") {
  1336. message.warning("申请退款金额不能为空!");
  1337. return false;
  1338. }
  1339. if (this.state.remarksC.trim() == "") {
  1340. message.warning("请正确填写变更原因");
  1341. return false;
  1342. }
  1343. if (this.state.startRemarks.trim() == "") {
  1344. message.warning("请正确填写备注信息");
  1345. return false;
  1346. }
  1347. let theorgCodeUrl = [];
  1348. if (this.state.voucherUrl.length) {
  1349. let picArr = [];
  1350. this.state.voucherUrl.map(function (item) {
  1351. if (item.response && item.response.data && item.response.data.length) {
  1352. picArr.push(item.response.data);
  1353. }
  1354. });
  1355. theorgCodeUrl = picArr.join(",");
  1356. }
  1357. this.setState({
  1358. loading: true
  1359. });
  1360. $.ajax({
  1361. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  1362. method: "post",
  1363. data: {
  1364. id: this.state.changeId,
  1365. changeType: 0,
  1366. orderNo: this.state.orderNo, //订单编号
  1367. processState: 0,
  1368. startRemarks: this.state.startRemarks,
  1369. remarks: this.state.remarksC,
  1370. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1371. totalAmount: this.state.totalAmount,
  1372. settlementAmount: this.state.settlementAmount,
  1373. changeAmount: this.state.changeAmount,
  1374. applicant: this.state.salesmanName,
  1375. depName: this.state.depName,
  1376. type: this.state.typeChange
  1377. }
  1378. }).done(
  1379. function (data) {
  1380. if (!data.error.length) {
  1381. this.setState({
  1382. loading: false
  1383. });
  1384. message.success("发起变更成功");
  1385. this.handleCancelclose();
  1386. } else {
  1387. message.warning(data.error[0].message);
  1388. this.setState({
  1389. loading: false
  1390. });
  1391. }
  1392. }.bind(this)
  1393. );
  1394. }
  1395. editCui(record) {
  1396. this.setState({
  1397. editCuiVisible: true,
  1398. editCuiMoney: record.appropriationRatio ? record.appropriationRatio : record.money,
  1399. appropriationRatio: record.appropriationRatio,
  1400. editCuiTid: record.tid,
  1401. editCuiId: record.id
  1402. });
  1403. }
  1404. editPro(record) {
  1405. this.setState({
  1406. editProVisible: true,
  1407. editSplitStatus: record.splitStatus,
  1408. editProMoney: record.commodityPrice,
  1409. editProCommodityQuantity: record.commodityQuantity,
  1410. editProTid: record.tid,
  1411. editProId: record.id
  1412. });
  1413. }
  1414. submitEditCui(type) {
  1415. if (isNaN(parseFloat(this.state.editCuiMoney))) {
  1416. if (type === 1) {
  1417. message.warn('请输入比例')
  1418. } else {
  1419. message.warn('请输入金额')
  1420. }
  1421. return;
  1422. }
  1423. this.setState({
  1424. loading: true
  1425. });
  1426. let data = {
  1427. id: this.state.editCuiId,
  1428. type: this.state.editCuiTid ? 2 : 1,
  1429. tid: this.state.editCuiTid,
  1430. }
  1431. if (type === 1) {
  1432. data.appropriationRatio = this.state.editCuiMoney;
  1433. } else {
  1434. data.money = this.state.editCuiMoney;
  1435. }
  1436. $.ajax({
  1437. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  1438. method: "post",
  1439. data
  1440. }).done(
  1441. function (data) {
  1442. this.setState({
  1443. loading: false
  1444. });
  1445. if (!data.error.length) {
  1446. message.success("修改成功!");
  1447. this.cuiList();
  1448. this.proList()
  1449. this.setState({
  1450. editCuiVisible: false
  1451. });
  1452. } else {
  1453. message.warning(data.error[0].message);
  1454. }
  1455. }.bind(this)
  1456. );
  1457. }
  1458. submitEditPro() {
  1459. this.setState({
  1460. loading: true
  1461. });
  1462. $.ajax({
  1463. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  1464. method: "post",
  1465. data: {
  1466. id: this.state.editProId,
  1467. type: this.state.editProTid ? 2 : 1,
  1468. commodityPrice: this.state.editProMoney,
  1469. commodityQuantity: this.state.editProCommodityQuantity,
  1470. tid: this.state.editProTid
  1471. }
  1472. }).done(
  1473. function (data) {
  1474. this.setState({
  1475. loading: false
  1476. });
  1477. if (!data.error.length) {
  1478. message.success("修改成功!");
  1479. this.proList();
  1480. this.cuiList()
  1481. this.setState({
  1482. editProVisible: false
  1483. });
  1484. } else {
  1485. message.warning(data.error[0].message);
  1486. }
  1487. }.bind(this)
  1488. );
  1489. }
  1490. componentWillMount() {
  1491. this.departmentList();
  1492. this.state.data = this.props.orderData;
  1493. this.state.data.oldPrice = this.props.orderData.totalAmount;
  1494. this.setState({
  1495. data: this.state.data,
  1496. voucherUrl: this.props.voucherUrl
  1497. });
  1498. this.proList();
  1499. this.cuiList();
  1500. let e = this.props.orderData.type;
  1501. if (e == 1) {
  1502. this.setState({
  1503. hetongFlag: false,
  1504. listFlag: false,
  1505. listCuiFlag: false,
  1506. tuiKuanFlag: false,
  1507. displayList: false
  1508. });
  1509. } else if (e == 2) {
  1510. this.setState({
  1511. hetongFlag: true,
  1512. listFlag: false,
  1513. listCuiFlag: false,
  1514. tuiKuanFlag: true,
  1515. displayList: false
  1516. });
  1517. } else if (e == 3) {
  1518. this.setState({
  1519. listFlag: false,
  1520. hetongFlag: false,
  1521. listCuiFlag: false,
  1522. tuiKuanFlag: false,
  1523. displayList: true
  1524. });
  1525. } else if (e == 4) {
  1526. this.setState({
  1527. listFlag: false,
  1528. listCuiFlag: false,
  1529. hetongFlag: false,
  1530. tuiKuanFlag: true,
  1531. displayList: false
  1532. });
  1533. } else if (e == 5) {
  1534. this.setState({
  1535. listFlag: false,
  1536. listCuiFlag: false,
  1537. hetongFlag: true,
  1538. tuiKuanFlag: true,
  1539. displayList: false
  1540. });
  1541. } else {
  1542. this.setState({
  1543. listFlag: true,
  1544. hetongFlag: true,
  1545. listCuiFlag: true,
  1546. tuiKuanFlag: false,
  1547. displayList: false
  1548. });
  1549. }
  1550. }
  1551. // componentWillReceiveProps(nextProps) {
  1552. // this.state.data = nextProps.orderData;
  1553. // this.state.data.oldPrice = nextProps.orderData.totalAmount;
  1554. // this.setState({
  1555. // data: this.state.data,
  1556. // voucherUrl: nextProps.voucherUrl
  1557. // });
  1558. // // this.proList();
  1559. // // this.cuiList();
  1560. // let e = nextProps.orderData.type;
  1561. // if (e == 1) {
  1562. // this.setState({
  1563. // hetongFlag: false,
  1564. // listFlag: false,
  1565. // listCuiFlag: false,
  1566. // tuiKuanFlag: false,
  1567. // displayList: false
  1568. // });
  1569. // } else if (e == 2) {
  1570. // this.setState({
  1571. // hetongFlag: true,
  1572. // listFlag: false,
  1573. // listCuiFlag: false,
  1574. // tuiKuanFlag: true,
  1575. // displayList: false
  1576. // });
  1577. // } else if (e == 3) {
  1578. // this.setState({
  1579. // listFlag: false,
  1580. // hetongFlag: false,
  1581. // listCuiFlag: false,
  1582. // tuiKuanFlag: false,
  1583. // displayList: true
  1584. // });
  1585. // } else if (e == 4) {
  1586. // this.setState({
  1587. // listFlag: false,
  1588. // listCuiFlag: false,
  1589. // hetongFlag: false,
  1590. // tuiKuanFlag: true,
  1591. // displayList: false
  1592. // });
  1593. // } else if (e == 5) {
  1594. // this.setState({
  1595. // listFlag: false,
  1596. // listCuiFlag: false,
  1597. // hetongFlag: true,
  1598. // tuiKuanFlag: true,
  1599. // displayList: false
  1600. // });
  1601. // } else {
  1602. // this.setState({
  1603. // listFlag: true,
  1604. // hetongFlag: true,
  1605. // listCuiFlag: true,
  1606. // tuiKuanFlag: false,
  1607. // displayList: false
  1608. // });
  1609. // }
  1610. // }
  1611. not() {
  1612. }
  1613. deleteChange() {
  1614. this.setState({
  1615. loading: true,
  1616. });
  1617. $.ajax({
  1618. url: globalConfig.context + "/api/admin/orderChange/cancelOrderChange",
  1619. method: "post",
  1620. data: {
  1621. id: this.state.data.id,
  1622. status: this.state.data.status,
  1623. processState: this.state.data.processState,
  1624. orderNo: this.state.data.orderNo
  1625. },
  1626. }).done(
  1627. function (data) {
  1628. this.setState({
  1629. loading: false,
  1630. });
  1631. if (!data.error.length) {
  1632. message.success("取消成功!");
  1633. this.props.onCancel()
  1634. } else {
  1635. message.warning(data.error[0].message);
  1636. }
  1637. }.bind(this)
  1638. );
  1639. }
  1640. render() {
  1641. const expandedRowRender = e => {
  1642. const data = e.list;
  1643. data.forEach((item) => {
  1644. item.key = item.id
  1645. })
  1646. let columns = [];
  1647. if (e.list instanceof Array && e.list.length) {
  1648. columns = [
  1649. {
  1650. title: "变更状态",
  1651. dataIndex: "type",
  1652. key: "type",
  1653. render: (text, record) => {
  1654. let str = "";
  1655. let color = "";
  1656. if (text == 1) {
  1657. str = "增";
  1658. color = "#87d068";
  1659. } else if (text == 2) {
  1660. str = "改";
  1661. color = "#108ee9";
  1662. } else if (text == 3) {
  1663. str = "删";
  1664. color = "#f50";
  1665. }
  1666. return (
  1667. <span>
  1668. <Tag
  1669. color={color}
  1670. style={{ display: text == 0 ? "none" : "inline-block" }}
  1671. >
  1672. {str}
  1673. </Tag>
  1674. {record.splitStatus == 1 ? (
  1675. <Tag
  1676. color="#108ee9"
  1677. // onClick={e => {
  1678. // e.stopPropagation();
  1679. // this.showRes(record);
  1680. // }}
  1681. >
  1682. 父项目
  1683. </Tag>
  1684. ) : (
  1685. ""
  1686. )}
  1687. {record.splitStatus == 2 ? (
  1688. <Tag
  1689. color="#108ee9"
  1690. // onClick={e => {
  1691. // e.stopPropagation();
  1692. // this.showRes(record);
  1693. // }}
  1694. >
  1695. 子项目
  1696. </Tag>
  1697. ) : (
  1698. ""
  1699. )}
  1700. </span>
  1701. );
  1702. },
  1703. },
  1704. {
  1705. title: "业务项目名称",
  1706. dataIndex: "commodityName",
  1707. key: "commodityName",
  1708. render: (text, record) => {
  1709. return <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span>{"-" + record.id}</span>
  1710. }
  1711. },
  1712. {
  1713. title: "项目类别",
  1714. dataIndex: "cname",
  1715. key: "cname",
  1716. },
  1717. {
  1718. title: "项目数量",
  1719. dataIndex: "commodityQuantity",
  1720. key: "commodityQuantity",
  1721. },
  1722. {
  1723. title: "金额(万元)",
  1724. dataIndex: "commodityPrice",
  1725. key: "commodityPrice",
  1726. render: (text, record) => {
  1727. if (record.splitStatus == 2) {
  1728. return "/";
  1729. } else {
  1730. return text;
  1731. }
  1732. },
  1733. },
  1734. {
  1735. title: "主要项目",
  1736. dataIndex: "main",
  1737. key: "main",
  1738. render: (text) => {
  1739. return text ? "是" : "否";
  1740. },
  1741. },
  1742. {
  1743. title: "项目负责人",
  1744. dataIndex: "receiverName",
  1745. key: "receiverName",
  1746. },
  1747. {
  1748. title: "项目说明",
  1749. dataIndex: "taskComment",
  1750. key: "taskComment",
  1751. render: (text) => {
  1752. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  1753. },
  1754. },
  1755. {
  1756. title: "操作",
  1757. dataIndex: "ABC",
  1758. key: "ABC",
  1759. render: (text, record) => {
  1760. return (
  1761. <div>
  1762. <Button
  1763. onClick={(e) => {
  1764. e.stopPropagation();
  1765. this.showConfirm(this.changeDeletePro, record);
  1766. }}
  1767. disabled={this.state.listFlag}
  1768. style={{
  1769. display: this.state.displayList ? "none" : "block",
  1770. }}
  1771. >
  1772. 删除
  1773. </Button>
  1774. </div>
  1775. );
  1776. },
  1777. },
  1778. ];
  1779. return (
  1780. <Table
  1781. columns={columns}
  1782. dataSource={data}
  1783. scroll={{ x: "max-content", y: 0 }}
  1784. pagination={false}
  1785. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  1786. />
  1787. );
  1788. } else {
  1789. columns = [];
  1790. return (
  1791. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  1792. 此项目暂未拆分
  1793. </p>
  1794. );
  1795. }
  1796. };
  1797. const { TextArea } = Input;
  1798. const data = this.state.data;
  1799. // let departmentArr = this.state.departmentArr || [];
  1800. const dataSources = this.state.customerArr || [];
  1801. const cuiDataList = this.state.contactList || [];
  1802. let departmentArr = this.state.departmentArr || [];
  1803. const options = this.state.states
  1804. ? dataSources.map(group => (
  1805. <Select.Option key={group.id} value={group.name}>
  1806. {group.name}
  1807. </Select.Option>
  1808. ))
  1809. : dataSources.map((group, index) => (
  1810. <Select.Option key={index} value={group.bname}>
  1811. {group.bname}
  1812. </Select.Option>
  1813. ));
  1814. return (
  1815. <div>
  1816. <Spin spinning={this.state.loading}>
  1817. {this.state.resVisible ? (
  1818. <ResolutionDetail
  1819. cancel={this.resCancel}
  1820. detail={this.state.resRecord}
  1821. visible={this.state.resVisible}
  1822. id={this.state.resRecord.orderNo}
  1823. />
  1824. ) : (
  1825. ""
  1826. )}
  1827. <div className="clearfix">
  1828. <FormItem
  1829. className="half-item"
  1830. {...formItemLayout}
  1831. label="客户名称"
  1832. >
  1833. <span>{data.userName}</span>
  1834. <EnterpriseNameChange
  1835. type='journal'
  1836. style={{ marginLeft: 10 }}
  1837. enterpriseId={this.props.orderUid} />
  1838. </FormItem>
  1839. </div>
  1840. <div className="clearfix">
  1841. <FormItem
  1842. className="half-item"
  1843. {...formItemLayout}
  1844. label="合同编号"
  1845. >
  1846. <span>{data.contractNo}</span>
  1847. </FormItem>
  1848. </div>
  1849. <div className="clearfix">
  1850. <FormItem
  1851. className="half-item"
  1852. {...formItemLayout}
  1853. label="申请变更部门"
  1854. >
  1855. <span>{this.state.data.depName}</span>
  1856. </FormItem>
  1857. <FormItem className="half-item" {...formItemLayout} label="申请人">
  1858. {/* <Input
  1859. placeholder="请输入申请人"
  1860. ref="signTotalAmount"
  1861. value={data.applicant}
  1862. onChange={e => {
  1863. let data = this.state.data;
  1864. data.applicant = e.target.value;
  1865. this.setState({ data });
  1866. }}
  1867. style={{ width: "240px" }}
  1868. /> */}
  1869. <span>{data.applicant}</span>
  1870. </FormItem>
  1871. </div>
  1872. <div className="clearfix">
  1873. <FormItem
  1874. labelCol={{ span: 4 }}
  1875. wrapperCol={{ span: 18 }}
  1876. label="变更类型"
  1877. >
  1878. <Select
  1879. placeholder="选择合同变更类型"
  1880. style={{ width: 200 }}
  1881. disabled={this.state.changeFlag}
  1882. onChange={(e) => {
  1883. let data = this.state.data;
  1884. data.type = e;
  1885. this.setState({ data, changeFlag: true });
  1886. if (e == 1) {
  1887. this.setState({
  1888. hetongFlag: false,
  1889. listFlag: false,
  1890. listCuiFlag: false,
  1891. tuiKuanFlag: false,
  1892. displayList: false,
  1893. });
  1894. } else if (e == 2) {
  1895. this.setState({
  1896. hetongFlag: true,
  1897. listFlag: false,
  1898. listCuiFlag: false,
  1899. tuiKuanFlag: true,
  1900. displayList: false,
  1901. });
  1902. } else if (e == 3) {
  1903. this.setState({
  1904. listFlag: false,
  1905. hetongFlag: false,
  1906. listCuiFlag: false,
  1907. tuiKuanFlag: false,
  1908. displayList: true,
  1909. });
  1910. } else if (e == 4) {
  1911. this.setState({
  1912. listFlag: false,
  1913. listCuiFlag: false,
  1914. hetongFlag: false,
  1915. tuiKuanFlag: true,
  1916. displayList: false,
  1917. });
  1918. } else if (e == 5) {
  1919. this.setState({
  1920. listFlag: false,
  1921. listCuiFlag: false,
  1922. hetongFlag: true,
  1923. tuiKuanFlag: true,
  1924. displayList: false,
  1925. });
  1926. } else {
  1927. this.setState({
  1928. listFlag: true,
  1929. hetongFlag: true,
  1930. listCuiFlag: true,
  1931. tuiKuanFlag: false,
  1932. displayList: false,
  1933. });
  1934. }
  1935. }}
  1936. value={data.type}
  1937. >
  1938. <Option value={0}>退单退款</Option>
  1939. <Option value={1}>项目及金额变更</Option>
  1940. <Option value={2}>仅项目变更</Option>
  1941. <Option value={3}>仅金额变更</Option>
  1942. <Option value={4}>重报</Option>
  1943. <Option value={5}>赠送</Option>
  1944. </Select>
  1945. <Button
  1946. style={{ marginLeft: 10 }}
  1947. onClick={(e) => {
  1948. this.state.data.startRemarks = "";
  1949. this.state.data.remarks = "";
  1950. this.state.data.changeAmount = "0";
  1951. this.state.data.depNameChange = undefined;
  1952. this.state.data.typeChange = undefined;
  1953. this.state.data.totalAmount = this.state.data.oldPrice;
  1954. this.setState({
  1955. listFlag: false,
  1956. hetongFlag: false,
  1957. listCuiFlag: false,
  1958. tuiKuanFlag: false,
  1959. displayList: false,
  1960. startRemarks: "",
  1961. data: this.state.data,
  1962. changeFlag: false,
  1963. voucherUrl: [],
  1964. // changeAmount: "0",
  1965. // applicant: undefined,
  1966. // depNameChange: undefined,
  1967. // typeChange: [],
  1968. // changeFlag: false
  1969. });
  1970. }}
  1971. >
  1972. 重置
  1973. </Button>
  1974. {this.state.data.status == 3 ? (
  1975. <Button
  1976. type="danger"
  1977. style={{
  1978. float: "right",
  1979. backgroundColor: "red",
  1980. color: "white",
  1981. position: "absolute",
  1982. right: 0,
  1983. height: 50,
  1984. borderRadius: 20,
  1985. }}
  1986. onClick={(e) => {
  1987. e.stopPropagation();
  1988. this.showConfirmChange(this.deleteChange);
  1989. }}
  1990. >
  1991. 取消本次变更
  1992. </Button>
  1993. ) : (
  1994. ""
  1995. )}
  1996. </FormItem>
  1997. </div>
  1998. <div className="clearfix">
  1999. <FormItem
  2000. labelCol={{ span: 4 }}
  2001. wrapperCol={{ span: 18 }}
  2002. label="合同额(万元)"
  2003. >
  2004. <Input
  2005. placeholder="请输入合同额"
  2006. ref="signTotalAmount"
  2007. disabled={this.state.hetongFlag}
  2008. value={data.totalAmount}
  2009. onChange={(e) => {
  2010. let data = this.state.data;
  2011. data.totalAmount = e.target.value;
  2012. this.setState({ data });
  2013. }}
  2014. style={{ width: "240px" }}
  2015. />
  2016. </FormItem>
  2017. <FormItem
  2018. labelCol={{ span: 4 }}
  2019. wrapperCol={{ span: 18 }}
  2020. label="已收款(万元)"
  2021. >
  2022. {/* <Input
  2023. placeholder="请输入已收款"
  2024. ref="signTotalAmount"
  2025. value={data.settlementAmount}
  2026. onChange={e => {
  2027. let data = this.state.data;
  2028. data.settlementAmount = e.target.value;
  2029. this.setState({ data });
  2030. }}
  2031. style={{ width: "240px" }}
  2032. /> */}
  2033. <span>
  2034. {this.state.data.settlementAmount}&nbsp;&nbsp;&nbsp;&nbsp;
  2035. <span style={{ color: "red" }}>
  2036. (注:已收款与现实收款不符,请与财务专员联系)
  2037. </span>
  2038. </span>
  2039. </FormItem>
  2040. <FormItem
  2041. labelCol={{ span: 4 }}
  2042. wrapperCol={{ span: 18 }}
  2043. label="申请退款(万元)"
  2044. >
  2045. <Input
  2046. placeholder="请输入申请退款"
  2047. ref="signTotalAmount"
  2048. disabled={this.state.tuiKuanFlag}
  2049. value={data.changeAmount}
  2050. onChange={(e) => {
  2051. let data = this.state.data;
  2052. data.changeAmount = e.target.value;
  2053. this.setState({ data });
  2054. }}
  2055. style={{ width: "240px" }}
  2056. />
  2057. </FormItem>
  2058. </div>
  2059. <div>
  2060. <div>
  2061. <span
  2062. style={{
  2063. marginLeft: "50px",
  2064. fontSize: "20px",
  2065. }}
  2066. >
  2067. 项目业务
  2068. </span>
  2069. <span style={{ color: "red" }}>
  2070. (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!双击可修改对应金额数量!)
  2071. </span>
  2072. <Button
  2073. type="primary"
  2074. onClick={this.changeAddPro}
  2075. disabled={this.state.listFlag}
  2076. style={{
  2077. float: "right",
  2078. marginRight: "50px",
  2079. marginBottom: "15px",
  2080. display: this.state.displayList ? "none" : "block",
  2081. }}
  2082. >
  2083. 添加项目明细
  2084. </Button>
  2085. </div>
  2086. <div className="patent-table" style={{ marginBottom: 10 }}>
  2087. {/* <Spin spinning={this.state.loading}> */}
  2088. <Table
  2089. columns={this.state.proColumns}
  2090. dataSource={this.state.proDataSource}
  2091. scroll={{ x: "max-content", y: 0 }}
  2092. expandedRowRender={expandedRowRender}
  2093. pagination={false}
  2094. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2095. bordered
  2096. size="small"
  2097. />
  2098. {/* </Spin> */}
  2099. </div>
  2100. <div>
  2101. <span
  2102. style={{
  2103. marginLeft: "50px",
  2104. fontSize: "20px",
  2105. }}
  2106. >
  2107. 催款节点
  2108. </span>
  2109. <span style={{ color: "red" }}>
  2110. (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!双击可修改对应金额!)
  2111. </span>
  2112. <Button
  2113. type="primary"
  2114. onClick={(e) => {
  2115. this.changeAddCui();
  2116. }}
  2117. disabled={this.state.listCuiFlag}
  2118. style={{
  2119. float: "right",
  2120. marginRight: "50px",
  2121. marginBottom: "15px",
  2122. display: this.state.displayList ? "none" : "block",
  2123. }}
  2124. >
  2125. 添加催款节点
  2126. </Button>
  2127. </div>
  2128. <div className="clearfix">
  2129. {/* <Spin spinning={this.state.loading}> */}
  2130. <Form layout="horizontal">
  2131. <Table
  2132. pagination={false}
  2133. columns={this.state.changeCuiList}
  2134. dataSource={this.state.cuiDataSource}
  2135. scroll={{ x: "max-content", y: 0 }}
  2136. onRowDoubleClick={
  2137. this.state.listCuiFlag ? this.not : this.editCui
  2138. }
  2139. bordered
  2140. size="small"
  2141. />
  2142. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2143. </Form>
  2144. {/* </Spin> */}
  2145. </div>
  2146. </div>
  2147. <div className="clearfix">
  2148. <FormItem
  2149. style={{ height: "auto" }}
  2150. labelCol={{ span: 4 }}
  2151. wrapperCol={{ span: 18 }}
  2152. label="变更原因"
  2153. >
  2154. <TextArea
  2155. rows={4}
  2156. placeholder="因企业政府补助费用与营销员签单承诺费用不一"
  2157. ref="signTotalAmount"
  2158. style={{ width: "95%" }}
  2159. value={data.remarks}
  2160. onChange={(e) => {
  2161. let data = this.state.data;
  2162. data.remarks = e.target.value;
  2163. this.setState({ data });
  2164. }}
  2165. />
  2166. </FormItem>
  2167. </div>
  2168. {/* 备注 */}
  2169. <div className="clearfix">
  2170. <FormItem
  2171. style={{ height: "auto" }}
  2172. labelCol={{ span: 4 }}
  2173. wrapperCol={{ span: 18 }}
  2174. label="备注"
  2175. >
  2176. <TextArea
  2177. rows={4}
  2178. placeholder="请输入备注信息"
  2179. ref="signTotalAmount"
  2180. style={{ width: "95%" }}
  2181. value={data.startRemarks}
  2182. onChange={(e) => {
  2183. let data = this.state.data;
  2184. data.startRemarks = e.target.value;
  2185. this.setState({ data });
  2186. }}
  2187. />
  2188. </FormItem>
  2189. </div>
  2190. <div className="clearfix">
  2191. <FormItem
  2192. labelCol={{ span: 4 }}
  2193. wrapperCol={{ span: 18 }}
  2194. label="变更凭证"
  2195. >
  2196. <PicturesWall
  2197. fileList={this.getVoucherUrl}
  2198. pictureUrl={this.state.voucherUrl}
  2199. url="/api/admin/orderChange/uploadFile"
  2200. sign="order_change_file"
  2201. />
  2202. <Rizhi changeId={data.id} />
  2203. <p>图片建议:要清晰。</p>
  2204. </FormItem>
  2205. </div>
  2206. {/* <ul
  2207. style={{
  2208. width: "868px",
  2209. overflow: "hidden",
  2210. paddingLeft: "90px",
  2211. marginBottom: "20px"
  2212. }}
  2213. >
  2214. {this.state.dataSource.map((item, index) => (
  2215. <li
  2216. key={index}
  2217. style={{
  2218. width: "100%",
  2219. height: "auto",
  2220. wordBreak: "break-all",
  2221. color: "black",
  2222. marginBottom: "10px"
  2223. }}
  2224. >{`${item.aname}: ${item.remarks}`}</li>
  2225. ))}
  2226. </ul> */}
  2227. <div className="clearfix">
  2228. <Button
  2229. type="primary"
  2230. style={{ float: "right", marginRight: 40 }}
  2231. onClick={this.changeApply}
  2232. >
  2233. 发起变更申请
  2234. </Button>
  2235. </div>
  2236. <Modal
  2237. maskClosable={false}
  2238. title="修改项目金额及数量"
  2239. visible={this.state.editProVisible}
  2240. onOk={this.submitEditPro}
  2241. width={300}
  2242. okText={"保存"}
  2243. onCancel={() => {
  2244. this.setState({
  2245. editProVisible: false,
  2246. });
  2247. }}
  2248. >
  2249. <div className="clearfix">
  2250. <FormItem
  2251. labelCol={{ span: 6 }}
  2252. wrapperCol={{ span: 14 }}
  2253. label="项目金额"
  2254. style={{
  2255. display: this.state.editSplitStatus == 2 ? "none" : "block",
  2256. }}
  2257. >
  2258. <Input
  2259. placeholder="请输入金额"
  2260. rows={4}
  2261. value={this.state.editProMoney}
  2262. onChange={(e) => {
  2263. this.setState({ editProMoney: e.target.value });
  2264. }}
  2265. />
  2266. </FormItem>
  2267. <FormItem
  2268. labelCol={{ span: 6 }}
  2269. wrapperCol={{ span: 14 }}
  2270. label="项目数量"
  2271. >
  2272. <Input
  2273. placeholder="请输入数量"
  2274. rows={4}
  2275. value={this.state.editProCommodityQuantity}
  2276. onChange={(e) => {
  2277. this.setState({ editProCommodityQuantity: e.target.value });
  2278. }}
  2279. />
  2280. </FormItem>
  2281. </div>
  2282. </Modal>
  2283. <Modal
  2284. maskClosable={false}
  2285. title={isNaN(parseFloat(this.state.appropriationRatio)) ? "修改催款节点金额" : "修改催款节点比例"}
  2286. visible={this.state.editCuiVisible}
  2287. onOk={() => {
  2288. this.submitEditCui(isNaN(parseFloat(this.state.appropriationRatio)) ? 0 : 1);
  2289. }}
  2290. okText={"保存"}
  2291. width={300}
  2292. onCancel={(e) => {
  2293. this.setState({
  2294. editCuiVisible: false,
  2295. appropriationRatio: ''
  2296. });
  2297. }}
  2298. >
  2299. <div className="clearfix">
  2300. <FormItem
  2301. labelCol={{ span: 6 }}
  2302. wrapperCol={{ span: 14 }}
  2303. label={isNaN(parseFloat(this.state.appropriationRatio)) ? "催款金额" : "催款比例"}
  2304. >
  2305. <Input
  2306. type='number'
  2307. placeholder={isNaN(parseFloat(this.state.appropriationRatio)) ? "请输入金额" : "请输入比例"}
  2308. rows={4}
  2309. value={this.state.editCuiMoney}
  2310. onChange={(e) => {
  2311. this.setState({ editCuiMoney: e.target.value });
  2312. }}
  2313. />
  2314. </FormItem>
  2315. </div>
  2316. </Modal>
  2317. {/* {
  2318. this.state.changeVisible &&
  2319. <ProjectOperation
  2320. readOnly={false}
  2321. orderNo={this.state.data.orderNo}
  2322. visible={this.state.changeVisible}
  2323. dataInfor={{}}
  2324. onCancel={this.nextCancel}
  2325. />
  2326. } */}
  2327. <Modal
  2328. maskClosable={false}
  2329. visible={this.state.changeVisible}
  2330. onOk={this.nextCancel}
  2331. onCancel={this.nextCancel}
  2332. width="900px"
  2333. title={"添加变更项目"}
  2334. footer=""
  2335. className="admin-desc-content"
  2336. >
  2337. <Form
  2338. layout="horizontal"
  2339. >
  2340. <div className="clearfix">
  2341. <FormItem
  2342. className="half-item"
  2343. {...formItemLayout}
  2344. label="服务名称"
  2345. >
  2346. <AutoComplete
  2347. className="certain-category-search"
  2348. dropdownClassName="certain-category-search-dropdown"
  2349. dropdownMatchSelectWidth={false}
  2350. dropdownStyle={{ width: 200 }}
  2351. style={{ width: "200px" }}
  2352. dataSource={options}
  2353. placeholder="输入服务名称"
  2354. value={this.state.commodityName}
  2355. onChange={this.httpChange}
  2356. filterOption={true}
  2357. onSelect={this.selectAuto}
  2358. >
  2359. <Input />
  2360. </AutoComplete>
  2361. <span className="mandatory">*</span>
  2362. </FormItem>
  2363. <FormItem
  2364. className="half-item"
  2365. {...formItemLayout}
  2366. label="服务数量"
  2367. >
  2368. <Input
  2369. placeholder="请输入服务数量"
  2370. value={this.state.commodityQuantity}
  2371. style={{ width: "200px" }}
  2372. onChange={(e) => {
  2373. this.setState({ commodityQuantity: e.target.value });
  2374. }}
  2375. ref="commodityQuantity"
  2376. />
  2377. <span className="mandatory">*</span>
  2378. </FormItem>
  2379. <div style={{ marginTop: "33px", color: "red", textAlign: "right", position: "relative", top: "-8", left: "0" }}>如会员项目,服务一年,请填写1,服务二年,请填写2,依次类推</div>
  2380. {!this.state.patentTransfer &&
  2381. <FormItem
  2382. className="half-item"
  2383. labelCol={{ span: 4 }}
  2384. wrapperCol={{ span: 14 }}
  2385. label="专利类型:"
  2386. style={{
  2387. display: this.state.displayFees,
  2388. marginLeft: "63px",
  2389. }}
  2390. >
  2391. {<Select
  2392. placeholder="请选择专利类型"
  2393. style={{ width: "200px" }}
  2394. value={this.state.patentType}
  2395. onChange={(e) => {
  2396. this.setState({ patentType: e });
  2397. if (e !== 0 && e !== 2) {
  2398. this.setState({
  2399. costReduction: ''
  2400. })
  2401. }
  2402. }}
  2403. >
  2404. {this.state.patentTypeList.map(function (v, k) {
  2405. return (
  2406. <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
  2407. );
  2408. })}
  2409. </Select>}
  2410. <span style={{ color: "red", marginLeft: "8px" }}>
  2411. *
  2412. </span>
  2413. </FormItem>}
  2414. <FormItem
  2415. className="half-item"
  2416. labelCol={{ span: 3 }}
  2417. wrapperCol={{ span: 14 }}
  2418. label="官费:"
  2419. style={{
  2420. display: this.state.displayFees,
  2421. marginLeft: "63px",
  2422. }}
  2423. >
  2424. {<Radio.Group
  2425. value={this.state.officialCost}
  2426. onChange={(e) => {
  2427. this.setState({ officialCost: e.target.value });
  2428. if (e.target.value === 0) {
  2429. this.setState({
  2430. costReduction: ''
  2431. })
  2432. }
  2433. }}
  2434. >
  2435. <Radio value={1}>含官费</Radio>
  2436. <Radio value={0}>不含官费</Radio>
  2437. </Radio.Group>}
  2438. <span style={{ color: "red", marginLeft: "8px" }}>
  2439. *
  2440. </span>
  2441. </FormItem>
  2442. {
  2443. (this.state.patentType === 0 || this.state.patentType === 2) && this.state.officialCost === 1 &&
  2444. <FormItem
  2445. className="half-item"
  2446. labelCol={{ span: 3 }}
  2447. wrapperCol={{ span: 14 }}
  2448. label="费减:"
  2449. style={{
  2450. display: this.state.displayFees,
  2451. marginLeft: "63px",
  2452. }}
  2453. >
  2454. {/*不含官费或者专利类型不为复审或者申请时置灰*/}
  2455. {<Radio.Group
  2456. disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
  2457. value={this.state.costReduction}
  2458. onChange={(e) => {
  2459. this.setState({ costReduction: e.target.value });
  2460. }}
  2461. >
  2462. <Radio value={1}>有费减</Radio>
  2463. <Radio value={0}>无费减</Radio>
  2464. </Radio.Group>}
  2465. <span style={{ color: "red", marginLeft: "8px" }}>
  2466. *
  2467. </span>
  2468. </FormItem>
  2469. }
  2470. <FormItem
  2471. className="half-item"
  2472. {...formItemLayout}
  2473. label="实签价格(万元)"
  2474. >
  2475. <Input
  2476. placeholder="请输入实签价格"
  2477. value={this.state.commodityPrice}
  2478. style={{ width: "200px" }}
  2479. onChange={(e) => {
  2480. this.setState({ commodityPrice: e.target.value });
  2481. }}
  2482. ref="commodityPrice"
  2483. />
  2484. <span className="mandatory">*</span>
  2485. </FormItem>
  2486. <FormItem
  2487. className="half-item"
  2488. {...formItemLayout}
  2489. label="主要业务"
  2490. >
  2491. <Select
  2492. placeholder="选择是否为主要业务"
  2493. style={{ width: "200px" }}
  2494. value={this.state.main}
  2495. onChange={(e) => {
  2496. this.setState({ main: e });
  2497. }}
  2498. >
  2499. {boutique.map(function (item) {
  2500. return (
  2501. <Select.Option key={item.value}>
  2502. {item.key}
  2503. </Select.Option>
  2504. );
  2505. })}
  2506. </Select>
  2507. <span className="mandatory">*</span>
  2508. </FormItem>
  2509. <div className="clearfix">
  2510. <FormItem
  2511. labelCol={{ span: 4 }}
  2512. wrapperCol={{ span: 16 }}
  2513. label="项目说明"
  2514. >
  2515. <Input
  2516. type="textarea"
  2517. placeholder="如会员项目请详细描写会员项目的服务年限、详细服务时间段段,如第一年从2021年1月至2021年12月31日止,第二年从。。。"
  2518. value={this.state.taskComment}
  2519. onChange={(e) => {
  2520. this.setState({ taskComment: e.target.value });
  2521. }}
  2522. />
  2523. </FormItem>
  2524. </div>
  2525. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  2526. {this.state.addProjectType === 5 ?
  2527. <div className="clearfix">
  2528. <FormItem
  2529. className="half-item"
  2530. {...formItemLayout}
  2531. label="企业要求申报批次"
  2532. >
  2533. <Select
  2534. placeholder="请选择企业要求申报批次"
  2535. style={{ width: "200px" }}
  2536. value={this.state.declarationBatch}
  2537. onChange={(e) => {
  2538. this.setState({ declarationBatch: e });
  2539. }}
  2540. >
  2541. <Select.Option value={1}>
  2542. 第一批
  2543. </Select.Option>
  2544. <Select.Option value={2}>
  2545. 第二批
  2546. </Select.Option>
  2547. <Select.Option value={3}>
  2548. 第三批
  2549. </Select.Option>
  2550. <Select.Option value={4}>
  2551. 第四批
  2552. </Select.Option>
  2553. </Select>
  2554. <span className="mandatory">*</span>
  2555. </FormItem>
  2556. </div> : null
  2557. }
  2558. {
  2559. this.state.isIso &&
  2560. <div className="clearfix">
  2561. <FormItem
  2562. className="half-item"
  2563. {...formItemLayout}
  2564. label="是否包含认证费用"
  2565. >
  2566. {<Select
  2567. placeholder="请选择是否包含认证费用"
  2568. style={{ width: "200px" }}
  2569. value={this.state.ifCertificationFee}
  2570. onChange={(e) => {
  2571. this.setState({ ifCertificationFee: e });
  2572. }}
  2573. >
  2574. <Select.Option value={0}>
  2575. </Select.Option>
  2576. <Select.Option value={1}>
  2577. </Select.Option>
  2578. </Select>}
  2579. <span className="mandatory">*</span>
  2580. </FormItem>
  2581. </div>
  2582. }
  2583. <FormItem
  2584. wrapperCol={{ span: 12, offset: 4 }}
  2585. className="half-middle"
  2586. >
  2587. <Button
  2588. className="submitSave"
  2589. type="primary"
  2590. onClick={this.changeProSubmit}
  2591. >
  2592. 保存
  2593. </Button>
  2594. <Button
  2595. className="submitSave"
  2596. type="ghost"
  2597. onClick={this.nextCancel}
  2598. >
  2599. 取消
  2600. </Button>
  2601. </FormItem>
  2602. </div>
  2603. </Form>
  2604. </Modal>
  2605. </Spin>
  2606. </div>
  2607. );
  2608. }
  2609. }
  2610. export default ChangeApply;