changeApply.js 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974
  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. this.state.data.type == 8
  993. ) {
  994. if (Number(this.state.data.settlementAmount) < Number(this.state.data.changeAmount)) {
  995. message.warning("退款金额大于已收款金额");
  996. return;
  997. }
  998. }
  999. let newContractUrl = [];
  1000. if (this.state.newContractUrl.length) {
  1001. let cArr = [];
  1002. this.state.newContractUrl.map(function (item) {
  1003. if (
  1004. item.response &&
  1005. item.response.data &&
  1006. item.response.data.length
  1007. ) {
  1008. cArr.push(item.response.data);
  1009. }
  1010. });
  1011. newContractUrl = cArr.join(",");
  1012. }
  1013. if (this.state.isNew && newContractUrl.length == 0) {
  1014. message.warning("请上传新合同扫描件!");
  1015. return
  1016. }
  1017. let theorgCodeUrl = [];
  1018. if (this.state.voucherUrl.length) {
  1019. let picArr = [];
  1020. this.state.voucherUrl.map(function (item) {
  1021. if (item.response &&
  1022. item.response.data &&
  1023. item.response.data.length
  1024. ) {
  1025. picArr.push(item.response.data);
  1026. }
  1027. });
  1028. theorgCodeUrl = picArr.join(",");
  1029. }
  1030. Object.assign(this.state.data, {
  1031. id: this.props.orderData.id, //订单编号
  1032. changeType: 0,
  1033. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1034. consultantExamine: [],
  1035. managerExamine: [],
  1036. contractPictureUrl: this.state.isNew
  1037. ? newContractUrl : undefined,//合同替换件
  1038. });
  1039. this.setState({
  1040. loading: true
  1041. })
  1042. $.ajax({
  1043. method: "post",
  1044. dataType: "json",
  1045. crossDomain: false,
  1046. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  1047. data: this.state.data
  1048. }).done(
  1049. function (data) {
  1050. if (!data.error.length) {
  1051. message.success("变更成功!");
  1052. this.props.onCancel();
  1053. this.setState({
  1054. loading: false
  1055. });
  1056. } else {
  1057. message.warning(data.error[0].message);
  1058. this.setState({
  1059. loading: false
  1060. });
  1061. }
  1062. }.bind(this)
  1063. );
  1064. }
  1065. // componentDidMount() {
  1066. // window.setTimeout(() => {
  1067. // this.loadDataChange();
  1068. // }, 10);
  1069. // }
  1070. // loadDataChange() {
  1071. // console.log(this.props);
  1072. // $.ajax({
  1073. // method: "get",
  1074. // dataType: "json",
  1075. // crossDomain: false,
  1076. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  1077. // data: {
  1078. // changeId: this.props.data.id
  1079. // },
  1080. // success: function(data) {
  1081. // if (data.error.length || data.data.list == "") {
  1082. // if (data.error && data.error.length) {
  1083. // message.warning(data.error[0].message);
  1084. // }
  1085. // } else {
  1086. // this.setState({
  1087. // dataSource: data.data
  1088. // });
  1089. // }
  1090. // }.bind(this)
  1091. // });
  1092. // }
  1093. // 拆分详细
  1094. showRes(record) {
  1095. this.setState({
  1096. resVisible: true,
  1097. resRecord: record
  1098. })
  1099. }
  1100. resCancel() {
  1101. this.setState({
  1102. resVisible: false
  1103. })
  1104. }
  1105. cuiList(id) {
  1106. this.setState({
  1107. loading: true,
  1108. });
  1109. $.ajax({
  1110. method: "get",
  1111. dataType: "json",
  1112. crossDomain: false,
  1113. url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
  1114. data: {
  1115. id: id || this.state.data.id
  1116. },
  1117. success: function (data) {
  1118. this.setState({
  1119. cuiDataSource: data.data,
  1120. loading: false,
  1121. });
  1122. if (data.data && data.data.length) {
  1123. if (id) {
  1124. this.setState({
  1125. listCuiFlag: true,
  1126. });
  1127. }
  1128. this.setState({
  1129. cuiDataSource: data.data,
  1130. });
  1131. this.setState({
  1132. loading: false,
  1133. });
  1134. } else if (data.error && data.error.length) {
  1135. message.warning(data.error[0].message);
  1136. this.setState({
  1137. loading: false,
  1138. });
  1139. }
  1140. }.bind(this)
  1141. });
  1142. }
  1143. proList(id) {
  1144. this.setState({
  1145. loading: true
  1146. })
  1147. $.ajax({
  1148. method: "get",
  1149. dataType: "json",
  1150. crossDomain: false,
  1151. url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
  1152. data: {
  1153. id: id || this.state.data.id
  1154. },
  1155. success: function (data) {
  1156. this.setState({
  1157. loading: false
  1158. })
  1159. if (data.data && data.data.length) {
  1160. if (id) {
  1161. this.setState({
  1162. listFlag: true
  1163. });
  1164. }
  1165. data.data.forEach(item => {
  1166. item.key = item.id
  1167. })
  1168. this.setState({
  1169. proDataSource: data.data
  1170. });
  1171. this.setState({
  1172. loading: false,
  1173. });
  1174. } else if (data.error && data.error.length) {
  1175. // message.warning(data.error[0].message)
  1176. this.setState({
  1177. loading: false,
  1178. });
  1179. }
  1180. }.bind(this)
  1181. });
  1182. }
  1183. departmentList() {
  1184. $.ajax({
  1185. method: "get",
  1186. dataType: "json",
  1187. crossDomain: false,
  1188. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  1189. data: {},
  1190. success: function (data) {
  1191. let thedata = data.data;
  1192. let theArr = [];
  1193. if (!thedata) {
  1194. if (data.error && data.error.length) {
  1195. message.warning(data.error[0].message);
  1196. }
  1197. } else {
  1198. thedata.map(function (item, index) {
  1199. theArr.push({
  1200. key: index,
  1201. name: item.name,
  1202. id: item.id
  1203. });
  1204. });
  1205. }
  1206. this.setState({
  1207. departmentArr: theArr
  1208. });
  1209. }.bind(this)
  1210. });
  1211. }
  1212. getVoucherUrl(e) {
  1213. this.setState({ voucherUrl: e });
  1214. }
  1215. getNewContractUrl(e) {
  1216. this.setState({ newContractUrl: e });
  1217. }
  1218. changeAddPro() {
  1219. this.setState({
  1220. newData: this.state.proDataSource,
  1221. changeVisible: true,
  1222. gid: "",
  1223. customerArr: [],
  1224. commodityName: "",
  1225. commodityQuantity: "",
  1226. commodityId: "",
  1227. taskComment: "",
  1228. main: undefined,
  1229. commodityPrice: ""
  1230. });
  1231. }
  1232. changeProSubmit() {
  1233. if (this.state.gid == undefined || !this.state.gid) {
  1234. message.warning("服务名称不匹配!");
  1235. return
  1236. }
  1237. let reg = /^([0]|[1-9][0-9]*)$/;
  1238. if (
  1239. !this.state.commodityQuantity ||
  1240. !reg.test(this.state.commodityQuantity)
  1241. ) {
  1242. message.warning("请输入正确商品数量!");
  1243. return
  1244. }
  1245. if (this.state.displayFees === 'block') {
  1246. if (this.state.patentType === "" && !this.state.patentTransfer) {
  1247. message.warning("请选择专利类型!");
  1248. return
  1249. }
  1250. if (this.state.officialCost === '') {
  1251. message.warning("请选择官费!");
  1252. return
  1253. }
  1254. if (this.state.costReduction === "" && (this.state.patentType === 0 || this.state.patentType === 2) && this.state.officialCost === 1) {
  1255. message.warning("请选择费减!");
  1256. return
  1257. }
  1258. }
  1259. if (isNaN(parseFloat(this.state.commodityPrice))) {
  1260. message.warning("请输入正确的金额!");
  1261. return;
  1262. }
  1263. if (this.state.addProjectType == "3") {// 3审计
  1264. if (this.state.serviceLife.length === 0) {
  1265. message.warning("请选择服务年限!");
  1266. return
  1267. }
  1268. if (this.state.serviceLife.length != this.state.commodityQuantity) {
  1269. message.warning("服务数量与服务年限不符!");
  1270. return
  1271. }
  1272. }
  1273. if (!this.state.main) {
  1274. message.warning("请选择是否为主要项目!");
  1275. return
  1276. }
  1277. if (this.state.addProjectType === 5) {// 5高新
  1278. if (!this.state.declarationBatch) {
  1279. message.warning("请选择企业要求申报批次!");
  1280. return
  1281. }
  1282. if (!this.state.serviceYear) {
  1283. message.warning("请选择申报年份!");
  1284. return
  1285. }
  1286. }
  1287. if (this.state.isVip == 6) {//会员
  1288. if (this.state.yearSum === undefined) {
  1289. message.warning("请选择会员总服务年限!");
  1290. return
  1291. }
  1292. if (this.state.serviceLife.length === 0) {
  1293. message.warning("请添加会员服务年限!");
  1294. return
  1295. }
  1296. if (this.state.serviceLife.length != this.state.yearSum) {
  1297. message.warning("会员服务年限与总年限不符合!");
  1298. return
  1299. }
  1300. if (this.state.serviceYear === undefined) {
  1301. message.warning("请选择本次派单年份!");
  1302. return
  1303. }
  1304. if (this.state.contractTerm.length === 0) {
  1305. message.warning("请填写合同期!");
  1306. return
  1307. }
  1308. }
  1309. this.setState({
  1310. loading: true
  1311. });
  1312. let type = 0;
  1313. if (this.state.typeChange == 4 || this.state.typeChange == 5) {
  1314. type = 1;
  1315. }
  1316. let infor = {
  1317. commodityId: this.state.gid, //商品ID
  1318. orderNo: this.state.data.orderNo, //订单编号
  1319. commodityName: this.state.commodityName, //商品名称
  1320. commodityQuantity: this.state.commodityQuantity, //商品数量
  1321. commodityPrice: this.state.commodityPrice, //签单总价
  1322. taskComment: this.state.taskComment, //服务说明
  1323. main: this.state.main, //是否为主要项目
  1324. cid: this.state.data.id, //变更ID
  1325. type,
  1326. }
  1327. if (this.state.displayFees === 'block') {
  1328. infor.officialCost = this.state.officialCost //是否有官费
  1329. infor.costReduction = (this.state.patentType === 0 || this.state.patentType === 2) ? (this.state.officialCost === 1 ? this.state.costReduction : 0) : 0//是否有费减
  1330. infor.patentType = this.state.patentType //专利类型
  1331. }
  1332. if (this.state.isIso) {
  1333. infor.ifCertificationFee = this.state.ifCertificationFee || undefined;//是否包含认证费用
  1334. }
  1335. if (this.state.addProjectType == "3") {//审计
  1336. infor.serviceLife = JSON.stringify(this.state.serviceLife) //服务年限
  1337. }
  1338. if (this.state.addProjectType == "5") {//高新
  1339. infor.declarationBatch = this.state.declarationBatch || 1//申报批次
  1340. infor.serviceYear = this.state.serviceYear //申报年份
  1341. }
  1342. if (this.state.isVip == 6) {//会员
  1343. infor.yearSum = this.state.yearSum //会员总服务年限
  1344. infor.serviceLife = JSON.stringify(this.state.serviceLife) //会员服务年限
  1345. infor.serviceYear = this.state.serviceYear //本次派单年份
  1346. infor.contractTerm = JSON.stringify(this.state.contractTerm)//合同期
  1347. }
  1348. $.ajax({
  1349. method: "post",
  1350. dataType: "json",
  1351. crossDomain: false,
  1352. url: globalConfig.context + "/api/admin/orderChange/addChangeTask",
  1353. data: infor,
  1354. success: function (data) {
  1355. let theArr = [];
  1356. if (data.error && data.error.length) {
  1357. message.warning(data.error[0].message);
  1358. } else {
  1359. message.success("保存成功");
  1360. this.nextCancel();
  1361. this.proList();
  1362. }
  1363. }.bind(this)
  1364. }).always(
  1365. function () {
  1366. this.setState({
  1367. loading: false
  1368. });
  1369. }.bind(this)
  1370. );
  1371. }
  1372. changeDeletePro(record) {
  1373. this.setState({
  1374. loading: true
  1375. });
  1376. $.ajax({
  1377. method: "post",
  1378. dataType: "json",
  1379. crossDomain: false,
  1380. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  1381. data: {
  1382. id: record.id,
  1383. type: 3,
  1384. tid: record.tid,
  1385. splitStatus: record.splitStatus
  1386. },
  1387. success: function (data) {
  1388. let theArr = [];
  1389. if (data.error && data.error.length) {
  1390. message.warning(data.error[0].message);
  1391. } else {
  1392. message.success("删除成功");
  1393. this.proList();
  1394. this.cuiList();
  1395. }
  1396. }.bind(this)
  1397. }).always(
  1398. function () {
  1399. this.setState({
  1400. loading: false
  1401. });
  1402. }.bind(this)
  1403. );
  1404. }
  1405. //点击新增变更催款节点
  1406. changeAddCui() {
  1407. this.state.cuiDataSource.push({
  1408. key: this.state.cuiDataSource.length,
  1409. money: "",
  1410. dunSubject: undefined,
  1411. orderNo: this.state.data.orderNo,
  1412. dunTarget: this.state.kehuId
  1413. });
  1414. this.setState({
  1415. cuiDataSource: this.state.cuiDataSource,
  1416. cuiFlag: true
  1417. });
  1418. }
  1419. //删除变更收款节点
  1420. changeDeleteCui(index) {
  1421. if (index.id) {
  1422. this.state.cuiDataSource.splice(index.id, 1);
  1423. this.setState({
  1424. contactListNew: this.state.cuiDataSource,
  1425. cuiFlag: false,
  1426. addFlag: false,
  1427. boFlag: false
  1428. });
  1429. $.ajax({
  1430. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  1431. method: "post",
  1432. data: {
  1433. id: index.id,
  1434. type: 3,
  1435. tid: index.tid,
  1436. did: index.did
  1437. }
  1438. }).done(
  1439. function (data) {
  1440. this.setState({
  1441. loading: false
  1442. });
  1443. if (!data.error.length) {
  1444. message.success("删除成功!");
  1445. this.setState({
  1446. cuiFlag: false
  1447. });
  1448. this.cuiList();
  1449. } else {
  1450. message.warning(data.error[0].message);
  1451. }
  1452. }.bind(this)
  1453. );
  1454. } else {
  1455. this.state.cuiDataSource.splice(index.key, 1);
  1456. this.setState({
  1457. cuiDataSource: this.state.cuiDataSource,
  1458. cuiFlag: false,
  1459. addFlag: false,
  1460. boFlag: false
  1461. });
  1462. }
  1463. }
  1464. changeSaveCui(record) {
  1465. if (record.boStatus == "false") {
  1466. record.boStatus = false;
  1467. } else if (record.boStatus == "true") {
  1468. record.boStatus = true;
  1469. }
  1470. if (!this.state.yearFlag) {
  1471. if (!record.effectiveCount && !record.dunTypeCustom) {
  1472. message.warning("请选择服务年限");
  1473. return;
  1474. }
  1475. } else {
  1476. record.effectiveCount = "";
  1477. }
  1478. if (isNaN(parseInt(record.money)) && !record.boStatus) {
  1479. message.warning("请填写金额");
  1480. return;
  1481. } else if ((isNaN(parseInt(record.money)) && record.boStatus)) {
  1482. message.warning("请填写比例");
  1483. return;
  1484. }
  1485. if (record.boStatus) {
  1486. if (
  1487. typeof +record.money == "number" &&
  1488. +record.money >= 0 &&
  1489. +record.money <= 1
  1490. ) {
  1491. record.appropriationRatio = record.money;
  1492. } else {
  1493. message.warning("金额比例填写错误,比例范围0~1");
  1494. return;
  1495. }
  1496. }
  1497. if (!record.dunType && record.dunType != 0) {
  1498. message.warning("请选择对应科目");
  1499. return;
  1500. }
  1501. if (record.dunType != 1) {
  1502. record.waitDay = "";
  1503. }
  1504. this.setState({
  1505. loading: true
  1506. });
  1507. if (record.boStatus) {
  1508. $.ajax({
  1509. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  1510. method: "post",
  1511. data: {
  1512. orderNo: record.orderNo,
  1513. ctid: record.ctid,
  1514. projectType: record.sort,
  1515. dunType: record.dunType,
  1516. appropriationRatio: record.appropriationRatio,
  1517. waitDay: record.waitDay,
  1518. effectiveCount: record.effectiveCount,
  1519. cid: this.state.data.id, //变更ID
  1520. ustomizeTimes:
  1521. record.dunType == 0 ? record.customizeTimes : undefined,
  1522. customizeName:
  1523. record.dunType == 0 ? record.customizeName : undefined,
  1524. }
  1525. }).done(
  1526. function (data) {
  1527. this.setState({
  1528. loading: false,
  1529. });
  1530. if (!data.error.length) {
  1531. message.success("保存成功!");
  1532. this.setState({
  1533. cuiFlag: false,
  1534. boFlag: false,
  1535. addFlag: false,
  1536. });
  1537. this.cuiList();
  1538. } else {
  1539. message.warning(data.error[0].message);
  1540. }
  1541. }.bind(this)
  1542. );
  1543. } else {
  1544. $.ajax({
  1545. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  1546. method: "post",
  1547. data: {
  1548. orderNo: record.orderNo,
  1549. ctid: record.ctid,
  1550. projectType: record.sort,
  1551. dunType: record.dunType,
  1552. money: record.money,
  1553. waitDay: record.waitDay,
  1554. effectiveCount: record.effectiveCount,
  1555. cid: this.state.data.id, //变更ID
  1556. customizeTimes:
  1557. record.dunType == 0 ? record.customizeTimes : undefined,
  1558. customizeName:
  1559. record.dunType == 0 ? record.customizeName : undefined,
  1560. }
  1561. }).done(
  1562. function (data) {
  1563. this.setState({
  1564. loading: false,
  1565. });
  1566. if (!data.error.length) {
  1567. message.success("保存成功!");
  1568. this.setState({
  1569. cuiFlag: false,
  1570. boFlag: false,
  1571. addFlag: false,
  1572. });
  1573. this.cuiList();
  1574. } else {
  1575. message.warning(data.error[0].message);
  1576. }
  1577. }.bind(this)
  1578. );
  1579. }
  1580. }
  1581. submitChange() {
  1582. if (
  1583. this.state.typeChange == undefined ||
  1584. (this.state.typeChange == "" && this.state.typeChange != 0)
  1585. ) {
  1586. message.warning("请选择变更类型");
  1587. return false;
  1588. }
  1589. if (
  1590. this.state.typeChange == 0 ||
  1591. this.state.typeChange == 1 ||
  1592. this.state.typeChange == 3 ||
  1593. this.state.typeChange == 8
  1594. ) {
  1595. if (this.state.settlementAmount < this.state.changeAmount) {
  1596. message.warning("退款金额大于已收款金额");
  1597. return;
  1598. }
  1599. }
  1600. if (this.state.processStatus != 6 || this.state.processStatus != 7) {
  1601. message.warning("当前订单流程不能发起变更!");
  1602. return false;
  1603. }
  1604. if (this.state.changeAmount === "") {
  1605. message.warning("申请退款金额不能为空!");
  1606. return false;
  1607. }
  1608. if (this.state.remarksC.trim() == "") {
  1609. message.warning("请正确填写变更原因");
  1610. return false;
  1611. }
  1612. if (this.state.startRemarks.trim() == "") {
  1613. message.warning("请正确填写备注信息");
  1614. return false;
  1615. }
  1616. let theorgCodeUrl = [];
  1617. if (this.state.voucherUrl.length) {
  1618. let picArr = [];
  1619. this.state.voucherUrl.map(function (item) {
  1620. if (item.response && item.response.data && item.response.data.length) {
  1621. picArr.push(item.response.data);
  1622. }
  1623. });
  1624. theorgCodeUrl = picArr.join(",");
  1625. }
  1626. this.setState({
  1627. loading: true
  1628. });
  1629. $.ajax({
  1630. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  1631. method: "post",
  1632. data: {
  1633. id: this.state.changeId,
  1634. changeType: 0,
  1635. orderNo: this.state.orderNo, //订单编号
  1636. processState: 0,
  1637. startRemarks: this.state.startRemarks,
  1638. remarks: this.state.remarksC,
  1639. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1640. totalAmount: this.state.totalAmount,
  1641. settlementAmount: this.state.settlementAmount,
  1642. changeAmount: this.state.changeAmount,
  1643. applicant: this.state.salesmanName,
  1644. depName: this.state.depName,
  1645. type: this.state.typeChange
  1646. }
  1647. }).done(
  1648. function (data) {
  1649. if (!data.error.length) {
  1650. this.setState({
  1651. loading: false
  1652. });
  1653. message.success("发起变更成功");
  1654. this.handleCancelclose();
  1655. } else {
  1656. message.warning(data.error[0].message);
  1657. this.setState({
  1658. loading: false
  1659. });
  1660. }
  1661. }.bind(this)
  1662. );
  1663. }
  1664. editCui(record) {
  1665. this.setState({
  1666. editCuiVisible: true,
  1667. editCuiMoney: record.appropriationRatio ? record.appropriationRatio : record.money,
  1668. appropriationRatio: record.appropriationRatio,
  1669. editCuiTid: record.tid,
  1670. editCuiId: record.id
  1671. });
  1672. }
  1673. editPro(record) {
  1674. this.setState({
  1675. editProVisible: true,
  1676. dataInfor: record,
  1677. // newData: this.state.proDataSource,
  1678. });
  1679. // this.setState({
  1680. // editProVisible: true,
  1681. // editSplitStatus: record.splitStatus,
  1682. // editProMoney: record.commodityPrice,
  1683. // editProCommodityQuantity: record.commodityQuantity,
  1684. // editProTid: record.tid,
  1685. // editProId: record.id
  1686. // });
  1687. }
  1688. submitEditCui(type) {
  1689. if (isNaN(parseFloat(this.state.editCuiMoney))) {
  1690. if (type === 1) {
  1691. message.warn('请输入比例')
  1692. } else {
  1693. message.warn('请输入金额')
  1694. }
  1695. return;
  1696. }
  1697. this.setState({
  1698. loading: true
  1699. });
  1700. let data = {
  1701. id: this.state.editCuiId,
  1702. type: this.state.editCuiTid ? 2 : 1,
  1703. tid: this.state.editCuiTid,
  1704. }
  1705. if (type === 1) {
  1706. data.appropriationRatio = this.state.editCuiMoney;
  1707. } else {
  1708. data.money = this.state.editCuiMoney;
  1709. }
  1710. $.ajax({
  1711. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  1712. method: "post",
  1713. data
  1714. }).done(
  1715. function (data) {
  1716. this.setState({
  1717. loading: false
  1718. });
  1719. if (!data.error.length) {
  1720. message.success("修改成功!");
  1721. this.cuiList();
  1722. this.proList()
  1723. this.setState({
  1724. editCuiVisible: false
  1725. });
  1726. } else {
  1727. message.warning(data.error[0].message);
  1728. }
  1729. }.bind(this)
  1730. );
  1731. }
  1732. submitEditPro() {
  1733. this.setState({
  1734. loading: true
  1735. });
  1736. $.ajax({
  1737. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  1738. method: "post",
  1739. data: {
  1740. id: this.state.editProId,
  1741. type: this.state.editProTid ? 2 : 1,
  1742. commodityPrice: this.state.editProMoney,
  1743. commodityQuantity: this.state.editProCommodityQuantity,
  1744. tid: this.state.editProTid
  1745. }
  1746. }).done(
  1747. function (data) {
  1748. this.setState({
  1749. loading: false
  1750. });
  1751. if (!data.error.length) {
  1752. message.success("修改成功!");
  1753. this.proList();
  1754. this.cuiList()
  1755. this.setState({
  1756. editProVisible: false
  1757. });
  1758. } else {
  1759. message.warning(data.error[0].message);
  1760. }
  1761. }.bind(this)
  1762. );
  1763. }
  1764. componentWillMount() {
  1765. this.departmentList();
  1766. this.state.data = this.props.orderData;
  1767. this.state.data.oldPrice = this.props.orderData.totalAmount;
  1768. this.setState({
  1769. data: this.state.data,
  1770. voucherUrl: this.props.voucherUrl
  1771. });
  1772. this.proList();
  1773. this.cuiList();
  1774. let e = this.props.orderData.type;
  1775. if (e == 1) {
  1776. this.setState({
  1777. hetongFlag: false,
  1778. listFlag: false,
  1779. listCuiFlag: false,
  1780. tuiKuanFlag: false,
  1781. displayList: false
  1782. });
  1783. } else if (e == 2) {
  1784. this.setState({
  1785. hetongFlag: true,
  1786. listFlag: false,
  1787. listCuiFlag: false,
  1788. tuiKuanFlag: true,
  1789. displayList: false
  1790. });
  1791. } else if (e == 3) {
  1792. this.setState({
  1793. listFlag: false,
  1794. hetongFlag: false,
  1795. listCuiFlag: false,
  1796. tuiKuanFlag: false,
  1797. displayList: true
  1798. });
  1799. } else if (e == 4) {
  1800. this.setState({
  1801. listFlag: false,
  1802. listCuiFlag: false,
  1803. hetongFlag: false,
  1804. tuiKuanFlag: true,
  1805. displayList: false
  1806. });
  1807. } else if (e == 5) {
  1808. this.setState({
  1809. listFlag: false,
  1810. listCuiFlag: false,
  1811. hetongFlag: true,
  1812. tuiKuanFlag: true,
  1813. displayList: false
  1814. });
  1815. } else if (e == 6) {
  1816. this.setState({
  1817. listFlag: true,
  1818. listCuiFlag: true,
  1819. hetongFlag: true,
  1820. tuiKuanFlag: true,
  1821. displayList: false,
  1822. });
  1823. } else if (e == 7) {
  1824. this.setState({
  1825. listFlag: true,
  1826. listCuiFlag: true,
  1827. hetongFlag: true,
  1828. tuiKuanFlag: true,
  1829. displayList: false,
  1830. isNew: true,
  1831. });
  1832. } else {
  1833. this.setState({
  1834. listFlag: false,
  1835. listCuiFlag: false,
  1836. hetongFlag: false,
  1837. tuiKuanFlag: false,
  1838. displayList: false,
  1839. });
  1840. }
  1841. }
  1842. // componentWillReceiveProps(nextProps) {
  1843. // this.state.data = nextProps.orderData;
  1844. // this.state.data.oldPrice = nextProps.orderData.totalAmount;
  1845. // this.setState({
  1846. // data: this.state.data,
  1847. // voucherUrl: nextProps.voucherUrl
  1848. // });
  1849. // // this.proList();
  1850. // // this.cuiList();
  1851. // let e = nextProps.orderData.type;
  1852. // if (e == 1) {
  1853. // this.setState({
  1854. // hetongFlag: false,
  1855. // listFlag: false,
  1856. // listCuiFlag: false,
  1857. // tuiKuanFlag: false,
  1858. // displayList: false
  1859. // });
  1860. // } else if (e == 2) {
  1861. // this.setState({
  1862. // hetongFlag: true,
  1863. // listFlag: false,
  1864. // listCuiFlag: false,
  1865. // tuiKuanFlag: true,
  1866. // displayList: false
  1867. // });
  1868. // } else if (e == 3) {
  1869. // this.setState({
  1870. // listFlag: false,
  1871. // hetongFlag: false,
  1872. // listCuiFlag: false,
  1873. // tuiKuanFlag: false,
  1874. // displayList: true
  1875. // });
  1876. // } else if (e == 4) {
  1877. // this.setState({
  1878. // listFlag: false,
  1879. // listCuiFlag: false,
  1880. // hetongFlag: false,
  1881. // tuiKuanFlag: true,
  1882. // displayList: false
  1883. // });
  1884. // } else if (e == 5) {
  1885. // this.setState({
  1886. // listFlag: false,
  1887. // listCuiFlag: false,
  1888. // hetongFlag: true,
  1889. // tuiKuanFlag: true,
  1890. // displayList: false
  1891. // });
  1892. // } else {
  1893. // this.setState({
  1894. // listFlag: true,
  1895. // hetongFlag: true,
  1896. // listCuiFlag: true,
  1897. // tuiKuanFlag: false,
  1898. // displayList: false
  1899. // });
  1900. // }
  1901. // }
  1902. not() {
  1903. }
  1904. deleteChange() {
  1905. this.setState({
  1906. loading: true,
  1907. });
  1908. $.ajax({
  1909. url: globalConfig.context + "/api/admin/orderChange/cancelOrderChange",
  1910. method: "post",
  1911. data: {
  1912. id: this.state.data.id,
  1913. status: this.state.data.status,
  1914. processState: this.state.data.processState,
  1915. orderNo: this.state.data.orderNo
  1916. },
  1917. }).done(
  1918. function (data) {
  1919. this.setState({
  1920. loading: false,
  1921. });
  1922. if (!data.error.length) {
  1923. message.success("取消成功!");
  1924. this.props.onCancel()
  1925. } else {
  1926. message.warning(data.error[0].message);
  1927. }
  1928. }.bind(this)
  1929. );
  1930. }
  1931. handleClose(removedTag) {
  1932. let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
  1933. this.setState({ serviceLife, serviceYear: undefined });
  1934. }
  1935. // 可展开颜色不同
  1936. addRowColor(record) {
  1937. if (!!record.list && record.list.length > 0) {
  1938. return 'light'
  1939. } else {
  1940. return 'dark'
  1941. }
  1942. }
  1943. render() {
  1944. const expandedRowRender = e => {
  1945. const data = e.list;
  1946. if (e.cSort != 6) {
  1947. let columns = [];
  1948. if (data instanceof Array && data.length) {
  1949. columns = [
  1950. {
  1951. title: "变更状态",
  1952. dataIndex: "type",
  1953. key: "type",
  1954. render: (text, record) => {
  1955. let str = "";
  1956. let color = "";
  1957. if (text == 1) {
  1958. str = "增";
  1959. color = "#87d068";
  1960. } else if (text == 2) {
  1961. str = "改";
  1962. color = "#108ee9";
  1963. } else if (text == 3) {
  1964. str = "删";
  1965. color = "#f50";
  1966. }
  1967. return (
  1968. <span>
  1969. <Tag
  1970. color={color}
  1971. style={{ display: text == 0 ? "none" : "inline-block" }}
  1972. >
  1973. {str}
  1974. </Tag>
  1975. {/* {record.splitStatus == 1 ? (
  1976. <Tag
  1977. color="#108ee9"
  1978. // onClick={e => {
  1979. // e.stopPropagation();
  1980. // this.showRes(record);
  1981. // }}
  1982. >
  1983. 父项目
  1984. </Tag>
  1985. ) : (
  1986. ""
  1987. )}
  1988. {record.splitStatus == 2 ? (
  1989. <Tag
  1990. color="#108ee9"
  1991. // onClick={e => {
  1992. // e.stopPropagation();
  1993. // this.showRes(record);
  1994. // }}
  1995. >
  1996. 子项目
  1997. </Tag>
  1998. ) : (
  1999. ""
  2000. )} */}
  2001. </span>
  2002. );
  2003. },
  2004. },
  2005. {
  2006. title: "业务项目名称",
  2007. dataIndex: "commodityName",
  2008. key: "commodityName",
  2009. render: (text, record) => {
  2010. return <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span>{"-" + record.id}</span>
  2011. }
  2012. },
  2013. {
  2014. title: "项目类别",
  2015. dataIndex: "cname",
  2016. key: "cname",
  2017. },
  2018. {
  2019. title: "项目数量",
  2020. dataIndex: "commodityQuantity",
  2021. key: "commodityQuantity",
  2022. },
  2023. {
  2024. title: "金额(万元)",
  2025. dataIndex: "commodityPrice",
  2026. key: "commodityPrice",
  2027. render: (text, record) => {
  2028. if (record.splitStatus == 2) {
  2029. return "/";
  2030. } else {
  2031. return text;
  2032. }
  2033. },
  2034. },
  2035. {
  2036. title: "主要项目",
  2037. dataIndex: "main",
  2038. key: "main",
  2039. render: (text) => {
  2040. return text ? "是" : "否";
  2041. },
  2042. },
  2043. {
  2044. title: "项目负责人",
  2045. dataIndex: "receiverName",
  2046. key: "receiverName",
  2047. },
  2048. {
  2049. title: "总年限",
  2050. dataIndex: "yearSum",
  2051. key: "yearSum",
  2052. render: (text, record) => {
  2053. return (
  2054. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  2055. );
  2056. }
  2057. },
  2058. {
  2059. title: "年限",
  2060. dataIndex: "serviceLife",
  2061. key: "serviceLife",
  2062. render: (text, record) => {
  2063. return (
  2064. <div>{!!text && JSON.parse(text).toString()}</div>
  2065. );
  2066. }
  2067. },
  2068. {
  2069. title: "本次派单",
  2070. dataIndex: "serviceYear",
  2071. key: "serviceYear",
  2072. render: (text, record) => {
  2073. return (
  2074. <div>{!text ? "" : text}</div>
  2075. );
  2076. }
  2077. },
  2078. {
  2079. title: "项目说明",
  2080. dataIndex: "taskComment",
  2081. key: "taskComment",
  2082. render: (text) => {
  2083. return (
  2084. <Tooltip title={text}>
  2085. <div
  2086. style={{
  2087. width: 100,
  2088. overflow: "hidden",
  2089. whiteSpace: "nowrap",
  2090. textOverflow: "ellipsis",
  2091. }}
  2092. >{text}</div>
  2093. </Tooltip>
  2094. )
  2095. },
  2096. },
  2097. {
  2098. title: "操作",
  2099. dataIndex: "ABC",
  2100. key: "ABC",
  2101. render: (text, record) => {
  2102. return (
  2103. <div>
  2104. <Button
  2105. onClick={(e) => {
  2106. e.stopPropagation();
  2107. this.showConfirm(this.changeDeletePro, record);
  2108. }}
  2109. disabled={this.state.listFlag}
  2110. style={{
  2111. display: this.state.displayList ? "none" : "block",
  2112. }}
  2113. >
  2114. 删除
  2115. </Button>
  2116. </div>
  2117. );
  2118. },
  2119. },
  2120. ];
  2121. return (
  2122. <Table
  2123. columns={columns}
  2124. dataSource={data}
  2125. scroll={{ x: "max-content", y: 0 }}
  2126. pagination={false}
  2127. onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2128. />
  2129. );
  2130. } else {
  2131. columns = [];
  2132. return (
  2133. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  2134. 此项目暂未拆分
  2135. </p>
  2136. );
  2137. }
  2138. } else {
  2139. let columns = [];
  2140. if (data instanceof Array && data.length) {
  2141. columns = [
  2142. {
  2143. title: "变更状态",
  2144. dataIndex: "type",
  2145. key: "type",
  2146. render: (text, record) => {
  2147. let str = "";
  2148. let color = "";
  2149. if (text == 1) {
  2150. str = "增";
  2151. color = "#87d068";
  2152. } else if (text == 2) {
  2153. str = "改";
  2154. color = "#108ee9";
  2155. } else if (text == 3) {
  2156. str = "删";
  2157. color = "#f50";
  2158. }
  2159. return (
  2160. <span>
  2161. <Tag
  2162. color={color}
  2163. style={{ display: text == 0 ? "none" : "inline-block" }}
  2164. >
  2165. {str}
  2166. </Tag>
  2167. </span>
  2168. );
  2169. },
  2170. },
  2171. {
  2172. title: "负责人",
  2173. dataIndex: "receiverName",
  2174. key: "receiverName",
  2175. },
  2176. {
  2177. title: "负责人电话",
  2178. dataIndex: "receiverMobile",
  2179. key: "receiverMobile",
  2180. },
  2181. {
  2182. title: "项目状态",
  2183. dataIndex: "projectStatus",
  2184. key: "projectStatus",
  2185. render: (text) => {
  2186. return text
  2187. // return getProjectName(text);
  2188. },
  2189. },
  2190. {
  2191. title: "本次派单",
  2192. dataIndex: "serviceYear",
  2193. key: "serviceYear",
  2194. },
  2195. {
  2196. title: "项目说明",
  2197. dataIndex: "taskComment",
  2198. key: "taskComment",
  2199. render: (text) => {
  2200. return (
  2201. <Tooltip title={text}>
  2202. <div
  2203. >{text}</div>
  2204. </Tooltip>
  2205. )
  2206. },
  2207. },
  2208. ];
  2209. return (
  2210. <Table
  2211. columns={columns}
  2212. dataSource={data}
  2213. pagination={false}
  2214. />
  2215. );
  2216. } else {
  2217. columns = [];
  2218. return (
  2219. <p
  2220. style={{ fontWeight: "bold", color: "red", textAlign: "center" }}
  2221. >
  2222. 暂无派单
  2223. </p>
  2224. );
  2225. }
  2226. }
  2227. };
  2228. const { TextArea } = Input;
  2229. const data = this.state.data;
  2230. // let departmentArr = this.state.departmentArr || [];
  2231. const dataSources = this.state.customerArr || [];
  2232. const cuiDataList = this.state.contactList || [];
  2233. let departmentArr = this.state.departmentArr || [];
  2234. const options = this.state.states
  2235. ? dataSources.map(group => (
  2236. <Select.Option key={group.id} value={group.name}>
  2237. {group.name}
  2238. </Select.Option>
  2239. ))
  2240. : dataSources.map((group, index) => (
  2241. <Select.Option key={index} value={group.bname}>
  2242. {group.bname}
  2243. </Select.Option>
  2244. ));
  2245. let children = vipYear.map(its => (
  2246. <Option key={its}>{its}</Option>
  2247. ));
  2248. const { isVip, histYear, isEdit } = this.state
  2249. return (
  2250. <div>
  2251. <Spin spinning={this.state.loading}>
  2252. {this.state.resVisible ? (
  2253. <ResolutionDetail
  2254. cancel={this.resCancel}
  2255. detail={this.state.resRecord}
  2256. visible={this.state.resVisible}
  2257. id={this.state.resRecord.orderNo}
  2258. />
  2259. ) : (
  2260. ""
  2261. )}
  2262. <div className="clearfix">
  2263. <FormItem
  2264. className="half-item"
  2265. {...formItemLayout}
  2266. label="客户名称"
  2267. >
  2268. <span>{data.userName}</span>
  2269. <EnterpriseNameChange
  2270. type='journal'
  2271. style={{ marginLeft: 10 }}
  2272. enterpriseId={this.props.orderUid} />
  2273. </FormItem>
  2274. </div>
  2275. <div className="clearfix">
  2276. <FormItem
  2277. className="half-item"
  2278. {...formItemLayout}
  2279. label="合同编号"
  2280. >
  2281. <span>{data.contractNo}</span>
  2282. </FormItem>
  2283. </div>
  2284. <div className="clearfix">
  2285. <FormItem
  2286. className="half-item"
  2287. {...formItemLayout}
  2288. label="申请变更部门"
  2289. >
  2290. <span>{this.state.data.depName}</span>
  2291. </FormItem>
  2292. <FormItem className="half-item" {...formItemLayout} label="申请人">
  2293. {/* <Input
  2294. placeholder="请输入申请人"
  2295. ref="signTotalAmount"
  2296. value={data.applicant}
  2297. onChange={e => {
  2298. let data = this.state.data;
  2299. data.applicant = e.target.value;
  2300. this.setState({ data });
  2301. }}
  2302. style={{ width: "240px" }}
  2303. /> */}
  2304. <span>{data.applicant}</span>
  2305. </FormItem>
  2306. </div>
  2307. <div className="clearfix">
  2308. <FormItem
  2309. labelCol={{ span: 4 }}
  2310. wrapperCol={{ span: 18 }}
  2311. label="变更类型"
  2312. >
  2313. <Select
  2314. placeholder="选择合同变更类型"
  2315. style={{ width: 200 }}
  2316. disabled={this.state.changeFlag}
  2317. onChange={(e) => {
  2318. let data = this.state.data;
  2319. data.type = e;
  2320. this.setState({ data, changeFlag: true });
  2321. if (e == 1) {
  2322. this.setState({
  2323. hetongFlag: false,
  2324. listFlag: false,
  2325. listCuiFlag: false,
  2326. tuiKuanFlag: false,
  2327. displayList: false,
  2328. });
  2329. } else if (e == 2) {
  2330. this.setState({
  2331. hetongFlag: true,
  2332. listFlag: false,
  2333. listCuiFlag: false,
  2334. tuiKuanFlag: true,
  2335. displayList: false,
  2336. });
  2337. } else if (e == 3) {
  2338. this.setState({
  2339. listFlag: false,
  2340. hetongFlag: false,
  2341. listCuiFlag: false,
  2342. tuiKuanFlag: false,
  2343. displayList: true,
  2344. });
  2345. } else if (e == 4) {
  2346. this.setState({
  2347. listFlag: false,
  2348. listCuiFlag: false,
  2349. hetongFlag: false,
  2350. tuiKuanFlag: true,
  2351. displayList: false,
  2352. });
  2353. } else if (e == 5) {
  2354. this.setState({
  2355. listFlag: false,
  2356. listCuiFlag: false,
  2357. hetongFlag: true,
  2358. tuiKuanFlag: true,
  2359. displayList: false,
  2360. });
  2361. } else if (e == 6) {
  2362. this.setState({
  2363. listFlag: true,
  2364. listCuiFlag: true,
  2365. hetongFlag: true,
  2366. tuiKuanFlag: true,
  2367. displayList: false,
  2368. });
  2369. } else if (e == 7) {
  2370. this.setState({
  2371. listFlag: true,
  2372. listCuiFlag: true,
  2373. hetongFlag: true,
  2374. tuiKuanFlag: true,
  2375. displayList: false,
  2376. isNew: true, //上传替换合同
  2377. });
  2378. } else {
  2379. this.setState({
  2380. listFlag: false,
  2381. listCuiFlag: false,
  2382. hetongFlag: false,
  2383. tuiKuanFlag: false,
  2384. displayList: false,
  2385. });
  2386. }
  2387. }}
  2388. value={data.type}
  2389. >
  2390. <Option value={0}>退单退款</Option>
  2391. <Option value={1}>项目及金额变更</Option>
  2392. <Option value={2}>仅项目变更</Option>
  2393. <Option value={3}>仅金额变更</Option>
  2394. <Option value={4}>重报</Option>
  2395. <Option value={5}>赠送</Option>
  2396. <Option value={6}>退单不退款</Option>
  2397. <Option value={7}>仅变更合同</Option>
  2398. <Option value={8}>框架协议(仅已签框架合同适用)</Option>
  2399. </Select>
  2400. <Button
  2401. style={{ marginLeft: 10 }}
  2402. onClick={(e) => {
  2403. this.state.data.startRemarks = "";
  2404. this.state.data.remarks = "";
  2405. this.state.data.changeAmount = "0";
  2406. this.state.data.depNameChange = undefined;
  2407. this.state.data.typeChange = undefined;
  2408. this.state.data.totalAmount = this.state.data.oldPrice;
  2409. this.setState({
  2410. listFlag: true,
  2411. listCuiFlag: true,
  2412. hetongFlag: true,
  2413. tuiKuanFlag: true,
  2414. displayList: false,
  2415. isNew: false,
  2416. // listFlag: false,
  2417. // hetongFlag: false,
  2418. // listCuiFlag: false,
  2419. // tuiKuanFlag: false,
  2420. // displayList: false,
  2421. startRemarks: "",
  2422. data: this.state.data,
  2423. changeFlag: false,
  2424. voucherUrl: [],
  2425. // changeAmount: "0",
  2426. // applicant: undefined,
  2427. // depNameChange: undefined,
  2428. // typeChange: [],
  2429. // changeFlag: false
  2430. });
  2431. }}
  2432. >
  2433. 重置
  2434. </Button>
  2435. {(this.state.data.status == 3 || this.state.data.status == 0) ? (
  2436. <Button
  2437. type="danger"
  2438. style={{
  2439. float: "right",
  2440. backgroundColor: "red",
  2441. color: "white",
  2442. position: "absolute",
  2443. right: 0,
  2444. height: 50,
  2445. borderRadius: 20,
  2446. }}
  2447. onClick={(e) => {
  2448. e.stopPropagation();
  2449. this.showConfirmChange(this.deleteChange);
  2450. }}
  2451. >
  2452. 取消本次变更
  2453. </Button>
  2454. ) : (
  2455. ""
  2456. )}
  2457. </FormItem>
  2458. </div>
  2459. <div className="clearfix">
  2460. <FormItem
  2461. labelCol={{ span: 4 }}
  2462. wrapperCol={{ span: 18 }}
  2463. label="合同额(万元)"
  2464. >
  2465. <Input
  2466. placeholder="请输入合同额"
  2467. ref="signTotalAmount"
  2468. disabled={this.state.hetongFlag}
  2469. value={data.totalAmount}
  2470. onChange={(e) => {
  2471. let data = this.state.data;
  2472. data.totalAmount = e.target.value;
  2473. this.setState({ data });
  2474. }}
  2475. style={{ width: "240px" }}
  2476. />
  2477. </FormItem>
  2478. <FormItem
  2479. labelCol={{ span: 4 }}
  2480. wrapperCol={{ span: 18 }}
  2481. label="首付款(万元)"
  2482. >
  2483. <Input
  2484. placeholder="请输入首付款"
  2485. ref="signTotalAmount"
  2486. disabled={this.state.hetongFlag}
  2487. value={data.firstAmount}
  2488. onChange={(e) => {
  2489. let data = this.state.data;
  2490. data.firstAmount = e.target.value;
  2491. this.setState({ data });
  2492. }}
  2493. style={{ width: "240px" }}
  2494. />
  2495. </FormItem>
  2496. <FormItem
  2497. labelCol={{ span: 4 }}
  2498. wrapperCol={{ span: 18 }}
  2499. label="已收款(万元)"
  2500. >
  2501. {/* <Input
  2502. placeholder="请输入已收款"
  2503. ref="signTotalAmount"
  2504. value={data.settlementAmount}
  2505. onChange={e => {
  2506. let data = this.state.data;
  2507. data.settlementAmount = e.target.value;
  2508. this.setState({ data });
  2509. }}
  2510. style={{ width: "240px" }}
  2511. /> */}
  2512. <span>
  2513. {this.state.data.settlementAmount}&nbsp;&nbsp;&nbsp;&nbsp;
  2514. <span style={{ color: "red" }}>
  2515. (注:已收款与现实收款不符,请与财务专员联系)
  2516. </span>
  2517. </span>
  2518. </FormItem>
  2519. <FormItem
  2520. labelCol={{ span: 4 }}
  2521. wrapperCol={{ span: 18 }}
  2522. label="申请退款(万元)"
  2523. >
  2524. <Input
  2525. placeholder="请输入申请退款"
  2526. ref="signTotalAmount"
  2527. disabled={this.state.tuiKuanFlag}
  2528. value={data.changeAmount}
  2529. onChange={(e) => {
  2530. let data = this.state.data;
  2531. data.changeAmount = e.target.value;
  2532. this.setState({ data });
  2533. }}
  2534. style={{ width: "240px" }}
  2535. />
  2536. </FormItem>
  2537. </div>
  2538. <div>
  2539. <div>
  2540. <span
  2541. style={{
  2542. marginLeft: "50px",
  2543. fontSize: "20px",
  2544. }}
  2545. >
  2546. 项目业务
  2547. </span>
  2548. <span style={{ color: "red" }}>
  2549. (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!)
  2550. </span>
  2551. <Button
  2552. type="primary"
  2553. onClick={this.changeAddPro}
  2554. disabled={this.state.listFlag}
  2555. style={{
  2556. float: "right",
  2557. marginRight: "50px",
  2558. marginBottom: "15px",
  2559. display: this.state.displayList ? "none" : "block",
  2560. }}
  2561. >
  2562. 添加项目明细
  2563. </Button>
  2564. </div>
  2565. <div className="patent-table" style={{ marginBottom: 10 }}>
  2566. {/* <Spin spinning={this.state.loading}> */}
  2567. <Table
  2568. columns={this.state.proColumns}
  2569. dataSource={this.state.proDataSource}
  2570. scroll={{ x: "max-content", y: 0 }}
  2571. expandedRowRender={expandedRowRender}
  2572. rowClassName={this.addRowColor}
  2573. pagination={false}
  2574. // onRowDoubleClick={this.state.listFlag ? this.not : this.editPro}
  2575. bordered
  2576. size="small"
  2577. />
  2578. {/* </Spin> */}
  2579. </div>
  2580. <div>
  2581. <span
  2582. style={{
  2583. marginLeft: "50px",
  2584. fontSize: "20px",
  2585. }}
  2586. >
  2587. 催款节点
  2588. </span>
  2589. <span style={{ color: "red" }}>
  2590. (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!双击可修改对应金额!)
  2591. </span>
  2592. <Button
  2593. type="primary"
  2594. onClick={(e) => {
  2595. this.changeAddCui();
  2596. }}
  2597. disabled={this.state.listCuiFlag}
  2598. style={{
  2599. float: "right",
  2600. marginRight: "50px",
  2601. marginBottom: "15px",
  2602. display: this.state.displayList ? "none" : "block",
  2603. }}
  2604. >
  2605. 添加催款节点
  2606. </Button>
  2607. </div>
  2608. <div className="clearfix">
  2609. {/* <Spin spinning={this.state.loading}> */}
  2610. <Form layout="horizontal">
  2611. <Table
  2612. pagination={false}
  2613. columns={this.state.changeCuiList}
  2614. dataSource={this.state.cuiDataSource}
  2615. scroll={{ x: "max-content", y: 0 }}
  2616. onRowDoubleClick={
  2617. this.state.listCuiFlag ? this.not : this.editCui
  2618. }
  2619. bordered
  2620. size="small"
  2621. />
  2622. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2623. </Form>
  2624. {/* </Spin> */}
  2625. </div>
  2626. </div>
  2627. <div className="clearfix">
  2628. <FormItem
  2629. style={{ height: "auto" }}
  2630. labelCol={{ span: 4 }}
  2631. wrapperCol={{ span: 18 }}
  2632. label="变更原因"
  2633. >
  2634. <TextArea
  2635. rows={4}
  2636. placeholder="因企业政府补助费用与营销员签单承诺费用不一"
  2637. ref="signTotalAmount"
  2638. style={{ width: "95%" }}
  2639. value={data.remarks}
  2640. onChange={(e) => {
  2641. let data = this.state.data;
  2642. data.remarks = e.target.value;
  2643. this.setState({ data });
  2644. }}
  2645. />
  2646. </FormItem>
  2647. </div>
  2648. {/* 备注 */}
  2649. <div className="clearfix">
  2650. <FormItem
  2651. style={{ height: "auto" }}
  2652. labelCol={{ span: 4 }}
  2653. wrapperCol={{ span: 18 }}
  2654. label="备注"
  2655. >
  2656. <TextArea
  2657. rows={4}
  2658. placeholder="请输入备注信息"
  2659. ref="signTotalAmount"
  2660. style={{ width: "95%" }}
  2661. value={data.startRemarks}
  2662. onChange={(e) => {
  2663. let data = this.state.data;
  2664. data.startRemarks = e.target.value;
  2665. this.setState({ data });
  2666. }}
  2667. />
  2668. </FormItem>
  2669. </div>
  2670. <div className="clearfix">
  2671. <FormItem
  2672. labelCol={{ span: 4 }}
  2673. wrapperCol={{ span: 18 }}
  2674. label="变更凭证"
  2675. >
  2676. <PicturesWall
  2677. fileList={this.getVoucherUrl}
  2678. pictureUrl={this.state.voucherUrl}
  2679. url="/api/admin/orderChange/uploadFile"
  2680. sign="order_change_file"
  2681. />
  2682. <Rizhi changeId={data.id} />
  2683. <p>图片建议:要清晰。</p>
  2684. </FormItem>
  2685. </div>
  2686. <div className="clearfix">
  2687. <FormItem
  2688. labelCol={{ span: 4 }}
  2689. wrapperCol={{ span: 18 }}
  2690. label="上传替换合同"
  2691. >
  2692. <Switch disabled={data.type == 7} checked={this.state.isNew} onChange={e => { this.setState({ isNew: e }) }} />,
  2693. <p style={{ color: "red" }}>注:原上传合同为空或作废时,需上传替换合同</p>
  2694. </FormItem>
  2695. </div>
  2696. {
  2697. this.state.isNew &&
  2698. <div className="clearfix">
  2699. <FormItem
  2700. labelCol={{ span: 4 }}
  2701. wrapperCol={{ span: 18 }}
  2702. label="合同扫描件"
  2703. >
  2704. <PicturesWall
  2705. domId={"newcontract"}
  2706. fileList={this.getNewContractUrl}
  2707. pictureUrl={this.state.newContractUrl}
  2708. url="/api/admin/orderChange/uploadFile"
  2709. sign=""
  2710. />
  2711. <p>图片建议:要清晰。</p>
  2712. </FormItem>
  2713. </div>
  2714. }
  2715. {/* <ul
  2716. style={{
  2717. width: "868px",
  2718. overflow: "hidden",
  2719. paddingLeft: "90px",
  2720. marginBottom: "20px"
  2721. }}
  2722. >
  2723. {this.state.dataSource.map((item, index) => (
  2724. <li
  2725. key={index}
  2726. style={{
  2727. width: "100%",
  2728. height: "auto",
  2729. wordBreak: "break-all",
  2730. color: "black",
  2731. marginBottom: "10px"
  2732. }}
  2733. >{`${item.aname}: ${item.remarks}`}</li>
  2734. ))}
  2735. </ul> */}
  2736. <div className="clearfix">
  2737. <Button
  2738. type="primary"
  2739. style={{ float: "right", marginRight: 40 }}
  2740. onClick={this.changeApply}
  2741. >
  2742. 发起变更申请
  2743. </Button>
  2744. </div>
  2745. {
  2746. // 变更项目任务编辑
  2747. this.state.editProVisible &&
  2748. <NewEditProject
  2749. type="change"
  2750. children="list"
  2751. typeChange={this.state.typeChange}
  2752. cid={this.state.data.id}
  2753. readOnly={false}
  2754. orderNo={this.state.data.orderNo}
  2755. visible={this.state.editProVisible}
  2756. dataInfor={this.state.dataInfor}
  2757. newData={this.state.newData}
  2758. onCancel={() => [this.nextCancel("change")]}
  2759. />
  2760. // <ProjectOperation
  2761. // type="biangeng"
  2762. // readOnly={false}
  2763. // visible={this.state.editProVisible}
  2764. // dataInfor={this.state.dataInfor}
  2765. // newData={this.state.newData}
  2766. // onCancel={() => {
  2767. // this.setState({
  2768. // editProVisible: false,
  2769. // });
  2770. // this.proList()
  2771. // }}
  2772. // />
  2773. }
  2774. {/* <Modal
  2775. maskClosable={false}
  2776. title="修改项目金额及数量"
  2777. visible={this.state.editProVisible}
  2778. onOk={this.submitEditPro}
  2779. width={300}
  2780. okText={"保存"}
  2781. onCancel={() => {
  2782. this.setState({
  2783. editProVisible: false,
  2784. });
  2785. }}
  2786. >
  2787. <div className="clearfix">
  2788. <FormItem
  2789. labelCol={{ span: 6 }}
  2790. wrapperCol={{ span: 14 }}
  2791. label="项目金额"
  2792. style={{
  2793. display: this.state.editSplitStatus == 2 ? "none" : "block",
  2794. }}
  2795. >
  2796. <Input
  2797. placeholder="请输入金额"
  2798. rows={4}
  2799. value={this.state.editProMoney}
  2800. onChange={(e) => {
  2801. this.setState({ editProMoney: e.target.value });
  2802. }}
  2803. />
  2804. </FormItem>
  2805. <FormItem
  2806. labelCol={{ span: 6 }}
  2807. wrapperCol={{ span: 14 }}
  2808. label="项目数量"
  2809. >
  2810. <Input
  2811. placeholder="请输入数量"
  2812. rows={4}
  2813. value={this.state.editProCommodityQuantity}
  2814. onChange={(e) => {
  2815. this.setState({ editProCommodityQuantity: e.target.value });
  2816. }}
  2817. />
  2818. </FormItem>
  2819. </div>
  2820. </Modal> */}
  2821. <Modal
  2822. maskClosable={false}
  2823. title={isNaN(parseFloat(this.state.appropriationRatio)) ? "修改催款节点金额" : "修改催款节点比例"}
  2824. visible={this.state.editCuiVisible}
  2825. onOk={() => {
  2826. this.submitEditCui(isNaN(parseFloat(this.state.appropriationRatio)) ? 0 : 1);
  2827. }}
  2828. okText={"保存"}
  2829. width={300}
  2830. onCancel={(e) => {
  2831. this.setState({
  2832. editCuiVisible: false,
  2833. appropriationRatio: ''
  2834. });
  2835. }}
  2836. >
  2837. <div className="clearfix">
  2838. <FormItem
  2839. labelCol={{ span: 6 }}
  2840. wrapperCol={{ span: 14 }}
  2841. label={isNaN(parseFloat(this.state.appropriationRatio)) ? "催款金额" : "催款比例"}
  2842. >
  2843. <Input
  2844. type='number'
  2845. placeholder={isNaN(parseFloat(this.state.appropriationRatio)) ? "请输入金额" : "请输入比例"}
  2846. rows={4}
  2847. value={this.state.editCuiMoney}
  2848. onChange={(e) => {
  2849. this.setState({ editCuiMoney: e.target.value });
  2850. }}
  2851. />
  2852. </FormItem>
  2853. </div>
  2854. </Modal>
  2855. {
  2856. this.state.changeVisible &&
  2857. <NewAddProject
  2858. type="change"
  2859. children="list"
  2860. typeChange={this.state.typeChange}
  2861. cid={this.state.data.id}
  2862. readOnly={false}
  2863. orderNo={this.state.data.orderNo}
  2864. visible={this.state.changeVisible}
  2865. newData={this.state.newData}
  2866. onCancel={() => [this.nextCancel("change")]}
  2867. />
  2868. }
  2869. </Spin>
  2870. {
  2871. this.state.addYears &&
  2872. <Modal
  2873. title="添加服务年限"
  2874. visible={this.state.addYears}
  2875. okText="添加"
  2876. onOk={() => {
  2877. if (!this.state.addyear) {
  2878. message.warn("请选择年份!")
  2879. return
  2880. }
  2881. if (this.state.isGive == undefined) {
  2882. message.warn("请选择是否赠送!")
  2883. return
  2884. }
  2885. let slist = this.state.serviceLife
  2886. if (this.state.isGive == 0) {
  2887. slist.push(this.state.addyear)
  2888. } else if (this.state.isGive == 1) {
  2889. let newYear = this.state.addyear + "(赠)"
  2890. slist.push(newYear)
  2891. }
  2892. this.setState({
  2893. serviceLife: slist,
  2894. addYears: false
  2895. })
  2896. }}
  2897. onCancel={() => {
  2898. this.setState({
  2899. addYears: false
  2900. })
  2901. }}
  2902. >
  2903. <Select
  2904. style={{ width: '200px', marginRight: 50 }}
  2905. placeholder="请选择年份"
  2906. onChange={e => {
  2907. this.setState({
  2908. addyear: e,
  2909. })
  2910. }}
  2911. >
  2912. {
  2913. vipYear.map(its => (
  2914. <Option
  2915. key={its}
  2916. disabled={this.state.serviceLife.toString().includes(its)}
  2917. >{its}</Option>
  2918. ))
  2919. }
  2920. </Select>
  2921. <RadioGroup
  2922. onChange={e => {
  2923. this.setState({
  2924. isGive: e.target.value
  2925. })
  2926. }}
  2927. value={this.state.isGive}
  2928. >
  2929. <Radio value={0}>非赠送</Radio>
  2930. <Radio value={1}>赠送</Radio>
  2931. </RadioGroup>
  2932. </Modal>
  2933. }
  2934. </div>
  2935. );
  2936. }
  2937. }
  2938. export default ChangeApply;