Commit 8e2cd8af authored by verestrasz's avatar verestrasz

update

parent ba51eeb5
......@@ -86,8 +86,8 @@ export const getGoodCheckList = {
export const onOffSeries = {
url: '/goodsList/onOff',
method: 'PUT',
dealReqData: ({ goodsId, type }) => {
return { goodsId, type }
dealReqData: ({ goodsId, type, preheatEndTime }) => {
return { goodsId, type, preheatEndTime }
}
}
......
......@@ -8,7 +8,8 @@ export const OffShelfType = {
CHECK_FAIL: 6,
OFFERING: 7,
CANCELED: 8,
DRAFT: 9
DRAFT: 9,
PREHEAT: 10
}
export const OffShelfTypeObj = {
......@@ -51,6 +52,10 @@ export const OffShelfTypeObj = {
[OffShelfType.DRAFT]: {
label: '草稿',
color: 'default'
},
[OffShelfType.PREHEAT]: {
label: '预热中',
color: 'default'
}
}
export const IsAppendType = {
......
......@@ -86,6 +86,63 @@
@on-selection-change="changeSelect"
/>
</Card>
<Modal
v-model="detailModal"
:width="400"
@on-ok="OffShelfModalOk"
@on-cancel="detailModal = false"
:title="formData.title"
>
<div class="OffShelfModal">
<div class="content">
<p v-if="formData.type === 2">
商品 {{ formData.name }} 上架{{
formData.date ? "预热" : ""
}}中,确定要下架吗?
</p>
<p v-else>请为商品 {{ formData.name }} 选择上架方式</p>
</div>
<div class="form-content">
<div class="flex-between">
<template v-if="formData.type === 2">
<p v-if="formData.preheatEndTime">
开售时间 : {{ formData.preheatEndTime }}
</p>
</template>
<template v-else>
<Form ref="loginForm" :model="formData">
<FormItem prop="account">
<RadioGroup v-model="formData.type">
<Radio :label="1">立即上架开售</Radio>
</RadioGroup>
</FormItem>
<FormItem prop="password">
<RadioGroup v-model="formData.type">
<Radio :label="10"
>上架预热<span
style="display: inline-block; width: 10px"
></span>
</Radio>
</RadioGroup>
<DatePicker
type="datetime"
format="yyyy-MM-dd HH:mm"
:options="optionsDate"
@on-change="changeFormDataDate"
v-model="formData.date"
placeholder="请选择日期"
style="width: 200px"
></DatePicker>
</FormItem>
</Form>
</template>
</div>
</div>
</div>
</Modal>
</div>
</template>
......@@ -374,7 +431,7 @@ export default {
},
style: {
margin: '5px',
display: ((status == OffShelfType.OFFERING || status == OffShelfType.SHELVES) && !platform) || status == OffShelfType.GROUNDING ? 'inline-block' : 'none'
display: ((status == OffShelfType.OFFERING || status == OffShelfType.SHELVES|| status == OffShelfType.PREHEAT) && !platform) || status == OffShelfType.GROUNDING ? 'inline-block' : 'none'
}
},
status == OffShelfType.OFFERING || status == OffShelfType.SHELVES ? '上 架' : '下 架'
......@@ -438,7 +495,18 @@ export default {
totalSize: 0,
loading: false,
selectList: [],
selectCount: 0
selectCount: 0,
detailModal: false,
formData: {
goodsId: "",
preheatEndTime: "",
date: "",
tiem: "",
type: 1,
title: "",
name: "",
date: "",
},
}
},
methods: {
......@@ -571,20 +639,78 @@ export default {
let goodsId = row.goodsId
let type = row.status == OffShelfType.OFFERING || row.status == OffShelfType.SHELVES ? OffShelfType.GROUNDING : OffShelfType.SHELVES
let title = row.status == OffShelfType.OFFERING || row.status == OffShelfType.SHELVES ? '上架' : '下架'
this.$Modal.confirm({
this.formData = {
title,
content: `确认要${title}名称为 ${row.name} 的商品 ?`,
onOk: () => {
this.api({
apiName: 'onOffSeries',
postdata: { goodsId, type },
success: () => {
this.requestData()
this.$Notice.success({ title: `操作成功!` })
}
})
goodsId,
type,
preheatEndTime: "",
name:row.name,
};
if (row.preheatEndTime && row.status === 10) {
let date = formatTime(row.preheatEndTime, "yyyy-MM-dd hh:mm");
this.formData.preheatEndTime = date;
this.formData.date = new Date(row.preheatEndTime);
}
this.detailModal = true;
// this.$Modal.confirm({
// title,
// content: `确认要${title}名称为 ${row.name} 的商品 ?`,
// onOk: () => {
// this.api({
// apiName: 'onOffSeries',
// postdata: { goodsId, type },
// success: () => {
// this.requestData()
// this.$Notice.success({ title: `操作成功!` })
// }
// })
// }
// })
}
},
OffShelfModalOk() {
if (this.formData.type === 10) {
let date = new Date().getTime();
let flag = true;
if (!this.formData.preheatEndTime) {
this.$Notice.error({ title: `请选择日期` });
flag = false;
}
if (flag) {
let preheatEndTime = new Date(this.formData.preheatEndTime).getTime();
if (preheatEndTime <= date) {
this.$Notice.error({ title: `预热时间不能小于当前时间!` });
flag = false;
}
})
}
if (flag) {
let { goodsId, type, preheatEndTime } = this.formData;
preheatEndTime = new Date(preheatEndTime).getTime();
this.api({
apiName: "onOffSeries",
postdata: { goodsId, type,preheatEndTime },
success: () => {
this.requestData();
this.$Notice.success({ title: `操作成功!` });
},
});
} else {
setTimeout(() => {
this.detailModal = true;
}, 200);
return;
}
} else {
let { goodsId, type } = this.formData;
this.api({
apiName: "onOffSeries",
postdata: { goodsId, type },
success: () => {
this.requestData();
this.$Notice.success({ title: `操作成功!` });
},
});
}
},
handleCancel (row) {
......@@ -605,6 +731,12 @@ export default {
})
}
},
changeFormDataDate(val) {
console.log(val);
this.formData.preheatEndTime = val;
console.log(this.formData);
// this.formData.date = val;
},
handleRecommend (row) {
// return () => {}
}
......
......@@ -48,8 +48,8 @@ module.exports = {
},
// target: 'http://172.22.17.174:8088'
target: 'http://172.22.17.108:8088'
// target: 'https://testadminym.8n.cn/root'
// target: 'http://172.22.17.108:8088'
target: 'https://testadminym.8n.cn/root'
},
'/contact': {
......
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