Compare commits

..

9 Commits

Author SHA1 Message Date
4452edc517 Merge pull request 'newCreateAndDistribute' (#2) from newCreateAndDistribute into main
Reviewed-on: http://112.4.208.194:3000/FeiDaBaoKai/wms_client_kate_suzhou/pulls/2
2026-02-02 10:42:17 +08:00
06f1b10163 1. 修改默认页为空白 2026-01-20 20:22:11 +08:00
9d45a883fb 1. 增加库存(盘点用)界面 2026-01-16 15:15:43 +08:00
b159388557 1. 增加界面:工作日历,库存(盘点用) 2026-01-09 15:26:22 +08:00
6f29427894 1. 增加工作日历的显示菜单;
2. 增加一键切换创建与分配。
2026-01-08 17:03:30 +08:00
b64ff96b7b 界面完善 2025-12-25 14:05:14 +08:00
c33de5c502 1. 盘点请求参数中增加站台号字段;
2. 延长系统超时时间至60秒。
2025-12-10 14:50:50 +08:00
c5c53f30d5 1. 盘点增加根据物料信息的二次判断;
2. 物料信息增加盘点指示器,1/3。
2025-11-24 14:31:44 +08:00
c4b8f5eeb4 增加一个新的库存状态:已出库 2025-11-13 16:14:17 +08:00
21 changed files with 3374 additions and 2427 deletions

93
package-lock.json generated
View File

@ -25,6 +25,7 @@
"vue-router": "^4.0.3",
"vue3-print-nb": "^0.1.4",
"vuex": "^4.0.0",
"worker-loader": "^3.0.8",
"xlsx": "^0.18.5"
},
"devDependencies": {
@ -3929,7 +3930,6 @@
"version": "5.2.2",
"resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true,
"engines": {
"node": "*"
}
@ -5578,7 +5578,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true,
"engines": {
"node": ">= 4"
}
@ -7453,7 +7452,6 @@
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"bin": {
"json5": "lib/cli.js"
},
@ -12020,6 +12018,55 @@
"node": ">=0.10.0"
}
},
"node_modules/worker-loader": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-3.0.8.tgz",
"integrity": "sha512-XQyQkIFeRVC7f7uRhFdNMe/iJOdO6zxAaR3EWbDp45v3mDhrTi+++oswKNxShUNjPC/1xUp5DB29YKLhFo129g==",
"dependencies": {
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
},
"engines": {
"node": ">= 10.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"peerDependencies": {
"webpack": "^4.0.0 || ^5.0.0"
}
},
"node_modules/worker-loader/node_modules/loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
},
"engines": {
"node": ">=8.9.0"
}
},
"node_modules/worker-loader/node_modules/schema-utils": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
"integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
"dependencies": {
"@types/json-schema": "^7.0.8",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
},
"engines": {
"node": ">= 10.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
}
},
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@ -15053,8 +15100,7 @@
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
},
"binary-extensions": {
"version": "2.2.0",
@ -16409,8 +16455,7 @@
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
},
"encode-utf8": {
"version": "1.0.3",
@ -17914,8 +17959,7 @@
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA=="
},
"jsonfile": {
"version": "6.1.0",
@ -21501,6 +21545,37 @@
"dev": true,
"peer": true
},
"worker-loader": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-3.0.8.tgz",
"integrity": "sha512-XQyQkIFeRVC7f7uRhFdNMe/iJOdO6zxAaR3EWbDp45v3mDhrTi+++oswKNxShUNjPC/1xUp5DB29YKLhFo129g==",
"requires": {
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
},
"dependencies": {
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"schema-utils": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
"integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
"requires": {
"@types/json-schema": "^7.0.8",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
}
}
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",

View File

@ -25,6 +25,7 @@
"vue-router": "^4.0.3",
"vue3-print-nb": "^0.1.4",
"vuex": "^4.0.0",
"worker-loader": "^3.0.8",
"xlsx": "^0.18.5"
},
"devDependencies": {

View File

@ -198,6 +198,16 @@ const downloadWorkFlowExcel = (data) => {
})
}
const downloadKateOrdersExcel = (data) => {
return request({
url: '/excel/downloadKateOrdersExcel',
method: 'post',
responseType: 'blob',
data: data,
timeout: 600000
})
}
export {
uploadExcelStock,
uploadExcelGoods,
@ -219,5 +229,6 @@ export {
uploadExcelKanban,
uploadWorkFlow,
uploadExcelWorkDate,
downloadWorkFlowExcel
downloadWorkFlowExcel,
downloadKateOrdersExcel
}

View File

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

View File

@ -1,133 +1,157 @@
import request from "@/http/request";
const getDbs = (params) => {
return request({
url: '/kateWork/getDbs',
method: 'post',
data: params
})
return request({
url: '/kateWork/getDbs',
method: 'post',
data: params
})
}
const deleteDbs = (params) => {
return request({
url: '/kateWork/deleteDbs',
method: 'post',
data: params
})
return request({
url: '/kateWork/deleteDbs',
method: 'post',
data: params
})
}
const updateDbs = (params) => {
return request({
url: '/kateWork/updateDbs',
method: 'post',
data: params
})
return request({
url: '/kateWork/updateDbs',
method: 'post',
data: params
})
}
const getOrders = (params) => {
return request({
url: '/kateWork/getOrders',
method: 'post',
data: params
})
return request({
url: '/kateWork/getOrders',
method: 'post',
data: params
})
}
const deleteOrders = (params) => {
return request({
url: '/kateWork/deleteOrders',
method: 'post',
data: params
})
return request({
url: '/kateWork/deleteOrders',
method: 'post',
data: params
})
}
const updateOrders = (params) => {
return request({
url: '/kateWork/updateOrders',
method: 'post',
data: params
})
return request({
url: '/kateWork/updateOrders',
method: 'post',
data: params
})
}
const getStationConfigs = (params) => {
return request({
url: '/kateWork/getStationConfigs',
method: 'post',
data: params
})
return request({
url: '/kateWork/getStationConfigs',
method: 'post',
data: params
})
}
const deleteStationConfigs = (params) => {
return request({
url: '/kateWork/deleteStationConfigs',
method: 'post',
data: params
})
return request({
url: '/kateWork/deleteStationConfigs',
method: 'post',
data: params
})
}
const updateStationConfigs = (params) => {
return request({
url: '/kateWork/updateStationConfigs',
method: 'post',
data: params
})
return request({
url: '/kateWork/updateStationConfigs',
method: 'post',
data: params
})
}
const getClcKanbanRequirement = (params) => {
return request({
url: '/kateWork/getClcKanbanRequirement',
method: 'post',
data: params
})
return request({
url: '/kateWork/getClcKanbanRequirement',
method: 'post',
data: params
})
}
const getWorkFlows = (params) => {
return request({
url: '/kateWork/getWorkFlows',
method: 'post',
data: params
})
return request({
url: '/kateWork/getWorkFlows',
method: 'post',
data: params
})
}
const updateWorkFlows = (params) => {
return request({
url: '/kateWork/updateWorkFlows',
method: 'post',
data: params
})
return request({
url: '/kateWork/updateWorkFlows',
method: 'post',
data: params
})
}
const getWorkSummary = (params) => {
return request({
url: '/kateWork/getWorkSummary',
method: 'post',
data: params
})
return request({
url: '/kateWork/getWorkSummary',
method: 'post',
data: params
})
}
const getClcKanbanByPage = (params) => {
return request({
url: '/kateWork/getClcKanbanByPage',
method: 'post',
data: params
})
return request({
url: '/kateWork/getClcKanbanByPage',
method: 'post',
data: params
})
}
const genClcKanbanRequirement = (params) => {
return request({
url: '/kateWork/genClcKanbanRequirement',
method: 'post',
data: params,
timeout: 600000
})
return request({
url: '/kateWork/genClcKanbanRequirement',
method: 'post',
data: params,
timeout: 600000
})
}
const getBigBoxList = (params) => {
return request({
url: '/kateWork/getBigBoxList',
method: 'post',
data: params,
timeout: 10000
})
return request({
url: '/kateWork/getBigBoxList',
method: 'post',
data: params,
timeout: 10000
})
}
const queryWorkDate = (params) => {
return request({
url: '/kateWork/queryWorkDate',
method: 'post',
data: params
})
}
const addWorkDate = (params) => {
return request({
url: '/kateWork/addWorkDate',
method: 'post',
data: params
})
}
const deleteWorkDate = (params) => {
return request({
url: '/kateWork/deleteWorkDate',
method: 'post',
data: params
})
}
export {
@ -146,5 +170,8 @@ export {
getWorkSummary,
getClcKanbanByPage,
genClcKanbanRequirement,
getBigBoxList
getBigBoxList,
queryWorkDate,
addWorkDate,
deleteWorkDate
}

View File

@ -16,7 +16,25 @@ const updateStandInfo = (params) => {
})
}
const switchToCreate = (params) => {
return request({
url: '/stand/switchToCreate',
method: 'post',
data: params
})
}
const switchToDistribute = (params) => {
return request({
url: '/stand/switchToDistribute',
method: 'post',
data: params
})
}
export {
getStandsByPage,
updateStandInfo
updateStandInfo,
switchToCreate,
switchToDistribute
}

