addService.jsx 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete,DatePicker,Radio,Col} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import {orderTypes,customerType,jiedian,tepi,boutique} from '../../../dataDic.js';
  7. import {splitUrl,getTransactionProject,getChangeState,getTransactionChannel,beforeUploadFile,getProcessStatus,getLiquidationStatus,getboutique} from '../../../tools.js';
  8. const Option = AutoComplete.Option;
  9. //图片组件
  10. const PicturesWall = React.createClass({
  11. getInitialState() {
  12. return {
  13. previewVisible: false,
  14. previewImage: '',
  15. fileList: [],
  16. }
  17. },
  18. getDefaultProps(){
  19. return{
  20. changeClick:this.modifyChange
  21. }
  22. },
  23. handleCancel() {
  24. this.setState({ previewVisible: false })
  25. },
  26. handlePreview(file) {
  27. this.setState({
  28. previewImage: file.url || file.thumbUrl,
  29. previewVisible: true,
  30. });
  31. },
  32. handleChange(info) {
  33. let fileList = info.fileList;
  34. this.setState({ fileList });
  35. this.props.fileList(fileList);
  36. },
  37. componentWillReceiveProps(nextProps) {
  38. this.state.fileList = nextProps.pictureUrl;
  39. },
  40. render() {
  41. const { previewVisible, previewImage, fileList } = this.state;
  42. const uploadButton = (
  43. <div>
  44. <Icon type="plus" />
  45. <div className="ant-upload-text">点击上传</div>
  46. </div>
  47. );
  48. return (
  49. <div style={{display:"inline-block"}}>
  50. <Upload
  51. beforeUpload={beforeUploadFile}
  52. action={globalConfig.context + "/api/admin/order/uploadOrderImg"}
  53. data={{ 'sign': '' }}
  54. listType="picture-card"
  55. fileList={fileList}
  56. onPreview={this.handlePreview}
  57. onChange={this.handleChange} >
  58. {fileList.length >= 18 ? null : uploadButton}
  59. </Upload>
  60. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  61. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  62. </Modal>
  63. </div>
  64. );
  65. }
  66. });
  67. const NewService = Form.create()(React.createClass({
  68. //查看项目列表
  69. loadData(record) {
  70. this.state.data = [];
  71. this.setState({
  72. loading: true
  73. });
  74. $.ajax({
  75. method: "get",
  76. dataType: "json",
  77. crossDomain: false,
  78. url: globalConfig.context + '/open/api/admin/newOrder/getOrderTask',
  79. data: {
  80. orderNo:record?record.orderNo:this.props.datauser.orderNo
  81. },
  82. success: function (data) {
  83. let theArr = [];
  84. if (!data.data) {
  85. if (data.error && data.error.length) {
  86. message.warning(data.error[0].message);
  87. };
  88. } else {
  89. for (let i = 0; i < data.data.length; i++) {
  90. let thisdata = data.data[i];
  91. theArr.push({
  92. key: i,
  93. id:thisdata.id,
  94. orderNo:thisdata.orderNo,//订单编号
  95. commodityId:thisdata.commodityId,//项目ID
  96. commodityName:thisdata.commodityName,//项目名称
  97. cname:thisdata.cname,//项目类别
  98. commodityPrice:thisdata.commodityPrice,//项目价格
  99. commodityQuantity:thisdata.commodityQuantity,//项目数量
  100. main:thisdata.main,//是否为主要任务
  101. taskComment:thisdata.taskComment,//任务说明
  102. contacts:thisdata.contacts,//联系人
  103. contactsMobile:thisdata.contactsMobile,//联系人电话
  104. });
  105. };
  106. }
  107. this.setState({
  108. dataSource: theArr,
  109. pagination: false,
  110. });
  111. }.bind(this),
  112. }).always(function () {
  113. this.setState({
  114. loading: false
  115. });
  116. }.bind(this));
  117. },
  118. //收款节点
  119. loadDatas(record) {
  120. this.state.data = [];
  121. this.setState({
  122. loading: true
  123. });
  124. $.ajax({
  125. method: "get",
  126. dataType: "json",
  127. crossDomain: false,
  128. url: globalConfig.context + '/open/api/admin/newOrder/selectOrderDun',
  129. data: {
  130. orderNo:record?record.orderNo:this.props.datauser.orderNo
  131. },
  132. success: function (data) {
  133. let theArr = [];
  134. if (!data.data) {
  135. if (data.error && data.error.length) {
  136. message.warning(data.error[0].message);
  137. };
  138. } else {
  139. for (let i = 0; i < data.data.length; i++) {
  140. let thisdata = data.data[i];
  141. theArr.push({
  142. key: i,
  143. id:thisdata.id,
  144. });
  145. };
  146. }
  147. this.setState({
  148. dataSource: theArr,
  149. pagination: false,
  150. });
  151. }.bind(this),
  152. }).always(function () {
  153. this.setState({
  154. loading: false
  155. });
  156. }.bind(this));
  157. },
  158. getInitialState() {
  159. return {
  160. loading: false,
  161. visible: false,
  162. orgCodeUrl:[],
  163. customerArr:[],
  164. bussStats:false,
  165. checkedKeys: [],
  166. lookflowList:[],
  167. active:{
  168. applySign:false
  169. },
  170. lookState:false,
  171. signBillVisible:false,
  172. commod:'',
  173. columns: [
  174. {
  175. title: '业务项目名称',
  176. dataIndex: 'commodityName',
  177. key: 'commodityName'
  178. }, {
  179. title: '项目类别',
  180. dataIndex: 'cname',
  181. key: 'cname',
  182. },{
  183. title: '项目数量',
  184. dataIndex: 'commodityQuantity',
  185. key: 'commodityQuantity'
  186. }, {
  187. title: '金额(万元)',
  188. dataIndex: 'commodityPrice',
  189. key: 'commodityPrice'
  190. }, {
  191. title: '负责人',
  192. dataIndex: 'contacts',
  193. key: 'contacts'
  194. }, {
  195. title: '负责人电话',
  196. dataIndex: 'contactsMobile',
  197. key: 'contactsMobile'
  198. }, {
  199. title: '主要项目',
  200. dataIndex: 'main',
  201. key: 'main',
  202. render:(text)=>{
  203. return (text?'是':'否')
  204. }
  205. }, {
  206. title: '项目说明',
  207. dataIndex: 'taskComment',
  208. key: 'taskComment',
  209. render:(text)=>{
  210. return (text&&text.length>8?text.substr(0,8)+'…':text)
  211. }
  212. }, {
  213. title: '操作',
  214. dataIndex: 'ABC',
  215. key: 'ABC',
  216. render: (text, record, index) => {
  217. return <div>
  218. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.delectRow(record)}} okText="是" cancelText="否">
  219. <Button onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  220. </Popconfirm>:""}
  221. </div>
  222. }
  223. },
  224. ],
  225. flowList:[
  226. {
  227. title: '平台流水号',
  228. dataIndex: 'billNo',
  229. key: 'billNo',
  230. }, {
  231. title: '平台流水时间',
  232. dataIndex: 'createTime',
  233. key: 'createTime'
  234. }, {
  235. title: '流水金额(万元)',
  236. dataIndex: 'transactionAmount',
  237. key: 'transactionAmount'
  238. },{
  239. title: '付款人名称',
  240. dataIndex: 'payerName',
  241. key: 'payerName'
  242. }, {
  243. title: '收款人名称',
  244. dataIndex: 'payeeName',
  245. key: 'payeeName'
  246. },
  247. {
  248. title: '流水科目',
  249. dataIndex: 'transactionSubject',
  250. key: 'transactionSubject',
  251. render:(text)=>{return getTransactionProject(text) }
  252. }, {
  253. title: '流水渠道',
  254. dataIndex: 'transactionChannel',
  255. key: 'transactionChannel',
  256. render:(text)=>{return getTransactionChannel(text) }
  257. },{
  258. title: '财务流水号',
  259. dataIndex: 'financialPayNo',
  260. key: 'financialPayNo',
  261. }, {
  262. title: '财务流水时间',
  263. dataIndex: 'financialPayTime',
  264. key: 'financialPayTime',
  265. }, {
  266. title: '流水确认',
  267. dataIndex: 'confirmSign',
  268. key: 'confirmSign',
  269. render:(text)=>{return text?'已确认':'待确认' }
  270. },{
  271. title: '确认时间',
  272. dataIndex: 'confirmTime',
  273. key: 'confirmTime',
  274. }
  275. ],
  276. contactList:[],
  277. loading:false,
  278. ContactsLists: [{
  279. title: '催款科目',
  280. dataIndex: 'dunSubject',
  281. key: 'dunSubject',
  282. render: (text, record, index) => {
  283. return <Select placeholder="请选择催款科目" value={record.dunSubject} style={{width:'150px'}}
  284. onChange={(e) => { record.dunSubject = e; this.setState({ contactList: this.state.contactList }); }}>
  285. {
  286. jiedian.map(function (item) {
  287. return <Select.Option key={item.value} >{item.key}</Select.Option>
  288. })
  289. }
  290. </Select>
  291. }
  292. },{
  293. title: '金额(万)',
  294. dataIndex: 'money',
  295. key: 'money',
  296. render: (text, record, index) => {
  297. return <Input value={record.money} placeholder="请输入金额(必填项)" key={record.id} required="required"
  298. onChange={(e) => { record.money = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>
  299. }
  300. }, {
  301. title: '催款状态',
  302. dataIndex: 'dunStatus',
  303. key: 'dunStatus',
  304. render: (text, record, index) => {
  305. return text?'已完成':'催款中'
  306. }
  307. },
  308. {
  309. title: '操作',
  310. dataIndex: 'dels',
  311. key: 'dels',
  312. render: (text, record, index) => {
  313. return <div>
  314. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.confirmDelet(record.key)}} okText="删除" cancelText="不删除">
  315. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
  316. </Popconfirm>
  317. :''}
  318. {record.id?'': <Button type="primary" htmlType="submit" onClick={this.contactSave}>保存</Button>}
  319. </div>
  320. }
  321. }
  322. ],
  323. };
  324. },
  325. //新建订单、编辑订单保存
  326. handleSubmit(e) {
  327. e.preventDefault();
  328. let theorgCodeUrl = [];
  329. if (this.state.orgCodeUrl.length) {
  330. let picArr = [];
  331. this.state.orgCodeUrl.map(function (item) {
  332. if ( item.response && item.response.data && item.response.data.length ){
  333. picArr.push(item.response.data);
  334. }
  335. });
  336. theorgCodeUrl = picArr.join(",");
  337. };
  338. if(this.props.userDetaile){
  339. if(!this.state.contacts){
  340. message.warning('企业负责人不能为空');
  341. this.refs.signFirstPayment.focus()
  342. return false;
  343. };
  344. if(!this.state.contactMobile){
  345. message.warning('企业负责人电话不能为空');
  346. this.refs.signFirstPayment.focus()
  347. return false;
  348. };
  349. if(!this.state.totalAmount){
  350. message.warning('签单金额不能为空');
  351. this.refs.signFirstPayment.focus()
  352. return false;
  353. };
  354. if(!this.state.firstAmount){
  355. message.warning('首付金额不能为空');
  356. this.refs.signFirstPayment.focus()
  357. return false;
  358. };
  359. if(!theorgCodeUrl){
  360. message.warning('企业负责人不能为空');
  361. this.refs.signFirstPayment.focus()
  362. return false;
  363. };
  364. }else{
  365. if(this.state.orderType==undefined){
  366. message.warning('请选择订单类型');
  367. return false;
  368. };
  369. if(!this.state.autoId){
  370. message.warning('客户名称不匹配');
  371. return false;
  372. };
  373. }
  374. this.props.form.validateFields((err, values) => {
  375. if(!err) {
  376. this.setState({
  377. loading: true
  378. });
  379. let api=this.props.userDetaile?'/open/api/admin/newOrder/updateServiceOrderNew':'/open/api/admin/newOrder/createOrder';
  380. $.ajax({
  381. method: "POST",
  382. dataType: "json",
  383. crossDomain: false,
  384. url: globalConfig.context + api,
  385. data: !this.props.userDetaile?{
  386. uid:this.state.autoId,
  387. orderType:this.state.orderType,
  388. contractType:this.state.contractType
  389. }:{
  390. orderNo: this.state.orderNo,//订单编号
  391. totalAmount: this.state.totalAmount,//总金额
  392. firstAmount: this.state.firstAmount,//首付
  393. isSubmit: this.state.isSubmit,//保存草稿还是提交
  394. signDate: this.state.signDate,//签单日期
  395. contacts: this.state.contacts,//企业负责人
  396. contactMobile: this.state.contactMobile,//负责人联系方式
  397. legalPerson: this.state.legalPerson,//企业法人
  398. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  399. approval: this.state.approval,//特批状态
  400. contractNo: this.state.contractNo,//合同编号
  401. orderRemarks: this.state.orderRemarks,//订单备注
  402. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  403. }
  404. }).done(function(data) {
  405. this.setState({
  406. loading: false
  407. });
  408. if(!data.error.length) {
  409. message.success('保存成功!');
  410. this.handleOk()
  411. } else {
  412. message.warning(data.error[0].message);
  413. }
  414. }.bind(this));
  415. }
  416. });
  417. },
  418. //订单详情修改
  419. xiangqingClick(e) {
  420. e.preventDefault();
  421. this.setState({
  422. loading: true
  423. });
  424. $.ajax({
  425. url: globalConfig.context + '/open/api/admin/newOrder/updateServiceOrderNew',
  426. method: 'post',
  427. data: {
  428. orderNo: this.state.orderNo,//订单编号
  429. totalAmount: this.state.totalAmount,//总金额
  430. firstAmount: this.state.firstAmount,//首付
  431. isSubmit: this.state.isSubmit,//保存草稿还是提交
  432. signDate: this.state.signDate,//签单日期
  433. contacts: this.state.contacts,//企业负责人
  434. contactMobile: this.state.contactMobile,//负责人联系方式
  435. legalPerson: this.state.legalPerson,//企业法人
  436. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  437. approval: this.state.approval,//特批状态
  438. contractNo: this.state.contractNo,//合同编号
  439. orderRemarks: this.state.orderRemarks,//订单备注
  440. }
  441. }).done(function(data) {
  442. this.setState({
  443. loading: false
  444. });
  445. if(!data.error.length) {
  446. message.success('保存成功!');
  447. this.loaduser();
  448. } else {
  449. message.warning(data.error[0].message);
  450. }
  451. }.bind(this));
  452. },
  453. //查看基本详情基本信息
  454. loaduser(record){
  455. this.state.orderList=[]
  456. $.ajax({
  457. method: "get",
  458. dataType: "json",
  459. crossDomain: false,
  460. url: globalConfig.context + '/open/api/admin/newOrder/getOrderNewDetail',
  461. data: {
  462. orderNo:record?record.orderNo:this.props.datauser.orderNo
  463. },
  464. success: function (data) {
  465. let thisData = data.data;
  466. if (!thisData) {
  467. if (data.error && data.error.length) {
  468. message.warning(data.error[0].message);
  469. };
  470. thisData = {};
  471. };
  472. this.setState({
  473. id:thisData.id,
  474. kehuId:thisData.buyerId,
  475. orderNo:thisData.orderNo,//订单编号
  476. orderType:thisData.orderType,//订单类型
  477. firstAmount:thisData.firstAmount,//首付金额
  478. totalAmount:thisData.totalAmount,//总金额
  479. settlementAmount:thisData.settlementAmount,//结算金额
  480. liquidationStatus:thisData.liquidationStatus,//清算状态
  481. processStatus:thisData.processStatus,//流程状态
  482. approval:thisData.approval.toString(),//特批状态
  483. orderRemarks:thisData.orderRemarks,//订单备注
  484. contractNo:thisData.contractNo,//合同编号
  485. contacts:thisData.contacts,//联系人
  486. contactMobile:thisData.contactMobile,//联系人电话
  487. legalPerson:thisData.legalPerson,//法人
  488. legalPersonTel:thisData.legalPersonTel,//法人电话
  489. contractNo:thisData.contractNo,//合同编号
  490. orgCodeUrl: thisData.contractPictureUrl ? splitUrl(thisData.contractPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],//图片地址
  491. signDate:thisData.signDate,//签单时间
  492. userName:thisData.userName,//客户名称
  493. salesmanName:thisData.salesmanName,//营销员名称
  494. financeName:thisData.financeName,//财务名称
  495. contractNo:thisData.contractNo,//合同编号
  496. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  497. });
  498. }.bind(this),
  499. }).always(function () {
  500. this.setState({
  501. loading: false
  502. });
  503. }.bind(this));
  504. },
  505. //查看催款节点
  506. loaduserss(record){
  507. this.state.orderList=[]
  508. this.setState({
  509. orderNoss:record?record.orderNo:this.props.datauser.orderNo,
  510. })
  511. $.ajax({
  512. method: "get",
  513. dataType: "json",
  514. crossDomain: false,
  515. url: globalConfig.context + '/open/api/admin/newOrder/selectOrderDun',
  516. data: {
  517. orderNo:record?record.orderNo:this.props.datauser.orderNo
  518. },
  519. success: function (data) {
  520. let theArr=[];
  521. let thisData=[];
  522. if (!thisData) {
  523. if (data.error && data.error.length) {
  524. message.warning(data.error[0].message);
  525. };
  526. thisData = {};
  527. }else{
  528. for(let i = 0; i < data.data.length; i++) {
  529. thisData= data.data[i];
  530. theArr.push({
  531. key:i,
  532. dunSubject:thisData.dunSubject?thisData.dunSubject.toString():"",//催款科目
  533. id:thisData.id,//节点Id
  534. money:thisData.money,//催款金额
  535. dunStatus:thisData.dunStatus,//催款状态
  536. orderNo:record?record.orderNo:this.props.datauser.orderNo,
  537. })
  538. }
  539. this.setState({
  540. contactList:theArr
  541. })
  542. };
  543. }.bind(this),
  544. }).always(function () {
  545. this.setState({
  546. loading: false
  547. });
  548. }.bind(this));
  549. },
  550. //催款节点保存
  551. contactSave(e) {
  552. this.setState({
  553. loading: true
  554. });
  555. $.ajax({
  556. url: globalConfig.context + '/open/api/admin/newOrder/createOrderDun',
  557. method: 'post',
  558. data: {
  559. orderNo: this.state.orderNoss,
  560. orderDun: JSON.stringify(this.state.contactList)
  561. }
  562. }).done(function(data) {
  563. this.setState({
  564. loading: false
  565. });
  566. if(!data.error.length) {
  567. message.success('保存成功!');
  568. this.loaduserss();
  569. } else {
  570. message.warning(data.error[0].message);
  571. }
  572. }.bind(this));
  573. },
  574. //点击新增催款节点
  575. addcontact(record) {
  576. this.state.contactList.push({
  577. key:this.state.contactList.length,
  578. money: '',
  579. dunSubject:undefined,
  580. orderNo: this.state.orderNoss,
  581. dunTarget:this.state.kehuId,
  582. });
  583. this.setState({
  584. contactList: this.state.contactList
  585. })
  586. console.log(this.state.contactList);
  587. },
  588. //删除收款节点
  589. confirmDelet(index) {
  590. console.log(index);
  591. this.state.contactList.splice(index,1);
  592. this.setState({
  593. contactList: this.state.contactList
  594. })
  595. this.contactSave();
  596. },
  597. handleOk(e) {
  598. this.setState({
  599. visible: false,
  600. });
  601. this.props.closeDesc(false, true);
  602. },
  603. handleCancel(e) {
  604. this.setState({
  605. visible: false,
  606. });
  607. this.props.closeDesc(false);
  608. },
  609. //点击签单
  610. handleCancels(e) {
  611. this.setState({
  612. //visible: false,
  613. });
  614. this.props.closeDesc(false);
  615. this.setState({
  616. isSubmit:1
  617. })
  618. },
  619. //点击签单
  620. handleCancelq(e) {
  621. this.setState({
  622. //visible: false,
  623. });
  624. this.props.closeDesc(false);
  625. this.setState({
  626. isSubmit:0
  627. })
  628. },
  629. //删除
  630. delectRow(record) {
  631. this.setState({
  632. loading: true
  633. });
  634. $.ajax({
  635. method: "post",
  636. dataType: "json",
  637. crossDomain: false,
  638. url: globalConfig.context + "/open/api/admin/newOrder/deleteOrderTask",
  639. data: {
  640. id:record.id
  641. }
  642. }).done(function (data) {
  643. if (!data.error.length) {
  644. message.success('删除成功!');
  645. this.setState({
  646. loading: false,
  647. });
  648. this.loaduser()
  649. this.loadData();
  650. } else {
  651. message.warning(data.error[0].message);
  652. };
  653. }.bind(this));
  654. },
  655. nextCancel() {
  656. this.setState({
  657. addnextVisible: false
  658. })
  659. },
  660. getOrgCodeUrl(e) {
  661. this.setState({ orgCodeUrl: e });
  662. },
  663. componentWillMount() {
  664. },
  665. //查看订单详情里面的各种骚操作
  666. //受理订单
  667. admissibleOrderOK(){
  668. let idArr=this.props.datauser;
  669. this.props.admissibleOrder(idArr,true)
  670. },
  671. //拒绝受理
  672. admissibleOrderCancel(){
  673. let idArr=this.props.datauser;
  674. this.props.admissibleOrder(idArr,false)
  675. },
  676. //取消订单
  677. cancelOrder(){
  678. let idArr=this.props.datauser;
  679. this.props.operation(idArr,3)
  680. },
  681. //作废订单
  682. scrapOrder(){
  683. let idArr=this.props.datauser;
  684. this.props.operation(idArr,2)
  685. },
  686. //锁定订单
  687. lockOrder(){
  688. let idArr=this.props.datauser;
  689. this.props.operation(idArr,0)
  690. },
  691. //解锁订单
  692. unlockOrder(){
  693. let idArr=this.props.datauser;
  694. this.props.operation(idArr,1)
  695. },
  696. //签单
  697. signBitt(){
  698. this.setState({
  699. contractNo:this.state.contractNo,
  700. signVisible:true,
  701. entryTime:undefined,
  702. selTime:undefined
  703. })
  704. },
  705. signBittOk(){
  706. this.setState({
  707. signVisible:false
  708. })
  709. },
  710. signBillOk(){
  711. this.setState({
  712. signBillVisible:false
  713. })
  714. },
  715. signBillCancel(e) {
  716. this.setState({
  717. signVisible:false,
  718. signBillVisible: false,
  719. });
  720. this.props.closeDesc(false, true);
  721. },
  722. //加载(自动补全)
  723. supervisor(e,state){ //客户名称与服务名称自动补全
  724. let api=state?'/api/admin/customer/getCustomerByName':'/api/admin/order/getBusinessProjectByName';
  725. $.ajax({
  726. method: "get",
  727. dataType: "json",
  728. crossDomain: false,
  729. url: globalConfig.context + api,
  730. data:state?{
  731. name:e,
  732. type:this.state.customType
  733. }:{
  734. businessName:e
  735. },
  736. success: function (data) {
  737. let thedata=data.data;
  738. if (!thedata) {
  739. if (data.error && data.error.length) {
  740. message.warning(data.error[0].message);
  741. };
  742. thedata = {};
  743. };
  744. this.setState({
  745. states:state,
  746. customerArr:thedata,
  747. });
  748. }.bind(this),
  749. }).always(function () {
  750. this.setState({
  751. loading: false
  752. });
  753. }.bind(this));
  754. },
  755. //上级主管输入框失去焦点是判断客户是否存在
  756. selectAuto(value){
  757. let kid=[];
  758. let fwList=this.state.customerArr;
  759. fwList.map(function(item){
  760. if(value==item.bname){
  761. kid=item
  762. }
  763. })
  764. this.setState({
  765. commodityName:value,
  766. gid:kid.id,
  767. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  768. commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
  769. })
  770. },
  771. //客户
  772. selectAutoCUT(value){
  773. let autoIds;
  774. let fwList=this.state.customerArr;
  775. fwList.map(function(item){
  776. if(value==item.name){
  777. autoIds=item.id
  778. }
  779. })
  780. this.setState({
  781. customerName:value,
  782. autoId:autoIds
  783. })
  784. },
  785. //服务值改变时请求客户名称
  786. httpChange(e){
  787. this.state.gid='';
  788. if(e.length>=1){
  789. this.supervisor(e,false);
  790. }
  791. this.setState({
  792. commodityName:e
  793. })
  794. },
  795. //客户名称自动补全
  796. customerChange(e){
  797. this.state.autoId='';
  798. if(e.length>=2){
  799. this.supervisor(e,true);
  800. }
  801. this.setState({
  802. customerName:e
  803. })
  804. },
  805. //点击添加项目明细
  806. addDetailed(){
  807. this.setState({
  808. gid:'',
  809. customerArr:[],
  810. commodityName:'',
  811. commodityQuantity:'',
  812. commodityId:'',
  813. taskComment:'',
  814. main:undefined,
  815. commodityPrice:'',
  816. addState:1,
  817. addnextVisible: true
  818. })
  819. },
  820. //新建项目明细保存
  821. nextSubmit(e) {
  822. e.preventDefault();
  823. if(this.state.gid==undefined||!this.state.gid){
  824. message.warning('服务名称不匹配!');
  825. return false;
  826. };
  827. if(!this.state.commodityPrice){
  828. message.warning('请输入金额!');
  829. this.refs.commodityPrice.focus();
  830. return false;
  831. };
  832. if(!this.state.commodityQuantity){
  833. message.warning('请输入商品数量!');
  834. this.refs.commodityQuantity.focus();
  835. return false;
  836. };
  837. if(!this.state.main){
  838. message.warning('请选择是否为主要项目!');
  839. this.refs.commodityQuantity.focus();
  840. return false;
  841. };
  842. this.setState({
  843. loading: true
  844. });
  845. let api=this.state.addState?'/open/api/admin/newOrder/addOrderTask':'/api/bianji';
  846. $.ajax({
  847. method: "POST",
  848. dataType: "json",
  849. crossDomain: false,
  850. url: globalConfig.context +api ,
  851. data: {
  852. commodityId:this.state.gid,//商品ID
  853. orderNo:this.props.datauser.orderNo,//订单编号
  854. commodityName:this.state.commodityName,//商品名称
  855. commodityQuantity:this.state.commodityQuantity,//商品数量
  856. commodityPrice:this.state.commodityPrice,//签单总价
  857. taskComment:this.state.taskComment,//服务说明
  858. main:this.state.main,//是否为主要项目
  859. }
  860. }).done(function(data) {
  861. this.setState({
  862. loading: false
  863. });
  864. if(!data.error.length) {
  865. message.success('保存成功!');
  866. this.nextCancel()
  867. //this.loaduser(this.props.datauser);
  868. this.loadData();
  869. } else {
  870. message.warning(data.error[0].message);
  871. }
  872. }.bind(this));
  873. },
  874. //点击打卡项目详情
  875. tableRowClick(record, index) {
  876. console.log(record);
  877. this.setState({
  878. jid:record.id,//项目ID
  879. kid:record.commodityId,//商品ID
  880. commodityName:record.commodityName,//金额
  881. commodityPrice:record.commodityPrice,//金额
  882. commodityQuantity:record.commodityQuantity,//数量
  883. taskComment:record.taskComment,//备注
  884. main:record.main.toString(),//是否为主要
  885. addnextVisible:true,
  886. addState:0,
  887. });
  888. },
  889. //修改项目详情
  890. tabRowSave(e){
  891. e.preventDefault();
  892. if(!this.state.commodityPrice){
  893. message.warning('金额不能为空!');
  894. return false;
  895. };
  896. if(!this.state.commodityQuantity){
  897. message.warning('数量不能为空!');
  898. return false;
  899. };
  900. if(!this.state.main){
  901. message.warning('请选择是否为主要项目!');
  902. this.refs.commodityQuantity.focus();
  903. return false;
  904. };
  905. $.ajax({
  906. method: "POST",
  907. dataType: "json",
  908. crossDomain: false,
  909. url: globalConfig.context +'/open/api/admin/newOrder/updateOrderTask' ,
  910. data: {
  911. id:this.state.jid,//项目ID
  912. commodityId:this.state.kid,//商品ID
  913. orderNo:this.props.datauser.orderNo,//订单编号
  914. main:this.state.main,//是否为主要
  915. commodityPrice:this.state.commodityPrice,//金额
  916. commodityQuantity:this.state.commodityQuantity,//数量
  917. taskComment:this.state.taskComment//备注
  918. }
  919. }).done(function(data) {
  920. this.setState({
  921. loading: false
  922. });
  923. if(!data.error.length) {
  924. message.success('保存成功!');
  925. this.nextCancel()
  926. this.loaduser(this.props.datauser);
  927. this.loadData();
  928. } else {
  929. message.warning(data.error[0].message);
  930. }
  931. }.bind(this));
  932. },
  933. //签单保存
  934. signOk(e){
  935. e.preventDefault();
  936. this.temporarySave(false)
  937. },
  938. //暂存信息
  939. temporary(){
  940. this.temporarySave(true)
  941. },
  942. //签单时间选择
  943. selTime(e,index){
  944. this.setState({
  945. entryTime:e,
  946. selTime:index
  947. })
  948. },
  949. signSub(e){
  950. e.preventDefault();
  951. if(!this.state.selTime){
  952. message.warning("请选择签单时间!");
  953. return false;
  954. };
  955. let theorgCodeUrl = [];
  956. if (this.state.orgCodeUrl.length) {
  957. let picArr = [];
  958. this.state.orgCodeUrl.map(function (item) {
  959. if ( item.response && item.response.data && item.response.data.length ){
  960. picArr.push(item.response.data);
  961. }
  962. });
  963. theorgCodeUrl = picArr.join(",");
  964. };
  965. this.setState({
  966. loading: true
  967. });
  968. let dataList=this.state.dataSource,
  969. idsList=[];
  970. dataList.map((item,index) => {
  971. console.log(item);
  972. console.log(this.state.commodityId);
  973. idsList.push({
  974. businessId:'',
  975. businessProjectId:item.commodityId,
  976. customerStatus:"1",
  977. followSituation:"5",
  978. remarks:"签单-自动触发"
  979. })
  980. })
  981. $.ajax({
  982. method: "POST",
  983. dataType: "json",
  984. crossDomain: false,
  985. url: globalConfig.context +'/api/admin/order/signServiceOrder' ,
  986. data: {
  987. userBusinessList: JSON.stringify(idsList),
  988. uid:this.state.buyerId,
  989. orderNo:this.props.datauser.orderNo,
  990. signTotalAmount:this.state.signTotalAmount,
  991. signFirstPayment:this.state.signFirstPayment,
  992. approval:this.state.approval,
  993. orderRemarks:this.state.orderRemarks,
  994. contractNo:this.state.contractNo,
  995. signTime:this.state.selTime,
  996. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  997. }
  998. }).done(function(data) {
  999. this.setState({
  1000. loading: false
  1001. });
  1002. if(!data.error.length) {
  1003. message.success('操作成功!');
  1004. this.signBillCancel()
  1005. } else {
  1006. message.warning(data.error[0].message);
  1007. }
  1008. }.bind(this));
  1009. },
  1010. //签单保存与暂存函数
  1011. temporarySave(e){
  1012. if(!this.state.signTotalAmount){
  1013. message.warning('实签款项不能为空!')
  1014. return false;
  1015. };
  1016. if(!this.state.signTotalAmount){
  1017. message.warning('实签首款不能为空!')
  1018. return false;
  1019. };
  1020. if(this.state.approval==undefined){
  1021. message.warning('实签首款不能为空!')
  1022. return false;
  1023. };
  1024. if(!this.state.contractNo){
  1025. message.warning("请输入合同编号!");
  1026. return false;
  1027. }
  1028. this.setState({
  1029. loading: true
  1030. });
  1031. let theorgCodeUrl = [];
  1032. if (this.state.orgCodeUrl.length) {
  1033. let picArr = [];
  1034. this.state.orgCodeUrl.map(function (item) {
  1035. if ( item.response && item.response.data && item.response.data.length ){
  1036. picArr.push(item.response.data);
  1037. }
  1038. });
  1039. theorgCodeUrl = picArr.join(",");
  1040. };
  1041. let api=e?'/api/admin/order/updateServiceOrder':'/api/admin/order/signServiceOrder';
  1042. $.ajax({
  1043. method: "POST",
  1044. dataType: "json",
  1045. crossDomain: false,
  1046. url: globalConfig.context +api ,
  1047. data: {
  1048. orderNo:this.props.uid?this.props.uid.orderNo:this.props.datauser.orderNo,
  1049. signTotalAmount:this.state.signTotalAmount,
  1050. signFirstPayment:this.state.signFirstPayment,
  1051. approval:this.state.approval,
  1052. orderRemarks:this.state.orderRemarks,
  1053. contractNo:this.state.contractNo,
  1054. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  1055. }
  1056. }).done(function(data) {
  1057. this.setState({
  1058. loading: false
  1059. });
  1060. if(!data.error.length) {
  1061. message.success('操作成功!');
  1062. this.signBillCancel()
  1063. } else {
  1064. message.warning(data.error[0].message);
  1065. }
  1066. }.bind(this));
  1067. },
  1068. lookflow(){
  1069. this.setState({
  1070. loading: true,
  1071. lookVisible:true,
  1072. })
  1073. this.state.lookSource=[];
  1074. $.ajax({
  1075. method: "get",
  1076. dataType: "json",
  1077. crossDomain: false,
  1078. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  1079. data: {
  1080. orderNo:this.props.datauser.orderNo,
  1081. },
  1082. success: function (data) {
  1083. let theArr = [];
  1084. if (!data.data) {
  1085. if (data.error && data.error.length) {
  1086. message.warning(data.error[0].message);
  1087. };
  1088. } else {
  1089. for (let i = 0; i < data.data.length; i++) {
  1090. let thisdata = data.data[i];
  1091. theArr.push({
  1092. key: i,
  1093. billNo: thisdata.billNo,
  1094. transactionAmount:thisdata.transactionAmount,
  1095. createTime:thisdata.createTime,
  1096. transactionAmount:thisdata.transactionAmount,
  1097. payerName:thisdata.payerName,
  1098. payeeName:thisdata.payeeName,
  1099. transactionSubject:thisdata.transactionSubject,
  1100. transactionChannel:thisdata.transactionChannel,
  1101. financialPayNo:thisdata.financialPayNo,
  1102. financialPayTime:thisdata.financialPayTime,
  1103. orderNo:thisdata.orderNo,
  1104. departmentName:thisdata.departmentName,
  1105. salesmanName:thisdata.salesmanName,
  1106. financeName:thisdata.financeName,
  1107. confirmSign:thisdata.confirmSign,
  1108. deleteSign:thisdata.deleteSign,
  1109. confirmTime:thisdata.confirmTime
  1110. });
  1111. };
  1112. };
  1113. this.setState({
  1114. lookflowList: theArr,
  1115. });
  1116. }.bind(this),
  1117. }).always(function () {
  1118. this.setState({
  1119. loading: false
  1120. });
  1121. }.bind(this));
  1122. },
  1123. lookCancel(){
  1124. this.setState({
  1125. lookVisible:false
  1126. })
  1127. },
  1128. /* -----变更操作开始----- */
  1129. //新建变更
  1130. addChange(){
  1131. this.setState({
  1132. addChangeState:true,
  1133. stateAdd:1,
  1134. changeRemarks:''
  1135. })
  1136. },
  1137. //产看变更记录
  1138. lookChange(){
  1139. this.setState({
  1140. addChangeState:true,
  1141. stateAdd:0
  1142. })
  1143. this.lookChangeData()
  1144. },
  1145. //查看变更列表修改变更
  1146. modifyChangeCancel(){
  1147. this.setState({
  1148. modifyChangeState:false
  1149. })
  1150. },
  1151. //获取变更记录
  1152. lookChangeData(){
  1153. this.setState({
  1154. loading:true
  1155. });
  1156. $.ajax({
  1157. method: "get",
  1158. dataType: "json",
  1159. crossDomain: false,
  1160. url: globalConfig.context +'/api/admin/order/viewOrderChange',
  1161. data: {
  1162. orderNo:this.props.datauser.orderNo,
  1163. },
  1164. success: function (data) {
  1165. let theArr = [];
  1166. if (!data.data) {
  1167. if (data.error && data.error.length) {
  1168. message.warning(data.error[0].message);
  1169. };
  1170. } else {
  1171. for (let i = 0; i < data.data.length; i++) {
  1172. theArr = data.data;
  1173. };
  1174. };
  1175. this.setState({
  1176. changeHtml: theArr,
  1177. });
  1178. }.bind(this),
  1179. }).always(function () {
  1180. this.setState({
  1181. loading: false
  1182. });
  1183. }.bind(this));
  1184. },
  1185. //添加变更状态
  1186. addChangeCancel(){
  1187. this.setState({
  1188. addChangeState:false
  1189. })
  1190. },
  1191. //新建变更
  1192. subChangeState(e){
  1193. e.preventDefault();
  1194. this.setState({
  1195. loading: true
  1196. });
  1197. $.ajax({
  1198. method: "POST",
  1199. dataType: "json",
  1200. crossDomain: false,
  1201. url: globalConfig.context +'/api/admin/order/addOrderChange' ,
  1202. data: {
  1203. orderNo:this.props.datauser.orderNo,
  1204. changeComment:this.state.changeRemarks
  1205. }
  1206. }).done(function(data) {
  1207. this.setState({
  1208. loading: false
  1209. });
  1210. if(!data.error.length) {
  1211. message.success('保存成功!');
  1212. this.addChangeCancel();
  1213. this.loaduser();
  1214. } else {
  1215. message.warning(data.error[0].message);
  1216. }
  1217. }.bind(this));
  1218. },
  1219. //查看修改变更
  1220. modifyChange(item){
  1221. this.setState({
  1222. modifyChangeState:true,
  1223. changePromoter:item.creater,
  1224. changeTime:item.createTime,
  1225. changeState:item.changeStatus,
  1226. changeRemarks:item.changeComment,
  1227. idt:item.changeId,
  1228. orderNot:item.orderNo
  1229. })
  1230. },
  1231. //删除变更
  1232. modifyDelete(item){
  1233. this.setState({
  1234. loading: true
  1235. });
  1236. $.ajax({
  1237. method: "get",
  1238. dataType: "json",
  1239. crossDomain: false,
  1240. url: globalConfig.context +'/api/admin/order/deleteOrderChange' ,
  1241. data: {
  1242. changeId:item.changeId,
  1243. }
  1244. }).done(function(data) {
  1245. this.setState({
  1246. loading: false
  1247. });
  1248. if(!data.error.length) {
  1249. message.success('删除成功!');
  1250. this.lookChangeData();
  1251. this.loaduser()
  1252. } else {
  1253. message.warning(data.error[0].message);
  1254. }
  1255. }.bind(this));
  1256. },
  1257. //修改变更保存
  1258. changeModify(e){
  1259. e.preventDefault();
  1260. this.setState({
  1261. loading: true
  1262. });
  1263. $.ajax({
  1264. method: "POST",
  1265. dataType: "json",
  1266. crossDomain: false,
  1267. url: globalConfig.context +'/api/admin/order/updateOrderChange' ,
  1268. data: {
  1269. changeId:this.state.idt,
  1270. changeStatus:this.state.changeState,
  1271. changeComment:this.state.changeRemarks
  1272. }
  1273. }).done(function(data) {
  1274. this.setState({
  1275. loading: false
  1276. });
  1277. if(!data.error.length) {
  1278. message.success('保存成功!');
  1279. this.modifyChangeCancel();
  1280. this.lookChangeData();
  1281. this.loaduser()
  1282. } else {
  1283. message.warning(data.error[0].message);
  1284. }
  1285. }.bind(this));
  1286. },
  1287. /*-----变更操作结束----*/
  1288. //查看流失。项目列表
  1289. lookSee(state) {
  1290. this.state.lookSource=[];
  1291. this.setState({
  1292. loading: true
  1293. });
  1294. let api=state?'/api/xiangmu':'/api/liushui'
  1295. $.ajax({
  1296. method: "get",
  1297. dataType: "json",
  1298. crossDomain: false,
  1299. url: globalConfig.context + api,
  1300. data: {
  1301. orderNo:this.props.datauser.orderNo
  1302. },
  1303. success: function (data) {
  1304. let theArr = [];
  1305. if (!data.data) {
  1306. if (data.error && data.error.length) {
  1307. message.warning(data.error[0].message);
  1308. };
  1309. } else {
  1310. for (let i = 0; i < data.data.length; i++) {
  1311. let thisdata = data.data[i];
  1312. theArr.push({
  1313. key: i,
  1314. id:thisdata.id,
  1315. orderNo:thisdata.orderNo,
  1316. commodityName:thisdata.commodityName,
  1317. commodityType:thisdata.commodityType,
  1318. commodityMode:thisdata.commodityMode,
  1319. commodityQuantity:thisdata.commodityQuantity,
  1320. commodityPrice:thisdata.commodityPrice,
  1321. discountPrice:thisdata.discountPrice,
  1322. commodityFirstPayment:thisdata.commodityFirstPayment,
  1323. createTimes:thisdata.createTimes,
  1324. remarks:thisdata.remarks,
  1325. });
  1326. };
  1327. }
  1328. this.setState({
  1329. lookSource: theArr,
  1330. });
  1331. }.bind(this),
  1332. }).always(function () {
  1333. this.setState({
  1334. loading: false
  1335. });
  1336. }.bind(this));
  1337. },
  1338. //开单选择订单类型骚操作
  1339. orderTypeFn(e){
  1340. if(e==0){
  1341. this.setState({
  1342. bussStats:true,
  1343. orderType:e
  1344. })
  1345. this.category();
  1346. }else{
  1347. this.setState({
  1348. contractType:undefined,
  1349. bussStats:false,
  1350. orderType:e
  1351. })
  1352. }
  1353. },
  1354. //品类数据获取
  1355. category(){
  1356. $.ajax({
  1357. method: "get",
  1358. dataType: "json",
  1359. crossDomain: false,
  1360. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1361. data: {
  1362. },
  1363. success: function(data) {
  1364. let thedata = data.data;
  1365. let theArr=[];
  1366. if(!thedata) {
  1367. if(data.error && data.error.length) {
  1368. message.warning(data.error[0].message);
  1369. };
  1370. thedata = {};
  1371. }else{
  1372. thedata.map(function(item,index){
  1373. theArr.push({
  1374. key:index,
  1375. name:item.cname,
  1376. id:item.id,
  1377. })
  1378. })
  1379. }
  1380. this.setState({
  1381. contractType:undefined,
  1382. categoryArr:theArr,
  1383. })
  1384. }.bind(this),
  1385. });
  1386. },
  1387. componentWillReceiveProps(nextProps) { //props改变时触发
  1388. this.state.visible = nextProps.showDesc;
  1389. this.state.signBillVisible=nextProps.signBillVisible;
  1390. if(this.state.signBillVisible){
  1391. this.loaduser(nextProps.uid)
  1392. };
  1393. if(nextProps.userDetaile && nextProps.showDesc) {
  1394. this.loaduser(nextProps.datauser);
  1395. this.loaduserss(nextProps.datauser);
  1396. this.loadData(nextProps.datauser);
  1397. }else{
  1398. this.setState({
  1399. orderType:undefined,
  1400. customerName:'',
  1401. autoId:'',
  1402. customerArr:[],
  1403. contractType:undefined,
  1404. bussStats:false,
  1405. customType:undefined
  1406. })
  1407. }
  1408. },
  1409. render() {
  1410. const FormItem = Form.Item
  1411. const formItemLayout = {
  1412. labelCol: { span: 8 },
  1413. wrapperCol: { span: 14 },
  1414. };
  1415. const changeHtml=this.state.changeHtml ||[];
  1416. const categoryList=this.state.categoryArr ||[];
  1417. const orderDetaiel=this.state.orderList || [];
  1418. const dataSources=this.state.customerArr || [];
  1419. const options = this.state.states?dataSources.map((group,index) =>
  1420. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  1421. ):dataSources.map((group,index) =>
  1422. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  1423. )
  1424. return(
  1425. <div>
  1426. <Modal maskClosable={false} visible={this.state.visible}
  1427. onOk={this.handleOk} onCancel={this.handleCancel}
  1428. width={!this.props.userDetaile?'600px':'900px'}
  1429. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  1430. footer=''
  1431. className="admin-desc-content">
  1432. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  1433. <Spin spinning={this.state.loading}>
  1434. <div className="clearfix">
  1435. {!this.props.userDetaile?
  1436. <div className="clearfix">
  1437. <div className="clearfix">
  1438. <FormItem
  1439. {...formItemLayout}
  1440. label="订单类型" >
  1441. <Select placeholder="请选择订单类型"
  1442. style={{ width:'200px'}}
  1443. value={this.state.orderType}
  1444. onChange={(e)=>{this.setState({orderType:e})}}>
  1445. {
  1446. orderTypes.map(function (item) {
  1447. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1448. })
  1449. }
  1450. </Select>
  1451. <span className="mandatory">*</span>
  1452. </FormItem>
  1453. </div>
  1454. <FormItem
  1455. {...formItemLayout}
  1456. label="客户所属类型" >
  1457. <Select placeholder="请选择客户所属类型"
  1458. style={{ width:'200px'}}
  1459. value={this.state.customType}
  1460. onChange={(e)=>{this.setState({customType:e})}}>
  1461. {
  1462. customerType.map(function (item) {
  1463. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1464. })
  1465. }
  1466. </Select>
  1467. </FormItem>
  1468. <div className="clearfix">
  1469. <FormItem
  1470. {...formItemLayout}
  1471. label="客户名称" >
  1472. <AutoComplete
  1473. className="certain-category-search"
  1474. dropdownClassName="certain-category-search-dropdown"
  1475. dropdownMatchSelectWidth={false}
  1476. dropdownStyle={{ width: 200 }}
  1477. size="large"
  1478. style={{ width: '200px' }}
  1479. dataSource={options}
  1480. placeholder="输入名称"
  1481. value={this.state.customerName}
  1482. onChange={this.customerChange}
  1483. filterOption={true}
  1484. onSelect={this.selectAutoCUT}
  1485. >
  1486. <Input/>
  1487. </AutoComplete>
  1488. <span className="mandatory">*</span>
  1489. </FormItem>
  1490. </div>
  1491. <div className='addSave' style={{marginTop:'15px'}}>
  1492. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1493. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1494. </div>
  1495. </div>
  1496. :<div className="clearfix">
  1497. <FormItem className="half-item"
  1498. {...formItemLayout}
  1499. label="订单编号" >
  1500. <span>{this.state.orderNo}</span>
  1501. </FormItem>
  1502. <FormItem className="half-item"
  1503. {...formItemLayout}
  1504. label="合同编号" >
  1505. <Input placeholder="请输入合同编号" value={this.state.contractNo}
  1506. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />
  1507. </FormItem>
  1508. <FormItem className="half-item"
  1509. {...formItemLayout}
  1510. label="客户名称" >
  1511. <span>{this.state.userName}</span>
  1512. </FormItem>
  1513. <FormItem className="half-item"
  1514. {...formItemLayout}
  1515. label="流程状态" >
  1516. <span>{getProcessStatus(this.state.processStatus)}</span>
  1517. </FormItem>
  1518. <FormItem className="half-item"
  1519. {...formItemLayout}
  1520. label="结算状态" >
  1521. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1522. </FormItem>
  1523. <FormItem className="half-item"
  1524. {...formItemLayout}
  1525. label="已收款项" >
  1526. <span>{this.state.settlementAmount+'万元'}</span>
  1527. </FormItem>
  1528. <FormItem className="half-item"
  1529. {...formItemLayout}
  1530. label="企业联系人" >
  1531. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1532. <span className="mandatory">*</span>
  1533. </FormItem>
  1534. <FormItem className="half-item"
  1535. {...formItemLayout}
  1536. label="联系人电话" >
  1537. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1538. <span className="mandatory">*</span>
  1539. </FormItem>
  1540. <FormItem className="half-item"
  1541. {...formItemLayout}
  1542. label="企业法人" >
  1543. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1544. </FormItem>
  1545. <FormItem className="half-item"
  1546. {...formItemLayout}
  1547. label="法人电话" >
  1548. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1549. </FormItem>
  1550. <div className='clearfix'>
  1551. <FormItem className="half-item"
  1552. {...formItemLayout}
  1553. label="签单金额(万元)" >
  1554. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1555. <span className="mandatory">*</span>
  1556. </FormItem>
  1557. <FormItem className="half-item"
  1558. {...formItemLayout}
  1559. label="首付金额(万元)" >
  1560. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1561. <span className="mandatory">*</span>
  1562. </FormItem>
  1563. <FormItem className="half-item"
  1564. {...formItemLayout}
  1565. label="特批立项" >
  1566. <Select placeholder="请选择客户所属类型"
  1567. style={{ width:'240px'}}
  1568. value={this.state.approval}
  1569. onChange={(e)=>{this.setState({approval:e})}}>
  1570. {
  1571. tepi.map(function (item) {
  1572. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1573. })
  1574. }
  1575. </Select>
  1576. </FormItem>
  1577. <FormItem className="half-item"
  1578. {...formItemLayout}
  1579. label="合同签订时间" >
  1580. <DatePicker
  1581. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1582. showTime
  1583. format="YYYY-MM-DD"
  1584. placeholder="合同签订时间"
  1585. value={this.state.signDate}
  1586. onChange={(e,time)=>{this.selTime(e,time)}}
  1587. />
  1588. <span className="mandatory">*</span>
  1589. </FormItem>
  1590. <div className='clearfix'>
  1591. <FormItem
  1592. labelCol={{ span: 4 }}
  1593. wrapperCol={{ span: 18 }}
  1594. label={
  1595. <span>
  1596. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1597. </span>
  1598. }
  1599. >
  1600. <PicturesWall
  1601. fileList={this.getOrgCodeUrl}
  1602. pictureUrl={this.state.orgCodeUrl} />
  1603. <p>图片建议:要清晰。</p>
  1604. </FormItem>
  1605. </div>
  1606. <div className='clearfix'>
  1607. <FormItem
  1608. labelCol={{ span: 4 }}
  1609. wrapperCol={{ span: 16 }}
  1610. label="订单留言" >
  1611. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1612. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1613. </FormItem>
  1614. </div>
  1615. </div>
  1616. <div className='clearfix'>
  1617. <FormItem className="half-item"
  1618. {...formItemLayout}
  1619. label="订单负责人" >
  1620. <span>{this.state.salesmanName}</span>
  1621. </FormItem>
  1622. <FormItem className="half-item"
  1623. {...formItemLayout}
  1624. label="订单负责人电话" >
  1625. <span>{orderDetaiel.projectType}</span>
  1626. </FormItem>
  1627. </div>
  1628. <div className='clearfix'>
  1629. <FormItem className="half-item"
  1630. {...formItemLayout}
  1631. label="财务负责人" >
  1632. <span>{this.state.financeName}</span>
  1633. </FormItem>
  1634. <FormItem className="half-item"
  1635. {...formItemLayout}
  1636. label="财务负责人电话" >
  1637. <span>{orderDetaiel.projectType}</span>
  1638. </FormItem>
  1639. </div>
  1640. <div>
  1641. <span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
  1642. {this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
  1643. </div>
  1644. <div className="clearfix">
  1645. <Spin spinning={this.state.loading}>
  1646. <Form layout="horizontal" id="demand-form" >
  1647. <Table
  1648. pagination={false}
  1649. columns={this.state.ContactsLists}
  1650. dataSource={this.state.contactList}
  1651. />
  1652. <Col span={24} offset={9} style={{marginTop:'15px'}}>
  1653. </Col>
  1654. </Form>
  1655. </Spin>
  1656. </div>
  1657. <div>
  1658. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1659. {this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
  1660. </div>
  1661. <div className="patent-table">
  1662. <Spin spinning={this.state.loading}>
  1663. <Table columns={this.state.columns}
  1664. dataSource={this.state.dataSource}
  1665. pagination={this.state.pagination}
  1666. onRowClick={this.tableRowClick}
  1667. />
  1668. </Spin>
  1669. </div>
  1670. {this.state.processStatus==0?
  1671. <div className='addSave' style={{marginTop:'15px'}}>
  1672. <Button className="cancel" type="primary" onClick={this.handleCancels} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1673. <Button className="cancel" type="primary" onClick={this.handleCancelq} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1674. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1675. </div>:""}
  1676. </div>}
  1677. </div>
  1678. </Spin>
  1679. </Form >
  1680. </Modal>
  1681. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1682. onOk={this.nextCancel} onCancel={this.nextCancel}
  1683. width='800px'
  1684. title={this.state.addState?'添加项目任务':'项目任务详情'}
  1685. footer=''
  1686. className="admin-desc-content">
  1687. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1688. <Spin spinning={this.state.loading}>
  1689. {this.state.addState?<div className="clearfix">
  1690. <FormItem className="half-item"
  1691. {...formItemLayout}
  1692. label="服务名称" >
  1693. <AutoComplete
  1694. className="certain-category-search"
  1695. dropdownClassName="certain-category-search-dropdown"
  1696. dropdownMatchSelectWidth={false}
  1697. dropdownStyle={{ width: 200 }}
  1698. style={{ width: '200px' }}
  1699. dataSource={options}
  1700. placeholder="输入服务名称"
  1701. value={this.state.commodityName}
  1702. onChange={this.httpChange}
  1703. filterOption={true}
  1704. onSelect={this.selectAuto}
  1705. >
  1706. <Input/>
  1707. </AutoComplete>
  1708. <span className="mandatory">*</span>
  1709. </FormItem>
  1710. <FormItem className="half-item"
  1711. {...formItemLayout}
  1712. label="服务数量" >
  1713. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1714. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1715. <span className="mandatory">*</span>
  1716. </FormItem>
  1717. <FormItem className="half-item"
  1718. {...formItemLayout}
  1719. label="实签价格(万元)" >
  1720. <Input placeholder="请输入实签价格" value={this.state.commodityPrice} style={{width:'200px'}}
  1721. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} ref="commodityPrice"/>
  1722. <span className="mandatory">*</span>
  1723. </FormItem>
  1724. <FormItem className="half-item"
  1725. {...formItemLayout}
  1726. label="主要业务" >
  1727. <Select placeholder="选择是否为主要业务"
  1728. style={{ width:'200px'}}
  1729. value={this.state.main}
  1730. onChange={(e)=>{this.setState({main:e})}}>
  1731. {
  1732. boutique.map(function (item) {
  1733. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1734. })
  1735. }
  1736. </Select>
  1737. <span className="mandatory">*</span>
  1738. </FormItem>
  1739. <div className='clearfix'>
  1740. <FormItem
  1741. labelCol={{ span: 4 }}
  1742. wrapperCol={{ span: 16 }}
  1743. label="服务说明" >
  1744. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1745. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1746. </FormItem>
  1747. </div>
  1748. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1749. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1750. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1751. </FormItem>
  1752. </div>:
  1753. <div className='clearfix'>
  1754. <FormItem className="half-item"
  1755. {...formItemLayout}
  1756. label="项目名称" >
  1757. <span>{this.state.commodityName}</span>
  1758. </FormItem>
  1759. <FormItem className="half-item"
  1760. {...formItemLayout}
  1761. label="项目数量" >
  1762. <Input placeholder="请输入数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1763. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} />
  1764. <span className="mandatory">*</span>
  1765. </FormItem>
  1766. <FormItem className="half-item"
  1767. {...formItemLayout}
  1768. label="金额(万元)" >
  1769. <Input placeholder="请输入签单金额" value={this.state.commodityPrice} style={{width:'200px'}}
  1770. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} />
  1771. <span className="mandatory">*</span>
  1772. </FormItem>
  1773. <FormItem className="half-item"
  1774. {...formItemLayout}
  1775. label="主要项目" >
  1776. <Select placeholder="选择是否为主要业务"
  1777. style={{ width:'200px'}}
  1778. value={this.state.main}
  1779. onChange={(e)=>{this.setState({main:e})}}>
  1780. {
  1781. boutique.map(function (item) {
  1782. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1783. })
  1784. }
  1785. </Select>
  1786. <span className="mandatory">*</span>
  1787. </FormItem>
  1788. <div className='clearfix'>
  1789. <FormItem
  1790. labelCol={{ span: 4 }}
  1791. wrapperCol={{ span: 16 }}
  1792. label="服务说明" >
  1793. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1794. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1795. </FormItem>
  1796. </div>
  1797. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1798. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1799. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1800. </FormItem>
  1801. </div>}
  1802. </Spin>
  1803. </Form >
  1804. </Modal>
  1805. <Modal maskClosable={false} visible={this.state.signBillVisible}
  1806. onOk={this.signBillOk} onCancel={this.signBillOk}
  1807. width='800px'
  1808. title='签单信息'
  1809. footer=''
  1810. className="admin-desc-content">
  1811. <Form layout="horizontal" onSubmit={this.signOk} id="demand-form">
  1812. <Spin spinning={this.state.loading}>
  1813. <div className="clearfix">
  1814. <FormItem className="half-item"
  1815. {...formItemLayout}
  1816. label="订单编号" >
  1817. <span>{this.state.orderNo}</span>
  1818. </FormItem>
  1819. <FormItem className="half-item"
  1820. {...formItemLayout}
  1821. label="客户名称" >
  1822. <span>{this.state.buyerName}</span>
  1823. </FormItem>
  1824. <FormItem className="half-item"
  1825. {...formItemLayout}
  1826. label="实签款项(万元)" >
  1827. <Input placeholder="请输入实签款项" value={this.state.signTotalAmount} style={{width:'200px'}}
  1828. onChange={(e)=>{this.setState({signTotalAmount:e.target.value})}} />
  1829. <span className="mandatory">*</span>
  1830. </FormItem>
  1831. <FormItem className="half-item"
  1832. {...formItemLayout}
  1833. label="实签首款(万元)" >
  1834. <Input placeholder="请输入实签首款" value={this.state.signFirstPayment} style={{width:'200px'}}
  1835. onChange={(e)=>{this.setState({signFirstPayment:e.target.value})}} />
  1836. <span className="mandatory">*</span>
  1837. </FormItem>
  1838. <FormItem className="half-item"
  1839. {...formItemLayout}
  1840. label="特批立项" >
  1841. <Select placeholder="选择特批立项类型"
  1842. style={{ width:'200px'}}
  1843. value={this.state.approval}
  1844. onChange={(e) => { this.setState({ approval: e }) }}>
  1845. <Select.Option value='0'>不申请特批</Select.Option>
  1846. <Select.Option value='1'>申请特批</Select.Option>
  1847. </Select>
  1848. <span className="mandatory">*</span>
  1849. </FormItem>
  1850. <FormItem className="half-item"
  1851. {...formItemLayout}
  1852. label="合同编号" >
  1853. <Input placeholder="请输入合同编号" value={this.state.contractNo}
  1854. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'200px'}} />
  1855. <span className="mandatory">*</span>
  1856. </FormItem>
  1857. <div className='clearfix'>
  1858. <FormItem
  1859. labelCol={{ span: 4 }}
  1860. wrapperCol={{ span: 16 }}
  1861. label="签单备注" >
  1862. <Input type="textarea" placeholder="请输入签单备注" rows={4} value={this.state.orderRemarks}
  1863. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1864. </FormItem>
  1865. </div>
  1866. <div className='clearfix'>
  1867. <FormItem
  1868. labelCol={{ span: 4 }}
  1869. wrapperCol={{ span: 18 }}
  1870. label="合同扫描件" >
  1871. <PicturesWall
  1872. listType="picture-card"
  1873. fileList={this.getOrgCodeUrl}
  1874. pictureUrl={this.state.orgCodeUrl} />
  1875. <p>图片建议:要清晰。</p>
  1876. </FormItem>
  1877. </div>
  1878. </div>
  1879. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1880. <Button className="submitSave" type="primary" htmlType="submit">确定签单</Button>
  1881. <Button className="submitSave" type="ghost" onClick={this.signBillOk}>返回</Button>
  1882. </FormItem>
  1883. </Spin>
  1884. </Form >
  1885. </Modal>
  1886. <Modal maskClosable={false} visible={this.state.signVisible}
  1887. onOk={this.signBittOk} onCancel={this.signBittOk}
  1888. width='600px'
  1889. title='签单信息'
  1890. footer=''
  1891. className="admin-desc-content">
  1892. <Form layout="horizontal" onSubmit={this.signSub} id="demand-form">
  1893. <Spin spinning={this.state.loading}>
  1894. <div className="clearfix">
  1895. <FormItem
  1896. {...formItemLayout}
  1897. label="特批立项" >
  1898. <Select placeholder="选择特批立项类型"
  1899. style={{ width:'200px'}}
  1900. value={this.state.approval}
  1901. onChange={(e) => { this.setState({ approval: e }) }}>
  1902. <Select.Option value='0'>不申请特批</Select.Option>
  1903. <Select.Option value='1'>申请特批</Select.Option>
  1904. </Select>
  1905. <span className="mandatory">*</span>
  1906. </FormItem>
  1907. </div>
  1908. <div className="clearfix">
  1909. <FormItem
  1910. {...formItemLayout}
  1911. label="签单时间" >
  1912. <DatePicker
  1913. style={{marginTop:"2px"}}
  1914. showTime
  1915. format="YYYY-MM-DD"
  1916. placeholder="选择签单时间"
  1917. value={this.state.entryTime}
  1918. onChange={(e,time)=>{this.selTime(e,time)}}
  1919. />
  1920. <span className="mandatory">*</span>
  1921. </FormItem>
  1922. </div>
  1923. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1924. <Button className="submitSave" type="primary" htmlType="submit">确定签单</Button>
  1925. <Button className="submitSave" type="ghost" onClick={this.signBittOk}>返回</Button>
  1926. </FormItem>
  1927. </Spin>
  1928. </Form >
  1929. </Modal>
  1930. <Modal maskClosable={false} visible={this.state.lookVisible}
  1931. onOk={this.lookCancel} onCancel={this.lookCancel}
  1932. width='1300px'
  1933. title= '查看流水'
  1934. footer=''
  1935. className="admin-desc-content">
  1936. <Form layout="horizontal" id="demand-form">
  1937. <Spin spinning={this.state.loading}>
  1938. <div className="clearfix">
  1939. <Table columns={this.state.flowList}
  1940. dataSource={this.state.lookflowList}
  1941. pagination={false}
  1942. />
  1943. </div>
  1944. </Spin>
  1945. </Form >
  1946. </Modal>
  1947. <Modal maskClosable={false} visible={this.state.addChangeState}
  1948. onOk={this.addChangeCancel} onCancel={this.addChangeCancel}
  1949. width='800px'
  1950. title= {this.state.stateAdd?'添加变更':'查看变更记录'}
  1951. footer=''
  1952. className="admin-desc-content">
  1953. <Form layout="horizontal" id="demand-form">
  1954. <Spin spinning={this.state.loading}>
  1955. <div className="clearfix">
  1956. {this.state.stateAdd?<div className="clearfix">
  1957. <FormItem
  1958. labelCol={{ span: 4 }}
  1959. wrapperCol={{ span: 16 }}
  1960. label="变更说明" >
  1961. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  1962. onChange={(e)=>{this.setState({changeRemarks:e.target.value})}}/>
  1963. </FormItem>
  1964. <div className="clearfix">
  1965. <Button type="primary" onClick={this.subChangeState} style={{margin:"10px 50px 10px 128px"}}>保存</Button>
  1966. <Button onClick={this.addChangeCancel}>取消</Button>
  1967. </div>
  1968. </div>:
  1969. <div>
  1970. {
  1971. changeHtml.length?changeHtml.map(function(item,index){
  1972. return (<div className="changeBorder" key={index}>
  1973. <FormItem className="half-item"
  1974. {...formItemLayout}
  1975. label="变更发起人" >
  1976. <span>{item.creater}</span>
  1977. </FormItem>
  1978. <FormItem className="half-item"
  1979. {...formItemLayout}
  1980. label="变更申请时间" >
  1981. <span>{item.createTime}</span>
  1982. </FormItem>
  1983. <div className='clearfix'>
  1984. <FormItem className="half-item"
  1985. {...formItemLayout}
  1986. label="变更状态" >
  1987. <span>{getChangeState(item.changeStatus)}</span>
  1988. </FormItem>
  1989. <FormItem className="half-item"
  1990. {...formItemLayout}
  1991. label="变更操作" >
  1992. <Button onClick={(e)=>{this.modifyChange(item)}}>修改</Button>
  1993. {/*<Button type="danger" onClick={(e)=>{this.modifyDelete(item)}}>删除</Button>*/}
  1994. </FormItem>
  1995. </div>
  1996. <div className='clearfix changeRemark'>
  1997. <FormItem
  1998. labelCol={{ span: 4 }}
  1999. wrapperCol={{ span: 16 }}
  2000. label="变更说明" >
  2001. <p>{item.changeComment}</p>
  2002. </FormItem>
  2003. </div>
  2004. </div>)
  2005. },this):<p style={{textAlign:"center"}}>暂无变更记录</p>}
  2006. </div>
  2007. }
  2008. </div>
  2009. </Spin>
  2010. </Form >
  2011. </Modal>
  2012. <Modal maskClosable={false} visible={this.state.modifyChangeState}
  2013. onOk={this.modifyChangeCancel} onCancel={this.modifyChangeCancel}
  2014. width='600px'
  2015. title= "修改变更 "
  2016. footer=''
  2017. className="admin-desc-content">
  2018. <Form layout="horizontal" id="demand-form">
  2019. <Spin spinning={this.state.loading}>
  2020. <div className="clearfix">
  2021. <div className="clearfix">
  2022. <FormItem className="half-item"
  2023. {...formItemLayout}
  2024. label="变更发起人" >
  2025. <span>{this.state.changePromoter}</span>
  2026. </FormItem>
  2027. <FormItem className="half-item"
  2028. {...formItemLayout}
  2029. label="变更申请时间" >
  2030. <span>{this.state.changeTime}</span>
  2031. </FormItem>
  2032. <div className='clearfix'>
  2033. <FormItem
  2034. labelCol={{ span: 4 }}
  2035. wrapperCol={{ span: 16 }}
  2036. label="变更状态" >
  2037. <Radio.Group onChange={(e)=>{this.setState({changeState:e.target.value})}} value={this.state.changeState}>
  2038. <Radio value={1}>变更中</Radio>
  2039. <Radio value={2}>变更完成</Radio>
  2040. </Radio.Group>
  2041. </FormItem>
  2042. </div>
  2043. <div className='clearfix'>
  2044. <FormItem
  2045. labelCol={{ span: 4 }}
  2046. wrapperCol={{ span: 16 }}
  2047. label="变更说明" >
  2048. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  2049. onChange={(e)=>{this.setState({changeRemarks:e.target.value})}}/>
  2050. </FormItem>
  2051. </div>
  2052. <div className="clearfix">
  2053. <Button type="primary" onClick={this.changeModify} style={{margin:"10px 95px"}}>保存</Button>
  2054. <Button onClick={this.modifyChangeCancel}>取消</Button>
  2055. </div>
  2056. </div>
  2057. </div>
  2058. </Spin>
  2059. </Form >
  2060. </Modal>
  2061. </div>
  2062. )
  2063. }
  2064. }));
  2065. export default NewService;