|
|
@@ -56,7 +56,7 @@
|
|
|
<el-option label="物料维度" value="4"> </el-option>
|
|
|
<el-option label="包装维度" value="3"> </el-option>
|
|
|
<el-option label="批次维度" value="2"> </el-option>
|
|
|
- <!-- <el-option label="物品维度" value="1"> </el-option> -->
|
|
|
+ <el-option label="物品维度" value="1"> </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
@@ -160,6 +160,7 @@
|
|
|
</el-aside>
|
|
|
<el-main>
|
|
|
<el-table
|
|
|
+ v-if="isShowTable"
|
|
|
ref="multipleTable"
|
|
|
:data="tableData"
|
|
|
tooltip-effect="dark"
|
|
|
@@ -207,6 +208,31 @@
|
|
|
<template v-else>{{ row[item.prop] }}</template>
|
|
|
</template></el-table-column
|
|
|
>
|
|
|
+ <el-table-column
|
|
|
+ v-if="dimension == 1"
|
|
|
+ label="出库数量"
|
|
|
+ type="index"
|
|
|
+ width="100"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="row.outboundNum"
|
|
|
+ @input="handleInput(row, $event)"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="availableCountBase"
|
|
|
+ label="计量库存数量"
|
|
|
+ width="120"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="measuringUnit"
|
|
|
+ label="计量单位"
|
|
|
+ width="90"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="manualBatchNo"
|
|
|
label="批号"
|
|
|
@@ -269,16 +295,6 @@
|
|
|
v-if="dimension != 4"
|
|
|
width="90"
|
|
|
></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="availableCountBase"
|
|
|
- label="计量库存数量"
|
|
|
- width="120"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="measuringUnit"
|
|
|
- label="计量单位"
|
|
|
- width="90"
|
|
|
- ></el-table-column>
|
|
|
<el-table-column
|
|
|
v-if="dimension == 4"
|
|
|
prop="weight"
|
|
|
@@ -361,7 +377,12 @@
|
|
|
import outin from '@/api/warehouseManagement/outin';
|
|
|
import { login } from '@/api/login';
|
|
|
import { getWarehouseList } from '@/api/classifyManage/itemInformation';
|
|
|
- import { getBatchDetails, getDetailById } from '@/api/classifyManage';
|
|
|
+ import {
|
|
|
+ getBatchDetails,
|
|
|
+ getDetailById,
|
|
|
+ getListByUserId,
|
|
|
+ quantityDelivery
|
|
|
+ } from '@/api/classifyManage';
|
|
|
export default {
|
|
|
components: { AssetTree },
|
|
|
props: {
|
|
|
@@ -383,6 +404,7 @@
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ isShowTable: true,
|
|
|
qualityResultOption: [
|
|
|
{
|
|
|
value: 0,
|
|
|
@@ -423,16 +445,28 @@
|
|
|
selectionList: [],
|
|
|
materialType: '',
|
|
|
warehouseList: [],
|
|
|
- dimension: '4'
|
|
|
+ dimension: '1',
|
|
|
+ isSpareParts: false
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
+ handleInput(row, value) {
|
|
|
+ if (row.outboundNum <= row.availableCountBase) {
|
|
|
+ return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
|
|
|
+ } else {
|
|
|
+ row.outboundNum = row.availableCountBase;
|
|
|
+ }
|
|
|
+ },
|
|
|
changeDimensionHandler(e) {
|
|
|
+ this.isShowTable = false;
|
|
|
// this.$refs.multipleTable.clearSelection();
|
|
|
// this.selectionList = [];
|
|
|
this.pages.pageNum = 1;
|
|
|
this.changeDimension(e);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.isShowTable = true;
|
|
|
+ });
|
|
|
},
|
|
|
async changeDimension(e, is) {
|
|
|
// await this.$refs.multipleTable.clearSelection();
|
|
|
@@ -449,6 +483,12 @@
|
|
|
...this.searchForm,
|
|
|
dimension: e
|
|
|
};
|
|
|
+ if (this.isSpareParts) {
|
|
|
+ let data = await getListByUserId();
|
|
|
+ if (data.length > 0) {
|
|
|
+ params.warehouseIds = data.map((item) => item.id).join(',');
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.materialType) {
|
|
|
params.categoryLevelId = this.materialType;
|
|
|
}
|
|
|
@@ -526,7 +566,8 @@
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
- open() {
|
|
|
+ open(boolen) {
|
|
|
+ this.isSpareParts = !!boolen;
|
|
|
this.visible = true;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.treeList.getTreeData();
|
|
|
@@ -590,13 +631,36 @@
|
|
|
this.$message.error('请至少选择一条数据!');
|
|
|
return;
|
|
|
}
|
|
|
- const data = await this.handleExit(this.selectionList);
|
|
|
+ if (this.dimension == 1) {
|
|
|
+ let boolen = this.selectionList.every((item) => item.outboundNum > 0);
|
|
|
+ if (!boolen) {
|
|
|
+ this.$message.error('请输入出库数量!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let data = null;
|
|
|
+ if (this.dimension == 1) {
|
|
|
+ let params = this.selectionList.map((item) => {
|
|
|
+ return {
|
|
|
+ code: item.assetCode,
|
|
|
+ demandQuantity: item.outboundNum
|
|
|
+ };
|
|
|
+ });
|
|
|
+ data = {
|
|
|
+ realTimeInventoryVOList: await quantityDelivery({
|
|
|
+ orderDTOList: params
|
|
|
+ })
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ data = await this.handleExit(this.selectionList);
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
if (this.dimension == 4) {
|
|
|
arr = this.selectionList.map((item) => {
|
|
|
return { ...item, assetName: item.name };
|
|
|
});
|
|
|
}
|
|
|
+ console.log('data-------------------', data);
|
|
|
this.$emit('detailData', { ...data, wlList: arr }, this.dimension);
|
|
|
|
|
|
// this.$emit('selectTableData', this.selectionList);
|