@@ -63,6 +63,7 @@ import domToImage from 'dom-to-image';
import html2canvas from 'html2canvas'; // 高清渲染
import { Message } from 'element-ui';
import { PDFDocument } from 'pdf-lib';
+import { getMaterialCoil } from '@/api/wms/coil';
import MaterialTag from './MaterialTag.vue';
import OuterTagPreview from './OuterTagPreview.vue';
@@ -88,6 +89,7 @@ export default {
data() {
return {
labelType: '2',
+ innerContent: {},
tagSizeMap: {
'2': {
width: 100,
@@ -121,7 +123,8 @@ export default {
width: 100,
height: 80,
},
- }
+ },
+ loading: false,
}
},
computed: {
@@ -149,7 +152,22 @@ export default {
watch: {
content: {
handler(newVal) {
- const { itemName, itemType, warehouseId } = newVal;
+ const { itemName, itemType, warehouseId, coilId } = newVal;
+ // 额外查询出合同号和订货单位
+ if (!coilId) {
+ return;
+ }
+ this.loading = true;
+ getMaterialCoil(coilId).then(res => {
+ this.loading = false;
+ this.innerContent = {
+ ...res.data,
+ // 保留前10个字符的订货单位
+ orderUnit: res.data.orderList?.[0]?.customer?.substring(0, 12) || '',
+ contractNumber: res.data.orderList?.[0]?.contractCode || '',
+ } || {};
+ })
+
// 在镀锌原料库或者在镀锌分条原料库的卷使用镀锌原料标签
if (itemType == 'raw_material' && (warehouseId == '1988150263284953089' || warehouseId == '1988150487185289217')) {
this.labelType = '5';