代码更新:

1. 备料界面增加待配料列表
2. 增加打印确认完标签的功能
3. 修复打印标签点击两次的问题
This commit is contained in:
梁州 2024-12-10 17:02:55 +08:00
parent 80dc563108
commit e2ac7a73c6
3 changed files with 139 additions and 8 deletions

View File

@ -73,6 +73,15 @@ const getWorkByStandAndGoods = (params) => {
}) })
} }
const getWorkGoodsList = (params) => {
return request({
url: '/task/getWorkGoodsList',
method: 'post',
data: params,
timeout: 10000
})
}
const confirmFinishedWork = (params) => { const confirmFinishedWork = (params) => {
return request({ return request({
url: '/task/confirmFinishedWork', url: '/task/confirmFinishedWork',
@ -145,6 +154,14 @@ const requestPrintData = (params) => {
}) })
} }
const requestOldPrintData = (params) => {
return request({
url: '/task/requestOldPrintData',
method: 'post',
data: params
})
}
const requestSortBox = (params) => { const requestSortBox = (params) => {
return request({ return request({
url: '/task/requestSortBox', url: '/task/requestSortBox',
@ -236,5 +253,7 @@ export {
updatePickTasks, updatePickTasks,
clcNoPlan, clcNoPlan,
clcNoPlanConfirmBack, clcNoPlanConfirmBack,
finishSortBox finishSortBox,
getWorkGoodsList,
requestOldPrintData
} }

View File

@ -132,6 +132,17 @@
</div> </div>
</el-form> </el-form>
</fieldset> </fieldset>
<fieldset class="goods-list-area" v-if="pickingGoodsList.length > 0">
<legend>
待拣选物料列表
</legend>
<el-table :data="pickingGoodsList" stripe border max-height="200px"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
<el-table-column prop="vehicleId" label="箱号" min-width="120px" />
<el-table-column prop="goodsId" label="料号" min-width="120px" />
<el-table-column prop="goodsName" label="料名" min-width="120px" show-overflow-tooltip />
</el-table>
</fieldset>
<el-dialog v-model="dialogVisible" title="异常箱料处理" width="40%" draggable :show-close="false"> <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;"> <div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
<el-form ref="exceptionHandleFormRef" :model="exceptionHandleFormEntity" :label-position="labelPosition" <el-form ref="exceptionHandleFormRef" :model="exceptionHandleFormEntity" :label-position="labelPosition"
@ -166,7 +177,7 @@
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task' import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods, getWorkGoodsList } from '@/api/task'
import { handleExceptionStock } from '@/api/stock' import { handleExceptionStock } from '@/api/stock'
import { errorBox, warningBox } from '@/utils/myMessageBox.js' import { errorBox, warningBox } from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
@ -202,13 +213,15 @@ export default {
}), }),
exceptionHandleFormEntity: reactive({}), exceptionHandleFormEntity: reactive({}),
exceptionHandleFormRef: ref(), exceptionHandleFormRef: ref(),
dialogVisible: false dialogVisible: false,
pickingGoodsList: []
} }
}, },
mounted() { mounted() {
this.$refs.goodsId.focus() this.$refs.goodsId.focus()
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.queryFinish() this.queryFinish()
// this.getWorkList()
}, 1500) }, 1500)
}, },
beforeUnmount() { beforeUnmount() {
@ -279,6 +292,23 @@ export default {
console.log(err) console.log(err)
}) })
}, },
getWorkList() {
const request = {
standId: this.standId,
userName: store.getters.getUserName
}
getWorkGoodsList(request).then(res => {
const response = res.data
if (response.code == 0) {
this.pickingGoodsList = response.returnData
} else {
this.pickingGoodsList = []
}
}).catch(err => {
console.log(err)
this.pickingGoodsList = []
})
},
// //
resetForms() { resetForms() {
this.workFormEntity.goodsId = '' this.workFormEntity.goodsId = ''
@ -521,4 +551,16 @@ export default {
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
} }
.goods-list-area {
margin: auto;
min-height: fit-content;
max-height: 90%;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
}
</style> </style>

View File

@ -13,7 +13,15 @@
<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> <el-popover placement="top-start" title="提示" :width="250" trigger="hover"
content="点击此处打印上次确认过的标签" popper-style="background-color: #F0FFFF;">
<template #reference>
<span class="station-no-text" @click="requestPrintOld()">
<Printer style="display: none;" />
{{ standId }}
</span>
</template>
</el-popover>
</div> </div>
</fieldset> </fieldset>
<fieldset class="main-area"> <fieldset class="main-area">
@ -95,7 +103,7 @@
</div> </div>
</div> </div>
<div style="margin: 10px;"> <div style="margin: 10px;">
<div class="arrow" @click="requestPrint()" v-print="'#printArea'"> <div class="arrow" @click="requestPrint()">
<Printer style="display: none;" /> <Printer style="display: none;" />
<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>
@ -111,6 +119,7 @@
</el-form> </el-form>
</fieldset> </fieldset>
<div style="width: 0;height: 0;overflow: hidden"> <div style="width: 0;height: 0;overflow: hidden">
<button ref="printBtn" style="display: none;" v-print="printObj"></button>
<!-- <div> --> <!-- <div> -->
<div id="printArea" class="objectDialogFlowPrint"> <div id="printArea" class="objectDialogFlowPrint">
<!-- <div class="myPrint"> --> <!-- <div class="myPrint"> -->
@ -139,10 +148,11 @@
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { getFinishedWorkInfo, confirmFinishedWork, requestPrintData } from '@/api/task' import { getFinishedWorkInfo, confirmFinishedWork, requestPrintData, requestOldPrintData } from '@/api/task'
import { ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { errorBox } from '@/utils/myMessageBox.js' import { errorBox } from '@/utils/myMessageBox.js'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import loading from '@/utils/loading.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
@ -150,6 +160,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
export default { export default {
name: 'finishKitting', name: 'finishKitting',
data() { data() {
let self = this
return { return {
standId: store.getters.getStandId, standId: store.getters.getStandId,
// timer: '', // timer: '',
@ -168,7 +179,34 @@ export default {
{ required: true, message: '请输入料号' } { required: true, message: '请输入料号' }
] ]
}), }),
printTabs: [] printTabs: [],
printObj: {
id: "printArea", // ID
popTitle: "&nbsp", //
extraCss: "", // css
extraHead: "", //
preview: false, // false
previewTitle: '打印客户账单', //
previewPrintBtnLabel: '预览结束,开始打印', //
zIndex: 10002, // z-index20002
previewBeforeOpenCallback() {
// console.log('');
}, // callback
previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // callback
beforeOpenCallback() {
// console.log('')
}, // callback
openCallback() {
// console.log('')
}, // callback
closeCallback() {
// console.log('')
}, // callback(or)
clickMounted() {
// console.log('v-print')
},
},
} }
}, },
mounted() { mounted() {
@ -238,21 +276,50 @@ export default {
}) })
}, },
requestPrint() { requestPrint() {
loading.open('请求数据中,请稍等...')
// //
const printParams = { const printParams = {
standId: this.standId, standId: this.standId,
userName: store.getters.getUserName userName: store.getters.getUserName
} }
requestPrintData(printParams).then(res => { requestPrintData(printParams).then(res => {
loading.close()
if (res.data.code == 0) { if (res.data.code == 0) {
this.printTabs = res.data.returnData this.printTabs = res.data.returnData
this.$nextTick(() => {
this.$refs.printBtn.click()
});
} else { } else {
errorBox(res.data.message) errorBox(res.data.message)
} }
}).catch(err => { }).catch(err => {
loading.close()
console.log(err) console.log(err)
errorBox('获取标签数据时异常') errorBox('获取标签数据时异常')
}) })
},
requestPrintOld() {
loading.open('请求数据中,请稍等...')
//
const printParams = {
standId: this.standId,
userName: store.getters.getUserName
}
requestOldPrintData(printParams).then(res => {
loading.close()
if (res.data.code == 0) {
this.printTabs = res.data.returnData
this.$nextTick(() => {
this.$refs.printBtn.click()
});
} else {
errorBox(res.data.message)
}
}).catch(err => {
loading.close()
console.log(err)
errorBox('获取标签数据(确认过)时异常')
})
} }
} }
} }
@ -362,6 +429,9 @@ export default {
align-self: center; align-self: center;
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 25px;
cursor: pointer;
background-color: white;
border: white;
} }
.display-title-div { .display-title-div {