kaiPiaoModal.jsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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. getProjectStatus,
  6. getProvinceA,
  7. getInvoiceStatus,
  8. getprovince,
  9. getStatus,
  10. getPeople,
  11. splitUrl,
  12. ShowModal,
  13. getProcessStatus,
  14. } from "@/tools";
  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="900px"
  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. ></Upload>
  264. <Modal
  265. maskClosable={false}
  266. footer={null}
  267. width={"50%"}
  268. visible={this.state.previewVisible}
  269. onCancel={() => {
  270. this.setState({ previewVisible: false, rotateDeg: 0 });
  271. }}
  272. >
  273. <img
  274. alt=""
  275. style={{ width: "100%" }}
  276. src={this.state.previewImage || ""}
  277. />
  278. <Button
  279. onClick={this.rotate}
  280. style={{
  281. position: "relative",
  282. left: "50%",
  283. transform: "translateX(-50%)",
  284. }}
  285. >
  286. 旋转
  287. </Button>
  288. <Button
  289. onClick={this.upImg}
  290. style={{
  291. position: "absolute",
  292. left: -81,
  293. top: "50%",
  294. transform: "translateY(-50%)",
  295. }}
  296. >
  297. 上一张
  298. </Button>
  299. <Button
  300. onClick={this.downImg}
  301. style={{
  302. position: "absolute",
  303. right: -81,
  304. top: "50%",
  305. transform: "translateY(-50%)",
  306. }}
  307. >
  308. 下一张
  309. </Button>
  310. </Modal>
  311. </FormItem>
  312. </div>
  313. <hr
  314. style={{
  315. border: "1px dashed #aaa",
  316. width: "90%",
  317. margin: "auto",
  318. }}
  319. />
  320. <div className="clearfix" style={{ marginTop: "10px" }}>
  321. <FormItem
  322. className="half-item"
  323. {...formItemLayout}
  324. label="发票是否邮寄:"
  325. >
  326. <span>{this.state.post === 0 ? "是" : "否"}</span>
  327. </FormItem>
  328. </div>
  329. {this.state.post === 0 ? (
  330. <div>
  331. <div className="clearfix">
  332. <FormItem
  333. className="half-item"
  334. {...formItemLayout}
  335. label="收信人姓名"
  336. >
  337. <span>{this.state.addressee}</span>
  338. </FormItem>
  339. <FormItem
  340. className="half-item"
  341. {...formItemLayout}
  342. label="电话"
  343. >
  344. <span>{this.state.addresseeMobile}</span>
  345. </FormItem>
  346. </div>
  347. <div className="clearfix">
  348. <FormItem
  349. className="half-item"
  350. {...formItemLayout}
  351. label="省-市-区"
  352. >
  353. <span>
  354. {getprovince(this.state.addresseeProvince)}/
  355. {getprovince(this.state.addresseeCity)}/
  356. {getprovince(this.state.addresseeArea)}
  357. </span>
  358. </FormItem>
  359. </div>
  360. <div className="clearfix">
  361. <FormItem
  362. className="half-item"
  363. {...formItemLayout}
  364. label="详细地址"
  365. >
  366. <span>{this.state.recipientAddress}</span>
  367. </FormItem>
  368. </div>
  369. </div>
  370. ) : (
  371. ""
  372. )}
  373. <FormItem
  374. className="half-item"
  375. {...formItemLayout}
  376. label={
  377. <span>
  378. <strong style={{ color: "#f00" }}>*</strong>开票金额总计
  379. </span>
  380. }
  381. >
  382. <span>{this.state.alreadyAmount}万元</span>
  383. </FormItem>
  384. </div>
  385. </Spin>
  386. </Form>
  387. </Modal>
  388. );
  389. },
  390. });
  391. export default KaiPiaoModal;