changeApply.js 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409
  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. ustomizeTimes:
  1234. record.dunType == 0 ? record.customizeTimes : undefined,
  1235. customizeName: record.dunType == 0 ? record.customizeName : undefined,
  1236. },
  1237. }).done(
  1238. function (data) {
  1239. this.setState({
  1240. loading: false,
  1241. });
  1242. if (!data.error.length) {
  1243. message.success("保存成功!");
  1244. this.setState({
  1245. cuiFlag: false,
  1246. boFlag: false,
  1247. addFlag: false,
  1248. });
  1249. this.cuiList();
  1250. } else {
  1251. message.warning(data.error[0].message);
  1252. }
  1253. }.bind(this)
  1254. );
  1255. }
  1256. }
  1257. submitChange() {
  1258. if (
  1259. this.state.typeChange == undefined ||
  1260. (this.state.typeChange == "" && this.state.typeChange != 0)
  1261. ) {
  1262. message.warning("请选择变更类型");
  1263. return false;
  1264. }
  1265. if (
  1266. this.state.typeChange == 0 ||
  1267. this.state.typeChange == 1 ||
  1268. this.state.typeChange == 3
  1269. ) {
  1270. if (this.state.settlementAmount < this.state.changeAmount) {
  1271. message.warning("退款金额大于已收款金额");
  1272. return;
  1273. }
  1274. }
  1275. if (this.state.processStatus != 5 || this.state.processStatus != 6) {
  1276. message.warning("当前订单流程不能发起变更!");
  1277. return false;
  1278. }
  1279. if (this.state.changeAmount === "") {
  1280. message.warning("申请退款金额不能为空!");
  1281. return false;
  1282. }
  1283. if (this.state.remarksC.trim() == "") {
  1284. message.warning("请正确填写变更原因");
  1285. return false;
  1286. }
  1287. if (this.state.startRemarks.trim() == "") {
  1288. message.warning("请正确填写备注信息");
  1289. return false;
  1290. }
  1291. let theorgCodeUrl = [];
  1292. if (this.state.voucherUrl.length) {
  1293. let picArr = [];
  1294. this.state.voucherUrl.map(function (item) {
  1295. if (item.response && item.response.data && item.response.data.length) {
  1296. picArr.push(item.response.data);
  1297. }
  1298. });
  1299. theorgCodeUrl = picArr.join(",");
  1300. }
  1301. this.setState({
  1302. loading: true
  1303. });
  1304. $.ajax({
  1305. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  1306. method: "post",
  1307. data: {
  1308. id: this.state.changeId,
  1309. changeType: 0,
  1310. orderNo: this.state.orderNo, //订单编号
  1311. processState: 0,
  1312. startRemarks: this.state.startRemarks,
  1313. remarks: this.state.remarksC,
  1314. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1315. totalAmount: this.state.totalAmount,
  1316. settlementAmount: this.state.settlementAmount,
  1317. changeAmount: this.state.changeAmount,
  1318. applicant: this.state.salesmanName,
  1319. depName: this.state.depName,
  1320. type: this.state.typeChange
  1321. }
  1322. }).done(
  1323. function (data) {
  1324. if (!data.error.length) {
  1325. this.setState({
  1326. loading: false
  1327. });
  1328. message.success("发起变更成功");
  1329. this.handleCancelclose();
  1330. } else {
  1331. message.warning(data.error[0].message);
  1332. this.setState({
  1333. loading: false
  1334. });
  1335. }
  1336. }.bind(this)
  1337. );
  1338. }
  1339. editCui(record) {
  1340. this.setState({
  1341. editCuiVisible: true,
  1342. editCuiMoney: record.money,
  1343. editCuiTid: record.tid,
  1344. editCuiId: record.id
  1345. });
  1346. }
  1347. editPro(record) {
  1348. this.setState({
  1349. editProVisible: true,
  1350. editSplitStatus: record.splitStatus,
  1351. editProMoney: record.commodityPrice,
  1352. editProCommodityQuantity: record.commodityQuantity,
  1353. editProTid: record.tid,
  1354. editProId: record.id
  1355. });
  1356. }
  1357. submitEditCui() {
  1358. this.setState({
  1359. loading: true
  1360. });
  1361. $.ajax({
  1362. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  1363. method: "post",
  1364. data: {
  1365. id: this.state.editCuiId,
  1366. type: this.state.editCuiTid ? 2 : 1,
  1367. money: this.state.editCuiMoney,
  1368. tid: this.state.editCuiTid,
  1369. }
  1370. }).done(
  1371. function (data) {
  1372. this.setState({
  1373. loading: false
  1374. });
  1375. if (!data.error.length) {
  1376. message.success("修改成功!");
  1377. this.cuiList();
  1378. this.proList()
  1379. this.setState({
  1380. editCuiVisible: false
  1381. });
  1382. } else {
  1383. message.warning(data.error[0].message);
  1384. }
  1385. }.bind(this)
  1386. );
  1387. }
  1388. submitEditPro() {
  1389. this.setState({
  1390. loading: true
  1391. });
  1392. $.ajax({
  1393. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  1394. method: "post",
  1395. data: {
  1396. id: this.state.editProId,
  1397. type: this.state.editProTid ? 2 : 1,
  1398. commodityPrice: this.state.editProMoney,
  1399. commodityQuantity: this.state.editProCommodityQuantity,
  1400. tid: this.state.editProTid
  1401. }
  1402. }).done(
  1403. function (data) {
  1404. this.setState({
  1405. loading: false
  1406. });
  1407. if (!data.error.length) {
  1408. message.success("修改成功!");
  1409. this.proList();
  1410. this.cuiList()
  1411. this.setState({
  1412. editProVisible: false
  1413. });
  1414. } else {
  1415. message.warning(data.error[0].message);
  1416. }
  1417. }.bind(this)
  1418. );
  1419. }
  1420. componentWillMount() {
  1421. this.departmentList();
  1422. this.state.data = this.props.orderData;
  1423. this.state.data.oldPrice = this.props.orderData.totalAmount;
  1424. this.setState({
  1425. data: this.state.data,
  1426. voucherUrl: this.props.voucherUrl
  1427. });
  1428. this.proList();
  1429. this.cuiList();
  1430. let e = this.props.orderData.type;
  1431. if (e == 1) {
  1432. this.setState({
  1433. hetongFlag: false,
  1434. listFlag: false,
  1435. listCuiFlag: false,
  1436. tuiKuanFlag: false,
  1437. displayList: false
  1438. });
  1439. } else if (e == 2) {
  1440. this.setState({
  1441. hetongFlag: true,
  1442. listFlag: false,
  1443. listCuiFlag: false,
  1444. tuiKuanFlag: true,
  1445. displayList: false
  1446. });
  1447. } else if (e == 3) {
  1448. this.setState({
  1449. listFlag: false,
  1450. hetongFlag: false,
  1451. listCuiFlag: false,
  1452. tuiKuanFlag: false,
  1453. displayList: true
  1454. });
  1455. } else if (e == 4) {
  1456. this.setState({
  1457. listFlag: false,
  1458. listCuiFlag: false,
  1459. hetongFlag: false,
  1460. tuiKuanFlag: true,
  1461. displayList: false
  1462. });
  1463. } else if (e == 5) {
  1464. this.setState({
  1465. listFlag: false,
  1466. listCuiFlag: false,
  1467. hetongFlag: true,
  1468. tuiKuanFlag: true,
  1469. displayList: false
  1470. });
  1471. } else {
  1472. this.setState({
  1473. listFlag: true,
  1474. hetongFlag: true,
  1475. listCuiFlag: true,
  1476. tuiKuanFlag: false,
  1477. displayList: false
  1478. });
  1479. }
  1480. }
  1481. componentWillReceiveProps(nextProps) {
  1482. this.state.data = nextProps.orderData;
  1483. this.state.data.oldPrice = nextProps.orderData.totalAmount;
  1484. this.setState({
  1485. data: this.state.data,
  1486. voucherUrl: nextProps.voucherUrl
  1487. });
  1488. this.proList();
  1489. this.cuiList();
  1490. let e = nextProps.orderData.type;
  1491. if (e == 1) {
  1492. this.setState({
  1493. hetongFlag: false,
  1494. listFlag: false,
  1495. listCuiFlag: false,
  1496. tuiKuanFlag: false,
  1497. displayList: false
  1498. });
  1499. } else if (e == 2) {
  1500. this.setState({
  1501. hetongFlag: true,
  1502. listFlag: false,
  1503. listCuiFlag: false,
  1504. tuiKuanFlag: true,
  1505. displayList: false
  1506. });
  1507. } else if (e == 3) {
  1508. this.setState({
  1509. listFlag: false,
  1510. hetongFlag: false,
  1511. listCuiFlag: false,
  1512. tuiKuanFlag: false,
  1513. displayList: true
  1514. });
  1515. } else if (e == 4) {
  1516. this.setState({
  1517. listFlag: false,
  1518. listCuiFlag: false,
  1519. hetongFlag: false,
  1520. tuiKuanFlag: true,
  1521. displayList: false
  1522. });
  1523. } else if (e == 5) {
  1524. this.setState({
  1525. listFlag: false,
  1526. listCuiFlag: false,
  1527. hetongFlag: true,
  1528. tuiKuanFlag: true,
  1529. displayList: false
  1530. });
  1531. } else {
  1532. this.setState({
  1533. listFlag: true,
  1534. hetongFlag: true,
  1535. listCuiFlag: true,
  1536. tuiKuanFlag: false,
  1537. displayList: false
  1538. });
  1539. }
  1540. // }
  1541. }
  1542. // componentWillMount() {
  1543. // this.departmentList();
  1544. // }
  1545. not() {
  1546. }
  1547. deleteChange() {
  1548. this.setState({
  1549. loading: true,
  1550. });
  1551. $.ajax({
  1552. url: globalConfig.context + "/api/admin/orderChange/cancelOrderChange",
  1553. method: "post",
  1554. data: {
  1555. id: this.state.data.id,
  1556. status: this.state.data.status,
  1557. processState: this.state.data.processState,
  1558. orderNo: this.state.data.orderNo
  1559. },
  1560. }).done(
  1561. function (data) {
  1562. this.setState({
  1563. loading: false,
  1564. });
  1565. if (!data.error.length) {
  1566. message.success("取消成功!");
  1567. this.props.onCancel()
  1568. } else {
  1569. message.warning(data.error[0].message);
  1570. }
  1571. }.bind(this)
  1572. );
  1573. }
  1574. render() {
  1575. const expandedRowRender = e => {
  1576. const data = e.list;
  1577. data.forEach((item) => {
  1578. item.key = item.id
  1579. })
  1580. let columns = [];
  1581. if (e.list instanceof Array && e.list.length) {
  1582. columns = [
  1583. {
  1584. title: "变更状态",
  1585. dataIndex: "type",
  1586. key: "type",
  1587. render: (text, record) => {
  1588. let str = "";
  1589. let color = "";
  1590. if (text == 1) {
  1591. str = "增";
  1592. color = "#87d068";
  1593. } else if (text == 2) {
  1594. str = "改";
  1595. color = "#108ee9";
  1596. } else if (text == 3) {
  1597. str = "删";
  1598. color = "#f50";
  1599. }
  1600. return (
  1601. <span>
  1602. <Tag
  1603. color={color}
  1604. style={{ display: text == 0 ? "none" : "inline-block" }}
  1605. >
  1606. {str}
  1607. </Tag>
  1608. {record.splitStatus == 1 ? (
  1609. <Tag
  1610. color="#108ee9"
  1611. // onClick={e => {
  1612. // e.stopPropagation();
  1613. // this.showRes(record);
  1614. // }}
  1615. >
  1616. 父项目
  1617. </Tag>
  1618. ) : (
  1619. ""
  1620. )}
  1621. {record.splitStatus == 2 ? (
  1622. <Tag
  1623. color="#108ee9"
  1624. // onClick={e => {
  1625. // e.stopPropagation();
  1626. // this.showRes(record);
  1627. // }}
  1628. >
  1629. 子项目
  1630. </Tag>
  1631. ) : (
  1632. ""
  1633. )}
  1634. </span>
  1635. );
  1636. },
  1637. },
  1638. {
  1639. title: "业务项目名称",
  1640. dataIndex: "commodityName",
  1641. key: "commodityName",
  1642. render: (text, record) => {
  1643. return text + "-" + record.id;
  1644. },
  1645. },
  1646. {
  1647. title: "项目类别",
  1648. dataIndex: "cname",
  1649. key: "cname",
  1650. },
  1651. {
  1652. title: "项目数量",
  1653. dataIndex: "commodityQuantity",
  1654. key: "commodityQuantity",
  1655. },
  1656. {
  1657. title: "金额(万元)",
  1658. dataIndex: "commodityPrice",
  1659. key: "commodityPrice",
  1660. render: (text, record) => {
  1661. if (record.splitStatus == 2) {
  1662. return "/";
  1663. } else {
  1664. return text;
  1665. }
  1666. },
  1667. },
  1668. {
  1669. title: "主要项目",
  1670. dataIndex: "main",
  1671. key: "main",
  1672. render: (text) => {
  1673. return text ? "是" : "否";
  1674. },
  1675. },
  1676. {
  1677. title: "项目负责人",
  1678. dataIndex: "receiverName",
  1679. key: "receiverName",
  1680. },
  1681. {
  1682. title: "项目说明",
  1683. dataIndex: "taskComment",
  1684. key: "taskComment",
  1685. render: (text) => {
  1686. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  1687. },
  1688. },
  1689. {
  1690. title: "操作",
  1691. dataIndex: "ABC",
  1692. key: "ABC",
  1693. render: (text, record) => {
  1694. return (
  1695. <div>
  1696. <Button
  1697. onClick={(e) => {
  1698. e.stopPropagation();
  1699. this.showConfirm(this.changeDeletePro, record);
  1700. }}
  1701. disabled={this.state.listFlag}
  1702. style={{
  1703. display: this.state.displayList ? "none" : "block",
  1704. }}
  1705. >
  1706. 删除
  1707. </Button>
  1708. </div>
  1709. );
  1710. },
  1711. },
  1712. ];
  1713. return (
  1714. <Table
  1715. columns={columns}
  1716. dataSource={data}
  1717. scroll={{ x: "max-content", y: 0 }}
  1718. pagination={false}
  1719. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  1720. />
  1721. );
  1722. } else {
  1723. columns = [];
  1724. return (
  1725. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  1726. 此项目暂未拆分
  1727. </p>
  1728. );
  1729. }
  1730. };
  1731. const { TextArea } = Input;
  1732. const data = this.state.data;
  1733. // let departmentArr = this.state.departmentArr || [];
  1734. const dataSources = this.state.customerArr || [];
  1735. const cuiDataList = this.state.contactList || [];
  1736. let departmentArr = this.state.departmentArr || [];
  1737. const options = this.state.states
  1738. ? dataSources.map(group => (
  1739. <Select.Option key={group.id} value={group.name}>
  1740. {group.name}
  1741. </Select.Option>
  1742. ))
  1743. : dataSources.map((group, index) => (
  1744. <Select.Option key={index} value={group.bname}>
  1745. {group.bname}
  1746. </Select.Option>
  1747. ));
  1748. return (
  1749. <div>
  1750. <Spin spinning={this.state.loading}>
  1751. {this.state.resVisible ? (
  1752. <ResolutionDetail
  1753. cancel={this.resCancel}
  1754. detail={this.state.resRecord}
  1755. visible={this.state.resVisible}
  1756. id={this.state.resRecord.orderNo}
  1757. />
  1758. ) : (
  1759. ""
  1760. )}
  1761. <div className="clearfix">
  1762. <FormItem
  1763. className="half-item"
  1764. {...formItemLayout}
  1765. label="客户名称"
  1766. >
  1767. <span>{data.userName}</span>
  1768. </FormItem>
  1769. </div>
  1770. <div className="clearfix">
  1771. <FormItem
  1772. className="half-item"
  1773. {...formItemLayout}
  1774. label="合同编号"
  1775. >
  1776. <span>{data.contractNo}</span>
  1777. </FormItem>
  1778. </div>
  1779. <div className="clearfix">
  1780. <FormItem
  1781. className="half-item"
  1782. {...formItemLayout}
  1783. label="申请变更部门"
  1784. >
  1785. <span>{this.state.data.depName}</span>
  1786. </FormItem>
  1787. <FormItem className="half-item" {...formItemLayout} label="申请人">
  1788. {/* <Input
  1789. placeholder="请输入申请人"
  1790. ref="signTotalAmount"
  1791. value={data.applicant}
  1792. onChange={e => {
  1793. let data = this.state.data;
  1794. data.applicant = e.target.value;
  1795. this.setState({ data });
  1796. }}
  1797. style={{ width: "240px" }}
  1798. /> */}
  1799. <span>{data.applicant}</span>
  1800. </FormItem>
  1801. </div>
  1802. <div className="clearfix">
  1803. <FormItem
  1804. labelCol={{ span: 4 }}
  1805. wrapperCol={{ span: 18 }}
  1806. label="变更类型"
  1807. >
  1808. <Select
  1809. placeholder="选择合同变更类型"
  1810. style={{ width: 200 }}
  1811. disabled={this.state.changeFlag}
  1812. onChange={(e) => {
  1813. let data = this.state.data;
  1814. data.type = e;
  1815. this.setState({ data, changeFlag: true });
  1816. if (e == 1) {
  1817. this.setState({
  1818. hetongFlag: false,
  1819. listFlag: false,
  1820. listCuiFlag: false,
  1821. tuiKuanFlag: false,
  1822. displayList: false,
  1823. });
  1824. } else if (e == 2) {
  1825. this.setState({
  1826. hetongFlag: true,
  1827. listFlag: false,
  1828. listCuiFlag: false,
  1829. tuiKuanFlag: true,
  1830. displayList: false,
  1831. });
  1832. } else if (e == 3) {
  1833. this.setState({
  1834. listFlag: false,
  1835. hetongFlag: false,
  1836. listCuiFlag: false,
  1837. tuiKuanFlag: false,
  1838. displayList: true,
  1839. });
  1840. } else if (e == 4) {
  1841. this.setState({
  1842. listFlag: false,
  1843. listCuiFlag: false,
  1844. hetongFlag: false,
  1845. tuiKuanFlag: true,
  1846. displayList: false,
  1847. });
  1848. } else if (e == 5) {
  1849. this.setState({
  1850. listFlag: false,
  1851. listCuiFlag: false,
  1852. hetongFlag: true,
  1853. tuiKuanFlag: true,
  1854. displayList: false,
  1855. });
  1856. } else {
  1857. this.setState({
  1858. listFlag: true,
  1859. hetongFlag: true,
  1860. listCuiFlag: true,
  1861. tuiKuanFlag: false,
  1862. displayList: false,
  1863. });
  1864. }
  1865. }}
  1866. value={data.type}
  1867. >
  1868. <Option value={0}>退单退款</Option>
  1869. <Option value={1}>项目及金额变更</Option>
  1870. <Option value={2}>仅项目变更</Option>
  1871. <Option value={3}>仅金额变更</Option>
  1872. <Option value={4}>重报</Option>
  1873. <Option value={5}>赠送</Option>
  1874. </Select>
  1875. <Button
  1876. style={{ marginLeft: 10 }}
  1877. onClick={(e) => {
  1878. this.state.data.startRemarks = "";
  1879. this.state.data.remarks = "";
  1880. this.state.data.changeAmount = "0";
  1881. this.state.data.depNameChange = undefined;
  1882. this.state.data.typeChange = undefined;
  1883. this.state.data.totalAmount = this.state.data.oldPrice;
  1884. this.setState({
  1885. listFlag: false,
  1886. hetongFlag: false,
  1887. listCuiFlag: false,
  1888. tuiKuanFlag: false,
  1889. displayList: false,
  1890. startRemarks: "",
  1891. data: this.state.data,
  1892. changeFlag: false,
  1893. voucherUrl: [],
  1894. // changeAmount: "0",
  1895. // applicant: undefined,
  1896. // depNameChange: undefined,
  1897. // typeChange: [],
  1898. // changeFlag: false
  1899. });
  1900. }}
  1901. >
  1902. 重置
  1903. </Button>
  1904. {this.state.data.status == 3 ? (
  1905. <Button
  1906. type="danger"
  1907. style={{
  1908. float: "right",
  1909. backgroundColor: "red",
  1910. color: "white",
  1911. position: "absolute",
  1912. right: 0,
  1913. height: 50,
  1914. borderRadius: 20,
  1915. }}
  1916. onClick={(e) => {
  1917. e.stopPropagation();
  1918. this.showConfirmChange(this.deleteChange);
  1919. }}
  1920. >
  1921. 取消本次变更
  1922. </Button>
  1923. ) : (
  1924. ""
  1925. )}
  1926. </FormItem>
  1927. </div>
  1928. <div className="clearfix">
  1929. <FormItem
  1930. labelCol={{ span: 4 }}
  1931. wrapperCol={{ span: 18 }}
  1932. label="合同额(万元)"
  1933. >
  1934. <Input
  1935. placeholder="请输入合同额"
  1936. ref="signTotalAmount"
  1937. disabled={this.state.hetongFlag}
  1938. value={data.totalAmount}
  1939. onChange={(e) => {
  1940. let data = this.state.data;
  1941. data.totalAmount = e.target.value;
  1942. this.setState({ data });
  1943. }}
  1944. style={{ width: "240px" }}
  1945. />
  1946. </FormItem>
  1947. <FormItem
  1948. labelCol={{ span: 4 }}
  1949. wrapperCol={{ span: 18 }}
  1950. label="已收款(万元)"
  1951. >
  1952. {/* <Input
  1953. placeholder="请输入已收款"
  1954. ref="signTotalAmount"
  1955. value={data.settlementAmount}
  1956. onChange={e => {
  1957. let data = this.state.data;
  1958. data.settlementAmount = e.target.value;
  1959. this.setState({ data });
  1960. }}
  1961. style={{ width: "240px" }}
  1962. /> */}
  1963. <span>
  1964. {this.state.data.settlementAmount}&nbsp;&nbsp;&nbsp;&nbsp;
  1965. <span style={{ color: "red" }}>
  1966. (注:已收款与现实收款不符,请与财务专员联系)
  1967. </span>
  1968. </span>
  1969. </FormItem>
  1970. <FormItem
  1971. labelCol={{ span: 4 }}
  1972. wrapperCol={{ span: 18 }}
  1973. label="申请退款(万元)"
  1974. >
  1975. <Input
  1976. placeholder="请输入申请退款"
  1977. ref="signTotalAmount"
  1978. disabled={this.state.tuiKuanFlag}
  1979. value={data.changeAmount}
  1980. onChange={(e) => {
  1981. let data = this.state.data;
  1982. data.changeAmount = e.target.value;
  1983. this.setState({ data });
  1984. }}
  1985. style={{ width: "240px" }}
  1986. />
  1987. </FormItem>
  1988. </div>
  1989. <div>
  1990. <div>
  1991. <span
  1992. style={{
  1993. marginLeft: "50px",
  1994. fontSize: "20px",
  1995. }}
  1996. >
  1997. 项目业务
  1998. </span>
  1999. <span style={{ color: "red" }}>
  2000. (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!双击可修改对应金额数量!)
  2001. </span>
  2002. <Button
  2003. type="primary"
  2004. onClick={this.changeAddPro}
  2005. disabled={this.state.listFlag}
  2006. style={{
  2007. float: "right",
  2008. marginRight: "50px",
  2009. marginBottom: "15px",
  2010. display: this.state.displayList ? "none" : "block",
  2011. }}
  2012. >
  2013. 添加项目明细
  2014. </Button>
  2015. </div>
  2016. <div className="patent-table" style={{ marginBottom: 10 }}>
  2017. {/* <Spin spinning={this.state.loading}> */}
  2018. <Table
  2019. columns={this.state.proColumns}
  2020. dataSource={this.state.proDataSource}
  2021. scroll={{ x: "max-content", y: 0 }}
  2022. expandedRowRender={expandedRowRender}
  2023. pagination={false}
  2024. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2025. bordered
  2026. size="small"
  2027. />
  2028. {/* </Spin> */}
  2029. </div>
  2030. <div>
  2031. <span
  2032. style={{
  2033. marginLeft: "50px",
  2034. fontSize: "20px",
  2035. }}
  2036. >
  2037. 催款节点
  2038. </span>
  2039. <span style={{ color: "red" }}>
  2040. (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!双击可修改对应金额!)
  2041. </span>
  2042. <Button
  2043. type="primary"
  2044. onClick={(e) => {
  2045. this.changeAddCui();
  2046. }}
  2047. disabled={this.state.listCuiFlag}
  2048. style={{
  2049. float: "right",
  2050. marginRight: "50px",
  2051. marginBottom: "15px",
  2052. display: this.state.displayList ? "none" : "block",
  2053. }}
  2054. >
  2055. 添加催款节点
  2056. </Button>
  2057. </div>
  2058. <div className="clearfix">
  2059. {/* <Spin spinning={this.state.loading}> */}
  2060. <Form layout="horizontal">
  2061. <Table
  2062. pagination={false}
  2063. columns={this.state.changeCuiList}
  2064. dataSource={this.state.cuiDataSource}
  2065. scroll={{ x: "max-content", y: 0 }}
  2066. onRowDoubleClick={
  2067. this.state.listCuiFlag ? this.not : this.editCui
  2068. }
  2069. bordered
  2070. size="small"
  2071. />
  2072. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2073. </Form>
  2074. {/* </Spin> */}
  2075. </div>
  2076. </div>
  2077. <div className="clearfix">
  2078. <FormItem
  2079. style={{ height: "auto" }}
  2080. labelCol={{ span: 4 }}
  2081. wrapperCol={{ span: 18 }}
  2082. label="变更原因"
  2083. >
  2084. <TextArea
  2085. rows={4}
  2086. placeholder="因企业政府补助费用与营销员签单承诺费用不一"
  2087. ref="signTotalAmount"
  2088. style={{ width: "95%" }}
  2089. value={data.remarks}
  2090. onChange={(e) => {
  2091. let data = this.state.data;
  2092. data.remarks = e.target.value;
  2093. this.setState({ data });
  2094. }}
  2095. />
  2096. </FormItem>
  2097. </div>
  2098. {/* 备注 */}
  2099. <div className="clearfix">
  2100. <FormItem
  2101. style={{ height: "auto" }}
  2102. labelCol={{ span: 4 }}
  2103. wrapperCol={{ span: 18 }}
  2104. label="备注"
  2105. >
  2106. <TextArea
  2107. rows={4}
  2108. placeholder="请输入备注信息"
  2109. ref="signTotalAmount"
  2110. style={{ width: "95%" }}
  2111. value={data.startRemarks}
  2112. onChange={(e) => {
  2113. let data = this.state.data;
  2114. data.startRemarks = e.target.value;
  2115. this.setState({ data });
  2116. }}
  2117. />
  2118. </FormItem>
  2119. </div>
  2120. <div className="clearfix">
  2121. <FormItem
  2122. labelCol={{ span: 4 }}
  2123. wrapperCol={{ span: 18 }}
  2124. label="变更凭证"
  2125. >
  2126. <PicturesWall
  2127. fileList={this.getVoucherUrl}
  2128. pictureUrl={this.state.voucherUrl}
  2129. url="/api/admin/orderChange/uploadFile"
  2130. sign="order_change_file"
  2131. />
  2132. <Rizhi changeId={data.id} />
  2133. <p>图片建议:要清晰。</p>
  2134. </FormItem>
  2135. </div>
  2136. {/* <ul
  2137. style={{
  2138. width: "868px",
  2139. overflow: "hidden",
  2140. paddingLeft: "90px",
  2141. marginBottom: "20px"
  2142. }}
  2143. >
  2144. {this.state.dataSource.map((item, index) => (
  2145. <li
  2146. key={index}
  2147. style={{
  2148. width: "100%",
  2149. height: "auto",
  2150. wordBreak: "break-all",
  2151. color: "black",
  2152. marginBottom: "10px"
  2153. }}
  2154. >{`${item.aname}: ${item.remarks}`}</li>
  2155. ))}
  2156. </ul> */}
  2157. <div className="clearfix">
  2158. <Button
  2159. type="primary"
  2160. style={{ float: "right", marginRight: 40 }}
  2161. onClick={this.changeApply}
  2162. >
  2163. 发起变更申请
  2164. </Button>
  2165. </div>
  2166. <Modal
  2167. title="修改项目金额及数量"
  2168. visible={this.state.editProVisible}
  2169. onOk={this.submitEditPro}
  2170. width={300}
  2171. okText={"保存"}
  2172. onCancel={() => {
  2173. this.setState({
  2174. editProVisible: false,
  2175. });
  2176. }}
  2177. >
  2178. <div className="clearfix">
  2179. <FormItem
  2180. labelCol={{ span: 6 }}
  2181. wrapperCol={{ span: 14 }}
  2182. label="项目金额"
  2183. style={{
  2184. display: this.state.editSplitStatus == 2 ? "none" : "block",
  2185. }}
  2186. >
  2187. <Input
  2188. placeholder="请输入金额"
  2189. rows={4}
  2190. value={this.state.editProMoney}
  2191. onChange={(e) => {
  2192. this.setState({ editProMoney: e.target.value });
  2193. }}
  2194. />
  2195. </FormItem>
  2196. <FormItem
  2197. labelCol={{ span: 6 }}
  2198. wrapperCol={{ span: 14 }}
  2199. label="项目数量"
  2200. >
  2201. <Input
  2202. placeholder="请输入数量"
  2203. rows={4}
  2204. value={this.state.editProCommodityQuantity}
  2205. onChange={(e) => {
  2206. this.setState({ editProCommodityQuantity: e.target.value });
  2207. }}
  2208. />
  2209. </FormItem>
  2210. </div>
  2211. </Modal>
  2212. <Modal
  2213. title="修改催款节点金额"
  2214. visible={this.state.editCuiVisible}
  2215. onOk={this.submitEditCui}
  2216. okText={"保存"}
  2217. width={300}
  2218. onCancel={(e) => {
  2219. this.setState({
  2220. editCuiVisible: false,
  2221. });
  2222. }}
  2223. >
  2224. <div className="clearfix">
  2225. <FormItem
  2226. labelCol={{ span: 6 }}
  2227. wrapperCol={{ span: 14 }}
  2228. label="催款金额"
  2229. >
  2230. <Input
  2231. placeholder="请输入金额"
  2232. rows={4}
  2233. value={this.state.editCuiMoney}
  2234. onChange={(e) => {
  2235. this.setState({ editCuiMoney: e.target.value });
  2236. }}
  2237. />
  2238. </FormItem>
  2239. </div>
  2240. </Modal>
  2241. <Modal
  2242. maskClosable={false}
  2243. visible={this.state.changeVisible}
  2244. onOk={this.nextCancel}
  2245. onCancel={this.nextCancel}
  2246. width="800px"
  2247. title={"添加变更项目"}
  2248. footer=""
  2249. className="admin-desc-content"
  2250. >
  2251. <Form
  2252. layout="horizontal"
  2253. // id="demand-form"
  2254. >
  2255. {/* <Spin spinning={this.state.loading}> */}
  2256. <div className="clearfix">
  2257. <FormItem
  2258. className="half-item"
  2259. {...formItemLayout}
  2260. label="服务名称"
  2261. >
  2262. <AutoComplete
  2263. className="certain-category-search"
  2264. dropdownClassName="certain-category-search-dropdown"
  2265. dropdownMatchSelectWidth={false}
  2266. dropdownStyle={{ width: 200 }}
  2267. style={{ width: "200px" }}
  2268. dataSource={options}
  2269. placeholder="输入服务名称"
  2270. value={this.state.commodityName}
  2271. onChange={this.httpChange}
  2272. filterOption={true}
  2273. onSelect={this.selectAuto}
  2274. >
  2275. <Input />
  2276. </AutoComplete>
  2277. <span className="mandatory">*</span>
  2278. </FormItem>
  2279. <FormItem
  2280. className="half-item"
  2281. {...formItemLayout}
  2282. label="服务数量"
  2283. >
  2284. <Input
  2285. placeholder="请输入服务数量"
  2286. value={this.state.commodityQuantity}
  2287. style={{ width: "200px" }}
  2288. onChange={(e) => {
  2289. this.setState({ commodityQuantity: e.target.value });
  2290. }}
  2291. ref="commodityQuantity"
  2292. />
  2293. <span className="mandatory">*</span>
  2294. </FormItem>
  2295. <FormItem
  2296. className="half-item"
  2297. {...formItemLayout}
  2298. label="实签价格(万元)"
  2299. >
  2300. <Input
  2301. placeholder="请输入实签价格"
  2302. value={this.state.commodityPrice}
  2303. style={{ width: "200px" }}
  2304. onChange={(e) => {
  2305. this.setState({ commodityPrice: e.target.value });
  2306. }}
  2307. ref="commodityPrice"
  2308. />
  2309. <span className="mandatory">*</span>
  2310. </FormItem>
  2311. <FormItem
  2312. className="half-item"
  2313. {...formItemLayout}
  2314. label="主要业务"
  2315. >
  2316. <Select
  2317. placeholder="选择是否为主要业务"
  2318. style={{ width: "200px" }}
  2319. value={this.state.main}
  2320. onChange={(e) => {
  2321. this.setState({ main: e });
  2322. }}
  2323. >
  2324. {boutique.map(function (item) {
  2325. return (
  2326. <Select.Option key={item.value}>
  2327. {item.key}
  2328. </Select.Option>
  2329. );
  2330. })}
  2331. </Select>
  2332. <span className="mandatory">*</span>
  2333. </FormItem>
  2334. <div className="clearfix">
  2335. <FormItem
  2336. labelCol={{ span: 4 }}
  2337. wrapperCol={{ span: 16 }}
  2338. label="服务说明"
  2339. >
  2340. <Input
  2341. type="textarea"
  2342. placeholder="请输入服务说明"
  2343. value={this.state.taskComment}
  2344. onChange={(e) => {
  2345. this.setState({ taskComment: e.target.value });
  2346. }}
  2347. />
  2348. </FormItem>
  2349. </div>
  2350. <FormItem
  2351. wrapperCol={{ span: 12, offset: 4 }}
  2352. className="half-middle"
  2353. >
  2354. <Button
  2355. className="submitSave"
  2356. type="primary"
  2357. onClick={this.changeProSubmit}
  2358. >
  2359. 保存
  2360. </Button>
  2361. <Button
  2362. className="submitSave"
  2363. type="ghost"
  2364. onClick={this.nextCancel}
  2365. >
  2366. 取消
  2367. </Button>
  2368. </FormItem>
  2369. </div>
  2370. {/* </Spin> */}
  2371. </Form>
  2372. </Modal>
  2373. </Spin>
  2374. </div>
  2375. );
  2376. }
  2377. }
  2378. export default ChangeApply;