代码更新:
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) => {
|
const getUser = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/login/getUser',
|
url: '/user/getUser',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,52 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-row>
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
<el-row>
|
||||||
:suffix-icon="Search" />
|
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||||
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
|
:suffix-icon="Search" />
|
||||||
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
:suffix-icon="Search" />
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||||
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
|
:suffix-icon="Search" />
|
||||||
</el-row>
|
<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 />
|
<br />
|
||||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="lastInTime" label="最近入库时间" :formatter="timeFormat" min-width="120px" />
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
<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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -35,112 +55,141 @@
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
<div
|
||||||
style="max-width: 100%" :rules="rules" status-icon>
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
<el-row :gutter="16">
|
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||||
<el-col :span="12" :offset="0">
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-form-item label="箱号" prop="vehicleId">
|
<el-row :gutter="16">
|
||||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
<el-col :span="12" :offset="0">
|
||||||
</el-form-item>
|
<el-form-item label="id" prop="orderId">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="库位" prop="locationId">
|
</el-col>
|
||||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="工单" prop="workOrder">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||||
</el-row>
|
</el-form-item>
|
||||||
<el-row :gutter="16">
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
</el-row>
|
||||||
<el-form-item label="空箱" prop="isEmpty">
|
<el-row :gutter="16">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
<el-col :span="12" :offset="0">
|
||||||
:options="isEmptyOptions"></el-select-v2>
|
<el-form-item label="小工位" prop="supplyArea">
|
||||||
</el-form-item>
|
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item label="状态" prop="vehicleStatus">
|
<el-col :span="12">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
<el-form-item label="料号" prop="goodsId">
|
||||||
:options="vehicleStatusOptions"></el-select-v2>
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
<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>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>上次更新</legend>
|
||||||
|
<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>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 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>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'vehicle',
|
name: 'kateOrders',
|
||||||
props: ['selVehicle'],
|
|
||||||
emits: ['update:selVehicle'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
vehicles: [],
|
ordersList: [],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
queryKey: '',
|
workOrderQuery: '',
|
||||||
|
goodsIdQuery: '',
|
||||||
|
smallBoxQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
vehicleId: '',
|
uploadDialogVisible: false,
|
||||||
vehicleFormEntity: reactive({}),
|
orderId: '',
|
||||||
|
ordersFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
vehicleFormRef: ref(),
|
ordersFormRef: ref(),
|
||||||
rules: reactive({
|
rules: reactive({})
|
||||||
vehicleId: [
|
|
||||||
{ required: true, message: '请输入箱号' }
|
|
||||||
],
|
|
||||||
currentLocation: [
|
|
||||||
{ required: true, message: '请输入库位' }
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
// 物料高度
|
|
||||||
isEmptyOptions: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '带料'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '空托'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 托盘状态
|
|
||||||
vehicleStatusOptions: [
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '在库中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '在站台'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
label: '移动中'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -149,70 +198,106 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const tableRequest = {
|
const request = {
|
||||||
pageNo: this.currentPage,
|
pageNo: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
vehicleId: this.queryKey.trim(),
|
workOrder: this.workOrderQuery.trim(),
|
||||||
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
supplyArea: this.smallBoxQuery.trim(),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
getAllVehicles(tableRequest).then(res => {
|
getOrders(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code == 0) {
|
if (tableResponse.code == 0) {
|
||||||
this.vehicles = tableResponse.returnData.lists
|
this.ordersList = tableResponse.returnData.lists
|
||||||
this.total = tableResponse.returnData.total
|
this.total = tableResponse.returnData.total
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询料箱信息错误' + err.message)
|
ElMessage.error('查询工单错误' + err.message)
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
return vehicleStatusFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
|
||||||
locationFormat: (row, column, cellValue, index) => {
|
|
||||||
return locationFormatter(cellValue)
|
|
||||||
},
|
},
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
},
|
},
|
||||||
isEmptyFormat: (row, column, cellValue, index) => {
|
|
||||||
if (cellValue == 0) {
|
|
||||||
return '带料'
|
|
||||||
}
|
|
||||||
if (cellValue == 1) {
|
|
||||||
return '空箱'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reset() {
|
reset() {
|
||||||
this.queryKey = ''
|
this.workOrderQuery = ''
|
||||||
|
this.goodsIdQuery = ''
|
||||||
|
this.smallBoxQuery = ''
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowVehicle(row) {
|
editCurrentRowOrders(row) {
|
||||||
this.vehicleFormEntity = {
|
this.orderId = row.orderId
|
||||||
vehicleId: row.vehicleId,
|
this.ordersFormEntity = {
|
||||||
currentLocation: row.currentLocation,
|
orderId: row.orderId,
|
||||||
isEmpty: row.isEmpty,
|
workOrder: row.workOrder,
|
||||||
vehicleStatus: row.vehicleStatus,
|
goodsId: row.goodsId,
|
||||||
lastInTime: row.lastInTime
|
supplyArea: row.supplyArea,
|
||||||
|
requirementQuantity: row.requirementQuantity,
|
||||||
|
orderStatus: row.orderStatus,
|
||||||
|
lackQuantity: row.lackQuantity,
|
||||||
|
pickedQuantity: row.pickedQuantity
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
submitVehicleInfo(formData) {
|
deleteCurrentRowOrders(row) {
|
||||||
const request = {
|
this.orderId = row.orderId
|
||||||
vehicleId: formData.vehicleId,
|
ElMessageBox.confirm(
|
||||||
currentLocation: formData.currentLocation,
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
isEmpty: formData.isEmpty,
|
'警告',
|
||||||
vehicleStatus: formData.vehicleStatus,
|
{
|
||||||
lastInTime: row.lastInTime,
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
orderId: this.orderId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteOrders(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除工单信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除工单信息成功')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitOrdersInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
orderId: formData.orderId,
|
||||||
|
workOrder: formData.workOrder,
|
||||||
|
goodsId: formData.goodsId,
|
||||||
|
supplyArea: formData.supplyArea,
|
||||||
|
requirementQuantity: formData.requirementQuantity,
|
||||||
|
orderStatus: formData.orderStatus,
|
||||||
|
lackQuantity: formData.lackQuantity,
|
||||||
|
pickedQuantity: formData.pickedQuantity,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
updateVehicleInfo(request).then(res => {
|
updateOrders(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新料箱信息成功',
|
message: '更新工单成功。',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -220,54 +305,45 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新料箱信息失败:' + err)
|
ElMessage.error('更新工单失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.vehicleId = row.vehicleId
|
this.dbsId = row.dbsId
|
||||||
this.$emit('update:selVehicle', row)
|
|
||||||
},
|
},
|
||||||
exportExcel() {
|
openUploadDialog() {
|
||||||
const request = {
|
// 请求上传记录
|
||||||
vehicleId: formData.vehicleId,
|
const param = {
|
||||||
currentLocation: formData.currentLocation,
|
userName: store.getters.getUserName,
|
||||||
isEmpty: formData.isEmpty,
|
fileDescription: 'ORDERS',
|
||||||
vehicleStatus: formData.vehicleStatus,
|
isAsc: false,
|
||||||
userName: store.getters.getUserName
|
sortBy: 'upload_time'
|
||||||
}
|
}
|
||||||
downloadVehicleExcel(request).then(res => {
|
queryUploadRecord(param).then(res => {
|
||||||
const link = document.createElement('a');//创建a标签
|
if (res.data.code == 0) {
|
||||||
try {
|
if (res.data.returnData.total > 0) {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
} else {
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
this.uploadRecord = reactive({
|
||||||
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
|
fileName: '',
|
||||||
link.style.display = 'none'//隐藏
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
// 兼容不同浏览器的URL对象
|
})
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
}
|
||||||
link.href = url.createObjectURL(blob)
|
} else {
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
this.uploadRecord = reactive({
|
||||||
document.body.appendChild(link)
|
fileName: '',
|
||||||
link.click()
|
uploadTime: '',
|
||||||
document.body.removeChild(link)
|
uploadUser: ''
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
|
||||||
} catch (e) {
|
|
||||||
ElMessage({
|
|
||||||
message: '下载文件失败:: ' + e,
|
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage({
|
console.log(err)
|
||||||
message: '导出失败:: ' + err,
|
ElMessage.error('发生异常')
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -284,7 +360,6 @@ export default {
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* font-size: 5px; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.el-row .el-form-item {
|
||||||
|
|
@ -303,4 +378,18 @@ export default {
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,287 +1,348 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-row>
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
|
<el-row>
|
||||||
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
|
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
:suffix-icon="Search" />
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
</el-row>
|
: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 />
|
<br />
|
||||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
@row-click="getCurrentRow">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
<el-table-column prop="vehicleId" label="载具号" min-width="120px" />
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="goodsRelated.goodsId" label="物料编号" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
<el-table-column prop="goodsRelated.goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
<el-table-column prop="description" label="描述" min-width="120px" />
|
||||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
<el-table-column prop="sLoc" label="SLoc" min-width="120px" />
|
||||||
<el-table-column prop="opNum" label="操作数量" min-width="120px" />
|
<el-table-column prop="type" label="Type" min-width="120px" />
|
||||||
<el-table-column prop="originNum" label="库存数量" min-width="120px" />
|
<el-table-column prop="originStatus" label="Status" min-width="120px" />
|
||||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
<el-table-column prop="sortString" label="SortStrng" min-width="120px" />
|
||||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" />
|
||||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" />
|
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
||||||
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px" />
|
<el-table-column prop="orderStatus" label="状态" min-width="120px" />
|
||||||
<!-- <el-table-column prop="userName" label="操作人员姓名" min-width="120px" /> -->
|
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" />
|
||||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" />
|
||||||
min-width="120px" />
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" />
|
||||||
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
||||||
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button plain type="primary" @click="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>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<br />
|
<br />
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
<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"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="任务信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="taskFormRef" :model="taskFormEntity" :label-position="labelPosition" label-width="100px"
|
<div
|
||||||
style="max-width: 100%" :rules="rules" status-icon>
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
<el-row :gutter="16">
|
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||||
<el-col :span="12" :offset="0">
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-form-item label="料箱号" prop="vehicleNo">
|
<el-row :gutter="16">
|
||||||
<el-input v-model="taskFormEntity.vehicleNo" disabled />
|
<el-col :span="12" :offset="0">
|
||||||
</el-form-item>
|
<el-form-item label="id" prop="orderId">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="零件号" prop="goodsId">
|
</el-col>
|
||||||
<el-input v-model="taskFormEntity.goodsId" disabled />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="工单" prop="workOrder">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||||
</el-row>
|
</el-form-item>
|
||||||
<el-row :gutter="16">
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
</el-row>
|
||||||
<el-form-item label="起点" prop="origin">
|
<el-row :gutter="16">
|
||||||
<el-input v-model="taskFormEntity.origin" disabled />
|
<el-col :span="12" :offset="0">
|
||||||
</el-form-item>
|
<el-form-item label="小工位" prop="supplyArea">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||||
<el-col :span="12" v-if="taskFormEntity.taskType == 1">
|
</el-form-item>
|
||||||
<el-form-item label="终点" prop="destination">
|
</el-col>
|
||||||
<el-select-v2 v-model="taskFormEntity.destination"
|
<el-col :span="12">
|
||||||
:options="availableLocationOptions"></el-select-v2>
|
<el-form-item label="料号" prop="goodsId">
|
||||||
</el-form-item>
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12" v-if="taskFormEntity.taskType == 2">
|
</el-col>
|
||||||
<el-form-item label="终点" prop="destination">
|
</el-row>
|
||||||
<el-input v-model="taskFormEntity.destination" disabled />
|
<el-row :gutter="16">
|
||||||
</el-form-item>
|
<el-col :span="12" :offset="0">
|
||||||
</el-col>
|
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||||
</el-row>
|
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||||
<el-row :gutter="16">
|
controls-position="right" :min="0" clearable />
|
||||||
<el-col :span="12" :offset="0">
|
</el-form-item>
|
||||||
<el-form-item label="任务类型" prop="taskType">
|
</el-col>
|
||||||
<el-select-v2 v-model="taskFormEntity.taskType" placeholder="请选择任务类型" disabled
|
<el-col :span="12">
|
||||||
:options="taskTypeOptions"></el-select-v2>
|
<el-form-item label="状态" prop="orderStatus">
|
||||||
</el-form-item>
|
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||||
</el-col>
|
controls-position="right" :min="0" :max="4" clearable />
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="任务状态" prop="taskStatus">
|
</el-col>
|
||||||
<el-select-v2 v-model="taskFormEntity.taskStatus" placeholder="请选择任务状态"
|
</el-row>
|
||||||
:options="taskStatusOptions"></el-select-v2>
|
<el-row :gutter="16">
|
||||||
</el-form-item>
|
<el-col :span="12" :offset="0">
|
||||||
</el-col>
|
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||||
</el-row>
|
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||||
</el-form>
|
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>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitTaskInfo(taskFormEntity)">
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>上次更新</legend>
|
||||||
|
<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>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 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 { 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>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'taskMonitor',
|
name: 'kateOrders',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tasks: [],
|
ordersList: [],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
workOrderQuery: '',
|
||||||
goodsIdQuery: '',
|
goodsIdQuery: '',
|
||||||
vehicleIdQuery: '',
|
smallBoxQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
taskFormEntity: reactive({}),
|
uploadDialogVisible: false,
|
||||||
|
orderId: '',
|
||||||
|
ordersFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
taskFormRef: ref(),
|
ordersFormRef: ref(),
|
||||||
rules: reactive({}),
|
rules: reactive({})
|
||||||
taskId: '',
|
|
||||||
taskTypeOptions: [
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '入库'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '出库'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
label: '盘点'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 9,
|
|
||||||
label: '移库'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
taskStatusOptions: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '任务重置'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '任务取消'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '任务完成'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
availableLocationOptions: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
methods: {
|
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) => {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
return dateFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
},
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
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() {
|
reset() {
|
||||||
|
this.workOrderQuery = ''
|
||||||
this.goodsIdQuery = ''
|
this.goodsIdQuery = ''
|
||||||
this.vehicleIdQuery = ''
|
this.smallBoxQuery = ''
|
||||||
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowTask(row) {
|
editCurrentRowOrders(row) {
|
||||||
// if (row.taskType == 1) {
|
this.orderId = row.orderId
|
||||||
// this.availableLocationOptions = []
|
this.ordersFormEntity = {
|
||||||
// var currentOption = {
|
orderId: row.orderId,
|
||||||
// value: row.destination,
|
workOrder: row.workOrder,
|
||||||
// label: locationFormatter(row.destination)
|
goodsId: row.goodsId,
|
||||||
// }
|
supplyArea: row.supplyArea,
|
||||||
// this.availableLocationOptions.push(currentOption)
|
requirementQuantity: row.requirementQuantity,
|
||||||
// // 生成可用库位列表
|
orderStatus: row.orderStatus,
|
||||||
// const requestParam = {
|
lackQuantity: row.lackQuantity,
|
||||||
// areaId: 1
|
pickedQuantity: row.pickedQuantity
|
||||||
// }
|
}
|
||||||
// getAvailableLocations(requestParam).then(res => {
|
|
||||||
// if (res.data.code == 0) {
|
|
||||||
// for (const location of res.data.returnData) {
|
|
||||||
// var newOption = {}
|
|
||||||
// newOption.value = location.locationId
|
|
||||||
// newOption.label = locationFormatter(location.locationId)
|
|
||||||
// this.availableLocationOptions.push(newOption)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }).catch(err => {
|
|
||||||
// ElMessage.error('查找可用库位失败:' + err)
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
this.taskFormEntity.taskId = row.taskId
|
|
||||||
this.taskFormEntity.vehicleNo = row.vehicleNo
|
|
||||||
this.taskFormEntity.goodsId = row.goodsId
|
|
||||||
this.taskFormEntity.origin = row.origin
|
|
||||||
this.taskFormEntity.destination = row.destination
|
|
||||||
this.taskFormEntity.taskType = row.taskType
|
|
||||||
this.taskFormEntity.taskStatus = null
|
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
submitTaskInfo(formData) {
|
deleteCurrentRowOrders(row) {
|
||||||
if (formData.taskStatus == null || formData.taskStatus == undefined) {
|
this.orderId = row.orderId
|
||||||
ElMessage.error('请选择任务状态')
|
ElMessageBox.confirm(
|
||||||
return
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
orderId: this.orderId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteOrders(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除工单信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除工单信息成功')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitOrdersInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
orderId: formData.orderId,
|
||||||
|
workOrder: formData.workOrder,
|
||||||
|
goodsId: formData.goodsId,
|
||||||
|
supplyArea: formData.supplyArea,
|
||||||
|
requirementQuantity: formData.requirementQuantity,
|
||||||
|
orderStatus: formData.orderStatus,
|
||||||
|
lackQuantity: formData.lackQuantity,
|
||||||
|
pickedQuantity: formData.pickedQuantity,
|
||||||
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
formData.userName = store.getters.getUserName
|
updateOrders(params).then(res => {
|
||||||
changeTaskStatus(formData).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新任务状态成功',
|
message: '更新工单成功。',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.taskFormEntity.taskId = ''
|
|
||||||
this.taskFormEntity.vehicleNo = ''
|
|
||||||
this.taskFormEntity.goodsId = ''
|
|
||||||
this.taskFormEntity.origin = ''
|
|
||||||
this.taskFormEntity.destination = ''
|
|
||||||
this.taskFormEntity.taskType = null
|
|
||||||
this.taskFormEntity.taskStatus = null
|
|
||||||
this.search()
|
this.search()
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新任务状态失败:' + err)
|
ElMessage.error('更新工单失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
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>
|
</script>
|
||||||
|
|
@ -301,6 +362,11 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-row .el-form-item {
|
||||||
|
width: 10% inherit;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
.el-row .el-form-item .el-select-v2 {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
@ -312,4 +378,18 @@ export default {
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -114,7 +114,7 @@ export default {
|
||||||
standId: this.standId,
|
standId: this.standId,
|
||||||
bigBoxNo: this.workFormEntity.bigBoxNo,
|
bigBoxNo: this.workFormEntity.bigBoxNo,
|
||||||
// orderOfOrders: this.workFormEntity.orderOfOrders,
|
// orderOfOrders: this.workFormEntity.orderOfOrders,
|
||||||
userName: store.getters.getUserName,
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
requestSortBox(request).then(res => {
|
requestSortBox(request).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
|
|
|
||||||
|
|
@ -3,47 +3,50 @@
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-input v-model="goodsIdQuery" 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" />
|
:suffix-icon="Search" />
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button style="background-color: #00CED1; color: #000;"
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
@click="uploadDialogVisible = true">导入</el-button>
|
@click="openUploadDialog()">导入</el-button>
|
||||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<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' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="goodsId" label="料号" fixed="left" sortable min-width="120px" />
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
<el-table-column prop="goodsName" label="描述" min-width="120px" />
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="goodsUnit" label="单位" sortable min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
<el-table-column prop="goodsType" label="物料分类" min-width="120px" />
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="providerType" label="供应商分类" min-width="120px" />
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
<el-table-column prop="weight" label="重量" min-width="120px" />
|
<el-table-column prop="description" label="描述" min-width="120px" />
|
||||||
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" />
|
<el-table-column prop="sLoc" label="SLoc" min-width="120px" />
|
||||||
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" />
|
<el-table-column prop="type" label="Type" min-width="120px" />
|
||||||
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" />
|
<el-table-column prop="originStatus" label="Status" min-width="120px" />
|
||||||
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" />
|
<el-table-column prop="sortString" label="SortStrng" min-width="120px" />
|
||||||
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" />
|
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" />
|
||||||
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" />
|
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
||||||
<el-table-column prop="feedingType" label="补料方式" min-width="120px" />
|
<el-table-column prop="orderStatus" label="状态" min-width="120px" />
|
||||||
<el-table-column prop="feedingValue" label="补货点" min-width="120px" />
|
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" />
|
||||||
<el-table-column prop="dataSource" label="数据来源" min-width="120px" />
|
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" />
|
||||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" />
|
||||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
||||||
<el-table-column fixed="right" label="操作" width="240px">
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
||||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
<el-button plain type="danger" @click="deleteCurrentRowOrders(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -52,102 +55,60 @@
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
<div
|
||||||
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
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>
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="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-form-item label="料号" prop="goodsId">
|
||||||
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="描述" prop="goodsName">
|
|
||||||
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="单位" prop="goodsUnit">
|
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||||
|
controls-position="right" :min="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="物料分类" prop="goodsType">
|
<el-form-item label="状态" prop="orderStatus">
|
||||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||||
|
controls-position="right" :min="0" :max="4" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="供应商分类" prop="providerType">
|
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||||
|
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="重量" prop="weight">
|
<el-form-item label="已拣数量" prop="pickedQuantity">
|
||||||
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
||||||
:precision="3" :step="0.1"
|
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="重量单位" prop="weightUnit">
|
|
||||||
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="每盒数量" prop="quantityPerBox">
|
|
||||||
<el-input-number v-model.number="goodsFormEntity.quantityPerBox" controls-position="right"
|
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="拆包方式" prop="unpackingType">
|
|
||||||
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料箱类型" prop="vehicleType">
|
|
||||||
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription">
|
|
||||||
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料箱类型2" prop="goodsInVehicleType">
|
|
||||||
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="补料方式" prop="feedingType">
|
|
||||||
<el-input v-model="goodsFormEntity.feedingType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="补货点" prop="feedingValue">
|
|
||||||
<el-input-number v-model.number="goodsFormEntity.feedingValue" controls-position="right"
|
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="数据来源" prop="dataSource">
|
|
||||||
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -156,20 +117,37 @@
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</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">
|
<fieldset class="title-area">
|
||||||
<legend>导入物料</legend>
|
<legend>上次更新</legend>
|
||||||
<UploadExcelGoods></UploadExcelGoods>
|
<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>
|
||||||
<fieldset class="title-area">
|
<fieldset class="title-area">
|
||||||
<legend>导入工站配置</legend>
|
<legend>再次更新</legend>
|
||||||
<UploadExcelStationConfig></UploadExcelStationConfig>
|
<UploadExcelOrders></UploadExcelOrders>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
|
|
@ -178,34 +156,39 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
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 zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
import UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
|
||||||
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
import { queryUploadRecord } from '@/api/excel.js'
|
||||||
import { downloadMaterialExcel } from '@/api/excel.js'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'goods',
|
name: 'kateOrders',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsList: [],
|
ordersList: [],
|
||||||
goodsInfo: {},
|
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
workOrderQuery: '',
|
||||||
goodsIdQuery: '',
|
goodsIdQuery: '',
|
||||||
|
smallBoxQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
uploadDialogVisible: false,
|
uploadDialogVisible: false,
|
||||||
goodsId: '',
|
orderId: '',
|
||||||
goodsFormEntity: reactive({}),
|
ordersFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
goodsFormRef: ref(),
|
ordersFormRef: ref(),
|
||||||
rules: reactive({})
|
rules: reactive({})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -218,19 +201,21 @@ export default {
|
||||||
const request = {
|
const request = {
|
||||||
pageNo: this.currentPage,
|
pageNo: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
|
workOrder: this.workOrderQuery.trim(),
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
supplyArea: this.smallBoxQuery.trim(),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
getGoodsInfoByPage(request).then(res => {
|
getOrders(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code == 0) {
|
if (tableResponse.code == 0) {
|
||||||
this.goodsList = tableResponse.returnData.lists
|
this.ordersList = tableResponse.returnData.lists
|
||||||
this.total = tableResponse.returnData.total
|
this.total = tableResponse.returnData.total
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询物料错误' + err.message)
|
ElMessage.error('查询工单错误' + err.message)
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
|
|
@ -241,34 +226,29 @@ export default {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
|
this.workOrderQuery = ''
|
||||||
this.goodsIdQuery = ''
|
this.goodsIdQuery = ''
|
||||||
|
this.smallBoxQuery = ''
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowGoods(row) {
|
editCurrentRowOrders(row) {
|
||||||
this.goodsId = row.goodsId
|
this.orderId = row.orderId
|
||||||
this.goodsFormEntity = {
|
this.ordersFormEntity = {
|
||||||
|
orderId: row.orderId,
|
||||||
|
workOrder: row.workOrder,
|
||||||
goodsId: row.goodsId,
|
goodsId: row.goodsId,
|
||||||
goodsName: row.goodsName,
|
supplyArea: row.supplyArea,
|
||||||
goodsUnit: row.goodsUnit,
|
requirementQuantity: row.requirementQuantity,
|
||||||
goodsType: row.goodsType,
|
orderStatus: row.orderStatus,
|
||||||
providerType: row.providerType,
|
lackQuantity: row.lackQuantity,
|
||||||
weight: row.weight,
|
pickedQuantity: row.pickedQuantity
|
||||||
weightUnit: row.weightUnit,
|
|
||||||
quantityPerBox: row.quantityPerBox,
|
|
||||||
unpackingType: row.unpackingType,
|
|
||||||
vehicleType: row.vehicleType,
|
|
||||||
vehicleTypeDescription: row.vehicleTypeDescription,
|
|
||||||
goodsInVehicleType: row.goodsInVehicleType,
|
|
||||||
feedingType: row.feedingType,
|
|
||||||
feedingValue: row.feedingValue,
|
|
||||||
dataSource: row.dataSource,
|
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
deleteCurrentRowGoods(row) {
|
deleteCurrentRowOrders(row) {
|
||||||
this.goodsId = row.goodsId
|
this.orderId = row.orderId
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
'该操作会删除选择的物料数据。\n是否继续',
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
'警告',
|
'警告',
|
||||||
{
|
{
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|
@ -277,13 +257,13 @@ export default {
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: this.goodsId,
|
orderId: this.orderId,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
deleteAllKateTasks(params).then(res => {
|
deleteOrders(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '删除物料信息成功',
|
message: '删除工单信息成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -292,7 +272,7 @@ export default {
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('删除物料信息失败')
|
ElMessage.error('删除工单信息成功')
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
|
@ -301,12 +281,23 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitGoodsInfo(formData) {
|
submitOrdersInfo(formData) {
|
||||||
updatePartInfo(formData).then(res => {
|
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) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新零件信息成功',
|
message: '更新工单成功。',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -314,54 +305,45 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新零件信息失败')
|
ElMessage.error('更新工单失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.goodsId = row.goodsId
|
this.dbsId = row.dbsId
|
||||||
},
|
},
|
||||||
exportExcel() {
|
openUploadDialog() {
|
||||||
downloadMaterialExcel().then(res => {
|
// 请求上传记录
|
||||||
const link = document.createElement('a');//创建a标签
|
const param = {
|
||||||
try {
|
userName: store.getters.getUserName,
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
fileDescription: 'ORDERS',
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
isAsc: false,
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
sortBy: 'upload_time'
|
||||||
let _fileName = "导出物料信息" + dateFormatter(new Date) + ".xlsx"
|
}
|
||||||
link.style.display = 'none'//隐藏
|
queryUploadRecord(param).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
// 兼容不同浏览器的URL对象
|
if (res.data.returnData.total > 0) {
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
link.href = url.createObjectURL(blob)
|
} else {
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
this.uploadRecord = reactive({
|
||||||
document.body.appendChild(link)
|
fileName: '',
|
||||||
link.click()
|
uploadTime: '',
|
||||||
document.body.removeChild(link)
|
uploadUser: ''
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
})
|
||||||
} catch (e) {
|
}
|
||||||
ElMessage({
|
} else {
|
||||||
message: '下载文件失败:: ' + e,
|
this.uploadRecord = reactive({
|
||||||
type: 'error',
|
fileName: '',
|
||||||
showClose: true
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage({
|
console.log(err)
|
||||||
message: '导出失败:: ' + err,
|
ElMessage.error('发生异常')
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// watch: {
|
|
||||||
// currentPage() {
|
|
||||||
// this.getCurrentPageGoods()
|
|
||||||
// },
|
|
||||||
// pageSize() {
|
|
||||||
// this.getCurrentPageGoods()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,47 +3,50 @@
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-input v-model="goodsIdQuery" 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" />
|
:suffix-icon="Search" />
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button style="background-color: #00CED1; color: #000;"
|
<el-button style="background-color: #00CED1; color: #000;"
|
||||||
@click="uploadDialogVisible = true">导入</el-button>
|
@click="openUploadDialog()">导入</el-button>
|
||||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<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' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="goodsId" label="料号" fixed="left" sortable min-width="120px" />
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
<el-table-column prop="goodsName" label="描述" min-width="120px" />
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="goodsUnit" label="单位" sortable min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
<el-table-column prop="goodsType" label="物料分类" min-width="120px" />
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="providerType" label="供应商分类" min-width="120px" />
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
<el-table-column prop="weight" label="重量" min-width="120px" />
|
<el-table-column prop="description" label="描述" min-width="120px" />
|
||||||
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" />
|
<el-table-column prop="sLoc" label="SLoc" min-width="120px" />
|
||||||
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" />
|
<el-table-column prop="type" label="Type" min-width="120px" />
|
||||||
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" />
|
<el-table-column prop="originStatus" label="Status" min-width="120px" />
|
||||||
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" />
|
<el-table-column prop="sortString" label="SortStrng" min-width="120px" />
|
||||||
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" />
|
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" />
|
||||||
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" />
|
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
||||||
<el-table-column prop="feedingType" label="补料方式" min-width="120px" />
|
<el-table-column prop="orderStatus" label="状态" min-width="120px" />
|
||||||
<el-table-column prop="feedingValue" label="补货点" min-width="120px" />
|
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" />
|
||||||
<el-table-column prop="dataSource" label="数据来源" min-width="120px" />
|
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" />
|
||||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" />
|
||||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
||||||
<el-table-column fixed="right" label="操作" width="240px">
|
<el-table-column fixed="right" label="操作" width="240px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
||||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
<el-button plain type="danger" @click="deleteCurrentRowOrders(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -52,102 +55,60 @@
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
<div
|
||||||
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
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>
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="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-form-item label="料号" prop="goodsId">
|
||||||
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="描述" prop="goodsName">
|
|
||||||
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="单位" prop="goodsUnit">
|
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||||
|
controls-position="right" :min="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="物料分类" prop="goodsType">
|
<el-form-item label="状态" prop="orderStatus">
|
||||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||||
|
controls-position="right" :min="0" :max="4" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="供应商分类" prop="providerType">
|
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||||
|
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="重量" prop="weight">
|
<el-form-item label="已拣数量" prop="pickedQuantity">
|
||||||
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
||||||
:precision="3" :step="0.1"
|
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="重量单位" prop="weightUnit">
|
|
||||||
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="每盒数量" prop="quantityPerBox">
|
|
||||||
<el-input-number v-model.number="goodsFormEntity.quantityPerBox" controls-position="right"
|
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="拆包方式" prop="unpackingType">
|
|
||||||
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料箱类型" prop="vehicleType">
|
|
||||||
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription">
|
|
||||||
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料箱类型2" prop="goodsInVehicleType">
|
|
||||||
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="补料方式" prop="feedingType">
|
|
||||||
<el-input v-model="goodsFormEntity.feedingType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="补货点" prop="feedingValue">
|
|
||||||
<el-input-number v-model.number="goodsFormEntity.feedingValue" controls-position="right"
|
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="数据来源" prop="dataSource">
|
|
||||||
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -156,20 +117,37 @@
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</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">
|
<fieldset class="title-area">
|
||||||
<legend>导入物料</legend>
|
<legend>上次更新</legend>
|
||||||
<UploadExcelGoods></UploadExcelGoods>
|
<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>
|
||||||
<fieldset class="title-area">
|
<fieldset class="title-area">
|
||||||
<legend>导入工站配置</legend>
|
<legend>再次更新</legend>
|
||||||
<UploadExcelStationConfig></UploadExcelStationConfig>
|
<UploadExcelOrders></UploadExcelOrders>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
|
|
@ -178,34 +156,39 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
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 zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
import UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
|
||||||
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
import { queryUploadRecord } from '@/api/excel.js'
|
||||||
import { downloadMaterialExcel } from '@/api/excel.js'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'goods',
|
name: 'kateOrders',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsList: [],
|
ordersList: [],
|
||||||
goodsInfo: {},
|
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
workOrderQuery: '',
|
||||||
goodsIdQuery: '',
|
goodsIdQuery: '',
|
||||||
|
smallBoxQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
uploadDialogVisible: false,
|
uploadDialogVisible: false,
|
||||||
goodsId: '',
|
orderId: '',
|
||||||
goodsFormEntity: reactive({}),
|
ordersFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
goodsFormRef: ref(),
|
ordersFormRef: ref(),
|
||||||
rules: reactive({})
|
rules: reactive({})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -218,19 +201,21 @@ export default {
|
||||||
const request = {
|
const request = {
|
||||||
pageNo: this.currentPage,
|
pageNo: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
|
workOrder: this.workOrderQuery.trim(),
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
supplyArea: this.smallBoxQuery.trim(),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
getGoodsInfoByPage(request).then(res => {
|
getOrders(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code == 0) {
|
if (tableResponse.code == 0) {
|
||||||
this.goodsList = tableResponse.returnData.lists
|
this.ordersList = tableResponse.returnData.lists
|
||||||
this.total = tableResponse.returnData.total
|
this.total = tableResponse.returnData.total
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询物料错误' + err.message)
|
ElMessage.error('查询工单错误' + err.message)
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
|
|
@ -241,34 +226,29 @@ export default {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
|
this.workOrderQuery = ''
|
||||||
this.goodsIdQuery = ''
|
this.goodsIdQuery = ''
|
||||||
|
this.smallBoxQuery = ''
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowGoods(row) {
|
editCurrentRowOrders(row) {
|
||||||
this.goodsId = row.goodsId
|
this.orderId = row.orderId
|
||||||
this.goodsFormEntity = {
|
this.ordersFormEntity = {
|
||||||
|
orderId: row.orderId,
|
||||||
|
workOrder: row.workOrder,
|
||||||
goodsId: row.goodsId,
|
goodsId: row.goodsId,
|
||||||
goodsName: row.goodsName,
|
supplyArea: row.supplyArea,
|
||||||
goodsUnit: row.goodsUnit,
|
requirementQuantity: row.requirementQuantity,
|
||||||
goodsType: row.goodsType,
|
orderStatus: row.orderStatus,
|
||||||
providerType: row.providerType,
|
lackQuantity: row.lackQuantity,
|
||||||
weight: row.weight,
|
pickedQuantity: row.pickedQuantity
|
||||||
weightUnit: row.weightUnit,
|
|
||||||
quantityPerBox: row.quantityPerBox,
|
|
||||||
unpackingType: row.unpackingType,
|
|
||||||
vehicleType: row.vehicleType,
|
|
||||||
vehicleTypeDescription: row.vehicleTypeDescription,
|
|
||||||
goodsInVehicleType: row.goodsInVehicleType,
|
|
||||||
feedingType: row.feedingType,
|
|
||||||
feedingValue: row.feedingValue,
|
|
||||||
dataSource: row.dataSource,
|
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
deleteCurrentRowGoods(row) {
|
deleteCurrentRowOrders(row) {
|
||||||
this.goodsId = row.goodsId
|
this.orderId = row.orderId
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
'该操作会删除选择的物料数据。\n是否继续',
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
'警告',
|
'警告',
|
||||||
{
|
{
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|
@ -277,13 +257,13 @@ export default {
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: this.goodsId,
|
orderId: this.orderId,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
deleteAllKateTasks(params).then(res => {
|
deleteOrders(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '删除物料信息成功',
|
message: '删除工单信息成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -292,7 +272,7 @@ export default {
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('删除物料信息失败')
|
ElMessage.error('删除工单信息成功')
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
|
@ -301,12 +281,23 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitGoodsInfo(formData) {
|
submitOrdersInfo(formData) {
|
||||||
updatePartInfo(formData).then(res => {
|
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) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新零件信息成功',
|
message: '更新工单成功。',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -314,54 +305,45 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新零件信息失败')
|
ElMessage.error('更新工单失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.goodsId = row.goodsId
|
this.dbsId = row.dbsId
|
||||||
},
|
},
|
||||||
exportExcel() {
|
openUploadDialog() {
|
||||||
downloadMaterialExcel().then(res => {
|
// 请求上传记录
|
||||||
const link = document.createElement('a');//创建a标签
|
const param = {
|
||||||
try {
|
userName: store.getters.getUserName,
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
fileDescription: 'ORDERS',
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
isAsc: false,
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
sortBy: 'upload_time'
|
||||||
let _fileName = "导出物料信息" + dateFormatter(new Date) + ".xlsx"
|
}
|
||||||
link.style.display = 'none'//隐藏
|
queryUploadRecord(param).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
// 兼容不同浏览器的URL对象
|
if (res.data.returnData.total > 0) {
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
link.href = url.createObjectURL(blob)
|
} else {
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
this.uploadRecord = reactive({
|
||||||
document.body.appendChild(link)
|
fileName: '',
|
||||||
link.click()
|
uploadTime: '',
|
||||||
document.body.removeChild(link)
|
uploadUser: ''
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
})
|
||||||
} catch (e) {
|
}
|
||||||
ElMessage({
|
} else {
|
||||||
message: '下载文件失败:: ' + e,
|
this.uploadRecord = reactive({
|
||||||
type: 'error',
|
fileName: '',
|
||||||
showClose: true
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage({
|
console.log(err)
|
||||||
message: '导出失败:: ' + err,
|
ElMessage.error('发生异常')
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// watch: {
|
|
||||||
// currentPage() {
|
|
||||||
// this.getCurrentPageGoods()
|
|
||||||
// },
|
|
||||||
// pageSize() {
|
|
||||||
// this.getCurrentPageGoods()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,52 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-row>
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
<el-row>
|
||||||
:suffix-icon="Search" />
|
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||||
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
|
:suffix-icon="Search" />
|
||||||
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
:suffix-icon="Search" />
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||||
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
|
:suffix-icon="Search" />
|
||||||
</el-row>
|
<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 />
|
<br />
|
||||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="lastInTime" label="最近入库时间" :formatter="timeFormat" min-width="120px" />
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
<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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -35,112 +55,141 @@
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
<div
|
||||||
style="max-width: 100%" :rules="rules" status-icon>
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
<el-row :gutter="16">
|
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||||
<el-col :span="12" :offset="0">
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-form-item label="箱号" prop="vehicleId">
|
<el-row :gutter="16">
|
||||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
<el-col :span="12" :offset="0">
|
||||||
</el-form-item>
|
<el-form-item label="id" prop="orderId">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="库位" prop="locationId">
|
</el-col>
|
||||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="工单" prop="workOrder">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||||
</el-row>
|
</el-form-item>
|
||||||
<el-row :gutter="16">
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
</el-row>
|
||||||
<el-form-item label="空箱" prop="isEmpty">
|
<el-row :gutter="16">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
<el-col :span="12" :offset="0">
|
||||||
:options="isEmptyOptions"></el-select-v2>
|
<el-form-item label="小工位" prop="supplyArea">
|
||||||
</el-form-item>
|
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item label="状态" prop="vehicleStatus">
|
<el-col :span="12">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
<el-form-item label="料号" prop="goodsId">
|
||||||
:options="vehicleStatusOptions"></el-select-v2>
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
<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>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>上次更新</legend>
|
||||||
|
<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>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 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>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'vehicle',
|
name: 'kateOrders',
|
||||||
props: ['selVehicle'],
|
|
||||||
emits: ['update:selVehicle'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
vehicles: [],
|
ordersList: [],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
queryKey: '',
|
workOrderQuery: '',
|
||||||
|
goodsIdQuery: '',
|
||||||
|
smallBoxQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
vehicleId: '',
|
uploadDialogVisible: false,
|
||||||
vehicleFormEntity: reactive({}),
|
orderId: '',
|
||||||
|
ordersFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
vehicleFormRef: ref(),
|
ordersFormRef: ref(),
|
||||||
rules: reactive({
|
rules: reactive({})
|
||||||
vehicleId: [
|
|
||||||
{ required: true, message: '请输入箱号' }
|
|
||||||
],
|
|
||||||
currentLocation: [
|
|
||||||
{ required: true, message: '请输入库位' }
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
// 物料高度
|
|
||||||
isEmptyOptions: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '带料'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '空托'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 托盘状态
|
|
||||||
vehicleStatusOptions: [
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '在库中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '在站台'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
label: '移动中'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -149,70 +198,106 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const tableRequest = {
|
const request = {
|
||||||
pageNo: this.currentPage,
|
pageNo: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
vehicleId: this.queryKey.trim(),
|
workOrder: this.workOrderQuery.trim(),
|
||||||
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
supplyArea: this.smallBoxQuery.trim(),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
getAllVehicles(tableRequest).then(res => {
|
getOrders(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code == 0) {
|
if (tableResponse.code == 0) {
|
||||||
this.vehicles = tableResponse.returnData.lists
|
this.ordersList = tableResponse.returnData.lists
|
||||||
this.total = tableResponse.returnData.total
|
this.total = tableResponse.returnData.total
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询料箱信息错误' + err.message)
|
ElMessage.error('查询工单错误' + err.message)
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
return vehicleStatusFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
|
||||||
locationFormat: (row, column, cellValue, index) => {
|
|
||||||
return locationFormatter(cellValue)
|
|
||||||
},
|
},
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
},
|
},
|
||||||
isEmptyFormat: (row, column, cellValue, index) => {
|
|
||||||
if (cellValue == 0) {
|
|
||||||
return '带料'
|
|
||||||
}
|
|
||||||
if (cellValue == 1) {
|
|
||||||
return '空箱'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reset() {
|
reset() {
|
||||||
this.queryKey = ''
|
this.workOrderQuery = ''
|
||||||
|
this.goodsIdQuery = ''
|
||||||
|
this.smallBoxQuery = ''
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowVehicle(row) {
|
editCurrentRowOrders(row) {
|
||||||
this.vehicleFormEntity = {
|
this.orderId = row.orderId
|
||||||
vehicleId: row.vehicleId,
|
this.ordersFormEntity = {
|
||||||
currentLocation: row.currentLocation,
|
orderId: row.orderId,
|
||||||
isEmpty: row.isEmpty,
|
workOrder: row.workOrder,
|
||||||
vehicleStatus: row.vehicleStatus,
|
goodsId: row.goodsId,
|
||||||
lastInTime: row.lastInTime
|
supplyArea: row.supplyArea,
|
||||||
|
requirementQuantity: row.requirementQuantity,
|
||||||
|
orderStatus: row.orderStatus,
|
||||||
|
lackQuantity: row.lackQuantity,
|
||||||
|
pickedQuantity: row.pickedQuantity
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
submitVehicleInfo(formData) {
|
deleteCurrentRowOrders(row) {
|
||||||
const request = {
|
this.orderId = row.orderId
|
||||||
vehicleId: formData.vehicleId,
|
ElMessageBox.confirm(
|
||||||
currentLocation: formData.currentLocation,
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
isEmpty: formData.isEmpty,
|
'警告',
|
||||||
vehicleStatus: formData.vehicleStatus,
|
{
|
||||||
lastInTime: row.lastInTime,
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
orderId: this.orderId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteOrders(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除工单信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除工单信息成功')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitOrdersInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
orderId: formData.orderId,
|
||||||
|
workOrder: formData.workOrder,
|
||||||
|
goodsId: formData.goodsId,
|
||||||
|
supplyArea: formData.supplyArea,
|
||||||
|
requirementQuantity: formData.requirementQuantity,
|
||||||
|
orderStatus: formData.orderStatus,
|
||||||
|
lackQuantity: formData.lackQuantity,
|
||||||
|
pickedQuantity: formData.pickedQuantity,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
updateVehicleInfo(request).then(res => {
|
updateOrders(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新料箱信息成功',
|
message: '更新工单成功。',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -220,54 +305,45 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新料箱信息失败:' + err)
|
ElMessage.error('更新工单失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.vehicleId = row.vehicleId
|
this.dbsId = row.dbsId
|
||||||
this.$emit('update:selVehicle', row)
|
|
||||||
},
|
},
|
||||||
exportExcel() {
|
openUploadDialog() {
|
||||||
const request = {
|
// 请求上传记录
|
||||||
vehicleId: formData.vehicleId,
|
const param = {
|
||||||
currentLocation: formData.currentLocation,
|
userName: store.getters.getUserName,
|
||||||
isEmpty: formData.isEmpty,
|
fileDescription: 'ORDERS',
|
||||||
vehicleStatus: formData.vehicleStatus,
|
isAsc: false,
|
||||||
userName: store.getters.getUserName
|
sortBy: 'upload_time'
|
||||||
}
|
}
|
||||||
downloadVehicleExcel(request).then(res => {
|
queryUploadRecord(param).then(res => {
|
||||||
const link = document.createElement('a');//创建a标签
|
if (res.data.code == 0) {
|
||||||
try {
|
if (res.data.returnData.total > 0) {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
} else {
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
this.uploadRecord = reactive({
|
||||||
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
|
fileName: '',
|
||||||
link.style.display = 'none'//隐藏
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
// 兼容不同浏览器的URL对象
|
})
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
}
|
||||||
link.href = url.createObjectURL(blob)
|
} else {
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
this.uploadRecord = reactive({
|
||||||
document.body.appendChild(link)
|
fileName: '',
|
||||||
link.click()
|
uploadTime: '',
|
||||||
document.body.removeChild(link)
|
uploadUser: ''
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
|
||||||
} catch (e) {
|
|
||||||
ElMessage({
|
|
||||||
message: '下载文件失败:: ' + e,
|
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage({
|
console.log(err)
|
||||||
message: '导出失败:: ' + err,
|
ElMessage.error('发生异常')
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -284,7 +360,6 @@ export default {
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* font-size: 5px; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.el-row .el-form-item {
|
||||||
|
|
@ -303,4 +378,18 @@ export default {
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,32 +1,52 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-row>
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
<el-row>
|
||||||
:suffix-icon="Search" />
|
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||||
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
|
:suffix-icon="Search" />
|
||||||
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
:suffix-icon="Search" />
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||||
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
|
:suffix-icon="Search" />
|
||||||
</el-row>
|
<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 />
|
<br />
|
||||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||||
<el-table-column prop="lastInTime" label="最近入库时间" :formatter="timeFormat" min-width="120px" />
|
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
<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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -35,112 +55,141 @@
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
@current-change="search" />
|
@current-change="search" />
|
||||||
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="dialogVisible" title="DBS信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" label-width="100px"
|
<div
|
||||||
style="max-width: 100%" :rules="rules" status-icon>
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
<el-row :gutter="16">
|
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||||
<el-col :span="12" :offset="0">
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-form-item label="箱号" prop="vehicleId">
|
<el-row :gutter="16">
|
||||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
<el-col :span="12" :offset="0">
|
||||||
</el-form-item>
|
<el-form-item label="id" prop="orderId">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="库位" prop="locationId">
|
</el-col>
|
||||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="工单" prop="workOrder">
|
||||||
</el-col>
|
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||||
</el-row>
|
</el-form-item>
|
||||||
<el-row :gutter="16">
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
</el-row>
|
||||||
<el-form-item label="空箱" prop="isEmpty">
|
<el-row :gutter="16">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
<el-col :span="12" :offset="0">
|
||||||
:options="isEmptyOptions"></el-select-v2>
|
<el-form-item label="小工位" prop="supplyArea">
|
||||||
</el-form-item>
|
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item label="状态" prop="vehicleStatus">
|
<el-col :span="12">
|
||||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
|
<el-form-item label="料号" prop="goodsId">
|
||||||
:options="vehicleStatusOptions"></el-select-v2>
|
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
<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>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="title-area">
|
||||||
|
<legend>上次更新</legend>
|
||||||
|
<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>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 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>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'vehicle',
|
name: 'kateOrders',
|
||||||
props: ['selVehicle'],
|
|
||||||
emits: ['update:selVehicle'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
vehicles: [],
|
ordersList: [],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
uploadRecord: reactive({
|
||||||
|
fileName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
|
}),
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
queryKey: '',
|
workOrderQuery: '',
|
||||||
|
goodsIdQuery: '',
|
||||||
|
smallBoxQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
vehicleId: '',
|
uploadDialogVisible: false,
|
||||||
vehicleFormEntity: reactive({}),
|
orderId: '',
|
||||||
|
ordersFormEntity: reactive({}),
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
vehicleFormRef: ref(),
|
ordersFormRef: ref(),
|
||||||
rules: reactive({
|
rules: reactive({})
|
||||||
vehicleId: [
|
|
||||||
{ required: true, message: '请输入箱号' }
|
|
||||||
],
|
|
||||||
currentLocation: [
|
|
||||||
{ required: true, message: '请输入库位' }
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
// 物料高度
|
|
||||||
isEmptyOptions: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '带料'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '空托'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 托盘状态
|
|
||||||
vehicleStatusOptions: [
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '在库中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '在站台'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
label: '移动中'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -149,70 +198,106 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const tableRequest = {
|
const request = {
|
||||||
pageNo: this.currentPage,
|
pageNo: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
vehicleId: this.queryKey.trim(),
|
workOrder: this.workOrderQuery.trim(),
|
||||||
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
|
supplyArea: this.smallBoxQuery.trim(),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
getAllVehicles(tableRequest).then(res => {
|
getOrders(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code == 0) {
|
if (tableResponse.code == 0) {
|
||||||
this.vehicles = tableResponse.returnData.lists
|
this.ordersList = tableResponse.returnData.lists
|
||||||
this.total = tableResponse.returnData.total
|
this.total = tableResponse.returnData.total
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询料箱信息错误' + err.message)
|
ElMessage.error('查询工单错误' + err.message)
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
return vehicleStatusFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
|
||||||
locationFormat: (row, column, cellValue, index) => {
|
|
||||||
return locationFormatter(cellValue)
|
|
||||||
},
|
},
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
},
|
},
|
||||||
isEmptyFormat: (row, column, cellValue, index) => {
|
|
||||||
if (cellValue == 0) {
|
|
||||||
return '带料'
|
|
||||||
}
|
|
||||||
if (cellValue == 1) {
|
|
||||||
return '空箱'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reset() {
|
reset() {
|
||||||
this.queryKey = ''
|
this.workOrderQuery = ''
|
||||||
|
this.goodsIdQuery = ''
|
||||||
|
this.smallBoxQuery = ''
|
||||||
this.search()
|
this.search()
|
||||||
},
|
},
|
||||||
editCurrentRowVehicle(row) {
|
editCurrentRowOrders(row) {
|
||||||
this.vehicleFormEntity = {
|
this.orderId = row.orderId
|
||||||
vehicleId: row.vehicleId,
|
this.ordersFormEntity = {
|
||||||
currentLocation: row.currentLocation,
|
orderId: row.orderId,
|
||||||
isEmpty: row.isEmpty,
|
workOrder: row.workOrder,
|
||||||
vehicleStatus: row.vehicleStatus,
|
goodsId: row.goodsId,
|
||||||
lastInTime: row.lastInTime
|
supplyArea: row.supplyArea,
|
||||||
|
requirementQuantity: row.requirementQuantity,
|
||||||
|
orderStatus: row.orderStatus,
|
||||||
|
lackQuantity: row.lackQuantity,
|
||||||
|
pickedQuantity: row.pickedQuantity
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
submitVehicleInfo(formData) {
|
deleteCurrentRowOrders(row) {
|
||||||
const request = {
|
this.orderId = row.orderId
|
||||||
vehicleId: formData.vehicleId,
|
ElMessageBox.confirm(
|
||||||
currentLocation: formData.currentLocation,
|
'该操作会删除选择的工单数据。\n是否继续',
|
||||||
isEmpty: formData.isEmpty,
|
'警告',
|
||||||
vehicleStatus: formData.vehicleStatus,
|
{
|
||||||
lastInTime: row.lastInTime,
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
const params = {
|
||||||
|
orderId: this.orderId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
deleteOrders(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除工单信息成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('删除工单信息成功')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '操作取消',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitOrdersInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
orderId: formData.orderId,
|
||||||
|
workOrder: formData.workOrder,
|
||||||
|
goodsId: formData.goodsId,
|
||||||
|
supplyArea: formData.supplyArea,
|
||||||
|
requirementQuantity: formData.requirementQuantity,
|
||||||
|
orderStatus: formData.orderStatus,
|
||||||
|
lackQuantity: formData.lackQuantity,
|
||||||
|
pickedQuantity: formData.pickedQuantity,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
updateVehicleInfo(request).then(res => {
|
updateOrders(params).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '更新料箱信息成功',
|
message: '更新工单成功。',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
this.search()
|
this.search()
|
||||||
|
|
@ -220,54 +305,45 @@ export default {
|
||||||
ElMessage.error(res.data.message)
|
ElMessage.error(res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('更新料箱信息失败:' + err)
|
ElMessage.error('更新工单失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.vehicleId = row.vehicleId
|
this.dbsId = row.dbsId
|
||||||
this.$emit('update:selVehicle', row)
|
|
||||||
},
|
},
|
||||||
exportExcel() {
|
openUploadDialog() {
|
||||||
const request = {
|
// 请求上传记录
|
||||||
vehicleId: formData.vehicleId,
|
const param = {
|
||||||
currentLocation: formData.currentLocation,
|
userName: store.getters.getUserName,
|
||||||
isEmpty: formData.isEmpty,
|
fileDescription: 'ORDERS',
|
||||||
vehicleStatus: formData.vehicleStatus,
|
isAsc: false,
|
||||||
userName: store.getters.getUserName
|
sortBy: 'upload_time'
|
||||||
}
|
}
|
||||||
downloadVehicleExcel(request).then(res => {
|
queryUploadRecord(param).then(res => {
|
||||||
const link = document.createElement('a');//创建a标签
|
if (res.data.code == 0) {
|
||||||
try {
|
if (res.data.returnData.total > 0) {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
this.uploadRecord = res.data.returnData.lists[0]
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
} else {
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
this.uploadRecord = reactive({
|
||||||
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
|
fileName: '',
|
||||||
link.style.display = 'none'//隐藏
|
uploadTime: '',
|
||||||
|
uploadUser: ''
|
||||||
// 兼容不同浏览器的URL对象
|
})
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
}
|
||||||
link.href = url.createObjectURL(blob)
|
} else {
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
this.uploadRecord = reactive({
|
||||||
document.body.appendChild(link)
|
fileName: '',
|
||||||
link.click()
|
uploadTime: '',
|
||||||
document.body.removeChild(link)
|
uploadUser: ''
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
|
||||||
} catch (e) {
|
|
||||||
ElMessage({
|
|
||||||
message: '下载文件失败:: ' + e,
|
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage({
|
console.log(err)
|
||||||
message: '导出失败:: ' + err,
|
ElMessage.error('发生异常')
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
this.uploadDialogVisible = true
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -284,7 +360,6 @@ export default {
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* font-size: 5px; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.el-row .el-form-item {
|
||||||
|
|
@ -303,4 +378,18 @@ export default {
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-area {
|
||||||
|
display: flex;
|
||||||
|
min-height: 10%;
|
||||||
|
max-height: max-content;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -42,35 +42,6 @@ const loginToMonitor = () => {
|
||||||
const mpnitorUrl = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}`
|
const mpnitorUrl = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}`
|
||||||
window.location.href = mpnitorUrl// 当前窗口跳转
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,58 @@
|
||||||
<el-form-item style="width: 100%">
|
<el-form-item style="width: 100%">
|
||||||
<el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button>
|
<el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</body>
|
</body>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 { ElMessage, ElLoading } from 'element-plus'
|
||||||
import { reactive } from 'vue';
|
import { reactive, onMounted } from 'vue';
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import router from '@/router'
|
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({
|
const loginForm = reactive({
|
||||||
loginAccount: "",
|
loginAccount: "",
|
||||||
loginPassword: "",
|
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 login = () => {
|
||||||
const loading = ElLoading.service({
|
const loading = ElLoading.service({
|
||||||
|
|
@ -49,6 +87,62 @@ const login = () => {
|
||||||
ElMessage.error('登录失败!')
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user