changeApply.js 79 KB

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