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 ( +
+ + + +
+ ) + } +} diff --git a/src/pages/order/packageDetail/more.less b/src/pages/order/packageDetail/more.less new file mode 100644 index 00000000..7cf8be83 --- /dev/null +++ b/src/pages/order/packageDetail/more.less @@ -0,0 +1,40 @@ +#more{ + + .main-body{ + padding: 24px; + box-sizing: border-box; + + li{ + width: 40%; + list-style-type: none; + display: flex; + justify-content: space-between; + line-height: 42px; + font-size: 14px; + span{ + color:#626366; + // font-size: 14px; + } + font{ + color:#313233; + } + + } + .num{ + span,font{ + color:#ccc!important; + } + + } + } +} +.logOrder{ + ul{ + li{ + padding: 8px 0; + font{ + color: #313233; + } + } + } +} \ No newline at end of file diff --git a/src/pages/order/settlementList/list.jsx b/src/pages/order/settlementList/list.jsx index db7d91f6..21fcfdc6 100644 --- a/src/pages/order/settlementList/list.jsx +++ b/src/pages/order/settlementList/list.jsx @@ -136,18 +136,18 @@ export default class settlementList extends React.Component { //详情 moreFn(e, row) { - this.props.history.push("/home/order-addetails?oid=" + row.order_number) - sessionStorage.setItem("pathname2", "/home/order-addetails") + this.props.history.push("/home/packageDetail?id=" + row.id) + sessionStorage.setItem("pathname2", "/home/packageDetail") let activerou = [ { items: [ { - path: "/home/order-list", - name: "订单管理" + path: "/home/settlementList", + name: "包码列表" }, { - path: "/home/order-addetails", - name: "订单详情" + path: "/home/packageDetail", + name: "包码详情" } ] } diff --git a/src/router/index.js b/src/router/index.js index 9e8d1c80..5905e07f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -30,6 +30,7 @@ import downloadList from "@/pages/order/downloadList/list" import OrderList from "@/pages/order/list/list" import OrderDetails from "@/pages/order/more/more" import SettlementList from "@/pages/order/settlementList/list" +import PackageDetail from "@/pages/order/packageDetail" import PlanAdd from "@/pages/plan/add/add" import PlanEdit from "@/pages/plan/add/edit" import PlanEditCopy from "@/pages/plan/add/plan-copy" @@ -91,6 +92,10 @@ const router = [ path: "/home/settlementList", component: SettlementList }, + { + path: "/home/packageDetail", + component: PackageDetail + }, { path: "/home/mytempMould", component: MyTempMouldAdd