|
|
@@ -0,0 +1,304 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basicDetails
|
|
|
+ ref="details"
|
|
|
+ :titleText="mainData.itemname"
|
|
|
+ :editData="mainData"
|
|
|
+ :mainAreaData="mainAreaData"
|
|
|
+ turnPageId="2026052209105106"
|
|
|
+ idname="sc_points_productid"
|
|
|
+ ownertable="sc_points_product"
|
|
|
+ tags=""
|
|
|
+ :tabs="['详细信息']"
|
|
|
+ :column="5"
|
|
|
+ @pageChange="pageChange"
|
|
|
+ @onEditSuccess="queryMainData($route.query.id)"
|
|
|
+ >
|
|
|
+ <div slot="tags"></div>
|
|
|
+ <template slot="customOperation">
|
|
|
+ <Edit
|
|
|
+ v-if="mainData.status === '新建'"
|
|
|
+ class="inline-16"
|
|
|
+ title_btn="编辑"
|
|
|
+ title_drawer="编辑积分商品"
|
|
|
+ btn_size="mini"
|
|
|
+ :data="mainData"
|
|
|
+ @onSuccess="queryMainData"
|
|
|
+ ></Edit>
|
|
|
+ <batchUp
|
|
|
+ v-if="
|
|
|
+ mainData.status === '新建' &&
|
|
|
+ mainData.isonsale === 0 &&
|
|
|
+ tool.checkAuth($route.name, 'batchUp')
|
|
|
+ "
|
|
|
+ class="inline-16"
|
|
|
+ :rowData="[mainData]"
|
|
|
+ btnName="上架"
|
|
|
+ btn_size="mini"
|
|
|
+ @batchUpSuccess="queryMainData"
|
|
|
+ ></batchUp>
|
|
|
+ <batchDown
|
|
|
+ v-if="
|
|
|
+ mainData.status === '新建' &&
|
|
|
+ mainData.isonsale === 1 &&
|
|
|
+ tool.checkAuth($route.name, 'batchDown')
|
|
|
+ "
|
|
|
+ class="inline-16"
|
|
|
+ :rowData="[mainData]"
|
|
|
+ btnName="下架"
|
|
|
+ btn_size="mini"
|
|
|
+ @batchUpSuccess="queryMainData"
|
|
|
+ ></batchDown>
|
|
|
+ <toExamine
|
|
|
+ v-if="
|
|
|
+ mainData.status === '新建' &&
|
|
|
+ tool.checkAuth($route.name, 'toExamine')
|
|
|
+ "
|
|
|
+ class="inline-16"
|
|
|
+ :rowData="[mainData]"
|
|
|
+ btnName="审核"
|
|
|
+ btn_size="mini"
|
|
|
+ @examineSuccess="queryMainData"
|
|
|
+ ></toExamine>
|
|
|
+ <counterExamine
|
|
|
+ v-if="
|
|
|
+ mainData.status === '审核' &&
|
|
|
+ tool.checkAuth($route.name, 'reverseReview')
|
|
|
+ "
|
|
|
+ class="inline-16"
|
|
|
+ :rowData="[mainData]"
|
|
|
+ btnName="反审"
|
|
|
+ btn_size="mini"
|
|
|
+ @examineSuccess="queryMainData"
|
|
|
+ ></counterExamine>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ @click="onDelete"
|
|
|
+ size="mini"
|
|
|
+ :loading="deleteLoading"
|
|
|
+ v-if="mainData.status === '新建'"
|
|
|
+ >{{ $t(`删 除`) }}</el-button>
|
|
|
+ </template>
|
|
|
+ <div slot="slot0">
|
|
|
+ <baseInfo
|
|
|
+ v-if="detailInfo"
|
|
|
+ :detailInfo="detailInfo"
|
|
|
+ ></baseInfo>
|
|
|
+ </div>
|
|
|
+ </basicDetails>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Edit from "./add";
|
|
|
+import BaseInfo from "./baseInfo";
|
|
|
+import batchUp from "./batchUp";
|
|
|
+import batchDown from "./batchDown";
|
|
|
+import toExamine from "./toExamine";
|
|
|
+import counterExamine from "./counterExamine";
|
|
|
+export default {
|
|
|
+ name: "detail",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ mainData: {},
|
|
|
+ mainAreaData: {},
|
|
|
+ detailInfo: "",
|
|
|
+ deleteLoading: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ Edit,
|
|
|
+ BaseInfo,
|
|
|
+ batchUp,
|
|
|
+ batchDown,
|
|
|
+ toExamine,
|
|
|
+ counterExamine,
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async queryMainData() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 2026052209105106,
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ sc_points_productid: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.mainData = res.data;
|
|
|
+ this.changeDataStructure();
|
|
|
+ console.log("this.mainData", this.mainData);
|
|
|
+ },
|
|
|
+ changeDataStructure() {
|
|
|
+ this.mainAreaData = [
|
|
|
+ {
|
|
|
+ label: "商品名称",
|
|
|
+ value: this.mainData.itemname,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "商品编号",
|
|
|
+ value: this.mainData.itemno,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "价格",
|
|
|
+ value: this.mainData.price,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "积分",
|
|
|
+ value: this.mainData.points,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "最小订购量",
|
|
|
+ value: this.mainData.orderminqty,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "订购增量",
|
|
|
+ value: this.mainData.orderaddqty,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "单位",
|
|
|
+ value: this.mainData.unitname,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "上架状态",
|
|
|
+ value: this.mainData.isonsale == 1 ? "上架" : "下架",
|
|
|
+ style: () => {
|
|
|
+ let color =
|
|
|
+ this.mainData.isonsale == 1
|
|
|
+ ? this.tool.getStatusColor("上架", true)
|
|
|
+ : this.tool.getStatusColor("下架", true);
|
|
|
+ return { color: color };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "状态",
|
|
|
+ value: this.mainData.status,
|
|
|
+ style: () => {
|
|
|
+ let color = this.tool.getStatusColor(
|
|
|
+ this.mainData.status,
|
|
|
+ true
|
|
|
+ );
|
|
|
+ return { color: color };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.detailInfo = {
|
|
|
+ baseInfo: [
|
|
|
+ {
|
|
|
+ label: "商品名称",
|
|
|
+ value: this.mainData.itemname,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "商品编号",
|
|
|
+ value: this.mainData.itemno,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "积分",
|
|
|
+ value: this.mainData.points,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "价格",
|
|
|
+ value: this.mainData.price,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "最小订购量",
|
|
|
+ value: this.mainData.orderminqty,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "订购增量",
|
|
|
+ value: this.mainData.orderaddqty,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "单位",
|
|
|
+ value: this.mainData.unitname,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "上架状态",
|
|
|
+ value: this.mainData.isonsale == 1 ? "上架" : "下架",
|
|
|
+ style: () => {
|
|
|
+ let color =
|
|
|
+ this.mainData.isonsale == 1
|
|
|
+ ? this.tool.getStatusColor("上架", true)
|
|
|
+ : this.tool.getStatusColor("下架", true);
|
|
|
+ return { color: color };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "状态",
|
|
|
+ value: this.mainData.status,
|
|
|
+ style: () => {
|
|
|
+ let color = this.tool.getStatusColor(
|
|
|
+ this.mainData.status,
|
|
|
+ true
|
|
|
+ );
|
|
|
+ return { color: color };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ value: this.mainData.remarks,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ systemInfo: [
|
|
|
+ { label: "创建人", value: this.mainData.createby },
|
|
|
+ { label: "创建时间", value: this.mainData.createdate },
|
|
|
+ { label: "最近编辑人", value: this.mainData.changeby },
|
|
|
+ { label: "最近编辑时间", value: this.mainData.changedate },
|
|
|
+ { label: "上架人", value: this.mainData.onsaleby },
|
|
|
+ { label: "上架时间", value: this.mainData.onsaledate },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ pageChange(id, rowindex, tabIndex) {
|
|
|
+ this.flag = false;
|
|
|
+ tabIndex = this.$route.query.tabIndex;
|
|
|
+ this.$router.replace({
|
|
|
+ path: "/pointsbasedproductsDetail",
|
|
|
+ query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
|
|
|
+ });
|
|
|
+ this.queryMainData(id);
|
|
|
+ },
|
|
|
+ onDelete() {
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("是否确认删除此积分商品") + "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(async () => {
|
|
|
+ this.deleteLoading = true;
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "2026052209112406",
|
|
|
+ content: {
|
|
|
+ sc_points_productid: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.deleteLoading = false;
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.$message.error(res.data[0].errmsg);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("删除成功"),
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.$store.dispatch("changeDetailDrawer", false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: this.$t("已取消删除"),
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.queryMainData(this.$route.query.id);
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped></style>
|