|
|
@@ -183,6 +183,13 @@
|
|
|
prop="brandNum"
|
|
|
:show-overflow-tooltip="true"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in newColumns"
|
|
|
+ :label="item.label"
|
|
|
+ :align="item.align"
|
|
|
+ :prop="item.prop"
|
|
|
+ :show-overflow-tooltip="item.showOverflowTooltip"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
label="批次号"
|
|
|
align="center"
|
|
|
@@ -889,6 +896,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ newColumns: [], // 动态表头
|
|
|
sceneState,
|
|
|
saveLoading: false,
|
|
|
dateVisible: false,
|
|
|
@@ -977,10 +985,25 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getFieldModel();
|
|
|
this.getListItems();
|
|
|
this.initFormData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取动态表头
|
|
|
+ getFieldModel() {
|
|
|
+ storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
|
|
|
+ let newRes = res.map((m) => {
|
|
|
+ return {
|
|
|
+ prop: 'extField.' + m.prop,
|
|
|
+ label: m.label,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.newColumns = [...newRes];
|
|
|
+ });
|
|
|
+ },
|
|
|
// 初始化信息
|
|
|
async initFormData() {
|
|
|
this.formData.type = 1;
|
|
|
@@ -993,40 +1016,49 @@
|
|
|
this.formData.sourceBizNo = this.sourceBizNo;
|
|
|
this.formData.extInfo.supplierName = this.form.supplierName;
|
|
|
this.formData.extInfo.supplierId = this.form.supplierId;
|
|
|
+ console.log('this.detailList---------', this.detailList);
|
|
|
if (this.detailList?.length > 0) {
|
|
|
let codeList = this.detailList.map((item) => {
|
|
|
- return item.productCode;
|
|
|
+ return item.productCode || item.categoryCode;
|
|
|
});
|
|
|
console.log('codeList-----------', codeList);
|
|
|
storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
|
|
|
console.log(res);
|
|
|
const batchNo = await getCode('lot_number_code');
|
|
|
this.productList = res.map((item, index) => {
|
|
|
- let warehouseId = this.detailList.filter(
|
|
|
- (detailItem) => detailItem.productCode == item.code
|
|
|
- )[0].warehouseId;
|
|
|
- let warehouseName = this.detailList.filter(
|
|
|
- (detailItem) => detailItem.productCode == item.code
|
|
|
- )[0].warehouseName;
|
|
|
+ let filtersItem = this.detailList.filter(
|
|
|
+ (detailItem) =>
|
|
|
+ (detailItem.productCode || detailItem.categoryCode) ==
|
|
|
+ item.code
|
|
|
+ )[0];
|
|
|
+ console.log('filtersItem--------', filtersItem);
|
|
|
+ let warehouseId = filtersItem.warehouseId;
|
|
|
+ let warehouseName = filtersItem.warehouseName;
|
|
|
+ let minPackingQuantity =
|
|
|
+ filtersItem.totalCount || filtersItem.packingCount;
|
|
|
+ let measureQuantity =
|
|
|
+ filtersItem.totalCount || filtersItem.packingCount;
|
|
|
+ let packingQuantity = 1;
|
|
|
+ let price = filtersItem.singlePrice;
|
|
|
return {
|
|
|
index: this.productList.length + index,
|
|
|
categoryId: item.id, // 物品id
|
|
|
categoryName: item.name, // 物品名称
|
|
|
categoryCode: item.code, // 物品编码
|
|
|
- categoryModel: item.listSavemodelType, // 物品型号
|
|
|
+ categoryModel: item.modelType, // 物品型号
|
|
|
specification: item.specification, // 规格
|
|
|
brandNum: item.brandNum, // 牌号
|
|
|
batchNo: batchNo, // 批次号
|
|
|
- minPackingQuantity: '', // 最小包装单元数量
|
|
|
- packingQuantity: '', // 包装数量
|
|
|
+ minPackingQuantity: minPackingQuantity, // 最小包装单元数量
|
|
|
+ packingQuantity: packingQuantity, // 包装数量
|
|
|
packingUnit: item.packingUnit, // 包装单位
|
|
|
- measureQuantity: 0, // 计量数量
|
|
|
+ measureQuantity: measureQuantity, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
weight: 0, // 重量
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
totalMoney: '', // 总价
|
|
|
- price: item.price, // 单价
|
|
|
+ price: item.price || price, // 单价
|
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
|
warehouseId, // 仓库id
|
|
|
@@ -1035,6 +1067,9 @@
|
|
|
warehouseNames: [warehouseName]
|
|
|
};
|
|
|
});
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.listSaveArrs();
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -1569,6 +1604,8 @@
|
|
|
specification: item.specification, // 规格
|
|
|
brandNum: item.brandNum, // 牌号
|
|
|
batchNo: batchNo, // 批次号
|
|
|
+ approvalNumber: item.approvalNumber, // 批准文号
|
|
|
+ packingSpecification: item.packingSpecification, // 包装规格
|
|
|
minPackingQuantity: '', // 最小包装单元数量
|
|
|
packingQuantity: '', // 包装数量
|
|
|
packingUnit: item.packingUnit, // 包装单位
|