addService.jsx 134 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728
  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].dunType == 1 && !arr[i].waitDay && this.state.approval == 1) {
  781. message.warning("特批存在首付催款节点未填写时间的情况,请删除后重新填写保存")
  782. return false
  783. }
  784. if (!this.state.contactListNew[i].id && this.props.userDetaile) {
  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. if (index.id) {
  1352. this.state.contactListNew.splice(index.key, 1);
  1353. this.setState({
  1354. contactListNew: this.state.contactListNew,
  1355. cuiFlag: false,
  1356. addFlag: 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. addFlag: false
  1386. });
  1387. }
  1388. },
  1389. handleOk() {
  1390. this.setState({
  1391. visible: false,
  1392. mark: false
  1393. });
  1394. this.props.closeDesc(false, true);
  1395. },
  1396. handleCancel() {
  1397. if (this.state.orderType == undefined) {
  1398. return false;
  1399. }
  1400. if (!this.state.autoId) {
  1401. return false;
  1402. }
  1403. this.setState({
  1404. visible: false,
  1405. mark: false
  1406. });
  1407. this.props.closeDesc(false);
  1408. },
  1409. handleCancelclose() {
  1410. this.setState(
  1411. {
  1412. visible: false,
  1413. mark: false,
  1414. cuiFlag: false,
  1415. addFlag: false,
  1416. },
  1417. () => {
  1418. this.setState({
  1419. activeKey: "1"
  1420. });
  1421. }
  1422. );
  1423. this.props.closeDesc(false);
  1424. this.reset();
  1425. },
  1426. //点击签单
  1427. handleCancels() {
  1428. this.setState({
  1429. isSubmit: 1
  1430. });
  1431. },
  1432. //点击签单
  1433. handleCancelq() {
  1434. this.setState({
  1435. isSubmit: 0
  1436. });
  1437. },
  1438. //删除
  1439. delectRow(record) {
  1440. this.setState({
  1441. loading: true
  1442. });
  1443. $.ajax({
  1444. method: "post",
  1445. dataType: "json",
  1446. crossDomain: false,
  1447. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1448. data: {
  1449. id: record.id
  1450. }
  1451. }).done(
  1452. function(data) {
  1453. if (!data.error.length) {
  1454. message.success("删除成功!");
  1455. this.setState({
  1456. loading: false
  1457. });
  1458. this.jiedian(this.state.orderNo);
  1459. this.jiedianNew(this.state.orderNo);
  1460. this.loaduser();
  1461. this.loadData();
  1462. } else {
  1463. message.warning(data.error[0].message);
  1464. }
  1465. }.bind(this)
  1466. );
  1467. },
  1468. nextCancel() {
  1469. this.setState({
  1470. addnextVisible: false
  1471. });
  1472. },
  1473. rizhi() {
  1474. this.setState({
  1475. loading: true
  1476. });
  1477. $.ajax({
  1478. method: "get",
  1479. dataType: "json",
  1480. crossDomain: false,
  1481. url: "/api/admin/newOrder/selectOrderLog",
  1482. data: {
  1483. orderNo: this.props.datauser.orderNo
  1484. },
  1485. success: function(data) {
  1486. let theArr = [];
  1487. let thisData = data.data;
  1488. if (!thisData.length) {
  1489. if (data.error && data.error.length) {
  1490. message.warning(data.error[0].message);
  1491. }
  1492. thisData = {};
  1493. } else {
  1494. for (let i = 0; i < data.data.length; i++) {
  1495. let thisdata = data.data[i];
  1496. theArr.push({
  1497. processName: thisdata.processName,
  1498. adminName: thisdata.adminName,
  1499. createDate: thisdata.createDate
  1500. });
  1501. }
  1502. }
  1503. this.setState({
  1504. dataSourcerizhi: theArr
  1505. });
  1506. }.bind(this)
  1507. }).always(
  1508. function() {
  1509. this.setState({
  1510. loading: false
  1511. });
  1512. }.bind(this)
  1513. );
  1514. },
  1515. //查看订单日志
  1516. getOrderLog() {
  1517. this.setState({
  1518. rizhivisible: true
  1519. });
  1520. this.rizhi();
  1521. },
  1522. closeOrderLog() {
  1523. this.setState({
  1524. rizhivisible: false
  1525. });
  1526. },
  1527. callback(key) {
  1528. this.setState({
  1529. activeKey: key
  1530. });
  1531. if (key === "2") {
  1532. let url = window.location.href.substring(7);
  1533. $.ajax({
  1534. method: "get",
  1535. dataType: "json",
  1536. crossDomain: false,
  1537. url:
  1538. globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  1539. data: {
  1540. orderNo: this.props.datauser.orderNo
  1541. },
  1542. success: function(data) {
  1543. // console.log(data.data);
  1544. if (data.data) {
  1545. let thisdata = data.data;
  1546. // console.log(this.state.userName);
  1547. Object.assign(thisdata, {
  1548. userName: this.state.userName,
  1549. contractNo: this.state.contractNo,
  1550. arrears: this.state.arrears
  1551. });
  1552. this.setState({
  1553. mark: true,
  1554. contractData: thisdata,
  1555. voucherUrl: thisdata.voucherUrl
  1556. ? splitUrl(
  1557. thisdata.voucherUrl,
  1558. ",",
  1559. globalConfig.avatarHost + "/upload",
  1560. url
  1561. )
  1562. : []
  1563. });
  1564. }
  1565. }.bind(this)
  1566. });
  1567. }
  1568. },
  1569. getOrgCodeUrl(e) {
  1570. this.setState({ orgCodeUrl: e });
  1571. },
  1572. getVoucherUrl(e) {
  1573. this.setState({ voucherUrl: e });
  1574. },
  1575. //加载(自动补全)
  1576. supervisor(e, state) {
  1577. //客户名称与服务名称自动补全
  1578. let api = state
  1579. ? "/api/admin/customer/getCustomerByName"
  1580. : "/api/admin/order/getBusinessProjectByName";
  1581. $.ajax({
  1582. method: "get",
  1583. dataType: "json",
  1584. crossDomain: false,
  1585. url: globalConfig.context + api,
  1586. data: state
  1587. ? {
  1588. name: e,
  1589. type: this.state.customType
  1590. }
  1591. : {
  1592. businessName: e
  1593. },
  1594. success: function(data) {
  1595. let thedata = data.data;
  1596. if (!thedata) {
  1597. if (data.error && data.error.length) {
  1598. message.warning(data.error[0].message);
  1599. }
  1600. thedata = {};
  1601. }
  1602. this.setState({
  1603. states: state,
  1604. customerArr: thedata
  1605. });
  1606. }.bind(this)
  1607. }).always(
  1608. function() {
  1609. this.setState({
  1610. loading: false
  1611. });
  1612. }.bind(this)
  1613. );
  1614. },
  1615. supervisorCui(e) {
  1616. //客户名称与服务名称自动补全
  1617. let api = "/api/admin/order/getBusinessProjectByName";
  1618. $.ajax({
  1619. method: "get",
  1620. dataType: "json",
  1621. crossDomain: false,
  1622. url: globalConfig.context + api,
  1623. data: {
  1624. businessName: e
  1625. },
  1626. success: function(data) {
  1627. let thedata = data.data;
  1628. if (!thedata) {
  1629. if (data.error && data.error.length) {
  1630. message.warning(data.error[0].message);
  1631. }
  1632. thedata = {};
  1633. }
  1634. this.setState({
  1635. customerCuiArr: thedata
  1636. });
  1637. console.log(thedata);
  1638. }.bind(this)
  1639. }).always(
  1640. function() {
  1641. this.setState({
  1642. loading: false
  1643. });
  1644. }.bind(this)
  1645. );
  1646. },
  1647. //上级主管输入框失去焦点是判断客户是否存在
  1648. selectAuto(value) {
  1649. let kid = [];
  1650. let fwList = this.state.customerArr;
  1651. fwList.map(function(item) {
  1652. if (value == item.bname) {
  1653. kid = item;
  1654. }
  1655. });
  1656. this.setState({
  1657. commodityName: value,
  1658. gid: kid.id,
  1659. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1660. commodityFirstPayment:
  1661. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  1662. });
  1663. },
  1664. selectAutoCui(value) {
  1665. let kid = [];
  1666. let fwList = this.state.customerCuiArr;
  1667. fwList.map(function(item) {
  1668. if (value == item.bname) {
  1669. kid = item;
  1670. }
  1671. });
  1672. this.setState({
  1673. commodityNameCui: value,
  1674. cid: kid.id,
  1675. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1676. commodityFirstPayment:
  1677. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  1678. });
  1679. },
  1680. //客户
  1681. selectAutoCUT(value) {
  1682. let autoIds;
  1683. let fwList = this.state.customerArr;
  1684. fwList.map(function(item) {
  1685. if (value == item.name) {
  1686. autoIds = item.id;
  1687. }
  1688. });
  1689. this.setState({
  1690. customerName: value,
  1691. autoId: autoIds
  1692. });
  1693. },
  1694. //服务值改变时请求客户名称
  1695. httpChange(e) {
  1696. this.state.gid = "";
  1697. if (e.length >= 1) {
  1698. this.supervisor(e, false);
  1699. }
  1700. this.setState({
  1701. commodityName: e
  1702. });
  1703. },
  1704. httpChangeCui(e) {
  1705. if (e.length >= 1) {
  1706. this.supervisorCui(e, false);
  1707. }
  1708. this.setState({
  1709. commodityNameCui: e
  1710. });
  1711. },
  1712. //客户名称自动补全
  1713. customerChange(e) {
  1714. if (this.state.customType) {
  1715. this.state.autoId = "";
  1716. if (e.length >= 2) {
  1717. this.supervisor(e, true);
  1718. }
  1719. this.setState({
  1720. customerName: e
  1721. });
  1722. } else {
  1723. this.setState({
  1724. customerName: ""
  1725. });
  1726. message.warning("客户所属类型必须指定");
  1727. }
  1728. },
  1729. //点击添加项目明细
  1730. addDetailed() {
  1731. this.setState({
  1732. gid: "",
  1733. customerArr: [],
  1734. commodityName: "",
  1735. commodityQuantity: "",
  1736. commodityId: "",
  1737. taskComment: "",
  1738. main: undefined,
  1739. commodityPrice: "",
  1740. addState: 1,
  1741. addnextVisible: true
  1742. });
  1743. },
  1744. //新建项目明细保存
  1745. nextSubmit(e) {
  1746. e.preventDefault();
  1747. if (this.state.gid == undefined || !this.state.gid) {
  1748. message.warning("服务名称不匹配!");
  1749. return false;
  1750. }
  1751. if (!this.state.commodityPrice) {
  1752. message.warning("请输入金额!");
  1753. this.refs.commodityPrice.focus();
  1754. return false;
  1755. }
  1756. if (!this.state.commodityQuantity) {
  1757. message.warning("请输入商品数量!");
  1758. this.refs.commodityQuantity.focus();
  1759. return false;
  1760. }
  1761. if (!this.state.main) {
  1762. message.warning("请选择是否为主要项目!");
  1763. this.refs.commodityQuantity.focus();
  1764. return false;
  1765. }
  1766. this.setState({
  1767. loading: true
  1768. });
  1769. let api = this.state.addState
  1770. ? "/api/admin/newOrder/addOrderTask"
  1771. : "/api/bianji";
  1772. $.ajax({
  1773. method: "POST",
  1774. dataType: "json",
  1775. crossDomain: false,
  1776. url: globalConfig.context + api,
  1777. data: {
  1778. commodityId: this.state.gid, //商品ID
  1779. orderNo: this.props.datauser.orderNo, //订单编号
  1780. commodityName: this.state.commodityName, //商品名称
  1781. commodityQuantity: this.state.commodityQuantity, //商品数量
  1782. commodityPrice: this.state.commodityPrice, //签单总价
  1783. taskComment: this.state.taskComment, //服务说明
  1784. main: this.state.main //是否为主要项目
  1785. }
  1786. }).done(
  1787. function(data) {
  1788. this.setState({
  1789. loading: false
  1790. });
  1791. if (!data.error.length) {
  1792. message.success("保存成功!");
  1793. this.nextCancel();
  1794. //this.loaduser(this.props.datauser);
  1795. this.loadData();
  1796. } else {
  1797. message.warning(data.error[0].message);
  1798. }
  1799. }.bind(this)
  1800. );
  1801. },
  1802. //点击打卡项目详情
  1803. tableRowClick(record) {
  1804. this.setState({
  1805. jid: record.id, //项目ID
  1806. kid: record.commodityId, //商品ID
  1807. commodityName: record.commodityName, //金额
  1808. commodityPrice: record.commodityPrice, //金额
  1809. commodityQuantity: record.commodityQuantity, //数量
  1810. taskComment: record.taskComment, //备注
  1811. main: record.main.toString(), //是否为主要
  1812. addnextVisible: true,
  1813. addState: 0
  1814. });
  1815. },
  1816. //修改项目详情
  1817. tabRowSave(e) {
  1818. e.preventDefault();
  1819. if (!this.state.commodityPrice) {
  1820. message.warning("金额不能为空!");
  1821. return false;
  1822. }
  1823. if (!this.state.commodityQuantity) {
  1824. message.warning("数量不能为空!");
  1825. return false;
  1826. }
  1827. if (!this.state.main) {
  1828. message.warning("请选择是否为主要项目!");
  1829. this.refs.commodityQuantity.focus();
  1830. return false;
  1831. }
  1832. $.ajax({
  1833. method: "POST",
  1834. dataType: "json",
  1835. crossDomain: false,
  1836. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  1837. data: {
  1838. id: this.state.jid, //项目ID
  1839. commodityId: this.state.kid, //商品ID
  1840. orderNo: this.props.datauser.orderNo, //订单编号
  1841. main: this.state.main, //是否为主要
  1842. commodityPrice: this.state.commodityPrice, //金额
  1843. commodityQuantity: this.state.commodityQuantity, //数量
  1844. taskComment: this.state.taskComment //备注
  1845. }
  1846. }).done(
  1847. function(data) {
  1848. this.setState({
  1849. loading: false
  1850. });
  1851. if (!data.error.length) {
  1852. message.success("保存成功!");
  1853. this.nextCancel();
  1854. //this.loaduser(this.props.datauser);
  1855. this.loadData();
  1856. } else {
  1857. message.warning(data.error[0].message);
  1858. }
  1859. }.bind(this)
  1860. );
  1861. },
  1862. //签单时间选择
  1863. selTime(e, index) {
  1864. this.setState({
  1865. entryTime: e,
  1866. signDate: e,
  1867. selTime: index
  1868. });
  1869. },
  1870. //退单操作
  1871. //点击退单
  1872. tuikuan() {
  1873. this.setState({
  1874. lookVisible: true,
  1875. contractUrl: [],
  1876. applicationUrl: [],
  1877. reason: ""
  1878. });
  1879. },
  1880. //关闭退单
  1881. noCancel() {
  1882. this.setState({
  1883. lookVisible: false
  1884. });
  1885. },
  1886. //点击确认退单
  1887. tuidanOk() {
  1888. let contractUrls = [];
  1889. let applicationUrls = [];
  1890. if (this.state.contractUrl.length) {
  1891. let picArr = [];
  1892. this.state.contractUrl.map(function(item) {
  1893. if (
  1894. item.response &&
  1895. item.response.data &&
  1896. item.response.data.length
  1897. ) {
  1898. picArr.push(item.response.data);
  1899. }
  1900. });
  1901. contractUrls = picArr.join(",");
  1902. }
  1903. if (this.state.applicationUrl.length) {
  1904. let picArr = [];
  1905. this.state.applicationUrl.map(function(item) {
  1906. if (
  1907. item.response &&
  1908. item.response.data &&
  1909. item.response.data.length
  1910. ) {
  1911. picArr.push(item.response.data);
  1912. }
  1913. });
  1914. applicationUrls = picArr.join(",");
  1915. }
  1916. $.ajax({
  1917. method: "POST",
  1918. dataType: "json",
  1919. crossDomain: false,
  1920. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  1921. data: {
  1922. orderNo: this.state.orderNo, //订单编号
  1923. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  1924. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  1925. reason: this.state.reason //退单原因
  1926. }
  1927. }).done(
  1928. function(data) {
  1929. this.setState({
  1930. loading: false
  1931. });
  1932. if (!data.error.length) {
  1933. message.success("退单成功!");
  1934. this.noCancel();
  1935. this.handleCancelclose();
  1936. } else {
  1937. message.warning(data.error[0].message);
  1938. }
  1939. }.bind(this)
  1940. );
  1941. },
  1942. //开单选择订单类型骚操作
  1943. orderTypeFn(e) {
  1944. if (e == 0) {
  1945. this.setState({
  1946. bussStats: true,
  1947. orderType: e
  1948. });
  1949. this.category();
  1950. } else {
  1951. this.setState({
  1952. contractType: undefined,
  1953. bussStats: false,
  1954. orderType: e
  1955. });
  1956. }
  1957. },
  1958. //品类数据获取
  1959. category() {
  1960. $.ajax({
  1961. method: "get",
  1962. dataType: "json",
  1963. crossDomain: false,
  1964. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1965. data: {},
  1966. success: function(data) {
  1967. let thedata = data.data;
  1968. let theArr = [];
  1969. if (!thedata) {
  1970. if (data.error && data.error.length) {
  1971. message.warning(data.error[0].message);
  1972. }
  1973. thedata = {};
  1974. } else {
  1975. thedata.map(function(item, index) {
  1976. theArr.push({
  1977. key: index,
  1978. name: item.cname,
  1979. id: item.id
  1980. });
  1981. });
  1982. }
  1983. this.setState({
  1984. contractType: undefined,
  1985. categoryArr: theArr
  1986. });
  1987. }.bind(this)
  1988. });
  1989. },
  1990. //变更申请
  1991. changeApply() {
  1992. if (this.state.processStatus <= 4) {
  1993. message.warning("当前订单流程不能发起变更!");
  1994. return false;
  1995. }
  1996. if (this.state.changeAmount == "") {
  1997. message.warning("申请退款金额不能为空!");
  1998. // console.log(this.state.changeAmount);
  1999. return false;
  2000. }
  2001. if (this.state.remarksC.trim() == "") {
  2002. message.warning("请正确填写变更原因");
  2003. return false;
  2004. }
  2005. if (this.state.startRemarks.trim() == "") {
  2006. message.warning("请正确填写备注信息");
  2007. return false;
  2008. }
  2009. let theorgCodeUrl = [];
  2010. if (this.state.voucherUrl.length) {
  2011. let picArr = [];
  2012. this.state.voucherUrl.map(function(item) {
  2013. if (
  2014. item.response &&
  2015. item.response.data &&
  2016. item.response.data.length
  2017. ) {
  2018. picArr.push(item.response.data);
  2019. }
  2020. });
  2021. theorgCodeUrl = picArr.join(",");
  2022. }
  2023. $.ajax({
  2024. method: "post",
  2025. dataType: "json",
  2026. crossDomain: false,
  2027. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2028. data: {
  2029. orderNo: this.state.orderNo, //订单编号
  2030. processState: 0,
  2031. status: 1,
  2032. startRemarks: this.state.startRemarks,
  2033. remarks: this.state.remarksC,
  2034. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2035. totalAmount: this.state.totalAmount,
  2036. settlementAmount: this.state.settlementAmount,
  2037. changeAmount: this.state.changeAmount,
  2038. applicant: this.state.salesmanName,
  2039. depName: this.state.depName,
  2040. type: this.state.typeChange
  2041. }
  2042. }).done(
  2043. function(data) {
  2044. this.setState({
  2045. loading: false
  2046. });
  2047. if (!data.error.length) {
  2048. message.success("变更成功!");
  2049. this.noCancel();
  2050. this.handleCancelclose();
  2051. } else {
  2052. message.warning(data.error[0].message);
  2053. }
  2054. }.bind(this)
  2055. );
  2056. },
  2057. componentDidMount() {
  2058. window.setTimeout(() => {
  2059. // console.log("我看看", this.state);
  2060. }, 100);
  2061. },
  2062. reset() {
  2063. this.setState({
  2064. startRemarks: "",
  2065. remarksC: "",
  2066. voucherUrl: [],
  2067. totalAmount: undefined,
  2068. settlementAmount: undefined,
  2069. changeAmount: "0",
  2070. applicant: undefined,
  2071. depNameChange: undefined,
  2072. typeChange: 0,
  2073. });
  2074. },
  2075. componentWillReceiveProps(nextProps) {
  2076. //props改变时触发
  2077. this.state.visible = nextProps.showDesc;
  2078. this.state.signBillVisible = nextProps.signBillVisible;
  2079. if (this.state.signBillVisible) {
  2080. this.loaduser(nextProps.uid);
  2081. }
  2082. if (nextProps.userDetaile && nextProps.showDesc) {
  2083. this.loaduser(nextProps.datauser);
  2084. this.jiedian(nextProps.datauser.orderNo);
  2085. this.jiedianNew(nextProps.datauser.orderNo);
  2086. this.loadData(nextProps.datauser);
  2087. } else {
  2088. this.setState({
  2089. orderType: undefined,
  2090. customerName: "",
  2091. autoId: "",
  2092. customerArr: [],
  2093. contractType: undefined,
  2094. bussStats: false,
  2095. customType: undefined
  2096. });
  2097. }
  2098. },
  2099. showConfirm(fn,record) {
  2100. confirm({
  2101. title: '确定删除此项目吗?',
  2102. content: <span style={{ color: "red" }}>删除后会将该项目下的所有催款节点自动清除!!!</span>,
  2103. onOk() {
  2104. fn(record)
  2105. },
  2106. onCancel() {
  2107. },
  2108. });
  2109. },
  2110. render() {
  2111. const FormItem = Form.Item;
  2112. const { TabPane } = Tabs;
  2113. const { TextArea } = Input;
  2114. const formItemLayout = {
  2115. labelCol: { span: 8 },
  2116. wrapperCol: { span: 14 }
  2117. };
  2118. const contractData = this.state.contractData;
  2119. const formItemList = [
  2120. {
  2121. label: "企业联系人",
  2122. content: <span>{this.state.contacts}</span>
  2123. },
  2124. {
  2125. label: "联系人电话",
  2126. content: <span>{this.state.contactMobile}</span>
  2127. },
  2128. {
  2129. label: "企业法人",
  2130. content: <span>{this.state.legalPerson}</span>
  2131. },
  2132. {
  2133. label: "法人电话",
  2134. content: <span>{this.state.legalPersonTel}</span>
  2135. },
  2136. // {
  2137. // label: "签单金额(万元)",
  2138. // content: <span>{this.state.totalAmount}</span>
  2139. // },
  2140. // {
  2141. // label: "首付金额(万元)",
  2142. // content: <span>{this.state.firstAmount}</span>
  2143. // },
  2144. {
  2145. label: "特批立项",
  2146. content: <span>{getApprovedState(this.state.approval)}</span>
  2147. },
  2148. {
  2149. label: "合同签订时间",
  2150. content: <span>{this.state.signDate}</span>
  2151. },
  2152. {
  2153. label: "订单部门",
  2154. content: <span>{this.state.depName}</span>
  2155. }
  2156. ];
  2157. const dataSources = this.state.customerArr || [];
  2158. const cuiDataList = this.state.contactList || [];
  2159. let departmentArr = this.state.departmentArr || [];
  2160. const options = this.state.states
  2161. ? dataSources.map(group => (
  2162. <Select.Option key={group.id} value={group.name}>
  2163. {group.name}
  2164. </Select.Option>
  2165. ))
  2166. : dataSources.map((group, index) => (
  2167. <Select.Option key={index} value={group.bname}>
  2168. {group.bname}
  2169. </Select.Option>
  2170. ));
  2171. return (
  2172. <div>
  2173. <Modal
  2174. maskClosable={false}
  2175. visible={this.state.visible}
  2176. onOk={this.handleOk}
  2177. onCancel={this.handleCancelclose}
  2178. width={!this.props.userDetaile ? "600px" : "900px"}
  2179. title={!this.props.userDetaile ? "创建订单" : ""}
  2180. footer=""
  2181. // width={1300}
  2182. className="admin-desc-content"
  2183. >
  2184. <Form
  2185. layout="horizontal"
  2186. onSubmit={this.handleSubmit}
  2187. id="demand-form"
  2188. style={{ paddingBottom: "40px" }}
  2189. >
  2190. <Spin spinning={this.state.loading}>
  2191. <div className="clearfix">
  2192. {!this.props.userDetaile ? (
  2193. <div className="clearfix">
  2194. <div className="clearfix">
  2195. <FormItem {...formItemLayout} label="订单类型">
  2196. <Select
  2197. placeholder="请选择订单类型"
  2198. style={{ width: "200px" }}
  2199. value={this.state.orderType}
  2200. onChange={e => {
  2201. this.setState({ orderType: e });
  2202. }}
  2203. >
  2204. {orderTypes.map(function(item) {
  2205. return (
  2206. <Select.Option key={item.value}>
  2207. {item.key}
  2208. </Select.Option>
  2209. );
  2210. })}
  2211. </Select>
  2212. <span className="mandatory">*</span>
  2213. </FormItem>
  2214. </div>
  2215. <FormItem {...formItemLayout} label="客户所属类型">
  2216. <Select
  2217. placeholder="请选择客户所属类型"
  2218. style={{ width: "200px" }}
  2219. value={this.state.customType}
  2220. onChange={e => {
  2221. this.setState({ customType: e });
  2222. }}
  2223. >
  2224. {customerType.map(function(item) {
  2225. return (
  2226. <Select.Option key={item.value}>
  2227. {item.key}
  2228. </Select.Option>
  2229. );
  2230. })}
  2231. </Select>
  2232. </FormItem>
  2233. <div className="clearfix">
  2234. <FormItem {...formItemLayout} label="客户名称">
  2235. <AutoComplete
  2236. className="certain-category-search"
  2237. dropdownClassName="certain-category-search-dropdown"
  2238. dropdownMatchSelectWidth={false}
  2239. dropdownStyle={{ width: 200 }}
  2240. size="large"
  2241. style={{ width: "200px" }}
  2242. dataSource={options}
  2243. placeholder="输入名称"
  2244. value={this.state.customerName}
  2245. onChange={this.customerChange}
  2246. filterOption={true}
  2247. onSelect={this.selectAutoCUT}
  2248. >
  2249. <Input />
  2250. </AutoComplete>
  2251. <span className="mandatory">*</span>
  2252. </FormItem>
  2253. </div>
  2254. <div className="addSave" style={{ marginTop: "15px" }}>
  2255. <Button
  2256. className="cancel"
  2257. type="primary"
  2258. onClick={this.handleCancel}
  2259. style={{ marginLeft: "150px" }}
  2260. htmlType="submit"
  2261. >
  2262. 开单
  2263. </Button>
  2264. <Button
  2265. className="cancel"
  2266. type="ghost"
  2267. onClick={this.handleCancelclose}
  2268. style={{ marginLeft: "50px" }}
  2269. >
  2270. 取消
  2271. </Button>
  2272. </div>
  2273. </div>
  2274. ) : (
  2275. <Tabs
  2276. onChange={this.callback}
  2277. activeKey={this.state.activeKey}
  2278. >
  2279. <TabPane tab={"编辑订单"} key="1">
  2280. <div className="clearfix">
  2281. <div className="clearfix">
  2282. <FormItem
  2283. className="half-item"
  2284. {...formItemLayout}
  2285. label="合同编号"
  2286. >
  2287. {<span>{this.state.contractNo}</span>}
  2288. </FormItem>
  2289. <FormItem
  2290. className="half-item"
  2291. {...formItemLayout}
  2292. label="订单编号"
  2293. >
  2294. <span>{this.state.orderNo}</span>
  2295. </FormItem>
  2296. <FormItem
  2297. className="half-item"
  2298. {...formItemLayout}
  2299. label="流程状态"
  2300. >
  2301. <span>
  2302. {getProcessStatus(this.state.processStatus)}
  2303. </span>
  2304. </FormItem>
  2305. <FormItem
  2306. className="half-item"
  2307. {...formItemLayout}
  2308. label="结算状态"
  2309. >
  2310. <span>
  2311. {getLiquidationStatus(
  2312. this.state.liquidationStatus
  2313. )}
  2314. </span>
  2315. </FormItem>
  2316. {this.state.processStatus === 0 ? (
  2317. <div className="clearfix">
  2318. <FormItem
  2319. className="half-item"
  2320. {...formItemLayout}
  2321. label="特批立项"
  2322. >
  2323. <Select
  2324. placeholder="请选择客户所属类型"
  2325. style={{ width: "240px" }}
  2326. value={getApprovedState(
  2327. this.state.approval
  2328. )}
  2329. onChange={e => {
  2330. this.setState({ approval: e });
  2331. }}
  2332. >
  2333. {/* {tepi.map(function(item) {
  2334. // if(item.key == "特批通过" || item.key == "特批驳回")
  2335. return (
  2336. <Select.Option key={item.value}>
  2337. {item.key}
  2338. </Select.Option>
  2339. );
  2340. })} */}
  2341. <Select.Option key={0}>
  2342. 非特批
  2343. </Select.Option>
  2344. <Select.Option key={1}>特批</Select.Option>
  2345. </Select>
  2346. </FormItem>
  2347. <FormItem
  2348. className="half-item"
  2349. {...formItemLayout}
  2350. label="合同签订时间"
  2351. >
  2352. <DatePicker
  2353. style={{
  2354. marginTop: "2px",
  2355. // width: "240px",
  2356. height: "32px"
  2357. }}
  2358. showTime
  2359. format="YYYY-MM-DD"
  2360. onOk={() => {}}
  2361. value={
  2362. this.state.signDate
  2363. ? moment(this.state.signDate)
  2364. : null
  2365. }
  2366. onChange={(data, dataString) => {
  2367. this.setState({ signDate: dataString });
  2368. }}
  2369. />
  2370. <span
  2371. className="mandatory"
  2372. style={{ marginLeft: 20 }}
  2373. >
  2374. *
  2375. </span>
  2376. </FormItem>
  2377. <FormItem
  2378. className="half-item"
  2379. {...formItemLayout}
  2380. label="订单部门"
  2381. >
  2382. <Select
  2383. placeholder="请输入订单部门"
  2384. style={{ width: 240 }}
  2385. value={this.state.organizationSearch}
  2386. onChange={e => {
  2387. this.setState({ organizationSearch: e });
  2388. }}
  2389. >
  2390. {departmentArr.map(function(item) {
  2391. return (
  2392. <Select.Option key={item.id}>
  2393. {item.name}
  2394. </Select.Option>
  2395. );
  2396. })}
  2397. </Select>
  2398. </FormItem>
  2399. </div>
  2400. ) : (
  2401. <div className="clearfix">
  2402. <FormItem
  2403. className="half-item"
  2404. {...formItemLayout}
  2405. label="特批立项"
  2406. >
  2407. <span>
  2408. {getApprovedState(this.state.approval)}
  2409. </span>
  2410. </FormItem>
  2411. <FormItem
  2412. className="half-item"
  2413. {...formItemLayout}
  2414. label="合同签订时间"
  2415. >
  2416. <span>{this.state.signDate}</span>
  2417. </FormItem>
  2418. <FormItem
  2419. className="half-item"
  2420. {...formItemLayout}
  2421. label="订单部门"
  2422. >
  2423. <span>{this.state.depName}</span>
  2424. </FormItem>
  2425. </div>
  2426. )}
  2427. </div>
  2428. <h3
  2429. style={{
  2430. marginLeft: 10,
  2431. fontWeight: 800,
  2432. marginBottom: 10
  2433. }}
  2434. >
  2435. 收款项目
  2436. </h3>
  2437. {this.state.processStatus === 0 ? (
  2438. <div className="clearfix">
  2439. <FormItem
  2440. className="half-item"
  2441. {...formItemLayout}
  2442. label="签单金额(万元)"
  2443. >
  2444. <Input
  2445. placeholder="签单金额"
  2446. ref="signTotalAmount"
  2447. value={this.state.totalAmount}
  2448. onChange={e => {
  2449. this.setState({
  2450. totalAmount: e.target.value
  2451. });
  2452. }}
  2453. style={{ width: "240px" }}
  2454. />
  2455. {/* <span className="mandatory">*</span> */}
  2456. </FormItem>
  2457. <FormItem
  2458. className="half-item"
  2459. {...formItemLayout}
  2460. label="首付金额(万元)"
  2461. >
  2462. <Input
  2463. placeholder="请输入实签首款金额"
  2464. ref="signFirstPayment"
  2465. value={this.state.firstAmount}
  2466. onChange={e => {
  2467. this.setState({
  2468. firstAmount: e.target.value
  2469. });
  2470. }}
  2471. style={{ width: "240px" }}
  2472. />
  2473. {/* <span className="mandatory">*</span> */}
  2474. </FormItem>
  2475. <FormItem
  2476. className="half-item"
  2477. {...formItemLayout}
  2478. label="已收款项"
  2479. >
  2480. <span>
  2481. {this.state.settlementAmount + "万元"}
  2482. </span>
  2483. {/* {this.state.settlementAmount ? (
  2484. <Button
  2485. type="primary"
  2486. onClick={this.tuikuan}
  2487. style={{
  2488. float: "right",
  2489. marginRight: "50px",
  2490. marginBottom: "15px"
  2491. }}
  2492. >
  2493. 退单
  2494. </Button>
  2495. ) : (
  2496. ""
  2497. )} */}
  2498. </FormItem>
  2499. </div>
  2500. ) : (
  2501. <div className="clearfix">
  2502. <FormItem
  2503. className="half-item"
  2504. {...formItemLayout}
  2505. label="签单金额(万元)"
  2506. >
  2507. <span>{this.state.totalAmount}</span>
  2508. </FormItem>
  2509. <FormItem
  2510. className="half-item"
  2511. {...formItemLayout}
  2512. label="首付金额(万元)"
  2513. >
  2514. <span>{this.state.firstAmount}</span>
  2515. </FormItem>
  2516. <FormItem
  2517. className="half-item"
  2518. {...formItemLayout}
  2519. label="已收款项"
  2520. >
  2521. <span>
  2522. {this.state.settlementAmount + "万元"}
  2523. </span>
  2524. {/* {this.state.settlementAmount ? (
  2525. <Button
  2526. type="primary"
  2527. onClick={this.tuikuan}
  2528. style={{
  2529. float: "right",
  2530. marginRight: "50px",
  2531. marginBottom: "15px"
  2532. }}
  2533. >
  2534. 退单
  2535. </Button>
  2536. ) : (
  2537. ""
  2538. )} */}
  2539. </FormItem>
  2540. </div>
  2541. )}
  2542. <h3
  2543. style={{
  2544. marginLeft: 10,
  2545. fontWeight: 800,
  2546. marginBottom: 10
  2547. }}
  2548. >
  2549. 联系信息
  2550. </h3>
  2551. {this.state.processStatus == 0 ? (
  2552. <div className="clearfix">
  2553. <div className="clearfix">
  2554. <FormItem
  2555. className="half-item"
  2556. {...formItemLayout}
  2557. label="客户名称"
  2558. >
  2559. <span>{this.state.userName}</span>
  2560. </FormItem>
  2561. </div>
  2562. <FormItem
  2563. className="half-item"
  2564. {...formItemLayout}
  2565. label="企业联系人"
  2566. >
  2567. <Input
  2568. placeholder="请输入联系人"
  2569. ref="signTotalAmount"
  2570. value={this.state.contacts}
  2571. onChange={e => {
  2572. this.setState({ contacts: e.target.value });
  2573. }}
  2574. style={{ width: "240px" }}
  2575. />
  2576. </FormItem>
  2577. <FormItem
  2578. className="half-item"
  2579. {...formItemLayout}
  2580. label="联系人电话"
  2581. >
  2582. <Input
  2583. placeholder="请输入联系人电话"
  2584. ref="signTotalAmount"
  2585. value={this.state.contactMobile}
  2586. onChange={e => {
  2587. this.setState({
  2588. contactMobile: e.target.value
  2589. });
  2590. }}
  2591. style={{ width: "240px" }}
  2592. />
  2593. </FormItem>
  2594. <FormItem
  2595. className="half-item"
  2596. {...formItemLayout}
  2597. label="企业法人"
  2598. >
  2599. <Input
  2600. placeholder="请输入法人"
  2601. ref="signTotalAmount"
  2602. value={this.state.legalPerson}
  2603. onChange={e => {
  2604. this.setState({
  2605. legalPerson: e.target.value
  2606. });
  2607. }}
  2608. style={{ width: "240px" }}
  2609. />
  2610. </FormItem>
  2611. <FormItem
  2612. className="half-item"
  2613. {...formItemLayout}
  2614. label="法人电话"
  2615. >
  2616. <Input
  2617. placeholder="请输入法人电话"
  2618. ref="signTotalAmount"
  2619. value={this.state.legalPersonTel}
  2620. onChange={e => {
  2621. this.setState({
  2622. legalPersonTel: e.target.value
  2623. });
  2624. }}
  2625. style={{ width: "240px" }}
  2626. />
  2627. </FormItem>
  2628. </div>
  2629. ) : (
  2630. <div className="clearfix">
  2631. {formItemList.map((data, index) => {
  2632. return (
  2633. <FormItem
  2634. className="half-item"
  2635. {...formItemLayout}
  2636. key={index}
  2637. label={data.label}
  2638. >
  2639. {data.content}
  2640. </FormItem>
  2641. );
  2642. })}
  2643. </div>
  2644. )}
  2645. <div className="clearfix">
  2646. {this.state.processStatus == 0 ? (
  2647. <FormItem
  2648. labelCol={{ span: 4 }}
  2649. wrapperCol={{ span: 18 }}
  2650. label={
  2651. <span>
  2652. <strong style={{ color: "#f00" }}>*</strong>
  2653. 合同扫描件
  2654. </span>
  2655. }
  2656. >
  2657. <PicturesWall
  2658. fileList={this.getOrgCodeUrl}
  2659. pictureUrl={this.state.orgCodeUrl}
  2660. url="/api/admin/order/uploadOrderImg"
  2661. sign=""
  2662. />
  2663. <p>图片建议:要清晰。</p>
  2664. <Button
  2665. style={{
  2666. float: "right",
  2667. marginRight: "140px",
  2668. marginTop: "20px"
  2669. }}
  2670. onClick={this.getOrderLog}
  2671. >
  2672. 查看订单日志
  2673. </Button>
  2674. </FormItem>
  2675. ) : (
  2676. <FormItem
  2677. labelCol={{ span: 4 }}
  2678. wrapperCol={{ span: 18 }}
  2679. label="合同扫描件"
  2680. >
  2681. <Upload
  2682. className="demandDetailShow-upload"
  2683. listType="picture-card"
  2684. fileList={this.state.orgCodeUrl}
  2685. onPreview={file => {
  2686. this.setState({
  2687. previewImage: file.url || file.thumbUrl,
  2688. previewVisible: true
  2689. });
  2690. }}
  2691. ></Upload>
  2692. <Modal
  2693. maskClosable={false}
  2694. footer={null}
  2695. visible={this.state.previewVisible}
  2696. onCancel={() => {
  2697. this.setState({ previewVisible: false });
  2698. }}
  2699. >
  2700. <img
  2701. alt=""
  2702. style={{ width: "100%" }}
  2703. src={this.state.previewImage || ""}
  2704. />
  2705. </Modal>
  2706. <Button
  2707. style={{
  2708. float: "right",
  2709. marginRight: "140px",
  2710. marginTop: "20px"
  2711. }}
  2712. onClick={this.getOrderLog}
  2713. >
  2714. 查看订单日志
  2715. </Button>
  2716. </FormItem>
  2717. )}
  2718. </div>
  2719. <div className="clearfix">
  2720. {this.state.processStatus == 0 ? (
  2721. <div className="clearfix">
  2722. <FormItem
  2723. labelCol={{ span: 4 }}
  2724. wrapperCol={{ span: 16 }}
  2725. label="订单留言"
  2726. >
  2727. <Input
  2728. type="textarea"
  2729. placeholder="请输入订单留言"
  2730. rows={4}
  2731. value={this.state.orderRemarks}
  2732. onChange={e => {
  2733. this.setState({
  2734. orderRemarks: e.target.value
  2735. });
  2736. }}
  2737. style={{ width: "95%" }}
  2738. />
  2739. <span className="mandatory">*</span>
  2740. </FormItem>
  2741. </div>
  2742. ) : (
  2743. <FormItem
  2744. labelCol={{ span: 4 }}
  2745. wrapperCol={{ span: 16 }}
  2746. label="订单留言"
  2747. >
  2748. <p
  2749. style={{ width: 500, wordWrap: "break-word" }}
  2750. >
  2751. {this.state.orderRemarks}
  2752. </p>
  2753. </FormItem>
  2754. )}
  2755. </div>
  2756. <div className="clearfix">
  2757. <FormItem
  2758. className="half-item"
  2759. {...formItemLayout}
  2760. label="订单负责人"
  2761. >
  2762. <span>{this.state.salesmanName}</span>
  2763. </FormItem>
  2764. <FormItem
  2765. className="half-item"
  2766. {...formItemLayout}
  2767. label="订单负责人电话"
  2768. >
  2769. <span>{this.state.salesmanMobile}</span>
  2770. </FormItem>
  2771. </div>
  2772. <div className="clearfix">
  2773. <FormItem
  2774. className="half-item"
  2775. {...formItemLayout}
  2776. label="当前财务负责人"
  2777. >
  2778. <span>{this.state.nowFinance}</span>
  2779. </FormItem>
  2780. <FormItem
  2781. className="half-item"
  2782. {...formItemLayout}
  2783. label="当前财务负责人电话"
  2784. >
  2785. <span>{this.state.nowFinanceMobile}</span>
  2786. </FormItem>
  2787. </div>
  2788. <div className="clearfix">
  2789. <FormItem
  2790. className="half-item"
  2791. {...formItemLayout}
  2792. style={{ opacity: ".5" }}
  2793. label="原订单负责人"
  2794. >
  2795. <span>{this.state.oldSalesmanName}</span>
  2796. </FormItem>
  2797. <FormItem
  2798. className="half-item"
  2799. {...formItemLayout}
  2800. style={{ opacity: ".5" }}
  2801. label="原订单负责人电话"
  2802. >
  2803. <span>{this.state.oldSalesmanMobile}</span>
  2804. </FormItem>
  2805. </div>
  2806. <div className="clearfix">
  2807. <FormItem
  2808. className="half-item"
  2809. style={{ opacity: ".5" }}
  2810. {...formItemLayout}
  2811. label="实际财务操作人"
  2812. >
  2813. <span>{this.state.financeName}</span>
  2814. </FormItem>
  2815. <FormItem
  2816. className="half-item"
  2817. {...formItemLayout}
  2818. style={{ opacity: ".5" }}
  2819. label="实际财务操作人电话"
  2820. >
  2821. <span>{this.state.financeMobile}</span>
  2822. </FormItem>
  2823. </div>
  2824. <div>
  2825. <span
  2826. style={{ marginLeft: "50px", fontSize: "20px" }}
  2827. >
  2828. 项目业务
  2829. </span>
  2830. {this.state.processStatus == 0 ? (
  2831. <Button
  2832. type="primary"
  2833. onClick={this.addDetailed}
  2834. style={{
  2835. float: "right",
  2836. marginRight: "50px",
  2837. marginBottom: "15px"
  2838. }}
  2839. >
  2840. 添加项目明细
  2841. </Button>
  2842. ) : (
  2843. ""
  2844. )}
  2845. </div>
  2846. <div
  2847. className="patent-table"
  2848. style={{ marginBottom: 10 }}
  2849. >
  2850. <Spin spinning={this.state.loading}>
  2851. <Table
  2852. columns={this.state.columns}
  2853. dataSource={this.state.dataSource}
  2854. pagination={this.state.pagination}
  2855. onRowClick={this.tableRowClick}
  2856. bordered
  2857. size="small"
  2858. />
  2859. </Spin>
  2860. </div>
  2861. <div
  2862. style={{
  2863. display: cuiDataList.length ? "block" : "none"
  2864. }}
  2865. >
  2866. <span
  2867. style={{ marginLeft: "50px", fontSize: "20px" }}
  2868. >
  2869. 旧催款节点
  2870. </span>
  2871. <Button
  2872. type="primary"
  2873. // onClick={this.addcontact}
  2874. disabled
  2875. onClick={e => {
  2876. cuiDataList.length
  2877. ? this.addcontact()
  2878. : this.addcontactNew();
  2879. }}
  2880. style={{
  2881. float: "right",
  2882. marginRight: "50px",
  2883. marginBottom: "15px",
  2884. display:
  2885. this.state.processStatus == 0
  2886. ? "block"
  2887. : "none"
  2888. }}
  2889. >
  2890. 添加催款节点
  2891. </Button>
  2892. </div>
  2893. <div
  2894. className="clearfix"
  2895. style={{
  2896. display: cuiDataList.length ? "block" : "none"
  2897. }}
  2898. >
  2899. <Spin spinning={this.state.loading}>
  2900. <Form layout="horizontal" id="demand-form">
  2901. <Table
  2902. pagination={false}
  2903. columns={this.state.ContactsLists}
  2904. dataSource={this.state.contactList}
  2905. scroll={{ x: "max-content", y: 0 }}
  2906. />
  2907. <Col
  2908. span={24}
  2909. offset={9}
  2910. style={{ marginTop: "15px" }}
  2911. ></Col>
  2912. </Form>
  2913. </Spin>
  2914. </div>
  2915. <div
  2916. style={{
  2917. display: cuiDataList.length ? "none" : "block"
  2918. }}
  2919. >
  2920. <span
  2921. style={{
  2922. marginLeft: "50px",
  2923. fontSize: "20px"
  2924. }}
  2925. >
  2926. 新催款节点
  2927. </span>
  2928. <Button
  2929. type="primary"
  2930. disabled={this.state.addFlag ? true : false}
  2931. // onClick={this.addcontact}
  2932. onClick={e => {
  2933. this.setState({ addFlag: true });
  2934. this.addcontactNew();
  2935. }}
  2936. style={{
  2937. float: "right",
  2938. marginRight: "50px",
  2939. marginBottom: "15px",
  2940. display:
  2941. this.state.processStatus == 0
  2942. ? "block"
  2943. : "none"
  2944. }}
  2945. >
  2946. 添加催款节点
  2947. </Button>
  2948. </div>
  2949. <div
  2950. className="clearfix"
  2951. style={{
  2952. display: cuiDataList.length ? "none" : "block"
  2953. }}
  2954. >
  2955. <Spin spinning={this.state.loading}>
  2956. <Form layout="horizontal" id="demand-form">
  2957. <Table
  2958. pagination={false}
  2959. columns={this.state.ContactsListsNew}
  2960. dataSource={this.state.contactListNew}
  2961. scroll={{ x: "max-content", y: 0 }}
  2962. bordered
  2963. size="small"
  2964. />
  2965. <Col
  2966. span={24}
  2967. offset={9}
  2968. style={{ marginTop: "15px" }}
  2969. ></Col>
  2970. </Form>
  2971. </Spin>
  2972. </div>
  2973. {this.state.processStatus == 0 ? (
  2974. <div
  2975. className="addSave"
  2976. style={{ marginTop: "15px" }}
  2977. >
  2978. <Button
  2979. className="cancel"
  2980. type="primary"
  2981. onClick={this.handleCancels}
  2982. style={{ marginLeft: "200px" }}
  2983. htmlType="submit"
  2984. >
  2985. 签单
  2986. </Button>
  2987. <Button
  2988. className="cancel"
  2989. type="primary"
  2990. onClick={this.handleCancelq}
  2991. style={{ marginLeft: "50px" }}
  2992. htmlType="submit"
  2993. >
  2994. 保存
  2995. </Button>
  2996. <Button
  2997. className="cancel"
  2998. type="ghost"
  2999. onClick={this.handleCancelclose}
  3000. style={{ marginLeft: "50px" }}
  3001. >
  3002. 取消
  3003. </Button>
  3004. </div>
  3005. ) : (
  3006. ""
  3007. )}
  3008. </div>
  3009. </TabPane>
  3010. <TabPane tab="合同变更记录" key="2">
  3011. {
  3012. <div>
  3013. <div className="clearfix">
  3014. <FormItem
  3015. className="half-item"
  3016. {...formItemLayout}
  3017. label="客户名称"
  3018. >
  3019. <span>{this.state.userName}</span>
  3020. </FormItem>
  3021. </div>
  3022. <div className="clearfix">
  3023. <FormItem
  3024. className="half-item"
  3025. {...formItemLayout}
  3026. label="合同编号"
  3027. >
  3028. <span>{this.state.contractNo}</span>
  3029. </FormItem>
  3030. </div>
  3031. <div className="clearfix">
  3032. <FormItem
  3033. className="half-item"
  3034. {...formItemLayout}
  3035. label="申请变更部门"
  3036. >
  3037. {!this.state.mark ? (
  3038. <Select
  3039. placeholder="请输入变更部门"
  3040. style={{ width: 240 }}
  3041. value={this.state.depName}
  3042. onChange={e => {
  3043. this.setState({ depName: e });
  3044. // console.log("5454", e);
  3045. }}
  3046. >
  3047. {departmentArr.map(function(item) {
  3048. return (
  3049. <Select.Option
  3050. key={item.id}
  3051. value={item.name}
  3052. >
  3053. {item.name}
  3054. </Select.Option>
  3055. );
  3056. })}
  3057. </Select>
  3058. ) : (
  3059. <span>{contractData.depName}</span>
  3060. )}
  3061. </FormItem>
  3062. <FormItem
  3063. className="half-item"
  3064. {...formItemLayout}
  3065. label="申请人"
  3066. >
  3067. {!this.state.mark ? (
  3068. <Input
  3069. placeholder="请输入申请人"
  3070. ref="signTotalAmount"
  3071. value={this.state.salesmanName}
  3072. onChange={e => {
  3073. this.setState({
  3074. salesmanName: e.target.value
  3075. });
  3076. }}
  3077. style={{ width: "240px" }}
  3078. />
  3079. ) : (
  3080. <span>{contractData.applicant}</span>
  3081. )}
  3082. </FormItem>
  3083. </div>
  3084. <div className="clearfix">
  3085. <FormItem
  3086. labelCol={{ span: 4 }}
  3087. wrapperCol={{ span: 18 }}
  3088. label="变更类型"
  3089. >
  3090. {!this.state.mark ? (
  3091. <Select
  3092. placeholder="选择合同变更类型"
  3093. style={{ width: 200 }}
  3094. onChange={e => {
  3095. this.setState({
  3096. typeChange: e
  3097. });
  3098. }}
  3099. value={this.state.typeChange}
  3100. >
  3101. <Option value={0}>退单退款</Option>
  3102. <Option value={1}>项目及金额变更</Option>
  3103. <Option value={2}>仅项目变更</Option>
  3104. <Option value={3}>仅金额变更</Option>
  3105. <Option value={4}>重报</Option>
  3106. <Option value={5}>赠送</Option>
  3107. </Select>
  3108. ) : (
  3109. <span>
  3110. {getChangeType(contractData.type)}
  3111. </span>
  3112. )}
  3113. </FormItem>
  3114. </div>
  3115. <div className="clearfix">
  3116. <FormItem
  3117. labelCol={{ span: 4 }}
  3118. wrapperCol={{ span: 18 }}
  3119. label="合同额(万元)"
  3120. >
  3121. {!this.state.mark ? (
  3122. <Input
  3123. placeholder="请输入合同额"
  3124. ref="signTotalAmount"
  3125. value={this.state.totalAmount}
  3126. onChange={e => {
  3127. this.setState({
  3128. totalAmount: e.target.value
  3129. });
  3130. }}
  3131. style={{ width: "240px" }}
  3132. />
  3133. ) : (
  3134. <span>{contractData.totalAmount}</span>
  3135. )}
  3136. </FormItem>
  3137. <FormItem
  3138. labelCol={{ span: 4 }}
  3139. wrapperCol={{ span: 18 }}
  3140. label="已收款(万元)"
  3141. >
  3142. {!this.state.mark ? (
  3143. <Input
  3144. placeholder="请输入已收款"
  3145. ref="signTotalAmount"
  3146. value={this.state.settlementAmount}
  3147. onChange={e => {
  3148. this.setState({
  3149. settlementAmount: e.target.value
  3150. });
  3151. }}
  3152. style={{ width: "240px" }}
  3153. />
  3154. ) : (
  3155. <span>{contractData.settlementAmount}</span>
  3156. )}
  3157. </FormItem>
  3158. <FormItem
  3159. labelCol={{ span: 4 }}
  3160. wrapperCol={{ span: 18 }}
  3161. label="申请退款(万元)"
  3162. >
  3163. {!this.state.mark ? (
  3164. <Input
  3165. placeholder="请输入申请退款"
  3166. ref="signTotalAmount"
  3167. value={this.state.changeAmount}
  3168. onChange={e => {
  3169. this.setState({
  3170. changeAmount: e.target.value
  3171. });
  3172. }}
  3173. style={{ width: "240px" }}
  3174. />
  3175. ) : (
  3176. <span>{contractData.changeAmount}</span>
  3177. )}
  3178. </FormItem>
  3179. </div>
  3180. <div className="clearfix">
  3181. <FormItem
  3182. style={{ height: "auto" }}
  3183. labelCol={{ span: 4 }}
  3184. wrapperCol={{ span: 18 }}
  3185. label="变更原因"
  3186. >
  3187. {!this.state.mark ? (
  3188. <TextArea
  3189. rows={4}
  3190. placeholder="请输入变更原因"
  3191. ref="signTotalAmount"
  3192. style={{ width: "95%" }}
  3193. value={this.state.remarksC}
  3194. onChange={e => {
  3195. this.setState({
  3196. remarksC: e.target.value
  3197. });
  3198. }}
  3199. />
  3200. ) : (
  3201. <span>{contractData.remarks}</span>
  3202. )}
  3203. </FormItem>
  3204. </div>
  3205. {/*----- */}
  3206. <div className="clearfix">
  3207. <FormItem
  3208. style={{ height: "auto" }}
  3209. labelCol={{ span: 4 }}
  3210. wrapperCol={{ span: 18 }}
  3211. label="备注"
  3212. >
  3213. {!this.state.mark ? (
  3214. <TextArea
  3215. rows={4}
  3216. placeholder="请输入备注"
  3217. ref="signTotalAmount"
  3218. style={{ width: "95%" }}
  3219. value={this.state.startRemarks}
  3220. onChange={e => {
  3221. this.setState({
  3222. startRemarks: e.target.value
  3223. });
  3224. }}
  3225. />
  3226. ) : (
  3227. <span>{contractData.startRemarks}</span>
  3228. )}
  3229. </FormItem>
  3230. </div>
  3231. {/* ---- */}
  3232. <div className="clearfix">
  3233. <FormItem
  3234. labelCol={{ span: 4 }}
  3235. wrapperCol={{ span: 18 }}
  3236. label="变更凭证"
  3237. >
  3238. {!this.state.mark ? (
  3239. <PicturesWall
  3240. fileList={this.getVoucherUrl}
  3241. pictureUrl={this.state.voucherUrl}
  3242. url="/api/admin/orderChange/uploadFile"
  3243. sign="order_change_file"
  3244. />
  3245. ) : (
  3246. <div>
  3247. <Upload
  3248. className="demandDetailShow-upload"
  3249. listType="picture-card"
  3250. fileList={this.state.voucherUrl}
  3251. onPreview={file => {
  3252. this.setState({
  3253. previewImage:
  3254. file.url || file.thumbUrl,
  3255. previewVisible: true
  3256. });
  3257. }}
  3258. />
  3259. <Modal
  3260. maskClosable={false}
  3261. footer={null}
  3262. visible={this.state.previewVisible}
  3263. onCancel={() => {
  3264. this.setState({
  3265. previewVisible: false
  3266. });
  3267. }}
  3268. >
  3269. <img
  3270. alt=""
  3271. style={{ width: "100%" }}
  3272. src={this.state.previewImage || ""}
  3273. />
  3274. </Modal>
  3275. </div>
  3276. )}
  3277. <p>图片建议:要清晰。</p>
  3278. </FormItem>
  3279. </div>
  3280. {!this.state.mark ? (
  3281. <div className="clearfix">
  3282. <Button
  3283. type="primary"
  3284. style={{ float: "right", marginRight: 40 }}
  3285. onClick={this.changeApply}
  3286. >
  3287. 发起变更申请
  3288. </Button>
  3289. </div>
  3290. ) : (
  3291. ""
  3292. )}
  3293. </div>
  3294. }
  3295. </TabPane>
  3296. </Tabs>
  3297. )}
  3298. </div>
  3299. </Spin>
  3300. </Form>
  3301. </Modal>
  3302. <Modal
  3303. maskClosable={false}
  3304. visible={this.state.addnextVisible}
  3305. onOk={this.nextCancel}
  3306. onCancel={this.nextCancel}
  3307. width="800px"
  3308. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  3309. footer=""
  3310. className="admin-desc-content"
  3311. >
  3312. <Form
  3313. layout="horizontal"
  3314. onSubmit={this.nextSubmit}
  3315. id="demand-form"
  3316. >
  3317. <Spin spinning={this.state.loading}>
  3318. {this.state.addState ? (
  3319. <div className="clearfix">
  3320. <FormItem
  3321. className="half-item"
  3322. {...formItemLayout}
  3323. label="服务名称"
  3324. >
  3325. <AutoComplete
  3326. className="certain-category-search"
  3327. dropdownClassName="certain-category-search-dropdown"
  3328. dropdownMatchSelectWidth={false}
  3329. dropdownStyle={{ width: 200 }}
  3330. style={{ width: "200px" }}
  3331. dataSource={options}
  3332. placeholder="输入服务名称"
  3333. value={this.state.commodityName}
  3334. onChange={this.httpChange}
  3335. filterOption={true}
  3336. onSelect={this.selectAuto}
  3337. >
  3338. <Input />
  3339. </AutoComplete>
  3340. <span className="mandatory">*</span>
  3341. </FormItem>
  3342. <FormItem
  3343. className="half-item"
  3344. {...formItemLayout}
  3345. label="服务数量"
  3346. >
  3347. <Input
  3348. placeholder="请输入服务数量"
  3349. value={this.state.commodityQuantity}
  3350. style={{ width: "200px" }}
  3351. onChange={e => {
  3352. this.setState({ commodityQuantity: e.target.value });
  3353. }}
  3354. ref="commodityQuantity"
  3355. />
  3356. <span className="mandatory">*</span>
  3357. </FormItem>
  3358. <FormItem
  3359. className="half-item"
  3360. {...formItemLayout}
  3361. label="实签价格(万元)"
  3362. >
  3363. <Input
  3364. placeholder="请输入实签价格"
  3365. value={this.state.commodityPrice}
  3366. style={{ width: "200px" }}
  3367. onChange={e => {
  3368. this.setState({ commodityPrice: e.target.value });
  3369. }}
  3370. ref="commodityPrice"
  3371. />
  3372. <span className="mandatory">*</span>
  3373. </FormItem>
  3374. <FormItem
  3375. className="half-item"
  3376. {...formItemLayout}
  3377. label="主要业务"
  3378. >
  3379. <Select
  3380. placeholder="选择是否为主要业务"
  3381. style={{ width: "200px" }}
  3382. value={this.state.main}
  3383. onChange={e => {
  3384. this.setState({ main: e });
  3385. }}
  3386. >
  3387. {boutique.map(function(item) {
  3388. return (
  3389. <Select.Option key={item.value}>
  3390. {item.key}
  3391. </Select.Option>
  3392. );
  3393. })}
  3394. </Select>
  3395. <span className="mandatory">*</span>
  3396. </FormItem>
  3397. <div className="clearfix">
  3398. <FormItem
  3399. labelCol={{ span: 4 }}
  3400. wrapperCol={{ span: 16 }}
  3401. label="服务说明"
  3402. >
  3403. <Input
  3404. type="textarea"
  3405. placeholder="请输入服务说明"
  3406. value={this.state.taskComment}
  3407. onChange={e => {
  3408. this.setState({ taskComment: e.target.value });
  3409. }}
  3410. />
  3411. </FormItem>
  3412. </div>
  3413. <FormItem
  3414. wrapperCol={{ span: 12, offset: 4 }}
  3415. className="half-middle"
  3416. >
  3417. <Button
  3418. className="submitSave"
  3419. type="primary"
  3420. htmlType="submit"
  3421. >
  3422. 保存
  3423. </Button>
  3424. <Button
  3425. className="submitSave"
  3426. type="ghost"
  3427. onClick={this.nextCancel}
  3428. >
  3429. 取消
  3430. </Button>
  3431. </FormItem>
  3432. </div>
  3433. ) : (
  3434. <div className="clearfix">
  3435. {this.state.processStatus == 0 ? (
  3436. <div className="clearfix">
  3437. <FormItem
  3438. className="half-item"
  3439. {...formItemLayout}
  3440. label="项目名称"
  3441. >
  3442. <span>{this.state.commodityName}</span>
  3443. </FormItem>
  3444. <FormItem
  3445. className="half-item"
  3446. {...formItemLayout}
  3447. label="项目数量"
  3448. >
  3449. <Input
  3450. placeholder="请输入数量"
  3451. value={this.state.commodityQuantity}
  3452. style={{ width: "200px" }}
  3453. onChange={e => {
  3454. this.setState({
  3455. commodityQuantity: e.target.value
  3456. });
  3457. }}
  3458. />
  3459. <span className="mandatory">*</span>
  3460. </FormItem>
  3461. <FormItem
  3462. className="half-item"
  3463. {...formItemLayout}
  3464. label="金额(万元)"
  3465. >
  3466. <Input
  3467. placeholder="请输入签单金额"
  3468. value={this.state.commodityPrice}
  3469. style={{ width: "200px" }}
  3470. onChange={e => {
  3471. this.setState({ commodityPrice: e.target.value });
  3472. }}
  3473. />
  3474. <span className="mandatory">*</span>
  3475. </FormItem>
  3476. <FormItem
  3477. className="half-item"
  3478. {...formItemLayout}
  3479. label="主要项目"
  3480. >
  3481. <Select
  3482. placeholder="选择是否为主要业务"
  3483. style={{ width: "200px" }}
  3484. value={this.state.main}
  3485. onChange={e => {
  3486. this.setState({ main: e });
  3487. }}
  3488. >
  3489. {boutique.map(function(item) {
  3490. return (
  3491. <Select.Option key={item.value}>
  3492. {item.key}
  3493. </Select.Option>
  3494. );
  3495. })}
  3496. </Select>
  3497. <span className="mandatory">*</span>
  3498. </FormItem>
  3499. <div className="clearfix">
  3500. <FormItem
  3501. labelCol={{ span: 4 }}
  3502. wrapperCol={{ span: 16 }}
  3503. label="服务说明"
  3504. >
  3505. <Input
  3506. type="textarea"
  3507. placeholder="请输入服务说明"
  3508. value={this.state.taskComment}
  3509. onChange={e => {
  3510. this.setState({ taskComment: e.target.value });
  3511. }}
  3512. />
  3513. </FormItem>
  3514. </div>
  3515. <FormItem
  3516. wrapperCol={{ span: 12, offset: 4 }}
  3517. className="half-middle"
  3518. >
  3519. <Button
  3520. className="submitSave"
  3521. type="primary"
  3522. onClick={this.tabRowSave}
  3523. >
  3524. 保存
  3525. </Button>
  3526. <Button
  3527. className="submitSave"
  3528. type="ghost"
  3529. onClick={this.nextCancel}
  3530. >
  3531. 取消
  3532. </Button>
  3533. </FormItem>
  3534. </div>
  3535. ) : (
  3536. <div className="clearfix">
  3537. <FormItem
  3538. className="half-item"
  3539. {...formItemLayout}
  3540. label="项目名称"
  3541. >
  3542. <span>{this.state.commodityName}</span>
  3543. </FormItem>
  3544. <FormItem
  3545. className="half-item"
  3546. {...formItemLayout}
  3547. label="项目数量"
  3548. >
  3549. <span>{this.state.commodityQuantity}</span>
  3550. </FormItem>
  3551. <FormItem
  3552. className="half-item"
  3553. {...formItemLayout}
  3554. label="金额(万元)"
  3555. >
  3556. <span>{this.state.commodityPrice}</span>
  3557. </FormItem>
  3558. <FormItem
  3559. className="half-item"
  3560. {...formItemLayout}
  3561. label="主要项目"
  3562. >
  3563. <span>{getboutique(this.state.main)}</span>
  3564. </FormItem>
  3565. <div className="clearfix">
  3566. <FormItem
  3567. labelCol={{ span: 4 }}
  3568. wrapperCol={{ span: 16 }}
  3569. label="服务说明"
  3570. >
  3571. <span>{this.state.taskComment}</span>
  3572. </FormItem>
  3573. </div>
  3574. </div>
  3575. )}
  3576. </div>
  3577. )}
  3578. </Spin>
  3579. </Form>
  3580. </Modal>
  3581. <Modal
  3582. maskClosable={false}
  3583. visible={this.state.lookVisible}
  3584. onOk={this.noCancel}
  3585. onCancel={this.noCancel}
  3586. width="800px"
  3587. title={"退单申请"}
  3588. footer=""
  3589. className="admin-desc-content"
  3590. >
  3591. <Form layout="horizontal" id="demand-form">
  3592. <Spin spinning={this.state.loading}>
  3593. <div className="clearfix">
  3594. <FormItem
  3595. labelCol={{ span: 4 }}
  3596. wrapperCol={{ span: 16 }}
  3597. label="终止合同"
  3598. >
  3599. <Picture
  3600. fileList={e => {
  3601. this.setState({ contractUrl: e });
  3602. }}
  3603. pictureUrl={this.state.contractUrl}
  3604. visible={this.props.visible}
  3605. data={{
  3606. sign: "order_refund_file",
  3607. url: "/api/admin/newOrder/uploadRefundOrderFile",
  3608. number: 8
  3609. }}
  3610. />
  3611. </FormItem>
  3612. </div>
  3613. <div className="clearfix">
  3614. <FormItem
  3615. labelCol={{ span: 4 }}
  3616. wrapperCol={{ span: 16 }}
  3617. label="退单申请表"
  3618. >
  3619. <Picture
  3620. fileList={e => {
  3621. this.setState({ applicationUrl: e });
  3622. }}
  3623. pictureUrl={this.state.applicationUrl}
  3624. visible={this.props.visible}
  3625. data={{
  3626. sign: "order_refund_file",
  3627. url: "/api/admin/newOrder/uploadRefundOrderFile",
  3628. number: 8
  3629. }}
  3630. />
  3631. </FormItem>
  3632. </div>
  3633. <div className="clearfix">
  3634. <FormItem
  3635. labelCol={{ span: 4 }}
  3636. wrapperCol={{ span: 16 }}
  3637. label="退单理由"
  3638. >
  3639. <Input
  3640. type="textarea"
  3641. placeholder="请输入退单理由"
  3642. rows={4}
  3643. value={this.state.reason}
  3644. onChange={e => {
  3645. this.setState({ reason: e.target.value });
  3646. }}
  3647. />
  3648. </FormItem>
  3649. </div>
  3650. <div className="clearfix">
  3651. <Button
  3652. className="cancel"
  3653. type="primary"
  3654. onClick={this.tuidanOk}
  3655. style={{ marginLeft: "50px" }}
  3656. htmlType="submit"
  3657. >
  3658. 确定退单
  3659. </Button>
  3660. <Button
  3661. className="cancel"
  3662. type="ghost"
  3663. onClick={this.noCancel}
  3664. style={{ marginLeft: "50px" }}
  3665. >
  3666. 取消
  3667. </Button>
  3668. </div>
  3669. </Spin>
  3670. </Form>
  3671. </Modal>
  3672. {/* <Modal
  3673. visible={this.state.rizhivisible}
  3674. className="admin-desc-content"
  3675. width="800px"
  3676. maskClosable={false}
  3677. title="订单日志"
  3678. footer={null}
  3679. onCancel={this.closeOrderLog}
  3680. >
  3681. <div className="patent-table">
  3682. <Spin spinning={this.state.loading}>
  3683. <Table
  3684. columns={this.state.columnsrizhi}
  3685. dataSource={this.state.dataSourcerizhi}
  3686. pagination={false}
  3687. />
  3688. </Spin>
  3689. </div>
  3690. </Modal> */}
  3691. <OrderRiZi
  3692. dataSourcerizhi={this.state.dataSourcerizhi}
  3693. closeOrderLog={this.closeOrderLog}
  3694. visible={this.state.rizhivisible}
  3695. loading={this.state.loading}
  3696. />
  3697. </div>
  3698. );
  3699. }
  3700. })
  3701. );
  3702. export default Form.create()(NewService);