addorders.js 96 KB

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