修改数据后,第一次不生效,第二次修改后,生效的是第一次数据。
原代码如下:
export function onChange({ value, extra }) {
var temp = {};//定义一个对象
var or = {}
for (var i in value) {
var key = value[i].textField_lub0ffqh;
var key1 = value[i].selectField_lv6240bp;
if ((temp[key]={}) && (key1 == "生油")) {
//审批表:
temp[key].textField_lvaks77e = value[i].selectField_lv6240bp;
temp[key].textField_lv5yletz = value[i].textField_lub0ffqg;
temp[key].textField_lv5yleu0 = value[i].textField_lub0ffqh;
temp[key].numberField_lv5yleu1 = Number(value[i].numberField_lub0ffqj);
temp[key].numberField_lv5yleu2 = Number(value[i].numberField_lub0ffqk);
temp[key].numberField_lv5yleu3 = Number(value[i].numberField_lub0ffql);
temp[key].numberField_lv5yleu4 = Number(value[i].numberField_lub0ffqm);
temp[key].numberField_lv5yleu5 = Number(value[i].numberField_lub0ffqn);
temp[key].numberField_lv5yleu6 = Number(value[i].numberField_lub0ffqo);
temp[key].textField_lv5yleu7 = value[i].textField_lub0ffqp;
//信息表:
temp[key].textField_lvaks77f = value[i].selectField_lv6240bp;
temp[key].textField_lv6367ra = value[i].textField_lub0ffqg;
temp[key].numberField_lv6367rb = Number(value[i].numberField_lub0ffqr);
temp[key].textField_lv6367rc = value[i].textField_lub0ffqs;
temp[key].textField_lv6367rd = value[i].textField_lub0ffqh;
temp[key].textField_lv6367re = value[i].textField_lub0ffqt;
temp[key].dateField_lv6367rf = value[i].dateField_lub0ffqv;
temp[key].numberField_lv6367rg = Number(value[i].numberField_lub0ffqj);
temp[key].textField_lv6367rh = value[i].textField_lub0ffqx;
temp[key].textField_lv6367ri = value[i].selectField_lub0ffr1;
temp[key].textField_lv6367rj = value[i].textField_lub0ffqy;
}
//审批表:
else if ((temp[key]={}) && (key1 == "主油")) {
temp[key].textField_lvaks77e = value[i].selectField_lv6240bp;
temp[key].textField_lv5yletz = value[i].textField_lub0ffqg;
temp[key].textField_lv5yleu0 = value[i].textField_lub0ffqh;
temp[key].numberField_lv5yleu1 = Number(value[i].numberField_lub0ffqj);
temp[key].numberField_lv5yleu2 = Number(value[i].numberField_lub0ffqk);
temp[key].numberField_lv5yleu3 = Number(value[i].numberField_lub0ffql);
temp[key].numberField_lv5yleu4 = Number(value[i].numberField_lub0ffqm);
temp[key].numberField_lv5yleu5 = Number(value[i].numberField_lub0ffqn);
temp[key].numberField_lv5yleu6 = Number(value[i].numberField_lub0ffqo);
temp[key].textField_lv5yleu7 = value[i].textField_lub0ffqp;
//信息表:
temp[key].textField_lvaks77f = value[i].selectField_lv6240bp;
temp[key].textField_lv6367ra = value[i].textField_lub0ffqg;
temp[key].numberField_lv6367rb = value[i].numberField_lub0ffqr;
temp[key].textField_lv6367rc = value[i].textField_lub0ffqs;
temp[key].textField_lv6367rd = value[i].textField_lub0ffqh;
temp[key].textField_lv6367re = value[i].textField_lub0ffqt;
temp[key].dateField_lv6367rf = value[i].dateField_lub0ffqv;
temp[key].numberField_lv6367rg = value[i].numberField_lub0ffqj;
temp[key].textField_lv6367rh = value[i].textField_lub0ffqx;
temp[key].textField_lv6367ri = value[i].selectField_lub0ffr1;
temp[key].textField_lv6367rj = value[i].textField_lub0ffqy;
}
else if ((temp[key] = {}) && (key1 == "负油")){
//信息表:
temp[key].textField_lvaks77f = value[i].selectField_lv6240bp;
temp[key].textField_lv6367ra = value[i].textField_lub0ffqg;
temp[key].numberField_lv6367rb = value[i].numberField_lub0ffqr;
temp[key].textField_lv6367rc = value[i].textField_lub0ffqs;
temp[key].textField_lv6367rd = value[i].textField_lub0ffqh;
temp[key].textField_lv6367re = value[i].textField_lub0ffqt;
temp[key].dateField_lv6367rf = value[i].dateField_lub0ffqv;
temp[key].numberField_lv6367rg = value[i].numberField_lub0ffqj;
temp[key].textField_lv6367rh = value[i].textField_lub0ffqx;
temp[key].textField_lv6367ri = value[i].selectField_lub0ffr1;
temp[key].textField_lv6367rj = value[i].textField_lub0ffqy;
}
else {
//信息表:
temp[key] = {};
}
}
//console.log("temp[key]", temp)
var newArry = [];
for (var k in temp) {
newArry.push(temp[k]);
}
//console.log(newArry);
this.$("tableField_lv5ylety").setValue(newArry)
this.$("tableField_lv6367r8").setValue(newArry)
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。