changeApply.js 70 KB

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