changeApply.js 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971
  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 if (e == 6) {
  1814. this.setState({
  1815. listFlag: true,
  1816. listCuiFlag: true,
  1817. hetongFlag: true,
  1818. tuiKuanFlag: true,
  1819. displayList: false,
  1820. });
  1821. } else if (e == 7) {
  1822. this.setState({
  1823. listFlag: true,
  1824. listCuiFlag: true,
  1825. hetongFlag: true,
  1826. tuiKuanFlag: true,
  1827. displayList: false,
  1828. isNew: true,
  1829. });
  1830. } else {
  1831. this.setState({
  1832. listFlag: false,
  1833. listCuiFlag: false,
  1834. hetongFlag: false,
  1835. tuiKuanFlag: false,
  1836. displayList: false,
  1837. });
  1838. }
  1839. }
  1840. // componentWillReceiveProps(nextProps) {
  1841. // this.state.data = nextProps.orderData;
  1842. // this.state.data.oldPrice = nextProps.orderData.totalAmount;
  1843. // this.setState({
  1844. // data: this.state.data,
  1845. // voucherUrl: nextProps.voucherUrl
  1846. // });
  1847. // // this.proList();
  1848. // // this.cuiList();
  1849. // let e = nextProps.orderData.type;
  1850. // if (e == 1) {
  1851. // this.setState({
  1852. // hetongFlag: false,
  1853. // listFlag: false,
  1854. // listCuiFlag: false,
  1855. // tuiKuanFlag: false,
  1856. // displayList: false
  1857. // });
  1858. // } else if (e == 2) {
  1859. // this.setState({
  1860. // hetongFlag: true,
  1861. // listFlag: false,
  1862. // listCuiFlag: false,
  1863. // tuiKuanFlag: true,
  1864. // displayList: false
  1865. // });
  1866. // } else if (e == 3) {
  1867. // this.setState({
  1868. // listFlag: false,
  1869. // hetongFlag: false,
  1870. // listCuiFlag: false,
  1871. // tuiKuanFlag: false,
  1872. // displayList: true
  1873. // });
  1874. // } else if (e == 4) {
  1875. // this.setState({
  1876. // listFlag: false,
  1877. // listCuiFlag: false,
  1878. // hetongFlag: false,
  1879. // tuiKuanFlag: true,
  1880. // displayList: false
  1881. // });
  1882. // } else if (e == 5) {
  1883. // this.setState({
  1884. // listFlag: false,
  1885. // listCuiFlag: false,
  1886. // hetongFlag: true,
  1887. // tuiKuanFlag: true,
  1888. // displayList: false
  1889. // });
  1890. // } else {
  1891. // this.setState({
  1892. // listFlag: true,
  1893. // hetongFlag: true,
  1894. // listCuiFlag: true,
  1895. // tuiKuanFlag: false,
  1896. // displayList: false
  1897. // });
  1898. // }
  1899. // }
  1900. not() {
  1901. }
  1902. deleteChange() {
  1903. this.setState({
  1904. loading: true,
  1905. });
  1906. $.ajax({
  1907. url: globalConfig.context + "/api/admin/orderChange/cancelOrderChange",
  1908. method: "post",
  1909. data: {
  1910. id: this.state.data.id,
  1911. status: this.state.data.status,
  1912. processState: this.state.data.processState,
  1913. orderNo: this.state.data.orderNo
  1914. },
  1915. }).done(
  1916. function (data) {
  1917. this.setState({
  1918. loading: false,
  1919. });
  1920. if (!data.error.length) {
  1921. message.success("取消成功!");
  1922. this.props.onCancel()
  1923. } else {
  1924. message.warning(data.error[0].message);
  1925. }
  1926. }.bind(this)
  1927. );
  1928. }
  1929. handleClose(removedTag) {
  1930. let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
  1931. this.setState({ serviceLife, serviceYear: undefined });
  1932. }
  1933. // 可展开颜色不同
  1934. addRowColor(record) {
  1935. if (!!record.list && record.list.length > 0) {
  1936. return 'light'
  1937. } else {
  1938. return 'dark'
  1939. }
  1940. }
  1941. render() {
  1942. const expandedRowRender = e => {
  1943. const data = e.list;
  1944. if (e.cSort != 6) {
  1945. let columns = [];
  1946. if (data instanceof Array && data.length) {
  1947. columns = [
  1948. {
  1949. title: "变更状态",
  1950. dataIndex: "type",
  1951. key: "type",
  1952. render: (text, record) => {
  1953. let str = "";
  1954. let color = "";
  1955. if (text == 1) {
  1956. str = "增";
  1957. color = "#87d068";
  1958. } else if (text == 2) {
  1959. str = "改";
  1960. color = "#108ee9";
  1961. } else if (text == 3) {
  1962. str = "删";
  1963. color = "#f50";
  1964. }
  1965. return (
  1966. <span>
  1967. <Tag
  1968. color={color}
  1969. style={{ display: text == 0 ? "none" : "inline-block" }}
  1970. >
  1971. {str}
  1972. </Tag>
  1973. {/* {record.splitStatus == 1 ? (
  1974. <Tag
  1975. color="#108ee9"
  1976. // onClick={e => {
  1977. // e.stopPropagation();
  1978. // this.showRes(record);
  1979. // }}
  1980. >
  1981. 父项目
  1982. </Tag>
  1983. ) : (
  1984. ""
  1985. )}
  1986. {record.splitStatus == 2 ? (
  1987. <Tag
  1988. color="#108ee9"
  1989. // onClick={e => {
  1990. // e.stopPropagation();
  1991. // this.showRes(record);
  1992. // }}
  1993. >
  1994. 子项目
  1995. </Tag>
  1996. ) : (
  1997. ""
  1998. )} */}
  1999. </span>
  2000. );
  2001. },
  2002. },
  2003. {
  2004. title: "业务项目名称",
  2005. dataIndex: "commodityName",
  2006. key: "commodityName",
  2007. render: (text, record) => {
  2008. return <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span>{"-" + record.id}</span>
  2009. }
  2010. },
  2011. {
  2012. title: "项目类别",
  2013. dataIndex: "cname",
  2014. key: "cname",
  2015. },
  2016. {
  2017. title: "项目数量",
  2018. dataIndex: "commodityQuantity",
  2019. key: "commodityQuantity",
  2020. },
  2021. {
  2022. title: "金额(万元)",
  2023. dataIndex: "commodityPrice",
  2024. key: "commodityPrice",
  2025. render: (text, record) => {
  2026. if (record.splitStatus == 2) {
  2027. return "/";
  2028. } else {
  2029. return text;
  2030. }
  2031. },
  2032. },
  2033. {
  2034. title: "主要项目",
  2035. dataIndex: "main",
  2036. key: "main",
  2037. render: (text) => {
  2038. return text ? "是" : "否";
  2039. },
  2040. },
  2041. {
  2042. title: "项目负责人",
  2043. dataIndex: "receiverName",
  2044. key: "receiverName",
  2045. },
  2046. {
  2047. title: "总年限",
  2048. dataIndex: "yearSum",
  2049. key: "yearSum",
  2050. render: (text, record) => {
  2051. return (
  2052. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  2053. );
  2054. }
  2055. },
  2056. {
  2057. title: "年限",
  2058. dataIndex: "serviceLife",
  2059. key: "serviceLife",
  2060. render: (text, record) => {
  2061. return (
  2062. <div>{!!text && JSON.parse(text).toString()}</div>
  2063. );
  2064. }
  2065. },
  2066. {
  2067. title: "本次派单",
  2068. dataIndex: "serviceYear",
  2069. key: "serviceYear",
  2070. render: (text, record) => {
  2071. return (
  2072. <div>{!text ? "" : text}</div>
  2073. );
  2074. }
  2075. },
  2076. {
  2077. title: "项目说明",
  2078. dataIndex: "taskComment",
  2079. key: "taskComment",
  2080. render: (text) => {
  2081. return (
  2082. <Tooltip title={text}>
  2083. <div
  2084. style={{
  2085. width: 100,
  2086. overflow: "hidden",
  2087. whiteSpace: "nowrap",
  2088. textOverflow: "ellipsis",
  2089. }}
  2090. >{text}</div>
  2091. </Tooltip>
  2092. )
  2093. },
  2094. },
  2095. {
  2096. title: "操作",
  2097. dataIndex: "ABC",
  2098. key: "ABC",
  2099. render: (text, record) => {
  2100. return (
  2101. <div>
  2102. <Button
  2103. onClick={(e) => {
  2104. e.stopPropagation();
  2105. this.showConfirm(this.changeDeletePro, record);
  2106. }}
  2107. disabled={this.state.listFlag}
  2108. style={{
  2109. display: this.state.displayList ? "none" : "block",
  2110. }}
  2111. >
  2112. 删除
  2113. </Button>
  2114. </div>
  2115. );
  2116. },
  2117. },
  2118. ];
  2119. return (
  2120. <Table
  2121. columns={columns}
  2122. dataSource={data}
  2123. scroll={{ x: "max-content", y: 0 }}
  2124. pagination={false}
  2125. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2126. />
  2127. );
  2128. } else {
  2129. columns = [];
  2130. return (
  2131. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  2132. 此项目暂未拆分
  2133. </p>
  2134. );
  2135. }
  2136. } else {
  2137. let columns = [];
  2138. if (data instanceof Array && data.length) {
  2139. columns = [
  2140. {
  2141. title: "变更状态",
  2142. dataIndex: "type",
  2143. key: "type",
  2144. render: (text, record) => {
  2145. let str = "";
  2146. let color = "";
  2147. if (text == 1) {
  2148. str = "增";
  2149. color = "#87d068";
  2150. } else if (text == 2) {
  2151. str = "改";
  2152. color = "#108ee9";
  2153. } else if (text == 3) {
  2154. str = "删";
  2155. color = "#f50";
  2156. }
  2157. return (
  2158. <span>
  2159. <Tag
  2160. color={color}
  2161. style={{ display: text == 0 ? "none" : "inline-block" }}
  2162. >
  2163. {str}
  2164. </Tag>
  2165. </span>
  2166. );
  2167. },
  2168. },
  2169. {
  2170. title: "负责人",
  2171. dataIndex: "receiverName",
  2172. key: "receiverName",
  2173. },
  2174. {
  2175. title: "负责人电话",
  2176. dataIndex: "receiverMobile",
  2177. key: "receiverMobile",
  2178. },
  2179. {
  2180. title: "项目状态",
  2181. dataIndex: "projectStatus",
  2182. key: "projectStatus",
  2183. render: (text) => {
  2184. return text
  2185. // return getProjectName(text);
  2186. },
  2187. },
  2188. {
  2189. title: "本次派单",
  2190. dataIndex: "serviceYear",
  2191. key: "serviceYear",
  2192. },
  2193. {
  2194. title: "项目说明",
  2195. dataIndex: "taskComment",
  2196. key: "taskComment",
  2197. render: (text) => {
  2198. return (
  2199. <Tooltip title={text}>
  2200. <div
  2201. >{text}</div>
  2202. </Tooltip>
  2203. )
  2204. },
  2205. },
  2206. ];
  2207. return (
  2208. <Table
  2209. columns={columns}
  2210. dataSource={data}
  2211. pagination={false}
  2212. />
  2213. );
  2214. } else {
  2215. columns = [];
  2216. return (
  2217. <p
  2218. style={{ fontWeight: "bold", color: "red", textAlign: "center" }}
  2219. >
  2220. 暂无派单
  2221. </p>
  2222. );
  2223. }
  2224. }
  2225. };
  2226. const { TextArea } = Input;
  2227. const data = this.state.data;
  2228. // let departmentArr = this.state.departmentArr || [];
  2229. const dataSources = this.state.customerArr || [];
  2230. const cuiDataList = this.state.contactList || [];
  2231. let departmentArr = this.state.departmentArr || [];
  2232. const options = this.state.states
  2233. ? dataSources.map(group => (
  2234. <Select.Option key={group.id} value={group.name}>
  2235. {group.name}
  2236. </Select.Option>
  2237. ))
  2238. : dataSources.map((group, index) => (
  2239. <Select.Option key={index} value={group.bname}>
  2240. {group.bname}
  2241. </Select.Option>
  2242. ));
  2243. let children = vipYear.map(its => (
  2244. <Option key={its}>{its}</Option>
  2245. ));
  2246. const { isVip, histYear, isEdit } = this.state
  2247. return (
  2248. <div>
  2249. <Spin spinning={this.state.loading}>
  2250. {this.state.resVisible ? (
  2251. <ResolutionDetail
  2252. cancel={this.resCancel}
  2253. detail={this.state.resRecord}
  2254. visible={this.state.resVisible}
  2255. id={this.state.resRecord.orderNo}
  2256. />
  2257. ) : (
  2258. ""
  2259. )}
  2260. <div className="clearfix">
  2261. <FormItem
  2262. className="half-item"
  2263. {...formItemLayout}
  2264. label="客户名称"
  2265. >
  2266. <span>{data.userName}</span>
  2267. <EnterpriseNameChange
  2268. type='journal'
  2269. style={{ marginLeft: 10 }}
  2270. enterpriseId={this.props.orderUid} />
  2271. </FormItem>
  2272. </div>
  2273. <div className="clearfix">
  2274. <FormItem
  2275. className="half-item"
  2276. {...formItemLayout}
  2277. label="合同编号"
  2278. >
  2279. <span>{data.contractNo}</span>
  2280. </FormItem>
  2281. </div>
  2282. <div className="clearfix">
  2283. <FormItem
  2284. className="half-item"
  2285. {...formItemLayout}
  2286. label="申请变更部门"
  2287. >
  2288. <span>{this.state.data.depName}</span>
  2289. </FormItem>
  2290. <FormItem className="half-item" {...formItemLayout} label="申请人">
  2291. {/* <Input
  2292. placeholder="请输入申请人"
  2293. ref="signTotalAmount"
  2294. value={data.applicant}
  2295. onChange={e => {
  2296. let data = this.state.data;
  2297. data.applicant = e.target.value;
  2298. this.setState({ data });
  2299. }}
  2300. style={{ width: "240px" }}
  2301. /> */}
  2302. <span>{data.applicant}</span>
  2303. </FormItem>
  2304. </div>
  2305. <div className="clearfix">
  2306. <FormItem
  2307. labelCol={{ span: 4 }}
  2308. wrapperCol={{ span: 18 }}
  2309. label="变更类型"
  2310. >
  2311. <Select
  2312. placeholder="选择合同变更类型"
  2313. style={{ width: 200 }}
  2314. disabled={this.state.changeFlag}
  2315. onChange={(e) => {
  2316. let data = this.state.data;
  2317. data.type = e;
  2318. this.setState({ data, changeFlag: true });
  2319. if (e == 1) {
  2320. this.setState({
  2321. hetongFlag: false,
  2322. listFlag: false,
  2323. listCuiFlag: false,
  2324. tuiKuanFlag: false,
  2325. displayList: false,
  2326. });
  2327. } else if (e == 2) {
  2328. this.setState({
  2329. hetongFlag: true,
  2330. listFlag: false,
  2331. listCuiFlag: false,
  2332. tuiKuanFlag: true,
  2333. displayList: false,
  2334. });
  2335. } else if (e == 3) {
  2336. this.setState({
  2337. listFlag: false,
  2338. hetongFlag: false,
  2339. listCuiFlag: false,
  2340. tuiKuanFlag: false,
  2341. displayList: true,
  2342. });
  2343. } else if (e == 4) {
  2344. this.setState({
  2345. listFlag: false,
  2346. listCuiFlag: false,
  2347. hetongFlag: false,
  2348. tuiKuanFlag: true,
  2349. displayList: false,
  2350. });
  2351. } else if (e == 5) {
  2352. this.setState({
  2353. listFlag: false,
  2354. listCuiFlag: false,
  2355. hetongFlag: true,
  2356. tuiKuanFlag: true,
  2357. displayList: false,
  2358. });
  2359. } else if (e == 6) {
  2360. this.setState({
  2361. listFlag: true,
  2362. listCuiFlag: true,
  2363. hetongFlag: true,
  2364. tuiKuanFlag: true,
  2365. displayList: false,
  2366. });
  2367. } else if (e == 7) {
  2368. this.setState({
  2369. listFlag: true,
  2370. listCuiFlag: true,
  2371. hetongFlag: true,
  2372. tuiKuanFlag: true,
  2373. displayList: false,
  2374. isNew: true, //上传替换合同
  2375. });
  2376. } else {
  2377. this.setState({
  2378. listFlag: false,
  2379. listCuiFlag: false,
  2380. hetongFlag: false,
  2381. tuiKuanFlag: false,
  2382. displayList: false,
  2383. });
  2384. }
  2385. }}
  2386. value={data.type}
  2387. >
  2388. <Option value={0}>退单退款</Option>
  2389. <Option value={1}>项目及金额变更</Option>
  2390. <Option value={2}>仅项目变更</Option>
  2391. <Option value={3}>仅金额变更</Option>
  2392. <Option value={4}>重报</Option>
  2393. <Option value={5}>赠送</Option>
  2394. <Option value={6}>退单不退款</Option>
  2395. <Option value={7}>仅变更合同</Option>
  2396. </Select>
  2397. <Button
  2398. style={{ marginLeft: 10 }}
  2399. onClick={(e) => {
  2400. this.state.data.startRemarks = "";
  2401. this.state.data.remarks = "";
  2402. this.state.data.changeAmount = "0";
  2403. this.state.data.depNameChange = undefined;
  2404. this.state.data.typeChange = undefined;
  2405. this.state.data.totalAmount = this.state.data.oldPrice;
  2406. this.setState({
  2407. listFlag: true,
  2408. listCuiFlag: true,
  2409. hetongFlag: true,
  2410. tuiKuanFlag: true,
  2411. displayList: false,
  2412. isNew: false,
  2413. // listFlag: false,
  2414. // hetongFlag: false,
  2415. // listCuiFlag: false,
  2416. // tuiKuanFlag: false,
  2417. // displayList: false,
  2418. startRemarks: "",
  2419. data: this.state.data,
  2420. changeFlag: false,
  2421. voucherUrl: [],
  2422. // changeAmount: "0",
  2423. // applicant: undefined,
  2424. // depNameChange: undefined,
  2425. // typeChange: [],
  2426. // changeFlag: false
  2427. });
  2428. }}
  2429. >
  2430. 重置
  2431. </Button>
  2432. {(this.state.data.status == 3 || this.state.data.status == 0) ? (
  2433. <Button
  2434. type="danger"
  2435. style={{
  2436. float: "right",
  2437. backgroundColor: "red",
  2438. color: "white",
  2439. position: "absolute",
  2440. right: 0,
  2441. height: 50,
  2442. borderRadius: 20,
  2443. }}
  2444. onClick={(e) => {
  2445. e.stopPropagation();
  2446. this.showConfirmChange(this.deleteChange);
  2447. }}
  2448. >
  2449. 取消本次变更
  2450. </Button>
  2451. ) : (
  2452. ""
  2453. )}
  2454. </FormItem>
  2455. </div>
  2456. <div className="clearfix">
  2457. <FormItem
  2458. labelCol={{ span: 4 }}
  2459. wrapperCol={{ span: 18 }}
  2460. label="合同额(万元)"
  2461. >
  2462. <Input
  2463. placeholder="请输入合同额"
  2464. ref="signTotalAmount"
  2465. disabled={this.state.hetongFlag}
  2466. value={data.totalAmount}
  2467. onChange={(e) => {
  2468. let data = this.state.data;
  2469. data.totalAmount = e.target.value;
  2470. this.setState({ data });
  2471. }}
  2472. style={{ width: "240px" }}
  2473. />
  2474. </FormItem>
  2475. <FormItem
  2476. labelCol={{ span: 4 }}
  2477. wrapperCol={{ span: 18 }}
  2478. label="首付款(万元)"
  2479. >
  2480. <Input
  2481. placeholder="请输入首付款"
  2482. ref="signTotalAmount"
  2483. disabled={this.state.hetongFlag}
  2484. value={data.firstAmount}
  2485. onChange={(e) => {
  2486. let data = this.state.data;
  2487. data.firstAmount = e.target.value;
  2488. this.setState({ data });
  2489. }}
  2490. style={{ width: "240px" }}
  2491. />
  2492. </FormItem>
  2493. <FormItem
  2494. labelCol={{ span: 4 }}
  2495. wrapperCol={{ span: 18 }}
  2496. label="已收款(万元)"
  2497. >
  2498. {/* <Input
  2499. placeholder="请输入已收款"
  2500. ref="signTotalAmount"
  2501. value={data.settlementAmount}
  2502. onChange={e => {
  2503. let data = this.state.data;
  2504. data.settlementAmount = e.target.value;
  2505. this.setState({ data });
  2506. }}
  2507. style={{ width: "240px" }}
  2508. /> */}
  2509. <span>
  2510. {this.state.data.settlementAmount}&nbsp;&nbsp;&nbsp;&nbsp;
  2511. <span style={{ color: "red" }}>
  2512. (注:已收款与现实收款不符,请与财务专员联系)
  2513. </span>
  2514. </span>
  2515. </FormItem>
  2516. <FormItem
  2517. labelCol={{ span: 4 }}
  2518. wrapperCol={{ span: 18 }}
  2519. label="申请退款(万元)"
  2520. >
  2521. <Input
  2522. placeholder="请输入申请退款"
  2523. ref="signTotalAmount"
  2524. disabled={this.state.tuiKuanFlag}
  2525. value={data.changeAmount}
  2526. onChange={(e) => {
  2527. let data = this.state.data;
  2528. data.changeAmount = e.target.value;
  2529. this.setState({ data });
  2530. }}
  2531. style={{ width: "240px" }}
  2532. />
  2533. </FormItem>
  2534. </div>
  2535. <div>
  2536. <div>
  2537. <span
  2538. style={{
  2539. marginLeft: "50px",
  2540. fontSize: "20px",
  2541. }}
  2542. >
  2543. 项目业务
  2544. </span>
  2545. <span style={{ color: "red" }}>
  2546. (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!)
  2547. </span>
  2548. <Button
  2549. type="primary"
  2550. onClick={this.changeAddPro}
  2551. disabled={this.state.listFlag}
  2552. style={{
  2553. float: "right",
  2554. marginRight: "50px",
  2555. marginBottom: "15px",
  2556. display: this.state.displayList ? "none" : "block",
  2557. }}
  2558. >
  2559. 添加项目明细
  2560. </Button>
  2561. </div>
  2562. <div className="patent-table" style={{ marginBottom: 10 }}>
  2563. {/* <Spin spinning={this.state.loading}> */}
  2564. <Table
  2565. columns={this.state.proColumns}
  2566. dataSource={this.state.proDataSource}
  2567. scroll={{ x: "max-content", y: 0 }}
  2568. expandedRowRender={expandedRowRender}
  2569. rowClassName={this.addRowColor}
  2570. pagination={false}
  2571. // onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2572. bordered
  2573. size="small"
  2574. />
  2575. {/* </Spin> */}
  2576. </div>
  2577. <div>
  2578. <span
  2579. style={{
  2580. marginLeft: "50px",
  2581. fontSize: "20px",
  2582. }}
  2583. >
  2584. 催款节点
  2585. </span>
  2586. <span style={{ color: "red" }}>
  2587. (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!双击可修改对应金额!)
  2588. </span>
  2589. <Button
  2590. type="primary"
  2591. onClick={(e) => {
  2592. this.changeAddCui();
  2593. }}
  2594. disabled={this.state.listCuiFlag}
  2595. style={{
  2596. float: "right",
  2597. marginRight: "50px",
  2598. marginBottom: "15px",
  2599. display: this.state.displayList ? "none" : "block",
  2600. }}
  2601. >
  2602. 添加催款节点
  2603. </Button>
  2604. </div>
  2605. <div className="clearfix">
  2606. {/* <Spin spinning={this.state.loading}> */}
  2607. <Form layout="horizontal">
  2608. <Table
  2609. pagination={false}
  2610. columns={this.state.changeCuiList}
  2611. dataSource={this.state.cuiDataSource}
  2612. scroll={{ x: "max-content", y: 0 }}
  2613. onRowDoubleClick={
  2614. this.state.listCuiFlag ? this.not : this.editCui
  2615. }
  2616. bordered
  2617. size="small"
  2618. />
  2619. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2620. </Form>
  2621. {/* </Spin> */}
  2622. </div>
  2623. </div>
  2624. <div className="clearfix">
  2625. <FormItem
  2626. style={{ height: "auto" }}
  2627. labelCol={{ span: 4 }}
  2628. wrapperCol={{ span: 18 }}
  2629. label="变更原因"
  2630. >
  2631. <TextArea
  2632. rows={4}
  2633. placeholder="因企业政府补助费用与营销员签单承诺费用不一"
  2634. ref="signTotalAmount"
  2635. style={{ width: "95%" }}
  2636. value={data.remarks}
  2637. onChange={(e) => {
  2638. let data = this.state.data;
  2639. data.remarks = e.target.value;
  2640. this.setState({ data });
  2641. }}
  2642. />
  2643. </FormItem>
  2644. </div>
  2645. {/* 备注 */}
  2646. <div className="clearfix">
  2647. <FormItem
  2648. style={{ height: "auto" }}
  2649. labelCol={{ span: 4 }}
  2650. wrapperCol={{ span: 18 }}
  2651. label="备注"
  2652. >
  2653. <TextArea
  2654. rows={4}
  2655. placeholder="请输入备注信息"
  2656. ref="signTotalAmount"
  2657. style={{ width: "95%" }}
  2658. value={data.startRemarks}
  2659. onChange={(e) => {
  2660. let data = this.state.data;
  2661. data.startRemarks = e.target.value;
  2662. this.setState({ data });
  2663. }}
  2664. />
  2665. </FormItem>
  2666. </div>
  2667. <div className="clearfix">
  2668. <FormItem
  2669. labelCol={{ span: 4 }}
  2670. wrapperCol={{ span: 18 }}
  2671. label="变更凭证"
  2672. >
  2673. <PicturesWall
  2674. fileList={this.getVoucherUrl}
  2675. pictureUrl={this.state.voucherUrl}
  2676. url="/api/admin/orderChange/uploadFile"
  2677. sign="order_change_file"
  2678. />
  2679. <Rizhi changeId={data.id} />
  2680. <p>图片建议:要清晰。</p>
  2681. </FormItem>
  2682. </div>
  2683. <div className="clearfix">
  2684. <FormItem
  2685. labelCol={{ span: 4 }}
  2686. wrapperCol={{ span: 18 }}
  2687. label="上传替换合同"
  2688. >
  2689. <Switch disabled={data.type == 7} checked={this.state.isNew} onChange={e => { this.setState({ isNew: e }) }} />,
  2690. <p style={{ color: "red" }}>注:原上传合同为空或作废时,需上传替换合同</p>
  2691. </FormItem>
  2692. </div>
  2693. {
  2694. this.state.isNew &&
  2695. <div className="clearfix">
  2696. <FormItem
  2697. labelCol={{ span: 4 }}
  2698. wrapperCol={{ span: 18 }}
  2699. label="合同扫描件"
  2700. >
  2701. <PicturesWall
  2702. domId={"newcontract"}
  2703. fileList={this.getNewContractUrl}
  2704. pictureUrl={this.state.newContractUrl}
  2705. url="/api/admin/orderChange/uploadFile"
  2706. sign=""
  2707. />
  2708. <p>图片建议:要清晰。</p>
  2709. </FormItem>
  2710. </div>
  2711. }
  2712. {/* <ul
  2713. style={{
  2714. width: "868px",
  2715. overflow: "hidden",
  2716. paddingLeft: "90px",
  2717. marginBottom: "20px"
  2718. }}
  2719. >
  2720. {this.state.dataSource.map((item, index) => (
  2721. <li
  2722. key={index}
  2723. style={{
  2724. width: "100%",
  2725. height: "auto",
  2726. wordBreak: "break-all",
  2727. color: "black",
  2728. marginBottom: "10px"
  2729. }}
  2730. >{`${item.aname}: ${item.remarks}`}</li>
  2731. ))}
  2732. </ul> */}
  2733. <div className="clearfix">
  2734. <Button
  2735. type="primary"
  2736. style={{ float: "right", marginRight: 40 }}
  2737. onClick={this.changeApply}
  2738. >
  2739. 发起变更申请
  2740. </Button>
  2741. </div>
  2742. {
  2743. // 变更项目任务编辑
  2744. this.state.editProVisible &&
  2745. <NewEditProject
  2746. type="change"
  2747. children="list"
  2748. typeChange={this.state.typeChange}
  2749. cid={this.state.data.id}
  2750. readOnly={false}
  2751. orderNo={this.state.data.orderNo}
  2752. visible={this.state.editProVisible}
  2753. dataInfor={this.state.dataInfor}
  2754. newData={this.state.newData}
  2755. onCancel={() => [this.nextCancel("change")]}
  2756. />
  2757. // <ProjectOperation
  2758. // type="biangeng"
  2759. // readOnly={false}
  2760. // visible={this.state.editProVisible}
  2761. // dataInfor={this.state.dataInfor}
  2762. // newData={this.state.newData}
  2763. // onCancel={() => {
  2764. // this.setState({
  2765. // editProVisible: false,
  2766. // });
  2767. // this.proList()
  2768. // }}
  2769. // />
  2770. }
  2771. {/* <Modal
  2772. maskClosable={false}
  2773. title="修改项目金额及数量"
  2774. visible={this.state.editProVisible}
  2775. onOk={this.submitEditPro}
  2776. width={300}
  2777. okText={"保存"}
  2778. onCancel={() => {
  2779. this.setState({
  2780. editProVisible: false,
  2781. });
  2782. }}
  2783. >
  2784. <div className="clearfix">
  2785. <FormItem
  2786. labelCol={{ span: 6 }}
  2787. wrapperCol={{ span: 14 }}
  2788. label="项目金额"
  2789. style={{
  2790. display: this.state.editSplitStatus == 2 ? "none" : "block",
  2791. }}
  2792. >
  2793. <Input
  2794. placeholder="请输入金额"
  2795. rows={4}
  2796. value={this.state.editProMoney}
  2797. onChange={(e) => {
  2798. this.setState({ editProMoney: e.target.value });
  2799. }}
  2800. />
  2801. </FormItem>
  2802. <FormItem
  2803. labelCol={{ span: 6 }}
  2804. wrapperCol={{ span: 14 }}
  2805. label="项目数量"
  2806. >
  2807. <Input
  2808. placeholder="请输入数量"
  2809. rows={4}
  2810. value={this.state.editProCommodityQuantity}
  2811. onChange={(e) => {
  2812. this.setState({ editProCommodityQuantity: e.target.value });
  2813. }}
  2814. />
  2815. </FormItem>
  2816. </div>
  2817. </Modal> */}
  2818. <Modal
  2819. maskClosable={false}
  2820. title={isNaN(parseFloat(this.state.appropriationRatio)) ? "修改催款节点金额" : "修改催款节点比例"}
  2821. visible={this.state.editCuiVisible}
  2822. onOk={() => {
  2823. this.submitEditCui(isNaN(parseFloat(this.state.appropriationRatio)) ? 0 : 1);
  2824. }}
  2825. okText={"保存"}
  2826. width={300}
  2827. onCancel={(e) => {
  2828. this.setState({
  2829. editCuiVisible: false,
  2830. appropriationRatio: ''
  2831. });
  2832. }}
  2833. >
  2834. <div className="clearfix">
  2835. <FormItem
  2836. labelCol={{ span: 6 }}
  2837. wrapperCol={{ span: 14 }}
  2838. label={isNaN(parseFloat(this.state.appropriationRatio)) ? "催款金额" : "催款比例"}
  2839. >
  2840. <Input
  2841. type='number'
  2842. placeholder={isNaN(parseFloat(this.state.appropriationRatio)) ? "请输入金额" : "请输入比例"}
  2843. rows={4}
  2844. value={this.state.editCuiMoney}
  2845. onChange={(e) => {
  2846. this.setState({ editCuiMoney: e.target.value });
  2847. }}
  2848. />
  2849. </FormItem>
  2850. </div>
  2851. </Modal>
  2852. {
  2853. this.state.changeVisible &&
  2854. <NewAddProject
  2855. type="change"
  2856. children="list"
  2857. typeChange={this.state.typeChange}
  2858. cid={this.state.data.id}
  2859. readOnly={false}
  2860. orderNo={this.state.data.orderNo}
  2861. visible={this.state.changeVisible}
  2862. newData={this.state.newData}
  2863. onCancel={() => [this.nextCancel("change")]}
  2864. />
  2865. }
  2866. </Spin>
  2867. {
  2868. this.state.addYears &&
  2869. <Modal
  2870. title="添加服务年限"
  2871. visible={this.state.addYears}
  2872. okText="添加"
  2873. onOk={() => {
  2874. if (!this.state.addyear) {
  2875. message.warn("请选择年份!")
  2876. return
  2877. }
  2878. if (this.state.isGive == undefined) {
  2879. message.warn("请选择是否赠送!")
  2880. return
  2881. }
  2882. let slist = this.state.serviceLife
  2883. if (this.state.isGive == 0) {
  2884. slist.push(this.state.addyear)
  2885. } else if (this.state.isGive == 1) {
  2886. let newYear = this.state.addyear + "(赠)"
  2887. slist.push(newYear)
  2888. }
  2889. this.setState({
  2890. serviceLife: slist,
  2891. addYears: false
  2892. })
  2893. }}
  2894. onCancel={() => {
  2895. this.setState({
  2896. addYears: false
  2897. })
  2898. }}
  2899. >
  2900. <Select
  2901. style={{ width: '200px', marginRight: 50 }}
  2902. placeholder="请选择年份"
  2903. onChange={e => {
  2904. this.setState({
  2905. addyear: e,
  2906. })
  2907. }}
  2908. >
  2909. {
  2910. vipYear.map(its => (
  2911. <Option
  2912. key={its}
  2913. disabled={this.state.serviceLife.toString().includes(its)}
  2914. >{its}</Option>
  2915. ))
  2916. }
  2917. </Select>
  2918. <RadioGroup
  2919. onChange={e => {
  2920. this.setState({
  2921. isGive: e.target.value
  2922. })
  2923. }}
  2924. value={this.state.isGive}
  2925. >
  2926. <Radio value={0}>非赠送</Radio>
  2927. <Radio value={1}>赠送</Radio>
  2928. </RadioGroup>
  2929. </Modal>
  2930. }
  2931. </div>
  2932. );
  2933. }
  2934. }
  2935. export default ChangeApply;