代码更新:
1. 增加卡特登录功能 2. 增加各种报表
This commit is contained in:
parent
872d5eafd7
commit
bc6d48f59b
19
src/api/kateLogin.js
Normal file
19
src/api/kateLogin.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import axios from "axios";
|
||||
axios.defaults.baseURL = 'https://login.microsoftonline.com/caterpillar.onmicrosoft.com'
|
||||
axios.defaults.timeout = 5000;
|
||||
// axios.defaults.withCredentials = true
|
||||
|
||||
const postToGetToken = (params) => {
|
||||
return axios({
|
||||
url: '/oauth2/v2.0/token',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
postToGetToken
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ const loginWithAuth = (params) => {
|
|||
|
||||
const getUser = (params) => {
|
||||
return request({
|
||||
url: '/login/getUser',
|
||||
url: '/user/getUser',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,32 +1,52 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<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="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||
<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" />
|
||||
<!-- <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>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<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' }"
|
||||
<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.vehicleId" v-model="vehicleId"> </el-radio>
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </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">
|
||||
<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="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||
<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>
|
||||
|
|
@ -35,112 +55,141 @@
|
|||
: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-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="箱号" prop="vehicleId">
|
||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||
<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="locationId">
|
||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||
<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="isEmpty">
|
||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||
:options="isEmptyOptions"></el-select-v2>
|
||||
<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="vehicleStatus">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
||||
:options="vehicleStatusOptions"></el-select-v2>
|
||||
<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="submitVehicleInfo(vehicleFormEntity)">
|
||||
<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 { 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'
|
||||
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: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
queryKey: '',
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: 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: '移动中'
|
||||
}
|
||||
]
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -149,70 +198,72 @@ export default {
|
|||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getAllVehicles(tableRequest).then(res => {
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.vehicles = tableResponse.returnData.lists
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询料箱信息错误' + err.message)
|
||||
ElMessage.error('查询工单错误' + err.message)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||
return vehicleStatusFormatter(cellValue)
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(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.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowVehicle(row) {
|
||||
this.vehicleFormEntity = {
|
||||
vehicleId: row.vehicleId,
|
||||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
lastInTime: row.lastInTime
|
||||
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
|
||||
},
|
||||
submitVehicleInfo(formData) {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
lastInTime: row.lastInTime,
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateVehicleInfo(request).then(res => {
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage({
|
||||
message: '更新料箱信息成功',
|
||||
message: '删除工单信息成功',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -220,54 +271,79 @@ export default {
|
|||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('更新料箱信息失败:' + 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.vehicleId = row.vehicleId
|
||||
this.$emit('update:selVehicle', row)
|
||||
this.dbsId = row.dbsId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
userName: store.getters.getUserName
|
||||
openUploadDialog() {
|
||||
// 请求上传记录
|
||||
const param = {
|
||||
userName: store.getters.getUserName,
|
||||
fileDescription: 'ORDERS',
|
||||
isAsc: false,
|
||||
sortBy: 'upload_time'
|
||||
}
|
||||
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
|
||||
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 => {
|
||||
ElMessage({
|
||||
message: '导出失败:: ' + err,
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
console.log(err)
|
||||
ElMessage.error('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -284,7 +360,6 @@ export default {
|
|||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
|
|
@ -303,4 +378,18 @@ export default {
|
|||
.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>
|
||||
|
|
@ -1,287 +1,348 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<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="料号" />
|
||||
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
|
||||
<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="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 :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.taskId" v-model="taskId"> </el-radio>
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </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">
|
||||
<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="editCurrentRowTask(scope.row)">编辑</el-button>
|
||||
<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-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-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="料箱号" prop="vehicleNo">
|
||||
<el-input v-model="taskFormEntity.vehicleNo" disabled />
|
||||
<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="goodsId">
|
||||
<el-input v-model="taskFormEntity.goodsId" disabled />
|
||||
<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="origin">
|
||||
<el-input v-model="taskFormEntity.origin" disabled />
|
||||
<el-form-item label="小工位" prop="supplyArea">
|
||||
<el-input v-model="ordersFormEntity.supplyArea" 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-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="taskType">
|
||||
<el-select-v2 v-model="taskFormEntity.taskType" placeholder="请选择任务类型" disabled
|
||||
:options="taskTypeOptions"></el-select-v2>
|
||||
<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="taskStatus">
|
||||
<el-select-v2 v-model="taskFormEntity.taskStatus" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions"></el-select-v2>
|
||||
<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="submitTaskInfo(taskFormEntity)">
|
||||
<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 { 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 { 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: 'taskMonitor',
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
tasks: [],
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
taskFormEntity: reactive({}),
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: 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: []
|
||||
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)
|
||||
},
|
||||
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.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
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
|
||||
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
|
||||
},
|
||||
submitTaskInfo(formData) {
|
||||
if (formData.taskStatus == null || formData.taskStatus == undefined) {
|
||||
ElMessage.error('请选择任务状态')
|
||||
return
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
formData.userName = store.getters.getUserName
|
||||
changeTaskStatus(formData).then(res => {
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage({
|
||||
message: '更新任务状态成功',
|
||||
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)
|
||||
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.taskId = row.taskId
|
||||
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>
|
||||
|
|
@ -301,6 +362,11 @@ export default {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
|
@ -312,4 +378,18 @@ export default {
|
|||
.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>
|
||||
|
|
@ -114,7 +114,7 @@ export default {
|
|||
standId: this.standId,
|
||||
bigBoxNo: this.workFormEntity.bigBoxNo,
|
||||
// orderOfOrders: this.workFormEntity.orderOfOrders,
|
||||
userName: store.getters.getUserName,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
requestSortBox(request).then(res => {
|
||||
const response = res.data
|
||||
|
|
|
|||
|
|
@ -3,47 +3,50 @@
|
|||
<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="uploadDialogVisible = true">导入</el-button>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
<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.goodsId" v-model="goodsId"> </el-radio>
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </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 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="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
||||
<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>
|
||||
|
|
@ -52,102 +55,60 @@
|
|||
: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"
|
||||
<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="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-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="goodsUnit">
|
||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||
<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="goodsType">
|
||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||
<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="providerType">
|
||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||
<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="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 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>
|
||||
|
|
@ -156,20 +117,37 @@
|
|||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
||||
<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">
|
||||
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>导入物料</legend>
|
||||
<UploadExcelGoods></UploadExcelGoods>
|
||||
<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>
|
||||
<UploadExcelStationConfig></UploadExcelStationConfig>
|
||||
<legend>再次更新</legend>
|
||||
<UploadExcelOrders></UploadExcelOrders>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
|
|
@ -178,34 +156,39 @@
|
|||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||
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 UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
||||
import { downloadMaterialExcel } from '@/api/excel.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: 'goods',
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
goodsInfo: {},
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
goodsId: '',
|
||||
goodsFormEntity: reactive({}),
|
||||
orderId: '',
|
||||
ordersFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
goodsFormRef: ref(),
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
|
|
@ -218,19 +201,21 @@ export default {
|
|||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getGoodsInfoByPage(request).then(res => {
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.goodsList = tableResponse.returnData.lists
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询物料错误' + err.message)
|
||||
ElMessage.error('查询工单错误' + err.message)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
|
|
@ -241,34 +226,29 @@ export default {
|
|||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
this.goodsFormEntity = {
|
||||
editCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
this.ordersFormEntity = {
|
||||
orderId: row.orderId,
|
||||
workOrder: row.workOrder,
|
||||
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,
|
||||
supplyArea: row.supplyArea,
|
||||
requirementQuantity: row.requirementQuantity,
|
||||
orderStatus: row.orderStatus,
|
||||
lackQuantity: row.lackQuantity,
|
||||
pickedQuantity: row.pickedQuantity
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的物料数据。\n是否继续',
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
|
|
@ -277,13 +257,13 @@ export default {
|
|||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
goodsId: this.goodsId,
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteAllKateTasks(params).then(res => {
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '删除物料信息成功',
|
||||
message: '删除工单信息成功',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -292,7 +272,7 @@ export default {
|
|||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('删除物料信息失败')
|
||||
ElMessage.error('删除工单信息成功')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
|
|
@ -301,12 +281,23 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
submitGoodsInfo(formData) {
|
||||
updatePartInfo(formData).then(res => {
|
||||
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: '更新零件信息成功',
|
||||
message: '更新工单成功。',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -314,54 +305,45 @@ export default {
|
|||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('更新零件信息失败')
|
||||
ElMessage.error('更新工单失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.goodsId = row.goodsId
|
||||
this.dbsId = row.dbsId
|
||||
},
|
||||
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
|
||||
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 => {
|
||||
ElMessage({
|
||||
message: '导出失败:: ' + err,
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
console.log(err)
|
||||
ElMessage.error('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
// watch: {
|
||||
// currentPage() {
|
||||
// this.getCurrentPageGoods()
|
||||
// },
|
||||
// pageSize() {
|
||||
// this.getCurrentPageGoods()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,47 +3,50 @@
|
|||
<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="uploadDialogVisible = true">导入</el-button>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
<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.goodsId" v-model="goodsId"> </el-radio>
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </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 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="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
||||
<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>
|
||||
|
|
@ -52,102 +55,60 @@
|
|||
: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"
|
||||
<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="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-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="goodsUnit">
|
||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||
<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="goodsType">
|
||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||
<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="providerType">
|
||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||
<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="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 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>
|
||||
|
|
@ -156,20 +117,37 @@
|
|||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
||||
<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">
|
||||
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>导入物料</legend>
|
||||
<UploadExcelGoods></UploadExcelGoods>
|
||||
<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>
|
||||
<UploadExcelStationConfig></UploadExcelStationConfig>
|
||||
<legend>再次更新</legend>
|
||||
<UploadExcelOrders></UploadExcelOrders>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
|
|
@ -178,34 +156,39 @@
|
|||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||
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 UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
||||
import { downloadMaterialExcel } from '@/api/excel.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: 'goods',
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
goodsInfo: {},
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
goodsId: '',
|
||||
goodsFormEntity: reactive({}),
|
||||
orderId: '',
|
||||
ordersFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
goodsFormRef: ref(),
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
|
|
@ -218,19 +201,21 @@ export default {
|
|||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getGoodsInfoByPage(request).then(res => {
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.goodsList = tableResponse.returnData.lists
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询物料错误' + err.message)
|
||||
ElMessage.error('查询工单错误' + err.message)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
|
|
@ -241,34 +226,29 @@ export default {
|
|||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
this.goodsFormEntity = {
|
||||
editCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
this.ordersFormEntity = {
|
||||
orderId: row.orderId,
|
||||
workOrder: row.workOrder,
|
||||
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,
|
||||
supplyArea: row.supplyArea,
|
||||
requirementQuantity: row.requirementQuantity,
|
||||
orderStatus: row.orderStatus,
|
||||
lackQuantity: row.lackQuantity,
|
||||
pickedQuantity: row.pickedQuantity
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的物料数据。\n是否继续',
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
|
|
@ -277,13 +257,13 @@ export default {
|
|||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
goodsId: this.goodsId,
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteAllKateTasks(params).then(res => {
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '删除物料信息成功',
|
||||
message: '删除工单信息成功',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -292,7 +272,7 @@ export default {
|
|||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('删除物料信息失败')
|
||||
ElMessage.error('删除工单信息成功')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
|
|
@ -301,12 +281,23 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
submitGoodsInfo(formData) {
|
||||
updatePartInfo(formData).then(res => {
|
||||
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: '更新零件信息成功',
|
||||
message: '更新工单成功。',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -314,54 +305,45 @@ export default {
|
|||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('更新零件信息失败')
|
||||
ElMessage.error('更新工单失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.goodsId = row.goodsId
|
||||
this.dbsId = row.dbsId
|
||||
},
|
||||
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
|
||||
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 => {
|
||||
ElMessage({
|
||||
message: '导出失败:: ' + err,
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
console.log(err)
|
||||
ElMessage.error('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
// watch: {
|
||||
// currentPage() {
|
||||
// this.getCurrentPageGoods()
|
||||
// },
|
||||
// pageSize() {
|
||||
// this.getCurrentPageGoods()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +1,52 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<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="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||
<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" />
|
||||
<!-- <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>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<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' }"
|
||||
<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.vehicleId" v-model="vehicleId"> </el-radio>
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </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">
|
||||
<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="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||
<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>
|
||||
|
|
@ -35,112 +55,141 @@
|
|||
: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-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="箱号" prop="vehicleId">
|
||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||
<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="locationId">
|
||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||
<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="isEmpty">
|
||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||
:options="isEmptyOptions"></el-select-v2>
|
||||
<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="vehicleStatus">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
||||
:options="vehicleStatusOptions"></el-select-v2>
|
||||
<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="submitVehicleInfo(vehicleFormEntity)">
|
||||
<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 { 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'
|
||||
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: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
queryKey: '',
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: 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: '移动中'
|
||||
}
|
||||
]
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -149,70 +198,72 @@ export default {
|
|||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getAllVehicles(tableRequest).then(res => {
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.vehicles = tableResponse.returnData.lists
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询料箱信息错误' + err.message)
|
||||
ElMessage.error('查询工单错误' + err.message)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||
return vehicleStatusFormatter(cellValue)
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(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.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowVehicle(row) {
|
||||
this.vehicleFormEntity = {
|
||||
vehicleId: row.vehicleId,
|
||||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
lastInTime: row.lastInTime
|
||||
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
|
||||
},
|
||||
submitVehicleInfo(formData) {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
lastInTime: row.lastInTime,
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateVehicleInfo(request).then(res => {
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage({
|
||||
message: '更新料箱信息成功',
|
||||
message: '删除工单信息成功',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -220,54 +271,79 @@ export default {
|
|||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('更新料箱信息失败:' + 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.vehicleId = row.vehicleId
|
||||
this.$emit('update:selVehicle', row)
|
||||
this.dbsId = row.dbsId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
userName: store.getters.getUserName
|
||||
openUploadDialog() {
|
||||
// 请求上传记录
|
||||
const param = {
|
||||
userName: store.getters.getUserName,
|
||||
fileDescription: 'ORDERS',
|
||||
isAsc: false,
|
||||
sortBy: 'upload_time'
|
||||
}
|
||||
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
|
||||
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 => {
|
||||
ElMessage({
|
||||
message: '导出失败:: ' + err,
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
console.log(err)
|
||||
ElMessage.error('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -284,7 +360,6 @@ export default {
|
|||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
|
|
@ -303,4 +378,18 @@ export default {
|
|||
.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>
|
||||
|
|
@ -1,32 +1,52 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<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="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||
<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" />
|
||||
<!-- <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>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<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' }"
|
||||
<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.vehicleId" v-model="vehicleId"> </el-radio>
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </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">
|
||||
<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="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||
<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>
|
||||
|
|
@ -35,112 +55,141 @@
|
|||
: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-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="箱号" prop="vehicleId">
|
||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||
<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="locationId">
|
||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||
<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="isEmpty">
|
||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||
:options="isEmptyOptions"></el-select-v2>
|
||||
<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="vehicleStatus">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
||||
:options="vehicleStatusOptions"></el-select-v2>
|
||||
<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="submitVehicleInfo(vehicleFormEntity)">
|
||||
<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 { 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'
|
||||
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: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
queryKey: '',
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: 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: '移动中'
|
||||
}
|
||||
]
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -149,70 +198,72 @@ export default {
|
|||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getAllVehicles(tableRequest).then(res => {
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.vehicles = tableResponse.returnData.lists
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询料箱信息错误' + err.message)
|
||||
ElMessage.error('查询工单错误' + err.message)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||
return vehicleStatusFormatter(cellValue)
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(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.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowVehicle(row) {
|
||||
this.vehicleFormEntity = {
|
||||
vehicleId: row.vehicleId,
|
||||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
lastInTime: row.lastInTime
|
||||
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
|
||||
},
|
||||
submitVehicleInfo(formData) {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
lastInTime: row.lastInTime,
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateVehicleInfo(request).then(res => {
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage({
|
||||
message: '更新料箱信息成功',
|
||||
message: '删除工单信息成功',
|
||||
type: 'success',
|
||||
})
|
||||
this.search()
|
||||
|
|
@ -220,54 +271,79 @@ export default {
|
|||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('更新料箱信息失败:' + 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.vehicleId = row.vehicleId
|
||||
this.$emit('update:selVehicle', row)
|
||||
this.dbsId = row.dbsId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
userName: store.getters.getUserName
|
||||
openUploadDialog() {
|
||||
// 请求上传记录
|
||||
const param = {
|
||||
userName: store.getters.getUserName,
|
||||
fileDescription: 'ORDERS',
|
||||
isAsc: false,
|
||||
sortBy: 'upload_time'
|
||||
}
|
||||
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
|
||||
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 => {
|
||||
ElMessage({
|
||||
message: '导出失败:: ' + err,
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
console.log(err)
|
||||
ElMessage.error('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -284,7 +360,6 @@ export default {
|
|||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
|
|
@ -303,4 +378,18 @@ export default {
|
|||
.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>
|
||||
|
|
@ -42,35 +42,6 @@ const loginToMonitor = () => {
|
|||
const mpnitorUrl = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}`
|
||||
window.location.href = mpnitorUrl// 当前窗口跳转
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (router.currentRoute.value.query.code != undefined) {
|
||||
console.log(router.currentRoute.value.query.code)
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
const codeInfo = {
|
||||
code: router.currentRoute.value.query.code,
|
||||
state: router.currentRoute.value.query.state
|
||||
}
|
||||
getUser(codeInfo).then(res => {
|
||||
loading.close()
|
||||
if (res.data.code == 0) {
|
||||
store.commit('mutationUser', res.data.returnData.user)// 用户信息
|
||||
store.commit('mutationMenu', res.data.returnData.menuList)// 菜单信息
|
||||
router.replace({ path: '/' })
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
loading.close()
|
||||
ElMessage.error('登录失败!')
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -11,20 +11,58 @@
|
|||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%; border: none" @click="loginCate">卡特账号登录</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { loginWithAuth } from '@/api/login.js'
|
||||
import { getUser, loginWithAuth } from '@/api/login.js'
|
||||
import { postToGetToken } from "@/api/kateLogin.js";
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
import { reactive } from 'vue';
|
||||
import { reactive, onMounted } from 'vue';
|
||||
import store from '@/store'
|
||||
import router from '@/router'
|
||||
import crypto from 'crypto'
|
||||
// Dependency: Node.js crypto module
|
||||
// https://nodejs.org/api/crypto.html#crypto_crypto
|
||||
function base64URLEncode(str) {
|
||||
return str.toString('base64')
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=/g, '');
|
||||
}
|
||||
var verifier = base64URLEncode(crypto.randomBytes(32));
|
||||
// Dependency: Node.js crypto module
|
||||
// https://nodejs.org/api/crypto.html#crypto_crypto
|
||||
function sha256(buffer) {
|
||||
return crypto.createHash('sha256').update(buffer).digest();
|
||||
}
|
||||
var challenge = base64URLEncode(sha256(verifier));
|
||||
|
||||
const loginForm = reactive({
|
||||
loginAccount: "",
|
||||
loginPassword: "",
|
||||
})
|
||||
// todo 参数待设置
|
||||
const oauthConstants = {
|
||||
client_id: 'f921b5f5-ba70-4bcb-8a4b-f3c7d90ec84e',// 客户端id,卡特提供
|
||||
// client_id: 'ASRS_ac_client',
|
||||
response_type: 'code',// 授权类型,固定为code
|
||||
state: '001',// 客户端当前状态,任意值
|
||||
scope: 'openid%20profile',// 权限范围,固定为openid
|
||||
grant_type: 'authorization_code',
|
||||
code_challenge: challenge,
|
||||
code_challenge_method: 'S256',
|
||||
// response_mode: "form_post",
|
||||
redirect_uri: 'https://csclasrs.ecorp.cat.com/wms'
|
||||
}
|
||||
|
||||
|
||||
// 跳转登录的网址
|
||||
const cateLoginUrl = `https://login.microsoftonline.com/caterpillar.onmicrosoft.com/oauth2/v2.0/authorize?client_id=${oauthConstants.client_id}&response_type=${oauthConstants.response_type}&code_challenge=${oauthConstants.code_challenge}&code_challenge_method=S256&grant_type=${oauthConstants.grant_type}&scope=${oauthConstants.scope}&state=${oauthConstants.state}&redirect_uri=${oauthConstants.redirect_uri}`
|
||||
// 登录
|
||||
const login = () => {
|
||||
const loading = ElLoading.service({
|
||||
|
|
@ -49,6 +87,62 @@ const login = () => {
|
|||
ElMessage.error('登录失败!')
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转卡特登录接口
|
||||
const loginCate = () => {
|
||||
store.commit('mutationAddVerify', verifier)// 添加认证信息
|
||||
// console.log(cateLoginUrl)
|
||||
window.location.href = cateLoginUrl// 打开新窗口
|
||||
// window.open(cateLoginUrl)// 不打开新窗口
|
||||
}
|
||||
onMounted(() => {
|
||||
if (router.currentRoute.value.query.code != null | undefined) {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
const tokenParam = {
|
||||
code_verifier: store.getters.getVerify,
|
||||
client_id: '609f8296-74ab-441e-904f-3a8508030511',
|
||||
// scope: 'openid',
|
||||
code: router.currentRoute.value.query.code,
|
||||
redirect_uri: 'https://csclasrs.ecorp.cat.com/wms',
|
||||
grant_type: 'authorization_code',
|
||||
// client_secret: 'o6h8Q~iLegnIBG.GzJngXk.03FYdBJzIoCtTtcwj',
|
||||
// response_type: 'id_token',
|
||||
// response_mode: 'form_post'
|
||||
}
|
||||
postToGetToken(tokenParam).then(res => {
|
||||
loading.close()
|
||||
store.commit('mutationClearVerify', verifier)// 删除认证信息
|
||||
if (res.data.id_token != null | undefined) {
|
||||
const codeInfo = {
|
||||
id_token: res.data.id_token
|
||||
}
|
||||
getUser(codeInfo).then(res => {
|
||||
loading.close()
|
||||
if (res.data.code == 0) {
|
||||
store.commit('mutationUser', res.data.returnData.user)// 用户信息
|
||||
store.commit('mutationMenu', res.data.returnData.menuList)// 菜单信息
|
||||
store.commit('mutationStandId', res.data.returnData.standId)
|
||||
router.replace({ path: '/systemCenter' })
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
loading.close()
|
||||
ElMessage.error('登录失败!')
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
loading.close()
|
||||
ElMessage.error('登录错误')
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user