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", "vue-router": "^4.0.3",
"vue3-print-nb": "^0.1.4", "vue3-print-nb": "^0.1.4",
"vuex": "^4.0.0", "vuex": "^4.0.0",
"worker-loader": "^3.0.8",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
@ -3929,7 +3930,6 @@
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true,
"engines": { "engines": {
"node": "*" "node": "*"
} }
@ -5578,7 +5578,6 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true,
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
} }
@ -7453,7 +7452,6 @@
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz", "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"bin": { "bin": {
"json5": "lib/cli.js" "json5": "lib/cli.js"
}, },
@ -12020,6 +12018,55 @@
"node": ">=0.10.0" "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": { "node_modules/wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@ -15053,8 +15100,7 @@
"big.js": { "big.js": {
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
"dev": true
}, },
"binary-extensions": { "binary-extensions": {
"version": "2.2.0", "version": "2.2.0",
@ -16409,8 +16455,7 @@
"emojis-list": { "emojis-list": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
"dev": true
}, },
"encode-utf8": { "encode-utf8": {
"version": "1.0.3", "version": "1.0.3",
@ -17914,8 +17959,7 @@
"json5": { "json5": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz", "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA=="
"dev": true
}, },
"jsonfile": { "jsonfile": {
"version": "6.1.0", "version": "6.1.0",
@ -21501,6 +21545,37 @@
"dev": true, "dev": true,
"peer": 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": { "wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",

View File

@ -25,6 +25,7 @@
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vue3-print-nb": "^0.1.4", "vue3-print-nb": "^0.1.4",
"vuex": "^4.0.0", "vuex": "^4.0.0",
"worker-loader": "^3.0.8",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "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 { export {
uploadExcelStock, uploadExcelStock,
uploadExcelGoods, uploadExcelGoods,
@ -219,5 +229,6 @@ export {
uploadExcelKanban, uploadExcelKanban,
uploadWorkFlow, uploadWorkFlow,
uploadExcelWorkDate, uploadExcelWorkDate,
downloadWorkFlowExcel downloadWorkFlowExcel,
downloadKateOrdersExcel
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -10,9 +10,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-button style="background-color: #00CED1; color: #000; width: 120px;" <el-button style="background-color: #00CED1; color: #000; width: 120px;"
@click="openUploadDialog(1)">导入DBS</el-button> @click="openUploadDialog()">导入DBS</el-button>
<el-button style="background-color: #32CD32; color: #000; width: 120px;"
@click="openUploadDialog(2)">导入工作日历</el-button>
</el-row> </el-row>
</div> </div>
<br /> <br />
@ -125,33 +123,6 @@
<UploadExcelDbs></UploadExcelDbs> <UploadExcelDbs></UploadExcelDbs>
</fieldset> </fieldset>
</el-dialog> </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> </el-config-provider>
</div> </div>
</template> </template>
@ -300,11 +271,11 @@ export default {
getCurrentRow(row) { getCurrentRow(row) {
this.dbsId = row.dbsId this.dbsId = row.dbsId
}, },
openUploadDialog(uploadType) { openUploadDialog() {
// //
const param = { const param = {
userName: store.getters.getUserName, userName: store.getters.getUserName,
fileDescription: uploadType == 1 ? 'DBS' : 'WORK_DATE', fileDescription: 'DBS',
isAsc: false, isAsc: false,
sortBy: 'upload_time' sortBy: 'upload_time'
} }
@ -330,11 +301,7 @@ export default {
console.log(err) console.log(err)
errorBox('发生异常') errorBox('发生异常')
}) })
if (uploadType == 1) { this.uploadDialogVisible = true
this.uploadDialogVisible = true
} else {
this.uploadWorkDateDialogVisible = true
}
}, },
}, },
} }

View File

