changeApply.js 54 KB

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