退料查询优化
This commit is contained in:
		
							parent
							
								
									02771f4edb
								
							
						
					
					
						commit
						0b1ce97392
					
				| 
						 | 
				
			
			@ -315,10 +315,23 @@ export default {
 | 
			
		|||
        let start = new Date()
 | 
			
		||||
        start.setMonth(start.getMonth() - 1)
 | 
			
		||||
        this.queryParams.time = [this.format(start), this.format(end)]
 | 
			
		||||
        this.getList();
 | 
			
		||||
        // 不在这里直接调用getList,等字典数据加载完成后再调用
 | 
			
		||||
        this.initSelectData()
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        // 字典数据加载完成后的回调
 | 
			
		||||
        onDictReady(dict) {
 | 
			
		||||
            // 获取back_task_status的所有选项
 | 
			
		||||
            const validOptions = dict.type.back_task_status || []
 | 
			
		||||
            
 | 
			
		||||
            // 如果有有效选项,设置第一个为默认值
 | 
			
		||||
            if (validOptions.length > 0) {
 | 
			
		||||
                this.queryParams.status = validOptions[0].value
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            // 执行查询
 | 
			
		||||
            this.getList()
 | 
			
		||||
        },
 | 
			
		||||
        format(date) {
 | 
			
		||||
            const y = date.getFullYear()
 | 
			
		||||
            const m = String(date.getMonth() + 1).padStart(2, '0')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue