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 * @Author: zwq
* @Date: 2024-01-17 09:58:41 * @Date: 2024-01-17 09:58:41
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-02-22 14:07:03 * @LastEditTime: 2024-09-23 14:05:14
* @Description: * @Description:
--> -->
<template> <template>
@ -12,18 +12,20 @@
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />
<div class="tips"> <div class="tips">
<el-tag <el-button
effect="dark" type="primary"
color="#16DC09" size="mini"
style="border: none"> style="margin-right: 50px"
@click="stackerBtn">
</el-tag> 巷道开关
</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="#d3d3d3" style="border: none"></el-tag>
<el-tag effect="dark" color="#7362F3" 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> <el-tag effect="dark" color="#ff0000" style="border: none">不可用</el-tag>
</div> </div>
<div class="mainbody"> <div class="mainbody">
<!-- @click="showDia()" --> <!-- @click="showDia()" -->
<div v-for="i in listQuery.total" :key="i"> <div v-for="i in listQuery.total" :key="i">
<el-row style="margin-bottom: 10px"> <el-row style="margin-bottom: 10px">
<el-col :span="24"> <el-col :span="24">
@ -65,10 +67,10 @@
j.deactivate === 0 || j.warehouseStorehouseState === 1 j.deactivate === 0 || j.warehouseStorehouseState === 1
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
background: background:
j.deactivate === 1 j.deactivate === 1
? bgColor[j.warehouseStorehouseState] ? bgColor[j.warehouseStorehouseState]
: '#ff0000', : '#ff0000',
}" /> }" />
</el-popover> </el-popover>
</div> </div>
@ -108,10 +110,10 @@
j.deactivate === 0 || j.warehouseStorehouseState === 1 j.deactivate === 0 || j.warehouseStorehouseState === 1
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
background: background:
j.deactivate === 1 j.deactivate === 1
? bgColor[j.warehouseStorehouseState] ? bgColor[j.warehouseStorehouseState]
: '#ff0000', : '#ff0000',
}" /> }" />
</el-popover> </el-popover>
</div> </div>
@ -155,10 +157,10 @@
j.deactivate === 0 || j.warehouseStorehouseState === 1 j.deactivate === 0 || j.warehouseStorehouseState === 1
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
background: background:
j.deactivate === 1 j.deactivate === 1
? bgColor[j.warehouseStorehouseState] ? bgColor[j.warehouseStorehouseState]
: '#ff0000', : '#ff0000',
}" /> }" />
</el-popover> </el-popover>
</div> </div>
@ -196,10 +198,10 @@
j.deactivate === 0 || j.warehouseStorehouseState === 1 j.deactivate === 0 || j.warehouseStorehouseState === 1
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
background: background:
j.deactivate === 1 j.deactivate === 1
? bgColor[j.warehouseStorehouseState] ? bgColor[j.warehouseStorehouseState]
: '#ff0000', : '#ff0000',
}" /> }" />
</el-popover> </el-popover>
</div> </div>
@ -213,6 +215,10 @@
ref="dialogRef" ref="dialogRef"
v-if="diaVisible" v-if="diaVisible"
@refreshDataList="getDataList"></pot-dialog> @refreshDataList="getDataList"></pot-dialog>
<stacker-dialog
ref="stackerRef"
v-if="stackerVisible"
:warehouse-id="listQuery.aId"></stacker-dialog>
</div> </div>
</template> </template>
@ -223,6 +229,7 @@ import {
exportWarehouseStorehouseExcel, exportWarehouseStorehouseExcel,
} from '@/api/asrs/warehouseStorehouse'; } from '@/api/asrs/warehouseStorehouse';
import potDialog from './potDialog'; import potDialog from './potDialog';
import stackerDialog from './stackerDialog';
export default { export default {
mixins: [basicPage], mixins: [basicPage],
@ -236,6 +243,7 @@ export default {
wareLayer: 1, wareLayer: 1,
}, },
diaVisible: false, diaVisible: false,
stackerVisible: false,
wareData: [], wareData: [],
bgColor: ['#d3d3d3', '#7362F3', '#16DC09'], // bgColor: ['#d3d3d3', '#7362F3', '#16DC09'], //
formConfig: [ formConfig: [
@ -271,6 +279,7 @@ export default {
}, },
components: { components: {
potDialog, potDialog,
stackerDialog,
}, },
created() {}, created() {},
methods: { methods: {
@ -302,6 +311,12 @@ export default {
this.$refs.dialogRef.init(); this.$refs.dialogRef.init();
}); });
}, },
stackerBtn() {
this.stackerVisible = true;
this.$nextTick(() => {
this.$refs.stackerRef.init();
});
},
}, },
}; };
</script> </script>
@ -357,7 +372,7 @@ export default {
width: 100%; width: 100%;
height: 30px; height: 30px;
&:hover { &:hover {
border: 1px #000000 dashed; border: 1px #000000 dashed;
transform: scale(1.3); transform: scale(1.3);
} }
} }

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>