代码更新:
1. 打印标签
This commit is contained in:
parent
83f96d3298
commit
f5880d2252
|
|
@ -128,6 +128,22 @@ const requestBackTest = (params) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const requestInTest = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/task/requestInTest',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestPrintData = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/task/requestPrintData',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
sendGoodsInTask,
|
sendGoodsInTask,
|
||||||
sendGoodsOutTask,
|
sendGoodsOutTask,
|
||||||
|
|
@ -144,5 +160,7 @@ export {
|
||||||
callEmptyVehicle,
|
callEmptyVehicle,
|
||||||
queryFinishByStandAndGoods,
|
queryFinishByStandAndGoods,
|
||||||
requestPickTest,
|
requestPickTest,
|
||||||
requestBackTest
|
requestBackTest,
|
||||||
|
requestInTest,
|
||||||
|
requestPrintData
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin: 10px;">
|
<div style="margin: 10px;">
|
||||||
<div class="arrow" @click="confirmWork()">
|
<div class="arrow" v-print="'#printArea'">
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -109,6 +110,27 @@
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<div style="width: 0;height: 0;overflow: hidden">
|
||||||
|
<div id="printArea" class="objectDialogFlowPrint">
|
||||||
|
<div class="myPrint">
|
||||||
|
<div class="pageWarp" v-for="item in printTabs">
|
||||||
|
<div class="print-tab-left">
|
||||||
|
<div class="print-disp">
|
||||||
|
序号:{{ item.sequenceNo }}</div>
|
||||||
|
<div class="print-disp"> 小工位:{{ item.smallWorkCenter }}</div>
|
||||||
|
<div class="print-disp"> 料号数量:{{ item.goodsCount }}</div>
|
||||||
|
<div class="print-disp"> 配料人员:{{ item.opUser }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="print-tab-right">
|
||||||
|
<div class="print-disp"> 机器序列号:{{ item.machineNo }}</div>
|
||||||
|
<div class="print-disp"> 工单:{{ item.workOrder }}</div>
|
||||||
|
<div class="print-disp"> 零件数量:{{ item.goodsNumCount }}</div>
|
||||||
|
<div class="print-disp"> 配料日期:{{ item.opTime }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
|
|
@ -116,7 +138,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getFinishedWorkInfo, confirmFinishedWork } from '@/api/task'
|
import { getFinishedWorkInfo, confirmFinishedWork, requestPrintData } from '@/api/task'
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
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'
|
||||||
|
|
@ -144,6 +166,18 @@ export default {
|
||||||
{ required: true, message: '请输入料号' }
|
{ required: true, message: '请输入料号' }
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
printTabs: [
|
||||||
|
{
|
||||||
|
sequenceNo: 1,
|
||||||
|
machineNo: 'WF800471',
|
||||||
|
smallWorkCenter: 'abd1111',
|
||||||
|
workOrder: '115000262768',
|
||||||
|
goodsCount: 30,
|
||||||
|
goodsNumCount: 132,
|
||||||
|
opUser: 'test',
|
||||||
|
opTime: '2024/8/11'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -215,6 +249,23 @@ export default {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('确认时发生异常')
|
ElMessage.error('确认时发生异常')
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
printTabs() {
|
||||||
|
// 获取打印标签的数据
|
||||||
|
const printParams = {
|
||||||
|
standId: this.standId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
requestPrintData(printParams).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.printTabs = res.data.returnData
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('获取标签数据时异常')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -375,4 +426,49 @@ export default {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @media print {
|
||||||
|
@page {
|
||||||
|
size: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
body,
|
||||||
|
html {
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
.objectDialogFlowPrint .pageWarp {
|
||||||
|
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
||||||
|
page-break-after: always;
|
||||||
|
height: 100%;
|
||||||
|
width: 98%;
|
||||||
|
text-align: center;
|
||||||
|
margin: 5px auto;
|
||||||
|
padding: auto;
|
||||||
|
border: #000 solid 1px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectDialogFlowPrint .myPrint {
|
||||||
|
/* 打印的时候是否显示底色 */
|
||||||
|
print-color-adjust: exact;
|
||||||
|
}
|
||||||
|
|
||||||
|
.print-tab-left {
|
||||||
|
margin: 5px;
|
||||||
|
width: 45%;
|
||||||
|
border-right: #156082 dashed 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.print-tab-right {
|
||||||
|
margin: 5px;
|
||||||
|
width: 55%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.print-disp {
|
||||||
|
margin: 5px;
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: 25px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -99,6 +99,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { sendGoodsInTask } from '@/api/task'
|
import { sendGoodsInTask } from '@/api/task'
|
||||||
|
import { replaceEnglishAndNumberIGAI } from '@/utils/formatter'
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
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'
|
||||||
|
|
@ -149,8 +150,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addTempTask() {
|
addTempTask() {
|
||||||
this.workFormEntity.vehicleId = this.workFormEntity.vehicleId.replace('€', '')
|
this.workFormEntity.vehicleId = replaceEnglishAndNumberIGAI(this.workFormEntity.vehicleId)
|
||||||
this.workFormEntity.goodsId = this.workFormEntity.goodsId.replace('€', '')
|
|
||||||
if (this.workFormEntity.vehicleId != '' && this.workFormEntity.goodsId != '' && this.workFormEntity.goodsNum != null && this.workFormEntity.goodsNum > 0) {
|
if (this.workFormEntity.vehicleId != '' && this.workFormEntity.goodsId != '' && this.workFormEntity.goodsNum != null && this.workFormEntity.goodsNum > 0) {
|
||||||
if (this.currentVehicleId != '' && this.currentVehicleId != this.workFormEntity.vehicleId) {
|
if (this.currentVehicleId != '' && this.currentVehicleId != this.workFormEntity.vehicleId) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
工作台
|
工作台
|
||||||
</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>
|
||||||
|
|
@ -65,18 +65,24 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin: 10px; margin-left: 20px;">
|
<div style="margin: 10px; margin-left: 20px;" v-if="standId != 'ASRS-#0'">
|
||||||
<div class="arrow" @click="requestPick()">
|
<div class="arrow" @click="requestPick()">
|
||||||
<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 style="margin: 10px;">
|
<div style="margin: 10px;">
|
||||||
<div class="arrow" @click="requestBack()">
|
<div class="arrow" @click="requestBack()" v-if="standId != 'ASRS-#0'">
|
||||||
<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 style="margin: 10px;">
|
||||||
|
<div class="arrow" @click="requestIn()" v-if="standId == 'ASRS-#0'">
|
||||||
|
<span
|
||||||
|
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">请求入库</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
@ -87,7 +93,8 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { requestPickTest, requestBackTest } from '@/api/task'
|
import { requestPickTest, requestBackTest, requestInTest } from '@/api/task'
|
||||||
|
import { replaceEnglishAndNumberIGAI } from '@/utils/formatter'
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
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'
|
||||||
|
|
@ -130,6 +137,7 @@ export default {
|
||||||
this.$refs.vehicleId.focus()
|
this.$refs.vehicleId.focus()
|
||||||
},
|
},
|
||||||
focusChange() {
|
focusChange() {
|
||||||
|
this.workFormEntity.vehicleId = replaceEnglishAndNumberIGAI(this.workFormEntity.vehicleId)
|
||||||
if (this.workFormEntity.vehicleId == '') {
|
if (this.workFormEntity.vehicleId == '') {
|
||||||
this.$refs.vehicleId.focus()
|
this.$refs.vehicleId.focus()
|
||||||
} else if (this.workFormEntity.goodsId == '') {
|
} else if (this.workFormEntity.goodsId == '') {
|
||||||
|
|
@ -144,8 +152,8 @@ export default {
|
||||||
userName: store.getters.getUserName,
|
userName: store.getters.getUserName,
|
||||||
pickStand: this.standId,
|
pickStand: this.standId,
|
||||||
goodsId: this.workFormEntity.goodsId,
|
goodsId: this.workFormEntity.goodsId,
|
||||||
vehicleId: this.workFormEntity.remainNumOrigin,
|
vehicleId: this.workFormEntity.vehicleId,
|
||||||
goodsNum: this.workFormEntity.remainNumReal
|
goodsNum: this.workFormEntity.goodsNum
|
||||||
}
|
}
|
||||||
requestPickTest(confirmParams).then(res => {
|
requestPickTest(confirmParams).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
|
|
@ -166,8 +174,8 @@ export default {
|
||||||
userName: store.getters.getUserName,
|
userName: store.getters.getUserName,
|
||||||
pickStand: this.standId,
|
pickStand: this.standId,
|
||||||
goodsId: this.workFormEntity.goodsId,
|
goodsId: this.workFormEntity.goodsId,
|
||||||
vehicleId: this.workFormEntity.remainNumOrigin,
|
vehicleId: this.workFormEntity.vehicleId,
|
||||||
goodsNum: this.workFormEntity.remainNumReal
|
goodsNum: this.workFormEntity.goodsNum
|
||||||
}
|
}
|
||||||
requestBackTest(confirmParams).then(res => {
|
requestBackTest(confirmParams).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
|
|
@ -181,6 +189,28 @@ export default {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('确认时发生异常')
|
ElMessage.error('确认时发生异常')
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 请求入库
|
||||||
|
requestIn() {
|
||||||
|
const confirmParams = {
|
||||||
|
userName: store.getters.getUserName,
|
||||||
|
pickStand: this.standId,
|
||||||
|
goodsId: this.workFormEntity.goodsId,
|
||||||
|
vehicleId: this.workFormEntity.vehicleId,
|
||||||
|
goodsNum: this.workFormEntity.goodsNum
|
||||||
|
}
|
||||||
|
requestInTest(confirmParams).then(res => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code == 0) {
|
||||||
|
this.resetForms()
|
||||||
|
ElMessage.success(response.message)
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('确认时发生异常')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -265,13 +295,14 @@ export default {
|
||||||
width: -webkit-fill-available;
|
width: -webkit-fill-available;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
background-color: #CCCCCC;
|
height: 150px;
|
||||||
|
background-color: #87CEFA;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-text {
|
.title-text {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 25px;
|
font-size: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.station-div {
|
.station-div {
|
||||||
|
|
|
||||||
|
|
@ -147,40 +147,7 @@ export default {
|
||||||
stockId: '',
|
stockId: '',
|
||||||
stockFormRef: ref(),
|
stockFormRef: ref(),
|
||||||
stockFormEntity: reactive({}),
|
stockFormEntity: reactive({}),
|
||||||
rules: reactive({
|
rules: reactive({}),
|
||||||
goodsType: [
|
|
||||||
{ required: true, message: '请输入型号' }
|
|
||||||
],
|
|
||||||
specification: [
|
|
||||||
{ required: true, message: '请输入规格' }
|
|
||||||
],
|
|
||||||
barcode: [
|
|
||||||
{ required: true, message: '请输入条码号' }
|
|
||||||
],
|
|
||||||
batchNo: [
|
|
||||||
{ required: true, message: '请输入批次号' }
|
|
||||||
],
|
|
||||||
locationId: [
|
|
||||||
{ required: true, message: '请输入库位' }
|
|
||||||
],
|
|
||||||
orderId: [
|
|
||||||
{ required: true, message: '请输入订单号' }
|
|
||||||
],
|
|
||||||
stockStatus: [
|
|
||||||
{ required: true, message: '请输入库存状态' }
|
|
||||||
],
|
|
||||||
goodsStatus: [
|
|
||||||
{ required: true, message: '请输入物料状态' }
|
|
||||||
],
|
|
||||||
originNum: [
|
|
||||||
{ required: true, message: '请输入入库数量' },
|
|
||||||
{ type: 'number', message: '请输入数字' }
|
|
||||||
],
|
|
||||||
realNum: [
|
|
||||||
{ required: true, message: '请输入实际数量' },
|
|
||||||
{ type: 'number', message: '请输入数字' }
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
labelPosition: 'top',
|
labelPosition: 'top',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
goodsStatusOptions: [
|
goodsStatusOptions: [
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,12 @@ import ElementPlus from 'element-plus'
|
||||||
import 'element-plus/dist/index.css'
|
import 'element-plus/dist/index.css'
|
||||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||||
import print from 'vue3-print-nb'
|
import print from 'vue3-print-nb'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
app.use(store)
|
app.use(store)
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.use(ElementPlus)
|
app.use(ElementPlus, {locale: zhCn})
|
||||||
app.use(print)
|
app.use(print)
|
||||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||||
app.component(key, component)
|
app.component(key, component)
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,10 @@ function jsonFormatter(value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function replaceEnglishAndNumberIGAI(value) {
|
||||||
|
return value.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '')
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
timeFormatter,
|
timeFormatter,
|
||||||
dateFormatter,
|
dateFormatter,
|
||||||
|
|
@ -186,5 +190,6 @@ export {
|
||||||
dueFormatter,
|
dueFormatter,
|
||||||
locationStatusFormatter,
|
locationStatusFormatter,
|
||||||
sizeFormatter,
|
sizeFormatter,
|
||||||
jsonFormatter
|
jsonFormatter,
|
||||||
|
replaceEnglishAndNumberIGAI
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user