fix:玻纤输出检验添加重新获取设备数据的按钮
This commit is contained in:
parent
37e6684a54
commit
a6c81fa9c6
|
@ -204,6 +204,14 @@
|
||||||
@click="formTableCancel(scope.row)"
|
@click="formTableCancel(scope.row)"
|
||||||
>取消</el-link
|
>取消</el-link
|
||||||
>
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
type="success"
|
||||||
|
size="small"
|
||||||
|
style="margin-left: 5px;"
|
||||||
|
@click="getEqData(scope.$index)"
|
||||||
|
>重取数据</el-link
|
||||||
|
>
|
||||||
<el-link
|
<el-link
|
||||||
v-if="!scope.row.isEdit&&(mode=='outs'||route_code=='niuzhuan')"
|
v-if="!scope.row.isEdit&&(mode=='outs'||route_code=='niuzhuan')"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -930,22 +938,38 @@ export default {
|
||||||
that.mlogbwlist.unshift(obj);
|
that.mlogbwlist.unshift(obj);
|
||||||
if(that.setForm.cd_req_addr!==null){
|
if(that.setForm.cd_req_addr!==null){
|
||||||
//执行cd_req_addr,获取检测设备的数据
|
//执行cd_req_addr,获取检测设备的数据
|
||||||
that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
|
that.getEqData(0);
|
||||||
//例:res:[{"ZValue": "-0.18", "machineId": "testMachine","XValue": "-127.5831","YValue": "-12.5523"}]
|
|
||||||
//遍历检测项,查看是否有cd_expr
|
|
||||||
that.qct_testitems.forEach(item0 => {
|
|
||||||
if(item0.testitem_cd_expr!=null){
|
|
||||||
that.mlogbwlist[0][item0.testitem_name]= eval(item0.testitem_cd_expr);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}).catch((err) => {
|
|
||||||
return err;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getEqData(index){
|
||||||
|
let that = this;
|
||||||
|
that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
|
||||||
|
that.qct_testitems.forEach(item0 => {
|
||||||
|
if(item0.testitem_cd_expr!=null){
|
||||||
|
that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
// let retryCount = 0;
|
||||||
|
// let MAX_RETRIES = 3;
|
||||||
|
// that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
|
||||||
|
// that.qct_testitems.forEach(item0 => {
|
||||||
|
// if(item0.testitem_cd_expr!=null){
|
||||||
|
// that.mlogbwlist[0][item0.testitem_name]= eval(item0.testitem_cd_expr);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }).catch((err) => {
|
||||||
|
// if (retryCount < MAX_RETRIES) {
|
||||||
|
// retryCount++;
|
||||||
|
// that.getEqData(); // 递归调用
|
||||||
|
// }
|
||||||
|
// return err;
|
||||||
|
// });
|
||||||
|
},
|
||||||
wprChange(wprNumber){
|
wprChange(wprNumber){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mlogbwlist.forEach(item => {
|
that.mlogbwlist.forEach(item => {
|
||||||
|
|
Loading…
Reference in New Issue