changeApply.js 71 KB

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