|
@@ -371,13 +371,13 @@
|
|
|
<script>
|
|
|
import GraphicEchart from "../components/graphicHome.vue";
|
|
|
import SecurityCheckHeader from "../components/securityCheckHeader.vue";
|
|
|
-import { comprehensiveTable } from "@/api/statistics/statistics.js";
|
|
|
+import { comprehensive } from "@/api/statistics/statistics.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
dataall: {
|
|
|
name: "总件数",
|
|
|
- cont: "500",
|
|
|
+ cont: "",
|
|
|
data: [
|
|
|
{ value: 335, name: "1" },
|
|
|
{ value: 310, name: "2" },
|
|
@@ -423,22 +423,26 @@ export default {
|
|
|
GraphicEchart,
|
|
|
SecurityCheckHeader,
|
|
|
},
|
|
|
- created(){
|
|
|
- this.getData()
|
|
|
+ created() {
|
|
|
+ this.getData();
|
|
|
},
|
|
|
methods: {
|
|
|
change() {
|
|
|
this.$router.push("./cargoTable");
|
|
|
},
|
|
|
- async getData(){
|
|
|
- try{
|
|
|
- const result = await comprehensiveTable({
|
|
|
- });
|
|
|
-
|
|
|
- }catch(error){
|
|
|
- console.log(error)
|
|
|
+ async getData() {
|
|
|
+ try {
|
|
|
+ const result = await comprehensive({});
|
|
|
+ let count = 0;
|
|
|
+ //获取总件数:
|
|
|
+ result.data.forEach((item) => {
|
|
|
+ count += item.num;
|
|
|
+ });
|
|
|
+ this.dataall.cont=count;
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|