初版作成
This commit is contained in:
parent
db97c0856b
commit
fd06ed2ef2
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -9,3 +9,4 @@ docs/_book
|
|||
# TODO: where does this rule come from?
|
||||
test/
|
||||
|
||||
node_modules
|
||||
|
|
|
|||
5
babel.config.js
Normal file
5
babel.config.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
19
jsconfig.json
Normal file
19
jsconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
||||
21675
package-lock.json
generated
Normal file
21675
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
59
package.json
Normal file
59
package.json
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"name": "wms",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.3.3",
|
||||
"core-js": "^3.8.3",
|
||||
"element-plus": "^2.4.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"moment": "^2.29.4",
|
||||
"node-polyfill-webpack-plugin": "^2.0.1",
|
||||
"qrcode": "^1.5.3",
|
||||
"qrcode.vue": "^3.4.1",
|
||||
"stream-http": "^3.2.0",
|
||||
"vue": "^3.2.13",
|
||||
"vue-print-nb": "^1.7.5",
|
||||
"vue-router": "^4.0.3",
|
||||
"vue3-print-nb": "^0.1.4",
|
||||
"vuex": "^4.0.0",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-router": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"sass": "^1.83.4",
|
||||
"sass-loader": "^16.0.4"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {
|
||||
"no-unused-vars": "off"
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead",
|
||||
"not ie 11"
|
||||
]
|
||||
}
|
||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
17
public/index.html
Normal file
17
public/index.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
55
src/App.vue
Normal file
55
src/App.vue
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
created() {
|
||||
//在页面加载时读取sessionStorage里的状态信息
|
||||
if (sessionStorage.getItem('storeState')) {
|
||||
//replaceState,替换store的根状态
|
||||
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('storeState'))))
|
||||
}
|
||||
|
||||
//在页面刷新时将vuex里的信息保存到sessionStorage里
|
||||
window.addEventListener('beforeunload', () => {
|
||||
sessionStorage.setItem('storeState', JSON.stringify(this.$store.state))
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
nav {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
nav a {
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
nav a.router-link-exact-active {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
39
src/api/config.js
Normal file
39
src/api/config.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getConfigs = () => {
|
||||
return request.get('/config/getConfigs')
|
||||
}
|
||||
|
||||
const updateConfig = (params) => {
|
||||
return request.post('/config/updateConfig', params)
|
||||
}
|
||||
|
||||
const getConfigsByPage = (params) => {
|
||||
return request.post('/config/getConfigsByPage', params)
|
||||
}
|
||||
|
||||
const restartSystem = (params) => {
|
||||
return request({
|
||||
url: '/system/restartSystem',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 10000
|
||||
})
|
||||
}
|
||||
|
||||
const reloadConfig = (params) => {
|
||||
return request({
|
||||
url: '/system/reloadConfig',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 10000
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getConfigs,
|
||||
getConfigsByPage,
|
||||
updateConfig,
|
||||
restartSystem,
|
||||
reloadConfig
|
||||
}
|
||||
193
src/api/excel.js
Normal file
193
src/api/excel.js
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
export const uploadExcelStock = (data) => {
|
||||
return request({
|
||||
url: '/excel/uploadStocks',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadExcelBaseGoods = (data) => {
|
||||
return request({
|
||||
url: '/excel/importBaseGoods',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadExcelKanban = (data) => {
|
||||
return request({
|
||||
url: '/excel/importKanban',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadExcelDbs = (data) => {
|
||||
return request({
|
||||
url: '/excel/importDbs',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadExcelProduct = (data) => {
|
||||
return request({
|
||||
url: '/excel/importProduct',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadExcelSingleProduct = (data) => {
|
||||
return request({
|
||||
url: '/excel/importSingleProduct',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadExcelProductExtend = (data) => {
|
||||
return request({
|
||||
url: '/excel/importProductExtend',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const exportDbsWithExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/exportDbsWithExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const exportKittingBomWithExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/exportKittingBomWithExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const exportKittingBomRelationWithExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/exportKittingBomRelationWithExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadStockExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadStockExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadInRecordExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadInRecordExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadOutRecordExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadOutRecordExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadInventoryRecordExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadInventoryRecordExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadGoodsExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/exportBaseGoods',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadVehicleExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadVehicleExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadLocationsExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadLocationsExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const queryUploadRecord = (data) => {
|
||||
return request({
|
||||
url: '/excel/queryUploadRecord',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 100000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadClcKanbanRequirementExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadClcKanbanRequirementExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export const downloadWorkSummaryExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadWorkSummaryExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
61
src/api/goods.js
Normal file
61
src/api/goods.js
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
/**
|
||||
* 分页查找物料
|
||||
*/
|
||||
const getGoodsInfoByPage = (params) => {
|
||||
return request({
|
||||
url: '/goods/getGoodsInfoByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新物料信息
|
||||
*/
|
||||
const updateGoodsInfo = (params) => {
|
||||
return request({
|
||||
url: '/goods/updateGoodsInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有物料信息
|
||||
*/
|
||||
const getGoodsInfo = (params) => {
|
||||
return request({
|
||||
url: '/goods/getGoodsInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询自动补全时可用的物料信息
|
||||
*/
|
||||
const getGoodsInfoByGoodsId = (params) => {
|
||||
return request({
|
||||
url: '/goods/getGoodsInfoByGoodsId',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const deleteGoodsInfo = (params) => {
|
||||
return request({
|
||||
url: '/goods/deleteGoodsInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getGoodsInfoByPage,
|
||||
deleteGoodsInfo,
|
||||
getGoodsInfoByGoodsId,
|
||||
getGoodsInfo,
|
||||
updateGoodsInfo
|
||||
}
|
||||
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
|
||||
}
|
||||
110
src/api/kateWork.js
Normal file
110
src/api/kateWork.js
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
// 查询工作
|
||||
export const queryKateWorks = (params) => {
|
||||
return request({
|
||||
url: '/kate/queryKateWorks',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 下发工作
|
||||
export const initWorks = (params) => {
|
||||
return request({
|
||||
url: '/kate/initWorks',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 查询当前工作
|
||||
export const getCurrentWorks = (params) => {
|
||||
return request({
|
||||
url: '/kate/getCurrentWorks',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 确认当前工作
|
||||
export const confirmCurrentWork = (params) => {
|
||||
return request({
|
||||
url: '/kate/confirmCurrentWork',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 获取图纸---定时显示
|
||||
export const getImageOfWork = (params) => {
|
||||
return request({
|
||||
url: '/kate/getImageOfWork',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 获取料盒及缺料
|
||||
export const getBoxesAndLacks = (params) => {
|
||||
return request({
|
||||
url: '/kate/getBoxesAndLacks',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 分页查询看板
|
||||
export const queryKanbanByPage = (params) => {
|
||||
return request({
|
||||
url: '/kate/queryKanbanByPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 生成看板需求
|
||||
export const genClcKanbanRequirement = (params) => {
|
||||
return request({
|
||||
url: '/kate/genClcKanbanRequirement',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 请求图纸---产线扫码
|
||||
export const requestImageDetail = (params) => {
|
||||
return request({
|
||||
url: '/kate/requestImageDetail',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 10000
|
||||
})
|
||||
}
|
||||
// 分页查询DBS
|
||||
export const queryDbsByPage = (params) => {
|
||||
return request({
|
||||
url: '/kate/queryDbsByPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 分页查询配料单
|
||||
export const queryKittingBomByPage = (params) => {
|
||||
return request({
|
||||
url: '/kate/queryKittingBomByPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 分页查询对应关系
|
||||
export const queryRelationByPage = (params) => {
|
||||
return request({
|
||||
url: '/kate/queryRelationByPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
40
src/api/location.js
Normal file
40
src/api/location.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getLocations = (params) => {
|
||||
return request({
|
||||
url: '/location/getLocationsByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateLocation = (params) => {
|
||||
return request({
|
||||
url: '/location/updateLocation',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getELocationsByPage = (params) => {
|
||||
return request({
|
||||
url: '/location/getELocationsByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateELocationInfo = (params) => {
|
||||
return request({
|
||||
url: '/location/updateELocationInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getLocations,
|
||||
updateLocation,
|
||||
getELocationsByPage,
|
||||
updateELocationInfo
|
||||
}
|
||||
31
src/api/login.js
Normal file
31
src/api/login.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const loginWithoutAuth = (params) => {
|
||||
return request({
|
||||
url: '/login/loginWithoutAuth',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const loginWithAuth = (params) => {
|
||||
return request({
|
||||
url: '/login/loginWithAuth',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getUser = (params) => {
|
||||
return request({
|
||||
url: '/user/getUser',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
loginWithoutAuth,
|
||||
loginWithAuth,
|
||||
getUser
|
||||
}
|
||||
13
src/api/record.js
Normal file
13
src/api/record.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getTaskRecords = (params) => {
|
||||
return request({
|
||||
url: '/record/getTaskRecordByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getTaskRecords
|
||||
}
|
||||
22
src/api/stand.js
Normal file
22
src/api/stand.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getStandsByPage = (params) => {
|
||||
return request({
|
||||
url: '/stand/getStandsByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateStandInfo = (params) => {
|
||||
return request({
|
||||
url: '/stand/updateStandInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getStandsByPage,
|
||||
updateStandInfo
|
||||
}
|
||||
49
src/api/stock.js
Normal file
49
src/api/stock.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const queryStocksByPage = (params) => {
|
||||
return request({
|
||||
url: '/stock/queryStocksByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateStockInfo = (params) => {
|
||||
return request({
|
||||
url: '/stock/updateStockInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getStockNumByGoodsId = (params) => {
|
||||
return request({
|
||||
url: '/stock/getStockNumByGoodsId',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getStockUpdateRecord = (params) => {
|
||||
return request({
|
||||
url: '/stock/getStockUpdateRecord',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const handleExceptionStock = (params) => {
|
||||
return request({
|
||||
url: '/stock/handleExceptionStock',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
queryStocksByPage,
|
||||
updateStockInfo,
|
||||
getStockNumByGoodsId,
|
||||
getStockUpdateRecord,
|
||||
handleExceptionStock
|
||||
}
|
||||
40
src/api/task.js
Normal file
40
src/api/task.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const requireStockIn = (params) => {
|
||||
return request({
|
||||
url: '/task/requireStockIn',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const requireStockOut = (params) => {
|
||||
return request({
|
||||
url: '/task/requireStockOut',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getCurrentTask = (params) => {
|
||||
return request({
|
||||
url: '/task/getCurrentTask',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const confirmCurrentTask = (params) => {
|
||||
return request({
|
||||
url: '/task/confirmCurrentTask',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
requireStockIn,
|
||||
requireStockOut,
|
||||
getCurrentTask,
|
||||
confirmCurrentTask
|
||||
}
|
||||
22
src/api/taskMonitor.js
Normal file
22
src/api/taskMonitor.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getPickTasksByPage = (params) => {
|
||||
return request({
|
||||
url: '/taskMonitor/getPickTasksByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updatePickTaskInfo = (params) => {
|
||||
return request({
|
||||
url: '/taskMonitor/updatePickTaskInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getPickTasksByPage,
|
||||
updatePickTaskInfo
|
||||
}
|
||||
149
src/api/user.js
Normal file
149
src/api/user.js
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
// // 登录方法
|
||||
// export function login(username, password, code, uuid) {
|
||||
// const data = {
|
||||
// username,
|
||||
// password,
|
||||
// code,
|
||||
// uuid
|
||||
// }
|
||||
// return request({
|
||||
// url: '/login',
|
||||
// headers: {
|
||||
// isToken: false
|
||||
// },
|
||||
// method: 'post',
|
||||
// data: data
|
||||
// })
|
||||
// }
|
||||
|
||||
// // 注册方法
|
||||
// export function register(data) {
|
||||
// return request({
|
||||
// url: '/register',
|
||||
// headers: {
|
||||
// isToken: false
|
||||
// },
|
||||
// method: 'post',
|
||||
// data: data
|
||||
// })
|
||||
// }
|
||||
|
||||
// // 获取用户详细信息
|
||||
// export function getInfo() {
|
||||
// return request({
|
||||
// url: '/getInfo',
|
||||
// method: 'get'
|
||||
// })
|
||||
// }
|
||||
|
||||
// // 退出方法
|
||||
// export function logout() {
|
||||
// return request({
|
||||
// url: '/logout',
|
||||
// method: 'post'
|
||||
// })
|
||||
// }
|
||||
|
||||
// // 获取验证码
|
||||
// export function getCodeImg() {
|
||||
// return request({
|
||||
// url: '/captchaImage',
|
||||
// headers: {
|
||||
// isToken: false
|
||||
// },
|
||||
// method: 'get',
|
||||
// timeout: 20000
|
||||
// })
|
||||
// }
|
||||
|
||||
export function getUserList(params) {
|
||||
return request({
|
||||
url: '/user/getUserList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoleList(params) {
|
||||
return request({
|
||||
url: '/user/getRoleList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function getPermissionList(params) {
|
||||
return request({
|
||||
url: '/user/getPermissionList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRoleInfo(params) {
|
||||
return request({
|
||||
url: '/user/updateRoleInfo',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRoleInfo(params) {
|
||||
return request({
|
||||
url: '/user/deleteRoleInfo',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function addRoleInfo(params) {
|
||||
return request({
|
||||
url: '/user/addRoleInfo',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoleOptions(params) {
|
||||
return request({
|
||||
url: '/user/getRoleOptions',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUserInfo(params) {
|
||||
return request({
|
||||
url: '/user/updateUserInfo',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function addUserInfo(params) {
|
||||
return request({
|
||||
url: '/user/addUserInfo',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteUserInfo(params) {
|
||||
return request({
|
||||
url: '/user/deleteUserInfo',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
31
src/api/vehicle.js
Normal file
31
src/api/vehicle.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getAllVehicles = (params) => {
|
||||
return request({
|
||||
url: '/location/getVehiclesByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateVehicleInfo = (params) => {
|
||||
return request({
|
||||
url: '/location/updateVehicleInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const deleteCurrentVehicle = (params) => {
|
||||
return request({
|
||||
url: '/location/deleteVehicle',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getAllVehicles,
|
||||
updateVehicleInfo,
|
||||
deleteCurrentVehicle
|
||||
}
|
||||
13
src/api/wmsLog.js
Normal file
13
src/api/wmsLog.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const queryLogs = (params) => {
|
||||
return request({
|
||||
url: '/log/queryWmsLog',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
queryLogs
|
||||
}
|
||||
BIN
src/assets/fdbk_log.png
Normal file
BIN
src/assets/fdbk_log.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
71
src/components/appTag.vue
Normal file
71
src/components/appTag.vue
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
// AppTag组件
|
||||
<template>
|
||||
<div class="app-tag">
|
||||
<el-tag closable size="default" v-for="(tag, index) in tags" :key="tag.labelName" :disable-transitions="true"
|
||||
:effect="$route.path === tag.path ? 'dark' : 'plain'" @close="handleClose(tag, index)"
|
||||
@click="handleClick(tag)">
|
||||
{{ tag.labelName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex';
|
||||
export default {
|
||||
name: 'app-tag',
|
||||
data() {
|
||||
return {
|
||||
tags: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//stateTagsList是state.js中的存放tags数组的key,stateTagsList的值默认为空数组
|
||||
this.tags = this.stateTagsList;
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['stateTagsList'])
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations({
|
||||
close: 'mutationCloseTag'
|
||||
}),
|
||||
handleClose(tag, index) {
|
||||
if (this.tags.length === 1) { // 如果只有一个标签则不能关闭
|
||||
return
|
||||
}
|
||||
this.close(tag) // 删除当前tag
|
||||
if (this.$router.path === tag.path) { // 如果关闭的标签不是当前路由的话,不做路由跳转
|
||||
return
|
||||
} else {
|
||||
if (index === (this.tags.length - 1)) { // 关闭最后一个标签,则路由跳转至最后一个
|
||||
this.$router.push(this.tags[index].path)
|
||||
} else { // 路由跳转至下一个标签页
|
||||
if (index === 0) {
|
||||
this.$router.push(this.tags[0].path)
|
||||
} else {
|
||||
this.$router.push(this.tags[index - 1].path)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 点击tags具体标签
|
||||
handleClick(tag) {
|
||||
this.$router.push(tag.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-tag .el-tag {
|
||||
cursor: pointer;
|
||||
height: 30px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.app-tag .el-tag:hover {
|
||||
color: #000;
|
||||
background-color: #5A9CF8;
|
||||
}
|
||||
</style>
|
||||
58
src/components/sideMenu.vue
Normal file
58
src/components/sideMenu.vue
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<template>
|
||||
<div class="menu-title">主菜单</div>
|
||||
<!-- 侧边栏菜单区域 -->
|
||||
<el-menu active-text-color="#409Eff" background-color="#fff" text-color="#000" :router="true" unique-opened>
|
||||
<!-- 一级菜单 -->
|
||||
<el-sub-menu :index="item.id" v-for="item in menuList" :key="item.id">
|
||||
<!-- 一级菜单模板区域 -->
|
||||
<template #title>
|
||||
<el-icon>
|
||||
<component :is="item.iconValue"></component>
|
||||
</el-icon>
|
||||
<span>{{ item.labelName }}</span>
|
||||
</template>
|
||||
<!-- 二级菜单 -->
|
||||
<el-menu-item :index="subItem.path" v-for="subItem in item.children" :key="subItem.id"
|
||||
@click="clickMenu(subItem)">
|
||||
<template #title>
|
||||
<span>{{ subItem.labelName }}</span>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</el-sub-menu>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
// import { mapState, mapMutations } from 'vuex';
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'side-menu',
|
||||
data() {
|
||||
return {
|
||||
menuList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getMenuList()
|
||||
},
|
||||
methods: {
|
||||
getMenuList() {
|
||||
// this.menuList = this.$store.state.menuList
|
||||
this.menuList = store.getters.getMenuList
|
||||
},
|
||||
// 点击菜单
|
||||
clickMenu(value) {
|
||||
//通过vuex将数据存储在store中
|
||||
store.commit('mutationSelectTags', value)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.menu-title {
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
43
src/constant/form.js
Normal file
43
src/constant/form.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
export const shortcuts = [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export const labelPosition = 'top'
|
||||
|
||||
export const printObj = {
|
||||
id: "printArea", // 这里是要打印元素的ID
|
||||
popTitle: " ", // 打印的标题
|
||||
extraCss: "", // 打印可引入外部的一个 css 文件
|
||||
extraHead: "", // 打印头部文字
|
||||
preview: false, // 是否启动预览模式,默认是false
|
||||
previewTitle: '打印预览', // 打印预览的标题
|
||||
previewPrintBtnLabel: '预览结束,开始打印', // 打印预览的标题下方的按钮文本,点击可进入打印
|
||||
zIndex: 10002, // 预览窗口的z-index,默认是20002,最好比默认值更高
|
||||
previewBeforeOpenCallback() {
|
||||
// console.log('正在加载预览窗口!');
|
||||
}, // 预览窗口打开之前的callback
|
||||
previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback
|
||||
beforeOpenCallback() {
|
||||
// console.log('开始打印之前!')
|
||||
}, // 开始打印之前的callback
|
||||
openCallback() {
|
||||
// console.log('执行打印了!')
|
||||
}, // 调用打印时的callback
|
||||
closeCallback() {
|
||||
// console.log('关闭了打印工具!')
|
||||
}, // 关闭打印的callback(无法区分确认or取消)
|
||||
clickMounted() {
|
||||
// console.log('点击v-print绑定的按钮了!')
|
||||
},
|
||||
}
|
||||
87
src/constant/options.js
Normal file
87
src/constant/options.js
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
// 库存状态
|
||||
export const stockStatusOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '在库中'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '出库中'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已出库'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '回库中'
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '盘点中'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '库存锁定'
|
||||
}
|
||||
]
|
||||
// 物料状态
|
||||
export const goodsStatusOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '正常'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '不合格'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '延期'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '过期'
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '长时间未使用'
|
||||
}
|
||||
]
|
||||
// 看板状态
|
||||
export const kanbanStatusOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '空'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '满'
|
||||
}
|
||||
]
|
||||
// dbs状态
|
||||
export const dbsStatusOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '未开始'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已开始'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已完成'
|
||||
}
|
||||
]
|
||||
// 配料单类型
|
||||
export const kittingBomTypeOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '总成'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '单片'
|
||||
}
|
||||
]
|
||||
55
src/demo/excelDemo.vue
Normal file
55
src/demo/excelDemo.vue
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<template>
|
||||
<el-upload :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false" :data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button size="small" type="primary">选取文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">确认导入</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcel } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: ''
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
}
|
||||
const submitUpload = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
ElMessage.error('请选择文件之后再导入')
|
||||
}
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("file", file.value.raw);
|
||||
|
||||
uploadExcel(formData).then(res => {
|
||||
console.log(res.data)
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '导入成功',
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导入错误')
|
||||
})
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
2
src/env.d.ts
vendored
Normal file
2
src/env.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
declare module 'element-plus/dist/locale/zh-cn.mjs';
|
||||
declare module 'vue3-print-nb';
|
||||
94
src/excel/UploadExcelBaseGoods.vue
Normal file
94
src/excel/UploadExcelBaseGoods.vue
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取基本信息文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadBaseGoods">上传物料基本信息</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelBaseGoods } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadBaseGoods = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelBaseGoods(formData).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success(res.data.message)
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
}).finally(() => {
|
||||
currentHash = ''
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
98
src/excel/UploadExcelDbs.vue
Normal file
98
src/excel/UploadExcelDbs.vue
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取DBS文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadDbs">上传DBS数据</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelDbs } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
const file = ref()
|
||||
var currentHash = ''
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadDbs = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelDbs(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
98
src/excel/UploadExcelKanban.vue
Normal file
98
src/excel/UploadExcelKanban.vue
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取看板文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadKanban">上传看板</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelKanban } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadKanban = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelKanban(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
98
src/excel/UploadExcelProduct.vue
Normal file
98
src/excel/UploadExcelProduct.vue
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取总成配料单文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadProduct">上传总成配料清单</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelProduct } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadProduct = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelProduct(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
98
src/excel/UploadExcelProductExtend.vue
Normal file
98
src/excel/UploadExcelProductExtend.vue
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取总成-单片文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadProductExtend">上传总成-单片数据</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelProductExtend } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadProductExtend = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelProductExtend(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
98
src/excel/UploadExcelSingleProduct.vue
Normal file
98
src/excel/UploadExcelSingleProduct.vue
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取单片配料单文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadSingleProduct">上传单片配料单</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelSingleProduct } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadSingleProduct = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelSingleProduct(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
46
src/http/request.js
Normal file
46
src/http/request.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import axios from 'axios'
|
||||
|
||||
const request = axios.create({
|
||||
baseURL: 'http://localhost:12315/wms',
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
// axios.defaults.baseURL = 'http://10.90.83.39:443/wmsServer/wms'
|
||||
// axios.defaults.baseURL = 'http://localhost:12315/wms'
|
||||
// axios.defaults.baseURL = 'https://s4wwjasrsp01.ap.cat.com/wmsServer/wms'
|
||||
|
||||
// // request 请求器
|
||||
// // 可以自请求发送前对请求做一些处理
|
||||
// // 比如统一加token,对请求参数统一加密
|
||||
// request.interceptors.request.use(config => {
|
||||
// if (config && config.headers) {
|
||||
// config.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||
// }
|
||||
// // config.headers['token'] = user.token; // 设置请求头
|
||||
// return config
|
||||
// }, error => {
|
||||
// return Promise.reject(error)
|
||||
// });
|
||||
|
||||
// // response 拦截器
|
||||
// // 可以在接口响应后统一处理结果
|
||||
// request.interceptors.response.use(
|
||||
// response => {
|
||||
// let res = response.data;
|
||||
// // 如果是返回的文件
|
||||
// if (response.config.responseType === 'blob') {
|
||||
// return res
|
||||
// }
|
||||
// // 兼容服务端返回的字符串数据
|
||||
// if (typeof res === 'string') {
|
||||
// res = res ? JSON.parse(res) : res
|
||||
// }
|
||||
// return res;
|
||||
// },
|
||||
// error => {
|
||||
// console.log('err' + error) // for debug
|
||||
// return Promise.reject(error)
|
||||
// }
|
||||
// )
|
||||
|
||||
export default request
|
||||
304
src/layout/clcKanban.vue
Normal file
304
src/layout/clcKanban.vue
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="kanbanQueryFormRef" :model="kanbanQuery" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="kanbanQuery.goodsId" placeholder="料号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="看板Id">
|
||||
<el-input v-model="kanbanQuery.kanbanId" placeholder="看板Id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="看板状态">
|
||||
<el-select-v2 v-model="kanbanQuery.kanbanStatus" placeholder="看板状态"
|
||||
:options="addAllOptionOfOptions(kanbanStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单日期开始(生成看板用)">
|
||||
<el-date-picker v-model="kanbanQuery.planStartDateFrom" type="date" placeholder="请选择开始日期"
|
||||
:shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单日期结束(生成看板用)">
|
||||
<el-date-picker v-model="kanbanQuery.planStartDateTo" type="date" placeholder="请选择结束日期"
|
||||
:shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary"
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||
@click="search()">查询</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||
@click="clearQuery()">清空</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #20B2AA; color: #000;"
|
||||
@click="genKanban()">生成看板</el-button>
|
||||
<el-button
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #32CD32; color: #000;"
|
||||
@click="exportExcel()">导出看板</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="kanbanList" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.recordId" v-model="recordId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="recordId" label="id" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="料号" show-overflow-tooltip sortable="custom"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="kanbanId" label="看板id" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="kanbanStatus" label="看板状态" sortable="custom"
|
||||
:formatter="kanbanStatusFormat" min-width="120px" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { queryKanbanByPage, genClcKanbanRequirement } from '@/api/kateWork.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { labelPosition, shortcuts } from '@/constant/form'
|
||||
import { kanbanStatusOptions } from '@/constant/options'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let kanbanList = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['goodsId', true]]),
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let kanbanQuery = reactive({
|
||||
goodsId: '',
|
||||
kanbanId: '',
|
||||
kanbanStatus: -99,
|
||||
planStartDateFrom: null,
|
||||
planStartDateTo: null
|
||||
})
|
||||
let kanbanQueryFormRef = ref()
|
||||
let recordId = ''
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.goodsId = kanbanQuery.goodsId
|
||||
request.kanbanId = kanbanQuery.kanbanId
|
||||
request.kanbanStatus = kanbanQuery.kanbanStatus == -99 ? null : kanbanQuery.kanbanStatus
|
||||
queryKanbanByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
kanbanList.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
kanbanList.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询看板信息异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
// 清空查询
|
||||
const clearQuery = () => {
|
||||
kanbanQuery.goodsId = ''
|
||||
kanbanQuery.kanbanId = ''
|
||||
kanbanQuery.kanbanStatus = -99
|
||||
}
|
||||
// 处理排序
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
recordId = row.recordId
|
||||
}
|
||||
// 看板状态格式化
|
||||
const kanbanStatusFormat = (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '空'
|
||||
case 1:
|
||||
return '满'
|
||||
default:
|
||||
return '异常'
|
||||
}
|
||||
}
|
||||
const genKanban = () => {
|
||||
const request = {
|
||||
planStartDateFrom: kanbanQuery.planStartDateFrom,
|
||||
planStartDateTo: kanbanQuery.planStartDateTo,
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
loading.open('生成中...')
|
||||
genClcKanbanRequirement(request).then(res => {
|
||||
loading.close()
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success('生成看板需求成功。')
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
console.log(err)
|
||||
ElMessage.error('生成看板需求异常。')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
</style>
|
||||
523
src/layout/dbsList.vue
Normal file
523
src/layout/dbsList.vue
Normal file
|
|
@ -0,0 +1,523 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="dbsQueryFormRef" :model="dbsQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="dbsQueryFormEntity.workOrder" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="零件号">
|
||||
<el-input v-model="dbsQueryFormEntity.productId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select-v2 v-model="dbsQueryFormEntity.dbsStatus" placeholder="工单状态"
|
||||
:options="addAllOptionOfOptions(dbsStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划开工日期">
|
||||
<el-date-picker v-model="dbsQueryFormEntity.planStartDate" type="date"
|
||||
placeholder="计划开工日期" :shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1;" class="btn-search"
|
||||
@click="openUploadDialog()">导入DBS</el-button>
|
||||
<el-button type="success" class="btn-search"
|
||||
@click="exportExcel()">导出excel</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="displayDbs" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow" :row-style="rowStyle"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.dbsId" v-model="dbsId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="productIdOrigin" label="元零件号" fixed="left" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="productId" label="零件号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="testPlanStartDate" label="Test计划开始时间" :formatter="dateFormat"
|
||||
fixed="left" min-width="160px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="testPlanFinishDate" label="Test计划完成时间" :formatter="dateFormat"
|
||||
min-width="160px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="pntPlanStartDate" label="PNT计划开始时间" :formatter="dateFormat"
|
||||
min-width="170px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="pntPlanFinishDate" label="PNT计划完成时间" :formatter="dateFormat"
|
||||
min-width="170px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="planProduction" label="计划产量" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="equipmentName" label="设备名称" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="workShift" label="班次" sortable="custom" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="family" label="Family" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="testNo" label="Test No#" sortable="custom" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="dbsStatus" label="状态" :formatter="dbsStatusFormat" fixed="right"
|
||||
min-width="120px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="workStand" label="工作站台" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="realWorkDate" label="实际工作日期" sortable="custom" :formatter="dateFormat"
|
||||
min-width="140px" show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" min-width="120px" :formatter="timeFormat"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="kittingRemark" label="K料备注" sortable="custom" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
<!-- <el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存编号" prop="stockId">
|
||||
<el-input v-model="stockFormEntity.stockId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="stockFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="stockFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料名" prop="goodsName">
|
||||
<el-input v-model="stockFormEntity.goodsName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入库数量" prop="totalNum">
|
||||
<el-input-number v-model.number="stockFormEntity.totalNum" controls-position="right"
|
||||
:min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="剩余数量(为0时删除库存)" prop="remainNum">
|
||||
<el-input-number v-model.number="stockFormEntity.remainNum"
|
||||
controls-position="right" :min="0" :max="stockFormEntity.totalNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="stockFormEntity.locationId" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="未使用天数" prop="noUseDays">
|
||||
<el-input-number v-model.number="stockFormEntity.noUseDays"
|
||||
controls-position="right" :min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存状态" prop="stockStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
|
||||
:options="stockStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料状态" prop="goodsStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
|
||||
:options="goodsStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="盘点任务号" prop="inventoryTaskId">
|
||||
<el-input v-model="stockFormEntity.inventoryTaskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否盘点" prop="isInventory">
|
||||
<el-input v-model="stockFormEntity.isInventory" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="stockFormEntity.createTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
||||
<el-input v-model="stockFormEntity.lastUpdateTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
||||
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
<el-dialog v-model="showDbsUploadDialog" title="上传DBS" width="40%" draggable :show-close="true">
|
||||
<fieldset class="search-area">
|
||||
<legend>导入dbs</legend>
|
||||
<UploadExcelDbs></UploadExcelDbs>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { queryDbsByPage } from '@/api/kateWork.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { labelPosition, shortcuts } from '@/constant/form'
|
||||
import { dbsStatusOptions } from '@/constant/options'
|
||||
import UploadExcelDbs from '@/excel/UploadExcelDbs.vue'
|
||||
import { exportDbsWithExcel } from '@/api/excel'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let displayDbs = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['workOrder', true]]),// 按照工单顺序排序
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let dbsQueryFormEntity = reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
dbsStatus: -99,
|
||||
planStartDate: null
|
||||
})
|
||||
let dbsQueryFormRef = ref()
|
||||
let showEbsEditFlag = ref(false)
|
||||
let dbsId = ''
|
||||
let dbsEditFormRef = ref()
|
||||
let dbsEditFormEntity = reactive({})
|
||||
let showDbsUploadDialog = ref(false)
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.workOrder = dbsQueryFormEntity.workOrder
|
||||
request.productId = dbsQueryFormEntity.productId
|
||||
request.dbsStatus = dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus
|
||||
request.planStartDate = dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
queryDbsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayDbs.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
displayDbs.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询DBS数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
dbsQueryFormEntity.workOrder = ''
|
||||
dbsQueryFormEntity.productId = ''
|
||||
dbsQueryFormEntity.dbsStatus = -99
|
||||
dbsQueryFormEntity.planStartDate = null
|
||||
}
|
||||
const dbsStatusFormat = (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
return '已开始'
|
||||
case 2:
|
||||
return '已完成'
|
||||
default:
|
||||
return '未知状态'
|
||||
}
|
||||
}
|
||||
const dateFormat = (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const rowStyle = ({ row, rowIndex }) => {
|
||||
if (row.dbsStatus == 2) {
|
||||
return { "color": "red" }
|
||||
}
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
dbsId = row.dbsId
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
workOrder: dbsQueryFormEntity.workOrder,
|
||||
productId: dbsQueryFormEntity.productId,
|
||||
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
}
|
||||
exportDbsWithExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
const editCurrentRowStock = (row) => {
|
||||
this.stockFormEntity = {
|
||||
stockId: row.stockId,
|
||||
locationId: row.locationId,
|
||||
vehicleId: row.vehicleId,
|
||||
stockStatus: row.stockStatus,
|
||||
createTime: row.createTime,
|
||||
lastUpdateTime: row.lastUpdateTime,
|
||||
lastUpdateUser: row.lastUpdateUser,
|
||||
isInventory: row.isInventory,
|
||||
inventoryTaskId: row.inventoryTaskId,
|
||||
noUseDays: row.noUseDays,
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsStatus: row.goodsStatus,
|
||||
remainNum: row.remainNum,
|
||||
totalNum: row.totalNum
|
||||
}
|
||||
this.dialogVisible = true
|
||||
}
|
||||
const submitStockInfo = () => {
|
||||
const request = {
|
||||
stockId: this.stockFormEntity.stockId,
|
||||
locationId: this.stockFormEntity.locationId,
|
||||
vehicleId: this.stockFormEntity.vehicleId,
|
||||
stockStatus: this.stockFormEntity.stockStatus,
|
||||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库存成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库存失败')
|
||||
})
|
||||
}
|
||||
const openUploadDialog = () => {
|
||||
showDbsUploadDialog.value = true
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
423
src/layout/goods.vue
Normal file
423
src/layout/goods.vue
Normal file
|
|
@ -0,0 +1,423 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="uploadDialogVisible = true">导入</el-button>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsId" label="物料编号" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsDescription" label="物料描述" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vendorName" label="供应商" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="putArea" label="优先存放区域" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="firstImportTime" label="初次导入时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="firstImportUser" label="初次导入用户" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="描述" prop="goodsName">
|
||||
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="单位" prop="goodsUnit">
|
||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料分类" prop="goodsType">
|
||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="供应商分类" prop="providerType">
|
||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
||||
:precision="3" :step="0.1" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="重量单位" prop="weightUnit">
|
||||
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="每盒数量" prop="quantityPerBox">
|
||||
<el-input-number v-model.number="goodsFormEntity.quantityPerBox"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="拆包方式" prop="unpackingType">
|
||||
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料箱类型" prop="vehicleType">
|
||||
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="热度" prop="heat">
|
||||
<el-input v-model="goodsFormEntity.heat" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="卸货点" prop="releasePoint">
|
||||
<el-input v-model="goodsFormEntity.releasePoint" 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="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="dataSource">
|
||||
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>导入物料基本信息</legend>
|
||||
<UploadExcelBaseGoods></UploadExcelBaseGoods>
|
||||
</fieldset>
|
||||
<fieldset class="title-area">
|
||||
<legend>导入看板</legend>
|
||||
<UploadExcelKanban></UploadExcelKanban>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getGoodsInfoByPage, deleteGoodsInfo, updateGoodsInfo } from '@/api/goods.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
// import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||
import UploadExcelBaseGoods from '@/excel/UploadExcelBaseGoods.vue'
|
||||
import UploadExcelKanban from '@/excel/UploadExcelKanban.vue'
|
||||
import { downloadGoodsExcel } from '@/api/excel.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'goods',
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
goodsInfo: {},
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
goodsId: '',
|
||||
goodsFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
goodsFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getGoodsInfoByPage(request).then(res => {
|
||||
console.log(res)
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.goodsList = tableResponse.data.lists
|
||||
this.total = tableResponse.data.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询物料错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
this.goodsFormEntity = {
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsUnit: row.goodsUnit,
|
||||
goodsType: row.goodsType,
|
||||
providerType: row.providerType,
|
||||
weight: row.weight,
|
||||
weightUnit: row.weightUnit,
|
||||
quantityPerBox: row.quantityPerBox,
|
||||
unpackingType: row.unpackingType,
|
||||
vehicleType: row.vehicleType,
|
||||
vehicleTypeDescription: row.vehicleTypeDescription,
|
||||
goodsInVehicleType: row.goodsInVehicleType,
|
||||
feedingType: row.feedingType,
|
||||
feedingValue: row.feedingValue,
|
||||
dataSource: row.dataSource,
|
||||
heat: row.heat,
|
||||
releasePoint: row.releasePoint,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的物料数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
goodsId: this.goodsId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteGoodsInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除物料信息成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除物料信息失败')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
submitGoodsInfo(formData) {
|
||||
const request = {
|
||||
goodsId: formData.goodsId,
|
||||
goodsName: formData.goodsName,
|
||||
goodsUnit: formData.goodsUnit,
|
||||
goodsType: formData.goodsType,
|
||||
providerType: formData.providerType,
|
||||
weight: formData.weight,
|
||||
weightUnit: formData.weightUnit,
|
||||
quantityPerBox: formData.quantityPerBox,
|
||||
unpackingType: formData.unpackingType,
|
||||
vehicleType: formData.vehicleType,
|
||||
vehicleTypeDescription: formData.vehicleTypeDescription,
|
||||
goodsInVehicleType: formData.goodsInVehicleType,
|
||||
feedingType: formData.feedingType,
|
||||
feedingValue: formData.feedingValue,
|
||||
heat: formData.heat,
|
||||
releasePoint: formData.releasePoint,
|
||||
dataSource: formData.dataSource,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateGoodsInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新物料信息成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
errorBox('更新物料信息失败')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.goodsId = row.goodsId
|
||||
},
|
||||
exportExcel() {
|
||||
const params = {
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadGoodsExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "物料报表" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
508
src/layout/goodsIn.vue
Normal file
508
src/layout/goodsIn.vue
Normal file
|
|
@ -0,0 +1,508 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="main-area">
|
||||
<el-form ref="inTaskRef" :model="inTaskEntity" :label-position="labelPosition" label-width="158px"
|
||||
style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="入库类型" prop="emptyTask">
|
||||
<el-select-v2 v-model="inTaskEntity.emptyTask" placeholder="请选择入库类型"
|
||||
:options="inTypeOptions"
|
||||
:disabled="taskRequestEntity.vehicleId != ''"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="inTaskEntity.vehicleId" ref="vehicleId"
|
||||
:disabled="taskRequestEntity.vehicleId != ''" clearable
|
||||
@keyup.enter="handleEnter()" />
|
||||
</el-form-item>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="inTaskEntity.goodsId" ref="goodsId"
|
||||
:disabled="inTaskEntity.emptyTask" clearable @keyup.enter="handleEnter()" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model.number="inTaskEntity.opNum" ref="opNum"
|
||||
:disabled="inTaskEntity.emptyTask" controls-position="right" :min="1" clearable
|
||||
@keyup.enter="handleEnter()" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="addBinding()">绑定物料</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="clearInput()">清除输入</el-button>
|
||||
<el-button type="primary"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="openOutForInDialog()">入库料扫码</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="confirm-area" v-if="taskRequestEntity.vehicleId != ''">
|
||||
<el-form ref="taskRequestRef" :model="taskRequestEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="入库类型">
|
||||
<el-select-v2 v-model="taskRequestEntity.emptyTask" placeholder="请选择入库类型"
|
||||
:options="inTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="taskRequestEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success" ref="sendTaskRef"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmTasks()">下发任务</el-button>
|
||||
<el-button type="danger"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="cancelBinding()">取消绑定</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="taskRequestEntity.goodsInfo" stripe border class="table-class" max-height="450px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
v-if="taskRequestEntity.goodsInfo.length != 0">
|
||||
<el-table-column prop="goodsId" label="零件号" fixed="left" />
|
||||
<el-table-column prop="opNum" label="数量" />
|
||||
<el-table-column fixed="right" label="操作">
|
||||
<template #default>
|
||||
<el-button plain type="warning" @click="removeThisRow(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</fieldset>
|
||||
<el-dialog v-model="showInOutDialog" title="入库清单扫码" width="70%" draggable>
|
||||
<fieldset class="main-area">
|
||||
<el-form ref="outForInRef" :model="outForInEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" :rules="outForInRules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="outForInEntity.goodsId" ref="forInGoodsId" clearable
|
||||
@keyup.enter="addForInGoods()" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="addForInGoods()">添加物料</el-button>
|
||||
<el-button type="primary"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="refreshOuts()">刷新</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="confirm-area" v-if="outForInRequestEntity.goodsIds.length != 0">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto auto; font-size: large; color: black;"
|
||||
@click="confirmTasks()">确认需求</el-button>
|
||||
</div>
|
||||
<el-table ref="outForInTableRef" :data="outForInRequestEntity.goodsIds" stripe border
|
||||
class="table-class" max-height="200px" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" label="料号" fixed="left" />
|
||||
<el-table-column fixed="right" label="操作">
|
||||
<template #default>
|
||||
<el-button plain type="warning" @click="popThisGoodsId(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</fieldset>
|
||||
<!-- <fieldset class="confirm-area">
|
||||
<el-table :data="outForInRequestEntity.goodsIds" stripe border class="table-class"
|
||||
max-height="350px" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" label="料号" fixed="left" />
|
||||
<el-table-column prop="goodsId" label="状态" fixed="left" />
|
||||
<el-table-column fixed="right" label="操作">
|
||||
<template #default>
|
||||
<el-button plain type="warning" @click="removeThisRow(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</fieldset> -->
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { requireStockIn } from '@/api/task.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { labelPosition } from '@/constant/form'
|
||||
const inTypeOptions = [
|
||||
{
|
||||
label: '空箱入库',
|
||||
value: true
|
||||
},
|
||||
{
|
||||
label: '非空箱入库',
|
||||
value: false
|
||||
}
|
||||
]
|
||||
const rules = reactive({
|
||||
emptyTask: [
|
||||
{ required: true, message: '请选择入库类型。' }
|
||||
],
|
||||
vehicleId: [
|
||||
{ required: true, message: '请输入箱号。' }
|
||||
]
|
||||
})
|
||||
const vehicleId = ref()
|
||||
const goodsId = ref()
|
||||
const opNum = ref()
|
||||
const sendTaskRef = ref()
|
||||
let inTaskRef = ref()
|
||||
let inTaskEntity = reactive({
|
||||
emptyTask: false,
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
opNum: null
|
||||
})
|
||||
let taskRequestRef = ref()
|
||||
let taskRequestEntity = reactive({
|
||||
emptyTask: false,
|
||||
vehicleId: '',
|
||||
origin: store.getters.getStandId,
|
||||
goodsInfo: [],
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let showInOutDialog = ref(false)
|
||||
let outForInRef = ref()
|
||||
let outForInEntity = reactive({
|
||||
goodsId: '',
|
||||
})
|
||||
const outForInRules = reactive({
|
||||
goodsId: [
|
||||
{ required: true, message: '请输入料号。' }
|
||||
]
|
||||
})
|
||||
const forInGoodsId = ref()
|
||||
let outForInRequestEntity = reactive({
|
||||
goodsIds: [],
|
||||
origin: store.getters.getStandId,
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
const outForInTableRef = ref()
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
vehicleId.value.focus()
|
||||
})
|
||||
})
|
||||
// 处理回车事件
|
||||
const handleEnter = () => {
|
||||
changeFocus()
|
||||
}
|
||||
// 改变输入焦点
|
||||
const changeFocus = () => {
|
||||
// 进行大写格式化
|
||||
inTaskEntity.vehicleId = inTaskEntity.vehicleId.toUpperCase()
|
||||
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase()
|
||||
if (inTaskEntity.vehicleId == '') {
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
}
|
||||
// 进行格式判断
|
||||
if (inTaskEntity.vehicleId != '') {
|
||||
const vehicleArray = inTaskEntity.vehicleId.split('-')
|
||||
if (vehicleArray.length != 2) {
|
||||
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
} else {
|
||||
if (vehicleArray[0] != 'ASRS' || !numberCheck(vehicleArray[1]) || vehicleArray[1].length != 4) {
|
||||
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
} else if (parseInt(vehicleArray[1]) < 1 || parseInt(vehicleArray[1]) > 2200) {
|
||||
errorBox('箱号范围是0001~2200。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inTaskEntity.opNum != null) {
|
||||
if (inTaskEntity.opNum < 0 || inTaskEntity.opNum > 99999) {
|
||||
errorBox('数量不正确,应该为1-99999之间的整数值。')
|
||||
opNum.value.focus()
|
||||
return
|
||||
}
|
||||
}
|
||||
// 非空箱入库
|
||||
if (!inTaskEntity.emptyTask) {
|
||||
if (inTaskEntity.goodsId == '') {
|
||||
goodsId.value.focus()
|
||||
return
|
||||
}
|
||||
if (inTaskEntity.opNum == null || inTaskEntity.opNum == '') {
|
||||
opNum.value.focus()
|
||||
return
|
||||
}
|
||||
}
|
||||
if (inTaskEntity.goodsId == inTaskEntity.vehicleId || inTaskEntity.goodsId == inTaskEntity.opNum || inTaskEntity.vehicleId == inTaskEntity.opNum) {
|
||||
errorBox('箱号、料号、数量必须为互不相同。')
|
||||
goodsId.value.focus()
|
||||
return
|
||||
}
|
||||
addBinding()
|
||||
}
|
||||
// 判断一个字符串是否是数字
|
||||
const numberCheck = (numberStr) => {
|
||||
if (numberStr == null || numberStr == '') {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
return !isNaN(parseInt(numberStr))
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 清除输入
|
||||
const clearInput = () => {
|
||||
if (taskRequestEntity.vehicleId != '') {
|
||||
if (!taskRequestEntity.emptyTask) {
|
||||
inTaskEntity.goodsId = ''
|
||||
inTaskEntity.opNum = null
|
||||
}
|
||||
} else {
|
||||
inTaskEntity.vehicleId = ''
|
||||
if (!inTaskEntity.emptyTask) {
|
||||
inTaskEntity.goodsId = ''
|
||||
inTaskEntity.opNum = null
|
||||
}
|
||||
}
|
||||
}
|
||||
// 添加绑定关系
|
||||
const addBinding = () => {
|
||||
if (taskRequestEntity.vehicleId != '' && taskRequestEntity.vehicleId != inTaskEntity.vehicleId) {
|
||||
errorBox('请下发已绑定的任务或取消绑定后重试。')
|
||||
return
|
||||
}
|
||||
if (taskRequestEntity.vehicleId == '') {
|
||||
if (inTaskEntity.vehicleId == '') {
|
||||
errorBox('请输入箱号。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
}
|
||||
if (!inTaskEntity.emptyTask) {
|
||||
if (inTaskEntity.goodsId != '' && inTaskEntity.opNum != null && inTaskEntity.opNum > 0) {
|
||||
// 非空入库
|
||||
taskRequestEntity.goodsInfo.push({
|
||||
goodsId: inTaskEntity.goodsId,
|
||||
opNum: inTaskEntity.opNum
|
||||
})
|
||||
inTaskEntity.goodsId = ''
|
||||
inTaskEntity.opNum = null
|
||||
}
|
||||
}
|
||||
// 添加任务
|
||||
taskRequestEntity.emptyTask = inTaskEntity.emptyTask
|
||||
taskRequestEntity.vehicleId = inTaskEntity.vehicleId
|
||||
} else {
|
||||
if (!taskRequestEntity.emptyTask) {
|
||||
if (inTaskEntity.goodsId == '') {
|
||||
errorBox('请输入料号。')
|
||||
goodsId.value.focus()
|
||||
return
|
||||
}
|
||||
if (inTaskEntity.opNum == null || inTaskEntity.opNum == 0) {
|
||||
errorBox('请输入正确的数量。')
|
||||
opNum.value.focus()
|
||||
return
|
||||
}
|
||||
// 非空入库
|
||||
taskRequestEntity.goodsInfo.push({
|
||||
goodsId: inTaskEntity.goodsId,
|
||||
opNum: inTaskEntity.opNum
|
||||
})
|
||||
inTaskEntity.goodsId = ''
|
||||
inTaskEntity.opNum = null
|
||||
} else {
|
||||
// 空入库不允许多次下发
|
||||
errorBox('空入库不允许多次下发。')
|
||||
return
|
||||
}
|
||||
}
|
||||
goodsId.value.focus()
|
||||
}
|
||||
// 确认下发任务
|
||||
const confirmTasks = () => {
|
||||
// 判断是否是非空箱入库时,未输入料号和数量
|
||||
if (!taskRequestEntity.emptyTask && taskRequestEntity.goodsInfo.length == 0) {
|
||||
ElMessageBox.confirm(
|
||||
'非空箱入库未绑定物料,默认生成回库任务。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
confirmSend()
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
} else {
|
||||
confirmSend()
|
||||
}
|
||||
}
|
||||
const confirmSend = () => {
|
||||
let request = taskRequestEntity
|
||||
loading.open()
|
||||
requireStockIn(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
cancelBinding()
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
// 取消绑定
|
||||
const cancelBinding = () => {
|
||||
resetTaskEntity()
|
||||
inTaskEntity.vehicleId = ''
|
||||
vehicleId.value.focus()
|
||||
}
|
||||
// 移除当前行
|
||||
const removeThisRow = (row) => {
|
||||
taskRequestEntity.goodsInfo.splice(taskRequestEntity.goodsInfo.indexOf(row), 1)
|
||||
if (taskRequestEntity.goodsInfo.length == 0 && taskRequestEntity.vehicleId != '' && !taskRequestEntity.emptyTask) {
|
||||
// 非空箱且没有料号列表的情况下,解绑当前任务
|
||||
resetTaskEntity()
|
||||
}
|
||||
goodsId.value.focus()
|
||||
}
|
||||
// 重置任务
|
||||
const resetTaskEntity = () => {
|
||||
taskRequestEntity.emptyTask = false
|
||||
taskRequestEntity.vehicleId = ''
|
||||
taskRequestEntity.goodsInfo = []
|
||||
}
|
||||
// 打开入库料扫码
|
||||
const openOutForInDialog = () => {
|
||||
// 打开出库任务弹窗
|
||||
showInOutDialog.value = true
|
||||
nextTick(() => {
|
||||
// 聚焦
|
||||
forInGoodsId.value.focus()
|
||||
})
|
||||
}
|
||||
// 添加入库料
|
||||
const addForInGoods = () => {
|
||||
if (outForInEntity.goodsId == '') {
|
||||
errorBox('请输入料号。')
|
||||
} else {
|
||||
outForInEntity.goodsId = outForInEntity.goodsId.toUpperCase()
|
||||
outForInRequestEntity.goodsIds.push({
|
||||
goodsId: outForInEntity.goodsId
|
||||
})
|
||||
outForInEntity.goodsId = ''
|
||||
}
|
||||
// 表格自动滚动到最后
|
||||
// nextTick(() => {
|
||||
// outForInTableRef.value.scrollTo({
|
||||
// top: outForInTableRef.value.getScrollHeight(),
|
||||
// behavior: 'smooth'
|
||||
// })
|
||||
// })
|
||||
// 聚焦
|
||||
forInGoodsId.value.focus()
|
||||
}
|
||||
const popThisGoodsId = (row) => {
|
||||
outForInRequestEntity.goodsIds.splice(outForInRequestEntity.goodsIds.indexOf(row), 1)
|
||||
forInGoodsId.value.focus()
|
||||
}
|
||||
// 刷新入库料清单
|
||||
const refreshOuts = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.main-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.confirm-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 10px 5px 10px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 185px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
</style>
|
||||
470
src/layout/goodsInForPDA.vue
Normal file
470
src/layout/goodsInForPDA.vue
Normal file
|
|
@ -0,0 +1,470 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<fieldset class="input-area">
|
||||
<legend style="font-size: 25px;">入库界面</legend>
|
||||
<el-form ref="taskInRequestRef" :model="taskInRequestEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form-item label="是否入空托" prop="isEmpty">
|
||||
<el-select-v2 v-model="taskInRequestEntity.isEmpty" placeholder="请选择入库类型"
|
||||
:options="stockTypeOptions"
|
||||
@change="autoCompleteEmptyInfo(taskInRequestEntity)"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form-item label="箱号" prop="vehicleNo">
|
||||
<el-input v-model="taskInRequestEntity.vehicleNo" ref="vehicleNo" clearable
|
||||
v-on:keyup.tab="detectEndInputVehicleNo(taskInRequestEntity)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form-item label="零件号" prop="goodsId">
|
||||
<el-input v-model="taskInRequestEntity.goodsId" ref="goodsId" clearable
|
||||
:disabled="disabledEmpty" @blur="queryAndAutoComplete(taskInRequestEntity)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form-item label="零件名称" prop="goodsName">
|
||||
<el-input v-model="taskInRequestEntity.goodsName" clearable :disabled="disabledEmpty" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form-item label="零件数量" prop="goodsNum">
|
||||
<el-input-number v-model.number="taskInRequestEntity.goodsNum" ref="goodsNum" clearable
|
||||
:disabled="disabledEmpty" controls-position="right" :min="1"
|
||||
@blur="detectEndInputNum(taskInRequestEntity)"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form-item label="零件重量(千克)" prop="weight">
|
||||
<el-input v-model="taskInRequestEntity.weight" clearable :disabled="disabledEmpty" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1" v-show="disPlayDateFlag">
|
||||
<el-form-item label="有效期(年)" prop="shelfLife">
|
||||
<!-- // TODO 日期 -->
|
||||
<el-input v-model="taskInRequestEntity.shelfLife" clearable :disabled="disabledEmpty" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1" v-show="disPlayDateFlag">
|
||||
<el-form-item label="生产日期" prop="productionDate">
|
||||
<el-date-picker v-model="taskInRequestEntity.productionDate" ref="productionDate"
|
||||
:disabled="disabledEmpty" style="width: 100%;height: 75px;" type="date"
|
||||
placeholder="请选择生产日期" :editable="false" size="large" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-form-item>
|
||||
<el-button type="primary" round
|
||||
@click="addTempTasks(taskInRequestRef, taskInRequestEntity)">绑定信息</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item>
|
||||
<el-button type="warning" round
|
||||
@click="callEmptyVehicles(taskInRequestEntity)">请求空箱</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div ref="btnArea"></div>
|
||||
<fieldset class="display-area">
|
||||
<legend style="font-size: 25px;">
|
||||
入库暂存信息
|
||||
</legend>
|
||||
<el-table :data="tempTasks" stripe border class="table-class" max-height="684px"
|
||||
:header-cell-style="{ 'text-align': 'center', 'height': '100px' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="vehicleNo" label="箱号" fixed="left" min-width="1rem" />
|
||||
<el-table-column prop="goodsId" label="零件号" fixed="left" min-width="1rem" />
|
||||
<el-table-column prop="goodsNum" label="数量" min-width="1rem" />
|
||||
<el-table-column prop="goodsName" label="零件名称" min-width="1rem" />
|
||||
<el-table-column prop="weight" label="重量" min-width="1rem" />
|
||||
<el-table-column fixed="right" label="操作" min-width="1rem">
|
||||
<template #default>
|
||||
<el-button style="width: 1rem;" plain type="primary"
|
||||
@click="deleteRowTask(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-row :gutter="4">
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<el-button type="success" round
|
||||
@click="submitGoodsInTask(taskInRequestEntity)">下发任务</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</fieldset>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { sendGoodsInTask, callEmptyVehicle } from '@/api/task'
|
||||
import { queryPartInfoByPartNo } from '@/api/goods'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import UploadExcelPart from '@/excel/UploadExcelPart.vue'
|
||||
const taskInRequestRef = ref()
|
||||
const taskInRequestEntity = reactive({
|
||||
vehicleNo: '',// 载具号
|
||||
goodsId: '',// 零件号
|
||||
goodsName: '',// 零件名称
|
||||
goodsNum: 1,// 零件数量
|
||||
weight: 0,// 零件重量
|
||||
shelfLife: 0,// 有效期
|
||||
productionDate: '',// 生产日期
|
||||
isEmpty: '1',
|
||||
userName: store.getters.getUserName// 用户名
|
||||
})
|
||||
const rules = reactive({
|
||||
vehicleNo: [
|
||||
{ required: true, message: '请输入载具编号' }
|
||||
],
|
||||
goodsId: [
|
||||
{ required: true, message: '请输入物料编号' }
|
||||
],
|
||||
goodsNum: [
|
||||
{ required: true, message: '请输入数量' },
|
||||
{ type: 'number', message: '请输入数字' }
|
||||
]
|
||||
})
|
||||
const labelPosition = "top"
|
||||
const displayWidth = window.screen.width
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'goodsInPda',
|
||||
components: {
|
||||
UploadExcelPart
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tempTasks: [],
|
||||
tempVehicleNo: '',
|
||||
disPlayDateFlag: false,
|
||||
currentPartInfo: {},
|
||||
stockTypeOptions: [
|
||||
{
|
||||
value: '0',
|
||||
label: '空箱入库'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '带料入库'
|
||||
}
|
||||
],
|
||||
disabledEmpty: false,
|
||||
totalWeight: 0,
|
||||
isOverWeight: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.vehicleNo.focus()
|
||||
},
|
||||
methods: {
|
||||
// 查询
|
||||
queryAndAutoComplete(taskInRequestEntity) {
|
||||
this.loading = true
|
||||
const param = { material: taskInRequestEntity.goodsId }
|
||||
queryPartInfoByPartNo(param).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.code == 0) {
|
||||
this.currentPartInfo = res.data.returnData
|
||||
taskInRequestEntity.goodsName = this.currentPartInfo.itemDesc
|
||||
this.calWeight(taskInRequestEntity)
|
||||
if (this.currentPartInfo.SLED > 0) {// 判断生产日期区域显示与否
|
||||
this.disPlayDateFlag = true
|
||||
taskInRequestEntity.shelfLife = this.currentPartInfo.SLED
|
||||
} else {
|
||||
this.disPlayDateFlag = false
|
||||
taskInRequestEntity.shelfLife = 0
|
||||
taskInRequestEntity.productionDate = ''
|
||||
}
|
||||
taskInRequestEntity.goodsNum = ''
|
||||
this.$refs.goodsNum.focus()
|
||||
} else {
|
||||
taskInRequestEntity.goodsName = ''
|
||||
taskInRequestEntity.goodsNum = ''
|
||||
taskInRequestEntity.weight = 0
|
||||
this.disPlayDateFlag = false
|
||||
taskInRequestEntity.shelfLife = 0
|
||||
taskInRequestEntity.productionDate = ''
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
taskInRequestEntity.goodsName = ''
|
||||
taskInRequestEntity.goodsNum = ''
|
||||
taskInRequestEntity.weight = 0
|
||||
this.disPlayDateFlag = false
|
||||
taskInRequestEntity.shelfLife = 0
|
||||
taskInRequestEntity.productionDate = ''
|
||||
ElMessage.error('查询物料信息错误' + err.message)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
calWeight(taskInRequestEntity) {
|
||||
taskInRequestEntity.weight = this.currentPartInfo.partWeight * taskInRequestEntity.goodsNum
|
||||
this.totalWeight = this.totalWeight + taskInRequestEntity.weight
|
||||
if (this.totalWeight > 30) {
|
||||
this.isOverWeight = true
|
||||
ElMessage({
|
||||
message: '箱子重量超过30kg',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
},
|
||||
autoCompleteEmptyInfo(taskInRequestEntity) {// 自动补全空托入库信息
|
||||
if (taskInRequestEntity.isEmpty == '0') {// 空托入库
|
||||
taskInRequestEntity.goodsId = '000000000'
|
||||
taskInRequestEntity.batchNo = '000000000'
|
||||
taskInRequestEntity.goodsNum = 1
|
||||
taskInRequestEntity.weight = 0
|
||||
taskInRequestEntity.shelfLife = 0
|
||||
taskInRequestEntity.productionDate = ''
|
||||
taskInRequestEntity.goodsName = '空箱'
|
||||
this.currentPartInfo = {}
|
||||
this.disabledEmpty = true
|
||||
this.disPlayDateFlag = false
|
||||
} else {
|
||||
taskInRequestEntity.goodsId = ''
|
||||
taskInRequestEntity.batchNo = ''
|
||||
taskInRequestEntity.goodsNum = 1
|
||||
this.disabledEmpty = false
|
||||
}
|
||||
this.$refs.vehicleNo.focus()
|
||||
|
||||
},
|
||||
addTempTasks(formEl, formData) {// 生成入库任务
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (!valid) {
|
||||
ElMessage({
|
||||
message: '请输入必须的入库信息!',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.tempVehicleNo !== '' && this.tempVehicleNo !== formData.vehicleNo) {
|
||||
ElMessage({
|
||||
message: '载具编号不一致,请确认后重新输入!',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.tempVehicleNo != '' && formData.isEmpty == '0') {
|
||||
ElMessage({
|
||||
message: '此箱子已经绑定过,请下发。',
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.isOverWeight) {
|
||||
ElMessage({
|
||||
message: '已超重,不可继续绑定,请移除此物料,并下发任务',
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
this.tempVehicleNo = formData.vehicleNo
|
||||
formData.userName = store.getters.getUserName
|
||||
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == formData.goodsId)
|
||||
if (sameIndex != -1) {// 绑定过相同物料
|
||||
var sameGoods = this.tempTasks[sameIndex]
|
||||
sameGoods.goodsNum = sameGoods.goodsNum + formData.goodsNum
|
||||
sameGoods.weight = sameGoods.weight + formData.weight
|
||||
} else {
|
||||
this.tempTasks.push(Object.assign({}, formData))
|
||||
}
|
||||
this.resetFields(formData)
|
||||
formData.vehicleNo = this.tempVehicleNo
|
||||
ElMessage({
|
||||
message: '绑定成功!',
|
||||
type: 'success',
|
||||
})
|
||||
})
|
||||
},
|
||||
submitGoodsInTask(taskInRequestEntity) {// 下发入库任务
|
||||
if (this.tempTasks.length == 0) {
|
||||
ElMessage.error("未绑定任何信息")
|
||||
}
|
||||
sendGoodsInTask(this.tempTasks).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.tempTasks = []
|
||||
this.tempVehicleNo = ''
|
||||
this.resetFields(taskInRequestEntity)
|
||||
this.totalWeight = 0
|
||||
this.isOverWeight = false
|
||||
ElMessage({
|
||||
message: '下发任务成功,剩余库位可用数量: ' + res.data.returnData,
|
||||
type: 'success'
|
||||
})
|
||||
this.$refs.vehicleNo.focus()
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('创建入库任务错误!' + err.message)
|
||||
})
|
||||
},
|
||||
resetFields(taskInRequestEntity) {
|
||||
taskInRequestEntity.vehicleNo = ''
|
||||
if (taskInRequestEntity.isEmpty != '0') {// 不是空托入库
|
||||
taskInRequestEntity.goodsId = ''
|
||||
taskInRequestEntity.goodsName = ''
|
||||
taskInRequestEntity.goodsNum = 1
|
||||
taskInRequestEntity.weight = 0
|
||||
taskInRequestEntity.shelfLife = 0
|
||||
taskInRequestEntity.productionDate = ''
|
||||
}
|
||||
this.disPlayDateFlag = false
|
||||
this.currentPartInfo = {}
|
||||
},
|
||||
callEmptyVehicles(taskInRequestEntity) {
|
||||
callEmptyVehicle(taskInRequestEntity).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: res.data.message,
|
||||
type: 'success'
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('呼叫空箱错误' + err.message)
|
||||
})
|
||||
},
|
||||
deleteRowTask(row) {// 删除当前行的入库任务
|
||||
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
|
||||
if (this.tempTasks.length == 0) {
|
||||
this.tempVehicleNo = ''
|
||||
}
|
||||
},
|
||||
detectEndInputVehicleNo(taskInRequestEntity) {
|
||||
if (taskInRequestEntity.isEmpty == '0') {// 空托入库
|
||||
this.$refs.btnArea.scrollIntoView();
|
||||
// this.$refs.vehicleNo.blur()
|
||||
} else {
|
||||
this.$refs.goodsId.focus()
|
||||
}
|
||||
},
|
||||
detectEndInputNum(taskInRequestEntity) {
|
||||
this.calWeight(taskInRequestEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: v-bind(displayWidth);
|
||||
}
|
||||
|
||||
.el-row {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
font-size: 25px;
|
||||
/* margin: 10px; */
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
:deep(.el-select-v2__placeholder) {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
:deep(.el-select-v2__wrapper) {
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
:deep(.el-form-item .el-input) {
|
||||
height: 80px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
:deep(.el-form-item .el-input-number) {
|
||||
height: 80px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
:deep(.el-table .cell) {
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
width: 180px;
|
||||
height: 60px;
|
||||
margin: auto;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.input-area {
|
||||
margin: 10px;
|
||||
width: v-bind(displayWidth) - 20px;
|
||||
/* height: 730px; */
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.display-area {
|
||||
margin: 10px;
|
||||
width: v-bind(displayWidth) - 20px;
|
||||
/* height: auto; */
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
font-size: 1rem;
|
||||
}
|
||||
</style>
|
||||
351
src/layout/goodsOut.vue
Normal file
351
src/layout/goodsOut.vue
Normal file
|
|
@ -0,0 +1,351 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="outTaskRef" :model="outTaskEntity" :label-position="labelPosition" label-width="158px"
|
||||
style="max-width: 100%" :rules="requestRules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="出库类型" prop="outType">
|
||||
<el-select-v2 v-model="outTaskEntity.outType" placeholder="请选择入库类型"
|
||||
:options="outTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="outTaskEntity.goodsId" ref="goodsId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="outTaskEntity.vehicleId" ref="vehicleId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="needNum">
|
||||
<el-input-number v-model.number="outTaskEntity.needNum" ref="needNum"
|
||||
controls-position="right" :min="1" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="primary"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmOut()">确认出库</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="clearInput()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="confirm-area">
|
||||
<el-form ref="confirmRef" :model="confirmEntity" :label-position="labelPosition" label-width="158px"
|
||||
style="max-width: 100%" :rules="confirmRules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-row style="border-bottom: dashed 1px black;">
|
||||
<el-form-item label="出库类型" prop="outType">
|
||||
<el-select-v2 v-model="confirmEntity.outType" placeholder=" "
|
||||
:options="outTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="goodsId">
|
||||
<el-input v-model="confirmEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="总需求" prop="totalNeed">
|
||||
<el-input v-model="confirmEntity.totalNeed" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="剩余需求" prop="remainNeed">
|
||||
<el-input v-model="confirmEntity.remainNeed" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="本次计划拣选" prop="planPickQty">
|
||||
<el-input v-model="confirmEntity.planPickQty" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="本次实际拣选" prop="realPickQty">
|
||||
<el-input-number v-model.number="confirmEntity.realPickQty"
|
||||
controls-position="right" :min="0" clearable @change="changePlanQty()" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="confirmEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划剩余数量" prop="planRemainQty">
|
||||
<el-input v-model="confirmEntity.planRemainQty" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际剩余数量" prop="realRemainQty">
|
||||
<el-input-number v-model.number="confirmEntity.realRemainQty"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmOrRelease()">确认/放行</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { requireStockOut, getCurrentTask, confirmCurrentTask } from '@/api/task.js'
|
||||
import { errorBox, warningBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { loading } from '@/utils/loading'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'goodsOut',
|
||||
data() {
|
||||
return {
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName,
|
||||
timer: '',
|
||||
labelPosition: 'top',
|
||||
outTaskRef: ref(),
|
||||
outTaskEntity: reactive({
|
||||
outType: 9,
|
||||
goodsId: '',
|
||||
vehicleId: '',
|
||||
needNum: null
|
||||
}),
|
||||
requestRules: reactive({
|
||||
outType: [
|
||||
{ required: true, message: '请选择入库类型' }
|
||||
],
|
||||
needNum: [
|
||||
{ required: true, message: '请输入数量' },
|
||||
{ type: 'number', message: '请输入数字值' }
|
||||
],
|
||||
}),
|
||||
outTypeOptions: [
|
||||
{
|
||||
label: '空箱出库',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '紧急出库',
|
||||
value: 9
|
||||
}
|
||||
],
|
||||
confirmRef: ref(),
|
||||
confirmEntity: reactive({}),
|
||||
confirmRules: reactive({}),
|
||||
pauseGetPickFlag: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.timer = setInterval(() => {
|
||||
this.getTask()
|
||||
}, 1000)
|
||||
})
|
||||
},
|
||||
beforeUnmount() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 清除输入
|
||||
clearInput() {
|
||||
this.outTaskEntity = reactive({
|
||||
outType: 9,
|
||||
goodsId: '',
|
||||
vehicleId: '',
|
||||
needNum: null
|
||||
})
|
||||
},
|
||||
// 确认出库
|
||||
confirmOut() {
|
||||
if (this.outTaskEntity.needNum == null) {
|
||||
errorBox('请输入正确的数量。')
|
||||
return
|
||||
}
|
||||
if (this.outTaskEntity.outType != 1) {
|
||||
if (this.outTaskEntity.goodsId == '') {
|
||||
errorBox('非空箱出库时,请输入料号。')
|
||||
return
|
||||
}
|
||||
}
|
||||
const request = {
|
||||
outType: this.outTaskEntity.outType,
|
||||
goodsId: this.outTaskEntity.goodsId,
|
||||
vehicleId: this.outTaskEntity.vehicleId,
|
||||
needNum: this.outTaskEntity.needNum,
|
||||
destination: this.standId,
|
||||
userName: this.userName,
|
||||
standId: this.standId
|
||||
}
|
||||
loading.open('请求中,请稍等...')
|
||||
requireStockOut(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
// 成功
|
||||
ElMessage.success(response.message)
|
||||
this.clearInput()
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
// 获取拣选信息
|
||||
getTask() {
|
||||
if (this.pauseGetPickFlag) {
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
standId: this.standId,
|
||||
userName: this.userName
|
||||
}
|
||||
// 获取当前拣选信息
|
||||
getCurrentTask(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const confirmVo = response.data
|
||||
// 设置form
|
||||
this.confirmEntity = {
|
||||
taskId: confirmVo.taskConfirm.taskId,
|
||||
outType: confirmVo.taskConfirm.outType,
|
||||
goodsId: confirmVo.taskConfirm.goodsId,
|
||||
totalNeed: confirmVo.taskConfirm.totalNeed,
|
||||
remainNeed: confirmVo.taskConfirm.remainNeed,
|
||||
planPickQty: confirmVo.taskConfirm.planPickQty,
|
||||
realPickQty: confirmVo.taskConfirm.realPickQty,
|
||||
stockId: confirmVo.stockConfirm.stockId,
|
||||
vehicleId: confirmVo.stockConfirm.vehicleId,
|
||||
planRemainQty: confirmVo.stockConfirm.planRemainQty,
|
||||
realRemainQty: confirmVo.stockConfirm.realRemainQty,
|
||||
isOut: confirmVo.stockConfirm.isOut,
|
||||
putArea: confirmVo.stockConfirm.putArea,
|
||||
warningQty: confirmVo.stockConfirm.warningQty
|
||||
}
|
||||
this.pauseGetPickFlag = true
|
||||
// 如果剩余数量低于预警值,弹框报警
|
||||
if (this.confirmEntity.isOut == 0 && this.confirmEntity.planRemainQty <= this.confirmEntity.warningQty) {
|
||||
warningBox('剩余数量低于预警值,请清点库存数量。')
|
||||
}
|
||||
} else if (response.code == 400) {
|
||||
// 警告,弹框
|
||||
this.pauseGetPickFlag = true
|
||||
warningBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.pauseGetPickFlag = true
|
||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||
})
|
||||
},
|
||||
// 确认/放行
|
||||
confirmOrRelease() {
|
||||
// 确认放行---与配料工作区分开来
|
||||
const request = {
|
||||
taskConfirm: {
|
||||
taskId: this.confirmEntity.taskId,
|
||||
outType: this.confirmEntity.outType,
|
||||
goodsId: this.confirmEntity.goodsId,
|
||||
totalNeed: this.confirmEntity.totalNeed,
|
||||
remainNeed: this.confirmEntity.remainNeed,
|
||||
planPickQty: this.confirmEntity.planPickQty,
|
||||
realPickQty: this.confirmEntity.realPickQty,
|
||||
},
|
||||
stockConfirm: {
|
||||
stockId: this.confirmEntity.stockId,
|
||||
vehicleId: this.confirmEntity.vehicleId,
|
||||
goodsId: this.confirmEntity.goodsId,
|
||||
planRemainQty: this.confirmEntity.planRemainQty,
|
||||
realRemainQty: this.confirmEntity.realRemainQty,
|
||||
isOut: this.confirmEntity.isOut,
|
||||
putArea: this.confirmEntity.putArea,
|
||||
},
|
||||
standId: this.standId,
|
||||
userName: this.userName
|
||||
}
|
||||
confirmCurrentTask(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
// 设置form
|
||||
this.confirmEntity = reactive({})
|
||||
this.pauseGetPickFlag = false
|
||||
ElMessage.success(response.message)
|
||||
} else if (response.code == 400) {
|
||||
this.pauseGetPickFlag = false
|
||||
warningBox(response.message)
|
||||
} else {
|
||||
// 错误,弹框
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||
})
|
||||
},
|
||||
// 当拣选数量修改时,要对应的修改
|
||||
changePlanQty() {
|
||||
if (this.confirmEntity.isOut == 0 && this.confirmEntity.realPickQty != this.confirmEntity.planPickQty) {
|
||||
// 修正量
|
||||
const changeQty = this.confirmEntity.realPickQty - this.confirmEntity.planPickQty
|
||||
// 修正实际剩余数量
|
||||
this.confirmEntity.realRemainQty = this.confirmEntity.planRemainQty + changeQty
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.confirm-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 10px 5px 10px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
</style>
|
||||
90
src/layout/imageDisplay.vue
Normal file
90
src/layout/imageDisplay.vue
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<template>
|
||||
<!-- 图纸展示 -->
|
||||
<div class="content">
|
||||
<el-image class="image-full" :src="imageData.base64" :fit="fit">
|
||||
<template #error>
|
||||
<div class="error-slot">
|
||||
{{ imageData.errMsg }}
|
||||
</div>
|
||||
</template>
|
||||
</el-image>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
// 导入
|
||||
import store from '@/store'
|
||||
import { getImageOfWork } from '@/api/kateWork.js'
|
||||
import { onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
||||
// 声明变量
|
||||
let timer = ref()
|
||||
const standId = store.getters.getStandId
|
||||
const userName = store.getters.getUserName
|
||||
const fit = 'contain'
|
||||
let imageData = reactive({
|
||||
url: '',
|
||||
base64: '',
|
||||
name: '',
|
||||
errMsg: ''
|
||||
})
|
||||
// 声明系统方法
|
||||
onMounted(() => {
|
||||
// findImage()
|
||||
timer.value = setInterval(() => {
|
||||
findImage()
|
||||
}, 1000)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(timer.value)
|
||||
})
|
||||
// 声明自定义方法
|
||||
// 查询图纸
|
||||
const findImage = () => {
|
||||
const request = {
|
||||
standId: standId,
|
||||
userName: userName
|
||||
}
|
||||
getImageOfWork(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const image = response.data
|
||||
openPreview(image)
|
||||
} else {
|
||||
closePreview(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
closePreview("发生异常,请刷新界面并重试。")
|
||||
})
|
||||
}
|
||||
// 打开图纸
|
||||
const openPreview = (image) => {
|
||||
imageData.url = image.imageIp + image.imagePath + image.imageName
|
||||
imageData.base64 = 'data:image/png;base64,' + image.imageDetail
|
||||
imageData.name = image.imageName
|
||||
imageData.errMsg = ''
|
||||
}
|
||||
// 关闭图纸
|
||||
const closePreview = (errMsg) => {
|
||||
imageData.url = ''
|
||||
imageData.base64 = ''
|
||||
imageData.name = ''
|
||||
imageData.errMsg = errMsg
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.image-full {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.image-full .error-slot {
|
||||
color: red;
|
||||
font-size: 50px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
95
src/layout/imageTable.vue
Normal file
95
src/layout/imageTable.vue
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<template>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="productIdQuery" style="width: 196px; margin-right: 10px;" placeholder="成品号" />
|
||||
<el-input v-model="boxNoQuery" style="width: 196px; margin-right: 10px;" placeholder="料盒号" />
|
||||
<el-button type="primary" @click="init()">搜索</el-button>
|
||||
<!-- <el-button type="warning" @click="reset()">重置</el-button> -->
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table :data="datalist" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
highlight-current-row :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="productId" label="成品号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="boxNo" label="料盒号" fixed="left" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="openPreview(scope.row)">预览</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 图片预览 -->
|
||||
<el-image-viewer v-if="showImagePreview" :zoom-rate="1.2" @close="closePreview" :url-list="imgPreviewList" />
|
||||
</template>
|
||||
<script setup>
|
||||
import axios from 'axios'
|
||||
// import store from '@/store'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'imageTable',
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
datalist: [],
|
||||
showImagePreview: false,
|
||||
imgPreviewList: [],
|
||||
currentBase64FileData: {
|
||||
url: '',
|
||||
base64: '',
|
||||
name: ''
|
||||
},
|
||||
request: axios.create({
|
||||
baseURL: 'https://s4wwjasrsp01.ap.cat.com/wmsServer/test',
|
||||
timeout: 10000
|
||||
}),
|
||||
productIdQuery: '',
|
||||
boxNoQuery: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
productId: this.productIdQuery,
|
||||
boxNo: this.boxNoQuery,
|
||||
// userName: store.getters.getUserName
|
||||
}
|
||||
this.request({
|
||||
url: '/testRequestImage',
|
||||
method: 'post',
|
||||
data: request
|
||||
}).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
this.datalist = response.data
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
openPreview(row) {
|
||||
this.currentBase64FileData.url = 'http://localhost:12315/image/' + row.imageName
|
||||
this.currentBase64FileData.base64 = 'data:image/png;base64,' + row.imageDetail
|
||||
this.currentBase64FileData.name = row.imageName
|
||||
this.showImagePreview = true
|
||||
// 下面数组里可以放一个url,如'https://raw.githubusercontent.com/JACK-ZHANG-coming/map-depot/master/2023image-20231120091054028.png',我这里放的是一个base64数据,也可以用来显示图片
|
||||
this.imgPreviewList = [this.currentBase64FileData.base64]
|
||||
// this.imgPreviewList = [this.currentBase64FileData.url]
|
||||
},
|
||||
closePreview() {
|
||||
this.imgPreviewList = []
|
||||
this.showImagePreview = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
193
src/layout/inTaskRecord.vue
Normal file
193
src/layout/inTaskRecord.vue
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 15px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" />
|
||||
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择创建日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-date-picker v-model="finishTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="success" @click="exportExcel()">导出记录</el-button>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getTaskRecords } from '@/api/record.js'
|
||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { downloadInRecordExcel } from '@/api/excel.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'inTaskRecord',
|
||||
data() {
|
||||
return {
|
||||
tasks: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
loading: true,
|
||||
createTimeQuery: null,
|
||||
finishTimeQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1: return '入库'
|
||||
case 2: return '出库'
|
||||
case 3: return '盘点'
|
||||
case 9: return '移库'
|
||||
default: return '未知'
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
taskType: 1,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
finishTime: timeFormatter(this.finishTimeQuery),
|
||||
}
|
||||
getTaskRecords(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.tasks = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询任务记录错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
this.createTimeQuery = null
|
||||
this.finishTimeQuery = null
|
||||
this.search()
|
||||
},
|
||||
exportExcel() {
|
||||
const params = {
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
finishTime: timeFormatter(this.finishTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadInRecordExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "导出入库记录" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
401
src/layout/inventory.vue
Normal file
401
src/layout/inventory.vue
Normal file
|
|
@ -0,0 +1,401 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="title-area">
|
||||
<legend>
|
||||
工作台
|
||||
</legend>
|
||||
<div class="title-div">
|
||||
<span class="title-text">物料盘点</span>
|
||||
</div>
|
||||
<div class="station-div">
|
||||
<span class="station-text">工作站:</span>
|
||||
</div>
|
||||
<div class="station-no-div">
|
||||
<span class="station-no-text">{{ standId }}</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="main-area">
|
||||
<legend>
|
||||
物料盘点
|
||||
</legend>
|
||||
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
|
||||
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex;">
|
||||
<div style="display: block; margin: 5px;">
|
||||
<!-- <div
|
||||
style="display: inline-flex; justify-content: center; height: 60px; width: 655px; margin: 5px; padding: 5px;">
|
||||
<UploadExcelPart></UploadExcelPart>
|
||||
</div> -->
|
||||
<div style="height: 50px; margin-bottom: 20px"><UploadExcelInventoryList></UploadExcelInventoryList></div>
|
||||
<div
|
||||
style="display: inline-flex; justify-content: center; height: 40px; width: 655px; margin: 5px; padding: 5px; background-color: #00AAE8;">
|
||||
<span style="align-self: center; font-weight: bold;font-size: 25px;">
|
||||
{{ workFormEntity.tip }}
|
||||
</span>
|
||||
</div>
|
||||
<div style="display: flex;">
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<div class="display-title-div">
|
||||
<span class="display-title-text">料号</span>
|
||||
</div>
|
||||
<div class="display-form-div">
|
||||
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
|
||||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<div class="display-title-div">
|
||||
<span class="display-title-text">箱号</span>
|
||||
</div>
|
||||
<div class="display-form-div">
|
||||
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId"
|
||||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<div class="display-title-div">
|
||||
<span class="display-title-text">实物数量</span>
|
||||
</div>
|
||||
<div style="display: flex; margin-top: 20px;">
|
||||
<div class="display-form-div-left">
|
||||
<el-input-number v-model.number="workFormEntity.realNum" ref="realNum"
|
||||
controls-position="right" :min="0" />
|
||||
</div>
|
||||
<div class="display-form-div-right">
|
||||
<span class="display-form-text-right">PC</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin: 10px;">
|
||||
<div class="arrow" @click="confirmTask()">
|
||||
<span
|
||||
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import UploadExcelInventoryList from '@/excel/UploadExcelProduct.vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'inventory',
|
||||
data() {
|
||||
return {
|
||||
standId: store.getters.getStandId,
|
||||
timer: '',
|
||||
labelPosition: 'top',
|
||||
workFormRef: ref(),
|
||||
workFormEntity: reactive({
|
||||
goodsId: '',
|
||||
planPickNum: 0,
|
||||
remainNumOrigin: null,
|
||||
remainNumReal: null,
|
||||
remark: '',
|
||||
finishedRows: 0,
|
||||
totalRows: 0,
|
||||
finishedCounts: 0,
|
||||
totalCounts: 0,
|
||||
tip: ''
|
||||
}),
|
||||
rules: reactive({
|
||||
goodsId: [
|
||||
{ required: true, message: '请输入料号' }
|
||||
]
|
||||
}),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.goodsId.focus()
|
||||
this.timer = setInterval(() => {
|
||||
this.queryFinish()
|
||||
}, 2000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 获取当前工作信息
|
||||
getCurrentWorkInfo() {
|
||||
const request = {
|
||||
standId: this.standId,
|
||||
goodsId: this.workFormEntity.goodsId
|
||||
}
|
||||
getWorkByStandAndGoods(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
this.workFormEntity.goodsId = response.returnData.goodsId
|
||||
this.workFormEntity.planPickNum = response.returnData.planPickNum
|
||||
this.workFormEntity.remainNumOrigin = response.returnData.remainNumOrigin
|
||||
this.workFormEntity.remainNumReal = response.returnData.remainNumReal
|
||||
this.workFormEntity.remark = response.returnData.remark
|
||||
this.workFormEntity.finishedRows = response.returnData.finishedRows
|
||||
this.workFormEntity.totalRows = response.returnData.totalRows
|
||||
this.workFormEntity.finishedCounts = response.returnData.finishedCounts
|
||||
this.workFormEntity.totalCounts = response.returnData.totalCounts
|
||||
this.workFormEntity.tip = response.returnData.tip
|
||||
} else {
|
||||
this.resetForms()
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.resetForms()
|
||||
errorBox('查询工作信息错误')
|
||||
})
|
||||
},
|
||||
// 查询是否完成
|
||||
queryFinish() {
|
||||
if (this.workFormEntity.goodsId == '') {
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
standId: this.standId,
|
||||
goodsId: this.workFormEntity.goodsId
|
||||
}
|
||||
queryFinishByStandAndGoods(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.returnData != null) {
|
||||
this.workFormEntity.tip = response.returnData.tip
|
||||
}
|
||||
this.resetForms()
|
||||
ElMessage.success(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
// 重置参数
|
||||
resetForms() {
|
||||
this.workFormEntity = reactive({
|
||||
goodsId: '',
|
||||
planPickNum: 0,
|
||||
remainNumOrigin: null,
|
||||
remainNumReal: null,
|
||||
remark: '',
|
||||
finishedRows: 0,
|
||||
totalRows: 0,
|
||||
finishedCounts: 0,
|
||||
totalCounts: 0,
|
||||
tip: ''
|
||||
})
|
||||
this.$refs.goodsId.focus()
|
||||
},
|
||||
// 确认完成工作
|
||||
confirmTask() {
|
||||
if (this.standId == '' || this.workFormEntity.goodsId == '') {
|
||||
errorBox('站台号和料号不可缺少')
|
||||
return
|
||||
}
|
||||
const confirmParams = {
|
||||
standId: this.standId,
|
||||
goodsId: this.workFormEntity.goodsId,
|
||||
remainNumOrigin: this.workFormEntity.remainNumOrigin,
|
||||
remainNumReal: this.workFormEntity.remainNumReal
|
||||
}
|
||||
confirmFinishWork(confirmParams).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.returnData != null) {
|
||||
this.workFormEntity.tip = response.returnData.tip
|
||||
}
|
||||
this.resetForms()
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('确认时发生异常')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.main-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: 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;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
background: linear-gradient(-105deg,
|
||||
transparent 50%,
|
||||
#309330 50%,
|
||||
#309330 100%) top right,
|
||||
linear-gradient(-75deg,
|
||||
transparent 50%,
|
||||
#309330 50%,
|
||||
#309330 100%) bottom right;
|
||||
background-size: 100% 50%;
|
||||
height: 400px;
|
||||
width: 250px;
|
||||
background-repeat: no-repeat;
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.el-input) {
|
||||
width: 195px;
|
||||
height: 130px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
:deep(.el-input-number) {
|
||||
width: 125px;
|
||||
height: 130px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
/* :deep(.el-input .el-input__inner) {
|
||||
font-size: 60px;
|
||||
height: 130px;
|
||||
}
|
||||
|
||||
:deep(.el-input-number .el-input__inner) {
|
||||
font-size: 60px;
|
||||
height: 130px;
|
||||
} */
|
||||
|
||||
.title-div {
|
||||
display: inline-flex;
|
||||
width: -webkit-fill-available;
|
||||
margin-right: 5px;
|
||||
padding: 5px;
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
align-self: center;
|
||||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.station-div {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 150px;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
padding: 5px;
|
||||
background-color: #FFFAAA;
|
||||
}
|
||||
|
||||
.station-text {
|
||||
align-self: center;
|
||||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.station-no-div {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 200px;
|
||||
padding: 5px;
|
||||
border: 5px double #000000;
|
||||
}
|
||||
|
||||
.station-no-text {
|
||||
align-self: center;
|
||||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.display-title-div {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 205px;
|
||||
height: 80px;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
background-color: #FFFAAA;
|
||||
}
|
||||
|
||||
.display-title-text {
|
||||
align-self: center;
|
||||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.display-form-div {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 195px;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
border: 5px double #000000;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.display-form-div-left {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 125px;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
border: 5px double #000000;
|
||||
}
|
||||
|
||||
.display-form-div-right {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
|
||||
.display-form-text-right {
|
||||
align-self: center;
|
||||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
}
|
||||
</style>
|
||||
152
src/layout/inventoryRecord.vue
Normal file
152
src/layout/inventoryRecord.vue
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
|
||||
<template>
|
||||
<div style="margin-bottom: 15px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="零件号" />
|
||||
<el-input v-model="vehicleNoQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="success" @click="refresh()">刷新</el-button>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" label="零件号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="vehicleNo" label="箱号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="goodsName" label="零件名称" min-width="120px" />
|
||||
<el-table-column prop="taskType" label="任务类型" :formatter="taskTypeFormat" sortable min-width="120px" />
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||
<el-table-column prop="pickStand" label="拣选站台" min-width="120px" />
|
||||
<el-table-column prop="weight" label="重量" min-width="120px" />
|
||||
<el-table-column prop="productionDate" label="生产日期" :formatter="dateFormat" min-width="120px" />
|
||||
<el-table-column prop="expirationDate" label="有效日期" :formatter="dateFormat" min-width="120px" />
|
||||
<el-table-column prop="operateNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="totalNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="taskPriority" label="任务优先级" sortable min-width="120px" />
|
||||
<el-table-column prop="kateTaskId" label="配件任务号" sortable min-width="140px" />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column prop="finishTime" label="任务完成时间" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat" min-width="120px" />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="180px">
|
||||
<template v-slot="scope">
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" title="请确认是否取消任务?" :hide-after="10" @confirm="">
|
||||
<template #reference>
|
||||
<el-button plain type="warning">取消</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" title="请确认是否完成任务?" :hide-after="10" @confirm="">
|
||||
<template #reference>
|
||||
<el-button plain type="primary">完成</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getTaskRecords } from '@/api/record.js'
|
||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import store from '@/store'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'inventoryRecord',
|
||||
data() {
|
||||
return {
|
||||
pageInfo: {},
|
||||
tasks: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleNoQuery: '',
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1: return '入库'
|
||||
case 2: return '出库'
|
||||
case 3: return '盘点'
|
||||
default: return '未知'
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
this.pageInfo.pageNum = this.currentPage
|
||||
this.pageInfo.pageSize = this.pageSize
|
||||
const tableRequest = {
|
||||
page: this.pageInfo,
|
||||
param: {
|
||||
taskType: 3,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleNo: this.vehicleNoQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
getTaskRecords(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.tasks = tableResponse.rows
|
||||
this.total = tableResponse.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询盘点记录错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleNoQuery = ''
|
||||
this.search()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
388
src/layout/kateOrdersTable.vue
Normal file
388
src/layout/kateOrdersTable.vue
Normal file
|
|
@ -0,0 +1,388 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||
<el-table-column prop="description" label="描述" min-width="120px" show-overflow-tooltip />
|
||||
<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" show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowOrders(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="工单信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="id" prop="orderId">
|
||||
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单" prop="workOrder">
|
||||
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="小工位" prop="supplyArea">
|
||||
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="orderStatus">
|
||||
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||
controls-position="right" :min="0" :max="4" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已拣数量" prop="pickedQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>上次更新</legend>
|
||||
<div style="padding: 5px;">
|
||||
<div style="display: flex; margin-bottom: 10px;">
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 30%; align-content: center;">时间:</div>
|
||||
<el-input v-model="uploadRecord.uploadTime" readonly />
|
||||
</div>
|
||||
<div style="display: flex; width: 100%; margin-left: 5px;">
|
||||
<div style="width: 30%; align-content: center;">人员:</div>
|
||||
<el-input v-model="uploadRecord.uploadUser" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 13%; align-content: center;">文件名:</div>
|
||||
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="title-area">
|
||||
<legend>再次更新</legend>
|
||||
<UploadExcelOrders></UploadExcelOrders>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getOrders, deleteOrders, updateOrders } from '@/api/kateWork.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { queryUploadRecord } from '@/api/excel.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询工单错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
this.ordersFormEntity = {
|
||||
orderId: row.orderId,
|
||||
workOrder: row.workOrder,
|
||||
goodsId: row.goodsId,
|
||||
supplyArea: row.supplyArea,
|
||||
requirementQuantity: row.requirementQuantity,
|
||||
orderStatus: row.orderStatus,
|
||||
lackQuantity: row.lackQuantity,
|
||||
pickedQuantity: row.pickedQuantity
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除工单信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除工单信息成功')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
submitOrdersInfo(formData) {
|
||||
const params = {
|
||||
orderId: formData.orderId,
|
||||
workOrder: formData.workOrder,
|
||||
goodsId: formData.goodsId,
|
||||
supplyArea: formData.supplyArea,
|
||||
requirementQuantity: formData.requirementQuantity,
|
||||
orderStatus: formData.orderStatus,
|
||||
lackQuantity: formData.lackQuantity,
|
||||
pickedQuantity: formData.pickedQuantity,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新工单成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新工单失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.orderId = row.orderId
|
||||
},
|
||||
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)
|
||||
errorBox('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
649
src/layout/kitting.vue
Normal file
649
src/layout/kitting.vue
Normal file
|
|
@ -0,0 +1,649 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="main-area">
|
||||
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="计划开工日期" prop="planStartDate">
|
||||
<el-date-picker v-model="workFormEntity.planStartDate" type="date"
|
||||
placeholder="选择开工日期" :shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单号" prop="workOrder">
|
||||
<el-select v-model="workFormEntity.workOrder" filterable default-first-option
|
||||
placeholder="请选择工单号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.workOrder = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.workOrder" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="成品号" prop="productId">
|
||||
<el-select v-model="workFormEntity.productId" filterable default-first-option
|
||||
placeholder="请选择成品号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.productId = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.productId" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号" prop="singleProductId">
|
||||
<el-select v-model="workFormEntity.singleProductId" filterable default-first-option
|
||||
placeholder="请选择单片号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.singleProductId = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.singleProductId" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="料盒号" prop="boxNo">
|
||||
<el-select v-model="workFormEntity.boxNo" filterable default-first-option
|
||||
placeholder="请选择料盒号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.boxNo = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.boxNo" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原材料号" prop="goodsId">
|
||||
<el-select v-model="workFormEntity.goodsId" filterable default-first-option
|
||||
placeholder="请选择原材料号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.goodsId = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.goodsId" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmStart()">确认配料</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="resetWorkFormQuery()">清除选择</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="confirm-area">
|
||||
<el-form ref="confirmRef" :model="confirmEntity" :label-position="labelPosition" label-width="158px"
|
||||
style="max-width: 100%" :rules="confirmRules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-row style="border-bottom: dashed 1px black;">
|
||||
<el-form-item label="工单号" prop="workOrder">
|
||||
<el-input v-model="confirmEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品号" prop="productId">
|
||||
<el-input v-model="confirmEntity.productId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号" prop="singleProductId">
|
||||
<el-input v-model="confirmEntity.singleProductId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="goodsId">
|
||||
<el-input v-model="confirmEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="料盒号" prop="boxNo">
|
||||
<el-input v-model="confirmEntity.boxNo" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划拣选数量" prop="planPickQty">
|
||||
<el-input v-model="confirmEntity.planPickQty" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际拣选数量" prop="realPickQty">
|
||||
<el-input-number v-model.number="confirmEntity.realPickQty"
|
||||
controls-position="right" :min="0" clearable @change="changePlanQty()" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="confirmEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="存放区域" prop="putArea">
|
||||
<el-input v-model="confirmEntity.putArea" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划剩余数量" prop="planRemainQty" v-if="confirmEntity.isOut != 1">
|
||||
<el-input v-model="confirmEntity.planRemainQty" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际剩余数量" prop="realRemainQty" v-if="confirmEntity.isOut != 1">
|
||||
<el-input-number v-model.number="confirmEntity.realRemainQty"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="primary"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="showBoxSummary()">显示料盒</el-button>
|
||||
<el-button type="success" ref="confirmReleaseBtn"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmOrRelease()">确认/放行</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="requestPrint()">打印标签</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<el-dialog v-model="boxShowFlag" title="料盒总览" width="50%" center :close="closeBoxSummary">
|
||||
<span>料盒信息</span>
|
||||
<el-table :data="boxSummary" stripe border class="table-class" max-height="200px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="workOrder" label="工单号" fixed="left" />
|
||||
<el-table-column prop="productId" label="总成号" />
|
||||
<el-table-column prop="singleProductId" label="成品/单片" />
|
||||
<el-table-column prop="boxNo" label="料盒号" />
|
||||
<el-table-column prop="boxQty" label="料盒数量" />
|
||||
</el-table>
|
||||
<span>缺料信息</span>
|
||||
<el-table :data="goodsLackSummary" stripe border class="table-class" max-height="450px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" label="料号" fixed="left" />
|
||||
<el-table-column prop="needNum" label="需求数量" />
|
||||
<el-table-column prop="stockNum" label="库存数量" />
|
||||
<el-table-column prop="lackNum" label="缺料数量" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<div style="width: 0;height: 0;overflow: hidden">
|
||||
<button ref="printBtn" style="display: none;" v-print="printObj"></button>
|
||||
<div id="printArea" class="objectDialogFlowPrint">
|
||||
<div class="pageWarp" v-for="item in printTabs">
|
||||
<div class="print-tab-text">
|
||||
<div class="print-row-normal">工单:{{ item.workOrder }}</div>
|
||||
<div class="print-row-normal">总成:{{ item.productId }}</div>
|
||||
<div class="print-row-normal">单片:{{ item.singleProductId }}</div>
|
||||
<div class="print-row-normal">配料:{{ item.kittingDate }}</div>
|
||||
</div>
|
||||
<div class="print-tab-text">
|
||||
<div class="print-row-normal">测试台:{{ item.testNo }}</div>
|
||||
<div class="print-row-normal">产量:{{ item.productionQty }}</div>
|
||||
<div class="print-row-normal">料盒号:{{ item.boxNo }}</div>
|
||||
<div class="print-row-normal">生产:{{ item.produceDate }}</div>
|
||||
</div>
|
||||
<div class="print-tab-image">
|
||||
<qrcode-vue
|
||||
:value="item.singleProductId == '' ? item.productId + '&' + item.boxNo : item.singleProductId + '&' + item.boxNo"
|
||||
:size="size" :foreground="color" level="H" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { queryKateWorks, initWorks, getCurrentWorks, confirmCurrentWork, getBoxesAndLacks } from '@/api/kateWork.js'
|
||||
import { errorBox, warningBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { dateFormatter } from '@/utils/formatter.js'
|
||||
import { nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { printObj, labelPosition, shortcuts } from '@/constant/form'
|
||||
import { loading } from '@/utils/loading'
|
||||
import QrcodeVue from 'qrcode.vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { useRoute } from 'vue-router'
|
||||
const standId = store.getters.getStandId
|
||||
const userName = store.getters.getUserName
|
||||
let timer = ref()
|
||||
let optionLoading = ref(false)
|
||||
let workOptions = reactive({
|
||||
workOrder: [],
|
||||
productId: [],
|
||||
singleProductId: [],
|
||||
boxNo: [],
|
||||
goodsId: []
|
||||
})
|
||||
let workFormRef = ref()
|
||||
let workFormEntity = reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
goodsId: '',
|
||||
planStartDate: null
|
||||
})
|
||||
let workFormQuery = reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
goodsId: '',
|
||||
})
|
||||
const rules = reactive({
|
||||
workOrder: [
|
||||
{ required: true, message: '请选择工单号。' }
|
||||
]
|
||||
})
|
||||
let confirmRef = ref()
|
||||
let confirmEntity = reactive({})
|
||||
let confirmRules = reactive({})
|
||||
let boxShowFlag = ref(false)
|
||||
let boxSummary = ref([])
|
||||
let goodsLackSummary = ref([])
|
||||
let pauseGetWorkFlag = ref(false)
|
||||
let lastBox = reactive({})
|
||||
let printTabs = ref([])
|
||||
const printBtn = ref()
|
||||
const confirmReleaseBtn = ref()
|
||||
const size = ref(35)
|
||||
const color = ref('#000000')
|
||||
const route = useRoute()// 路由
|
||||
// 系统
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
initWorkOptions()
|
||||
timer.value = setInterval(() => {
|
||||
getWork()
|
||||
}, 1000)
|
||||
// 监听enter键
|
||||
window.addEventListener('keydown', solveEnterKey)
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(timer.value)
|
||||
window.removeEventListener('keydown', solveEnterKey)
|
||||
})
|
||||
// 监视路由
|
||||
watch(() => route.path, (newVal, oldVal) => {
|
||||
if (newVal == '/kitting') {
|
||||
timer.value = setInterval(() => {
|
||||
getWork()
|
||||
}, 1000)
|
||||
// 监听enter键
|
||||
window.addEventListener('keydown', solveEnterKey)
|
||||
} else {
|
||||
clearInterval(timer.value)
|
||||
window.removeEventListener('keydown', solveEnterKey)
|
||||
}
|
||||
})
|
||||
// 自定义方法
|
||||
const solveEnterKey = (e) => {
|
||||
if (e.key.toLocaleLowerCase() == 'enter') {
|
||||
confirmReleaseBtn.value.$el.click()
|
||||
}
|
||||
}
|
||||
// 初始化工单options
|
||||
const initWorkOptions = () => {
|
||||
const request = {
|
||||
workOrder: workFormQuery.workOrder != '' ? workFormQuery.workOrder : workFormEntity.workOrder,
|
||||
productId: workFormQuery.productId != '' ? workFormQuery.productId : workFormEntity.productId,
|
||||
singleProductId: workFormQuery.singleProductId != '' ? workFormQuery.singleProductId : workFormEntity.singleProductId,
|
||||
boxNo: workFormQuery.boxNo != '' ? workFormQuery.boxNo : workFormEntity.boxNo,
|
||||
goodsId: workFormQuery.goodsId != '' ? workFormQuery.goodsId : workFormEntity.goodsId,
|
||||
planStartDate: dateFormatter(workFormEntity.planStartDate)
|
||||
}
|
||||
optionLoading.value = true
|
||||
queryKateWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
workOptions.workOrder = response.data.workOrder
|
||||
workOptions.productId = response.data.productId
|
||||
workOptions.singleProductId = response.data.singleProductId
|
||||
workOptions.boxNo = response.data.boxNo
|
||||
workOptions.goodsId = response.data.goodsId
|
||||
} else {
|
||||
workOptions.workOrder = []
|
||||
workOptions.productId = []
|
||||
workOptions.singleProductId = []
|
||||
workOptions.boxNo = []
|
||||
workOptions.goodsId = []
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询选项错误。')
|
||||
}).finally(() => {
|
||||
optionLoading.value = false
|
||||
})
|
||||
}
|
||||
// 重置参数
|
||||
const resetWorkFormQuery = () => {
|
||||
workFormEntity.workOrder = ''
|
||||
workFormEntity.productId = ''
|
||||
workFormEntity.singleProductId = ''
|
||||
workFormEntity.boxNo = ''
|
||||
workFormEntity.goodsId = ''
|
||||
}
|
||||
// 确认配料
|
||||
const confirmStart = () => {
|
||||
const request = {
|
||||
workOrder: workFormEntity.workOrder,
|
||||
productId: workFormEntity.productId,
|
||||
singleProductId: workFormEntity.singleProductId,
|
||||
boxNo: workFormEntity.boxNo,
|
||||
goodsId: workFormEntity.goodsId,
|
||||
planStartDate: dateFormatter(workFormEntity.planStartDate),
|
||||
standId: standId,
|
||||
userName: userName
|
||||
}
|
||||
loading.open()
|
||||
initWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
setTimeout(() => {
|
||||
showBoxSummary()
|
||||
}, 2000)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
// 显示料盒总览
|
||||
const showBoxSummary = () => {
|
||||
if (boxShowFlag.value) {
|
||||
return
|
||||
}
|
||||
boxSummary.value = []
|
||||
goodsLackSummary.value = []
|
||||
// 请求
|
||||
const request = {
|
||||
standId: standId,
|
||||
userName: userName
|
||||
}
|
||||
getBoxesAndLacks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const boxDetailVo = response.data
|
||||
// 获得打印标签数据
|
||||
getPrintTabs(boxDetailVo.boxSummary)
|
||||
// 料盒显示数据
|
||||
boxSummary.value = [boxDetailVo.boxSummary]
|
||||
goodsLackSummary.value = boxDetailVo.goodsLackSummary
|
||||
boxShowFlag.value = true
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
errorBox('发生异常:' + error)
|
||||
})
|
||||
}
|
||||
// 关闭弹窗
|
||||
const closeBoxSummary = () => {
|
||||
boxSummary.value = []
|
||||
goodsLackSummary.value = []
|
||||
boxShowFlag.value = false
|
||||
}
|
||||
// 获取工作信息
|
||||
const getWork = () => {
|
||||
if (pauseGetWorkFlag.value) {
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
standId: standId,
|
||||
userName: userName
|
||||
}
|
||||
getCurrentWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
// 设置form
|
||||
confirmEntity.workOrder = response.data.orderConfirm.workOrder
|
||||
confirmEntity.productId = response.data.orderConfirm.productId
|
||||
confirmEntity.singleProductId = response.data.orderConfirm.singleProductId
|
||||
confirmEntity.boxNo = response.data.orderConfirm.boxNo
|
||||
confirmEntity.goodsId = response.data.orderConfirm.goodsId
|
||||
confirmEntity.planPickQty = response.data.orderConfirm.planPickQty
|
||||
confirmEntity.realPickQty = response.data.orderConfirm.realPickQty
|
||||
confirmEntity.stockId = response.data.stockConfirm.stockId
|
||||
confirmEntity.vehicleId = response.data.stockConfirm.vehicleId
|
||||
confirmEntity.planRemainQty = response.data.stockConfirm.planRemainQty
|
||||
confirmEntity.realRemainQty = response.data.stockConfirm.realRemainQty
|
||||
confirmEntity.isOut = response.data.stockConfirm.isOut
|
||||
confirmEntity.putArea = response.data.stockConfirm.putArea
|
||||
confirmEntity.warningQty = response.data.stockConfirm.warningQty
|
||||
pauseGetWorkFlag.value = true
|
||||
// 如果剩余数量低于预警值,弹框报警
|
||||
if (confirmEntity.isOut == 0 && confirmEntity.planRemainQty <= confirmEntity.warningQty) {
|
||||
warningBox('剩余数量低于预警值,请清点库存数量。')
|
||||
}
|
||||
// 判断是否需要显示料盒信息
|
||||
ifNeedShowBoxSummary()
|
||||
} else if (response.code == 400) {
|
||||
// 警告,弹框
|
||||
pauseGetWorkFlag.value = true
|
||||
warningBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
pauseGetWorkFlag.value = true
|
||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||
})
|
||||
}
|
||||
// 是否弹出料盒界面
|
||||
const ifNeedShowBoxSummary = () => {
|
||||
if (lastBox.workOrder != null && lastBox.boxNo != null) {
|
||||
if (lastBox.workOrder == confirmEntity.workOrder && lastBox.boxNo == confirmEntity.boxNo) {
|
||||
// 不需要弹出显示料盒信息
|
||||
return
|
||||
}
|
||||
}
|
||||
showBoxSummary()
|
||||
// 设置上次信息
|
||||
lastBox.workOrder = confirmEntity.workOrder
|
||||
lastBox.boxNo = confirmEntity.boxNo
|
||||
}
|
||||
// 确认放行
|
||||
const confirmOrRelease = () => {
|
||||
const request = {
|
||||
orderConfirm: {
|
||||
workOrder: confirmEntity.workOrder,
|
||||
productId: confirmEntity.productId,
|
||||
singleProductId: confirmEntity.singleProductId,
|
||||
boxNo: confirmEntity.boxNo,
|
||||
goodsId: confirmEntity.goodsId,
|
||||
planPickQty: confirmEntity.planPickQty,
|
||||
realPickQty: confirmEntity.realPickQty
|
||||
},
|
||||
stockConfirm: {
|
||||
stockId: confirmEntity.stockId,
|
||||
vehicleId: confirmEntity.vehicleId,
|
||||
goodsId: confirmEntity.goodsId,
|
||||
planRemainQty: confirmEntity.planRemainQty,
|
||||
realRemainQty: confirmEntity.realRemainQty,
|
||||
isOut: confirmEntity.isOut,
|
||||
putArea: confirmEntity.putArea
|
||||
},
|
||||
standId: standId,
|
||||
userName: userName
|
||||
}
|
||||
confirmCurrentWork(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
// 设置form
|
||||
resetConfirmEntity()
|
||||
pauseGetWorkFlag.value = false
|
||||
ElMessage.success(response.message)
|
||||
} else if (response.code == 400) {
|
||||
// 警告
|
||||
pauseGetWorkFlag.value = false
|
||||
warningBox(response.message)
|
||||
} else {
|
||||
// 错误
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||
})
|
||||
}
|
||||
const resetConfirmEntity = () => {
|
||||
confirmEntity.workOrder = ''
|
||||
confirmEntity.productId = ''
|
||||
confirmEntity.singleProductId = ''
|
||||
confirmEntity.boxNo = ''
|
||||
confirmEntity.goodsId = ''
|
||||
confirmEntity.planPickQty = null
|
||||
confirmEntity.realPickQty = null
|
||||
confirmEntity.stockId = ''
|
||||
confirmEntity.vehicleId = ''
|
||||
confirmEntity.planRemainQty = null
|
||||
confirmEntity.realRemainQty = null
|
||||
confirmEntity.isOut = null
|
||||
confirmEntity.putArea = ''
|
||||
confirmEntity.warningQty = null
|
||||
}
|
||||
// 当拣选数量修改时,要对应的修改
|
||||
const changePlanQty = () => {
|
||||
if (confirmEntity.isOut == 0 && confirmEntity.realPickQty != confirmEntity.planPickQty) {
|
||||
// 修正量
|
||||
const changeQty = confirmEntity.realPickQty - confirmEntity.planPickQty
|
||||
// 修正实际剩余数量
|
||||
confirmEntity.realRemainQty = confirmEntity.planRemainQty + changeQty
|
||||
}
|
||||
}
|
||||
const requestPrint = () => {
|
||||
nextTick(() => {
|
||||
printBtn.value.click()
|
||||
});
|
||||
}
|
||||
// 获得打印数据
|
||||
const getPrintTabs = (boxSummary) => {
|
||||
printTabs.value = []
|
||||
if (boxSummary != undefined) {
|
||||
for (let i = 1; i <= boxSummary.boxQty; i++) {
|
||||
printTabs.value.push(
|
||||
{
|
||||
workOrder: boxSummary.workOrder,
|
||||
productId: boxSummary.productIdOrigin,
|
||||
singleProductId: boxSummary.singleProductId,
|
||||
boxNo: boxSummary.boxNo,
|
||||
kittingDate: boxSummary.kittingDate,
|
||||
produceDate: boxSummary.produceDate,
|
||||
testNo: boxSummary.testNo,
|
||||
productionQty: boxSummary.productionQty,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.main-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.confirm-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 10px 5px 10px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
size: auto;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
body,
|
||||
html {
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint .pageWarp {
|
||||
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
||||
page-break-after: always;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.print-tab-text {
|
||||
width: 40%;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.print-tab-image {
|
||||
width: 20%;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.print-row-normal {
|
||||
margin: 8px 3px 8px 3px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
500
src/layout/kittingList.vue
Normal file
500
src/layout/kittingList.vue
Normal file
|
|
@ -0,0 +1,500 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="kittingBomQueryFormRef" :model="kittingBomQueryFormEntity"
|
||||
:label-position="labelPosition" label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="配料单类型">
|
||||
<el-select-v2 v-model="kittingBomQueryFormEntity.bomType" placeholder="配料单类型"
|
||||
:options="kittingBomTypeOptions" @change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="机型">
|
||||
<el-input v-model="kittingBomQueryFormEntity.model" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品号">
|
||||
<el-input v-model="kittingBomQueryFormEntity.productId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="原材料号">
|
||||
<el-input v-model="kittingBomQueryFormEntity.goodsId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="料盒号">
|
||||
<el-input v-model="kittingBomQueryFormEntity.boxNo" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1;" class="btn-search"
|
||||
@click="openUploadDialog()">导入配料单</el-button>
|
||||
<el-button type="success" class="btn-search"
|
||||
@click="exportExcel()">导出excel</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="displayKittingList" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.templateId" v-model="templateId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bomType" label="配料类型" fixed="left" min-width="120px" sortable="custom"
|
||||
:formatter="bomTypeFormat" show-overflow-tooltip />
|
||||
<el-table-column prop="model" label="机型" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="productId" label="成品号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="原材料号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsDescription" label="物料描述" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="quantity1Pair" label="单套数量" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="boxNo" label="料盒号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="quantityOfPair" label="套数" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
<!-- <el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存编号" prop="stockId">
|
||||
<el-input v-model="stockFormEntity.stockId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="stockFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="stockFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料名" prop="goodsName">
|
||||
<el-input v-model="stockFormEntity.goodsName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入库数量" prop="totalNum">
|
||||
<el-input-number v-model.number="stockFormEntity.totalNum" controls-position="right"
|
||||
:min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="剩余数量(为0时删除库存)" prop="remainNum">
|
||||
<el-input-number v-model.number="stockFormEntity.remainNum"
|
||||
controls-position="right" :min="0" :max="stockFormEntity.totalNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="stockFormEntity.locationId" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="未使用天数" prop="noUseDays">
|
||||
<el-input-number v-model.number="stockFormEntity.noUseDays"
|
||||
controls-position="right" :min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存状态" prop="stockStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
|
||||
:options="stockStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料状态" prop="goodsStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
|
||||
:options="goodsStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="盘点任务号" prop="inventoryTaskId">
|
||||
<el-input v-model="stockFormEntity.inventoryTaskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否盘点" prop="isInventory">
|
||||
<el-input v-model="stockFormEntity.isInventory" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="stockFormEntity.createTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
||||
<el-input v-model="stockFormEntity.lastUpdateTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
||||
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
<el-dialog v-model="showKittingBomUploadDialog" title="上传配料单" width="40%" draggable :show-close="true">
|
||||
<fieldset class="search-area">
|
||||
<legend>导入总成配料单</legend>
|
||||
<UploadExcelProduct></UploadExcelProduct>
|
||||
</fieldset>
|
||||
<fieldset class="search-area">
|
||||
<legend>导入单片配料单</legend>
|
||||
<UploadExcelSingleProduct></UploadExcelSingleProduct>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import UploadExcelProduct from '@/excel/UploadExcelProduct.vue'
|
||||
import UploadExcelSingleProduct from '@/excel/UploadExcelSingleProduct.vue'
|
||||
import { queryKittingBomByPage } from '@/api/kateWork.js'
|
||||
import { dateFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest } from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form.js'
|
||||
import { kittingBomTypeOptions } from '@/constant/options.js'
|
||||
import { exportKittingBomWithExcel } from '@/api/excel.js'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let displayKittingList = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['productId', true]]),// 按照成品号顺序排序
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let kittingBomQueryFormEntity = reactive({
|
||||
bomType: 1,
|
||||
model: '',
|
||||
productId: '',
|
||||
goodsId: '',
|
||||
boxNo: ''
|
||||
})
|
||||
let kittingBomQueryFormRef = ref()
|
||||
let showKittingBomEditFlag = ref(false)
|
||||
let templateId = ''
|
||||
let kittingBomEditFormRef = ref()
|
||||
let dbsEditFormEntity = reactive({})
|
||||
let showKittingBomUploadDialog = ref(false)
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.bomType = kittingBomQueryFormEntity.bomType
|
||||
request.model = kittingBomQueryFormEntity.model
|
||||
request.productId = kittingBomQueryFormEntity.productId
|
||||
request.goodsId = kittingBomQueryFormEntity.goodsId
|
||||
request.boxNo = kittingBomQueryFormEntity.boxNo
|
||||
queryKittingBomByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayKittingList.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
displayKittingList.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询配料单异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
kittingBomQueryFormEntity.model = ''
|
||||
kittingBomQueryFormEntity.productId = ''
|
||||
kittingBomQueryFormEntity.goodsId = ''
|
||||
kittingBomQueryFormEntity.boxNo = ''
|
||||
}
|
||||
const bomTypeFormat = (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1:
|
||||
return '总成'
|
||||
case 2:
|
||||
return '单片'
|
||||
default:
|
||||
return '未知类型'
|
||||
}
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
templateId = row.templateId
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
bomType: kittingBomQueryFormEntity.bomType,
|
||||
model: kittingBomQueryFormEntity.model,
|
||||
productId: kittingBomQueryFormEntity.productId,
|
||||
rgoodsId: kittingBomQueryFormEntity.goodsId,
|
||||
boxNo: kittingBomQueryFormEntity.boxNo
|
||||
}
|
||||
exportKittingBomWithExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
const preName = kittingBomQueryFormEntity.bomType == 1 ? '总成' : '单片'
|
||||
let _fileName = preName + '配料单' + dateFormatter(new Date) + '.xlsx'
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
const editCurrentRowStock = (row) => {
|
||||
this.stockFormEntity = {
|
||||
stockId: row.stockId,
|
||||
locationId: row.locationId,
|
||||
vehicleId: row.vehicleId,
|
||||
stockStatus: row.stockStatus,
|
||||
createTime: row.createTime,
|
||||
lastUpdateTime: row.lastUpdateTime,
|
||||
lastUpdateUser: row.lastUpdateUser,
|
||||
isInventory: row.isInventory,
|
||||
inventoryTaskId: row.inventoryTaskId,
|
||||
noUseDays: row.noUseDays,
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsStatus: row.goodsStatus,
|
||||
remainNum: row.remainNum,
|
||||
totalNum: row.totalNum
|
||||
}
|
||||
this.dialogVisible = true
|
||||
}
|
||||
const submitStockInfo = () => {
|
||||
const request = {
|
||||
stockId: this.stockFormEntity.stockId,
|
||||
locationId: this.stockFormEntity.locationId,
|
||||
vehicleId: this.stockFormEntity.vehicleId,
|
||||
stockStatus: this.stockFormEntity.stockStatus,
|
||||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库存成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库存失败')
|
||||
})
|
||||
}
|
||||
const openUploadDialog = () => {
|
||||
showKittingBomUploadDialog.value = true
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
459
src/layout/kittingRelation.vue
Normal file
459
src/layout/kittingRelation.vue
Normal file
|
|
@ -0,0 +1,459 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="relationQueryFormRef" :model="relationQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="机型">
|
||||
<el-input v-model="relationQueryFormEntity.model" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="总成号">
|
||||
<el-input v-model="relationQueryFormEntity.productId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号">
|
||||
<el-input v-model="relationQueryFormEntity.singleProductId" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1;" class="btn-search"
|
||||
@click="openUploadDialog()">导入数据</el-button>
|
||||
<el-button type="success" class="btn-search"
|
||||
@click="exportExcel()">导出excel</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="displayRelationList" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.recordId" v-model="recordId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="model" label="机型" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="productId" label="总成号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="singleProductId" label="单片号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
<!-- <el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存编号" prop="stockId">
|
||||
<el-input v-model="stockFormEntity.stockId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="stockFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="stockFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料名" prop="goodsName">
|
||||
<el-input v-model="stockFormEntity.goodsName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入库数量" prop="totalNum">
|
||||
<el-input-number v-model.number="stockFormEntity.totalNum" controls-position="right"
|
||||
:min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="剩余数量(为0时删除库存)" prop="remainNum">
|
||||
<el-input-number v-model.number="stockFormEntity.remainNum"
|
||||
controls-position="right" :min="0" :max="stockFormEntity.totalNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="stockFormEntity.locationId" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="未使用天数" prop="noUseDays">
|
||||
<el-input-number v-model.number="stockFormEntity.noUseDays"
|
||||
controls-position="right" :min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存状态" prop="stockStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
|
||||
:options="stockStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料状态" prop="goodsStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
|
||||
:options="goodsStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="盘点任务号" prop="inventoryTaskId">
|
||||
<el-input v-model="stockFormEntity.inventoryTaskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否盘点" prop="isInventory">
|
||||
<el-input v-model="stockFormEntity.isInventory" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="stockFormEntity.createTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
||||
<el-input v-model="stockFormEntity.lastUpdateTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
||||
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
<el-dialog v-model="showRelationUploadDialog" title="上传配对关系" width="40%" draggable :show-close="true">
|
||||
<fieldset class="search-area">
|
||||
<legend>导入总成-单片对应</legend>
|
||||
<UploadExcelProductExtend></UploadExcelProductExtend>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import UploadExcelProductExtend from '@/excel/UploadExcelProductExtend.vue'
|
||||
import { queryRelationByPage } from '@/api/kateWork.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest } from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form'
|
||||
import { exportKittingBomRelationWithExcel } from '@/api/excel.js'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let displayRelationList = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['productId', true]]),// 按照成品号顺序排序
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let relationQueryFormEntity = reactive({
|
||||
model: '',
|
||||
productId: '',
|
||||
singleProductId: ''
|
||||
})
|
||||
let relationQueryFormRef = ref()
|
||||
let showRelationAddFlag = ref(false)
|
||||
let recordId = ''
|
||||
let relationAddFormRef = ref()
|
||||
let relationAddFormEntity = reactive({})
|
||||
let showRelationUploadDialog = ref(false)
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.model = relationQueryFormEntity.model
|
||||
request.productId = relationQueryFormEntity.productId
|
||||
request.singleProductId = relationQueryFormEntity.singleProductId
|
||||
queryRelationByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayRelationList.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
displayRelationList.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询对应关系异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
relationQueryFormEntity.model = ''
|
||||
relationQueryFormEntity.productId = ''
|
||||
relationQueryFormEntity.singleProductId = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
recordId = row.recordId
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
model: relationQueryFormEntity.model,
|
||||
productId: relationQueryFormEntity.productId,
|
||||
singleProductId: relationQueryFormEntity.singleProductId
|
||||
}
|
||||
exportKittingBomRelationWithExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "配对关系" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
const editCurrentRowStock = (row) => {
|
||||
this.stockFormEntity = {
|
||||
stockId: row.stockId,
|
||||
locationId: row.locationId,
|
||||
vehicleId: row.vehicleId,
|
||||
stockStatus: row.stockStatus,
|
||||
createTime: row.createTime,
|
||||
lastUpdateTime: row.lastUpdateTime,
|
||||
lastUpdateUser: row.lastUpdateUser,
|
||||
isInventory: row.isInventory,
|
||||
inventoryTaskId: row.inventoryTaskId,
|
||||
noUseDays: row.noUseDays,
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsStatus: row.goodsStatus,
|
||||
remainNum: row.remainNum,
|
||||
totalNum: row.totalNum
|
||||
}
|
||||
this.dialogVisible = true
|
||||
}
|
||||
const submitStockInfo = () => {
|
||||
const request = {
|
||||
stockId: this.stockFormEntity.stockId,
|
||||
locationId: this.stockFormEntity.locationId,
|
||||
vehicleId: this.stockFormEntity.vehicleId,
|
||||
stockStatus: this.stockFormEntity.stockStatus,
|
||||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库存成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库存失败')
|
||||
})
|
||||
}
|
||||
const openUploadDialog = () => {
|
||||
showRelationUploadDialog.value = true
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
185
src/layout/location.vue
Normal file
185
src/layout/location.vue
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row style="align-items: center;">
|
||||
<!-- <span>选择库区:</span>
|
||||
<el-select v-model="areaId" placeholder="请选择库区" style="width: 120px;" @change="getAllLocations">
|
||||
<el-option label="3楼库区" :value='1' />
|
||||
<el-option label="2楼库区" :value='2' />
|
||||
</el-select> -->
|
||||
<span style="margin-left: 5px;">状态说明:</span>
|
||||
<el-button color="green">空闲</el-button>
|
||||
<el-button color="red">占用</el-button>
|
||||
<el-button color="yellow">锁定</el-button>
|
||||
<el-button color="#00BFFF" style="margin: 0 0 0 auto;" @click="getAllLocations">刷新</el-button>
|
||||
</el-row>
|
||||
<hr style="border: 1px solid #ff0000" />
|
||||
<div>
|
||||
<el-scrollbar max-height="760px">
|
||||
<div v-for="currentRowLocation in allLocations">
|
||||
<span>第{{ currentRowLocation.row }}排</span>
|
||||
<div class="row" v-for="currentLayerLocation in currentRowLocation.currentLayerLocations">
|
||||
<div class="col" v-for="currentColLocation in currentLayerLocation.currentColLocations">
|
||||
<el-button :color="getLocationStatus(currentColLocation)"
|
||||
@click="showDialog(currentColLocation)">
|
||||
<span style="font-size: 15px;">{{ currentColLocation.queue }}排{{ currentColLocation.line}}列{{ currentColLocation.layer}}层</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="border: 1px solid #000000" />
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<el-dialog v-model="dialogVisible" :title="currentLocationTitle" width="30%" draggable :show-close="false">
|
||||
<el-form :model="location">
|
||||
<el-form-item label="占用/解除占用库位" :label-width="140">
|
||||
<el-select v-model="location.locationStatus" placeholder="库位是否占用" style="width: 70%;">
|
||||
<el-option label="空闲" :value='0' />
|
||||
<el-option label="占用" :value='1' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定/解锁库位" :label-width="140">
|
||||
<el-select v-model="location.isLock" placeholder="库位是否锁定" style="width: 70%;">
|
||||
<el-option label="解锁" :value='0' />
|
||||
<el-option label="锁定" :value='1' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具" :label-width="140">
|
||||
<el-input v-model="location.vehicleId" style="width: 70%;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitLocationStatus()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { getLocations, updateLocation } from '@/api/location.js'
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { reactive } from 'vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'location',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
currentSelectedLocation: {},
|
||||
allLocations: [],
|
||||
location: reactive({
|
||||
locationStatus: '',
|
||||
isLock: '',
|
||||
vehicleId: ''
|
||||
}),
|
||||
currentLocationTitle: '',
|
||||
areaId: 1
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getAllLocations()
|
||||
},
|
||||
methods: {
|
||||
getLocationStatus: (currentColLocation) => {
|
||||
if (currentColLocation.isLock === 1) {
|
||||
return 'yellow'
|
||||
}
|
||||
if (currentColLocation.locationStatus === 1) {
|
||||
return 'red'
|
||||
}
|
||||
return 'green'
|
||||
},
|
||||
getAllLocations() {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
const data = { areaId: this.areaId }
|
||||
getLocations(data).then(res => {
|
||||
loading.close()
|
||||
if (res.data.code == 0) {
|
||||
console.log(res.data.returnData)
|
||||
this.allLocations = res.data.returnData
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
ElMessage.error('查询库位失败!')
|
||||
})
|
||||
},
|
||||
showDialog(currentColLocation) {
|
||||
this.dialogVisible = true
|
||||
this.currentSelectedLocation = currentColLocation
|
||||
this.setCurrentLocationTitle()
|
||||
this.location.locationStatus = this.currentSelectedLocation.locationStatus
|
||||
this.location.isLock = this.currentSelectedLocation.isLock
|
||||
this.location.vehicleId = this.currentSelectedLocation.vehicleId
|
||||
},
|
||||
submitLocationStatus() {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
this.currentSelectedLocation.locationStatus = this.location.locationStatus
|
||||
this.currentSelectedLocation.isLock = this.location.isLock
|
||||
this.currentSelectedLocation.vehicleId = this.location.vehicleId
|
||||
updateLocation(this.currentSelectedLocation).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
loading.close()
|
||||
this.dialogVisible = false
|
||||
ElMessage({
|
||||
message: '更新库位信息成功!',
|
||||
type: 'success',
|
||||
})
|
||||
this.getAllLocations()
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
ElMessage.error('更新库位信息失败')
|
||||
})
|
||||
},
|
||||
setCurrentLocationTitle() {
|
||||
this.currentLocationTitle = '当前选择库位:' + this.currentSelectedLocation.queue + '排' + this.currentSelectedLocation.line + '列' + this.currentSelectedLocation.layer + '层'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.col {
|
||||
/* width: 100px; */
|
||||
/* height: 40px; */
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.col .el-button {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
345
src/layout/locationsTable.vue
Normal file
345
src/layout/locationsTable.vue
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="locationIdQuery" 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: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="locations" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.locationId" v-model="locationId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="locationId" label="库位" fixed="left" :formatter="locationFormat" min-width="180px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="areaId" label="库区" min-width="120px" />
|
||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" />
|
||||
<el-table-column prop="locationType" label="库位类型" min-width="120px" />
|
||||
<el-table-column prop="wRow" label="排" min-width="120px" />
|
||||
<el-table-column prop="wCol" label="列" min-width="120px" />
|
||||
<el-table-column prop="wLayer" label="层" min-width="120px" />
|
||||
<el-table-column prop="wDepth" label="深度" min-width="120px" />
|
||||
<el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px" />
|
||||
<el-table-column prop="locationStatus" label="状态" :formatter="locationStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="料箱" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowLocation(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="库位信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="locationFormRef" :model="locationFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="locationFormEntity.locationId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="locationType">
|
||||
<el-input v-model="locationFormEntity.locationType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库区" prop="areaId">
|
||||
<el-input v-model="locationFormEntity.areaId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备号" prop="equipmentId">
|
||||
<el-input v-model="locationFormEntity.equipmentId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="排" prop="wRow">
|
||||
<el-input v-model="locationFormEntity.wRow" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="列" prop="wCol">
|
||||
<el-input v-model="locationFormEntity.wCol" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="层" prop="wLayer">
|
||||
<el-input v-model="locationFormEntity.wLayer" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="深度" prop="wDepth">
|
||||
<el-input v-model="locationFormEntity.wDepth" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="锁定" prop="isLock">
|
||||
<el-select-v2 v-model="locationFormEntity.isLock" placeholder="请选择是否锁定"
|
||||
:options="isLockOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="locationStatus">
|
||||
<el-select-v2 v-model="locationFormEntity.locationStatus" placeholder="请选择库位状态"
|
||||
:options="locationStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料箱" prop="vehicleId">
|
||||
<el-input v-model="locationFormEntity.vehicleId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitLocationInfo(locationFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { downloadLocationsExcel } from '@/api/excel.js'
|
||||
import { getLocations, updateLocation } from '@/api/location.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { locationStatusFormatter, locationFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'locationsTable',
|
||||
data() {
|
||||
return {
|
||||
locations: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
locationIdQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
locationId: '',
|
||||
locationFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
locationFormRef: ref(),
|
||||
rules: reactive({
|
||||
locationId: [
|
||||
{ required: true, message: '请输入库位号' }
|
||||
],
|
||||
}),
|
||||
// 锁定
|
||||
isLockOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '正常'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '锁定'
|
||||
}
|
||||
],
|
||||
// 状态
|
||||
locationStatusOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '空闲'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '占用'
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
locationId: this.locationIdQuery.trim()
|
||||
}
|
||||
getLocations(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.locations = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询库位信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
locationStatusFormat: (row, column, cellValue, index) => {
|
||||
return locationStatusFormatter(cellValue)
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
},
|
||||
isLockFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == 0) {
|
||||
return '正常'
|
||||
}
|
||||
if (cellValue == 1) {
|
||||
return '锁定'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.locationIdQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowLocation(row) {
|
||||
this.locationFormEntity = {
|
||||
locationId: row.locationId,
|
||||
areaId: row.areaId,
|
||||
equipmentId: row.equipmentId,
|
||||
locationType: row.locationType,
|
||||
wRow: row.wRow,
|
||||
wCol: row.wCol,
|
||||
wLayer: row.wLayer,
|
||||
wDepth: row.wDepth,
|
||||
isLock: row.isLock,
|
||||
locationStatus: row.locationStatus,
|
||||
vehicleId: row.vehicleId
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitLocationInfo(formData) {
|
||||
const request = {
|
||||
locationId: formData.locationId,
|
||||
areaId: formData.areaId,
|
||||
equipmentId: formData.equipmentId,
|
||||
locationType: formData.locationType,
|
||||
wRow: formData.wRow,
|
||||
wCol: formData.wCol,
|
||||
wLayer: formData.wLayer,
|
||||
wDepth: formData.wDepth,
|
||||
isLock: formData.isLock,
|
||||
locationStatus: formData.locationStatus,
|
||||
vehicleId: formData.vehicleId
|
||||
}
|
||||
updateLocation(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库位信息成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库位信息失败')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.locationId = row.locationId
|
||||
},
|
||||
exportExcel() {
|
||||
const params = {
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadLocationsExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "库位报表" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
192
src/layout/outTaskRecord.vue
Normal file
192
src/layout/outTaskRecord.vue
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
|
||||
<template>
|
||||
<div style="margin-bottom: 15px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" />
|
||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号" />
|
||||
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择创建日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-date-picker v-model="finishTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="success" @click="exportExcel()">导出记录</el-button>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getTaskRecords } from '@/api/record.js'
|
||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { downloadOutRecordExcel } from '@/api/excel.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import store from '@/store'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'outTaskRecord',
|
||||
data() {
|
||||
return {
|
||||
tasks: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
loading: true,
|
||||
createTimeQuery: null,
|
||||
finishTimeQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1: return '入库'
|
||||
case 2: return '出库'
|
||||
case 3: return '盘点'
|
||||
case 9: return '移库'
|
||||
default: return '未知'
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
taskType: 2,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
finishTime: timeFormatter(this.finishTimeQuery),
|
||||
}
|
||||
getTaskRecords(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)
|
||||
errorBox('查询任务记录错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
this.createTimeQuery = null
|
||||
this.finishTimeQuery = null
|
||||
this.search()
|
||||
},
|
||||
exportExcel() {
|
||||
const params = {
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
finishTime: timeFormatter(this.finishTimeQuery),
|
||||
userName: store.getters.userName
|
||||
}
|
||||
downloadOutRecordExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "导出出库记录" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
293
src/layout/pickTaskMonitor.vue
Normal file
293
src/layout/pickTaskMonitor.vue
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="standQuery" style="width: 158px; margin-right: 10px;" placeholder="工站"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="pickStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择状态" :options="pickStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.pickTaskId" v-model="pickTaskId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pickTaskId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="standId" label="站台号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="pickStatus" label="拣选状态" :formatter="pickStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" show-overflow-tooltip
|
||||
min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="拣选任务详细信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="pickTaskFormRef" :model="pickTaskFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="id" prop="pickTaskId">
|
||||
<el-input v-model="pickTaskFormEntity.pickTaskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工站" prop="vehicleId">
|
||||
<el-input v-model="pickTaskFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="小盒子" prop="standId">
|
||||
<el-input v-model="pickTaskFormEntity.standId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态" prop="pickStatus">
|
||||
<el-select-v2 v-model="pickTaskFormEntity.pickStatus" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitInfo(pickTaskFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getPickTasksByPage, updatePickTaskInfo } from '@/api/taskMonitor.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'pickTaskMonitor',
|
||||
data() {
|
||||
return {
|
||||
pickTaskList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
vehicleIdQuery: '',
|
||||
standQuery: '',
|
||||
pickStatusQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
pickTaskId: '',
|
||||
pickTaskFormEntity: reactive({}),
|
||||
pickTaskFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
taskStatusOptions: [
|
||||
{
|
||||
value: -1,
|
||||
label: '暂存'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '待下发'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已下发'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已到达'
|
||||
}
|
||||
],
|
||||
pickStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: -1,
|
||||
label: '暂存'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '待下发'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已下发'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已到达'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
standId: this.standQuery.trim(),
|
||||
pickStatus: this.pickStatusQuery == -99 ? null : this.pickStatusQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getPickTasksByPage(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.pickTaskList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询拣选任务错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
pickStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case -1:
|
||||
return '暂存'
|
||||
case 0:
|
||||
return '待下发'
|
||||
case 1:
|
||||
return '已下发'
|
||||
case 2:
|
||||
return '已到达'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.vehicleIdQuery = ''
|
||||
this.standQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.pickTaskId = row.pickTaskId
|
||||
this.pickTaskFormEntity = {
|
||||
pickTaskId: row.pickTaskId,
|
||||
vehicleId: row.vehicleId,
|
||||
standId: row.standId,
|
||||
pickStatus: row.pickStatus,
|
||||
lastUpdateTime: row.lastUpdateTime
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
pickTaskId: formData.pickTaskId,
|
||||
pickStatus: formData.pickStatus,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updatePickTaskInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新拣选任务成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新拣选任务失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.pickTaskId = row.pickTaskId
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
388
src/layout/role_permission.vue
Normal file
388
src/layout/role_permission.vue
Normal file
|
|
@ -0,0 +1,388 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="roleNameQuery" style="width: 216px; 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 type="success" @click="openAddRoleDialog()">新增角色</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="roleList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.roleId" v-model="roleId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="roleName" label="角色名" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="216px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑角色</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRow(scope.row)">删除角色</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="编辑角色信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 350px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="roleFormRef" :model="roleFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="角色id" prop="roleId">
|
||||
<el-input v-model="roleFormEntity.roleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色名" prop="roleName">
|
||||
<el-input v-model="roleFormEntity.roleName" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="权限" prop="permission">
|
||||
<el-tree ref="permissionRef" style="max-width: 600px"
|
||||
:data="roleFormEntity.permissionTreeData" show-checkbox default-expand-all
|
||||
node-key="id" highlight-current :props="defaultProps" />
|
||||
</el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitInfo(roleFormEntity)">
|
||||
确认更新
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="addRoleDialogVisible" title="添加角色信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 350px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="addRoleFormRef" :model="addRoleFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="角色id" prop="roleId">
|
||||
<el-input v-model="addRoleFormEntity.roleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色名" prop="roleName">
|
||||
<el-input v-model="addRoleFormEntity.roleName" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="权限" prop="permission">
|
||||
<el-tree ref="addRolePermissionRef" style="max-width: 600px"
|
||||
:data="addRoleFormEntity.permissionTreeData" show-checkbox default-expand-all
|
||||
node-key="id" highlight-current :props="defaultProps" />
|
||||
</el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="addRoleDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitAddRole(addRoleFormEntity)">
|
||||
确认添加
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getRoleList, getPermissionList, updateRoleInfo, deleteRoleInfo, addRoleInfo } from '@/api/user.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'role_permission',
|
||||
data() {
|
||||
return {
|
||||
roleList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
roleNameQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
roleId: '',
|
||||
roleFormEntity: reactive({}),
|
||||
roleFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
addRoleDialogVisible: false,
|
||||
addRoleFormEntity: reactive({}),
|
||||
addRoleFormRef: ref(),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
userName: store.getters.getUserName,
|
||||
roleId: store.getters.getUser.roleId,
|
||||
roleName: this.roleNameQuery.trim()
|
||||
}
|
||||
getRoleList(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.roleList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询角色列表错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.standTypeQuery = -99
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.roleId = row.roleId
|
||||
if (store.getters.getUser.roleId != 1) {
|
||||
errorBox("操作人必须是管理员级别。")
|
||||
return
|
||||
}
|
||||
// 获取权限
|
||||
this.loading = true
|
||||
const request = {
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
roleId2: row.roleId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getPermissionList(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
this.roleFormEntity = {
|
||||
roleId: row.roleId,
|
||||
roleName: row.roleName,
|
||||
permissionTreeData: response.returnData.menu
|
||||
}
|
||||
// 设置选中
|
||||
this.$refs.permissionRef.setCheckedKeys(response.returnData.menuIds, false)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询权限列表错误')
|
||||
this.dialogVisible = false
|
||||
})
|
||||
this.loading = false
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openAddRoleDialog() {
|
||||
if (store.getters.getUser.roleId != 1) {
|
||||
errorBox("操作人必须是管理员级别。")
|
||||
return
|
||||
}
|
||||
// 获取权限
|
||||
this.loading = true
|
||||
const request = {
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
roleId2: null,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getPermissionList(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
this.addRoleFormEntity = {
|
||||
roleId: '',
|
||||
roleName: '',
|
||||
permissionTreeData: response.returnData.menu
|
||||
}
|
||||
// 设置选中
|
||||
this.$refs.addRolePermissionRef.setCheckedKeys([], false)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
this.addRoleDialogVisible = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询权限列表错误')
|
||||
this.addRoleDialogVisible = false
|
||||
})
|
||||
this.loading = false
|
||||
this.addRoleDialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
roleId2: formData.roleId,
|
||||
role2Name: formData.roleName,
|
||||
menuIds: this.$refs.permissionRef.getCheckedKeys(false),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateRoleInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新角色信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新角色信息失败。')
|
||||
})
|
||||
},
|
||||
submitAddRole(formData) {
|
||||
const params = {
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
roleId2: formData.roleId,
|
||||
role2Name: formData.roleName,
|
||||
menuIds: this.$refs.addRolePermissionRef.getCheckedKeys(false),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
addRoleInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.addRoleDialogVisible = false
|
||||
ElMessage.success('添加角色信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('添加角色信息失败。')
|
||||
})
|
||||
},
|
||||
deleteCurrentRow(row) {
|
||||
this.roleId = row.roleId
|
||||
if (store.getters.getUser.roleId != 1) {
|
||||
errorBox("操作人员必须是管理员级别。")
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(
|
||||
'该操作会从数据库中删除角色。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
roleId2: row.roleId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteRoleInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除角色信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除角色信息失败。')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.roleId = row.roleId
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
376
src/layout/role_user.vue
Normal file
376
src/layout/role_user.vue
Normal file
|
|
@ -0,0 +1,376 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="userNameQuery" style="width: 216px; 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 type="success" @click="addOneUser()">新增用户</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="userList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.userId" v-model="userId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="用户名" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="roleId" label="角色" :formatter="roleFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="loginAccount" label="登录账户" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="addTime" label="增加时间" :formatter="timeFormat" show-overflow-tooltip
|
||||
min-width="120px" />
|
||||
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="addUser" label="添加用户" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" min-width="120px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRow(scope.row)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="编辑用户信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="userFormRef" :model="userFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="userFormEntity.userId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model="userFormEntity.userName" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="登录账户" prop="loginAccount">
|
||||
<el-input v-model="userFormEntity.loginAccount" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色" prop="roleId">
|
||||
<el-select-v2 v-model="userFormEntity.roleId" placeholder="请选择角色"
|
||||
:options="roleOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitInfo(userFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="addUserDialogVisible" title="添加用户信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 350px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="addUserFormRef" :model="addUserFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="角色" prop="roleIdUpdate">
|
||||
<el-select-v2 v-model="addUserFormEntity.roleIdUpdate" placeholder="请选择角色"
|
||||
:options="roleOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名" prop="userNameUpdate">
|
||||
<el-input v-model="addUserFormEntity.userNameUpdate" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="登录账户" prop="loginAccountUpdate">
|
||||
<el-input v-model="addUserFormEntity.loginAccountUpdate" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="登录密码" prop="loginPasswordUpdate">
|
||||
<el-input v-model="addUserFormEntity.loginPasswordUpdate" show-password clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="addUserDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitAddUser(addUserFormEntity)">
|
||||
确认添加
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getUserList, getRoleOptions, updateUserInfo, addUserInfo, deleteUserInfo } from '@/api/user.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'role_user',
|
||||
data() {
|
||||
return {
|
||||
userList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
userNameQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
userId: '',
|
||||
userFormEntity: reactive({}),
|
||||
userFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
roleOptions: [],
|
||||
addUserDialogVisible: false,
|
||||
addUserFormEntity: reactive({}),
|
||||
addUserFormRef: ref(),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getRoleOptions()
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
getRoleOptions() {
|
||||
const request = {
|
||||
roleId: store.getters.getUser.roleId,
|
||||
}
|
||||
getRoleOptions(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.roleOptions = tableResponse.returnData
|
||||
} else {
|
||||
this.roleOptions = []
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.roleOptions = []
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
userName: this.userNameQuery.trim(),
|
||||
roleId: store.getters.getUser.roleId,
|
||||
}
|
||||
getUserList(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.userList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询用户列表错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
roleFormat(row, column, cellValue, index) {
|
||||
const roleOptionInfo = this.roleOptions.find(item => {
|
||||
return item.value == cellValue
|
||||
})
|
||||
return roleOptionInfo == null|undefined ? '未知角色' : roleOptionInfo.label
|
||||
},
|
||||
reset() {
|
||||
this.userNameQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.userId = row.userId
|
||||
this.userFormEntity = {
|
||||
userId: row.userId,
|
||||
userName: row.userName,
|
||||
loginAccount: row.loginAccount,
|
||||
roleId: row.roleId,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRow(row) {
|
||||
this.userId = row.userId
|
||||
if (store.getters.getUser.roleId != 1) {
|
||||
errorBox("操作人员必须是管理员级别。")
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(
|
||||
'该操作会从数据库中删除用户。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
userIdUpdate: row.userId,
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteUserInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除用户信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除用户信息失败。')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
addOneUser() {
|
||||
this.addUserFormEntity = {
|
||||
roleIdUpdate: null,
|
||||
userNameUpdate: '',
|
||||
loginAccountUpdate: '',
|
||||
loginPasswordUpdate: '',
|
||||
}
|
||||
this.addUserDialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
roleIdUpdate: formData.roleId,
|
||||
userIdUpdate: formData.userId,
|
||||
userNameUpdate: formData.userName,
|
||||
loginAccountUpdate: formData.loginAccount,
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateUserInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新用户信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新用户信息失败。')
|
||||
})
|
||||
},
|
||||
submitAddUser(formData) {
|
||||
const params = {
|
||||
roleIdUpdate: formData.roleIdUpdate,
|
||||
userNameUpdate: formData.userNameUpdate,
|
||||
loginAccountUpdate: formData.loginAccountUpdate,
|
||||
loginPasswordUpdate: formData.loginPasswordUpdate,
|
||||
roleId1: store.getters.getUser.roleId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
addUserInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.addUserDialogVisible = false
|
||||
ElMessage.success('添加用户信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('添加用户信息失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.userId = row.userId
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
127
src/layout/scanForImage.vue
Normal file
127
src/layout/scanForImage.vue
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
<template>
|
||||
<!-- 图纸展示 -->
|
||||
<div class="content">
|
||||
<el-image class="image-full" :src="imageData.base64" :fit="fit">
|
||||
<template #error>
|
||||
<div class="error-slot">
|
||||
{{ imageData.errMsg }}
|
||||
</div>
|
||||
</template>
|
||||
</el-image>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
// 导入
|
||||
import store from '@/store'
|
||||
import { requestImageDetail } from '@/api/kateWork.js'
|
||||
import { isSingleCharacter, isNumber } from '@/utils/stringUtils';
|
||||
import { onBeforeUnmount, onMounted, reactive } from 'vue';
|
||||
// 声明变量
|
||||
const fit = 'contain'
|
||||
let imageData = reactive({
|
||||
url: '',
|
||||
base64: '',
|
||||
name: '',
|
||||
errMsg: ''
|
||||
})
|
||||
let inputStr = ''
|
||||
let imageRequest = reactive({
|
||||
productId: '',
|
||||
boxNo: '',
|
||||
userName: store.getters.getUserName,
|
||||
standId: store.getters.getStandId
|
||||
})
|
||||
// 声明系统方法
|
||||
onMounted(() => {
|
||||
document.addEventListener('keydown', handleKeyDown)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('keydown', handleKeyDown)
|
||||
})
|
||||
// 声明自定义方法
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.key.toLowerCase() == 'enter') {
|
||||
solveInput()
|
||||
} else {
|
||||
if (event.key == 'Backspace') {
|
||||
inputStr = inputStr.substring(0, inputStr.length - 1)
|
||||
} else if (isSingleCharacter(event.key) || isNumber(event.key) || event.key == '&') {
|
||||
inputStr += event.key
|
||||
}
|
||||
}
|
||||
}
|
||||
// 处理输入
|
||||
const solveInput = () => {
|
||||
console.log(inputStr)
|
||||
// 空输入
|
||||
if (inputStr == '') {
|
||||
closePreview('空输入。')
|
||||
}
|
||||
// 解析
|
||||
const splitArray = inputStr.split('&')
|
||||
if (splitArray.length != 2) {
|
||||
closePreview('请扫描正确的二维码。')
|
||||
} else {
|
||||
imageRequest.productId = splitArray[0]
|
||||
imageRequest.boxNo = splitArray[1]
|
||||
// 查询图纸
|
||||
findImage()
|
||||
}
|
||||
inputStr = ''
|
||||
}
|
||||
// 查询图纸
|
||||
const findImage = () => {
|
||||
if (imageRequest.productId == '' || imageRequest.boxNo == '') {
|
||||
closePreview('请求缺少成品号和料盒号。')
|
||||
}
|
||||
requestImageDetail(imageRequest).then(res => {
|
||||
const response = res.data
|
||||
console.log(response)
|
||||
if (response.code == 0) {
|
||||
const results = response.data
|
||||
if (results == undefined || results.length != 1) {
|
||||
closePreview('无图纸。')
|
||||
return
|
||||
}
|
||||
const image = results[0]
|
||||
openPreview(image)
|
||||
} else {
|
||||
closePreview(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
closePreview("查询图纸失败,请检查。")
|
||||
})
|
||||
}
|
||||
// 打开图纸
|
||||
const openPreview = (image) => {
|
||||
imageData.url = image.imageIp + image.imagePath + image.imageName
|
||||
imageData.base64 = 'data:image/png;base64,' + image.imageDetail
|
||||
imageData.name = image.imageName
|
||||
imageData.errMsg = ''
|
||||
}
|
||||
// 关闭图纸
|
||||
const closePreview = (errMsg) => {
|
||||
imageData.url = ''
|
||||
imageData.base64 = ''
|
||||
imageData.name = ''
|
||||
imageData.errMsg = errMsg
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.image-full {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.image-full .error-slot {
|
||||
color: red;
|
||||
font-size: 50px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
337
src/layout/standSettings.vue
Normal file
337
src/layout/standSettings.vue
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="standTypeQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择站台类型" :options="standTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="standList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.standId" v-model="standId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="standId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="allowIn" label="允许入库" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="allowOut" label="允许出库" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="standStatus" label="状态" :formatter="standStatusFormat" show-overflow-tooltip
|
||||
min-width="120px" />
|
||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="areaId" label="区域" min-width="120px" />
|
||||
<el-table-column prop="standType" label="类型" :formatter="standTypeFormat" min-width="120px" />
|
||||
<el-table-column prop="standIp" label="电脑ip地址" min-width="120px" />
|
||||
<el-table-column prop="outerId" label="外部编号" min-width="120px" />
|
||||
<el-table-column prop="lastUseTime" label="上次使用时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="pickGoods" label="拣选料号" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="pickVehicle" label="拣选箱号" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="pickTip" label="提示" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="pickVehicleCount" label="站台料箱数量" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="编辑站台信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="standFormRef" :model="standFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="站台号" prop="standId">
|
||||
<el-input v-model="standFormEntity.standId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="isLock">
|
||||
<el-select-v2 v-model="standFormEntity.standType" placeholder="请选择类型"
|
||||
:options="standTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="锁定" prop="isLock">
|
||||
<el-select-v2 v-model="standFormEntity.isLock" placeholder="请选择是否锁定"
|
||||
:options="isLockOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="standStatus">
|
||||
<el-select-v2 v-model="standFormEntity.standStatus" placeholder="请选择站台状态"
|
||||
:options="standStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="上次使用时间" prop="lastUseTime">
|
||||
<el-input v-model="standFormEntity.lastUseTime" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="站台料箱数量" prop="pickVehicleCount">
|
||||
<el-input-number v-model.number="standFormEntity.pickVehicleCount"
|
||||
controls-position="right" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitInfo(standFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getStandsByPage, updateStandInfo } from '@/api/stand.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'standSettings',
|
||||
data() {
|
||||
return {
|
||||
standList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
standIdQuery: '',
|
||||
standTypeQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
standId: '',
|
||||
standFormEntity: reactive({}),
|
||||
standFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
standTypeOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '入库站台'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '备料站台'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '堆垛机'
|
||||
}
|
||||
],
|
||||
isLockOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '未锁定'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已锁定'
|
||||
},
|
||||
],
|
||||
standStatusOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '不可用'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
standId: this.standIdQuery.trim(),
|
||||
standType: this.standTypeQuery == -99 ? null : this.standTypeQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getStandsByPage(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.standList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询站台信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
standTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1:
|
||||
return '入库站台'
|
||||
case 2:
|
||||
return '备料站台'
|
||||
case 3:
|
||||
return '堆垛机'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
isLockFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未锁定'
|
||||
case 1:
|
||||
return '已锁定'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
standStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '可用'
|
||||
case 1:
|
||||
return '不可用'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.standTypeQuery = -99
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.standId = row.standId
|
||||
this.standFormEntity = {
|
||||
standId: row.standId,
|
||||
standType: row.standType,
|
||||
isLock: row.isLock,
|
||||
standStatus: row.standStatus,
|
||||
lastUseTime: row.lastUseTime,
|
||||
pickVehicleCount: row.pickVehicleCount,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
standId: formData.standId,
|
||||
standType: formData.standType,
|
||||
isLock: formData.isLock,
|
||||
standStatus: formData.standStatus,
|
||||
lastUseTime: formData.lastUseTime,
|
||||
pickVehicleCount: formData.pickVehicleCount,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStandInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新站台信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新站台信息失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.standId = row.standId
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
590
src/layout/stock.vue
Normal file
590
src/layout/stock.vue
Normal file
|
|
@ -0,0 +1,590 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="stockQueryFormRef" :model="stockQuery" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="stockQuery.vehicleId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="stockQuery.goodsId" clearable />
|
||||
<!-- <el-autocomplete v-model="stockQuery.goodsId" :fetch-suggestions="filterGoodsId"
|
||||
popper-class="my-autocomplete" placeholder="料号" @select="handleSelectGoodsId"
|
||||
style="width: 196px;">
|
||||
<template #default="{ item }">
|
||||
<div>
|
||||
料号:<span class="goods_id">{{ item.goodsId }}</span>
|
||||
;
|
||||
名称:<span class="goods_name">{{ item.goodsDesc }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-input v-model="stockQuery.locationId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存状态">
|
||||
<el-select-v2 v-model="stockQuery.stockStatus" placeholder="库存状态"
|
||||
:options="addAllOptionOfOptions(stockStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料状态">
|
||||
<el-select-v2 v-model="stockQuery.goodsStatus" placeholder="物料状态"
|
||||
:options="addAllOptionOfOptions(goodsStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始日期">
|
||||
<el-date-picker v-model="stockQuery.fromDate" type="date" placeholder="起始日期"
|
||||
:shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker v-model="stockQuery.toDate" type="date" placeholder="结束日期"
|
||||
:shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary"
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||
@click="search()">查询库存</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||
@click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success" disabled
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||
@click="clearInput()">导出excel</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="displayStocks" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow" :row-style="rowStyle"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.stockId" v-model="stockId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stockId" label="库存编号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="物料号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="locationId" label="库位" :formatter="locationFormat" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="totalNum" label="入库数量" min-width="120px" />
|
||||
<el-table-column prop="remainNum" label="剩余数量" min-width="120px" />
|
||||
<el-table-column prop="goodsStatus" label="物料状态" :formatter="goodsStatusFormat"
|
||||
min-width="120px" sortable="custom" />
|
||||
<el-table-column prop="stockStatus" label="库存状态" :formatter="stockStatusFormat" fixed="right"
|
||||
min-width="120px" sortable="custom" />
|
||||
<el-table-column prop="firstInTime" label="上架时间" sortable="custom" :formatter="timeFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="firstInUser" label="上架用户" min-width="120px" />
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" sortable="custom" :formatter="timeFormat"
|
||||
min-width="140px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
<!-- <el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存编号" prop="stockId">
|
||||
<el-input v-model="stockFormEntity.stockId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="stockFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="stockFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料名" prop="goodsName">
|
||||
<el-input v-model="stockFormEntity.goodsName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入库数量" prop="totalNum">
|
||||
<el-input-number v-model.number="stockFormEntity.totalNum" controls-position="right"
|
||||
:min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="剩余数量(为0时删除库存)" prop="remainNum">
|
||||
<el-input-number v-model.number="stockFormEntity.remainNum"
|
||||
controls-position="right" :min="0" :max="stockFormEntity.totalNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="stockFormEntity.locationId" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="未使用天数" prop="noUseDays">
|
||||
<el-input-number v-model.number="stockFormEntity.noUseDays"
|
||||
controls-position="right" :min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="库存状态" prop="stockStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
|
||||
:options="stockStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料状态" prop="goodsStatus">
|
||||
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
|
||||
:options="goodsStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="盘点任务号" prop="inventoryTaskId">
|
||||
<el-input v-model="stockFormEntity.inventoryTaskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否盘点" prop="isInventory">
|
||||
<el-input v-model="stockFormEntity.isInventory" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="stockFormEntity.createTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
||||
<el-input v-model="stockFormEntity.lastUpdateTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
||||
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { queryStocksByPage, updateStockInfo } from '@/api/stock.js'
|
||||
import { getGoodsInfoByGoodsId } from '@/api/goods.js'
|
||||
import { downloadStockExcel } from '@/api/excel.js'
|
||||
import { dateFormatter, locationFormatter, timeFormatter, yesOrNoFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { labelPosition, shortcuts } from '@/constant/form'
|
||||
import { stockStatusOptions, goodsStatusOptions } from '@/constant/options'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let displayStocks = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['firstInTime', true]]),
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let stockQuery = reactive({
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
locationId: '',
|
||||
stockStatus: -99,
|
||||
goodsStatus: -99,
|
||||
fromDate: null,
|
||||
toDate: null
|
||||
})
|
||||
let stockQueryFormRef = ref()
|
||||
let goodsIdList = ref([])
|
||||
let showStockEditFlag = ref(false)
|
||||
let stockId = ''
|
||||
let stockFormRef = ref()
|
||||
let stockFormEntity = reactive({})
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.vehicleId = stockQuery.vehicleId
|
||||
request.goodsId = stockQuery.goodsId
|
||||
request.locationId = stockQuery.locationId
|
||||
request.stockStatus = stockQuery.stockStatus == -99 ? null : stockQuery.stockStatus
|
||||
request.goodsStatus = stockQuery.goodsStatus == -99 ? null : stockQuery.goodsStatus
|
||||
request.fromDate = stockQuery.fromDate
|
||||
request.toDate = stockQuery.toDate
|
||||
queryStocksByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayStocks.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
displayStocks.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询库存信息异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
stockQuery.vehicleId = '',
|
||||
stockQuery.goodsId = '',
|
||||
stockQuery.locationId = '',
|
||||
stockQuery.stockStatus = -99,
|
||||
stockQuery.goodsStatus = -99,
|
||||
stockQuery.fromDate = null,
|
||||
stockQuery.toDate = null
|
||||
}
|
||||
const loadAllGoodsInfo = () => {
|
||||
const request = {
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getGoodsInfoByGoodsId(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.goodsList = tableResponse.returnData
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询物料信息异常。')
|
||||
})
|
||||
}
|
||||
|
||||
const filterGoodsId = (queryString, cb) => {
|
||||
const results = queryString
|
||||
? this.goodsList.filter(this.createFilter(queryString))
|
||||
: this.goodsList
|
||||
// call callback function to return suggestion objects
|
||||
cb(results)
|
||||
}
|
||||
const createFilter = (queryString) => {
|
||||
return (restaurant) => {
|
||||
return (
|
||||
restaurant.goodsId.toLowerCase().indexOf(queryString.toLowerCase()) != -1
|
||||
)
|
||||
}
|
||||
}
|
||||
const handleSelectGoodsId = (item) => {
|
||||
this.goodsIdQuery = item.goodsId
|
||||
}
|
||||
const locationFormat = (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
}
|
||||
const dateFormat = (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const goodsStatusFormat = (row, column, cellValue, index) => {
|
||||
if (cellValue === 0) {
|
||||
return '正常'
|
||||
} else if (cellValue === 1) {
|
||||
return '不合格'
|
||||
} else if (cellValue === 2) {
|
||||
return '延期'
|
||||
} else if (cellValue === 3) {
|
||||
return '过期'
|
||||
} else if (cellValue === 5) {
|
||||
return '长时间未使用'
|
||||
}
|
||||
}
|
||||
const stockStatusFormat = (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '在库中'
|
||||
case 1:
|
||||
return '出库中'
|
||||
case 2:
|
||||
return '已出库'
|
||||
case 3:
|
||||
return '回库中'
|
||||
case 4:
|
||||
return '盘点中'
|
||||
case 9:
|
||||
return '库存锁定'
|
||||
default:
|
||||
return '异常'
|
||||
}
|
||||
}
|
||||
const yesOrNoFormat = (row, column, cellValue, index) => {
|
||||
return yesOrNoFormatter(cellValue)
|
||||
}
|
||||
const rowStyle = ({ row, rowIndex }) => {
|
||||
if (row.goodsStatus == 3) {
|
||||
return { "color": "red" }
|
||||
}
|
||||
if (row.goodsStatus == 5) {
|
||||
return { "color": "yellow" }
|
||||
}
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
stockId = row.stockId
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadStockExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "库存报表" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
const editCurrentRowStock = (row) => {
|
||||
this.stockFormEntity = {
|
||||
stockId: row.stockId,
|
||||
locationId: row.locationId,
|
||||
vehicleId: row.vehicleId,
|
||||
stockStatus: row.stockStatus,
|
||||
createTime: row.createTime,
|
||||
lastUpdateTime: row.lastUpdateTime,
|
||||
lastUpdateUser: row.lastUpdateUser,
|
||||
isInventory: row.isInventory,
|
||||
inventoryTaskId: row.inventoryTaskId,
|
||||
noUseDays: row.noUseDays,
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsStatus: row.goodsStatus,
|
||||
remainNum: row.remainNum,
|
||||
totalNum: row.totalNum
|
||||
}
|
||||
this.dialogVisible = true
|
||||
}
|
||||
const submitStockInfo = () => {
|
||||
const request = {
|
||||
stockId: this.stockFormEntity.stockId,
|
||||
locationId: this.stockFormEntity.locationId,
|
||||
vehicleId: this.stockFormEntity.vehicleId,
|
||||
stockStatus: this.stockFormEntity.stockStatus,
|
||||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库存成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库存失败')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
</style>
|
||||
226
src/layout/stockUpdateRecord.vue
Normal file
226
src/layout/stockUpdateRecord.vue
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="reasonQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择更新原因" :options="reasonOptions" @change="search()"></el-select-v2>
|
||||
<el-date-picker v-model="updateTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="recordList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.recordId" v-model="recordId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="recordId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="stockId" label="库存编号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="料号" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="locationBefore" label="原位置" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="locationAfter" label="新位置" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="quantityBefore" label="原数量" min-width="120px" />
|
||||
<el-table-column prop="quantityAfter" label="新数量" min-width="120px" />
|
||||
<el-table-column prop="reason" label="原因" fixed="right" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="updateTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="updateUser" label="操作用户" show-overflow-tooltip min-width="120px" />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getStockUpdateRecord } from '@/api/stock.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'stockUpdateRecord',
|
||||
data() {
|
||||
return {
|
||||
recordList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
vehicleIdQuery: '',
|
||||
goodsIdQuery: '',
|
||||
reasonQuery: '',
|
||||
updateTimeQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
loading: true,
|
||||
recordId: '',
|
||||
reasonOptions: [
|
||||
{
|
||||
value: '',
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: '备料拣选更新',
|
||||
label: '备料拣选更新'
|
||||
},
|
||||
{
|
||||
value: '站台确认更新',
|
||||
label: '站台确认更新'
|
||||
},
|
||||
{
|
||||
value: '直接物料非计划领料回库更新',
|
||||
label: '直接物料非计划领料回库更新'
|
||||
},
|
||||
{
|
||||
value: '站台处理箱料错误',
|
||||
label: '站台处理箱料错误'
|
||||
},
|
||||
{
|
||||
value: '界面修改库存',
|
||||
label: '界面修改库存'
|
||||
},
|
||||
{
|
||||
value: '界面删除库存',
|
||||
label: '界面删除库存'
|
||||
},
|
||||
{
|
||||
value: '界面增加库存',
|
||||
label: '界面增加库存'
|
||||
},
|
||||
{
|
||||
value: '入库更新库存',
|
||||
label: '入库更新库存'
|
||||
},
|
||||
{
|
||||
value: '入库增加库存',
|
||||
label: '入库增加库存'
|
||||
},
|
||||
{
|
||||
value: '整出',
|
||||
label: '整出'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
reason: this.reasonQuery.trim(),
|
||||
updateTime: timeFormatter(this.updateTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getStockUpdateRecord(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.recordList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询库存更新记录错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.vehicleIdQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.reasonQuery = ''
|
||||
this.updateTimeQuery = null
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.recordId = row.recordId
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
379
src/layout/taskMonitor.vue
Normal file
379
src/layout/taskMonitor.vue
Normal file
|
|
@ -0,0 +1,379 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 196px; margin-right: 10px;" placeholder="料号" />
|
||||
<el-input v-model="vehicleIdQuery" style="width: 196px; margin-right: 10px;" placeholder="箱号" />
|
||||
<el-select-v2 v-model="taskTypeQuery" style="width: 196px; margin-right: 10px;" placeholder="请选择任务类型"
|
||||
:options="taskTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="taskStatusQuery" style="width: 196px; margin-right: 10px;" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@row-click="getCurrentRow">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowTask(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="任务信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="taskFormRef" :model="taskFormEntity" :label-position="labelPosition" label-width="100px"
|
||||
style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务号" prop="taskId">
|
||||
<el-input v-model="taskFormEntity.taskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务优先级" prop="taskPriority">
|
||||
<el-input-number v-model.number="taskFormEntity.taskPriority" controls-position="right"
|
||||
:min="1" :max="9" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料箱号" prop="vehicleId">
|
||||
<el-input v-model="taskFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="taskFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="起点" prop="origin">
|
||||
<el-input v-model="taskFormEntity.origin" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" v-if="taskFormEntity.taskType == 1">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-select-v2 v-model="taskFormEntity.destination"
|
||||
:options="availableLocationOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="taskFormEntity.taskType == 2">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-input v-model="taskFormEntity.destination" disabled />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-input v-model="taskFormEntity.destination" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务类型" prop="taskType">
|
||||
<el-select-v2 v-model="taskFormEntity.taskType" placeholder="请选择任务类型" disabled
|
||||
:options="taskTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态" prop="taskStatus">
|
||||
<el-select-v2 v-model="taskFormEntity.taskStatus" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitTaskInfo(taskFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getTasksByPage, updateTaskInfo } from '@/api/task.js'
|
||||
import { dateFormatter, taskStatusFormatter, timeFormatter, dueFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'taskMonitor',
|
||||
data() {
|
||||
return {
|
||||
tasks: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
taskTypeQuery: -99,
|
||||
taskStatusQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
taskFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
taskFormRef: ref(),
|
||||
rules: reactive({}),
|
||||
taskId: '',
|
||||
taskTypeOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '所有类型'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '入库'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '出库'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '盘点'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '移库'
|
||||
},
|
||||
],
|
||||
taskStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '所有状态'
|
||||
},
|
||||
{
|
||||
value: -2,
|
||||
label: '重复入库'
|
||||
},
|
||||
{
|
||||
value: -1,
|
||||
label: '暂存'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '新建待下发'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已下发'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '开始执行'
|
||||
},
|
||||
{
|
||||
value: 8,
|
||||
label: '拣选中'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '盘点中'
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
label: '任务完成'
|
||||
},
|
||||
{
|
||||
value: 998,
|
||||
label: '任务取消'
|
||||
},
|
||||
{
|
||||
value: 999,
|
||||
label: '任务异常'
|
||||
}
|
||||
],
|
||||
availableLocationOptions: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1: return '入库'
|
||||
case 2: return '出库'
|
||||
case 3: return '盘点'
|
||||
case 9: return '移库'
|
||||
default: return '未知'
|
||||
}
|
||||
},
|
||||
dueFormat: (row, column, cellValue, index) => {
|
||||
return dueFormatter(cellValue)
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
taskType: this.taskTypeQuery == -99 ? null : this.taskTypeQuery,
|
||||
taskStatus: this.taskStatusQuery == -99 ? null : this.taskStatusQuery,
|
||||
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
|
||||
console.log(this.tasks)
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询任务错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
},
|
||||
editCurrentRowTask(row) {
|
||||
console.log(row)
|
||||
// if (row.taskType == 1) {
|
||||
// this.availableLocationOptions = []
|
||||
// var currentOption = {
|
||||
// value: row.destination,
|
||||
// label: locationFormatter(row.destination)
|
||||
// }
|
||||
// this.availableLocationOptions.push(currentOption)
|
||||
// // 生成可用库位列表
|
||||
// const requestParam = {
|
||||
// areaId: 1
|
||||
// }
|
||||
// getAvailableLocations(requestParam).then(res => {
|
||||
// if (res.data.code == 0) {
|
||||
// for (const location of res.data.returnData) {
|
||||
// var newOption = {}
|
||||
// newOption.value = location.locationId
|
||||
// newOption.label = locationFormatter(location.locationId)
|
||||
// this.availableLocationOptions.push(newOption)
|
||||
// }
|
||||
// }
|
||||
// }).catch(err => {
|
||||
// errorBox('查找可用库位失败:' + err)
|
||||
// })
|
||||
// }
|
||||
this.taskFormEntity = {
|
||||
taskId: row.taskId,
|
||||
taskPriority: row.taskPriority,
|
||||
vehicleId: row.vehicleId,
|
||||
goodsId: row.goodsRelated == null ? '' : row.goodsRelated.goodsId,
|
||||
origin: row.origin,
|
||||
destination: row.destination,
|
||||
taskType: row.taskType,
|
||||
taskStatus: row.taskStatus,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitTaskInfo() {
|
||||
if (this.taskFormEntity.taskStatus == null || this.taskFormEntity.taskStatus == undefined) {
|
||||
errorBox('请选择任务状态')
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
taskId: this.taskFormEntity.taskId,
|
||||
taskStatus: this.taskFormEntity.taskStatus,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateTaskInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('修改任务成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('修改任务失败')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.taskId = row.taskId
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
462
src/layout/testView.vue
Normal file
462
src/layout/testView.vue
Normal file
|
|
@ -0,0 +1,462 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="main-area">
|
||||
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="计划开工日期" prop="planStartDate">
|
||||
<el-date-picker v-model="workFormEntity.planStartDate" type="date"
|
||||
placeholder="选择开工日期" :shortcuts="shortcuts" style="width: 196px;" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单号" prop="workOrder">
|
||||
<el-select v-model="workFormEntity.workOrder" filterable default-first-option
|
||||
placeholder="请选择工单号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.workOrder = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.workOrder" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="成品号" prop="productId">
|
||||
<el-select v-model="workFormEntity.productId" filterable default-first-option
|
||||
placeholder="请选择成品号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.productId = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.productId" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号" prop="singleProductId">
|
||||
<el-select v-model="workFormEntity.singleProductId" filterable default-first-option
|
||||
placeholder="请选择单片号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.singleProductId = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.singleProductId" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="料盒号" prop="boxNo">
|
||||
<el-select v-model="workFormEntity.boxNo" filterable default-first-option
|
||||
placeholder="请选择料盒号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.boxNo = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.boxNo" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原材料号" prop="goodsId">
|
||||
<el-select v-model="workFormEntity.goodsId" filterable default-first-option
|
||||
placeholder="请选择原材料号" style="width: 196px" :loading="optionLoading" remote
|
||||
:remote-method="(query) => {
|
||||
workFormQuery.goodsId = query
|
||||
initWorkOptions()
|
||||
}" remote-show-suffix reserve-keyword clearable>
|
||||
<el-option v-for="item in workOptions.goodsId" :key="item" :label="item"
|
||||
:value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmStart()">确认配料</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="resetWorkFormQuery()">清除选择</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="confirm-area">
|
||||
<el-form ref="confirmRef" :model="confirmEntity" :label-position="labelPosition" label-width="158px"
|
||||
style="max-width: 100%" :rules="confirmRules" status-icon>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-row style="border-bottom: dashed 1px black;">
|
||||
<el-form-item label="工单号" prop="workOrder">
|
||||
<el-input v-model="confirmEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品号" prop="productId">
|
||||
<el-input v-model="confirmEntity.productId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号" prop="singleProductId">
|
||||
<el-input v-model="confirmEntity.singleProductId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="goodsId">
|
||||
<el-input v-model="confirmEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="料盒号" prop="boxNo">
|
||||
<el-input v-model="confirmEntity.boxNo" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划拣选数量" prop="planPickQty">
|
||||
<el-input v-model="confirmEntity.planPickQty" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际拣选数量" prop="realPickQty">
|
||||
<el-input-number v-model.number="confirmEntity.realPickQty"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="confirmEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="goodsId">
|
||||
<el-input v-model="confirmEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否库外料" prop="isOut">
|
||||
<el-input v-model="confirmEntity.isOut" :formatter="formatter => {
|
||||
return confirmEntity.isOut === 1 ? '是' : '否'
|
||||
}" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="存放区域" prop="putArea">
|
||||
<el-input v-model="confirmEntity.putArea" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划剩余数量" prop="planRemainQty">
|
||||
<el-input v-model="confirmEntity.planRemainQty" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际剩余数量" prop="realRemainQty">
|
||||
<el-input-number v-model.number="confirmEntity.realRemainQty"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="primary"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="showBoxSummary()">显示料盒</el-button>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmOrRelease()">确认/放行</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="resetWorkFormQuery()">打印标签</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<el-dialog v-model="boxShowFlag" title="料盒总览" width="50%" center>
|
||||
<el-table :data="boxSummary" stripe border class="table-class" max-height="450px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="workOrder" label="工单号" fixed="left" />
|
||||
<el-table-column prop="productId" label="成品号" />
|
||||
<el-table-column prop="singleProductId" label="单片号" />
|
||||
<el-table-column prop="boxNo" label="料盒号" />
|
||||
<el-table-column prop="boxQty" label="料盒数量" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { queryKateWorks, initWorks, getCurrentWorks, confirmCurrentWork } from '@/api/kateWork.js'
|
||||
import { errorBox, warningBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage, formatter } from 'element-plus'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { reactive, ref } from 'vue'
|
||||
import loading from '@/utils/loading'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'test',
|
||||
data() {
|
||||
return {
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName,
|
||||
timer: '',
|
||||
labelPosition: 'top',
|
||||
workFormRef: ref(),
|
||||
workFormEntity: reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
goodsId: '',
|
||||
planStartDate: null
|
||||
}),
|
||||
workFormQuery: reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
goodsId: '',
|
||||
}),
|
||||
rules: reactive({
|
||||
workOrder: [
|
||||
{ required: true, message: '请选择工单号。' }
|
||||
]
|
||||
}),
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
optionLoading: false,
|
||||
workOptions: {
|
||||
workOrder: [],
|
||||
productId: [],
|
||||
singleProductId: [],
|
||||
boxNo: [],
|
||||
goodsId: []
|
||||
},
|
||||
confirmRef: ref(),
|
||||
confirmEntity: reactive({}),
|
||||
confirmRules: reactive({}),
|
||||
boxShowFlag: false,
|
||||
boxSummary: [],
|
||||
pauseGetWorkFlag: true,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initWorkOptions()
|
||||
this.timer = setInterval(() => {
|
||||
this.getWork()
|
||||
}, 1000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 初始化工单options
|
||||
initWorkOptions() {
|
||||
const request = {
|
||||
workOrder: this.workFormQuery.workOrder != '' ? this.workFormQuery.workOrder : this.workFormEntity.workOrder,
|
||||
productId: this.workFormQuery.productId != '' ? this.workFormQuery.productId : this.workFormEntity.productId,
|
||||
singleProductId: this.workFormQuery.singleProductId != '' ? this.workFormQuery.singleProductId : this.workFormEntity.singleProductId,
|
||||
boxNo: this.workFormQuery.boxNo != '' ? this.workFormQuery.boxNo : this.workFormEntity.boxNo,
|
||||
goodsId: this.workFormQuery.goodsId != '' ? this.workFormQuery.goodsId : this.workFormEntity.goodsId,
|
||||
planStartDate: dateFormatter(this.workFormEntity.planStartDate)
|
||||
}
|
||||
this.optionLoading = true
|
||||
queryKateWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
this.workOptions = response.data
|
||||
} else {
|
||||
this.workOptions = {
|
||||
workOrder: [],
|
||||
productId: [],
|
||||
singleProductId: [],
|
||||
boxNo: [],
|
||||
goodsId: []
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询选项错误。')
|
||||
}).finally(() => {
|
||||
this.optionLoading = false
|
||||
})
|
||||
},
|
||||
// 重置参数
|
||||
resetWorkFormQuery() {
|
||||
const planStartDate = this.workFormEntity.planStartDate
|
||||
this.workFormEntity = reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
goodsId: '',
|
||||
planStartDate: planStartDate
|
||||
})
|
||||
},
|
||||
// 确认配料
|
||||
confirmStart() {
|
||||
const request = {
|
||||
workOrder: this.workFormEntity.workOrder,
|
||||
productId: this.workFormEntity.productId,
|
||||
singleProductId: this.workFormEntity.singleProductId,
|
||||
boxNo: this.workFormEntity.boxNo,
|
||||
goodsId: this.workFormEntity.goodsId,
|
||||
planStartDate: dateFormatter(this.workFormEntity.planStartDate),
|
||||
standId: 'P1',
|
||||
userName: this.userName
|
||||
}
|
||||
loading.open()
|
||||
initWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
// 显示料盒总览
|
||||
showBoxSummary() {
|
||||
this.boxShowFlag = true
|
||||
},
|
||||
getWork() {
|
||||
if (this.pauseGetWorkFlag) {
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
standId: this.standId,
|
||||
userName: this.userName
|
||||
}
|
||||
getCurrentWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
// 设置form
|
||||
this.confirmEntity = {
|
||||
workOrder: response.data.orderConfirmVo.workOrder,
|
||||
productId: response.data.orderConfirmVo.productId,
|
||||
singleProductId: response.data.orderConfirmVo.singleProductId,
|
||||
boxNo: response.data.orderConfirmVo.boxNo,
|
||||
goodsId: response.data.orderConfirmVo.goodsId,
|
||||
planPickQty: response.data.orderConfirmVo.planPickQty,
|
||||
realPickQty: response.data.orderConfirmVo.realPickQty,
|
||||
stockId: response.data.stockConfirmVo.stockId,
|
||||
vehicleId: response.data.stockConfirmVo.vehicleId,
|
||||
goodsId: response.data.stockConfirmVo.goodsId,
|
||||
planRemainQty: response.data.stockConfirmVo.planRemainQty,
|
||||
realRemainQty: response.data.stockConfirmVo.realRemainQty,
|
||||
isOut: response.data.stockConfirmVo.isOut,
|
||||
putArea: response.data.stockConfirmVo.putArea,
|
||||
}
|
||||
this.pauseGetWorkFlag = true
|
||||
} else if (response.code == 400) {
|
||||
// 警告,弹框
|
||||
this.pauseGetWorkFlag = true
|
||||
warningBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.pauseGetWorkFlag = true
|
||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||
})
|
||||
},
|
||||
confirmOrRelease() {
|
||||
const request = {
|
||||
orderConfirm: {
|
||||
workOrder: this.confirmEntity.workOrder,
|
||||
productId: this.confirmEntity.productId,
|
||||
singleProductId: this.confirmEntity.singleProductId,
|
||||
boxNo: this.confirmEntity.boxNo,
|
||||
goodsId: this.confirmEntity.goodsId,
|
||||
planPickQty: this.confirmEntity.planPickQty,
|
||||
realPickQty: this.confirmEntity.realPickQty,
|
||||
},
|
||||
stockConfirm: {
|
||||
stockId: this.confirmEntity.stockId,
|
||||
vehicleId: this.confirmEntity.vehicleId,
|
||||
goodsId: this.confirmEntity.goodsId,
|
||||
planRemainQty: this.confirmEntity.planRemainQty,
|
||||
realRemainQty: this.confirmEntity.realRemainQty,
|
||||
isOut: this.confirmEntity.isOut,
|
||||
putArea: this.confirmEntity.putArea,
|
||||
},
|
||||
standId: this.standId,
|
||||
userName: this.userName
|
||||
}
|
||||
confirmCurrentWork(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
// 设置form
|
||||
this.confirmEntity = reactive({})
|
||||
this.pauseGetWorkFlag = false
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
// 错误,弹框
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.main-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.confirm-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 10px 5px 10px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
</style>
|
||||
331
src/layout/vehicle.vue
Normal file
331
src/layout/vehicle.vue
Normal file
|
|
@ -0,0 +1,331 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="locationQuery" style="width: 158px; margin-right: 10px;" placeholder="位置"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱"
|
||||
:options="isEmptyOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row v-if="selVehicle == null">
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }" @sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
||||
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="空箱" prop="isEmpty">
|
||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||
:options="isEmptyOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="vehicleStatus">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择料箱状态"
|
||||
:options="vehicleStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
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 { toUnderScoreCase } from '@/utils/stringUtils.js'
|
||||
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||
import store from '@/store'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: '',
|
||||
isAsc: true,
|
||||
queryKey: '',
|
||||
locationQuery: '',
|
||||
isEmptyQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
vehicleFormRef: ref(),
|
||||
rules: reactive({
|
||||
vehicleId: [
|
||||
{ required: true, message: '请输入箱号' }
|
||||
],
|
||||
currentLocation: [
|
||||
{ required: true, message: '请输入库位' }
|
||||
]
|
||||
}),
|
||||
// 是否空箱
|
||||
isEmptyOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '带料'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '空箱'
|
||||
}
|
||||
],
|
||||
// 料箱状态
|
||||
vehicleStatusOptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: '入库中'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '在库中'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '出库中'
|
||||
},
|
||||
{
|
||||
value: 99,
|
||||
label: '异常'
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
sortBy: this.sortBy,
|
||||
isAsc: this.isAsc,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getAllVehicles(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.vehicles = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询料箱信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
handleSortChange(data) {
|
||||
this.sortBy = toUnderScoreCase(data.prop)
|
||||
this.isAsc = data.order == 'ascending'
|
||||
this.search()
|
||||
},
|
||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||
return vehicleStatusFormatter(cellValue)
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
isEmptyFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == 0) {
|
||||
return '带料'
|
||||
}
|
||||
if (cellValue == 1) {
|
||||
return '空箱'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.queryKey = ''
|
||||
this.locationQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowVehicle(row) {
|
||||
this.vehicleFormEntity = {
|
||||
vehicleId: row.vehicleId,
|
||||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
lastInTime: row.lastInTime
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitVehicleInfo(formData) {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
lastInTime: formData.lastInTime,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateVehicleInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新料箱信息成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新料箱信息失败')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.vehicleId = row.vehicleId
|
||||
this.$emit('update:selVehicle', row)
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadVehicleExcel(request).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "料箱报表" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
261
src/layout/wmsConfig.vue
Normal file
261
src/layout/wmsConfig.vue
Normal file
|
|
@ -0,0 +1,261 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="configNameQuery" 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>
|
||||
<br />
|
||||
<el-table :data="configList" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.configId" v-model="configId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configId" label="配置id" fixed="left" min-width="80px" show-overflow-tooltip />
|
||||
<el-table-column prop="configName" label="配置名称" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px" />
|
||||
<el-table-column prop="configType" label="配置类型" :formatter="configTypeFormat" min-width="100px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper" :total="total" />
|
||||
<el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="configFormRef" :model="configFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置名称" prop="configName">
|
||||
<el-input v-model="configFormEntity.configName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置类型" prop="configType">
|
||||
<el-select-v2 v-model="configFormEntity.configType" placeholder="请选择配置类型"
|
||||
:options="configTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置键" prop="configKey">
|
||||
<el-input v-model="configFormEntity.configKey" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置值" prop="configValue">
|
||||
<el-input v-if="configFormEntity.configType == '1'" type="textarea" :rows="1"
|
||||
v-model="configFormEntity.configValue" placeholder="" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }">
|
||||
</el-input>
|
||||
<el-select v-if="configFormEntity.configType == '2'"
|
||||
v-model="configFormEntity.configValue" multiple collapse-tags collapse-tags-tooltip
|
||||
:placeholder="'请选择' + configFormEntity.configName">
|
||||
<el-option v-for="(value, index) in mails" :key="index" :label="value"
|
||||
:value="value" />
|
||||
</el-select>
|
||||
<el-switch v-if="configFormEntity.configType == '3'" style="margin-left: 5px;"
|
||||
v-model="configFormEntity.configValue" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitChange()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getConfigsByPage, updateConfig } from '@/api/config.js'
|
||||
import { configTypeFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import store from '@/store'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'wmsConfig',
|
||||
data() {
|
||||
return {
|
||||
pageInfo: {},
|
||||
configList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
configNameQuery: '',
|
||||
loading: false,
|
||||
configId: '',
|
||||
configFormRef: ref(),
|
||||
configFormEntity: reactive({}),
|
||||
rules: reactive({
|
||||
configId: [
|
||||
{ required: true, message: '请输入配置id' }
|
||||
],
|
||||
configName: [
|
||||
{ required: true, message: '请输入配置名称' }
|
||||
],
|
||||
configKey: [
|
||||
{ required: true, message: '请输入配置键' }
|
||||
],
|
||||
configValue: [
|
||||
{ required: true, message: '请输入配置值' }
|
||||
],
|
||||
configType: [
|
||||
{ required: true, message: '请输入配置类型' }
|
||||
]
|
||||
}),
|
||||
labelPosition: 'top',
|
||||
dialogVisible: false,
|
||||
configTypeOptions: [
|
||||
{
|
||||
value: '1',
|
||||
label: '输入框'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '下拉多选'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '开关'
|
||||
}
|
||||
],
|
||||
mails: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
configTypeFormat: (row, column, cellValue, index) => {
|
||||
return configTypeFormatter(cellValue)
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
configName: this.configNameQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getConfigsByPage(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.configList = tableResponse.returnData.lists
|
||||
this.configList.forEach((config) => {
|
||||
if (config.configType == '2') {
|
||||
const tempArray = config.configValue.split(';')
|
||||
config.configValue = tempArray
|
||||
}
|
||||
if (config.configKey == 'MAIL_ADDRESS') {
|
||||
const tempArray = config.configValue.split(';')
|
||||
this.mails = tempArray
|
||||
}
|
||||
})
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询配置错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.configNameQuery = ''
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.configId = row.configId
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.configFormEntity = reactive({
|
||||
configId: row.configId,
|
||||
configName: row.configName,
|
||||
configKey: row.configKey,
|
||||
configValue: row.configValue,
|
||||
configType: row.configType
|
||||
})
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitChange() {
|
||||
const request = {
|
||||
configId: this.configFormEntity.configId,
|
||||
configName: this.configFormEntity.configName,
|
||||
configKey: this.configFormEntity.configKey,
|
||||
configValue: this.configFormEntity.configValue,
|
||||
configType: this.configFormEntity.configType,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateConfig(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新系统配置成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新系统配置失败')
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
387
src/layout/wmsConfigNew.vue
Normal file
387
src/layout/wmsConfigNew.vue
Normal file
|
|
@ -0,0 +1,387 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="dbsQueryFormRef" :model="dbsQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="dbsQueryFormEntity.workOrder" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="零件号">
|
||||
<el-input v-model="dbsQueryFormEntity.productId" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="displayDbs" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.configId" v-model="configId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configId" label="配置id" fixed="left" min-width="80px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="configName" label="配置名称" fixed="left" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px" />
|
||||
<el-table-column prop="configType" label="配置类型" :formatter="configTypeFormat" min-width="100px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="configFormRef" :model="configFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置名称" prop="configName">
|
||||
<el-input v-model="configFormEntity.configName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置类型" prop="configType">
|
||||
<el-select-v2 v-model="configFormEntity.configType" placeholder="请选择配置类型"
|
||||
:options="configTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置键" prop="configKey">
|
||||
<el-input v-model="configFormEntity.configKey" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置值" prop="configValue">
|
||||
<el-input v-if="configFormEntity.configType == '1'" type="textarea" :rows="1"
|
||||
v-model="configFormEntity.configValue" placeholder="" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }">
|
||||
</el-input>
|
||||
<el-select v-if="configFormEntity.configType == '2'"
|
||||
v-model="configFormEntity.configValue" multiple collapse-tags
|
||||
collapse-tags-tooltip :placeholder="'请选择' + configFormEntity.configName">
|
||||
<el-option v-for="(value, index) in mails" :key="index" :label="value"
|
||||
:value="value" />
|
||||
</el-select>
|
||||
<el-switch v-if="configFormEntity.configType == '3'" style="margin-left: 5px;"
|
||||
v-model="configFormEntity.configValue" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitChange()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { queryDbsByPage } from '@/api/kateWork.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { labelPosition, shortcuts } from '@/constant/form'
|
||||
import { dbsStatusOptions } from '@/constant/options'
|
||||
import { exportDbsWithExcel } from '@/api/excel'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let displayConfigs = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['configId', true]]),// 按照工单顺序排序
|
||||
standId: store.getters.getStandId,
|
||||
userName: store.getters.getUserName
|
||||
})
|
||||
let configQueryFormEntity = reactive({
|
||||
configKey: '',
|
||||
configName: ''
|
||||
})
|
||||
let configQueryFormRef = ref()
|
||||
let showConfigEditFlag = ref(false)
|
||||
let configId = ''
|
||||
let configEditFormRef = ref()
|
||||
let configEditFormEntity = reactive({})
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.workOrder = dbsQueryFormEntity.workOrder
|
||||
request.productId = dbsQueryFormEntity.productId
|
||||
request.dbsStatus = dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus
|
||||
request.planStartDate = dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
queryDbsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayDbs.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
displayDbs.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询DBS数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
dbsQueryFormEntity.workOrder = ''
|
||||
dbsQueryFormEntity.productId = ''
|
||||
dbsQueryFormEntity.dbsStatus = -99
|
||||
dbsQueryFormEntity.planStartDate = null
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
dbsId = row.dbsId
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
workOrder: dbsQueryFormEntity.workOrder,
|
||||
productId: dbsQueryFormEntity.productId,
|
||||
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
}
|
||||
exportDbsWithExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
const editCurrentRowStock = (row) => {
|
||||
this.stockFormEntity = {
|
||||
stockId: row.stockId,
|
||||
locationId: row.locationId,
|
||||
vehicleId: row.vehicleId,
|
||||
stockStatus: row.stockStatus,
|
||||
createTime: row.createTime,
|
||||
lastUpdateTime: row.lastUpdateTime,
|
||||
lastUpdateUser: row.lastUpdateUser,
|
||||
isInventory: row.isInventory,
|
||||
inventoryTaskId: row.inventoryTaskId,
|
||||
noUseDays: row.noUseDays,
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsStatus: row.goodsStatus,
|
||||
remainNum: row.remainNum,
|
||||
totalNum: row.totalNum
|
||||
}
|
||||
this.dialogVisible = true
|
||||
}
|
||||
const submitStockInfo = () => {
|
||||
const request = {
|
||||
stockId: this.stockFormEntity.stockId,
|
||||
locationId: this.stockFormEntity.locationId,
|
||||
vehicleId: this.stockFormEntity.vehicleId,
|
||||
stockStatus: this.stockFormEntity.stockStatus,
|
||||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库存成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库存失败')
|
||||
})
|
||||
}
|
||||
const openUploadDialog = () => {
|
||||
showDbsUploadDialog.value = true
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
221
src/layout/wmsLog.vue
Normal file
221
src/layout/wmsLog.vue
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="请输入搜索信息" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-table :data="wmsLogs" stripe border v-loading="loading" class="table-class" max-height="650px"
|
||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.logId" v-model="logId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="logId" label="请求id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="logTitle" label="请求名称" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="logMethod" label="请求接口" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="logRequest" label="请求信息" :formatter="jsonFormat" min-width="180px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="logResponse" label="响应信息" :formatter="jsonFormat" min-width="180px" show-overflow-tooltip />
|
||||
<el-table-column prop="logIp" label="请求ip" min-width="120px" />
|
||||
<el-table-column prop="logTime" label="请求时间" :formatter="timeFormat" show-overflow-tooltip
|
||||
min-width="120px" />
|
||||
<el-table-column prop="logUser" label="请求用户" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="detailCurrentRowLog(scope.row)">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="日志详情" width="40%" draggable :show-close="false">
|
||||
<el-form ref="wmsLogFormRef" :model="wmsLogEntity" :label-position="labelPosition" label-width="100px"
|
||||
style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="请求id" prop="logId">
|
||||
<el-input v-model="wmsLogEntity.logId" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="请求名称" prop="logTitle">
|
||||
<el-input v-model="wmsLogEntity.logTitle" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="请求接口" prop="logMethod">
|
||||
<el-input v-model="wmsLogEntity.logMethod" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="请求ip" prop="logIp">
|
||||
<el-input v-model="wmsLogEntity.logIp" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="请求信息" prop="logRequest">
|
||||
<el-input type="textarea" :rows="2" v-model="wmsLogEntity.logRequest" placeholder=""
|
||||
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }" readonly>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="响应信息" prop="logResponse">
|
||||
<el-input type="textarea" :rows="2" v-model="wmsLogEntity.logResponse" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }" readonly>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="请求时间" prop="logTime">
|
||||
<el-input v-model="wmsLogEntity.logTime" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="请求用户" prop="logUser">
|
||||
<el-input v-model="wmsLogEntity.logUser" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { queryLogs } from '@/api/wmsLog.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { timeFormatter, jsonFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive } from 'vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'wmsLog',
|
||||
data() {
|
||||
return {
|
||||
wmsLogs: [],
|
||||
pageInfo: {},
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
queryKey: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
logId: '',
|
||||
wmsLogEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
wmsLogFormRef: ref(),
|
||||
rules: reactive({})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
queryParam: this.queryKey.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
queryLogs(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.wmsLogs = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询日志错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
jsonFormat: (row, column, cellValue, index) => {
|
||||
return jsonFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.queryKey = ''
|
||||
this.search
|
||||
},
|
||||
detailCurrentRowLog(row) {
|
||||
this.wmsLogEntity = {
|
||||
logId: row.logId,
|
||||
logTitle: row.logTitle,
|
||||
logMethod: row.logMethod,
|
||||
logRequest: jsonFormatter(row.logRequest),
|
||||
logResponse: jsonFormatter(row.logResponse),
|
||||
logTime: row.logTime,
|
||||
logUser: row.logUser,
|
||||
logIp: row.logIp,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.logId = row.logId
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
461
src/layout/workFlow.vue
Normal file
461
src/layout/workFlow.vue
Normal file
|
|
@ -0,0 +1,461 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px;" placeholder="工单号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px;" placeholder="工位/小盒子"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="lightStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择灯光状态" :options="lightStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="workStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择工作状态" :options="workStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="workFlowList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.workFlowId" v-model="workFlowId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="orderId" label="订单号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workStation" label="站台号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px" />
|
||||
<el-table-column prop="lightStatus" label="亮灯状态" :formatter="lightStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="工作流详细信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="workFlowFormRef" :model="workFlowFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="id" prop="workFlowId">
|
||||
<el-input v-model="workFlowFormEntity.workFlowId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input v-model="workFlowFormEntity.orderId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="站台号" prop="workStation">
|
||||
<el-input v-model="workFlowFormEntity.workStation" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单" prop="workOrder">
|
||||
<el-input v-model="workFlowFormEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工位/小盒子" prop="workCenter">
|
||||
<el-input v-model="workFlowFormEntity.workCenter" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="workFlowFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量" prop="needNum">
|
||||
<el-input-number v-model.number="workFlowFormEntity.needNum"
|
||||
controls-position="right" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已拣数量" prop="pickedNum">
|
||||
<el-input-number v-model.number="workFlowFormEntity.pickedNum"
|
||||
controls-position="right" :min="0" :max="workFlowFormEntity.needNum"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务状态" prop="lightStatus">
|
||||
<el-select-v2 v-model="workFlowFormEntity.lightStatus" placeholder="请选择亮灯状态"
|
||||
:options="lightStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态" prop="workStatus">
|
||||
<el-select-v2 v-model="workFlowFormEntity.workStatus" placeholder="请选择任务状态"
|
||||
:options="workStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="workFlowFormEntity.createTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="完成时间" prop="finishTime">
|
||||
<el-input v-model="workFlowFormEntity.finishTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="操作用户" prop="opUser">
|
||||
<el-input v-model="workFlowFormEntity.opUser" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitInfo(workFlowFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="uploadDialogVisible" title="工作流" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>上次更新</legend>
|
||||
<div style="padding: 5px;">
|
||||
<div style="display: flex; margin-bottom: 10px;">
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 30%; align-content: center;">时间:</div>
|
||||
<el-input v-model="uploadRecord.uploadTime" readonly />
|
||||
</div>
|
||||
<div style="display: flex; width: 100%; margin-left: 5px;">
|
||||
<div style="width: 30%; align-content: center;">人员:</div>
|
||||
<el-input v-model="uploadRecord.uploadUser" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 13%; align-content: center;">文件名:</div>
|
||||
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="title-area">
|
||||
<legend>再次更新</legend>
|
||||
<UploadExcelWorkFlow></UploadExcelWorkFlow>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getWorkFlows, updateWorkFlows } from '@/api/kateWork.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { queryUploadRecord } from '@/api/excel.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'pickTaskMonitor',
|
||||
data() {
|
||||
return {
|
||||
workFlowList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
workCenterQuery: '',
|
||||
goodsIdQuery: '',
|
||||
standIdQuery: '',
|
||||
lightStatusQuery: -99,
|
||||
workStatusQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
workFlowId: '',
|
||||
workFlowFormEntity: reactive({}),
|
||||
workFlowFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
lightStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '未亮灯'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已亮灯'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已拍灯'
|
||||
}
|
||||
],
|
||||
workStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '未开始'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '正在做'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已完成'
|
||||
}
|
||||
],
|
||||
uploadDialogVisible: false,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
lightStatus: this.lightStatusQuery == -99 ? null : this.lightStatusQuery,
|
||||
workStatus: this.workStatusQuery == -99 ? null : this.workStatusQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getWorkFlows(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.workFlowList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询工作流错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
lightStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未亮灯'
|
||||
case 1:
|
||||
return '已亮灯'
|
||||
case 2:
|
||||
return '已拍灯'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
workStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
return '正在做'
|
||||
case 2:
|
||||
return '已完成'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.workOrderQuery = ''
|
||||
this.workCenterQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.workFlowId = row.workFlowId
|
||||
this.workFlowFormEntity = {
|
||||
workFlowId: row.workFlowId,
|
||||
orderId: row.orderId,
|
||||
workStation: row.workStation,
|
||||
workOrder: row.workOrder,
|
||||
workCenter: row.workCenter,
|
||||
goodsId: row.goodsId,
|
||||
pickedNum: row.pickedNum,
|
||||
needNum: row.needNum,
|
||||
lightStatus: row.lightStatus,
|
||||
workStatus: row.workStatus,
|
||||
createTime: row.createTime,
|
||||
finishTime: row.finishTime,
|
||||
opUser: row.opUser
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
workFlowId: formData.workFlowId,
|
||||
pickedNum: formData.pickedNum,
|
||||
lightStatus: formData.lightStatus,
|
||||
workStatus: formData.workStatus,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateWorkFlows(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新工作流信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新工作流信息失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.workFlowId = row.workFlowId
|
||||
},
|
||||
openUploadDialog() {
|
||||
// 请求上传记录
|
||||
const param = {
|
||||
userName: store.getters.getUserName,
|
||||
fileDescription: 'WORKFLOW',
|
||||
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)
|
||||
errorBox('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
272
src/layout/workSummary.vue
Normal file
272
src/layout/workSummary.vue
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px;" placeholder="工单号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px;" placeholder="工位/小盒子"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-date-picker v-model="workDateQuery" type="date" placeholder="选择工作日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择缺料状态" :options="lackStatusOptions" @change="search()"></el-select-v2>
|
||||
<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: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="workSummaryList" stripe border v-loading="loading" class="table-class"
|
||||
highlight-current-row max-height="650px" @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.workFlowId" v-model="workFlowId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workStation" label="站台号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px" />
|
||||
<el-table-column prop="lackNum" label="缺件数量" min-width="120px" />
|
||||
<el-table-column prop="eLocationId" label="拣货位置" min-width="120px" />
|
||||
<el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="workDate" label="工作日期" :formatter="dateFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px" />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getWorkSummary } from '@/api/kateWork.js'
|
||||
import { downloadWorkSummaryExcel } from '@/api/excel.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'workFlow',
|
||||
data() {
|
||||
return {
|
||||
workSummaryList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
workCenterQuery: '',
|
||||
goodsIdQuery: '',
|
||||
standIdQuery: '',
|
||||
workDateQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
lackStatusQuery: -99,
|
||||
loading: true,
|
||||
workFlowId: '',
|
||||
lackStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '不缺'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '缺料'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getWorkSummary(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.workSummaryList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询工作总结错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
lackStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '不缺'
|
||||
case 1:
|
||||
return '缺料'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
workStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
return '正在做'
|
||||
case 2:
|
||||
return '已完成'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.workOrderQuery = ''
|
||||
this.workCenterQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.workDateQuery = null
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.workFlowId = row.workFlowId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadWorkSummaryExcel(request).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
let _fileName = "工作分析报表" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
20
src/main.js
Normal file
20
src/main.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import './styles/index.scss'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
import print from 'vue3-print-nb'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(store)
|
||||
app.use(router)
|
||||
app.use(ElementPlus, {locale: zhCn})
|
||||
app.use(print)
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component)
|
||||
}
|
||||
app.mount('#app')
|
||||
85
src/print/printDemo.vue
Normal file
85
src/print/printDemo.vue
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-button style="margin-left: 25px;" color="#626aef" v-print="'#printArea'"><el-icon>
|
||||
<Printer />
|
||||
</el-icon>打印标签</el-button>
|
||||
</el-row>
|
||||
<el-container class="content">
|
||||
<!-- <div style="width: 0;height: 0;overflow: hidden"> -->
|
||||
<div>
|
||||
<div id="printArea" class="objectDialogFlowPrint">
|
||||
<div class="myPrint">
|
||||
<div class="pageWarp" v-for="item in printTabs">
|
||||
<el-card :body-style="{ padding: '0px', display: 'flex' }">
|
||||
<qrcode-vue :value="item.name + '&' + item.quantity" :size="size" :foreground="color"
|
||||
level="H" style="margin: 15px" />
|
||||
<div style="padding: 14px; text-align: left;">
|
||||
<span style="font-size: 27pt;font-weight: bold; margin-left: 0;">零件号:{{ item.name
|
||||
}}</span>
|
||||
<br />
|
||||
<span style="font-size: 27pt;font-weight: bold; margin-left: 0;">数 量:{{
|
||||
item.quantity }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ref } from 'vue'
|
||||
import QrcodeVue from 'qrcode.vue'
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'printDemo',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
printTabs: [
|
||||
{
|
||||
name: '测试物料1',
|
||||
quantity: 1
|
||||
},
|
||||
{
|
||||
name: '测试物料2',
|
||||
quantity: 2
|
||||
}
|
||||
],
|
||||
size: ref(200),
|
||||
color: ref('#000000')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint .pageWarp {
|
||||
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
||||
page-break-after: always;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 5px auto;
|
||||
padding: auto;
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint .myPrint {
|
||||
/* 打印的时候是否显示底色 */
|
||||
print-color-adjust: exact;
|
||||
}</style>
|
||||
83
src/router/index.js
Normal file
83
src/router/index.js
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import HomeView from '@/views/HomeView.vue'
|
||||
import login from '@/views/login.vue'
|
||||
import systemCenter from'@/views/SystemCenter.vue'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: HomeView,
|
||||
redirect: '/stock',
|
||||
children: [
|
||||
{ path: '/stock', component: () => import('@/layout/stock.vue')},// 库存
|
||||
{ path: '/goodsIn', component: () => import('@/layout/goodsIn.vue') },// 入库
|
||||
{ path: '/goodsOut', component: () => import('@/layout/goodsOut.vue') },// 出库
|
||||
{ path: '/kitting', component: () => import('@/layout/kitting.vue') },// 配料
|
||||
{ path: '/inTaskRecord', component: () => import('@/layout/inTaskRecord.vue') },// 入库记录
|
||||
{ path: '/outTaskRecord', component: () => import('@/layout/outTaskRecord.vue') },// 出库记录
|
||||
{ path: '/location', component: () => import('@/layout/locationsTable.vue') },// 库位
|
||||
{ path: '/goods', component: () => import('@/layout/goods.vue') },// 物料
|
||||
{ path: '/standSettings', component: () => import('@/layout/standSettings.vue') },// 站台(库口)设置
|
||||
{ path: '/config', component: () => import('@/layout/wmsConfigNew.vue') },// 系统配置
|
||||
{ path: '/taskMonitor', component: () => import('@/layout/taskMonitor.vue') },// 任务监控
|
||||
{ path: '/vehicles', component: () => import('@/layout/vehicle.vue') },// 料箱监控
|
||||
{ path: '/inventory', component: () => import('@/layout/inventory.vue') },// 盘点
|
||||
{ path: '/inventoryRecord', component: () => import('@/layout/inventoryRecord.vue') },// 盘点记录
|
||||
{ path: '/wmsLog', component: () => import('@/layout/wmsLog.vue') },// 日志
|
||||
{ path: '/workFlow', component: () => import('@/layout/workFlow.vue') },// 工作流
|
||||
{ path: '/workSummary', component: () => import('@/layout/workSummary.vue') },// 工作总结
|
||||
{ path: '/pickTask', component: () => import('@/layout/pickTaskMonitor.vue') },// 拣选任务
|
||||
{ path: '/clcKanban', component: () => import('@/layout/clcKanban.vue') },// 需求看板
|
||||
{ path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录
|
||||
{ path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表
|
||||
{ path: '/rolePermission', component: () => import('@/layout/role_permission.vue') },// 角色——权限列表
|
||||
{ path: '/test', component: () => import('@/layout/testView.vue') },// 测试
|
||||
{ path: '/dbsList', component: () => import('@/layout/dbsList.vue') },// dbs计划
|
||||
{ path: '/kittingList', component: () => import('@/layout/kittingList.vue') },// 配料单
|
||||
{ path: '/kittingRelation', component: () => import('@/layout/kittingRelation.vue') },// 配料单
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'login',
|
||||
component: login
|
||||
},
|
||||
{
|
||||
path: '/systemCenter',
|
||||
name: 'systemCenter',
|
||||
component: systemCenter
|
||||
},
|
||||
{
|
||||
path: '/imageDisplay',
|
||||
name: 'imageDisplay',
|
||||
component: () => import('@/layout/imageDisplay.vue')
|
||||
},
|
||||
{
|
||||
path: '/imageTable',
|
||||
name: 'imageTable',
|
||||
component: () => import('@/layout/imageTable.vue')
|
||||
},
|
||||
{
|
||||
path: '/scanForImage',
|
||||
name: 'scanForImage',
|
||||
component: () => import('@/layout/scanForImage.vue')
|
||||
}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
base: '/',
|
||||
history: createWebHashHistory(),
|
||||
routes
|
||||
})
|
||||
|
||||
// 挂载路由导航守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.path === '/') return next()
|
||||
// 获取token
|
||||
const user = sessionStorage.getItem('user')
|
||||
if (!user) return next('/')
|
||||
next()
|
||||
})
|
||||
|
||||
export default router
|
||||
100
src/store/index.js
Normal file
100
src/store/index.js
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
import { createStore } from 'vuex'
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
stateTagsList: [{
|
||||
id: '99',
|
||||
labelName: '库存',
|
||||
path: '/stock'
|
||||
}],
|
||||
user: {},
|
||||
menuList: [],
|
||||
token: '',
|
||||
verifier: '',
|
||||
stand: {}
|
||||
},
|
||||
getters: {
|
||||
getUser(state) {
|
||||
return state.user
|
||||
},
|
||||
getUserName(state) {
|
||||
return state.user.userName
|
||||
},
|
||||
getMenuList(state) {
|
||||
return state.menuList
|
||||
},
|
||||
getToken(state) {
|
||||
return state.token
|
||||
},
|
||||
getVerify(state) {
|
||||
return state.verifier
|
||||
},
|
||||
getStand(state) {
|
||||
return state.stand
|
||||
},
|
||||
getStandId(state) {
|
||||
return state.stand.standId
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
/**
|
||||
* 选择tag标签
|
||||
*/
|
||||
mutationSelectTags(state, data) {
|
||||
let result = false
|
||||
for (let i = 0; i < state.stateTagsList.length; i++) {
|
||||
if (state.stateTagsList[i].path == data.path) {
|
||||
return result = true
|
||||
}
|
||||
}
|
||||
result === false ? state.stateTagsList.push(data) : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭tag标签
|
||||
*/
|
||||
mutationCloseTag(state, data) {
|
||||
let result = state.stateTagsList.findIndex(item => item.path === data.path)
|
||||
state.stateTagsList.splice(result, 1)
|
||||
},
|
||||
|
||||
/**
|
||||
* 存储用户信息
|
||||
*/
|
||||
mutationUser(state, data) {
|
||||
state.user = data
|
||||
sessionStorage.setItem("user", state.user)
|
||||
},
|
||||
|
||||
/**
|
||||
* 存储菜单信息
|
||||
*/
|
||||
mutationMenu(state, data) {
|
||||
state.menuList = data
|
||||
sessionStorage.setItem("menuList", state.menuList)
|
||||
},
|
||||
|
||||
/**
|
||||
* 存储站台信息
|
||||
*/
|
||||
mutationStand(state, data) {
|
||||
state.stand = data
|
||||
sessionStorage.setItem("stand", state.stand)
|
||||
},
|
||||
|
||||
/**
|
||||
* 存储认证
|
||||
*/
|
||||
mutationAddVerify(state, data) {
|
||||
state.verifier = data
|
||||
},
|
||||
|
||||
mutationClearVerify(state) {
|
||||
state.verifier = ''
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
})
|
||||
9
src/styles/index.scss
Normal file
9
src/styles/index.scss
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/* 只需要重写你需要的即可 */
|
||||
@forward 'element-plus/theme-chalk/src/common/var.scss' with ($colors: ('primary': ('base': green,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// 如果只是按需导入,则可以忽略以下内容。
|
||||
// 如果你想导入所有样式:
|
||||
// @use "element-plus/theme-chalk/src/index.scss" as *;
|
||||
23
src/utils/dateUtils.js
Normal file
23
src/utils/dateUtils.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function revertSeconds(originSeconds) {
|
||||
const dayRule = 60*60*24
|
||||
const hourRule = 60*60
|
||||
const days = Math.floor(originSeconds/dayRule)
|
||||
const hours = Math.floor((originSeconds%dayRule)/hourRule)
|
||||
const minutes = Math.floor((originSeconds%hourRule)/60)
|
||||
const seconds = originSeconds%60
|
||||
var dueTime = ''
|
||||
if (days > 0) {
|
||||
dueTime = dueTime.concat(days).concat('天')
|
||||
}
|
||||
if (hours > 0) {
|
||||
dueTime = dueTime.concat(hours).concat('小时')
|
||||
}
|
||||
if (minutes > 0) {
|
||||
dueTime = dueTime.concat(minutes).concat('分')
|
||||
}
|
||||
return dueTime.concat(seconds).concat('秒')
|
||||
}
|
||||
|
||||
export {
|
||||
revertSeconds
|
||||
}
|
||||
213
src/utils/formatter.js
Normal file
213
src/utils/formatter.js
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
import moment from "moment";
|
||||
import { revertSeconds } from '@/utils/dateUtils'
|
||||
|
||||
function timeFormatter(date) {
|
||||
if (date === null || date === undefined) {
|
||||
return ''
|
||||
}
|
||||
return moment(date).format('yyyy-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
function dateFormatter(date) {
|
||||
if (date === null || date === undefined) {
|
||||
return ''
|
||||
}
|
||||
return moment(date).format('yyyy-MM-DD');
|
||||
}
|
||||
|
||||
function dueFormatter(date) {
|
||||
if (date === null || date === undefined) {
|
||||
return ''
|
||||
}
|
||||
return revertSeconds(moment(new Date().getTime()).diff(moment(date), 'seconds'));
|
||||
}
|
||||
|
||||
function taskStatusFormatter(value) {
|
||||
switch (value) {
|
||||
case -2:
|
||||
return '重复入库'
|
||||
case -1:
|
||||
return '暂存任务'
|
||||
case 0:
|
||||
return '任务新建,待下发'
|
||||
case 1:
|
||||
return '任务已下发'
|
||||
case 2:
|
||||
return '任务开始执行'
|
||||
case 8:
|
||||
return '拣选中'
|
||||
case 9:
|
||||
return '盘点中'
|
||||
case 100:
|
||||
return '任务完成'
|
||||
case 998:
|
||||
return '任务取消'
|
||||
case 999:
|
||||
return '任务异常'
|
||||
default:
|
||||
return '其他状态'
|
||||
}
|
||||
}
|
||||
|
||||
// 库位格式化
|
||||
function locationFormatter(locationId) {
|
||||
if (locationId === null || locationId == undefined) {
|
||||
return ''
|
||||
}
|
||||
const locationArray = locationId.split('-')
|
||||
if (locationArray.length == 3) {
|
||||
return locationArray[0] + '排' + locationArray[1] + '列' + locationArray[2] + '层'
|
||||
} else if (locationArray.length == 4) {
|
||||
return locationArray[0] + '排' + locationArray[1] + '列' + locationArray[2] + '层' + locationArray[3] + '深度'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function kateTaskStatusFormatter(value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return '待下发'
|
||||
case 1:
|
||||
return '已下发'
|
||||
case 2:
|
||||
return '执行中'
|
||||
case 3:
|
||||
return '正在拣货'
|
||||
case 5:
|
||||
return '任务完成'
|
||||
default:
|
||||
return '异常状态'
|
||||
}
|
||||
}
|
||||
|
||||
function pickingStatusFormatter(value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return '待拣货'
|
||||
case 1:
|
||||
return '正在拣货'
|
||||
case 2:
|
||||
return '拣货完成'
|
||||
default:
|
||||
return '未拣货'
|
||||
}
|
||||
}
|
||||
|
||||
function vehicleStatusFormatter(value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return '入库中'
|
||||
case 2:
|
||||
return '在库中'
|
||||
case 3:
|
||||
return '出库中'
|
||||
case 4:
|
||||
return '移库中'
|
||||
default:
|
||||
return '异常状态'
|
||||
}
|
||||
}
|
||||
|
||||
function locationStatusFormatter(value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return '空闲'
|
||||
case 1:
|
||||
return '占用'
|
||||
default:
|
||||
return '异常状态'
|
||||
}
|
||||
}
|
||||
|
||||
function configTypeFormatter(value) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '输入框'
|
||||
case '2':
|
||||
return '下拉多选'
|
||||
case '3':
|
||||
return '开关'
|
||||
default:
|
||||
return '任务类型异常'
|
||||
}
|
||||
}
|
||||
|
||||
function sizeFormatter(value) {
|
||||
if (typeof value != 'number') {
|
||||
return 'error'
|
||||
}
|
||||
const oneByte = 1
|
||||
const oneKB = oneByte * 1024
|
||||
const oneMB = oneKB * 1024
|
||||
const oneGB = oneMB * 1024
|
||||
const oneTB = oneGB * 1024
|
||||
const onePB = oneTB * 1024
|
||||
const oneEB = onePB * 1024
|
||||
const oneZB = oneEB * 1024
|
||||
const oneYB = oneZB * 1024
|
||||
if (value < oneKB) {
|
||||
return value + 'B'
|
||||
} else if (value < oneMB) {
|
||||
return (value / oneKB).toFixed(2) + 'KB'
|
||||
} else if (value < oneGB) {
|
||||
return (value / oneMB).toFixed(2) + 'MB'
|
||||
} else if (value < oneTB) {
|
||||
return (value / oneGB).toFixed(2) + 'GB'
|
||||
} else if (value < onePB) {
|
||||
return (value / oneTB).toFixed(2) + 'TB'
|
||||
} else if (value < oneEB) {
|
||||
return (value / onePB).toFixed(2) + 'PB'
|
||||
} else if (value < oneZB) {
|
||||
return (value / oneEB).toFixed(2) + 'EB'
|
||||
} else if (value < oneYB) {
|
||||
return (value / oneZB).toFixed(2) + 'ZB'
|
||||
} else {
|
||||
return (value / oneYB).toFixed(2) + 'YB'
|
||||
}
|
||||
}
|
||||
|
||||
function jsonFormatter(value) {
|
||||
if (value == null) {
|
||||
return ""
|
||||
}
|
||||
if (typeof value == 'string') {
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(value), null, 4)
|
||||
} catch (e) {
|
||||
return "error"
|
||||
}
|
||||
} else {
|
||||
return JSON.stringify(value, null, 4)
|
||||
}
|
||||
}
|
||||
|
||||
function replaceEnglishAndNumberIGAI(value) {
|
||||
return value.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '')
|
||||
}
|
||||
|
||||
function yesOrNoFormatter(value) {
|
||||
return value == 1 ? '是' : '否'
|
||||
}
|
||||
|
||||
function converseYesOrNoFormatter(value) {
|
||||
return value == 0 ? '是' : '否'
|
||||
}
|
||||
|
||||
export {
|
||||
timeFormatter,
|
||||
dateFormatter,
|
||||
taskStatusFormatter,
|
||||
locationFormatter,
|
||||
kateTaskStatusFormatter,
|
||||
pickingStatusFormatter,
|
||||
vehicleStatusFormatter,
|
||||
configTypeFormatter,
|
||||
dueFormatter,
|
||||
locationStatusFormatter,
|
||||
sizeFormatter,
|
||||
jsonFormatter,
|
||||
replaceEnglishAndNumberIGAI,
|
||||
yesOrNoFormatter,
|
||||
converseYesOrNoFormatter
|
||||
}
|
||||
34
src/utils/generator.js
Normal file
34
src/utils/generator.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
||||
// 构建table基本请求---带分页
|
||||
export function genTableRequest(baseTableQuery) {
|
||||
// 构建sortBy的集合
|
||||
let sortBy = []
|
||||
for (const [key, value] of baseTableQuery.sortBy) {
|
||||
sortBy.push({
|
||||
column: toUnderScoreCase(key),
|
||||
asc: value
|
||||
})
|
||||
}
|
||||
return {
|
||||
pageNo: baseTableQuery.currentPage,
|
||||
pageSize: baseTableQuery.pageSize,
|
||||
sortBy: sortBy.reverse(),
|
||||
standId: baseTableQuery.standId,
|
||||
userName: baseTableQuery.userName
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向options中添加全部这个选项
|
||||
* @param {*} options
|
||||
* @returns
|
||||
*/
|
||||
export function addAllOptionOfOptions(options) {
|
||||
const allOption = [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
}
|
||||
]
|
||||
return allOption.concat(options)
|
||||
}
|
||||
16
src/utils/hashUtils.js
Normal file
16
src/utils/hashUtils.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import crypto from 'crypto'
|
||||
function base64URLEncode(str) {
|
||||
return str.toString('base64')
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=/g, '');
|
||||
}
|
||||
|
||||
function getHashString(obj) {
|
||||
return base64URLEncode(crypto.createHash('sha256').update(obj).digest())
|
||||
}
|
||||
|
||||
export {
|
||||
base64URLEncode,
|
||||
getHashString
|
||||
}
|
||||
14
src/utils/loading.js
Normal file
14
src/utils/loading.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { ElLoading } from 'element-plus'
|
||||
export const loading = {
|
||||
loadingInstance: null,
|
||||
open: function (text) {
|
||||
this.loadingInstance = ElLoading.service({
|
||||
lock: true,
|
||||
text: text,
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
},
|
||||
close: function () {
|
||||
this.loadingInstance.close()
|
||||
}
|
||||
}
|
||||
4
src/utils/media.js
Normal file
4
src/utils/media.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// 语音播报
|
||||
export function speak (message) {
|
||||
window.speechSynthesis.speak(new SpeechSynthesisUtterance(message));
|
||||
}
|
||||
64
src/utils/myMessageBox.js
Normal file
64
src/utils/myMessageBox.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
function errorBox(msg) {
|
||||
ElMessageBox.alert(msg, '错误', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
center: true,
|
||||
type: 'error',
|
||||
closeOnPressEscape: true,
|
||||
showClose: false,
|
||||
callback: (action) => {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function successBox(msg) {
|
||||
ElMessageBox.alert(msg, '成功', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
center: true,
|
||||
type: 'success',
|
||||
closeOnPressEscape: true,
|
||||
showClose: false,
|
||||
callback: (action) => {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function infoBox(msg) {
|
||||
ElMessageBox.alert(msg, '提示', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
center: true,
|
||||
type: 'info',
|
||||
closeOnPressEscape: true,
|
||||
showClose: false,
|
||||
callback: (action) => {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function warningBox(msg) {
|
||||
ElMessageBox.alert(msg, '警告', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
center: true,
|
||||
type: 'warning',
|
||||
closeOnPressEscape: true,
|
||||
showClose: false,
|
||||
callback: (action) => {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
errorBox,
|
||||
successBox,
|
||||
infoBox,
|
||||
warningBox
|
||||
}
|
||||
146
src/utils/request.js
Normal file
146
src/utils/request.js
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
import axios from 'axios'
|
||||
import { ElNotification, ElMessageBox, ElMessage, ElLoading } from 'element-plus'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import { tansParams, blobValidate } from '@/utils/ruoyi'
|
||||
import cache from '@/plugins/cache'
|
||||
import { saveAs } from 'file-saver'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
let downloadLoadingInstance;
|
||||
// 是否显示重新登录
|
||||
export let isRelogin = { show: false };
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
// 是否需要防止数据重复提交
|
||||
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params);
|
||||
url = url.slice(0, -1);
|
||||
config.params = {};
|
||||
config.url = url;
|
||||
}
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
time: new Date().getTime()
|
||||
}
|
||||
const sessionObj = cache.session.getJSON('sessionObj')
|
||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
||||
cache.session.setJSON('sessionObj', requestObj)
|
||||
} else {
|
||||
const s_url = sessionObj.url; // 请求地址
|
||||
const s_data = sessionObj.data; // 请求数据
|
||||
const s_time = sessionObj.time; // 请求时间
|
||||
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
|
||||
const message = '数据正在处理,请勿重复提交';
|
||||
console.warn(`[${s_url}]: ` + message)
|
||||
return Promise.reject(new Error(message))
|
||||
} else {
|
||||
cache.session.setJSON('sessionObj', requestObj)
|
||||
}
|
||||
}
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
// 二进制数据则直接返回
|
||||
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
|
||||
return res.data
|
||||
}
|
||||
if (code === 401) {
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true;
|
||||
ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
isRelogin.show = false;
|
||||
useUserStore().logOut().then(() => {
|
||||
location.href = '/index';
|
||||
})
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
}
|
||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
} else if (code === 500) {
|
||||
ElMessage({ message: msg, type: 'error' })
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code === 601) {
|
||||
ElMessage({ message: msg, type: 'warning' })
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code !== 200) {
|
||||
ElNotification.error({ title: msg })
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
} else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
ElMessage({ message: message, type: 'error', duration: 5 * 1000 })
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 通用下载方法
|
||||
export function download(url, params, filename, config) {
|
||||
downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", })
|
||||
return service.post(url, params, {
|
||||
transformRequest: [(params) => { return tansParams(params) }],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
responseType: 'blob',
|
||||
...config
|
||||
}).then(async (data) => {
|
||||
const isLogin = await blobValidate(data);
|
||||
if (isLogin) {
|
||||
const blob = new Blob([data])
|
||||
saveAs(blob, filename)
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||
ElMessage.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
ElMessage.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
}
|
||||
|
||||
export default service
|
||||
35
src/utils/stringUtils.js
Normal file
35
src/utils/stringUtils.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import moment from "moment";
|
||||
function genTaskId(code) {
|
||||
return code + moment(new Date()).format("YYYYMMDDHHmmssSSS");
|
||||
}
|
||||
|
||||
function toCamelCase(str) {
|
||||
return str.replace(/-(\w)/g, function (_, c) {
|
||||
return c ? c.toUpperCase() : "";
|
||||
});
|
||||
}
|
||||
|
||||
function toUnderScoreCase(str) {
|
||||
return str.replace(/([A-Z])/g, function (_, c) {
|
||||
return "_" + c.toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
function isSingleCharacter(c) {
|
||||
if (c.length !== 1) {
|
||||
return false
|
||||
}
|
||||
return c.toLowerCase() >= 'a' && c.toLowerCase() <= 'z'
|
||||
}
|
||||
|
||||
function isNumber(d) {
|
||||
return d >= '0' && d <= '9'
|
||||
}
|
||||
|
||||
export {
|
||||
genTaskId,
|
||||
toCamelCase,
|
||||
toUnderScoreCase,
|
||||
isSingleCharacter,
|
||||
isNumber
|
||||
}
|
||||
194
src/views/HomeView.vue
Normal file
194
src/views/HomeView.vue
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
<template>
|
||||
<el-container class="wms-home">
|
||||
<el-header class="header">
|
||||
<div class="icon-img">
|
||||
<el-image :src="icon_img_url" :fit="'fill'" />
|
||||
</div>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px;font-weight: bold; color: black;">WMS仓库管理系统</span>
|
||||
</div>
|
||||
<div class="stand">
|
||||
<span style="font-size: 15px;font-weight: bold; color: black;">{{ standId }}</span>
|
||||
</div>
|
||||
<el-dropdown @command="handleCommand" class="user">
|
||||
<span style="font-size: 15px; font-weight: bold; color: black;">
|
||||
用户名:{{ userName }}
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="1">重启系统</el-dropdown-item>
|
||||
<el-dropdown-item command="2" divided>重载配置</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-header>
|
||||
<el-container class="content">
|
||||
<el-aside class="aside">
|
||||
<el-scrollbar style="height: max-content;">
|
||||
<sideMenu></sideMenu>
|
||||
</el-scrollbar>
|
||||
</el-aside>
|
||||
<el-container class="view-container">
|
||||
<el-header class="tag">
|
||||
<appTag></appTag>
|
||||
</el-header>
|
||||
<el-main class="view-main">
|
||||
<!-- 路由占位符 -->
|
||||
<el-scrollbar>
|
||||
<router-view v-slot="{ Component }">
|
||||
<!-- // TODO keepAlive配置 -->
|
||||
<keep-alive>
|
||||
<component :is="Component" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</el-scrollbar>
|
||||
</el-main>
|
||||
|
||||
</el-container>
|
||||
</el-container>
|
||||
<!-- <el-footer class="footer">© 1970- 江苏菲达宝开电气股份有限公司</el-footer> -->
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// @ is an alias to /src
|
||||
import sideMenu from '@/components/sideMenu.vue'
|
||||
import appTag from '@/components/appTag.vue'
|
||||
import store from '@/store'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { restartSystem, reloadConfig } from '@/api/config.js'
|
||||
const icon_img_url = require('@/assets/fdbk_log.png')
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HomeView',
|
||||
components: {
|
||||
sideMenu,
|
||||
appTag
|
||||
},
|
||||
computed: {
|
||||
userName() {
|
||||
return store.getters.getUserName
|
||||
},
|
||||
standId() {
|
||||
return store.getters.getStandId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCommand: (command) => {
|
||||
const param = {
|
||||
roleId: store.getters.getUser.roleId,
|
||||
userName: store.getters.getUser.userName
|
||||
}
|
||||
if (command == 1) {
|
||||
restartSystem(param).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '重启系统成功',
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('发生错误')
|
||||
})
|
||||
} else if (command == 2) {
|
||||
reloadConfig(param).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '重载配置成功',
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('发生错误')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wms-home {
|
||||
height: calc(100vh);
|
||||
width: calc(100vw);
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 92%;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: #D9E3EE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 5%;
|
||||
padding-left: 5px;
|
||||
/* font-size: 15px; */
|
||||
}
|
||||
|
||||
.aside {
|
||||
background-color: #fff;
|
||||
height: 100%;
|
||||
width: 10%;
|
||||
border-right: 1px solid #66CCFF;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: #F0FFFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 3%;
|
||||
}
|
||||
|
||||
.tag {
|
||||
padding-left: 1px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 35px;
|
||||
border-bottom: solid 1px;
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
height: 100%;
|
||||
width: 3%;
|
||||
}
|
||||
|
||||
.icon-img .el-image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.stand {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.user {
|
||||
margin-left: auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.view-container {
|
||||
height: 100%;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.view-main {
|
||||
height: 97% - 35px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
92
src/views/SystemCenter.vue
Normal file
92
src/views/SystemCenter.vue
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<template>
|
||||
<body id="login-page">
|
||||
<el-form class="login-container" label-position="left" label-width="0px">
|
||||
<h3 class="login_title">请选择系统</h3>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button color="#87CEFA" style="width: 100%; border: none" @click="loginToWms">WMS系统</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button color="#87CEEB" style="width: 100%; border: none" @click="loginToImage">工作图纸</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button color="#87CEEB" style="width: 100%; border: none" @click="loginToImageTable">所有图纸预览</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button color="#87CEEB" style="width: 100%; border: none" @click="loginToScanImage">产线扫码</el-button>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item style="width: 100%">
|
||||
<el-button color="#AFEEEE" style="width: 100%; border: none" @click="loginToSideScan">线边扫码系统</el-button>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item style="width: 100%">
|
||||
<el-button color="#ADD8E6" style="width: 100%; border: none" @click="loginToWcs">WCS系统</el-button>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item style="width: 100%">
|
||||
<el-button color="#B0E0E6" style="width: 100%; border: none" @click="loginToMonitor">监控系统</el-button>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import router from '@/router'
|
||||
const user = store.getters.getUserNam// 用户名
|
||||
const token = store.getters.getToken// 密码
|
||||
// 登录到WMS系统
|
||||
const loginToWms = () => {
|
||||
router.replace({ path: '/home' })
|
||||
}
|
||||
// 登录到工作图纸系统
|
||||
const loginToImage = () => {
|
||||
router.replace({ path: '/imageDisplay' })
|
||||
}
|
||||
// 登录到所有图纸预览系统
|
||||
const loginToImageTable = () => {
|
||||
router.replace({ path: '/imageTable' })
|
||||
}
|
||||
// 登录到产线扫码系统
|
||||
const loginToScanImage = () => {
|
||||
router.replace({ path: '/scanForImage' })
|
||||
}
|
||||
// 登录到WCS系统
|
||||
const loginToWcs = () => {
|
||||
const wcsUrl = `https://cxlasrs.ecorp.cat.com/wcs/#/login?user=user&pwd=user`
|
||||
window.location.href = wcsUrl// 打开新窗口
|
||||
}
|
||||
const loginToMonitor = () => {
|
||||
const mpnitorUrl = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}`
|
||||
window.location.href = mpnitorUrl// 当前窗口跳转
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#login-page {
|
||||
/* background: url("../assets/img/bg.jpg") no-repeat; */
|
||||
background-position: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
border-radius: 15px;
|
||||
background-clip: padding-box;
|
||||
margin: 90px auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeaea;
|
||||
box-shadow: 0 0 25px #cac6c6;
|
||||
}
|
||||
|
||||
.login_title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
}
|
||||
</style>
|
||||
92
src/views/login.vue
Normal file
92
src/views/login.vue
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<template>
|
||||
<body id="login-page">
|
||||
<el-form class="login-container" :model="loginForm" label-position="left" label-width="0px" @keyup.enter="login">
|
||||
<h3 class="login_title">系统登录</h3>
|
||||
<el-form-item>
|
||||
<el-input type="text" ref="loginAccountInput" v-model="loginForm.loginAccount" auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="password" v-model="loginForm.loginPassword" auto-complete="off"
|
||||
placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button ref="loginBtn" type="primary" style="width: 100%; border: none"
|
||||
@click="login">登录</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { loginWithAuth } from '@/api/login.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { reactive, onMounted, nextTick, ref } from 'vue';
|
||||
import { loading } from '@/utils/loading'
|
||||
import store from '@/store'
|
||||
import router from '@/router'
|
||||
const loginBtn = ref()
|
||||
let loginForm = reactive({
|
||||
loginAccount: "",
|
||||
loginPassword: "",
|
||||
})
|
||||
const loginAccountInput = ref()
|
||||
// 页面创建生命周期
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
loginAccountInput.value.focus()
|
||||
})
|
||||
})
|
||||
// 登录
|
||||
const login = () => {
|
||||
loading.open('登录中...')
|
||||
loginWithAuth(loginForm).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
store.commit('mutationUser', response.data.user)// 用户信息
|
||||
store.commit('mutationMenu', response.data.menuList)// 菜单信息
|
||||
store.commit('mutationStand', response.data.stand)
|
||||
// router.replace({ path: '/' })// 直接跳转到主页
|
||||
router.replace({ path: '/systemCenter' })// 跳转到系统选择的界面
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('登录失败!')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#login-page {
|
||||
/* background: url("../assets/img/bg.jpg") no-repeat; */
|
||||
background-position: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
border-radius: 15px;
|
||||
background-clip: padding-box;
|
||||
margin: 90px auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeaea;
|
||||
box-shadow: 0 0 25px #cac6c6;
|
||||
}
|
||||
|
||||
.login_title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
}
|
||||
</style>
|
||||
21
vue.config.js
Normal file
21
vue.config.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const { defineConfig } = require('@vue/cli-service')
|
||||
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
|
||||
|
||||
module.exports = defineConfig({
|
||||
publicPath: '/wms',
|
||||
transpileDependencies: true,
|
||||
configureWebpack: {
|
||||
plugins: [new NodePolyfillPlugin()]
|
||||
},
|
||||
devServer: {
|
||||
port: 12306, // 端口
|
||||
proxy: {
|
||||
'/authorize': { // 若请求的前缀不是这个'/wms',那请求就不会走代理服务器
|
||||
target: "https://login.microsoftonline.com/caterpillar.onmicrosoft.com/", //这里写路径
|
||||
pathRewrite: { '^/authorize': '' }, //将所有含/wms路径的,去掉/wms转发给服务器
|
||||
ws: true, //用于支持websocket
|
||||
changeOrigin: true //用于控制请求头中的host值
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user