update
Этот коммит содержится в:
родитель
8502f5d7d1
Коммит
6d4594b338
27
src/api/dashboard.js
Обычный файл
27
src/api/dashboard.js
Обычный файл
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-16 16:08:06
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-16 16:45:41
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-ck-wms-ui\src\api\dashboard.js
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取菜单列表
|
||||
export function getPortList(data) {
|
||||
return request({
|
||||
url: '/api/wms/location/shelfList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取菜单详情
|
||||
export function getPortDetail(id) {
|
||||
return request({
|
||||
url: '/api/wms/storage/box/circ/info/getByLocationId',
|
||||
method: 'post',
|
||||
data: { id }
|
||||
})
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-15 16:42:34
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-15 16:58:26
|
||||
* @LastEditTime: 2022-03-16 19:08:39
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-ck-wms-ui\src\lang\i18n\en\module\dashboard.js
|
||||
*/
|
||||
@ -12,5 +12,13 @@ export default {
|
||||
second: 'Second Row',
|
||||
title: 'WMS Inventory Information',
|
||||
pageHeader: 'No.',
|
||||
pageFooter: ' Page'
|
||||
pageFooter: ' Page',
|
||||
currLocation: 'Current Location',
|
||||
isEmpty: 'Is Empty',
|
||||
status: 'Status',
|
||||
storageBoxCode: 'Cassette Code',
|
||||
empty: 'Empty',
|
||||
notEmpty: 'Not Empty',
|
||||
initialize: 'Initialize',
|
||||
finish: 'Finish'
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-15 16:42:34
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-15 16:58:30
|
||||
* @LastEditTime: 2022-03-16 19:08:19
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-ck-wms-ui\src\lang\i18n\zh\module\dashboard.js
|
||||
*/
|
||||
@ -12,5 +12,13 @@ export default {
|
||||
second: '第二排',
|
||||
title: 'WMS库存信息',
|
||||
pageHeader: '第',
|
||||
pageFooter: '页'
|
||||
pageFooter: '页',
|
||||
currLocation: '当前库位',
|
||||
isEmpty: '是否为空',
|
||||
status: '状态',
|
||||
storageBoxCode: '存储箱编码',
|
||||
empty: '空箱',
|
||||
notEmpty: '有货',
|
||||
initialize: '初始化',
|
||||
finish: '完成'
|
||||
}
|
||||
|
79
src/views/dashboard/components/PortDetail.vue
Обычный файл
79
src/views/dashboard/components/PortDetail.vue
Обычный файл
@ -0,0 +1,79 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-16 19:13:47
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="'btn.detail' | i18nFilter"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-form ref="dataForm" :model="dataForm" label-width="100px">
|
||||
<el-form-item :label="$t('module.dashboard.currLocation')" prop="currLocation">
|
||||
{{ dataForm.currLocation }}
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.dashboard.storageBoxCode')" prop="storageBoxCode">
|
||||
{{ dataForm.storageBoxCode }}
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.dashboard.isEmpty')" prop="isEmpty">
|
||||
{{ dataForm.isEmpty >= 0 ? emptyDict[dataForm.isEmpty] : '' }}
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.dashboard.status')" prop="status">
|
||||
{{ dataForm.status >= 0 ? statusDict[dataForm.status] : '' }}
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="drawer-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
code: null,
|
||||
createTime: null,
|
||||
currLocation: null,
|
||||
currLocationId: null,
|
||||
id: null,
|
||||
isEmpty: null,
|
||||
status: null,
|
||||
storageBoxCode: null,
|
||||
storageBoxId: null,
|
||||
updateTime: null
|
||||
},
|
||||
emptyDict: {
|
||||
0: this.$t('module.dashboard.empty'),
|
||||
1: this.$t('module.dashboard.notEmpty')
|
||||
},
|
||||
statusDict: {
|
||||
0: this.$t('module.dashboard.initialize'),
|
||||
1: this.$t('module.dashboard.finish')
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(data) {
|
||||
this.visible = true
|
||||
console.log(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
@ -2,7 +2,7 @@
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-03 09:16:10
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-15 16:47:57
|
||||
* @LastEditTime: 2022-03-16 19:12:35
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-ck-wms-ui\src\views\dashboard\index.vue
|
||||
-->
|
||||
@ -28,15 +28,15 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row v-if="current * 80 < shelfList[0].rowList[0].portList.length" class="dashboard-layout" :gutter="12">
|
||||
<el-row v-if="current * 80 < shelfVoList[0].rowVoList[0].portVoList.length" class="dashboard-layout" :gutter="12">
|
||||
<el-col v-for="item in 4" :key="'shelfbox' + item" class="dashboard-layout-shelf-box" :span="6">
|
||||
<el-row>
|
||||
<el-col v-for="(i, index) in shelfList" :key="item + 'shelf' + i.id" :span="12" class="dashboard-layout-shelf">
|
||||
<el-col v-for="(i, index) in shelfVoList" :key="item + 'shelf' + i.id" :span="12" class="dashboard-layout-shelf">
|
||||
<el-row>
|
||||
<el-col v-for="z in i.rowList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in 20" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}">
|
||||
<div v-if="z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0] ? cassetteStatusObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0].status] : ''}" />
|
||||
{{ z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
<el-col v-for="z in i.rowVoList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in 20" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}" @click="handlePort(z, x)">
|
||||
<div v-if="z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteVoList[0] ? cassetteStatusObj[z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteVoList[0].status] : ''}" />
|
||||
{{ z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -48,22 +48,22 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-else class="dashboard-layout" :gutter="12">
|
||||
<el-col v-for="item in Math.ceil((shelfList[0].rowList[0].portList.length - (current - 1) * 80) / 20)" :key="'shelfbox' + item" class="dashboard-layout-shelf-box" :span="6">
|
||||
<el-col v-for="item in Math.ceil((shelfVoList[0].rowVoList[0].portVoList.length - (current - 1) * 80) / 20)" :key="'shelfbox' + item" class="dashboard-layout-shelf-box" :span="6">
|
||||
<el-row>
|
||||
<el-col v-for="(i, index) in shelfList" :key="item + 'shelf' + i.id" :span="12" class="dashboard-layout-shelf">
|
||||
<el-row v-if="item < Math.ceil((shelfList[0].rowList[0].portList.length - (current - 1) * 80) / 20)">
|
||||
<el-col v-for="z in i.rowList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in 20" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}">
|
||||
<div v-if="z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0] ? cassetteStatusObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0].status] : ''}" />
|
||||
{{ z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
<el-col v-for="(i, index) in shelfVoList" :key="item + 'shelf' + i.id" :span="12" class="dashboard-layout-shelf">
|
||||
<el-row v-if="item < Math.ceil((shelfVoList[0].rowVoList[0].portVoList.length - (current - 1) * 80) / 20)">
|
||||
<el-col v-for="z in i.rowVoList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in 20" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}" @click="handlePort(z, x)">
|
||||
<div v-if="z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteVoList[0] ? cassetteStatusObj[z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteVoList[0].status] : ''}" />
|
||||
{{ z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-else>
|
||||
<el-col v-for="z in i.rowList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in shelfList[0].rowList[0].portList.length - (item - 1) * 20 - (current - 1) * 80" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}">
|
||||
<div v-if="z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0] ? cassetteStatusObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0].status] : ''}" />
|
||||
{{ z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
<el-col v-for="z in i.rowVoList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in shelfVoList[0].rowVoList[0].portVoList.length - (item - 1) * 20 - (current - 1) * 80" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}" @click="handlePort(z, x)">
|
||||
<div v-if="z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteVoList[0] ? cassetteStatusObj[z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteVoList[0].status] : ''}" />
|
||||
{{ z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -75,24 +75,51 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<port-detail ref="addOrUpdate" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import testdata from './testdata'
|
||||
import { getPortList, getPortDetail } from '@/api/dashboard'
|
||||
import portDetail from './components/PortDetail'
|
||||
|
||||
export default {
|
||||
name: 'Dashboard',
|
||||
components: { portDetail },
|
||||
data() {
|
||||
return testdata
|
||||
},
|
||||
created() {
|
||||
console.log(this.shelfList)
|
||||
this.totalPage = Math.ceil(this.shelfList[0].rowList[0].portList.length / 80)
|
||||
this.totalPage = Math.ceil(this.shelfVoList[0].rowVoList[0].portVoList.length / 80)
|
||||
getPortList().then(res => {
|
||||
console.log(res.data[0].shelfVoList)
|
||||
this.shelfVoList = res.data[0].shelfVoList.map(item => {
|
||||
item.rowVoList.map(i => {
|
||||
i.portVoList.map(z => {
|
||||
if (!(z.attribute)) {
|
||||
z.attribute = 0
|
||||
}
|
||||
return z
|
||||
})
|
||||
return i
|
||||
})
|
||||
return item
|
||||
})
|
||||
this.totalPage = Math.ceil(this.shelfVoList[0].rowVoList[0].portVoList.length / 80)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleChange(v) {
|
||||
console.log(v)
|
||||
},
|
||||
handlePort(z, x) {
|
||||
getPortDetail(z.portVoList[x].id).then(res => {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(res.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче
Block a user