changeApply.js 71 KB

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