reject.jsx 96 KB

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