changeApply.js 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630
  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. not() {
  1600. }
  1601. deleteChange() {
  1602. this.setState({
  1603. loading: true,
  1604. });
  1605. $.ajax({
  1606. url: globalConfig.context + "/api/admin/orderChange/cancelOrderChange",
  1607. method: "post",
  1608. data: {
  1609. id: this.state.data.id,
  1610. status: this.state.data.status,
  1611. processState: this.state.data.processState,
  1612. orderNo: this.state.data.orderNo
  1613. },
  1614. }).done(
  1615. function (data) {
  1616. this.setState({
  1617. loading: false,
  1618. });
  1619. if (!data.error.length) {
  1620. message.success("取消成功!");
  1621. this.props.onCancel()
  1622. } else {
  1623. message.warning(data.error[0].message);
  1624. }
  1625. }.bind(this)
  1626. );
  1627. }
  1628. render() {
  1629. const expandedRowRender = e => {
  1630. const data = e.list;
  1631. data.forEach((item) => {
  1632. item.key = item.id
  1633. })
  1634. let columns = [];
  1635. if (e.list instanceof Array && e.list.length) {
  1636. columns = [
  1637. {
  1638. title: "变更状态",
  1639. dataIndex: "type",
  1640. key: "type",
  1641. render: (text, record) => {
  1642. let str = "";
  1643. let color = "";
  1644. if (text == 1) {
  1645. str = "增";
  1646. color = "#87d068";
  1647. } else if (text == 2) {
  1648. str = "改";
  1649. color = "#108ee9";
  1650. } else if (text == 3) {
  1651. str = "删";
  1652. color = "#f50";
  1653. }
  1654. return (
  1655. <span>
  1656. <Tag
  1657. color={color}
  1658. style={{ display: text == 0 ? "none" : "inline-block" }}
  1659. >
  1660. {str}
  1661. </Tag>
  1662. {record.splitStatus == 1 ? (
  1663. <Tag
  1664. color="#108ee9"
  1665. // onClick={e => {
  1666. // e.stopPropagation();
  1667. // this.showRes(record);
  1668. // }}
  1669. >
  1670. 父项目
  1671. </Tag>
  1672. ) : (
  1673. ""
  1674. )}
  1675. {record.splitStatus == 2 ? (
  1676. <Tag
  1677. color="#108ee9"
  1678. // onClick={e => {
  1679. // e.stopPropagation();
  1680. // this.showRes(record);
  1681. // }}
  1682. >
  1683. 子项目
  1684. </Tag>
  1685. ) : (
  1686. ""
  1687. )}
  1688. </span>
  1689. );
  1690. },
  1691. },
  1692. {
  1693. title: "业务项目名称",
  1694. dataIndex: "commodityName",
  1695. key: "commodityName",
  1696. render: (text, record) => {
  1697. return text + "-" + record.id;
  1698. },
  1699. },
  1700. {
  1701. title: "项目类别",
  1702. dataIndex: "cname",
  1703. key: "cname",
  1704. },
  1705. {
  1706. title: "项目数量",
  1707. dataIndex: "commodityQuantity",
  1708. key: "commodityQuantity",
  1709. },
  1710. {
  1711. title: "金额(万元)",
  1712. dataIndex: "commodityPrice",
  1713. key: "commodityPrice",
  1714. render: (text, record) => {
  1715. if (record.splitStatus == 2) {
  1716. return "/";
  1717. } else {
  1718. return text;
  1719. }
  1720. },
  1721. },
  1722. {
  1723. title: "主要项目",
  1724. dataIndex: "main",
  1725. key: "main",
  1726. render: (text) => {
  1727. return text ? "是" : "否";
  1728. },
  1729. },
  1730. {
  1731. title: "项目负责人",
  1732. dataIndex: "receiverName",
  1733. key: "receiverName",
  1734. },
  1735. {
  1736. title: "项目说明",
  1737. dataIndex: "taskComment",
  1738. key: "taskComment",
  1739. render: (text) => {
  1740. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  1741. },
  1742. },
  1743. {
  1744. title: "操作",
  1745. dataIndex: "ABC",
  1746. key: "ABC",
  1747. render: (text, record) => {
  1748. return (
  1749. <div>
  1750. <Button
  1751. onClick={(e) => {
  1752. e.stopPropagation();
  1753. this.showConfirm(this.changeDeletePro, record);
  1754. }}
  1755. disabled={this.state.listFlag}
  1756. style={{
  1757. display: this.state.displayList ? "none" : "block",
  1758. }}
  1759. >
  1760. 删除
  1761. </Button>
  1762. </div>
  1763. );
  1764. },
  1765. },
  1766. ];
  1767. return (
  1768. <Table
  1769. columns={columns}
  1770. dataSource={data}
  1771. scroll={{ x: "max-content", y: 0 }}
  1772. pagination={false}
  1773. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  1774. />
  1775. );
  1776. } else {
  1777. columns = [];
  1778. return (
  1779. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  1780. 此项目暂未拆分
  1781. </p>
  1782. );
  1783. }
  1784. };
  1785. const { TextArea } = Input;
  1786. const data = this.state.data;
  1787. // let departmentArr = this.state.departmentArr || [];
  1788. const dataSources = this.state.customerArr || [];
  1789. const cuiDataList = this.state.contactList || [];
  1790. let departmentArr = this.state.departmentArr || [];
  1791. const options = this.state.states
  1792. ? dataSources.map(group => (
  1793. <Select.Option key={group.id} value={group.name}>
  1794. {group.name}
  1795. </Select.Option>
  1796. ))
  1797. : dataSources.map((group, index) => (
  1798. <Select.Option key={index} value={group.bname}>
  1799. {group.bname}
  1800. </Select.Option>
  1801. ));
  1802. return (
  1803. <div>
  1804. <Spin spinning={this.state.loading}>
  1805. {this.state.resVisible ? (
  1806. <ResolutionDetail
  1807. cancel={this.resCancel}
  1808. detail={this.state.resRecord}
  1809. visible={this.state.resVisible}
  1810. id={this.state.resRecord.orderNo}
  1811. />
  1812. ) : (
  1813. ""
  1814. )}
  1815. <div className="clearfix">
  1816. <FormItem
  1817. className="half-item"
  1818. {...formItemLayout}
  1819. label="客户名称"
  1820. >
  1821. <span>{data.userName}</span>
  1822. <EnterpriseNameChange
  1823. type='journal'
  1824. style={{ marginLeft: 10 }}
  1825. enterpriseId={this.props.orderUid} />
  1826. </FormItem>
  1827. </div>
  1828. <div className="clearfix">
  1829. <FormItem
  1830. className="half-item"
  1831. {...formItemLayout}
  1832. label="合同编号"
  1833. >
  1834. <span>{data.contractNo}</span>
  1835. </FormItem>
  1836. </div>
  1837. <div className="clearfix">
  1838. <FormItem
  1839. className="half-item"
  1840. {...formItemLayout}
  1841. label="申请变更部门"
  1842. >
  1843. <span>{this.state.data.depName}</span>
  1844. </FormItem>
  1845. <FormItem className="half-item" {...formItemLayout} label="申请人">
  1846. {/* <Input
  1847. placeholder="请输入申请人"
  1848. ref="signTotalAmount"
  1849. value={data.applicant}
  1850. onChange={e => {
  1851. let data = this.state.data;
  1852. data.applicant = e.target.value;
  1853. this.setState({ data });
  1854. }}
  1855. style={{ width: "240px" }}
  1856. /> */}
  1857. <span>{data.applicant}</span>
  1858. </FormItem>
  1859. </div>
  1860. <div className="clearfix">
  1861. <FormItem
  1862. labelCol={{ span: 4 }}
  1863. wrapperCol={{ span: 18 }}
  1864. label="变更类型"
  1865. >
  1866. <Select
  1867. placeholder="选择合同变更类型"
  1868. style={{ width: 200 }}
  1869. disabled={this.state.changeFlag}
  1870. onChange={(e) => {
  1871. let data = this.state.data;
  1872. data.type = e;
  1873. this.setState({ data, changeFlag: true });
  1874. if (e == 1) {
  1875. this.setState({
  1876. hetongFlag: false,
  1877. listFlag: false,
  1878. listCuiFlag: false,
  1879. tuiKuanFlag: false,
  1880. displayList: false,
  1881. });
  1882. } else if (e == 2) {
  1883. this.setState({
  1884. hetongFlag: true,
  1885. listFlag: false,
  1886. listCuiFlag: false,
  1887. tuiKuanFlag: true,
  1888. displayList: false,
  1889. });
  1890. } else if (e == 3) {
  1891. this.setState({
  1892. listFlag: false,
  1893. hetongFlag: false,
  1894. listCuiFlag: false,
  1895. tuiKuanFlag: false,
  1896. displayList: true,
  1897. });
  1898. } else if (e == 4) {
  1899. this.setState({
  1900. listFlag: false,
  1901. listCuiFlag: false,
  1902. hetongFlag: false,
  1903. tuiKuanFlag: true,
  1904. displayList: false,
  1905. });
  1906. } else if (e == 5) {
  1907. this.setState({
  1908. listFlag: false,
  1909. listCuiFlag: false,
  1910. hetongFlag: true,
  1911. tuiKuanFlag: true,
  1912. displayList: false,
  1913. });
  1914. } else {
  1915. this.setState({
  1916. listFlag: true,
  1917. hetongFlag: true,
  1918. listCuiFlag: true,
  1919. tuiKuanFlag: false,
  1920. displayList: false,
  1921. });
  1922. }
  1923. }}
  1924. value={data.type}
  1925. >
  1926. <Option value={0}>退单退款</Option>
  1927. <Option value={1}>项目及金额变更</Option>
  1928. <Option value={2}>仅项目变更</Option>
  1929. <Option value={3}>仅金额变更</Option>
  1930. <Option value={4}>重报</Option>
  1931. <Option value={5}>赠送</Option>
  1932. </Select>
  1933. <Button
  1934. style={{ marginLeft: 10 }}
  1935. onClick={(e) => {
  1936. this.state.data.startRemarks = "";
  1937. this.state.data.remarks = "";
  1938. this.state.data.changeAmount = "0";
  1939. this.state.data.depNameChange = undefined;
  1940. this.state.data.typeChange = undefined;
  1941. this.state.data.totalAmount = this.state.data.oldPrice;
  1942. this.setState({
  1943. listFlag: false,
  1944. hetongFlag: false,
  1945. listCuiFlag: false,
  1946. tuiKuanFlag: false,
  1947. displayList: false,
  1948. startRemarks: "",
  1949. data: this.state.data,
  1950. changeFlag: false,
  1951. voucherUrl: [],
  1952. // changeAmount: "0",
  1953. // applicant: undefined,
  1954. // depNameChange: undefined,
  1955. // typeChange: [],
  1956. // changeFlag: false
  1957. });
  1958. }}
  1959. >
  1960. 重置
  1961. </Button>
  1962. {this.state.data.status == 3 ? (
  1963. <Button
  1964. type="danger"
  1965. style={{
  1966. float: "right",
  1967. backgroundColor: "red",
  1968. color: "white",
  1969. position: "absolute",
  1970. right: 0,
  1971. height: 50,
  1972. borderRadius: 20,
  1973. }}
  1974. onClick={(e) => {
  1975. e.stopPropagation();
  1976. this.showConfirmChange(this.deleteChange);
  1977. }}
  1978. >
  1979. 取消本次变更
  1980. </Button>
  1981. ) : (
  1982. ""
  1983. )}
  1984. </FormItem>
  1985. </div>
  1986. <div className="clearfix">
  1987. <FormItem
  1988. labelCol={{ span: 4 }}
  1989. wrapperCol={{ span: 18 }}
  1990. label="合同额(万元)"
  1991. >
  1992. <Input
  1993. placeholder="请输入合同额"
  1994. ref="signTotalAmount"
  1995. disabled={this.state.hetongFlag}
  1996. value={data.totalAmount}
  1997. onChange={(e) => {
  1998. let data = this.state.data;
  1999. data.totalAmount = e.target.value;
  2000. this.setState({ data });
  2001. }}
  2002. style={{ width: "240px" }}
  2003. />
  2004. </FormItem>
  2005. <FormItem
  2006. labelCol={{ span: 4 }}
  2007. wrapperCol={{ span: 18 }}
  2008. label="已收款(万元)"
  2009. >
  2010. {/* <Input
  2011. placeholder="请输入已收款"
  2012. ref="signTotalAmount"
  2013. value={data.settlementAmount}
  2014. onChange={e => {
  2015. let data = this.state.data;
  2016. data.settlementAmount = e.target.value;
  2017. this.setState({ data });
  2018. }}
  2019. style={{ width: "240px" }}
  2020. /> */}
  2021. <span>
  2022. {this.state.data.settlementAmount}&nbsp;&nbsp;&nbsp;&nbsp;
  2023. <span style={{ color: "red" }}>
  2024. (注:已收款与现实收款不符,请与财务专员联系)
  2025. </span>
  2026. </span>
  2027. </FormItem>
  2028. <FormItem
  2029. labelCol={{ span: 4 }}
  2030. wrapperCol={{ span: 18 }}
  2031. label="申请退款(万元)"
  2032. >
  2033. <Input
  2034. placeholder="请输入申请退款"
  2035. ref="signTotalAmount"
  2036. disabled={this.state.tuiKuanFlag}
  2037. value={data.changeAmount}
  2038. onChange={(e) => {
  2039. let data = this.state.data;
  2040. data.changeAmount = e.target.value;
  2041. this.setState({ data });
  2042. }}
  2043. style={{ width: "240px" }}
  2044. />
  2045. </FormItem>
  2046. </div>
  2047. <div>
  2048. <div>
  2049. <span
  2050. style={{
  2051. marginLeft: "50px",
  2052. fontSize: "20px",
  2053. }}
  2054. >
  2055. 项目业务
  2056. </span>
  2057. <span style={{ color: "red" }}>
  2058. (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!双击可修改对应金额数量!)
  2059. </span>
  2060. <Button
  2061. type="primary"
  2062. onClick={this.changeAddPro}
  2063. disabled={this.state.listFlag}
  2064. style={{
  2065. float: "right",
  2066. marginRight: "50px",
  2067. marginBottom: "15px",
  2068. display: this.state.displayList ? "none" : "block",
  2069. }}
  2070. >
  2071. 添加项目明细
  2072. </Button>
  2073. </div>
  2074. <div className="patent-table" style={{ marginBottom: 10 }}>
  2075. {/* <Spin spinning={this.state.loading}> */}
  2076. <Table
  2077. columns={this.state.proColumns}
  2078. dataSource={this.state.proDataSource}
  2079. scroll={{ x: "max-content", y: 0 }}
  2080. expandedRowRender={expandedRowRender}
  2081. pagination={false}
  2082. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2083. bordered
  2084. size="small"
  2085. />
  2086. {/* </Spin> */}
  2087. </div>
  2088. <div>
  2089. <span
  2090. style={{
  2091. marginLeft: "50px",
  2092. fontSize: "20px",
  2093. }}
  2094. >
  2095. 催款节点
  2096. </span>
  2097. <span style={{ color: "red" }}>
  2098. (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!双击可修改对应金额!)
  2099. </span>
  2100. <Button
  2101. type="primary"
  2102. onClick={(e) => {
  2103. this.changeAddCui();
  2104. }}
  2105. disabled={this.state.listCuiFlag}
  2106. style={{
  2107. float: "right",
  2108. marginRight: "50px",
  2109. marginBottom: "15px",
  2110. display: this.state.displayList ? "none" : "block",
  2111. }}
  2112. >
  2113. 添加催款节点
  2114. </Button>
  2115. </div>
  2116. <div className="clearfix">
  2117. {/* <Spin spinning={this.state.loading}> */}
  2118. <Form layout="horizontal">
  2119. <Table
  2120. pagination={false}
  2121. columns={this.state.changeCuiList}
  2122. dataSource={this.state.cuiDataSource}
  2123. scroll={{ x: "max-content", y: 0 }}
  2124. onRowDoubleClick={
  2125. this.state.listCuiFlag ? this.not : this.editCui
  2126. }
  2127. bordered
  2128. size="small"
  2129. />
  2130. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2131. </Form>
  2132. {/* </Spin> */}
  2133. </div>
  2134. </div>
  2135. <div className="clearfix">
  2136. <FormItem
  2137. style={{ height: "auto" }}
  2138. labelCol={{ span: 4 }}
  2139. wrapperCol={{ span: 18 }}
  2140. label="变更原因"
  2141. >
  2142. <TextArea
  2143. rows={4}
  2144. placeholder="因企业政府补助费用与营销员签单承诺费用不一"
  2145. ref="signTotalAmount"
  2146. style={{ width: "95%" }}
  2147. value={data.remarks}
  2148. onChange={(e) => {
  2149. let data = this.state.data;
  2150. data.remarks = e.target.value;
  2151. this.setState({ data });
  2152. }}
  2153. />
  2154. </FormItem>
  2155. </div>
  2156. {/* 备注 */}
  2157. <div className="clearfix">
  2158. <FormItem
  2159. style={{ height: "auto" }}
  2160. labelCol={{ span: 4 }}
  2161. wrapperCol={{ span: 18 }}
  2162. label="备注"
  2163. >
  2164. <TextArea
  2165. rows={4}
  2166. placeholder="请输入备注信息"
  2167. ref="signTotalAmount"
  2168. style={{ width: "95%" }}
  2169. value={data.startRemarks}
  2170. onChange={(e) => {
  2171. let data = this.state.data;
  2172. data.startRemarks = e.target.value;
  2173. this.setState({ data });
  2174. }}
  2175. />
  2176. </FormItem>
  2177. </div>
  2178. <div className="clearfix">
  2179. <FormItem
  2180. labelCol={{ span: 4 }}
  2181. wrapperCol={{ span: 18 }}
  2182. label="变更凭证"
  2183. >
  2184. <PicturesWall
  2185. fileList={this.getVoucherUrl}
  2186. pictureUrl={this.state.voucherUrl}
  2187. url="/api/admin/orderChange/uploadFile"
  2188. sign="order_change_file"
  2189. />
  2190. <Rizhi changeId={data.id} />
  2191. <p>图片建议:要清晰。</p>
  2192. </FormItem>
  2193. </div>
  2194. {/* <ul
  2195. style={{
  2196. width: "868px",
  2197. overflow: "hidden",
  2198. paddingLeft: "90px",
  2199. marginBottom: "20px"
  2200. }}
  2201. >
  2202. {this.state.dataSource.map((item, index) => (
  2203. <li
  2204. key={index}
  2205. style={{
  2206. width: "100%",
  2207. height: "auto",
  2208. wordBreak: "break-all",
  2209. color: "black",
  2210. marginBottom: "10px"
  2211. }}
  2212. >{`${item.aname}: ${item.remarks}`}</li>
  2213. ))}
  2214. </ul> */}
  2215. <div className="clearfix">
  2216. <Button
  2217. type="primary"
  2218. style={{ float: "right", marginRight: 40 }}
  2219. onClick={this.changeApply}
  2220. >
  2221. 发起变更申请
  2222. </Button>
  2223. </div>
  2224. <Modal
  2225. maskClosable={false}
  2226. title="修改项目金额及数量"
  2227. visible={this.state.editProVisible}
  2228. onOk={this.submitEditPro}
  2229. width={300}
  2230. okText={"保存"}
  2231. onCancel={() => {
  2232. this.setState({
  2233. editProVisible: false,
  2234. });
  2235. }}
  2236. >
  2237. <div className="clearfix">
  2238. <FormItem
  2239. labelCol={{ span: 6 }}
  2240. wrapperCol={{ span: 14 }}
  2241. label="项目金额"
  2242. style={{
  2243. display: this.state.editSplitStatus == 2 ? "none" : "block",
  2244. }}
  2245. >
  2246. <Input
  2247. placeholder="请输入金额"
  2248. rows={4}
  2249. value={this.state.editProMoney}
  2250. onChange={(e) => {
  2251. this.setState({ editProMoney: e.target.value });
  2252. }}
  2253. />
  2254. </FormItem>
  2255. <FormItem
  2256. labelCol={{ span: 6 }}
  2257. wrapperCol={{ span: 14 }}
  2258. label="项目数量"
  2259. >
  2260. <Input
  2261. placeholder="请输入数量"
  2262. rows={4}
  2263. value={this.state.editProCommodityQuantity}
  2264. onChange={(e) => {
  2265. this.setState({ editProCommodityQuantity: e.target.value });
  2266. }}
  2267. />
  2268. </FormItem>
  2269. </div>
  2270. </Modal>
  2271. <Modal
  2272. maskClosable={false}
  2273. title={isNaN(parseFloat(this.state.appropriationRatio)) ? "修改催款节点金额" : "修改催款节点比例"}
  2274. visible={this.state.editCuiVisible}
  2275. onOk={() => {
  2276. this.submitEditCui(isNaN(parseFloat(this.state.appropriationRatio)) ? 0 : 1);
  2277. }}
  2278. okText={"保存"}
  2279. width={300}
  2280. onCancel={(e) => {
  2281. this.setState({
  2282. editCuiVisible: false,
  2283. appropriationRatio: ''
  2284. });
  2285. }}
  2286. >
  2287. <div className="clearfix">
  2288. <FormItem
  2289. labelCol={{ span: 6 }}
  2290. wrapperCol={{ span: 14 }}
  2291. label={isNaN(parseFloat(this.state.appropriationRatio)) ? "催款金额" : "催款比例"}
  2292. >
  2293. <Input
  2294. type='number'
  2295. placeholder={isNaN(parseFloat(this.state.appropriationRatio)) ? "请输入金额" : "请输入比例"}
  2296. rows={4}
  2297. value={this.state.editCuiMoney}
  2298. onChange={(e) => {
  2299. this.setState({ editCuiMoney: e.target.value });
  2300. }}
  2301. />
  2302. </FormItem>
  2303. </div>
  2304. </Modal>
  2305. {/* {
  2306. this.state.changeVisible &&
  2307. <ProjectOperation
  2308. readOnly={false}
  2309. orderNo={this.state.data.orderNo}
  2310. visible={this.state.changeVisible}
  2311. dataInfor={{}}
  2312. onCancel={this.nextCancel}
  2313. />
  2314. } */}
  2315. <Modal
  2316. maskClosable={false}
  2317. visible={this.state.changeVisible}
  2318. onOk={this.nextCancel}
  2319. onCancel={this.nextCancel}
  2320. width="900px"
  2321. title={"添加变更项目"}
  2322. footer=""
  2323. className="admin-desc-content"
  2324. >
  2325. <Form
  2326. layout="horizontal"
  2327. >
  2328. <div className="clearfix">
  2329. <FormItem
  2330. className="half-item"
  2331. {...formItemLayout}
  2332. label="服务名称"
  2333. >
  2334. <AutoComplete
  2335. className="certain-category-search"
  2336. dropdownClassName="certain-category-search-dropdown"
  2337. dropdownMatchSelectWidth={false}
  2338. dropdownStyle={{ width: 200 }}
  2339. style={{ width: "200px" }}
  2340. dataSource={options}
  2341. placeholder="输入服务名称"
  2342. value={this.state.commodityName}
  2343. onChange={this.httpChange}
  2344. filterOption={true}
  2345. onSelect={this.selectAuto}
  2346. >
  2347. <Input />
  2348. </AutoComplete>
  2349. <span className="mandatory">*</span>
  2350. </FormItem>
  2351. <FormItem
  2352. className="half-item"
  2353. {...formItemLayout}
  2354. label="服务数量"
  2355. >
  2356. <Input
  2357. placeholder="请输入服务数量"
  2358. value={this.state.commodityQuantity}
  2359. style={{ width: "200px" }}
  2360. onChange={(e) => {
  2361. this.setState({ commodityQuantity: e.target.value });
  2362. }}
  2363. ref="commodityQuantity"
  2364. />
  2365. <span className="mandatory">*</span>
  2366. </FormItem>
  2367. <div style={{ marginTop: "33px", color: "red", textAlign: "right", position: "relative", top: "-8", left: "0" }}>如会员项目,服务一年,请填写1,服务二年,请填写2,依次类推</div>
  2368. {!this.state.patentTransfer &&
  2369. <FormItem
  2370. className="half-item"
  2371. labelCol={{ span: 4 }}
  2372. wrapperCol={{ span: 14 }}
  2373. label="专利类型:"
  2374. style={{
  2375. display: this.state.displayFees,
  2376. marginLeft: "63px",
  2377. }}
  2378. >
  2379. {<Select
  2380. placeholder="请选择专利类型"
  2381. style={{ width: "200px" }}
  2382. value={this.state.patentType}
  2383. onChange={(e) => {
  2384. this.setState({ patentType: e });
  2385. if (e !== 0 && e !== 2) {
  2386. this.setState({
  2387. costReduction: ''
  2388. })
  2389. }
  2390. }}
  2391. >
  2392. {this.state.patentTypeList.map(function (v, k) {
  2393. return (
  2394. <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
  2395. );
  2396. })}
  2397. </Select>}
  2398. <span style={{ color: "red", marginLeft: "8px" }}>
  2399. *
  2400. </span>
  2401. </FormItem>}
  2402. <FormItem
  2403. className="half-item"
  2404. labelCol={{ span: 3 }}
  2405. wrapperCol={{ span: 14 }}
  2406. label="官费:"
  2407. style={{
  2408. display: this.state.displayFees,
  2409. marginLeft: "63px",
  2410. }}
  2411. >
  2412. {<Radio.Group
  2413. value={this.state.officialCost}
  2414. onChange={(e) => {
  2415. this.setState({ officialCost: e.target.value });
  2416. if (e.target.value === 0) {
  2417. this.setState({
  2418. costReduction: ''
  2419. })
  2420. }
  2421. }}
  2422. >
  2423. <Radio value={1}>含官费</Radio>
  2424. <Radio value={0}>不含官费</Radio>
  2425. </Radio.Group>}
  2426. <span style={{ color: "red", marginLeft: "8px" }}>
  2427. *
  2428. </span>
  2429. </FormItem>
  2430. <FormItem
  2431. className="half-item"
  2432. labelCol={{ span: 3 }}
  2433. wrapperCol={{ span: 14 }}
  2434. label="费减:"
  2435. style={{
  2436. display: this.state.displayFees,
  2437. marginLeft: "63px",
  2438. }}
  2439. >
  2440. {/*不含官费或者专利类型不为复审或者申请时置灰*/}
  2441. {<Radio.Group
  2442. disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
  2443. value={this.state.costReduction}
  2444. onChange={(e) => {
  2445. this.setState({ costReduction: e.target.value });
  2446. }}
  2447. >
  2448. <Radio value={1}>有费减</Radio>
  2449. <Radio value={0}>无费减</Radio>
  2450. </Radio.Group>}
  2451. <span style={{ color: "red", marginLeft: "8px" }}>
  2452. *
  2453. </span>
  2454. </FormItem>
  2455. <FormItem
  2456. className="half-item"
  2457. {...formItemLayout}
  2458. label="实签价格(万元)"
  2459. >
  2460. <Input
  2461. placeholder="请输入实签价格"
  2462. value={this.state.commodityPrice}
  2463. style={{ width: "200px" }}
  2464. onChange={(e) => {
  2465. this.setState({ commodityPrice: e.target.value });
  2466. }}
  2467. ref="commodityPrice"
  2468. />
  2469. <span className="mandatory">*</span>
  2470. </FormItem>
  2471. <FormItem
  2472. className="half-item"
  2473. {...formItemLayout}
  2474. label="主要业务"
  2475. >
  2476. <Select
  2477. placeholder="选择是否为主要业务"
  2478. style={{ width: "200px" }}
  2479. value={this.state.main}
  2480. onChange={(e) => {
  2481. this.setState({ main: e });
  2482. }}
  2483. >
  2484. {boutique.map(function (item) {
  2485. return (
  2486. <Select.Option key={item.value}>
  2487. {item.key}
  2488. </Select.Option>
  2489. );
  2490. })}
  2491. </Select>
  2492. <span className="mandatory">*</span>
  2493. </FormItem>
  2494. <div className="clearfix">
  2495. <FormItem
  2496. labelCol={{ span: 4 }}
  2497. wrapperCol={{ span: 16 }}
  2498. label="项目说明"
  2499. >
  2500. <Input
  2501. type="textarea"
  2502. placeholder="如会员项目请详细描写会员项目的服务年限、详细服务时间段段,如第一年从2021年1月至2021年12月31日止,第二年从。。。"
  2503. value={this.state.taskComment}
  2504. onChange={(e) => {
  2505. this.setState({ taskComment: e.target.value });
  2506. }}
  2507. />
  2508. </FormItem>
  2509. </div>
  2510. {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
  2511. {this.state.addProjectType === 5 ?
  2512. <div className="clearfix">
  2513. <FormItem
  2514. className="half-item"
  2515. {...formItemLayout}
  2516. label="企业要求申报批次"
  2517. >
  2518. <Select
  2519. placeholder="请选择企业要求申报批次"
  2520. style={{ width: "200px" }}
  2521. value={this.state.declarationBatch}
  2522. onChange={(e) => {
  2523. this.setState({ declarationBatch: e });
  2524. }}
  2525. >
  2526. <Select.Option value={1}>
  2527. 第一批
  2528. </Select.Option>
  2529. <Select.Option value={2}>
  2530. 第二批
  2531. </Select.Option>
  2532. <Select.Option value={3}>
  2533. 第三批
  2534. </Select.Option>
  2535. <Select.Option value={4}>
  2536. 第四批
  2537. </Select.Option>
  2538. </Select>
  2539. <span className="mandatory">*</span>
  2540. </FormItem>
  2541. </div> : null
  2542. }
  2543. {
  2544. this.state.isIso &&
  2545. <div className="clearfix">
  2546. <FormItem
  2547. className="half-item"
  2548. {...formItemLayout}
  2549. label="是否包含认证费用"
  2550. >
  2551. {<Select
  2552. placeholder="请选择是否包含认证费用"
  2553. style={{ width: "200px" }}
  2554. value={this.state.ifCertificationFee}
  2555. onChange={(e) => {
  2556. this.setState({ ifCertificationFee: e });
  2557. }}
  2558. >
  2559. <Select.Option value={0}>
  2560. </Select.Option>
  2561. <Select.Option value={1}>
  2562. </Select.Option>
  2563. </Select>}
  2564. <span className="mandatory">*</span>
  2565. </FormItem>
  2566. </div>
  2567. }
  2568. <FormItem
  2569. wrapperCol={{ span: 12, offset: 4 }}
  2570. className="half-middle"
  2571. >
  2572. <Button
  2573. className="submitSave"
  2574. type="primary"
  2575. onClick={this.changeProSubmit}
  2576. >
  2577. 保存
  2578. </Button>
  2579. <Button
  2580. className="submitSave"
  2581. type="ghost"
  2582. onClick={this.nextCancel}
  2583. >
  2584. 取消
  2585. </Button>
  2586. </FormItem>
  2587. </div>
  2588. </Form>
  2589. </Modal>
  2590. </Spin>
  2591. </div>
  2592. );
  2593. }
  2594. }
  2595. export default ChangeApply;