Authored by 李奇

请退单详情修改

@@ -10,19 +10,20 @@ @@ -10,19 +10,20 @@
10 </filter-item> 10 </filter-item>
11 </layout-filter> 11 </layout-filter>
12 <layout-list> 12 <layout-list>
13 - <Table border :columns="columns" 13 + <Table border :columns="columns" :row-class-name="rowClassName"
14 @on-selection-change="selectChange" :data="dataList"></Table> 14 @on-selection-change="selectChange" :data="dataList"></Table>
15 </layout-list> 15 </layout-list>
16 </layout-body> 16 </layout-body>
17 </template> 17 </template>
18 18
19 <script> 19 <script>
20 - import store from './store/detail'; 20 + import _ from 'lodash';
  21 + import { detail } from './store';
21 import rs from 'return-service'; 22 import rs from 'return-service';
22 23
23 export default { 24 export default {
24 data() { 25 data() {
25 - return store.apply(this); 26 + return detail.apply(this);
26 }, 27 },
27 created() { 28 created() {
28 const returnId = this.$route.params.id; 29 const returnId = this.$route.params.id;
@@ -42,8 +43,32 @@ @@ -42,8 +43,32 @@
42 }, 43 },
43 methods: { 44 methods: {
44 resolveRes(data) { 45 resolveRes(data) {
  46 + let totalNum = 0;
  47 + let totalOut = 0;
  48 +
45 this.dataList = data.records; 49 this.dataList = data.records;
46 - this.dataList.push({productSkn: '总计'}); 50 + _.each(this.dataList, item => {
  51 + totalNum += item.nums;
  52 + totalOut += item.outNums;
  53 + });
  54 + this.dataList.push({
  55 + productSkn: '总计',
  56 + nums: totalNum,
  57 + outNums: totalOut,
  58 + _isLastLine: true,
  59 + cellClassName: {
  60 + productSkn: 'cell-total',
  61 + occupiedNum: 'cell-occupy',
  62 + nums: 'cell-num',
  63 + outNums: 'cell-out-num'
  64 + }
  65 + });
  66 + },
  67 + rowClassName(row) {
  68 + if (row._isLastLine) {
  69 + return 'last-line';
  70 + }
  71 + return '';
47 }, 72 },
48 backList() { 73 backList() {
49 this.$router.push({ name: 'repository.prodReturn.list' }); 74 this.$router.push({ name: 'repository.prodReturn.list' });
@@ -71,4 +96,16 @@ @@ -71,4 +96,16 @@
71 margin-right: 20px; 96 margin-right: 20px;
72 } 97 }
73 98
  99 + .last-line {
  100 + td {
  101 + border: none;
  102 + }
  103 + }
  104 +
  105 + .cell-num,
  106 + .cell-occupy,
  107 + .cell-total,
  108 + .cell-out-num {
  109 + border-right: 1px solid #e3e8ee !important;
  110 + }
74 </style> 111 </style>
@@ -22,6 +22,10 @@ export default function() { @@ -22,6 +22,10 @@ export default function() {
22 render: (h, params) => { 22 render: (h, params) => {
23 const row = params.row; 23 const row = params.row;
24 24
  25 + if (row._isLastLine) {
  26 + return '';
  27 + }
  28 +
25 return ( 29 return (
26 <span>{row.productSkc}({row.colorName})</span> 30 <span>{row.productSkc}({row.colorName})</span>
27 ); 31 );
@@ -33,6 +37,10 @@ export default function() { @@ -33,6 +37,10 @@ export default function() {
33 render: (h, params) => { 37 render: (h, params) => {
34 const row = params.row; 38 const row = params.row;
35 39
  40 + if (row._isLastLine) {
  41 + return '';
  42 + }
  43 +
36 return ( 44 return (
37 <span>{row.productSku}({row.sizeName})</span> 45 <span>{row.productSku}({row.sizeName})</span>
38 ); 46 );
@@ -44,6 +52,10 @@ export default function() { @@ -44,6 +52,10 @@ export default function() {
44 render: (h, params) => { 52 render: (h, params) => {
45 const row = params.row; 53 const row = params.row;
46 54
  55 + if (row._isLastLine) {
  56 + return '';
  57 + }
  58 +
47 return ( 59 return (
48 <span>{row.factoryCode || '-'}</span> 60 <span>{row.factoryCode || '-'}</span>
49 ); 61 );
@@ -95,6 +107,10 @@ export default function() { @@ -95,6 +107,10 @@ export default function() {
95 render: (h, params) => { 107 render: (h, params) => {
96 const row = params.row; 108 const row = params.row;
97 109
  110 + if (row._isLastLine) {
  111 + return '';
  112 + }
  113 +
98 return ( 114 return (
99 <span>{row.returndReason || '-'}</span> 115 <span>{row.returndReason || '-'}</span>
100 ); 116 );
@@ -106,6 +122,10 @@ export default function() { @@ -106,6 +122,10 @@ export default function() {
106 render: (h, params) => { 122 render: (h, params) => {
107 const row = params.row; 123 const row = params.row;
108 124
  125 + if (row._isLastLine) {
  126 + return '';
  127 + }
  128 +
109 return ( 129 return (
110 <span>{row.expressCode || '-'}</span> 130 <span>{row.expressCode || '-'}</span>
111 ); 131 );
@@ -120,6 +140,10 @@ export default function() { @@ -120,6 +140,10 @@ export default function() {
120 title: '请退时间', 140 title: '请退时间',
121 align: 'center', 141 align: 'center',
122 render: (h, params) => { 142 render: (h, params) => {
  143 + if (params.row._isLastLine) {
  144 + return '';
  145 + }
  146 +
123 return ( 147 return (
124 <span>{timeFormat(params.row.createTime)}</span> 148 <span>{timeFormat(params.row.createTime)}</span>
125 ); 149 );
@@ -129,6 +153,10 @@ export default function() { @@ -129,6 +153,10 @@ export default function() {
129 title: '退库时间', 153 title: '退库时间',
130 align: 'center', 154 align: 'center',
131 render: (h, params) => { 155 render: (h, params) => {
  156 + if (params.row._isLastLine) {
  157 + return '';
  158 + }
  159 +
132 return ( 160 return (
133 <span>{timeFormat(params.row.outTime)}</span> 161 <span>{timeFormat(params.row.outTime)}</span>
134 ); 162 );
  1 +/**
  2 + * index.js
  3 + * @author: leo
  4 + * @date: 07/06/2017
  5 + */
  6 +import list from './list';
  7 +import detail from './detail';
  8 +
  9 +export {
  10 + list,
  11 + detail
  12 +};
  13 +
  14 +