Compare commits
No commits in common. "e92d35ee52938f56ec1507ae095c7f98e8b95a31" and "4bd3007e0de35f077f5bf0ea036ac5159b729fda" have entirely different histories.
e92d35ee52
...
4bd3007e0d
|
|
@ -84,8 +84,6 @@
|
||||||
hideDo
|
hideDo
|
||||||
@row-click="rowClick"
|
@row-click="rowClick"
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
:summary-method="getSummaries"
|
|
||||||
show-summary
|
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="50" />
|
<el-table-column type="selection" width="50" />
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
|
@ -106,7 +104,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="发出数量" prop="count_send" v-if="mioObj.type == 'sale_out'&&project_code=='gx'">
|
<el-table-column label="发出数量" prop="count_send" v-if="mioObj.type == 'sale_out'&&project_code=='gx'">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="样品数量" v-if="mioObj.type == 'sale_out'&&project_code=='gx'">
|
<el-table-column label="样品数量" prop="count" v-if="mioObj.type == 'sale_out'&&project_code=='gx'">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ Number(scope.row.count) - Number(scope.row.count_send) }}
|
{{ Number(scope.row.count) - Number(scope.row.count_send) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -644,48 +642,6 @@ export default {
|
||||||
loading.close();
|
loading.close();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getSummaries({ columns, data }) {
|
|
||||||
const sums = [];
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = "合计";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let propert = '';
|
|
||||||
//尺寸检验
|
|
||||||
if(index == 6){
|
|
||||||
propert = 'count';
|
|
||||||
}else if(index == 7){
|
|
||||||
propert = 'count_send';
|
|
||||||
}
|
|
||||||
if (propert!=='') {
|
|
||||||
const values = data.map((item) =>
|
|
||||||
Number(item[propert])
|
|
||||||
);
|
|
||||||
if (!values.every((value) => Number.isNaN(value))) {
|
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
|
||||||
const value = Number(curr);
|
|
||||||
let sum = Number(Number(prev) + Number(curr));
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
return sum;
|
|
||||||
} else {
|
|
||||||
return prev;
|
|
||||||
}
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(index==8){
|
|
||||||
if(sums[6]){
|
|
||||||
if(sums[7]){
|
|
||||||
sums[index] = sums[6]-sums[7];
|
|
||||||
}else{
|
|
||||||
sums[index] = sums[6];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return sums;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue