|
@@ -18,7 +18,7 @@
|
|
|
</el-form-item>
|
|
|
<!--操作按钮-->
|
|
|
<el-form-item style="float:right;">
|
|
|
- <el-link type="primary" :underline="false" :disabled="productSelections.length==0" @click="importProduct()">导出产品</el-link>
|
|
|
+ <el-link type="primary" :underline="false" :disabled="productSelections.length==0" @click="exportProduct()">导出产品</el-link>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float:right;">
|
|
|
<el-upload class="filter-item" name="file" action :on-error="uploadFalse" :on-success="uploadSuccess"
|
|
@@ -752,7 +752,7 @@ export default {
|
|
|
listLoading: false,
|
|
|
total: 0,
|
|
|
page: 1,
|
|
|
- size: localStorage.getItem("projectPageSize") == null ? 20 : parseInt(localStorage.getItem("projectPageSize")),
|
|
|
+ size: localStorage.getItem("projectPageSize") == null ? 10 : parseInt(localStorage.getItem("projectPageSize")),
|
|
|
list: [
|
|
|
{
|
|
|
tableProdProcedure: {
|
|
@@ -972,9 +972,42 @@ export default {
|
|
|
|
|
|
|
|
|
},
|
|
|
- importProduct() {
|
|
|
+ exportProduct() {
|
|
|
+
|
|
|
let productSelectionString = JSON.stringify(this.productSelections);
|
|
|
- this.http.post("/product/exportData", {
|
|
|
+
|
|
|
+ this.exportDisabled = true
|
|
|
+ this.exportNotification = this.$notify({
|
|
|
+ title: '导出产品',
|
|
|
+ message: '产品导出中、请稍后...',
|
|
|
+ duration: 0,
|
|
|
+ showClose: false
|
|
|
+ });
|
|
|
+ //导出产品
|
|
|
+ this.http.post('/product/exportData', {date: productSelectionString,productType: this.category},
|
|
|
+ res => {
|
|
|
+ this.exportDisabled = false
|
|
|
+ this.exportNotification.close()
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.productSelections=[]
|
|
|
+ var filePath = res.data;
|
|
|
+ const a = document.createElement('a'); // 创建a标签
|
|
|
+ a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
|
|
|
+ a.setAttribute('href', filePath);// href链接
|
|
|
+ a.click(); //自执行点击事件
|
|
|
+ a.remove();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.exportNotification.close()
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ /* this.http.post("/product/exportData", {
|
|
|
date: productSelectionString,
|
|
|
productType: this.category
|
|
|
},
|
|
@@ -986,7 +1019,7 @@ export default {
|
|
|
type: 'success'
|
|
|
});
|
|
|
}
|
|
|
- })
|
|
|
+ }) */
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
this.productSelections = []
|