Compare commits

..

No commits in common. "5e88f7afe668b260c2069f1cdc06808485413092" and "02c3d6d7ebd44b89853b113467e67a67dc6171ff" have entirely different histories.

2 changed files with 318 additions and 377 deletions

View File

@ -1,6 +1,6 @@
import axios from "axios"; import axios from "axios";
axios.defaults.baseURL = 'https://login.microsoftonline.com/caterpillar.onmicrosoft.com' axios.defaults.baseURL = 'https://login.microsoftonline.com/caterpillar.onmicrosoft.com'
axios.defaults.timeout = 50000; axios.defaults.timeout = 5000;
// axios.defaults.withCredentials = true // axios.defaults.withCredentials = true
const postToGetToken = (params) => { const postToGetToken = (params) => {

View File

@ -1,433 +1,374 @@
<template> <template>
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;"> <div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号" <el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
:suffix-icon="Search"/> :suffix-icon="Search" />
<el-select-v2 v-model="standTypeQuery" style="width: 158px; margin-right: 10px;" <el-select-v2 v-model="standTypeQuery" style="width: 158px; margin-right: 10px;"
placeholder="请选择站台类型" :options="standTypeOptions" @change="search()"></el-select-v2> placeholder="请选择站台类型" :options="standTypeOptions" @change="search()"></el-select-v2>
<el-select-v2 v-model="allowMwlQuery" style="width: 158px; margin-right: 10px;" <el-button type="primary" @click="search()">搜索</el-button>
placeholder="是否允许装载机" :options="yesOrNoOptions" @change="search()"></el-select-v2> <el-button type="warning" @click="reset()">重置</el-button>
<el-select-v2 v-model="allowMgQuery" style="width: 158px; margin-right: 10px;" </el-row>
placeholder="是否允许平地机" :options="yesOrNoOptions" @change="search()"></el-select-v2> </div>
<el-button type="primary" @click="search()">搜索</el-button> <br />
<el-button type="warning" @click="reset()">重置</el-button> <el-table :data="standList" stripe border v-loading="loading" class="table-class" highlight-current-row
</el-row>
</div>
<br/>
<el-table :data="standList" stripe border v-loading="loading" class="table-class" highlight-current-row
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }" max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }"> :cell-style="{ 'text-align': 'center' }">
<el-table-column width="65px" fixed="left"> <el-table-column width="65px" fixed="left">
<template v-slot="scope"> <template v-slot="scope">
<el-radio :label="scope.row.standId" v-model="standId">&nbsp;</el-radio> <el-radio :label="scope.row.standId" v-model="standId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="standId" label="id" fixed="left" min-width="120px" show-overflow-tooltip/> <el-table-column prop="standId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
<el-table-column prop="allowIn" label="允许入库" :formatter="yesOrNoFormat" min-width="120px" <el-table-column prop="allowIn" label="允许入库" min-width="120px" show-overflow-tooltip />
show-overflow-tooltip/> <el-table-column prop="allowOut" label="允许出库" min-width="120px" show-overflow-tooltip />
<el-table-column prop="allowOut" label="允许出库" :formatter="yesOrNoFormat" min-width="120px" <el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px"
show-overflow-tooltip/> show-overflow-tooltip />
<el-table-column prop="allowMwl" label="允许装载机" :formatter="yesOrNoFormat" min-width="120px" <el-table-column prop="standStatus" label="状态" :formatter="standStatusFormat" show-overflow-tooltip
show-overflow-tooltip/> min-width="120px" />
<el-table-column prop="allowMg" label="允许平地机" :formatter="yesOrNoFormat" min-width="120px" <el-table-column prop="equipmentId" label="设备号" min-width="120px" show-overflow-tooltip />
show-overflow-tooltip/> <el-table-column prop="areaId" label="区域" min-width="120px" />
<el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px" <el-table-column prop="standType" label="类型" :formatter="standTypeFormat" min-width="120px" />
show-overflow-tooltip/> <el-table-column prop="standIp" label="电脑ip地址" min-width="120px" />
<el-table-column prop="standStatus" label="状态" :formatter="standStatusFormat" show-overflow-tooltip <el-table-column prop="outerId" label="外部编号" min-width="120px" />
min-width="120px"/> <el-table-column prop="lastUseTime" label="上次使用时间" :formatter="timeFormat" min-width="120px"
<el-table-column prop="equipmentId" label="设备号" min-width="120px" show-overflow-tooltip/> show-overflow-tooltip />
<el-table-column prop="areaId" label="区域" min-width="120px"/> <el-table-column prop="pickGoods" label="拣选料号" show-overflow-tooltip min-width="120px" />
<el-table-column prop="standType" label="类型" :formatter="standTypeFormat" min-width="120px"/> <el-table-column prop="pickVehicle" label="拣选箱号" show-overflow-tooltip min-width="120px" />
<el-table-column prop="standIp" label="电脑ip地址" min-width="120px"/> <el-table-column prop="pickTip" label="提示" show-overflow-tooltip min-width="120px" />
<el-table-column prop="outerId" label="外部编号" min-width="120px"/> <el-table-column prop="pickVehicleCount" label="站台料箱数量" min-width="120px" />
<el-table-column prop="lastUseTime" label="上次使用时间" :formatter="timeFormat" min-width="120px" <el-table-column prop="allowNoPlan" label="非计划" :formatter="allowNoPlanFormat" show-overflow-tooltip
show-overflow-tooltip/> min-width="120px" />
<el-table-column prop="pickGoods" label="拣选料号" show-overflow-tooltip min-width="120px"/> <el-table-column fixed="right" label="操作" width="120px">
<el-table-column prop="pickVehicle" label="拣选箱号" show-overflow-tooltip min-width="120px"/> <template v-slot="scope">
<el-table-column prop="pickTip" label="提示" show-overflow-tooltip min-width="120px"/> <el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
<el-table-column prop="pickVehicleCount" label="站台料箱数量" min-width="120px"/> </template>
<el-table-column prop="allowNoPlan" label="非计划" :formatter="allowNoPlanFormat" show-overflow-tooltip </el-table-column>
min-width="120px"/> </el-table>
<el-table-column fixed="right" label="操作" width="120px"> <br />
<template v-slot="scope"> <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button> :small="false" :disabled="false" :background="false" :default-page-size="10"
</template> layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
</el-table-column> @current-change="search" />
</el-table> <el-dialog v-model="dialogVisible" title="编辑站台信息" width="40%" draggable :show-close="false">
<br/> <div
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]" style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
:small="false" :disabled="false" :background="false" :default-page-size="10" <el-form ref="standFormRef" :model="standFormEntity" :label-position="labelPosition"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search" label-width="100px" style="width: 95%;" :rules="rules" status-icon>
@current-change="search"/> <el-row :gutter="16">
<el-dialog v-model="dialogVisible" title="编辑站台信息" width="40%" draggable :show-close="false"> <el-col :span="12" :offset="0">
<div <el-form-item label="站台号" prop="standId">
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;"> <el-input v-model="standFormEntity.standId" disabled />
<el-form ref="standFormRef" :model="standFormEntity" :label-position="labelPosition" </el-form-item>
label-width="100px" style="width: 95%;" :rules="rules" status-icon> </el-col>
<el-row :gutter="16"> <el-col :span="12">
<el-col :span="12" :offset="0"> <el-form-item label="类型" prop="isLock">
<el-form-item label="站台号" prop="standId"> <el-select-v2 v-model="standFormEntity.standType" placeholder="请选择类型"
<el-input v-model="standFormEntity.standId" disabled/> :options="standTypeOptions" disabled></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="类型" prop="isLock"> <el-row :gutter="16">
<el-select-v2 v-model="standFormEntity.standType" placeholder="请选择类型" <el-col :span="12" :offset="0">
:options="standTypeOptions" disabled></el-select-v2> <el-form-item label="锁定" prop="isLock">
</el-form-item> <el-select-v2 v-model="standFormEntity.isLock" placeholder="请选择是否锁定"
</el-col> :options="isLockOptions"></el-select-v2>
</el-row> </el-form-item>
<el-row :gutter="16"> </el-col>
<el-col :span="12" :offset="0"> <el-col :span="12">
<el-form-item label="锁定" prop="isLock"> <el-form-item label="状态" prop="standStatus">
<el-select-v2 v-model="standFormEntity.isLock" placeholder="请选择是否锁定" <el-select-v2 v-model="standFormEntity.standStatus" placeholder="请选择站台状态"
:options="isLockOptions"></el-select-v2> :options="standStatusOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="状态" prop="standStatus"> <el-row :gutter="16">
<el-select-v2 v-model="standFormEntity.standStatus" placeholder="请选择站台状态" <el-col :span="12" :offset="0">
:options="standStatusOptions"></el-select-v2> <el-form-item label="上次使用时间" prop="lastUseTime">
</el-form-item> <el-input v-model="standFormEntity.lastUseTime" />
</el-col> </el-form-item>
</el-row> </el-col>
<el-row :gutter="16"> <el-col :span="12">
<el-col :span="12" :offset="0"> <el-form-item label="站台料箱数量" prop="pickVehicleCount">
<el-form-item label="允许装载机" prop="allowMwl"> <el-input-number v-model.number="standFormEntity.pickVehicleCount"
<el-select-v2 v-model="standFormEntity.allowMwl" placeholder="是否允许装载机" controls-position="right" :disabled="standFormEntity.standType != 2"
:options="yesOrNoOptions" :disabled="standFormEntity.standType != 2"></el-select-v2> clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="允许平地机" prop="allowMg"> <el-row :gutter="16">
<el-select-v2 v-model="standFormEntity.allowMg" placeholder="是否允许平地机" <el-col :span="12" :offset="0">
:options="yesOrNoOptions" :disabled="standFormEntity.standType != 2"></el-select-v2> <el-form-item label="非计划" prop="allowNoPlan">
</el-form-item> <el-select-v2 v-model="standFormEntity.allowNoPlan" placeholder="请选择是否允许非计划领料"
</el-col> :options="allowNoPlanOptions"
</el-row> :disabled="standFormEntity.standType != 2"></el-select-v2>
<el-row :gutter="16"> </el-form-item>
<el-col :span="12" :offset="0"> </el-col>
<el-form-item label="上次使用时间" prop="lastUseTime"> </el-row>
<el-input v-model="standFormEntity.lastUseTime"/> </el-form>
</el-form-item> </div>
</el-col> <template #footer>
<el-col :span="12">
<el-form-item label="站台料箱数量" prop="pickVehicleCount">
<el-input-number v-model.number="standFormEntity.pickVehicleCount"
controls-position="right" :disabled="standFormEntity.standType != 2"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="非计划" prop="allowNoPlan">
<el-select-v2 v-model="standFormEntity.allowNoPlan" placeholder="请选择是否允许非计划领料"
:options="allowNoPlanOptions"
:disabled="standFormEntity.standType != 2"></el-select-v2>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitInfo(standFormEntity)"> <el-button type="primary" @click="submitInfo(standFormEntity)">
确定 确定
</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import {getStandsByPage, updateStandInfo} from '@/api/stand.js' import { getStandsByPage, updateStandInfo } from '@/api/stand.js'
import {errorBox} from '@/utils/myMessageBox.js' import { errorBox } from '@/utils/myMessageBox.js'
import {ElMessage} from 'element-plus' import { ElMessage } from 'element-plus'
import {ref, reactive} from 'vue' import { ref, reactive } from 'vue'
import {dateFormatter, timeFormatter} from '@/utils/formatter.js' import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
import {Search} from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
<script> <script>
export default { export default {
name: 'standSettings', name: 'standSettings',
data() { data() {
return { return {
standList: [], standList: [],
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
standIdQuery: '', standIdQuery: '',
standTypeQuery: -99, standTypeQuery: -99,
allowMwlQuery: -99, loading: true,
allowMgQuery: -99, dialogVisible: false,
loading: true, standId: '',
dialogVisible: false, standFormEntity: reactive({}),
standId: '', standFormRef: ref(),
standFormEntity: reactive({}), labelPosition: 'top',
standFormRef: ref(), rules: reactive({}),
labelPosition: 'top', standTypeOptions: [
rules: reactive({}), {
standTypeOptions: [ value: -99,
{ label: '全部'
value: -99, },
label: '全部' {
}, value: 1,
{ label: '入库站台'
value: 1, },
label: '入库站台' {
}, value: 2,
{ label: '备料站台'
value: 2, },
label: '备料站台' {
}, value: 3,
{ label: '堆垛机'
value: 3, }
label: '堆垛机' ],
isLockOptions: [
{
value: 0,
label: '未锁定'
},
{
value: 1,
label: '已锁定'
},
],
standStatusOptions: [
{
value: 0,
label: '可用'
},
{
value: 1,
label: '不可用'
},
],
allowNoPlanOptions: [
{
value: 1,
label: '允许'
},
{
value: 0,
label: '不允许'
},
]
} }
], },
isLockOptions: [ mounted() {
{ this.search()
value: 0, },
label: '未锁定' methods: {
search() {
this.loading = true
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
standId: this.standIdQuery.trim(),
standType: this.standTypeQuery == -99 ? null : this.standTypeQuery,
userName: store.getters.getUserName
}
getStandsByPage(request).then(res => {
const tableResponse = res.data
if (tableResponse.code == 0) {
this.standList = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
errorBox(tableResponse.message)
}
}).catch(err => {
console.log(err)
errorBox('查询站台信息错误')
})
this.loading = false
}, },
{ dateFormat: (row, column, cellValue, index) => {
value: 1, return dateFormatter(cellValue)
label: '已锁定'
}, },
], timeFormat: (row, column, cellValue, index) => {
yesOrNoOptions: [ return timeFormatter(cellValue)
{
value: -99,
label: '全部'
}, },
{ standTypeFormat: (row, column, cellValue, index) => {
value: 0, switch (cellValue) {
label: '否' case 1:
return '入库站台'
case 2:
return '备料站台'
case 3:
return '堆垛机'
default:
return '未知'
}
}, },
{ isLockFormat: (row, column, cellValue, index) => {
value: 1, switch (cellValue) {
label: '是' case 0:
return '未锁定'
case 1:
return '已锁定'
default:
return '未知'
}
}, },
], standStatusFormat: (row, column, cellValue, index) => {
standStatusOptions: [ switch (cellValue) {
{ case 0:
value: 0, return '可用'
label: '可用' case 1:
return '不可用'
default:
return '未知'
}
}, },
{ allowNoPlanFormat: (row, column, cellValue, index) => {
value: 1, switch (cellValue) {
label: '不可用' case 0:
return '不允许'
case 1:
return '允许'
default:
return '无效'
}
}, },
], reset() {
allowNoPlanOptions: [ this.standIdQuery = ''
{ this.standTypeQuery = -99
value: 1, this.search()
label: '允许'
}, },
{ editCurrentRow(row) {
value: 0, this.standId = row.standId
label: '不允许' this.standFormEntity = {
standId: row.standId,
standType: row.standType,
isLock: row.isLock,
standStatus: row.standStatus,
lastUseTime: row.lastUseTime,
pickVehicleCount: row.pickVehicleCount,
allowNoPlan: row.allowNoPlan
}
this.dialogVisible = true
},
submitInfo(formData) {
if (formData.standType == 3) {
return errorBox('堆垛机不允许非计划。')
}
const params = {
standId: formData.standId,
standType: formData.standType,
isLock: formData.isLock,
standStatus: formData.standStatus,
lastUseTime: formData.lastUseTime,
pickVehicleCount: formData.pickVehicleCount,
allowNoPlan: formData.allowNoPlan,
userName: store.getters.getUserName
}
updateStandInfo(params).then(res => {
if (res.data.code == 0) {
this.dialogVisible = false
ElMessage.success('更新站台信息成功。')
this.search()
} else {
errorBox(res.data.message)
}
}).catch(err => {
console.log(err)
errorBox('更新站台信息失败。')
})
},
getCurrentRow(row) {
this.standId = row.standId
}, },
]
}
},
mounted() {
this.search()
},
methods: {
search() {
this.loading = true
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
standId: this.standIdQuery.trim(),
standType: this.standTypeQuery === -99 ? null : this.standTypeQuery,
allowMwl: this.allowMwlQuery === -99 ? null : this.allowMwlQuery,
allowMg: this.allowMgQuery === -99 ? null : this.allowMgQuery,
userName: store.getters.getUserName
}
getStandsByPage(request).then(res => {
const tableResponse = res.data
if (tableResponse.code == 0) {
this.standList = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
errorBox(tableResponse.message)
}
}).catch(err => {
console.log(err)
errorBox('查询站台信息错误')
})
this.loading = false
}, },
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
},
standTypeFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 1:
return '入库站台'
case 2:
return '备料站台'
case 3:
return '堆垛机'
default:
return '未知'
}
},
isLockFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '未锁定'
case 1:
return '已锁定'
default:
return '未知'
}
},
yesOrNoFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '否'
case 1:
return '是'
default:
return '未知'
}
},
standStatusFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '可用'
case 1:
return '不可用'
default:
return '未知'
}
},
allowNoPlanFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '不允许'
case 1:
return '允许'
default:
return '无效'
}
},
reset() {
this.standIdQuery = ''
this.standTypeQuery = -99
this.search()
},
editCurrentRow(row) {
this.standId = row.standId
this.standFormEntity = {
standId: row.standId,
standType: row.standType,
isLock: row.isLock,
standStatus: row.standStatus,
lastUseTime: row.lastUseTime,
pickVehicleCount: row.pickVehicleCount,
allowNoPlan: row.allowNoPlan,
allowMwl: row.allowMwl,
allowMg: row.allowMg,
}
this.dialogVisible = true
},
submitInfo(formData) {
if (formData.standType == 3 && formData.allowNoPlan == 1) {
return errorBox('堆垛机不允许非计划。')
}
if (formData.allowMwl == -99 || formData.allowMg == -99) {
return errorBox('必须确定是否允许装载机与是否允许平地机。')
}
const params = {
standId: formData.standId,
standType: formData.standType,
isLock: formData.isLock,
standStatus: formData.standStatus,
lastUseTime: formData.lastUseTime,
pickVehicleCount: formData.pickVehicleCount,
allowNoPlan: formData.allowNoPlan,
allowMwl: formData.allowMwl,
allowMg: formData.allowMg,
userName: store.getters.getUserName
}
updateStandInfo(params).then(res => {
if (res.data.code == 0) {
this.dialogVisible = false
ElMessage.success('更新站台信息成功。')
this.search()
} else {
errorBox(res.data.message)
}
}).catch(err => {
console.log(err)
errorBox('更新站台信息失败。')
})
},
getCurrentRow(row) {
this.standId = row.standId
},
},
} }
</script> </script>
<style scoped> <style scoped>
.el-pagination { .el-pagination {
padding-left: 5px; padding-left: 5px;
} }
.el-row .el-button { .el-row .el-button {
width: 72px; width: 72px;
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;
} }
.table-class { .table-class {
width: 100%; width: 100%;
} }
.el-row .el-form-item { .el-row .el-form-item {
width: 10% inherit; width: 10% inherit;
justify-content: center; justify-content: center;
} }
.el-row .el-form-item .el-select-v2 { .el-row .el-form-item .el-select-v2 {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-input-number { .el-row .el-form-item .el-input-number {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-button { .el-row .el-form-item .el-button {
margin: auto; margin: auto;
} }
.title-area { .title-area {
display: flex; display: flex;
/* min-height: 10%; */ /* min-height: 10%; */
max-height: max-content; max-height: max-content;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
flex-direction: column; flex-direction: column;
padding: 10px; padding: 10px;
} }
</style> </style>