Commit 4081e0b3 authored by xiangjiaojunxp's avatar xiangjiaojunxp

物料转换页面修改,导入对比页面修改,批量对比修改

parent 24fa7fd9
......@@ -349,95 +349,100 @@ export default {
let cell=(c1<=c2)?c1:c2;
let array=[];
let r=this.row-1;
for(let i=r;i<row;i++) {
for (let j = 0; j <cell; j++) {
//第一个表的单元格为null直接跳出
if(d1[i][j]==null ){
continue
}
//第二个表的单元格为null直接跳出
if(d2[i][j]==null ){
continue
}
//第一个表内数据为0 且 第二个表只有样式内部为空
if(d2[i][j].v==0 && d1[i][j].v==undefined ){
continue
}
//第一个表内数据为0 且 第二个表只有样式内部为空
if( d1[i][j].v==0 && d2[i][j].v==undefined ){
continue
}
// 第一个表内数据为string型 且 第二个表只有样式内部为空
/*if((typeof(d1[i][j].v)=="string" && d2[i][j].v==undefined)){
continue
}*/
//第一个表为合并单元格 且第二个内没有值
if(d1[i][j].mc!=undefined &&d2[i][j].v==undefined){
continue
}
//第二个表为合并单元格 且第一个内没有值
if(d2[i][j].mc!=undefined &&d1[i][j].v==undefined){
continue
}
if((isNaN(d1[i][j].v) && d2[i][j].v==undefined)){
try{
for(let i=r;i<row;i++) {
for (let j = 0; j <cell; j++) {
//第一个表的单元格为null直接跳出
if(d1[i][j]==null ){
continue
}
//第二个表的单元格为null直接跳出
if(d2[i][j]==null ){
continue
}
//第一个表内数据为0 且 第二个表只有样式内部为空
if(d2[i][j].v==0 && d1[i][j].v==undefined ){
continue
}
//第一个表内数据为0 且 第二个表只有样式内部为空
if( d1[i][j].v==0 && d2[i][j].v==undefined ){
continue
}
// 第一个表内数据为string型 且 第二个表只有样式内部为空
/*if((typeof(d1[i][j].v)=="string" && d2[i][j].v==undefined)){
continue
}*/
//第一个表为合并单元格 且第二个内没有值
if(d1[i][j].mc!=undefined &&d2[i][j].v==undefined){
continue
}
//第二个表为合并单元格 且第一个内没有值
if(d2[i][j].mc!=undefined &&d1[i][j].v==undefined){
continue
}
if((isNaN(d1[i][j].v) && d2[i][j].v==undefined)){
}
// 第二个表内数据为string型 且 第一个表只有样式内部为空
if(isNaN(d2[i][j].v)&& d1[i][j].v==undefined){
}
// 第二个表内数据为string型 且 第一个表只有样式内部为空
if(isNaN(d2[i][j].v)&& d1[i][j].v==undefined){
}
// 没有选只比较数值 且 第一个表内数据为string型 且 第二个表内数据位string型
if(this.numm!=false &&(isNaN(d1[i][j].v)&&isNaN(d2[i][j].v))){
continue;
}
// 两个表的值都是0
if(d1[i][j].v==0 && d2[i][j].v==0 ){
continue
}
// 两个表都是只有样式没有数据
if(d1[i][j].v==undefined && d2[i][j].v==undefined ){
}
// 没有选只比较数值 且 第一个表内数据为string型 且 第二个表内数据位string型
if(this.numm!=false &&(isNaN(d1[i][j].v)&&isNaN(d2[i][j].v))){
continue;
}
// 两个表的值都是0
if(d1[i][j].v==0 && d2[i][j].v==0 ){
continue
}
// 两个表都是只有样式没有数据
if(d1[i][j].v==undefined && d2[i][j].v==undefined ){
}else if (d1[i][j].v==undefined || d2[i][j].v==undefined){
luckysheet.setCellValue(i, j, {bg: "#e85f5f"})
as++
let s = this.numToString(j+1);
array.push([i+1,s]);
//array.push([i+1,j+1]);
}else {
if (d1[i][j].v!= d2[i][j].v) {
}else if (d1[i][j].v==undefined || d2[i][j].v==undefined){
luckysheet.setCellValue(i, j, {bg: "#e85f5f"})
//查看是否有标签
/*luckysheet.setCellValue(i, j, {
ps: { //批注
"left": 92, //批注框左边距
"top": 10, //批注框上边距暖色
"width": 91, //批注框宽度
"height": 48, //批注框高度
"value": this.dep+"表有误", //批准内容
"isshow": false //批注框为显示状态
}
})*/
as++
let s = this.numToString(j+1);
array.push([i+1,s]);
//array.push([i+1,j+1]);
}else {
if (d1[i][j].v!= d2[i][j].v) {
luckysheet.setCellValue(i, j, {bg: "#e85f5f"})
//查看是否有标签
/*luckysheet.setCellValue(i, j, {
ps: { //批注
"left": 92, //批注框左边距
"top": 10, //批注框上边距暖色
"width": 91, //批注框宽度
"height": 48, //批注框高度
"value": this.dep+"表有误", //批准内容
"isshow": false //批注框为显示状态
}
})*/
as++
let s = this.numToString(j+1);
array.push([i+1,s]);
//array.push([i+1,j+1]);
}
}
}
}
}
map.set(name1,array);
if(as>0){
this.$message({
message: "导入完成,本次导入共发现"+as+"条不同数据",
type: "warning"});
}else{
map.set(name1,array);
if(as>0){
this.$message({
message: "导入完成,本次导入共发现"+as+"条不同数据",
type: "warning"});
}else{
this.$message({
message: "导入完成,本次导入未发现不同数据",
type: "success"});
}
}catch (err){
this.$message({
message: "导入完成,本次导入未发现不同数据",
type: "success"});
message: "导入失败,导入文件与对比文件有所不匹",
type: "error"});
}
})
},
/** 导出设置 */
......
......@@ -337,8 +337,6 @@ export default {
type: "error"});
}
}
)
},
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment