|
@@ -19,6 +19,17 @@
|
|
|
<el-tabs v-model="activeName">
|
|
<el-tabs v-model="activeName">
|
|
|
<el-tab-pane label="物品清单" name="0">
|
|
<el-tab-pane label="物品清单" name="0">
|
|
|
<div class="materialList">
|
|
<div class="materialList">
|
|
|
|
|
+ <div class="u-reset">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ class="u-reset-button"
|
|
|
|
|
+ @click="openPicking(2, 'goods')"
|
|
|
|
|
+ v-if="clientEnvironmentId == 3"
|
|
|
|
|
+ >
|
|
|
|
|
+ 添加
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
<!-- <div class="u-reset" style="display: flex;" v-if="clientEnvironmentId != 2">
|
|
<!-- <div class="u-reset" style="display: flex;" v-if="clientEnvironmentId != 2">
|
|
|
<el-checkbox color="#fff" v-model="checkedAll" :checked="seletedAll" @change="_seletedAll">全选
|
|
<el-checkbox color="#fff" v-model="checkedAll" :checked="seletedAll" @change="_seletedAll">全选
|
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
@@ -192,9 +203,18 @@
|
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
|
>
|
|
>
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
- {{ row.feedQuantity }}
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="row.feedQuantity"
|
|
|
|
|
+ v-if="row.isSelection == '1'"
|
|
|
|
|
+ @input="inputNum(row, $index)"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ <span v-else> {{ row.feedQuantity }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <!-- <template slot-scope="{ row, $index }" v-else>
|
|
|
|
|
+ {{ row.feedQuantity }}
|
|
|
|
|
+ </template> -->
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="重量"
|
|
label="重量"
|
|
|
type="weightUnit"
|
|
type="weightUnit"
|
|
@@ -239,7 +259,7 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="small"
|
|
size="small"
|
|
|
class="u-reset-button"
|
|
class="u-reset-button"
|
|
|
- @click="openPicking(2)"
|
|
|
|
|
|
|
+ @click="openPicking(2, 'belting')"
|
|
|
>
|
|
>
|
|
|
添加
|
|
添加
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -258,6 +278,12 @@
|
|
|
<span>编码</span>{{ item.code }}
|
|
<span>编码</span>{{ item.code }}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <div v-if="clientEnvironmentId == 3">
|
|
|
|
|
+ <el-button type="text" @click="convertList(item, index)"
|
|
|
|
|
+ >转物品清单</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<div
|
|
<div
|
|
|
v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
|
|
v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -324,7 +350,7 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="small"
|
|
size="small"
|
|
|
class="u-reset-button"
|
|
class="u-reset-button"
|
|
|
- @click="openPicking(3)"
|
|
|
|
|
|
|
+ @click="openPicking(3, 'output')"
|
|
|
>
|
|
>
|
|
|
添加
|
|
添加
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -353,10 +379,19 @@
|
|
|
<div class="items content_num">
|
|
<div class="items content_num">
|
|
|
<span>数量</span>
|
|
<span>数量</span>
|
|
|
<input
|
|
<input
|
|
|
- style="width: 90% !important"
|
|
|
|
|
|
|
+ style="width: 30% !important"
|
|
|
v-model="item.demandQuantity"
|
|
v-model="item.demandQuantity"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click="deleteOutput(index)"
|
|
|
|
|
+ style="color: red"
|
|
|
|
|
+ >删除</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</label>
|
|
</label>
|
|
@@ -459,7 +494,8 @@
|
|
|
checkListLen: 0,
|
|
checkListLen: 0,
|
|
|
|
|
|
|
|
warehouseList: [],
|
|
warehouseList: [],
|
|
|
- pickOutInListSelect: []
|
|
|
|
|
|
|
+ pickOutInListSelect: [],
|
|
|
|
|
+ selectionIds: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -499,14 +535,25 @@
|
|
|
// // this.outsourceMaterialFn()
|
|
// // this.outsourceMaterialFn()
|
|
|
// // this.getWarehouseFn()
|
|
// // this.getWarehouseFn()
|
|
|
// },
|
|
// },
|
|
|
- allSelection(e, item) {
|
|
|
|
|
|
|
+ allSelection(e, item, type) {
|
|
|
if (e == 2) {
|
|
if (e == 2) {
|
|
|
- if (item.length) {
|
|
|
|
|
- item.map((v) => {
|
|
|
|
|
- this.bomMaterialList.push(v);
|
|
|
|
|
|
|
+ if (type == 'goods') {
|
|
|
|
|
+ item.map((it) => {
|
|
|
|
|
+ it.isSelection = '1';
|
|
|
|
|
+ it.categoryCode = it.code;
|
|
|
|
|
+ it.feedQuantity = 1;
|
|
|
|
|
+ it.categoryId = it.id;
|
|
|
|
|
+ it.newWeight = it.weight;
|
|
|
|
|
+ this.pickOutInList.push(this.deepCopy(it));
|
|
|
});
|
|
});
|
|
|
|
|
+ this.selectionData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (item.length) {
|
|
|
|
|
+ item.map((v) => {
|
|
|
|
|
+ this.bomMaterialList.push(v);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- console.log(this.bomMaterialList);
|
|
|
|
|
} else if (e == 3) {
|
|
} else if (e == 3) {
|
|
|
if (item.length) {
|
|
if (item.length) {
|
|
|
this.standardOutputList = item;
|
|
this.standardOutputList = item;
|
|
@@ -514,8 +561,34 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- openPicking(id) {
|
|
|
|
|
- this.$refs.pickingListRef.open(id);
|
|
|
|
|
|
|
+ // selectionData(ids) {
|
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
|
+ // this.tableData.forEach((row) => {
|
|
|
|
|
+ // if (ids.includes(row.id)) {
|
|
|
|
|
+ // this.$refs.table.toggleRowSelection(row, true);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
|
|
+ deepCopy(obj, hash = new WeakMap()) {
|
|
|
|
|
+ if (obj === null) return null;
|
|
|
|
|
+ if (obj instanceof Date) return new Date(obj);
|
|
|
|
|
+ if (obj instanceof RegExp) return new RegExp(obj);
|
|
|
|
|
+ if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
|
|
|
|
|
+ if (hash.has(obj)) return hash.get(obj);
|
|
|
|
|
+
|
|
|
|
|
+ const result = Array.isArray(obj) ? [] : {};
|
|
|
|
|
+ hash.set(obj, result);
|
|
|
|
|
+
|
|
|
|
|
+ return Object.keys(obj).reduce((acc, key) => {
|
|
|
|
|
+ acc[key] = this.deepCopy(obj[key], hash);
|
|
|
|
|
+ return acc;
|
|
|
|
|
+ }, result);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ openPicking(id, type) {
|
|
|
|
|
+ this.$refs.pickingListRef.open(id, type);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
outsourceMaterialFn(res) {
|
|
outsourceMaterialFn(res) {
|
|
@@ -525,6 +598,7 @@
|
|
|
this.pickOutInList = _arr.reduce((acc, item) => {
|
|
this.pickOutInList = _arr.reduce((acc, item) => {
|
|
|
const existingItem = acc.find((existing) => existing.id === item.id);
|
|
const existingItem = acc.find((existing) => existing.id === item.id);
|
|
|
if (!existingItem) {
|
|
if (!existingItem) {
|
|
|
|
|
+ item.isSelection = '2';
|
|
|
acc.push(item);
|
|
acc.push(item);
|
|
|
}
|
|
}
|
|
|
return acc;
|
|
return acc;
|
|
@@ -578,6 +652,19 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ inputNum(item, index) {
|
|
|
|
|
+ if (item.feedQuantity) {
|
|
|
|
|
+ const totalWeight = Number(item.feedQuantity) * Number(item.weight);
|
|
|
|
|
+ this.$set(this.pickOutInList[index], 'newWeight', totalWeight);
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$set(this.pickOutInList[index], 'newWeight', item.weight);
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ console.log(this.pickOutInList, 'this.pickOutInList');
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
// 仓库
|
|
// 仓库
|
|
|
getWarehouseFn() {
|
|
getWarehouseFn() {
|
|
|
getWarehouseList().then((res) => {
|
|
getWarehouseList().then((res) => {
|
|
@@ -647,6 +734,30 @@
|
|
|
this.pickOutInListSelect = val;
|
|
this.pickOutInListSelect = val;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ deleteOutput(index) {
|
|
|
|
|
+ this.standardOutputList.splice(index, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ convertList(item, index) {
|
|
|
|
|
+ if (item.demandQuantity) {
|
|
|
|
|
+ item.categoryCode = item.code;
|
|
|
|
|
+ item.feedQuantity = item.demandQuantity;
|
|
|
|
|
+ item.isSelection = '2';
|
|
|
|
|
+ item.categoryId = item.id;
|
|
|
|
|
+ item.newWeight = item.weight;
|
|
|
|
|
+ this.pickOutInList.push(item);
|
|
|
|
|
+ this.selectionData();
|
|
|
|
|
+ this.bomMaterialList.splice(index, 1);
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ selectionData() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.pickOutRef.toggleAllSelection();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
scrolltolower() {},
|
|
scrolltolower() {},
|
|
|
|
|
|
|
|
addPicking(id) {
|
|
addPicking(id) {
|
|
@@ -692,6 +803,16 @@
|
|
|
_pickOutInList = this.pickOutInListSelect;
|
|
_pickOutInList = this.pickOutInListSelect;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ for (let i = 0; i < _pickOutInList.length; i++) {
|
|
|
|
|
+ if (
|
|
|
|
|
+ !_pickOutInList[i].feedQuantity &&
|
|
|
|
|
+ _pickOutInList[i].isSelection == '1'
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.$message.warning('物品数量不能为空');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let param = {
|
|
let param = {
|
|
|
...this.outObj,
|
|
...this.outObj,
|
|
|
isRelease: isRelease,
|
|
isRelease: isRelease,
|
|
@@ -818,4 +939,9 @@
|
|
|
background-color: #f7f9fa;
|
|
background-color: #f7f9fa;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .el-input--medium .el-input__inner {
|
|
|
|
|
+ height: 26px;
|
|
|
|
|
+ line-height: 26px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|