未结算报表增加费用减免列
This commit is contained in:
		
							parent
							
								
									e472d8042e
								
							
						
					
					
						commit
						aec4479c80
					
				| 
						 | 
				
			
			@ -244,13 +244,43 @@ export default {
 | 
			
		|||
        }
 | 
			
		||||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
        let arr = JSON.parse(this.row)
 | 
			
		||||
        this.rowData = arr
 | 
			
		||||
        this.getDataAll()
 | 
			
		||||
        console.log('📋 ApplyDetail 组件挂载,接收到的 row 数据:', this.row);
 | 
			
		||||
        this.initData();
 | 
			
		||||
        //   this.getUnitList();
 | 
			
		||||
        //   this.getProjectList();
 | 
			
		||||
    },
 | 
			
		||||
    activated() {
 | 
			
		||||
        // 当组件被 keep-alive 缓存后重新激活时调用
 | 
			
		||||
        console.log('📋 ApplyDetail 组件激活 (keep-alive),row 数据:', this.row);
 | 
			
		||||
        this.initData();
 | 
			
		||||
    },
 | 
			
		||||
    watch: {
 | 
			
		||||
        // 监听 row 数据变化
 | 
			
		||||
        row: {
 | 
			
		||||
            handler(newVal, oldVal) {
 | 
			
		||||
                console.log('📋 监听到 row 数据变化:', { newVal, oldVal });
 | 
			
		||||
                if (newVal && newVal !== oldVal) {
 | 
			
		||||
                    this.initData();
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            immediate: false
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        // 初始化数据 - 统一处理数据解析和API调用
 | 
			
		||||
        initData() {
 | 
			
		||||
            if (!this.row) {
 | 
			
		||||
                console.log('📋 row 数据为空,跳过初始化');
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            console.log('📋 开始初始化数据,row:', this.row);
 | 
			
		||||
            let arr = JSON.parse(this.row)
 | 
			
		||||
            console.log('📋 解析后的数据:', arr);
 | 
			
		||||
            this.rowData = arr
 | 
			
		||||
            console.log('📋 准备调用 getDataAll() 获取详情数据');
 | 
			
		||||
            this.getDataAll()
 | 
			
		||||
        },
 | 
			
		||||
        //获取单位类型 ,getUnitList, getProjectList
 | 
			
		||||
        getUnitList() {
 | 
			
		||||
            getUnitList().then((response) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -264,7 +294,10 @@ export default {
 | 
			
		|||
        },
 | 
			
		||||
        /** 查询列表 */
 | 
			
		||||
        getDataAll() {
 | 
			
		||||
            console.log('🔥 开始调用 getSltInfo API,传入参数:', this.rowData);
 | 
			
		||||
            getSltInfo(this.rowData).then((response) => {
 | 
			
		||||
                console.log('🔥 API 调用成功,返回数据:', response);
 | 
			
		||||
                console.log('🔥 返回的详情数据:', response.data);
 | 
			
		||||
                this.leaseList = response.data.leaseList //租赁费用列表
 | 
			
		||||
                this.projectName = response.data.projectName
 | 
			
		||||
                this.unitName = response.data.unitName
 | 
			
		||||
| 
						 | 
				
			
			@ -311,6 +344,9 @@ export default {
 | 
			
		|||
                this.costAll = costSum
 | 
			
		||||
 | 
			
		||||
                this.subCostFlag = costSum
 | 
			
		||||
            }).catch((error) => {
 | 
			
		||||
                console.error('❌ API 调用失败:', error);
 | 
			
		||||
                this.$message.error('获取结算详情失败: ' + (error.message || error));
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
        //计算金额1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -431,18 +431,14 @@ export default {
 | 
			
		|||
        },
 | 
			
		||||
        //结算申请
 | 
			
		||||
        handleApply(row) {
 | 
			
		||||
            console.log('🚀 handleApply 被调用,传入数据:', row);
 | 
			
		||||
            let arr = [];
 | 
			
		||||
            arr.push(row);
 | 
			
		||||
            // console.log(arr)
 | 
			
		||||
            // console.log(this.ids)
 | 
			
		||||
            // console.log(JSON.stringify(arr))
 | 
			
		||||
            // this.$tab.closeOpenPage({
 | 
			
		||||
            //     path: '/cost/costApplyDetail',
 | 
			
		||||
            //     query: {
 | 
			
		||||
            //         rowData: JSON.stringify(arr),
 | 
			
		||||
            //     },
 | 
			
		||||
            // })
 | 
			
		||||
            console.log('🚀 准备发送的数据:', arr);
 | 
			
		||||
            console.log('🚀 JSON化后的数据:', JSON.stringify(arr));
 | 
			
		||||
            // 注意:'/cost/costApplyDetail' 路由不存在,使用组件切换方式
 | 
			
		||||
            this.$emit("goDetail",JSON.stringify(arr));
 | 
			
		||||
            console.log('🚀 goDetail 事件已发出');
 | 
			
		||||
        },
 | 
			
		||||
        handleApplyList() {
 | 
			
		||||
            if (this.ids.length < 1) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,9 +39,11 @@ export default {
 | 
			
		|||
    methods: {
 | 
			
		||||
        // 退料编辑
 | 
			
		||||
        goDetail(rowData) {
 | 
			
		||||
            console.log('🎯 父组件接收到 goDetail 事件,数据:', rowData);
 | 
			
		||||
            this.rowData = rowData;
 | 
			
		||||
            this.pageContent = '结算详情';
 | 
			
		||||
            this.isShowComponent = 'ApplyDetail';
 | 
			
		||||
            console.log('🎯 组件已切换到 ApplyDetail');
 | 
			
		||||
        },
 | 
			
		||||
        goBack() {
 | 
			
		||||
            this.isShowComponent = 'ApplyHome'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue