|
|
@@ -149,30 +149,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <div class="mt20">
|
|
|
- <headerTitle title="领料单详情"></headerTitle>
|
|
|
- <el-table :data="form.detailList" style="width: 100%">
|
|
|
- <el-table-column prop="code" label="领料单号"> </el-table-column>
|
|
|
- <el-table-column prop="workOrderCode" label="工单编号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="workOrderId" label="工单编号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="categoryCode" label="物品编码">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="categoryName" label="物品名称">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="数量">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- {{ row.demandQuantity }}/{{ row.unit }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="领料仓库">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- {{ row.warehouseName }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
<div>
|
|
|
<el-button
|
|
|
style="margin-bottom: 20px; float: right; margin-right: 20px"
|
|
|
@@ -564,23 +540,20 @@
|
|
|
import { deepClone } from '@/components/FormGenerator/utils/index';
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
|
- import { getPickOrderById } from '@/api/pda';
|
|
|
-
|
|
|
export default {
|
|
|
components: {
|
|
|
selectTree,
|
|
|
AssetsDialog
|
|
|
},
|
|
|
props: {
|
|
|
- // form: { type: Object, default: {} },
|
|
|
+ form: { type: Object, default: {} },
|
|
|
bizType: { type: Number, default: 1 },
|
|
|
- // sourceBizNo: { type: String, default: '' },
|
|
|
+ sourceBizNo: { type: String, default: '' },
|
|
|
type: { type: String, default: '正常出库' },
|
|
|
- // detailList: { type: Array, default: () => [] },
|
|
|
+ detailList: { type: Array, default: () => [] },
|
|
|
saleProductList: { type: Array, default: () => [] },
|
|
|
- // extractedList: { type: Array, default: () => [] },
|
|
|
- // wwType: { type: Number, default: null },
|
|
|
- activeNameProps: { type: Object, default: {} }
|
|
|
+ extractedList: { type: Array, default: () => [] },
|
|
|
+ wwType: { type: Number, default: null }
|
|
|
},
|
|
|
directives: {
|
|
|
'el-table-infinite-scroll': elTableInfiniteScroll
|
|
|
@@ -646,12 +619,7 @@
|
|
|
trigger: 'change'
|
|
|
}
|
|
|
},
|
|
|
- llrLsit: [],
|
|
|
- form: [],
|
|
|
- sourceBizNo: '',
|
|
|
- detailList: [],
|
|
|
- wwType: '',
|
|
|
- extractedList: []
|
|
|
+ llrLsit: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -660,11 +628,10 @@
|
|
|
return this.$store.state.user.info.clientEnvironmentId;
|
|
|
}
|
|
|
},
|
|
|
- async created() {
|
|
|
- await this.getPickOrderDetail();
|
|
|
- await this.getFieldModel();
|
|
|
- await this.getListItems();
|
|
|
- await this.initDeptData().then(() => {
|
|
|
+ created() {
|
|
|
+ this.getFieldModel();
|
|
|
+ this.getListItems();
|
|
|
+ this.initDeptData().then(() => {
|
|
|
this.initFormData();
|
|
|
});
|
|
|
},
|
|
|
@@ -683,27 +650,6 @@
|
|
|
this.newColumns = [...newRes];
|
|
|
});
|
|
|
},
|
|
|
- getPickOrderDetail() {
|
|
|
- getPickOrderById(this.activeNameProps.businessId).then((data) => {
|
|
|
- data.detailList = data.detailList.map((item) => {
|
|
|
- item.code = data.code;
|
|
|
- return item;
|
|
|
- });
|
|
|
- this.wwType = data.type;
|
|
|
- this.extractedList = data.detailList.map((item) => ({
|
|
|
- taskId: item.taskId,
|
|
|
- workOrderId: item.workOrderId
|
|
|
- }));
|
|
|
- let categoryLevelTopIds = data.detailList.map(
|
|
|
- (item) => item.rootCategoryLevelId
|
|
|
- );
|
|
|
- let filterCategoryLevelTopIds = Array.from(
|
|
|
- new Set(categoryLevelTopIds)
|
|
|
- );
|
|
|
- data.categoryLevelTopId = filterCategoryLevelTopIds.join(',');
|
|
|
- this.form = deepClone(data);
|
|
|
- });
|
|
|
- },
|
|
|
userSlected(data) {
|
|
|
this.formData.fromId = data.id;
|
|
|
this.formData.fromUser = data.name;
|
|
|
@@ -716,6 +662,7 @@
|
|
|
console.log('清空');
|
|
|
},
|
|
|
pickingHandleScroll() {
|
|
|
+ console.log('---------pickingHandleScroll------------');
|
|
|
if (this.showPackingList.length < this.packingList.length) {
|
|
|
if (this.packingList.length > this.pageSize) {
|
|
|
this.pickingPageNum += 1;
|
|
|
@@ -731,6 +678,7 @@
|
|
|
);
|
|
|
},
|
|
|
materielHandleScroll() {
|
|
|
+ console.log('---------materielHandleScroll------------');
|
|
|
if (this.showMaterialList.length < this.materialList.length) {
|
|
|
if (this.materialList.length > this.pageSize) {
|
|
|
this.materielPageNum += 1;
|
|
|
@@ -744,6 +692,7 @@
|
|
|
this.showMaterialList = this.showMaterialList.concat(
|
|
|
this.materialList.slice(start, end)
|
|
|
);
|
|
|
+ console.log(this.showMaterialList);
|
|
|
},
|
|
|
// 获取物品列表
|
|
|
async getListItems() {
|
|
|
@@ -772,15 +721,15 @@
|
|
|
return {
|
|
|
...packingItem,
|
|
|
workOrderId:
|
|
|
- this.activeNameProps.type === '自选领用出库'
|
|
|
+ this.type === '自选领用出库'
|
|
|
? this.form.detailList[0].workOrderId
|
|
|
: '',
|
|
|
pickOrderId:
|
|
|
- this.activeNameProps.type === '自选领用出库'
|
|
|
+ this.type === '自选领用出库'
|
|
|
? this.form.detailList[0].pickOrderId
|
|
|
: '',
|
|
|
taskId:
|
|
|
- this.activeNameProps.type === '自选领用出库'
|
|
|
+ this.type === '自选领用出库'
|
|
|
? this.form.detailList[0].taskId
|
|
|
: '',
|
|
|
categoryName: productItem.categoryName,
|
|
|
@@ -820,7 +769,9 @@
|
|
|
},
|
|
|
async getReturnStorage() {
|
|
|
return new Promise((resolve) => {
|
|
|
+ console.log(this.formData);
|
|
|
this.$refs.formName.validate(async (valid) => {
|
|
|
+ console.log('valid', valid);
|
|
|
if (valid) {
|
|
|
if (!this.productList?.length) {
|
|
|
return this.$message.error('请添加出库明细!');
|
|
|
@@ -848,6 +799,7 @@
|
|
|
});
|
|
|
obj.warehouseIds = warehouseId;
|
|
|
obj.warehouseNames = warehouseName;
|
|
|
+ console.log('2222', obj);
|
|
|
let isPass = false;
|
|
|
// 1按数量计费 2按重量计费
|
|
|
if (this.form.pricingWay == 2) {
|
|
|
@@ -919,9 +871,6 @@
|
|
|
});
|
|
|
},
|
|
|
// 初始化用户信息
|
|
|
- /**
|
|
|
- * 异步初始化表单数据
|
|
|
- */
|
|
|
async initFormData() {
|
|
|
// const res = await warehouseDefinition.tree();
|
|
|
// let obj = res.find(
|
|
|
@@ -934,21 +883,22 @@
|
|
|
// this.formData.extInfo.deptName = obj.name;
|
|
|
// this.formData.extInfo.createUserName = this.user.info.name;
|
|
|
// this.formData.createUserId = this.user.info.userId;
|
|
|
+
|
|
|
// 物品类型
|
|
|
this.formData.extInfo.assetType = Array.from(
|
|
|
- new Set(this.form.categoryLevelTopId?.split(','))
|
|
|
+ new Set(this.form.categoryLevelTopId.split(','))
|
|
|
);
|
|
|
// 出库类型
|
|
|
- this.formData.bizType = this.activeNameProps.bizType;
|
|
|
+ this.formData.bizType = this.bizType;
|
|
|
// 添加单据来源
|
|
|
- this.formData.sourceBizNo = this.form.code;
|
|
|
+ this.formData.sourceBizNo = this.sourceBizNo;
|
|
|
// 将出库状态改成出库状态 2出库 1入库
|
|
|
this.formData.type = 2;
|
|
|
// 入库登记人
|
|
|
this.formData.extInfo.createUserName = this.$store.state.user.info.name;
|
|
|
this.formData.createUserId = this.$store.state.user.info.userId;
|
|
|
// 生产相关逻辑
|
|
|
- if (this.form.detailList?.length > 0) {
|
|
|
+ if (this.detailList?.length > 0) {
|
|
|
// 获取领料人列表
|
|
|
this.getStaffList({ id: this.form.executorDeptId }).then(() => {
|
|
|
// 获取领料人和领料部门
|
|
|
@@ -959,7 +909,7 @@
|
|
|
});
|
|
|
let pData = {
|
|
|
type: '1',
|
|
|
- builders: this.form.detailList.map((item) => {
|
|
|
+ builders: this.detailList.map((item) => {
|
|
|
return {
|
|
|
categoryId: item.instanceId || item.categoryId,
|
|
|
num: item.demandQuantity
|
|
|
@@ -969,11 +919,7 @@
|
|
|
let pData2 = {
|
|
|
type: this.wwType,
|
|
|
taskIds: this.extractedList.map((item) => item.taskId),
|
|
|
- workOrderIds: this.extractedList.map((item) => item.workOrderId),
|
|
|
- outsourceBatchNos: this.extractedList.map(
|
|
|
- (item) => item.outsourceBatchNo
|
|
|
- ),
|
|
|
- outsourceCodes: this.extractedList.map((item) => item.outsourceCode)
|
|
|
+ workOrderIds: this.extractedList.map((item) => item.workOrderId)
|
|
|
};
|
|
|
storageApi
|
|
|
.getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
|
|
|
@@ -987,11 +933,11 @@
|
|
|
// 销售相关逻辑
|
|
|
if (this.saleProductList?.length > 0) {
|
|
|
// 获取领料人列表
|
|
|
- this.getStaffList({ id: this.form.executorDeptId }).then(() => {
|
|
|
+ this.getStaffList({ id: this.form.deptId }).then(() => {
|
|
|
// 获取领料人和领料部门
|
|
|
this.formData.fromId = this.form.makerId;
|
|
|
this.formData.fromUser = this.form.makerName;
|
|
|
- this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
|
|
|
+ this.formData.extInfo.verifyDeptCode = this.form.deptId;
|
|
|
this.formData.extInfo.verifyDeptName = this.form.deptName;
|
|
|
});
|
|
|
let pData = {
|
|
|
@@ -1006,11 +952,7 @@
|
|
|
let pData2 = {
|
|
|
type: this.wwType,
|
|
|
taskIds: this.extractedList.map((item) => item.taskId),
|
|
|
- workOrderIds: this.extractedList.map((item) => item.workOrderId),
|
|
|
- outsourceBatchNos: this.extractedList.map(
|
|
|
- (item) => item.outsourceBatchNo
|
|
|
- ),
|
|
|
- outsourceCodes: this.extractedList.map((item) => item.outsourceCode)
|
|
|
+ workOrderIds: this.extractedList.map((item) => item.workOrderId)
|
|
|
};
|
|
|
storageApi
|
|
|
.getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
|
|
|
@@ -1037,6 +979,7 @@
|
|
|
});
|
|
|
},
|
|
|
addStock() {
|
|
|
+ console.log(this.formData.extInfo.assetType);
|
|
|
if (
|
|
|
!(
|
|
|
this.formData.extInfo.assetType &&
|
|
|
@@ -1059,6 +1002,8 @@
|
|
|
watch: {
|
|
|
packingList: {
|
|
|
handler(newVal) {
|
|
|
+ console.log('包装列表', newVal);
|
|
|
+ console.log('当前包装列表加载页数', this.pickingPageNum);
|
|
|
this.showPackingList = newVal.slice(
|
|
|
0,
|
|
|
this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
|
|
|
@@ -1068,6 +1013,8 @@
|
|
|
},
|
|
|
materialList: {
|
|
|
handler(newVal) {
|
|
|
+ console.log('物料列表', newVal);
|
|
|
+ console.log('当前物料列表加载页数', this.materielPageNum);
|
|
|
this.showMaterialList = newVal.slice(
|
|
|
0,
|
|
|
this.pageSize *
|