|
|
@@ -21,20 +21,24 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #status="scope">
|
|
|
- <p>团购状态:{{ allTabOptions.find(item => item.name === scope.row.groupType)?.label ?? "--" }}</p>
|
|
|
- <p>审核状态:{{ statusEnum.find(item => item.value === scope.row.reviewType)?.label ?? "--" }}</p> </template
|
|
|
+ <p>团购状态:{{ scope.row.statusName ?? "--" }}</p>
|
|
|
+ <p>审核状态:{{ scope.row.reviewType ?? "--" }}</p> </template
|
|
|
>:
|
|
|
<!-- 表格操作 -->
|
|
|
<template #operation="scope">
|
|
|
<!-- 审批通过和拒绝按钮仅在状态为0时显示 -->
|
|
|
- <template v-if="scope.row.status === '0'">
|
|
|
- <el-button link type="primary" @click="changeTypes(scope.row, 'on')"> 上架 </el-button>
|
|
|
- <el-button link type="primary" @click="changeTypes(scope.row, 'off')"> 下架 </el-button>
|
|
|
- <el-button link type="primary" @click="changeInventory(scope.row)"> 修改库存 </el-button>
|
|
|
- </template>
|
|
|
- <el-button type="primary" link @click="toDetail(scope.row)"> 查看详情 </el-button>
|
|
|
- <el-button link type="primary" @click="editRow(scope.row)"> 编辑 </el-button>
|
|
|
- <el-button link type="primary" @click="deleteRow(scope.row)"> 删除 </el-button>
|
|
|
+ <el-button link type="primary" @click="changeTypes(scope.row, 'on')" v-if="sj.includes(scope.row.status)">
|
|
|
+ 上架
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" @click="changeTypes(scope.row, 'off')" v-if="xj.includes(scope.row.status)">
|
|
|
+ 下架
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" @click="changeInventory(scope.row)" v-if="xgkc.includes(scope.row.status)">
|
|
|
+ 修改库存
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" link @click="toDetail(scope.row)" v-if="ckxq.includes(scope.row.status)"> 查看详情 </el-button>
|
|
|
+ <el-button link type="primary" @click="editRow(scope.row)" v-if="bj.includes(scope.row.status)"> 编辑 </el-button>
|
|
|
+ <el-button link type="primary" @click="deleteRow(scope.row)" v-if="sc.includes(scope.row.status)"> 删除 </el-button>
|
|
|
</template>
|
|
|
</ProTable>
|
|
|
<el-dialog v-model="dialogFormVisible" title="修改库存" width="500">
|
|
|
@@ -93,10 +97,16 @@ const rules = reactive<FormRules<RuleForm>>({
|
|
|
]
|
|
|
});
|
|
|
const statusEnum = [
|
|
|
- { value: "-1", label: "待审核" },
|
|
|
- { value: "-2", label: "审核通过" },
|
|
|
- { value: "0", label: "审核驳回" }
|
|
|
+ { value: "0", label: "待审核" },
|
|
|
+ { value: "1", label: "审核通过" },
|
|
|
+ { value: "2", label: "审核驳回" }
|
|
|
];
|
|
|
+const ckxq = [1, 3, 4, 5, 6, 7];
|
|
|
+const sj = [];
|
|
|
+const xj = [5];
|
|
|
+const xgkc = [5, 4, 7];
|
|
|
+const bj = [0, 3, 4, 7];
|
|
|
+const sc = [0, 3, 4, 5, 7];
|
|
|
|
|
|
// ProTable 实例(需要在使用它的地方之前定义)
|
|
|
const proTable = ref<ProTableInstance>();
|
|
|
@@ -133,7 +143,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
width: 400
|
|
|
},
|
|
|
{
|
|
|
- prop: "goodsId",
|
|
|
+ prop: "saleNum",
|
|
|
label: "已售"
|
|
|
},
|
|
|
{
|
|
|
@@ -148,15 +158,18 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- prop: "goodsId",
|
|
|
+ prop: "costPrice",
|
|
|
label: "成本价",
|
|
|
render: (scope: any) => {
|
|
|
- return `¥${scope.row.originalPrice}`;
|
|
|
+ return `¥${scope.row.costPrice}`;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- prop: "goodsId",
|
|
|
- label: "利润"
|
|
|
+ prop: "profit",
|
|
|
+ label: "利润",
|
|
|
+ render: (scope: any) => {
|
|
|
+ return `¥${scope.row.profit}`;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop: "reviewType",
|