diff --git a/src/components/subnav/main.js b/src/components/subnav/main.js index 7848a392..258ec543 100644 --- a/src/components/subnav/main.js +++ b/src/components/subnav/main.js @@ -100,7 +100,8 @@ export default class topNav extends React.Component { "product-edit", "distributor-merchant", "callback-message", - "coupon-commodity" + "coupon-commodity", + "packageDetail" ] const backShowRoutes = [ "account-add", diff --git a/src/pages/order/packageDetail/index.js b/src/pages/order/packageDetail/index.js new file mode 100644 index 00000000..fbd9aa13 --- /dev/null +++ b/src/pages/order/packageDetail/index.js @@ -0,0 +1,155 @@ +import { getOrderDetails, getOrderLog, handelResponse } from "@/assets/api.js" +import "@/assets/comm.css" +import Grid from "@/components/gird/main.js" +import TabPage from "@/components/tabPage/main.js" +import moment from "moment" +import React from "react" +import ReactJson from "react-json-view" +import { Notify } from "zent" +import "./more.less" +const Column = [ + { + title: "创建时间", + name: "time", + prop: "time", + type: "slot", + width: "20%" + }, + { + title: "操作描述", + name: "message", + prop: "message", + type: "normal", + width: "20%" + }, + { + title: "详情", + name: "opearo", + type: "slot", + prop: "opearo", + width: "50%" + } +] + +export default class order extends React.Component { + constructor(props) { + super(props) + this.state = { + tabList: [{ title: "详情" }], + tabactive: 0, + orderDetailLog_data: [], + orderDetail_data: {}, + tableHeight: 500, + page: 1, + orderNo: "", + limit: 10, + total: 0 + } + } + tabFn(index) { + this.setState({ tabactive: index }) + let activerou = [] + if (index == 0) { + activerou = [ + { + items: [ + { + path: "/settlementList", + name: "包码结算列表" + }, + { + path: "/packageDetail", + name: "包码详情" + } + ] + } + ] + } + sessionStorage.setItem("breaknav", JSON.stringify(activerou)) + this.getOrderLogFn() + } + selection() {} + //获取订单日志 + getOrderLogFn() { + let _self = this + let { page, limit, orderNo } = this.state + let data = { + page, + limit + } + getOrderLog(orderNo, data) + .then((res) => { + handelResponse( + res, + (response, msg) => { + const orderDetailLog_data = response.data + _self.setState({ orderDetailLog_data, total: response.total }) + }, + (err) => { + Notify.error(err) + } + ) + }) + .catch((err) => {}) + } + //获取详情信息 + getDetails(data) { + let _self = this + getOrderDetails(data) + .then((res) => { + handelResponse( + res, + (response, msg) => { + console.log(response) + _self.setState({ orderDetail_data: response }) + }, + (err) => { + Notify.error(err) + } + ) + }) + .catch((err) => {}) + } + //page + pageChange(e) { + this.setState({ page: e }) + setTimeout(() => { + this.getOrderLogFn() + }, 0) + } + //limit + countChange(e) { + this.setState({ page: 1, limit: e }) + setTimeout(() => { + this.getOrderLogFn() + }, 0) + } + componentWillMount() { + let href = window.location.href + let strindex = href.lastIndexOf("=") + let orderNo = href.substr(strindex + 1, href.length) + this.setState({ orderNo }) + this.getDetails(orderNo) + this.setState({ tableHeight: window.innerHeight - 430 }) + } + + render() { + let orderDetail_data = this.state.orderDetail_data + return ( +