addService.jsx 133 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725
  1. import React from "react";
  2. import {
  3. Table,
  4. Modal,
  5. message,
  6. Spin,
  7. Input,
  8. Select,
  9. Button,
  10. Form,
  11. Upload,
  12. Popconfirm,
  13. AutoComplete,
  14. DatePicker,
  15. Col,
  16. Tabs
  17. } from "antd";
  18. import $ from "jquery/src/ajax";
  19. import "../userMangagement.less";
  20. import "../billing.less";
  21. import moment from "moment";
  22. import Picture from "@/manageCenter/publicComponent/picture";
  23. import OrderRiZi from "@/orderRiZi.jsx";
  24. import {
  25. orderTypes,
  26. customerType,
  27. jiedian,
  28. tepi,
  29. boutique,
  30. } from "../../../dataDic.js";
  31. import {
  32. splitUrl,
  33. getProcessStatus,
  34. getLiquidationStatus,
  35. getboutique,
  36. getApprovedState,
  37. getjiedian,
  38. getCuikuan,
  39. getProjectStatus,
  40. moneyVerify
  41. } from "../../../tools.js";
  42. import {cuiJieDian} from "@/dataDic.js"
  43. import PicturesWall from "./changeComponent/picturesWall.js";
  44. import { changeType, getChangeType } from "./changeComponent/changeDetailYxgly";
  45. // const Options = Select.Option;
  46. const Option = AutoComplete.Option;
  47. const confirm = Modal.confirm;
  48. const NewService = Form.create()(
  49. React.createClass({
  50. //查看项目列表
  51. loadData(record) {
  52. this.state.data = [];
  53. this.setState({
  54. loading: true
  55. });
  56. $.ajax({
  57. method: "get",
  58. dataType: "json",
  59. crossDomain: false,
  60. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  61. data: {
  62. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  63. },
  64. success: function(data) {
  65. let theArr = [];
  66. if (!data.data) {
  67. if (data.error && data.error.length) {
  68. message.warning(data.error[0].message);
  69. }
  70. } else {
  71. for (let i = 0; i < data.data.length; i++) {
  72. let thisdata = data.data[i];
  73. theArr.push({
  74. key: i,
  75. id: thisdata.id,
  76. orderNo: thisdata.orderNo, //订单编号
  77. commodityId: thisdata.commodityId, //项目ID
  78. commodityName: thisdata.commodityName, //项目名称
  79. cname: thisdata.cname, //项目类别
  80. commodityPrice: thisdata.commodityPrice, //项目价格
  81. commodityQuantity: thisdata.commodityQuantity, //项目数量
  82. main: thisdata.main, //是否为主要任务
  83. taskComment: thisdata.taskComment, //任务说明
  84. contacts: thisdata.contacts, //联系人
  85. contactsMobile: thisdata.contactsMobile, //联系人电话
  86. projectStatus: thisdata.projectStatus, //项目状态
  87. sort: thisdata.cSort
  88. });
  89. }
  90. }
  91. this.departmentList();
  92. this.setState({
  93. dataSource: theArr,
  94. pagination: false
  95. });
  96. }.bind(this)
  97. }).always(
  98. function() {
  99. this.setState({
  100. loading: false
  101. });
  102. }.bind(this)
  103. );
  104. },
  105. //收款节点
  106. loadDatas(record) {
  107. this.state.data = [];
  108. this.setState({
  109. loading: true
  110. });
  111. $.ajax({
  112. method: "get",
  113. dataType: "json",
  114. crossDomain: false,
  115. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  116. data: {
  117. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  118. },
  119. success: function(data) {
  120. let theArr = [];
  121. if (!data.data) {
  122. if (data.error && data.error.length) {
  123. message.warning(data.error[0].message);
  124. }
  125. } else {
  126. for (let i = 0; i < data.data.length; i++) {
  127. let thisdata = data.data[i];
  128. theArr.push({
  129. key: i,
  130. id: thisdata.id
  131. });
  132. }
  133. }
  134. this.setState({
  135. dataSource: theArr,
  136. pagination: false
  137. });
  138. }.bind(this)
  139. }).always(
  140. function() {
  141. this.setState({
  142. loading: false
  143. });
  144. }.bind(this)
  145. );
  146. },
  147. getInitialState() {
  148. return {
  149. cuiFlag: false,
  150. startRemarks: "",
  151. remarksC: "",
  152. loading: false,
  153. visible: false,
  154. status: 4,
  155. orgCodeUrl: [],
  156. voucherUrl: [],
  157. customerArr: [],
  158. mark: false,
  159. activeKey: "1",
  160. typeChange: 0,
  161. bussStats: false,
  162. checkedKeys: [],
  163. lookflowList: [],
  164. contractUrl: [],
  165. applicationUrl: [],
  166. changeAmount: "0",
  167. active: {
  168. applySign: false
  169. },
  170. lookState: false,
  171. signBillVisible: false,
  172. commod: "",
  173. columns: [
  174. {
  175. title: "业务项目名称",
  176. dataIndex: "commodityName",
  177. key: "commodityName"
  178. },
  179. {
  180. title: "项目类别",
  181. dataIndex: "cname",
  182. key: "cname"
  183. },
  184. {
  185. title: "项目数量",
  186. dataIndex: "commodityQuantity",
  187. key: "commodityQuantity"
  188. },
  189. {
  190. title: "金额(万元)",
  191. dataIndex: "commodityPrice",
  192. key: "commodityPrice"
  193. },
  194. {
  195. title: "负责人",
  196. dataIndex: "contacts",
  197. key: "contacts"
  198. },
  199. {
  200. title: "负责人电话",
  201. dataIndex: "contactsMobile",
  202. key: "contactsMobile"
  203. },
  204. {
  205. title: "项目状态",
  206. dataIndex: "projectStatus",
  207. key: "projectStatus",
  208. render: text => {
  209. return getProjectStatus(text);
  210. }
  211. },
  212. {
  213. title: "主要项目",
  214. dataIndex: "main",
  215. key: "main",
  216. render: text => {
  217. return text ? "是" : "否";
  218. }
  219. },
  220. {
  221. title: "项目说明",
  222. dataIndex: "taskComment",
  223. key: "taskComment",
  224. render: text => {
  225. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  226. }
  227. },
  228. {
  229. title: "操作",
  230. dataIndex: "ABC",
  231. key: "ABC",
  232. render: (text, record) => {
  233. return (
  234. <div>
  235. {this.state.processStatus == 0 ? (
  236. <Button onClick={e => {
  237. e.stopPropagation()
  238. this.showConfirm(this.delectRow,record)
  239. }}>删除</Button>
  240. ) : (
  241. ""
  242. )}
  243. </div>
  244. );
  245. }
  246. }
  247. ],
  248. columnsrizhi: [
  249. {
  250. title: "流程",
  251. dataIndex: "processName",
  252. key: "processName"
  253. },
  254. {
  255. title: "操作人",
  256. dataIndex: "adminName",
  257. key: "adminName"
  258. },
  259. {
  260. title: "时间",
  261. dataIndex: "createDate",
  262. key: "createDate"
  263. }
  264. ],
  265. contactList: [],
  266. loading: false,
  267. ContactsLists: [
  268. {
  269. title: "催款科目",
  270. dataIndex: "dunSubject",
  271. key: "dunSubject",
  272. render: (text, record) => {
  273. return (
  274. <Select
  275. placeholder="请选择催款科目"
  276. value={record.dunSubject}
  277. style={{ width: "150px" }}
  278. disabled
  279. onChange={e => {
  280. record.dunSubject = e;
  281. this.setState({ contactList: this.state.contactList });
  282. }}
  283. >
  284. {jiedian.map(function(item) {
  285. return (
  286. <Select.Option key={item.value}>{item.key}</Select.Option>
  287. );
  288. })}
  289. </Select>
  290. );
  291. }
  292. },
  293. {
  294. title: "金额(万)",
  295. dataIndex: "money",
  296. key: "money",
  297. render: (text, record) => {
  298. return (
  299. <Input
  300. value={record.money}
  301. placeholder="请输入金额(必填项)"
  302. disabled
  303. key={record.id}
  304. required="required"
  305. onChange={e => {
  306. record.money = e.target.value;
  307. this.setState({ contactList: this.state.contactList });
  308. }}
  309. style={{ width: "120px" }}
  310. />
  311. );
  312. }
  313. },
  314. {
  315. title: "催款状态",
  316. dataIndex: "dunStatus",
  317. key: "dunStatus",
  318. render: text => {
  319. return getCuikuan(text);
  320. }
  321. },
  322. {
  323. title: "操作",
  324. dataIndex: "dels",
  325. key: "dels",
  326. render: (text, record) => {
  327. return (
  328. <div>
  329. {
  330. <Popconfirm
  331. title="是否删除?"
  332. onConfirm={() => {
  333. this.confirmDelet(record.key);
  334. }}
  335. okText="删除"
  336. cancelText="不删除"
  337. >
  338. <Button
  339. style={{
  340. marginRight: "10px",
  341. color: "#ffffff",
  342. background: "#f00",
  343. border: "none",
  344. display:
  345. this.state.processStatus == 0 ? "block" : "none"
  346. }}
  347. >
  348. 删除
  349. </Button>
  350. </Popconfirm>
  351. }
  352. {record.id ? (
  353. ""
  354. ) : (
  355. <Button type="primary" onClick={this.contactSave}>
  356. 保存
  357. </Button>
  358. )}
  359. </div>
  360. );
  361. }
  362. }
  363. ],
  364. ContactsListsNew: [
  365. {
  366. title: "项目名称",
  367. dataIndex: "commodityName",
  368. key: "commodityName",
  369. render: (text, record, index) => {
  370. let dataArr = this.state.dataSource || [];
  371. if (text) {
  372. return <span>{text}</span>;
  373. }
  374. return (
  375. <Select
  376. placeholder="请选择名称"
  377. style={{ width: "150px" }}
  378. disabled={
  379. this.state.getLoad && record.sortName ? true : false
  380. }
  381. onChange={e => {
  382. record.sortName = e;
  383. dataArr.forEach(item => {
  384. if (item.commodityName == record.sortName) {
  385. record.cname = item.cname;
  386. record.tid = item.id;
  387. record.isSave = true;
  388. record.sort = item.sort;
  389. console.log(record);
  390. cuiJieDian.forEach(item => {
  391. if (item.value == record.sort) {
  392. record.arr = item.children;
  393. let yearFlag = true;
  394. if (record.sort == 6) {
  395. yearFlag = false;
  396. }
  397. this.setState({
  398. getLoad: true,
  399. yearFlag
  400. });
  401. }
  402. });
  403. }
  404. });
  405. console.log(e);
  406. }}
  407. >
  408. {dataArr.map(item => {
  409. return (
  410. <Select.Option key={item.id} value={item.commodityName}>
  411. {item.commodityName}
  412. </Select.Option>
  413. );
  414. })}
  415. </Select>
  416. );
  417. }
  418. },
  419. {
  420. title: "项目分类",
  421. dataIndex: "projectType",
  422. key: "projectType",
  423. render: (text, record) => {
  424. if (text) {
  425. let arr = this.state.dataSource || [];
  426. let str = "";
  427. for (let i = 0; i < arr.length; i++) {
  428. if (this.state.dataSource[i].sort == text) {
  429. str = this.state.dataSource[i].cname;
  430. return <span>{str}</span>;
  431. }
  432. }
  433. }
  434. if (this.state.getLoad) {
  435. return (
  436. <Select
  437. style={{ width: "150px" }}
  438. placeholder="请选择分类"
  439. value={record.cname}
  440. >
  441. <Select.Option key={record.sort} value={record.cname}>
  442. {record.cname}
  443. </Select.Option>
  444. </Select>
  445. );
  446. } else {
  447. return (
  448. <Select style={{ width: "150px" }} placeholder="请选择分类">
  449. <Select.Option key={record.sort} value={record.cname}>
  450. {record.cname}
  451. </Select.Option>
  452. </Select>
  453. );
  454. }
  455. }
  456. },
  457. {
  458. title: "催款科目",
  459. dataIndex: "dunTypeName",
  460. key: "dunTypeName",
  461. render: (text, record) => {
  462. if (text) {
  463. return <span>{text}</span>;
  464. }
  465. if (this.state.getLoad) {
  466. let arr = record.arr || [];
  467. console.log("arrrr", arr);
  468. return (
  469. <Select
  470. style={{ width: "150px" }}
  471. placeholder="请选择分类"
  472. onChange={e => {
  473. record.dunType = e;
  474. if(e != 1) {
  475. this.setState({
  476. timeFlag: true
  477. })
  478. }else {
  479. this.setState({
  480. timeFlag: false
  481. })
  482. }
  483. if(e == 1 && record.sort == 6) {
  484. this.setState({
  485. yearFlag: true
  486. })
  487. }else if(e != 1 && record.sort == 6) {
  488. this.setState({
  489. yearFlag: false
  490. })
  491. }
  492. console.log(e);
  493. }}
  494. >
  495. {arr.map(item => {
  496. record;
  497. return (
  498. <Select.Option key={item.value} value={item.value}>
  499. {item.key}
  500. </Select.Option>
  501. );
  502. })}
  503. </Select>
  504. );
  505. } else {
  506. return (
  507. <Select style={{ width: "150px" }} placeholder="请选择分类">
  508. <Select.Option
  509. key={0}
  510. value={"请选择上一项"}
  511. ></Select.Option>
  512. </Select>
  513. );
  514. }
  515. }
  516. },
  517. {
  518. title: "时间",
  519. dataIndex: "waitDay",
  520. key: "waitDay",
  521. render: (text, record) => {
  522. if (record.dunTypeName) {
  523. if(!text) {
  524. var str = ""
  525. }else {
  526. var str = text + "天";
  527. }
  528. return <span>{str}</span>;
  529. }
  530. return (
  531. <Select
  532. placeholder="请选择时间"
  533. style={{ width: "150px" }}
  534. disabled={this.state.approval != 0 && !this.state.timeFlag ? false : true}
  535. onChange={e => {
  536. console.log("ee", e);
  537. record.waitDay = e;
  538. console.log("time", record);
  539. }}
  540. >
  541. <Select.Option key={3}>3天</Select.Option>
  542. <Select.Option key={5}>5天</Select.Option>
  543. <Select.Option key={7}>7天</Select.Option>
  544. <Select.Option key={15}>15天</Select.Option>
  545. </Select>
  546. );
  547. }
  548. },
  549. {
  550. title: "金额(万)",
  551. dataIndex: "money",
  552. key: "money",
  553. render: (text, record) => {
  554. if (record.dunTypeName) {
  555. return <span>{text}</span>;
  556. }
  557. return (
  558. <div>
  559. {/* {this.state.processStatus == 0 ? (
  560. <Input
  561. value={record.money}
  562. placeholder="请输入金额(必填项)"
  563. key={record.id}
  564. required="required"
  565. onChange={e => {
  566. record.money = e.target.value;
  567. this.setState({ contactList: this.state.contactList });
  568. }}
  569. style={{ width: "120px" }}
  570. />
  571. ) : (
  572. <span>{text}</span>
  573. )} */}
  574. <Input
  575. value={record.money}
  576. placeholder="请输入金额(必填项)"
  577. key={record.id}
  578. required="required"
  579. onChange={e => {
  580. record.money = e.target.value;
  581. this.setState({ contactList: this.state.contactList });
  582. }}
  583. style={{ width: "120px" }}
  584. />
  585. </div>
  586. );
  587. }
  588. },
  589. {
  590. title: "服务年限",
  591. dataIndex: "startDate",
  592. key: "startDate",
  593. render: (text, record) => {
  594. if (record.dunTypeName) {
  595. return <span>{text}</span>;
  596. }
  597. return (
  598. <Select
  599. placeholder="请选择时间"
  600. style={{ width: "150px" }}
  601. disabled={this.state.yearFlag ? true : false}
  602. onChange={e => {
  603. console.log("ee", e);
  604. record.effectiveCount = e;
  605. console.log("year", record);
  606. }}
  607. >
  608. {/* <Select.Option key={null}>无</Select.Option> */}
  609. <Select.Option key={1}>一年</Select.Option>
  610. <Select.Option key={3}>两年</Select.Option>
  611. <Select.Option key={5}>三年</Select.Option>
  612. <Select.Option key={7}>四年</Select.Option>
  613. <Select.Option key={9}>五年</Select.Option>
  614. </Select>
  615. );
  616. }
  617. },
  618. {
  619. title: "催款状态",
  620. dataIndex: "status",
  621. key: "status",
  622. render: text => {
  623. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  624. }
  625. },
  626. {
  627. title: "操作",
  628. dataIndex: "dels",
  629. key: "dels",
  630. render: (text, record, index) => {
  631. return (
  632. <div>
  633. {this.state.processStatus == 0 ? (
  634. <Popconfirm
  635. title="是否删除?"
  636. onConfirm={() => {
  637. this.confirmDeletNew(record);
  638. }}
  639. okText="删除"
  640. cancelText="不删除"
  641. >
  642. <Button
  643. style={{
  644. marginRight: "10px",
  645. color: "#ffffff",
  646. background: "#f00",
  647. border: "none"
  648. }}
  649. >
  650. 删除
  651. </Button>
  652. </Popconfirm>
  653. ) : (
  654. ""
  655. )}
  656. {record.isSave ? (
  657. <Button
  658. type="primary"
  659. onClick={e => {
  660. this.contactSaveNew(record);
  661. this.setState({
  662. addFlag: false
  663. })
  664. }}
  665. >
  666. 保存
  667. </Button>
  668. ) : (
  669. ""
  670. )}
  671. </div>
  672. );
  673. }
  674. }
  675. ]
  676. };
  677. },
  678. departmentList() {
  679. this.setState({
  680. loading: true
  681. });
  682. $.ajax({
  683. method: "get",
  684. dataType: "json",
  685. crossDomain: false,
  686. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  687. data: {},
  688. success: function(data) {
  689. let thedata = data.data;
  690. let theArr = [];
  691. if (!thedata) {
  692. if (data.error && data.error.length) {
  693. message.warning(data.error[0].message);
  694. }
  695. thedata = {};
  696. } else {
  697. thedata.map(function(item, index) {
  698. theArr.push({
  699. key: index,
  700. name: item.name,
  701. id: item.id,
  702. depNo: item.depNo
  703. });
  704. });
  705. }
  706. this.setState({
  707. departmentArr: theArr
  708. });
  709. }.bind(this)
  710. }).always(
  711. function() {
  712. this.setState({
  713. loading: false
  714. });
  715. }.bind(this)
  716. );
  717. },
  718. //新建订单、编辑订单保存
  719. handleSubmit(e) {
  720. e.preventDefault();
  721. let theorgCodeUrl = [];
  722. if (this.state.orgCodeUrl.length) {
  723. let picArr = [];
  724. this.state.orgCodeUrl.map(function(item) {
  725. if (
  726. item.response &&
  727. item.response.data &&
  728. item.response.data.length
  729. ) {
  730. picArr.push(item.response.data);
  731. }
  732. });
  733. theorgCodeUrl = picArr.join(",");
  734. }
  735. if (this.props.userDetaile) {
  736. if (this.state.totalAmount === "") {
  737. message.warning("签单金额不能为空");
  738. this.refs.signFirstPayment.focus();
  739. return false;
  740. }
  741. if (this.state.firstAmount === "") {
  742. message.warning("首付金额不能为空");
  743. this.refs.signFirstPayment.focus();
  744. return false;
  745. }
  746. if (moneyVerify(this.state.firstAmount)) {
  747. return;
  748. }
  749. if (moneyVerify(this.state.totalAmount)) {
  750. return;
  751. }
  752. if (!theorgCodeUrl) {
  753. message.warning("图片过大,上传失败");
  754. this.refs.signFirstPayment.focus();
  755. return false;
  756. }
  757. if (!this.state.signDate) {
  758. message.warning("签单日期不能为空");
  759. this.refs.signFirstPayment.focus();
  760. return false;
  761. }
  762. if (!this.state.orderRemarks) {
  763. message.warning("订单留言不能为空");
  764. this.refs.signFirstPayment.focus();
  765. return false;
  766. }
  767. } else {
  768. }
  769. const arr = this.state.contactListNew || []
  770. for (let i = 0; i < arr.length; i++) {
  771. if (
  772. arr[i].dunType == 1 &&
  773. arr[i].waitDay &&
  774. this.state.approval == 0
  775. ) {
  776. message.warning(
  777. "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
  778. );
  779. return false;
  780. }else if(arr[i] != 1 && !arr[i].waitDay && this.state.approval == 1) {
  781. message.warning("特批存在首付催款节点未填写时间的情况,请删除后重新填写保存")
  782. return false
  783. }
  784. if (!this.state.contactListNew[i].id) {
  785. message.warning("请保存催款节点");
  786. return false;
  787. }
  788. }
  789. this.setState({
  790. loading: true
  791. });
  792. let api = this.props.userDetaile
  793. ? "/api/admin/newOrder/updateServiceOrderNew"
  794. : "/api/admin/newOrder/createOrder";
  795. $.ajax({
  796. method: "POST",
  797. dataType: "json",
  798. crossDomain: false,
  799. url: globalConfig.context + api,
  800. data: !this.props.userDetaile
  801. ? {
  802. uid: this.state.autoId,
  803. orderType: this.state.orderType
  804. }
  805. : {
  806. orderNo: this.state.orderNo, //订单编号
  807. totalAmount: this.state.totalAmount, //总金额
  808. firstAmount: this.state.firstAmount, //首付
  809. isSubmit: this.state.isSubmit, //保存草稿还是提交
  810. signDate: this.state.signDate, //签单日期
  811. contacts: this.state.contacts, //企业负责人
  812. contactMobile: this.state.contactMobile, //负责人联系方式
  813. legalPerson: this.state.legalPerson, //企业法人
  814. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  815. approval: this.state.approval, //特批状态
  816. orderRemarks: this.state.orderRemarks, //订单备注
  817. contractPictureUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  818. orderDep: this.state.organizationSearch
  819. }
  820. }).done(
  821. function(data) {
  822. this.setState({
  823. loading: false
  824. });
  825. if (!data.error.length) {
  826. message.success("保存成功!");
  827. this.handleOk();
  828. if (this.state.autoId) {
  829. this.loadData();
  830. }
  831. } else {
  832. message.warning(data.error[0].message);
  833. }
  834. }.bind(this)
  835. );
  836. },
  837. //订单详情修改
  838. xiangqingClick(e) {
  839. e.preventDefault();
  840. this.setState({
  841. loading: true
  842. });
  843. if (this.state.approval == 2 || this.state.approval == 3) {
  844. message.warning("特批状态不正确");
  845. this.setState({
  846. loading: false
  847. });
  848. return;
  849. }
  850. $.ajax({
  851. url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
  852. method: "post",
  853. data: {
  854. orderNo: this.state.orderNo, //订单编号
  855. totalAmount: this.state.totalAmount, //总金额
  856. firstAmount: this.state.firstAmount, //首付
  857. isSubmit: this.state.isSubmit, //保存草稿还是提交
  858. signDate: this.state.selTime, //签单日期
  859. contacts: this.state.contacts, //企业负责人
  860. contactMobile: this.state.contactMobile, //负责人联系方式
  861. legalPerson: this.state.legalPerson, //企业法人
  862. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  863. approval: this.state.approval, //特批状态
  864. orderRemarks: this.state.orderRemarks //订单备注
  865. }
  866. }).done(
  867. function(data) {
  868. this.setState({
  869. loading: false
  870. });
  871. if (!data.error.length) {
  872. message.success("保存成功!");
  873. this.loaduser();
  874. } else {
  875. message.warning(data.error[0].message);
  876. }
  877. }.bind(this)
  878. );
  879. },
  880. //查看基本详情基本信息
  881. loaduser(record) {
  882. this.state.orderList = [];
  883. $.ajax({
  884. method: "get",
  885. dataType: "json",
  886. crossDomain: false,
  887. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  888. data: {
  889. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  890. },
  891. success: function(data) {
  892. let thisData = data.data;
  893. if (!thisData) {
  894. if (data.error && data.error.length) {
  895. message.warning(data.error[0].message);
  896. }
  897. thisData = {};
  898. }
  899. if (thisData.approval == 2) {
  900. thisData.approval = "特批通过";
  901. } else if (thisData.approval == 3) {
  902. thisData.approval = "特批驳回";
  903. }
  904. this.setState({
  905. id: thisData.id,
  906. kehuId: thisData.buyerId,
  907. orderNo: thisData.orderNo, //订单编号
  908. orderType: thisData.orderType, //订单类型
  909. firstAmount: thisData.firstAmount, //首付金额
  910. totalAmount: thisData.totalAmount, //总金额
  911. settlementAmount: thisData.settlementAmount, //结算金额
  912. liquidationStatus: thisData.liquidationStatus, //清算状态
  913. processStatus: thisData.processStatus, //流程状态
  914. approval: thisData.approval.toString(), //特批状态
  915. orderRemarks: thisData.orderRemarks, //订单备注
  916. contractNo: thisData.contractNo, //合同编号
  917. contacts: thisData.contacts, //联系人
  918. contactMobile: thisData.contactMobile, //联系人电话
  919. legalPerson: thisData.legalPerson, //法人
  920. legalPersonTel: thisData.legalPersonTel, //法人电话
  921. contractNo: thisData.contractNo, //合同编号
  922. orgCodeUrl: thisData.contractPictureUrl
  923. ? splitUrl(
  924. thisData.contractPictureUrl,
  925. ",",
  926. globalConfig.avatarHost + "/upload"
  927. )
  928. : [], //图片地址
  929. signDate: thisData.signDate, //签单时间
  930. userName: thisData.userName, //客户名称
  931. salesmanName: thisData.salesmanName, //营销员名称
  932. salesmanMobile: thisData.salesmanMobile, //营销员电话
  933. oldSalesmanName: thisData.oldSalesmanName, //营销员名称
  934. oldSalesmanMobile: thisData.oldSalesmanMobile, //营销员电话
  935. financeName: thisData.financeName, //财务名称
  936. financeMobile: thisData.financeMobile, //财务电话
  937. nowFinanceMobile: thisData.nowFinanceMobile,
  938. nowFinance: thisData.nowFinance,
  939. contractNo: thisData.contractNo, //合同编号
  940. approval:
  941. thisData.approval == 0
  942. ? thisData.approval.toString()
  943. : thisData.approval,
  944. organizationSearch: thisData.orderDep,
  945. depName: thisData.depName,
  946. status: thisData.status
  947. });
  948. // console.log("kkkk",this.state.processStatus);
  949. }.bind(this)
  950. }).always(
  951. function() {
  952. this.setState({
  953. loading: false
  954. });
  955. }.bind(this)
  956. );
  957. },
  958. // //查看催款节点
  959. // loaduserss(record) {
  960. // this.state.orderList = [];
  961. // this.setState({
  962. // orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  963. // });
  964. // $.ajax({
  965. // method: "get",
  966. // dataType: "json",
  967. // crossDomain: false,
  968. // url: globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  969. // data: {
  970. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  971. // },
  972. // success: function(data) {
  973. // let theArr = [];
  974. // let thisData = [];
  975. // if (!thisData) {
  976. // if (data.error && data.error.length) {
  977. // message.warning(data.error[0].message);
  978. // }
  979. // thisData = {};
  980. // } else {
  981. // for (let i = 0; i < data.data.length; i++) {
  982. // thisData = data.data[i];
  983. // theArr.push({
  984. // key: i,
  985. // dunSubject: thisData.dunSubject
  986. // ? thisData.dunSubject.toString()
  987. // : "", //催款科目
  988. // id: thisData.id, //节点Id
  989. // money: thisData.money, //催款金额
  990. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  991. // commodityName: thisData.commodityName,
  992. // projectType: thisData.projectType,
  993. // dunTypeName: thisData.dunTypeName,
  994. // status: thisData.status,
  995. // waitDay: thisData.waitDay,
  996. // effectiveCount: thisData.effectiveCount,
  997. // startDate: thisData.startDate
  998. // });
  999. // }
  1000. // this.setState({
  1001. // contactList: theArr
  1002. // });
  1003. // }
  1004. // }.bind(this)
  1005. // }).always(
  1006. // function() {
  1007. // this.setState({
  1008. // loading: false
  1009. // });
  1010. // }.bind(this)
  1011. // );
  1012. // },
  1013. // //催款节点保存
  1014. // contactSave(record) {
  1015. // if(!this.state.yearFlag) {
  1016. // if(!record.effectiveCount) {
  1017. // message.warning("请选择服务年限")
  1018. // return
  1019. // }
  1020. // }else {
  1021. // record.effectiveCount = ""
  1022. // }
  1023. // if(record.money == "" ) {
  1024. // message.warning("请填写金额")
  1025. // return
  1026. // }
  1027. // if(!record.dunType) {
  1028. // message.warning("请选择对应科目")
  1029. // return
  1030. // }
  1031. // // if (this.state.contactList) {
  1032. // // let cuiData = this.state.contactList;
  1033. // // for (var a = 0; a < cuiData.length; a++) {
  1034. // // if (cuiData[a].money == "") {
  1035. // // message.warning("催款金额不能为空");
  1036. // // this.refs.signFirstPayment.focus();
  1037. // // return false;
  1038. // // } else if (!cuiData[a].dunSubject) {
  1039. // // message.warning("催款科目不能为空");
  1040. // // this.refs.signFirstPayment.focus();
  1041. // // return false;
  1042. // // }
  1043. // // if (moneyVerify(cuiData[a].money)) {
  1044. // // return;
  1045. // // }
  1046. // // }
  1047. // // }
  1048. // this.setState({
  1049. // loading: true
  1050. // });
  1051. // $.ajax({
  1052. // url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1053. // method: "post",
  1054. // data: {
  1055. // orderNo: record.orderNo,
  1056. // tid: record.tid,
  1057. // projectType: record.sort,
  1058. // dunType: record.dunType,
  1059. // money: record.money,
  1060. // waitDay: record.waitDay,
  1061. // effectiveCount: record.effectiveCount
  1062. // }
  1063. // }).done(
  1064. // function(data) {
  1065. // this.setState({
  1066. // loading: false
  1067. // });
  1068. // if (!data.error.length) {
  1069. // message.success("保存成功!");
  1070. // this.setState({
  1071. // cuiFlag: false
  1072. // });
  1073. // this.jiedian();
  1074. // } else {
  1075. // message.warning(data.error[0].message);
  1076. // }
  1077. // }.bind(this)
  1078. // );
  1079. // },
  1080. // //点击新增催款节点
  1081. // addcontact() {
  1082. // this.state.contactList.push({
  1083. // key: this.state.contactList.length,
  1084. // money: "",
  1085. // dunSubject: undefined,
  1086. // orderNo: this.state.orderNoss,
  1087. // dunTarget: this.state.kehuId
  1088. // });
  1089. // this.setState({
  1090. // contactList: this.state.contactList,
  1091. // cuiFlag: true
  1092. // });
  1093. // },
  1094. // //删除收款节点
  1095. // confirmDelet(index) {
  1096. // if (index.id) {
  1097. // this.state.contactList.splice(index.key, 1);
  1098. // this.setState({
  1099. // contactList: this.state.contactList,
  1100. // cuiFlag: false
  1101. // });
  1102. // $.ajax({
  1103. // url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1104. // method: "post",
  1105. // data: {
  1106. // id: index.id,
  1107. // }
  1108. // }).done(
  1109. // function(data) {
  1110. // this.setState({
  1111. // loading: false
  1112. // });
  1113. // if (!data.error.length) {
  1114. // message.success("删除成功!");
  1115. // this.setState({
  1116. // cuiFlag: false
  1117. // });
  1118. // this.jiedian();
  1119. // } else {
  1120. // message.warning(data.error[0].message);
  1121. // }
  1122. // }.bind(this)
  1123. // );
  1124. // } else {
  1125. // this.state.contactList.splice(index.key, 1);
  1126. // this.setState({
  1127. // contactList: this.state.contactList,
  1128. // cuiFlag: false
  1129. // });
  1130. // }
  1131. // },
  1132. //节点列表
  1133. jiedian(orderNos) {
  1134. $.ajax({
  1135. method: "get",
  1136. dataType: "json",
  1137. crossDomain: false,
  1138. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  1139. data: {
  1140. orderNo: orderNos
  1141. },
  1142. success: function(data) {
  1143. let theArr = [];
  1144. let thisData = [];
  1145. if (data.error.length || data.data.list == "") {
  1146. if (data.error && data.error.length) {
  1147. message.warning(data.error[0].message);
  1148. }
  1149. } else {
  1150. for (let i = 0; i < data.data.length; i++) {
  1151. thisData = data.data[i];
  1152. theArr.push({
  1153. key: i,
  1154. dunSubject: thisData.dunSubject
  1155. ? thisData.dunSubject.toString()
  1156. : "", //催款科目
  1157. id: thisData.id, //节点Id
  1158. money: thisData.money, //催款金额
  1159. dunStatus: thisData.dunStatus, //催款状态
  1160. orderNo: thisData.orderNo
  1161. });
  1162. }
  1163. this.setState({
  1164. contactList: theArr
  1165. });
  1166. }
  1167. }.bind(this)
  1168. }).always(
  1169. function() {
  1170. this.setState({
  1171. loading: false
  1172. });
  1173. }.bind(this)
  1174. );
  1175. },
  1176. //查看催款节点
  1177. jiedianNew(orderNos) {
  1178. $.ajax({
  1179. method: "get",
  1180. dataType: "json",
  1181. crossDomain: false,
  1182. url:
  1183. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1184. data: {
  1185. orderNo: orderNos
  1186. },
  1187. success: function(data) {
  1188. let theArr = [];
  1189. let thisData = [];
  1190. if (!thisData) {
  1191. if (data.error && data.error.length) {
  1192. message.warning(data.error[0].message);
  1193. }
  1194. thisData = {};
  1195. } else {
  1196. let arr = data.data || []
  1197. for (let i = 0; i < arr.length; i++) {
  1198. thisData = arr[i];
  1199. theArr.push({
  1200. key: i,
  1201. dunSubject: thisData.dunSubject
  1202. ? thisData.dunSubject.toString()
  1203. : "", //催款科目
  1204. id: thisData.id, //节点Id
  1205. money: thisData.money, //催款金额
  1206. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1207. commodityName: thisData.commodityName,
  1208. projectType: thisData.projectType,
  1209. dunTypeName: thisData.dunTypeName,
  1210. status: thisData.status,
  1211. waitDay: thisData.waitDay,
  1212. effectiveCount: thisData.effectiveCount,
  1213. startDate: thisData.startDate,
  1214. dunType: thisData.dunType
  1215. });
  1216. }
  1217. this.setState({
  1218. contactListNew: theArr
  1219. });
  1220. }
  1221. }.bind(this)
  1222. }).always(
  1223. function() {
  1224. this.setState({
  1225. loading: false
  1226. });
  1227. }.bind(this)
  1228. );
  1229. },
  1230. //催款节点保存
  1231. contactSave(record) {
  1232. for (let i = 0; i < this.state.contactList.length; i++) {
  1233. if (moneyVerify(this.state.contactList[i].money)) {
  1234. return;
  1235. }
  1236. }
  1237. this.setState({
  1238. loading: true
  1239. });
  1240. $.ajax({
  1241. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1242. method: "post",
  1243. data: {
  1244. orderNo: this.state.orderNo,
  1245. orderDun: JSON.stringify(this.state.contactList)
  1246. }
  1247. }).done(
  1248. function(data) {
  1249. this.setState({
  1250. loading: false
  1251. });
  1252. if (!data.error.length) {
  1253. message.success("保存成功!");
  1254. this.jiedian(record.orderNo);
  1255. } else {
  1256. message.warning(data.error[0].message);
  1257. }
  1258. }.bind(this)
  1259. );
  1260. },
  1261. //催款节点保存
  1262. contactSaveNew(record) {
  1263. if (!this.state.yearFlag) {
  1264. if (!record.effectiveCount) {
  1265. message.warning("请选择服务年限");
  1266. return;
  1267. }
  1268. } else {
  1269. record.effectiveCount = "";
  1270. }
  1271. if (record.money == "") {
  1272. message.warning("请填写金额");
  1273. return;
  1274. }
  1275. if (!record.dunType) {
  1276. message.warning("请选择对应科目");
  1277. return;
  1278. }
  1279. if (record.dunType != 1) {
  1280. record.waitDay = ""
  1281. }
  1282. this.setState({
  1283. loading: true
  1284. });
  1285. $.ajax({
  1286. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1287. method: "post",
  1288. data: {
  1289. orderNo: record.orderNo,
  1290. tid: record.tid,
  1291. projectType: record.sort,
  1292. dunType: record.dunType,
  1293. money: record.money,
  1294. waitDay: record.waitDay,
  1295. effectiveCount: record.effectiveCount
  1296. }
  1297. }).done(
  1298. function(data) {
  1299. this.setState({
  1300. loading: false
  1301. });
  1302. if (!data.error.length) {
  1303. message.success("保存成功!");
  1304. this.setState({
  1305. cuiFlag: false
  1306. });
  1307. this.jiedianNew(record.orderNo);
  1308. } else {
  1309. message.warning(data.error[0].message);
  1310. }
  1311. }.bind(this)
  1312. );
  1313. },
  1314. //点击新增催款节点
  1315. addcontact() {
  1316. this.state.contactList.push({
  1317. key: this.state.contactList.length,
  1318. money: "",
  1319. dunSubject: undefined,
  1320. orderNo: this.state.orderNo,
  1321. dunTarget: this.state.kehuId
  1322. });
  1323. this.setState({
  1324. contactList: this.state.contactList
  1325. });
  1326. },
  1327. //点击新增催款节点
  1328. addcontactNew() {
  1329. this.state.contactListNew.push({
  1330. key: this.state.contactListNew.length,
  1331. money: "",
  1332. dunSubject: undefined,
  1333. orderNo: this.state.orderNo,
  1334. dunTarget: this.state.kehuId
  1335. });
  1336. this.setState({
  1337. contactListNew: this.state.contactListNew,
  1338. cuiFlag: true
  1339. });
  1340. },
  1341. //删除收款节点
  1342. confirmDelet(index) {
  1343. this.state.contactList.splice(index, 1);
  1344. this.setState({
  1345. contactList: this.state.contactList
  1346. });
  1347. this.contactSave();
  1348. },
  1349. //删除收款节点
  1350. confirmDeletNew(index) {
  1351. console.log(index);
  1352. if (index.id) {
  1353. this.state.contactListNew.splice(index.key, 1);
  1354. this.setState({
  1355. contactListNew: this.state.contactListNew,
  1356. cuiFlag: false
  1357. });
  1358. $.ajax({
  1359. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1360. method: "post",
  1361. data: {
  1362. id: index.id
  1363. }
  1364. }).done(
  1365. function(data) {
  1366. this.setState({
  1367. loading: false
  1368. });
  1369. if (!data.error.length) {
  1370. message.success("删除成功!");
  1371. this.setState({
  1372. cuiFlag: false
  1373. });
  1374. this.jiedianNew(this.state.orderNo);
  1375. } else {
  1376. message.warning(data.error[0].message);
  1377. }
  1378. }.bind(this)
  1379. );
  1380. } else {
  1381. this.state.contactListNew.splice(index.key, 1);
  1382. this.setState({
  1383. contactListNew: this.state.contactListNew,
  1384. cuiFlag: false
  1385. });
  1386. }
  1387. },
  1388. handleOk() {
  1389. this.setState({
  1390. visible: false,
  1391. mark: false
  1392. });
  1393. this.props.closeDesc(false, true);
  1394. },
  1395. handleCancel() {
  1396. if (this.state.orderType == undefined) {
  1397. return false;
  1398. }
  1399. if (!this.state.autoId) {
  1400. return false;
  1401. }
  1402. this.setState({
  1403. visible: false,
  1404. mark: false
  1405. });
  1406. this.props.closeDesc(false);
  1407. },
  1408. handleCancelclose() {
  1409. this.setState(
  1410. {
  1411. visible: false,
  1412. mark: false,
  1413. cuiFlag: false,
  1414. addFlag: false
  1415. },
  1416. () => {
  1417. this.setState({
  1418. activeKey: "1"
  1419. });
  1420. }
  1421. );
  1422. this.props.closeDesc(false);
  1423. this.reset();
  1424. },
  1425. //点击签单
  1426. handleCancels() {
  1427. this.setState({
  1428. isSubmit: 1
  1429. });
  1430. },
  1431. //点击签单
  1432. handleCancelq() {
  1433. this.setState({
  1434. isSubmit: 0
  1435. });
  1436. },
  1437. //删除
  1438. delectRow(record) {
  1439. this.setState({
  1440. loading: true
  1441. });
  1442. $.ajax({
  1443. method: "post",
  1444. dataType: "json",
  1445. crossDomain: false,
  1446. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1447. data: {
  1448. id: record.id
  1449. }
  1450. }).done(
  1451. function(data) {
  1452. if (!data.error.length) {
  1453. message.success("删除成功!");
  1454. this.setState({
  1455. loading: false
  1456. });
  1457. this.jiedian(this.state.orderNo);
  1458. this.jiedianNew(this.state.orderNo);
  1459. this.loaduser();
  1460. this.loadData();
  1461. } else {
  1462. message.warning(data.error[0].message);
  1463. }
  1464. }.bind(this)
  1465. );
  1466. },
  1467. nextCancel() {
  1468. this.setState({
  1469. addnextVisible: false
  1470. });
  1471. },
  1472. rizhi() {
  1473. this.setState({
  1474. loading: true
  1475. });
  1476. $.ajax({
  1477. method: "get",
  1478. dataType: "json",
  1479. crossDomain: false,
  1480. url: "/api/admin/newOrder/selectOrderLog",
  1481. data: {
  1482. orderNo: this.props.datauser.orderNo
  1483. },
  1484. success: function(data) {
  1485. let theArr = [];
  1486. let thisData = data.data;
  1487. if (!thisData.length) {
  1488. if (data.error && data.error.length) {
  1489. message.warning(data.error[0].message);
  1490. }
  1491. thisData = {};
  1492. } else {
  1493. for (let i = 0; i < data.data.length; i++) {
  1494. let thisdata = data.data[i];
  1495. theArr.push({
  1496. processName: thisdata.processName,
  1497. adminName: thisdata.adminName,
  1498. createDate: thisdata.createDate
  1499. });
  1500. }
  1501. }
  1502. this.setState({
  1503. dataSourcerizhi: theArr
  1504. });
  1505. }.bind(this)
  1506. }).always(
  1507. function() {
  1508. this.setState({
  1509. loading: false
  1510. });
  1511. }.bind(this)
  1512. );
  1513. },
  1514. //查看订单日志
  1515. getOrderLog() {
  1516. this.setState({
  1517. rizhivisible: true
  1518. });
  1519. this.rizhi();
  1520. },
  1521. closeOrderLog() {
  1522. this.setState({
  1523. rizhivisible: false
  1524. });
  1525. },
  1526. callback(key) {
  1527. this.setState({
  1528. activeKey: key
  1529. });
  1530. if (key === "2") {
  1531. let url = window.location.href.substring(7);
  1532. $.ajax({
  1533. method: "get",
  1534. dataType: "json",
  1535. crossDomain: false,
  1536. url:
  1537. globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  1538. data: {
  1539. orderNo: this.props.datauser.orderNo
  1540. },
  1541. success: function(data) {
  1542. // console.log(data.data);
  1543. if (data.data) {
  1544. let thisdata = data.data;
  1545. // console.log(this.state.userName);
  1546. Object.assign(thisdata, {
  1547. userName: this.state.userName,
  1548. contractNo: this.state.contractNo,
  1549. arrears: this.state.arrears
  1550. });
  1551. this.setState({
  1552. mark: true,
  1553. contractData: thisdata,
  1554. voucherUrl: thisdata.voucherUrl
  1555. ? splitUrl(
  1556. thisdata.voucherUrl,
  1557. ",",
  1558. globalConfig.avatarHost + "/upload",
  1559. url
  1560. )
  1561. : []
  1562. });
  1563. }
  1564. }.bind(this)
  1565. });
  1566. }
  1567. },
  1568. getOrgCodeUrl(e) {
  1569. this.setState({ orgCodeUrl: e });
  1570. },
  1571. getVoucherUrl(e) {
  1572. this.setState({ voucherUrl: e });
  1573. },
  1574. //加载(自动补全)
  1575. supervisor(e, state) {
  1576. //客户名称与服务名称自动补全
  1577. let api = state
  1578. ? "/api/admin/customer/getCustomerByName"
  1579. : "/api/admin/order/getBusinessProjectByName";
  1580. $.ajax({
  1581. method: "get",
  1582. dataType: "json",
  1583. crossDomain: false,
  1584. url: globalConfig.context + api,
  1585. data: state
  1586. ? {
  1587. name: e,
  1588. type: this.state.customType
  1589. }
  1590. : {
  1591. businessName: e
  1592. },
  1593. success: function(data) {
  1594. let thedata = data.data;
  1595. if (!thedata) {
  1596. if (data.error && data.error.length) {
  1597. message.warning(data.error[0].message);
  1598. }
  1599. thedata = {};
  1600. }
  1601. this.setState({
  1602. states: state,
  1603. customerArr: thedata
  1604. });
  1605. }.bind(this)
  1606. }).always(
  1607. function() {
  1608. this.setState({
  1609. loading: false
  1610. });
  1611. }.bind(this)
  1612. );
  1613. },
  1614. supervisorCui(e) {
  1615. //客户名称与服务名称自动补全
  1616. let api = "/api/admin/order/getBusinessProjectByName";
  1617. $.ajax({
  1618. method: "get",
  1619. dataType: "json",
  1620. crossDomain: false,
  1621. url: globalConfig.context + api,
  1622. data: {
  1623. businessName: e
  1624. },
  1625. success: function(data) {
  1626. let thedata = data.data;
  1627. if (!thedata) {
  1628. if (data.error && data.error.length) {
  1629. message.warning(data.error[0].message);
  1630. }
  1631. thedata = {};
  1632. }
  1633. this.setState({
  1634. customerCuiArr: thedata
  1635. });
  1636. console.log(thedata);
  1637. }.bind(this)
  1638. }).always(
  1639. function() {
  1640. this.setState({
  1641. loading: false
  1642. });
  1643. }.bind(this)
  1644. );
  1645. },
  1646. //上级主管输入框失去焦点是判断客户是否存在
  1647. selectAuto(value) {
  1648. let kid = [];
  1649. let fwList = this.state.customerArr;
  1650. fwList.map(function(item) {
  1651. if (value == item.bname) {
  1652. kid = item;
  1653. }
  1654. });
  1655. this.setState({
  1656. commodityName: value,
  1657. gid: kid.id,
  1658. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1659. commodityFirstPayment:
  1660. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  1661. });
  1662. },
  1663. selectAutoCui(value) {
  1664. let kid = [];
  1665. let fwList = this.state.customerCuiArr;
  1666. fwList.map(function(item) {
  1667. if (value == item.bname) {
  1668. kid = item;
  1669. }
  1670. });
  1671. this.setState({
  1672. commodityNameCui: value,
  1673. cid: kid.id,
  1674. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1675. commodityFirstPayment:
  1676. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  1677. });
  1678. },
  1679. //客户
  1680. selectAutoCUT(value) {
  1681. let autoIds;
  1682. let fwList = this.state.customerArr;
  1683. fwList.map(function(item) {
  1684. if (value == item.name) {
  1685. autoIds = item.id;
  1686. }
  1687. });
  1688. this.setState({
  1689. customerName: value,
  1690. autoId: autoIds
  1691. });
  1692. },
  1693. //服务值改变时请求客户名称
  1694. httpChange(e) {
  1695. this.state.gid = "";
  1696. if (e.length >= 1) {
  1697. this.supervisor(e, false);
  1698. }
  1699. this.setState({
  1700. commodityName: e
  1701. });
  1702. },
  1703. httpChangeCui(e) {
  1704. if (e.length >= 1) {
  1705. this.supervisorCui(e, false);
  1706. }
  1707. this.setState({
  1708. commodityNameCui: e
  1709. });
  1710. },
  1711. //客户名称自动补全
  1712. customerChange(e) {
  1713. if (this.state.customType) {
  1714. this.state.autoId = "";
  1715. if (e.length >= 2) {
  1716. this.supervisor(e, true);
  1717. }
  1718. this.setState({
  1719. customerName: e
  1720. });
  1721. } else {
  1722. this.setState({
  1723. customerName: ""
  1724. });
  1725. message.warning("客户所属类型必须指定");
  1726. }
  1727. },
  1728. //点击添加项目明细
  1729. addDetailed() {
  1730. this.setState({
  1731. gid: "",
  1732. customerArr: [],
  1733. commodityName: "",
  1734. commodityQuantity: "",
  1735. commodityId: "",
  1736. taskComment: "",
  1737. main: undefined,
  1738. commodityPrice: "",
  1739. addState: 1,
  1740. addnextVisible: true
  1741. });
  1742. },
  1743. //新建项目明细保存
  1744. nextSubmit(e) {
  1745. e.preventDefault();
  1746. if (this.state.gid == undefined || !this.state.gid) {
  1747. message.warning("服务名称不匹配!");
  1748. return false;
  1749. }
  1750. if (!this.state.commodityPrice) {
  1751. message.warning("请输入金额!");
  1752. this.refs.commodityPrice.focus();
  1753. return false;
  1754. }
  1755. if (!this.state.commodityQuantity) {
  1756. message.warning("请输入商品数量!");
  1757. this.refs.commodityQuantity.focus();
  1758. return false;
  1759. }
  1760. if (!this.state.main) {
  1761. message.warning("请选择是否为主要项目!");
  1762. this.refs.commodityQuantity.focus();
  1763. return false;
  1764. }
  1765. this.setState({
  1766. loading: true
  1767. });
  1768. let api = this.state.addState
  1769. ? "/api/admin/newOrder/addOrderTask"
  1770. : "/api/bianji";
  1771. $.ajax({
  1772. method: "POST",
  1773. dataType: "json",
  1774. crossDomain: false,
  1775. url: globalConfig.context + api,
  1776. data: {
  1777. commodityId: this.state.gid, //商品ID
  1778. orderNo: this.props.datauser.orderNo, //订单编号
  1779. commodityName: this.state.commodityName, //商品名称
  1780. commodityQuantity: this.state.commodityQuantity, //商品数量
  1781. commodityPrice: this.state.commodityPrice, //签单总价
  1782. taskComment: this.state.taskComment, //服务说明
  1783. main: this.state.main //是否为主要项目
  1784. }
  1785. }).done(
  1786. function(data) {
  1787. this.setState({
  1788. loading: false
  1789. });
  1790. if (!data.error.length) {
  1791. message.success("保存成功!");
  1792. this.nextCancel();
  1793. //this.loaduser(this.props.datauser);
  1794. this.loadData();
  1795. } else {
  1796. message.warning(data.error[0].message);
  1797. }
  1798. }.bind(this)
  1799. );
  1800. },
  1801. //点击打卡项目详情
  1802. tableRowClick(record) {
  1803. this.setState({
  1804. jid: record.id, //项目ID
  1805. kid: record.commodityId, //商品ID
  1806. commodityName: record.commodityName, //金额
  1807. commodityPrice: record.commodityPrice, //金额
  1808. commodityQuantity: record.commodityQuantity, //数量
  1809. taskComment: record.taskComment, //备注
  1810. main: record.main.toString(), //是否为主要
  1811. addnextVisible: true,
  1812. addState: 0
  1813. });
  1814. },
  1815. //修改项目详情
  1816. tabRowSave(e) {
  1817. e.preventDefault();
  1818. if (!this.state.commodityPrice) {
  1819. message.warning("金额不能为空!");
  1820. return false;
  1821. }
  1822. if (!this.state.commodityQuantity) {
  1823. message.warning("数量不能为空!");
  1824. return false;
  1825. }
  1826. if (!this.state.main) {
  1827. message.warning("请选择是否为主要项目!");
  1828. this.refs.commodityQuantity.focus();
  1829. return false;
  1830. }
  1831. $.ajax({
  1832. method: "POST",
  1833. dataType: "json",
  1834. crossDomain: false,
  1835. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  1836. data: {
  1837. id: this.state.jid, //项目ID
  1838. commodityId: this.state.kid, //商品ID
  1839. orderNo: this.props.datauser.orderNo, //订单编号
  1840. main: this.state.main, //是否为主要
  1841. commodityPrice: this.state.commodityPrice, //金额
  1842. commodityQuantity: this.state.commodityQuantity, //数量
  1843. taskComment: this.state.taskComment //备注
  1844. }
  1845. }).done(
  1846. function(data) {
  1847. this.setState({
  1848. loading: false
  1849. });
  1850. if (!data.error.length) {
  1851. message.success("保存成功!");
  1852. this.nextCancel();
  1853. //this.loaduser(this.props.datauser);
  1854. this.loadData();
  1855. } else {
  1856. message.warning(data.error[0].message);
  1857. }
  1858. }.bind(this)
  1859. );
  1860. },
  1861. //签单时间选择
  1862. selTime(e, index) {
  1863. this.setState({
  1864. entryTime: e,
  1865. signDate: e,
  1866. selTime: index
  1867. });
  1868. },
  1869. //退单操作
  1870. //点击退单
  1871. tuikuan() {
  1872. this.setState({
  1873. lookVisible: true,
  1874. contractUrl: [],
  1875. applicationUrl: [],
  1876. reason: ""
  1877. });
  1878. },
  1879. //关闭退单
  1880. noCancel() {
  1881. this.setState({
  1882. lookVisible: false
  1883. });
  1884. },
  1885. //点击确认退单
  1886. tuidanOk() {
  1887. let contractUrls = [];
  1888. let applicationUrls = [];
  1889. if (this.state.contractUrl.length) {
  1890. let picArr = [];
  1891. this.state.contractUrl.map(function(item) {
  1892. if (
  1893. item.response &&
  1894. item.response.data &&
  1895. item.response.data.length
  1896. ) {
  1897. picArr.push(item.response.data);
  1898. }
  1899. });
  1900. contractUrls = picArr.join(",");
  1901. }
  1902. if (this.state.applicationUrl.length) {
  1903. let picArr = [];
  1904. this.state.applicationUrl.map(function(item) {
  1905. if (
  1906. item.response &&
  1907. item.response.data &&
  1908. item.response.data.length
  1909. ) {
  1910. picArr.push(item.response.data);
  1911. }
  1912. });
  1913. applicationUrls = picArr.join(",");
  1914. }
  1915. $.ajax({
  1916. method: "POST",
  1917. dataType: "json",
  1918. crossDomain: false,
  1919. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  1920. data: {
  1921. orderNo: this.state.orderNo, //订单编号
  1922. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  1923. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  1924. reason: this.state.reason //退单原因
  1925. }
  1926. }).done(
  1927. function(data) {
  1928. this.setState({
  1929. loading: false
  1930. });
  1931. if (!data.error.length) {
  1932. message.success("退单成功!");
  1933. this.noCancel();
  1934. this.handleCancelclose();
  1935. } else {
  1936. message.warning(data.error[0].message);
  1937. }
  1938. }.bind(this)
  1939. );
  1940. },
  1941. //开单选择订单类型骚操作
  1942. orderTypeFn(e) {
  1943. if (e == 0) {
  1944. this.setState({
  1945. bussStats: true,
  1946. orderType: e
  1947. });
  1948. this.category();
  1949. } else {
  1950. this.setState({
  1951. contractType: undefined,
  1952. bussStats: false,
  1953. orderType: e
  1954. });
  1955. }
  1956. },
  1957. //品类数据获取
  1958. category() {
  1959. $.ajax({
  1960. method: "get",
  1961. dataType: "json",
  1962. crossDomain: false,
  1963. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1964. data: {},
  1965. success: function(data) {
  1966. let thedata = data.data;
  1967. let theArr = [];
  1968. if (!thedata) {
  1969. if (data.error && data.error.length) {
  1970. message.warning(data.error[0].message);
  1971. }
  1972. thedata = {};
  1973. } else {
  1974. thedata.map(function(item, index) {
  1975. theArr.push({
  1976. key: index,
  1977. name: item.cname,
  1978. id: item.id
  1979. });
  1980. });
  1981. }
  1982. this.setState({
  1983. contractType: undefined,
  1984. categoryArr: theArr
  1985. });
  1986. }.bind(this)
  1987. });
  1988. },
  1989. //变更申请
  1990. changeApply() {
  1991. if (this.state.processStatus <= 4) {
  1992. message.warning("当前订单流程不能发起变更!");
  1993. return false;
  1994. }
  1995. if (this.state.changeAmount == "") {
  1996. message.warning("申请退款金额不能为空!");
  1997. // console.log(this.state.changeAmount);
  1998. return false;
  1999. }
  2000. if (this.state.remarksC.trim() == "") {
  2001. message.warning("请正确填写变更原因");
  2002. return false;
  2003. }
  2004. if (this.state.startRemarks.trim() == "") {
  2005. message.warning("请正确填写备注信息");
  2006. return false;
  2007. }
  2008. let theorgCodeUrl = [];
  2009. if (this.state.voucherUrl.length) {
  2010. let picArr = [];
  2011. this.state.voucherUrl.map(function(item) {
  2012. if (
  2013. item.response &&
  2014. item.response.data &&
  2015. item.response.data.length
  2016. ) {
  2017. picArr.push(item.response.data);
  2018. }
  2019. });
  2020. theorgCodeUrl = picArr.join(",");
  2021. }
  2022. $.ajax({
  2023. method: "post",
  2024. dataType: "json",
  2025. crossDomain: false,
  2026. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2027. data: {
  2028. orderNo: this.state.orderNo, //订单编号
  2029. processState: 0,
  2030. status: 1,
  2031. startRemarks: this.state.startRemarks,
  2032. remarks: this.state.remarksC,
  2033. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2034. totalAmount: this.state.totalAmount,
  2035. settlementAmount: this.state.settlementAmount,
  2036. changeAmount: this.state.changeAmount,
  2037. applicant: this.state.salesmanName,
  2038. depName: this.state.depName,
  2039. type: this.state.typeChange
  2040. }
  2041. }).done(
  2042. function(data) {
  2043. this.setState({
  2044. loading: false
  2045. });
  2046. if (!data.error.length) {
  2047. message.success("变更成功!");
  2048. this.noCancel();
  2049. this.handleCancelclose();
  2050. } else {
  2051. message.warning(data.error[0].message);
  2052. }
  2053. }.bind(this)
  2054. );
  2055. },
  2056. componentDidMount() {
  2057. window.setTimeout(() => {
  2058. // console.log("我看看", this.state);
  2059. }, 100);
  2060. },
  2061. reset() {
  2062. this.setState({
  2063. startRemarks: "",
  2064. remarksC: "",
  2065. voucherUrl: [],
  2066. totalAmount: undefined,
  2067. settlementAmount: undefined,
  2068. changeAmount: "0",
  2069. applicant: undefined,
  2070. depNameChange: undefined,
  2071. typeChange: 0
  2072. });
  2073. },
  2074. componentWillReceiveProps(nextProps) {
  2075. //props改变时触发
  2076. this.state.visible = nextProps.showDesc;
  2077. this.state.signBillVisible = nextProps.signBillVisible;
  2078. if (this.state.signBillVisible) {
  2079. this.loaduser(nextProps.uid);
  2080. }
  2081. if (nextProps.userDetaile && nextProps.showDesc) {
  2082. this.loaduser(nextProps.datauser);
  2083. this.jiedian(nextProps.datauser.orderNo);
  2084. this.jiedianNew(nextProps.datauser.orderNo);
  2085. this.loadData(nextProps.datauser);
  2086. } else {
  2087. this.setState({
  2088. orderType: undefined,
  2089. customerName: "",
  2090. autoId: "",
  2091. customerArr: [],
  2092. contractType: undefined,
  2093. bussStats: false,
  2094. customType: undefined
  2095. });
  2096. }
  2097. },
  2098. showConfirm(fn,record) {
  2099. confirm({
  2100. title: '确定删除此项目吗?',
  2101. content: <span style={{ color: "red" }}>删除后会将该项目下的所有催款节点自动清除!!!</span>,
  2102. onOk() {
  2103. fn(record)
  2104. },
  2105. onCancel() {
  2106. },
  2107. });
  2108. },
  2109. render() {
  2110. const FormItem = Form.Item;
  2111. const { TabPane } = Tabs;
  2112. const { TextArea } = Input;
  2113. const formItemLayout = {
  2114. labelCol: { span: 8 },
  2115. wrapperCol: { span: 14 }
  2116. };
  2117. const contractData = this.state.contractData;
  2118. const formItemList = [
  2119. {
  2120. label: "企业联系人",
  2121. content: <span>{this.state.contacts}</span>
  2122. },
  2123. {
  2124. label: "联系人电话",
  2125. content: <span>{this.state.contactMobile}</span>
  2126. },
  2127. {
  2128. label: "企业法人",
  2129. content: <span>{this.state.legalPerson}</span>
  2130. },
  2131. {
  2132. label: "法人电话",
  2133. content: <span>{this.state.legalPersonTel}</span>
  2134. },
  2135. // {
  2136. // label: "签单金额(万元)",
  2137. // content: <span>{this.state.totalAmount}</span>
  2138. // },
  2139. // {
  2140. // label: "首付金额(万元)",
  2141. // content: <span>{this.state.firstAmount}</span>
  2142. // },
  2143. {
  2144. label: "特批立项",
  2145. content: <span>{getApprovedState(this.state.approval)}</span>
  2146. },
  2147. {
  2148. label: "合同签订时间",
  2149. content: <span>{this.state.signDate}</span>
  2150. },
  2151. {
  2152. label: "订单部门",
  2153. content: <span>{this.state.depName}</span>
  2154. }
  2155. ];
  2156. const dataSources = this.state.customerArr || [];
  2157. const cuiDataList = this.state.contactList || [];
  2158. let departmentArr = this.state.departmentArr || [];
  2159. const options = this.state.states
  2160. ? dataSources.map(group => (
  2161. <Select.Option key={group.id} value={group.name}>
  2162. {group.name}
  2163. </Select.Option>
  2164. ))
  2165. : dataSources.map((group, index) => (
  2166. <Select.Option key={index} value={group.bname}>
  2167. {group.bname}
  2168. </Select.Option>
  2169. ));
  2170. return (
  2171. <div>
  2172. <Modal
  2173. maskClosable={false}
  2174. visible={this.state.visible}
  2175. onOk={this.handleOk}
  2176. onCancel={this.handleCancelclose}
  2177. width={!this.props.userDetaile ? "600px" : "900px"}
  2178. title={!this.props.userDetaile ? "创建订单" : ""}
  2179. footer=""
  2180. // width={1300}
  2181. className="admin-desc-content"
  2182. >
  2183. <Form
  2184. layout="horizontal"
  2185. onSubmit={this.handleSubmit}
  2186. id="demand-form"
  2187. style={{ paddingBottom: "40px" }}
  2188. >
  2189. <Spin spinning={this.state.loading}>
  2190. <div className="clearfix">
  2191. {!this.props.userDetaile ? (
  2192. <div className="clearfix">
  2193. <div className="clearfix">
  2194. <FormItem {...formItemLayout} label="订单类型">
  2195. <Select
  2196. placeholder="请选择订单类型"
  2197. style={{ width: "200px" }}
  2198. value={this.state.orderType}
  2199. onChange={e => {
  2200. this.setState({ orderType: e });
  2201. }}
  2202. >
  2203. {orderTypes.map(function(item) {
  2204. return (
  2205. <Select.Option key={item.value}>
  2206. {item.key}
  2207. </Select.Option>
  2208. );
  2209. })}
  2210. </Select>
  2211. <span className="mandatory">*</span>
  2212. </FormItem>
  2213. </div>
  2214. <FormItem {...formItemLayout} label="客户所属类型">
  2215. <Select
  2216. placeholder="请选择客户所属类型"
  2217. style={{ width: "200px" }}
  2218. value={this.state.customType}
  2219. onChange={e => {
  2220. this.setState({ customType: e });
  2221. }}
  2222. >
  2223. {customerType.map(function(item) {
  2224. return (
  2225. <Select.Option key={item.value}>
  2226. {item.key}
  2227. </Select.Option>
  2228. );
  2229. })}
  2230. </Select>
  2231. </FormItem>
  2232. <div className="clearfix">
  2233. <FormItem {...formItemLayout} label="客户名称">
  2234. <AutoComplete
  2235. className="certain-category-search"
  2236. dropdownClassName="certain-category-search-dropdown"
  2237. dropdownMatchSelectWidth={false}
  2238. dropdownStyle={{ width: 200 }}
  2239. size="large"
  2240. style={{ width: "200px" }}
  2241. dataSource={options}
  2242. placeholder="输入名称"
  2243. value={this.state.customerName}
  2244. onChange={this.customerChange}
  2245. filterOption={true}
  2246. onSelect={this.selectAutoCUT}
  2247. >
  2248. <Input />
  2249. </AutoComplete>
  2250. <span className="mandatory">*</span>
  2251. </FormItem>
  2252. </div>
  2253. <div className="addSave" style={{ marginTop: "15px" }}>
  2254. <Button
  2255. className="cancel"
  2256. type="primary"
  2257. onClick={this.handleCancel}
  2258. style={{ marginLeft: "150px" }}
  2259. htmlType="submit"
  2260. >
  2261. 开单
  2262. </Button>
  2263. <Button
  2264. className="cancel"
  2265. type="ghost"
  2266. onClick={this.handleCancelclose}
  2267. style={{ marginLeft: "50px" }}
  2268. >
  2269. 取消
  2270. </Button>
  2271. </div>
  2272. </div>
  2273. ) : (
  2274. <Tabs
  2275. onChange={this.callback}
  2276. activeKey={this.state.activeKey}
  2277. >
  2278. <TabPane tab={"编辑订单"} key="1">
  2279. <div className="clearfix">
  2280. <div className="clearfix">
  2281. <FormItem
  2282. className="half-item"
  2283. {...formItemLayout}
  2284. label="合同编号"
  2285. >
  2286. {<span>{this.state.contractNo}</span>}
  2287. </FormItem>
  2288. <FormItem
  2289. className="half-item"
  2290. {...formItemLayout}
  2291. label="订单编号"
  2292. >
  2293. <span>{this.state.orderNo}</span>
  2294. </FormItem>
  2295. <FormItem
  2296. className="half-item"
  2297. {...formItemLayout}
  2298. label="流程状态"
  2299. >
  2300. <span>
  2301. {getProcessStatus(this.state.processStatus)}
  2302. </span>
  2303. </FormItem>
  2304. <FormItem
  2305. className="half-item"
  2306. {...formItemLayout}
  2307. label="结算状态"
  2308. >
  2309. <span>
  2310. {getLiquidationStatus(
  2311. this.state.liquidationStatus
  2312. )}
  2313. </span>
  2314. </FormItem>
  2315. {this.state.processStatus === 0 ? (
  2316. <div className="clearfix">
  2317. <FormItem
  2318. className="half-item"
  2319. {...formItemLayout}
  2320. label="特批立项"
  2321. >
  2322. <Select
  2323. placeholder="请选择客户所属类型"
  2324. style={{ width: "240px" }}
  2325. value={getApprovedState(
  2326. this.state.approval
  2327. )}
  2328. onChange={e => {
  2329. this.setState({ approval: e });
  2330. }}
  2331. >
  2332. {/* {tepi.map(function(item) {
  2333. // if(item.key == "特批通过" || item.key == "特批驳回")
  2334. return (
  2335. <Select.Option key={item.value}>
  2336. {item.key}
  2337. </Select.Option>
  2338. );
  2339. })} */}
  2340. <Select.Option key={0}>
  2341. 非特批
  2342. </Select.Option>
  2343. <Select.Option key={1}>特批</Select.Option>
  2344. </Select>
  2345. </FormItem>
  2346. <FormItem
  2347. className="half-item"
  2348. {...formItemLayout}
  2349. label="合同签订时间"
  2350. >
  2351. <DatePicker
  2352. style={{
  2353. marginTop: "2px",
  2354. // width: "240px",
  2355. height: "32px"
  2356. }}
  2357. showTime
  2358. format="YYYY-MM-DD"
  2359. onOk={() => {}}
  2360. value={
  2361. this.state.signDate
  2362. ? moment(this.state.signDate)
  2363. : null
  2364. }
  2365. onChange={(data, dataString) => {
  2366. this.setState({ signDate: dataString });
  2367. }}
  2368. />
  2369. <span
  2370. className="mandatory"
  2371. style={{ marginLeft: 20 }}
  2372. >
  2373. *
  2374. </span>
  2375. </FormItem>
  2376. <FormItem
  2377. className="half-item"
  2378. {...formItemLayout}
  2379. label="订单部门"
  2380. >
  2381. <Select
  2382. placeholder="请输入订单部门"
  2383. style={{ width: 240 }}
  2384. value={this.state.organizationSearch}
  2385. onChange={e => {
  2386. this.setState({ organizationSearch: e });
  2387. }}
  2388. >
  2389. {departmentArr.map(function(item) {
  2390. return (
  2391. <Select.Option key={item.id}>
  2392. {item.name}
  2393. </Select.Option>
  2394. );
  2395. })}
  2396. </Select>
  2397. </FormItem>
  2398. </div>
  2399. ) : (
  2400. <div className="clearfix">
  2401. <FormItem
  2402. className="half-item"
  2403. {...formItemLayout}
  2404. label="特批立项"
  2405. >
  2406. <span>
  2407. {getApprovedState(this.state.approval)}
  2408. </span>
  2409. </FormItem>
  2410. <FormItem
  2411. className="half-item"
  2412. {...formItemLayout}
  2413. label="合同签订时间"
  2414. >
  2415. <span>{this.state.signDate}</span>
  2416. </FormItem>
  2417. <FormItem
  2418. className="half-item"
  2419. {...formItemLayout}
  2420. label="订单部门"
  2421. >
  2422. <span>{this.state.depName}</span>
  2423. </FormItem>
  2424. </div>
  2425. )}
  2426. </div>
  2427. <h3
  2428. style={{
  2429. marginLeft: 10,
  2430. fontWeight: 800,
  2431. marginBottom: 10
  2432. }}
  2433. >
  2434. 收款项目
  2435. </h3>
  2436. {this.state.processStatus === 0 ? (
  2437. <div className="clearfix">
  2438. <FormItem
  2439. className="half-item"
  2440. {...formItemLayout}
  2441. label="签单金额(万元)"
  2442. >
  2443. <Input
  2444. placeholder="签单金额"
  2445. ref="signTotalAmount"
  2446. value={this.state.totalAmount}
  2447. onChange={e => {
  2448. this.setState({
  2449. totalAmount: e.target.value
  2450. });
  2451. }}
  2452. style={{ width: "240px" }}
  2453. />
  2454. {/* <span className="mandatory">*</span> */}
  2455. </FormItem>
  2456. <FormItem
  2457. className="half-item"
  2458. {...formItemLayout}
  2459. label="首付金额(万元)"
  2460. >
  2461. <Input
  2462. placeholder="请输入实签首款金额"
  2463. ref="signFirstPayment"
  2464. value={this.state.firstAmount}
  2465. onChange={e => {
  2466. this.setState({
  2467. firstAmount: e.target.value
  2468. });
  2469. }}
  2470. style={{ width: "240px" }}
  2471. />
  2472. {/* <span className="mandatory">*</span> */}
  2473. </FormItem>
  2474. <FormItem
  2475. className="half-item"
  2476. {...formItemLayout}
  2477. label="已收款项"
  2478. >
  2479. <span>
  2480. {this.state.settlementAmount + "万元"}
  2481. </span>
  2482. {/* {this.state.settlementAmount ? (
  2483. <Button
  2484. type="primary"
  2485. onClick={this.tuikuan}
  2486. style={{
  2487. float: "right",
  2488. marginRight: "50px",
  2489. marginBottom: "15px"
  2490. }}
  2491. >
  2492. 退单
  2493. </Button>
  2494. ) : (
  2495. ""
  2496. )} */}
  2497. </FormItem>
  2498. </div>
  2499. ) : (
  2500. <div className="clearfix">
  2501. <FormItem
  2502. className="half-item"
  2503. {...formItemLayout}
  2504. label="签单金额(万元)"
  2505. >
  2506. <span>{this.state.totalAmount}</span>
  2507. </FormItem>
  2508. <FormItem
  2509. className="half-item"
  2510. {...formItemLayout}
  2511. label="首付金额(万元)"
  2512. >
  2513. <span>{this.state.firstAmount}</span>
  2514. </FormItem>
  2515. <FormItem
  2516. className="half-item"
  2517. {...formItemLayout}
  2518. label="已收款项"
  2519. >
  2520. <span>
  2521. {this.state.settlementAmount + "万元"}
  2522. </span>
  2523. {/* {this.state.settlementAmount ? (
  2524. <Button
  2525. type="primary"
  2526. onClick={this.tuikuan}
  2527. style={{
  2528. float: "right",
  2529. marginRight: "50px",
  2530. marginBottom: "15px"
  2531. }}
  2532. >
  2533. 退单
  2534. </Button>
  2535. ) : (
  2536. ""
  2537. )} */}
  2538. </FormItem>
  2539. </div>
  2540. )}
  2541. <h3
  2542. style={{
  2543. marginLeft: 10,
  2544. fontWeight: 800,
  2545. marginBottom: 10
  2546. }}
  2547. >
  2548. 联系信息
  2549. </h3>
  2550. {this.state.processStatus == 0 ? (
  2551. <div className="clearfix">
  2552. <div className="clearfix">
  2553. <FormItem
  2554. className="half-item"
  2555. {...formItemLayout}
  2556. label="客户名称"
  2557. >
  2558. <span>{this.state.userName}</span>
  2559. </FormItem>
  2560. </div>
  2561. <FormItem
  2562. className="half-item"
  2563. {...formItemLayout}
  2564. label="企业联系人"
  2565. >
  2566. <Input
  2567. placeholder="请输入联系人"
  2568. ref="signTotalAmount"
  2569. value={this.state.contacts}
  2570. onChange={e => {
  2571. this.setState({ contacts: e.target.value });
  2572. }}
  2573. style={{ width: "240px" }}
  2574. />
  2575. </FormItem>
  2576. <FormItem
  2577. className="half-item"
  2578. {...formItemLayout}
  2579. label="联系人电话"
  2580. >
  2581. <Input
  2582. placeholder="请输入联系人电话"
  2583. ref="signTotalAmount"
  2584. value={this.state.contactMobile}
  2585. onChange={e => {
  2586. this.setState({
  2587. contactMobile: e.target.value
  2588. });
  2589. }}
  2590. style={{ width: "240px" }}
  2591. />
  2592. </FormItem>
  2593. <FormItem
  2594. className="half-item"
  2595. {...formItemLayout}
  2596. label="企业法人"
  2597. >
  2598. <Input
  2599. placeholder="请输入法人"
  2600. ref="signTotalAmount"
  2601. value={this.state.legalPerson}
  2602. onChange={e => {
  2603. this.setState({
  2604. legalPerson: e.target.value
  2605. });
  2606. }}
  2607. style={{ width: "240px" }}
  2608. />
  2609. </FormItem>
  2610. <FormItem
  2611. className="half-item"
  2612. {...formItemLayout}
  2613. label="法人电话"
  2614. >
  2615. <Input
  2616. placeholder="请输入法人电话"
  2617. ref="signTotalAmount"
  2618. value={this.state.legalPersonTel}
  2619. onChange={e => {
  2620. this.setState({
  2621. legalPersonTel: e.target.value
  2622. });
  2623. }}
  2624. style={{ width: "240px" }}
  2625. />
  2626. </FormItem>
  2627. </div>
  2628. ) : (
  2629. <div className="clearfix">
  2630. {formItemList.map((data, index) => {
  2631. return (
  2632. <FormItem
  2633. className="half-item"
  2634. {...formItemLayout}
  2635. key={index}
  2636. label={data.label}
  2637. >
  2638. {data.content}
  2639. </FormItem>
  2640. );
  2641. })}
  2642. </div>
  2643. )}
  2644. <div className="clearfix">
  2645. {this.state.processStatus == 0 ? (
  2646. <FormItem
  2647. labelCol={{ span: 4 }}
  2648. wrapperCol={{ span: 18 }}
  2649. label={
  2650. <span>
  2651. <strong style={{ color: "#f00" }}>*</strong>
  2652. 合同扫描件
  2653. </span>
  2654. }
  2655. >
  2656. <PicturesWall
  2657. fileList={this.getOrgCodeUrl}
  2658. pictureUrl={this.state.orgCodeUrl}
  2659. url="/api/admin/order/uploadOrderImg"
  2660. sign=""
  2661. />
  2662. <p>图片建议:要清晰。</p>
  2663. <Button
  2664. style={{
  2665. float: "right",
  2666. marginRight: "140px",
  2667. marginTop: "20px"
  2668. }}
  2669. onClick={this.getOrderLog}
  2670. >
  2671. 查看订单日志
  2672. </Button>
  2673. </FormItem>
  2674. ) : (
  2675. <FormItem
  2676. labelCol={{ span: 4 }}
  2677. wrapperCol={{ span: 18 }}
  2678. label="合同扫描件"
  2679. >
  2680. <Upload
  2681. className="demandDetailShow-upload"
  2682. listType="picture-card"
  2683. fileList={this.state.orgCodeUrl}
  2684. onPreview={file => {
  2685. this.setState({
  2686. previewImage: file.url || file.thumbUrl,
  2687. previewVisible: true
  2688. });
  2689. }}
  2690. ></Upload>
  2691. <Modal
  2692. maskClosable={false}
  2693. footer={null}
  2694. visible={this.state.previewVisible}
  2695. onCancel={() => {
  2696. this.setState({ previewVisible: false });
  2697. }}
  2698. >
  2699. <img
  2700. alt=""
  2701. style={{ width: "100%" }}
  2702. src={this.state.previewImage || ""}
  2703. />
  2704. </Modal>
  2705. <Button
  2706. style={{
  2707. float: "right",
  2708. marginRight: "140px",
  2709. marginTop: "20px"
  2710. }}
  2711. onClick={this.getOrderLog}
  2712. >
  2713. 查看订单日志
  2714. </Button>
  2715. </FormItem>
  2716. )}
  2717. </div>
  2718. <div className="clearfix">
  2719. {this.state.processStatus == 0 ? (
  2720. <div className="clearfix">
  2721. <FormItem
  2722. labelCol={{ span: 4 }}
  2723. wrapperCol={{ span: 16 }}
  2724. label="订单留言"
  2725. >
  2726. <Input
  2727. type="textarea"
  2728. placeholder="请输入订单留言"
  2729. rows={4}
  2730. value={this.state.orderRemarks}
  2731. onChange={e => {
  2732. this.setState({
  2733. orderRemarks: e.target.value
  2734. });
  2735. }}
  2736. style={{ width: "95%" }}
  2737. />
  2738. <span className="mandatory">*</span>
  2739. </FormItem>
  2740. </div>
  2741. ) : (
  2742. <FormItem
  2743. labelCol={{ span: 4 }}
  2744. wrapperCol={{ span: 16 }}
  2745. label="订单留言"
  2746. >
  2747. <p
  2748. style={{ width: 500, wordWrap: "break-word" }}
  2749. >
  2750. {this.state.orderRemarks}
  2751. </p>
  2752. </FormItem>
  2753. )}
  2754. </div>
  2755. <div className="clearfix">
  2756. <FormItem
  2757. className="half-item"
  2758. {...formItemLayout}
  2759. label="订单负责人"
  2760. >
  2761. <span>{this.state.salesmanName}</span>
  2762. </FormItem>
  2763. <FormItem
  2764. className="half-item"
  2765. {...formItemLayout}
  2766. label="订单负责人电话"
  2767. >
  2768. <span>{this.state.salesmanMobile}</span>
  2769. </FormItem>
  2770. </div>
  2771. <div className="clearfix">
  2772. <FormItem
  2773. className="half-item"
  2774. {...formItemLayout}
  2775. label="当前财务负责人"
  2776. >
  2777. <span>{this.state.nowFinance}</span>
  2778. </FormItem>
  2779. <FormItem
  2780. className="half-item"
  2781. {...formItemLayout}
  2782. label="当前财务负责人电话"
  2783. >
  2784. <span>{this.state.nowFinanceMobile}</span>
  2785. </FormItem>
  2786. </div>
  2787. <div className="clearfix">
  2788. <FormItem
  2789. className="half-item"
  2790. {...formItemLayout}
  2791. style={{ opacity: ".5" }}
  2792. label="原订单负责人"
  2793. >
  2794. <span>{this.state.oldSalesmanName}</span>
  2795. </FormItem>
  2796. <FormItem
  2797. className="half-item"
  2798. {...formItemLayout}
  2799. style={{ opacity: ".5" }}
  2800. label="原订单负责人电话"
  2801. >
  2802. <span>{this.state.oldSalesmanMobile}</span>
  2803. </FormItem>
  2804. </div>
  2805. <div className="clearfix">
  2806. <FormItem
  2807. className="half-item"
  2808. style={{ opacity: ".5" }}
  2809. {...formItemLayout}
  2810. label="实际财务操作人"
  2811. >
  2812. <span>{this.state.financeName}</span>
  2813. </FormItem>
  2814. <FormItem
  2815. className="half-item"
  2816. {...formItemLayout}
  2817. style={{ opacity: ".5" }}
  2818. label="实际财务操作人电话"
  2819. >
  2820. <span>{this.state.financeMobile}</span>
  2821. </FormItem>
  2822. </div>
  2823. <div>
  2824. <span
  2825. style={{ marginLeft: "50px", fontSize: "20px" }}
  2826. >
  2827. 项目业务
  2828. </span>
  2829. {this.state.processStatus == 0 ? (
  2830. <Button
  2831. type="primary"
  2832. onClick={this.addDetailed}
  2833. style={{
  2834. float: "right",
  2835. marginRight: "50px",
  2836. marginBottom: "15px"
  2837. }}
  2838. >
  2839. 添加项目明细
  2840. </Button>
  2841. ) : (
  2842. ""
  2843. )}
  2844. </div>
  2845. <div
  2846. className="patent-table"
  2847. style={{ marginBottom: 10 }}
  2848. >
  2849. <Spin spinning={this.state.loading}>
  2850. <Table
  2851. columns={this.state.columns}
  2852. dataSource={this.state.dataSource}
  2853. pagination={this.state.pagination}
  2854. onRowClick={this.tableRowClick}
  2855. bordered
  2856. size="small"
  2857. />
  2858. </Spin>
  2859. </div>
  2860. <div
  2861. style={{
  2862. display: cuiDataList.length ? "block" : "none"
  2863. }}
  2864. >
  2865. <span
  2866. style={{ marginLeft: "50px", fontSize: "20px" }}
  2867. >
  2868. 旧催款节点
  2869. </span>
  2870. <Button
  2871. type="primary"
  2872. // onClick={this.addcontact}
  2873. disabled
  2874. onClick={e => {
  2875. cuiDataList.length
  2876. ? this.addcontact()
  2877. : this.addcontactNew();
  2878. }}
  2879. style={{
  2880. float: "right",
  2881. marginRight: "50px",
  2882. marginBottom: "15px",
  2883. display:
  2884. this.state.processStatus == 0
  2885. ? "block"
  2886. : "none"
  2887. }}
  2888. >
  2889. 添加催款节点
  2890. </Button>
  2891. </div>
  2892. <div
  2893. className="clearfix"
  2894. style={{
  2895. display: cuiDataList.length ? "block" : "none"
  2896. }}
  2897. >
  2898. <Spin spinning={this.state.loading}>
  2899. <Form layout="horizontal" id="demand-form">
  2900. <Table
  2901. pagination={false}
  2902. columns={this.state.ContactsLists}
  2903. dataSource={this.state.contactList}
  2904. scroll={{ x: "max-content", y: 0 }}
  2905. />
  2906. <Col
  2907. span={24}
  2908. offset={9}
  2909. style={{ marginTop: "15px" }}
  2910. ></Col>
  2911. </Form>
  2912. </Spin>
  2913. </div>
  2914. <div>
  2915. <span
  2916. style={{
  2917. marginLeft: "50px",
  2918. fontSize: "20px",
  2919. display: cuiDataList.length ? "none" : "block"
  2920. }}
  2921. >
  2922. 新催款节点
  2923. </span>
  2924. <Button
  2925. type="primary"
  2926. disabled={this.state.addFlag ? true : false}
  2927. // onClick={this.addcontact}
  2928. onClick={e => {
  2929. this.setState({ addFlag: true });
  2930. this.addcontactNew();
  2931. }}
  2932. style={{
  2933. float: "right",
  2934. marginRight: "50px",
  2935. marginBottom: "15px",
  2936. display:
  2937. this.state.processStatus == 0
  2938. ? "block"
  2939. : "none"
  2940. }}
  2941. >
  2942. 添加催款节点
  2943. </Button>
  2944. </div>
  2945. <div
  2946. className="clearfix"
  2947. style={{
  2948. display: cuiDataList.length ? "none" : "block"
  2949. }}
  2950. >
  2951. <Spin spinning={this.state.loading}>
  2952. <Form layout="horizontal" id="demand-form">
  2953. <Table
  2954. pagination={false}
  2955. columns={this.state.ContactsListsNew}
  2956. dataSource={this.state.contactListNew}
  2957. scroll={{ x: "max-content", y: 0 }}
  2958. bordered
  2959. size="small"
  2960. />
  2961. <Col
  2962. span={24}
  2963. offset={9}
  2964. style={{ marginTop: "15px" }}
  2965. ></Col>
  2966. </Form>
  2967. </Spin>
  2968. </div>
  2969. {this.state.processStatus == 0 ? (
  2970. <div
  2971. className="addSave"
  2972. style={{ marginTop: "15px" }}
  2973. >
  2974. <Button
  2975. className="cancel"
  2976. type="primary"
  2977. onClick={this.handleCancels}
  2978. style={{ marginLeft: "200px" }}
  2979. htmlType="submit"
  2980. >
  2981. 签单
  2982. </Button>
  2983. <Button
  2984. className="cancel"
  2985. type="primary"
  2986. onClick={this.handleCancelq}
  2987. style={{ marginLeft: "50px" }}
  2988. htmlType="submit"
  2989. >
  2990. 保存
  2991. </Button>
  2992. <Button
  2993. className="cancel"
  2994. type="ghost"
  2995. onClick={this.handleCancelclose}
  2996. style={{ marginLeft: "50px" }}
  2997. >
  2998. 取消
  2999. </Button>
  3000. </div>
  3001. ) : (
  3002. ""
  3003. )}
  3004. </div>
  3005. </TabPane>
  3006. <TabPane tab="合同变更记录" key="2">
  3007. {
  3008. <div>
  3009. <div className="clearfix">
  3010. <FormItem
  3011. className="half-item"
  3012. {...formItemLayout}
  3013. label="客户名称"
  3014. >
  3015. <span>{this.state.userName}</span>
  3016. </FormItem>
  3017. </div>
  3018. <div className="clearfix">
  3019. <FormItem
  3020. className="half-item"
  3021. {...formItemLayout}
  3022. label="合同编号"
  3023. >
  3024. <span>{this.state.contractNo}</span>
  3025. </FormItem>
  3026. </div>
  3027. <div className="clearfix">
  3028. <FormItem
  3029. className="half-item"
  3030. {...formItemLayout}
  3031. label="申请变更部门"
  3032. >
  3033. {!this.state.mark ? (
  3034. <Select
  3035. placeholder="请输入变更部门"
  3036. style={{ width: 240 }}
  3037. value={this.state.depName}
  3038. onChange={e => {
  3039. this.setState({ depName: e });
  3040. // console.log("5454", e);
  3041. }}
  3042. >
  3043. {departmentArr.map(function(item) {
  3044. return (
  3045. <Select.Option
  3046. key={item.id}
  3047. value={item.name}
  3048. >
  3049. {item.name}
  3050. </Select.Option>
  3051. );
  3052. })}
  3053. </Select>
  3054. ) : (
  3055. <span>{contractData.depName}</span>
  3056. )}
  3057. </FormItem>
  3058. <FormItem
  3059. className="half-item"
  3060. {...formItemLayout}
  3061. label="申请人"
  3062. >
  3063. {!this.state.mark ? (
  3064. <Input
  3065. placeholder="请输入申请人"
  3066. ref="signTotalAmount"
  3067. value={this.state.salesmanName}
  3068. onChange={e => {
  3069. this.setState({
  3070. salesmanName: e.target.value
  3071. });
  3072. }}
  3073. style={{ width: "240px" }}
  3074. />
  3075. ) : (
  3076. <span>{contractData.applicant}</span>
  3077. )}
  3078. </FormItem>
  3079. </div>
  3080. <div className="clearfix">
  3081. <FormItem
  3082. labelCol={{ span: 4 }}
  3083. wrapperCol={{ span: 18 }}
  3084. label="变更类型"
  3085. >
  3086. {!this.state.mark ? (
  3087. <Select
  3088. placeholder="选择合同变更类型"
  3089. style={{ width: 200 }}
  3090. onChange={e => {
  3091. this.setState({
  3092. typeChange: e
  3093. });
  3094. }}
  3095. value={this.state.typeChange}
  3096. >
  3097. <Option value={0}>退单退款</Option>
  3098. <Option value={1}>项目及金额变更</Option>
  3099. <Option value={2}>仅项目变更</Option>
  3100. <Option value={3}>仅金额变更</Option>
  3101. <Option value={4}>重报</Option>
  3102. <Option value={5}>赠送</Option>
  3103. </Select>
  3104. ) : (
  3105. <span>
  3106. {getChangeType(contractData.type)}
  3107. </span>
  3108. )}
  3109. </FormItem>
  3110. </div>
  3111. <div className="clearfix">
  3112. <FormItem
  3113. labelCol={{ span: 4 }}
  3114. wrapperCol={{ span: 18 }}
  3115. label="合同额(万元)"
  3116. >
  3117. {!this.state.mark ? (
  3118. <Input
  3119. placeholder="请输入合同额"
  3120. ref="signTotalAmount"
  3121. value={this.state.totalAmount}
  3122. onChange={e => {
  3123. this.setState({
  3124. totalAmount: e.target.value
  3125. });
  3126. }}
  3127. style={{ width: "240px" }}
  3128. />
  3129. ) : (
  3130. <span>{contractData.totalAmount}</span>
  3131. )}
  3132. </FormItem>
  3133. <FormItem
  3134. labelCol={{ span: 4 }}
  3135. wrapperCol={{ span: 18 }}
  3136. label="已收款(万元)"
  3137. >
  3138. {!this.state.mark ? (
  3139. <Input
  3140. placeholder="请输入已收款"
  3141. ref="signTotalAmount"
  3142. value={this.state.settlementAmount}
  3143. onChange={e => {
  3144. this.setState({
  3145. settlementAmount: e.target.value
  3146. });
  3147. }}
  3148. style={{ width: "240px" }}
  3149. />
  3150. ) : (
  3151. <span>{contractData.settlementAmount}</span>
  3152. )}
  3153. </FormItem>
  3154. <FormItem
  3155. labelCol={{ span: 4 }}
  3156. wrapperCol={{ span: 18 }}
  3157. label="申请退款(万元)"
  3158. >
  3159. {!this.state.mark ? (
  3160. <Input
  3161. placeholder="请输入申请退款"
  3162. ref="signTotalAmount"
  3163. value={this.state.changeAmount}
  3164. onChange={e => {
  3165. this.setState({
  3166. changeAmount: e.target.value
  3167. });
  3168. }}
  3169. style={{ width: "240px" }}
  3170. />
  3171. ) : (
  3172. <span>{contractData.changeAmount}</span>
  3173. )}
  3174. </FormItem>
  3175. </div>
  3176. <div className="clearfix">
  3177. <FormItem
  3178. style={{ height: "auto" }}
  3179. labelCol={{ span: 4 }}
  3180. wrapperCol={{ span: 18 }}
  3181. label="变更原因"
  3182. >
  3183. {!this.state.mark ? (
  3184. <TextArea
  3185. rows={4}
  3186. placeholder="请输入变更原因"
  3187. ref="signTotalAmount"
  3188. style={{ width: "95%" }}
  3189. value={this.state.remarksC}
  3190. onChange={e => {
  3191. this.setState({
  3192. remarksC: e.target.value
  3193. });
  3194. }}
  3195. />
  3196. ) : (
  3197. <span>{contractData.remarks}</span>
  3198. )}
  3199. </FormItem>
  3200. </div>
  3201. {/*----- */}
  3202. <div className="clearfix">
  3203. <FormItem
  3204. style={{ height: "auto" }}
  3205. labelCol={{ span: 4 }}
  3206. wrapperCol={{ span: 18 }}
  3207. label="备注"
  3208. >
  3209. {!this.state.mark ? (
  3210. <TextArea
  3211. rows={4}
  3212. placeholder="请输入备注"
  3213. ref="signTotalAmount"
  3214. style={{ width: "95%" }}
  3215. value={this.state.startRemarks}
  3216. onChange={e => {
  3217. this.setState({
  3218. startRemarks: e.target.value
  3219. });
  3220. }}
  3221. />
  3222. ) : (
  3223. <span>{contractData.startRemarks}</span>
  3224. )}
  3225. </FormItem>
  3226. </div>
  3227. {/* ---- */}
  3228. <div className="clearfix">
  3229. <FormItem
  3230. labelCol={{ span: 4 }}
  3231. wrapperCol={{ span: 18 }}
  3232. label="变更凭证"
  3233. >
  3234. {!this.state.mark ? (
  3235. <PicturesWall
  3236. fileList={this.getVoucherUrl}
  3237. pictureUrl={this.state.voucherUrl}
  3238. url="/api/admin/orderChange/uploadFile"
  3239. sign="order_change_file"
  3240. />
  3241. ) : (
  3242. <div>
  3243. <Upload
  3244. className="demandDetailShow-upload"
  3245. listType="picture-card"
  3246. fileList={this.state.voucherUrl}
  3247. onPreview={file => {
  3248. this.setState({
  3249. previewImage:
  3250. file.url || file.thumbUrl,
  3251. previewVisible: true
  3252. });
  3253. }}
  3254. />
  3255. <Modal
  3256. maskClosable={false}
  3257. footer={null}
  3258. visible={this.state.previewVisible}
  3259. onCancel={() => {
  3260. this.setState({
  3261. previewVisible: false
  3262. });
  3263. }}
  3264. >
  3265. <img
  3266. alt=""
  3267. style={{ width: "100%" }}
  3268. src={this.state.previewImage || ""}
  3269. />
  3270. </Modal>
  3271. </div>
  3272. )}
  3273. <p>图片建议:要清晰。</p>
  3274. </FormItem>
  3275. </div>
  3276. {!this.state.mark ? (
  3277. <div className="clearfix">
  3278. <Button
  3279. type="primary"
  3280. style={{ float: "right", marginRight: 40 }}
  3281. onClick={this.changeApply}
  3282. >
  3283. 发起变更申请
  3284. </Button>
  3285. </div>
  3286. ) : (
  3287. ""
  3288. )}
  3289. </div>
  3290. }
  3291. </TabPane>
  3292. </Tabs>
  3293. )}
  3294. </div>
  3295. </Spin>
  3296. </Form>
  3297. </Modal>
  3298. <Modal
  3299. maskClosable={false}
  3300. visible={this.state.addnextVisible}
  3301. onOk={this.nextCancel}
  3302. onCancel={this.nextCancel}
  3303. width="800px"
  3304. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  3305. footer=""
  3306. className="admin-desc-content"
  3307. >
  3308. <Form
  3309. layout="horizontal"
  3310. onSubmit={this.nextSubmit}
  3311. id="demand-form"
  3312. >
  3313. <Spin spinning={this.state.loading}>
  3314. {this.state.addState ? (
  3315. <div className="clearfix">
  3316. <FormItem
  3317. className="half-item"
  3318. {...formItemLayout}
  3319. label="服务名称"
  3320. >
  3321. <AutoComplete
  3322. className="certain-category-search"
  3323. dropdownClassName="certain-category-search-dropdown"
  3324. dropdownMatchSelectWidth={false}
  3325. dropdownStyle={{ width: 200 }}
  3326. style={{ width: "200px" }}
  3327. dataSource={options}
  3328. placeholder="输入服务名称"
  3329. value={this.state.commodityName}
  3330. onChange={this.httpChange}
  3331. filterOption={true}
  3332. onSelect={this.selectAuto}
  3333. >
  3334. <Input />
  3335. </AutoComplete>
  3336. <span className="mandatory">*</span>
  3337. </FormItem>
  3338. <FormItem
  3339. className="half-item"
  3340. {...formItemLayout}
  3341. label="服务数量"
  3342. >
  3343. <Input
  3344. placeholder="请输入服务数量"
  3345. value={this.state.commodityQuantity}
  3346. style={{ width: "200px" }}
  3347. onChange={e => {
  3348. this.setState({ commodityQuantity: e.target.value });
  3349. }}
  3350. ref="commodityQuantity"
  3351. />
  3352. <span className="mandatory">*</span>
  3353. </FormItem>
  3354. <FormItem
  3355. className="half-item"
  3356. {...formItemLayout}
  3357. label="实签价格(万元)"
  3358. >
  3359. <Input
  3360. placeholder="请输入实签价格"
  3361. value={this.state.commodityPrice}
  3362. style={{ width: "200px" }}
  3363. onChange={e => {
  3364. this.setState({ commodityPrice: e.target.value });
  3365. }}
  3366. ref="commodityPrice"
  3367. />
  3368. <span className="mandatory">*</span>
  3369. </FormItem>
  3370. <FormItem
  3371. className="half-item"
  3372. {...formItemLayout}
  3373. label="主要业务"
  3374. >
  3375. <Select
  3376. placeholder="选择是否为主要业务"
  3377. style={{ width: "200px" }}
  3378. value={this.state.main}
  3379. onChange={e => {
  3380. this.setState({ main: e });
  3381. }}
  3382. >
  3383. {boutique.map(function(item) {
  3384. return (
  3385. <Select.Option key={item.value}>
  3386. {item.key}
  3387. </Select.Option>
  3388. );
  3389. })}
  3390. </Select>
  3391. <span className="mandatory">*</span>
  3392. </FormItem>
  3393. <div className="clearfix">
  3394. <FormItem
  3395. labelCol={{ span: 4 }}
  3396. wrapperCol={{ span: 16 }}
  3397. label="服务说明"
  3398. >
  3399. <Input
  3400. type="textarea"
  3401. placeholder="请输入服务说明"
  3402. value={this.state.taskComment}
  3403. onChange={e => {
  3404. this.setState({ taskComment: e.target.value });
  3405. }}
  3406. />
  3407. </FormItem>
  3408. </div>
  3409. <FormItem
  3410. wrapperCol={{ span: 12, offset: 4 }}
  3411. className="half-middle"
  3412. >
  3413. <Button
  3414. className="submitSave"
  3415. type="primary"
  3416. htmlType="submit"
  3417. >
  3418. 保存
  3419. </Button>
  3420. <Button
  3421. className="submitSave"
  3422. type="ghost"
  3423. onClick={this.nextCancel}
  3424. >
  3425. 取消
  3426. </Button>
  3427. </FormItem>
  3428. </div>
  3429. ) : (
  3430. <div className="clearfix">
  3431. {this.state.processStatus == 0 ? (
  3432. <div className="clearfix">
  3433. <FormItem
  3434. className="half-item"
  3435. {...formItemLayout}
  3436. label="项目名称"
  3437. >
  3438. <span>{this.state.commodityName}</span>
  3439. </FormItem>
  3440. <FormItem
  3441. className="half-item"
  3442. {...formItemLayout}
  3443. label="项目数量"
  3444. >
  3445. <Input
  3446. placeholder="请输入数量"
  3447. value={this.state.commodityQuantity}
  3448. style={{ width: "200px" }}
  3449. onChange={e => {
  3450. this.setState({
  3451. commodityQuantity: e.target.value
  3452. });
  3453. }}
  3454. />
  3455. <span className="mandatory">*</span>
  3456. </FormItem>
  3457. <FormItem
  3458. className="half-item"
  3459. {...formItemLayout}
  3460. label="金额(万元)"
  3461. >
  3462. <Input
  3463. placeholder="请输入签单金额"
  3464. value={this.state.commodityPrice}
  3465. style={{ width: "200px" }}
  3466. onChange={e => {
  3467. this.setState({ commodityPrice: e.target.value });
  3468. }}
  3469. />
  3470. <span className="mandatory">*</span>
  3471. </FormItem>
  3472. <FormItem
  3473. className="half-item"
  3474. {...formItemLayout}
  3475. label="主要项目"
  3476. >
  3477. <Select
  3478. placeholder="选择是否为主要业务"
  3479. style={{ width: "200px" }}
  3480. value={this.state.main}
  3481. onChange={e => {
  3482. this.setState({ main: e });
  3483. }}
  3484. >
  3485. {boutique.map(function(item) {
  3486. return (
  3487. <Select.Option key={item.value}>
  3488. {item.key}
  3489. </Select.Option>
  3490. );
  3491. })}
  3492. </Select>
  3493. <span className="mandatory">*</span>
  3494. </FormItem>
  3495. <div className="clearfix">
  3496. <FormItem
  3497. labelCol={{ span: 4 }}
  3498. wrapperCol={{ span: 16 }}
  3499. label="服务说明"
  3500. >
  3501. <Input
  3502. type="textarea"
  3503. placeholder="请输入服务说明"
  3504. value={this.state.taskComment}
  3505. onChange={e => {
  3506. this.setState({ taskComment: e.target.value });
  3507. }}
  3508. />
  3509. </FormItem>
  3510. </div>
  3511. <FormItem
  3512. wrapperCol={{ span: 12, offset: 4 }}
  3513. className="half-middle"
  3514. >
  3515. <Button
  3516. className="submitSave"
  3517. type="primary"
  3518. onClick={this.tabRowSave}
  3519. >
  3520. 保存
  3521. </Button>
  3522. <Button
  3523. className="submitSave"
  3524. type="ghost"
  3525. onClick={this.nextCancel}
  3526. >
  3527. 取消
  3528. </Button>
  3529. </FormItem>
  3530. </div>
  3531. ) : (
  3532. <div className="clearfix">
  3533. <FormItem
  3534. className="half-item"
  3535. {...formItemLayout}
  3536. label="项目名称"
  3537. >
  3538. <span>{this.state.commodityName}</span>
  3539. </FormItem>
  3540. <FormItem
  3541. className="half-item"
  3542. {...formItemLayout}
  3543. label="项目数量"
  3544. >
  3545. <span>{this.state.commodityQuantity}</span>
  3546. </FormItem>
  3547. <FormItem
  3548. className="half-item"
  3549. {...formItemLayout}
  3550. label="金额(万元)"
  3551. >
  3552. <span>{this.state.commodityPrice}</span>
  3553. </FormItem>
  3554. <FormItem
  3555. className="half-item"
  3556. {...formItemLayout}
  3557. label="主要项目"
  3558. >
  3559. <span>{getboutique(this.state.main)}</span>
  3560. </FormItem>
  3561. <div className="clearfix">
  3562. <FormItem
  3563. labelCol={{ span: 4 }}
  3564. wrapperCol={{ span: 16 }}
  3565. label="服务说明"
  3566. >
  3567. <span>{this.state.taskComment}</span>
  3568. </FormItem>
  3569. </div>
  3570. </div>
  3571. )}
  3572. </div>
  3573. )}
  3574. </Spin>
  3575. </Form>
  3576. </Modal>
  3577. <Modal
  3578. maskClosable={false}
  3579. visible={this.state.lookVisible}
  3580. onOk={this.noCancel}
  3581. onCancel={this.noCancel}
  3582. width="800px"
  3583. title={"退单申请"}
  3584. footer=""
  3585. className="admin-desc-content"
  3586. >
  3587. <Form layout="horizontal" id="demand-form">
  3588. <Spin spinning={this.state.loading}>
  3589. <div className="clearfix">
  3590. <FormItem
  3591. labelCol={{ span: 4 }}
  3592. wrapperCol={{ span: 16 }}
  3593. label="终止合同"
  3594. >
  3595. <Picture
  3596. fileList={e => {
  3597. this.setState({ contractUrl: e });
  3598. }}
  3599. pictureUrl={this.state.contractUrl}
  3600. visible={this.props.visible}
  3601. data={{
  3602. sign: "order_refund_file",
  3603. url: "/api/admin/newOrder/uploadRefundOrderFile",
  3604. number: 8
  3605. }}
  3606. />
  3607. </FormItem>
  3608. </div>
  3609. <div className="clearfix">
  3610. <FormItem
  3611. labelCol={{ span: 4 }}
  3612. wrapperCol={{ span: 16 }}
  3613. label="退单申请表"
  3614. >
  3615. <Picture
  3616. fileList={e => {
  3617. this.setState({ applicationUrl: e });
  3618. }}
  3619. pictureUrl={this.state.applicationUrl}
  3620. visible={this.props.visible}
  3621. data={{
  3622. sign: "order_refund_file",
  3623. url: "/api/admin/newOrder/uploadRefundOrderFile",
  3624. number: 8
  3625. }}
  3626. />
  3627. </FormItem>
  3628. </div>
  3629. <div className="clearfix">
  3630. <FormItem
  3631. labelCol={{ span: 4 }}
  3632. wrapperCol={{ span: 16 }}
  3633. label="退单理由"
  3634. >
  3635. <Input
  3636. type="textarea"
  3637. placeholder="请输入退单理由"
  3638. rows={4}
  3639. value={this.state.reason}
  3640. onChange={e => {
  3641. this.setState({ reason: e.target.value });
  3642. }}
  3643. />
  3644. </FormItem>
  3645. </div>
  3646. <div className="clearfix">
  3647. <Button
  3648. className="cancel"
  3649. type="primary"
  3650. onClick={this.tuidanOk}
  3651. style={{ marginLeft: "50px" }}
  3652. htmlType="submit"
  3653. >
  3654. 确定退单
  3655. </Button>
  3656. <Button
  3657. className="cancel"
  3658. type="ghost"
  3659. onClick={this.noCancel}
  3660. style={{ marginLeft: "50px" }}
  3661. >
  3662. 取消
  3663. </Button>
  3664. </div>
  3665. </Spin>
  3666. </Form>
  3667. </Modal>
  3668. {/* <Modal
  3669. visible={this.state.rizhivisible}
  3670. className="admin-desc-content"
  3671. width="800px"
  3672. maskClosable={false}
  3673. title="订单日志"
  3674. footer={null}
  3675. onCancel={this.closeOrderLog}
  3676. >
  3677. <div className="patent-table">
  3678. <Spin spinning={this.state.loading}>
  3679. <Table
  3680. columns={this.state.columnsrizhi}
  3681. dataSource={this.state.dataSourcerizhi}
  3682. pagination={false}
  3683. />
  3684. </Spin>
  3685. </div>
  3686. </Modal> */}
  3687. <OrderRiZi
  3688. dataSourcerizhi={this.state.dataSourcerizhi}
  3689. closeOrderLog={this.closeOrderLog}
  3690. visible={this.state.rizhivisible}
  3691. loading={this.state.loading}
  3692. />
  3693. </div>
  3694. );
  3695. }
  3696. })
  3697. );
  3698. export default Form.create()(NewService);