This commit is contained in:
2022-03-18 16:36:37 +08:00
13 changed files with 386 additions and 91 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2020-12-29 15:41:11
* @LastEditors: zwq
* @LastEditTime: 2022-03-16 09:52:07
* @LastEditTime: 2022-03-17 14:50:20
* @Description:
-->
<template>
@@ -62,7 +62,7 @@ const tableProps = [
align: 'center'
},
{
prop: 'name',
prop: 'locationName',
label: i18n.t('module.basicData.cache.LocationName'),
align: 'center'
}

View File

@@ -2,7 +2,7 @@
* @Author: gtz
* @Date: 2022-03-03 09:16:10
* @LastEditors: gtz
* @LastEditTime: 2022-03-18 16:02:21
* @LastEditTime: 2022-03-18 16:33:59
* @Description: file content
* @FilePath: \mt-ck-wms-ui\src\views\basicData\Warehouse\components\processStorageLink.vue
-->
@@ -11,7 +11,9 @@
<el-card class="dashboard-main">
<el-row class="dashboard-title">
<div class="dashboard-header-line" />
<div class="dashboard-header-title">{{ $t('module.dashboard.title') }}</div>
<div class="dashboard-header-title">
{{ $t("module.dashboard.title") }}
</div>
</el-row>
<el-row class="dashboard-legend">
<div
@@ -38,15 +40,28 @@
<el-button type="primary" size="mini" @click="submitLinkList">{{
"btn.submit" | i18nFilter
}}</el-button>
<el-button type="warning" size="mini" @click="init()">{{ 'btn.reset' | i18nFilter }}</el-button>
<el-button type="success" size="mini" @click="goback()">{{ 'btn.back' | i18nFilter }}</el-button>
<el-button type="warning" size="mini" @click="init()">{{
"btn.reset" | i18nFilter
}}</el-button>
<el-button type="success" size="mini" @click="goback()">{{
"btn.back" | i18nFilter
}}</el-button>
</div>
<div class="dashboard-legend-search">
<el-select
v-model="current"
size="mini"
@change="handleChange"
><el-option v-for="item in totalPage" :key="'select' + item" :label="$t('module.dashboard.pageHeader') + item + $t('module.dashboard.pageFooter')" :value="item" />
><el-option
v-for="item in totalPage"
:key="'select' + item"
:label="
$t('module.dashboard.pageHeader') +
item +
$t('module.dashboard.pageFooter')
"
:value="item"
/>
</el-select>
</div>
</el-row>
@@ -98,9 +113,15 @@
].attribute === '3'
? '#A2A8B5'
: '',
border:
selectStorageList.some(StorageItem=>StorageItem.locationId===z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].id)
? '1px solid red' : ''
border: selectStorageList.some(
StorageItem =>
StorageItem.locationId ===
z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id
)
? '2px dashed red'
: ''
}"
@click="
setType(
@@ -110,13 +131,55 @@
)
"
>
<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
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
]
: ''
}"
/>
<div
v-if="
StorageList.some(
StorageItem =>
StorageItem.id ===
z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id
)"
class="dashboard-layout-item-horn"
/>
{{
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>
<div class="dashboard-layout-footer">
{{ $t(bottomIndex[index]) + '(' + ((current - 1) * 4 + item) + ')' }}
{{
$t(bottomIndex[index]) +
"(" +
((current - 1) * 4 + item) +
")"
}}
</div>
</el-col>
</el-row>
@@ -125,7 +188,9 @@
<el-row v-else class="dashboard-layout" :gutter="12">
<el-col
v-for="item in Math.ceil(
(shelfVoList[0].rowVoList[0].portVoList.length - (current - 1) * 80) / 20
(shelfVoList[0].rowVoList[0].portVoList.length -
(current - 1) * 80) /
20
)"
:key="'shelfbox' + item"
class="dashboard-layout-shelf-box"
@@ -177,9 +242,15 @@
].attribute === '3'
? '#A2A8B5'
: '',
border:
selectStorageList.some(StorageItem=>StorageItem.locationId===z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].id)
? '1px solid red' : ''
border: selectStorageList.some(
StorageItem =>
StorageItem.locationId ===
z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id
)
? '2px dashed red'
: ''
}"
@click="
setType(
@@ -189,8 +260,45 @@
)
"
>
<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
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
]
: ''
}"
/>
<div
v-if="
StorageList.some(
StorageItem =>
StorageItem.id ===
z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id
)"
class="dashboard-layout-item-horn"
/>
{{
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>
@@ -226,9 +334,15 @@
].attribute === '3'
? '#A2A8B5'
: '',
border:
selectStorageList.some(StorageItem=>StorageItem.locationId===z.portVoList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].id)
? '1px solid red' : ''
border: selectStorageList.some(
StorageItem =>
StorageItem.locationId ===
z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id
)
? '2px dashed red'
: ''
}"
@click="
setType(
@@ -238,13 +352,55 @@
)
"
>
<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
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
]
: ''
}"
/>
<div
v-if="
StorageList.some(
StorageItem =>
StorageItem.id ===
z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id
)"
class="dashboard-layout-item-horn"
/>
{{
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>
<div class="dashboard-layout-footer">
{{ $t(bottomIndex[index]) + '(' + ((current - 1) * 4 + item) + ')' }}
{{
$t(bottomIndex[index]) +
"(" +
((current - 1) * 4 + item) +
")"
}}
</div>
</el-col>
</el-row>
@@ -261,6 +417,7 @@
<script>
import { getPortList } from '@/api/dashboard'
import { locationByProcessList } from '@/api/basicData/Warehouse/StorageBoxInfo'
import { batchListAdd } from '@/api/basicData/Warehouse/StorageBoxInfo'
import testdata from './testdata'
import processStorageType from './processStorageType'
@@ -273,25 +430,53 @@ export default {
},
created() {
this.id = this.$route.query.id
this.totalPage = Math.ceil(this.shelfVoList[0].rowVoList[0].portVoList.length / 80)
this.totalPage = Math.ceil(
this.shelfVoList[0].rowVoList[0].portVoList.length / 80
)
this.init()
},
methods: {
init() {
getPortList().then(res => {
this.shelfVoList = res.data[0].shelfVoList
this.totalPage = Math.ceil(this.shelfVoList[0].rowVoList[0].portVoList.length / 80)
this.totalPage = Math.ceil(
this.shelfVoList[0].rowVoList[0].portVoList.length / 80
)
})
locationByProcessList({
current: 1,
size: 990,
workSequenId: this.id
}).then(response => {
if (response.data.records) {
this.StorageList = response.data.records
} else {
this.StorageList.splice(0, this.StorageList.length)
}
})
this.selectStorageList.splice(0, this.selectStorageList.length)
},
setType(item) {
if (item.attribute !== '3') {
if (this.selectStorageList.findIndex(StorageItem => StorageItem.locationId === item.id) + 1) {
this.selectStorageList.splice(this.selectStorageList.findIndex(StorageItem => StorageItem.locationId === item.id), 1)
if (
this.selectStorageList.findIndex(
StorageItem => StorageItem.locationId === item.id
) + 1
) {
this.selectStorageList.splice(
this.selectStorageList.findIndex(
StorageItem => StorageItem.locationId === item.id
),
1
)
} else {
const isExist = this.StorageList.some(
StorageItem =>
StorageItem.id === item.id
)
this.typeVisible = true
this.$nextTick(() => {
this.$refs.typeRef.init(item.id, item.name)
this.$refs.typeRef.init(item.id, item.name, item.attribute, isExist)
})
}
}
@@ -312,22 +497,34 @@ export default {
workSequenId: this.id,
processLocationStorageList: this.selectStorageList
}
this.$confirm(`${this.$t('module.basicData.visual.TipsStorageBefore')}[${tipArr.join(',')}]?`, this.$t('module.basicData.visual.Tips'), {
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
type: 'warning'
}).then(() => {
batchListAdd(obj).then(res => {
this.$message({
message: this.$t('module.basicData.visual.success'),
type: 'success',
duration: 1500,
onClose: () => {
this.init()
}
this.$confirm(
`${this.$t(
'module.basicData.visual.TipsStorageBefore'
)}[${tipArr.join(',')}]?`,
this.$t('module.basicData.visual.Tips'),
{
confirmButtonText: this.$t(
'module.basicData.visual.confirmButtonText'
),
cancelButtonText: this.$t(
'module.basicData.visual.cancelButtonText'
),
type: 'warning'
}
)
.then(() => {
batchListAdd(obj).then(res => {
this.$message({
message: this.$t('module.basicData.visual.success'),
type: 'success',
duration: 1500,
onClose: () => {
this.init()
}
})
})
})
}).catch(() => {})
.catch(() => {})
} else {
this.$message({
message: this.$t('module.basicData.visual.PleaseAddLocationFirst'),
@@ -427,6 +624,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
@@ -434,6 +632,16 @@ export default {
border-radius: 6px;
margin-right: 6px;
}
.dashboard-layout-item-horn {
position: absolute;
width: 0;
height: 0;
right: 0;
top: 0;
border-style: solid;
border-width: 14px 0px 0px 14px;
border-color: #0B58FF transparent transparent transparent;
}
}
}
}

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2020-12-29 16:37:56
* @LastEditors: zwq
* @LastEditTime: 2022-03-16 09:47:01
* @LastEditTime: 2022-03-18 09:39:09
* @Description:
-->
<template>
@@ -18,9 +18,9 @@
label-position="left"
>
<el-form-item :label="$t('module.basicData.Warehouse.SelectStorageType')" prop="portAttrId">
<el-radio v-model="dataForm.portAttrId" :label="1">Working Port</el-radio>
<el-radio v-model="dataForm.portAttrId" :label="2">Buffer Port</el-radio>
<el-radio v-model="dataForm.portAttrId" :label="3">Exception Port</el-radio>
<el-radio v-model="dataForm.portAttrId" label="1">Working Port</el-radio>
<el-radio v-model="dataForm.portAttrId" label="2">Buffer Port</el-radio>
<el-radio v-model="dataForm.portAttrId" label="3">Exception Port</el-radio>
</el-form-item>
<el-form-item :label="$t('module.basicData.storageBox.name')" prop="storageId">
<el-select v-model="dataForm.storageId" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.storageBox.name')])" clearable>
@@ -41,6 +41,7 @@
</template>
<script>
import { getPortDetail } from '@/api/dashboard'
import { storageBoxList } from '@/api/basicData/Cache/storageBox'
export default {
@@ -50,7 +51,7 @@ export default {
locationId: '',
locationName: '',
dataForm: {
portAttrId: 1,
portAttrId: '1',
storageId: ''
},
dataRule: {
@@ -65,7 +66,7 @@ export default {
}
},
methods: {
init(id, name) {
init(id, name, attribute, isExist) {
this.locationId = id
this.locationName = name
const listQuery = {
@@ -81,6 +82,16 @@ export default {
})
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (attribute) {
this.dataForm.portAttrId = attribute
} else {
this.dataForm.portAttrId = '1'
}
if (isExist) {
getPortDetail(id).then(res => {
if (res.code === 0) { this.dataForm.storageId = res.data.storageBoxId }
})
}
})
this.visible = true
},

View File

@@ -2,7 +2,7 @@
* @Author: gtz
* @Date: 2022-03-03 15:47:47
* @LastEditors: zwq
* @LastEditTime: 2022-03-16 09:43:36
* @LastEditTime: 2022-03-17 09:05:02
* @Description: file content
* @FilePath: \mt-ck-wms-ui\src\views\dashboard\testdata.js
*/
@@ -2603,6 +2603,7 @@ export default {
4: '#FFA08F'
},
selectStorageList: [],
StorageList: [],
typeVisible: false,
id: '',
bottomIndex: ['module.dashboard.first', 'module.dashboard.second'],