addService.jsx 134 KB

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