addService.jsx 132 KB

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