@ -1,448 +1,509 @@
<template> <template>
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;"> <div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" <el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
:suffix-icon="Search" /> :suffix-icon="Search"/>
<el-button type="primary" @click="search()">搜索</el-button> <el-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
<el-button type="warning" @click="reset()">重置</el-button> placeholder="物料类型" :options="vehicleTypeOptions" @change="search()"></el-select-v2>
<!-- <el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</el-button> --> <el-button type="primary" @click="search()">搜索</el-button>
</el-row> <el-button type="warning" @click="reset()">重置</el-button>
<el-row> <!-- <el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</el-button> -->
<el-button style="background-color: #00CED1; color: #000;" </el-row>
@click="uploadDialogVisible = true">导入</el-button> <el-row>
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button> <el-button style="background-color: #00CED1; color: #000;"
</el-row> @click="uploadDialogVisible = true">导入
</div> </el-button>
<br /> <el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row </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' }" max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }"> :cell-style="{ 'text-align': 'center' }">
<el-table-column width="65px" fixed="left"> <el-table-column width="65px" fixed="left">
<template v-slot="scope"> <template v-slot="scope">
<el-radio :label="scope.row.goodsId" v-model="goodsId">&nbsp;</el-radio> <el-radio :label="scope.row.goodsId" v-model="goodsId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" /> <el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsName" label="描述" min-width="120px" /> <el-table-column prop="goodsName" label="描述" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsUnit" label="单位" min-width="120px" /> <el-table-column prop="goodsUnit" label="单位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsType" label="物料分类" min-width="120px" /> <el-table-column prop="goodsType" label="物料分类" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="providerType" label="供应商分类" min-width="120px" /> <el-table-column prop="providerType" label="供应商分类" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="weight" label="重量" min-width="120px" /> <el-table-column prop="weight" label="重量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="weightUnit" label="重量单位" min-width="120px" /> <el-table-column prop="weightUnit" label="重量单位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" /> <el-table-column prop="quantityPerBox" label="每盒数量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="unpackingType" label="拆包方式" min-width="120px" /> <el-table-column prop="unpackingType" label="拆包方式" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleType" label="料箱类型" min-width="120px" /> <el-table-column prop="vehicleType" label="料箱类型" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" /> <el-table-column prop="vehicleTypeDescription" label="料箱类型描述" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" /> <el-table-column prop="goodsInVehicleType" label="料箱类型2" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="feedingType" label="补料方式" min-width="120px" /> <el-table-column prop="feedingType" label="补料方式" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="feedingValue" label="补货点" min-width="120px" /> <el-table-column prop="feedingValue" label="补货点" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="heat" label="热度" min-width="120px" /> <el-table-column prop="heat" label="热度" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="releasePoint" label="卸货点" min-width="120px" /> <el-table-column prop="releasePoint" label="卸货点" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="dataSource" label="数据来源" min-width="120px" /> <el-table-column prop="dataSource" label="数据来源" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" /> <el-table-column prop="needInventory" label="盘点管理" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" /> <el-table-column prop="haveSled" label="SLED管理" min-width="120px" show-overflow-tooltip/>
<el-table-column fixed="right" label="操作" width="240px"> <el-table-column prop="sledDays" label="SLED天数" min-width="120px" show-overflow-tooltip/>
<template v-slot="scope"> <el-table-column prop="indicator" label="盘点指示器" min-width="120px" show-overflow-tooltip/>
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button> <el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px"
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button> show-overflow-tooltip/>
</template> <el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" show-overflow-tooltip/>
</el-table-column> <el-table-column fixed="right" label="操作" width="240px">
</el-table> <template v-slot="scope">
<br /> <el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]" <el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
:small="false" :disabled="false" :background="false" :default-page-size="10" </template>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search" </el-table-column>
@current-change="search" /> </el-table>
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false"> <br/>
<div <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;"> :small="false" :disabled="false" :background="false" :default-page-size="10"
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
label-width="100px" style="width: 95%;" :rules="rules" status-icon> @current-change="search"/>
<el-row :gutter="16"> <el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
<el-col :span="12" :offset="0"> <div
<el-form-item label="料号" prop="goodsId"> style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
<el-input v-model="goodsFormEntity.goodsId" disabled /> <el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
</el-form-item> label-width="100px" style="width: 95%;" :rules="rules" status-icon>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="描述" prop="goodsName"> <el-form-item label="料号" prop="goodsId">
<el-input v-model="goodsFormEntity.goodsName" clearable /> <el-input v-model="goodsFormEntity.goodsId" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="16"> <el-form-item label="描述" prop="goodsName">
<el-col :span="12" :offset="0"> <el-input v-model="goodsFormEntity.goodsName" clearable/>
<el-form-item label="单位" prop="goodsUnit"> </el-form-item>
<el-input v-model="goodsFormEntity.goodsUnit" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="物料分类" prop="goodsType"> <el-form-item label="单位" prop="goodsUnit">
<el-input v-model="goodsFormEntity.goodsType" clearable /> <el-input v-model="goodsFormEntity.goodsUnit" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="16"> <el-form-item label="物料分类" prop="goodsType">
<el-col :span="12" :offset="0"> <el-input v-model="goodsFormEntity.goodsType" clearable/>
<el-form-item label="供应商分类" prop="providerType"> </el-form-item>
<el-input v-model="goodsFormEntity.providerType" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="重量" prop="weight"> <el-form-item label="供应商分类" prop="providerType">
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right" <el-input v-model="goodsFormEntity.providerType" clearable/>
:precision="3" :step="0.1" :min="0" clearable /> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
</el-row> <el-form-item label="重量" prop="weight">
<el-row :gutter="16"> <el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
<el-col :span="12" :offset="0"> :precision="3" :step="0.1" :min="0" clearable/>
<el-form-item label="重量单位" prop="weightUnit"> </el-form-item>
<el-input v-model="goodsFormEntity.weightUnit" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="每盒数量" prop="quantityPerBox"> <el-form-item label="重量单位" prop="weightUnit">
<el-input-number v-model.number="goodsFormEntity.quantityPerBox" <el-input v-model="goodsFormEntity.weightUnit" clearable/>
controls-position="right" :min="0" clearable /> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
</el-row> <el-form-item label="每盒数量" prop="quantityPerBox">
<el-row :gutter="16"> <el-input-number v-model.number="goodsFormEntity.quantityPerBox"
<el-col :span="12" :offset="0"> controls-position="right" :min="0" clearable/>
<el-form-item label="拆包方式" prop="unpackingType"> </el-form-item>
<el-input v-model="goodsFormEntity.unpackingType" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="料箱类型" prop="vehicleType"> <el-form-item label="拆包方式" prop="unpackingType">
<el-input v-model="goodsFormEntity.vehicleType" clearable /> <el-input v-model="goodsFormEntity.unpackingType" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="16"> <el-form-item label="料箱类型" prop="vehicleType">
<el-col :span="12" :offset="0"> <el-input v-model="goodsFormEntity.vehicleType" clearable/>
<el-form-item label="热度" prop="heat"> </el-form-item>
<el-input v-model="goodsFormEntity.heat" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="卸货点" prop="releasePoint"> <el-form-item label="热度" prop="heat">
<el-input v-model="goodsFormEntity.releasePoint" clearable /> <el-input v-model="goodsFormEntity.heat" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="16"> <el-form-item label="卸货点" prop="releasePoint">
<el-col :span="12" :offset="0"> <el-input v-model="goodsFormEntity.releasePoint" clearable/>
<el-form-item label="补料方式" prop="feedingType"> </el-form-item>
<el-input v-model="goodsFormEntity.feedingType" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="补货点" prop="feedingValue"> <el-form-item label="补料方式" prop="feedingType">
<el-input-number v-model.number="goodsFormEntity.feedingValue" <el-input v-model="goodsFormEntity.feedingType" clearable/>
controls-position="right" :min="0" clearable /> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
</el-row> <el-form-item label="补货点" prop="feedingValue">
<el-row :gutter="16"> <el-input-number v-model.number="goodsFormEntity.feedingValue"
<el-col :span="12" :offset="0"> controls-position="right" :min="0" clearable/>
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription"> </el-form-item>
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="料箱类型2" prop="goodsInVehicleType"> <el-form-item label="盘点管理" prop="needInventory">
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable /> <el-input v-model="goodsFormEntity.needInventory" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="16"> <el-form-item label="SLED管理" prop="haveSled">
<el-col :span="12" :offset="0"> <el-input v-model="goodsFormEntity.haveSled" clearable/>
<el-form-item label="数据来源" prop="dataSource"> </el-form-item>
<el-input v-model="goodsFormEntity.dataSource" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
</el-row> <el-col :span="12" :offset="0">
</el-form> <el-form-item label="SLED天数" prop="sledDays">
</div> <el-input-number v-model.number="goodsFormEntity.sledDays"
<template #footer> 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"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)"> <el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
确定 确定
</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true"> <el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
<fieldset class="title-area"> <fieldset class="title-area">
<legend>导入物料基本信息</legend> <legend>导入物料基本信息</legend>
<UploadExcelBaseGoods></UploadExcelBaseGoods> <UploadExcelBaseGoods></UploadExcelBaseGoods>
</fieldset> </fieldset>
<fieldset class="title-area"> <fieldset class="title-area">
<legend>导入看板</legend> <legend>导入看板</legend>
<UploadExcelKanban></UploadExcelKanban> <UploadExcelKanban></UploadExcelKanban>
</fieldset> </fieldset>
</el-dialog> </el-dialog>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { 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 zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { ElMessageBox, ElMessage } from 'element-plus' import {ElMessageBox, ElMessage} from 'element-plus'
import { ref, reactive } from 'vue' import {ref, reactive} from 'vue'
import { dateFormatter, timeFormatter } from '@/utils/formatter.js' import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
import { errorBox } from '@/utils/myMessageBox.js' import {errorBox} from '@/utils/myMessageBox.js'
// import UploadExcelGoods from '@/excel/UploadExcelGoods.vue' // import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
import UploadExcelBaseGoods from '@/excel/UploadExcelBaseGoods.vue' import UploadExcelBaseGoods from '@/excel/UploadExcelBaseGoods.vue'
import UploadExcelKanban from '@/excel/UploadExcelKanban.vue' import UploadExcelKanban from '@/excel/UploadExcelKanban.vue'
import { downloadGoodsExcel } from '@/api/excel.js' import {downloadGoodsExcel} from '@/api/excel.js'
import { Search } from '@element-plus/icons-vue' import {Search} from '@element-plus/icons-vue'
</script> </script>
<script> <script>
export default { export default {
name: 'goods', name: 'goods',
data() { data() {
return { return {
goodsList: [], goodsList: [],
goodsInfo: {}, goodsInfo: {},
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
goodsIdQuery: '', goodsIdQuery: '',
loading: true, vehicleTypeQuery: '',
dialogVisible: false, loading: true,
uploadDialogVisible: false, dialogVisible: false,
goodsId: '', uploadDialogVisible: false,
goodsFormEntity: reactive({}), goodsId: '',
labelPosition: 'top', goodsFormEntity: reactive({}),
goodsFormRef: ref(), labelPosition: 'top',
rules: reactive({}) 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() { search() {
this.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: { dateFormat: (row, column, cellValue, index) => {
setIndirect() { return dateFormatter(cellValue)
const request = {} },
updateIndirectInfos(request).then(res => { timeFormat: (row, column, cellValue, index) => {
const response = res.data return timeFormatter(cellValue)
if (response.code == 0) { },
ElMessage.success(response.message) reset() {
} else { this.goodsIdQuery = ''
errorBox(response.message) this.search()
} },
}).catch(err => { editCurrentRowGoods(row) {
console.log(err) this.goodsId = row.goodsId
errorBox('一键设置错误。') this.goodsFormEntity = {
}) goodsId: row.goodsId,
}, goodsName: row.goodsName,
search() { goodsUnit: row.goodsUnit,
this.loading = true goodsType: row.goodsType,
const request = { providerType: row.providerType,
pageNo: this.currentPage, weight: row.weight,
pageSize: this.pageSize, weightUnit: row.weightUnit,
goodsId: this.goodsIdQuery.trim(), quantityPerBox: row.quantityPerBox,
userName: store.getters.getUserName unpackingType: row.unpackingType,
} vehicleType: row.vehicleType,
getGoodsInfoByPage(request).then(res => { vehicleTypeDescription: row.vehicleTypeDescription,
const tableResponse = res.data goodsInVehicleType: row.goodsInVehicleType,
if (tableResponse.code == 0) { feedingType: row.feedingType,
this.goodsList = tableResponse.returnData.lists feedingValue: row.feedingValue,
this.total = tableResponse.returnData.total dataSource: row.dataSource,
} else { heat: row.heat,
errorBox(tableResponse.message) releasePoint: row.releasePoint,
} needInventory: row.needInventory,
}).catch(err => { haveSled: row.haveSled,
console.log(err) sledDays: row.sledDays,
errorBox('查询物料错误') indicator: row.indicator,
}) }
this.loading = false this.dialogVisible = true
}, },
dateFormat: (row, column, cellValue, index) => { deleteCurrentRowGoods(row) {
return dateFormatter(cellValue) this.goodsId = row.goodsId
}, ElMessageBox.confirm(
timeFormat: (row, column, cellValue, index) => { '该操作会删除选择的物料数据。\n是否继续',
return timeFormatter(cellValue) '警告',
}, {
reset() { confirmButtonText: '确认',
this.goodsIdQuery = '' 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() this.search()
}, } else {
editCurrentRowGoods(row) { errorBox(res.data.message)
this.goodsId = row.goodsId }
this.goodsFormEntity = { }).catch(err => {
goodsId: row.goodsId, console.log(err)
goodsName: row.goodsName, errorBox('删除物料信息失败')
goodsUnit: row.goodsUnit, })
goodsType: row.goodsType, }).catch(() => {
providerType: row.providerType, ElMessage.info('操作取消')
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('导出失败')
})
},
}, },
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> </script>
<style scoped> <style scoped>
.el-pagination { .el-pagination {
padding-left: 5px; padding-left: 5px;
} }
.el-row .el-button { .el-row .el-button {
width: 72px; width: 72px;
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;
} }
.table-class { .table-class {
width: 100%; width: 100%;
} }
.el-row .el-form-item { .el-row .el-form-item {
width: 10% inherit; width: 10% inherit;
justify-content: center; justify-content: center;
} }
.el-row .el-form-item .el-select-v2 { .el-row .el-form-item .el-select-v2 {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-input-number { .el-row .el-form-item .el-input-number {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-button { .el-row .el-form-item .el-button {
margin: auto; margin: auto;
} }
.title-area { .title-area {
display: flex; display: flex;
/* min-height: 10%; */ /* min-height: 10%; */
max-height: max-content; max-height: max-content;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
flex-direction: column; flex-direction: column;
padding: 10px; padding: 10px;
} }
</style> </style>

View File

@ -1,349 +1,362 @@
<template> <template>
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-container class="content"> <el-container class="content">
<div class="work-area"> <div class="work-area">
<fieldset class="title-area"> <fieldset class="title-area">
<legend> <legend>
工作台 工作台
</legend> </legend>
<div class="title-div"> <div class="title-div">
<span class="title-text">物料盘点</span> <span class="title-text">物料盘点</span>
</div> </div>
<div class="station-div"> <div class="station-div">
<span class="station-text">工作站</span> <span class="station-text">工作站</span>
</div> </div>
<div class="station-no-div"> <div class="station-no-div">
<span class="station-no-text">{{ standId }}</span> <span class="station-no-text">{{ standId }}</span>
</div> </div>
</fieldset> </fieldset>
<fieldset class="goods-list-area"> <fieldset class="goods-list-area">
<legend> <legend>
物料信息列表 物料信息列表
</legend> </legend>
<el-table :data="inventoryGoodsDetails" stripe border max-height="200px" <el-table :data="inventoryGoodsDetails" stripe border max-height="200px"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"> :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="goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehiclesQuantity" label="料箱数量" min-width="120px" /> <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="vehicleIds" label="料箱号" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleStatus" 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="feedingWS" label="备料工位" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="lastFeedingMachineNo" label="最后一台备料机器序列号" min-width="120px" show-overflow-tooltip /> <el-table-column prop="lastFeedingMachineNo" label="最后一台备料机器序列号" min-width="120px"
<el-table-column prop="lastFeedingTime" label="备料最后一台车日期" min-width="120px" show-overflow-tooltip /> show-overflow-tooltip/>
<el-table-column prop="isLack" label="是否缺料" min-width="120px" show-overflow-tooltip /> <el-table-column prop="lastFeedingTime" label="备料最后一台车日期" min-width="120px" show-overflow-tooltip/>
</el-table> <el-table-column prop="isLack" label="是否缺料" min-width="120px" show-overflow-tooltip/>
</fieldset> </el-table>
<fieldset class="main-area"> </fieldset>
<legend> <fieldset class="main-area">
物料盘点 <legend>
</legend> 物料盘点
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition" </legend>
label-width="150px" style="max-width: 100%" :rules="rules" status-icon> <el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
<div style="display: flex;"> label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
<div style="display: block; margin: 5px;"> <div style="display: flex;">
<div <div style="display: block; margin: 5px;">
style="display: inline-flex; justify-content: center; height: 40px; width: 430px; margin: 5px; padding: 5px; background-color: #00AAE8;"> <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 style="align-self: center; font-weight: bold;font-size: 25px;">
输入完料号请按回车确认 输入完料号请按回车确认
</span> </span>
</div> </div>
<div style="display: flex;"> <div style="display: flex;">
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div class="display-title-div"> <div class="display-title-div">
<span class="display-title-text">料号</span> <span class="display-title-text">料号</span>
</div> </div>
<div class="display-form-div"> <div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId" <el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
v-on:keyup.enter="getCurrentInvInfo()" clearable></el-input> v-on:keyup.enter="getCurrentInvInfo()" clearable></el-input>
</div> </div>
</div> </div>
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div class="display-title-div"> <div class="display-title-div">
<span class="display-title-text">箱号</span> <span class="display-title-text">箱号</span>
</div> </div>
<div class="display-form-div"> <div class="display-form-div">
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId" clearable></el-input> <el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId" clearable></el-input>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin: 10px;"> <div style="margin: 10px;">
<div class="arrow" @click="invenOut()" style="height: 330px;"> <div class="arrow" @click="invenOut()" style="height: 330px;">
<span <span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">请求盘点</span> style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">请求盘点</span>
</div> </div>
</div> </div>
</div> </div>
</el-form> </el-form>
</fieldset> </fieldset>
<fieldset class="main-area"> <fieldset class="main-area">
<legend> <legend>
盘点确认 盘点确认
</legend> </legend>
<el-form ref="confirmFormRef" :model="confirmFormEntity" :label-position="labelPosition" <el-form ref="confirmFormRef" :model="confirmFormEntity" :label-position="labelPosition"
label-width="150px" style="max-width: 100%" :rules="rules" status-icon> label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
<div style="display: flex;"> <div style="display: flex;">
<div style="display: block; margin: 5px;"> <div style="display: block; margin: 5px;">
<div style="display: flex;"> <div style="display: flex;">
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div class="display-title-div"> <div class="display-title-div">
<span class="display-title-text">箱号</span> <span class="display-title-text">箱号</span>
</div> </div>
<div class="display-form-div"> <div class="display-form-div">
<el-input v-model="confirmFormEntity.vehicleId" size="default" <el-input v-model="confirmFormEntity.vehicleId" size="default"
ref="confirmVehicleId" v-on:keyup.enter="changeFocus()" ref="confirmVehicleId" v-on:keyup.enter="changeFocus()"
clearable></el-input> clearable></el-input>
</div> </div>
</div> </div>
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div class="display-title-div"> <div class="display-title-div">
<span class="display-title-text">料号</span> <span class="display-title-text">料号</span>
</div> </div>
<div class="display-form-div"> <div class="display-form-div">
<el-input v-model="confirmFormEntity.goodsId" size="default" <el-input v-model="confirmFormEntity.goodsId" size="default"
ref="confirmGoodsId" v-on:keyup.enter="changeFocus()" ref="confirmGoodsId" v-on:keyup.enter="changeFocus()"
clearable></el-input> clearable></el-input>
</div> </div>
</div> </div>
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div class="display-title-div"> <div class="display-title-div">
<span class="display-title-text">盘点数量</span> <span class="display-title-text">盘点数量</span>
</div> </div>
<div style="display: flex; margin-top: 20px;"> <div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left"> <div class="display-form-div-left">
<el-input-number v-model.number="confirmFormEntity.confirmNum" <el-input-number v-model.number="confirmFormEntity.confirmNum"
ref="confirmNum" v-on:keyup.enter="changeFocus()" controls-position="right" :min="0" /> ref="confirmNum" v-on:keyup.enter="changeFocus()" controls-position="right"
</div> :min="0"/>
<div class="display-form-div-right"> </div>
<span class="display-form-text-right">PC</span> <div class="display-form-div-right">
</div> <span class="display-form-text-right">PC</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin: 10px;"> </div>
<div class="arrow" @click="invenConfirm()" style="height: 270px;"> <div style="margin: 10px;">
<div class="arrow" @click="invenConfirm()" style="height: 270px;">
<span <span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">确认盘点</span> style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">确认盘点</span>
</div> </div>
</div> </div>
</div>
</el-form>
</fieldset>
</div> </div>
</el-container> </el-form>
</el-config-provider> </fieldset>
</div>
</el-container>
</el-config-provider>
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { inventoryOut, getCurrentGoodsInventory, inventoryConfirmBack } from '@/api/inventory' import {inventoryOut, getCurrentGoodsInventory, inventoryConfirmBack} from '@/api/inventory'
import { replaceEnglishAndNumberIGAI } from '@/utils/formatter' import {replaceEnglishAndNumberIGAI} from '@/utils/formatter'
import { reactive, ref } from 'vue' import {reactive, ref} from 'vue'
import { errorBox } from '@/utils/myMessageBox.js' import {errorBox} from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus' import {ElMessage} from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
<script> <script>
export default { export default {
name: 'inventory', name: 'inventory',
data() { data() {
return { return {
standId: store.getters.getStandId, standId: store.getters.getStandId,
labelPosition: 'top', labelPosition: 'top',
workFormRef: ref(), workFormRef: ref(),
workFormEntity: reactive({ workFormEntity: reactive({
goodsId: '', goodsId: '',
vehicleId: '' vehicleId: ''
}), }),
rules: reactive({ rules: reactive({
goodsId: [ goodsId: [
{ required: true, message: '请输入料号' } {required: true, message: '请输入料号'}
] ]
}), }),
inventoryGoodsDetails: [], inventoryGoodsDetails: [],
confirmFormRef: ref(), confirmFormRef: ref(),
confirmFormEntity: reactive({ confirmFormEntity: reactive({
goodsId: '', goodsId: '',
vehicleId: '', vehicleId: '',
confirmNum: null 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,
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
}
},
} }
},
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> </script>
<style scoped> <style scoped>
.content { .content {
display: flex; display: flex;
width: 100%; width: 100%;
} }
.work-area { .work-area {
width: 100%; width: 100%;
/* padding: 5px; */ /* padding: 5px; */
} }
.main-area { .main-area {
margin: auto; margin: auto;
min-height: fit-content; min-height: fit-content;
max-height: 90%; max-height: 90%;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
} }
.title-area { .title-area {
display: flex; display: flex;
/* min-height: 10%; */ /* min-height: 10%; */
max-height: max-content; max-height: max-content;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
} }
.arrow { .arrow {
background: linear-gradient(-105deg, background: linear-gradient(-105deg,
transparent 50%, transparent 50%,
#309330 50%, #309330 50%,
#309330 100%) top right, #309330 100%) top right,
linear-gradient(-75deg, linear-gradient(-75deg,
transparent 50%, transparent 50%,
#309330 50%, #309330 50%,
#309330 100%) bottom right; #309330 100%) bottom right;
background-size: 100% 50%; background-size: 100% 50%;
/* height: 400px; */ /* height: 400px; */
width: 250px; width: 250px;
background-repeat: no-repeat; background-repeat: no-repeat;
display: inline-flex; display: inline-flex;
cursor: pointer; cursor: pointer;
} }
:deep(.el-input) { :deep(.el-input) {
width: 195px; width: 195px;
height: 130px; height: 130px;
font-size: 25px; font-size: 25px;
} }
:deep(.el-input-number) { :deep(.el-input-number) {
width: 125px; width: 125px;
height: 130px; height: 130px;
font-size: 25px; font-size: 25px;
} }
/* :deep(.el-input .el-input__inner) { /* :deep(.el-input .el-input__inner) {
@ -357,108 +370,108 @@ export default {
} */ } */
.title-div { .title-div {
display: inline-flex; display: inline-flex;
width: -webkit-fill-available; width: -webkit-fill-available;
margin-right: 5px; margin-right: 5px;
padding: 5px; padding: 5px;
background-color: #CCCCCC; background-color: #CCCCCC;
} }
.title-text { .title-text {
align-self: center; align-self: center;
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
} }
.station-div { .station-div {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
width: 150px; width: 150px;
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
padding: 5px; padding: 5px;
background-color: #FFFAAA; background-color: #FFFAAA;
} }
.station-text { .station-text {
align-self: center; align-self: center;
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
} }
.station-no-div { .station-no-div {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
width: 200px; width: 200px;
padding: 5px; padding: 5px;
border: 5px double #000000; border: 5px double #000000;
} }
.station-no-text { .station-no-text {
align-self: center; align-self: center;
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
} }
.display-title-div { .display-title-div {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
width: 205px; width: 205px;
height: 80px; height: 80px;
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
background-color: #FFFAAA; background-color: #FFFAAA;
} }
.display-title-text { .display-title-text {
align-self: center; align-self: center;
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
} }
.display-form-div { .display-form-div {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
width: 195px; width: 195px;
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
border: 5px double #000000; border: 5px double #000000;
margin-top: 25px; margin-top: 25px;
} }
.display-form-div-left { .display-form-div-left {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
width: 125px; width: 125px;
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
border: 5px double #000000; border: 5px double #000000;
} }
.display-form-div-right { .display-form-div-right {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
width: 50px; width: 50px;
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
background-color: #CCCCCC; background-color: #CCCCCC;
} }
.display-form-text-right { .display-form-text-right {
align-self: center; align-self: center;
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
} }
.goods-list-area { .goods-list-area {
margin: auto; margin: auto;
min-height: fit-content; min-height: fit-content;
max-height: 90%; max-height: 90%;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
} }
</style> </style>

View File

@ -1,406 +1,474 @@
<template> <template>
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;"> <div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单" <el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px;" placeholder="工单"
:suffix-icon="Search" /> :suffix-icon="Search"/>
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" <el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
:suffix-icon="Search" /> :suffix-icon="Search"/>
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位" <el-input v-model="smallBoxQuery" style="width: 158px; margin-right: 10px;" placeholder="小工位"
:suffix-icon="Search" /> :suffix-icon="Search"/>
<el-button type="primary" @click="search()">搜索</el-button> <el-date-picker v-model="planStartDateQuery" type="date" placeholder="计划开工日期" :shortcuts="shortcuts"
<el-button type="warning" @click="reset()">重置</el-button> style="width: 158px; margin-right: 10px;" clearable />
</el-row> <el-button type="primary" @click="search()">搜索</el-button>
<el-row> <el-button type="warning" @click="reset()">重置</el-button>
<el-button style="background-color: #00CED1; color: #000;" </el-row>
@click="openUploadDialog()">导入</el-button> <el-row>
</el-row> <el-button style="background-color: #00CED1; color: #000; width: 120px"
</div> @click="exportUndoOrders()">导出未做工单
<br /> </el-button>
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row <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' }" max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }"> :cell-style="{ 'text-align': 'center' }">
<el-table-column width="65px" fixed="left"> <el-table-column width="65px" fixed="left">
<template v-slot="scope"> <template v-slot="scope">
<el-radio :label="scope.row.orderId" v-model="orderId">&nbsp;</el-radio> <el-radio :label="scope.row.orderId" v-model="orderId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip /> <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="workOrder" label="工单" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsId" label="料号" min-width="120px" /> <el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" /> <el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="item" label="Item" min-width="120px" /> <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="description" label="描述" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="sLoc" label="SLoc" min-width="120px" /> <el-table-column prop="sLoc" label="SLoc" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="type" label="Type" min-width="120px" /> <el-table-column prop="type" label="Type" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="originStatus" label="Status" min-width="120px" /> <el-table-column prop="originStatus" label="Status" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="sortString" label="SortStrng" min-width="120px" /> <el-table-column prop="sortString" label="SortStrng" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" /> <el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" show-overflow-tooltip/>
<el-table-column prop="goodsUnit" label="单位" min-width="120px" /> <el-table-column prop="goodsUnit" label="单位" min-width="120px" show-overflow-tooltip/>
<el-table-column v-if="isAddReqmtDate" prop="planStartDate" label="开工时间" min-width="120px" /> <el-table-column prop="planStartDate" label="开工时间" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="orderStatus" label="状态" min-width="120px" /> <el-table-column prop="orderStatus" label="状态" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" /> <el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" /> <el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="finishTime" label="计划完成时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip /> <el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
<el-table-column prop="userName" label="操作人员" min-width="120px" /> show-overflow-tooltip/>
<el-table-column fixed="right" label="操作" width="240px"> <el-table-column prop="lastUpdateTime" label="最新更新时间" :formatter="timeFormat" min-width="120px"
<template v-slot="scope"> show-overflow-tooltip/>
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button> <el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
<el-button plain type="danger" @click="deleteCurrentRowOrders(scope.row)">删除</el-button> show-overflow-tooltip/>
</template> <el-table-column prop="userName" label="操作人员" min-width="120px" show-overflow-tooltip/>
</el-table-column> <el-table-column prop="lastUpdateReason" label="来源" min-width="120px" show-overflow-tooltip/>
</el-table> <el-table-column fixed="right" label="操作" width="240px">
<br /> <template v-slot="scope">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]" <el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
:small="false" :disabled="false" :background="false" :default-page-size="10" <el-button plain type="danger" @click="deleteCurrentRowOrders(scope.row)">删除</el-button>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search" </template>
@current-change="search" /> </el-table-column>
<el-dialog v-model="dialogVisible" title="工单信息" width="40%" draggable :show-close="false"> </el-table>
<div <br/>
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;"> <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition" :small="false" :disabled="false" :background="false" :default-page-size="10"
label-width="100px" style="width: 95%;" :rules="rules" status-icon> layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
<el-row :gutter="16"> @current-change="search"/>
<el-col :span="12" :offset="0"> <el-dialog v-model="dialogVisible" title="工单信息" width="40%" draggable :show-close="false">
<el-form-item label="id" prop="orderId"> <div
<el-input v-model="ordersFormEntity.orderId" disabled /> style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
</el-form-item> <el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
</el-col> label-width="100px" style="width: 95%;" :rules="rules" status-icon>
<el-col :span="12"> <el-row :gutter="16">
<el-form-item label="工单" prop="workOrder"> <el-col :span="12" :offset="0">
<el-input v-model="ordersFormEntity.workOrder" disabled /> <el-form-item label="id" prop="orderId">
</el-form-item> <el-input v-model="ordersFormEntity.orderId" disabled/>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row :gutter="16"> <el-col :span="12">
<el-col :span="12" :offset="0"> <el-form-item label="工单" prop="workOrder">
<el-form-item label="小工位" prop="supplyArea"> <el-input v-model="ordersFormEntity.workOrder" disabled/>
<el-input v-model="ordersFormEntity.supplyArea" disabled /> </el-form-item>
</el-form-item> </el-col>
</el-col> </el-row>
<el-col :span="12"> <el-row :gutter="16">
<el-form-item label="料号" prop="goodsId"> <el-col :span="12" :offset="0">
<el-input v-model="ordersFormEntity.goodsId" disabled /> <el-form-item label="小工位" prop="supplyArea">
</el-form-item> <el-input v-model="ordersFormEntity.supplyArea" disabled/>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row :gutter="16"> <el-col :span="12">
<el-col :span="12" :offset="0"> <el-form-item label="料号" prop="goodsId">
<el-form-item label="需求数量" prop="requirementQuantity"> <el-input v-model="ordersFormEntity.goodsId" disabled/>
<el-input-number v-model.number="ordersFormEntity.requirementQuantity" </el-form-item>
controls-position="right" :min="0" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="状态" prop="orderStatus"> <el-form-item label="需求数量" prop="requirementQuantity">
<el-input-number v-model.number="ordersFormEntity.orderStatus" <el-input-number v-model.number="ordersFormEntity.requirementQuantity"
controls-position="right" :min="0" :max="4" clearable /> controls-position="right" :min="0" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="16"> <el-form-item label="状态" prop="orderStatus">
<el-col :span="12" :offset="0"> <el-input-number v-model.number="ordersFormEntity.orderStatus"
<el-form-item label="缺少数量" prop="lackQuantity"> controls-position="right" :min="0" :max="4" clearable/>
<el-input-number v-model.number="ordersFormEntity.lackQuantity" </el-form-item>
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12" :offset="0">
<el-form-item label="已拣数量" prop="pickedQuantity"> <el-form-item label="缺少数量" prop="lackQuantity">
<el-input-number v-model.number="ordersFormEntity.pickedQuantity" <el-input-number v-model.number="ordersFormEntity.lackQuantity"
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable /> controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity"
</el-form-item> clearable/>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row v-if="isAddReqmtDate" :gutter="16"> <el-col :span="12">
<el-col :span="12" :offset="0"> <el-form-item label="已拣数量" prop="pickedQuantity">
<el-form-item label="计划开工时间" prop="planStartDate"> <el-input-number v-model.number="ordersFormEntity.pickedQuantity"
<el-date-picker controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity"
v-model="ordersFormEntity.planStartDate" clearable/>
type="date" </el-form-item>
placeholder="选择日期" </el-col>
style="width: 100%;" </el-row>
value-format="YYYY-MM-DD" <el-row :gutter="16">
/> <el-col :span="12" :offset="0">
</el-form-item> <el-form-item label="计划开工时间" prop="planStartDate">
</el-col> <el-date-picker
</el-row> v-model="ordersFormEntity.planStartDate"
</el-form> type="date"
</div> placeholder="选择日期"
<template #footer> style="width: 100%;"
value-format="YYYY-MM-DD"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)"> <el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
确定 确定
</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true"> <el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
<fieldset class="title-area"> <fieldset class="title-area">
<legend>上次更新</legend> <legend>上次更新</legend>
<div style="padding: 5px;"> <div style="padding: 5px;">
<div style="display: flex; margin-bottom: 10px;"> <div style="display: flex; margin-bottom: 10px;">
<div style="display: flex; width: 100%;"> <div style="display: flex; width: 100%;">
<div style="width: 30%; align-content: center;">时间</div> <div style="width: 30%; align-content: center;">时间</div>
<el-input v-model="uploadRecord.uploadTime" readonly /> <el-input v-model="uploadRecord.uploadTime" readonly/>
</div> </div>
<div style="display: flex; width: 100%; margin-left: 5px;"> <div style="display: flex; width: 100%; margin-left: 5px;">
<div style="width: 30%; align-content: center;">人员</div> <div style="width: 30%; align-content: center;">人员</div>
<el-input v-model="uploadRecord.uploadUser" readonly /> <el-input v-model="uploadRecord.uploadUser" readonly/>
</div> </div>
</div> </div>
<div style="display: flex; width: 100%;"> <div style="display: flex; width: 100%;">
<div style="width: 13%; align-content: center;">文件名</div> <div style="width: 13%; align-content: center;">文件名</div>
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1" <el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly> :show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
</el-input> </el-input>
</div> </div>
</div> </div>
</fieldset> </fieldset>
<fieldset class="title-area"> <fieldset class="title-area">
<legend>再次更新</legend> <legend>再次更新</legend>
<UploadExcelOrders></UploadExcelOrders> <UploadExcelOrders></UploadExcelOrders>
</fieldset> </fieldset>
</el-dialog> </el-dialog>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { 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 zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { ElMessageBox, ElMessage } from 'element-plus' import {ElMessageBox, ElMessage} from 'element-plus'
import { errorBox } from '@/utils/myMessageBox.js' import {errorBox} from '@/utils/myMessageBox.js'
import { ref, reactive } from 'vue' import {ref, reactive} from 'vue'
import { dateFormatter, timeFormatter } from '@/utils/formatter.js' import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
import UploadExcelOrders from '@/excel/UploadExcelOrders.vue' import UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
import { queryUploadRecord } from '@/api/excel.js' import {queryUploadRecord} from '@/api/excel.js'
import { Search } from '@element-plus/icons-vue' import {Search} from '@element-plus/icons-vue'
</script> </script>
<script> <script>
import {downloadKateOrdersExcel} from "@/api/excel";
export default { export default {
name: 'kateOrders', name: 'kateOrders',
data() { data() {
return { return {
ordersList: [], ordersList: [],
currentPage: 1, currentPage: 1,
uploadRecord: reactive({ uploadRecord: reactive({
fileName: '', fileName: '',
uploadTime: '', uploadTime: '',
uploadUser: '' uploadUser: ''
}), }),
pageSize: 10, pageSize: 10,
total: 0, total: 0,
workOrderQuery: '', workOrderQuery: '',
goodsIdQuery: '', goodsIdQuery: '',
smallBoxQuery: '', smallBoxQuery: '',
loading: true, loading: true,
dialogVisible: false, dialogVisible: false,
uploadDialogVisible: false, uploadDialogVisible: false,
orderId: '', orderId: '',
ordersFormEntity: reactive({}), ordersFormEntity: reactive({}),
labelPosition: 'top', labelPosition: 'top',
ordersFormRef: ref(), ordersFormRef: ref(),
rules: reactive({}), rules: reactive({}),
isAddReqmtDate: false 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() { dateFormat: (row, column, cellValue, index) => {
this.search() return dateFormatter(cellValue)
}, },
methods: { timeFormat: (row, column, cellValue, index) => {
search() { return timeFormatter(cellValue)
this.loading = true },
const request = { reset() {
pageNo: this.currentPage, this.workOrderQuery = ''
pageSize: this.pageSize, this.goodsIdQuery = ''
workOrder: this.workOrderQuery.trim(), this.smallBoxQuery = ''
goodsId: this.goodsIdQuery.trim(), this.search()
supplyArea: this.smallBoxQuery.trim(), },
userName: store.getters.getUserName editCurrentRowOrders(row) {
} this.orderId = row.orderId
getOrders(request).then(res => { this.ordersFormEntity = {
const tableResponse = res.data orderId: row.orderId,
if (tableResponse.code == 0) { workOrder: row.workOrder,
this.ordersList = tableResponse.returnData.lists goodsId: row.goodsId,
this.total = tableResponse.returnData.total supplyArea: row.supplyArea,
} else { requirementQuantity: row.requirementQuantity,
errorBox(tableResponse.message) orderStatus: row.orderStatus,
} lackQuantity: row.lackQuantity,
}).catch(err => { pickedQuantity: row.pickedQuantity,
console.log(err) planStartDate: row.planStartDate
errorBox('查询工单错误') }
}) this.dialogVisible = true
this.loading = false },
}, deleteCurrentRowOrders(row) {
dateFormat: (row, column, cellValue, index) => { this.orderId = row.orderId
return dateFormatter(cellValue) ElMessageBox.confirm(
}, '该操作会删除选择的工单数据。\n是否继续',
timeFormat: (row, column, cellValue, index) => { '警告',
return timeFormatter(cellValue) {
}, confirmButtonText: '确认',
reset() { cancelButtonText: '取消',
this.workOrderQuery = '' type: 'warning',
this.goodsIdQuery = '' }
this.smallBoxQuery = '' ).then(() => {
const params = {
orderId: this.orderId,
userName: store.getters.getUserName
}
deleteOrders(params).then(res => {
if (res.data.code == 0) {
ElMessage.success('删除工单信息成功。')
this.search() this.search()
}, } else {
editCurrentRowOrders(row) { errorBox(res.data.message)
this.orderId = row.orderId }
this.ordersFormEntity = { }).catch(err => {
orderId: row.orderId, console.log(err)
workOrder: row.workOrder, errorBox('删除工单信息成功')
goodsId: row.goodsId, })
supplyArea: row.supplyArea, }).catch(() => {
requirementQuantity: row.requirementQuantity, ElMessage.info('操作取消')
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
},
}, },
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> </script>
<style scoped> <style scoped>
.el-pagination { .el-pagination {
padding-left: 5px; padding-left: 5px;
} }
.el-row .el-button { .el-row .el-button {
width: 72px; width: 72px;
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;
} }
.table-class { .table-class {
width: 100%; width: 100%;
} }
.el-row .el-form-item { .el-row .el-form-item {
width: 10% inherit; width: 10% inherit;
justify-content: center; justify-content: center;
} }
.el-row .el-form-item .el-select-v2 { .el-row .el-form-item .el-select-v2 {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-input-number { .el-row .el-form-item .el-input-number {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-button { .el-row .el-form-item .el-button {
margin: auto; margin: auto;
} }
.title-area { .title-area {
display: flex; display: flex;
/* min-height: 10%; */ /* min-height: 10%; */
max-height: max-content; max-height: max-content;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
flex-direction: column; flex-direction: column;
padding: 10px; padding: 10px;
} }
</style> </style>

View File

@ -13,6 +13,8 @@
placeholder="是否允许平地机" :options="yesOrNoOptions" @change="search()"></el-select-v2> placeholder="是否允许平地机" :options="yesOrNoOptions" @change="search()"></el-select-v2>
<el-button type="primary" @click="search()">搜索</el-button> <el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button> <el-button type="warning" @click="reset()">重置</el-button>
<el-button style="width: 130px;" @click="switchCreate()">一键切换创建工作</el-button>
<el-button style="width: 130px;" @click="switchDistribute()">一键切换分配工作</el-button>
</el-row> </el-row>
</div> </div>
<br/> <br/>
@ -156,6 +158,10 @@ import {Search} from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
<script> <script>
import {switchToCreate, switchToDistribute} from "@/api/stand";
import myLoading from "@/utils/loading";
import {successBox} from "@/utils/myMessageBox";
export default { export default {
name: 'standSettings', name: 'standSettings',
data() { data() {
@ -268,6 +274,46 @@ export default {
}) })
this.loading = false 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) => { dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue) 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> <template>
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号" <el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号"
:suffix-icon="Search" /> :suffix-icon="Search"/>
<el-input v-model="locationQuery" style="width: 158px; margin-right: 10px;" placeholder="位置" <el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
:suffix-icon="Search" /> :suffix-icon="Search"/>
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱" <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> :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> placeholder="物料类型" :options="vehicleTypeOptions" @change="search()"></el-select-v2>
<el-button type="primary" @click="search()">搜索</el-button> <el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button> <el-button type="warning" @click="reset()">重置</el-button>
</el-row> </el-row>
<el-row v-if="selVehicle == null"> <el-row v-if="selVehicle == null">
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button> <el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
</el-row> </el-row>
</div> </div>
<br /> <br/>
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px" <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' }" highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }" @sort-change="handleSortChange"> :cell-style="{ 'text-align': 'center' }" @sort-change="handleSortChange">
<el-table-column width="65px" fixed="left"> <el-table-column width="65px" fixed="left">
<template v-slot="scope"> <template v-slot="scope">
<el-radio :label="scope.row.vehicleId" v-model="vehicleId">&nbsp;</el-radio> <el-radio :label="scope.row.vehicleId" v-model="vehicleId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" /> <el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px"/>
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat" <el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat"
min-width="120px" show-overflow-tooltip /> min-width="120px" show-overflow-tooltip/>
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" /> <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="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px"/>
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat" <el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat"
min-width="120px" /> min-width="120px"/>
<el-table-column prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat" <el-table-column prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat"
min-width="120px" show-overflow-tooltip /> min-width="120px" show-overflow-tooltip/>
<el-table-column prop="details" label="绑定关系" :formatter="jsonFormat" min-width="180px" <el-table-column prop="goodsInfo" label="绑定关系" :formatter="jsonFormat" min-width="180px"
show-overflow-tooltip /> show-overflow-tooltip/>
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null"> <el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
<template v-slot="scope"> <template v-slot="scope">
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button> <el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<br /> <br/>
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]" <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
:small="false" :disabled="false" :background="false" :default-page-size="10" :small="false" :disabled="false" :background="false" :default-page-size="10"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
@current-change="search" /> @current-change="search"/>
<el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false"> <el-dialog v-model="dialogVisible" title="料箱信息" width="40%" draggable :show-close="false">
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition" <el-form ref="vehicleFormRef" :model="vehicleFormEntity" :label-position="labelPosition"
label-width="100px" style="max-width: 100%" :rules="rules" status-icon> label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="箱号" prop="vehicleId"> <el-form-item label="箱号" prop="vehicleId">
<el-input v-model="vehicleFormEntity.vehicleId" disabled /> <el-input v-model="vehicleFormEntity.vehicleId" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="库位" prop="locationId"> <el-form-item label="库位" prop="locationId">
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" /> <el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="空箱" prop="isEmpty"> <el-form-item label="空箱" prop="isEmpty">
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托" <el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
:options="isEmptyOptions"></el-select-v2> :options="isEmptyOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="状态" prop="vehicleStatus"> <el-form-item label="状态" prop="vehicleStatus">
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择料箱状态" <el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择料箱状态"
:options="vehicleStatusOptions"></el-select-v2> :options="vehicleStatusOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="物料类型" prop="vehicleType"> <el-form-item label="物料类型" prop="vehicleType">
<el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型" <el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型"
:options="vehicleTypeOptions"></el-select-v2> :options="vehicleTypeOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="绑定关系" prop="details"> <el-form-item label="绑定关系" prop="goodsInfo">
<el-input type="textarea" :rows="2" v-model="vehicleFormEntity.details" placeholder="" <el-input type="textarea" :rows="2" v-model="vehicleFormEntity.goodsInfo" placeholder=""
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }"> :maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)"> <el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
确定 确定
</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup> <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 zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { errorBox } from '@/utils/myMessageBox.js' import {errorBox} from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus' import {ElMessage} from 'element-plus'
import { Search } from '@element-plus/icons-vue' import {Search} from '@element-plus/icons-vue'
import { ref, reactive } from 'vue' import {ref, reactive} from 'vue'
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter, jsonFormatter } from '@/utils/formatter.js' import {
import { toUnderScoreCase } from '@/utils/stringUtils.js' vehicleStatusFormatter,
locationFormatter,
dateFormatter,
timeFormatter,
jsonFormatter
} from '@/utils/formatter.js'
import {toUnderScoreCase} from '@/utils/stringUtils.js'
// import uploadVehicles from '@/excel/uploadVehicles.vue' // import uploadVehicles from '@/excel/uploadVehicles.vue'
import { downloadVehicleExcel } from '@/api/excel.js' import {downloadVehicleExcel} from '@/api/excel.js'
import store from '@/store' import store from '@/store'
</script> </script>
<script> <script>
export default { export default {
name: 'vehicle', name: 'vehicle',
props: ['selVehicle'], props: ['selVehicle'],
emits: ['update:selVehicle'], emits: ['update:selVehicle'],
data() { data() {
return { return {
vehicles: [], vehicles: [],
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
sortBy: '', sortBy: '',
isAsc: true, isAsc: true,
queryKey: '', queryKey: '',
locationQuery: '', locationQuery: '',
isEmptyQuery: -99, goodsIdQuery: '',
vehicleTypeQuery: '', isEmptyQuery: -99,
loading: true, vehicleTypeQuery: '',
dialogVisible: false, loading: true,
vehicleId: '', dialogVisible: false,
vehicleFormEntity: reactive({}), vehicleId: '',
labelPosition: 'top', vehicleFormEntity: reactive({}),
vehicleFormRef: ref(), labelPosition: 'top',
rules: reactive({ vehicleFormRef: ref(),
vehicleId: [ rules: reactive({
{ required: true, message: '请输入箱号' } vehicleId: [
], {required: true, message: '请输入箱号'}
currentLocation: [ ],
{ required: true, message: '请输入库位' } currentLocation: [
] {required: true, message: '请输入库位'}
}), ]
// }),
isEmptyOptions: [ //
{ isEmptyOptions: [
value: -99, {
label: '全部' value: -99,
}, label: '全部'
{ },
value: 0, {
label: '带料' value: 0,
}, label: '带料'
{ },
value: 1, {
label: '空箱' value: 1,
} label: '空箱'
],
vehicleTypeOptions: [
{
value: "",
label: '全部'
},
{
value: "直接物料",
label: '直接物料'
},
{
value: "间接物料",
label: '间接物料'
}
],
//
vehicleStatusOptions: [
{
value: 1,
label: '入库中'
},
{
value: 2,
label: '在库中'
},
{
value: 3,
label: '出库中'
},
{
value: 99,
label: '异常'
},
]
} }
}, ],
mounted() { vehicleTypeOptions: [
this.search() {
}, value: "",
methods: { label: '全部'
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
}, },
handleSortChange(data) { {
this.sortBy = toUnderScoreCase(data.prop) value: "直接物料",
this.isAsc = data.order == 'ascending' label: '直接物料'
this.search()
}, },
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 == "间接物料") { value: 99,
return '间接物料' label: '异常'
} 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('导出失败')
})
}, },
]
} }
},
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> </script>
<style scoped> <style scoped>
.el-pagination { .el-pagination {
padding-left: 5px; padding-left: 5px;
} }
.el-row .el-button { .el-row .el-button {
width: 72px; width: 72px;
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;
} }
.table-class { .table-class {
width: 100%; width: 100%;
/* font-size: 5px; */ /* font-size: 5px; */
} }
.el-row .el-form-item { .el-row .el-form-item {
width: 10% inherit; width: 10% inherit;
justify-content: center; justify-content: center;
} }
.el-row .el-form-item .el-select-v2 { .el-row .el-form-item .el-select-v2 {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-input-number { .el-row .el-form-item .el-input-number {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-button { .el-row .el-form-item .el-button {
margin: auto; margin: auto;
} }
</style> </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> <template>
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;"> <div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工单号" <el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px; height: 32px;"
:suffix-icon="Search" /> placeholder="工单号"
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子" :suffix-icon="Search"/>
:suffix-icon="Search" /> <el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;"
<el-input v-model="goodsIdQuery" type="textarea" :rows="1" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子"
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea" /> :suffix-icon="Search"/>
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号" <el-input v-model="goodsIdQuery" type="textarea" :rows="1"
:suffix-icon="Search" /> style="width: 158px; margin-right: 10px; height: 32px;"
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts" placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea"/>
style="width: 158px; margin-right: 10px;" clearable /> <el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
<el-date-picker v-model="workEndDateQuery" type="date" placeholder="工作结束日期" :shortcuts="shortcuts" :suffix-icon="Search"/>
style="width: 158px; margin-right: 10px;" clearable /> <el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;" 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> placeholder="请选择缺料状态" :options="lackStatusOptions" @change="search()"></el-select-v2>
<el-button type="primary" @click="search()">搜索</el-button> <el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button> <el-button type="warning" @click="reset()">重置</el-button>
</el-row> </el-row>
<el-row> <el-row>
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button> <el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
</el-row> </el-row>
</div> </div>
<br /> <br/>
<el-table :data="workSummaryList" stripe border v-loading="loading" class="table-class" <el-table :data="workSummaryList" stripe border v-loading="loading" class="table-class"
highlight-current-row max-height="650px" @row-click="getCurrentRow" highlight-current-row max-height="650px" @row-click="getCurrentRow"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"> :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
<el-table-column width="65px" fixed="left"> <el-table-column width="65px" fixed="left">
<template v-slot="scope"> <template v-slot="scope">
<el-radio :label="scope.row.workFlowId" v-model="workFlowId">&nbsp;</el-radio> <el-radio :label="scope.row.workFlowId" v-model="workFlowId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip /> <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="workStation" label="站台号" min-width="120px" show-overflow-tooltip/>
<el-table-column prop="workOrder" 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="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px"/>
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip /> <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="needNum" label="需求数量" min-width="120px"/>
<el-table-column prop="pickedNum" 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="lackNum" label="缺件数量" min-width="120px"/>
<el-table-column prop="eLocationId" label="拣货位置" min-width="120px" /> <el-table-column prop="eLocationId" label="拣货位置" min-width="120px"/>
<el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat" <el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat"
min-width="120px" /> min-width="120px"/>
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" 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" <el-table-column prop="workDate" label="工作日期" :formatter="dateFormat" min-width="120px"
show-overflow-tooltip /> show-overflow-tooltip/>
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" <el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
show-overflow-tooltip /> show-overflow-tooltip/>
<el-table-column prop="opUser" label="操作用户" min-width="120px" /> <el-table-column prop="opUser" label="操作用户" min-width="120px"/>
</el-table> </el-table>
<br /> <br/>
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]" <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
:small="false" :disabled="false" :background="false" :default-page-size="10" :small="false" :disabled="false" :background="false" :default-page-size="10"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
@current-change="search" /> @current-change="search"/>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { getWorkSummary } from '@/api/kateWork.js' import {getWorkSummary} from '@/api/kateWork.js'
import { downloadWorkSummaryExcel } from '@/api/excel.js' import {downloadWorkSummaryExcel} from '@/api/excel.js'
import { errorBox } from '@/utils/myMessageBox.js' import {errorBox} from '@/utils/myMessageBox.js'
import { dateFormatter, timeFormatter } from '@/utils/formatter.js' import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
import { Search } from '@element-plus/icons-vue' import {Search} from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
<script> <script>
export default { export default {
name: 'workSummary', name: 'workSummary',
data() { data() {
return { return {
workSummaryList: [], workSummaryList: [],
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
workOrderQuery: '', workOrderQuery: '',
workCenterQuery: '', workCenterQuery: '',
goodsIdQuery: '', goodsIdQuery: '',
standIdQuery: '', standIdQuery: '',
workDateQuery: null, workDateQuery: null,
workEndDateQuery: null, workEndDateQuery: null,
shortcuts: [ shortcuts: [
{ {
text: '今天', text: '今天',
value: new Date(), value: new Date(),
}, },
{ {
text: '昨天', text: '昨天',
value: () => { value: () => {
const date = new Date() const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24) date.setTime(date.getTime() - 3600 * 1000 * 24)
return date return date
}, },
}, },
], ],
lackStatusQuery: -99, lackStatusQuery: -99,
loading: true, loading: true,
workFlowId: '', workFlowId: '',
lackStatusOptions: [ lackStatusOptions: [
{ {
value: -99, value: -99,
label: '全部' label: '全部'
}, },
{ {
value: 0, value: 0,
label: '不缺' label: '不缺'
}, },
{ {
value: 1, value: 1,
label: '缺料' 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() { dateFormat: (row, column, cellValue, index) => {
this.search() return dateFormatter(cellValue)
}, },
methods: { timeFormat: (row, column, cellValue, index) => {
search() { return timeFormatter(cellValue)
this.loading = true },
const request = { lackStatusFormat: (row, column, cellValue, index) => {
pageNo: this.currentPage, switch (cellValue) {
pageSize: this.pageSize, case 0:
workStation: this.standIdQuery.trim(), return '不缺'
workOrder: this.workOrderQuery.trim(), case 1:
workCenter: this.workCenterQuery.trim(), return '缺料'
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','), default:
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery, return '未知'
workDate: timeFormatter(this.workDateQuery), }
workEndDate: timeFormatter(this.workEndDateQuery), },
userName: store.getters.getUserName workStatusFormat: (row, column, cellValue, index) => {
} switch (cellValue) {
getWorkSummary(request).then(res => { case 0:
const tableResponse = res.data return '未开始'
if (tableResponse.code == 0) { case 1:
this.workSummaryList = tableResponse.returnData.lists return '正在做'
this.total = tableResponse.returnData.total case 2:
} else { return '已完成'
errorBox(tableResponse.message) default:
} return '未知'
}).catch(err => { }
console.log(err) },
errorBox('查询工作总结错误') reset() {
}) this.standIdQuery = ''
this.loading = false this.workOrderQuery = ''
}, this.workCenterQuery = ''
dateFormat: (row, column, cellValue, index) => { this.goodsIdQuery = ''
return dateFormatter(cellValue) this.workDateQuery = null
}, this.search()
timeFormat: (row, column, cellValue, index) => { },
return timeFormatter(cellValue) getCurrentRow(row) {
}, this.workFlowId = row.workFlowId
lackStatusFormat: (row, column, cellValue, index) => { },
switch (cellValue) { exportExcel() {
case 0: const request = {
return '不缺' workStation: this.standIdQuery.trim(),
case 1: workOrder: this.workOrderQuery.trim(),
return '缺料' workCenter: this.workCenterQuery.trim(),
default: goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
return '未知' lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
} workDate: timeFormatter(this.workDateQuery),
}, workEndDate: timeFormatter(this.workEndDateQuery),
workStatusFormat: (row, column, cellValue, index) => { userName: store.getters.getUserName
switch (cellValue) { }
case 0: downloadWorkSummaryExcel(request).then(res => {
return '未开始' const link = document.createElement('a');//a
case 1: try {
return '正在做' // let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
case 2: let blob = res.data //blob
return '已完成' // let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //
default: let _fileName = "工作分析报表" + dateFormatter(new Date) + ".xlsx"
return '未知' link.style.display = 'none'//
}
},
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 // URL
const url = window.URL || window.webkitURL || window.moxURL const url = window.URL || window.webkitURL || window.moxURL
link.href = url.createObjectURL(blob) link.href = url.createObjectURL(blob)
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1)) link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.removeChild(link) document.body.removeChild(link)
url.revokeObjectURL(link.href)//url url.revokeObjectURL(link.href)//url
} catch (e) { } catch (e) {
console.log(e) console.log(e)
errorBox('下载文件失败') errorBox('下载文件失败')
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
errorBox('导出失败') errorBox('导出失败')
}) })
},
}, },
},
} }
</script> </script>
<style scoped> <style scoped>
.el-pagination { .el-pagination {
padding-left: 5px; padding-left: 5px;
} }
.el-row .el-button { .el-row .el-button {
width: 72px; width: 72px;
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;
} }
.table-class { .table-class {
width: 100%; width: 100%;
} }
.el-row .el-form-item { .el-row .el-form-item {
width: 10% inherit; width: 10% inherit;
justify-content: center; justify-content: center;
} }
.el-row .el-form-item .el-select-v2 { .el-row .el-form-item .el-select-v2 {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-input-number { .el-row .el-form-item .el-input-number {
width: 100% !important; width: 100% !important;
} }
.el-row .el-form-item .el-button { .el-row .el-form-item .el-button {
margin: auto; margin: auto;
} }
.title-area { .title-area {
display: flex; display: flex;
/* min-height: 10%; */ /* min-height: 10%; */
max-height: max-content; max-height: max-content;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
flex-direction: column; flex-direction: column;
padding: 10px; padding: 10px;
} }
/* 专门为料号文本域添加样式 */ /* 专门为料号文本域添加样式 */
.goods-id-container { .goods-id-container {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
.goods-id-textarea { .goods-id-textarea {
vertical-align: top; vertical-align: top;
} }
.goods-id-textarea :deep(.el-textarea__inner) { .goods-id-textarea :deep(.el-textarea__inner) {
font-size: 12px; font-size: 12px;
line-height: 1.2; line-height: 1.2;
padding: 5px; padding: 5px;
height: 32px !important; height: 32px !important;
min-height: 32px !important; min-height: 32px !important;
resize: none; resize: none;
} }
/* 确保其他输入框保持一致的高度 */ /* 确保其他输入框保持一致的高度 */
.el-input { .el-input {
height: 32px; height: 32px;
} }
.el-input :deep(.el-input__wrapper) { .el-input :deep(.el-input__wrapper) {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
</style> </style>

View File

@ -9,7 +9,6 @@ const routes = [
path: '/home', path: '/home',
name: 'home', name: 'home',
component: HomeView, component: HomeView,
redirect: '/stock',
children: [ children: [
{ path: '/stock', component: stock },// 库存 { path: '/stock', component: stock },// 库存
{ path: '/goodsIn', component: () => import('@/layout/goodsIn.vue') },// 入库 { path: '/goodsIn', component: () => import('@/layout/goodsIn.vue') },// 入库
@ -44,7 +43,8 @@ const routes = [
{ path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录 { path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录
{ path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表 { path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表
{ path: '/rolePermission', component: () => import('@/layout/role_permission.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({ export default createStore({
state: { state: {
stateTagsList: [{ stateTagsList: [],
id: '21',
labelName: '库存',
path: '/stock'
}],
user: {}, user: {},
menuList: [], menuList: [],
token: '', token: '',

View File

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