|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose title="装运单打印" :height="400" :width="800" ok-text="打印" @ok="onPrint">
|
|
|
<section ref="print" style="padding: 10px 10px 0; position: relative; border: 1px solid #c5c5c5; background: beige; width: 98%" id="printContent">
|
|
|
- <span style="position: absolute; right: 20px; top: 10px; font-size: 16px; font-weight: bold"
|
|
|
- >{{ info.ccmNo }}#机 / {{ info.btype == 1 ? '冷' : '热' }}</span
|
|
|
- >
|
|
|
+ <span style="position: absolute; right: 20px; top: 10px; font-size: 16px; font-weight: bold; cursor: pointer" @click="changeBtype">
|
|
|
+ {{ info.ccmNo }}#机 / {{ info.btype == 1 ? '冷' : '热' }}
|
|
|
+ </span>
|
|
|
<div class="ticket next-ticket">
|
|
|
<div style="text-align: center">
|
|
|
<p style="font-size: 24px; font-weight: 800; display: inline-block; border-bottom: 2px solid #000; margin-bottom: 16px; line-height: 30px">
|
|
@@ -11,42 +11,102 @@
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="flex" style="line-height: 24px">
|
|
|
- <div class="flex-1">库名:{{ info.destination }}</div>
|
|
|
- <div class="flex-1" style="text-align: center; font-size: 13px">{{
|
|
|
- dayjs(info.arrivalTime).format('YYYY 年 MM 月 DD 日 HH 时 mm 分')
|
|
|
- }}</div>
|
|
|
+ <div class="flex-1">
|
|
|
+ 库名:
|
|
|
+ <JSearchSelect
|
|
|
+ type="list"
|
|
|
+ style="width: 120px"
|
|
|
+ :bordered="false"
|
|
|
+ v-model:value="info.typeConfigId"
|
|
|
+ :options="destinationOptions[info.ccmNo]"
|
|
|
+ placeholder="请选择"
|
|
|
+ allowClear
|
|
|
+ @change="(v) => handleDestinationIdChange(v)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="flex-1" style="text-align: center; font-size: 13px">
|
|
|
+ <a-date-picker
|
|
|
+ class="lgprint-date-picker"
|
|
|
+ v-model:value="info.arrivalTimeDay"
|
|
|
+ format="YYYY 年 MM 月 DD 日 HH 时 mm 分"
|
|
|
+ showTime
|
|
|
+ :bordered="false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="flex-1" style="text-align: right; font-size: 12px">
|
|
|
- {{ dayjs(info.arrivalTime).format('YYYYMMDDHHmmss') }}/{{ info.carNum }}/{{ info.carAllNum }}/{{ info.shift_dictText }}/{{
|
|
|
- info.shiftGroup_dictText
|
|
|
- }}
|
|
|
+ <a-input v-model:value="info.classes" style="font-size: 12px; padding: 0; width: 100%; text-align: right" :bordered="false" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<a-descriptions style="margin-top: 6px; margin-bottom: 4px" layout="vertical" bordered :column="8" size="small">
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="序号">
|
|
|
- <div style="min-height: 80px; display: flex; align-items: center; justify-content: center"
|
|
|
- ><span>{{ info.carAllNum }}</span></div
|
|
|
- >
|
|
|
+ <div style="min-height: 80px; display: flex; align-items: center; justify-content: center" @click="numberEdit.value.focus()">
|
|
|
+ <a-input
|
|
|
+ ref="numberEdit"
|
|
|
+ v-model:value="info.number"
|
|
|
+ style="font-size: 12px; padding: 0; width: 28px; text-align: center"
|
|
|
+ :bordered="false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="车号">
|
|
|
- {{ info.licensePlate }}
|
|
|
+ <!-- {{ info.licensePlate }} -->
|
|
|
+ <JSearchSelect
|
|
|
+ type="list"
|
|
|
+ :bordered="false"
|
|
|
+ v-model:value="info.licensePlate"
|
|
|
+ dict="lg_car"
|
|
|
+ style="width: 110px; font-size: 12px"
|
|
|
+ placeholder="请选择"
|
|
|
+ allowClear
|
|
|
+ />
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="牌号">
|
|
|
- <component :is="renderDictTag(info.brandNum, 'billet_spec')" />
|
|
|
+ <!-- <component :is="renderDictTag(info.brandNum, 'billet_spec')" /> -->
|
|
|
+ <JSearchSelect type="list" :bordered="false" v-model:value="info.brandNum" dict="billet_spec" placeholder="请选择" allowClear />
|
|
|
</a-descriptions-item>
|
|
|
- <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="炉号">
|
|
|
- <div v-for="item in headDtl" :key="item.id">{{ item.heatNo }} - {{ item.billetNos.length }}</div>
|
|
|
+ <a-descriptions-item
|
|
|
+ class="heat-wrapper"
|
|
|
+ style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px; position: relative"
|
|
|
+ label="炉号"
|
|
|
+ >
|
|
|
+ <div class="heatNo-item" v-for="(item, sindex) in headDtl" :key="item.id">
|
|
|
+ {{ item.heatNo }} - {{ item.heatNum ? item.heatNum : item.billetNos.length }}
|
|
|
+ <div class="op jian" @click="deleteHeatDtl(sindex)">-</div>
|
|
|
+ </div>
|
|
|
+ <div class="add-heatNo" @click="addHeatDtl">+</div>
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="规格">
|
|
|
- 170 / {{ sizeInfo.join(',') }}
|
|
|
+ <div style="min-width: 120px">
|
|
|
+ <span> 170 /</span>
|
|
|
+ <!-- {{ sizeInfo.join(',') }} -->
|
|
|
+ <!-- <JSelectMultiple type="list" :bordered="false" v-model:value="info.size" dictCode="lg_dcgg" placeholder="请选择" allowClear /> -->
|
|
|
+ <a-input v-model:value="info.size" :bordered="false" style="width: 80px; padding: 0; font-size: 12px; display: inline-block" />
|
|
|
+ </div>
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="名称">
|
|
|
- 方坯
|
|
|
+ <div style="min-width: 40px"> 方坯 </div>
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="支数">
|
|
|
- {{ info.amountTotal }}
|
|
|
+ <!-- {{ info.amountTotal }} -->
|
|
|
+ <a-input-number
|
|
|
+ :bordered="false"
|
|
|
+ style="min-width: 50px; width: 50px; font-size: 12px; text-align: center"
|
|
|
+ v-model:value="info.amountTotal"
|
|
|
+ :min="0"
|
|
|
+ :max="99"
|
|
|
+ :precision="0"
|
|
|
+ />
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="重量">
|
|
|
- {{ weight > 0 ? weight.toFixed(4) : 0 }}
|
|
|
+ <!-- {{ weight > 0 ? weight.toFixed(4) : 0 }} -->
|
|
|
+ <a-input-number
|
|
|
+ :bordered="false"
|
|
|
+ style="min-width: 80px; width: 80px; font-size: 12px; text-align: center"
|
|
|
+ v-model:value="info.weight"
|
|
|
+ :min="0"
|
|
|
+ :max="99"
|
|
|
+ :precision="4"
|
|
|
+ />
|
|
|
</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
<a-descriptions style="padding: 0 30px" size="small">
|
|
@@ -56,6 +116,19 @@
|
|
|
</a-descriptions>
|
|
|
</div>
|
|
|
</section>
|
|
|
+ <div class="add-heat" v-if="showAddHeat" style="margin: 20px">
|
|
|
+ <a-input-group size="large">
|
|
|
+ <a-row :gutter="8">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-input-number placeholder="请输入炉号" style="min-width: 180px" size="large" v-model:value="headValue" :precision="0" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="4">
|
|
|
+ <a-input-number placeholder="请输入支数" v-model:value="heatNum" size="large" :precision="0" />
|
|
|
+ </a-col>
|
|
|
+ <a-button type="primary" @click="confirmAddHeatDtl">添加</a-button>
|
|
|
+ </a-row>
|
|
|
+ </a-input-group>
|
|
|
+ </div>
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
|
|
@@ -63,9 +136,15 @@
|
|
|
import { ref } from 'vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import dayjs from 'dayjs';
|
|
|
- import { render } from '/@/utils/common/renderUtils';
|
|
|
+ // import { render } from '/@/utils/common/renderUtils';
|
|
|
import { printJS } from '/@/hooks/web/usePrintJS';
|
|
|
- import { listShippingBill } from '../shippingBill.api';
|
|
|
+ import { listShippingBill, saveBeforePrint, getByStorageBillId } from '../shippingBill.api';
|
|
|
+ import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
|
|
|
+ // import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+ import { destinationOptions } from '../../hotDelivery/common.data';
|
|
|
+
|
|
|
+ const { createMessage } = useMessage();
|
|
|
|
|
|
const props = defineProps({
|
|
|
api: {
|
|
@@ -78,22 +157,40 @@
|
|
|
const headDtl = ref<any[]>([]);
|
|
|
const weight = ref<number>(0);
|
|
|
const sizeInfo = ref<string[]>([]);
|
|
|
+ const numberEdit = ref();
|
|
|
//表单赋值
|
|
|
const [registerModal, { changeLoading, changeOkLoading }] = useModalInner(async (data) => {
|
|
|
- const { record } = data;
|
|
|
- console.log(record);
|
|
|
+ const { record, type } = data;
|
|
|
if (record) {
|
|
|
- info.value = record;
|
|
|
- getTableList();
|
|
|
+ info.value = {
|
|
|
+ ...record,
|
|
|
+ arrivalTimeDay: dayjs(record.arrivalTime),
|
|
|
+ number: record.carAllNum,
|
|
|
+ classes:
|
|
|
+ dayjs(record.arrivalTime).format('YYYYMMDDHHmmss') +
|
|
|
+ '/' +
|
|
|
+ record.carNum +
|
|
|
+ '/' +
|
|
|
+ record.carAllNum +
|
|
|
+ '/' +
|
|
|
+ record.shift_dictText +
|
|
|
+ '/' +
|
|
|
+ record.shiftGroup_dictText,
|
|
|
+ };
|
|
|
+
|
|
|
+ await getTableList();
|
|
|
+ if (type === 'offline') {
|
|
|
+ getOfflineBill();
|
|
|
+ }
|
|
|
} else {
|
|
|
info.value = {};
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 渲染字典标签
|
|
|
- const renderDictTag = (value: string, dictCode: string) => {
|
|
|
- return render.renderDict(value, dictCode);
|
|
|
- };
|
|
|
+ // const renderDictTag = (value: string, dictCode: string) => {
|
|
|
+ // return render.renderDict(value, dictCode);
|
|
|
+ // };
|
|
|
|
|
|
const getTableList = async () => {
|
|
|
try {
|
|
@@ -144,6 +241,7 @@
|
|
|
headDtl.value = newArr;
|
|
|
weight.value = allWeight;
|
|
|
sizeInfo.value = sizeArr;
|
|
|
+ info.value.weight = allWeight;
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
} finally {
|
|
@@ -152,8 +250,93 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 获取线下票据数据
|
|
|
+ const getOfflineBill = async () => {
|
|
|
+ try {
|
|
|
+ changeLoading(true);
|
|
|
+ changeOkLoading(true);
|
|
|
+ getByStorageBillId({ storageBillId: info.value.id }).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ info.value = {
|
|
|
+ ...info.value,
|
|
|
+ ...res,
|
|
|
+ };
|
|
|
+
|
|
|
+ headDtl.value = Object.keys(res.heatNo).map((item) => ({
|
|
|
+ heatNo: item,
|
|
|
+ heatNum: res.heatNo[item],
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ } finally {
|
|
|
+ changeLoading(false);
|
|
|
+ changeOkLoading(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const deleteHeatDtl = (index: number) => {
|
|
|
+ headDtl.value.splice(index, 1);
|
|
|
+ };
|
|
|
+
|
|
|
+ const headValue = ref<number | null>();
|
|
|
+ const heatNum = ref<number | null>();
|
|
|
+ const showAddHeat = ref(false);
|
|
|
+ const addHeatDtl = () => {
|
|
|
+ headValue.value = null;
|
|
|
+ heatNum.value = null;
|
|
|
+ showAddHeat.value = true;
|
|
|
+ };
|
|
|
+ const confirmAddHeatDtl = () => {
|
|
|
+ if (headValue.value && heatNum.value) {
|
|
|
+ headDtl.value.push({
|
|
|
+ id: headValue.value + '-' + heatNum.value,
|
|
|
+ heatNo: headValue.value,
|
|
|
+ heatNum: heatNum.value,
|
|
|
+ });
|
|
|
+ showAddHeat.value = false;
|
|
|
+ } else {
|
|
|
+ createMessage.warning('请填写炉号和支数');
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const changeBtype = (v) => {
|
|
|
+ info.value.btype = info.value.btype == '1' ? '0' : '1';
|
|
|
+ };
|
|
|
+
|
|
|
+ // 修改目的地
|
|
|
+ function handleDestinationIdChange(v) {
|
|
|
+ if (v) {
|
|
|
+ const cur = destinationOptions[info.value.ccmNo].find((item) => item.value === v);
|
|
|
+ info.value.destination = cur.label;
|
|
|
+ } else {
|
|
|
+ info.value.destination = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function onPrint() {
|
|
|
changeOkLoading(true);
|
|
|
+
|
|
|
+ let headDtlObj = {};
|
|
|
+ headDtl.value.forEach((item) => {
|
|
|
+ headDtlObj[item.heatNo] = item.heatNum ? item.heatNum : item.billetNos.length;
|
|
|
+ });
|
|
|
+ saveBeforePrint({
|
|
|
+ amountTotal: info.value.amountTotal,
|
|
|
+ arrivalTime: info.value.arrivalTimeDay.format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ brandNum: info.value.brandNum,
|
|
|
+ destination: info.value.destination,
|
|
|
+ heatNo: headDtlObj,
|
|
|
+ licensePlate: info.value.licensePlate,
|
|
|
+ name: '方坯',
|
|
|
+ size: info.value.size,
|
|
|
+ storageBillId: info.value.id,
|
|
|
+ weight: info.value.weight,
|
|
|
+ number: info.value.number,
|
|
|
+ classes: info.value.classes,
|
|
|
+ btype: info.value.btype,
|
|
|
+ ccmNo: info.value.ccmNo,
|
|
|
+ });
|
|
|
printJS({
|
|
|
printable: '#printContent',
|
|
|
type: 'html',
|
|
@@ -165,6 +348,92 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
+ #printContent {
|
|
|
+ .lgprint-date-picker {
|
|
|
+ font-size: 13px;
|
|
|
+ padding: 0;
|
|
|
+
|
|
|
+ .ant-picker-input > input {
|
|
|
+ font-size: 13px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-picker-suffix {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-select {
|
|
|
+ .ant-select-single .ant-select-selector {
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-select-selection-item {
|
|
|
+ padding-inline-end: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-select-arrow {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .heatNo-item {
|
|
|
+ position: relative;
|
|
|
+ min-width: 100px;
|
|
|
+
|
|
|
+ .op {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ font-size: 18px;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ line-height: 12px;
|
|
|
+ border-radius: 18px;
|
|
|
+ text-align: center;
|
|
|
+ background: #f5f5f5;
|
|
|
+ border: 1px solid #625dfa;
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .jian {
|
|
|
+ right: 0;
|
|
|
+ background-color: rgb(255, 205, 205);
|
|
|
+ border: 1 solid #fa5d5d;
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ .op {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .add-heatNo {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ font-size: 18px;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ line-height: 12px;
|
|
|
+ border-radius: 18px;
|
|
|
+ text-align: center;
|
|
|
+ background: #f5f5f5;
|
|
|
+ border: 1px solid #625dfa;
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .heat-wrapper {
|
|
|
+ &:hover {
|
|
|
+ .add-heatNo {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
@media print {
|
|
|
header,
|
|
|
footer,
|