|
@@ -84,7 +84,6 @@
|
|
|
>
|
|
|
<el-form-item>
|
|
|
<el-table
|
|
|
- style="width: 1400px"
|
|
|
:data="form.storeGoodsList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
row-key="id"
|
|
@@ -94,8 +93,24 @@
|
|
|
<el-table-column label="分类" align="center" prop="categoryName" />
|
|
|
<el-table-column label="规格计量单位" align="center" prop="spuUnit" />
|
|
|
<el-table-column label="skuId" align="center" prop="skuId" />
|
|
|
- <el-table-column label="规格名称" align="center" prop="skuSpecName" />
|
|
|
- <el-table-column label="规格内容" align="center" prop="skuSpecName" />
|
|
|
+ <el-table-column label="规格名称" align="center" prop="skuSpecName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.skuSpecName
|
|
|
+ ? JSON.parse(scope.row.skuSpecName)[0].specsName
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="规格内容" align="center" prop="skuSpecName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.skuSpecName
|
|
|
+ ? JSON.parse(scope.row.skuSpecName)[0].specsValue
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="单位换算" align="center" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex; flex-direction: row; align-items: center">
|
|
@@ -110,7 +125,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="浮动重量" align="center">
|
|
|
+ <el-table-column label="浮动重量" align="center" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
v-model="scope.row.floatingWeight"
|
|
@@ -121,7 +136,7 @@
|
|
|
</el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="入库数量" align="center">
|
|
|
+ <el-table-column label="入库数量" align="center" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
v-model="scope.row.storeNum"
|
|
@@ -132,7 +147,7 @@
|
|
|
</el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="入库单价" align="center">
|
|
|
+ <el-table-column label="入库单价" align="center" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
v-model="scope.row.storeUnitPrice"
|
|
@@ -143,15 +158,16 @@
|
|
|
</el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="销售单价" align="center" width="120">
|
|
|
+ <el-table-column label="销售单价" align="center" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
+ {{ scope.row.salePrice }}元/{{ scope.row.spuUnit }}
|
|
|
+ <!-- <el-input
|
|
|
v-model="scope.row.salePrice"
|
|
|
clearable
|
|
|
oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
>
|
|
|
- <span slot="suffix"> 元/{{ scope.row.spuUnit }}</span>
|
|
|
- </el-input>
|
|
|
+ <span slot="suffix"> </span>
|
|
|
+ </el-input> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -334,11 +350,11 @@
|
|
|
<el-table-column label="商品状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- scope.row.skuStatus == 2
|
|
|
+ scope.row.spuStatus == 2
|
|
|
? "售罄"
|
|
|
- : scope.row.skuStatus == 0
|
|
|
+ : scope.row.spuStatus == 0
|
|
|
? "上架"
|
|
|
- : scope.row.skuStatus == 1
|
|
|
+ : scope.row.spuStatus == 1
|
|
|
? "下架"
|
|
|
: ""
|
|
|
}}
|
|
@@ -367,7 +383,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { getClassificationListPage } from "@/api/common/index";
|
|
|
-import { getStoreGoodsListByShopId, storeManageSave } from "@/api/manage/storage";
|
|
|
+import {
|
|
|
+ getStoreGoodsListByShopId,
|
|
|
+ storeManageSave,
|
|
|
+ getSkuMsgBySpuId,
|
|
|
+} from "@/api/manage/storage";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -454,19 +474,38 @@ export default {
|
|
|
this.form.storeGoodsList.splice(index, 1);
|
|
|
},
|
|
|
dialogOk() {
|
|
|
+ if (this.multipleSelection.length < 1) {
|
|
|
+ this.$message.error("请选择入库商品");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.dialogVisible = false;
|
|
|
console.log("this.", this.multipleSelection);
|
|
|
+ let ids = [];
|
|
|
+
|
|
|
for (let index = 0; index < this.multipleSelection.length; index++) {
|
|
|
- let params = {
|
|
|
- unitConversion: "",
|
|
|
- floatingWeight: "",
|
|
|
- storeNum: "",
|
|
|
- storeUnitPrice: "",
|
|
|
- };
|
|
|
- let obj = { ...this.multipleSelection[index], ...params };
|
|
|
- this.form.storeGoodsList.push(obj);
|
|
|
+ ids.push(this.multipleSelection[index].spuId);
|
|
|
}
|
|
|
- console.log(this.form.storeGoodsList);
|
|
|
+
|
|
|
+ getSkuMsgBySpuId(ids).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ res.data.forEach((e) => {
|
|
|
+ let params = {
|
|
|
+ unitConversion: "",
|
|
|
+ floatingWeight: "",
|
|
|
+ storeNum: "",
|
|
|
+ storeUnitPrice: "",
|
|
|
+ };
|
|
|
+ let obj = { ...e, ...params };
|
|
|
+ this.form.storeGoodsList.push(obj);
|
|
|
+ });
|
|
|
+ this.form.storeGoodsList = this.unique(this.form.storeGoodsList);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ unique(arr) {
|
|
|
+ const res = new Map();
|
|
|
+ return arr.filter((arr) => !res.has(arr.skuId) && res.set(arr.skuId, 1));
|
|
|
},
|
|
|
|
|
|
handleSelectionChange(val) {
|