reject.jsx 94 KB

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