addService.jsx 108 KB

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