changeApply.js 58 KB

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