Kaynağa Gözat

first commit

liuhairui 9 ay önce
ebeveyn
işleme
78d029144a

+ 16 - 1
src/view/yunyin/shengchanguanli/yuedudahuoshengchanjindu.vue

@@ -8,6 +8,7 @@
 			  <el-form-item>
 				<el-input v-model="searchInfo" placeholder="搜索" style="width: 180px;"></el-input>
 				<el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
+				<el-button  type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">每月客户导出</el-button>
 				</el-form-item>
 			</el-form>
 		  </div>
@@ -47,7 +48,7 @@
 			 			<el-table-column   align="left" label="包装完成数" prop="包装"  width="90" />
 						<el-table-column   align="left" label="订单状态" prop="订单状态"  width="90" />
 						<el-table-column   align="left" label="落货日期" prop="落货日期"  width="160" />
-			 			
+			 			<el-table-column   align="left" label="日期" prop="日期"  width="90" />
 			  </el-table>
 			  <!-- 分页 -->
 			  <div class="gva-pagination">
@@ -194,6 +195,20 @@ const onSubmit = () => {
 	}
 };
 
+//导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('tab');
+  // 文件名
+  const filename = _riqi.value + '每月客户导出.xlsx';
+  const wb = XLSX.utils.table_to_book(el, { raw: true });
+  const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
+  try {
+    FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
+  } catch (e) {
+    console.log(e);
+  }
+  return wbout;
+}
   
 // 分页相关的响应式变量
 const page = ref(1)