shish hace 1 año
padre
commit
76f46213c2
Se han modificado 2 ficheros con 14 adiciones y 0 borrados
  1. 6 0
      ghs/src/service/product/index.js
  2. 8 0
      ghs/src/views/item/list.vue

+ 6 - 0
ghs/src/service/product/index.js

@@ -92,6 +92,12 @@ list(data) {
     });
   }
 
+  generateStockTable(data) {
+    return this.request({
+      url: '/generate-stock-table',
+      params: data
+    });
+  }
 
 }
 

+ 8 - 0
ghs/src/views/item/list.vue

@@ -134,6 +134,7 @@
       <template #slot-download-price-btn>
         <el-button type="primary" size="mini" @click="downloadPrice(1)">批发价格表</el-button>
 		<el-button type="primary" size="mini" @click="downloadPrice(0)">零售价格表</el-button>
+		<el-button type="primary" size="mini" @click="downloadStock()">下载库存表</el-button>
       </template>
 
       <template #slot-add-goods-btn>
@@ -555,6 +556,13 @@ export default {
 			}
 		})
 	  },
+	  downloadStock(){
+		this.$service.product.generateStockTable().then(res => {
+			if(res.file){
+				window.location.href = res.file
+			}
+		})
+	  },
 	copyProduct(id){
 		this.$message({message: '开发中',type: 'warning'});
     	return;