|
@@ -0,0 +1,101 @@
|
|
|
+<template>
|
|
|
+ <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
|
|
|
+ <h1 style="margin:20px auto; text-align: center"> 设备位置统计数据 </h1>
|
|
|
+ <a-card title="厂区统计">
|
|
|
+ <a-card-grid v-for="position in sbPositionData" v-if="position.type === 1" :key="position.id" style="cursor: pointer;width:25%;text-align:center" @click="selectCountByPosition(position)">
|
|
|
+ {{ position.name + '(数量:' + num + ')' }}
|
|
|
+ </a-card-grid>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <a-card title="车间统计">
|
|
|
+ <a-card-grid v-for="position in sbPositionData" v-if="position.type === 2" :key="position.id" style="cursor: pointer;width:25%;text-align:center" @click="selectCountByPositionGroupBySbType(position)">
|
|
|
+ {{ position.name + '(数量:' + lineNum + ')' }}
|
|
|
+ </a-card-grid>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <a-card title="类型统计">
|
|
|
+ <a-card-grid v-for="type in typeData" :key="type.id" style="cursor: pointer;width:25%;text-align:center" @click="jumpSbInfo(type)">
|
|
|
+ {{ type.typeName + '(数量:' + type.num + ')' }}
|
|
|
+ </a-card-grid>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <a-row :gutter="48">
|
|
|
+ <a-col :md="48" :sm="48">
|
|
|
+ <span class="table-page-search-submitButtons" style="float: right;margin-top: 10px">
|
|
|
+ <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
|
|
|
+ </span>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import { querySbPosition, selectCountByPosition, selectCountByPositionGroupBySbType } from '@/api/sb/position'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'SbPositionNum',
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ confirmLoading: false,
|
|
|
+ modalTitle: null,
|
|
|
+ configMap: {},
|
|
|
+ num: null,
|
|
|
+ lineNum: null,
|
|
|
+ sbPositionData: [],
|
|
|
+ typeData: [],
|
|
|
+ factoryStr: null,
|
|
|
+ form: this.$form.createForm(this),
|
|
|
+ visible: true,
|
|
|
+ user: this.$store.getters.userInfo
|
|
|
+ }
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ // 下拉框map
|
|
|
+ querySbPosition().then(res => {
|
|
|
+ this.sbPositionData = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ base (record) {
|
|
|
+ this.visible = true
|
|
|
+ // 如果是空标识添加
|
|
|
+ if (this.BaseTool.Object.isBlank(record)) {
|
|
|
+ this.modalTitle = '添加'
|
|
|
+ this.data = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCancel (values) {
|
|
|
+ this.visible = false
|
|
|
+ this.confirmLoading = false
|
|
|
+ this.form.resetFields()
|
|
|
+ if (this.BaseTool.Object.isNotBlank(values)) {
|
|
|
+ this.$emit('ok', values)
|
|
|
+ } else {
|
|
|
+ this.$emit('ok')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectCountByPosition (position) {
|
|
|
+ selectCountByPosition(position).then(res => {
|
|
|
+ this.num = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectCountByPositionGroupBySbType (position) {
|
|
|
+ selectCountByPosition(position).then(res => {
|
|
|
+ this.lineNum = res.data
|
|
|
+ })
|
|
|
+ selectCountByPositionGroupBySbType(position).then(res => {
|
|
|
+ this.typeData = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ jumpSbInfo (type) {
|
|
|
+ const routeUrl = this.$router.resolve({ path: '/sb/info/company', query: { typeId: type.typeId } })
|
|
|
+ window.open(routeUrl.href, '_blank')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|