addorders.js 92 KB

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