Commit 40d08b77 authored by liwenhong's avatar liwenhong

fix: 回显上架时间

parent f1815e1f
...@@ -148,7 +148,11 @@ ...@@ -148,7 +148,11 @@
label="上架时间" label="上架时间"
prop="online_start_time" prop="online_start_time"
align="center" align="center"
></el-table-column> >
<template #default="scope">
{{scope.row.online_start_time}} - {{scope.row.online_end_time}}
</template>
</el-table-column>
<!-- 操作快捷键 --> <!-- 操作快捷键 -->
<el-table-column label="操作" align="center" fixed="right" width="200"> <el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope"> <template #default="scope">
...@@ -199,7 +203,7 @@ ...@@ -199,7 +203,7 @@
> >
<el-button <el-button
type="text" type="text"
@click="handleGoodOnline(scope.row.goods_spu_id)" @click="handleGoodOnline(scope.row)"
>上架配置</el-button >上架配置</el-button
> >
</template> </template>
...@@ -439,9 +443,10 @@ export default { ...@@ -439,9 +443,10 @@ export default {
console.log(spuId); console.log(spuId);
this.$router.push({ name: "GoodsDetail", params: { operation, spuId } }); this.$router.push({ name: "GoodsDetail", params: { operation, spuId } });
}, },
handleGoodOnline(id) { handleGoodOnline(item) {
this.addTimeRange = [item.online_start_time, item.online_end_time];
this.showGoodsAddTime = true; this.showGoodsAddTime = true;
this.checkedAddTime.goods_spu_id = id; this.checkedAddTime.goods_spu_id = item.goods_spu_id;
}, },
changeDate(dateA) { changeDate(dateA) {
let time = new Date(dateA).toJSON(); let time = new Date(dateA).toJSON();
...@@ -449,8 +454,10 @@ export default { ...@@ -449,8 +454,10 @@ export default {
return date; return date;
}, },
async handleConfirmRefund() { async handleConfirmRefund() {
if(this.checkedAddTime.online_type == 2) {
this.checkedAddTime.online_start_time = this.changeDate(this.addTimeRange[0]); this.checkedAddTime.online_start_time = this.changeDate(this.addTimeRange[0]);
this.checkedAddTime.online_end_time = this.changeDate(this.addTimeRange[1]); this.checkedAddTime.online_end_time = this.changeDate(this.addTimeRange[1]);
}
let res = await putOnlineSite(this.checkedAddTime); let res = await putOnlineSite(this.checkedAddTime);
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.showGoodsAddTime = false; this.showGoodsAddTime = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment