|
@@ -224,7 +224,13 @@
|
|
|
|
|
|
<!-- 新增炉号 -->
|
|
|
<a-modal v-model:open="openNewHeatNo" title="新增炉次" centered width="500px" :zIndex="1000" @ok="confirmAddHeatNo">
|
|
|
- <div style="padding: 60px 30px 30px; font-size: 16px">
|
|
|
+ <div style="padding: 30px; font-size: 16px">
|
|
|
+ <div class="flex" style="margin-bottom: 30px">
|
|
|
+ <span style="color: #f50; padding: 0 20px 0 0"> 添加</span>
|
|
|
+ <a-select class="flex-1" v-model:value="nextHeatNo" allowClear :options="getAddHeatNo" />
|
|
|
+ <span style="color: #f50; padding: 0 0 0 20px"> 之前</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
<a-input size="large" v-model:value="newHeatNo"></a-input>
|
|
|
</div>
|
|
|
</a-modal>
|
|
@@ -248,6 +254,7 @@
|
|
|
import { initDictOptions } from '/@/utils/dict';
|
|
|
import printBilletSampleCard from './printBilletSampleCard.vue';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
+ import { getMachineConfig, MachineConfigType } from '../../hotDelivery/common.data';
|
|
|
|
|
|
// 注册打印送样卡modal
|
|
|
const [registerPrintModal, { openModal }] = useModal();
|
|
@@ -370,7 +377,7 @@
|
|
|
{
|
|
|
title: () => {
|
|
|
return h('div', { style: { position: 'relative' } }, [
|
|
|
- h('span', {}, '棒一'),
|
|
|
+ h('span', {}, hostNumber.value == '5' ? '棒一' : '高线'),
|
|
|
h(
|
|
|
'div',
|
|
|
{
|
|
@@ -382,7 +389,6 @@
|
|
|
},
|
|
|
class: 'noprint',
|
|
|
onClick: () => {
|
|
|
- console.log('点击了');
|
|
|
const rollOnrColumn: any = columns.value.find((item: any) => item.dataIndex === 'rollOne');
|
|
|
let newSize: string | number = '';
|
|
|
rollOnrColumn.children.push({
|
|
@@ -479,22 +485,18 @@
|
|
|
const fetchChangeShiftId = ref('');
|
|
|
// 定尺
|
|
|
const sizeListOPtions = ref([]);
|
|
|
- const [registerModal, { changeOkLoading, changeLoading, closeModal }] = useModalInner(async (data) => {
|
|
|
- const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId, time, confirmOrgData } = data;
|
|
|
- printKey.value = dayjs().unix();
|
|
|
|
|
|
- hostNumber.value = ccmNo;
|
|
|
- fetchQueryType.value = queryType;
|
|
|
- fetchChangeShiftId.value = changeShiftId;
|
|
|
- shiftInfoTxt.value = shiftText.split('-');
|
|
|
- shiftInfo.value = curShiftInfo;
|
|
|
- isConfirmOrgData.value = confirmOrgData === true;
|
|
|
- if (time) {
|
|
|
- curTime.value = time;
|
|
|
- }
|
|
|
+ // 堆垛
|
|
|
+ const stackList = ref<any[]>([]);
|
|
|
+ // 获取堆垛信息
|
|
|
+ const getStackInfo = async (ccmNo) => {
|
|
|
+ const machineConfig = await getMachineConfig(ccmNo)[MachineConfigType.STACKING];
|
|
|
+ stackList.value = machineConfig;
|
|
|
+ };
|
|
|
|
|
|
+ const getTotalRows = (num = 22) => {
|
|
|
let newSip: any[] = [];
|
|
|
- for (let index = 0; index < 22; index++) {
|
|
|
+ for (let index = 0; index < num; index++) {
|
|
|
newSip.push({
|
|
|
SerialNumber: index + 1,
|
|
|
heatNo: '',
|
|
@@ -511,7 +513,27 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- dataSource.value = [...newSip];
|
|
|
+ return newSip;
|
|
|
+ };
|
|
|
+
|
|
|
+ const [registerModal, { changeOkLoading, changeLoading, closeModal }] = useModalInner(async (data) => {
|
|
|
+ const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId, time, confirmOrgData } = data;
|
|
|
+ printKey.value = dayjs().unix();
|
|
|
+
|
|
|
+ // 获取堆垛信息
|
|
|
+ getStackInfo(ccmNo);
|
|
|
+
|
|
|
+ hostNumber.value = ccmNo;
|
|
|
+ fetchQueryType.value = queryType;
|
|
|
+ fetchChangeShiftId.value = changeShiftId;
|
|
|
+ shiftInfoTxt.value = shiftText.split('-');
|
|
|
+ shiftInfo.value = curShiftInfo;
|
|
|
+ isConfirmOrgData.value = confirmOrgData === true;
|
|
|
+ if (time) {
|
|
|
+ curTime.value = time;
|
|
|
+ }
|
|
|
+
|
|
|
+ dataSource.value = getTotalRows();
|
|
|
getHeatList({
|
|
|
ccmNo,
|
|
|
queryType,
|
|
@@ -590,85 +612,93 @@
|
|
|
const stackingSize = {};
|
|
|
|
|
|
// 堆垛字段
|
|
|
- let stackLengthColumn: any = {
|
|
|
- title: () => {
|
|
|
- return h('div', { style: { position: 'relative' } }, [
|
|
|
- h('span', {}, '堆垛'),
|
|
|
- h(
|
|
|
- 'div',
|
|
|
- {
|
|
|
- style: {
|
|
|
- cursor: 'pointer',
|
|
|
- position: 'absolute',
|
|
|
- right: '4px',
|
|
|
- top: '1px',
|
|
|
- },
|
|
|
- class: 'noprint',
|
|
|
- onClick: () => {
|
|
|
- const rollOnrColumn: any = columns.value.find((item: any) => item.dataIndex === 'stackLength');
|
|
|
- let newSize: string | number = '';
|
|
|
- rollOnrColumn.children.push({
|
|
|
- title: () => {
|
|
|
- return h(
|
|
|
- // Select,
|
|
|
- Input,
|
|
|
- {
|
|
|
- // options: sizeListOPtions.value,
|
|
|
- bordered: false,
|
|
|
- // dropdownStyle: {
|
|
|
- // minWidth: '80px',
|
|
|
- // },
|
|
|
- style: {
|
|
|
- padding: '0px',
|
|
|
- textAlign: 'center',
|
|
|
+ let stackLengthColumn: any[] = stackList.value.map((stack) => {
|
|
|
+ return {
|
|
|
+ title: () => {
|
|
|
+ return h('div', { style: { position: 'relative' } }, [
|
|
|
+ h('span', {}, stack.typeName),
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ {
|
|
|
+ style: {
|
|
|
+ cursor: 'pointer',
|
|
|
+ position: 'absolute',
|
|
|
+ right: '4px',
|
|
|
+ top: '1px',
|
|
|
+ },
|
|
|
+ class: 'noprint',
|
|
|
+ onClick: () => {
|
|
|
+ const rollOnrColumn: any = columns.value.find((item: any) => item.dataIndex === 'stackLength' + stack.id);
|
|
|
+ let newSize: string | number = '';
|
|
|
+ rollOnrColumn.children.push({
|
|
|
+ title: () => {
|
|
|
+ return h(
|
|
|
+ // Select,
|
|
|
+ Input,
|
|
|
+ {
|
|
|
+ // options: sizeListOPtions.value,
|
|
|
+ bordered: false,
|
|
|
+ // dropdownStyle: {
|
|
|
+ // minWidth: '80px',
|
|
|
+ // },
|
|
|
+ style: {
|
|
|
+ padding: '0px',
|
|
|
+ textAlign: 'center',
|
|
|
+ },
|
|
|
+ defaultValue: ' ',
|
|
|
+ // onChange: (value) => {
|
|
|
+ // newSize = value;
|
|
|
+ // },
|
|
|
+ onBlur: throttle((e) => {
|
|
|
+ if (e.target.value.trim() === '') {
|
|
|
+ createMessage.error('请输入定尺');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const size = Number(e.target.value.trim());
|
|
|
+ if (!isNumber(size)) {
|
|
|
+ createMessage.error('请输入数字');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ newSize = size <= 20 ? size * 1000 : size;
|
|
|
+ }, 500),
|
|
|
},
|
|
|
- defaultValue: ' ',
|
|
|
- // onChange: (value) => {
|
|
|
- // newSize = value;
|
|
|
- // },
|
|
|
- onBlur: throttle((e) => {
|
|
|
- if (e.target.value.trim() === '') {
|
|
|
- createMessage.error('请输入定尺');
|
|
|
- return;
|
|
|
- }
|
|
|
- const size = Number(e.target.value.trim());
|
|
|
- if (!isNumber(size)) {
|
|
|
- createMessage.error('请输入数字');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- newSize = size <= 20 ? size * 1000 : size;
|
|
|
- }, 500),
|
|
|
- },
|
|
|
- ''
|
|
|
- );
|
|
|
- },
|
|
|
- dataIndex: 'newSize',
|
|
|
- key: 'newSize',
|
|
|
- align: 'center',
|
|
|
- // width: 100,
|
|
|
- customRender({ text, record }) {
|
|
|
- if (!record.heatNo) {
|
|
|
- return '';
|
|
|
- }
|
|
|
- return h(
|
|
|
- Input,
|
|
|
- { class: 'total-input', size: 'small', bordered: false, value: text, onBlur: (e) => handleStackChange(e, record, newSize) },
|
|
|
- ''
|
|
|
- );
|
|
|
- },
|
|
|
- });
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ },
|
|
|
+ dataIndex: 'newSize',
|
|
|
+ key: 'newSize',
|
|
|
+ align: 'center',
|
|
|
+ // width: 100,
|
|
|
+ customRender({ text, record }) {
|
|
|
+ if (!record.heatNo) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ return h(
|
|
|
+ Input,
|
|
|
+ {
|
|
|
+ class: 'total-input',
|
|
|
+ size: 'small',
|
|
|
+ bordered: false,
|
|
|
+ value: text,
|
|
|
+ onBlur: (e) => handleStackChange(e, record, newSize, stack.id),
|
|
|
+ },
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- h(Icon, { icon: 'ant-design:plus-square-outlined' }, '')
|
|
|
- ),
|
|
|
- ]);
|
|
|
- },
|
|
|
- dataIndex: 'stackLength',
|
|
|
- key: 'stackLength',
|
|
|
- width: 120,
|
|
|
- children: [],
|
|
|
- };
|
|
|
+ h(Icon, { icon: 'ant-design:plus-square-outlined' }, '')
|
|
|
+ ),
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+ dataIndex: 'stackLength' + stack.id,
|
|
|
+ key: 'stackLength' + stack.id,
|
|
|
+ width: 120,
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
+ });
|
|
|
|
|
|
const hotChargeColumns: any = {
|
|
|
// 棒二字段
|
|
@@ -704,7 +734,8 @@
|
|
|
roll_out_shipp: [],
|
|
|
};
|
|
|
|
|
|
- dataSource.value = dataSource.value.map((item, index) => {
|
|
|
+ const totalRows = getTotalRows();
|
|
|
+ dataSource.value = totalRows.map((item, index) => {
|
|
|
if (!newArr[index]) return item;
|
|
|
const { hotChargeLength, rollClubOneDetails, stackLength } = newArr[index];
|
|
|
|
|
@@ -902,10 +933,15 @@
|
|
|
if (stackLength) {
|
|
|
const stackLeghtObj = JSON.parse(stackLength);
|
|
|
stackLeghtObj.forEach((v) => {
|
|
|
+ // 初始化堆垛的定尺key
|
|
|
const sSize = String(v.stackingLength);
|
|
|
- const hasChild = stackLengthColumn.children.findIndex((ele) => ele.dataIndex === sSize + 'stackLength');
|
|
|
+ const stackKey = sSize + 'stackLength' + v.stackingBhtcId;
|
|
|
+ // 查找某一个堆垛 dataIndex='stackLength' + stackingBhtcId
|
|
|
+ const index = stackLengthColumn.findIndex((ele) => ele.dataIndex == 'stackLength' + v.stackingBhtcId);
|
|
|
+ const curStackChild = stackLengthColumn[index === -1 ? 0 : index].children;
|
|
|
+ const hasChild = curStackChild.findIndex((ele) => ele.dataIndex === stackKey);
|
|
|
if (hasChild < 0) {
|
|
|
- stackLengthColumn.children.push({
|
|
|
+ curStackChild.push({
|
|
|
title: () => {
|
|
|
return h('div', { class: 'rollOneColumnWrapper' }, [
|
|
|
h(
|
|
@@ -935,8 +971,8 @@
|
|
|
h('div', { class: 'noprint', onClick: () => deleteStackColumn(sSize) }, h(Icon, { icon: 'ant-design:delete-outlined' }, '')),
|
|
|
]);
|
|
|
},
|
|
|
- dataIndex: sSize + 'stackLength',
|
|
|
- key: sSize + 'stackLength',
|
|
|
+ dataIndex: stackKey,
|
|
|
+ key: stackKey,
|
|
|
width: 100,
|
|
|
customRender({ text, record }) {
|
|
|
if (!record.heatNo) {
|
|
@@ -944,14 +980,20 @@
|
|
|
}
|
|
|
return h(
|
|
|
Input,
|
|
|
- { class: 'total-input', size: 'small', bordered: false, value: text, onBlur: (e) => handleStackChange(e, record, sSize) },
|
|
|
+ {
|
|
|
+ class: 'total-input',
|
|
|
+ size: 'small',
|
|
|
+ bordered: false,
|
|
|
+ value: text,
|
|
|
+ onBlur: (e) => handleStackChange(e, record, sSize, v.stackingBhtcId),
|
|
|
+ },
|
|
|
''
|
|
|
);
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- stackSizeData[sSize + 'stackLength'] = v.stackingCount;
|
|
|
+ stackSizeData[stackKey] = v.stackingCount;
|
|
|
|
|
|
// 给堆垛添加致谢
|
|
|
if (!stackingSize[sSize]) {
|
|
@@ -1067,22 +1109,30 @@
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- columns.value = [...defaultColumns, ...otherColumns, ...[stackLengthColumn], ...totalColum];
|
|
|
+ columns.value = [...defaultColumns, ...otherColumns, ...stackLengthColumn, ...totalColum];
|
|
|
const rollOneIndex = defaultColumns.findIndex((ele: any) => ele.dataIndex === 'rollOne');
|
|
|
(columns.value[rollOneIndex] as any).children = rollOneColumns.length ? rollOneColumns : [];
|
|
|
|
|
|
+ // 堆垛的列数量
|
|
|
+ const stackColNums = stackLengthColumn.reduce((pre: any, cur: any) => {
|
|
|
+ return pre + (cur.children && cur.children.length ? cur.children.length : 1);
|
|
|
+ }, 0);
|
|
|
// 计算列,合并
|
|
|
- const allSpan =
|
|
|
- 4 +
|
|
|
- (rollOneColumns.length ? rollOneColumns.length : 1) +
|
|
|
- otherColumnsNums +
|
|
|
- (stackLengthColumn.children.length ? stackLengthColumn.children.length : 1);
|
|
|
+ const allSpan = 4 + (rollOneColumns.length ? rollOneColumns.length : 1) + otherColumnsNums + stackColNums;
|
|
|
remakeColSpan.value = Math.ceil(allSpan / 3);
|
|
|
const nnColSpan = Math.ceil((allSpan - remakeColSpan.value) / 2);
|
|
|
const newNNColSpan = nnColSpan % 2 === 0 ? nnColSpan : nnColSpan + 1;
|
|
|
sizeColSpan.value = newNNColSpan / 2 > 4 ? 4 : newNNColSpan / 2;
|
|
|
flowColSpan.value = newNNColSpan - sizeColSpan.value;
|
|
|
weightColSpan.value = allSpan - remakeColSpan.value - newNNColSpan;
|
|
|
+ // console.log('列宽计算结果allSpan', allSpan);
|
|
|
+ // console.log('列宽计算结果stackColNums', stackColNums);
|
|
|
+ // console.log('列宽计算结果remakeColSpan.value', remakeColSpan.value);
|
|
|
+ // console.log('列宽计算结果nnColSpan', nnColSpan);
|
|
|
+ // console.log('列宽计算结果newNNColSpan', newNNColSpan);
|
|
|
+ // console.log('列宽计算结果sizeColSpan.value', sizeColSpan.value);
|
|
|
+ // console.log('列宽计算结果flowColSpan.value', flowColSpan.value);
|
|
|
+ // console.log('列宽计算结果weightColSpan.value', weightColSpan.value);
|
|
|
|
|
|
let allWeight = 0;
|
|
|
// 热送统计
|
|
@@ -1155,7 +1205,8 @@
|
|
|
return;
|
|
|
}
|
|
|
const { orgData } = record;
|
|
|
- if (Number(orgData.amount) != val) {
|
|
|
+ const allCount = handleTotalSum(orgData);
|
|
|
+ if (Number(orgData.amount) != val && allCount != val) {
|
|
|
handleEdit({
|
|
|
...orgData,
|
|
|
amount: val,
|
|
@@ -1264,7 +1315,7 @@
|
|
|
};
|
|
|
|
|
|
// 修改堆垛定尺数量
|
|
|
- const handleStackChange = throttle((e: any, record, size) => {
|
|
|
+ const handleStackChange = throttle((e: any, record, size, stackingId) => {
|
|
|
if (e.target.value.trim() === '') return;
|
|
|
if (!size) {
|
|
|
createMessage.error('请选择定尺');
|
|
@@ -1283,7 +1334,7 @@
|
|
|
obj = JSON.parse(stackLength);
|
|
|
}
|
|
|
|
|
|
- const lengthGroupCount = obj.findIndex((v) => v.stackingLength == size);
|
|
|
+ const lengthGroupCount = obj.findIndex((v) => v.stackingLength == size && v.stackingBhtcId == stackingId);
|
|
|
|
|
|
// 计算补的数量是不是4的倍数
|
|
|
let stackInfo: any = null;
|
|
@@ -1303,6 +1354,7 @@
|
|
|
stackingCount: val,
|
|
|
stackingLength: size,
|
|
|
stackingWeight: val * (Number(size) / 1000) * 0.2265,
|
|
|
+ stackingBhtcId: stackingId,
|
|
|
});
|
|
|
} else {
|
|
|
if (obj[lengthGroupCount].stackingCount === val) return;
|
|
@@ -1614,11 +1666,23 @@
|
|
|
|
|
|
// 添加炉次
|
|
|
const newHeatNo = ref('');
|
|
|
+ const nextHeatNo = ref(undefined);
|
|
|
const openNewHeatNo = ref(false);
|
|
|
const addHeatNo = () => {
|
|
|
newHeatNo.value = '';
|
|
|
openNewHeatNo.value = true;
|
|
|
};
|
|
|
+
|
|
|
+ const getAddHeatNo = computed(() => {
|
|
|
+ return dataSource.value
|
|
|
+ .filter((o) => o.heatNo)
|
|
|
+ .map((t) => {
|
|
|
+ return {
|
|
|
+ label: t.SerialNumber + ' - ' + t.heatNo,
|
|
|
+ value: t.heatNo,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
const confirmAddHeatNo = async () => {
|
|
|
try {
|
|
|
if (!newHeatNo.value) {
|
|
@@ -1630,6 +1694,8 @@
|
|
|
await addBilletNo({
|
|
|
ccmNo: hostNumber.value,
|
|
|
heatNo: newHeatNo.value,
|
|
|
+ changeShiftId: fetchChangeShiftId.value,
|
|
|
+ nextHeatNo: nextHeatNo.value,
|
|
|
});
|
|
|
openNewHeatNo.value = false;
|
|
|
|