|
|
@@ -34,7 +34,7 @@
|
|
|
<el-form-item label="领料人部门" prop="extInfo.verifyDeptCode">
|
|
|
<selectTree ref="tree" class="form-ipt" size="medium" style="width: 100%"
|
|
|
:value="formData.extInfo.verifyDeptCode" clearable :options="treeList" :props="{
|
|
|
- value: 'code',
|
|
|
+ value: 'id',
|
|
|
label: 'name',
|
|
|
children: 'children'
|
|
|
}" @getValue="auditorDeptClick" />
|
|
|
@@ -227,7 +227,8 @@
|
|
|
</div> -->
|
|
|
</div>
|
|
|
<div class="center mt20">
|
|
|
- <el-button type="primary" @click="handleSave" :loading="saveLoading">保存</el-button>
|
|
|
+ <el-button type="primary" @click="handleSave('save')" :loading="saveLoading">保存</el-button>
|
|
|
+ <el-button type="primary" @click="handleSave" :loading="saveLoading">出库</el-button>
|
|
|
<el-button @click="$router.go(-1)">返回</el-button>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -356,6 +357,10 @@ export default {
|
|
|
this.$refs.outboundRequisitionDialogRef.handleMine([queryObj]);
|
|
|
});
|
|
|
}
|
|
|
+ console.log(queryObj,'queryObj.detailId')
|
|
|
+ if (queryObj.detailId) {
|
|
|
+ this._getInfo(queryObj.detailId)
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
outboundRequisitionSelection(data, dimension, query) {
|
|
|
@@ -438,6 +443,72 @@ export default {
|
|
|
return '';
|
|
|
}
|
|
|
},
|
|
|
+ // getDeptName() {
|
|
|
+ // if (this.formData?.extInfo?.createUserId) {
|
|
|
+ // storageApi.getGroupById(this.formData.extInfo.createUserId).then((res) => {
|
|
|
+ // this.formData.extInfo.deptName = res?.groupName
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ async _getInfo(detailId) {
|
|
|
+ let res=await storageApi.getInboundDetailsById(detailId);
|
|
|
+
|
|
|
+ this.formData = res;
|
|
|
+ this.formData.extInfo.assetType = res.extInfo?.assetType?.split(',');
|
|
|
+ this.formData.bizType = res.bizType+''
|
|
|
+ console.log(this.formData.extInfo,'')
|
|
|
+ this.auditorDeptClick({
|
|
|
+ id:this.formData.extInfo?.verifyDeptCode,
|
|
|
+ name:this.formData.extInfo?.verifyDeptName
|
|
|
+ })
|
|
|
+ // this.getDeptName()
|
|
|
+ this.productList = res.outInDetailList.map(
|
|
|
+ (productItem, productIndex) => {
|
|
|
+ return {
|
|
|
+ ...productItem,
|
|
|
+ outInDetailRecordRequestList:
|
|
|
+ productItem.outInDetailRecordRequestList.map((packingItem) => {
|
|
|
+ return {
|
|
|
+ ...packingItem,
|
|
|
+ categoryName: productItem.categoryName,
|
|
|
+ categoryCode: productItem.categoryCode,
|
|
|
+ materialDetailList: packingItem.materialDetailList.map(
|
|
|
+ (materialItem) => {
|
|
|
+ return {
|
|
|
+ ...materialItem,
|
|
|
+ categoryName: productItem.categoryName,
|
|
|
+ categoryCode: productItem.categoryCode
|
|
|
+ };
|
|
|
+ }
|
|
|
+ )
|
|
|
+ };
|
|
|
+ })
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ // 获取包装维度数据
|
|
|
+ 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;
|
|
|
+ console.log(this.packingList);
|
|
|
+ console.log(this.materialList);
|
|
|
+ this.pickingFetchData();
|
|
|
+ this.materielFetchData();
|
|
|
+ },
|
|
|
detailData(data, dimension) {
|
|
|
this.dimension = dimension;
|
|
|
|
|
|
@@ -543,7 +614,7 @@ export default {
|
|
|
this.materielFetchData();
|
|
|
|
|
|
},
|
|
|
- handleSave() {
|
|
|
+ handleSave(type) {
|
|
|
this.$refs.formName.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
if (!this.productList?.length) {
|
|
|
@@ -573,13 +644,22 @@ export default {
|
|
|
});
|
|
|
obj.warehouseIds = warehouseId;
|
|
|
obj.warehouseNames = warehouseName;
|
|
|
- console.log('2222', obj);
|
|
|
+
|
|
|
try {
|
|
|
- const res = await storageApi.outStorage(obj);
|
|
|
+ let api=obj.id?storageApi.outUpdate:storageApi.outStorage
|
|
|
+ const res = await api(obj);
|
|
|
+
|
|
|
if (res.code == 0) {
|
|
|
- await storageApi.submitInsideTwo({ outInIds: res.data });
|
|
|
+
|
|
|
+ if(type!='save'){
|
|
|
+ await storageApi.submitInsideTwo({ outInIds: res.data });
|
|
|
+ this.$message.success('出库成功!');
|
|
|
+ }else{
|
|
|
+ this.$message.success('保存成功!');
|
|
|
+
|
|
|
+ }
|
|
|
this.$router.push('/warehouseManagement/outgoingManagement');
|
|
|
- this.$message.success('保存成功!');
|
|
|
+
|
|
|
}
|
|
|
this.saveLoading = false;
|
|
|
} catch (error) {
|
|
|
@@ -616,6 +696,9 @@ export default {
|
|
|
console.log(data);
|
|
|
this.formData.extInfo.verifyDeptCode = data?.id;
|
|
|
this.formData.extInfo.verifyDeptName = data?.name;
|
|
|
+ this.$set(this.formData.extInfo,'verifyDeptCode',data?.id)
|
|
|
+ this.$set(this.formData.extInfo,'verifyDeptName',data?.name)
|
|
|
+
|
|
|
this.formData.verifyId = '';
|
|
|
this.formData.verifyName = '';
|
|
|
this.$refs.formName.validateField('verifyDeptName');
|