changeApply.js 87 KB

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