billing.jsx 64 KB

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