changeApply.js 58 KB

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