master
吴普建 12 months ago
parent 003897fbc2
commit 1a9689c228

@ -4,6 +4,9 @@ import { request } from '~/src/service/request';
export const getWorkbenchEnamellingList = (params: any) => {
return request.get('/md/mes/md/mdWorkbenchEnamelling/list', { params });
};
export const getMdPrintData = (params: any) => {
return request.get('/mes/md/mdPrintData', { params });
};
export const selectAllWorkbenchEnamellingList = (params: any) => {
return request.get('/md/mes/md/mdWorkbenchEnamelling/selectAll', { params });
};

@ -135,9 +135,10 @@
<script setup lang="tsx">
import { ref, onMounted } from 'vue';
import type { Ref } from 'vue';
import { hiprint } from 'vue-plugin-hiprint';
import type { DataTableColumns } from 'naive-ui';
import { getWorkbenchWiredrawingList } from '@/service/api/md/workbench/wiredrawing';
import { getWorkbenchEnamellingList } from '@/service/api/md/workbench/enamelling';
import { getWorkbenchEnamellingList, getMdPrintData } from '@/service/api/md/workbench/enamelling';
// import { getMaterialList } from '@/service/api/md/itemlist/index';
// import { getIngredientsTradersList } from '@/service/api/md/ingredients/traders';
// import { getIngredientsManufacturerList } from '@/service/api/md/ingredients/manufacturer';
@ -147,8 +148,11 @@ import { useLoading } from '~/src/hooks';
import { getOutputLog } from '~/src/service/api/produre/workRecords/index';
import { formatDate } from '~/src/utils/form/rule';
import { useResetSearch } from '~/src/utils/common/searchReset';
import { useSocketStore } from '@/store/modules/socket';
const { loading, startLoading, endLoading } = useLoading();
const socketStore = useSocketStore();
const { searchForm, reset } = useResetSearch({
taskSn: '', //
workstationId: null, //
@ -297,7 +301,7 @@ const columns: Ref<DataTableColumns<workRecords.TabelList>> = ref([
width: 100
},
{
title: '报工数量',
title: '报工数量(副)',
align: 'center',
key: 'outputWeight',
width: 100
@ -337,6 +341,25 @@ const columns: Ref<DataTableColumns<workRecords.TabelList>> = ref([
align: 'center',
key: 'batchCode',
width: 100
},
{
title: '操作',
key: 'action',
fixed: 'right',
width: 100,
render(row) {
return (
<n-button
type="primary"
size="tiny"
onClick={() => {
printTemp(row);
}}
>
补打标签
</n-button>
);
}
}
]);
@ -456,6 +479,42 @@ function selectTaskType(value: number) {
// });
// }
function printTemp(row: any) {
let printData = row.printObj;
if (window.hiwebSocket?.opened) {
if (!printData) {
window.$message?.error('补打数据为空,不可打印!');
return;
}
const hiprintTemplate = new hiprint.PrintTemplate({ template: JSON.parse(printData?.templateJson) });
hiprintTemplate.print2(JSON.parse(printData?.templateData));
} else {
window.$message?.error('客户端未连接,无法直接打印');
}
// getMdPrintData({bizId: id}).then(res => {
// console.log(res)
// })
// socketStore.setMsg(
// JSON.stringify({
// templateType: 'paintStorage',
// printValue: [rawMaterial1Row.value],
// reprintData: reprintDatas
// })
// );
// window.$message?.success('');
// if (window.hiwebSocket.opened) {
// if (!printData) {
// window.$message?.error('');
// return;
// }
// const hiprintTemplate = new hiprint.PrintTemplate({ template: JSON.parse(printData?.templateJson) });
// hiprintTemplate.print2(JSON.parse(printData?.templateData));
// } else {
// window.$message?.error(',');
// }
}
function init() {
startLoading();
getOutputLog({ ...searchForm.value }).then(res => {

Loading…
Cancel
Save