|
|
@@ -1038,6 +1038,9 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ if (this.$route.query.name == 'inboundRequests') {
|
|
|
+ this.getProduct();
|
|
|
+ }
|
|
|
this.requestDict('不拆物料层规格');
|
|
|
this.getFieldModel();
|
|
|
this.getListItems();
|
|
|
@@ -1047,7 +1050,6 @@
|
|
|
storageApi
|
|
|
.getApplystorageDetailById(this.$route.query.id)
|
|
|
.then(async (data) => {
|
|
|
- console.log(data);
|
|
|
this.formData.extInfo.assetType = [data.rootCategoryLevelId];
|
|
|
this.formData.bizType = String(data.type);
|
|
|
this.formData.sourceBizNo = data.code;
|
|
|
@@ -1261,6 +1263,59 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ //出入库申请列表操作直接入库
|
|
|
+ getProduct() {
|
|
|
+ let aaa = [this.$route.query.inId];
|
|
|
+ console.log(aaa, 'abcabcabcabcabcabcabcabcabc');
|
|
|
+ storageApi.getApplystoragedetails(aaa).then(async (res) => {
|
|
|
+ if (this.$route.query.type == 2) {
|
|
|
+ // 出库
|
|
|
+ let data = await storageApi.getHierarchyFifo({
|
|
|
+ type: 1,
|
|
|
+ builders: res.map((item) => {
|
|
|
+ return {
|
|
|
+ categoryId: item.categoryId,
|
|
|
+ num: item.measureQuantity
|
|
|
+ };
|
|
|
+ })
|
|
|
+ });
|
|
|
+ if (data?.length > 0) {
|
|
|
+ this.outboundRequisitionSelection(data, 1, {
|
|
|
+ sourceBizNo: this.$route.query.code,
|
|
|
+ bizType: this.$route.query.sourceType,
|
|
|
+ assetType: Array.from(
|
|
|
+ new Set(res.map((item) => item.rootCategoryLevelId))
|
|
|
+ ).join(',')
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.warning('该出库申请单无库存');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 入库
|
|
|
+ const batchNo = await getCode('lot_number_code');
|
|
|
+ let data = res.map((item, index) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ index,
|
|
|
+ packingQuantity: 1,
|
|
|
+ minPackingQuantity: item.measureQuantity,
|
|
|
+ measureUnit: item.measuringUnit,
|
|
|
+ batchNo,
|
|
|
+ id: '',
|
|
|
+ warehouseIds: [item.warehouseId],
|
|
|
+ warehouseNames: [item.warehouseName]
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.outboundRequisitionSelection(data, 1, {
|
|
|
+ sourceBizNo: this.$route.query.code,
|
|
|
+ bizType: this.$route.query.sourceType,
|
|
|
+ assetType: Array.from(
|
|
|
+ new Set(res.map((item) => item.rootCategoryLevelId))
|
|
|
+ ).join(',')
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
async outboundRequisitionSelection(data, dimension, query) {
|
|
|
console.log('data-----------', data);
|
|
|
console.log('query-----------', query);
|