billtest.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. import React, { Component } from "react";
  2. import $ from "jquery/src/ajax";
  3. import {
  4. Form,
  5. Radio,
  6. Icon,
  7. Button,
  8. Input,
  9. Spin,
  10. Table,
  11. message,
  12. DatePicker,
  13. Modal,
  14. Upload,
  15. Popconfirm,
  16. Cascader,
  17. Tabs
  18. } from "antd";
  19. import NewService from "./addService.jsx";
  20. import moment from "moment";
  21. import "../userMangagement.less";
  22. import {
  23. projectProgress,
  24. specially,
  25. province,
  26. invoiceStatus,
  27. approval,
  28. approvalA
  29. } from "../../../dataDic.js";
  30. import { areaSelect, getProvince } from "@/NewDicProvinceList";
  31. import {
  32. getApprovedState,
  33. getprovince,
  34. getProcessStatus,
  35. getLiquidationStatus,
  36. getNewOrderStatus,
  37. beforeUploadFile,
  38. getProvinceA,
  39. getInvoiceStatus,
  40. splitUrl
  41. } from "../../../tools.js";
  42. class PicturesWall extends Component {
  43. constructor(props) {
  44. super(props);
  45. this.state = {
  46. previewVisible: false,
  47. previewImage: "",
  48. fileList: this.props.pictureUrl
  49. };
  50. }
  51. getDefaultProps = () => {
  52. return {
  53. changeClick: this.modifyChange
  54. };
  55. };
  56. handleCancel = () => {
  57. this.setState({ previewVisible: false });
  58. };
  59. handlePreview = file => {
  60. this.setState({
  61. previewImage: file.url || file.thumbUrl,
  62. previewVisible: true
  63. });
  64. };
  65. handleChange = info => {
  66. let fileList = info.fileList;
  67. this.setState({ fileList });
  68. this.props.fileList(fileList);
  69. };
  70. componentWillReceiveProps(nextProps) {
  71. this.state.fileList = nextProps.pictureUrl;
  72. }
  73. render() {
  74. const { previewVisible, previewImage, fileList } = this.state;
  75. const uploadButton = (
  76. <div>
  77. <Icon type="plus" />
  78. <div className="ant-upload-text">点击上传</div>
  79. </div>
  80. );
  81. return (
  82. <div style={{ display: "inline-block" }}>
  83. <Upload
  84. beforeUpload={beforeUploadFile}
  85. action={
  86. globalConfig.context +
  87. "/api/admin/orderInvoice/uploadOrderInvoiceFile"
  88. }
  89. data={{ sign: "order_invoice_file" }}
  90. listType="picture-card"
  91. fileList={fileList}
  92. onPreview={this.handlePreview}
  93. onChange={this.handleChange}
  94. >
  95. {fileList.length >= 18 ? null : uploadButton}
  96. </Upload>
  97. <Modal
  98. maskClosable={false}
  99. visible={previewVisible}
  100. footer={null}
  101. onCancel={this.handleCancel}
  102. >
  103. <img alt="example" style={{ width: "100%" }} src={previewImage} />
  104. </Modal>
  105. </div>
  106. );
  107. }
  108. }
  109. class MyService extends Component {
  110. constructor(props) {
  111. super(props);
  112. this.state = {
  113. loading: false,
  114. search: {},
  115. dataSource: [],
  116. pagination: {
  117. defaultCurrent: 1,
  118. defaultPageSize: 10,
  119. showQuickJumper: true,
  120. pageSize: 10,
  121. onChange: function(page) {
  122. this.loadData(page);
  123. }.bind(this),
  124. showTotal: function(total) {
  125. return "共" + total + "条数据";
  126. }
  127. },
  128. columns: [
  129. {
  130. title: "订单编号",
  131. dataIndex: "orderNo",
  132. key: "orderNo",
  133. fixed: "left"
  134. },
  135. {
  136. title: "客户名称",
  137. dataIndex: "userName",
  138. key: "userName",
  139. render: text => {
  140. return text && text.length > 9
  141. ? text.substr(0, 9) + "..."
  142. : text;
  143. }
  144. },
  145. {
  146. title: "下单时间",
  147. dataIndex: "createDate",
  148. key: "createTime"
  149. },
  150. {
  151. title: "合同签订时间",
  152. dataIndex: "signDate",
  153. key: "signDate"
  154. },
  155. {
  156. title: "流程状态",
  157. dataIndex: "processStatus",
  158. key: "processStatus",
  159. render: text => {
  160. return getProcessStatus(text);
  161. }
  162. },
  163. {
  164. title: "签单金额(万元)",
  165. dataIndex: "totalAmount",
  166. key: "totalAmount"
  167. },
  168. {
  169. title: "结算状态",
  170. dataIndex: "liquidationStatus",
  171. key: "liquidationStatus",
  172. render: text => {
  173. return getLiquidationStatus(text);
  174. }
  175. },
  176. {
  177. title: "是否特批",
  178. dataIndex: "approval",
  179. key: "approval",
  180. render: text => {
  181. return getApprovedState(text);
  182. }
  183. },
  184. {
  185. title: "订单状态",
  186. dataIndex: "orderStatus",
  187. key: "orderStatus",
  188. render: text => {
  189. return getNewOrderStatus(text);
  190. }
  191. },
  192. {
  193. title: "财务负责人",
  194. dataIndex: "financeName",
  195. key: "financeName"
  196. },
  197. {
  198. title: "操作",
  199. dataIndex: "abc",
  200. key: "abc",
  201. render: (text, record, index) => {
  202. return (
  203. <div>
  204. {
  205. <Button
  206. type="primary"
  207. style={{
  208. marginRight: "10px",
  209. color: "#ffffff",
  210. border: "none",
  211. marginTop: "5px",
  212. background: "red"
  213. }}
  214. onClick={e => {
  215. e.stopPropagation(),
  216. this.visit(record, index);
  217. }}
  218. >
  219. 开票
  220. </Button>
  221. }
  222. {
  223. <Button
  224. type="primary"
  225. onClick={e => {
  226. e.stopPropagation(),
  227. this.inRecord(record, index);
  228. }}
  229. style={{
  230. border: "none",
  231. background: "orangered",
  232. marginRight: "10px"
  233. }}
  234. >
  235. 开票记录
  236. </Button>
  237. }
  238. {record.liquidationStatus == 2 ? (
  239. <Popconfirm
  240. title="是否结项?"
  241. onConfirm={e => {
  242. this.delectRow(record);
  243. }}
  244. okText="是"
  245. cancelText="否"
  246. >
  247. <Button
  248. type="primary"
  249. style={{
  250. marginRight: "10px",
  251. color: "#ffffff",
  252. border: "none"
  253. }}
  254. onClick={e => {
  255. e.stopPropagation();
  256. }}
  257. >
  258. 结项
  259. </Button>
  260. </Popconfirm>
  261. ) : (
  262. ""
  263. )}
  264. </div>
  265. );
  266. }
  267. }
  268. ]
  269. };
  270. }
  271. render() {
  272. return (
  273. <div className="user-content">
  274. <div className="content-title">
  275. <span style={{ fontSize: "16px" }}>开单与签单</span>
  276. </div>
  277. </div>
  278. );
  279. }
  280. }