From 9d50a1aca705827f8601d61d4641d72f3f6bcdce Mon Sep 17 00:00:00 2001 From: xielue Date: Wed, 7 Jun 2023 16:30:40 +0800 Subject: [PATCH] =?UTF-8?q?bom=E5=AF=BC=E5=85=A5=20=E6=96=99=E5=93=81?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/application/mk/basic-pages/list.vue | 29 +- src/pages/Middle/Mes/MesBom/MesBom/List.vue | 251 ++++++++++++++++- .../Mes/MesMaterials/MesMaterials/index.vue | 252 ++++++++++++------ 3 files changed, 445 insertions(+), 87 deletions(-) diff --git a/src/application/mk/basic-pages/list.vue b/src/application/mk/basic-pages/list.vue index aacb96c..5b5795b 100644 --- a/src/application/mk/basic-pages/list.vue +++ b/src/application/mk/basic-pages/list.vue @@ -147,9 +147,11 @@ export default { headerCells.push(item.title); } - + + + let details = JSON.parse(JSON.stringify(this.$refs.xGrid.getTableData().fullData)); - + details.forEach(row => { let jsonRow = { @@ -157,16 +159,19 @@ export default { for (let i = 0; i < this.options.exportColumns.length; i++) { let item = this.options.exportColumns[i]; var v = ""; - if(item.dataField){ - v = row[item.dataField]; - if(item.textField && v){ + if (item.valueGetter) { + v = item.valueGetter({ row: row,column:item }); + } + else if (item.dataField) { + v = row[item.dataField]; + if (item.textField && v) { v = v[item.textField] } - }else{ + } else { v = row[item.field] || ''; } - - jsonRow[item.title] = v; + + jsonRow[item.title] = v; } jsonRows.push(jsonRow); }); @@ -178,7 +183,7 @@ export default { /* get binary string as output */ var wbout = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'array' }) try { - FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), (this.options.exportFileTitle || '导出数据' )+ '.xlsx') + FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), (this.options.exportFileTitle || '导出数据') + '.xlsx') } catch (e) { if (typeof console !== 'undefined') { console.log(e, wbout) @@ -289,7 +294,7 @@ export default { if (mode == "like") { // 如果是模糊搜索 value = "%" + value + "%"; // 如果是模糊搜索就在两边加上% } - if(typeof(value) == "object" && value.id){ + if (typeof (value) == "object" && value.id) { value = value.id; } rules.push({ // 添加搜索参数 @@ -498,6 +503,10 @@ export default { this.bindSearchData = arg; this.$refs.xGrid.commitProxy('query') // 提交搜索 }, + + gridReload(){ + this.$refs.xGrid.commitProxy('query') + } }, // 监听属性 watch: { diff --git a/src/pages/Middle/Mes/MesBom/MesBom/List.vue b/src/pages/Middle/Mes/MesBom/MesBom/List.vue index 2aacd8f..006eb68 100644 --- a/src/pages/Middle/Mes/MesBom/MesBom/List.vue +++ b/src/pages/Middle/Mes/MesBom/MesBom/List.vue @@ -1,5 +1,5 @@