cheeckTableChange
This commit is contained in:
parent
87e94c7b9f
commit
6b73a12840
|
@ -9,7 +9,7 @@
|
|||
<el-row>
|
||||
<el-col
|
||||
v-for="(item, $index) in formData"
|
||||
v-show="filterBlock(item.parent,item.display_expression,$index,item.field_key)"
|
||||
v-show="filterBlock(item.display_expression,$index,item.field_key)"
|
||||
:key="$index"
|
||||
:span="12"
|
||||
style="position: relative"
|
||||
|
@ -281,79 +281,71 @@
|
|||
}
|
||||
},
|
||||
methods:{
|
||||
filterBlock(parent,rule,index,field_key){
|
||||
filterBlock(rule,index,field_key){
|
||||
let that = this;
|
||||
if(parent!==''&&parent!==null&&parent!==undefined){
|
||||
if(rule!==''&&rule!==null&&rule!==undefined){
|
||||
let reg = /\{(.+?)\}/g;
|
||||
//let str = rule.replace(temp,'').replace('$','');//=='有'
|
||||
//let y = that.checkForm[key];
|
||||
if(rule.indexOf('||')>-1||rule.indexOf('&&')>-1){
|
||||
let tam = '', arr = [];
|
||||
if(rule.indexOf('||')>-1){
|
||||
arr = rule.split('||');
|
||||
}else{
|
||||
arr = rule.split('&&');
|
||||
}
|
||||
for (let i = 0;i<arr.length;i++){
|
||||
//获取判断依据
|
||||
let a = '';
|
||||
a = arr[i].replace(/`/g,'');
|
||||
a = '`'+ a+'`';
|
||||
let tem =a.match(reg)[0];
|
||||
let ky = tem.replace(/\{|\}/g, '');//qipao
|
||||
if(that.checkForm[ky]){
|
||||
//替换变量
|
||||
a = a.replace(ky, 'yyy');
|
||||
let yyy = "'"+that.checkForm[ky]+"'";
|
||||
if(eval(eval( a))){
|
||||
tam += 'true';
|
||||
}else{
|
||||
tam += 'false';
|
||||
}
|
||||
if(rule!==''&&rule!==null&&rule!==undefined){
|
||||
let reg = /\{(.+?)\}/g;
|
||||
if(rule.indexOf('||')>-1||rule.indexOf('&&')>-1){
|
||||
let tam = '', arr = [];
|
||||
if(rule.indexOf('||')>-1){
|
||||
arr = rule.split('||');
|
||||
}else{
|
||||
arr = rule.split('&&');
|
||||
}
|
||||
for (let i = 0;i<arr.length;i++){
|
||||
//获取判断依据
|
||||
let a = '';
|
||||
a = arr[i].replace(/`/g,'');
|
||||
a = '`'+ a+'`';
|
||||
let tem =a.match(reg)[0];
|
||||
let ky = tem.replace(/\{|\}/g, '');//qipao
|
||||
if(that.checkForm[ky]){
|
||||
//替换变量
|
||||
a = a.replace(ky, 'yyy');
|
||||
let yyy = "'"+that.checkForm[ky]+"'";
|
||||
if(eval(eval( a))){
|
||||
tam += 'true';
|
||||
}else{
|
||||
tam += 'false';
|
||||
}
|
||||
}
|
||||
let rea = true;
|
||||
if(rule.indexOf('||')>-1){
|
||||
if( tam.indexOf('true')>-1){
|
||||
rea = true;
|
||||
}else{
|
||||
rea = false;
|
||||
}
|
||||
}else{
|
||||
if( tam.indexOf('false')>-1){
|
||||
rea = false;
|
||||
}else{
|
||||
rea = true;
|
||||
}
|
||||
tam += 'false';
|
||||
}
|
||||
if(rea){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return rea;
|
||||
}else{
|
||||
let temp =rule.match(reg)[0];
|
||||
let key = temp.replace(/\{|\}/g, '');//qipao
|
||||
let a = rule.replace(key, 'yy');
|
||||
a = a.replace(key, 'yy');
|
||||
let yy = "'"+that.checkForm[key]+"'";
|
||||
if(eval(eval(a))){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return eval(eval(a));
|
||||
}
|
||||
let rea = true;
|
||||
if(rule.indexOf('||')>-1){
|
||||
if( tam.indexOf('true')>-1){
|
||||
rea = true;
|
||||
}else{
|
||||
rea = false;
|
||||
}
|
||||
}else{
|
||||
if( tam.indexOf('false')>-1){
|
||||
rea = false;
|
||||
}else{
|
||||
rea = true;
|
||||
}
|
||||
}
|
||||
if(rea){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return rea;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
return false;
|
||||
let temp =rule.match(reg)[0];
|
||||
let key = temp.replace(/\{|\}/g, '');//qipao
|
||||
let a = rule.replace(key, 'yy');
|
||||
a = a.replace(key, 'yy');
|
||||
let yy = "'"+that.checkForm[key]+"'";
|
||||
if(eval(eval(a))){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return eval(eval(a));
|
||||
}
|
||||
}else{
|
||||
that.formData[index].is_hidden = false;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<el-row>
|
||||
<el-col
|
||||
v-for="(item, $index) in formData"
|
||||
v-show="filterBlock(item.parent,item.display_expression,$index,item.field_key)"
|
||||
v-show="filterBlock(item.display_expression,$index,item.field_key)"
|
||||
:key="$index"
|
||||
:span="12"
|
||||
style="position: relative"
|
||||
|
@ -375,78 +375,73 @@
|
|||
}
|
||||
},
|
||||
methods:{
|
||||
filterBlock(parent,rule,index,field_key){
|
||||
filterBlock(rule,index,field_key){
|
||||
// debugger;
|
||||
let that = this;
|
||||
if(parent!==''&&parent!==null&&parent!==undefined){
|
||||
if(rule!==''&&rule!==null&&rule!==undefined){
|
||||
let reg = /\{(.+?)\}/g;
|
||||
if(rule.indexOf('||')>-1||rule.indexOf('&&')>-1){
|
||||
let tam = '', arr = [];
|
||||
if(rule.indexOf('||')>-1){
|
||||
arr = rule.split('||');
|
||||
}else{
|
||||
arr = rule.split('&&');
|
||||
}
|
||||
for (let i = 0;i<arr.length;i++){
|
||||
//获取判断依据
|
||||
let a = '';
|
||||
a = arr[i].replace(/`/g,'');
|
||||
a = '`'+ a+'`';
|
||||
let tem =a.match(reg)[0];
|
||||
let ky = tem.replace(/\{|\}/g, '');//qipao
|
||||
if(that.checkForm[ky]){
|
||||
//替换变量
|
||||
a = a.replace(ky, 'yyy');
|
||||
let yyy = "'"+that.checkForm[ky]+"'";
|
||||
if(eval(eval( a))){
|
||||
tam += 'true';
|
||||
}else{
|
||||
tam += 'false';
|
||||
}
|
||||
if(rule!==''&&rule!==null&&rule!==undefined){
|
||||
let reg = /\{(.+?)\}/g;
|
||||
debugger;
|
||||
if(rule.indexOf('||')>-1||rule.indexOf('&&')>-1){
|
||||
let tam = '', arr = [];
|
||||
if(rule.indexOf('||')>-1){
|
||||
arr = rule.split('||');
|
||||
}else{
|
||||
arr = rule.split('&&');
|
||||
}
|
||||
for (let i = 0;i<arr.length;i++){
|
||||
//获取判断依据
|
||||
let a = '';
|
||||
a = arr[i].replace(/`/g,'');
|
||||
a = '`'+ a+'`';
|
||||
let tem =a.match(reg)[0];
|
||||
let ky = tem.replace(/\{|\}/g, '');//qipao
|
||||
if(that.checkForm[ky]){
|
||||
//替换变量
|
||||
a = a.replace(ky, 'yyy');
|
||||
let yyy = "'"+that.checkForm[ky]+"'";
|
||||
if(eval(eval( a))){
|
||||
tam += 'true';
|
||||
}else{
|
||||
tam += 'false';
|
||||
}
|
||||
}
|
||||
let rea = true;
|
||||
if(rule.indexOf('||')>-1){
|
||||
if( tam.indexOf('true')>-1){
|
||||
rea = true;
|
||||
}else{
|
||||
rea = false;
|
||||
}
|
||||
}else{
|
||||
if( tam.indexOf('false')>-1){
|
||||
rea = false;
|
||||
}else{
|
||||
rea = true;
|
||||
}
|
||||
tam += 'false';
|
||||
}
|
||||
if(rea){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return rea;
|
||||
}else{
|
||||
let temp =rule.match(reg)[0];
|
||||
let key = temp.replace(/\{|\}/g, '');//qipao
|
||||
let a = rule.replace(key, 'yy');
|
||||
a = a.replace(key, 'yy');
|
||||
let yy = "'"+that.checkForm[key]+"'";
|
||||
if(eval(eval(a))){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return eval(eval(a));
|
||||
}
|
||||
let rea = true;
|
||||
if(rule.indexOf('||')>-1){
|
||||
if( tam.indexOf('true')>-1){
|
||||
rea = true;
|
||||
}else{
|
||||
rea = false;
|
||||
}
|
||||
}else{
|
||||
if( tam.indexOf('false')>-1){
|
||||
rea = false;
|
||||
}else{
|
||||
rea = true;
|
||||
}
|
||||
}
|
||||
if(rea){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return rea;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
return false;
|
||||
let temp =rule.match(reg)[0];
|
||||
let key = temp.replace(/\{|\}/g, '');//qipao
|
||||
let a = rule.replace(key, 'yy');
|
||||
a = a.replace(key, 'yy');
|
||||
let yy = "'"+that.checkForm[key]+"'";
|
||||
if(eval(eval(a))){
|
||||
that.formData[index].is_hidden = false;
|
||||
}else{
|
||||
that.formData[index].is_hidden = true;
|
||||
that.checkForm[field_key] = null;
|
||||
}
|
||||
return eval(eval(a));
|
||||
}
|
||||
}else{
|
||||
that.formData[index].is_hidden = false;
|
||||
|
|
|
@ -202,14 +202,6 @@
|
|||
xAxisData: ["供应商1", "供应商2", "供应商3", "供应商4", "供应商5", "供应商6", "供应商7"],
|
||||
seriesData:[2, 2, 4, 5,1, 0,1],
|
||||
},
|
||||
xAxisData1: ["气泡", "破点", "划伤", "其他"],
|
||||
xAxisbar21: ["物料1", "物料2", "物料3", "物料4", "物料5", "物料6", "物料7"],
|
||||
xAxisbar22: ["供应商1", "供应商2", "供应商3", "供应商4", "供应商5", "供应商6", "供应商7"],
|
||||
xAxisbar3: ["供应商1", "供应商2", "供应商3", "供应商4", "供应商5", "供应商6", "供应商7"],
|
||||
barData1: [30, 25, 35, 10],
|
||||
barData21: [800, 950, 960, 906, 600, 800, 900],
|
||||
barData22: [5, 20, 15, 25,10, 10,15],
|
||||
barData: [80, 95, 96, 96, 96, 98, 99],
|
||||
list: [
|
||||
{id: 1, name: 'HIehd91', card: '3331', sco: 'REF-31', num: 2, reason: "气泡"},
|
||||
{id: 2, name: 'HIehd92', card: '3332', sco: 'REF-32', num: 1, reason: "划痕"},
|
||||
|
|
|
@ -1008,25 +1008,23 @@
|
|||
handleInspection(scope, index) {
|
||||
//调该物料对应的检查表
|
||||
let that = this;
|
||||
this.innerIndex = index;
|
||||
that.innerIndex = index;
|
||||
// this.outerVisible = true;
|
||||
this.wproduct = scope.row.id;//半成品ID
|
||||
debugger;
|
||||
console.log(scope.row.material_check);
|
||||
this.listQueryrecordform.material = scope.row.material_check!==null ? scope.row.material_check :scope.row.material;//
|
||||
this.listQueryrecordform.type = 2;
|
||||
this.listQueryrecordform.enabled = true;
|
||||
this.recordform = null;
|
||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||
that.wproduct = scope.row.id;//半成品ID
|
||||
that.listQueryrecordform.material = scope.row.material;
|
||||
that.listQueryrecordform.type = 20;
|
||||
that.listQueryrecordform.enabled = true;
|
||||
that.recordform = null;
|
||||
getrecordformList(that.listQueryrecordform).then((response) => {
|
||||
if (response.data) {
|
||||
this.recordformList = response.data;
|
||||
that.recordformList = response.data;
|
||||
if (response.data.length === 1) {
|
||||
that.recordform = response.data[0].id;
|
||||
that.formName = response.data[0].name;
|
||||
that.submitrecordform(index);
|
||||
} else {
|
||||
//弹出列表选择框
|
||||
this.outerVisible = true;
|
||||
that.outerVisible = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1038,8 +1036,6 @@
|
|||
return item.id === that.recordform;
|
||||
});
|
||||
that.formName = arr[0].name;
|
||||
// this.outerVisible = false;
|
||||
// that.submitrecordform(that.innerIndex);
|
||||
},
|
||||
//检验记录
|
||||
checkRecord(scope, index) {
|
||||
|
|
Loading…
Reference in New Issue