From 5138015b66b49d2fc176e942ee36aaf49ff12671 Mon Sep 17 00:00:00 2001 From: kilo Date: Tue, 25 Oct 2022 18:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=90=E5=A4=96=E9=A1=B5=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessWasteMaterialsList.vue | 23 +++++++++++++++---- .../ProcessWasteMaterialsLists.vue | 23 +++++++++---------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/views/wastematerials/ProcessWasteMaterialsList.vue b/src/views/wastematerials/ProcessWasteMaterialsList.vue index ce914a1..edee713 100644 --- a/src/views/wastematerials/ProcessWasteMaterialsList.vue +++ b/src/views/wastematerials/ProcessWasteMaterialsList.vue @@ -22,7 +22,8 @@ - + + @@ -40,7 +41,6 @@
- 新增 导出 导入 @@ -118,6 +118,8 @@ import { httpAction, getAction } from '@/api/manage' import JSuperQuery from '@/components/jeecg/JSuperQuery.vue' import ProcessWasteMaterialsLists from '@views/wastematerials/ProcessWasteMaterialsLists' + import { ajaxGetDictItems, getDictItemsFromCache } from '@api/api' + import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil' export default { name: 'ProcessWasteMaterialsList', @@ -207,6 +209,7 @@ }, created() { this.getSuperFieldList(); + this.initDictConfig(); }, computed: { importExcelUrl: function(){ @@ -218,6 +221,19 @@ this.$router.push({name:'src-views-wastematerials-ProcessWasteMaterialsLists',params:{material: record.material}}) }, initDictConfig(){ + //优先从缓存中读取字典配置 + if(getDictItemsFromCache(this.dictCode)){ + this.dictOptions = getDictItemsFromCache(this.dictCode); + return + } + + //根据字典Code, 初始化字典数组 + ajaxGetDictItems(this.dictCode, null).then((res) => { + if (res.success) { +// console.log(res.result); + this.dictOptions = res.result; + } + }) }, getSuperFieldList(){ // let fieldList=[]; @@ -246,16 +262,13 @@ getAction(this.url.queryLibraryName,item).then((res)=>{ if(res.success){ this.libraryNames = res.result.records; - console.log("222222") console.log(res.result.records); } }); getAction(this.url.queryListmaterials).then((res)=>{ if(res.success){ this.Listmaterials = res.result; - console.log("1111111") console.log(res.result); - console.log("22222-22") } }); } diff --git a/src/views/wastematerials/ProcessWasteMaterialsLists.vue b/src/views/wastematerials/ProcessWasteMaterialsLists.vue index 4543880..6862029 100644 --- a/src/views/wastematerials/ProcessWasteMaterialsLists.vue +++ b/src/views/wastematerials/ProcessWasteMaterialsLists.vue @@ -20,11 +20,11 @@ - - - - - + + + + + @@ -60,7 +60,7 @@
查询 - 重置{{material}} + 重置
@@ -123,6 +123,8 @@ import JDate from '@/components/jeecg/JDate.vue' import JSuperQuery from '@/components/jeecg/JSuperQuery.vue' import ProcessWasteMaterialsList from '@views/wastematerials/ProcessWasteMaterialsList' + import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil' + import { ajaxGetDictItems, getDictItemsFromCache } from '@api/api' export default { name: 'ProcessWasteMaterialsLists', @@ -243,9 +245,9 @@ dataIndex: 'warehousePeople' }, { - title:'核算属性', - align:"center", - dataIndex: 'accountingAttributes' + title: '核算属性', + align: "center", + dataIndex: 'accountingAttributes_dictText', } ], url: { @@ -340,9 +342,6 @@ fieldList.push({type:'string',value:'warehousePeople',text:'入库人',dictCode:''}) fieldList.push({type:'string',value:'accountingAttributes',text:'核算属性',dictCode:''}) this.superFieldList = fieldList - console.log("superFieldList : ") - console.log(this.superFieldList) - } } }