+
-
+
-
+
-
-
-
-
+
查询
// import AddDiscount from "./popup/add-discount.vue";
// import AddPrice from "./popup/add-price.vue";
+import { mapState } from "vuex";
import AddOrUpdate from "./popup/add-or-update.vue";
import earlyWarning from "./popup/early-warning.vue";
export default {
@@ -137,7 +132,6 @@ export default {
marketId: "",
shopId: "",
},
- marketList: [],
tableProp: {
"auto-resize": true,
border: true,
@@ -169,43 +163,29 @@ export default {
],
productFilterType: "SALE",
selectList: [],
- isShopId: "",
- storeList: [],
};
},
created() {
- if (JSON.parse(sessionStorage.getItem("userInfo")).markets?.length > 0) {
- this.isShopId = true;
- this.formInline.marketId = JSON.parse(
- sessionStorage.getItem("userInfo")
- ).markets[0].marketId;
- this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
- console.log(this.marketList);
- this.getData();
- } else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
- (this.formInline.shopId = JSON.parse(
- sessionStorage.getItem("userInfo")
- ).shopId),
- (this.isShopId = true);
- this.$nextTick(() => {
- this.$refs.oTable.reload();
- });
- } else {
- this.isShopId = false;
- }
+ this.formInline = {
+ marketId: this.marketId,
+ shopId: this.shopId,
+ };
+ this.$nextTick(() => {
+ this.$refs.oTable.reload();
+ });
},
methods: {
- getData() {
- this.$api.mer_admin
- .storeList({ marketId: this.formInline.marketId })
- .then((res) => {
- this.storeList = res.data.data;
- this.formInline.shopId = res.data.data[0].shopId;
- this.$nextTick(() => {
- this.$refs.oTable.reload();
- });
- });
- },
+ // getData() {
+ // this.$api.mer_admin
+ // .storeList({ marketId: this.formInline.marketId })
+ // .then((res) => {
+ // this.storeList = res.data.data;
+ // this.formInline.shopId = res.data.data[0].shopId;
+ // this.$nextTick(() => {
+ // this.$refs.oTable.reload();
+ // });
+ // });
+ // },
addProduct() {
this.$refs.addOrUpdate.toggle().add();
},
@@ -256,8 +236,8 @@ export default {
Reset() {
this.formInline = {
name: "",
- marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0]
- .marketId,
+ marketId: this.marketId,
+ shopId: this.shopId,
};
this.$refs.oTable.reload();
},
@@ -355,6 +335,7 @@ export default {
(item) => item.presalePrice
)
)}
+ 元
);
} else {
@@ -366,13 +347,14 @@ export default {
(item) => item.presalePrice
)
)}
- 至
+ 元 ~
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
- )}
+ )}{" "}
+ 元
);
}
@@ -402,6 +384,7 @@ export default {
(item) => item.earnestMoney
)
)}
+ 元
);
} else {
@@ -412,14 +395,15 @@ export default {
row.productSpecificationList.map(
(item) => item.earnestMoney
)
- )}
- 至
+ )}{" "}
+ 元 ~
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.earnestMoney
)
- )}
+ )}{" "}
+ 元
);
}
@@ -449,6 +433,7 @@ export default {
(item) => item.balancePayment
)
)}
+ 元
);
} else {
@@ -460,13 +445,14 @@ export default {
(item) => item.balancePayment
)
)}
- 至
+ 元 ~
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.balancePayment
)
)}
+ 元
);
}
@@ -555,6 +541,13 @@ export default {
},
};
},
+ ...mapState("userData", [
+ "isMerchant",
+ "marketList",
+ "storeList",
+ "marketId",
+ "shopId",
+ ]),
},
};