diff --git a/src/assets/api.js b/src/assets/api.js
index c1304fef..49a8e43f 100644
--- a/src/assets/api.js
+++ b/src/assets/api.js
@@ -1019,4 +1019,9 @@ export const notifyReseller = (data) => {
return req("post", baseurl + "/order/notifyReseller", data)
}
+/* 获取包码订单结算列表 */
+export const getSettlementOrder = (data) => {
+ return req("get", baseurl + "/settlement_order/list", data)
+}
+
export { req }
diff --git a/src/pages/order/settlementList/list.jsx b/src/pages/order/settlementList/list.jsx
new file mode 100644
index 00000000..bc6ef87e
--- /dev/null
+++ b/src/pages/order/settlementList/list.jsx
@@ -0,0 +1,389 @@
+import {
+ getPlanChoseOption,
+ getReSellerOption,
+ getSettlementOrder,
+ getSettlementType,
+ handelResponse,
+ queryKeyBatch
+} from "@/assets/api.js"
+import "@/assets/comm.css"
+import { nowDay, nowMonth } from "@/assets/comm.js"
+import FormItem from "@/components/form-item/main"
+import Form from "@/components/form/main"
+import Grid from "@/components/gird/main.js"
+import Ipt from "@/components/input/main"
+import TabPage from "@/components/tabPage/main.js"
+import React from "react"
+import { Alert, Button, CombinedDateRangePicker, Notify, Select } from "zent"
+import "./list.less"
+import { Column } from "./utils"
+import { pickBy } from "lodash-es"
+var moment = require("moment")
+let day = moment(nowDay()).format("YYYY-MM-DD")
+let tomonth = moment(nowMonth()).format("YYYY-MM-DD")
+
+export default class settlementList extends React.Component {
+ constructor(props) {
+ super(props)
+ this.state = {
+ tabList: [{ title: "包码列表" }],
+ orderList: [],
+ selectionData: [],
+ allcheck: false,
+ itemcheck: false,
+ tableHeight: 500,
+ combinedValue: [],
+ planOptions: [],
+ resellerOptions: [],
+ keysOptions: [],
+ settlementOptions: [],
+ page: 1,
+ limit: 10,
+ officialPrice: 0,
+ costPrice: 0,
+ search: this.initSearch()
+ }
+ this.onChangeCombinedDate = this.onChangeCombinedDate.bind(this)
+ }
+
+ initSearch() {
+ return {
+ plan_id: "",
+ reseller_id: "",
+ key_batch_id: "",
+ type: "",
+ key: ""
+ }
+ }
+
+ searchChange(key, va) {
+ const search = this.state.search
+ search[key] = va
+ this.setState({ search })
+ }
+
+ //选中表格的选框
+ selection(selection) {
+ this.setState({ selectionData: selection })
+ let officialPrice = 0
+ let costPrice = 0
+ selection.forEach((item) => {
+ officialPrice += Number(item.key_official_price)
+ costPrice += Number(item.key_cost_price)
+ })
+ this.setState({ officialPrice, costPrice })
+ }
+
+ /* 获取营销计划/分销商/结算类型 */
+ getPlan() {
+ getPlanChoseOption().then((res) =>
+ handelResponse(
+ res,
+ (req, msg) => {
+ const planOptions = req.map((item) => ({
+ key: item.id,
+ text: item.title
+ }))
+ this.setState({ planOptions })
+ },
+ (err) => {}
+ )
+ )
+
+ getReSellerOption().then((res) => {
+ handelResponse(res, (req, msg) => {
+ const resellerOptions = req.map((item) => ({
+ key: item.id,
+ text: item.name
+ }))
+ this.setState({ resellerOptions })
+ })
+ })
+
+ getSettlementType().then((res) =>
+ handelResponse(
+ res,
+ (req, msg) => {
+ const settlementOptions = req.map((o) => {
+ return { key: o.settlement_type, text: o.settlement_text }
+ })
+ this.setState({ settlementOptions })
+ },
+ (err) => {}
+ )
+ )
+ }
+
+ /* 获取营销计划下的key批次 */
+ getBatchKeys(key) {
+ queryKeyBatch({ status: "4,5", plan_id: key, bind_object: 1 }).then((res) => {
+ handelResponse(
+ res,
+ (req, msg) => {
+ const keysOptions = req.map((item) => ({
+ key: item.id,
+ text: item.batch_name
+ }))
+ this.setState({ keysOptions })
+ },
+ (err) => {
+ Notify.error(err)
+ }
+ )
+ })
+ }
+
+ //详情
+ moreFn(e, row) {
+ this.props.history.push("/home/order-addetails?oid=" + row.order_number)
+ sessionStorage.setItem("pathname2", "/home/order-addetails")
+ let activerou = [
+ {
+ items: [
+ {
+ path: "/home/order-list",
+ name: "订单管理"
+ },
+ {
+ path: "/home/order-addetails",
+ name: "订单详情"
+ }
+ ]
+ }
+ ]
+ sessionStorage.setItem("breaknav", JSON.stringify(activerou))
+ }
+
+ //清空
+ clearFn() {
+ this.setState({ allcheck: false, selectionData: [], itemcheck: false })
+ }
+
+ //选择时间
+ onChangeCombinedDate(e) {
+ this.setState({ combinedValue: e, page: 1, selectionData: [] }, () => {
+ this.getOrderFn()
+ })
+ }
+
+ //page
+ pageChange(e) {
+ this.setState({ selectionData: [], page: e }, () => {
+ this.getOrderFn()
+ })
+ }
+
+ //limit
+ countChange(e) {
+ this.setState({ selectionData: [], page: 1, limit: e }, () => {
+ this.getOrderFn()
+ })
+ }
+
+ //!获取订单列表
+ getOrderFn() {
+ let { page, limit, search, combinedValue } = this.state
+ let data = {
+ page,
+ limit,
+ begin_time: combinedValue[0],
+ end_time: combinedValue[1]
+ }
+
+ for (let key in search) {
+ data[key] = typeof search[key] === "string" ? search[key] : search[key].key
+ }
+
+ getSettlementOrder(pickBy(data))
+ .then((res) => {
+ handelResponse(
+ res,
+ (response, msg) => {
+ const orderList_data = response.data
+ const { total } = response
+ this.setState({ orderList: orderList_data, total })
+ },
+ (err) => {
+ Notify.error(err)
+ }
+ )
+ })
+ .catch((err) => {})
+ }
+
+ componentWillMount() {
+ let datetime = [tomonth + " " + "00:00:00", day + " " + "23:59:59"]
+ this.getPlan()
+ this.setState({ tableHeight: window.innerHeight - 490, combinedValue: datetime }, () => {
+ this.getOrderFn()
+ })
+ }
+
+ /* 重置 */
+ reset() {
+ this.setState({ search: this.initSearch(), page: 1 }, () => this.getOrderFn())
+ }
+
+ //过滤表格枚举状态
+ render() {
+ const date = (
+