kaiPiaoModal.jsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. import React from "react";
  2. import { Spin, Button, Tabs, Table, message, Modal, Form, Upload } from "antd";
  3. import $ from "jquery/src/ajax";
  4. import {
  5. getProvinceA,
  6. getInvoiceStatus,
  7. getprovince,
  8. getStatus,
  9. getPeople,
  10. splitUrl,
  11. ShowModal,
  12. getProcessStatus,
  13. } from "@/tools";
  14. import ImgList from "../../../common/imgList";
  15. const FormItem = Form.Item;
  16. const KaiPiaoModal = React.createClass({
  17. getInitialState() {
  18. return {
  19. rotateDeg: 0
  20. };
  21. },
  22. componentWillReceiveProps(nextProps) {
  23. this.state = nextProps.data;
  24. this.setState(this.state);
  25. },
  26. downImg() {
  27. let num = 0;
  28. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  29. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  30. num = i;
  31. }
  32. }
  33. if (num == this.state.orgCodeUrl.length - 1) {
  34. return message.warning("已经是最后一张了哦");
  35. }
  36. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  37. this.setState({
  38. previewImage: this.state.previewImage,
  39. rotateDeg: 0,
  40. });
  41. },
  42. upImg() {
  43. let num = 0;
  44. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  45. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  46. num = i;
  47. }
  48. }
  49. if (num == 0) {
  50. return message.warning("已经是第一张了哦");
  51. }
  52. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  53. this.setState({
  54. previewImage: this.state.previewImage,
  55. rotateDeg: 0,
  56. });
  57. },
  58. rotate() {
  59. let rotateDeg = this.state.rotateDeg + 90;
  60. this.setState({
  61. rotateDeg,
  62. });
  63. },
  64. render() {
  65. const formItemLayout = {
  66. labelCol: { span: 8 },
  67. wrapperCol: { span: 14 },
  68. };
  69. return (
  70. <Modal
  71. className="admin-desc-content"
  72. footer=""
  73. title="开具发票申请单"
  74. width="1200px"
  75. visible={this.props.visible}
  76. onCancel={this.props.onCancel}
  77. >
  78. <Form
  79. layout="horizontal"
  80. id="demand-form"
  81. style={{ paddingBottom: "40px" }}
  82. >
  83. <Spin spinning={this.props.loading}>
  84. <div className="clearfix">
  85. <div className="clearfix">
  86. <FormItem
  87. className="half-item"
  88. {...formItemLayout}
  89. label="合同编号"
  90. >
  91. <span>{this.state.contractNo}</span>
  92. </FormItem>
  93. <FormItem
  94. className="half-item"
  95. {...formItemLayout}
  96. label="备注"
  97. >
  98. <span>{this.state.remarks}</span>
  99. </FormItem>
  100. </div>
  101. <div className="clearfix">
  102. <FormItem
  103. className="half-item"
  104. {...formItemLayout}
  105. label={
  106. <span>
  107. <strong style={{ color: "#f00" }}>*</strong>省内/外
  108. </span>
  109. }
  110. >
  111. <span>{getProvinceA(this.state.type)}</span>
  112. </FormItem>
  113. <FormItem
  114. className="half-item"
  115. {...formItemLayout}
  116. label={
  117. <span>
  118. <strong style={{ color: "#f00" }}>*</strong>特批
  119. </span>
  120. }
  121. >
  122. <span>{this.state.approval === 0 ? "否" : "是"}</span>
  123. </FormItem>
  124. </div>
  125. <hr
  126. style={{
  127. border: "1px dashed #aaa",
  128. width: "90%",
  129. margin: "auto",
  130. }}
  131. />
  132. <div style={{ marginTop: "13px", marginLeft: "16px" }}>
  133. <span style={{ fontSize: "14px" }}>发票内容</span>
  134. </div>
  135. <div className="clearfix">
  136. <FormItem
  137. className="half-item"
  138. {...formItemLayout}
  139. label={
  140. <span>
  141. <strong style={{ color: "#f00" }}>*</strong>发票类型
  142. </span>
  143. }
  144. >
  145. <span>
  146. {this.state.invoiceType === 0
  147. ? "增值税专用发票"
  148. : this.state.invoiceType === 1
  149. ? "增值税普通发票"
  150. : "其他"}
  151. </span>
  152. </FormItem>
  153. </div>
  154. <div className="clearfix">
  155. <FormItem
  156. className="half-item"
  157. {...formItemLayout}
  158. label={
  159. <span>
  160. <strong style={{ color: "#f00" }}>*</strong>单位名称
  161. </span>
  162. }
  163. >
  164. <span>{this.state.unitName}</span>
  165. </FormItem>
  166. <FormItem
  167. className="half-item"
  168. {...formItemLayout}
  169. label={
  170. <span>
  171. <strong style={{ color: "#f00" }}>*</strong>税号
  172. </span>
  173. }
  174. >
  175. <span>{this.state.taxNumber}</span>
  176. </FormItem>
  177. <FormItem
  178. className="half-item"
  179. {...formItemLayout}
  180. label={
  181. <span>
  182. <strong style={{ color: "#f00" }}>*</strong>
  183. 开票金额(万元)
  184. </span>
  185. }
  186. >
  187. <span>{this.state.amount}</span>
  188. </FormItem>
  189. <FormItem
  190. className="half-item"
  191. {...formItemLayout}
  192. label={
  193. <span>
  194. <strong style={{ color: "#f00" }}>*</strong>
  195. 开户行银行账号
  196. </span>
  197. }
  198. >
  199. <span>{this.state.banks}</span>
  200. </FormItem>
  201. <FormItem
  202. className="half-item"
  203. {...formItemLayout}
  204. label={
  205. <span>
  206. <strong style={{ color: "#f00" }}>*</strong>
  207. 开票内容及说明
  208. </span>
  209. }
  210. >
  211. <span>{this.state.content}</span>
  212. </FormItem>
  213. <FormItem
  214. className="half-item"
  215. {...formItemLayout}
  216. label={
  217. <span>
  218. <strong style={{ color: "#f00" }}>*</strong>单位地址
  219. </span>
  220. }
  221. >
  222. <span>{this.state.unitAddress}</span>
  223. </FormItem>
  224. <FormItem
  225. className="half-item"
  226. {...formItemLayout}
  227. label="备注"
  228. >
  229. <span>{this.state.invoiceRemarks}</span>
  230. </FormItem>
  231. <FormItem
  232. className="half-item"
  233. {...formItemLayout}
  234. label={
  235. <span>
  236. <strong style={{ color: "#f00" }}>*</strong>单位电话
  237. </span>
  238. }
  239. >
  240. <span>{this.state.unitMobile}</span>
  241. </FormItem>
  242. </div>
  243. <div className="clearfix">
  244. <FormItem
  245. labelCol={{ span: 4 }}
  246. wrapperCol={{ span: 18 }}
  247. label={
  248. <span>
  249. <strong style={{ color: "#f00" }}>*</strong>附件
  250. </span>
  251. }
  252. >
  253. <Upload
  254. className="demandDetailShow-upload"
  255. listType="picture-card"
  256. fileList={this.state.orgCodeUrl}
  257. onPreview={(file) => {
  258. this.setState({
  259. previewImage: file.url || file.thumbUrl,
  260. previewVisible: true,
  261. });
  262. }}
  263. />
  264. {/*<div style={{paddingTop:'10px',paddingBottom:'10px'}}>*/}
  265. {/* <ImgList fileList={this.state.orgCodeUrl} ItemWidth={'96px'}/>*/}
  266. {/*</div>*/}
  267. <Modal
  268. maskClosable={false}
  269. footer={null}
  270. width={"50%"}
  271. visible={this.state.previewVisible}
  272. onCancel={() => {
  273. this.setState({ previewVisible: false, rotateDeg: 0 });
  274. }}
  275. >
  276. <img
  277. alt=""
  278. style={{ width: "100%" }}
  279. src={this.state.previewImage || ""}
  280. />
  281. <Button
  282. onClick={this.rotate}
  283. style={{
  284. position: "relative",
  285. left: "50%",
  286. transform: "translateX(-50%)",
  287. }}
  288. >
  289. 旋转
  290. </Button>
  291. <Button
  292. onClick={this.upImg}
  293. style={{
  294. position: "absolute",
  295. left: -81,
  296. top: "50%",
  297. transform: "translateY(-50%)",
  298. }}
  299. >
  300. 上一张
  301. </Button>
  302. <Button
  303. onClick={this.downImg}
  304. style={{
  305. position: "absolute",
  306. right: -81,
  307. top: "50%",
  308. transform: "translateY(-50%)",
  309. }}
  310. >
  311. 下一张
  312. </Button>
  313. </Modal>
  314. </FormItem>
  315. </div>
  316. <hr
  317. style={{
  318. border: "1px dashed #aaa",
  319. width: "90%",
  320. margin: "auto",
  321. }}
  322. />
  323. <div className="clearfix" style={{ marginTop: "10px" }}>
  324. <FormItem
  325. className="half-item"
  326. {...formItemLayout}
  327. label="发票是否邮寄:"
  328. >
  329. <span>{this.state.post === 0 ? "是" : "否"}</span>
  330. </FormItem>
  331. </div>
  332. {this.state.post === 0 ? (
  333. <div>
  334. <div className="clearfix">
  335. <FormItem
  336. className="half-item"
  337. {...formItemLayout}
  338. label="收信人姓名"
  339. >
  340. <span>{this.state.addressee}</span>
  341. </FormItem>
  342. <FormItem
  343. className="half-item"
  344. {...formItemLayout}
  345. label="电话"
  346. >
  347. <span>{this.state.addresseeMobile}</span>
  348. </FormItem>
  349. </div>
  350. <div className="clearfix">
  351. <FormItem
  352. className="half-item"
  353. {...formItemLayout}
  354. label="省-市-区"
  355. >
  356. <span>
  357. {getprovince(this.state.addresseeProvince)}/
  358. {getprovince(this.state.addresseeCity)}/
  359. {getprovince(this.state.addresseeArea)}
  360. </span>
  361. </FormItem>
  362. </div>
  363. <div className="clearfix">
  364. <FormItem
  365. className="half-item"
  366. {...formItemLayout}
  367. label="详细地址"
  368. >
  369. <span>{this.state.recipientAddress}</span>
  370. </FormItem>
  371. </div>
  372. </div>
  373. ) : (
  374. ""
  375. )}
  376. {/* <FormItem
  377. className="half-item"
  378. {...formItemLayout}
  379. label={
  380. <span>
  381. <strong style={{ color: "#f00" }}>*</strong>开票金额总计
  382. </span>
  383. }
  384. >
  385. <span>{this.state.alreadyAmount}万元</span>
  386. </FormItem> */}
  387. </div>
  388. </Spin>
  389. </Form>
  390. </Modal>
  391. );
  392. },
  393. });
  394. export default KaiPiaoModal;