changeApply.js 72 KB

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