addService.jsx 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085
  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.selTime,//签单日期
  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. signDate:e,
  947. selTime:index
  948. })
  949. },
  950. signSub(e){
  951. e.preventDefault();
  952. if(!this.state.selTime){
  953. message.warning("请选择签单时间!");
  954. return false;
  955. };
  956. let theorgCodeUrl = [];
  957. if (this.state.orgCodeUrl.length) {
  958. let picArr = [];
  959. this.state.orgCodeUrl.map(function (item) {
  960. if ( item.response && item.response.data && item.response.data.length ){
  961. picArr.push(item.response.data);
  962. }
  963. });
  964. theorgCodeUrl = picArr.join(",");
  965. };
  966. this.setState({
  967. loading: true
  968. });
  969. let dataList=this.state.dataSource,
  970. idsList=[];
  971. dataList.map((item,index) => {
  972. console.log(item);
  973. console.log(this.state.commodityId);
  974. idsList.push({
  975. businessId:'',
  976. businessProjectId:item.commodityId,
  977. customerStatus:"1",
  978. followSituation:"5",
  979. remarks:"签单-自动触发"
  980. })
  981. })
  982. $.ajax({
  983. method: "POST",
  984. dataType: "json",
  985. crossDomain: false,
  986. url: globalConfig.context +'/api/admin/order/signServiceOrder' ,
  987. data: {
  988. userBusinessList: JSON.stringify(idsList),
  989. uid:this.state.buyerId,
  990. orderNo:this.props.datauser.orderNo,
  991. signTotalAmount:this.state.signTotalAmount,
  992. signFirstPayment:this.state.signFirstPayment,
  993. approval:this.state.approval,
  994. orderRemarks:this.state.orderRemarks,
  995. contractNo:this.state.contractNo,
  996. signTime:this.state.selTime,
  997. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  998. }
  999. }).done(function(data) {
  1000. this.setState({
  1001. loading: false
  1002. });
  1003. if(!data.error.length) {
  1004. message.success('操作成功!');
  1005. this.signBillCancel()
  1006. } else {
  1007. message.warning(data.error[0].message);
  1008. }
  1009. }.bind(this));
  1010. },
  1011. //签单保存与暂存函数
  1012. temporarySave(e){
  1013. if(!this.state.signTotalAmount){
  1014. message.warning('实签款项不能为空!')
  1015. return false;
  1016. };
  1017. if(!this.state.signTotalAmount){
  1018. message.warning('实签首款不能为空!')
  1019. return false;
  1020. };
  1021. if(this.state.approval==undefined){
  1022. message.warning('实签首款不能为空!')
  1023. return false;
  1024. };
  1025. if(!this.state.contractNo){
  1026. message.warning("请输入合同编号!");
  1027. return false;
  1028. }
  1029. this.setState({
  1030. loading: true
  1031. });
  1032. let theorgCodeUrl = [];
  1033. if (this.state.orgCodeUrl.length) {
  1034. let picArr = [];
  1035. this.state.orgCodeUrl.map(function (item) {
  1036. if ( item.response && item.response.data && item.response.data.length ){
  1037. picArr.push(item.response.data);
  1038. }
  1039. });
  1040. theorgCodeUrl = picArr.join(",");
  1041. };
  1042. let api=e?'/api/admin/order/updateServiceOrder':'/api/admin/order/signServiceOrder';
  1043. $.ajax({
  1044. method: "POST",
  1045. dataType: "json",
  1046. crossDomain: false,
  1047. url: globalConfig.context +api ,
  1048. data: {
  1049. orderNo:this.props.uid?this.props.uid.orderNo:this.props.datauser.orderNo,
  1050. signTotalAmount:this.state.signTotalAmount,
  1051. signFirstPayment:this.state.signFirstPayment,
  1052. approval:this.state.approval,
  1053. orderRemarks:this.state.orderRemarks,
  1054. contractNo:this.state.contractNo,
  1055. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  1056. }
  1057. }).done(function(data) {
  1058. this.setState({
  1059. loading: false
  1060. });
  1061. if(!data.error.length) {
  1062. message.success('操作成功!');
  1063. this.signBillCancel()
  1064. } else {
  1065. message.warning(data.error[0].message);
  1066. }
  1067. }.bind(this));
  1068. },
  1069. lookflow(){
  1070. this.setState({
  1071. loading: true,
  1072. lookVisible:true,
  1073. })
  1074. this.state.lookSource=[];
  1075. $.ajax({
  1076. method: "get",
  1077. dataType: "json",
  1078. crossDomain: false,
  1079. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  1080. data: {
  1081. orderNo:this.props.datauser.orderNo,
  1082. },
  1083. success: function (data) {
  1084. let theArr = [];
  1085. if (!data.data) {
  1086. if (data.error && data.error.length) {
  1087. message.warning(data.error[0].message);
  1088. };
  1089. } else {
  1090. for (let i = 0; i < data.data.length; i++) {
  1091. let thisdata = data.data[i];
  1092. theArr.push({
  1093. key: i,
  1094. billNo: thisdata.billNo,
  1095. transactionAmount:thisdata.transactionAmount,
  1096. createTime:thisdata.createTime,
  1097. transactionAmount:thisdata.transactionAmount,
  1098. payerName:thisdata.payerName,
  1099. payeeName:thisdata.payeeName,
  1100. transactionSubject:thisdata.transactionSubject,
  1101. transactionChannel:thisdata.transactionChannel,
  1102. financialPayNo:thisdata.financialPayNo,
  1103. financialPayTime:thisdata.financialPayTime,
  1104. orderNo:thisdata.orderNo,
  1105. departmentName:thisdata.departmentName,
  1106. salesmanName:thisdata.salesmanName,
  1107. financeName:thisdata.financeName,
  1108. confirmSign:thisdata.confirmSign,
  1109. deleteSign:thisdata.deleteSign,
  1110. confirmTime:thisdata.confirmTime
  1111. });
  1112. };
  1113. };
  1114. this.setState({
  1115. lookflowList: theArr,
  1116. });
  1117. }.bind(this),
  1118. }).always(function () {
  1119. this.setState({
  1120. loading: false
  1121. });
  1122. }.bind(this));
  1123. },
  1124. lookCancel(){
  1125. this.setState({
  1126. lookVisible:false
  1127. })
  1128. },
  1129. /* -----变更操作开始----- */
  1130. //新建变更
  1131. addChange(){
  1132. this.setState({
  1133. addChangeState:true,
  1134. stateAdd:1,
  1135. changeRemarks:''
  1136. })
  1137. },
  1138. //产看变更记录
  1139. lookChange(){
  1140. this.setState({
  1141. addChangeState:true,
  1142. stateAdd:0
  1143. })
  1144. this.lookChangeData()
  1145. },
  1146. //查看变更列表修改变更
  1147. modifyChangeCancel(){
  1148. this.setState({
  1149. modifyChangeState:false
  1150. })
  1151. },
  1152. //获取变更记录
  1153. lookChangeData(){
  1154. this.setState({
  1155. loading:true
  1156. });
  1157. $.ajax({
  1158. method: "get",
  1159. dataType: "json",
  1160. crossDomain: false,
  1161. url: globalConfig.context +'/api/admin/order/viewOrderChange',
  1162. data: {
  1163. orderNo:this.props.datauser.orderNo,
  1164. },
  1165. success: function (data) {
  1166. let theArr = [];
  1167. if (!data.data) {
  1168. if (data.error && data.error.length) {
  1169. message.warning(data.error[0].message);
  1170. };
  1171. } else {
  1172. for (let i = 0; i < data.data.length; i++) {
  1173. theArr = data.data;
  1174. };
  1175. };
  1176. this.setState({
  1177. changeHtml: theArr,
  1178. });
  1179. }.bind(this),
  1180. }).always(function () {
  1181. this.setState({
  1182. loading: false
  1183. });
  1184. }.bind(this));
  1185. },
  1186. //添加变更状态
  1187. addChangeCancel(){
  1188. this.setState({
  1189. addChangeState:false
  1190. })
  1191. },
  1192. //新建变更
  1193. subChangeState(e){
  1194. e.preventDefault();
  1195. this.setState({
  1196. loading: true
  1197. });
  1198. $.ajax({
  1199. method: "POST",
  1200. dataType: "json",
  1201. crossDomain: false,
  1202. url: globalConfig.context +'/api/admin/order/addOrderChange' ,
  1203. data: {
  1204. orderNo:this.props.datauser.orderNo,
  1205. changeComment:this.state.changeRemarks
  1206. }
  1207. }).done(function(data) {
  1208. this.setState({
  1209. loading: false
  1210. });
  1211. if(!data.error.length) {
  1212. message.success('保存成功!');
  1213. this.addChangeCancel();
  1214. this.loaduser();
  1215. } else {
  1216. message.warning(data.error[0].message);
  1217. }
  1218. }.bind(this));
  1219. },
  1220. //查看修改变更
  1221. modifyChange(item){
  1222. this.setState({
  1223. modifyChangeState:true,
  1224. changePromoter:item.creater,
  1225. changeTime:item.createTime,
  1226. changeState:item.changeStatus,
  1227. changeRemarks:item.changeComment,
  1228. idt:item.changeId,
  1229. orderNot:item.orderNo
  1230. })
  1231. },
  1232. //删除变更
  1233. modifyDelete(item){
  1234. this.setState({
  1235. loading: true
  1236. });
  1237. $.ajax({
  1238. method: "get",
  1239. dataType: "json",
  1240. crossDomain: false,
  1241. url: globalConfig.context +'/api/admin/order/deleteOrderChange' ,
  1242. data: {
  1243. changeId:item.changeId,
  1244. }
  1245. }).done(function(data) {
  1246. this.setState({
  1247. loading: false
  1248. });
  1249. if(!data.error.length) {
  1250. message.success('删除成功!');
  1251. this.lookChangeData();
  1252. this.loaduser()
  1253. } else {
  1254. message.warning(data.error[0].message);
  1255. }
  1256. }.bind(this));
  1257. },
  1258. //修改变更保存
  1259. changeModify(e){
  1260. e.preventDefault();
  1261. this.setState({
  1262. loading: true
  1263. });
  1264. $.ajax({
  1265. method: "POST",
  1266. dataType: "json",
  1267. crossDomain: false,
  1268. url: globalConfig.context +'/api/admin/order/updateOrderChange' ,
  1269. data: {
  1270. changeId:this.state.idt,
  1271. changeStatus:this.state.changeState,
  1272. changeComment:this.state.changeRemarks
  1273. }
  1274. }).done(function(data) {
  1275. this.setState({
  1276. loading: false
  1277. });
  1278. if(!data.error.length) {
  1279. message.success('保存成功!');
  1280. this.modifyChangeCancel();
  1281. this.lookChangeData();
  1282. this.loaduser()
  1283. } else {
  1284. message.warning(data.error[0].message);
  1285. }
  1286. }.bind(this));
  1287. },
  1288. /*-----变更操作结束----*/
  1289. //查看流失。项目列表
  1290. lookSee(state) {
  1291. this.state.lookSource=[];
  1292. this.setState({
  1293. loading: true
  1294. });
  1295. let api=state?'/api/xiangmu':'/api/liushui'
  1296. $.ajax({
  1297. method: "get",
  1298. dataType: "json",
  1299. crossDomain: false,
  1300. url: globalConfig.context + api,
  1301. data: {
  1302. orderNo:this.props.datauser.orderNo
  1303. },
  1304. success: function (data) {
  1305. let theArr = [];
  1306. if (!data.data) {
  1307. if (data.error && data.error.length) {
  1308. message.warning(data.error[0].message);
  1309. };
  1310. } else {
  1311. for (let i = 0; i < data.data.length; i++) {
  1312. let thisdata = data.data[i];
  1313. theArr.push({
  1314. key: i,
  1315. id:thisdata.id,
  1316. orderNo:thisdata.orderNo,
  1317. commodityName:thisdata.commodityName,
  1318. commodityType:thisdata.commodityType,
  1319. commodityMode:thisdata.commodityMode,
  1320. commodityQuantity:thisdata.commodityQuantity,
  1321. commodityPrice:thisdata.commodityPrice,
  1322. discountPrice:thisdata.discountPrice,
  1323. commodityFirstPayment:thisdata.commodityFirstPayment,
  1324. createTimes:thisdata.createTimes,
  1325. remarks:thisdata.remarks,
  1326. });
  1327. };
  1328. }
  1329. this.setState({
  1330. lookSource: theArr,
  1331. });
  1332. }.bind(this),
  1333. }).always(function () {
  1334. this.setState({
  1335. loading: false
  1336. });
  1337. }.bind(this));
  1338. },
  1339. //开单选择订单类型骚操作
  1340. orderTypeFn(e){
  1341. if(e==0){
  1342. this.setState({
  1343. bussStats:true,
  1344. orderType:e
  1345. })
  1346. this.category();
  1347. }else{
  1348. this.setState({
  1349. contractType:undefined,
  1350. bussStats:false,
  1351. orderType:e
  1352. })
  1353. }
  1354. },
  1355. //品类数据获取
  1356. category(){
  1357. $.ajax({
  1358. method: "get",
  1359. dataType: "json",
  1360. crossDomain: false,
  1361. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1362. data: {
  1363. },
  1364. success: function(data) {
  1365. let thedata = data.data;
  1366. let theArr=[];
  1367. if(!thedata) {
  1368. if(data.error && data.error.length) {
  1369. message.warning(data.error[0].message);
  1370. };
  1371. thedata = {};
  1372. }else{
  1373. thedata.map(function(item,index){
  1374. theArr.push({
  1375. key:index,
  1376. name:item.cname,
  1377. id:item.id,
  1378. })
  1379. })
  1380. }
  1381. this.setState({
  1382. contractType:undefined,
  1383. categoryArr:theArr,
  1384. })
  1385. }.bind(this),
  1386. });
  1387. },
  1388. componentWillReceiveProps(nextProps) { //props改变时触发
  1389. this.state.visible = nextProps.showDesc;
  1390. this.state.signBillVisible=nextProps.signBillVisible;
  1391. if(this.state.signBillVisible){
  1392. this.loaduser(nextProps.uid)
  1393. };
  1394. if(nextProps.userDetaile && nextProps.showDesc) {
  1395. this.loaduser(nextProps.datauser);
  1396. this.loaduserss(nextProps.datauser);
  1397. this.loadData(nextProps.datauser);
  1398. }else{
  1399. this.setState({
  1400. orderType:undefined,
  1401. customerName:'',
  1402. autoId:'',
  1403. customerArr:[],
  1404. contractType:undefined,
  1405. bussStats:false,
  1406. customType:undefined
  1407. })
  1408. }
  1409. },
  1410. render() {
  1411. const FormItem = Form.Item
  1412. const formItemLayout = {
  1413. labelCol: { span: 8 },
  1414. wrapperCol: { span: 14 },
  1415. };
  1416. const changeHtml=this.state.changeHtml ||[];
  1417. const categoryList=this.state.categoryArr ||[];
  1418. const orderDetaiel=this.state.orderList || [];
  1419. const dataSources=this.state.customerArr || [];
  1420. const options = this.state.states?dataSources.map((group,index) =>
  1421. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  1422. ):dataSources.map((group,index) =>
  1423. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  1424. )
  1425. return(
  1426. <div>
  1427. <Modal maskClosable={false} visible={this.state.visible}
  1428. onOk={this.handleOk} onCancel={this.handleCancel}
  1429. width={!this.props.userDetaile?'600px':'900px'}
  1430. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  1431. footer=''
  1432. className="admin-desc-content">
  1433. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  1434. <Spin spinning={this.state.loading}>
  1435. <div className="clearfix">
  1436. {!this.props.userDetaile?
  1437. <div className="clearfix">
  1438. <div className="clearfix">
  1439. <FormItem
  1440. {...formItemLayout}
  1441. label="订单类型" >
  1442. <Select placeholder="请选择订单类型"
  1443. style={{ width:'200px'}}
  1444. value={this.state.orderType}
  1445. onChange={(e)=>{this.setState({orderType:e})}}>
  1446. {
  1447. orderTypes.map(function (item) {
  1448. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1449. })
  1450. }
  1451. </Select>
  1452. <span className="mandatory">*</span>
  1453. </FormItem>
  1454. </div>
  1455. <FormItem
  1456. {...formItemLayout}
  1457. label="客户所属类型" >
  1458. <Select placeholder="请选择客户所属类型"
  1459. style={{ width:'200px'}}
  1460. value={this.state.customType}
  1461. onChange={(e)=>{this.setState({customType:e})}}>
  1462. {
  1463. customerType.map(function (item) {
  1464. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1465. })
  1466. }
  1467. </Select>
  1468. </FormItem>
  1469. <div className="clearfix">
  1470. <FormItem
  1471. {...formItemLayout}
  1472. label="客户名称" >
  1473. <AutoComplete
  1474. className="certain-category-search"
  1475. dropdownClassName="certain-category-search-dropdown"
  1476. dropdownMatchSelectWidth={false}
  1477. dropdownStyle={{ width: 200 }}
  1478. size="large"
  1479. style={{ width: '200px' }}
  1480. dataSource={options}
  1481. placeholder="输入名称"
  1482. value={this.state.customerName}
  1483. onChange={this.customerChange}
  1484. filterOption={true}
  1485. onSelect={this.selectAutoCUT}
  1486. >
  1487. <Input/>
  1488. </AutoComplete>
  1489. <span className="mandatory">*</span>
  1490. </FormItem>
  1491. </div>
  1492. <div className='addSave' style={{marginTop:'15px'}}>
  1493. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1494. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1495. </div>
  1496. </div>
  1497. :<div className="clearfix">
  1498. <FormItem className="half-item"
  1499. {...formItemLayout}
  1500. label="订单编号" >
  1501. <span>{this.state.orderNo}</span>
  1502. </FormItem>
  1503. <FormItem className="half-item"
  1504. {...formItemLayout}
  1505. label="合同编号" >
  1506. <Input placeholder="请输入合同编号" value={this.state.contractNo}
  1507. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />
  1508. </FormItem>
  1509. <FormItem className="half-item"
  1510. {...formItemLayout}
  1511. label="客户名称" >
  1512. <span>{this.state.userName}</span>
  1513. </FormItem>
  1514. <FormItem className="half-item"
  1515. {...formItemLayout}
  1516. label="流程状态" >
  1517. <span>{getProcessStatus(this.state.processStatus)}</span>
  1518. </FormItem>
  1519. <FormItem className="half-item"
  1520. {...formItemLayout}
  1521. label="结算状态" >
  1522. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1523. </FormItem>
  1524. <FormItem className="half-item"
  1525. {...formItemLayout}
  1526. label="已收款项" >
  1527. <span>{this.state.settlementAmount+'万元'}</span>
  1528. </FormItem>
  1529. <FormItem className="half-item"
  1530. {...formItemLayout}
  1531. label="企业联系人" >
  1532. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1533. <span className="mandatory">*</span>
  1534. </FormItem>
  1535. <FormItem className="half-item"
  1536. {...formItemLayout}
  1537. label="联系人电话" >
  1538. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1539. <span className="mandatory">*</span>
  1540. </FormItem>
  1541. <FormItem className="half-item"
  1542. {...formItemLayout}
  1543. label="企业法人" >
  1544. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1545. </FormItem>
  1546. <FormItem className="half-item"
  1547. {...formItemLayout}
  1548. label="法人电话" >
  1549. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1550. </FormItem>
  1551. <div className='clearfix'>
  1552. <FormItem className="half-item"
  1553. {...formItemLayout}
  1554. label="签单金额(万元)" >
  1555. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1556. <span className="mandatory">*</span>
  1557. </FormItem>
  1558. <FormItem className="half-item"
  1559. {...formItemLayout}
  1560. label="首付金额(万元)" >
  1561. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1562. <span className="mandatory">*</span>
  1563. </FormItem>
  1564. <FormItem className="half-item"
  1565. {...formItemLayout}
  1566. label="特批立项" >
  1567. <Select placeholder="请选择客户所属类型"
  1568. style={{ width:'240px'}}
  1569. value={this.state.approval}
  1570. onChange={(e)=>{this.setState({approval:e})}}>
  1571. {
  1572. tepi.map(function (item) {
  1573. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1574. })
  1575. }
  1576. </Select>
  1577. </FormItem>
  1578. <FormItem className="half-item"
  1579. {...formItemLayout}
  1580. label="合同签订时间" >
  1581. <DatePicker
  1582. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1583. showTime
  1584. format="YYYY-MM-DD"
  1585. placeholder="合同签订时间"
  1586. value={this.state.signDate}
  1587. onChange={(e,time)=>{this.selTime(e,time)}}
  1588. />
  1589. <span className="mandatory">*</span>
  1590. </FormItem>
  1591. <div className='clearfix'>
  1592. <FormItem
  1593. labelCol={{ span: 4 }}
  1594. wrapperCol={{ span: 18 }}
  1595. label={
  1596. <span>
  1597. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1598. </span>
  1599. }
  1600. >
  1601. <PicturesWall
  1602. fileList={this.getOrgCodeUrl}
  1603. pictureUrl={this.state.orgCodeUrl} />
  1604. <p>图片建议:要清晰。</p>
  1605. </FormItem>
  1606. </div>
  1607. <div className='clearfix'>
  1608. <FormItem
  1609. labelCol={{ span: 4 }}
  1610. wrapperCol={{ span: 16 }}
  1611. label="订单留言" >
  1612. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1613. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1614. </FormItem>
  1615. </div>
  1616. </div>
  1617. <div className='clearfix'>
  1618. <FormItem className="half-item"
  1619. {...formItemLayout}
  1620. label="订单负责人" >
  1621. <span>{this.state.salesmanName}</span>
  1622. </FormItem>
  1623. <FormItem className="half-item"
  1624. {...formItemLayout}
  1625. label="订单负责人电话" >
  1626. <span>{orderDetaiel.projectType}</span>
  1627. </FormItem>
  1628. </div>
  1629. <div className='clearfix'>
  1630. <FormItem className="half-item"
  1631. {...formItemLayout}
  1632. label="财务负责人" >
  1633. <span>{this.state.financeName}</span>
  1634. </FormItem>
  1635. <FormItem className="half-item"
  1636. {...formItemLayout}
  1637. label="财务负责人电话" >
  1638. <span>{orderDetaiel.projectType}</span>
  1639. </FormItem>
  1640. </div>
  1641. <div>
  1642. <span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
  1643. {this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
  1644. </div>
  1645. <div className="clearfix">
  1646. <Spin spinning={this.state.loading}>
  1647. <Form layout="horizontal" id="demand-form" >
  1648. <Table
  1649. pagination={false}
  1650. columns={this.state.ContactsLists}
  1651. dataSource={this.state.contactList}
  1652. />
  1653. <Col span={24} offset={9} style={{marginTop:'15px'}}>
  1654. </Col>
  1655. </Form>
  1656. </Spin>
  1657. </div>
  1658. <div>
  1659. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1660. {this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
  1661. </div>
  1662. <div className="patent-table">
  1663. <Spin spinning={this.state.loading}>
  1664. <Table columns={this.state.columns}
  1665. dataSource={this.state.dataSource}
  1666. pagination={this.state.pagination}
  1667. onRowClick={this.tableRowClick}
  1668. />
  1669. </Spin>
  1670. </div>
  1671. {this.state.processStatus==0?
  1672. <div className='addSave' style={{marginTop:'15px'}}>
  1673. <Button className="cancel" type="primary" onClick={this.handleCancels} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1674. <Button className="cancel" type="primary" onClick={this.handleCancelq} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1675. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1676. </div>:""}
  1677. </div>}
  1678. </div>
  1679. </Spin>
  1680. </Form >
  1681. </Modal>
  1682. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1683. onOk={this.nextCancel} onCancel={this.nextCancel}
  1684. width='800px'
  1685. title={this.state.addState?'添加项目任务':'项目任务详情'}
  1686. footer=''
  1687. className="admin-desc-content">
  1688. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1689. <Spin spinning={this.state.loading}>
  1690. {this.state.addState?<div className="clearfix">
  1691. <FormItem className="half-item"
  1692. {...formItemLayout}
  1693. label="服务名称" >
  1694. <AutoComplete
  1695. className="certain-category-search"
  1696. dropdownClassName="certain-category-search-dropdown"
  1697. dropdownMatchSelectWidth={false}
  1698. dropdownStyle={{ width: 200 }}
  1699. style={{ width: '200px' }}
  1700. dataSource={options}
  1701. placeholder="输入服务名称"
  1702. value={this.state.commodityName}
  1703. onChange={this.httpChange}
  1704. filterOption={true}
  1705. onSelect={this.selectAuto}
  1706. >
  1707. <Input/>
  1708. </AutoComplete>
  1709. <span className="mandatory">*</span>
  1710. </FormItem>
  1711. <FormItem className="half-item"
  1712. {...formItemLayout}
  1713. label="服务数量" >
  1714. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1715. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1716. <span className="mandatory">*</span>
  1717. </FormItem>
  1718. <FormItem className="half-item"
  1719. {...formItemLayout}
  1720. label="实签价格(万元)" >
  1721. <Input placeholder="请输入实签价格" value={this.state.commodityPrice} style={{width:'200px'}}
  1722. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} ref="commodityPrice"/>
  1723. <span className="mandatory">*</span>
  1724. </FormItem>
  1725. <FormItem className="half-item"
  1726. {...formItemLayout}
  1727. label="主要业务" >
  1728. <Select placeholder="选择是否为主要业务"
  1729. style={{ width:'200px'}}
  1730. value={this.state.main}
  1731. onChange={(e)=>{this.setState({main:e})}}>
  1732. {
  1733. boutique.map(function (item) {
  1734. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1735. })
  1736. }
  1737. </Select>
  1738. <span className="mandatory">*</span>
  1739. </FormItem>
  1740. <div className='clearfix'>
  1741. <FormItem
  1742. labelCol={{ span: 4 }}
  1743. wrapperCol={{ span: 16 }}
  1744. label="服务说明" >
  1745. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1746. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1747. </FormItem>
  1748. </div>
  1749. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1750. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1751. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1752. </FormItem>
  1753. </div>:
  1754. <div className='clearfix'>
  1755. <FormItem className="half-item"
  1756. {...formItemLayout}
  1757. label="项目名称" >
  1758. <span>{this.state.commodityName}</span>
  1759. </FormItem>
  1760. <FormItem className="half-item"
  1761. {...formItemLayout}
  1762. label="项目数量" >
  1763. <Input placeholder="请输入数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1764. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} />
  1765. <span className="mandatory">*</span>
  1766. </FormItem>
  1767. <FormItem className="half-item"
  1768. {...formItemLayout}
  1769. label="金额(万元)" >
  1770. <Input placeholder="请输入签单金额" value={this.state.commodityPrice} style={{width:'200px'}}
  1771. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} />
  1772. <span className="mandatory">*</span>
  1773. </FormItem>
  1774. <FormItem className="half-item"
  1775. {...formItemLayout}
  1776. label="主要项目" >
  1777. <Select placeholder="选择是否为主要业务"
  1778. style={{ width:'200px'}}
  1779. value={this.state.main}
  1780. onChange={(e)=>{this.setState({main:e})}}>
  1781. {
  1782. boutique.map(function (item) {
  1783. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1784. })
  1785. }
  1786. </Select>
  1787. <span className="mandatory">*</span>
  1788. </FormItem>
  1789. <div className='clearfix'>
  1790. <FormItem
  1791. labelCol={{ span: 4 }}
  1792. wrapperCol={{ span: 16 }}
  1793. label="服务说明" >
  1794. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1795. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1796. </FormItem>
  1797. </div>
  1798. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1799. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1800. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1801. </FormItem>
  1802. </div>}
  1803. </Spin>
  1804. </Form >
  1805. </Modal>
  1806. <Modal maskClosable={false} visible={this.state.signBillVisible}
  1807. onOk={this.signBillOk} onCancel={this.signBillOk}
  1808. width='800px'
  1809. title='签单信息'
  1810. footer=''
  1811. className="admin-desc-content">
  1812. <Form layout="horizontal" onSubmit={this.signOk} id="demand-form">
  1813. <Spin spinning={this.state.loading}>
  1814. <div className="clearfix">
  1815. <FormItem className="half-item"
  1816. {...formItemLayout}
  1817. label="订单编号" >
  1818. <span>{this.state.orderNo}</span>
  1819. </FormItem>
  1820. <FormItem className="half-item"
  1821. {...formItemLayout}
  1822. label="客户名称" >
  1823. <span>{this.state.buyerName}</span>
  1824. </FormItem>
  1825. <FormItem className="half-item"
  1826. {...formItemLayout}
  1827. label="实签款项(万元)" >
  1828. <Input placeholder="请输入实签款项" value={this.state.signTotalAmount} style={{width:'200px'}}
  1829. onChange={(e)=>{this.setState({signTotalAmount:e.target.value})}} />
  1830. <span className="mandatory">*</span>
  1831. </FormItem>
  1832. <FormItem className="half-item"
  1833. {...formItemLayout}
  1834. label="实签首款(万元)" >
  1835. <Input placeholder="请输入实签首款" value={this.state.signFirstPayment} style={{width:'200px'}}
  1836. onChange={(e)=>{this.setState({signFirstPayment:e.target.value})}} />
  1837. <span className="mandatory">*</span>
  1838. </FormItem>
  1839. <FormItem className="half-item"
  1840. {...formItemLayout}
  1841. label="特批立项" >
  1842. <Select placeholder="选择特批立项类型"
  1843. style={{ width:'200px'}}
  1844. value={this.state.approval}
  1845. onChange={(e) => { this.setState({ approval: e }) }}>
  1846. <Select.Option value='0'>不申请特批</Select.Option>
  1847. <Select.Option value='1'>申请特批</Select.Option>
  1848. </Select>
  1849. <span className="mandatory">*</span>
  1850. </FormItem>
  1851. <FormItem className="half-item"
  1852. {...formItemLayout}
  1853. label="合同编号" >
  1854. <Input placeholder="请输入合同编号" value={this.state.contractNo}
  1855. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'200px'}} />
  1856. <span className="mandatory">*</span>
  1857. </FormItem>
  1858. <div className='clearfix'>
  1859. <FormItem
  1860. labelCol={{ span: 4 }}
  1861. wrapperCol={{ span: 16 }}
  1862. label="签单备注" >
  1863. <Input type="textarea" placeholder="请输入签单备注" rows={4} value={this.state.orderRemarks}
  1864. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1865. </FormItem>
  1866. </div>
  1867. <div className='clearfix'>
  1868. <FormItem
  1869. labelCol={{ span: 4 }}
  1870. wrapperCol={{ span: 18 }}
  1871. label="合同扫描件" >
  1872. <PicturesWall
  1873. listType="picture-card"
  1874. fileList={this.getOrgCodeUrl}
  1875. pictureUrl={this.state.orgCodeUrl} />
  1876. <p>图片建议:要清晰。</p>
  1877. </FormItem>
  1878. </div>
  1879. </div>
  1880. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1881. <Button className="submitSave" type="primary" htmlType="submit">确定签单</Button>
  1882. <Button className="submitSave" type="ghost" onClick={this.signBillOk}>返回</Button>
  1883. </FormItem>
  1884. </Spin>
  1885. </Form >
  1886. </Modal>
  1887. <Modal maskClosable={false} visible={this.state.signVisible}
  1888. onOk={this.signBittOk} onCancel={this.signBittOk}
  1889. width='600px'
  1890. title='签单信息'
  1891. footer=''
  1892. className="admin-desc-content">
  1893. <Form layout="horizontal" onSubmit={this.signSub} id="demand-form">
  1894. <Spin spinning={this.state.loading}>
  1895. <div className="clearfix">
  1896. <FormItem
  1897. {...formItemLayout}
  1898. label="特批立项" >
  1899. <Select placeholder="选择特批立项类型"
  1900. style={{ width:'200px'}}
  1901. value={this.state.approval}
  1902. onChange={(e) => { this.setState({ approval: e }) }}>
  1903. <Select.Option value='0'>不申请特批</Select.Option>
  1904. <Select.Option value='1'>申请特批</Select.Option>
  1905. </Select>
  1906. <span className="mandatory">*</span>
  1907. </FormItem>
  1908. </div>
  1909. <div className="clearfix">
  1910. <FormItem
  1911. {...formItemLayout}
  1912. label="签单时间" >
  1913. <DatePicker
  1914. style={{marginTop:"2px"}}
  1915. showTime
  1916. format="YYYY-MM-DD"
  1917. placeholder="选择签单时间"
  1918. value={this.state.entryTime}
  1919. onChange={(e,time)=>{this.selTime(e,time)}}
  1920. />
  1921. <span className="mandatory">*</span>
  1922. </FormItem>
  1923. </div>
  1924. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1925. <Button className="submitSave" type="primary" htmlType="submit">确定签单</Button>
  1926. <Button className="submitSave" type="ghost" onClick={this.signBittOk}>返回</Button>
  1927. </FormItem>
  1928. </Spin>
  1929. </Form >
  1930. </Modal>
  1931. <Modal maskClosable={false} visible={this.state.lookVisible}
  1932. onOk={this.lookCancel} onCancel={this.lookCancel}
  1933. width='1300px'
  1934. title= '查看流水'
  1935. footer=''
  1936. className="admin-desc-content">
  1937. <Form layout="horizontal" id="demand-form">
  1938. <Spin spinning={this.state.loading}>
  1939. <div className="clearfix">
  1940. <Table columns={this.state.flowList}
  1941. dataSource={this.state.lookflowList}
  1942. pagination={false}
  1943. />
  1944. </div>
  1945. </Spin>
  1946. </Form >
  1947. </Modal>
  1948. <Modal maskClosable={false} visible={this.state.addChangeState}
  1949. onOk={this.addChangeCancel} onCancel={this.addChangeCancel}
  1950. width='800px'
  1951. title= {this.state.stateAdd?'添加变更':'查看变更记录'}
  1952. footer=''
  1953. className="admin-desc-content">
  1954. <Form layout="horizontal" id="demand-form">
  1955. <Spin spinning={this.state.loading}>
  1956. <div className="clearfix">
  1957. {this.state.stateAdd?<div className="clearfix">
  1958. <FormItem
  1959. labelCol={{ span: 4 }}
  1960. wrapperCol={{ span: 16 }}
  1961. label="变更说明" >
  1962. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  1963. onChange={(e)=>{this.setState({changeRemarks:e.target.value})}}/>
  1964. </FormItem>
  1965. <div className="clearfix">
  1966. <Button type="primary" onClick={this.subChangeState} style={{margin:"10px 50px 10px 128px"}}>保存</Button>
  1967. <Button onClick={this.addChangeCancel}>取消</Button>
  1968. </div>
  1969. </div>:
  1970. <div>
  1971. {
  1972. changeHtml.length?changeHtml.map(function(item,index){
  1973. return (<div className="changeBorder" key={index}>
  1974. <FormItem className="half-item"
  1975. {...formItemLayout}
  1976. label="变更发起人" >
  1977. <span>{item.creater}</span>
  1978. </FormItem>
  1979. <FormItem className="half-item"
  1980. {...formItemLayout}
  1981. label="变更申请时间" >
  1982. <span>{item.createTime}</span>
  1983. </FormItem>
  1984. <div className='clearfix'>
  1985. <FormItem className="half-item"
  1986. {...formItemLayout}
  1987. label="变更状态" >
  1988. <span>{getChangeState(item.changeStatus)}</span>
  1989. </FormItem>
  1990. <FormItem className="half-item"
  1991. {...formItemLayout}
  1992. label="变更操作" >
  1993. <Button onClick={(e)=>{this.modifyChange(item)}}>修改</Button>
  1994. {/*<Button type="danger" onClick={(e)=>{this.modifyDelete(item)}}>删除</Button>*/}
  1995. </FormItem>
  1996. </div>
  1997. <div className='clearfix changeRemark'>
  1998. <FormItem
  1999. labelCol={{ span: 4 }}
  2000. wrapperCol={{ span: 16 }}
  2001. label="变更说明" >
  2002. <p>{item.changeComment}</p>
  2003. </FormItem>
  2004. </div>
  2005. </div>)
  2006. },this):<p style={{textAlign:"center"}}>暂无变更记录</p>}
  2007. </div>
  2008. }
  2009. </div>
  2010. </Spin>
  2011. </Form >
  2012. </Modal>
  2013. <Modal maskClosable={false} visible={this.state.modifyChangeState}
  2014. onOk={this.modifyChangeCancel} onCancel={this.modifyChangeCancel}
  2015. width='600px'
  2016. title= "修改变更 "
  2017. footer=''
  2018. className="admin-desc-content">
  2019. <Form layout="horizontal" id="demand-form">
  2020. <Spin spinning={this.state.loading}>
  2021. <div className="clearfix">
  2022. <div className="clearfix">
  2023. <FormItem className="half-item"
  2024. {...formItemLayout}
  2025. label="变更发起人" >
  2026. <span>{this.state.changePromoter}</span>
  2027. </FormItem>
  2028. <FormItem className="half-item"
  2029. {...formItemLayout}
  2030. label="变更申请时间" >
  2031. <span>{this.state.changeTime}</span>
  2032. </FormItem>
  2033. <div className='clearfix'>
  2034. <FormItem
  2035. labelCol={{ span: 4 }}
  2036. wrapperCol={{ span: 16 }}
  2037. label="变更状态" >
  2038. <Radio.Group onChange={(e)=>{this.setState({changeState:e.target.value})}} value={this.state.changeState}>
  2039. <Radio value={1}>变更中</Radio>
  2040. <Radio value={2}>变更完成</Radio>
  2041. </Radio.Group>
  2042. </FormItem>
  2043. </div>
  2044. <div className='clearfix'>
  2045. <FormItem
  2046. labelCol={{ span: 4 }}
  2047. wrapperCol={{ span: 16 }}
  2048. label="变更说明" >
  2049. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  2050. onChange={(e)=>{this.setState({changeRemarks:e.target.value})}}/>
  2051. </FormItem>
  2052. </div>
  2053. <div className="clearfix">
  2054. <Button type="primary" onClick={this.changeModify} style={{margin:"10px 95px"}}>保存</Button>
  2055. <Button onClick={this.modifyChangeCancel}>取消</Button>
  2056. </div>
  2057. </div>
  2058. </div>
  2059. </Spin>
  2060. </Form >
  2061. </Modal>
  2062. </div>
  2063. )
  2064. }
  2065. }));
  2066. export default NewService;