addService.jsx 102 KB

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