addService.jsx 104 KB

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