|
@@ -99,7 +99,7 @@
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button-group>
|
|
<el-button-group>
|
|
<el-button size="small" @click="handleImport" v-hasPermi="['system:material:import']">批量导入</el-button>
|
|
<el-button size="small" @click="handleImport" v-hasPermi="['system:material:import']">批量导入</el-button>
|
|
- <el-button size="small" @click="handleQueryExport" v-hasPermi="['system:material:export']">批量导出</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="handleExport" v-hasPermi="['system:material:export']">批量导出</el-button>
|
|
</el-button-group>
|
|
</el-button-group>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
@@ -206,6 +206,7 @@
|
|
components: {
|
|
components: {
|
|
ElSuperSearch: () => import("@/components/super-search/index.vue"),
|
|
ElSuperSearch: () => import("@/components/super-search/index.vue"),
|
|
ElDictTag: () => import("@/components/DictTag/index.vue"),
|
|
ElDictTag: () => import("@/components/DictTag/index.vue"),
|
|
|
|
+
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
const params = this.$init.params(SearchColumns);
|
|
const params = this.$init.params(SearchColumns);
|
|
@@ -459,13 +460,8 @@
|
|
this.importData.list = fileList;
|
|
this.importData.list = fileList;
|
|
},
|
|
},
|
|
|
|
|
|
- // 查询条件导出
|
|
|
|
- handleQueryExport(){
|
|
|
|
- console.log(this.params,'this.params');
|
|
|
|
- this.download('/system/material/export', this.params, `物料基本信息${new Date().getTime()}.xlsx`);
|
|
|
|
- },
|
|
|
|
- // 多选批量导出
|
|
|
|
- handleSelectExport() {
|
|
|
|
|
|
+ // 批量导出
|
|
|
|
+ handleExport() {
|
|
|
|
|
|
let ids = this.checkedList.length ? this.checkedList.map(i => i.id) : [];
|
|
let ids = this.checkedList.length ? this.checkedList.map(i => i.id) : [];
|
|
|
|
|
|
@@ -477,11 +473,7 @@
|
|
}
|
|
}
|
|
this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
|
|
this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
|
|
} else {
|
|
} else {
|
|
- this.$notify({
|
|
|
|
- title:'警告',
|
|
|
|
- message: '请选择需要导出的数据!',
|
|
|
|
- type: 'warning'
|
|
|
|
- });
|
|
|
|
|
|
+ this.download('/system/material/export', this.params, `物料基本信息${new Date().getTime()}.xlsx`);
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -542,31 +534,49 @@
|
|
this.checkedList = selection;
|
|
this.checkedList = selection;
|
|
},
|
|
},
|
|
// 获取物料列表信息
|
|
// 获取物料列表信息
|
|
- getMaterialList(templateCode, query) {
|
|
|
|
- // (params, page)
|
|
|
|
- let _this = this;
|
|
|
|
- this.loading = true;
|
|
|
|
- let page = {
|
|
|
|
- pageNum: this.queryParams.pageNum,
|
|
|
|
- pageSize: this.queryParams.pageSize,
|
|
|
|
- }
|
|
|
|
|
|
+ async getMaterialList(templateCode, query) {
|
|
|
|
|
|
- let param = {
|
|
|
|
- templateCode,
|
|
|
|
- ...this.params
|
|
|
|
- // ...this.queryForm
|
|
|
|
- }
|
|
|
|
- // console.log(param, 'param');
|
|
|
|
- materialApi.materialList(param, page).then((res) => {
|
|
|
|
- _this.loading = false;
|
|
|
|
- console.log(res, '获取物料列表信息以及表头字段');
|
|
|
|
- let {code, data} = res;
|
|
|
|
|
|
+ try {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ let page = {
|
|
|
|
+ pageNum: this.queryParams.pageNum,
|
|
|
|
+ pageSize: this.queryParams.pageSize,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let param = {
|
|
|
|
+ templateCode,
|
|
|
|
+ ...this.params,
|
|
|
|
+ createTimeBegin: (this.params.createTimeQueue && this.params.createTimeQueue[0]) || '',
|
|
|
|
+ createTimeEnd:(this.params.createTimeQueue && this.params.createTimeQueue[1]) || '',
|
|
|
|
+ updateTimeBegin:(this.params.updateTimeQueue && this.params.updateTimeQueue[0]) || '',
|
|
|
|
+ updateTimeEnd:(this.params.updateTimeQueue && this.params.updateTimeQueue[1]) || ''
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ console.log(param,'param--------------');
|
|
|
|
+
|
|
|
|
+ let {code,data} = await materialApi.materialList(param, page);
|
|
|
|
+
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- _this.taskList = data.tableBody.rows;
|
|
|
|
- _this.total = data.tableBody.total;
|
|
|
|
|
|
+ this.taskList = data.tableBody.rows;
|
|
|
|
+ this.total = data.tableBody.total;
|
|
|
|
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+
|
|
|
|
+ }finally{
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // materialApi.materialList(param, page).then((res) => {
|
|
|
|
+ // _this.loading = false;
|
|
|
|
+ // console.log(res, '获取物料列表信息以及表头字段');
|
|
|
|
+ // let {code, data} = res;
|
|
|
|
+ // if (code == 200) {
|
|
|
|
+ // _this.taskList = data.tableBody.rows;
|
|
|
|
+ // _this.total = data.tableBody.total;
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
},
|
|
},
|
|
// 获取物料列表表头
|
|
// 获取物料列表表头
|
|
getTagList(templateCode) {
|
|
getTagList(templateCode) {
|