View File

@ -2,7 +2,7 @@ import axios from 'axios'
const request = axios.create({
baseURL: 'https://csclasrs.ecorp.cat.com/wmsServer/wms',
timeout: 10000
timeout: 60000
})
// axios.defaults.baseURL = 'http://10.90.36.70:443/wmsServer/wms'

View File

@ -104,7 +104,6 @@ export default {
standId: store.getters.getStandId,
displayGoods: false,//
// displayVehicleType1Selection: false,//
// timer: '',
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
@ -131,21 +130,9 @@ export default {
]
}
},
mounted() {
// this.timer = setInterval(() => {
// // this.getAllTasks()
// }, 2000)
},
beforeUnmount() {
// clearInterval(this.timer)
},
methods: {
vehicleType2ChangeHandle() {
if (this.workFormEntity.vehicleType2 == '间接物料') {
this.displayGoods = true
} else {
this.displayGoods = false
}
this.displayGoods = this.workFormEntity.vehicleType2 === '间接物料';
},
resetForms() {
this.workFormEntity = reactive({
@ -156,7 +143,7 @@ export default {
})
},
confirmTask() {
if (this.workFormEntity.vehicleType2 == '') {
if (this.workFormEntity.vehicleType2 === '') {
errorBox('请选择物料种类')
return
}
@ -173,7 +160,7 @@ export default {
}
callEmptyVehicle(request).then(res => {
const response = res.data
if (response.code == 0) {
if (response.code === 0) {
ElMessage.success(response.message)
this.resetForms()
} else {

View File

@ -10,9 +10,7 @@
</el-row>
<el-row>
<el-button style="background-color: #00CED1; color: #000; width: 120px;"
@click="openUploadDialog(1)">导入DBS</el-button>
<el-button style="background-color: #32CD32; color: #000; width: 120px;"
@click="openUploadDialog(2)">导入工作日历</el-button>
@click="openUploadDialog()">导入DBS</el-button>
</el-row>
</div>
<br />
@ -125,33 +123,6 @@
<UploadExcelDbs></UploadExcelDbs>
</fieldset>
</el-dialog>
<el-dialog v-model="uploadWorkDateDialogVisible" title="DBS" width="40%" draggable :show-close="true">
<fieldset class="title-area">
<legend>上次更新</legend>
<div style="padding: 5px;">
<div style="display: flex; margin-bottom: 10px;">
<div style="display: flex; width: 100%;">
<div style="width: 30%; align-content: center;">时间</div>
<el-input v-model="uploadRecord.uploadTime" readonly />
</div>
<div style="display: flex; width: 100%; margin-left: 5px;">
<div style="width: 30%; align-content: center;">人员</div>
<el-input v-model="uploadRecord.uploadUser" readonly />
</div>
</div>
<div style="display: flex; width: 100%;">
<div style="width: 13%; align-content: center;">文件名</div>
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
</el-input>
</div>
</div>
</fieldset>
<fieldset class="title-area">
<legend>再次更新</legend>
<UploadExcelWorkDate></UploadExcelWorkDate>
</fieldset>
</el-dialog>
</el-config-provider>
</div>
</template>
@ -300,11 +271,11 @@ export default {
getCurrentRow(row) {
this.dbsId = row.dbsId
},
openUploadDialog(uploadType) {
openUploadDialog() {
//
const param = {
userName: store.getters.getUserName,
fileDescription: uploadType == 1 ? 'DBS' : 'WORK_DATE',
fileDescription: 'DBS',
isAsc: false,
sortBy: 'upload_time'
}
@ -330,11 +301,7 @@ export default {
console.log(err)
errorBox('发生异常')
})
if (uploadType == 1) {
this.uploadDialogVisible = true
} else {
this.uploadWorkDateDialogVisible = true
}
this.uploadDialogVisible = true
},
},
}

View File

@ -1,448 +1,509 @@
<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-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</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
<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-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
placeholder="物料类型" :options="vehicleTypeOptions" @change="search()"></el-select-v2>
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
<!-- <el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</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">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" />
<el-table-column prop="goodsName" label="描述" min-width="120px" />
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
<el-table-column prop="goodsType" label="物料分类" min-width="120px" />
<el-table-column prop="providerType" label="供应商分类" min-width="120px" />
<el-table-column prop="weight" label="重量" min-width="120px" />
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" />
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" />
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" />
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" />
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" />
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" />
<el-table-column prop="feedingType" label="补料方式" min-width="120px" />
<el-table-column prop="feedingValue" label="补货点" min-width="120px" />
<el-table-column prop="heat" label="热度" min-width="120px" />
<el-table-column prop="releasePoint" label="卸货点" min-width="120px" />
<el-table-column prop="dataSource" label="数据来源" min-width="120px" />
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" />
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
<el-table-column fixed="right" label="操作" width="240px">
<template v-slot="scope">
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<br />
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
:small="false" :disabled="false" :background="false" :default-page-size="10"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
@current-change="search" />
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
<div
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="料号" prop="goodsId">
<el-input v-model="goodsFormEntity.goodsId" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="goodsName">
<el-input v-model="goodsFormEntity.goodsName" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="单位" prop="goodsUnit">
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料分类" prop="goodsType">
<el-input v-model="goodsFormEntity.goodsType" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="供应商分类" prop="providerType">
<el-input v-model="goodsFormEntity.providerType" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="重量" prop="weight">
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
:precision="3" :step="0.1" :min="0" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="重量单位" prop="weightUnit">
<el-input v-model="goodsFormEntity.weightUnit" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每盒数量" prop="quantityPerBox">
<el-input-number v-model.number="goodsFormEntity.quantityPerBox"
controls-position="right" :min="0" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="拆包方式" prop="unpackingType">
<el-input v-model="goodsFormEntity.unpackingType" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="料箱类型" prop="vehicleType">
<el-input v-model="goodsFormEntity.vehicleType" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="热度" prop="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>
<el-table-column width="65px" fixed="left">
<template v-slot="scope">
<el-radio :label="scope.row.goodsId" v-model="goodsId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsName" label="描述" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsUnit" label="单位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsType" label="物料分类" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="providerType" label="供应商分类" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="weight" label="重量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="feedingType" label="补料方式" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="feedingValue" label="补货点" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="heat" label="热度" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="releasePoint" label="卸货点" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="dataSource" label="数据来源" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="needInventory" label="盘点管理" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="haveSled" label="SLED管理" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="sledDays" label="SLED天数" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="indicator" 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="needInventory">
<el-input v-model="goodsFormEntity.needInventory" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="SLED管理" prop="haveSled">
<el-input v-model="goodsFormEntity.haveSled" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="SLED天数" prop="sledDays">
<el-input-number v-model.number="goodsFormEntity.sledDays"
controls-position="right" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="盘点指示器" prop="indicator">
<el-input-number v-model.number="goodsFormEntity.indicator"
controls-position="right" :min="1" :max="3" :step="2" 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>
</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, updateIndirectInfos } from '@/api/goods.js'
import {getGoodsInfoByPage, deleteGoodsInfo, updateGoodsInfo, updateIndirectInfos} 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 {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'
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({})
name: 'goods',
data() {
return {
goodsList: [],
goodsInfo: {},
currentPage: 1,
pageSize: 10,
total: 0,
goodsIdQuery: '',
vehicleTypeQuery: '',
loading: true,
dialogVisible: false,
uploadDialogVisible: false,
goodsId: '',
goodsFormEntity: reactive({}),
labelPosition: 'top',
goodsFormRef: ref(),
rules: reactive({}),
vehicleTypeOptions: [
{
value: "",
label: '全部'
},
{
value: "直接物料",
label: '直接物料'
},
{
value: "间接物料",
label: '间接物料'
}
],
}
},
mounted() {
this.search()
},
methods: {
setIndirect() {
const request = {}
updateIndirectInfos(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('一键设置错误。')
})
},
mounted() {
this.search()
search() {
this.loading = true
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
goodsId: this.goodsIdQuery.trim(),
goodsType: this.vehicleTypeQuery.trim(),
userName: store.getters.getUserName
}
getGoodsInfoByPage(request).then(res => {
const tableResponse = res.data
if (tableResponse.code == 0) {
this.goodsList = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
errorBox(tableResponse.message)
}
}).catch(err => {
console.log(err)
errorBox('查询物料错误')
})
this.loading = false
},
methods: {
setIndirect() {
const request = {}
updateIndirectInfos(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('一键设置错误。')
})
},
search() {
this.loading = true
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
goodsId: this.goodsIdQuery.trim(),
userName: store.getters.getUserName
}
getGoodsInfoByPage(request).then(res => {
const tableResponse = res.data
if (tableResponse.code == 0) {
this.goodsList = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
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 = ''
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,
needInventory: row.needInventory,
haveSled: row.haveSled,
sledDays: row.sledDays,
indicator: row.indicator,
}
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()
},
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'}); //blobblobtypexls
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('导出失败')
})
},
} else {
errorBox(res.data.message)
}
}).catch(err => {
console.log(err)
errorBox('删除物料信息失败')
})
}).catch(() => {
ElMessage.info('操作取消')
})
},
submitGoodsInfo(formData) {
if (formData.indicator !== null && formData.indicator !== 1 && formData.indicator !== 3) {
return errorBox('指示器只能为1或3')
}
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,
needInventory: formData.needInventory,
haveSled: formData.haveSled,
sledDays: formData.sledDays,
indicator: formData.indicator,
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'}); //blobblobtypexls
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;
padding-left: 5px;
}
.el-row .el-button {
width: 72px;
margin-left: 0px;
margin-right: 5px;
width: 72px;
margin-left: 0px;
margin-right: 5px;
}
.table-class {
width: 100%;
width: 100%;
}
.el-row .el-form-item {
width: 10% inherit;
justify-content: center;
width: 10% inherit;
justify-content: center;
}
.el-row .el-form-item .el-select-v2 {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-input-number {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-button {
margin: auto;
margin: auto;
}
.title-area {
display: flex;
/* min-height: 10%; */
max-height: max-content;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
flex-direction: column;
padding: 10px;
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>

View File

@ -1,349 +1,362 @@
<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="goods-list-area">
<legend>
物料信息列表
</legend>
<el-table :data="inventoryGoodsDetails" stripe border max-height="200px"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="vehiclesQuantity" label="料箱数量" min-width="120px" />
<el-table-column prop="vehicleIds" label="料箱号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="vehicleStatus" label="料箱状态" min-width="120px" show-overflow-tooltip />
<el-table-column prop="feedingWS" label="备料工位" min-width="120px" show-overflow-tooltip />
<el-table-column prop="lastFeedingMachineNo" label="最后一台备料机器序列号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="lastFeedingTime" label="备料最后一台车日期" min-width="120px" show-overflow-tooltip />
<el-table-column prop="isLack" label="是否缺料" min-width="120px" show-overflow-tooltip />
</el-table>
</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: 40px; width: 430px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<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="goods-list-area">
<legend>
物料信息列表
</legend>
<el-table :data="inventoryGoodsDetails" stripe border max-height="200px"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehiclesQuantity" label="料箱数量" min-width="120px"/>
<el-table-column prop="vehicleIds" label="料箱号" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleStatus" label="料箱状态" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="feedingWS" label="备料工位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="lastFeedingMachineNo" label="最后一台备料机器序列号" min-width="120px"
show-overflow-tooltip/>
<el-table-column prop="lastFeedingTime" label="备料最后一台车日期" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="isLack" label="是否缺料" min-width="120px" show-overflow-tooltip/>
</el-table>
</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: 40px; width: 430px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
输入完料号请按回车确认
</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="getCurrentInvInfo()" 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" clearable></el-input>
</div>
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="invenOut()" style="height: 330px;">
</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="getCurrentInvInfo()" 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" clearable></el-input>
</div>
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="invenOut()" style="height: 330px;">
<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>
<fieldset class="main-area">
<legend>
盘点确认
</legend>
<el-form ref="confirmFormRef" :model="confirmFormEntity" :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: 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="confirmFormEntity.vehicleId" size="default"
ref="confirmVehicleId" v-on:keyup.enter="changeFocus()"
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="confirmFormEntity.goodsId" size="default"
ref="confirmGoodsId" v-on:keyup.enter="changeFocus()"
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="confirmFormEntity.confirmNum"
ref="confirmNum" v-on:keyup.enter="changeFocus()" 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="invenConfirm()" style="height: 270px;">
</div>
</div>
</div>
</el-form>
</fieldset>
<fieldset class="main-area">
<legend>
盘点确认
</legend>
<el-form ref="confirmFormRef" :model="confirmFormEntity" :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: 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="confirmFormEntity.vehicleId" size="default"
ref="confirmVehicleId" v-on:keyup.enter="changeFocus()"
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="confirmFormEntity.goodsId" size="default"
ref="confirmGoodsId" v-on:keyup.enter="changeFocus()"
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="confirmFormEntity.confirmNum"
ref="confirmNum" v-on:keyup.enter="changeFocus()" 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="invenConfirm()" style="height: 270px;">
<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>
</div>
</div>
</el-container>
</el-config-provider>
</el-form>
</fieldset>
</div>
</el-container>
</el-config-provider>
</template>
<script setup>
import store from '@/store'
import { inventoryOut, getCurrentGoodsInventory, inventoryConfirmBack } from '@/api/inventory'
import { replaceEnglishAndNumberIGAI } from '@/utils/formatter'
import { reactive, ref } from 'vue'
import { errorBox } from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus'
import {inventoryOut, getCurrentGoodsInventory, inventoryConfirmBack} from '@/api/inventory'
import {replaceEnglishAndNumberIGAI} from '@/utils/formatter'
import {reactive, ref} from 'vue'
import {errorBox} from '@/utils/myMessageBox.js'
import {ElMessage} from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<script>
export default {
name: 'inventory',
data() {
return {
standId: store.getters.getStandId,
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
goodsId: '',
vehicleId: ''
}),
rules: reactive({
goodsId: [
{ required: true, message: '请输入料号' }
]
}),
inventoryGoodsDetails: [],
confirmFormRef: ref(),
confirmFormEntity: reactive({
goodsId: '',
vehicleId: '',
confirmNum: null
}),
}
},
mounted() {
this.$refs.goodsId.focus()
},
beforeUnmount() {
},
methods: {
//
getCurrentInvInfo() {
if (this.workFormEntity.goodsId == '') {
return
}
const request = {
goodsId: this.workFormEntity.goodsId,
userName: store.getters.getUserName
}
getCurrentGoodsInventory(request).then(res => {
const response = res.data
if (response.code == 0) {
this.inventoryGoodsDetails = response.returnData
} else {
this.inventoryGoodsDetails = []
errorBox(response.message)
}
}).catch(err => {
console.log(err)
this.inventoryGoodsDetails = []
errorBox('查询盘点信息错误。')
})
},
//
resetWorkForms() {
this.workFormEntity = reactive({
goodsId: '',
vehicleId: ''
})
this.$refs.goodsId.focus()
},
resetConfirmForms() {
this.confirmFormEntity = reactive({
vehicleId: '',
goodsId: '',
confirmNum: null
})
this.$refs.confirmGoodsId.focus()
},
invenOut() {
if (this.workFormEntity.goodsId == '') {
errorBox('料号不可缺少')
return
}
const request = {
goodsId: this.workFormEntity.goodsId,
vehicleId: this.confirmFormEntity.vehicleId,
userName: store.getters.getUserName
}
inventoryOut(request).then(res => {
const response = res.data
if (response.code == 0) {
this.resetWorkForms()
ElMessage.success(response.message)
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('下发盘点时发生异常。')
})
},
//
invenConfirm() {
if (this.confirmFormEntity.goodsId == '' || this.confirmFormEntity.vehicleId == '' || this.confirmFormEntity.confirmNum == null || this.confirmFormEntity.confirmNum == '') {
errorBox('料号、箱号、确认数量不可缺少。')
return
}
const confirmParams = {
goodsId: this.confirmFormEntity.goodsId,
vehicleId: this.confirmFormEntity.vehicleId,
confirmNum: this.confirmFormEntity.confirmNum,
userName: store.getters.getUserName
}
inventoryConfirmBack(confirmParams).then(res => {
const response = res.data
if (response.code == 0) {
this.resetConfirmForms()
ElMessage.success(response.message)
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('确认时发生异常')
})
},
changeFocus() {
this.confirmFormEntity.vehicleId = replaceEnglishAndNumberIGAI(this.confirmFormEntity.vehicleId)
if (this.confirmFormEntity.vehicleId == '' || this.confirmFormEntity.vehicleId == null || this.confirmFormEntity.vehicleId == undefined) {
this.$refs.confirmVehicleId.focus()
return
}
if (this.confirmFormEntity.goodsId == '' || this.confirmFormEntity.goodsId == null || this.confirmFormEntity.goodsId == undefined) {
this.$refs.confirmGoodsId.focus()
return
}
if (this.confirmFormEntity.confirmNum == null || this.confirmFormEntity.confirmNum == undefined || this.confirmFormEntity.confirmNum == '') {
this.$refs.confirmNum.focus()
return
}
},
name: 'inventory',
data() {
return {
standId: store.getters.getStandId,
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
goodsId: '',
vehicleId: ''
}),
rules: reactive({
goodsId: [
{required: true, message: '请输入料号'}
]
}),
inventoryGoodsDetails: [],
confirmFormRef: ref(),
confirmFormEntity: reactive({
goodsId: '',
vehicleId: '',
confirmNum: null
}),
invIndexMap: new Map(),
}
},
mounted() {
this.$refs.goodsId.focus()
},
beforeUnmount() {
},
methods: {
//
getCurrentInvInfo() {
if (this.workFormEntity.goodsId === '') {
return
}
const request = {
goodsId: this.workFormEntity.goodsId,
userName: store.getters.getUserName
}
getCurrentGoodsInventory(request).then(res => {
const response = res.data
if (response.code === 0) {
this.inventoryGoodsDetails = response.returnData
} else {
this.inventoryGoodsDetails = []
errorBox(response.message)
}
}).catch(err => {
console.log(err)
this.inventoryGoodsDetails = []
errorBox('查询盘点信息错误。')
})
},
//
resetWorkForms() {
this.workFormEntity = reactive({
goodsId: '',
vehicleId: ''
})
this.$refs.goodsId.focus()
},
resetConfirmForms() {
this.confirmFormEntity = reactive({
vehicleId: '',
goodsId: '',
confirmNum: null
})
this.$refs.confirmGoodsId.focus()
},
invenOut() {
if (this.workFormEntity.goodsId === '') {
errorBox('料号不可缺少')
return
}
const request = {
goodsId: this.workFormEntity.goodsId,
vehicleId: this.confirmFormEntity.vehicleId,
standId: this.standId,
userName: store.getters.getUserName
}
inventoryOut(request).then(res => {
const response = res.data
if (response.code === 0) {
this.resetWorkForms()
ElMessage.success(response.message)
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('下发盘点时发生异常。')
})
},
//
invenConfirm() {
if (this.confirmFormEntity.goodsId === '' || this.confirmFormEntity.vehicleId === '' || this.confirmFormEntity.confirmNum == null || this.confirmFormEntity.confirmNum === '') {
errorBox('料号、箱号、确认数量不可缺少。')
return
}
const invKey = this.confirmFormEntity.goodsId + '_' + this.confirmFormEntity.vehicleId
if (!this.invIndexMap.has(invKey)) {
this.invIndexMap.set(invKey, 1)
} else {
this.invIndexMap.set(invKey, this.invIndexMap.get(invKey) + 1)
}
const confirmParams = {
goodsId: this.confirmFormEntity.goodsId,
vehicleId: this.confirmFormEntity.vehicleId,
confirmNum: this.confirmFormEntity.confirmNum,
invIndex: this.invIndexMap.get(invKey),
standId: this.standId,
userName: store.getters.getUserName
}
inventoryConfirmBack(confirmParams).then(res => {
const response = res.data
if (response.code === 0) {
this.resetConfirmForms()
// map
this.invIndexMap.delete(invKey)
ElMessage.success(response.message)
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('确认时发生异常')
})
},
changeFocus() {
this.confirmFormEntity.vehicleId = replaceEnglishAndNumberIGAI(this.confirmFormEntity.vehicleId)
if (this.confirmFormEntity.vehicleId === '' || this.confirmFormEntity.vehicleId == null) {
this.$refs.confirmVehicleId.focus()
return
}
if (this.confirmFormEntity.goodsId === '' || this.confirmFormEntity.goodsId == null) {
this.$refs.confirmGoodsId.focus()
return
}
if (this.confirmFormEntity.confirmNum == null || this.confirmFormEntity.confirmNum === '') {
this.$refs.confirmNum.focus()
}
},
}
}
</script>
<style scoped>
.content {
display: flex;
width: 100%;
display: flex;
width: 100%;
}
.work-area {
width: 100%;
/* padding: 5px; */
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;
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;
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;
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;
width: 195px;
height: 130px;
font-size: 25px;
}
:deep(.el-input-number) {
width: 125px;
height: 130px;
font-size: 25px;
width: 125px;
height: 130px;
font-size: 25px;
}
/* :deep(.el-input .el-input__inner) {
@ -357,108 +370,108 @@ export default {
} */
.title-div {
display: inline-flex;
width: -webkit-fill-available;
margin-right: 5px;
padding: 5px;
background-color: #CCCCCC;
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;
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;
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;
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;
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;
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: 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;
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: 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: 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: 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;
align-self: center;
font-weight: bold;
font-size: 25px;
}
.goods-list-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;
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;
}
</style>

View File

@ -1,406 +1,474 @@
<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
<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="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
:suffix-icon="Search"/>
<el-input v-model="smallBoxQuery" style="width: 158px; margin-right: 10px;" placeholder="小工位"
:suffix-icon="Search"/>
<el-date-picker v-model="planStartDateQuery" 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>
<el-row>
<el-button style="background-color: #00CED1; color: #000; width: 120px"
@click="exportUndoOrders()">导出未做工单
</el-button>
<el-button style="background-color: #00CED1; color: #000; width: 120px"
@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">&nbsp;</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 v-if="isAddReqmtDate" prop="planStartDate" 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-row v-if="isAddReqmtDate" :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="计划开工时间" prop="planStartDate">
<el-date-picker
v-model="ordersFormEntity.planStartDate"
type="date"
placeholder="选择日期"
style="width: 100%;"
value-format="YYYY-MM-DD"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<el-table-column width="65px" fixed="left">
<template v-slot="scope">
<el-radio :label="scope.row.orderId" v-model="orderId">&nbsp;</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" show-overflow-tooltip/>
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="item" label="Item" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="description" label="描述" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="sLoc" label="SLoc" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="type" label="Type" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="originStatus" label="Status" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="sortString" label="SortStrng" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsUnit" label="单位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="planStartDate" label="开工时间" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="orderStatus" label="状态" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="pickedQuantity" 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="lastUpdateTime" 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" show-overflow-tooltip/>
<el-table-column prop="lastUpdateReason" 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="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-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="计划开工时间" prop="planStartDate">
<el-date-picker
v-model="ordersFormEntity.planStartDate"
type="date"
placeholder="选择日期"
style="width: 100%;"
value-format="YYYY-MM-DD"
/>
</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>
</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 {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 {ElMessageBox, ElMessage} from 'element-plus'
import {errorBox} from '@/utils/myMessageBox.js'
import {ref, reactive} from 'vue'
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
import UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
import { queryUploadRecord } from '@/api/excel.js'
import { Search } from '@element-plus/icons-vue'
import {queryUploadRecord} from '@/api/excel.js'
import {Search} from '@element-plus/icons-vue'
</script>
<script>
import {downloadKateOrdersExcel} from "@/api/excel";
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({}),
isAddReqmtDate: false
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({}),
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
planStartDateQuery: null
}
},
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(),
planStartDate: dateFormatter(this.planStartDateQuery),
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
},
mounted() {
this.search()
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
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 = ''
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,
planStartDate: row.planStartDate
}
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()
},
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,
planStartDate: row.planStartDate
}
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,
planStartDate: formData.planStartDate,
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
},
} 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,
planStartDate: formData.planStartDate,
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
},
//
exportUndoOrders() {
if (this.planStartDateQuery == null) {
errorBox('请选择需求日期')
return
}
const request = {
planStartDate: dateFormatter(this.planStartDateQuery),
orderStatus: 0,
userName: store.getters.getUserName
}
downloadKateOrdersExcel(request).then(res => {
const link = document.createElement('a');//a
try {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
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;
padding-left: 5px;
}
.el-row .el-button {
width: 72px;
margin-left: 0px;
margin-right: 5px;
width: 72px;
margin-left: 0px;
margin-right: 5px;
}
.table-class {
width: 100%;
width: 100%;
}
.el-row .el-form-item {
width: 10% inherit;
justify-content: center;
width: 10% inherit;
justify-content: center;
}
.el-row .el-form-item .el-select-v2 {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-input-number {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-button {
margin: auto;
margin: auto;
}
.title-area {
display: flex;
/* min-height: 10%; */
max-height: max-content;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
flex-direction: column;
padding: 10px;
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>

View File

@ -13,6 +13,8 @@
placeholder="是否允许平地机" :options="yesOrNoOptions" @change="search()"></el-select-v2>
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
<el-button style="width: 130px;" @click="switchCreate()">一键切换创建工作</el-button>
<el-button style="width: 130px;" @click="switchDistribute()">一键切换分配工作</el-button>
</el-row>
</div>
<br/>
@ -156,6 +158,10 @@ import {Search} from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<script>
import {switchToCreate, switchToDistribute} from "@/api/stand";
import myLoading from "@/utils/loading";
import {successBox} from "@/utils/myMessageBox";
export default {
name: 'standSettings',
data() {
@ -268,6 +274,46 @@ export default {
})
this.loading = false
},
switchCreate() {
const request = {
userName: store.getters.getUserName
}
myLoading.open('处理中,请稍等...')
switchToCreate(request).then(res => {
const response = res.data
if (response.code === 0) {
successBox(response.message)
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('一键切换创建工作异常')
}).finally(() => {
myLoading.close()
this.search()
})
},
switchDistribute() {
const request = {
userName: store.getters.getUserName
}
myLoading.open('处理中,请稍等...')
switchToDistribute(request).then(res => {
const response = res.data
if (response.code === 0) {
successBox(response.message)
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('一键切换分配工作异常')
}).finally(() => {
myLoading.close()
this.search()
})
},
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},

File diff suppressed because it is too large Load Diff

301
src/layout/stockForInv.vue Normal file
View File

@ -0,0 +1,301 @@
<template>
<div style="margin-bottom: 10px">
<el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;">
<el-row>
<el-autocomplete v-model="goodsIdQuery" :fetch-suggestions="filterGoodsId"
popper-class="my-autocomplete" placeholder="料号" @select="handleSelectGoodsId"
:suffix-icon="Search" style="width: 196px; margin-right: 10px;">
<template #default="{ item }">
<div>
料号<span class="goods_id">{{ item.goodsId }}</span>
名称<span class="goods_name">{{ item.goodsName }}</span>
</div>
</template>
</el-autocomplete>
<el-input v-model="vehicleIdQuery" style="width: 196px; 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>
</div>
<br/>
<el-table id="stock-table" :data="displayStocks" stripe border v-loading="loading" class="table-class"
max-height="650px" 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">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="stockId" label="库存编号" fixed="left" min-width="120px" 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" show-overflow-tooltip/>
<el-table-column prop="goodsName" label="物料名称" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsType" label="物料类型" :formatter="goodsTypeFormat"
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="goodsStatus" label="物料状态" :formatter="goodsStatusFormat" min-width="120px"/>
<el-table-column prop="stockStatus" label="库存状态" :formatter="stockStatusFormat" fixed="right"
min-width="120px"/>
<el-table-column prop="isInventory" label="是否盘点" :formatter="yesOrNoFormat" min-width="120px"/>
<el-table-column prop="inventoryTaskId" label="盘点任务号" min-width="120px"/>
<el-table-column prop="noUseDays" label="未使用天数" min-width="120px"/>
<el-table-column prop="createTime" label="上架时间" sortable="custom" :formatter="timeFormat"
min-width="120px" show-overflow-tooltip/>
<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>
<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-config-provider>
</div>
</template>
<script setup>
import store from '@/store'
import {getAllStocks, 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 {toUnderScoreCase} from '@/utils/stringUtils.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {Search} from '@element-plus/icons-vue'
import {ref, reactive} from 'vue'
import {errorBox} from '@/utils/myMessageBox.js'
import {ElMessage} from 'element-plus'
// import FileSaver from 'file-saver';
// import * as XLSX from 'xlsx';
</script>
<script>
export default {
name: 'stockFroInv',
data() {
return {
displayStocks: [],
currentPage: 1,
pageSize: 10,
total: 0,
sortBy: '',
isAsc: true,
goodsIdQuery: '',
vehicleIdQuery: '',
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
loading: true,
stockId: '',
goodsList: [],
}
},
mounted() {
this.search()
this.loadAllGoodsInfo()
},
methods: {
loadAllGoodsInfo() {
const request = {
userName: store.getters.getUserName
}
getGoodsInfoByGoodsId(request).then(res => {
const tableResponse = res.data
if (tableResponse.code == 0) {
this.goodsList = tableResponse.returnData
} else {
errorBox(tableResponse.message)
}
}).catch(err => {
console.log(err)
errorBox('查询物料信息异常。')
})
},
filterGoodsId(queryString, cb) {
const results = queryString
? this.goodsList.filter(this.createFilter(queryString))
: this.goodsList
// call callback function to return suggestion objects
cb(results)
},
createFilter(queryString) {
return (restaurant) => {
return (
restaurant.goodsId.toLowerCase().indexOf(queryString.toLowerCase()) != -1
)
}
},
handleSelectGoodsId(item) {
this.goodsIdQuery = item.goodsId
},
locationFormat: (row, column, cellValue, index) => {
return locationFormatter(cellValue)
},
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
},
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 '长时间未使用'
}
},
goodsTypeFormat: (row, column, cellValue, index) => {
if (cellValue == "间接物料") {
return '间接物料'
} else {
return '直接物料'
}
},
stockStatusFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '库存正常'
case 1:
return '出库中'
case 2:
return '盘点中'
case 3:
return '移库中'
case 4:
return '拣选中'
case 5:
return '回库中'
case 6:
return '已出库'
case 9:
return '库存锁定'
default:
return '异常'
}
},
yesOrNoFormat: (row, column, cellValue, index) => {
return yesOrNoFormatter(cellValue)
},
rowStyle: ({row, rowIndex}) => {
if (row.goodsStatus == 3) {
return {"color": "red"}
}
if (row.goodsStatus == 5) {
return {"color": "yellow"}
}
},
handleSortChange(data) {
this.sortBy = toUnderScoreCase(data.prop)
this.isAsc = data.order == 'ascending'
this.search()
},
search() {
this.loading = true
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
sortBy: this.sortBy,
isAsc: this.isAsc,
goodsId: this.goodsIdQuery.trim(),
vehicleId: this.vehicleIdQuery.trim(),
userName: store.getters.getUserName
}
getAllStocks(request).then(res => {
const tableResponse = res.data
if (tableResponse.code == 0) {
this.displayStocks = 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.search()
},
getCurrentRow(row) {
this.stockId = row.stockId
},
},
}
</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;
}
.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>

View File

@ -1,384 +1,395 @@
<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="是否空箱"
<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="goodsIdQuery" 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-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
<el-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
placeholder="物料类型" :options="vehicleTypeOptions" @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"
<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">&nbsp;</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 prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat"
min-width="120px" show-overflow-tooltip />
<el-table-column prop="details" label="绑定关系" :formatter="jsonFormat" min-width="180px"
show-overflow-tooltip />
<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-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="物料类型" prop="vehicleType">
<el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型"
:options="vehicleTypeOptions"></el-select-v2>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="绑定关系" prop="details">
<el-input type="textarea" :rows="2" v-model="vehicleFormEntity.details" placeholder=""
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-table-column width="65px" fixed="left">
<template v-slot="scope">
<el-radio :label="scope.row.vehicleId" v-model="vehicleId">&nbsp;</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 prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat"
min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsInfo" label="绑定关系" :formatter="jsonFormat" min-width="180px"
show-overflow-tooltip/>
<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-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="物料类型" prop="vehicleType">
<el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型"
:options="vehicleTypeOptions"></el-select-v2>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="绑定关系" prop="goodsInfo">
<el-input type="textarea" :rows="2" v-model="vehicleFormEntity.goodsInfo" placeholder=""
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }">
</el-input>
</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>
</el-dialog>
</el-config-provider>
</div>
</template>
<script setup>
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
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, jsonFormatter } from '@/utils/formatter.js'
import { toUnderScoreCase } from '@/utils/stringUtils.js'
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,
jsonFormatter
} from '@/utils/formatter.js'
import {toUnderScoreCase} from '@/utils/stringUtils.js'
// import uploadVehicles from '@/excel/uploadVehicles.vue'
import { downloadVehicleExcel } from '@/api/excel.js'
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,
vehicleTypeQuery: '',
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: '空箱'
}
],
vehicleTypeOptions: [
{
value: "",
label: '全部'
},
{
value: "直接物料",
label: '直接物料'
},
{
value: "间接物料",
label: '间接物料'
}
],
//
vehicleStatusOptions: [
{
value: 1,
label: '入库中'
},
{
value: 2,
label: '在库中'
},
{
value: 3,
label: '出库中'
},
{
value: 99,
label: '异常'
},
]
name: 'vehicle',
props: ['selVehicle'],
emits: ['update:selVehicle'],
data() {
return {
vehicles: [],
currentPage: 1,
pageSize: 10,
total: 0,
sortBy: '',
isAsc: true,
queryKey: '',
locationQuery: '',
goodsIdQuery: '',
isEmptyQuery: -99,
vehicleTypeQuery: '',
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: '空箱'
}
},
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(),
vehicleType: this.vehicleTypeQuery.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
],
vehicleTypeOptions: [
{
value: "",
label: '全部'
},
handleSortChange(data) {
this.sortBy = toUnderScoreCase(data.prop)
this.isAsc = data.order == 'ascending'
this.search()
{
value: "直接物料",
label: '直接物料'
},
vehicleStatusFormat: (row, column, cellValue, index) => {
return vehicleStatusFormatter(cellValue)
{
value: "间接物料",
label: '间接物料'
}
],
//
vehicleStatusOptions: [
{
value: 1,
label: '入库中'
},
locationFormat: (row, column, cellValue, index) => {
return locationFormatter(cellValue)
{
value: 2,
label: '在库中'
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
{
value: 3,
label: '出库中'
},
vehicleTypeFormat: (row, column, cellValue, index) => {
if (cellValue == "间接物料") {
return '间接物料'
} else {
return '直接物料'
}
},
isEmptyFormat: (row, column, cellValue, index) => {
if (cellValue == 0) {
return '带料'
}
if (cellValue == 1) {
return '空箱'
}
},
jsonFormat: (row, column, cellValue, index) => {
return jsonFormatter(cellValue)
},
reset() {
this.queryKey = ''
this.locationQuery = ''
this.search()
},
editCurrentRowVehicle(row) {
this.vehicleFormEntity = {
vehicleId: row.vehicleId,
currentLocation: row.currentLocation,
isEmpty: row.isEmpty,
vehicleStatus: row.vehicleStatus,
vehicleType: row.vehicleType == "间接物料" ? "间接物料" : "直接物料",
details: jsonFormatter(row.details),
lastInTime: row.lastInTime
}
this.dialogVisible = true
},
submitVehicleInfo(formData) {
const request = {
vehicleId: formData.vehicleId,
currentLocation: formData.currentLocation,
isEmpty: formData.isEmpty,
vehicleStatus: formData.vehicleStatus,
vehicleType: formData.vehicleType,
details: formData.details,
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(),
vehicleType: this.vehicleTypeQuery.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'}); //blobblobtypexls
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('导出失败')
})
{
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(),
vehicleType: this.vehicleTypeQuery.trim(),
goodsId: this.goodsIdQuery.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)
},
vehicleTypeFormat: (row, column, cellValue, index) => {
if (cellValue == "间接物料") {
return '间接物料'
} else {
return '直接物料'
}
},
isEmptyFormat: (row, column, cellValue, index) => {
if (cellValue == 0) {
return '带料'
}
if (cellValue == 1) {
return '空箱'
}
},
jsonFormat: (row, column, cellValue, index) => {
console.log(cellValue)
return jsonFormatter(cellValue)
},
reset() {
this.queryKey = ''
this.locationQuery = ''
this.search()
},
editCurrentRowVehicle(row) {
this.vehicleFormEntity = {
vehicleId: row.vehicleId,
currentLocation: row.currentLocation,
isEmpty: row.isEmpty,
vehicleStatus: row.vehicleStatus,
vehicleType: row.vehicleType == "间接物料" ? "间接物料" : "直接物料",
goodsInfo: jsonFormatter(row.goodsInfo),
lastInTime: row.lastInTime
}
this.dialogVisible = true
},
submitVehicleInfo(formData) {
const request = {
vehicleId: formData.vehicleId,
currentLocation: formData.currentLocation,
isEmpty: formData.isEmpty,
vehicleStatus: formData.vehicleStatus,
vehicleType: formData.vehicleType,
goodsInfo: formData.goodsInfo,
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(),
vehicleType: this.vehicleTypeQuery.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'}); //blobblobtypexls
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;
padding-left: 5px;
}
.el-row .el-button {
width: 72px;
margin-left: 0px;
margin-right: 5px;
width: 72px;
margin-left: 0px;
margin-right: 5px;
}
.table-class {
width: 100%;
/* font-size: 5px; */
width: 100%;
/* font-size: 5px; */
}
.el-row .el-form-item {
width: 10% inherit;
justify-content: center;
width: 10% inherit;
justify-content: center;
}
.el-row .el-form-item .el-select-v2 {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-input-number {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-button {
margin: auto;
margin: auto;
}
</style>

356
src/layout/workDateTable.vue Executable file
View File

@ -0,0 +1,356 @@
<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-select-v2 v-model="sourceQuery" style="width: 158px; margin-right: 10px;"
placeholder="请选择查询来源" :options="sourceOptions" @change="search()"></el-select-v2>
<el-date-picker v-model="workDateQuery" 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>
<el-row>
<el-button style="background-color: #5A9CF8; color: #000; width: 120px"
@click="dialogVisible = true">新增一个工作日
</el-button>
<el-button style="background-color: #00CED1; color: #000; width: 120px"
@click="openUploadDialog()">导入工作日历
</el-button>
</el-row>
</div>
<br/>
<el-table :data="workDateList" 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.workDate" v-model="workDate">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="id" label="id" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="workDate" label="工作日" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="remark" label="备注" min-width="120px" show-overflow-tooltip/>
<el-table-column fixed="right" label="操作" width="240px">
<template v-slot="scope">
<el-button plain type="danger" @click="deleteCurrentRowWorkDate(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="workDateFormRef" :model="workDateFormEntity" :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="workDate">
<el-date-picker
v-model="workDateFormEntity.workDate"
type="date"
placeholder="选择日期"
style="width: 100%;"
value-format="YYYY-MM-DD"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="workDateFormEntity.remark" 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="submitAdd(workDateFormEntity)">
确定
</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>
<UploadExcelWorkDate></UploadExcelWorkDate>
</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 UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
import {queryUploadRecord} from '@/api/excel.js'
import {Search} from '@element-plus/icons-vue'
import UploadExcelWorkDate from "@/excel/UploadExcelWorkDate.vue";
</script>
<script>
import {addWorkDate, deleteWorkDate, queryWorkDate} from "@/api/kateWork";
import myLoading from '@/utils/loading'
export default {
name: 'workDate',
data() {
return {
workDateList: [],
currentPage: 1,
uploadRecord: reactive({
fileName: '',
uploadTime: '',
uploadUser: ''
}),
pageSize: 10,
total: 0,
sourceQuery: 1,
workDateQuery: null,
loading: true,
dialogVisible: false,
uploadDialogVisible: false,
workDate: '',
workDateFormEntity: reactive({}),
labelPosition: 'top',
workDateFormRef: ref(),
rules: reactive({}),
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
sourceOptions: [
{
value: 1,
label: '当前使用'
},
{
value: 2,
label: '数据库'
}
]
}
},
mounted() {
this.search()
},
methods: {
search() {
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
sourceType: this.sourceQuery,
workDate: dateFormatter(this.workDateQuery),
userName: store.getters.getUserName
}
this.loading = true
queryWorkDate(request).then(res => {
const tableResponse = res.data
if (tableResponse.code === 0) {
this.workDateList = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
errorBox(tableResponse.message)
}
}).catch(err => {
console.log(err)
errorBox('查询工作日历错误')
}).finally(() => {
this.loading = false
})
},
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
},
reset() {
this.workDateQuery = null
this.search()
},
deleteCurrentRowWorkDate(row) {
this.workDate = row.workDate
ElMessageBox.confirm(
'该操作会删除选择的工作日。\n是否继续',
'警告',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
const params = {
workDate: this.workDate,
userName: store.getters.getUserName
}
myLoading.open("处理中...")
deleteWorkDate(params).then(res => {
if (res.data.code === 0) {
ElMessage.success('删除工作日成功。')
this.search()
} else {
errorBox(res.data.message)
}
}).catch(err => {
console.log(err)
errorBox('删除工作日成功')
}).finally(() => {
myLoading.close()
})
}).catch(() => {
ElMessage.info('操作取消')
})
},
submitAdd(formData) {
const params = {
workDate: formData.workDate,
remark: formData.remark,
userName: store.getters.getUserName
}
myLoading.open("处理中...")
addWorkDate(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('增加工作日失败。')
}).finally(() => {
myLoading.close()
})
},
getCurrentRow(row) {
this.workDate = row.workDate
},
openUploadDialog() {
//
const param = {
userName: store.getters.getUserName,
fileDescription: 'WORK_DATE',
isAsc: false,
sortBy: 'upload_time'
}
myLoading.open("处理中...")
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('发生异常')
}).finally(() => {
myLoading.close()
})
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>

View File

@ -1,306 +1,309 @@
<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; height: 32px;" placeholder="工单号"
:suffix-icon="Search" />
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子"
:suffix-icon="Search" />
<el-input v-model="goodsIdQuery" type="textarea" :rows="1" style="width: 158px; margin-right: 10px; height: 32px;"
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea" />
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
:suffix-icon="Search" />
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-date-picker v-model="workEndDateQuery" type="date" placeholder="工作结束日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
<el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;">
<el-row>
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px; height: 32px;"
placeholder="工单号"
:suffix-icon="Search"/>
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;"
placeholder="工位/小盒子"
:suffix-icon="Search"/>
<el-input v-model="goodsIdQuery" type="textarea" :rows="1"
style="width: 158px; margin-right: 10px; height: 32px;"
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea"/>
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
:suffix-icon="Search"/>
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable/>
<el-date-picker v-model="workEndDateQuery" 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"
<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">&nbsp;</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>
<el-table-column width="65px" fixed="left">
<template v-slot="scope">
<el-radio :label="scope.row.workFlowId" v-model="workFlowId">&nbsp;</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 {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: 'workSummary',
data() {
return {
workSummaryList: [],
currentPage: 1,
pageSize: 10,
total: 0,
workOrderQuery: '',
workCenterQuery: '',
goodsIdQuery: '',
standIdQuery: '',
workDateQuery: null,
workEndDateQuery: 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: '缺料'
}
],
name: 'workSummary',
data() {
return {
workSummaryList: [],
currentPage: 1,
pageSize: 10,
total: 0,
workOrderQuery: '',
workCenterQuery: '',
goodsIdQuery: '',
standIdQuery: '',
workDateQuery: null,
workEndDateQuery: 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().split('\n').filter(id => id.trim() !== '').join(','),
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
workDate: timeFormatter(this.workDateQuery),
workEndDate: timeFormatter(this.workEndDateQuery),
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
},
mounted() {
this.search()
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
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().split('\n').filter(id => id.trim() !== '').join(','),
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
workDate: timeFormatter(this.workDateQuery),
workEndDate: timeFormatter(this.workEndDateQuery),
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().split('\n').filter(id => id.trim() !== '').join(','),
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
workDate: timeFormatter(this.workDateQuery),
workEndDate: timeFormatter(this.workEndDateQuery),
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'}); //blobblobtypexls
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'//
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().split('\n').filter(id => id.trim() !== '').join(','),
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
workDate: timeFormatter(this.workDateQuery),
workEndDate: timeFormatter(this.workEndDateQuery),
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'}); //blobblobtypexls
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('导出失败')
})
},
// 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;
padding-left: 5px;
}
.el-row .el-button {
width: 72px;
margin-left: 0px;
margin-right: 5px;
width: 72px;
margin-left: 0px;
margin-right: 5px;
}
.table-class {
width: 100%;
width: 100%;
}
.el-row .el-form-item {
width: 10% inherit;
justify-content: center;
width: 10% inherit;
justify-content: center;
}
.el-row .el-form-item .el-select-v2 {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-input-number {
width: 100% !important;
width: 100% !important;
}
.el-row .el-form-item .el-button {
margin: auto;
margin: auto;
}
.title-area {
display: flex;
/* min-height: 10%; */
max-height: max-content;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
flex-direction: column;
padding: 10px;
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;
}
/* 专门为料号文本域添加样式 */
.goods-id-container {
display: inline-block;
vertical-align: top;
display: inline-block;
vertical-align: top;
}
.goods-id-textarea {
vertical-align: top;
vertical-align: top;
}
.goods-id-textarea :deep(.el-textarea__inner) {
font-size: 12px;
line-height: 1.2;
padding: 5px;
height: 32px !important;
min-height: 32px !important;
resize: none;
font-size: 12px;
line-height: 1.2;
padding: 5px;
height: 32px !important;
min-height: 32px !important;
resize: none;
}
/* 确保其他输入框保持一致的高度 */
.el-input {
height: 32px;
height: 32px;
}
.el-input :deep(.el-input__wrapper) {
height: 32px;
line-height: 32px;
height: 32px;
line-height: 32px;
}
</style>

View File

@ -9,7 +9,6 @@ const routes = [
path: '/home',
name: 'home',
component: HomeView,
redirect: '/stock',
children: [
{ path: '/stock', component: stock },// 库存
{ path: '/goodsIn', component: () => import('@/layout/goodsIn.vue') },// 入库
@ -44,7 +43,8 @@ const routes = [
{ path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录
{ path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表
{ path: '/rolePermission', component: () => import('@/layout/role_permission.vue') },// 角色——权限列表
{ path: '/workDateTable', component: () => import('@/layout/workDateTable.vue') },// 工作日历
{ path: '/stockForInv', component: () => import('@/layout/stockForInv.vue') },// 库存(盘点用)
]
},
{

View File

@ -2,11 +2,7 @@ import { createStore } from 'vuex'
export default createStore({
state: {
stateTagsList: [{
id: '21',
labelName: '库存',
path: '/stock'
}],
stateTagsList: [],
user: {},
menuList: [],
token: '',

View File

@ -2,21 +2,21 @@ import moment from "moment";
import { revertSeconds } from '@/utils/dateUtils'
function timeFormatter(date) {
if (date === null || date === undefined) {
if (date === null || date === undefined || date === '') {
return ''
}
return moment(date).format('yyyy-MM-DD HH:mm:ss');
}
function dateFormatter(date) {
if (date === null || date === undefined) {
if (date === null || date === undefined || date === '') {
return ''
}
return moment(date).format('yyyy-MM-DD');
}
function dueFormatter(date) {
if (date === null || date === undefined) {
if (date === null || date === undefined || date === '') {
return ''
}
return revertSeconds(moment(new Date().getTime()).diff(moment(date), 'seconds'));
@ -50,7 +50,7 @@ function taskStatusFormatter(value) {
}
function locationFormatter(locationId) {
if (locationId === null || locationId == undefined) {
if (locationId === null || locationId === undefined || locationId === '') {
return ''
}
const locationArray = locationId.split('-')
@ -180,11 +180,11 @@ function replaceEnglishAndNumberIGAI(value) {
}
function yesOrNoFormatter(value) {
return value == 1 ? '是' : '否'
return value === 1 ? '是' : '否'
}
function converseYesOrNoFormatter(value) {
return value == 0 ? '是' : '否'
return value === 0 ? '是' : '否'
}
export {