|
|
|
@ -135,9 +135,10 @@
|
|
|
|
<script setup lang="tsx">
|
|
|
|
<script setup lang="tsx">
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
import type { Ref } from 'vue';
|
|
|
|
import type { Ref } from 'vue';
|
|
|
|
|
|
|
|
import { hiprint } from 'vue-plugin-hiprint';
|
|
|
|
import type { DataTableColumns } from 'naive-ui';
|
|
|
|
import type { DataTableColumns } from 'naive-ui';
|
|
|
|
import { getWorkbenchWiredrawingList } from '@/service/api/md/workbench/wiredrawing';
|
|
|
|
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 { getMaterialList } from '@/service/api/md/itemlist/index';
|
|
|
|
// import { getIngredientsTradersList } from '@/service/api/md/ingredients/traders';
|
|
|
|
// import { getIngredientsTradersList } from '@/service/api/md/ingredients/traders';
|
|
|
|
// import { getIngredientsManufacturerList } from '@/service/api/md/ingredients/manufacturer';
|
|
|
|
// 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 { getOutputLog } from '~/src/service/api/produre/workRecords/index';
|
|
|
|
import { formatDate } from '~/src/utils/form/rule';
|
|
|
|
import { formatDate } from '~/src/utils/form/rule';
|
|
|
|
import { useResetSearch } from '~/src/utils/common/searchReset';
|
|
|
|
import { useResetSearch } from '~/src/utils/common/searchReset';
|
|
|
|
|
|
|
|
import { useSocketStore } from '@/store/modules/socket';
|
|
|
|
const { loading, startLoading, endLoading } = useLoading();
|
|
|
|
const { loading, startLoading, endLoading } = useLoading();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const socketStore = useSocketStore();
|
|
|
|
|
|
|
|
|
|
|
|
const { searchForm, reset } = useResetSearch({
|
|
|
|
const { searchForm, reset } = useResetSearch({
|
|
|
|
taskSn: '', // 生产工单号
|
|
|
|
taskSn: '', // 生产工单号
|
|
|
|
workstationId: null, // 机台
|
|
|
|
workstationId: null, // 机台
|
|
|
|
@ -297,7 +301,7 @@ const columns: Ref<DataTableColumns<workRecords.TabelList>> = ref([
|
|
|
|
width: 100
|
|
|
|
width: 100
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '报工数量',
|
|
|
|
title: '报工数量(副)',
|
|
|
|
align: 'center',
|
|
|
|
align: 'center',
|
|
|
|
key: 'outputWeight',
|
|
|
|
key: 'outputWeight',
|
|
|
|
width: 100
|
|
|
|
width: 100
|
|
|
|
@ -337,6 +341,25 @@ const columns: Ref<DataTableColumns<workRecords.TabelList>> = ref([
|
|
|
|
align: 'center',
|
|
|
|
align: 'center',
|
|
|
|
key: 'batchCode',
|
|
|
|
key: 'batchCode',
|
|
|
|
width: 100
|
|
|
|
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() {
|
|
|
|
function init() {
|
|
|
|
startLoading();
|
|
|
|
startLoading();
|
|
|
|
getOutputLog({ ...searchForm.value }).then(res => {
|
|
|
|
getOutputLog({ ...searchForm.value }).then(res => {
|
|
|
|
|