changeApply.js 89 KB

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