Authored by 李奇

商品退库导出修改

@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
31 const params = { supplierId, returnedSupplierId: returnId }; 31 const params = { supplierId, returnedSupplierId: returnId };
32 32
33 this.returnId = returnId; 33 this.returnId = returnId;
  34 + this.supplierId = supplierId;
34 this.supplierName = supplierName; 35 this.supplierName = supplierName;
35 36
36 this.$Loading.start(); 37 this.$Loading.start();
@@ -47,7 +48,10 @@ @@ -47,7 +48,10 @@
47 this.$router.push({ name: 'repository.prodReturn.list' }); 48 this.$router.push({ name: 'repository.prodReturn.list' });
48 }, 49 },
49 exportDetail() { 50 exportDetail() {
  51 + let href = `/Api/erp/exportProductReturnList?
  52 + supplierId=${this.supplierId}&returnedSupplierId=${this.returnId}`;
50 53
  54 + window.open(href, '_blank');
51 } 55 }
52 } 56 }
53 }; 57 };
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </FilterItem> 23 </FilterItem>
24 <FilterItem> 24 <FilterItem>
25 <Button type="primary" @click="filterSearch">筛选</Button> 25 <Button type="primary" @click="filterSearch">筛选</Button>
26 - <Button type="primary">导出</Button> 26 + <Button type="primary" @click="exportList">导出</Button>
27 <Button @click="clearFilter">清空条件</Button> 27 <Button @click="clearFilter">清空条件</Button>
28 </FilterItem> 28 </FilterItem>
29 </LayoutFilter> 29 </LayoutFilter>
@@ -166,6 +166,39 @@ @@ -166,6 +166,39 @@
166 } 166 }
167 }); 167 });
168 168
  169 + },
  170 + exportList() {
  171 + const keysMap = {
  172 + bOutTime: 'bOutTime',
  173 + eOutTime: 'eOutTime',
  174 + productSkn: 'sknCode',
  175 + productSku: 'skuCode',
  176 + factoryCode: 'prodBarCode',
  177 + bCreateTime: 'bCreateTime',
  178 + eCreateTime: 'eCreateTime',
  179 + returnedSupplierId: 'reqNum'
  180 + };
  181 + const fields = this.filters;
  182 +
  183 + let temp = [];
  184 + let params = {};
  185 +
  186 + _.each(keysMap, (val, key) => {
  187 + params[key] = fields[val].model;
  188 + });
  189 +
  190 + params = _.pickBy(params, (v) => {
  191 + return (v + '').length;
  192 + });
  193 +
  194 + _.each(params, (val, key) => {
  195 + temp.push(`${key}=${val}`);
  196 + });
  197 +
  198 + window.open(`/Api/erp/allotExportList?${temp.join('&')}`, '_blank');
  199 + },
  200 + exportOne(id) {
  201 + window.open(`/Api/erp/exportProductReturnList?returnedSupplierId=${id}`, '_blank');
169 } 202 }
170 }, 203 },
171 components: {} 204 components: {}
@@ -8,6 +8,7 @@ import timeFormat from 'filters/time-format'; @@ -8,6 +8,7 @@ import timeFormat from 'filters/time-format';
8 export default function() { 8 export default function() {
9 return { 9 return {
10 returnId: '', 10 returnId: '',
  11 + supplierId: '',
11 supplierName: '', 12 supplierName: '',
12 columns: [ 13 columns: [
13 { 14 {
@@ -139,7 +139,12 @@ export default function() { @@ -139,7 +139,12 @@ export default function() {
139 详情 139 详情
140 </i-button> 140 </i-button>
141 </span> 141 </span>
142 - <span><i-button type="primary" size="small">导出</i-button></span> 142 + <span>
  143 + <i-button type="primary" size="small"
  144 + onClick={() => this.exportOne(row.returnedSupplierId)}>
  145 + 导出
  146 + </i-button>
  147 + </span>
143 </div> 148 </div>
144 ); 149 );
145 }, 150 },
@@ -18,6 +18,8 @@ let domainApis = { @@ -18,6 +18,8 @@ let domainApis = {
18 allotPrintExpressDetail: '/erp-shop-web/purchase/queryExpressListByExpressNumber', 18 allotPrintExpressDetail: '/erp-shop-web/purchase/queryExpressListByExpressNumber',
19 returnSupplierList: '/erp-shop-web/logistics/returnedSupplier/list', 19 returnSupplierList: '/erp-shop-web/logistics/returnedSupplier/list',
20 returnSupplierDetail: '/erp-shop-web/logistics/returnedSupplier/detail', 20 returnSupplierDetail: '/erp-shop-web/logistics/returnedSupplier/detail',
  21 + exportProductReturnList: '/erp-shop-web/export/exportReturnForInvoice',
  22 + exportProductReturnDetail: '/erp-shop-web/export/exportReturnDetailForInvoice',
21 jitProductList: '/erp-shop-web/product/jitProductList', 23 jitProductList: '/erp-shop-web/product/jitProductList',
22 getJitStorageListBySkn: '/erp-shop-web/product/getJitStorageListBySkn', 24 getJitStorageListBySkn: '/erp-shop-web/product/getJitStorageListBySkn',
23 importJitStorage: '/erp-shop-web/product/importJitStorage', 25 importJitStorage: '/erp-shop-web/product/importJitStorage',