addorders.js 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952
  1. import React from "react";
  2. import {
  3. Table,
  4. Modal,
  5. message,
  6. Spin,
  7. Input,
  8. Select,
  9. Button,
  10. Form,
  11. Upload,
  12. Popconfirm,
  13. AutoComplete,
  14. DatePicker,
  15. Col,
  16. Tag
  17. } from "antd";
  18. import $ from "jquery/src/ajax";
  19. import "../userMangagement.less";
  20. import moment from "moment";
  21. import { cuiJieDian } from "@/dataDic.js";
  22. import Picture from "@/manageCenter/publicComponent/picture";
  23. import { jiedian, tepi, boutique } from "../../../dataDic.js";
  24. import {
  25. splitUrl,
  26. getProcessStatus,
  27. getLiquidationStatus,
  28. getboutique,
  29. getApprovedState,
  30. getjiedian,
  31. getCuikuan,
  32. getProjectStatus, getProjectName
  33. } from "../../../tools.js";
  34. import PicturesWall from "./changeComponent/picturesWall.js";
  35. import ResolutionDetail from "@/resolutionDetail";
  36. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  37. import ProjectOperation from "../../../common/projectOperation";
  38. const Addorders = Form.create()(
  39. React.createClass({
  40. //查看项目列表
  41. loadData(orderNo) {
  42. this.state.data = [];
  43. this.setState({
  44. loading: true,
  45. });
  46. $.ajax({
  47. method: "get",
  48. dataType: "json",
  49. crossDomain: false,
  50. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  51. data: {
  52. orderNo: orderNo,
  53. },
  54. success: function (data) {
  55. let theArr = [];
  56. if (!data.data) {
  57. if (data.error && data.error.length) {
  58. message.warning(data.error[0].message);
  59. }
  60. } else {
  61. for (let i = 0; i < data.data.length; i++) {
  62. let thisdata = data.data[i];
  63. thisdata.key = i;
  64. thisdata.sort = thisdata.cSort;
  65. theArr.push(thisdata);
  66. }
  67. }
  68. this.departmentList();
  69. this.setState({
  70. dataSource: theArr,
  71. pagination: false,
  72. });
  73. }.bind(this),
  74. }).always(
  75. function () {
  76. this.setState({
  77. loading: false,
  78. });
  79. }.bind(this)
  80. );
  81. },
  82. //收款节点
  83. loadDatas(orderNo) {
  84. this.state.data = [];
  85. this.setState({
  86. loading: true,
  87. });
  88. $.ajax({
  89. method: "get",
  90. dataType: "json",
  91. crossDomain: false,
  92. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  93. data: {
  94. orderNo: orderNo,
  95. },
  96. success: function (data) {
  97. let theArr = [];
  98. if (!data.data) {
  99. if (data.error && data.error.length) {
  100. message.warning(data.error[0].message);
  101. }
  102. } else {
  103. for (let i = 0; i < data.data.length; i++) {
  104. let thisdata = data.data[i];
  105. theArr.push({
  106. key: i,
  107. id: thisdata.id,
  108. });
  109. }
  110. }
  111. this.setState({
  112. dataSource: theArr,
  113. pagination: false,
  114. });
  115. }.bind(this),
  116. }).always(
  117. function () {
  118. this.setState({
  119. loading: false,
  120. });
  121. }.bind(this)
  122. );
  123. },
  124. getInitialState() {
  125. return {
  126. rotateDeg: 0,
  127. loading: false,
  128. visible: false,
  129. resVisible: false,
  130. orgCodeUrl: [],
  131. replenishUrl: [],
  132. voucherUrl: [],
  133. customerArr: [],
  134. mark: false,
  135. activeKey: "1",
  136. buttonStatus: true,
  137. typeChange: 0,
  138. bussStats: false,
  139. checkedKeys: [],
  140. lookflowList: [],
  141. contractUrl: [],
  142. applicationUrl: [],
  143. active: {
  144. applySign: false,
  145. },
  146. lookState: false,
  147. signBillVisible: false,
  148. commod: "",
  149. columns: [
  150. {
  151. title: "业务项目名称",
  152. dataIndex: "commodityName",
  153. key: "commodityName",
  154. },
  155. {
  156. title: "项目类别",
  157. dataIndex: "cname",
  158. key: "cname",
  159. },
  160. {
  161. title: "项目数量",
  162. dataIndex: "commodityQuantity",
  163. key: "commodityQuantity",
  164. render: (text, record) => {
  165. if (record.splitStatus == 1) {
  166. return (
  167. <span>
  168. {text}{" "}
  169. <Tag
  170. color="#108ee9"
  171. onClick={(e) => {
  172. e.stopPropagation();
  173. this.showRes(record);
  174. }}
  175. >
  176. 已拆
  177. </Tag>
  178. </span>
  179. );
  180. } else {
  181. return text;
  182. }
  183. },
  184. },
  185. {
  186. title: "金额(万元)",
  187. dataIndex: "commodityPrice",
  188. key: "commodityPrice",
  189. },
  190. {
  191. title: "负责人",
  192. dataIndex: "contacts",
  193. key: "contacts",
  194. },
  195. {
  196. title: "负责人电话",
  197. dataIndex: "contactsMobile",
  198. key: "contactsMobile",
  199. },
  200. {
  201. title: "项目状态",
  202. dataIndex: "projectStatus",
  203. key: "projectStatus",
  204. render: (text) => {
  205. return getProjectName(text);
  206. },
  207. },
  208. {
  209. title: "主要项目",
  210. dataIndex: "main",
  211. key: "main",
  212. render: (text) => {
  213. return text ? "是" : "否";
  214. },
  215. },
  216. {
  217. title: "项目说明",
  218. dataIndex: "taskComment",
  219. key: "taskComment",
  220. render: (text) => {
  221. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  222. },
  223. },
  224. {
  225. title: "操作",
  226. dataIndex: "ABC",
  227. key: "ABC",
  228. render: (_text, record) => {
  229. return (
  230. <div>
  231. {this.state.processStatus == 0 ? (
  232. <Popconfirm
  233. title="是否删除?"
  234. onConfirm={() => {
  235. this.delectRow(record);
  236. }}
  237. okText="是"
  238. cancelText="否"
  239. >
  240. <Button
  241. onClick={(e) => {
  242. e.stopPropagation();
  243. }}
  244. type="danger"
  245. >
  246. 删除
  247. </Button>
  248. </Popconfirm>
  249. ) : (
  250. ""
  251. )}
  252. </div>
  253. );
  254. },
  255. },
  256. ],
  257. columnsrizhi: [
  258. {
  259. title: "流程",
  260. dataIndex: "processName",
  261. key: "processName",
  262. },
  263. {
  264. title: "操作人",
  265. dataIndex: "adminName",
  266. key: "adminName",
  267. },
  268. {
  269. title: "时间",
  270. dataIndex: "createDate",
  271. key: "createDate",
  272. },
  273. ],
  274. contactList: [],
  275. loading: false,
  276. ContactsLists: [
  277. {
  278. title: "催款科目",
  279. dataIndex: "dunSubject",
  280. key: "dunSubject",
  281. render: (text, record) => {
  282. return (
  283. <Select
  284. placeholder="请选择催款科目"
  285. value={record.dunSubject}
  286. style={{ width: "150px" }}
  287. disabled
  288. onChange={(e) => {
  289. record.dunSubject = e;
  290. this.setState({ contactList: this.state.contactList });
  291. }}
  292. >
  293. {jiedian.map(function (item) {
  294. return (
  295. <Select.Option key={item.value}>{item.key}</Select.Option>
  296. );
  297. })}
  298. </Select>
  299. );
  300. },
  301. },
  302. {
  303. title: "金额(万元)",
  304. dataIndex: "money",
  305. key: "money",
  306. render: (text, record) => {
  307. return (
  308. <Input
  309. value={record.money}
  310. placeholder="请输入金额(必填项)"
  311. disabled
  312. key={record.id}
  313. required="required"
  314. onChange={(e) => {
  315. record.money = e.target.value;
  316. this.setState({ contactList: this.state.contactList });
  317. }}
  318. style={{ width: "120px" }}
  319. />
  320. );
  321. },
  322. },
  323. {
  324. title: "催款状态",
  325. dataIndex: "dunStatus",
  326. key: "dunStatus",
  327. render: (text) => {
  328. return getCuikuan(text);
  329. },
  330. },
  331. {
  332. title: "操作",
  333. dataIndex: "dels",
  334. key: "dels",
  335. render: (text, record) => {
  336. return (
  337. <div>
  338. {
  339. <Popconfirm
  340. title="是否删除?"
  341. onConfirm={() => {
  342. this.confirmDelet(record.key);
  343. }}
  344. okText="删除"
  345. cancelText="不删除"
  346. >
  347. <Button
  348. style={{
  349. marginRight: "10px",
  350. color: "#ffffff",
  351. background: "#f00",
  352. border: "none",
  353. display:
  354. this.state.processStatus == 0 ? "block" : "none",
  355. }}
  356. >
  357. 删除
  358. </Button>
  359. </Popconfirm>
  360. }
  361. {record.id ? (
  362. ""
  363. ) : (
  364. <Button type="primary" onClick={this.contactSave}>
  365. 保存
  366. </Button>
  367. )}
  368. </div>
  369. );
  370. },
  371. },
  372. ],
  373. ContactsListsNew: [
  374. {
  375. title: "项目名称",
  376. dataIndex: "commodityName",
  377. key: "commodityName",
  378. render: (text, record, index) => {
  379. let dataArr = this.state.dataSource || [];
  380. if (text) {
  381. return <span>{text}</span>;
  382. }
  383. return (
  384. <Select
  385. placeholder="请选择名称"
  386. style={{ width: "150px" }}
  387. disabled={
  388. this.state.getLoad && record.sortName ? true : false
  389. }
  390. onChange={(e) => {
  391. record.sortName = e;
  392. dataArr.forEach((item) => {
  393. if (item.commodityName == record.sortName) {
  394. record.cname = item.cname;
  395. record.tid = item.id;
  396. record.isSave = true;
  397. record.sort = item.sort;
  398. cuiJieDian.forEach((item) => {
  399. if (item.value == record.sort) {
  400. record.arr = item.children;
  401. let yearFlag = true;
  402. if (record.sort == 6) {
  403. yearFlag = false;
  404. }
  405. this.setState({
  406. getLoad: true,
  407. yearFlag,
  408. });
  409. }
  410. });
  411. }
  412. });
  413. }}
  414. >
  415. {dataArr.map((item) => {
  416. return (
  417. <Select.Option key={item.id} value={item.commodityName}>
  418. {item.commodityName}
  419. </Select.Option>
  420. );
  421. })}
  422. </Select>
  423. );
  424. },
  425. },
  426. {
  427. title: "项目分类",
  428. dataIndex: "projectType",
  429. key: "projectType",
  430. render: (text, record) => {
  431. if (text) {
  432. let arr = this.state.dataSource || [];
  433. let str = "";
  434. for (let i = 0; i < arr.length; i++) {
  435. if (this.state.dataSource[i].sort == text) {
  436. str = this.state.dataSource[i].cname;
  437. return <span>{str}</span>;
  438. }
  439. }
  440. }
  441. if (this.state.getLoad) {
  442. return (
  443. <Select
  444. style={{ width: "150px" }}
  445. placeholder="请选择分类"
  446. value={record.cname}
  447. >
  448. <Select.Option key={record.sort} value={record.cname}>
  449. {record.cname}
  450. </Select.Option>
  451. </Select>
  452. );
  453. } else {
  454. return (
  455. <Select style={{ width: "150px" }} placeholder="请选择分类">
  456. <Select.Option key={record.sort} value={record.cname}>
  457. {record.cname}
  458. </Select.Option>
  459. </Select>
  460. );
  461. }
  462. },
  463. },
  464. {
  465. title: "催款科目",
  466. dataIndex: "dunTypeName",
  467. key: "dunTypeName",
  468. render: (text, record) => {
  469. if (text) {
  470. if (record.customizeName) {
  471. return text + record.customizeName;
  472. }
  473. return <span>{text}</span>;
  474. }
  475. if (this.state.getLoad) {
  476. let arr = record.arr || [];
  477. return (
  478. <div>
  479. <Select
  480. style={{ width: "150px", marginRight: 5 }}
  481. placeholder="请选择分类"
  482. onChange={(e) => {
  483. record.dunType = e;
  484. if (record.dunType == 0) {
  485. record.customizeTimes = "";
  486. record.customizeName = "";
  487. }
  488. if (e != 1) {
  489. this.setState({
  490. timeFlag: true,
  491. });
  492. } else {
  493. this.setState({
  494. timeFlag: false,
  495. });
  496. }
  497. if (e == 1 && record.sort == 6) {
  498. this.setState({
  499. yearFlag: true,
  500. });
  501. } else if (e != 1 && record.sort == 6) {
  502. this.setState({
  503. yearFlag: false,
  504. });
  505. }
  506. if (record.sort == 3 && e == 3) {
  507. this.setState({
  508. boFlag: true,
  509. });
  510. } else {
  511. this.setState({
  512. boFlag: false,
  513. });
  514. }
  515. }}
  516. >
  517. {arr.map((item) => {
  518. record;
  519. return (
  520. <Select.Option key={item.value} value={item.value}>
  521. {item.key}
  522. </Select.Option>
  523. );
  524. })}
  525. <Select.Option key={0} value={0}>
  526. 自定义
  527. </Select.Option>
  528. </Select>
  529. {record.dunType == 0 ? (
  530. <Input
  531. value={record.customizeName}
  532. placeholder="请输入自定义名称"
  533. required="required"
  534. onChange={(e) => {
  535. record.customizeName = e.target.value;
  536. this.setState({
  537. contactList: this.state.contactList,
  538. });
  539. }}
  540. style={{ width: "120px" }}
  541. />
  542. ) : (
  543. ""
  544. )}
  545. </div>
  546. );
  547. } else {
  548. return (
  549. <Select style={{ width: "150px" }} placeholder="请选择分类">
  550. <Select.Option
  551. key={0}
  552. value={"请选择上一项"}
  553. ></Select.Option>
  554. </Select>
  555. );
  556. }
  557. },
  558. },
  559. {
  560. title: "收款时间(特批需选择时间)",
  561. dataIndex: "waitDay",
  562. key: "waitDay",
  563. render: (text, record) => {
  564. if (record.dunTypeName) {
  565. if (record.customizeTimes) {
  566. return record.customizeTimes;
  567. }
  568. if (text == 0) {
  569. var str = "当天";
  570. } else if (!text) {
  571. var str = "";
  572. } else {
  573. var str = text + "天";
  574. }
  575. return <span>{str}</span>;
  576. }
  577. return (
  578. <div>
  579. {record.dunType == 0 ? (
  580. <DatePicker
  581. style={{ width: 150 }}
  582. disabledDate={(e) => {
  583. let time = moment(e).valueOf();
  584. let today = Date.parse(new Date());
  585. if (time <= today) {
  586. return true;
  587. }
  588. }}
  589. onChange={(e, t) => {
  590. record.customizeTimes = t;
  591. }}
  592. />
  593. ) : (
  594. <Select
  595. placeholder="请选择时间"
  596. style={{ width: "160px" }}
  597. disabled={
  598. this.state.approval != 0 && !this.state.timeFlag
  599. ? false
  600. : true
  601. }
  602. onChange={(e) => {
  603. record.waitDay = e;
  604. }}
  605. >
  606. <Select.Option key={0}>当天</Select.Option>
  607. <Select.Option key={3}>3天</Select.Option>
  608. <Select.Option key={5}>5天</Select.Option>
  609. <Select.Option key={7}>7天</Select.Option>
  610. <Select.Option key={15}>15天</Select.Option>
  611. </Select>
  612. )}
  613. </div>
  614. );
  615. },
  616. },
  617. {
  618. title: "金额(万元)",
  619. dataIndex: "money",
  620. key: "money",
  621. render: (text, record) => {
  622. if (record.dunTypeName) {
  623. if (record.appropriationRatio) {
  624. return <span>{record.appropriationRatio}(拨款比例)</span>;
  625. } else {
  626. return <span>{text}</span>;
  627. }
  628. }
  629. if (this.state.boFlag) {
  630. return (
  631. <div>
  632. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  633. <Select
  634. placeholder="选择"
  635. defaultValue={"金额"}
  636. onChange={(e) => {
  637. record.boStatus = e;
  638. }}
  639. >
  640. <Select.Option key={true}>比例</Select.Option>
  641. <Select.Option key={false}>金额</Select.Option>
  642. </Select>
  643. </div>
  644. <div style={{ float: "right" }}>
  645. <Input
  646. value={record.money}
  647. key={record.id}
  648. required="required"
  649. onChange={(e) => {
  650. record.money = e.target.value;
  651. this.setState({
  652. contactList: this.state.contactList,
  653. });
  654. }}
  655. style={{ width: "120px" }}
  656. />
  657. </div>
  658. </div>
  659. );
  660. } else {
  661. return (
  662. <div>
  663. <Input
  664. value={record.money}
  665. placeholder="请输入金额(必填项)"
  666. key={record.id}
  667. required="required"
  668. onChange={(e) => {
  669. record.money = e.target.value;
  670. this.setState({ contactList: this.state.contactList });
  671. }}
  672. style={{ width: "120px" }}
  673. />
  674. </div>
  675. );
  676. }
  677. },
  678. },
  679. {
  680. title: "服务年限",
  681. dataIndex: "startDate",
  682. key: "startDate",
  683. render: (text, record) => {
  684. if (record.dunTypeName) {
  685. return <span>{text}</span>;
  686. }
  687. return (
  688. <Select
  689. placeholder="请选择年限"
  690. style={{ width: "150px" }}
  691. disabled={this.state.yearFlag ? true : false}
  692. onChange={(e) => {
  693. record.effectiveCount = e;
  694. }}
  695. >
  696. {/* <Select.Option key={null}>无</Select.Option> */}
  697. <Select.Option key={1}>一年</Select.Option>
  698. <Select.Option key={3}>两年</Select.Option>
  699. <Select.Option key={5}>三年</Select.Option>
  700. <Select.Option key={7}>四年</Select.Option>
  701. <Select.Option key={9}>五年</Select.Option>
  702. </Select>
  703. );
  704. },
  705. },
  706. {
  707. title: "催款状态",
  708. dataIndex: "status",
  709. key: "status",
  710. render: (text) => {
  711. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  712. },
  713. },
  714. {
  715. title: "操作",
  716. dataIndex: "dels",
  717. key: "dels",
  718. render: (text, record, index) => {
  719. return (
  720. <div>
  721. {this.state.processStatus == 0 ? (
  722. <Popconfirm
  723. title="是否删除?"
  724. onConfirm={() => {
  725. this.confirmDeletNew(record);
  726. }}
  727. okText="删除"
  728. cancelText="不删除"
  729. >
  730. <Button
  731. style={{
  732. marginRight: "10px",
  733. color: "#ffffff",
  734. background: "#f00",
  735. border: "none",
  736. }}
  737. >
  738. 删除
  739. </Button>
  740. </Popconfirm>
  741. ) : (
  742. ""
  743. )}
  744. {record.isSave ? (
  745. <Button
  746. type="primary"
  747. onClick={(e) => {
  748. this.contactSaveNew(record);
  749. }}
  750. >
  751. 保存
  752. </Button>
  753. ) : (
  754. ""
  755. )}
  756. </div>
  757. );
  758. },
  759. },
  760. ],
  761. };
  762. },
  763. departmentList() {
  764. this.setState({
  765. loading: true,
  766. });
  767. $.ajax({
  768. method: "get",
  769. dataType: "json",
  770. crossDomain: false,
  771. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  772. data: {},
  773. success: function (data) {
  774. let thedata = data.data;
  775. let theArr = [];
  776. if (!thedata) {
  777. if (data.error && data.error.length) {
  778. message.warning(data.error[0].message);
  779. }
  780. thedata = {};
  781. } else {
  782. thedata.map(function (item, index) {
  783. theArr.push({
  784. key: index,
  785. name: item.name,
  786. id: item.id,
  787. depNo: item.depNo,
  788. });
  789. });
  790. }
  791. this.setState({
  792. departmentArr: theArr,
  793. });
  794. }.bind(this),
  795. }).always(
  796. function () {
  797. this.setState({
  798. loading: false,
  799. });
  800. }.bind(this)
  801. );
  802. },
  803. // 拆分详细
  804. showRes(record) {
  805. this.setState({
  806. resVisible: true,
  807. resRecord: record,
  808. });
  809. },
  810. resCancel() {
  811. this.setState({
  812. resVisible: false,
  813. });
  814. },
  815. //新建订单、编辑订单保存
  816. handleSubmit() {
  817. let theorgCodeUrl = [];
  818. if (this.state.orgCodeUrl.length) {
  819. let picArr = [];
  820. this.state.orgCodeUrl.map(function (item) {
  821. if (
  822. item.response &&
  823. item.response.data &&
  824. item.response.data.length
  825. ) {
  826. picArr.push(item.response.data);
  827. }
  828. });
  829. theorgCodeUrl = picArr.join(",");
  830. }
  831. let theReplenishUrl = [];
  832. if (this.state.replenishUrl.length) {
  833. let picArr = [];
  834. this.state.replenishUrl.map(function (item) {
  835. if (
  836. item.response &&
  837. item.response.data &&
  838. item.response.data.length
  839. ) {
  840. picArr.push(item.response.data);
  841. }
  842. });
  843. theReplenishUrl = picArr.join(",");
  844. }
  845. if (this.props.data) {
  846. if (!theorgCodeUrl) {
  847. message.warning("图片过大,上传失败");
  848. return false;
  849. }
  850. if (!this.state.signDate) {
  851. message.warning("签单日期不能为空");
  852. return false;
  853. }
  854. if (!this.state.orderRemarks) {
  855. message.warning("订单留言不能为空");
  856. return false;
  857. }
  858. } else {
  859. }
  860. const arr = this.state.contactListNew || [];
  861. for (let i = 0; i < arr.length; i++) {
  862. if (
  863. arr[i].dunType == 1 &&
  864. arr[i].waitDay != null &&
  865. this.state.approval == 0
  866. ) {
  867. message.warning(
  868. "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
  869. );
  870. return false;
  871. } else if (
  872. arr[i].dunType == 1 &&
  873. arr[i].waitDay == null &&
  874. this.state.approval == 1
  875. ) {
  876. message.warning(
  877. "特批存在首付催款节点未填写时间的情况,请删除后重新填写保存"
  878. );
  879. return false;
  880. }
  881. if (!this.state.contactListNew[i].id && this.props.userDetaile) {
  882. message.warning("请保存催款节点");
  883. return false;
  884. }
  885. }
  886. this.setState({
  887. loading: true,
  888. });
  889. let api = "/api/admin/newOrder/updateServiceOrderNew";
  890. $.ajax({
  891. method: "POST",
  892. dataType: "json",
  893. crossDomain: false,
  894. url: globalConfig.context + api,
  895. data: {
  896. orderNo: this.state.orderNo, //订单编号
  897. totalAmount: this.state.totalAmount, //总金额
  898. firstAmount: this.state.firstAmount, //首付
  899. isSubmit: this.state.isSubmit, //保存草稿还是提交
  900. signDate: this.state.signDate, //签单日期
  901. contacts: this.state.contacts, //企业负责人
  902. contactMobile: this.state.contactMobile, //负责人联系方式
  903. legalPerson: this.state.legalPerson, //企业法人
  904. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  905. approval: this.state.approval, //特批状态
  906. orderRemarks: this.state.orderRemarks, //订单备注
  907. contractPictureUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  908. agreementUrl: theReplenishUrl.length ? theReplenishUrl : "",
  909. orderDep: this.state.organizationSearch,
  910. deleteSign: this.props.deleteSign === 3 ? 0 : undefined,
  911. },
  912. }).done(
  913. function (data) {
  914. this.setState({
  915. loading: false,
  916. });
  917. if (!data.error.length) {
  918. message.success("保存成功!");
  919. this.handleOk();
  920. if (this.state.autoId) {
  921. this.loadData(this.props.data);
  922. }
  923. } else {
  924. message.warning(data.error[0].message);
  925. }
  926. }.bind(this)
  927. );
  928. },
  929. //订单详情修改
  930. xiangqingClick(e) {
  931. e.preventDefault();
  932. this.setState({
  933. loading: true,
  934. });
  935. $.ajax({
  936. url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
  937. method: "post",
  938. data: {
  939. orderNo: this.state.orderNo, //订单编号
  940. totalAmount: this.state.totalAmount, //总金额
  941. firstAmount: this.state.firstAmount, //首付
  942. isSubmit: this.state.isSubmit, //保存草稿还是提交
  943. signDate: this.state.selTime, //签单日期
  944. contacts: this.state.contacts, //企业负责人
  945. contactMobile: this.state.contactMobile, //负责人联系方式
  946. legalPerson: this.state.legalPerson, //企业法人
  947. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  948. approval: this.state.approval, //特批状态
  949. orderRemarks: this.state.orderRemarks, //订单备注
  950. },
  951. }).done(
  952. function (data) {
  953. this.setState({
  954. loading: false,
  955. });
  956. if (!data.error.length) {
  957. message.success("保存成功!");
  958. this.loaduser(this.props.data);
  959. } else {
  960. message.warning(data.error[0].message);
  961. }
  962. }.bind(this)
  963. );
  964. },
  965. //查看基本详情基本信息
  966. loaduser(orderNo) {
  967. this.state.orderList = [];
  968. $.ajax({
  969. method: "get",
  970. dataType: "json",
  971. crossDomain: false,
  972. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  973. data: {
  974. orderNo: orderNo,
  975. },
  976. success: function (data) {
  977. let thisData = data.data;
  978. if (!thisData) {
  979. if (data.error && data.error.length) {
  980. message.warning(data.error[0].message);
  981. }
  982. thisData = {};
  983. }
  984. // this.props.getPrimaryOrder(thisData.primaryOrder);
  985. // this.props.getAdditionalOrder(thisData.additionalOrder);
  986. this.setState({
  987. id: thisData.id,
  988. kehuId: thisData.buyerId,
  989. orderNo: thisData.orderNo, //订单编号
  990. orderType: thisData.orderType, //订单类型
  991. firstAmount: thisData.firstAmount, //首付金额
  992. totalAmount: thisData.totalAmount, //总金额
  993. settlementAmount: thisData.settlementAmount, //结算金额
  994. liquidationStatus: thisData.liquidationStatus, //清算状态
  995. processStatus: thisData.processStatus, //流程状态
  996. approval: thisData.approval.toString(), //特批状态
  997. orderRemarks: thisData.orderRemarks, //订单备注
  998. contractNo: thisData.contractNo, //合同编号
  999. contacts: thisData.contacts, //联系人
  1000. contactMobile: thisData.contactMobile, //联系人电话
  1001. legalPerson: thisData.legalPerson, //法人
  1002. legalPersonTel: thisData.legalPersonTel, //法人电话
  1003. contractNo: thisData.contractNo, //合同编号
  1004. orgCodeUrl: thisData.contractPictureUrl
  1005. ? splitUrl(
  1006. thisData.contractPictureUrl,
  1007. ",",
  1008. globalConfig.avatarHost + "/upload"
  1009. )
  1010. : [], //图片地址
  1011. replenishUrl: thisData.agreementUrl
  1012. ? splitUrl(
  1013. thisData.agreementUrl,
  1014. ",",
  1015. globalConfig.avatarHost + "/upload"
  1016. )
  1017. : [],
  1018. signDate: thisData.signDate, //签单时间
  1019. userName: thisData.userName, //客户名称
  1020. salesmanName: thisData.salesmanName, //营销员名称
  1021. salesmanMobile: thisData.salesmanMobile, //营销员电话
  1022. oldSalesmanName: thisData.oldSalesmanName, //营销员名称
  1023. oldSalesmanMobile: thisData.oldSalesmanMobile, //营销员电话
  1024. financeName: thisData.financeName, //财务名称
  1025. financeMobile: thisData.financeMobile, //财务电话
  1026. nowFinance: thisData.nowFinance,
  1027. nowFinanceMobile: thisData.nowFinanceMobile,
  1028. contractNo: thisData.contractNo, //合同编号
  1029. approval:
  1030. thisData.approval == 0
  1031. ? thisData.approval.toString()
  1032. : thisData.approval,
  1033. organizationSearch: thisData.orderDep,
  1034. depName: thisData.depName,
  1035. });
  1036. }.bind(this),
  1037. }).always(
  1038. function () {
  1039. this.setState({
  1040. loading: false,
  1041. });
  1042. }.bind(this)
  1043. );
  1044. },
  1045. //查看催款节点
  1046. jiedian(orderNos) {
  1047. $.ajax({
  1048. method: "get",
  1049. dataType: "json",
  1050. crossDomain: false,
  1051. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  1052. data: {
  1053. orderNo: orderNos,
  1054. },
  1055. success: function (data) {
  1056. let theArr = [];
  1057. let thisData = [];
  1058. if (data.error.length || data.data.list == "") {
  1059. if (data.error && data.error.length) {
  1060. message.warning(data.error[0].message);
  1061. }
  1062. } else {
  1063. for (let i = 0; i < data.data.length; i++) {
  1064. thisData = data.data[i];
  1065. theArr.push({
  1066. key: i,
  1067. dunSubject: thisData.dunSubject
  1068. ? thisData.dunSubject.toString()
  1069. : "", //催款科目
  1070. id: thisData.id, //节点Id
  1071. money: thisData.money, //催款金额
  1072. dunStatus: thisData.dunStatus, //催款状态
  1073. orderNo: thisData.orderNo,
  1074. });
  1075. }
  1076. this.setState({
  1077. contactList: theArr,
  1078. });
  1079. }
  1080. }.bind(this),
  1081. }).always(
  1082. function () {
  1083. this.setState({
  1084. loading: false,
  1085. });
  1086. }.bind(this)
  1087. );
  1088. },
  1089. //查看催款节点
  1090. jiedianNew(orderNos) {
  1091. $.ajax({
  1092. method: "get",
  1093. dataType: "json",
  1094. crossDomain: false,
  1095. url:
  1096. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1097. data: {
  1098. orderNo: orderNos,
  1099. },
  1100. success: function (data) {
  1101. if (data.error && data.error.length) {
  1102. message.warning(data.error[0].message);
  1103. } else {
  1104. let theArr = [];
  1105. let thisData = [];
  1106. let arr = data.data || [];
  1107. let totalCui = 0;
  1108. for (let i = 0; i < arr.length; i++) {
  1109. thisData = arr[i];
  1110. totalCui += +thisData.money;
  1111. theArr.push({
  1112. key: i,
  1113. dunSubject: thisData.dunSubject
  1114. ? thisData.dunSubject.toString()
  1115. : "", //催款科目
  1116. id: thisData.id, //节点Id
  1117. money: thisData.money, //催款金额
  1118. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1119. commodityName: thisData.commodityName,
  1120. projectType: thisData.projectType,
  1121. dunTypeName: thisData.dunTypeName,
  1122. status: thisData.status,
  1123. waitDay: thisData.waitDay,
  1124. effectiveCount: thisData.effectiveCount,
  1125. startDate: thisData.startDate,
  1126. dunType: thisData.dunType,
  1127. appropriationRatio: thisData.appropriationRatio,
  1128. customizeName: thisData.customizeName,
  1129. customizeTimes: thisData.customizeTimes,
  1130. });
  1131. }
  1132. if (!totalCui) {
  1133. totalCui = 0;
  1134. }
  1135. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  1136. this.setState({
  1137. contactListNew: theArr,
  1138. totalCui:parseFloat(totalCui),
  1139. });
  1140. }
  1141. }.bind(this),
  1142. }).always(
  1143. function () {
  1144. this.setState({
  1145. loading: false,
  1146. });
  1147. }.bind(this)
  1148. );
  1149. },
  1150. //催款节点保存
  1151. contactSave(record) {
  1152. for (let i = 0; i < this.state.contactList.length; i++) {
  1153. if (moneyVerify(this.state.contactList[i].money)) {
  1154. return;
  1155. }
  1156. }
  1157. this.setState({
  1158. loading: true,
  1159. });
  1160. $.ajax({
  1161. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1162. method: "post",
  1163. data: {
  1164. orderNo: this.state.orderNo,
  1165. orderDun: JSON.stringify(this.state.contactList),
  1166. },
  1167. }).done(
  1168. function (data) {
  1169. this.setState({
  1170. loading: false,
  1171. });
  1172. if (!data.error.length) {
  1173. message.success("保存成功!");
  1174. this.jiedian(record.orderNo);
  1175. } else {
  1176. message.warning(data.error[0].message);
  1177. }
  1178. }.bind(this)
  1179. );
  1180. },
  1181. //催款节点保存
  1182. contactSaveNew(record) {
  1183. if (record.dunType == 0) {
  1184. if (!record.customizeTimes) {
  1185. message.warning("请输入自定义时间");
  1186. return;
  1187. } else if (!record.customizeName) {
  1188. message.warning("请输入自定义科目");
  1189. return;
  1190. }
  1191. }
  1192. if (record.boStatus == "false") {
  1193. record.boStatus = false;
  1194. } else if (record.boStatus == "true") {
  1195. record.boStatus = true;
  1196. }
  1197. if (!this.state.yearFlag) {
  1198. if (!record.effectiveCount) {
  1199. message.warning("请选择服务年限");
  1200. return;
  1201. }
  1202. } else {
  1203. record.effectiveCount = "";
  1204. }
  1205. if (record.money == "") {
  1206. message.warning("请填写金额");
  1207. return;
  1208. }
  1209. if (record.boStatus) {
  1210. if (
  1211. typeof +record.money == "number" &&
  1212. +record.money >= 0 &&
  1213. +record.money <= 1
  1214. ) {
  1215. record.appropriationRatio = record.money;
  1216. } else {
  1217. message.warning("金额比例填写错误,比例范围0~1");
  1218. return;
  1219. }
  1220. }
  1221. if (!record.dunType && record.dunType != 0) {
  1222. message.warning("请选择对应科目");
  1223. return;
  1224. }
  1225. if (record.dunType != 1) {
  1226. record.waitDay = "";
  1227. }
  1228. this.setState({
  1229. loading: true,
  1230. });
  1231. if (record.boStatus) {
  1232. $.ajax({
  1233. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1234. method: "post",
  1235. data: {
  1236. orderNo: record.orderNo,
  1237. tid: record.tid,
  1238. projectType: record.sort,
  1239. dunType: record.dunType,
  1240. appropriationRatio: record.appropriationRatio,
  1241. waitDay: record.waitDay,
  1242. effectiveCount: record.effectiveCount,
  1243. customizeTimes:
  1244. record.dunType == 0 ? record.customizeTimes : undefined,
  1245. customizeName:
  1246. record.dunType == 0 ? record.customizeName : undefined,
  1247. },
  1248. }).done(
  1249. function (data) {
  1250. this.setState({
  1251. loading: false,
  1252. });
  1253. if (!data.error.length) {
  1254. message.success("保存成功!");
  1255. this.setState({
  1256. cuiFlag: false,
  1257. boFlag: false,
  1258. addFlag: false,
  1259. });
  1260. this.jiedianNew(record.orderNo);
  1261. } else {
  1262. message.warning(data.error[0].message);
  1263. }
  1264. }.bind(this)
  1265. );
  1266. } else {
  1267. $.ajax({
  1268. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1269. method: "post",
  1270. data: {
  1271. orderNo: record.orderNo,
  1272. tid: record.tid,
  1273. projectType: record.sort,
  1274. dunType: record.dunType,
  1275. money: record.money,
  1276. waitDay: record.waitDay,
  1277. effectiveCount: record.effectiveCount,
  1278. customizeTimes:
  1279. record.dunType == 0 ? record.customizeTimes : undefined,
  1280. customizeName:
  1281. record.dunType == 0 ? record.customizeName : undefined,
  1282. },
  1283. }).done(
  1284. function (data) {
  1285. this.setState({
  1286. loading: false,
  1287. });
  1288. if (!data.error.length) {
  1289. message.success("保存成功!");
  1290. this.setState({
  1291. cuiFlag: false,
  1292. boFlag: false,
  1293. addFlag: false,
  1294. });
  1295. this.jiedianNew(record.orderNo);
  1296. } else {
  1297. message.warning(data.error[0].message);
  1298. }
  1299. }.bind(this)
  1300. );
  1301. }
  1302. },
  1303. //点击新增催款节点
  1304. addcontact() {
  1305. this.state.contactList.push({
  1306. key: this.state.contactList.length,
  1307. money: "",
  1308. dunSubject: undefined,
  1309. orderNo: this.state.orderNo,
  1310. dunTarget: this.state.kehuId,
  1311. });
  1312. this.setState({
  1313. contactList: this.state.contactList,
  1314. });
  1315. },
  1316. //点击新增催款节点
  1317. addcontactNew() {
  1318. this.state.contactListNew.push({
  1319. key: this.state.contactListNew.length,
  1320. money: "",
  1321. dunSubject: undefined,
  1322. orderNo: this.state.orderNo,
  1323. dunTarget: this.state.kehuId,
  1324. });
  1325. this.setState({
  1326. contactListNew: this.state.contactListNew,
  1327. cuiFlag: true,
  1328. });
  1329. },
  1330. //删除收款节点
  1331. confirmDelet(index) {
  1332. this.state.contactList.splice(index, 1);
  1333. this.setState({
  1334. contactList: this.state.contactList,
  1335. });
  1336. this.contactSave();
  1337. },
  1338. //删除收款节点
  1339. confirmDeletNew(index) {
  1340. if (index.id) {
  1341. this.state.contactListNew.splice(index.key, 1);
  1342. this.setState({
  1343. contactListNew: this.state.contactListNew,
  1344. cuiFlag: false,
  1345. addFlag: false,
  1346. boFlag: false,
  1347. });
  1348. $.ajax({
  1349. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1350. method: "post",
  1351. data: {
  1352. id: index.id,
  1353. },
  1354. }).done(
  1355. function (data) {
  1356. this.setState({
  1357. loading: false,
  1358. });
  1359. if (!data.error.length) {
  1360. message.success("删除成功!");
  1361. this.setState({
  1362. cuiFlag: false,
  1363. });
  1364. this.jiedianNew(this.state.orderNo);
  1365. } else {
  1366. message.warning(data.error[0].message);
  1367. }
  1368. }.bind(this)
  1369. );
  1370. } else {
  1371. this.state.contactListNew.splice(index.key, 1);
  1372. this.setState({
  1373. contactListNew: this.state.contactListNew,
  1374. cuiFlag: false,
  1375. addFlag: false,
  1376. boFlag: false,
  1377. });
  1378. }
  1379. },
  1380. handleOk() {
  1381. this.setState({
  1382. visible: false,
  1383. });
  1384. this.props.closeDesc(false, true);
  1385. },
  1386. handleCancel() {
  1387. if (this.state.orderType == undefined) {
  1388. return false;
  1389. }
  1390. if (!this.state.autoId) {
  1391. return false;
  1392. }
  1393. this.setState({
  1394. visible: false,
  1395. });
  1396. this.props.closeDesc(false);
  1397. },
  1398. handleCancelclose() {
  1399. this.setState(
  1400. {
  1401. visible: false,
  1402. },
  1403. () => {
  1404. this.setState({
  1405. activeKey: "1",
  1406. });
  1407. }
  1408. );
  1409. this.props.closeDesc(false);
  1410. this.reset();
  1411. },
  1412. //点击签单
  1413. handleCancels() {
  1414. this.setState(
  1415. {
  1416. isSubmit: 1,
  1417. },
  1418. () => {
  1419. this.handleSubmit();
  1420. }
  1421. );
  1422. },
  1423. //点击签单
  1424. handleCancelq() {
  1425. this.setState(
  1426. {
  1427. isSubmit: 0,
  1428. },
  1429. () => {
  1430. this.handleSubmit();
  1431. }
  1432. );
  1433. },
  1434. //删除
  1435. delectRow(record) {
  1436. this.setState({
  1437. loading: true,
  1438. });
  1439. $.ajax({
  1440. method: "post",
  1441. dataType: "json",
  1442. crossDomain: false,
  1443. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1444. data: {
  1445. id: record.id,
  1446. },
  1447. }).done(
  1448. function (data) {
  1449. if (!data.error.length) {
  1450. message.success("删除成功!");
  1451. this.setState({
  1452. loading: false,
  1453. });
  1454. //this.loaduser()
  1455. this.loadData(this.props.data);
  1456. } else {
  1457. message.warning(data.error[0].message);
  1458. }
  1459. }.bind(this)
  1460. );
  1461. },
  1462. nextCancel() {
  1463. this.setState({
  1464. projectOperationVisible: false,
  1465. dataInfor:{},
  1466. },()=>{
  1467. this.loadData(this.props.data);
  1468. });
  1469. },
  1470. rizhi() {
  1471. this.setState({
  1472. loading: true,
  1473. });
  1474. $.ajax({
  1475. method: "get",
  1476. dataType: "json",
  1477. crossDomain: false,
  1478. url: "/api/admin/newOrder/selectOrderLog",
  1479. data: {
  1480. orderNo: this.props.data,
  1481. },
  1482. success: function (data) {
  1483. let theArr = [];
  1484. let thisData = data.data;
  1485. if (!thisData.length) {
  1486. if (data.error && data.error.length) {
  1487. message.warning(data.error[0].message);
  1488. }
  1489. thisData = {};
  1490. } else {
  1491. for (let i = 0; i < data.data.length; i++) {
  1492. let thisdata = data.data[i];
  1493. theArr.push({
  1494. processName: thisdata.processName,
  1495. adminName: thisdata.adminName,
  1496. createDate: thisdata.createDate,
  1497. remarks: thisdata.remarks,
  1498. });
  1499. }
  1500. }
  1501. this.setState({
  1502. dataSourcerizhi: theArr,
  1503. });
  1504. }.bind(this),
  1505. }).always(
  1506. function () {
  1507. this.setState({
  1508. loading: false,
  1509. });
  1510. }.bind(this)
  1511. );
  1512. },
  1513. //查看订单日志
  1514. getOrderLog() {
  1515. this.setState({
  1516. rizhivisible: true,
  1517. });
  1518. this.rizhi();
  1519. },
  1520. closeOrderLog() {
  1521. this.setState({
  1522. rizhivisible: false,
  1523. });
  1524. },
  1525. callback(key) {
  1526. this.setState({
  1527. activeKey: key,
  1528. });
  1529. },
  1530. getOrgCodeUrl(e) {
  1531. this.setState({ orgCodeUrl: e });
  1532. },
  1533. getReplenishUrl(e) {
  1534. this.setState({ replenishUrl: e });
  1535. },
  1536. getVoucherUrl(e) {
  1537. this.setState({ voucherUrl: e });
  1538. },
  1539. //加载(自动补全)
  1540. supervisor(e, state) {
  1541. //客户名称与服务名称自动补全
  1542. let api = state
  1543. ? "/api/admin/customer/getCustomerByName"
  1544. : "/api/admin/order/getBusinessProjectByName";
  1545. $.ajax({
  1546. method: "get",
  1547. dataType: "json",
  1548. crossDomain: false,
  1549. url: globalConfig.context + api,
  1550. data: state
  1551. ? {
  1552. name: e,
  1553. type: this.state.customType,
  1554. }
  1555. : {
  1556. businessName: e,
  1557. },
  1558. success: function (data) {
  1559. let thedata = data.data;
  1560. if (!thedata) {
  1561. if (data.error && data.error.length) {
  1562. message.warning(data.error[0].message);
  1563. }
  1564. thedata = {};
  1565. }
  1566. this.setState({
  1567. states: state,
  1568. customerArr: thedata,
  1569. });
  1570. }.bind(this),
  1571. }).always(
  1572. function () {
  1573. this.setState({
  1574. loading: false,
  1575. });
  1576. }.bind(this)
  1577. );
  1578. },
  1579. //上级主管输入框失去焦点是判断客户是否存在
  1580. selectAuto(value) {
  1581. let kid = [];
  1582. let fwList = this.state.customerArr;
  1583. fwList.map(function (item) {
  1584. if (value == item.bname) {
  1585. kid = item;
  1586. }
  1587. });
  1588. this.setState({
  1589. commodityName: value,
  1590. gid: kid.id,
  1591. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1592. commodityFirstPayment:
  1593. kid.firstPayment == 0
  1594. ? kid.firstPayment.toString()
  1595. : kid.firstPayment,
  1596. });
  1597. },
  1598. //客户
  1599. selectAutoCUT(value) {
  1600. let autoIds;
  1601. let fwList = this.state.customerArr;
  1602. fwList.map(function (item) {
  1603. if (value == item.name) {
  1604. autoIds = item.id;
  1605. }
  1606. });
  1607. this.setState({
  1608. customerName: value,
  1609. autoId: autoIds,
  1610. });
  1611. },
  1612. //服务值改变时请求客户名称
  1613. httpChange(e) {
  1614. this.state.gid = "";
  1615. if (e.length >= 1) {
  1616. this.supervisor(e, false);
  1617. }
  1618. this.setState({
  1619. commodityName: e,
  1620. });
  1621. },
  1622. //客户名称自动补全
  1623. customerChange(e) {
  1624. if (this.state.customType) {
  1625. this.state.autoId = "";
  1626. if (e.length >= 2) {
  1627. this.supervisor(e, true);
  1628. }
  1629. this.setState({
  1630. customerName: e,
  1631. });
  1632. } else {
  1633. this.setState({
  1634. customerName: "",
  1635. });
  1636. message.warning("客户所属类型必须指定");
  1637. }
  1638. },
  1639. //点击添加项目明细
  1640. addDetailed() {
  1641. this.setState({
  1642. projectOperationVisible: true,
  1643. });
  1644. },
  1645. //点击打卡项目详情
  1646. tableRowClick(record) {
  1647. this.setState({
  1648. projectOperationVisible:true,
  1649. dataInfor:record,
  1650. });
  1651. },
  1652. //签单时间选择
  1653. selTime(e, index) {
  1654. this.setState({
  1655. entryTime: e,
  1656. signDate: e,
  1657. selTime: index,
  1658. });
  1659. },
  1660. //退单操作
  1661. //点击退单
  1662. tuikuan() {
  1663. this.setState({
  1664. lookVisible: true,
  1665. contractUrl: [],
  1666. applicationUrl: [],
  1667. reason: "",
  1668. });
  1669. },
  1670. //关闭退单
  1671. noCancel() {
  1672. this.setState({
  1673. lookVisible: false,
  1674. });
  1675. },
  1676. //点击确认退单
  1677. tuidanOk() {
  1678. let contractUrls = [];
  1679. let applicationUrls = [];
  1680. if (this.state.contractUrl.length) {
  1681. let picArr = [];
  1682. this.state.contractUrl.map(function (item) {
  1683. if (
  1684. item.response &&
  1685. item.response.data &&
  1686. item.response.data.length
  1687. ) {
  1688. picArr.push(item.response.data);
  1689. }
  1690. });
  1691. contractUrls = picArr.join(",");
  1692. }
  1693. if (this.state.applicationUrl.length) {
  1694. let picArr = [];
  1695. this.state.applicationUrl.map(function (item) {
  1696. if (
  1697. item.response &&
  1698. item.response.data &&
  1699. item.response.data.length
  1700. ) {
  1701. picArr.push(item.response.data);
  1702. }
  1703. });
  1704. applicationUrls = picArr.join(",");
  1705. }
  1706. $.ajax({
  1707. method: "POST",
  1708. dataType: "json",
  1709. crossDomain: false,
  1710. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  1711. data: {
  1712. orderNo: this.state.orderNo, //订单编号
  1713. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  1714. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  1715. reason: this.state.reason, //退单原因
  1716. },
  1717. }).done(
  1718. function (data) {
  1719. this.setState({
  1720. loading: false,
  1721. });
  1722. if (!data.error.length) {
  1723. message.success("退单成功!");
  1724. this.noCancel();
  1725. this.handleCancelclose();
  1726. } else {
  1727. message.warning(data.error[0].message);
  1728. }
  1729. }.bind(this)
  1730. );
  1731. },
  1732. //开单选择订单类型骚操作
  1733. orderTypeFn(e) {
  1734. if (e == 0) {
  1735. this.setState({
  1736. bussStats: true,
  1737. orderType: e,
  1738. });
  1739. this.category();
  1740. } else {
  1741. this.setState({
  1742. contractType: undefined,
  1743. bussStats: false,
  1744. orderType: e,
  1745. });
  1746. }
  1747. },
  1748. //品类数据获取
  1749. category() {
  1750. $.ajax({
  1751. method: "get",
  1752. dataType: "json",
  1753. crossDomain: false,
  1754. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1755. data: {},
  1756. success: function (data) {
  1757. let thedata = data.data;
  1758. let theArr = [];
  1759. if (!thedata) {
  1760. if (data.error && data.error.length) {
  1761. message.warning(data.error[0].message);
  1762. }
  1763. thedata = {};
  1764. } else {
  1765. thedata.map(function (item, index) {
  1766. theArr.push({
  1767. key: index,
  1768. name: item.cname,
  1769. id: item.id,
  1770. });
  1771. });
  1772. }
  1773. this.setState({
  1774. contractType: undefined,
  1775. categoryArr: theArr,
  1776. });
  1777. }.bind(this),
  1778. });
  1779. },
  1780. //变更申请
  1781. changeApply() {
  1782. let theorgCodeUrl = [];
  1783. if (this.state.voucherUrl.length) {
  1784. let picArr = [];
  1785. this.state.voucherUrl.map(function (item) {
  1786. if (
  1787. item.response &&
  1788. item.response.data &&
  1789. item.response.data.length
  1790. ) {
  1791. picArr.push(item.response.data);
  1792. }
  1793. });
  1794. theorgCodeUrl = picArr.join(",");
  1795. }
  1796. $.ajax({
  1797. method: "post",
  1798. dataType: "json",
  1799. crossDomain: false,
  1800. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  1801. data: {
  1802. orderNo: this.state.orderNo, //订单编号
  1803. processState: 0,
  1804. status: 1,
  1805. remarks: this.state.remarksC,
  1806. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1807. totalAmount: this.state.totalAmountC,
  1808. settlementAmount: this.state.settlementAmountC,
  1809. changeAmount: this.state.changeAmount,
  1810. applicant: this.state.applicant,
  1811. depName: this.state.depNameChange,
  1812. type: this.state.typeChange,
  1813. },
  1814. }).done(
  1815. function (data) {
  1816. this.setState({
  1817. loading: false,
  1818. });
  1819. if (!data.error.length) {
  1820. message.success("变更成功!");
  1821. this.setState({
  1822. mark: true,
  1823. });
  1824. this.noCancel();
  1825. this.handleCancelclose();
  1826. } else {
  1827. message.warning(data.error[0].message);
  1828. }
  1829. }.bind(this)
  1830. );
  1831. },
  1832. reset() {
  1833. this.setState({
  1834. remarksC: undefined,
  1835. voucherUrl: [],
  1836. totalAmountC: undefined,
  1837. settlementAmountC: undefined,
  1838. changeAmount: undefined,
  1839. applicant: undefined,
  1840. depNameChange: undefined,
  1841. typeChange: 0,
  1842. });
  1843. },
  1844. componentDidMount() {
  1845. this.loaduser(this.props.data);
  1846. this.jiedian(this.props.data);
  1847. this.jiedianNew(this.props.data);
  1848. this.loadData(this.props.data);
  1849. },
  1850. componentWillReceiveProps(nextProps) {
  1851. if (nextProps.mark) {
  1852. this.setState({
  1853. buttonStatus: true,
  1854. });
  1855. } else {
  1856. this.setState({
  1857. buttonStatus: false,
  1858. });
  1859. }
  1860. if (nextProps.activeKey === "4") {
  1861. this.loaduser(this.props.data);
  1862. this.jiedian(this.props.data);
  1863. this.jiedianNew(this.props.data);
  1864. this.loadData(this.props.data);
  1865. }
  1866. },
  1867. downImg() {
  1868. let num = 0;
  1869. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  1870. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  1871. num = i;
  1872. }
  1873. }
  1874. if (num == this.state.orgCodeUrl.length - 1) {
  1875. return message.warning("已经是最后一张了哦");
  1876. }
  1877. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  1878. this.setState({
  1879. previewImage: this.state.previewImage,
  1880. rotateDeg: 0,
  1881. });
  1882. },
  1883. upImg() {
  1884. let num = 0;
  1885. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  1886. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  1887. num = i;
  1888. }
  1889. }
  1890. if (num == 0) {
  1891. return message.warning("已经是第一张了哦");
  1892. }
  1893. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  1894. this.setState({
  1895. previewImage: this.state.previewImage,
  1896. rotateDeg: 0,
  1897. });
  1898. },
  1899. rotate() {
  1900. let rotateDeg = this.state.rotateDeg + 90;
  1901. this.setState({
  1902. rotateDeg,
  1903. });
  1904. },
  1905. downImgs() {
  1906. let num = 0;
  1907. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  1908. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  1909. num = i;
  1910. }
  1911. }
  1912. if (num == this.state.replenishUrl.length - 1) {
  1913. return message.warning("已经是最后一张了哦");
  1914. }
  1915. this.state.previewImage = this.state.replenishUrl[num + 1].url;
  1916. this.setState({
  1917. previewImage: this.state.previewImage,
  1918. rotateDeg: 0,
  1919. });
  1920. },
  1921. upImgs() {
  1922. let num = 0;
  1923. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  1924. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  1925. num = i;
  1926. }
  1927. }
  1928. if (num == 0) {
  1929. return message.warning("已经是第一张了哦");
  1930. }
  1931. this.state.previewImage = this.state.replenishUrl[num - 1].url;
  1932. this.setState({
  1933. previewImage: this.state.previewImage,
  1934. rotateDeg: 0,
  1935. });
  1936. },
  1937. rotates() {
  1938. let rotateDeg = this.state.rotateDeg + 90;
  1939. this.setState({
  1940. rotateDeg,
  1941. });
  1942. },
  1943. render() {
  1944. const FormItem = Form.Item;
  1945. const formItemLayout = {
  1946. labelCol: { span: 8 },
  1947. wrapperCol: { span: 14 },
  1948. };
  1949. const formItemList = [
  1950. {
  1951. label: "企业联系人",
  1952. content: <span>{this.state.contacts}</span>,
  1953. },
  1954. {
  1955. label: "联系人电话",
  1956. content: <span>{this.state.contactMobile}</span>,
  1957. },
  1958. {
  1959. label: "企业法人",
  1960. content: <span>{this.state.legalPerson}</span>,
  1961. },
  1962. {
  1963. label: "法人电话",
  1964. content: <span>{this.state.legalPersonTel}</span>,
  1965. },
  1966. {
  1967. label: "签单金额(万元)",
  1968. content: <span>{this.state.totalAmount}</span>,
  1969. },
  1970. {
  1971. label: "首付金额(万元)",
  1972. content: <span>{this.state.firstAmount}</span>,
  1973. },
  1974. {
  1975. label: "特批立项",
  1976. content: <span>{getApprovedState(this.state.approval)}</span>,
  1977. },
  1978. {
  1979. label: "合同签订时间",
  1980. content: <span>{this.state.signDate}</span>,
  1981. },
  1982. {
  1983. label: "订单部门",
  1984. content: <span>{this.state.depName}</span>,
  1985. },
  1986. ];
  1987. const dataSources = this.state.customerArr || [];
  1988. let departmentArr = this.state.departmentArr || [];
  1989. const cuiDataList = this.state.contactList || [];
  1990. const options = this.state.states
  1991. ? dataSources.map((group) => (
  1992. <Select.Option key={group.id} value={group.name}>
  1993. {group.name}
  1994. </Select.Option>
  1995. ))
  1996. : dataSources.map((group, index) => (
  1997. <Select.Option key={index} value={group.bname}>
  1998. {group.bname}
  1999. </Select.Option>
  2000. ));
  2001. return (
  2002. <div>
  2003. {this.state.resVisible ? (
  2004. <ResolutionDetail
  2005. cancel={this.resCancel}
  2006. detail={this.state.resRecord}
  2007. visible={this.state.resVisible}
  2008. id={this.state.resRecord.orderNo}
  2009. />
  2010. ) : (
  2011. ""
  2012. )}
  2013. <Spin spinning={this.state.loading}>
  2014. <div className="clearfix">
  2015. <FormItem
  2016. className="half-item"
  2017. {...formItemLayout}
  2018. label="合同编号"
  2019. >
  2020. {<span>{this.state.contractNo}</span>}
  2021. </FormItem>
  2022. <FormItem
  2023. className="half-item"
  2024. {...formItemLayout}
  2025. label="订单编号"
  2026. >
  2027. <span>{this.state.orderNo}</span>
  2028. </FormItem>
  2029. <FormItem
  2030. className="half-item"
  2031. {...formItemLayout}
  2032. label="流程状态"
  2033. >
  2034. <span>{getProcessStatus(this.state.processStatus)}</span>
  2035. </FormItem>
  2036. <FormItem
  2037. className="half-item"
  2038. {...formItemLayout}
  2039. label="结算状态"
  2040. >
  2041. <span>
  2042. {getLiquidationStatus(this.state.liquidationStatus)}
  2043. </span>
  2044. </FormItem>
  2045. {this.props.deleteSign === 3 || this.state.processStatus === 0 ? (
  2046. <div className="clearfix">
  2047. <FormItem
  2048. className="half-item"
  2049. {...formItemLayout}
  2050. label="特批立项"
  2051. >
  2052. <Select
  2053. placeholder="请选择客户所属类型"
  2054. style={{ width: "240px" }}
  2055. value={this.state.approval}
  2056. onChange={(e) => {
  2057. this.setState({ approval: e });
  2058. }}
  2059. >
  2060. {tepi.map(function (item) {
  2061. return (
  2062. <Select.Option key={item.value}>
  2063. {item.key}
  2064. </Select.Option>
  2065. );
  2066. })}
  2067. </Select>
  2068. </FormItem>
  2069. <FormItem
  2070. className="half-item"
  2071. {...formItemLayout}
  2072. label="合同签订时间"
  2073. >
  2074. <DatePicker
  2075. style={{
  2076. marginTop: "2px",
  2077. width: "240px",
  2078. height: "32px",
  2079. }}
  2080. showTime
  2081. format="YYYY-MM-DD"
  2082. onOk={() => {}}
  2083. value={
  2084. this.state.signDate ? moment(this.state.signDate) : null
  2085. }
  2086. onChange={(_data, dataString) => {
  2087. this.setState({ signDate: dataString });
  2088. }}
  2089. />
  2090. <span className="mandatory">*</span>
  2091. </FormItem>
  2092. <FormItem
  2093. className="half-item"
  2094. {...formItemLayout}
  2095. label="订单部门"
  2096. >
  2097. <Select
  2098. placeholder="请输入订单部门"
  2099. style={{ width: 240 }}
  2100. value={this.state.organizationSearch}
  2101. onChange={(e) => {
  2102. this.setState({ organizationSearch: e });
  2103. }}
  2104. >
  2105. {departmentArr.map(function (item) {
  2106. return (
  2107. <Select.Option key={item.id}>
  2108. {item.name}
  2109. </Select.Option>
  2110. );
  2111. })}
  2112. </Select>
  2113. </FormItem>
  2114. </div>
  2115. ) : (
  2116. <div className="clearfix">
  2117. <FormItem
  2118. className="half-item"
  2119. {...formItemLayout}
  2120. label="特批立项"
  2121. >
  2122. <span>{getApprovedState(this.state.approval)}</span>
  2123. </FormItem>
  2124. <FormItem
  2125. className="half-item"
  2126. {...formItemLayout}
  2127. label="合同签订时间"
  2128. >
  2129. <span>{this.state.signDate}</span>
  2130. </FormItem>
  2131. <FormItem
  2132. className="half-item"
  2133. {...formItemLayout}
  2134. label="订单部门"
  2135. >
  2136. <span>{this.state.depName}</span>
  2137. </FormItem>
  2138. </div>
  2139. )}
  2140. </div>
  2141. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  2142. 收款项目
  2143. </h3>
  2144. {this.props.deleteSign === 3 || this.state.processStatus === 0 ? (
  2145. <div className="clearfix">
  2146. <FormItem
  2147. className="half-item"
  2148. {...formItemLayout}
  2149. label="签单金额(万元)"
  2150. >
  2151. <Input
  2152. placeholder="签单金额"
  2153. ref="signTotalAmount"
  2154. value={this.state.totalAmount}
  2155. onChange={(e) => {
  2156. this.setState({ totalAmount: e.target.value });
  2157. }}
  2158. style={{ width: "240px" }}
  2159. />
  2160. <span className="mandatory">*</span>
  2161. </FormItem>
  2162. <FormItem
  2163. className="half-item"
  2164. {...formItemLayout}
  2165. label="首付金额(万元)"
  2166. >
  2167. <Input
  2168. placeholder="请输入实签首款金额"
  2169. ref="signFirstPayment"
  2170. value={this.state.firstAmount}
  2171. onChange={(e) => {
  2172. this.setState({ firstAmount: e.target.value });
  2173. }}
  2174. style={{ width: "240px" }}
  2175. />
  2176. <span className="mandatory">*</span>
  2177. </FormItem>
  2178. <FormItem
  2179. className="half-item"
  2180. {...formItemLayout}
  2181. label="已收款项"
  2182. >
  2183. <span>{this.state.settlementAmount + "万元"}</span>
  2184. {/* {this.state.settlementAmount ? (
  2185. <Button
  2186. type="primary"
  2187. onClick={this.tuikuan}
  2188. style={{
  2189. float: "right",
  2190. marginRight: "50px",
  2191. marginBottom: "15px"
  2192. }}
  2193. >
  2194. 退单
  2195. </Button>
  2196. ) : (
  2197. ""
  2198. )} */}
  2199. </FormItem>
  2200. </div>
  2201. ) : (
  2202. <div className="clearfix">
  2203. <FormItem
  2204. className="half-item"
  2205. {...formItemLayout}
  2206. label="签单金额(万元)"
  2207. >
  2208. <span>{this.state.totalAmount}</span>
  2209. </FormItem>
  2210. <FormItem
  2211. className="half-item"
  2212. {...formItemLayout}
  2213. label="首付金额(万元)"
  2214. >
  2215. <span>{this.state.firstAmount}</span>
  2216. </FormItem>
  2217. <FormItem
  2218. className="half-item"
  2219. {...formItemLayout}
  2220. label="已收款项"
  2221. >
  2222. <span>{this.state.settlementAmount + "万元"}</span>
  2223. {/* {this.state.settlementAmount ? (
  2224. <Button
  2225. type="primary"
  2226. onClick={this.tuikuan}
  2227. style={{
  2228. float: "right",
  2229. marginRight: "50px",
  2230. marginBottom: "15px"
  2231. }}
  2232. >
  2233. 退单
  2234. </Button>
  2235. ) : (
  2236. ""
  2237. )} */}
  2238. </FormItem>
  2239. </div>
  2240. )}
  2241. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  2242. 联系信息
  2243. </h3>
  2244. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2245. <div className="clearfix">
  2246. <div className="clearfix">
  2247. <FormItem
  2248. className="half-item"
  2249. {...formItemLayout}
  2250. label="客户名称"
  2251. >
  2252. <span>{this.state.userName}</span>
  2253. <EnterpriseNameChange
  2254. type='journal'
  2255. style={{ marginLeft: 10 }}
  2256. enterpriseId={this.props.orderUid}/>
  2257. </FormItem>
  2258. </div>
  2259. <FormItem
  2260. className="half-item"
  2261. {...formItemLayout}
  2262. label="企业联系人"
  2263. >
  2264. <Input
  2265. placeholder="请输入联系人"
  2266. ref="signTotalAmount"
  2267. value={this.state.contacts}
  2268. onChange={(e) => {
  2269. this.setState({ contacts: e.target.value });
  2270. }}
  2271. style={{ width: "240px" }}
  2272. />
  2273. </FormItem>
  2274. <FormItem
  2275. className="half-item"
  2276. {...formItemLayout}
  2277. label="联系人电话"
  2278. >
  2279. <Input
  2280. placeholder="请输入联系人电话"
  2281. ref="signTotalAmount"
  2282. value={this.state.contactMobile}
  2283. onChange={(e) => {
  2284. this.setState({ contactMobile: e.target.value });
  2285. }}
  2286. style={{ width: "240px" }}
  2287. />
  2288. </FormItem>
  2289. <FormItem
  2290. className="half-item"
  2291. {...formItemLayout}
  2292. label="企业法人"
  2293. >
  2294. <Input
  2295. placeholder="请输入法人"
  2296. ref="signTotalAmount"
  2297. value={this.state.legalPerson}
  2298. onChange={(e) => {
  2299. this.setState({ legalPerson: e.target.value });
  2300. }}
  2301. style={{ width: "240px" }}
  2302. />
  2303. </FormItem>
  2304. <FormItem
  2305. className="half-item"
  2306. {...formItemLayout}
  2307. label="法人电话"
  2308. >
  2309. <Input
  2310. placeholder="请输入法人电话"
  2311. ref="signTotalAmount"
  2312. value={this.state.legalPersonTel}
  2313. onChange={(e) => {
  2314. this.setState({ legalPersonTel: e.target.value });
  2315. }}
  2316. style={{ width: "240px" }}
  2317. />
  2318. </FormItem>
  2319. </div>
  2320. ) : (
  2321. <div className="clearfix">
  2322. {formItemList.map((data, index) => {
  2323. return (
  2324. <FormItem
  2325. className="half-item"
  2326. {...formItemLayout}
  2327. key={index}
  2328. label={data.label}
  2329. >
  2330. {data.content}
  2331. </FormItem>
  2332. );
  2333. })}
  2334. </div>
  2335. )}
  2336. <div className="clearfix">
  2337. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2338. <div>
  2339. <FormItem
  2340. labelCol={{ span: 4 }}
  2341. wrapperCol={{ span: 18 }}
  2342. label={
  2343. <span>
  2344. <strong style={{ color: "#f00" }}>*</strong>合同扫描件
  2345. </span>
  2346. }
  2347. >
  2348. <PicturesWall
  2349. fileList={this.getOrgCodeUrl}
  2350. pictureUrl={this.state.orgCodeUrl}
  2351. url="/api/admin/order/uploadOrderImg"
  2352. sign=""
  2353. />
  2354. <p>图片建议:要清晰。</p>
  2355. <Button
  2356. style={{
  2357. float: "right",
  2358. marginRight: "140px",
  2359. marginTop: "20px",
  2360. }}
  2361. onClick={this.getOrderLog}
  2362. >
  2363. 查看订单日志
  2364. </Button>
  2365. </FormItem>
  2366. <FormItem
  2367. labelCol={{ span: 4 }}
  2368. wrapperCol={{ span: 18 }}
  2369. label={
  2370. <span>
  2371. 补充协议
  2372. </span>
  2373. }
  2374. >
  2375. <PicturesWall
  2376. fileList={this.getReplenishUrl}
  2377. pictureUrl={this.state.replenishUrl}
  2378. url="/api/admin/order/uploadOrderImg"
  2379. sign=""
  2380. />
  2381. <p>图片建议:要清晰。</p>
  2382. </FormItem>
  2383. </div>
  2384. ) : (
  2385. <div>
  2386. <FormItem
  2387. labelCol={{ span: 4 }}
  2388. wrapperCol={{ span: 18 }}
  2389. label="合同扫描件"
  2390. >
  2391. <Upload
  2392. className="demandDetailShow-upload"
  2393. listType="picture-card"
  2394. fileList={this.state.orgCodeUrl}
  2395. onPreview={(file) => {
  2396. this.setState({
  2397. previewImage: file.url || file.thumbUrl,
  2398. previewVisible: true,
  2399. });
  2400. }}
  2401. ></Upload>
  2402. <Modal
  2403. maskClosable={false}
  2404. footer={null}
  2405. width={"50%"}
  2406. visible={this.state.previewVisible}
  2407. onCancel={() => {
  2408. this.setState({ previewVisible: false, rotateDeg: 0 });
  2409. }}
  2410. >
  2411. <img
  2412. alt=""
  2413. style={{
  2414. width: "100%",
  2415. transform: `rotate(${this.state.rotateDeg}deg)`,
  2416. }}
  2417. src={this.state.previewImage || ""}
  2418. />
  2419. <Button
  2420. onClick={this.rotate}
  2421. style={{
  2422. position: "relative",
  2423. left: "50%",
  2424. transform: "translateX(-50%)",
  2425. }}
  2426. >
  2427. 旋转
  2428. </Button>
  2429. <Button
  2430. onClick={this.upImg}
  2431. style={{
  2432. position: "absolute",
  2433. left: -81,
  2434. top: "50%",
  2435. transform: "translateY(-50%)",
  2436. }}
  2437. >
  2438. 上一张
  2439. </Button>
  2440. <Button
  2441. onClick={this.downImg}
  2442. style={{
  2443. position: "absolute",
  2444. right: -81,
  2445. top: "50%",
  2446. transform: "translateY(-50%)",
  2447. }}
  2448. >
  2449. 下一张
  2450. </Button>
  2451. </Modal>
  2452. <Button
  2453. style={{
  2454. float: "right",
  2455. marginRight: "140px",
  2456. marginTop: "20px",
  2457. }}
  2458. onClick={this.getOrderLog}
  2459. >
  2460. 查看订单日志
  2461. </Button>
  2462. </FormItem>
  2463. <FormItem
  2464. labelCol={{ span: 4 }}
  2465. wrapperCol={{ span: 18 }}
  2466. label="补充协议"
  2467. >
  2468. <Upload
  2469. className="demandDetailShow-upload"
  2470. listType="picture-card"
  2471. fileList={this.state.replenishUrl}
  2472. onPreview={(file) => {
  2473. this.setState({
  2474. previewImage: file.url || file.thumbUrl,
  2475. previewVisibles: true,
  2476. });
  2477. }}
  2478. ></Upload>
  2479. <Modal
  2480. maskClosable={false}
  2481. footer={null}
  2482. width={"50%"}
  2483. visible={this.state.previewVisibles}
  2484. onCancel={() => {
  2485. this.setState({ previewVisibles: false, rotateDeg: 0 });
  2486. }}
  2487. >
  2488. <img
  2489. alt=""
  2490. style={{
  2491. width: "100%",
  2492. transform: `rotate(${this.state.rotateDeg}deg)`,
  2493. }}
  2494. src={this.state.previewImage || ""}
  2495. />
  2496. <Button
  2497. onClick={this.rotates}
  2498. style={{
  2499. position: "relative",
  2500. left: "50%",
  2501. transform: "translateX(-50%)",
  2502. }}
  2503. >
  2504. 旋转
  2505. </Button>
  2506. <Button
  2507. onClick={this.upImgs}
  2508. style={{
  2509. position: "absolute",
  2510. left: -81,
  2511. top: "50%",
  2512. transform: "translateY(-50%)",
  2513. }}
  2514. >
  2515. 上一张
  2516. </Button>
  2517. <Button
  2518. onClick={this.downImgs}
  2519. style={{
  2520. position: "absolute",
  2521. right: -81,
  2522. top: "50%",
  2523. transform: "translateY(-50%)",
  2524. }}
  2525. >
  2526. 下一张
  2527. </Button>
  2528. </Modal>
  2529. </FormItem>
  2530. </div>
  2531. )}
  2532. </div>
  2533. <div className="clearfix">
  2534. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2535. <div className="clearfix">
  2536. <FormItem
  2537. labelCol={{ span: 4 }}
  2538. wrapperCol={{ span: 16 }}
  2539. label="订单留言"
  2540. >
  2541. <Input
  2542. type="textarea"
  2543. placeholder="请输入订单留言"
  2544. rows={4}
  2545. value={this.state.orderRemarks}
  2546. onChange={(e) => {
  2547. this.setState({ orderRemarks: e.target.value });
  2548. }}
  2549. style={{ width: "95%" }}
  2550. />
  2551. <span className="mandatory">*</span>
  2552. </FormItem>
  2553. </div>
  2554. ) : (
  2555. <FormItem
  2556. labelCol={{ span: 4 }}
  2557. wrapperCol={{ span: 16 }}
  2558. label="订单留言"
  2559. >
  2560. <p style={{ width: 500, wordWrap: "break-word" }}>
  2561. {this.state.orderRemarks}
  2562. </p>
  2563. </FormItem>
  2564. )}
  2565. </div>
  2566. <div className="clearfix">
  2567. <FormItem
  2568. className="half-item"
  2569. {...formItemLayout}
  2570. label="订单负责人"
  2571. >
  2572. <span>{this.state.salesmanName}</span>
  2573. </FormItem>
  2574. <FormItem
  2575. className="half-item"
  2576. {...formItemLayout}
  2577. label="订单负责人电话"
  2578. >
  2579. <span>{this.state.salesmanMobile}</span>
  2580. </FormItem>
  2581. </div>
  2582. <div className="clearfix">
  2583. <FormItem
  2584. className="half-item"
  2585. {...formItemLayout}
  2586. label="当前财务负责人"
  2587. >
  2588. <span>{this.state.nowFinance}</span>
  2589. </FormItem>
  2590. <FormItem
  2591. className="half-item"
  2592. {...formItemLayout}
  2593. label="当前财务负责人电话"
  2594. >
  2595. <span>{this.state.nowFinanceMobile}</span>
  2596. </FormItem>
  2597. </div>
  2598. <div className="clearfix">
  2599. <FormItem
  2600. className="half-item"
  2601. {...formItemLayout}
  2602. style={{ opacity: ".5" }}
  2603. label="原订单负责人"
  2604. >
  2605. <span>{this.state.oldSalesmanName}</span>
  2606. </FormItem>
  2607. <FormItem
  2608. className="half-item"
  2609. {...formItemLayout}
  2610. style={{ opacity: ".5" }}
  2611. label="原订单负责人电话"
  2612. >
  2613. <span>{this.state.oldSalesmanMobile}</span>
  2614. </FormItem>
  2615. </div>
  2616. <div className="clearfix">
  2617. <FormItem
  2618. className="half-item"
  2619. style={{ opacity: ".5" }}
  2620. {...formItemLayout}
  2621. label="实际财务操作人"
  2622. >
  2623. <span>{this.state.financeName}</span>
  2624. </FormItem>
  2625. <FormItem
  2626. className="half-item"
  2627. {...formItemLayout}
  2628. style={{ opacity: ".5" }}
  2629. label="实际财务操作人电话"
  2630. >
  2631. <span>{this.state.financeMobile}</span>
  2632. </FormItem>
  2633. </div>
  2634. <div>
  2635. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2636. 项目业务
  2637. </span>
  2638. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2639. <Button
  2640. type="primary"
  2641. onClick={this.addDetailed}
  2642. style={{
  2643. float: "right",
  2644. marginRight: "50px",
  2645. marginBottom: "15px",
  2646. }}
  2647. >
  2648. 添加项目明细
  2649. </Button>
  2650. ) : (
  2651. ""
  2652. )}
  2653. </div>
  2654. <div className="patent-table">
  2655. <Spin spinning={this.state.loading}>
  2656. <Table
  2657. columns={this.state.columns}
  2658. dataSource={this.state.dataSource}
  2659. pagination={this.state.pagination}
  2660. onRowClick={this.tableRowClick}
  2661. />
  2662. </Spin>
  2663. </div>{" "}
  2664. <div
  2665. style={{
  2666. display: cuiDataList.length ? "block" : "none",
  2667. }}
  2668. >
  2669. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2670. 旧催款节点
  2671. </span>
  2672. <Button
  2673. type="primary"
  2674. // onClick={this.addcontact}
  2675. disabled
  2676. onClick={(e) => {
  2677. cuiDataList.length ? this.addcontact() : this.addcontactNew();
  2678. }}
  2679. style={{
  2680. float: "right",
  2681. marginRight: "50px",
  2682. marginBottom: "15px",
  2683. display: this.state.processStatus == 0 ? "block" : "none",
  2684. }}
  2685. >
  2686. 添加催款节点
  2687. </Button>
  2688. </div>
  2689. <div
  2690. className="clearfix"
  2691. style={{
  2692. display: cuiDataList.length ? "block" : "none",
  2693. }}
  2694. >
  2695. <Spin spinning={this.state.loading}>
  2696. <Form layout="horizontal">
  2697. <Table
  2698. pagination={false}
  2699. columns={this.state.ContactsLists}
  2700. dataSource={this.state.contactList}
  2701. scroll={{ x: "max-content", y: 0 }}
  2702. bordered
  2703. size="small"
  2704. />
  2705. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2706. </Form>
  2707. </Spin>
  2708. </div>
  2709. <div
  2710. style={{
  2711. display: cuiDataList.length ? "none" : "block",
  2712. }}
  2713. >
  2714. <span
  2715. style={{
  2716. marginLeft: "50px",
  2717. fontSize: "20px",
  2718. }}
  2719. >
  2720. 新催款节点
  2721. </span>
  2722. <span
  2723. style={{
  2724. display: "inline-block",
  2725. marginLeft: 10,
  2726. color: "red",
  2727. }}
  2728. >
  2729. 金额总计(万元): {this.state.totalCui}
  2730. </span>
  2731. <Button
  2732. type="primary"
  2733. disabled={this.state.addFlag ? true : false}
  2734. // onClick={this.addcontact}
  2735. onClick={(e) => {
  2736. this.setState({ addFlag: true });
  2737. this.addcontactNew();
  2738. }}
  2739. style={{
  2740. float: "right",
  2741. marginRight: "50px",
  2742. marginBottom: "15px",
  2743. display: this.state.processStatus == 0 ? "block" : "none",
  2744. }}
  2745. >
  2746. 添加催款节点
  2747. </Button>
  2748. </div>
  2749. <div
  2750. className="clearfix"
  2751. style={{
  2752. display: cuiDataList.length ? "none" : "block",
  2753. }}
  2754. >
  2755. <Spin spinning={this.state.loading}>
  2756. <Form layout="horizontal">
  2757. <Table
  2758. pagination={false}
  2759. columns={this.state.ContactsListsNew}
  2760. dataSource={this.state.contactListNew}
  2761. scroll={{ x: "max-content", y: 0 }}
  2762. bordered
  2763. size="small"
  2764. />
  2765. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2766. </Form>
  2767. </Spin>
  2768. </div>
  2769. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2770. <div
  2771. className="addSave"
  2772. style={{
  2773. marginTop: "15px",
  2774. display: "flex",
  2775. justifyContent: "flex-end",
  2776. }}
  2777. >
  2778. {!this.state.buttonStatus ? (
  2779. <Button
  2780. className="cancel"
  2781. type="primary"
  2782. onClick={this.handleCancels}
  2783. style={{ marginRight: 20 }}
  2784. htmlType="submit"
  2785. >
  2786. 签单
  2787. </Button>
  2788. ) : (
  2789. ""
  2790. )}
  2791. <Button
  2792. className="cancel"
  2793. type="primary"
  2794. onClick={this.handleCancelq}
  2795. style={{ marginRight: 40 }}
  2796. htmlType="submit"
  2797. >
  2798. 保存
  2799. </Button>
  2800. </div>
  2801. ) : (
  2802. ""
  2803. )}
  2804. </Spin>
  2805. {this.state.lookVisible ? <Modal
  2806. maskClosable={false}
  2807. visible={this.state.lookVisible}
  2808. onOk={this.noCancel}
  2809. onCancel={this.noCancel}
  2810. width="800px"
  2811. title={"退单申请"}
  2812. footer=""
  2813. className="admin-desc-content"
  2814. >
  2815. <Form layout="horizontal" id="demand-form">
  2816. <Spin spinning={this.state.loading}>
  2817. <div className="clearfix">
  2818. <FormItem
  2819. labelCol={{ span: 4 }}
  2820. wrapperCol={{ span: 16 }}
  2821. label="终止合同"
  2822. >
  2823. <Picture
  2824. domId={'addorders1'}
  2825. fileList={(e) => {
  2826. this.setState({ contractUrl: e });
  2827. }}
  2828. pictureUrl={this.state.contractUrl}
  2829. visible={this.props.visible}
  2830. data={{
  2831. sign: "order_refund_file",
  2832. url: "/api/admin/newOrder/uploadRefundOrderFile",
  2833. number: 8,
  2834. }}
  2835. />
  2836. </FormItem>
  2837. </div>
  2838. <div className="clearfix">
  2839. <FormItem
  2840. labelCol={{ span: 4 }}
  2841. wrapperCol={{ span: 16 }}
  2842. label="退单申请表"
  2843. >
  2844. <Picture
  2845. domId={'addorders2'}
  2846. fileList={(e) => {
  2847. this.setState({ applicationUrl: e });
  2848. }}
  2849. pictureUrl={this.state.applicationUrl}
  2850. visible={this.props.visible}
  2851. data={{
  2852. sign: "order_refund_file",
  2853. url: "/api/admin/newOrder/uploadRefundOrderFile",
  2854. number: 8,
  2855. }}
  2856. />
  2857. </FormItem>
  2858. </div>
  2859. <div className="clearfix">
  2860. <FormItem
  2861. labelCol={{ span: 4 }}
  2862. wrapperCol={{ span: 16 }}
  2863. label="退单理由"
  2864. >
  2865. <Input
  2866. type="textarea"
  2867. placeholder="请输入退单理由"
  2868. rows={4}
  2869. value={this.state.reason}
  2870. onChange={(e) => {
  2871. this.setState({ reason: e.target.value });
  2872. }}
  2873. />
  2874. </FormItem>
  2875. </div>
  2876. <div className="clearfix">
  2877. <Button
  2878. className="cancel"
  2879. type="primary"
  2880. onClick={this.tuidanOk}
  2881. style={{ marginLeft: "50px" }}
  2882. htmlType="submit"
  2883. >
  2884. 确定退单
  2885. </Button>
  2886. <Button
  2887. className="cancel"
  2888. type="ghost"
  2889. onClick={this.noCancel}
  2890. style={{ marginLeft: "50px" }}
  2891. >
  2892. 取消
  2893. </Button>
  2894. </div>
  2895. </Spin>
  2896. </Form>
  2897. </Modal> : <div/>}
  2898. <Modal
  2899. visible={this.state.rizhivisible}
  2900. className="admin-desc-content"
  2901. width="800px"
  2902. maskClosable={false}
  2903. title="订单日志"
  2904. footer={null}
  2905. onCancel={this.closeOrderLog}
  2906. >
  2907. <div className="patent-table">
  2908. <Spin spinning={this.state.loading}>
  2909. <Table
  2910. columns={this.state.columnsrizhi}
  2911. dataSource={this.state.dataSourcerizhi}
  2912. pagination={false}
  2913. />
  2914. </Spin>
  2915. </div>
  2916. </Modal>
  2917. {this.state.projectOperationVisible ? <ProjectOperation
  2918. readOnly={this.state.dataInfor && Object.keys(this.state.dataInfor).length > 0 && this.state.processStatus !== 0}
  2919. orderNo={this.props.datauser.orderNo}
  2920. visible={this.state.projectOperationVisible}
  2921. dataInfor={this.state.dataInfor}
  2922. onCancel={this.nextCancel}
  2923. /> : null}
  2924. </div>
  2925. );
  2926. },
  2927. })
  2928. );
  2929. export default Addorders;