changeApply.js 71 KB

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