|
@@ -35,7 +35,7 @@
|
|
|
<a-table-summary-cell :col-span="8" style="text-align: center">备注</a-table-summary-cell>
|
|
|
<a-table-summary-cell :col-span="2" style="text-align: center"> 定尺 </a-table-summary-cell>
|
|
|
<a-table-summary-cell :col-span="2" style="text-align: center"> 支数(支) </a-table-summary-cell>
|
|
|
- <a-table-summary-cell :col-span="3" style="text-align: center"> 产量(吨) </a-table-summary-cell>
|
|
|
+ <a-table-summary-cell :col-span="8" style="text-align: center"> 产量(吨) </a-table-summary-cell>
|
|
|
</a-table-summary-row>
|
|
|
<a-table-summary-row class="summary-row-no-border">
|
|
|
<a-table-summary-cell :col-span="8">
|
|
@@ -44,7 +44,7 @@
|
|
|
<a-table-summary-cell :row-span="1"> 热送 </a-table-summary-cell>
|
|
|
<a-table-summary-cell :row-span="1"> </a-table-summary-cell>
|
|
|
<a-table-summary-cell :col-span="2"></a-table-summary-cell>
|
|
|
- <a-table-summary-cell :col-span="3"> </a-table-summary-cell>
|
|
|
+ <a-table-summary-cell :col-span="8"> </a-table-summary-cell>
|
|
|
</a-table-summary-row>
|
|
|
<a-table-summary-row>
|
|
|
<a-table-summary-cell :col-span="8">
|
|
@@ -53,22 +53,65 @@
|
|
|
<a-table-summary-cell :row-span="1"> 堆垛 </a-table-summary-cell>
|
|
|
<a-table-summary-cell :row-span="1"> </a-table-summary-cell>
|
|
|
<a-table-summary-cell :col-span="2"></a-table-summary-cell>
|
|
|
- <a-table-summary-cell :col-span="3"> </a-table-summary-cell>
|
|
|
+ <a-table-summary-cell :col-span="8"> </a-table-summary-cell>
|
|
|
</a-table-summary-row>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
</section>
|
|
|
+
|
|
|
+ <template #appendFooter>
|
|
|
+ <a-button @click="openJSModal = true"> 重量计算 </a-button>
|
|
|
+ </template>
|
|
|
</BasicModal>
|
|
|
+ <a-modal
|
|
|
+ v-model:open="openJSModal"
|
|
|
+ title="重量计算"
|
|
|
+ centered
|
|
|
+ width="600px"
|
|
|
+ :zIndex="9999"
|
|
|
+ @ok="
|
|
|
+ () => {
|
|
|
+ openJSModal = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ @cancel="
|
|
|
+ () => {
|
|
|
+ openJSModal = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div class="flex justify-center items-center" style="margin: 20px; line-height: 40px">
|
|
|
+ <a-input-group size="large">
|
|
|
+ <a-row :gutter="8">
|
|
|
+ <a-col :span="5">
|
|
|
+ <a-input type="number" v-model:value="weightNum" placeholder="请输入支数" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="1" style="line-height: 40px; text-align: center">*</a-col>
|
|
|
+ <a-col :span="5">
|
|
|
+ <a-input type="number" v-model:value="sizeNum" placeholder="请输入定尺" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="1" style="line-height: 40px; text-align: center">*</a-col>
|
|
|
+ <a-col :span="5">
|
|
|
+ <a-input type="number" v-model:value="xiShu" placeholder="请输入比例" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="1" style="line-height: 40px; text-align: center">=</a-col>
|
|
|
+
|
|
|
+ <a-col :span="6" style="line-height: 40px; text-align: center">{{ weightCalc }}</a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-input-group>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { ref } from 'vue';
|
|
|
+ import { ref, computed, h } from 'vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { printJS } from '/@/hooks/web/usePrintJS';
|
|
|
import type { TableColumnsType } from 'ant-design-vue';
|
|
|
import { queryHeatsActualsByCcmNo } from '../operator.api';
|
|
|
import { render } from '/@/utils/common/renderUtils';
|
|
|
+ import { isNumber } from '/@/utils/is';
|
|
|
|
|
|
// 渲染字典标签
|
|
|
const renderDictTag = (value: string, dictCode: string) => {
|
|
@@ -76,7 +119,7 @@
|
|
|
};
|
|
|
// 主机号
|
|
|
const hostNumber = ref('5');
|
|
|
- const columns: TableColumnsType = [
|
|
|
+ const defaultColumns: TableColumnsType = [
|
|
|
{
|
|
|
title: '序号',
|
|
|
width: 40,
|
|
@@ -111,89 +154,76 @@
|
|
|
dataIndex: 'oneFlow',
|
|
|
key: 'oneFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'II流',
|
|
|
dataIndex: 'twoFlow',
|
|
|
key: 'twoFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'III流',
|
|
|
dataIndex: 'threeFlow',
|
|
|
key: 'threeFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'IV流',
|
|
|
dataIndex: 'fourFlow',
|
|
|
key: 'fourFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'V流',
|
|
|
dataIndex: 'fiveFlow',
|
|
|
key: 'fiveFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'VI流',
|
|
|
dataIndex: 'sixFlow',
|
|
|
key: 'sixFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'VII流',
|
|
|
dataIndex: 'sevenFlow',
|
|
|
key: 'sevenFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: 'VIII流',
|
|
|
dataIndex: 'eightFlow',
|
|
|
key: 'eightFlow',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '热送',
|
|
|
- dataIndex: 'hotSend',
|
|
|
- key: 'hotSend',
|
|
|
- align: 'center',
|
|
|
- width: 50,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '堆垛',
|
|
|
- dataIndex: 'stack',
|
|
|
- key: 'stack',
|
|
|
- align: 'center',
|
|
|
- width: 50,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
{
|
|
|
title: '合计',
|
|
|
dataIndex: 'total',
|
|
|
key: 'total',
|
|
|
align: 'center',
|
|
|
- width: 50,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '备注',
|
|
|
- dataIndex: 'remark',
|
|
|
- key: 'remark',
|
|
|
- align: 'center',
|
|
|
- width: 60,
|
|
|
+ width: 40,
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '棒一',
|
|
|
+ width: 40,
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'rollOne',
|
|
|
+ key: 'rollOne',
|
|
|
+ },
|
|
|
];
|
|
|
|
|
|
+ const columns = ref<TableColumnsType>(defaultColumns);
|
|
|
const dataSource = ref<any[]>([]);
|
|
|
const shiftInfoTxt = ref(['', '']);
|
|
|
const shiftInfo = ref({ shift: '', shiftGroup: '' });
|
|
@@ -201,7 +231,6 @@
|
|
|
//表单赋值
|
|
|
const [registerModal, { changeOkLoading }] = useModalInner(async (data) => {
|
|
|
const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId, time } = data;
|
|
|
- console.log('data', data);
|
|
|
|
|
|
hostNumber.value = ccmNo;
|
|
|
shiftInfoTxt.value = shiftText.split('-');
|
|
@@ -224,10 +253,7 @@
|
|
|
sixFlow: '',
|
|
|
sevenFlow: '',
|
|
|
eightFlow: '',
|
|
|
- hotSend: '',
|
|
|
- stack: '',
|
|
|
total: '',
|
|
|
- remark: '',
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -239,6 +265,12 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ // 字段映射
|
|
|
+ const headText = {
|
|
|
+ rollClubTwoCount: '二',
|
|
|
+ rollClubThreeCount: '三',
|
|
|
+ };
|
|
|
+
|
|
|
const getHeatList = async (params) => {
|
|
|
try {
|
|
|
const res = await queryHeatsActualsByCcmNo(params);
|
|
@@ -252,28 +284,56 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ let sizeColumn: string[] = [];
|
|
|
+ let sizeHeadContent = {};
|
|
|
+
|
|
|
dataSource.value = dataSource.value.map((item, index) => {
|
|
|
if (!newArr[index]) return item;
|
|
|
- let hotSendNum = 0;
|
|
|
- let stackingNum = 0;
|
|
|
let totalNum = 0;
|
|
|
- const { hotSend, directRolling, stacking, totalInfo } = newArr[index];
|
|
|
+ const { totalInfo, length, hotSend, directRolling } = newArr[index];
|
|
|
+ if (totalInfo) {
|
|
|
+ const obj = JSON.parse(totalInfo);
|
|
|
+ totalNum = obj.totalCount;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 棒一
|
|
|
+ let rollOneNum = '';
|
|
|
if (hotSend) {
|
|
|
const obj = JSON.parse(hotSend);
|
|
|
- hotSendNum = obj.hotSendTotalCount;
|
|
|
+ rollOneNum = obj.hotSendTotalCount || '';
|
|
|
}
|
|
|
if (directRolling) {
|
|
|
const obj = JSON.parse(directRolling);
|
|
|
- hotSendNum = obj.directRollingTotalCount;
|
|
|
+ rollOneNum = obj.directRollingTotalCount || '';
|
|
|
}
|
|
|
- if (stacking) {
|
|
|
- const obj = JSON.parse(stacking);
|
|
|
- stackingNum = obj.stackingTotalCount;
|
|
|
- }
|
|
|
- if (totalInfo) {
|
|
|
- const obj = JSON.parse(totalInfo);
|
|
|
- totalNum = obj.totalCount;
|
|
|
+
|
|
|
+ // 定尺
|
|
|
+ let sizeArr = {};
|
|
|
+ if (length) {
|
|
|
+ const obj = JSON.parse(length);
|
|
|
+ Object.keys(obj).forEach((k) => {
|
|
|
+ const sizeFormat = Number(k) / 1000 + 'm';
|
|
|
+ sizeArr[sizeFormat] = obj[k].lengthTotalCount;
|
|
|
+ sizeArr[sizeFormat + 'Arr'] = {
|
|
|
+ rollClubTwoCount: obj[k].rollClubTwoCount,
|
|
|
+ rollClubThreeCount: obj[k].rollClubThreeCount,
|
|
|
+ };
|
|
|
+ sizeColumn.push(sizeFormat);
|
|
|
+
|
|
|
+ // 判断是否有该字段,列头显示
|
|
|
+ if (!sizeHeadContent[sizeFormat]) {
|
|
|
+ sizeHeadContent[sizeFormat] = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (obj[k].rollClubTwoCount && !sizeHeadContent[sizeFormat].includes('rollClubTwoCount')) {
|
|
|
+ sizeHeadContent[sizeFormat].push('rollClubTwoCount');
|
|
|
+ }
|
|
|
+ if (obj[k].rollClubThreeCount && !sizeHeadContent[sizeFormat].includes('rollClubThreeCount')) {
|
|
|
+ sizeHeadContent[sizeFormat].push('rollClubThreeCount');
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
return {
|
|
|
...item,
|
|
|
heatNo: newArr[index].heatNo,
|
|
@@ -286,18 +346,71 @@
|
|
|
sixFlow: newArr[index].sixStrandNo || '',
|
|
|
sevenFlow: newArr[index].sevenStrandNo || '',
|
|
|
eightFlow: newArr[index].eightStrandNo || '',
|
|
|
- hotSend: hotSendNum || '',
|
|
|
- stack: stackingNum || '',
|
|
|
total: totalNum || '',
|
|
|
- remark: '',
|
|
|
+ rollOne: rollOneNum,
|
|
|
+ ...sizeArr,
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ const otherColumn: TableColumnsType = [...new Set(sizeColumn)].map((item) => {
|
|
|
+ return {
|
|
|
+ title: () => {
|
|
|
+ const subHead = Object.keys(headText)
|
|
|
+ .filter((key) => sizeHeadContent[item].includes(key))
|
|
|
+ .map((key) => headText[key]);
|
|
|
+
|
|
|
+ return h('div', {}, [h('div', { style: { fontSize: '12px' } }, subHead.join(' / ')), h('div', {}, item)]);
|
|
|
+ },
|
|
|
+ dataIndex: item,
|
|
|
+ key: item,
|
|
|
+ align: 'center',
|
|
|
+ width: 50,
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ if (!text) return '';
|
|
|
+ const sizeArr = [h('div', { class: 'line' }, ''), h('div', { class: 'size-st-item' }, text)];
|
|
|
+ if (record[item + 'Arr']) {
|
|
|
+ const subHead = Object.keys(headText)
|
|
|
+ .filter((key) => sizeHeadContent[item].includes(key))
|
|
|
+ .map((key) => record[item + 'Arr'][key] || '~');
|
|
|
+ sizeArr.push(h('div', { class: ' size-st-num' }, subHead.join('/')));
|
|
|
+ }
|
|
|
+ return h('div', { class: 'size-st-wrapper' }, sizeArr);
|
|
|
+ },
|
|
|
};
|
|
|
});
|
|
|
+
|
|
|
+ // 添加空白列
|
|
|
+ otherColumn.push({
|
|
|
+ title: '',
|
|
|
+ dataIndex: '',
|
|
|
+ key: '',
|
|
|
+ align: 'center',
|
|
|
+ width: 40,
|
|
|
+ });
|
|
|
+ columns.value = [...defaultColumns, ...otherColumn];
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const openJSModal = ref(false);
|
|
|
+ const xiShu = ref(0.2265);
|
|
|
+ const sizeNum = ref();
|
|
|
+ const weightNum = ref();
|
|
|
+ // 重量计算按钮
|
|
|
+ const weightCalc = computed(() => {
|
|
|
+ const w = Number(weightNum.value);
|
|
|
+ const x = Number(xiShu.value);
|
|
|
+ const s = Number(sizeNum.value);
|
|
|
+ if (isNumber(w) && isNumber(x) && isNumber(s)) {
|
|
|
+ const r = w * x * s;
|
|
|
+
|
|
|
+ return !isNaN(r) ? r.toFixed(6) : '';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ });
|
|
|
+
|
|
|
function onPrint() {
|
|
|
changeOkLoading(true);
|
|
|
printJS({
|
|
@@ -410,6 +523,48 @@
|
|
|
border-inline-end: 1px solid rgba(0, 0, 0, 0.6);
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.6);
|
|
|
text-align: center;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .size-st-wrapper {
|
|
|
+ position: absolute;
|
|
|
+ top: 1px;
|
|
|
+ left: 1px;
|
|
|
+ right: 1px;
|
|
|
+ bottom: 1px;
|
|
|
+
|
|
|
+ .line {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%; /* 等于长方形宽度 */
|
|
|
+ height: 100%; /* 等于长方形高度 */
|
|
|
+
|
|
|
+ /* 创建斜线:线性渐变从左上到右下 */
|
|
|
+ background: linear-gradient(
|
|
|
+ to bottom right,
|
|
|
+ transparent 0%,
|
|
|
+ transparent calc(50% - 0.5px),
|
|
|
+ /* 斜线上方透明 */ rgba(0, 0, 0, 0.6) calc(50% - 0.5px),
|
|
|
+ /* 斜线颜色 */ rgba(0, 0, 0, 0.6) calc(50% + 0.5px),
|
|
|
+ /* 斜线厚度 */ transparent calc(50% + 0.5px) /* 斜线下方透明 */
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ .size-st-item {
|
|
|
+ position: absolute;
|
|
|
+ top: -4px;
|
|
|
+ left: 2px;
|
|
|
+ color: #108ee9;
|
|
|
+ }
|
|
|
+
|
|
|
+ .size-st-num {
|
|
|
+ position: absolute;
|
|
|
+ bottom: -4px;
|
|
|
+ right: 2px;
|
|
|
+ color: #f50;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -434,7 +589,7 @@
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
- @page :first {
|
|
|
+ @page {
|
|
|
margin-top: 10px; /* 第一页的页眉距离顶部为0 */
|
|
|
margin-bottom: 0; /* 第一页的页脚距离底部为0 */
|
|
|
}
|