billing.jsx 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803
  1. import React from 'react';
  2. import $ from 'jquery/src/ajax';
  3. import { Form,Radio, Icon, Button, Input, Spin, Table, message, DatePicker, Modal, Upload ,Popconfirm,Cascader,Tabs} from 'antd';
  4. import NewService from "./addService.jsx";
  5. import moment from 'moment';
  6. import '../userMangagement.less';
  7. import {areaSelect} from '@/NewDicProvinceList';
  8. import {
  9. getApprovedState,
  10. getprovince,
  11. getProcessStatus,
  12. getLiquidationStatus,
  13. getNewOrderStatus,
  14. beforeUploadFile,
  15. getProvinceA,
  16. getInvoiceStatus,
  17. splitUrl,
  18. ShowModal
  19. } from "../../../tools.js";
  20. import ShowModalDiv from "@/showModal.jsx";
  21. const PicturesWall = React.createClass({
  22. getInitialState() {
  23. return {
  24. previewVisible: false,
  25. previewImage: '',
  26. fileList: this.props.pictureUrl,
  27. }
  28. },
  29. getDefaultProps(){
  30. return{
  31. changeClick:this.modifyChange
  32. }
  33. },
  34. handleCancel() {
  35. this.setState({ previewVisible: false })
  36. },
  37. handlePreview(file) {
  38. this.setState({
  39. previewImage: file.url || file.thumbUrl,
  40. previewVisible: true,
  41. });
  42. },
  43. handleChange(info) {
  44. let fileList = info.fileList;
  45. this.setState({ fileList });
  46. this.props.fileList(fileList);
  47. },
  48. componentWillReceiveProps(nextProps) {
  49. this.state.fileList = nextProps.pictureUrl;
  50. },
  51. render() {
  52. const { previewVisible, previewImage, fileList } = this.state;
  53. const uploadButton = (
  54. <div>
  55. <Icon type="plus" />
  56. <div className="ant-upload-text">点击上传</div>
  57. </div>
  58. );
  59. return (
  60. <div style={{display:"inline-block"}}>
  61. <Upload
  62. beforeUpload={beforeUploadFile}
  63. action={globalConfig.context + "/api/admin/orderInvoice/uploadOrderInvoiceFile"}
  64. data={{ 'sign': 'order_invoice_file' }}
  65. listType="picture-card"
  66. fileList={fileList}
  67. onPreview={this.handlePreview}
  68. onChange={this.handleChange} >
  69. {fileList.length >= 18 ? null : uploadButton}
  70. </Upload>
  71. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  72. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  73. </Modal>
  74. </div>
  75. );
  76. }
  77. });
  78. const MyService=Form.create()(React.createClass({
  79. loadData(pageNo) {
  80. this.state.data = [];
  81. this.setState({
  82. loading: true
  83. });
  84. $.ajax({
  85. method: "get",
  86. dataType: "json",
  87. crossDomain: false,
  88. url: globalConfig.context + '/api/admin/newOrder/orderNewList',
  89. data: {
  90. pageNo: pageNo || 1,
  91. pageSize: this.state.pagination.pageSize,
  92. specially:0,
  93. name:this.state.customerName,
  94. orderNo:this.state.searchOrderNo,
  95. depId: this.state.departmenttSearch,
  96. starTime: this.state.releaseDate[0],
  97. endTime: this.state.releaseDate[1],
  98. },
  99. success: function (data) {
  100. ShowModal(this);
  101. let theArr = [];
  102. if (!data.data) {
  103. if (data.error && data.error.length) {
  104. message.warning(data.error[0].message);
  105. };
  106. } else {
  107. for (let i = 0; i < data.data.list.length; i++) {
  108. let thisdata = data.data.list[i];
  109. theArr.push({
  110. key: i,
  111. id: thisdata.id,
  112. orderNo: thisdata.orderNo,//订单编号
  113. totalAmount:thisdata.totalAmount,//签单金额
  114. processStatus:thisdata.processStatus,//流程状态
  115. liquidationStatus:thisdata.liquidationStatus,//结算状态
  116. approval:thisdata.approval,//特批状态
  117. signDate:thisdata.signDate,//签单时间
  118. userName:thisdata.userName,//客户名称
  119. salesmanName:thisdata.salesmanName,//营销员名称
  120. financeName:thisdata.financeName,//财务名称
  121. createDate:thisdata.createDate,//下单时间
  122. orderStatus:thisdata.orderStatus,//订单状态
  123. depName:thisdata.depName,//部门名称
  124. contractNo:thisdata.contractNo
  125. });
  126. };
  127. this.state.pagination.current = data.data.pageNo;
  128. this.state.pagination.total = data.data.totalCount;
  129. };
  130. if(!data.data.list.length){
  131. this.state.pagination.current=0
  132. this.state.pagination.total=0
  133. }
  134. this.setState({
  135. pageNo:pageNo,
  136. dataSource: theArr,
  137. pagination: this.state.pagination,
  138. selectedRowKeys:[],
  139. });
  140. }.bind(this),
  141. }).always(function () {
  142. this.setState({
  143. loading: false
  144. });
  145. }.bind(this));
  146. },
  147. getInitialState() {
  148. return {
  149. datauser:{},
  150. orgCodeUrl:[],
  151. selectedRowKeys: [],
  152. releaseDate: [],
  153. departmentArr: [],
  154. signBillState:false,
  155. signBillVisible:false,
  156. selectedRows: [],
  157. recordData:[],
  158. flag:false,
  159. searchMore: true,
  160. loading: false,
  161. alreadyAmount:0,
  162. intentOrder:true,
  163. formalOrder:true,
  164. pagination: {
  165. defaultCurrent: 1,
  166. defaultPageSize: 10,
  167. showQuickJumper: true,
  168. pageSize: 10,
  169. onChange: function (page) {
  170. this.loadData(page);
  171. }.bind(this),
  172. showTotal: function (total) {
  173. return '共' + total + '条数据';
  174. }
  175. },
  176. columns: [
  177. {
  178. title: '订单编号',
  179. dataIndex: 'orderNo',
  180. key: 'orderNo',
  181. fixed: 'left'
  182. },{
  183. title: '客户名称',
  184. dataIndex: 'userName',
  185. key: 'userName',
  186. render:(text)=>{
  187. return (text&&text.length>9?text.substr(0,9)+'...':text)
  188. }
  189. }, {
  190. title: '下单时间',
  191. dataIndex: 'createDate',
  192. key: 'createTime'
  193. },{
  194. title: '合同签订时间',
  195. dataIndex: 'signDate',
  196. key: 'signDate'
  197. }, {
  198. title: '流程状态',
  199. dataIndex: 'processStatus',
  200. key: 'processStatus',
  201. render:text=>{return getProcessStatus(text)}
  202. }, {
  203. title: '签单金额(万元)',
  204. dataIndex: 'totalAmount',
  205. key: 'totalAmount'
  206. },{
  207. title: '结算状态',
  208. dataIndex: 'liquidationStatus',
  209. key: 'liquidationStatus',
  210. render:text=>{return getLiquidationStatus(text)}
  211. }, {
  212. title: '是否特批',
  213. dataIndex: 'approval',
  214. key: 'approval',
  215. render:text=>{return getApprovedState(text)}
  216. },{
  217. title: '订单状态',
  218. dataIndex: 'orderStatus',
  219. key: 'orderStatus',
  220. render:text=>{return getNewOrderStatus(text)}
  221. },{
  222. title: '财务负责人',
  223. dataIndex: 'financeName',
  224. key: 'financeName'
  225. }, {
  226. title: '操作',
  227. dataIndex: 'abc',
  228. key: 'abc',
  229. render: (text, record, index) => {
  230. return (
  231. <div>
  232. {
  233. <Button
  234. type="primary"
  235. disabled={record.processStatus == 0 ? true : false}
  236. style={{
  237. marginRight: "10px",
  238. color: "#ffffff",
  239. border: "none",
  240. marginTop: "5px",
  241. background: record.processStatus == 0 ? "#ccc" : "red"
  242. }}
  243. onClick={e => {
  244. // console.log("2221", record);
  245. e.stopPropagation(), this.visit(record, index);
  246. }}
  247. >
  248. 开票
  249. </Button>
  250. }
  251. {
  252. <Button
  253. type="primary"
  254. onClick={e => {
  255. e.stopPropagation(), this.inRecord(record, index);
  256. }}
  257. style={{
  258. border: "none",
  259. background: "orangered",
  260. marginRight: "10px"
  261. }}
  262. >
  263. 开票记录
  264. </Button>
  265. }
  266. {record.liquidationStatus == 2 ? (
  267. <Popconfirm
  268. title="是否结项?"
  269. onConfirm={() => {
  270. this.delectRow(record);
  271. }}
  272. okText="是"
  273. cancelText="否"
  274. >
  275. <Button
  276. type="primary"
  277. style={{
  278. marginRight: "10px",
  279. color: "#ffffff",
  280. border: "none"
  281. }}
  282. onClick={e => {
  283. e.stopPropagation();
  284. }}
  285. >
  286. 结项
  287. </Button>
  288. </Popconfirm>
  289. ) : (
  290. ""
  291. )}
  292. </div>
  293. );
  294. }
  295. }
  296. ],
  297. columnsDate:[
  298. {
  299. title: '编号',
  300. dataIndex: 'id',
  301. key: 'id'
  302. },{
  303. title: '订单编号',
  304. dataIndex: 'orderno',
  305. key: 'orderno'
  306. },{
  307. title: '开票金额(万元)',
  308. dataIndex: 'amount',
  309. key: 'amount'
  310. },{
  311. title: '申请时间',
  312. dataIndex: 'createTime',
  313. key: 'createTime'
  314. },{
  315. title: '开票状态',
  316. dataIndex: 'status',
  317. key: 'status',
  318. render:(text,record)=>{
  319. return <div>
  320. {record.status === 3?<Button type="danger" onClick={(e) =>{ e.stopPropagation(),this.reject(record)}}>被拒,查看原因</Button>
  321. :getInvoiceStatus(text)}
  322. {record.status === 3?<Button type="primary" onClick={(e) =>{ e.stopPropagation(),this.recompose(record)}} style={{marginLeft:"10px"}}>修改开票</Button>
  323. :''}
  324. </div>
  325. }
  326. }
  327. ],
  328. dataSource: [],
  329. };
  330. },
  331. invoiceData(record) {
  332. let theorgCodeUrl = [];
  333. if (this.state.orgCodeUrl.length) {
  334. let picArr = [];
  335. this.state.orgCodeUrl.map(function (item) {
  336. if ( item.response && item.response.data && item.response.data.length ){
  337. picArr.push(item.response.data);
  338. }
  339. });
  340. theorgCodeUrl = picArr.join(",");
  341. };
  342. let api = '',
  343. api1 = '',
  344. method = '',
  345. fdata = {
  346. orderNo:this.state.orderNo3,
  347. type:this.state.type,
  348. status:this.state.status,
  349. approval:this.state.ordapproval,
  350. remarks:this.state.remarks,
  351. invoiceType:this.state.invoiceType,
  352. unitName:this.state.unitName,
  353. taxNumber:this.state.taxNumber,
  354. amount:parseFloat(this.state.amount),
  355. banks:this.state.banks,
  356. content:this.state.content,
  357. unitAddress:this.state.unitAddress,
  358. invoiceRemarks:this.state.invoiceRemarks,
  359. unitMobile:this.state.unitMobile,
  360. voucherUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  361. post:this.state.post,
  362. addressee:this.state.addressee,
  363. addresseeMobile:this.state.addresseeMobile,
  364. addresseeProvince:this.state.post === 0?this.state.ProvinceCity[0]:'',
  365. addresseeCity:this.state.post === 0?this.state.ProvinceCity[1]:'',
  366. addresseeArea:this.state.post === 0?this.state.ProvinceCity[2]:'',
  367. recipientAddress:this.state.recipientAddress,
  368. alreadyAmount:parseFloat(this.state.alreadyAmount)},
  369. sumData = {},
  370. sumData1 = {};
  371. switch (this.state.status) {
  372. case 0:api = '/api/admin/orderInvoice/createOrderInvoice';
  373. sumData = fdata;
  374. method = 'post'
  375. break;
  376. case 1:api = '/api/admin/orderInvoice/createOrderInvoice';
  377. api1 = '/api/admin/orderInvoice/updateOrderInvoice'
  378. sumData = fdata;
  379. sumData1 = {
  380. orderNo:this.state.orderNo3,
  381. type:this.state.type,
  382. status:this.state.status,
  383. approval:this.state.ordapproval,
  384. remarks:this.state.remarks,
  385. invoiceType:this.state.invoiceType,
  386. unitName:this.state.unitName,
  387. taxNumber:this.state.taxNumber,
  388. amount:parseFloat(this.state.amount),
  389. banks:this.state.banks,
  390. content:this.state.content,
  391. unitAddress:this.state.unitAddress,
  392. invoiceRemarks:this.state.invoiceRemarks,
  393. unitMobile:this.state.unitMobile,
  394. voucherUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  395. post:this.state.post,
  396. addressee:this.state.addressee,
  397. addresseeMobile:this.state.addresseeMobile,
  398. addresseeProvince:this.state.post === 0?this.state.ProvinceCity[0]:'',
  399. addresseeCity:this.state.post === 0?this.state.ProvinceCity[1]:'',
  400. addresseeArea:this.state.post === 0?this.state.ProvinceCity[2]:'',
  401. recipientAddress:this.state.recipientAddress,
  402. alreadyAmount:parseFloat(this.state.alreadyAmount)};
  403. sumData1.id = this.state.id;
  404. method = 'post'
  405. break;
  406. case 3:api = '/api/admin/orderInvoice/selectByIdOrderInvoice'
  407. sumData.id = record.id;
  408. method='get';
  409. break;
  410. default: api=''
  411. break;
  412. }
  413. if (this.state.status === 1 || this.state.status === 0) {
  414. if (typeof(this.state.type) !== 'number') {
  415. message.warning('省内/外不能为空')
  416. return
  417. }
  418. if (typeof(this.state.invoiceType) !== 'number') {
  419. message.warning('发票类型不能为空')
  420. return
  421. }
  422. if(typeof theorgCodeUrl !== 'string'){
  423. message.warning('未上传图片');
  424. return
  425. }
  426. if (!this.state.unitName) {
  427. message.warning('单位名称不能为空')
  428. return
  429. }
  430. if (!this.state.taxNumber) {
  431. message.warning('税号不能为空')
  432. return
  433. }
  434. if (!this.state.amount) {
  435. message.warning('金额不能为空')
  436. return
  437. }
  438. if (isNaN(this.state.amount)) {
  439. message.warning('开票金额包含非法字符,请重新输入')
  440. return
  441. }
  442. if (isNaN(this.state.alreadyAmount)) {
  443. message.warning('开票金额总计包含非法字符,请重新输入')
  444. return
  445. }
  446. if (parseFloat(this.state.alreadyAmount)<0) {
  447. message.warning('开票金额总计不能小于0,请重新输入')
  448. return
  449. }
  450. if (!this.state.banks) {
  451. message.warning('开户行不能为空')
  452. return
  453. }
  454. if (!this.state.content) {
  455. message.warning('开票内容及说明不能为空')
  456. return
  457. }
  458. if (!this.state.unitAddress) {
  459. message.warning('单位地址不能为空')
  460. return
  461. }
  462. if (!this.state.unitMobile) {
  463. message.warning('单位电话不能为空')
  464. return
  465. }
  466. if (this.state.alreadyAmount === '') {
  467. message.warning('开票金额总计不能为空')
  468. return
  469. }
  470. }
  471. // console.log(this.state.flag,this.state.status)
  472. this.setState({
  473. loading: true
  474. });
  475. $.ajax({
  476. method: method,
  477. dataType: "json",
  478. crossDomain: false,
  479. url: globalConfig.context + (this.state.flag?api1:api),
  480. data: this.state.flag?sumData1:sumData,
  481. success:function (data) {
  482. if(this.state.status === 3 && typeof data.data === 'object'){
  483. let thisdata = data.data;
  484. let ProvinceCityArr = [];
  485. let ProvinceS = thisdata.addresseeProvince; //省
  486. let citys = thisdata.addresseeCity;//市
  487. let Areas = thisdata.addresseeArea;//区
  488. ProvinceCityArr.push(ProvinceS, citys, Areas);
  489. this.setState({
  490. orderNo:thisdata.orderNo,
  491. type:thisdata.type,
  492. status:thisdata.status,
  493. ordapproval:thisdata.approval,
  494. remarks:thisdata.remarks,
  495. invoiceType:thisdata.invoiceType,
  496. unitName:thisdata.unitName,
  497. taxNumber:thisdata.taxNumber,
  498. amount:thisdata.amount,
  499. banks:thisdata.banks,
  500. content:thisdata.content,
  501. unitAddress:thisdata.unitAddress,
  502. invoiceRemarks:thisdata.invoiceRemarks,
  503. unitMobile:thisdata.unitMobile,
  504. post:thisdata.post,
  505. addressee:thisdata.addressee,
  506. addresseeMobile:thisdata.addresseeMobile,
  507. addresseeProvince:thisdata.addresseeProvince,
  508. addresseeCity:thisdata.addresseeCity,
  509. addresseeArea:thisdata.addresseeArea,
  510. alreadyAmount:thisdata.alreadyAmount,
  511. ProvinceCity: ProvinceCityArr[0]!=null?ProvinceCityArr:undefined,//省市区
  512. recipientAddress:thisdata.recipientAddress,
  513. orgCodeUrl: thisdata.voucherUrl ? splitUrl(thisdata.voucherUrl, ',', globalConfig.avatarHost + '/upload') : [],
  514. })
  515. }
  516. }.bind(this)
  517. }).done(function(data) {
  518. this.setState({
  519. loading: false
  520. });
  521. if(!data.error.length) {
  522. if(this.state.status === 1){
  523. message.success('提交成功!');
  524. this.visitCancels()
  525. if (this.state.flag) {
  526. this.inRecordData()
  527. }
  528. }else if(this.state.status === 0){
  529. message.success('保存成功!');
  530. this.visitCancels()
  531. }else if(this.state.status === 3){
  532. this.setState({
  533. flag:true
  534. })
  535. }
  536. } else {
  537. message.warning(data.error[0].message);
  538. }
  539. }.bind(this));
  540. },
  541. areset(){
  542. this.setState({
  543. remarks:'',
  544. type:undefined,
  545. orgCodeUrl:'',
  546. invoiceType:undefined,
  547. unitName:'',
  548. taxNumber:'',
  549. unitName:'',
  550. amount:'',
  551. banks:'',
  552. content:'',
  553. unitAddress:'',
  554. invoiceRemarks:'',
  555. unitMobile:'',
  556. post:undefined,
  557. addressee:'',
  558. addresseeMobile:'',
  559. addresseeProvince:'',
  560. addresseeCity:'',
  561. addresseeArea:'',
  562. recipientAddress:'',
  563. ordapproval:undefined,
  564. alreadyAmount:'',
  565. ProvinceCity:[]
  566. })
  567. },
  568. recompose(record){
  569. // console.log(record)
  570. this.setState({
  571. avisible:true,
  572. orderNo3:record.orderno,
  573. id:record.id
  574. })
  575. this.setState({
  576. status:3,
  577. cvisible:true,
  578. flag:false
  579. },()=>{
  580. this.invoiceData(record)
  581. })
  582. },
  583. submitApp(){
  584. if (this.state.status === 3) {
  585. this.setState({
  586. flag:true
  587. })
  588. }
  589. this.setState({
  590. status:1
  591. },()=>{
  592. this.invoiceData()
  593. })
  594. },
  595. saveApp(){
  596. this.setState({
  597. status:0
  598. },()=>{
  599. this.invoiceData()
  600. })
  601. },
  602. reject(record){
  603. this.setState({
  604. visibleR:true,
  605. reason:record.rejectReason
  606. });
  607. },
  608. rejectCancels(){
  609. this.setState({
  610. visibleR:false
  611. })
  612. },
  613. //开票
  614. visit(record,index){
  615. this.areset()
  616. this.setState({
  617. contractNo:this.state.dataSource[index].contractNo,
  618. orderNo3:record.orderNo,
  619. avisible:true,
  620. flag:false,
  621. invoiceType:0,
  622. alreadyAmount:0,
  623. unitName:this.state.dataSource[index].userName,
  624. post:1
  625. })
  626. },
  627. visitCancels(){
  628. this.setState({
  629. avisible:false,
  630. cvisible:false
  631. })
  632. },
  633. //查看开票历史记录详情
  634. dtableRowClick(record){
  635. this.setState({
  636. dvisible:true
  637. })
  638. this.setState({
  639. loading: true
  640. });
  641. $.ajax({
  642. method: "get",
  643. dataType: "json",
  644. crossDomain: false,
  645. url: globalConfig.context + '/api/admin/orderInvoice/selectByIdOrderInvoice',
  646. data:{
  647. id:record.id
  648. },
  649. success:function (data) {
  650. let thisdata = data.data;
  651. this.setState({
  652. contractNo:thisdata.contractNo,
  653. orderNo:thisdata.orderNo,
  654. ordapproval:thisdata.approval,
  655. type:thisdata.type,
  656. status:thisdata.status,
  657. remarks:thisdata.remarks,
  658. invoiceType:thisdata.invoiceType,
  659. unitName:thisdata.unitName,
  660. taxNumber:thisdata.taxNumber,
  661. amount:thisdata.amount,
  662. banks:thisdata.banks,
  663. content:thisdata.content,
  664. unitAddress:thisdata.unitAddress,
  665. invoiceRemarks:thisdata.invoiceRemarks,
  666. unitMobile:thisdata.unitMobile,
  667. post:thisdata.post,
  668. addressee:thisdata.addressee,
  669. addresseeMobile:thisdata.addresseeMobile,
  670. addresseeProvince:thisdata.addresseeProvince,
  671. addresseeCity:thisdata.addresseeCity,
  672. addresseeArea:thisdata.addresseeArea,
  673. alreadyAmount:thisdata.alreadyAmount,
  674. recipientAddress:thisdata.recipientAddress,
  675. orgCodeUrl: thisdata.voucherUrl ? splitUrl(thisdata.voucherUrl, ',', globalConfig.avatarHost + '/upload') : [],
  676. })
  677. }.bind(this)
  678. }).done(function() {
  679. this.setState({
  680. loading: false
  681. });
  682. }.bind(this));
  683. },
  684. //关闭开票历史记录详情
  685. dvisitCancels(){
  686. this.setState({
  687. dvisible:false
  688. })
  689. },
  690. inRecordData(){
  691. this.setState({
  692. loading: true
  693. });
  694. $.ajax({
  695. method: "get",
  696. dataType: "json",
  697. crossDomain: false,
  698. url: globalConfig.context + '/api/admin/orderInvoice/salesmanOrderInvoiceList',
  699. data: {
  700. orderNo:this.state.orderNo2
  701. },
  702. success: function (data) {
  703. let theArr = [];
  704. let sum = 0;
  705. if (!data.data) {
  706. if (data.error && data.error.length) {
  707. message.warning(data.error[0].message);
  708. };
  709. } else {
  710. for (let i = 0; i < data.data.list.length; i++) {
  711. let thisdata = data.data.list[i];
  712. sum += parseFloat(thisdata.amount);
  713. theArr.push({
  714. id: thisdata.id,
  715. orderno: thisdata.orderno,//订单编号
  716. amount:thisdata.amount,//签单金额
  717. createTime:thisdata.createTime,//流程状态
  718. status:thisdata.status,//结算状态
  719. rejectReason:thisdata.rejectReason
  720. });
  721. };
  722. };
  723. this.setState({
  724. recordData:theArr,
  725. sum:sum.toFixed(4)
  726. })
  727. }.bind(this),
  728. }).done(function() {
  729. this.setState({
  730. loading: false
  731. });
  732. }.bind(this));
  733. },
  734. inRecord(record){
  735. this.setState({
  736. bvisible:true,
  737. orderNo2:record.orderNo,
  738. },() => {this.inRecordData()})
  739. },
  740. inRecordCanl(){
  741. this.setState({
  742. bvisible:false
  743. })
  744. },
  745. //结项
  746. delectRow(record) {
  747. this.setState({
  748. loading: true
  749. });
  750. $.ajax({
  751. method: "get",
  752. dataType: "json",
  753. crossDomain: false,
  754. url: globalConfig.context + "/api/admin/newOrder/OrderOver",
  755. data: {
  756. orderNo:record.orderNo
  757. }
  758. }).done(function (data) {
  759. if (!data.error.length) {
  760. message.success('该项目已成功结项!');
  761. this.loadData();
  762. } else {
  763. message.warning(data.error[0].message);
  764. };
  765. this.setState({
  766. loading: false,
  767. });
  768. }.bind(this));
  769. },
  770. //是否退款
  771. refundCancel(record){
  772. this.refund(record,0)
  773. },
  774. refundOk(record){
  775. this.refund(record,1)
  776. },
  777. refund(record,index){
  778. this.setState({
  779. signBillVisible:false,
  780. selectedRowKeys: [],
  781. loading: true,
  782. userDetaile:false
  783. });
  784. $.ajax({
  785. method: "get",
  786. dataType: "json",
  787. crossDomain: false,
  788. url: globalConfig.context + '/api/admin/order/confirmRefund',
  789. data: {
  790. orderNo:record.orderNo,
  791. confirm:index
  792. }
  793. }).done(function (data) {
  794. if (!data.error.length) {
  795. message.success('操作成功!');
  796. this.setState({
  797. loading: false,
  798. showDesc:false
  799. });
  800. }
  801. this.loadData(this.state.pageNo);
  802. }.bind(this));
  803. },
  804. //受理订单
  805. admissibleOrderOk(e){
  806. this.admissibleOrder(e,true)
  807. },
  808. admissibleOrderCancel(e){
  809. this.admissibleOrder(e,false)
  810. },
  811. admissibleOrder(record,index) {
  812. this.setState({
  813. signBillVisible:false,
  814. selectedRowKeys: [],
  815. loading: true,
  816. userDetaile:false
  817. });
  818. $.ajax({
  819. method: "POST",
  820. dataType: "json",
  821. crossDomain: false,
  822. url: globalConfig.context + '/api/admin/order/confirmIntention',
  823. data: {
  824. orderNo:record.orderNo,
  825. confirm:index
  826. }
  827. }).done(function (data) {
  828. if (!data.error.length) {
  829. message.success('操作成功!');
  830. this.setState({
  831. loading: false,
  832. showDesc:false
  833. });
  834. } else {
  835. message.warning(data.error[0].message);
  836. this.setState({
  837. showDesc:true
  838. })
  839. };
  840. this.loadData(this.state.pageNo);
  841. }.bind(this));
  842. },
  843. //取消订单
  844. cancelOrder(e){
  845. this.operation(e,3)
  846. },
  847. //作废订单
  848. scrapOrder(e){
  849. this.operation(e,2)
  850. },
  851. //锁定订单
  852. lockOrder(e){
  853. this.operation(e,0)
  854. },
  855. //解锁订单
  856. unlockOrder(e){
  857. this.operation(e,1)
  858. },
  859. //签单
  860. signBill(ids){
  861. this.setState({
  862. uid:ids,
  863. signBillVisible:true
  864. })
  865. },
  866. componentWillMount() {
  867. this.departmentList();
  868. this.loadData();
  869. let data=localStorage.getItem('newData');
  870. if(data!='{}'&&data){
  871. var newData = JSON.parse(data);
  872. this.tableRowClick(newData);
  873. };
  874. },
  875. tableRowClick(record) {
  876. this.state.userDetaile=true;
  877. this.state.datauser = record;
  878. this.setState({
  879. signBillVisible:false,
  880. signBillState:true,
  881. showDesc: true
  882. });
  883. localStorage.setItem('newData','{}');
  884. },
  885. //列表各种骚操作
  886. operation(record,index) {
  887. this.setState({
  888. selectedRowKeys: [],
  889. loading: true,
  890. showDesc:false
  891. });
  892. $.ajax({
  893. method: "get",
  894. dataType: "json",
  895. crossDomain: false,
  896. url: globalConfig.context + '/api/admin/order/lockOrRevokeOrder',
  897. data: {
  898. orderNo:record.orderNo,
  899. operatorType:index
  900. }
  901. }).done(function (data) {
  902. if (!data.error.length) {
  903. message.success('操作成功!');
  904. this.setState({
  905. loading: false,
  906. });
  907. } else {
  908. message.warning(data.error[0].message);
  909. };
  910. this.loadData(this.state.pageNo);
  911. }.bind(this));
  912. },
  913. addClick() {
  914. this.state.userDetaile=false;
  915. this.setState({
  916. signBillVisible:false,
  917. showDesc: true
  918. });
  919. },
  920. closeDesc(e, s) {
  921. this.state.userDetaile=false;
  922. this.state.signBillVisible=false;
  923. this.state.showDesc = e;
  924. if (s) {
  925. this.loadData(this.state.pageNo);
  926. };
  927. },
  928. searchSwitch() {
  929. this.setState({
  930. signBillVisible:false,
  931. searchMore: !this.state.searchMore
  932. });
  933. },
  934. getOrgCodeUrl(e) {
  935. this.setState({ orgCodeUrl: e });
  936. },
  937. search() {
  938. this.setState({
  939. signBillVisible:false
  940. })
  941. this.loadData();
  942. },
  943. reset() {
  944. this.setState({
  945. signBillVisible:false
  946. })
  947. this.state.searchOrderNo=undefined;
  948. this.state.orderNo='';
  949. this.state.customerName='';
  950. this.state.departmenttSearch=undefined;
  951. this.state.releaseDate[0] = undefined;
  952. this.state.releaseDate[1] = undefined;
  953. this.state.projectProgress = undefined;
  954. this.state.approval= undefined;
  955. this.state.formalOrder=true;
  956. this.state.intentOrder=true;
  957. this.loadData();
  958. },
  959. //部门
  960. departmentList() {
  961. this.setState({
  962. loading: true
  963. });
  964. $.ajax({
  965. method: "get",
  966. dataType: "json",
  967. crossDomain: false,
  968. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  969. data: {
  970. },
  971. success: function(data) {
  972. let thedata = data.data;
  973. let theArr = [];
  974. if(!thedata) {
  975. if(data.error && data.error.length) {
  976. message.warning(data.error[0].message);
  977. };
  978. thedata = {};
  979. } else {
  980. thedata.map(function(item, index) {
  981. theArr.push({
  982. key: index,
  983. name: item.name,
  984. id: item.id,
  985. })
  986. })
  987. }
  988. this.setState({
  989. departmentArr: theArr,
  990. })
  991. }.bind(this),
  992. }).always(function() {
  993. this.setState({
  994. loading: false
  995. });
  996. }.bind(this));
  997. },
  998. render() {
  999. const FormItem = Form.Item;
  1000. const formItemLayout = {
  1001. labelCol: { span: 8 },
  1002. wrapperCol: { span: 14 },
  1003. };
  1004. const RadioGroup = Radio.Group;
  1005. const { RangePicker } = DatePicker;
  1006. return (
  1007. <div className="user-content" >
  1008. <ShowModalDiv ShowModal={this.state.showModal} />
  1009. <div className="content-title">
  1010. <span style={{fontSize:'16px'}}>开单与签单</span>
  1011. <div className="user-search">
  1012. <Input placeholder="客户名称" style={{width:'150px'}}
  1013. value={this.state.customerName}
  1014. onChange={(e) => { this.setState({ customerName: e.target.value }); }} />
  1015. <Input placeholder="订单编号" style={{width:'150px'}}
  1016. value={this.state.searchOrderNo}
  1017. onChange={(e) => { this.setState({ searchOrderNo: e.target.value }); }} />
  1018. <span style={{marginRight:"10px"}}>下单时间 :</span>
  1019. <RangePicker
  1020. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  1021. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  1022. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  1023. <Button type="primary" onClick={this.search} style={{marginLeft:'10px'}}>搜索<Icon type="search" /></Button>
  1024. <Button onClick={this.reset}>重置 <Icon type="reload" /></Button>
  1025. <Button type="primary" className="addButton" onClick={this.addClick} >开单<Icon type="plus" /></Button>
  1026. </div>
  1027. <div className="patent-table">
  1028. <Spin spinning={this.state.loading}>
  1029. <Table columns={this.state.columns}
  1030. dataSource={this.state.dataSource}
  1031. scroll={{ x: 1500, y: 0 }}
  1032. pagination={this.state.pagination}
  1033. onRowClick={this.tableRowClick} />
  1034. </Spin>
  1035. </div>
  1036. <NewService
  1037. uid={this.state.uid}
  1038. signBillVisible={this.state.signBillVisible}
  1039. signBillState={this.state.signBillState}
  1040. operation={this.operation}
  1041. admissibleOrder={this.admissibleOrder}
  1042. userDetaile={this.state.userDetaile}
  1043. datauser={this.state.datauser}
  1044. showDesc={this.state.showDesc}
  1045. closeDesc={this.closeDesc} />
  1046. <Modal
  1047. className="admin-desc-content"
  1048. footer=''
  1049. title = '开具发票申请单'
  1050. width='1000px'
  1051. visible={this.state.avisible}
  1052. onOk={this.visitOks}
  1053. onCancel={this.visitCancels}
  1054. style={{zIndex:999}}
  1055. >
  1056. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1057. <Spin spinning={this.state.loading}>
  1058. <div className="clearfix">
  1059. <div className="clearfix">
  1060. <FormItem className="half-item"
  1061. {...formItemLayout}
  1062. label="合同编号" >
  1063. <span>{this.state.contractNo}</span>
  1064. </FormItem>
  1065. <FormItem className="half-item"
  1066. {...formItemLayout}
  1067. label="备注" >
  1068. {<Input placeholder="填写申请发票原因" value={this.state.remarks}
  1069. onChange={(e)=>{this.setState({remarks:e.target.value})}} style={{width:'240px'}} />}
  1070. </FormItem>
  1071. </div>
  1072. <div className="clearfix">
  1073. <FormItem className="half-item"
  1074. {...formItemLayout}
  1075. label="省内/外:" >
  1076. <RadioGroup value={this.state.type}
  1077. onChange={(e)=>{this.setState({type:e.target.value})}}
  1078. >
  1079. <Radio value={0}>省内</Radio>
  1080. <Radio value={1}>省外</Radio>
  1081. </RadioGroup>
  1082. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'20px'}}>
  1083. 省内:湖南省<br></br>省外:除湖南省以外
  1084. </span>
  1085. </FormItem>
  1086. <FormItem className="half-item"
  1087. {...formItemLayout}
  1088. label="特批:" >
  1089. <RadioGroup value={this.state.ordapproval}
  1090. onChange={(e)=>{this.setState({ordapproval:e.target.value})}}
  1091. >
  1092. <Radio value={0}>否</Radio>
  1093. <Radio value={1}>是</Radio>
  1094. </RadioGroup>
  1095. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px'}}>
  1096. 注:特批单,省内省外,<br></br>分别由周总,省外总经理<br></br>特批后,方可至开票流程
  1097. </span>
  1098. </FormItem>
  1099. </div>
  1100. <hr style={{border:'1px dashed #aaa', width:"90%",margin:'auto'}}/>
  1101. <div style={{marginTop:'13px',marginLeft:'16px'}}>
  1102. <span style={{fontSize:'14px'}}>发票内容</span>
  1103. </div>
  1104. <div className="clearfix">
  1105. <FormItem className="half-item"
  1106. {...formItemLayout}
  1107. label={
  1108. <span>
  1109. <strong style={{ color: '#f00' }}>*</strong>发票类型
  1110. </span>
  1111. } >
  1112. <RadioGroup style={{width:'160%'}}
  1113. onChange={(e)=>{this.setState({invoiceType:e.target.value})}}
  1114. value={this.state.invoiceType}
  1115. >
  1116. <Radio value={0}>增值税专用发票</Radio>
  1117. <Radio value={1}>增值税普通发票</Radio>
  1118. <Radio value={2}>其他</Radio>
  1119. </RadioGroup>
  1120. </FormItem>
  1121. </div>
  1122. <div className="clearfix">
  1123. <FormItem className="half-item"
  1124. {...formItemLayout}
  1125. label={
  1126. <span>
  1127. <strong style={{ color: '#f00' }}>*</strong>单位名称
  1128. </span>
  1129. } >
  1130. {<Input placeholder="请输入单位名称" value={this.state.unitName}
  1131. onChange={(e)=>{this.setState({unitName:e.target.value})}} style={{width:'240px'}} />}
  1132. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',width:'30%'}}>
  1133. 系统读取单位<br></br>名称,可修改
  1134. </span>
  1135. </FormItem>
  1136. <FormItem className="half-item"
  1137. {...formItemLayout}
  1138. label={
  1139. <span>
  1140. <strong style={{ color: '#f00' }}>*</strong>税号
  1141. </span>
  1142. } >
  1143. {<Input placeholder="请输入税号" value={this.state.taxNumber}
  1144. onChange={(e)=>{this.setState({taxNumber:e.target.value})}} style={{width:'240px'}} />}
  1145. </FormItem>
  1146. <FormItem className="half-item"
  1147. {...formItemLayout}
  1148. label={
  1149. <span>
  1150. <strong style={{ color: '#f00' }}>*</strong>开票金额(万元)
  1151. </span>
  1152. } >
  1153. {<Input placeholder="请输入开票金额" value={this.state.amount}
  1154. onChange={(e)=>{this.setState({amount:e.target.value})}} style={{width:'240px'}} />}
  1155. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',width:'30%'}}>
  1156. 退票请写负数<br></br>金额
  1157. </span>
  1158. </FormItem>
  1159. <FormItem className="half-item"
  1160. {...formItemLayout}
  1161. label={
  1162. <span>
  1163. <strong style={{ color: '#f00' }}>*</strong>开户行及银行账号
  1164. </span>
  1165. } >
  1166. {<Input placeholder="请输入开户行及银行账号" value={this.state.banks}
  1167. onChange={(e)=>{this.setState({banks:e.target.value})}} style={{width:'240px'}} />}
  1168. </FormItem>
  1169. <FormItem className="half-item"
  1170. {...formItemLayout}
  1171. label={
  1172. <span>
  1173. <strong style={{ color: '#f00' }}>*</strong>开票内容及说明
  1174. </span>
  1175. } >
  1176. {<Input placeholder="请输入开票内容及说明" value={this.state.content}
  1177. onChange={(e)=>{this.setState({content:e.target.value})}} style={{width:'240px'}} />}
  1178. </FormItem>
  1179. <FormItem className="half-item"
  1180. {...formItemLayout}
  1181. label={
  1182. <span>
  1183. <strong style={{ color: '#f00' }}>*</strong>单位地址
  1184. </span>
  1185. } >
  1186. {<Input placeholder="请输入单位地址" value={this.state.unitAddress}
  1187. onChange={(e)=>{this.setState({unitAddress:e.target.value})}} style={{width:'240px'}} />}
  1188. </FormItem>
  1189. <FormItem className="half-item"
  1190. {...formItemLayout}
  1191. label="备注" >
  1192. {<Input placeholder="请备注开票公司名称" value={this.state.invoiceRemarks}
  1193. onChange={(e)=>{this.setState({invoiceRemarks:e.target.value})}} style={{width:'240px'}} />}
  1194. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',width:'30%'}}>
  1195. 开票公司名称,<br></br>如:科德集团
  1196. </span>
  1197. </FormItem>
  1198. <FormItem className="half-item"
  1199. {...formItemLayout}
  1200. label={
  1201. <span>
  1202. <strong style={{ color: '#f00' }}>*</strong>单位电话
  1203. </span>
  1204. } >
  1205. {<Input placeholder="请输入单位电话" value={this.state.unitMobile}
  1206. onChange={(e)=>{this.setState({unitMobile:e.target.value})}} style={{width:'240px'}} />}
  1207. </FormItem>
  1208. </div>
  1209. <div className="clearfix">
  1210. <FormItem
  1211. labelCol={{ span: 4 }}
  1212. wrapperCol={{ span: 18 }}
  1213. label={
  1214. <span>
  1215. <strong style={{ color: '#f00' }}>*</strong>上传附件
  1216. </span>
  1217. }
  1218. >
  1219. <PicturesWall
  1220. fileList={this.getOrgCodeUrl}
  1221. pictureUrl={this.state.orgCodeUrl} />
  1222. <span style={{paddingTop:'10px',paddingLeft:'10px',color:'red',fontSize:'14px'}}>注:请上传带"公司盖章"的开票申请纸质凭证</span>
  1223. <p>图片建议:要清晰。</p>
  1224. </FormItem>
  1225. </div>
  1226. <hr style={{border:'1px dashed #aaa', width:"90%",margin:'auto'}}/>
  1227. <div className="clearfix" style={{marginTop:'10px'}}>
  1228. <FormItem className="half-item"
  1229. {...formItemLayout}
  1230. label="发票是否邮寄:" >
  1231. <RadioGroup value={this.state.post}
  1232. onChange={(e)=>{this.setState({post:e.target.value})}}
  1233. >
  1234. <Radio value={0}>是</Radio>
  1235. <Radio value={1}>否</Radio>
  1236. </RadioGroup>
  1237. </FormItem>
  1238. </div>
  1239. {this.state.post === 0?<div className="clearfix">
  1240. <FormItem className="half-item"
  1241. {...formItemLayout}
  1242. label="收信人姓名" >
  1243. {<Input placeholder="请输入收信人姓名" value={this.state.addressee}
  1244. onChange={(e)=>{this.setState({addressee:e.target.value})}} style={{width:'240px'}} />}
  1245. </FormItem>
  1246. <FormItem className="half-item"
  1247. {...formItemLayout}
  1248. label="电话" >
  1249. {<Input placeholder="请输入电话" value={this.state.addresseeMobile}
  1250. onChange={(e)=>{this.setState({addresseeMobile:e.target.value})}} style={{width:'240px'}} />}
  1251. </FormItem>
  1252. </div>:''}
  1253. {this.state.post === 0?<div className="clearfix">
  1254. <FormItem className="half-item"
  1255. {...formItemLayout}
  1256. label="省-市-区"
  1257. >
  1258. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'95%'}}
  1259. onChange={(e) => { this.setState({ ProvinceCity: e }) }} />
  1260. </FormItem>
  1261. </div>:''}
  1262. {this.state.post === 0?<div className="clearfix">
  1263. <FormItem className="half-item"
  1264. {...formItemLayout}
  1265. label="详细地址"
  1266. >
  1267. {<Input placeholder="请输入详细地址" value={this.state.recipientAddress}
  1268. onChange={(e)=>{this.setState({recipientAddress:e.target.value})}} style={{width:'240px'}} />}
  1269. </FormItem>
  1270. </div>:''}
  1271. <FormItem className="half-item"
  1272. {...formItemLayout}
  1273. label={
  1274. <span>
  1275. <strong style={{ color: '#f00' }}>*</strong>开票金额总计
  1276. </span>
  1277. } >
  1278. {<Input value={this.state.alreadyAmount}
  1279. onChange={(e)=>{this.setState({alreadyAmount:e.target.value})}} style={{width:'40px'}} />}万元
  1280. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',marginLeft:'20px'}}>
  1281. 默认值为0.新开票订单此项不用填.<br></br>以前已开票订单,请填写已开票的总计<br></br>金额,便于审核核对!
  1282. </span>
  1283. </FormItem>
  1284. </div>
  1285. <Button className="cancel" type="primary" style={{marginRight:"50px",float:'right'}} size="large" onClick={this.submitApp}>提交申请</Button>
  1286. {/*<Button className="cancel" type="primary" style={{marginRight:"50px",float:'right',background:'deepskyblue',border:'none'}} size="large" onClick={this.saveApp}>保存</Button>*/}
  1287. </Spin>
  1288. </Form>
  1289. </Modal>
  1290. <Modal visible={this.state.bvisible}
  1291. footer=''
  1292. title='开票历史记录'
  1293. className="admin-desc-content"
  1294. width='900px'
  1295. onCancel={this.inRecordCanl}
  1296. style={{zIndex:5}}>
  1297. <Spin spinning={this.state.loading}>
  1298. <div className="patent-table">
  1299. <Table columns={this.state.columnsDate}
  1300. onRowClick={this.dtableRowClick}
  1301. dataSource={this.state.recordData}
  1302. pagination={false}/>
  1303. <div className="clearfix" style={{marginTop:'20px'}}>
  1304. <FormItem className="half-item"
  1305. {...formItemLayout}
  1306. label={
  1307. <span style={{fontSize:'14px'}}>
  1308. 开票总计
  1309. </span>
  1310. } >
  1311. <span>{this.state.sum+'(万元)'}</span>
  1312. </FormItem>
  1313. </div>
  1314. </div>
  1315. </Spin>
  1316. </Modal>
  1317. <Modal visible={this.state.visibleR}
  1318. className="admin-desc-content"
  1319. footer=''
  1320. title = '拒绝理由'
  1321. width='400px'
  1322. onCancel={this.rejectCancels}>
  1323. <Input.TextArea disabled={true}
  1324. rows={4}
  1325. value={this.state.reason}
  1326. style={{color:'black'}}>
  1327. </Input.TextArea>
  1328. </Modal>
  1329. <Modal
  1330. className="admin-desc-content"
  1331. footer=''
  1332. title = '开具发票申请单'
  1333. width='1000px'
  1334. visible={this.state.cvisible}
  1335. onOk={this.visitOks}
  1336. onCancel={this.visitCancels}
  1337. style={{zIndex:999}}
  1338. >
  1339. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1340. <Spin spinning={this.state.loading}>
  1341. <div className="clearfix">
  1342. <div className="clearfix">
  1343. <FormItem className="half-item"
  1344. {...formItemLayout}
  1345. label="合同编号" >
  1346. <span>{this.state.contractNo}</span>
  1347. </FormItem>
  1348. <FormItem className="half-item"
  1349. {...formItemLayout}
  1350. label="备注" >
  1351. {<Input placeholder="填写申请发票原因" value={this.state.remarks}
  1352. onChange={(e)=>{this.setState({remarks:e.target.value})}} style={{width:'240px'}} />}
  1353. </FormItem>
  1354. </div>
  1355. <div className="clearfix">
  1356. <FormItem className="half-item"
  1357. {...formItemLayout}
  1358. label="省内/外:" >
  1359. <RadioGroup value={this.state.type}
  1360. onChange={(e)=>{this.setState({type:e.target.value})}}
  1361. >
  1362. <Radio value={0}>省内</Radio>
  1363. <Radio value={1}>省外</Radio>
  1364. </RadioGroup>
  1365. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'20px'}}>
  1366. 省内:湖南省<br></br>省外:除湖南省以外
  1367. </span>
  1368. </FormItem>
  1369. <FormItem className="half-item"
  1370. {...formItemLayout}
  1371. label="特批:" >
  1372. <RadioGroup value={!this.state.ordapproval?0:1}
  1373. onChange={(e)=>{this.setState({ordapproval:e.target.value})}}
  1374. >
  1375. <Radio value={0}>否</Radio>
  1376. <Radio value={1}>是</Radio>
  1377. </RadioGroup>
  1378. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px'}}>
  1379. 注:特批单,省内省外,<br></br>分别由周总,省外总经理<br></br>特批后,方可至开票流程
  1380. </span>
  1381. </FormItem>
  1382. </div>
  1383. <hr style={{border:'1px dashed #aaa', width:"90%",margin:'auto'}}/>
  1384. <div style={{marginTop:'13px',marginLeft:'16px'}}>
  1385. <span style={{fontSize:'14px'}}>发票内容</span>
  1386. </div>
  1387. <div className="clearfix">
  1388. <FormItem className="half-item"
  1389. {...formItemLayout}
  1390. label={
  1391. <span>
  1392. <strong style={{ color: '#f00' }}>*</strong>发票类型
  1393. </span>
  1394. } >
  1395. <RadioGroup style={{width:'160%'}}
  1396. onChange={(e)=>{this.setState({invoiceType:e.target.value})}}
  1397. value={this.state.invoiceType}
  1398. >
  1399. <Radio value={0}>增值税专用发票</Radio>
  1400. <Radio value={1}>增值税普通发票</Radio>
  1401. <Radio value={2}>其他</Radio>
  1402. </RadioGroup>
  1403. </FormItem>
  1404. </div>
  1405. <div className="clearfix">
  1406. <FormItem className="half-item"
  1407. {...formItemLayout}
  1408. label={
  1409. <span>
  1410. <strong style={{ color: '#f00' }}>*</strong>单位名称
  1411. </span>
  1412. } >
  1413. {<Input placeholder="请输入单位名称" value={this.state.unitName}
  1414. onChange={(e)=>{this.setState({unitName:e.target.value})}} style={{width:'240px'}} />}
  1415. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',width:'30%'}}>
  1416. 系统读取单位<br></br>名称,可修改
  1417. </span>
  1418. </FormItem>
  1419. <FormItem className="half-item"
  1420. {...formItemLayout}
  1421. label={
  1422. <span>
  1423. <strong style={{ color: '#f00' }}>*</strong>税号
  1424. </span>
  1425. } >
  1426. {<Input placeholder="请输入税号" value={this.state.taxNumber}
  1427. onChange={(e)=>{this.setState({taxNumber:e.target.value})}} style={{width:'240px'}} />}
  1428. </FormItem>
  1429. <FormItem className="half-item"
  1430. {...formItemLayout}
  1431. label={
  1432. <span>
  1433. <strong style={{ color: '#f00' }}>*</strong>开票金额(万元)
  1434. </span>
  1435. } >
  1436. {<Input placeholder="请输入开票金额" value={this.state.amount}
  1437. onChange={(e)=>{this.setState({amount:e.target.value})}} style={{width:'240px'}} />}
  1438. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',width:'30%'}}>
  1439. 填写本次开票<br></br>金额
  1440. </span>
  1441. </FormItem>
  1442. <FormItem className="half-item"
  1443. {...formItemLayout}
  1444. label={
  1445. <span>
  1446. <strong style={{ color: '#f00' }}>*</strong>开户行及银行账号
  1447. </span>
  1448. } >
  1449. {<Input placeholder="请输入开户行及银行账号" value={this.state.banks}
  1450. onChange={(e)=>{this.setState({banks:e.target.value})}} style={{width:'240px'}} />}
  1451. </FormItem>
  1452. <FormItem className="half-item"
  1453. {...formItemLayout}
  1454. label={
  1455. <span>
  1456. <strong style={{ color: '#f00' }}>*</strong>开票内容及说明
  1457. </span>
  1458. } >
  1459. {<Input placeholder="请输入开票内容及说明" value={this.state.content}
  1460. onChange={(e)=>{this.setState({content:e.target.value})}} style={{width:'240px'}} />}
  1461. </FormItem>
  1462. <FormItem className="half-item"
  1463. {...formItemLayout}
  1464. label={
  1465. <span>
  1466. <strong style={{ color: '#f00' }}>*</strong>单位地址
  1467. </span>
  1468. } >
  1469. {<Input placeholder="请输入单位地址" value={this.state.unitAddress}
  1470. onChange={(e)=>{this.setState({unitAddress:e.target.value})}} style={{width:'240px'}} />}
  1471. </FormItem>
  1472. <FormItem className="half-item"
  1473. {...formItemLayout}
  1474. label="备注" >
  1475. {<Input placeholder="请备注开票公司名称" value={this.state.invoiceRemarks}
  1476. onChange={(e)=>{this.setState({invoiceRemarks:e.target.value})}} style={{width:'240px'}} />}
  1477. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',width:'30%'}}>
  1478. 开票公司名称,<br></br>如:科德集团
  1479. </span>
  1480. </FormItem>
  1481. <FormItem className="half-item"
  1482. {...formItemLayout}
  1483. label={
  1484. <span>
  1485. <strong style={{ color: '#f00' }}>*</strong>单位电话
  1486. </span>
  1487. } >
  1488. {<Input placeholder="请输入单位电话" value={this.state.unitMobile}
  1489. onChange={(e)=>{this.setState({unitMobile:e.target.value})}} style={{width:'240px'}} />}
  1490. </FormItem>
  1491. </div>
  1492. <div className="clearfix">
  1493. <FormItem
  1494. labelCol={{ span: 4 }}
  1495. wrapperCol={{ span: 18 }}
  1496. label={
  1497. <span>
  1498. <strong style={{ color: '#f00' }}>*</strong>上传附件
  1499. </span>
  1500. }
  1501. >
  1502. <PicturesWall
  1503. fileList={this.getOrgCodeUrl}
  1504. pictureUrl={this.state.orgCodeUrl} />
  1505. <span style={{paddingTop:'10px',paddingLeft:'10px',color:'red',fontSize:'14px'}}>注:请上传带"公司盖章"的开票申请纸质凭证</span>
  1506. <p>图片建议:要清晰。</p>
  1507. </FormItem>
  1508. </div>
  1509. <hr style={{border:'1px dashed #aaa', width:"90%",margin:'auto'}}/>
  1510. <div className="clearfix" style={{marginTop:'10px'}}>
  1511. <FormItem className="half-item"
  1512. {...formItemLayout}
  1513. label="发票是否邮寄:" >
  1514. <RadioGroup value={this.state.post}
  1515. onChange={(e)=>{this.setState({post:e.target.value})}}
  1516. >
  1517. <Radio value={0}>是</Radio>
  1518. <Radio value={1}>否</Radio>
  1519. </RadioGroup>
  1520. </FormItem>
  1521. </div>
  1522. {this.state.post === 0?<div className="clearfix">
  1523. <FormItem className="half-item"
  1524. {...formItemLayout}
  1525. label="收信人姓名" >
  1526. {<Input placeholder="请输入收信人姓名" value={this.state.addressee}
  1527. onChange={(e)=>{this.setState({addressee:e.target.value})}} style={{width:'240px'}} />}
  1528. </FormItem>
  1529. <FormItem className="half-item"
  1530. {...formItemLayout}
  1531. label="电话" >
  1532. {<Input placeholder="请输入电话" value={this.state.addresseeMobile}
  1533. onChange={(e)=>{this.setState({addresseeMobile:e.target.value})}} style={{width:'240px'}} />}
  1534. </FormItem>
  1535. </div>:''}
  1536. {this.state.post === 0?<div className="clearfix">
  1537. <FormItem className="half-item"
  1538. {...formItemLayout}
  1539. label="省-市-区"
  1540. >
  1541. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'95%'}}
  1542. onChange={(e) => { this.setState({ ProvinceCity: e }) }} />
  1543. </FormItem>
  1544. </div>:''}
  1545. {this.state.post === 0?<div className="clearfix">
  1546. <FormItem className="half-item"
  1547. {...formItemLayout}
  1548. label="详细地址"
  1549. >
  1550. {<Input placeholder="请输入详细地址" value={this.state.recipientAddress}
  1551. onChange={(e)=>{this.setState({recipientAddress:e.target.value})}} style={{width:'240px'}} />}
  1552. </FormItem>
  1553. </div>:''}
  1554. <FormItem className="half-item"
  1555. {...formItemLayout}
  1556. label={
  1557. <span>
  1558. <strong style={{ color: '#f00' }}>*</strong>开票金额总计
  1559. </span>
  1560. } >
  1561. {<Input value={this.state.alreadyAmount}
  1562. onChange={(e)=>{this.setState({alreadyAmount:e.target.value})}} style={{width:'40px'}} />}万元
  1563. <span style={{position:'absolute',color:'red',fontSize:'10px',lineHeight:'15px',marginLeft:'20px'}}>
  1564. 默认值为0.新开票订单此项不用填.<br></br>以前已开票订单,请填写已开票的总计<br></br>金额,便于审核核对!
  1565. </span>
  1566. </FormItem>
  1567. </div>
  1568. <Button className="cancel" type="primary" style={{marginRight:"50px",float:'right'}} size="large" onClick={this.submitApp}>提交申请</Button>
  1569. {/*<Button className="cancel" type="primary" style={{marginRight:"50px",float:'right',background:'deepskyblue',border:'none'}} size="large" onClick={this.saveApp}>保存</Button>*/}
  1570. </Spin>
  1571. </Form>
  1572. </Modal>
  1573. <Modal
  1574. className="admin-desc-content"
  1575. footer=''
  1576. title = '开具发票申请单'
  1577. width='900px'
  1578. visible={this.state.dvisible}
  1579. onOk={this.visitOks}
  1580. onCancel={this.dvisitCancels}
  1581. >
  1582. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1583. <Spin spinning={this.state.loading}>
  1584. <div className="clearfix">
  1585. <div className="clearfix">
  1586. <FormItem className="half-item"
  1587. {...formItemLayout}
  1588. label="合同编号" >
  1589. <span>{this.state.contractNo}</span>
  1590. </FormItem>
  1591. <FormItem className="half-item"
  1592. {...formItemLayout}
  1593. label="备注" >
  1594. <span>{this.state.remarks}</span>
  1595. </FormItem>
  1596. </div>
  1597. <div className="clearfix">
  1598. <FormItem className="half-item"
  1599. {...formItemLayout}
  1600. label={
  1601. <span>
  1602. <strong style={{ color: '#f00' }}>*</strong>省内/外
  1603. </span>
  1604. } >
  1605. <span>{getProvinceA(this.state.type)}</span>
  1606. </FormItem>
  1607. <FormItem className="half-item"
  1608. {...formItemLayout}
  1609. label={
  1610. <span>
  1611. <strong style={{ color: '#f00' }}>*</strong>特批
  1612. </span>
  1613. } >
  1614. <span>{this.state.ordapproval === 0?'否':'是'}</span>
  1615. </FormItem>
  1616. </div>
  1617. <hr style={{border:'1px dashed #aaa', width:"90%",margin:'auto'}}/>
  1618. <div style={{marginTop:'13px',marginLeft:'16px'}}>
  1619. <span style={{fontSize:'14px'}}>发票内容</span>
  1620. </div>
  1621. <div className="clearfix">
  1622. <FormItem className="half-item"
  1623. {...formItemLayout}
  1624. label={
  1625. <span>
  1626. <strong style={{ color: '#f00' }}>*</strong>发票类型
  1627. </span>
  1628. } >
  1629. <span>{this.state.invoiceType===0?'增值税专用发票':(this.state.invoiceType === 1?'增值税普通发票':'其他')}</span>
  1630. </FormItem>
  1631. </div>
  1632. <div className="clearfix">
  1633. <FormItem className="half-item"
  1634. {...formItemLayout}
  1635. label={
  1636. <span>
  1637. <strong style={{ color: '#f00' }}>*</strong>单位名称
  1638. </span>
  1639. } >
  1640. <span>{this.state.unitName}</span>
  1641. </FormItem>
  1642. <FormItem className="half-item"
  1643. {...formItemLayout}
  1644. label={
  1645. <span>
  1646. <strong style={{ color: '#f00' }}>*</strong>税号
  1647. </span>
  1648. } >
  1649. <span>{this.state.taxNumber}</span>
  1650. </FormItem>
  1651. <FormItem className="half-item"
  1652. {...formItemLayout}
  1653. label={
  1654. <span>
  1655. <strong style={{ color: '#f00' }}>*</strong>开票金额(万元)
  1656. </span>
  1657. } >
  1658. <span>{this.state.amount}</span>
  1659. </FormItem>
  1660. <FormItem className="half-item"
  1661. {...formItemLayout}
  1662. label={
  1663. <span>
  1664. <strong style={{ color: '#f00' }}>*</strong>开户行银行账号
  1665. </span>
  1666. } >
  1667. <span>{this.state.banks}</span>
  1668. </FormItem>
  1669. <FormItem className="half-item"
  1670. {...formItemLayout}
  1671. label={
  1672. <span>
  1673. <strong style={{ color: '#f00' }}>*</strong>开票内容及说明
  1674. </span>
  1675. } >
  1676. <span>{this.state.content}</span>
  1677. </FormItem>
  1678. <FormItem className="half-item"
  1679. {...formItemLayout}
  1680. label={
  1681. <span>
  1682. <strong style={{ color: '#f00' }}>*</strong>单位地址
  1683. </span>
  1684. } >
  1685. <span>{this.state.unitAddress}</span>
  1686. </FormItem>
  1687. <FormItem className="half-item"
  1688. {...formItemLayout}
  1689. label="备注" >
  1690. <span>{this.state.invoiceRemarks}</span>
  1691. </FormItem>
  1692. <FormItem className="half-item"
  1693. {...formItemLayout}
  1694. label={
  1695. <span>
  1696. <strong style={{ color: '#f00' }}>*</strong>单位电话
  1697. </span>
  1698. } >
  1699. <span>{this.state.unitMobile}</span>
  1700. </FormItem>
  1701. </div>
  1702. <div className="clearfix">
  1703. <FormItem
  1704. labelCol={{ span: 4 }}
  1705. wrapperCol={{ span: 18 }}
  1706. label={
  1707. <span>
  1708. <strong style={{ color: '#f00' }}>*</strong>附件
  1709. </span>
  1710. }
  1711. >
  1712. <Upload className="demandDetailShow-upload"
  1713. listType="picture-card"
  1714. fileList={this.state.orgCodeUrl}
  1715. onPreview={(file) => {
  1716. this.setState({
  1717. previewImage: file.url || file.thumbUrl,
  1718. previewVisible: true,
  1719. });
  1720. }} >
  1721. </Upload>
  1722. <Modal maskClosable={false} footer={null}
  1723. visible={this.state.previewVisible}
  1724. onCancel={() => { this.setState({ previewVisible: false }) }}>
  1725. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  1726. </Modal>
  1727. </FormItem>
  1728. </div>
  1729. <hr style={{border:'1px dashed #aaa', width:"90%",margin:'auto'}}/>
  1730. <div className="clearfix" style={{marginTop:'10px'}}>
  1731. <FormItem className="half-item"
  1732. {...formItemLayout}
  1733. label="发票是否邮寄:" >
  1734. <span>{this.state.post===0?'是':"否"}</span>
  1735. </FormItem>
  1736. </div>
  1737. {this.state.post === 0?<div>
  1738. <div className="clearfix">
  1739. <FormItem className="half-item"
  1740. {...formItemLayout}
  1741. label="收信人姓名" >
  1742. <span>{this.state.addressee}</span>
  1743. </FormItem>
  1744. <FormItem className="half-item"
  1745. {...formItemLayout}
  1746. label="电话" >
  1747. <span>{this.state.addresseeMobile}</span>
  1748. </FormItem>
  1749. </div>
  1750. <div className="clearfix">
  1751. <FormItem className="half-item"
  1752. {...formItemLayout}
  1753. label="省-市-区"
  1754. >
  1755. <span>{getprovince(this.state.addresseeProvince)}/{getprovince(this.state.addresseeCity)}/{getprovince(this.state.addresseeArea)}</span>
  1756. </FormItem>
  1757. </div>
  1758. <div className="clearfix">
  1759. <FormItem className="half-item"
  1760. {...formItemLayout}
  1761. label="详细地址"
  1762. >
  1763. <span>{this.state.recipientAddress}</span>
  1764. </FormItem>
  1765. </div>
  1766. </div>:''}
  1767. </div>
  1768. <FormItem className="half-item"
  1769. {...formItemLayout}
  1770. label={
  1771. <span>
  1772. <strong style={{ color: '#f00' }}>*</strong>开票金额总计
  1773. </span>
  1774. } >
  1775. <span>{this.state.alreadyAmount}万元</span>
  1776. </FormItem>
  1777. </Spin>
  1778. </Form>
  1779. </Modal>
  1780. </div >
  1781. </div>
  1782. );
  1783. }
  1784. }));
  1785. export default MyService;