dev01 3 years ago
parent
commit
7d69dc7474

+ 10 - 1
js/component/manageCenter/order/content.jsx

@@ -60,7 +60,7 @@ class Content extends Component {
           });
         });
         break;
-        //催款记录
+      //催款记录
       case "pressMoney":
         require.ensure([], () => {
           const PressMoney = require("./pressMoney").default;
@@ -69,6 +69,15 @@ class Content extends Component {
           });
         });
         break;
+      // 统计销售来源
+      case "census":
+        require.ensure([], () => {
+          const PressMoney = require("./source").default;
+          this.setState({
+            component: <PressMoney />,
+          });
+        });
+        break;
       //订单审核新
       case "examine":
         require.ensure([], () => {

+ 0 - 17
js/component/manageCenter/order/orderNew/addService.jsx

@@ -2100,10 +2100,6 @@ const NewService = Form.create()(
               disabledView: "inline-block",
             });
           }
-          console.log(this.state.disabledView);
-          console.log(this.state.processStatus === 0);
-          // console.log(typeof this.state.processStatus);
-          // console.log("kkkk",this.state.processStatus);
         }.bind(this),
       }).always(
         function () {
@@ -2629,7 +2625,6 @@ const NewService = Form.create()(
             orderNo: this.props.datauser.orderNo,
           },
           success: function (data) {
-            // console.log(data.data);
             if (data.data && data.data.length) {
               let thisdata = data.data[data.data.length - 1];
               if (
@@ -3236,7 +3231,6 @@ const NewService = Form.create()(
       }
       if (this.state.changeAmount === "") {
         message.warning("申请退款金额不能为空!");
-        // console.log(this.state.changeAmount);
         return false;
       }
       if (this.state.remarksC == "") {
@@ -3361,7 +3355,6 @@ const NewService = Form.create()(
       });
     },
     componentWillReceiveProps(nextProps) {
-      // console.log(nextProps)
       //props改变时触发
       this.state.visible = nextProps.showDesc;
       this.state.signBillVisible = nextProps.signBillVisible;
@@ -3414,7 +3407,6 @@ const NewService = Form.create()(
             loading: false,
           });
           let url = window.location.href.substring(7);
-          // console.log(data.data);
           if (data.data && data.data.length) {
             let thisdata = data.data[data.data.length - 1];
             thisdata.typeChange = thisdata.type;
@@ -3495,8 +3487,6 @@ const NewService = Form.create()(
           message.warning("请选择官费!");
           return false;
         }
-        console.log(this.state.officialCost);
-        console.log(this.state.costReduction);
         debugger;
         if (this.state.officialCost == "1") {
           if (this.state.costReduction === "") {
@@ -4245,7 +4235,6 @@ const NewService = Form.create()(
           });
         }.bind(this)
       );
-      // console.log(this.state.remarksView,this.state.dateView,this.state.contentView);
     },
     //获取上门人员
     assistList(record) {
@@ -4259,7 +4248,6 @@ const NewService = Form.create()(
           orderNo: record ? record.orderNo : this.props.datauser.orderNo,
         },
         success: function (data) {
-          // console.log(data.data)
           if (data.error.length) {
             this.setState({
               loading: false,
@@ -4291,7 +4279,6 @@ const NewService = Form.create()(
           orderNo: record ? record.orderNo : this.props.datauser.orderNo,
         },
         success: function (data) {
-          // console.log(data.data)
           if (data.error.length) {
             this.setState({
               loading: false,
@@ -4323,7 +4310,6 @@ const NewService = Form.create()(
           id: record.id,
         },
         success: function (data) {
-          // console.log(data.data)
           if (data.error.length) {
             this.setState({
               loading: false,
@@ -4356,7 +4342,6 @@ const NewService = Form.create()(
           orderNo: this.state.orderNo,
         },
         success: function (data) {
-          // console.log(data.data)
           if (data.error.length) {
             this.setState({
               loading: false,
@@ -4379,7 +4364,6 @@ const NewService = Form.create()(
     },
     // 获取动态数据名称
     handleSearch(value) {
-      // console.log(value);
       $.ajax({
         method: "get",
         dataType: "json",
@@ -4389,7 +4373,6 @@ const NewService = Form.create()(
           adminName: value,
         },
         success: function (data) {
-          // console.log(data.data)
           if (data.error.length) {
             this.setState({
               loading: false,

+ 54 - 18
js/component/manageCenter/order/orderNew/billing.jsx

@@ -165,6 +165,8 @@ const MyService = Form.create()(
                 invoiceAmount: thisdata.invoiceAmount, //开票金额
                 settlementAmount: thisdata.settlementAmount, //已收款
                 deleteSign: thisdata.deleteSign,
+                salesType: thisdata.salesType,
+                other: thisdata.other,
               });
             }
             this.state.pagination.current = data.data.pageNo;
@@ -462,6 +464,41 @@ const MyService = Form.create()(
         ],
         columns: [
           {
+            title: "销售类型",
+            dataIndex: "salesType",
+            key: "salesType",
+            width: 70,
+            render: (text, record) => {
+              return (
+                <Tooltip
+                  title={[
+                    "电话新开发",
+                    "电话自带资源",
+                    "网络",
+                    "渠道",
+                    "转介绍",
+                    "其他",
+                    "高新复购",
+                    "其他复购",
+                  ][text] + "," + ((text == 3 || text == 4 || text == 5) && record.other)}
+                >
+                  <span>
+                    {[
+                      "电话新开发",
+                      "电话自带资源",
+                      "网络",
+                      "渠道",
+                      "转介绍",
+                      "其他",
+                      "高新复购",
+                      "其他复购",
+                    ][text]}
+                  </span>
+                </Tooltip>
+              );
+            },
+          },
+          {
             title: "合同编号",
             dataIndex: "contractNo",
             key: "contractNo",
@@ -670,6 +707,7 @@ const MyService = Form.create()(
             title: "操作",
             dataIndex: "abc",
             key: "abc",
+            width: 90,
             render: (text, record, index) => {
               return (
                 <div>
@@ -678,7 +716,7 @@ const MyService = Form.create()(
                       type="primary"
                       disabled={record.processStatus == 0 ? true : false}
                       style={{
-                        marginRight: "10px",
+                        margin: "5px",
                         color: "#ffffff",
                         border: "none",
                         marginTop: "5px",
@@ -717,7 +755,7 @@ const MyService = Form.create()(
                       <Button
                         type="primary"
                         style={{
-                          marginRight: "10px",
+                          margin: "5px",
                           color: "#ffffff",
                           border: "none",
                         }}
@@ -1003,7 +1041,6 @@ const MyService = Form.create()(
           return;
         }
       }
-      // console.log(this.state.flag,this.state.status)
       this.setState({
         loading: true,
       });
@@ -1048,10 +1085,10 @@ const MyService = Form.create()(
               recipientAddress: thisdata.recipientAddress,
               orgCodeUrl: thisdata.voucherUrl
                 ? splitUrl(
-                    thisdata.voucherUrl,
-                    ",",
-                    globalConfig.avatarHost + "/upload"
-                  )
+                  thisdata.voucherUrl,
+                  ",",
+                  globalConfig.avatarHost + "/upload"
+                )
                 : [],
             });
           }
@@ -1121,7 +1158,6 @@ const MyService = Form.create()(
     },
 
     recompose(record) {
-      // console.log(record)
       this.setState({
         avisible: true,
         orderNo3: record.orderno,
@@ -1230,10 +1266,10 @@ const MyService = Form.create()(
               recipientAddress: thisdata.recipientAddress,
               orgCodeUrl: thisdata.voucherUrl
                 ? splitUrl(
-                    thisdata.voucherUrl,
-                    ",",
-                    globalConfig.avatarHost + "/upload"
-                  )
+                  thisdata.voucherUrl,
+                  ",",
+                  globalConfig.avatarHost + "/upload"
+                )
                 : [],
             });
           }
@@ -1294,10 +1330,10 @@ const MyService = Form.create()(
             recipientAddress: thisdata.recipientAddress,
             orgCodeUrl: thisdata.voucherUrl
               ? splitUrl(
-                  thisdata.voucherUrl,
-                  ",",
-                  globalConfig.avatarHost + "/upload"
-                )
+                thisdata.voucherUrl,
+                ",",
+                globalConfig.avatarHost + "/upload"
+              )
               : [],
           });
         }.bind(this),
@@ -3281,8 +3317,8 @@ const MyService = Form.create()(
                           {this.state.invoiceType === 0
                             ? "增值税专用发票"
                             : this.state.invoiceType === 1
-                            ? "增值税普通发票"
-                            : "其他"}
+                              ? "增值税普通发票"
+                              : "其他"}
                         </span>
                       </FormItem>
                     </div>

+ 581 - 0
js/component/manageCenter/order/source/index.jsx

@@ -0,0 +1,581 @@
+import React, { Component } from "react";
+import TabelContent from "../../../common/tabelContent";
+import {
+  Button,
+  Modal,
+  Form,
+  DatePicker,
+  Input,
+  Radio,
+  message,
+  Spin,
+  Select,
+  Tabs,
+  Table,
+} from "antd";
+import $ from "jquery/src/ajax";
+import { ShowModal, getPercentage } from "@/tools";
+import moment from "moment";
+import { provinceSelect, getProvince } from "../../../NewDicProvinceList";
+import { ChooseList } from "../../../manageCenter/order/orderNew/chooseList";
+import OrderList from "./order"
+
+const { TabPane } = Tabs;
+const FormItem = Form.Item;
+const Option = Select.Option;
+const { RangePicker } = DatePicker;
+
+class Source extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      cellData: {},
+      onelist: [
+        {
+          value: "0",
+          label: "按签单金额",
+        },
+        {
+          value: "1",
+          label: "按签单数",
+        },
+      ],
+      columns: [
+        {
+          title: "序号",
+          dataIndex: "key",
+          key: "key",
+          width: 45,
+        },
+        {
+          title: "省份",
+          dataIndex: "province",
+          key: "province",
+          width: 120,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {getProvince(text)}
+            </span>
+        },
+        {
+          title: "签单数(个)",
+          dataIndex: "counts",
+          key: "counts",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+        },
+        {
+          title: "签单金额(万元)",
+          dataIndex: "totalAmount",
+          key: "totalAmount",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+        },
+        {
+          title: "电话/占比",
+          dataIndex: "dhl",
+          key: "dhl",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 1
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.dh + "/" + getPercentage(text)}
+            </span>
+        },
+        {
+          title: "网络/占比",
+          dataIndex: "wll",
+          key: "wll",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 2
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.wl + "/" + getPercentage(text)}
+            </span>
+        },
+        {
+          title: "渠道/占比",
+          dataIndex: "qdl",
+          key: "qdl",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 3
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.qd + "/" + getPercentage(text)}
+            </span>
+        },
+        {
+          title: "复购/占比",
+          dataIndex: "gxfgl",
+          key: "gxfgl",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 6
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.gxfg + "/" + getPercentage(text)}
+            </span>
+        },
+        {
+          title: "复购其他/占比",
+          dataIndex: "qtfgl",
+          key: "qtfgl",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 7
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.qtfg + "/" + getPercentage(text)}
+            </span>
+        },
+        {
+          title: "转介绍/占比",
+          dataIndex: "zjsl",
+          key: "zjsl",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 4
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.zjs + "/" + getPercentage(text)}
+            </span>
+        },
+        {
+          title: "其他/占比",
+          dataIndex: "qtl",
+          key: "qtl",
+          width: 170,
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["province"] = r.province
+            cellData["salesType"] = 5
+            this.setState({
+              visible: true,
+              datas: cellData,
+            })
+          },
+          render: (text, record) =>
+            <span >
+              {record.qt + "/" + getPercentage(text)}
+            </span>
+        },
+      ],
+      pagination: {
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        showQuickJumper: true,
+        pageSize: 10,
+        onChange: function (page) {
+          this.loadData(page);
+        }.bind(this),
+        showTotal: function (total) {
+          return "共" + total + "条数据";
+        },
+      },
+      contactsOption: [],
+      loading: false,
+      changeList: undefined,
+      searchValues: {},
+      dataSource: [],
+      visible: false,
+    };
+  }
+
+  changeList(arr) {
+    const newArr = [];
+    this.state.columns.forEach((item) => {
+      arr.forEach((val) => {
+        if (val === item.title) {
+          newArr.push(item);
+        }
+      });
+    });
+    this.setState({
+      changeList: newArr,
+    });
+  }
+  // 重置
+  resetAll() {
+    this.setState(
+      {
+        searchValues: JSON.parse(JSON.stringify({})),
+        selectedRowKeys: [],
+      },
+      () => {
+        this.loadData();
+      }
+    );
+  }
+  // 列表接口
+  loadData(pageNo) {
+    const { searchValues, pagination } = this.state;
+    this.setState({
+      loading: true,
+    });
+    let datas = Object.assign(searchValues, {
+      pageNo: pageNo || 1,
+      pageSize: pagination.pageSize,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/statistis/orderSalesSource",
+      data: datas,
+      success: function (data) {
+        ShowModal(this);
+        this.setState({
+          loading: false,
+        });
+        if (data.error && data.error.length === 0) {
+          if (data.data.list) {
+            pagination.current = data.data.pageNo;
+            pagination.total = data.data.totalCount;
+            if (data.data && data.data.list && !data.data.list.length) {
+              pagination.current = 0;
+              pagination.total = 0;
+            }
+            this.setState({
+              dataSource: data.data.list,
+              pagination: this.state.pagination,
+              pageNo: data.data.pageNo,
+            });
+          } else {
+            this.setState({
+              dataSource: data.data,
+              pagination: false,
+            });
+          }
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  }
+  //获取上级组织
+  selectSuperId() {
+    this.setState({
+      departmentLoading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/organization/selectSuperId",
+      data: {},
+      success: function (data) {
+        let theArr = [];
+        if (data.error && data.error.length === 0) {
+          for (let i = 0; i < data.data.length; i++) {
+            let theData = data.data[i];
+            theArr.push({
+              value: theData.id,
+              label: theData.name,
+            });
+          }
+          this.setState({
+            contactsOption: theArr,
+          });
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          departmentLoading: false,
+        });
+      }.bind(this)
+    );
+  }
+  //导出excel
+  exportExec() {
+    message.config({
+      duration: 20,
+    });
+    let loading = message.loading("下载中...");
+    this.setState({
+      exportPendingLoading: true,
+    });
+    let data = {};
+    let obj1 = JSON.parse(JSON.stringify(this.state.searchValues));
+    data = Object.assign(data, obj1);
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: "/api/admin/statistis/orderSalesSource/export",
+      data,
+      success: function (data) {
+        if (data.error.length === 0) {
+          this.download(data.data);
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        loading();
+        this.setState({
+          exportPendingLoading: false,
+        });
+      }.bind(this)
+    );
+  }
+
+  download(fileName) {
+    window.location.href =
+      globalConfig.context + "/open/download?fileName=" + fileName;
+  }
+
+  componentWillMount() {
+    this.selectSuperId();
+    this.loadData();
+  }
+
+  render() {
+    const { searchValues, onelist, columns, changeList, contactsOption, visible } = this.state;
+    return (
+      <div className="user-content signatureStatistics">
+        <div className="content-title">
+          <span
+            style={{
+              fontWeight: 900,
+              fontSize: 16,
+              display: "block",
+              marginBottom: 10,
+            }}
+          >销售来源统计表 &nbsp;<spn style={{ color: "rgb(49,49,255)" }}>注:可通过签单数、签单金额查询统计</spn></span>
+        </div>
+        <Tabs defaultActiveKey="1">
+          <TabPane tab="搜索" key="1">
+            <div style={{ paddingTop: 10 }}>
+              <Form layout="inline">
+                <FormItem>
+                  <Select
+                    placeholder={"请选择部门"}
+                    style={{ width: 150 }}
+                    value={searchValues["depId"]
+                      ? searchValues["depId"]
+                      : undefined}
+                    onChange={(e) => {
+                      searchValues["depId"] = e;
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  >
+                    {contactsOption.map((cit, index) => (
+                      <Option key={cit.value}>{cit.label}</Option>
+                    ))}
+                  </Select>
+                </FormItem>
+                <FormItem>
+                  <Select
+                    placeholder={"请选择省份"}
+                    style={{ width: 150 }}
+                    value={searchValues["province"]
+                      ? searchValues["province"]
+                      : undefined}
+                    onChange={(e) => {
+                      searchValues["province"] = e;
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  >
+                    {provinceSelect().map((cit, cin) => (
+                      <Option key={cit.value}>{cit.label}</Option>
+                    ))}
+                  </Select>
+                </FormItem>
+                <FormItem>
+                  <Select
+                    placeholder={"请选择"}
+                    style={{ width: 150 }}
+                    value={searchValues["sort"]
+                      ? searchValues["sort"]
+                      : undefined}
+                    onChange={(e) => {
+                      searchValues["sort"] = e
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  >
+                    {onelist.map((it, ins) => (
+                      <Option key={it.value}>{it.label}</Option>
+                    ))}
+                  </Select>
+                </FormItem>
+                <FormItem>
+                  <RangePicker
+                    value={[
+                      searchValues["startDate"]
+                        ? moment(searchValues["startDate"])
+                        : null,
+                      searchValues["endDate"] ? moment(searchValues["endDate"]) : null,
+                    ]}
+                    onChange={(data, dataString) => {
+                      searchValues["startDate"] = dataString[0],
+                        searchValues["endDate"] = dataString[1],
+                        this.setState({
+                          searchValues: searchValues,
+                        });
+                    }}
+                  />
+                </FormItem>
+                <Button
+                  type="primary"
+                  onClick={() => { this.loadData() }}
+                  style={{ marginRight: "10px" }}
+                >
+                  搜索
+                </Button>
+                <Button
+                  onClick={() => { this.resetAll() }}
+                  style={{ marginRight: "10px" }}
+                >
+                  重置
+                </Button>
+              </Form>
+            </div>
+          </TabPane>
+          <TabPane tab="更改表格显示数据" key="2">
+            <div style={{ marginLeft: 10 }}>
+              <ChooseList
+                columns={columns}
+                changeFn={this.changeList.bind(this)}
+                changeList={changeList}
+                top={55}
+                margin={11}
+              />
+            </div>
+          </TabPane>
+          <TabPane tab="导出" key="3">
+            <div
+              style={{
+                marginLeft: 10,
+                padding: "10px 0",
+                display: "flex",
+              }}
+            >
+              <Button
+                type="primary"
+                onClick={() => { this.exportExec() }}
+                style={{ marginLeft: "10px" }}
+              >
+                导出excel
+              </Button>
+            </div>
+          </TabPane>
+        </Tabs>
+        <div className="patent-table">
+          <Spin spinning={this.state.loading}>
+            <Table
+              bordered
+              size="middle"
+              columns={changeList ? changeList : columns}
+              dataSource={this.state.dataSource}
+              pagination={this.state.pagination}
+            />
+          </Spin>
+        </div>
+        {
+          visible &&
+          <Modal
+            visible={visible}
+            title="客户订单列表"
+            width="90%"
+            footer={null}
+            onCancel={() => {
+              this.setState({
+                visible: false,
+                datas: {},
+              });
+            }}
+          >
+            <OrderList
+              data={this.state.datas}
+            />
+          </Modal>
+        }
+      </div>
+    );
+  }
+}
+
+export default Source;

+ 419 - 0
js/component/manageCenter/order/source/order.jsx

@@ -0,0 +1,419 @@
+import React, { Component } from "react";
+import TabelContent from "../../../common/tabelContent";
+import {
+  Button,
+  Form,
+  Input,
+  message,
+  Spin,
+  Select,
+  Tabs,
+  Table,
+} from "antd";
+import $ from "jquery/src/ajax";
+import moment from "moment";
+import { provinceSelect, getProvince } from "../../../NewDicProvinceList";
+import { ChooseList } from "../../../manageCenter/order/orderNew/chooseList";
+import {
+  getProcessStatus,
+  getLiquidationStatus,
+  getNewOrderStatus,
+  ShowModal,
+} from "@/tools.js";
+
+const { TabPane } = Tabs;
+const FormItem = Form.Item;
+const Option = Select.Option;
+
+class OrderList extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      onelist: [
+        {
+          value: "0",
+          label: "首付待付请",
+        },
+        {
+          value: "1",
+          label: "尾款待付清",
+        },
+        {
+          value: "2",
+          label: "已付请",
+        },
+      ],
+      twolist: [
+        {
+          value: "0",
+          label: "非特批",
+        },
+        {
+          value: "1",
+          label: "特批",
+        },
+      ],
+      threelist: [
+        {
+          value: "0",
+          label: "10万元以下",
+        },
+        {
+          value: "1",
+          label: "10万~20万",
+        },
+        {
+          value: "2",
+          label: "20万~30万",
+        },
+        {
+          value: "3",
+          label: "30万~40万",
+        },
+        {
+          value: "4",
+          label: "40万以上",
+        },
+      ],
+      columns: [
+        {
+          title: "合同编号",
+          dataIndex: "contractNo",
+          key: "contractNo",
+        },
+        {
+          title: "订单编号",
+          dataIndex: "orderNo",
+          key: "orderNo",
+        },
+        {
+          title: "客户名称",
+          dataIndex: "userName",
+          key: "userName",
+        },
+        {
+          title: "订单部门",
+          dataIndex: "depName",
+          key: "depName",
+        },
+        {
+          title: "下单时间",
+          dataIndex: "createDate",
+          key: "createDate",
+        },
+        {
+          title: "合同签订时间",
+          dataIndex: "signDate",
+          key: "signDate",
+        },
+        {
+          title: "流程状态",
+          dataIndex: "processStatus",
+          key: "processStatus",
+          render: (text, record) =>
+            <span >
+              {getProcessStatus(text)}
+            </span>
+        },
+        {
+          title: "签单金额(万元)",
+          dataIndex: "totalAmount",
+          key: "totalAmount",
+          render: (text, record) =>
+            <span >
+              {text}
+            </span>
+        },
+        {
+          title: "开单金额(万元)",
+          dataIndex: "invoiceAmount",
+          key: "invoiceAmount",
+          render: (text, record) =>
+            <span >
+              {text}
+            </span>
+        },
+        {
+          title: "已收款(万元)",
+          dataIndex: "settlementAmount",
+          key: "settlementAmount",
+          render: (text, record) =>
+            <span >
+              {text}
+            </span>
+        },
+        {
+          title: "结算状态",
+          dataIndex: "liquidationStatus",
+          key: "liquidationStatus",
+          render: (text, record) =>
+            <span >
+              {getLiquidationStatus(text)}
+            </span>
+        },
+        {
+          title: "是否特批",
+          dataIndex: "approval",
+          key: "approval",
+          render: (text, record) =>
+            <span >
+              {["非特批", "特批"][text]}
+            </span>
+        },
+        {
+          title: "订单状态",
+          dataIndex: "orderStatus",
+          key: "orderStatus",
+          render: (text, record) =>
+            <span >
+              {getNewOrderStatus(text)}
+            </span>
+        },
+      ],
+      pagination: {
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        showQuickJumper: true,
+        pageSize: 10,
+        onChange: function (page) {
+          this.loadData(page);
+        }.bind(this),
+        showTotal: function (total) {
+          return "共" + total + "条数据";
+        },
+      },
+      loading: false,
+      changeList: undefined,
+      searchValues: {},
+      dataSource: [],
+    };
+  }
+
+  changeList(arr) {
+    const newArr = [];
+    this.state.columns.forEach((item) => {
+      arr.forEach((val) => {
+        if (val === item.title) {
+          newArr.push(item);
+        }
+      });
+    });
+    this.setState({
+      changeList: newArr,
+    });
+  }
+  // 重置
+  resetAll() {
+    this.setState(
+      {
+        searchValues: JSON.parse(JSON.stringify({})),
+        selectedRowKeys: [],
+      },
+      () => {
+        this.loadData();
+      }
+    );
+  }
+  // 列表接口
+  loadData(pageNo) {
+    const { searchValues, pagination } = this.state;
+    this.setState({
+      loading: true,
+    });
+    let prs = this.props.data;
+    prs.pageNo = pageNo || 1;
+    prs.pageSize = pagination.pageSize;
+    let datas = Object.assign(searchValues, prs);
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/newOrder/statistics/orderList",
+      data: datas,
+      success: function (data) {
+        ShowModal(this);
+        this.setState({
+          loading: false,
+        });
+        if (data.error && data.error.length === 0) {
+          if (data.data.list) {
+            pagination.current = data.data.pageNo;
+            pagination.total = data.data.totalCount;
+            if (data.data && data.data.list && !data.data.list.length) {
+              pagination.current = 0;
+              pagination.total = 0;
+            }
+            this.setState({
+              dataSource: data.data.list,
+              pagination: this.state.pagination,
+              pageNo: data.data.pageNo,
+            });
+          } else {
+            this.setState({
+              dataSource: data.data,
+              pagination: false,
+            });
+          }
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  }
+
+  componentWillMount() {
+    this.loadData();
+  }
+
+  render() {
+    const { searchValues, onelist, twolist, threelist, columns, changeList } = this.state;
+    return (
+      <div className="user-content signatureStatistics">
+        <Tabs defaultActiveKey="1">
+          <TabPane tab="搜索" key="1">
+            <div style={{ paddingTop: 10 }}>
+              <Form layout="inline">
+                <FormItem>
+                  <Input
+                    placeholder="请输入订单编号"
+                    value={searchValues["orderNo"]}
+                    onChange={(e) => {
+                      searchValues["orderNo"] = e.target.value
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  />
+                </FormItem>
+                <FormItem>
+                  <Input
+                    placeholder="请输入客户姓名"
+                    value={searchValues["name"]}
+                    onChange={(e) => {
+                      searchValues["name"] = e.target.value
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  />
+                </FormItem>
+                <FormItem>
+                  <Input
+                    placeholder="请输入合同编号"
+                    value={searchValues["contractNo"]}
+                    onChange={(e) => {
+                      searchValues["contractNo"] = e.target.value
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  />
+                </FormItem>
+                <FormItem>
+                  <Select
+                    placeholder={"请选择结算状态"}
+                    style={{ width: 150 }}
+                    value={searchValues["liquidationStatus"]
+                      ? searchValues["liquidationStatus"]
+                      : undefined}
+                    onChange={(e) => {
+                      searchValues["liquidationStatus"] = e
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  >
+                    {onelist.map((it, ins) => (
+                      <Option key={it.value}>{it.label}</Option>
+                    ))}
+                  </Select>
+                </FormItem>
+                <FormItem>
+                  <Select
+                    placeholder={"请选择特批状态"}
+                    style={{ width: 150 }}
+                    value={searchValues["approval"]
+                      ? searchValues["approval"]
+                      : undefined}
+                    onChange={(e) => {
+                      searchValues["approval"] = e
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  >
+                    {twolist.map((it, ins) => (
+                      <Option key={it.value}>{it.label}</Option>
+                    ))}
+                  </Select>
+                </FormItem>
+                <FormItem>
+                  <Select
+                    placeholder={"请选择签单金额"}
+                    style={{ width: 150 }}
+                    value={searchValues["amountStatus"]
+                      ? searchValues["amountStatus"]
+                      : undefined}
+                    onChange={(e) => {
+                      searchValues["amountStatus"] = e
+                      this.setState({
+                        searchValues: searchValues,
+                      });
+                    }}
+                  >
+                    {threelist.map((it, ins) => (
+                      <Option key={it.value}>{it.label}</Option>
+                    ))}
+                  </Select>
+                </FormItem>
+                <Button
+                  type="primary"
+                  onClick={() => { this.loadData() }}
+                  style={{ marginRight: "10px" }}
+                >
+                  搜索
+                </Button>
+                <Button
+                  onClick={() => { this.resetAll() }}
+                  style={{ marginRight: "10px" }}
+                >
+                  重置
+                </Button>
+              </Form>
+            </div>
+          </TabPane>
+          <TabPane tab="更改表格显示数据" key="2">
+            <div style={{ marginLeft: 10 }}>
+              <ChooseList
+                columns={columns}
+                changeFn={this.changeList.bind(this)}
+                changeList={changeList}
+                top={55}
+                margin={11}
+              />
+            </div>
+          </TabPane>
+        </Tabs>
+        <div className="patent-table">
+          <Spin spinning={this.state.loading}>
+            <Table
+              bordered
+              size="middle"
+              columns={changeList ? changeList : columns}
+              dataSource={this.state.dataSource}
+              pagination={this.state.pagination}
+            />
+          </Spin>
+        </div>
+      </div>
+    );
+  }
+}
+
+export default OrderList;

+ 81 - 81
js/component/tools.js

@@ -116,6 +116,9 @@ import { provinceList } from './NewDicProvinceList.js';
 import ShowModal from './showModal.jsx';
 
 module.exports = {
+  getPercentage: function (val) {
+    return (Math.round(val * 10000)) / 100 + '%';
+  },
   splitUrl: function (string, i, url) {
     let theList = [];
     let theArr = [];
@@ -193,13 +196,13 @@ module.exports = {
     }
   },
   getPatentType: function (e) {
-      let theType = "";
-      patentTypeList.map(function (item) {
-        if (item.value == e) {
-          theType = item.key;
-        }
-      });
-      return theType;
+    let theType = "";
+    patentTypeList.map(function (item) {
+      if (item.value == e) {
+        theType = item.key;
+      }
+    });
+    return theType;
   },
   getPatentTypeva: function (e) {
     if (e) {
@@ -212,7 +215,6 @@ module.exports = {
       return theType;
     }
   },
-
   getPatentState: function (e) {
     if (e) {
       let theState = "";
@@ -338,10 +340,10 @@ module.exports = {
   downloadFile: function (path, fileName) {
     window.open(
       globalConfig.context +
-        "/open/downloadFile?path=" +
-        path +
-        "&fileName=" +
-        fileName
+      "/open/downloadFile?path=" +
+      path +
+      "&fileName=" +
+      fileName
     );
   },
   techDownloadFile: function (url, id) {
@@ -357,13 +359,13 @@ module.exports = {
     if (type) {
       window.open(
         globalConfig.context +
-          url +
-          "?id=" +
-          id +
-          "&sign=" +
-          sign +
-          "&type=" +
-          type
+        url +
+        "?id=" +
+        id +
+        "&sign=" +
+        sign +
+        "&type=" +
+        type
       );
     }
   },
@@ -388,7 +390,7 @@ module.exports = {
   getInUrgentTime(date, inUrgent, vocations) {
     if (vocations && vocations.length) {
       let now = new Date(date);
-      for (var i = 1; i <= inUrgent; ) {
+      for (var i = 1; i <= inUrgent;) {
         now.setDate(now.getDate() + 1);
         let thebool = true;
         vocations.map((item) => {
@@ -412,9 +414,7 @@ module.exports = {
       return year + month + day;
     }
   },
-
   //各种通过接口获取下拉列表
-
   setPatentStateOption(permission) {
     let theArr = [];
     patentStateList.map(function (item) {
@@ -561,28 +561,28 @@ module.exports = {
         }
         callback(
           "https://view.officeapps.live.com/op/view.aspx?src=" +
-            encodeURIComponent(
-              location.origin +
-                globalConfig.context +
-                "/open/preview?" +
-                data.data
-            )
+          encodeURIComponent(
+            location.origin +
+            globalConfig.context +
+            "/open/preview?" +
+            data.data
+          )
         );
         console.log(
           "https://view.officeapps.live.com/op/view.aspx?src=" +
-            (location.origin +
-              globalConfig.context +
-              "/open/preview?" +
-              data.data)
+          (location.origin +
+            globalConfig.context +
+            "/open/preview?" +
+            data.data)
         );
         console.log(
           "https://view.officeapps.live.com/op/view.aspx?src=" +
-            encodeURIComponent(
-              location.origin +
-                globalConfig.context +
-                "/open/preview?" +
-                data.data
-            )
+          encodeURIComponent(
+            location.origin +
+            globalConfig.context +
+            "/open/preview?" +
+            data.data
+          )
         );
       },
     });
@@ -606,28 +606,28 @@ module.exports = {
         }
         callback(
           "https://view.officeapps.live.com/op/view.aspx?src=" +
-            encodeURIComponent(
-              location.origin +
-                globalConfig.context +
-                "/open/preview?" +
-                data.data
-            )
+          encodeURIComponent(
+            location.origin +
+            globalConfig.context +
+            "/open/preview?" +
+            data.data
+          )
         );
         console.log(
           "https://view.officeapps.live.com/op/view.aspx?src=" +
-            (location.origin +
-              globalConfig.context +
-              "/open/preview?" +
-              data.data)
+          (location.origin +
+            globalConfig.context +
+            "/open/preview?" +
+            data.data)
         );
         console.log(
           "https://view.officeapps.live.com/op/view.aspx?src=" +
-            encodeURIComponent(
-              location.origin +
-                globalConfig.context +
-                "/open/preview?" +
-                data.data
-            )
+          encodeURIComponent(
+            location.origin +
+            globalConfig.context +
+            "/open/preview?" +
+            data.data
+          )
         );
       },
     });
@@ -1093,12 +1093,12 @@ module.exports = {
         }
       });
       return theType;
-    }else{
+    } else {
       return '未知';
     }
   },
   //获取外联分配状态名
-  getChannelAllocationStatus: function (e,isTag) {
+  getChannelAllocationStatus: function (e, isTag) {
     if (!isNaN(parseInt(e))) {
       let theType = "";
       let color = "";
@@ -1108,21 +1108,21 @@ module.exports = {
           color = item.color;
         }
       });
-      if(isTag){
+      if (isTag) {
         return <Tag color={color}>{theType}</Tag>
-      }else{
+      } else {
         return theType;
       }
-    }else{
-      if(isTag){
+    } else {
+      if (isTag) {
         return <Tag color='#000'>未知</Tag>
-      }else{
+      } else {
         return '未知';
       }
     }
   },
   //获取消息提醒状态
-  getMessageReminderStart: function (e,isTag) {
+  getMessageReminderStart: function (e, isTag) {
     if (!isNaN(parseInt(e))) {
       let theType = "";
       let color = "";
@@ -1132,21 +1132,21 @@ module.exports = {
           color = item.color;
         }
       });
-      if(isTag){
+      if (isTag) {
         return <Tag color={color}>{theType}</Tag>
-      }else{
+      } else {
         return theType;
       }
-    }else{
-      if(isTag){
+    } else {
+      if (isTag) {
         return <Tag color='#000'>未知</Tag>
-      }else{
+      } else {
         return '未知';
       }
     }
   },
   //获取分配状态名称
-  getTransferType:function (id){
+  getTransferType: function (id) {
     if (!isNaN(parseInt(id))) {
       let typeName = '';
       transferType.map(function (item) {
@@ -1794,10 +1794,10 @@ module.exports = {
   },
   //项目状态
   getProjectStatus: function (e) {
-    let arr = projectStatusList.filter(v=>{
+    let arr = projectStatusList.filter(v => {
       return v.value === e
     });
-    if(arr.length){
+    if (arr.length) {
       return arr[0].label
     }
     return '';
@@ -1946,7 +1946,7 @@ module.exports = {
       }
       if (record.approval === 1) {
         theType = "特批审核中"
-        if(record.status === 3){
+        if (record.status === 3) {
           theType = "特批被拒"
         }
       } else {
@@ -2021,7 +2021,7 @@ module.exports = {
       num = "完成";
     } else if (status == 5) {
       num = "取消变更";
-    }else if(status == 6) {
+    } else if (status == 6) {
       num = "待上传附件";
     }
     if (pro == 7 && status == 2) {
@@ -2030,7 +2030,7 @@ module.exports = {
       return "订单变更退票中 (财务处理中)";
     } else if (pro >= 7 && status == 4) {
       return "订单变更已完成";
-    }else if(pro >= 7 && status == 6) {
+    } else if (pro >= 7 && status == 6) {
       return "待上传附件(营销员处理中)";
     } else {
       return str + num;
@@ -2119,22 +2119,22 @@ module.exports = {
     );
   },
   getProjectName(e) {
-    let arr = projectStatusList.filter(v=>{
+    let arr = projectStatusList.filter(v => {
       return v.value === e
     });
-    if(arr.length){
+    if (arr.length) {
       return arr[0].label
     }
     return '';
   },
-  download(fileName,deleteLv= true) {
-    window.open(globalConfig.context +`${'/open/download?fileName='+fileName+'&delete='+deleteLv}`);
+  download(fileName, deleteLv = true) {
+    window.open(globalConfig.context + `${'/open/download?fileName=' + fileName + '&delete=' + deleteLv}`);
   },
-  getClockState(id,journal = false) {
-    let arr = journal ? clockJournalState.filter(v=>v.id === id) : clockState.filter(v=>v.id === id);
-    if(arr.length > 0){
+  getClockState(id, journal = false) {
+    let arr = journal ? clockJournalState.filter(v => v.id === id) : clockState.filter(v => v.id === id);
+    if (arr.length > 0) {
       return arr[0];
-    }else{
+    } else {
       return {};
     }
   }