addService.jsx 134 KB

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