changeApply.js 53 KB

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