|
@@ -11,7 +11,7 @@
|
|
|
>
|
|
|
<section
|
|
|
ref="print"
|
|
|
- style="padding: 10px 10px 0; position: relative; border: 1px solid #c5c5c5; background: #fff; width: 100%; height: 100%"
|
|
|
+ style="padding: 10px; position: relative; border: 1px solid #c5c5c5; background: #fff; width: 100%; min-height: 100%"
|
|
|
id="printBilletSampleCard"
|
|
|
:key="printKey"
|
|
|
>
|
|
@@ -246,7 +246,7 @@
|
|
|
import dayjs from 'dayjs';
|
|
|
import { printJS } from '/@/hooks/web/usePrintJS';
|
|
|
import type { TableColumnsType } from 'ant-design-vue';
|
|
|
- import { queryBilletRecordByCcmNo, editBilletRecord, addBilletNo, editOriginalProductRecord } from '../operator.api';
|
|
|
+ import { queryBilletRecordByCcmNo, editBilletRecord, addBilletNo, editOriginalProductRecord, deleteBilletRecord } from '../operator.api';
|
|
|
import { render } from '/@/utils/common/renderUtils';
|
|
|
import { isArray, isNumber } from '/@/utils/is';
|
|
|
import Icon from '/@/components/Icon';
|
|
@@ -258,11 +258,12 @@
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import { getMachineConfig, MachineConfigType } from '../../hotDelivery/common.data';
|
|
|
import { steelPlateFormula } from '../operator.data';
|
|
|
+ import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
|
|
|
|
|
|
// 注册打印送样卡modal
|
|
|
const [registerPrintModal, { openModal }] = useModal();
|
|
|
|
|
|
- const { createMessage } = useMessage();
|
|
|
+ const { createMessage, createConfirm } = useMessage();
|
|
|
const printKey = ref(dayjs().unix());
|
|
|
const isEditAbled = ref(false); // 是否可编辑
|
|
|
// 渲染字典标签
|
|
@@ -278,22 +279,146 @@
|
|
|
dataIndex: 'SerialNumber',
|
|
|
align: 'center',
|
|
|
key: 'SerialNumber',
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ if (!record.heatNo) return text;
|
|
|
+ const { orgData } = record;
|
|
|
+ return h(
|
|
|
+ 'div',
|
|
|
+ {
|
|
|
+ style: { position: 'relative' },
|
|
|
+ },
|
|
|
+ [
|
|
|
+ h('span', {}, text),
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ {
|
|
|
+ class: 'noprint delete-heat',
|
|
|
+ onClick: () => {
|
|
|
+ console.log('record', orgData);
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: '删除确认',
|
|
|
+ content: `确定删除【${record.heatNo}】吗?删除后无法恢复!`,
|
|
|
+ onOk: () => {
|
|
|
+ return deleteBilletRecord({
|
|
|
+ id: orgData.id,
|
|
|
+ }).then(() => {
|
|
|
+ getHeatList({
|
|
|
+ ccmNo: hostNumber.value,
|
|
|
+ queryType: fetchQueryType.value,
|
|
|
+ changeShiftId: fetchChangeShiftId.value,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ h(Icon, { icon: 'ant-design:delete-filled', size: '20' }, '')
|
|
|
+ ),
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '炉号',
|
|
|
dataIndex: 'heatNo',
|
|
|
- // width: 80,
|
|
|
+ width: 100,
|
|
|
align: 'center',
|
|
|
key: 'heatNo',
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ if (!record.heatNo) return '';
|
|
|
+ const { orgData } = record;
|
|
|
+ return h(Input, {
|
|
|
+ key: orgData.heatNo + record.keyDate,
|
|
|
+ size: 'small',
|
|
|
+ bordered: false,
|
|
|
+ value: text,
|
|
|
+ onBlur: throttle(
|
|
|
+ (e) => {
|
|
|
+ const v = e.target.value.trim();
|
|
|
+ if (!v || orgData.heatNo === v) return;
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: '交班确认',
|
|
|
+ content: `确定修改【${record.heatNo}】吗?`,
|
|
|
+ onOk: () => {
|
|
|
+ return editBilletRecord({
|
|
|
+ ...orgData,
|
|
|
+ heatNo: v,
|
|
|
+ }).then(() => {
|
|
|
+ getHeatList({
|
|
|
+ ccmNo: hostNumber.value,
|
|
|
+ queryType: fetchQueryType.value,
|
|
|
+ changeShiftId: fetchChangeShiftId.value,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ getHeatList({
|
|
|
+ ccmNo: hostNumber.value,
|
|
|
+ queryType: fetchQueryType.value,
|
|
|
+ changeShiftId: fetchChangeShiftId.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 500,
|
|
|
+ {
|
|
|
+ leading: true,
|
|
|
+ trailing: false,
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '钢种',
|
|
|
- // width: 80,
|
|
|
+ width: 100,
|
|
|
align: 'center',
|
|
|
dataIndex: 'brandNum',
|
|
|
key: 'brandNum',
|
|
|
- customRender: ({ text }) => {
|
|
|
- return render.renderDict(text, 'billet_spec');
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ if (!record.heatNo) return '';
|
|
|
+ const { orgData } = record;
|
|
|
+ return h(
|
|
|
+ JSearchSelect,
|
|
|
+ {
|
|
|
+ key: orgData.heatNo + record.keyDate,
|
|
|
+ type: 'list',
|
|
|
+ bordered: false,
|
|
|
+ size: 'small',
|
|
|
+ value: text,
|
|
|
+ dict: 'billet_spec',
|
|
|
+ onChange: (v) => {
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: '交班确认',
|
|
|
+ content: `确定修改【${record.heatNo}】的牌号吗?`,
|
|
|
+ onOk: () => {
|
|
|
+ return editBilletRecord({
|
|
|
+ ...orgData,
|
|
|
+ grade: v,
|
|
|
+ }).then(() => {
|
|
|
+ getHeatList({
|
|
|
+ ccmNo: hostNumber.value,
|
|
|
+ queryType: fetchQueryType.value,
|
|
|
+ changeShiftId: fetchChangeShiftId.value,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ getHeatList({
|
|
|
+ ccmNo: hostNumber.value,
|
|
|
+ queryType: fetchQueryType.value,
|
|
|
+ changeShiftId: fetchChangeShiftId.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ placeholder: '请选择',
|
|
|
+ },
|
|
|
+ ''
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
// {
|
|
@@ -740,6 +865,8 @@
|
|
|
roll_out_shipp: [],
|
|
|
};
|
|
|
|
|
|
+ const allSizeArr: any[] = [];
|
|
|
+
|
|
|
const totalRows = getTotalRows();
|
|
|
dataSource.value = totalRows.map((item, index) => {
|
|
|
if (!newArr[index]) return item;
|
|
@@ -760,6 +887,7 @@
|
|
|
// 热送棒一的定尺
|
|
|
Object.keys(lengthGroupCount).forEach((key) => {
|
|
|
const column = key;
|
|
|
+ allSizeArr.push(Number(column) / 1000);
|
|
|
const columnKey = column + 'rollOneColumn';
|
|
|
const findIndex = rollOneColumns.findIndex((item: any) => item.dataIndex === columnKey);
|
|
|
if (findIndex === -1) {
|
|
@@ -799,6 +927,7 @@
|
|
|
},
|
|
|
dataIndex: columnKey,
|
|
|
key: columnKey,
|
|
|
+ sortKey: column,
|
|
|
align: 'center',
|
|
|
width: 100,
|
|
|
customRender({ text, record }) {
|
|
@@ -838,6 +967,7 @@
|
|
|
const hotChargeArr = JSON.parse(hotChargeLength);
|
|
|
hotChargeArr.forEach((k) => {
|
|
|
const sizeFormat = Number(k.hotChargeLength) / 1000;
|
|
|
+ allSizeArr.push(sizeFormat);
|
|
|
const dataKey = sizeFormat + k.hotChargeDestination + k.hotChargeBtype;
|
|
|
sizeArr[dataKey] = k.totalCount;
|
|
|
// 热送统计
|
|
@@ -941,6 +1071,7 @@
|
|
|
stackLeghtObj.forEach((v) => {
|
|
|
// 初始化堆垛的定尺key
|
|
|
const sSize = String(v.stackingLength);
|
|
|
+ allSizeArr.push(Number(sSize) / 1000);
|
|
|
const stackKey = sSize + 'stackLength' + v.stackingBhtcId;
|
|
|
// 查找某一个堆垛 dataIndex='stackLength' + stackingBhtcId
|
|
|
const index = stackLengthColumn.findIndex((ele) => ele.dataIndex == 'stackLength' + v.stackingBhtcId);
|
|
@@ -984,6 +1115,7 @@
|
|
|
dataIndex: stackKey,
|
|
|
key: stackKey,
|
|
|
width: 100,
|
|
|
+ sortKey: sSize,
|
|
|
customRender({ text, record }) {
|
|
|
if (!record.heatNo) {
|
|
|
return '';
|
|
@@ -1019,9 +1151,13 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ const curTime = new Date().getTime();
|
|
|
+
|
|
|
return {
|
|
|
...item,
|
|
|
+ id: newArr[index].id || curTime,
|
|
|
heatNo: newArr[index].heatNo,
|
|
|
+ keyDate: curTime,
|
|
|
brandNum: newArr[index].grade,
|
|
|
oneFlow: newArr[index].oneStrandSum || '',
|
|
|
twoFlow: newArr[index].twoStrandSum || '',
|
|
@@ -1064,54 +1200,58 @@
|
|
|
}
|
|
|
);
|
|
|
});
|
|
|
- const childSizesColumn = hotChargeSizeArr.map((childItem) => {
|
|
|
- return {
|
|
|
- title: childItem,
|
|
|
- dataIndex: `${item}.${childItem}`,
|
|
|
- key: `${item}.${childItem}`,
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- customRender: ({ record }) => {
|
|
|
- const hotKey = childItem + item + '0';
|
|
|
- const coldKey = childItem + item + '1';
|
|
|
- let sizeArr: any = [];
|
|
|
- if (record[hotKey] || record[coldKey]) {
|
|
|
- sizeArr = [h('div', { class: 'line' }, ''), h('div', { class: 'size-st-item' }, record[hotKey] || '~')];
|
|
|
- sizeArr.push(h('div', { class: ' size-st-num' }, record[coldKey] || '~'));
|
|
|
- }
|
|
|
+ const childSizesColumn = hotChargeSizeArr
|
|
|
+ .sort((a, b) => Number(a) * 1000 - Number(b) * 1000)
|
|
|
+ .map((childItem) => {
|
|
|
+ return {
|
|
|
+ title: childItem,
|
|
|
+ dataIndex: `${item}.${childItem}`,
|
|
|
+ key: `${item}.${childItem}`,
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const hotKey = childItem + item + '0';
|
|
|
+ const coldKey = childItem + item + '1';
|
|
|
+ let sizeArr: any = [];
|
|
|
+ if (record[hotKey] || record[coldKey]) {
|
|
|
+ sizeArr = [h('div', { class: 'line' }, ''), h('div', { class: 'size-st-item' }, record[hotKey] || '~')];
|
|
|
+ sizeArr.push(h('div', { class: ' size-st-num' }, record[coldKey] || '~'));
|
|
|
+ }
|
|
|
|
|
|
- return h(
|
|
|
- 'div',
|
|
|
- {
|
|
|
- class: 'size-st-wrapper',
|
|
|
- onClick: () => {
|
|
|
- // if (!record[hotKey] && !record[coldKey]) return;
|
|
|
- const { orgData } = record;
|
|
|
- if (!orgData) return;
|
|
|
- const { hotChargeLength } = orgData;
|
|
|
-
|
|
|
- const hotChargeInfoArr = hotChargeLength ? JSON.parse(hotChargeLength) : [];
|
|
|
-
|
|
|
- const itemsHotArr = niubiGls.map((v) => {
|
|
|
- const hasVal = hotChargeInfoArr.find((j) => j.hotChargeLength == v.hotChargeLength && j.hotChargeBtype == v.hotChargeBtype);
|
|
|
- return {
|
|
|
- ...v,
|
|
|
- totalCount: hasVal ? hasVal.totalCount : 0,
|
|
|
+ return h(
|
|
|
+ 'div',
|
|
|
+ {
|
|
|
+ class: 'size-st-wrapper',
|
|
|
+ onClick: () => {
|
|
|
+ // if (!record[hotKey] && !record[coldKey]) return;
|
|
|
+ const { orgData } = record;
|
|
|
+ if (!orgData) return;
|
|
|
+ const { hotChargeLength } = orgData;
|
|
|
+
|
|
|
+ const hotChargeInfoArr = hotChargeLength ? JSON.parse(hotChargeLength) : [];
|
|
|
+
|
|
|
+ const itemsHotArr = niubiGls.map((v) => {
|
|
|
+ const hasVal = hotChargeInfoArr.find(
|
|
|
+ (j) => j.hotChargeLength == v.hotChargeLength && j.hotChargeBtype == v.hotChargeBtype
|
|
|
+ );
|
|
|
+ return {
|
|
|
+ ...v,
|
|
|
+ totalCount: hasVal ? hasVal.totalCount : 0,
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ editSizeNumRecord.value = {
|
|
|
+ ...orgData,
|
|
|
+ hotChargeLengthArr: itemsHotArr,
|
|
|
};
|
|
|
- });
|
|
|
-
|
|
|
- editSizeNumRecord.value = {
|
|
|
- ...orgData,
|
|
|
- hotChargeLengthArr: itemsHotArr,
|
|
|
- };
|
|
|
- openSetSizeNumModal.value = true;
|
|
|
+ openSetSizeNumModal.value = true;
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- sizeArr
|
|
|
- );
|
|
|
- },
|
|
|
- };
|
|
|
- });
|
|
|
+ sizeArr
|
|
|
+ );
|
|
|
+ },
|
|
|
+ };
|
|
|
+ });
|
|
|
otherColumnsNums = otherColumnsNums + (childSizesColumn.length ? childSizesColumn.length : 1);
|
|
|
return {
|
|
|
...hotChargeColumns[item],
|
|
@@ -1119,9 +1259,19 @@
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- columns.value = [...defaultColumns, ...otherColumns, ...stackLengthColumn, ...totalColum];
|
|
|
+ const sortedStackLengthColumn = stackLengthColumn.map((ss) => {
|
|
|
+ return {
|
|
|
+ ...ss,
|
|
|
+ children: ss.children.sort((a, b) => {
|
|
|
+ return Number(a.sortKey) - Number(b.sortKey);
|
|
|
+ }),
|
|
|
+ };
|
|
|
+ });
|
|
|
+ columns.value = [...defaultColumns, ...otherColumns, ...sortedStackLengthColumn, ...totalColum];
|
|
|
const rollOneIndex = defaultColumns.findIndex((ele: any) => ele.dataIndex === 'rollOne');
|
|
|
- (columns.value[rollOneIndex] as any).children = rollOneColumns.length ? rollOneColumns : [];
|
|
|
+ (columns.value[rollOneIndex] as any).children = rollOneColumns.length
|
|
|
+ ? rollOneColumns.sort((a: any, b: any) => Number(a.sortKey) - Number(b.sortKey))
|
|
|
+ : [];
|
|
|
|
|
|
// 堆垛的列数量
|
|
|
const stackColNums = stackLengthColumn.reduce((pre: any, cur: any) => {
|
|
@@ -1182,6 +1332,8 @@
|
|
|
}
|
|
|
|
|
|
mainRemark.value = `合计:${allWeight.toFixed(3)} t`;
|
|
|
+ // 查看所有的定尺
|
|
|
+ mainSize.value = sizeInfo || [...new Set(allSizeArr)].join(',');
|
|
|
}
|
|
|
changeLoading(false);
|
|
|
} catch (error) {
|
|
@@ -1837,6 +1989,14 @@
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
+ .delete-heat {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: -10px;
|
|
|
+ color: #f50;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
.size-st-wrapper {
|
|
|
position: absolute;
|
|
|
top: 1px;
|