addService.jsx 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545
  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 moment from 'moment';
  7. import Picture from '@/manageCenter/publicComponent/picture';
  8. import {orderTypes,customerType,jiedian,tepi,boutique} from '../../../dataDic.js';
  9. import {splitUrl,beforeUploadFile,getProcessStatus,getLiquidationStatus,getboutique,getApprovedState,getjiedian,getCuikuan} from '../../../tools.js';
  10. const Option = AutoComplete.Option;
  11. //图片组件
  12. const PicturesWall = React.createClass({
  13. getInitialState() {
  14. return {
  15. previewVisible: false,
  16. previewImage: '',
  17. fileList: [],
  18. }
  19. },
  20. getDefaultProps(){
  21. return{
  22. changeClick:this.modifyChange
  23. }
  24. },
  25. handleCancel() {
  26. this.setState({ previewVisible: false })
  27. },
  28. handlePreview(file) {
  29. this.setState({
  30. previewImage: file.url || file.thumbUrl,
  31. previewVisible: true,
  32. });
  33. },
  34. handleChange(info) {
  35. let fileList = info.fileList;
  36. this.setState({ fileList });
  37. this.props.fileList(fileList);
  38. },
  39. componentWillReceiveProps(nextProps) {
  40. this.state.fileList = nextProps.pictureUrl;
  41. },
  42. render() {
  43. const { previewVisible, previewImage, fileList } = this.state;
  44. const uploadButton = (
  45. <div>
  46. <Icon type="plus" />
  47. <div className="ant-upload-text">点击上传</div>
  48. </div>
  49. );
  50. return (
  51. <div style={{display:"inline-block"}}>
  52. <Upload
  53. beforeUpload={beforeUploadFile}
  54. action={globalConfig.context + "/api/admin/order/uploadOrderImg"}
  55. data={{ 'sign': '' }}
  56. listType="picture-card"
  57. fileList={fileList}
  58. onPreview={this.handlePreview}
  59. onChange={this.handleChange} >
  60. {fileList.length >= 18 ? null : uploadButton}
  61. </Upload>
  62. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  63. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  64. </Modal>
  65. </div>
  66. );
  67. }
  68. });
  69. const NewService = Form.create()(React.createClass({
  70. //查看项目列表
  71. loadData(record) {
  72. this.state.data = [];
  73. this.setState({
  74. loading: true
  75. });
  76. $.ajax({
  77. method: "get",
  78. dataType: "json",
  79. crossDomain: false,
  80. url: globalConfig.context + '/api/admin/newOrder/getOrderTask',
  81. data: {
  82. orderNo:record?record.orderNo:this.props.datauser.orderNo
  83. },
  84. success: function (data) {
  85. let theArr = [];
  86. if (!data.data) {
  87. if (data.error && data.error.length) {
  88. message.warning(data.error[0].message);
  89. };
  90. } else {
  91. for (let i = 0; i < data.data.length; i++) {
  92. let thisdata = data.data[i];
  93. theArr.push({
  94. key: i,
  95. id:thisdata.id,
  96. orderNo:thisdata.orderNo,//订单编号
  97. commodityId:thisdata.commodityId,//项目ID
  98. commodityName:thisdata.commodityName,//项目名称
  99. cname:thisdata.cname,//项目类别
  100. commodityPrice:thisdata.commodityPrice,//项目价格
  101. commodityQuantity:thisdata.commodityQuantity,//项目数量
  102. main:thisdata.main,//是否为主要任务
  103. taskComment:thisdata.taskComment,//任务说明
  104. contacts:thisdata.contacts,//联系人
  105. contactsMobile:thisdata.contactsMobile,//联系人电话
  106. });
  107. };
  108. }
  109. this.setState({
  110. dataSource: theArr,
  111. pagination: false,
  112. });
  113. }.bind(this),
  114. }).always(function () {
  115. this.setState({
  116. loading: false
  117. });
  118. }.bind(this));
  119. },
  120. //收款节点
  121. loadDatas(record) {
  122. this.state.data = [];
  123. this.setState({
  124. loading: true
  125. });
  126. $.ajax({
  127. method: "get",
  128. dataType: "json",
  129. crossDomain: false,
  130. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  131. data: {
  132. orderNo:record?record.orderNo:this.props.datauser.orderNo
  133. },
  134. success: function (data) {
  135. let theArr = [];
  136. if (!data.data) {
  137. if (data.error && data.error.length) {
  138. message.warning(data.error[0].message);
  139. };
  140. } else {
  141. for (let i = 0; i < data.data.length; i++) {
  142. let thisdata = data.data[i];
  143. theArr.push({
  144. key: i,
  145. id:thisdata.id,
  146. });
  147. };
  148. }
  149. this.setState({
  150. dataSource: theArr,
  151. pagination: false,
  152. });
  153. }.bind(this),
  154. }).always(function () {
  155. this.setState({
  156. loading: false
  157. });
  158. }.bind(this));
  159. },
  160. getInitialState() {
  161. return {
  162. loading: false,
  163. visible: false,
  164. orgCodeUrl:[],
  165. customerArr:[],
  166. bussStats:false,
  167. checkedKeys: [],
  168. lookflowList:[],
  169. contractUrl:[],
  170. applicationUrl:[],
  171. active:{
  172. applySign:false
  173. },
  174. lookState:false,
  175. signBillVisible:false,
  176. commod:'',
  177. columns: [
  178. {
  179. title: '业务项目名称',
  180. dataIndex: 'commodityName',
  181. key: 'commodityName'
  182. }, {
  183. title: '项目类别',
  184. dataIndex: 'cname',
  185. key: 'cname',
  186. },{
  187. title: '项目数量',
  188. dataIndex: 'commodityQuantity',
  189. key: 'commodityQuantity'
  190. }, {
  191. title: '金额(万元)',
  192. dataIndex: 'commodityPrice',
  193. key: 'commodityPrice'
  194. }, {
  195. title: '负责人',
  196. dataIndex: 'contacts',
  197. key: 'contacts'
  198. }, {
  199. title: '负责人电话',
  200. dataIndex: 'contactsMobile',
  201. key: 'contactsMobile'
  202. }, {
  203. title: '主要项目',
  204. dataIndex: 'main',
  205. key: 'main',
  206. render:(text)=>{
  207. return (text?'是':'否')
  208. }
  209. }, {
  210. title: '项目说明',
  211. dataIndex: 'taskComment',
  212. key: 'taskComment',
  213. render:(text)=>{
  214. return (text&&text.length>8?text.substr(0,8)+'…':text)
  215. }
  216. }, {
  217. title: '操作',
  218. dataIndex: 'ABC',
  219. key: 'ABC',
  220. render: (text, record, index) => {
  221. return <div>
  222. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.delectRow(record)}} okText="是" cancelText="否">
  223. <Button onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  224. </Popconfirm>:""}
  225. </div>
  226. }
  227. }
  228. ],
  229. contactList:[],
  230. loading:false,
  231. ContactsLists: [{
  232. title: '催款科目',
  233. dataIndex: 'dunSubject',
  234. key: 'dunSubject',
  235. render: (text, record, index) => {
  236. return <div>
  237. {this.state.processStatus==0?<Select placeholder="请选择催款科目" value={record.dunSubject} style={{width:'150px'}}
  238. onChange={(e) => { record.dunSubject = e; this.setState({ contactList: this.state.contactList }); }}>
  239. {
  240. jiedian.map(function (item) {
  241. return <Select.Option key={item.value} >{item.key}</Select.Option>
  242. })
  243. }
  244. </Select>:getjiedian(text)}
  245. </div>
  246. }
  247. },{
  248. title: '金额(万)',
  249. dataIndex: 'money',
  250. key: 'money',
  251. render: (text, record, index) => {
  252. return <div>
  253. {this.state.processStatus==0?<Input value={record.money} placeholder="请输入金额(必填项)" key={record.id} required="required"
  254. onChange={(e) => { record.money = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>:<span>{text}</span>}
  255. </div>
  256. }
  257. }, {
  258. title: '催款状态',
  259. dataIndex: 'dunStatus',
  260. key: 'dunStatus',
  261. render:text=>{return getCuikuan(text)}
  262. },
  263. {
  264. title: '操作',
  265. dataIndex: 'dels',
  266. key: 'dels',
  267. render: (text, record, index) => {
  268. console.log(index);
  269. console.log(this.state.contactList.length);
  270. return <div>
  271. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.confirmDelet(record)}} okText="删除" cancelText="不删除">
  272. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
  273. </Popconfirm>
  274. :''}
  275. {!record.id&&(index==(this.state.contactList.length-1))?<Button type="primary" onClick={this.contactSave}>保存</Button>:''}
  276. </div>
  277. }
  278. }
  279. ],
  280. };
  281. },
  282. //新建订单、编辑订单保存
  283. handleSubmit(e) {
  284. e.preventDefault();
  285. let theorgCodeUrl = [];
  286. if (this.state.orgCodeUrl.length) {
  287. let picArr = [];
  288. this.state.orgCodeUrl.map(function (item) {
  289. if ( item.response && item.response.data && item.response.data.length ){
  290. picArr.push(item.response.data);
  291. }
  292. });
  293. theorgCodeUrl = picArr.join(",");
  294. };
  295. if(this.props.userDetaile){
  296. if(!this.state.totalAmount){
  297. message.warning('签单金额不能为空');
  298. this.refs.signFirstPayment.focus()
  299. return false;
  300. };
  301. if(!this.state.firstAmount){
  302. message.warning('首付金额不能为空');
  303. this.refs.signFirstPayment.focus()
  304. return false;
  305. };
  306. if(!theorgCodeUrl){
  307. message.warning('企业负责人不能为空');
  308. this.refs.signFirstPayment.focus()
  309. return false;
  310. };
  311. if(!this.state.signDate){
  312. message.warning('签单日期不能为空');
  313. this.refs.signFirstPayment.focus()
  314. return false;
  315. };
  316. }else{
  317. if(this.state.orderType==undefined){
  318. message.warning('请选择订单类型');
  319. return false;
  320. };
  321. if(!this.state.autoId){
  322. message.warning('客户名称不匹配');
  323. return false;
  324. };
  325. }
  326. this.setState({
  327. loading: true
  328. });
  329. let api=this.props.userDetaile?'/api/admin/newOrder/updateServiceOrderNew':'/api/admin/newOrder/createOrder';
  330. $.ajax({
  331. method: "POST",
  332. dataType: "json",
  333. crossDomain: false,
  334. url: globalConfig.context + api,
  335. data: !this.props.userDetaile?{
  336. uid:this.state.autoId,
  337. orderType:this.state.orderType,
  338. contractType:this.state.contractType
  339. }:{
  340. orderNo: this.state.orderNo,//订单编号
  341. totalAmount: this.state.totalAmount,//总金额
  342. firstAmount: this.state.firstAmount,//首付
  343. isSubmit: this.state.isSubmit,//保存草稿还是提交
  344. signDate: this.state.signDate,//签单日期
  345. contacts: this.state.contacts,//企业负责人
  346. contactMobile: this.state.contactMobile,//负责人联系方式
  347. legalPerson: this.state.legalPerson,//企业法人
  348. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  349. approval: this.state.approval,//特批状态
  350. contractNo: this.state.contractNo,//合同编号
  351. orderRemarks: this.state.orderRemarks,//订单备注
  352. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  353. }
  354. }).done(function(data) {
  355. this.setState({
  356. loading: false
  357. });
  358. if(!data.error.length) {
  359. message.success('保存成功!');
  360. this.handleOk();
  361. if(this.state.autoId){
  362. this.loadData()
  363. };
  364. } else {
  365. message.warning(data.error[0].message);
  366. }
  367. }.bind(this));
  368. },
  369. //订单详情修改
  370. xiangqingClick(e) {
  371. e.preventDefault();
  372. this.setState({
  373. loading: true
  374. });
  375. $.ajax({
  376. url: globalConfig.context + '/api/admin/newOrder/updateServiceOrderNew',
  377. method: 'post',
  378. data: {
  379. orderNo: this.state.orderNo,//订单编号
  380. totalAmount: this.state.totalAmount,//总金额
  381. firstAmount: this.state.firstAmount,//首付
  382. isSubmit: this.state.isSubmit,//保存草稿还是提交
  383. signDate: this.state.selTime,//签单日期
  384. contacts: this.state.contacts,//企业负责人
  385. contactMobile: this.state.contactMobile,//负责人联系方式
  386. legalPerson: this.state.legalPerson,//企业法人
  387. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  388. approval: this.state.approval,//特批状态
  389. contractNo: this.state.contractNo,//合同编号
  390. orderRemarks: this.state.orderRemarks,//订单备注
  391. }
  392. }).done(function(data) {
  393. this.setState({
  394. loading: false
  395. });
  396. if(!data.error.length) {
  397. message.success('保存成功!');
  398. this.loaduser();
  399. } else {
  400. message.warning(data.error[0].message);
  401. }
  402. }.bind(this));
  403. },
  404. //查看基本详情基本信息
  405. loaduser(record){
  406. this.state.orderList=[]
  407. $.ajax({
  408. method: "get",
  409. dataType: "json",
  410. crossDomain: false,
  411. url: globalConfig.context + '/api/admin/newOrder/getOrderNewDetail',
  412. data: {
  413. orderNo:record?record.orderNo:this.props.datauser.orderNo
  414. },
  415. success: function (data) {
  416. let thisData = data.data;
  417. if (!thisData) {
  418. if (data.error && data.error.length) {
  419. message.warning(data.error[0].message);
  420. };
  421. thisData = {};
  422. };
  423. this.setState({
  424. id:thisData.id,
  425. kehuId:thisData.buyerId,
  426. orderNo:thisData.orderNo,//订单编号
  427. orderType:thisData.orderType,//订单类型
  428. firstAmount:thisData.firstAmount,//首付金额
  429. totalAmount:thisData.totalAmount,//总金额
  430. settlementAmount:thisData.settlementAmount,//结算金额
  431. liquidationStatus:thisData.liquidationStatus,//清算状态
  432. processStatus:thisData.processStatus,//流程状态
  433. approval:thisData.approval.toString(),//特批状态
  434. orderRemarks:thisData.orderRemarks,//订单备注
  435. contractNo:thisData.contractNo,//合同编号
  436. contacts:thisData.contacts,//联系人
  437. contactMobile:thisData.contactMobile,//联系人电话
  438. legalPerson:thisData.legalPerson,//法人
  439. legalPersonTel:thisData.legalPersonTel,//法人电话
  440. contractNo:thisData.contractNo,//合同编号
  441. orgCodeUrl: thisData.contractPictureUrl ? splitUrl(thisData.contractPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],//图片地址
  442. signDate:thisData.signDate,//签单时间
  443. userName:thisData.userName,//客户名称
  444. salesmanName:thisData.salesmanName,//营销员名称
  445. salesmanMobile:thisData.salesmanMobile,//营销员电话
  446. financeName:thisData.financeName,//财务名称
  447. financeMobile:thisData.financeMobile,//财务电话
  448. contractNo:thisData.contractNo,//合同编号
  449. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  450. });
  451. }.bind(this),
  452. }).always(function () {
  453. this.setState({
  454. loading: false
  455. });
  456. }.bind(this));
  457. },
  458. //查看催款节点
  459. loaduserss(record){
  460. this.state.orderList=[]
  461. this.setState({
  462. orderNoss:record?record.orderNo:this.props.datauser.orderNo,
  463. })
  464. $.ajax({
  465. method: "get",
  466. dataType: "json",
  467. crossDomain: false,
  468. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  469. data: {
  470. orderNo:record?record.orderNo:this.props.datauser.orderNo
  471. },
  472. success: function (data) {
  473. let theArr=[];
  474. let thisData=[];
  475. if (!thisData) {
  476. if (data.error && data.error.length) {
  477. message.warning(data.error[0].message);
  478. };
  479. thisData = {};
  480. }else{
  481. for(let i = 0; i < data.data.length; i++) {
  482. thisData= data.data[i];
  483. theArr.push({
  484. key:i,
  485. dunSubject:thisData.dunSubject?thisData.dunSubject.toString():"",//催款科目
  486. id:thisData.id,//节点Id
  487. money:thisData.money,//催款金额
  488. dunStatus:thisData.dunStatus,//催款状态
  489. orderNo:record?record.orderNo:this.props.datauser.orderNo,
  490. })
  491. }
  492. this.setState({
  493. contactList:theArr
  494. })
  495. };
  496. }.bind(this),
  497. }).always(function () {
  498. this.setState({
  499. loading: false
  500. });
  501. }.bind(this));
  502. },
  503. //催款节点保存
  504. contactSave(e) {
  505. if(this.state.contactList){
  506. let cuiData=this.state.contactList;
  507. for(var a=0;a<cuiData.length;a++){
  508. if(cuiData[a].money==''){
  509. message.warning('催款金额不能为空');
  510. this.refs.signFirstPayment.focus()
  511. return false;
  512. }else if(!cuiData[a].dunSubject){
  513. message.warning('催款科目不能为空');
  514. this.refs.signFirstPayment.focus()
  515. return false;
  516. }
  517. }
  518. };
  519. this.setState({
  520. loading: true
  521. });
  522. $.ajax({
  523. url: globalConfig.context + '/api/admin/newOrder/createOrderDun',
  524. method: 'post',
  525. data: {
  526. orderNo: this.state.orderNoss,
  527. orderDun: JSON.stringify(this.state.contactList)
  528. }
  529. }).done(function(data) {
  530. this.setState({
  531. loading: false
  532. });
  533. if(!data.error.length) {
  534. message.success('保存成功!');
  535. this.loaduserss();
  536. } else {
  537. message.warning(data.error[0].message);
  538. }
  539. }.bind(this));
  540. },
  541. //点击新增催款节点
  542. addcontact(record) {
  543. this.state.contactList.push({
  544. key:this.state.contactList.length,
  545. money: '',
  546. dunSubject:undefined,
  547. orderNo: this.state.orderNoss,
  548. dunTarget:this.state.kehuId,
  549. });
  550. this.setState({
  551. contactList: this.state.contactList
  552. })
  553. },
  554. //删除收款节点
  555. confirmDelet(index) {
  556. if(index.id){
  557. this.state.contactList.splice(index.key,1);
  558. this.setState({
  559. contactList: this.state.contactList
  560. })
  561. this.contactSave();
  562. }else{
  563. this.state.contactList.splice(index.key,1);
  564. this.setState({
  565. contactList: this.state.contactList
  566. })
  567. }
  568. },
  569. handleOk(e) {
  570. this.setState({
  571. visible: false,
  572. });
  573. this.props.closeDesc(false, true);
  574. },
  575. handleCancel(e) {
  576. this.setState({
  577. visible: false,
  578. });
  579. this.props.closeDesc(false);
  580. },
  581. //点击签单
  582. handleCancels(e) {
  583. this.setState({
  584. isSubmit:1
  585. })
  586. },
  587. //点击签单
  588. handleCancelq(e) {
  589. this.setState({
  590. isSubmit:0
  591. })
  592. },
  593. //删除
  594. delectRow(record) {
  595. this.setState({
  596. loading: true
  597. });
  598. $.ajax({
  599. method: "post",
  600. dataType: "json",
  601. crossDomain: false,
  602. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  603. data: {
  604. id:record.id
  605. }
  606. }).done(function (data) {
  607. if (!data.error.length) {
  608. message.success('删除成功!');
  609. this.setState({
  610. loading: false,
  611. });
  612. //this.loaduser()
  613. this.loadData();
  614. } else {
  615. message.warning(data.error[0].message);
  616. };
  617. }.bind(this));
  618. },
  619. nextCancel() {
  620. this.setState({
  621. addnextVisible: false
  622. })
  623. },
  624. getOrgCodeUrl(e) {
  625. this.setState({ orgCodeUrl: e });
  626. },
  627. componentWillMount() {
  628. },
  629. //加载(自动补全)
  630. supervisor(e,state){ //客户名称与服务名称自动补全
  631. let api=state?'/api/admin/customer/getCustomerByName':'/api/admin/order/getBusinessProjectByName';
  632. $.ajax({
  633. method: "get",
  634. dataType: "json",
  635. crossDomain: false,
  636. url: globalConfig.context + api,
  637. data:state?{
  638. name:e,
  639. type:this.state.customType
  640. }:{
  641. businessName:e
  642. },
  643. success: function (data) {
  644. let thedata=data.data;
  645. if (!thedata) {
  646. if (data.error && data.error.length) {
  647. message.warning(data.error[0].message);
  648. };
  649. thedata = {};
  650. };
  651. this.setState({
  652. states:state,
  653. customerArr:thedata,
  654. });
  655. }.bind(this),
  656. }).always(function () {
  657. this.setState({
  658. loading: false
  659. });
  660. }.bind(this));
  661. },
  662. //上级主管输入框失去焦点是判断客户是否存在
  663. selectAuto(value){
  664. let kid=[];
  665. let fwList=this.state.customerArr;
  666. fwList.map(function(item){
  667. if(value==item.bname){
  668. kid=item
  669. }
  670. })
  671. this.setState({
  672. commodityName:value,
  673. gid:kid.id,
  674. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  675. commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
  676. })
  677. },
  678. //客户
  679. selectAutoCUT(value){
  680. let autoIds;
  681. let fwList=this.state.customerArr;
  682. fwList.map(function(item){
  683. if(value==item.name){
  684. autoIds=item.id
  685. }
  686. })
  687. this.setState({
  688. customerName:value,
  689. autoId:autoIds
  690. })
  691. },
  692. //服务值改变时请求客户名称
  693. httpChange(e){
  694. this.state.gid='';
  695. if(e.length>=1){
  696. this.supervisor(e,false);
  697. }
  698. this.setState({
  699. commodityName:e
  700. })
  701. },
  702. //客户名称自动补全
  703. customerChange(e){
  704. this.state.autoId='';
  705. if(e.length>=2){
  706. this.supervisor(e,true);
  707. }
  708. this.setState({
  709. customerName:e
  710. })
  711. },
  712. //点击添加项目明细
  713. addDetailed(){
  714. this.setState({
  715. gid:'',
  716. customerArr:[],
  717. commodityName:'',
  718. commodityQuantity:'',
  719. commodityId:'',
  720. taskComment:'',
  721. main:undefined,
  722. commodityPrice:'',
  723. addState:1,
  724. addnextVisible: true
  725. })
  726. },
  727. //新建项目明细保存
  728. nextSubmit(e) {
  729. e.preventDefault();
  730. if(this.state.gid==undefined||!this.state.gid){
  731. message.warning('服务名称不匹配!');
  732. return false;
  733. };
  734. if(!this.state.commodityPrice){
  735. message.warning('请输入金额!');
  736. this.refs.commodityPrice.focus();
  737. return false;
  738. };
  739. if(!this.state.commodityQuantity){
  740. message.warning('请输入商品数量!');
  741. this.refs.commodityQuantity.focus();
  742. return false;
  743. };
  744. if(!this.state.main){
  745. message.warning('请选择是否为主要项目!');
  746. this.refs.commodityQuantity.focus();
  747. return false;
  748. };
  749. this.setState({
  750. loading: true
  751. });
  752. let api=this.state.addState?'/api/admin/newOrder/addOrderTask':'/api/bianji';
  753. $.ajax({
  754. method: "POST",
  755. dataType: "json",
  756. crossDomain: false,
  757. url: globalConfig.context +api ,
  758. data: {
  759. commodityId:this.state.gid,//商品ID
  760. orderNo:this.props.datauser.orderNo,//订单编号
  761. commodityName:this.state.commodityName,//商品名称
  762. commodityQuantity:this.state.commodityQuantity,//商品数量
  763. commodityPrice:this.state.commodityPrice,//签单总价
  764. taskComment:this.state.taskComment,//服务说明
  765. main:this.state.main,//是否为主要项目
  766. }
  767. }).done(function(data) {
  768. this.setState({
  769. loading: false
  770. });
  771. if(!data.error.length) {
  772. message.success('保存成功!');
  773. this.nextCancel()
  774. //this.loaduser(this.props.datauser);
  775. this.loadData();
  776. } else {
  777. message.warning(data.error[0].message);
  778. }
  779. }.bind(this));
  780. },
  781. //点击打卡项目详情
  782. tableRowClick(record, index) {
  783. this.setState({
  784. jid:record.id,//项目ID
  785. kid:record.commodityId,//商品ID
  786. commodityName:record.commodityName,//金额
  787. commodityPrice:record.commodityPrice,//金额
  788. commodityQuantity:record.commodityQuantity,//数量
  789. taskComment:record.taskComment,//备注
  790. main:record.main.toString(),//是否为主要
  791. addnextVisible:true,
  792. addState:0,
  793. });
  794. },
  795. //修改项目详情
  796. tabRowSave(e){
  797. e.preventDefault();
  798. if(!this.state.commodityPrice){
  799. message.warning('金额不能为空!');
  800. return false;
  801. };
  802. if(!this.state.commodityQuantity){
  803. message.warning('数量不能为空!');
  804. return false;
  805. };
  806. if(!this.state.main){
  807. message.warning('请选择是否为主要项目!');
  808. this.refs.commodityQuantity.focus();
  809. return false;
  810. };
  811. $.ajax({
  812. method: "POST",
  813. dataType: "json",
  814. crossDomain: false,
  815. url: globalConfig.context +'/api/admin/newOrder/updateOrderTask' ,
  816. data: {
  817. id:this.state.jid,//项目ID
  818. commodityId:this.state.kid,//商品ID
  819. orderNo:this.props.datauser.orderNo,//订单编号
  820. main:this.state.main,//是否为主要
  821. commodityPrice:this.state.commodityPrice,//金额
  822. commodityQuantity:this.state.commodityQuantity,//数量
  823. taskComment:this.state.taskComment//备注
  824. }
  825. }).done(function(data) {
  826. this.setState({
  827. loading: false
  828. });
  829. if(!data.error.length) {
  830. message.success('保存成功!');
  831. this.nextCancel()
  832. //this.loaduser(this.props.datauser);
  833. this.loadData();
  834. } else {
  835. message.warning(data.error[0].message);
  836. }
  837. }.bind(this));
  838. },
  839. //签单时间选择
  840. selTime(e,index){
  841. this.setState({
  842. entryTime:e,
  843. signDate:e,
  844. selTime:index
  845. })
  846. },
  847. //退单操作
  848. //点击退单
  849. tuikuan(){
  850. this.setState({
  851. lookVisible:true,
  852. contractUrl:[],
  853. applicationUrl:[],
  854. reason:''
  855. })
  856. },
  857. //关闭退单
  858. noCancel(){
  859. this.setState({
  860. lookVisible:false
  861. })
  862. },
  863. //点击确认退单
  864. tuidanOk(){
  865. let contractUrls = [];
  866. let applicationUrls = [];
  867. if (this.state.contractUrl.length) {
  868. let picArr = [];
  869. this.state.contractUrl.map(function (item) {
  870. if ( item.response && item.response.data && item.response.data.length ){
  871. picArr.push(item.response.data);
  872. }
  873. });
  874. contractUrls = picArr.join(",");
  875. };
  876. if (this.state.applicationUrl.length) {
  877. let picArr = [];
  878. this.state.applicationUrl.map(function (item) {
  879. if ( item.response && item.response.data && item.response.data.length ){
  880. picArr.push(item.response.data);
  881. }
  882. });
  883. applicationUrls = picArr.join(",");
  884. };
  885. $.ajax({
  886. method: "POST",
  887. dataType: "json",
  888. crossDomain: false,
  889. url: globalConfig.context +'/api/admin/newOrder/addOrderRefund' ,
  890. data: {
  891. orderNo:this.state.orderNo,//订单编号
  892. contractUrl:contractUrls.length?contractUrls:'',//终止合同
  893. applicationUrl:applicationUrls.length?applicationUrls:'',//退单申请表
  894. reason:this.state.reason,//退单原因
  895. }
  896. }).done(function(data) {
  897. this.setState({
  898. loading: false
  899. });
  900. if(!data.error.length) {
  901. message.success('退单成功!');
  902. this.noCancel();
  903. this.handleCancel();
  904. } else {
  905. message.warning(data.error[0].message);
  906. }
  907. }.bind(this));
  908. },
  909. //开单选择订单类型骚操作
  910. orderTypeFn(e){
  911. if(e==0){
  912. this.setState({
  913. bussStats:true,
  914. orderType:e
  915. })
  916. this.category();
  917. }else{
  918. this.setState({
  919. contractType:undefined,
  920. bussStats:false,
  921. orderType:e
  922. })
  923. }
  924. },
  925. //品类数据获取
  926. category(){
  927. $.ajax({
  928. method: "get",
  929. dataType: "json",
  930. crossDomain: false,
  931. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  932. data: {
  933. },
  934. success: function(data) {
  935. let thedata = data.data;
  936. let theArr=[];
  937. if(!thedata) {
  938. if(data.error && data.error.length) {
  939. message.warning(data.error[0].message);
  940. };
  941. thedata = {};
  942. }else{
  943. thedata.map(function(item,index){
  944. theArr.push({
  945. key:index,
  946. name:item.cname,
  947. id:item.id,
  948. })
  949. })
  950. }
  951. this.setState({
  952. contractType:undefined,
  953. categoryArr:theArr,
  954. })
  955. }.bind(this),
  956. });
  957. },
  958. componentWillReceiveProps(nextProps) { //props改变时触发
  959. this.state.visible = nextProps.showDesc;
  960. this.state.signBillVisible=nextProps.signBillVisible;
  961. if(this.state.signBillVisible){
  962. this.loaduser(nextProps.uid)
  963. };
  964. if(nextProps.userDetaile && nextProps.showDesc) {
  965. this.loaduser(nextProps.datauser);
  966. this.loaduserss(nextProps.datauser);
  967. this.loadData(nextProps.datauser);
  968. }else{
  969. this.setState({
  970. orderType:undefined,
  971. customerName:'',
  972. autoId:'',
  973. customerArr:[],
  974. contractType:undefined,
  975. bussStats:false,
  976. customType:undefined
  977. })
  978. }
  979. },
  980. render() {
  981. const FormItem = Form.Item
  982. const formItemLayout = {
  983. labelCol: { span: 8 },
  984. wrapperCol: { span: 14 },
  985. };
  986. const changeHtml=this.state.changeHtml ||[];
  987. const categoryList=this.state.categoryArr ||[];
  988. const orderDetaiel=this.state.orderList || [];
  989. const dataSources=this.state.customerArr || [];
  990. const options = this.state.states?dataSources.map((group,index) =>
  991. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  992. ):dataSources.map((group,index) =>
  993. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  994. )
  995. return(
  996. <div>
  997. <Modal maskClosable={false} visible={this.state.visible}
  998. onOk={this.handleOk} onCancel={this.handleCancel}
  999. width={!this.props.userDetaile?'600px':'900px'}
  1000. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  1001. footer=''
  1002. className="admin-desc-content">
  1003. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  1004. <Spin spinning={this.state.loading}>
  1005. <div className="clearfix">
  1006. {!this.props.userDetaile?
  1007. <div className="clearfix">
  1008. <div className="clearfix">
  1009. <FormItem
  1010. {...formItemLayout}
  1011. label="订单类型" >
  1012. <Select placeholder="请选择订单类型"
  1013. style={{ width:'200px'}}
  1014. value={this.state.orderType}
  1015. onChange={(e)=>{this.setState({orderType:e})}}>
  1016. {
  1017. orderTypes.map(function (item) {
  1018. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1019. })
  1020. }
  1021. </Select>
  1022. <span className="mandatory">*</span>
  1023. </FormItem>
  1024. </div>
  1025. <FormItem
  1026. {...formItemLayout}
  1027. label="客户所属类型" >
  1028. <Select placeholder="请选择客户所属类型"
  1029. style={{ width:'200px'}}
  1030. value={this.state.customType}
  1031. onChange={(e)=>{this.setState({customType:e})}}>
  1032. {
  1033. customerType.map(function (item) {
  1034. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1035. })
  1036. }
  1037. </Select>
  1038. </FormItem>
  1039. <div className="clearfix">
  1040. <FormItem
  1041. {...formItemLayout}
  1042. label="客户名称" >
  1043. <AutoComplete
  1044. className="certain-category-search"
  1045. dropdownClassName="certain-category-search-dropdown"
  1046. dropdownMatchSelectWidth={false}
  1047. dropdownStyle={{ width: 200 }}
  1048. size="large"
  1049. style={{ width: '200px' }}
  1050. dataSource={options}
  1051. placeholder="输入名称"
  1052. value={this.state.customerName}
  1053. onChange={this.customerChange}
  1054. filterOption={true}
  1055. onSelect={this.selectAutoCUT}
  1056. >
  1057. <Input/>
  1058. </AutoComplete>
  1059. <span className="mandatory">*</span>
  1060. </FormItem>
  1061. </div>
  1062. <div className='addSave' style={{marginTop:'15px'}}>
  1063. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1064. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1065. </div>
  1066. </div>
  1067. :<div className="clearfix">
  1068. <FormItem className="half-item"
  1069. {...formItemLayout}
  1070. label="订单编号" >
  1071. <span>{this.state.orderNo}</span>
  1072. </FormItem>
  1073. <FormItem className="half-item"
  1074. {...formItemLayout}
  1075. label="合同编号" >
  1076. {this.state.processStatus==0?<Input placeholder="请输入合同编号" value={this.state.contractNo}
  1077. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />:<span>{this.state.contractNo}</span>}
  1078. </FormItem>
  1079. <FormItem className="half-item"
  1080. {...formItemLayout}
  1081. label="客户名称" >
  1082. <span>{this.state.userName}</span>
  1083. </FormItem>
  1084. <FormItem className="half-item"
  1085. {...formItemLayout}
  1086. label="流程状态" >
  1087. <span>{getProcessStatus(this.state.processStatus)}</span>
  1088. </FormItem>
  1089. <FormItem className="half-item"
  1090. {...formItemLayout}
  1091. label="结算状态" >
  1092. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1093. </FormItem>
  1094. <FormItem className="half-item"
  1095. {...formItemLayout}
  1096. label="已收款项" >
  1097. <span>{this.state.settlementAmount+'万元'}</span>
  1098. {this.state.settlementAmount?<Button type='primary' onClick={this.tuikuan} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>退单</Button>:''}
  1099. </FormItem>
  1100. {this.state.processStatus==0?
  1101. <div className='clearfix'>
  1102. <FormItem className="half-item"
  1103. {...formItemLayout}
  1104. label="企业联系人" >
  1105. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1106. </FormItem>
  1107. <FormItem className="half-item"
  1108. {...formItemLayout}
  1109. label="联系人电话" >
  1110. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1111. </FormItem>
  1112. <FormItem className="half-item"
  1113. {...formItemLayout}
  1114. label="企业法人" >
  1115. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1116. </FormItem>
  1117. <FormItem className="half-item"
  1118. {...formItemLayout}
  1119. label="法人电话" >
  1120. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1121. </FormItem>
  1122. <FormItem className="half-item"
  1123. {...formItemLayout}
  1124. label="签单金额(万元)" >
  1125. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1126. <span className="mandatory">*</span>
  1127. </FormItem>
  1128. <FormItem className="half-item"
  1129. {...formItemLayout}
  1130. label="首付金额(万元)" >
  1131. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1132. <span className="mandatory">*</span>
  1133. </FormItem>
  1134. <FormItem className="half-item"
  1135. {...formItemLayout}
  1136. label="特批立项" >
  1137. <Select placeholder="请选择客户所属类型"
  1138. style={{ width:'240px'}}
  1139. value={this.state.approval}
  1140. onChange={(e)=>{this.setState({approval:e})}}>
  1141. {
  1142. tepi.map(function (item) {
  1143. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1144. })
  1145. }
  1146. </Select>
  1147. </FormItem>
  1148. <FormItem className="half-item" {...formItemLayout} label="合同签订时间">
  1149. <DatePicker
  1150. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1151. showTime
  1152. format="YYYY-MM-DD"
  1153. onOk={(e)=>{}}
  1154. value={this.state.signDate ? moment(this.state.signDate) : null}
  1155. onChange={(data, dataString) => { this.setState({ signDate: dataString }); }} />
  1156. <span className="mandatory">*</span>
  1157. </FormItem>
  1158. </div>
  1159. :
  1160. <div className='clearfix'>
  1161. <FormItem className="half-item"
  1162. {...formItemLayout}
  1163. label="企业联系人" >
  1164. <span>{this.state.contacts}</span>
  1165. </FormItem>
  1166. <FormItem className="half-item"
  1167. {...formItemLayout}
  1168. label="联系人电话" >
  1169. <span>{this.state.contactMobile}</span>
  1170. </FormItem>
  1171. <FormItem className="half-item"
  1172. {...formItemLayout}
  1173. label="企业法人" >
  1174. <span>{this.state.legalPerson}</span>
  1175. </FormItem>
  1176. <FormItem className="half-item"
  1177. {...formItemLayout}
  1178. label="法人电话" >
  1179. <span>{this.state.legalPersonTel}</span>
  1180. </FormItem>
  1181. <FormItem className="half-item"
  1182. {...formItemLayout}
  1183. label="签单金额(万元)" >
  1184. <span>{this.state.totalAmount}</span>
  1185. </FormItem>
  1186. <FormItem className="half-item"
  1187. {...formItemLayout}
  1188. label="首付金额(万元)" >
  1189. <span>{this.state.firstAmount}</span>
  1190. </FormItem>
  1191. <FormItem className="half-item"
  1192. {...formItemLayout}
  1193. label="特批立项" >
  1194. <span>{getApprovedState(this.state.approval)}</span>
  1195. </FormItem>
  1196. <FormItem className="half-item"
  1197. {...formItemLayout}
  1198. label="合同签订时间" >
  1199. <span>{this.state.signDate}</span>
  1200. </FormItem>
  1201. </div>}
  1202. <div className='clearfix'>
  1203. {this.state.processStatus==0?
  1204. <FormItem
  1205. labelCol={{ span: 4 }}
  1206. wrapperCol={{ span: 18 }}
  1207. label={
  1208. <span>
  1209. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1210. </span>
  1211. }
  1212. >
  1213. <PicturesWall
  1214. fileList={this.getOrgCodeUrl}
  1215. pictureUrl={this.state.orgCodeUrl} />
  1216. <p>图片建议:要清晰。</p>
  1217. </FormItem>:
  1218. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} label="合同扫描件">
  1219. <Upload className="demandDetailShow-upload"
  1220. listType="picture-card"
  1221. fileList={this.state.orgCodeUrl}
  1222. onPreview={(file) => {
  1223. this.setState({
  1224. previewImage: file.url || file.thumbUrl,
  1225. previewVisible: true,
  1226. });
  1227. }} >
  1228. </Upload>
  1229. <Modal maskClosable={false} footer={null}
  1230. visible={this.state.previewVisible}
  1231. onCancel={() => { this.setState({ previewVisible: false }) }}>
  1232. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  1233. </Modal>
  1234. </FormItem>}
  1235. </div>
  1236. <div className='clearfix'>
  1237. {this.state.processStatus==0?
  1238. <FormItem
  1239. labelCol={{ span: 4 }}
  1240. wrapperCol={{ span: 16 }}
  1241. label="订单留言" >
  1242. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1243. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1244. </FormItem>:
  1245. <FormItem
  1246. labelCol={{ span: 4 }}
  1247. wrapperCol={{ span: 16 }}
  1248. label="订单留言" >
  1249. <span>{this.state.orderRemarks}</span>
  1250. </FormItem>}
  1251. </div>
  1252. <div className='clearfix'>
  1253. <FormItem className="half-item"
  1254. {...formItemLayout}
  1255. label="订单负责人" >
  1256. <span>{this.state.salesmanName}</span>
  1257. </FormItem>
  1258. <FormItem className="half-item"
  1259. {...formItemLayout}
  1260. label="订单负责人电话" >
  1261. <span>{this.state.salesmanMobile}</span>
  1262. </FormItem>
  1263. </div>
  1264. <div className='clearfix'>
  1265. <FormItem className="half-item"
  1266. {...formItemLayout}
  1267. label="财务负责人" >
  1268. <span>{this.state.financeName}</span>
  1269. </FormItem>
  1270. <FormItem className="half-item"
  1271. {...formItemLayout}
  1272. label="财务负责人电话" >
  1273. <span>{this.state.financeMobile}</span>
  1274. </FormItem>
  1275. </div>
  1276. <div>
  1277. <span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
  1278. {this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
  1279. </div>
  1280. <div className="clearfix">
  1281. <Spin spinning={this.state.loading}>
  1282. <Form layout="horizontal" id="demand-form" >
  1283. <Table
  1284. pagination={false}
  1285. columns={this.state.ContactsLists}
  1286. dataSource={this.state.contactList}
  1287. />
  1288. <Col span={24} offset={9} style={{marginTop:'15px'}}>
  1289. </Col>
  1290. </Form>
  1291. </Spin>
  1292. </div>
  1293. <div>
  1294. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1295. {this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
  1296. </div>
  1297. <div className="patent-table">
  1298. <Spin spinning={this.state.loading}>
  1299. <Table columns={this.state.columns}
  1300. dataSource={this.state.dataSource}
  1301. pagination={this.state.pagination}
  1302. onRowClick={this.tableRowClick}
  1303. />
  1304. </Spin>
  1305. </div>
  1306. {this.state.processStatus==0?
  1307. <div className='addSave' style={{marginTop:'15px'}}>
  1308. <Button className="cancel" type="primary" onClick={this.handleCancels} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1309. <Button className="cancel" type="primary" onClick={this.handleCancelq} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1310. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1311. </div>:""}
  1312. </div>}
  1313. </div>
  1314. </Spin>
  1315. </Form >
  1316. </Modal>
  1317. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1318. onOk={this.nextCancel} onCancel={this.nextCancel}
  1319. width='800px'
  1320. title={this.state.addState?'添加项目任务':'项目任务详情'}
  1321. footer=''
  1322. className="admin-desc-content">
  1323. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1324. <Spin spinning={this.state.loading}>
  1325. {this.state.addState?<div className="clearfix">
  1326. <FormItem className="half-item"
  1327. {...formItemLayout}
  1328. label="服务名称" >
  1329. <AutoComplete
  1330. className="certain-category-search"
  1331. dropdownClassName="certain-category-search-dropdown"
  1332. dropdownMatchSelectWidth={false}
  1333. dropdownStyle={{ width: 200 }}
  1334. style={{ width: '200px' }}
  1335. dataSource={options}
  1336. placeholder="输入服务名称"
  1337. value={this.state.commodityName}
  1338. onChange={this.httpChange}
  1339. filterOption={true}
  1340. onSelect={this.selectAuto}
  1341. >
  1342. <Input/>
  1343. </AutoComplete>
  1344. <span className="mandatory">*</span>
  1345. </FormItem>
  1346. <FormItem className="half-item"
  1347. {...formItemLayout}
  1348. label="服务数量" >
  1349. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1350. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1351. <span className="mandatory">*</span>
  1352. </FormItem>
  1353. <FormItem className="half-item"
  1354. {...formItemLayout}
  1355. label="实签价格(万元)" >
  1356. <Input placeholder="请输入实签价格" value={this.state.commodityPrice} style={{width:'200px'}}
  1357. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} ref="commodityPrice"/>
  1358. <span className="mandatory">*</span>
  1359. </FormItem>
  1360. <FormItem className="half-item"
  1361. {...formItemLayout}
  1362. label="主要业务" >
  1363. <Select placeholder="选择是否为主要业务"
  1364. style={{ width:'200px'}}
  1365. value={this.state.main}
  1366. onChange={(e)=>{this.setState({main:e})}}>
  1367. {
  1368. boutique.map(function (item) {
  1369. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1370. })
  1371. }
  1372. </Select>
  1373. <span className="mandatory">*</span>
  1374. </FormItem>
  1375. <div className='clearfix'>
  1376. <FormItem
  1377. labelCol={{ span: 4 }}
  1378. wrapperCol={{ span: 16 }}
  1379. label="服务说明" >
  1380. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1381. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1382. </FormItem>
  1383. </div>
  1384. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1385. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1386. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1387. </FormItem>
  1388. </div>:
  1389. <div className="clearfix">
  1390. {this.state.processStatus==0?
  1391. <div className='clearfix'>
  1392. <FormItem className="half-item"
  1393. {...formItemLayout}
  1394. label="项目名称" >
  1395. <span>{this.state.commodityName}</span>
  1396. </FormItem>
  1397. <FormItem className="half-item"
  1398. {...formItemLayout}
  1399. label="项目数量" >
  1400. <Input placeholder="请输入数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1401. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} />
  1402. <span className="mandatory">*</span>
  1403. </FormItem>
  1404. <FormItem className="half-item"
  1405. {...formItemLayout}
  1406. label="金额(万元)" >
  1407. <Input placeholder="请输入签单金额" value={this.state.commodityPrice} style={{width:'200px'}}
  1408. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} />
  1409. <span className="mandatory">*</span>
  1410. </FormItem>
  1411. <FormItem className="half-item"
  1412. {...formItemLayout}
  1413. label="主要项目" >
  1414. <Select placeholder="选择是否为主要业务"
  1415. style={{ width:'200px'}}
  1416. value={this.state.main}
  1417. onChange={(e)=>{this.setState({main:e})}}>
  1418. {
  1419. boutique.map(function (item) {
  1420. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1421. })
  1422. }
  1423. </Select>
  1424. <span className="mandatory">*</span>
  1425. </FormItem>
  1426. <div className='clearfix'>
  1427. <FormItem
  1428. labelCol={{ span: 4 }}
  1429. wrapperCol={{ span: 16 }}
  1430. label="服务说明" >
  1431. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1432. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1433. </FormItem>
  1434. </div>
  1435. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1436. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1437. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1438. </FormItem>
  1439. </div>:<div className='clearfix'>
  1440. <FormItem className="half-item"
  1441. {...formItemLayout}
  1442. label="项目名称" >
  1443. <span>{this.state.commodityName}</span>
  1444. </FormItem>
  1445. <FormItem className="half-item"
  1446. {...formItemLayout}
  1447. label="项目数量" >
  1448. <span>{this.state.commodityQuantity}</span>
  1449. </FormItem>
  1450. <FormItem className="half-item"
  1451. {...formItemLayout}
  1452. label="金额(万元)" >
  1453. <span>{this.state.commodityPrice}</span>
  1454. </FormItem>
  1455. <FormItem className="half-item"
  1456. {...formItemLayout}
  1457. label="主要项目" >
  1458. <span>{getboutique(this.state.main)}</span>
  1459. </FormItem>
  1460. <div className='clearfix'>
  1461. <FormItem
  1462. labelCol={{ span: 4 }}
  1463. wrapperCol={{ span: 16 }}
  1464. label="服务说明" >
  1465. <span>{this.state.taskComment}</span>
  1466. </FormItem>
  1467. </div>
  1468. </div>
  1469. }
  1470. </div>
  1471. }
  1472. </Spin>
  1473. </Form >
  1474. </Modal>
  1475. <Modal maskClosable={false} visible={this.state.lookVisible}
  1476. onOk={this.noCancel} onCancel={this.noCancel}
  1477. width='800px'
  1478. title={'退单申请'}
  1479. footer=''
  1480. className="admin-desc-content">
  1481. <Form layout="horizontal" id="demand-form">
  1482. <Spin spinning={this.state.loading}>
  1483. <div className='clearfix'>
  1484. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="终止合同">
  1485. <Picture
  1486. fileList={(e)=>{this.setState({contractUrl:e})}}
  1487. pictureUrl={this.state.contractUrl}
  1488. visible={this.props.visible}
  1489. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1490. />
  1491. </FormItem>
  1492. </div>
  1493. <div className='clearfix'>
  1494. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="退单申请表">
  1495. <Picture
  1496. fileList={(e)=>{this.setState({applicationUrl:e})}}
  1497. pictureUrl={this.state.applicationUrl}
  1498. visible={this.props.visible}
  1499. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1500. />
  1501. </FormItem>
  1502. </div>
  1503. <div className='clearfix'>
  1504. <FormItem
  1505. labelCol={{ span: 4 }}
  1506. wrapperCol={{ span: 16 }}
  1507. label="退单理由" >
  1508. <Input type="textarea" placeholder="请输入退单理由" rows={4} value={this.state.reason}
  1509. onChange={(e)=>{this.setState({reason:e.target.value})}}/>
  1510. </FormItem>
  1511. </div>
  1512. <div className='clearfix'>
  1513. <Button className="cancel" type="primary" onClick={this.tuidanOk} style={{marginLeft:"50px"}} htmlType="submit">确定退单</Button>
  1514. <Button className="cancel" type="ghost" onClick={this.noCancel} style={{marginLeft:"50px"}}>取消</Button>
  1515. </div>
  1516. </Spin>
  1517. </Form >
  1518. </Modal>
  1519. </div>
  1520. )
  1521. }
  1522. }));
  1523. export default Form.create()(NewService);