addorders.js 107 KB

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