This commit is contained in:
朱文强 2024-09-26 14:12:01 +08:00
parent 732ca54eef
commit b6763f37aa
3 changed files with 164 additions and 25 deletions

28
src/api/asrs/stacker.js Normal file
View File

@ -0,0 +1,28 @@
/*
* @Author: zwq
* @Date: 2023-08-22 15:23:58
* @LastEditors: zwq
* @LastEditTime: 2024-09-23 14:03:46
* @Description:
*/
import request from '@/utils/request'
// 更新巷道
export function updateStacker(data) {
return request({
url: '/asrs/stacker/update',
method: 'put',
data: data,
timeout: 100000,
})
}
// 获得巷道分页
export function getStackerPage(query) {
return request({
url: '/asrs/stacker/page',
method: 'get',
params: query
})
}

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2024-01-17 09:58:41
* @LastEditors: zwq
* @LastEditTime: 2024-02-22 14:07:03
* @LastEditTime: 2024-09-23 14:05:14
* @Description:
-->
<template>
@ -12,12 +12,14 @@
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag
effect="dark"
color="#16DC09"
style="border: none">
</el-tag>
<el-button
type="primary"
size="mini"
style="margin-right: 50px"
@click="stackerBtn">
巷道开关
</el-button>
<el-tag effect="dark" color="#16DC09" style="border: none"></el-tag>
<el-tag effect="dark" color="#d3d3d3" style="border: none"></el-tag>
<el-tag effect="dark" color="#7362F3" style="border: none"></el-tag>
<el-tag effect="dark" color="#ff0000" style="border: none">不可用</el-tag>
@ -213,6 +215,10 @@
ref="dialogRef"
v-if="diaVisible"
@refreshDataList="getDataList"></pot-dialog>
<stacker-dialog
ref="stackerRef"
v-if="stackerVisible"
:warehouse-id="listQuery.aId"></stacker-dialog>
</div>
</template>
@ -223,6 +229,7 @@ import {
exportWarehouseStorehouseExcel,
} from '@/api/asrs/warehouseStorehouse';
import potDialog from './potDialog';
import stackerDialog from './stackerDialog';
export default {
mixins: [basicPage],
@ -236,6 +243,7 @@ export default {
wareLayer: 1,
},
diaVisible: false,
stackerVisible: false,
wareData: [],
bgColor: ['#d3d3d3', '#7362F3', '#16DC09'], //
formConfig: [
@ -271,6 +279,7 @@ export default {
},
components: {
potDialog,
stackerDialog,
},
created() {},
methods: {
@ -302,6 +311,12 @@ export default {
this.$refs.dialogRef.init();
});
},
stackerBtn() {
this.stackerVisible = true;
this.$nextTick(() => {
this.$refs.stackerRef.init();
});
},
},
};
</script>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2024-09-23 14:10:53
* @Description:
-->
<template>
<el-dialog
title="巷道信息"
:visible.sync="visible"
v-loading="loading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)">
<el-card shadow="hover" v-for="item in stackerList" :key="item.id">
<el-descriptions :column="1" size="mini" border>
<el-descriptions-item label="巷道名称">
{{ item.stackerName }}
</el-descriptions-item>
<el-descriptions-item label="巷道状态">
<el-tag size="mini" :type="item.stackerState === 1 ? '' : 'warning'">
{{ item.stackerState === 1 ? '开启中' : '已关闭' }}
</el-tag>
<el-switch
style="float: right"
@change="changeStatus(item)"
:active-value="1"
:inactive-value="0"
v-model="item.stackerState" />
</el-descriptions-item>
</el-descriptions>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
</span>
</el-dialog>
</template>
<script>
import { updateStacker, getStackerPage } from '@/api/asrs/stacker';
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
loading: false,
stackerList: [],
};
},
methods: {
init() {
this.visible = true;
this.$nextTick(() => {
const params = {
pageNo: 1,
pageSize: 100,
warehouseId: this.warehouseId,
};
getStackerPage(params).then((response) => {
this.stackerList = response.data.list.reverse();
});
});
},
changeStatus(val) {
const _this = this
let text = val.stackerState === 1 ? '启用' : '关闭';
this.$modal
.confirm('确认要"' + text + '""' + val.stackerName + '"巷道吗?')
.then(function () {
_this.loading = true;
const data = {
id: val.id,
stacker: val.stacker,
stackerState: val.stackerState,
};
return updateStacker(data);
})
.then(() => {
_this.loading = false;
this.$modal.msgSuccess(text + '成功');
})
.catch(function () {
val.stackerState = val.stackerState === 1 ? 0 : 1;
_this.loading = false;
});
},
},
};
</script>