Compare commits
2 Commits
56686dc243
...
d31791c8ee
Author | SHA1 | Date | |
---|---|---|---|
d31791c8ee | |||
4b94c31f91 |
@ -120,4 +120,15 @@ export function checkMaterialPack(data: any) {
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印标签
|
||||
* */
|
||||
export function printStorage(data: any) {
|
||||
return request({
|
||||
url: '/api/api/label/storagePrint',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
@ -71,7 +71,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-table border :height="tableHeight" v-loading="materialTableConfig.loading" :data="state.wareHouseList" highlight-current-row
|
||||
row-key="id" style="width: 100%">
|
||||
row-key="id" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<template v-for="(col, index) in materialTableConfig.column" :key="index">
|
||||
<el-table-column v-if="!col.hide" :label="col.header" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
@ -93,6 +94,25 @@
|
||||
<pagination v-if="total > 0" :total="total" v-model:pageNumTo="queryParams.pageNum"
|
||||
v-model:pageSizeTo="queryParams.pageSize" @pagination="handleQuery" />
|
||||
</div>
|
||||
<!-- 打印机 -->
|
||||
<div class="vue-element-page-table">
|
||||
<el-row class="page-search" justify="space-between" align="middle">
|
||||
<el-form ref="operateFormRef" :model="operateParams" :inline="true">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="选择打印机" v-model="state.PRINTNAME">
|
||||
<el-select v-model="state.PRINTNAME" placeholder="请选择打印机" style="width: 240px">
|
||||
<el-option v-for="item in state.PRINTLIST" :key="item.VALUE" :label="item.LABEL" :value="item.VALUE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<el-button type="primary" @click="print" :disabled="state.button_print" v-loading="state.loadings">打印</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 新增或编辑 -->
|
||||
<el-drawer :title="dialog.title" v-model="dialog.visible" @close="cancel" @opened="dialogOpend">
|
||||
@ -119,12 +139,14 @@ export default {
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted, toRefs, getCurrentInstance, nextTick } from "vue";
|
||||
import { ElForm, ElMessageBox, ElTable } from "element-plus";
|
||||
import { getQueryPageList, BpelEvent } from '@/api/common';
|
||||
import { getQueryPageList, BpelEvent, getQueryList } from '@/api/common'
|
||||
import { bTableHeight } from "../../../../composables/calcTableHeight";
|
||||
import { getORG } from '@/api/auth'
|
||||
import { createStorage, delStorage, editStorage } from '@/api/basics/storage/index'
|
||||
import { localStorage as ls } from "@/utils/storage";
|
||||
import { printStorage } from '@/api/label'
|
||||
|
||||
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(180);
|
||||
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(300);
|
||||
const queryFormRef = ref(ElForm);
|
||||
const formDataRef = ref(ElForm);
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
@ -211,14 +233,27 @@ const state = reactive({
|
||||
STORAGENAME: '',//库位名称
|
||||
}
|
||||
},
|
||||
// 打印机 start
|
||||
operateParams: {
|
||||
date: new Date()
|
||||
},
|
||||
PRINTNAME: '',
|
||||
PRINTLIST: [] as any,//打印机
|
||||
button_print:false,
|
||||
// 打印机 end
|
||||
wareHouseList: [] as any,
|
||||
total: 0,
|
||||
selectItem: undefined as any
|
||||
selectItem: undefined as any,
|
||||
multipleSelection: [] as any
|
||||
})
|
||||
|
||||
const {
|
||||
ERPFactoryList,
|
||||
rsa,
|
||||
// 打印机 start
|
||||
operateParams,
|
||||
button_print,
|
||||
// 打印机 end
|
||||
queryParams,
|
||||
total,
|
||||
dialog,
|
||||
@ -244,6 +279,8 @@ onMounted(() => {
|
||||
handleQuery();
|
||||
updateTableHeight();
|
||||
ERPFactoryQuery();
|
||||
// 打印机
|
||||
getPRINTLIST();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
const queryInfo = () => {
|
||||
@ -382,7 +419,7 @@ function submitForm() {
|
||||
SITENAME: 'SDK'
|
||||
};
|
||||
editStorage(params).then((res: any) => {
|
||||
if (res.code === "0") {
|
||||
if (res.code === "200") {
|
||||
proxy.$ElMessage.success("修改成功");
|
||||
cancel();
|
||||
handleQuery();
|
||||
@ -392,7 +429,7 @@ function submitForm() {
|
||||
})
|
||||
} else {
|
||||
createStorage(state.formData).then((res: any) => {
|
||||
if (res.code === "0") {
|
||||
if (res.code === "200") {
|
||||
proxy.$ElMessage.success("新增成功");
|
||||
cancel();
|
||||
handleQuery();
|
||||
@ -413,7 +450,7 @@ function handleDelete(row: any) {
|
||||
SITENAME: 'SDK',
|
||||
};
|
||||
delStorage(params).then((res: any) => {
|
||||
if (res.code === "0") {
|
||||
if (res.code === "200") {
|
||||
proxy.$ElMessage.success("删除成功");
|
||||
handleQuery();
|
||||
} else {
|
||||
@ -421,5 +458,56 @@ function handleDelete(row: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印机
|
||||
*/
|
||||
function print() {
|
||||
if (state.PRINTNAME == null || state.PRINTNAME == "") {
|
||||
ElMessageBox.alert('请选择打印机', {
|
||||
confirmButtonText: 'OK',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessageBox.alert('打印清单为空', {
|
||||
confirmButtonText: 'OK',
|
||||
})
|
||||
return
|
||||
}
|
||||
let PRINT = {
|
||||
LIST: state.multipleSelection,
|
||||
PRINTNAME: state.PRINTNAME,
|
||||
USER: ls.get('userId')
|
||||
}
|
||||
state.button_print = true;
|
||||
state.loadings = true;
|
||||
printStorage(PRINT).then((res: any) => {
|
||||
console.log('PRINT',res)
|
||||
}).catch(() => {
|
||||
state.button_print = false;
|
||||
state.loadings = false;
|
||||
});
|
||||
state.button_print = false;
|
||||
state.loadings = false;
|
||||
ElMessageBox.alert('标签打印成功', {
|
||||
confirmButtonText: 'OK',
|
||||
})
|
||||
}
|
||||
|
||||
function getPRINTLIST() {
|
||||
getQueryList({
|
||||
queryId: "getPRINTLIST",
|
||||
version: "00001",
|
||||
params: {
|
||||
},
|
||||
}).then((res: any) => {
|
||||
state.PRINTLIST = res.data
|
||||
})
|
||||
}
|
||||
|
||||
const handleSelectionChange = (val: any) => {
|
||||
state.multipleSelection = val;
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user