程序员不需要爱情 2021-04-16 10:29 采纳率: 0%
浏览 428

vue+element-ui以form为基础的表格如何实现每行数据相互独立?

如题,现在做了一个表格,每行的数据动态绑定已经实现,只做了cashin和cashout的第一行,现需求行与行之间的数据相互独立不会相互影响

 

 表格结构不是以table形式写的,使用table结构其他需求无法实现

 

 

//cashin
            //比率变化
            inputPratioChangeIn() {
                this.temp1.pCost = parseInt(this.temp1.pratio) * parseInt(this.temp1.moneyTotal) * 0.01;
            },
            //输入日期变化
            inputDateChange() {
                if (this.searchConfig == 'value0') {
                    this.deliveryDateChange();
                }
                if (this.searchConfig == 'value1') {
                    this.contractDateChange();
                }
                if (this.searchConfig == 'value2') {
                    this.installeDateChange();
                }
            },
            //起算节点变化
            startDateTypeChange(searchConfig) {
                debugger;
                this.searchConfig = searchConfig;
                if (this.searchConfig == 'value0') {
                    this.deliveryDateChange();
                }
                if (this.searchConfig == 'value1') {
                    this.contractDateChange();
                }
                if (this.searchConfig == 'value2') {
                    this.installeDateChange();
                }
            },
            //交货日期变化
            deliveryDateChange() {
                debugger;

                if (this.inputdate == undefined || this.inputdate == '') {
                    this.inputdate = 0;
                }
                var deliverydate = new Date(this.deliverydate);
                deliverydate.setDate(deliverydate.getDate() + parseInt(this.inputdate));
                let month = deliverydate.getMonth() + 1;
                let day = deliverydate.getDate();
                this.actualdate = deliverydate.getFullYear() + '-' + this.getFormatDate(month) + '-' + this.getFormatDate(day);
                this.temp1.actualmonth = deliverydate.getFullYear() + '-' + this.getFormatDate(month);
            },
            //合同日期变化
            contractDateChange() {
                debugger;
                if (this.inputdate == undefined || this.inputdate == '') {
                    this.inputdate = 0;
                }
                var contractdate = new Date(this.contractdate);
                contractdate.setDate(contractdate.getDate() + parseInt(this.inputdate));
                let month = contractdate.getMonth() + 1;
                let day = contractdate.getDate();
                this.actualdate = contractdate.getFullYear() + '-' + this.getFormatDate(month) + '-' + this.getFormatDate(day);
                this.temp1.actualmonth = contractdate.getFullYear() + '-' + this.getFormatDate(month);
            },
            //安装日期变化
            installeDateChange() {
                debugger;
                if (this.inputdate == undefined || this.inputdate == '') {
                    this.inputdate = 1;
                }
                var installedate = new Date(this.installedate);
                installedate.setDate(installedate.getDate() + parseInt(this.inputdate));
                let month = installedate.getMonth() + 1;
                let day = installedate.getDate();
                this.actualdate = installedate.getFullYear() + '-' + this.getFormatDate(month) + '-' + this.getFormatDate(day);
                this.temp1.actualmonth = installedate.getFullYear() + '-' + this.getFormatDate(month);
            },
  • 写回答

4条回答 默认 最新

  • 关注

    方便把情况说清楚一点吗?通过数组赋值,每行数据应该就是独立的吧。

    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB报错问题
  • ¥100 多线程+连接池+代理 运行一段时间线程阻塞
  • ¥15 关于#单片机#的问题:求一个使用C语言将重力加速度gx,gy,gz积分获取到速度的代码(相关搜索:c语言)
  • ¥15 matlab导致电脑重启问题
  • ¥15 Android studio打开dex
  • ¥20 为何R语言love图显示的分类变量点与smd值不一致
  • ¥15 asp.net实验:数据库写入不成功
  • ¥15 C#视频播放器的原码,有的发一
  • ¥15 用FDTD计算并提取光栅结构的正负一级衍射光的光功率
  • ¥30 AVL fire DVI中的Design Explorer里面的Run的Status为什么总是Terminated?哪里出问题了?需要修改哪里?