代码更新:
1.完善打印标签界面 2.增加一些报表界面
This commit is contained in:
parent
0841251bdd
commit
872d5eafd7
|
|
@ -1,20 +1,5 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
|
||||||
const downloadExcel = () => {
|
|
||||||
return request.get('/test/testExcelExport', {
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const uploadExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/test/testExcelImport',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
timeout: 100000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const uploadExcelStock = (data) => {
|
const uploadExcelStock = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/excel/uploadStocks',
|
url: '/excel/uploadStocks',
|
||||||
|
|
@ -150,9 +135,16 @@ const downloadLocationsExcel = (params) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const queryUploadRecord = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/excel/queryUploadRecord',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
timeout: 100000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
downloadExcel,
|
|
||||||
uploadExcel,
|
|
||||||
uploadExcelStock,
|
uploadExcelStock,
|
||||||
uploadExcelGoods,
|
uploadExcelGoods,
|
||||||
uploadExcelDbs,
|
uploadExcelDbs,
|
||||||
|
|
@ -165,5 +157,6 @@ export {
|
||||||
downloadOutRecordExcel,
|
downloadOutRecordExcel,
|
||||||
downloadInventoryRecordExcel,
|
downloadInventoryRecordExcel,
|
||||||
downloadLocationsExcel,
|
downloadLocationsExcel,
|
||||||
uploadStationConfig
|
uploadStationConfig,
|
||||||
|
queryUploadRecord
|
||||||
}
|
}
|
||||||
58
src/api/kateWork.js
Normal file
58
src/api/kateWork.js
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
import request from "@/http/request";
|
||||||
|
|
||||||
|
const getDbs = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kateWork/getDbs',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteDbs = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kateWork/deleteDbs',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateDbs = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kateWork/updateDbs',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const getOrders = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kateWork/getOrders',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteOrders = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kateWork/deleteOrders',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateOrders = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kateWork/updateOrders',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
getDbs,
|
||||||
|
deleteDbs,
|
||||||
|
updateDbs,
|
||||||
|
getOrders,
|
||||||
|
deleteOrders,
|
||||||
|
updateOrders
|
||||||
|
}
|
||||||
359
src/layout/dbsTable.vue
Normal file
359
src/layout/dbsTable.vue
Normal file
|
|
@ -0,0 +1,359 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<div style="display: flex;justify-content: space-between;">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
|
@click="openUploadDialog()">导入</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<el-table :data="dbsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.dbsId" v-model="dbsId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dbsId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="workSequence" label="顺序号" fixed="left" min-width="120px" />
|
||||||
|
<el-table-column prop="machineNo" label="机器序列号" min-width="120px" />
|
||||||
|
<el-table-column prop="workOrder" label="工单" min-width="120px" />
|
||||||
|
<el-table-column prop="planStartDate" label="开工日期" :formatter="dateFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="dbsStatus" label="状态" min-width="120px" />
|
||||||
|
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowDbs(scope.row)">编辑</el-button>
|
||||||
|
<el-button plain type="danger" @click="deleteCurrentRowDbs(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
|
<div
|
||||||
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
|
<el-form ref="dbsFormRef" :model="dbsFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="id" prop="dbsId">
|
||||||
|
<el-input v-model="dbsFormEntity.dbsId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工单" prop="workOrder">
|
||||||
|
<el-input v-model="dbsFormEntity.workOrder" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="机器序列号" prop="machineNo">
|
||||||
|
<el-input v-model="dbsFormEntity.machineNo" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="顺序号" prop="workSequence">
|
||||||
|
<el-input-number v-model.number="dbsFormEntity.workSequence"
|
||||||
|
controls-position="right" :min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="开工日期" prop="planStartDate">
|
||||||
|
<el-input v-model="dbsFormEntity.planStartDate" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态" prop="dbsStatus">
|
||||||
|
<el-input-number v-model.number="dbsFormEntity.dbsStatus"
|
||||||
|
controls-position="right" :min="0" :max="2" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitDbsInfo(dbsFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="DBS" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>上次更新</legend>
|
||||||
|
<div style="padding: 5px;">
|
||||||
|
<div style="display: flex; margin-bottom: 10px;">
|
||||||
|
<div style="display: flex; width: 100%;">
|
||||||
|
<div style="width: 30%; align-content: center;">时间:</div>
|
||||||
|
<el-input v-model="uploadRecord.uploadTime" readonly />
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; width: 100%; margin-left: 5px;">
|
||||||
|
<div style="width: 30%; align-content: center;">人员:</div>
|
||||||
|
<el-input v-model="uploadRecord.uploadUser" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; width: 100%;">
|
||||||
|
<div style="width: 13%; align-content: center;">文件名:</div>
|
||||||
|
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
||||||
|
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>再次更新</legend>
|
||||||
|
<UploadExcelDbs></UploadExcelDbs>
|
||||||
|
</fieldset>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
|
import { getDbs, deleteDbs, updateDbs } from '@/api/kateWork.js'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
import UploadExcelDbs from '@/excel/UploadExcelDbs.vue'
|
||||||
|
import { queryUploadRecord } from '@/api/excel.js'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'dbs',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dbsList: [],
|
||||||
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
workOrderQuery: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
uploadDialogVisible: false,
|
||||||
|
dbsId: '',
|
||||||
|
dbsFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
dbsFormRef: ref(),
|
||||||
|
rules: reactive({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const request = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
workOrder: this.workOrderQuery.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getDbs(request).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.dbsList = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('查询DBS错误' + err.message)
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
|
return dateFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.workOrderQuery = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRowDbs(row) {
|
||||||
|
this.dbsId = row.dbsId
|
||||||
|
this.dbsFormEntity = {
|
||||||
|
dbsId: row.dbsId,
|
||||||
|
workSequence: row.workSequence,
|
||||||
|
machineNo: row.machineNo,
|
||||||
|
workOrder: row.workOrder,
|
||||||
|
planStartDate: timeFormatter(row.planStartDate),
|
||||||
|
dbsStatus: row.dbsStatus,
|
||||||
|
lastUpdateTime: row.lastUpdateTime,
|
||||||
|
lastUpdateUser: row.lastUpdateUser
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
deleteCurrentRowDbs(row) {
|
||||||
|
this.dbsId = row.dbsId
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'该操作会删除选择的DBS数据。\n是否继续',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
dbsId: this.dbsId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteDbs(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除DBS信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除DBS信息成功')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitDbsInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
dbsId: this.dbsId,
|
||||||
|
dbsStatus: formData.dbsStatus,
|
||||||
|
workSequence: formData.workSequence,
|
||||||
|
machineNo: formData.machineNo,
|
||||||
|
planStartDate: formData.planStartDate,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateDbs(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新DBS成功。',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新DBS失败。')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.dbsId = row.dbsId
|
||||||
|
},
|
||||||
|
openUploadDialog() {
|
||||||
|
// 请求上传记录
|
||||||
|
const param = {
|
||||||
|
userName: store.getters.getUserName,
|
||||||
|
fileDescription: 'DBS',
|
||||||
|
isAsc: false,
|
||||||
|
sortBy: 'upload_time'
|
||||||
|
}
|
||||||
|
queryUploadRecord(param).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
if (res.data.returnData.total > 0) {
|
||||||
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
|
} else {
|
||||||
|
this.uploadRecord = reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.uploadRecord = reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('发生异常')
|
||||||
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -227,21 +227,22 @@ export default {
|
||||||
queryFinishByStandAndGoods(request).then(res => {
|
queryFinishByStandAndGoods(request).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
if (response.returnData != null) {
|
if (response.returnData != null && response.returnData.tip != '') {
|
||||||
this.workFormEntity.tip = response.returnData.tip
|
this.workFormEntity.tip = response.returnData.tip
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: response.returnData.tip,
|
message: response.returnData.tip,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
this.resetForms()
|
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: response.returnData.tip,
|
message: response.message,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.resetForms()
|
||||||
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
306
src/layout/eLocationTable.vue
Normal file
306
src/layout/eLocationTable.vue
Normal file
|
|
@ -0,0 +1,306 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
|
||||||
|
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
|
||||||
|
</el-row>
|
||||||
|
<br />
|
||||||
|
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||||
|
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
||||||
|
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="lastInTime" label="最近入库时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
||||||
|
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
||||||
|
style="max-width: 100%" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
|
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="库位" prop="locationId">
|
||||||
|
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="空箱" prop="isEmpty">
|
||||||
|
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||||
|
:options="isEmptyOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态" prop="vehicleStatus">
|
||||||
|
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
||||||
|
:options="vehicleStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||||
|
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||||
|
import store from '@/store'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'vehicle',
|
||||||
|
props: ['selVehicle'],
|
||||||
|
emits: ['update:selVehicle'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
vehicles: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
queryKey: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
vehicleId: '',
|
||||||
|
vehicleFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
vehicleFormRef: ref(),
|
||||||
|
rules: reactive({
|
||||||
|
vehicleId: [
|
||||||
|
{ required: true, message: '请输入箱号' }
|
||||||
|
],
|
||||||
|
currentLocation: [
|
||||||
|
{ required: true, message: '请输入库位' }
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
// 物料高度
|
||||||
|
isEmptyOptions: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '带料'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '空托'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 托盘状态
|
||||||
|
vehicleStatusOptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '在库中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '在站台'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '移动中'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const tableRequest = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
vehicleId: this.queryKey.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getAllVehicles(tableRequest).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.vehicles = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('查询料箱信息错误' + err.message)
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||||
|
return vehicleStatusFormatter(cellValue)
|
||||||
|
},
|
||||||
|
locationFormat: (row, column, cellValue, index) => {
|
||||||
|
return locationFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
isEmptyFormat: (row, column, cellValue, index) => {
|
||||||
|
if (cellValue == 0) {
|
||||||
|
return '带料'
|
||||||
|
}
|
||||||
|
if (cellValue == 1) {
|
||||||
|
return '空箱'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.queryKey = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRowVehicle(row) {
|
||||||
|
this.vehicleFormEntity = {
|
||||||
|
vehicleId: row.vehicleId,
|
||||||
|
currentLocation: row.currentLocation,
|
||||||
|
isEmpty: row.isEmpty,
|
||||||
|
vehicleStatus: row.vehicleStatus,
|
||||||
|
lastInTime: row.lastInTime
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submitVehicleInfo(formData) {
|
||||||
|
const request = {
|
||||||
|
vehicleId: formData.vehicleId,
|
||||||
|
currentLocation: formData.currentLocation,
|
||||||
|
isEmpty: formData.isEmpty,
|
||||||
|
vehicleStatus: formData.vehicleStatus,
|
||||||
|
lastInTime: row.lastInTime,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateVehicleInfo(request).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新料箱信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新料箱信息失败:' + err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.vehicleId = row.vehicleId
|
||||||
|
this.$emit('update:selVehicle', row)
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
const request = {
|
||||||
|
vehicleId: formData.vehicleId,
|
||||||
|
currentLocation: formData.currentLocation,
|
||||||
|
isEmpty: formData.isEmpty,
|
||||||
|
vehicleStatus: formData.vehicleStatus,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
downloadVehicleExcel(request).then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage({
|
||||||
|
message: '下载文件失败:: ' + e,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage({
|
||||||
|
message: '导出失败:: ' + err,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
/* font-size: 5px; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin: 10px;">
|
<div style="margin: 10px;">
|
||||||
<div class="arrow" v-print="'#printArea'">
|
<div class="arrow" @click="requestPrint()" v-print="'#printArea'">
|
||||||
<Printer style="display: none;" />
|
<Printer style="display: none;" />
|
||||||
<span
|
<span
|
||||||
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">打印标签</span>
|
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">打印标签</span>
|
||||||
|
|
@ -112,11 +112,11 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div style="width: 0;height: 0;overflow: hidden">
|
<div style="width: 0;height: 0;overflow: hidden">
|
||||||
<div id="printArea" class="objectDialogFlowPrint">
|
<div id="printArea" class="objectDialogFlowPrint">
|
||||||
<div class="myPrint">
|
<!-- <div class="myPrint"> -->
|
||||||
<div class="pageWarp" v-for="item in printTabs">
|
<div class="pageWarp" v-for="item in printTabs">
|
||||||
<div class="print-tab-left">
|
<div class="print-tab-left">
|
||||||
<div class="print-disp">
|
<div class="print-disp">
|
||||||
序号:{{ item.sequenceNo }}</div>
|
小盒子号:{{ item.sequenceNo }}</div>
|
||||||
<div class="print-disp"> 小工位:{{ item.smallWorkCenter }}</div>
|
<div class="print-disp"> 小工位:{{ item.smallWorkCenter }}</div>
|
||||||
<div class="print-disp"> 料号数量:{{ item.goodsCount }}</div>
|
<div class="print-disp"> 料号数量:{{ item.goodsCount }}</div>
|
||||||
<div class="print-disp"> 配料人员:{{ item.opUser }}</div>
|
<div class="print-disp"> 配料人员:{{ item.opUser }}</div>
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
<div class="print-disp"> 配料日期:{{ item.opTime }}</div>
|
<div class="print-disp"> 配料日期:{{ item.opTime }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -166,18 +166,7 @@ export default {
|
||||||
{ required: true, message: '请输入料号' }
|
{ required: true, message: '请输入料号' }
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
printTabs: [
|
printTabs: []
|
||||||
// {
|
|
||||||
// sequenceNo: 1,
|
|
||||||
// machineNo: 'WF800471',
|
|
||||||
// smallWorkCenter: 'abd1111',
|
|
||||||
// workOrder: '115000262768',
|
|
||||||
// goodsCount: 30,
|
|
||||||
// goodsNumCount: 132,
|
|
||||||
// opUser: 'test',
|
|
||||||
// opTime: '2024/8/11'
|
|
||||||
// }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -252,7 +241,7 @@ export default {
|
||||||
ElMessage.error('确认时发生异常')
|
ElMessage.error('确认时发生异常')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
printTabs() {
|
requestPrint() {
|
||||||
// 获取打印标签的数据
|
// 获取打印标签的数据
|
||||||
const printParams = {
|
const printParams = {
|
||||||
standId: this.standId,
|
standId: this.standId,
|
||||||
|
|
@ -436,41 +425,45 @@ export default {
|
||||||
|
|
||||||
body,
|
body,
|
||||||
html {
|
html {
|
||||||
height: auto !important;
|
width: 90mm !important;
|
||||||
|
height: 25mm !important;
|
||||||
}
|
}
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
.objectDialogFlowPrint {
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.objectDialogFlowPrint .pageWarp {
|
.objectDialogFlowPrint .pageWarp {
|
||||||
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
||||||
page-break-after: always;
|
page-break-after: always;
|
||||||
height: 100%;
|
|
||||||
width: 98%;
|
width: 98%;
|
||||||
|
height: 98%;
|
||||||
|
/* margin: 5px; */
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 5px auto;
|
padding: 0;
|
||||||
padding: auto;
|
/* border: #000 solid 1px; */
|
||||||
border: #000 solid 1px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
|
||||||
|
|
||||||
.objectDialogFlowPrint .myPrint {
|
|
||||||
/* 打印的时候是否显示底色 */
|
|
||||||
print-color-adjust: exact;
|
print-color-adjust: exact;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-tab-left {
|
.print-tab-left {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
width: 45%;
|
width: 50%;
|
||||||
border-right: #156082 dashed 1px;
|
border-right: #156082 dashed 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-tab-right {
|
.print-tab-right {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
width: 55%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-disp {
|
.print-disp {
|
||||||
margin: 5px;
|
margin: 2px;
|
||||||
padding-left: 20px;
|
padding-left: 5px;
|
||||||
font-size: 25px;
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,45 +1,45 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<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;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<UploadExcelGoods></UploadExcelGoods>
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
</el-row>
|
:suffix-icon="Search" />
|
||||||
<el-row>
|
|
||||||
<UploadExcelStationConfig></UploadExcelStationConfig>
|
|
||||||
</el-row>
|
|
||||||
<el-row style="margin-top: 10px;">
|
|
||||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
|
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
<el-button type="success" @click="exportExcel()">导出信息</el-button>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
|
@click="uploadDialogVisible = true">导入</el-button>
|
||||||
|
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" max-height="650px"
|
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
highlight-current-row @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.goodsId" v-model="goodsId"> </el-radio>
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="material" label="零件号" fixed="left" sortable min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="itemDesc" label="描述" fixed="left" min-width="120px" />
|
<el-table-column prop="goodsName" label="描述" min-width="120px" />
|
||||||
<el-table-column prop="category" label="零件类型" fixed="left" sortable min-width="120px" />
|
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
||||||
<el-table-column prop="categoryRemark" label="策略" min-width="120px" />
|
<el-table-column prop="goodsType" label="物料分类" min-width="120px" />
|
||||||
<el-table-column prop="unloadPlace" label="卸货点" min-width="120px" />
|
<el-table-column prop="providerType" label="供应商分类" min-width="120px" />
|
||||||
<el-table-column prop="kittingPoint" label="配料点" min-width="120px" />
|
<el-table-column prop="weight" label="重量" min-width="120px" />
|
||||||
<el-table-column prop="property" label="可用性" min-width="120px" />
|
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" />
|
||||||
<el-table-column prop="vendorId" label="供应商代码" min-width="120px" />
|
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" />
|
||||||
<el-table-column prop="dataOwner" label="数据负责人" min-width="120px" />
|
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" />
|
||||||
<el-table-column prop="partWeight" label="重量" min-width="120px" />
|
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" />
|
||||||
<el-table-column prop="storageLocation" label="库位" min-width="120px" />
|
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" />
|
||||||
<el-table-column prop="storageType" label="存储类型" min-width="120px" />
|
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" />
|
||||||
<el-table-column prop="storageBin" label="BIN位" min-width="120px" />
|
<el-table-column prop="feedingType" label="补料方式" min-width="120px" />
|
||||||
<el-table-column prop="vendorNameEN" label="供应商名称(英文)" min-width="120px" />
|
<el-table-column prop="feedingValue" label="补货点" min-width="120px" />
|
||||||
<el-table-column prop="vendorNameCN" label="供应商名称(中文)" min-width="120px" />
|
<el-table-column prop="dataSource" label="数据来源" min-width="120px" />
|
||||||
<el-table-column prop="vendorCountry" label="供应商国家/地区" min-width="120px" />
|
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
|
||||||
<el-table-column prop="SLED" label="SLED" min-width="120px" />
|
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
||||||
<el-table-column prop="updateDate" label="更新日期" min-width="120px" />
|
|
||||||
<el-table-column fixed="right" label="操作" width="240px">
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||||
|
|
@ -53,118 +53,106 @@
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition" label-width="100px"
|
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
style="max-width: 100%" :rules="rules" status-icon>
|
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="零件号" prop="material">
|
<el-form-item label="料号" prop="goodsId">
|
||||||
<el-input v-model="goodsFormEntity.material" disabled />
|
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="描述" prop="itemDesc">
|
<el-form-item label="描述" prop="goodsName">
|
||||||
<el-input v-model="goodsFormEntity.itemDesc" clearable />
|
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="零件类型" prop="category">
|
<el-form-item label="单位" prop="goodsUnit">
|
||||||
<el-input v-model="goodsFormEntity.category" clearable />
|
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="策略" prop="categoryRemark">
|
<el-form-item label="物料分类" prop="goodsType">
|
||||||
<el-input v-model="goodsFormEntity.categoryRemark" clearable />
|
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="卸货点" prop="unloadPlace">
|
<el-form-item label="供应商分类" prop="providerType">
|
||||||
<el-input v-model="goodsFormEntity.unloadPlace" clearable />
|
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="配料点" prop="kittingPoint">
|
<el-form-item label="重量" prop="weight">
|
||||||
<el-input v-model="goodsFormEntity.kittingPoint" clearable />
|
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
||||||
|
:precision="3" :step="0.1"
|
||||||
|
:min="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="可用性" prop="property">
|
<el-form-item label="重量单位" prop="weightUnit">
|
||||||
<el-input v-model="goodsFormEntity.property" clearable />
|
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="供应商代码" prop="vendorId">
|
<el-form-item label="每盒数量" prop="quantityPerBox">
|
||||||
<el-input v-model="goodsFormEntity.vendorId" clearable />
|
<el-input-number v-model.number="goodsFormEntity.quantityPerBox" controls-position="right"
|
||||||
|
:min="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="数据负责人" prop="dataOwner">
|
<el-form-item label="拆包方式" prop="unpackingType">
|
||||||
<el-input v-model="goodsFormEntity.dataOwner" clearable />
|
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="重量" prop="partWeight">
|
<el-form-item label="料箱类型" prop="vehicleType">
|
||||||
<el-input v-model="goodsFormEntity.partWeight" clearable />
|
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="库位" prop="storageLocation">
|
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription">
|
||||||
<el-input v-model="goodsFormEntity.storageLocation" clearable />
|
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="存储类型" prop="storageType">
|
<el-form-item label="料箱类型2" prop="goodsInVehicleType">
|
||||||
<el-input v-model="goodsFormEntity.storageType" clearable />
|
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="BIN位" prop="storageBin">
|
<el-form-item label="补料方式" prop="feedingType">
|
||||||
<el-input v-model="goodsFormEntity.storageBin" clearable />
|
<el-input v-model="goodsFormEntity.feedingType" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="供应商名称(英文)" prop="vendorNameEN">
|
<el-form-item label="补货点" prop="feedingValue">
|
||||||
<el-input v-model="goodsFormEntity.vendorNameEN" clearable />
|
<el-input-number v-model.number="goodsFormEntity.feedingValue" controls-position="right"
|
||||||
|
:min="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="供应商名称(中文)" prop="vendorNameCN">
|
<el-form-item label="数据来源" prop="dataSource">
|
||||||
<el-input v-model="goodsFormEntity.vendorNameCN" clearable />
|
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="供应商国家/地区" prop="vendorCountry">
|
|
||||||
<el-input v-model="goodsFormEntity.vendorCountry" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="SLED" prop="SLED">
|
|
||||||
<el-input-number v-model.number="goodsFormEntity.SLED" clearable controls-position="right"
|
|
||||||
:min="0" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="更新日期" prop="updateDate">
|
|
||||||
<el-input v-model="goodsFormEntity.updateDate" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
|
@ -174,6 +162,16 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>导入物料</legend>
|
||||||
|
<UploadExcelGoods></UploadExcelGoods>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>导入工站配置</legend>
|
||||||
|
<UploadExcelStationConfig></UploadExcelStationConfig>
|
||||||
|
</fieldset>
|
||||||
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -182,12 +180,13 @@
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getGoodsInfoByPage } from '@/api/goods.js'
|
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { dateFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||||
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
||||||
import { downloadMaterialExcel } from '@/api/excel.js'
|
import { downloadMaterialExcel } from '@/api/excel.js'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -202,7 +201,8 @@ export default {
|
||||||
goodsIdQuery: '',
|
goodsIdQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
material: '',
|
uploadDialogVisible: false,
|
||||||
|
goodsId: '',
|
||||||
goodsFormEntity: reactive({}),
|
goodsFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
goodsFormRef: ref(),
|
goodsFormRef: ref(),
|
||||||
|
|
@ -237,26 +237,53 @@ export default {
|
||||||
dateFormat: (row, column, cellValue, index) => {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
return dateFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.goodsIdQuery = ''
|
this.goodsIdQuery = ''
|
||||||
this.search
|
this.search()
|
||||||
},
|
},
|
||||||
// getCurrentPageGoods() {
|
|
||||||
// this.currentGoods = this.displayGoods.slice((this.currentPage - 1) * this.pageSize, this.currentPage * this.pageSize)
|
|
||||||
// },
|
|
||||||
editCurrentRowGoods(row) {
|
editCurrentRowGoods(row) {
|
||||||
this.goodsFormEntity = row
|
this.goodsId = row.goodsId
|
||||||
|
this.goodsFormEntity = {
|
||||||
|
goodsId: row.goodsId,
|
||||||
|
goodsName: row.goodsName,
|
||||||
|
goodsUnit: row.goodsUnit,
|
||||||
|
goodsType: row.goodsType,
|
||||||
|
providerType: row.providerType,
|
||||||
|
weight: row.weight,
|
||||||
|
weightUnit: row.weightUnit,
|
||||||
|
quantityPerBox: row.quantityPerBox,
|
||||||
|
unpackingType: row.unpackingType,
|
||||||
|
vehicleType: row.vehicleType,
|
||||||
|
vehicleTypeDescription: row.vehicleTypeDescription,
|
||||||
|
goodsInVehicleType: row.goodsInVehicleType,
|
||||||
|
feedingType: row.feedingType,
|
||||||
|
feedingValue: row.feedingValue,
|
||||||
|
dataSource: row.dataSource,
|
||||||
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
deleteCurrentRowGoods(row) {
|
deleteCurrentRowGoods(row) {
|
||||||
this.material = row.material
|
this.goodsId = row.goodsId
|
||||||
const goods = {
|
ElMessageBox.confirm(
|
||||||
material: row.material
|
'该操作会删除选择的物料数据。\n是否继续',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
}
|
}
|
||||||
deleteCurrentPartInfo(goods).then(res => {
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
goodsId: this.goodsId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteAllKateTasks(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '删除零件信息成功',
|
message: '删除物料信息成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -264,7 +291,14 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('删除零件信息失败:' + err)
|
console.log(err)
|
||||||
|
ElMessage.error('删除物料信息失败')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitGoodsInfo(formData) {
|
submitGoodsInfo(formData) {
|
||||||
|
|
@ -362,4 +396,18 @@ export default {
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
395
src/layout/kateOrdersTable.vue
Normal file
395
src/layout/kateOrdersTable.vue
Normal file
|
|
@ -0,0 +1,395 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<div style="display: flex;justify-content: space-between;">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
|
@click="openUploadDialog()">导入</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
|
<el-table-column prop="description" label="描述" min-width="120px" />
|
||||||
|
<el-table-column prop="sLoc" label="SLoc" min-width="120px" />
|
||||||
|
<el-table-column prop="type" label="Type" min-width="120px" />
|
||||||
|
<el-table-column prop="originStatus" label="Status" min-width="120px" />
|
||||||
|
<el-table-column prop="sortString" label="SortStrng" min-width="120px" />
|
||||||
|
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" />
|
||||||
|
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
||||||
|
<el-table-column prop="orderStatus" label="状态" min-width="120px" />
|
||||||
|
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" />
|
||||||
|
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" />
|
||||||
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
||||||
|
<el-button plain type="danger" @click="deleteCurrentRowOrders(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
|
<div
|
||||||
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
|
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="id" prop="orderId">
|
||||||
|
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工单" prop="workOrder">
|
||||||
|
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="小工位" prop="supplyArea">
|
||||||
|
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料号" prop="goodsId">
|
||||||
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||||
|
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||||
|
controls-position="right" :min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态" prop="orderStatus">
|
||||||
|
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||||
|
controls-position="right" :min="0" :max="4" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||||
|
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||||
|
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="已拣数量" prop="pickedQuantity">
|
||||||
|
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
||||||
|
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>上次更新</legend>
|
||||||
|
<div style="padding: 5px;">
|
||||||
|
<div style="display: flex; margin-bottom: 10px;">
|
||||||
|
<div style="display: flex; width: 100%;">
|
||||||
|
<div style="width: 30%; align-content: center;">时间:</div>
|
||||||
|
<el-input v-model="uploadRecord.uploadTime" readonly />
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; width: 100%; margin-left: 5px;">
|
||||||
|
<div style="width: 30%; align-content: center;">人员:</div>
|
||||||
|
<el-input v-model="uploadRecord.uploadUser" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; width: 100%;">
|
||||||
|
<div style="width: 13%; align-content: center;">文件名:</div>
|
||||||
|
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
||||||
|
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>再次更新</legend>
|
||||||
|
<UploadExcelOrders></UploadExcelOrders>
|
||||||
|
</fieldset>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
|
import { getOrders, deleteOrders, updateOrders } from '@/api/kateWork.js'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
import UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
|
||||||
|
import { queryUploadRecord } from '@/api/excel.js'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'kateOrders',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ordersList: [],
|
||||||
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
workOrderQuery: '',
|
||||||
|
goodsIdQuery: '',
|
||||||
|
smallBoxQuery: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
uploadDialogVisible: false,
|
||||||
|
orderId: '',
|
||||||
|
ordersFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
ordersFormRef: ref(),
|
||||||
|
rules: reactive({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const request = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
workOrder: this.workOrderQuery.trim(),
|
||||||
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
supplyArea: this.smallBoxQuery.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getOrders(request).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.ordersList = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('查询工单错误' + err.message)
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
|
return dateFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.workOrderQuery = ''
|
||||||
|
this.goodsIdQuery = ''
|
||||||
|
this.smallBoxQuery = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRowOrders(row) {
|
||||||
|
this.orderId = row.orderId
|
||||||
|
this.ordersFormEntity = {
|
||||||
|
orderId: row.orderId,
|
||||||
|
workOrder: row.workOrder,
|
||||||
|
goodsId: row.goodsId,
|
||||||
|
supplyArea: row.supplyArea,
|
||||||
|
requirementQuantity: row.requirementQuantity,
|
||||||
|
orderStatus: row.orderStatus,
|
||||||
|
lackQuantity: row.lackQuantity,
|
||||||
|
pickedQuantity: row.pickedQuantity
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
deleteCurrentRowOrders(row) {
|
||||||
|
this.orderId = row.orderId
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
orderId: this.orderId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteOrders(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除工单信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除工单信息成功')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitOrdersInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
orderId: formData.orderId,
|
||||||
|
workOrder: formData.workOrder,
|
||||||
|
goodsId: formData.goodsId,
|
||||||
|
supplyArea: formData.supplyArea,
|
||||||
|
requirementQuantity: formData.requirementQuantity,
|
||||||
|
orderStatus: formData.orderStatus,
|
||||||
|
lackQuantity: formData.lackQuantity,
|
||||||
|
pickedQuantity: formData.pickedQuantity,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateOrders(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新工单成功。',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新工单失败。')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.dbsId = row.dbsId
|
||||||
|
},
|
||||||
|
openUploadDialog() {
|
||||||
|
// 请求上传记录
|
||||||
|
const param = {
|
||||||
|
userName: store.getters.getUserName,
|
||||||
|
fileDescription: 'ORDERS',
|
||||||
|
isAsc: false,
|
||||||
|
sortBy: 'upload_time'
|
||||||
|
}
|
||||||
|
queryUploadRecord(param).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
if (res.data.returnData.total > 0) {
|
||||||
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
|
} else {
|
||||||
|
this.uploadRecord = reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.uploadRecord = reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('发生异常')
|
||||||
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
315
src/layout/pickTaskMonitor.vue
Normal file
315
src/layout/pickTaskMonitor.vue
Normal file
|
|
@ -0,0 +1,315 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
|
||||||
|
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
</el-row>
|
||||||
|
<br />
|
||||||
|
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||||
|
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
|
@row-click="getCurrentRow">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="vehicleId" label="载具号" min-width="120px" />
|
||||||
|
<el-table-column prop="goodsRelated.goodsId" label="物料编号" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="goodsRelated.goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||||
|
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||||
|
<el-table-column prop="opNum" label="操作数量" min-width="120px" />
|
||||||
|
<el-table-column prop="originNum" label="库存数量" min-width="120px" />
|
||||||
|
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
||||||
|
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px" />
|
||||||
|
<!-- <el-table-column prop="userName" label="操作人员姓名" min-width="120px" /> -->
|
||||||
|
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||||
|
min-width="120px" />
|
||||||
|
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowTask(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="任务信息" width="40%" draggable :show-close="false">
|
||||||
|
<el-form ref="taskFormRef" :model="taskFormEntity" :label-position="labelPosition" label-width="100px"
|
||||||
|
style="max-width: 100%" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="料箱号" prop="vehicleNo">
|
||||||
|
<el-input v-model="taskFormEntity.vehicleNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="零件号" prop="goodsId">
|
||||||
|
<el-input v-model="taskFormEntity.goodsId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="起点" prop="origin">
|
||||||
|
<el-input v-model="taskFormEntity.origin" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="taskFormEntity.taskType == 1">
|
||||||
|
<el-form-item label="终点" prop="destination">
|
||||||
|
<el-select-v2 v-model="taskFormEntity.destination"
|
||||||
|
:options="availableLocationOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="taskFormEntity.taskType == 2">
|
||||||
|
<el-form-item label="终点" prop="destination">
|
||||||
|
<el-input v-model="taskFormEntity.destination" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="任务类型" prop="taskType">
|
||||||
|
<el-select-v2 v-model="taskFormEntity.taskType" placeholder="请选择任务类型" disabled
|
||||||
|
:options="taskTypeOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="任务状态" prop="taskStatus">
|
||||||
|
<el-select-v2 v-model="taskFormEntity.taskStatus" placeholder="请选择任务状态"
|
||||||
|
:options="taskStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitTaskInfo(taskFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { getTasksByPage, changeTaskStatus } from '@/api/task.js'
|
||||||
|
import { dateFormatter, locationFormatter, taskStatusFormatter, timeFormatter, dueFormatter } from '@/utils/formatter.js'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import store from '@/store'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'taskMonitor',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tasks: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
goodsIdQuery: '',
|
||||||
|
vehicleIdQuery: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
taskFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
taskFormRef: ref(),
|
||||||
|
rules: reactive({}),
|
||||||
|
taskId: '',
|
||||||
|
taskTypeOptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '入库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '出库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '盘点'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 9,
|
||||||
|
label: '移库'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
taskStatusOptions: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '任务重置'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '任务取消'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '任务完成'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
availableLocationOptions: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
|
return dateFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
taskStatusFormat: (row, column, cellValue, index) => {
|
||||||
|
return taskStatusFormatter(cellValue)
|
||||||
|
},
|
||||||
|
taskTypeFormat: (row, column, cellValue, index) => {
|
||||||
|
switch (cellValue) {
|
||||||
|
case 1: return '入库'
|
||||||
|
case 2: return '出库'
|
||||||
|
case 3: return '盘点'
|
||||||
|
case 9: return '移库'
|
||||||
|
default: return '未知'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dueFormat: (row, column, cellValue, index) => {
|
||||||
|
return dueFormatter(cellValue)
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const tableRequest = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
vehicleId: this.vehicleIdQuery.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getTasksByPage(tableRequest).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.tasks = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('查询任务错误')
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.goodsIdQuery = ''
|
||||||
|
this.vehicleIdQuery = ''
|
||||||
|
},
|
||||||
|
editCurrentRowTask(row) {
|
||||||
|
// if (row.taskType == 1) {
|
||||||
|
// this.availableLocationOptions = []
|
||||||
|
// var currentOption = {
|
||||||
|
// value: row.destination,
|
||||||
|
// label: locationFormatter(row.destination)
|
||||||
|
// }
|
||||||
|
// this.availableLocationOptions.push(currentOption)
|
||||||
|
// // 生成可用库位列表
|
||||||
|
// const requestParam = {
|
||||||
|
// areaId: 1
|
||||||
|
// }
|
||||||
|
// getAvailableLocations(requestParam).then(res => {
|
||||||
|
// if (res.data.code == 0) {
|
||||||
|
// for (const location of res.data.returnData) {
|
||||||
|
// var newOption = {}
|
||||||
|
// newOption.value = location.locationId
|
||||||
|
// newOption.label = locationFormatter(location.locationId)
|
||||||
|
// this.availableLocationOptions.push(newOption)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }).catch(err => {
|
||||||
|
// ElMessage.error('查找可用库位失败:' + err)
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
this.taskFormEntity.taskId = row.taskId
|
||||||
|
this.taskFormEntity.vehicleNo = row.vehicleNo
|
||||||
|
this.taskFormEntity.goodsId = row.goodsId
|
||||||
|
this.taskFormEntity.origin = row.origin
|
||||||
|
this.taskFormEntity.destination = row.destination
|
||||||
|
this.taskFormEntity.taskType = row.taskType
|
||||||
|
this.taskFormEntity.taskStatus = null
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submitTaskInfo(formData) {
|
||||||
|
if (formData.taskStatus == null || formData.taskStatus == undefined) {
|
||||||
|
ElMessage.error('请选择任务状态')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
formData.userName = store.getters.getUserName
|
||||||
|
changeTaskStatus(formData).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新任务状态成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.taskFormEntity.taskId = ''
|
||||||
|
this.taskFormEntity.vehicleNo = ''
|
||||||
|
this.taskFormEntity.goodsId = ''
|
||||||
|
this.taskFormEntity.origin = ''
|
||||||
|
this.taskFormEntity.destination = ''
|
||||||
|
this.taskFormEntity.taskType = null
|
||||||
|
this.taskFormEntity.taskStatus = null
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新任务状态失败:' + err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.taskId = row.taskId
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,28 +1,49 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<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;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
|
:suffix-icon="Search" />
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
<!-- <el-button type="success" @click="refresh()">刷新</el-button> -->
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
|
@click="uploadDialogVisible = true">导入</el-button>
|
||||||
|
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="650px"
|
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
max-height="650px" @row-click="getCurrentRow" :header-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.vehicleId" v-model="vehicleId"> </el-radio>
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" fixed="left" sortable min-width="120px" />
|
||||||
<el-table-column prop="currentLocation" label="当前位置" fixed="left" min-width="120px" />
|
<el-table-column prop="goodsName" label="描述" min-width="120px" />
|
||||||
<el-table-column prop="vehicleStatus" label="料箱状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
<el-table-column prop="goodsUnit" label="单位" sortable min-width="120px" />
|
||||||
<el-table-column prop="isEmpty" label="是否空箱" :formatter="isEmptyFormat" min-width="120px" />
|
<el-table-column prop="goodsType" label="物料分类" min-width="120px" />
|
||||||
<el-table-column fixed="right" label="操作" width="200px" v-if="selVehicle == null">
|
<el-table-column prop="providerType" label="供应商分类" min-width="120px" />
|
||||||
|
<el-table-column prop="weight" label="重量" min-width="120px" />
|
||||||
|
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" />
|
||||||
|
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" />
|
||||||
|
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" />
|
||||||
|
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" />
|
||||||
|
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" />
|
||||||
|
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" />
|
||||||
|
<el-table-column prop="feedingType" label="补料方式" min-width="120px" />
|
||||||
|
<el-table-column prop="feedingValue" label="补货点" min-width="120px" />
|
||||||
|
<el-table-column prop="dataSource" label="数据来源" min-width="120px" />
|
||||||
|
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||||
<el-button plain type="danger" @click="deleteCurrentRowVehicle(scope.row)">删除</el-button>
|
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -31,107 +52,161 @@
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="托盘信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
style="max-width: 100%" :rules="rules" status-icon>
|
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="料箱号" prop="vehicleId">
|
<el-form-item label="料号" prop="goodsId">
|
||||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="当前位置" prop="currentLocation">
|
<el-form-item label="描述" prop="goodsName">
|
||||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入当前位置" />
|
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="是否空箱" prop="isEmpty">
|
<el-form-item label="单位" prop="goodsUnit">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择托盘状态"
|
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||||
:options="isEmptyOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="托盘状态" prop="vehicleStatus">
|
<el-form-item label="物料分类" prop="goodsType">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||||
:options="vehicleStatusOptions"></el-select-v2>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="供应商分类" prop="providerType">
|
||||||
|
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="重量" prop="weight">
|
||||||
|
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
||||||
|
:precision="3" :step="0.1"
|
||||||
|
:min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="重量单位" prop="weightUnit">
|
||||||
|
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="每盒数量" prop="quantityPerBox">
|
||||||
|
<el-input-number v-model.number="goodsFormEntity.quantityPerBox" controls-position="right"
|
||||||
|
:min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="拆包方式" prop="unpackingType">
|
||||||
|
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料箱类型" prop="vehicleType">
|
||||||
|
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription">
|
||||||
|
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料箱类型2" prop="goodsInVehicleType">
|
||||||
|
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="补料方式" prop="feedingType">
|
||||||
|
<el-input v-model="goodsFormEntity.feedingType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="补货点" prop="feedingValue">
|
||||||
|
<el-input-number v-model.number="goodsFormEntity.feedingValue" controls-position="right"
|
||||||
|
:min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="数据来源" prop="dataSource">
|
||||||
|
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</div>
|
||||||
<template #footer>
|
<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="submitVehicleInfo(vehicleFormEntity)">
|
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>导入物料</legend>
|
||||||
|
<UploadExcelGoods></UploadExcelGoods>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>导入工站配置</legend>
|
||||||
|
<UploadExcelStationConfig></UploadExcelStationConfig>
|
||||||
|
</fieldset>
|
||||||
|
</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 { getAllVehicles, updateVehicleInfo, deleteCurrentVehicle } from '@/api/vehicle'
|
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { vehicleStatusFormatter, locationFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||||
|
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
||||||
|
import { downloadMaterialExcel } from '@/api/excel.js'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'stand',
|
name: 'goods',
|
||||||
props: ['selVehicle'],
|
|
||||||
emits: ['update:selVehicle'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageInfo: {},
|
goodsList: [],
|
||||||
vehicles: [],
|
goodsInfo: {},
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
queryKey: '',
|
goodsIdQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
vehicleId: '',
|
uploadDialogVisible: false,
|
||||||
vehicleFormEntity: reactive({}),
|
goodsId: '',
|
||||||
|
goodsFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
vehicleFormRef: ref(),
|
goodsFormRef: ref(),
|
||||||
rules: reactive({
|
rules: reactive({})
|
||||||
locationId: [
|
|
||||||
{ required: true, message: '请输入库位' }
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
// 物料高度
|
|
||||||
isEmptyOptions: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '带料'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '空箱'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 托盘状态
|
|
||||||
vehicleStatusOptions: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '入库中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '在库中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '出库中'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -140,58 +215,75 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.pageInfo.pageNum = this.currentPage
|
const request = {
|
||||||
this.pageInfo.pageSize = this.pageSize
|
pageNo: this.currentPage,
|
||||||
const tableRequest = {
|
pageSize: this.pageSize,
|
||||||
page: this.pageInfo,
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
param: {
|
userName: store.getters.getUserName
|
||||||
vehicleId: this.queryKey.trim()
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
getAllVehicles(tableRequest).then(res => {
|
getGoodsInfoByPage(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code != 0) {
|
if (tableResponse.code == 0) {
|
||||||
console.log(tableResponse.code + ':' + tableResponse.message)
|
this.goodsList = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
this.vehicles = tableResponse.rows
|
|
||||||
this.total = tableResponse.total
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询托盘信息错误' + err.message)
|
ElMessage.error('查询物料错误' + err.message)
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
return vehicleStatusFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
},
|
||||||
locationFormat: (row, column, cellValue, index) => {
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
return locationFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
},
|
|
||||||
isEmptyFormat: (row, column, cellValue, index) => {
|
|
||||||
if (cellValue == 0) {
|
|
||||||
return '带料'
|
|
||||||
}
|
|
||||||
if (cellValue == 1) {
|
|
||||||
return '空箱'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.queryKey = ''
|
this.goodsIdQuery = ''
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowVehicle(row) {
|
editCurrentRowGoods(row) {
|
||||||
this.vehicleFormEntity = row
|
this.goodsId = row.goodsId
|
||||||
|
this.goodsFormEntity = {
|
||||||
|
goodsId: row.goodsId,
|
||||||
|
goodsName: row.goodsName,
|
||||||
|
goodsUnit: row.goodsUnit,
|
||||||
|
goodsType: row.goodsType,
|
||||||
|
providerType: row.providerType,
|
||||||
|
weight: row.weight,
|
||||||
|
weightUnit: row.weightUnit,
|
||||||
|
quantityPerBox: row.quantityPerBox,
|
||||||
|
unpackingType: row.unpackingType,
|
||||||
|
vehicleType: row.vehicleType,
|
||||||
|
vehicleTypeDescription: row.vehicleTypeDescription,
|
||||||
|
goodsInVehicleType: row.goodsInVehicleType,
|
||||||
|
feedingType: row.feedingType,
|
||||||
|
feedingValue: row.feedingValue,
|
||||||
|
dataSource: row.dataSource,
|
||||||
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
deleteCurrentRowVehicle(row) {
|
deleteCurrentRowGoods(row) {
|
||||||
this.vehicleId = row.vehicleId
|
this.goodsId = row.goodsId
|
||||||
const vehicle = {
|
ElMessageBox.confirm(
|
||||||
vehicleId: row.vehicleId
|
'该操作会删除选择的物料数据。\n是否继续',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
}
|
}
|
||||||
deleteCurrentVehicle(vehicle).then(res => {
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
goodsId: this.goodsId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteAllKateTasks(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '删除料箱成功',
|
message: '删除物料信息成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -199,15 +291,22 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('删除料箱信息失败:' + err)
|
console.log(err)
|
||||||
|
ElMessage.error('删除物料信息失败')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitVehicleInfo(formData) {
|
submitGoodsInfo(formData) {
|
||||||
updateVehicleInfo(formData).then(res => {
|
updatePartInfo(formData).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新料箱信息成功',
|
message: '更新零件信息成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -215,14 +314,54 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新料箱信息失败:' + err)
|
ElMessage.error('更新零件信息失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.vehicleId = row.vehicleId
|
this.goodsId = row.goodsId
|
||||||
this.$emit('update:selVehicle', row)
|
},
|
||||||
}
|
exportExcel() {
|
||||||
|
downloadMaterialExcel().then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = "导出物料信息" + dateFormatter(new Date) + ".xlsx"
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage({
|
||||||
|
message: '下载文件失败:: ' + e,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage({
|
||||||
|
message: '导出失败:: ' + err,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// watch: {
|
||||||
|
// currentPage() {
|
||||||
|
// this.getCurrentPageGoods()
|
||||||
|
// },
|
||||||
|
// pageSize() {
|
||||||
|
// this.getCurrentPageGoods()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -239,7 +378,6 @@ export default {
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* font-size: 5px; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.el-row .el-form-item {
|
||||||
|
|
@ -258,4 +396,18 @@ export default {
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
413
src/layout/stationConfig.vue
Normal file
413
src/layout/stationConfig.vue
Normal file
|
|
@ -0,0 +1,413 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<div style="display: flex;justify-content: space-between;">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
|
@click="uploadDialogVisible = true">导入</el-button>
|
||||||
|
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsId" label="料号" fixed="left" sortable min-width="120px" />
|
||||||
|
<el-table-column prop="goodsName" label="描述" min-width="120px" />
|
||||||
|
<el-table-column prop="goodsUnit" label="单位" sortable min-width="120px" />
|
||||||
|
<el-table-column prop="goodsType" label="物料分类" min-width="120px" />
|
||||||
|
<el-table-column prop="providerType" label="供应商分类" min-width="120px" />
|
||||||
|
<el-table-column prop="weight" label="重量" min-width="120px" />
|
||||||
|
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" />
|
||||||
|
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" />
|
||||||
|
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" />
|
||||||
|
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" />
|
||||||
|
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" />
|
||||||
|
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" />
|
||||||
|
<el-table-column prop="feedingType" label="补料方式" min-width="120px" />
|
||||||
|
<el-table-column prop="feedingValue" label="补货点" min-width="120px" />
|
||||||
|
<el-table-column prop="dataSource" label="数据来源" min-width="120px" />
|
||||||
|
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||||
|
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
||||||
|
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
|
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="料号" prop="goodsId">
|
||||||
|
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="描述" prop="goodsName">
|
||||||
|
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="单位" prop="goodsUnit">
|
||||||
|
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料分类" prop="goodsType">
|
||||||
|
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="供应商分类" prop="providerType">
|
||||||
|
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="重量" prop="weight">
|
||||||
|
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
||||||
|
:precision="3" :step="0.1"
|
||||||
|
:min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="重量单位" prop="weightUnit">
|
||||||
|
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="每盒数量" prop="quantityPerBox">
|
||||||
|
<el-input-number v-model.number="goodsFormEntity.quantityPerBox" controls-position="right"
|
||||||
|
:min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="拆包方式" prop="unpackingType">
|
||||||
|
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料箱类型" prop="vehicleType">
|
||||||
|
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription">
|
||||||
|
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料箱类型2" prop="goodsInVehicleType">
|
||||||
|
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="补料方式" prop="feedingType">
|
||||||
|
<el-input v-model="goodsFormEntity.feedingType" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="补货点" prop="feedingValue">
|
||||||
|
<el-input-number v-model.number="goodsFormEntity.feedingValue" controls-position="right"
|
||||||
|
:min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="数据来源" prop="dataSource">
|
||||||
|
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>导入物料</legend>
|
||||||
|
<UploadExcelGoods></UploadExcelGoods>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>导入工站配置</legend>
|
||||||
|
<UploadExcelStationConfig></UploadExcelStationConfig>
|
||||||
|
</fieldset>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
|
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||||
|
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
||||||
|
import { downloadMaterialExcel } from '@/api/excel.js'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'goods',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
goodsList: [],
|
||||||
|
goodsInfo: {},
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
goodsIdQuery: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
uploadDialogVisible: false,
|
||||||
|
goodsId: '',
|
||||||
|
goodsFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
goodsFormRef: ref(),
|
||||||
|
rules: reactive({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const request = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getGoodsInfoByPage(request).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.goodsList = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('查询物料错误' + err.message)
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
|
return dateFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.goodsIdQuery = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRowGoods(row) {
|
||||||
|
this.goodsId = row.goodsId
|
||||||
|
this.goodsFormEntity = {
|
||||||
|
goodsId: row.goodsId,
|
||||||
|
goodsName: row.goodsName,
|
||||||
|
goodsUnit: row.goodsUnit,
|
||||||
|
goodsType: row.goodsType,
|
||||||
|
providerType: row.providerType,
|
||||||
|
weight: row.weight,
|
||||||
|
weightUnit: row.weightUnit,
|
||||||
|
quantityPerBox: row.quantityPerBox,
|
||||||
|
unpackingType: row.unpackingType,
|
||||||
|
vehicleType: row.vehicleType,
|
||||||
|
vehicleTypeDescription: row.vehicleTypeDescription,
|
||||||
|
goodsInVehicleType: row.goodsInVehicleType,
|
||||||
|
feedingType: row.feedingType,
|
||||||
|
feedingValue: row.feedingValue,
|
||||||
|
dataSource: row.dataSource,
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
deleteCurrentRowGoods(row) {
|
||||||
|
this.goodsId = row.goodsId
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'该操作会删除选择的物料数据。\n是否继续',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
goodsId: this.goodsId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteAllKateTasks(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除物料信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除物料信息失败')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitGoodsInfo(formData) {
|
||||||
|
updatePartInfo(formData).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新零件信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新零件信息失败')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.goodsId = row.goodsId
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
downloadMaterialExcel().then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = "导出物料信息" + dateFormatter(new Date) + ".xlsx"
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage({
|
||||||
|
message: '下载文件失败:: ' + e,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage({
|
||||||
|
message: '导出失败:: ' + err,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// watch: {
|
||||||
|
// currentPage() {
|
||||||
|
// this.getCurrentPageGoods()
|
||||||
|
// },
|
||||||
|
// pageSize() {
|
||||||
|
// this.getCurrentPageGoods()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
306
src/layout/workFlow.vue
Normal file
306
src/layout/workFlow.vue
Normal file
|
|
@ -0,0 +1,306 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
|
||||||
|
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
|
||||||
|
</el-row>
|
||||||
|
<br />
|
||||||
|
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||||
|
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
||||||
|
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="lastInTime" label="最近入库时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
||||||
|
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
||||||
|
style="max-width: 100%" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
|
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="库位" prop="locationId">
|
||||||
|
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="空箱" prop="isEmpty">
|
||||||
|
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||||
|
:options="isEmptyOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态" prop="vehicleStatus">
|
||||||
|
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
||||||
|
:options="vehicleStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||||
|
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||||
|
import store from '@/store'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'vehicle',
|
||||||
|
props: ['selVehicle'],
|
||||||
|
emits: ['update:selVehicle'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
vehicles: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
queryKey: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
vehicleId: '',
|
||||||
|
vehicleFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
vehicleFormRef: ref(),
|
||||||
|
rules: reactive({
|
||||||
|
vehicleId: [
|
||||||
|
{ required: true, message: '请输入箱号' }
|
||||||
|
],
|
||||||
|
currentLocation: [
|
||||||
|
{ required: true, message: '请输入库位' }
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
// 物料高度
|
||||||
|
isEmptyOptions: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '带料'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '空托'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 托盘状态
|
||||||
|
vehicleStatusOptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '在库中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '在站台'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '移动中'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const tableRequest = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
vehicleId: this.queryKey.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getAllVehicles(tableRequest).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.vehicles = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('查询料箱信息错误' + err.message)
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||||
|
return vehicleStatusFormatter(cellValue)
|
||||||
|
},
|
||||||
|
locationFormat: (row, column, cellValue, index) => {
|
||||||
|
return locationFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
isEmptyFormat: (row, column, cellValue, index) => {
|
||||||
|
if (cellValue == 0) {
|
||||||
|
return '带料'
|
||||||
|
}
|
||||||
|
if (cellValue == 1) {
|
||||||
|
return '空箱'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.queryKey = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRowVehicle(row) {
|
||||||
|
this.vehicleFormEntity = {
|
||||||
|
vehicleId: row.vehicleId,
|
||||||
|
currentLocation: row.currentLocation,
|
||||||
|
isEmpty: row.isEmpty,
|
||||||
|
vehicleStatus: row.vehicleStatus,
|
||||||
|
lastInTime: row.lastInTime
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submitVehicleInfo(formData) {
|
||||||
|
const request = {
|
||||||
|
vehicleId: formData.vehicleId,
|
||||||
|
currentLocation: formData.currentLocation,
|
||||||
|
isEmpty: formData.isEmpty,
|
||||||
|
vehicleStatus: formData.vehicleStatus,
|
||||||
|
lastInTime: row.lastInTime,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateVehicleInfo(request).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新料箱信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新料箱信息失败:' + err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.vehicleId = row.vehicleId
|
||||||
|
this.$emit('update:selVehicle', row)
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
const request = {
|
||||||
|
vehicleId: formData.vehicleId,
|
||||||
|
currentLocation: formData.currentLocation,
|
||||||
|
isEmpty: formData.isEmpty,
|
||||||
|
vehicleStatus: formData.vehicleStatus,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
downloadVehicleExcel(request).then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage({
|
||||||
|
message: '下载文件失败:: ' + e,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage({
|
||||||
|
message: '导出失败:: ' + err,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
/* font-size: 5px; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
306
src/layout/workSummary.vue
Normal file
306
src/layout/workSummary.vue
Normal file
|
|
@ -0,0 +1,306 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px">
|
||||||
|
<el-config-provider :locale="zhCn">
|
||||||
|
<el-row>
|
||||||
|
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||||
|
:suffix-icon="Search" />
|
||||||
|
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
|
||||||
|
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
|
||||||
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
|
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
|
||||||
|
</el-row>
|
||||||
|
<br />
|
||||||
|
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||||
|
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
||||||
|
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
||||||
|
<el-table-column prop="lastInTime" label="最近入库时间" :formatter="timeFormat" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
|
@current-change="search" />
|
||||||
|
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
||||||
|
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
||||||
|
style="max-width: 100%" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
|
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="库位" prop="locationId">
|
||||||
|
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="空箱" prop="isEmpty">
|
||||||
|
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||||
|
:options="isEmptyOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态" prop="vehicleStatus">
|
||||||
|
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
||||||
|
:options="vehicleStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||||
|
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||||
|
import store from '@/store'
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'vehicle',
|
||||||
|
props: ['selVehicle'],
|
||||||
|
emits: ['update:selVehicle'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
vehicles: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
queryKey: '',
|
||||||
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
vehicleId: '',
|
||||||
|
vehicleFormEntity: reactive({}),
|
||||||
|
labelPosition: 'top',
|
||||||
|
vehicleFormRef: ref(),
|
||||||
|
rules: reactive({
|
||||||
|
vehicleId: [
|
||||||
|
{ required: true, message: '请输入箱号' }
|
||||||
|
],
|
||||||
|
currentLocation: [
|
||||||
|
{ required: true, message: '请输入库位' }
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
// 物料高度
|
||||||
|
isEmptyOptions: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '带料'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '空托'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 托盘状态
|
||||||
|
vehicleStatusOptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '在库中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '在站台'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '移动中'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.loading = true
|
||||||
|
const tableRequest = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
vehicleId: this.queryKey.trim(),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
getAllVehicles(tableRequest).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.vehicles = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('查询料箱信息错误' + err.message)
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||||
|
return vehicleStatusFormatter(cellValue)
|
||||||
|
},
|
||||||
|
locationFormat: (row, column, cellValue, index) => {
|
||||||
|
return locationFormatter(cellValue)
|
||||||
|
},
|
||||||
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
isEmptyFormat: (row, column, cellValue, index) => {
|
||||||
|
if (cellValue == 0) {
|
||||||
|
return '带料'
|
||||||
|
}
|
||||||
|
if (cellValue == 1) {
|
||||||
|
return '空箱'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.queryKey = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRowVehicle(row) {
|
||||||
|
this.vehicleFormEntity = {
|
||||||
|
vehicleId: row.vehicleId,
|
||||||
|
currentLocation: row.currentLocation,
|
||||||
|
isEmpty: row.isEmpty,
|
||||||
|
vehicleStatus: row.vehicleStatus,
|
||||||
|
lastInTime: row.lastInTime
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submitVehicleInfo(formData) {
|
||||||
|
const request = {
|
||||||
|
vehicleId: formData.vehicleId,
|
||||||
|
currentLocation: formData.currentLocation,
|
||||||
|
isEmpty: formData.isEmpty,
|
||||||
|
vehicleStatus: formData.vehicleStatus,
|
||||||
|
lastInTime: row.lastInTime,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateVehicleInfo(request).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage({
|
||||||
|
message: '更新料箱信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('更新料箱信息失败:' + err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.vehicleId = row.vehicleId
|
||||||
|
this.$emit('update:selVehicle', row)
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
const request = {
|
||||||
|
vehicleId: formData.vehicleId,
|
||||||
|
currentLocation: formData.currentLocation,
|
||||||
|
isEmpty: formData.isEmpty,
|
||||||
|
vehicleStatus: formData.vehicleStatus,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
downloadVehicleExcel(request).then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage({
|
||||||
|
message: '下载文件失败:: ' + e,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage({
|
||||||
|
message: '导出失败:: ' + err,
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-button {
|
||||||
|
width: 72px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
width: 100%;
|
||||||
|
/* font-size: 5px; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-select-v2 {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-input-number {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item .el-button {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -29,8 +29,8 @@ const routes = [
|
||||||
{ path: '/testFinishKitting', component: () => import('@/layout/finishKitting.vue') },// 备料完成
|
{ path: '/testFinishKitting', component: () => import('@/layout/finishKitting.vue') },// 备料完成
|
||||||
{ path: '/testCallEmptyVehicle', component: () => import('@/layout/callEmptyVehicle.vue') },// 呼叫空箱
|
{ path: '/testCallEmptyVehicle', component: () => import('@/layout/callEmptyVehicle.vue') },// 呼叫空箱
|
||||||
{ path: '/testSortBoxs', component: () => import('@/layout/sortBoxs.vue') },// 整理盒子
|
{ path: '/testSortBoxs', component: () => import('@/layout/sortBoxs.vue') },// 整理盒子
|
||||||
{ path: '/uploadDbs', component: () => import('@/layout/uploadDbs.vue') },// 上传DBS
|
{ path: '/uploadDbs', component: () => import('@/layout/dbsTable.vue') },// 上传DBS
|
||||||
{ path: '/uploadOrders', component: () => import('@/layout/uploadOrders.vue') },// 上传工单
|
{ path: '/uploadOrders', component: () => import('@/layout/kateOrdersTable.vue') },// 上传工单
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -77,10 +77,18 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleCommand: (command) => {
|
handleCommand: (command) => {
|
||||||
const param = store.getters.getUser
|
const param = {
|
||||||
|
roleId: store.getters.getUser.roleId,
|
||||||
|
userName: store.getters.getUser.userName
|
||||||
|
}
|
||||||
if (command == 1) {
|
if (command == 1) {
|
||||||
restartSystem(param).then(res => {
|
restartSystem(param).then(res => {
|
||||||
if (res.data.code != 0) {
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '重启系统成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user