changeApply.js 72 KB

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