|
|
@@ -60,14 +60,14 @@
|
|
|
</el-select> </el-form-item
|
|
|
></el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="单据来源" prop="documentSource">
|
|
|
+ <el-form-item label="单据来源" prop="sourceBizNo">
|
|
|
<el-input
|
|
|
placeholder="请选择"
|
|
|
- v-model="formData.extInfo.documentSource"
|
|
|
+ v-model="formData.sourceBizNo"
|
|
|
@click.native="openDocumentSourceDialog"
|
|
|
>
|
|
|
<el-button
|
|
|
- @click="clearDocumentSource"
|
|
|
+ @click="clearSourceBizNo"
|
|
|
slot="append"
|
|
|
icon="el-icon-circle-close"
|
|
|
></el-button>
|
|
|
@@ -204,6 +204,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"
|
|
|
@@ -908,6 +915,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ newColumns: [], // 动态表头
|
|
|
sceneState,
|
|
|
saveLoading: false,
|
|
|
dateVisible: false,
|
|
|
@@ -997,6 +1005,7 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getFieldModel();
|
|
|
this.getListItems();
|
|
|
this.initUserInfo();
|
|
|
if (this.$route.query.id) {
|
|
|
@@ -1006,7 +1015,7 @@
|
|
|
console.log(data);
|
|
|
this.formData.extInfo.assetType = [data.rootCategoryLevelId];
|
|
|
this.formData.bizType = String(data.type);
|
|
|
- this.formData.extInfo.documentSource = data.code;
|
|
|
+ this.formData.sourceBizNo = data.code;
|
|
|
const batchNo = await getCode('lot_number_code');
|
|
|
this.productList = data.detailList.map((item, index) => {
|
|
|
return {
|
|
|
@@ -1041,8 +1050,104 @@
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+ if (this.$route.query.detailId) {
|
|
|
+ storageApi
|
|
|
+ .getInboundDetailsById(this.$route.query.detailId)
|
|
|
+ .then(async (data) => {
|
|
|
+ this.formData.extInfo.assetType = data.extInfo.assetType.split(',');
|
|
|
+ this.formData.bizType = String(data.bizType);
|
|
|
+ this.formData.sourceBizNo = data.bizNo;
|
|
|
+ const batchNo = await getCode('lot_number_code');
|
|
|
+ this.productList = data.outInDetailList.map(
|
|
|
+ (productItem, productIndex) => {
|
|
|
+ return {
|
|
|
+ ...productItem,
|
|
|
+ index: this.productList.length + productIndex,
|
|
|
+ isSave: true,
|
|
|
+ batchNo: batchNo, // 批次号
|
|
|
+ warehouseIds: [productItem.warehouseId], // 仓库Id
|
|
|
+ warehouseNames: [productItem.warehouseName], // 仓库名称
|
|
|
+ outInDetailRecordRequestList:
|
|
|
+ productItem.outInDetailRecordRequestList.map(
|
|
|
+ (packingItem, packingIndex) => {
|
|
|
+ return {
|
|
|
+ ...packingItem,
|
|
|
+ index:
|
|
|
+ this.productList.length +
|
|
|
+ productIndex +
|
|
|
+ '-' +
|
|
|
+ packingIndex, // 包装索引
|
|
|
+ batchNo: batchNo, // 批次号
|
|
|
+ parentIndex: this.productList.length + productIndex, // 物品索引
|
|
|
+ categoryName: productItem.categoryName,
|
|
|
+ categoryCode: productItem.categoryCode,
|
|
|
+ materialDetailList:
|
|
|
+ packingItem.materialDetailList.map(
|
|
|
+ (materialItem, materialIndex) => {
|
|
|
+ return {
|
|
|
+ ...materialItem,
|
|
|
+ index:
|
|
|
+ this.productList.length +
|
|
|
+ productIndex +
|
|
|
+ '-' +
|
|
|
+ packingIndex +
|
|
|
+ '——' +
|
|
|
+ materialIndex, // 包装索引
|
|
|
+ parentIndex:
|
|
|
+ this.productList.length +
|
|
|
+ productIndex +
|
|
|
+ '-' +
|
|
|
+ packingIndex, // 物品索引
|
|
|
+ batchNo: batchNo, // 批次号
|
|
|
+ categoryName: productItem.categoryName,
|
|
|
+ categoryCode: productItem.categoryCode
|
|
|
+ };
|
|
|
+ }
|
|
|
+ )
|
|
|
+ };
|
|
|
+ }
|
|
|
+ )
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ console.log('this.productList-----------', this.productList);
|
|
|
+ // 获取包装维度数据
|
|
|
+ const arr = [];
|
|
|
+ for (const key in this.productList) {
|
|
|
+ for (const k in this.productList[key]
|
|
|
+ .outInDetailRecordRequestList) {
|
|
|
+ arr.push({
|
|
|
+ ...this.productList[key].outInDetailRecordRequestList[k]
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.packingList = arr;
|
|
|
+ // 获取物料维度数据
|
|
|
+ let iArr = [];
|
|
|
+ arr.forEach((item) => {
|
|
|
+ item.materialDetailList.forEach((ele) => {
|
|
|
+ iArr.push({ ...ele });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.materialList = iArr;
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
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 initUserInfo() {
|
|
|
const res = await warehouseDefinition.tree();
|
|
|
@@ -1066,8 +1171,8 @@
|
|
|
console.log('打开单据来源弹窗');
|
|
|
},
|
|
|
// 清除单据来源
|
|
|
- clearDocumentSource() {
|
|
|
- this.formData.extInfo.documentSource = '';
|
|
|
+ clearSourceBizNo() {
|
|
|
+ this.formData.sourceBizNo = '';
|
|
|
},
|
|
|
// 返回
|
|
|
back() {
|
|
|
@@ -1729,6 +1834,8 @@
|
|
|
specification: item.specification, // 规格
|
|
|
brandNum: item.brandNum, // 牌号
|
|
|
batchNo: batchNo, // 批次号
|
|
|
+ approvalNumber: item.approvalNumber, // 批准文号
|
|
|
+ packingSpecification: item.packingSpecification, // 包装规格
|
|
|
minPackingQuantity: '', // 最小包装单元数量
|
|
|
packingQuantity: '', // 包装数量
|
|
|
packingUnit: item.packingUnit, // 包装单位
|