reject.jsx 94 KB

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